bare-module-traverse 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +14 -3
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -299,9 +299,20 @@ exports.imports = function* (
299
299
  matchedConditions.pop()
300
300
 
301
301
  if (resolutions === 0) {
302
- throw errors.ADDON_NOT_FOUND(
303
- `Cannot find ${condition === 'default' ? 'module' : condition} '${specifier}' imported from '${parentURL.href}'`
304
- )
302
+ switch (condition) {
303
+ case 'addon':
304
+ throw errors.ADDON_NOT_FOUND(
305
+ `Cannot find addon '${specifier}' imported from '${parentURL.href}'`
306
+ )
307
+ case 'asset':
308
+ throw errors.ASSET_NOT_FOUND(
309
+ `Cannot find asset '${specifier}' imported from '${parentURL.href}'`
310
+ )
311
+ default:
312
+ throw errors.MODULE_NOT_FOUND(
313
+ `Cannot find module '${specifier}' imported from '${parentURL.href}'`
314
+ )
315
+ }
305
316
  }
306
317
  }
307
318
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bare-module-traverse",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "Low-level module graph traversal for Bare",
5
5
  "exports": {
6
6
  ".": "./index.js",