mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-11 04:48:44 +03: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:
parent
84feaf369d
commit
0bb0863b61
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user