module-lookup-amd
Advanced tools
Comparing version 4.0.0 to 4.0.1
16
index.js
@@ -82,9 +82,15 @@ var ConfigFile = require('requirejs-config-file').ConfigFile; | ||
var results = find.fileSync(new RegExp(pattern), fileDir); | ||
try { | ||
var results = find.fileSync(new RegExp(pattern), fileDir); | ||
debug('found the following matches: ', results.join('\n')); | ||
debug('found the following matches: ', results.join('\n')); | ||
// Not great if there are multiple matches, but the pattern should be | ||
// specific enough to prevent multiple results | ||
return results[0]; | ||
// Not great if there are multiple matches, but the pattern should be | ||
// specific enough to prevent multiple results | ||
return results[0]; | ||
} catch (e) { | ||
debug('error when looking for a match: ' + e.message); | ||
return ''; | ||
} | ||
} | ||
@@ -91,0 +97,0 @@ |
{ | ||
"name": "module-lookup-amd", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"description": "Resolve aliased dependency paths using a RequireJS config", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -154,2 +154,12 @@ var assert = require('assert'); | ||
it('does not throw if the partial doesn\'t resolve to a file', function() { | ||
assert.doesNotThrow(() => { | ||
lookup({ | ||
config, | ||
partial: 'foo/bar', | ||
filename: `${directory}/subdir/a.js`, | ||
}); | ||
}); | ||
}); | ||
describe('when no baseUrl is in the config', function() { | ||
@@ -156,0 +166,0 @@ describe('and a configPath is supplied', function() { |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
13092
325
0