mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-11 11:15:24 +03:00
use Array.prototype.some where corey wanted to use _.detect
This commit is contained in:
parent
f2e7d55a22
commit
c57a8d8112
@ -59,16 +59,11 @@ resolve = (file) ->
|
||||
throw "require: ../ prefix not yet implemented"
|
||||
|
||||
if file[0] isnt '/'
|
||||
# I want to use _.detect, but we don't have that at this point
|
||||
# or break would do, but coffeescript doesn't have that
|
||||
expandedPath = null
|
||||
paths.forEach (path) ->
|
||||
paths.some (path) ->
|
||||
if /\.(.+)$/.test(file) and __exists "#{path}/#{file}"
|
||||
expandedPath ?= "#{path}/#{file}"
|
||||
else
|
||||
expandedPath ?= expandPath("#{path}/#{file}")
|
||||
|
||||
file = expandedPath if expandedPath?
|
||||
file = "#{path}/#{file}"
|
||||
else if expanded = expandPath "#{path}/#{file}"
|
||||
file = expanded
|
||||
else
|
||||
file = expandPath(file) or file
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user