mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-19 06:00:56 -05:00
Improve check for local URLs in paper.resolvePath()
This commit is contained in:
parent
7cf844886f
commit
ae9ff56260
1 changed files with 1 additions and 1 deletions
|
@ -294,7 +294,7 @@ var PaperScope = Base.extend(/** @lends PaperScope# */{
|
|||
|
||||
resolvePath: function(url) {
|
||||
// On Node.js, resolve relative URLs to local files:
|
||||
return this.agent.node && !/^(?:[a-z]+:)?\/\//i.test(url)
|
||||
return url && this.agent.node && !/^[a-z]+:/i.test(url)
|
||||
? 'file://' + require('path').resolve(url) : url;
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue