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:
Kevin Sawicki 2013-02-04 09:06:35 -08:00
parent 84feaf369d
commit 0bb0863b61

View File

@ -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)