mirror of
https://github.com/atom/atom.git
synced 2026-02-04 11:45:16 -05:00
Use _.indexOf instead of _.contains
_.indexOf supports a isSorted flag which can be used since the extension arrays are pre-sorted.
This commit is contained in:
@@ -152,35 +152,33 @@ module.exports =
|
||||
undefined
|
||||
|
||||
isCompressedExtension: (ext) ->
|
||||
_.contains([
|
||||
_.indexOf([
|
||||
'.gz'
|
||||
'.jar'
|
||||
'.tar'
|
||||
'.zip'
|
||||
], ext)
|
||||
], ext, true) >= 0
|
||||
|
||||
isImageExtension: (ext) ->
|
||||
_.contains([
|
||||
_.indexOf([
|
||||
'.gif'
|
||||
'.jpeg'
|
||||
'.jpg'
|
||||
'.png'
|
||||
'.tiff'
|
||||
], ext)
|
||||
], ext, true) >= 0
|
||||
|
||||
isPdfExtension: (ext) ->
|
||||
_.contains([
|
||||
'.pdf'
|
||||
], ext)
|
||||
ext is '.pdf'
|
||||
|
||||
isMarkdownExtension: (ext) ->
|
||||
_.contains([
|
||||
_.indexOf([
|
||||
'.markdown'
|
||||
'.md'
|
||||
'.mkd'
|
||||
'.mkdown'
|
||||
'.ron'
|
||||
], ext)
|
||||
], ext, true) >= 0
|
||||
|
||||
readObject: (path) ->
|
||||
contents = @read(path)
|
||||
|
||||
Reference in New Issue
Block a user