bare-module-traverse 1.8.0 → 1.8.2

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 +3 -7
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -320,11 +320,7 @@ exports.preresolved = function* (url, source, resolutions, artifacts, visited, o
320
320
 
321
321
  exports.imports = function* (parentURL, source, imports, artifacts, lexer, visited, opts = {}) {
322
322
  // Handle backwards compatibility with the `target` option
323
- if (opts.target) {
324
- const { target, ...rest } = opts
325
- rest.hosts = target
326
- opts = rest
327
- }
323
+ if (opts.target) opts = { ...opts, hosts: opts.target }
328
324
 
329
325
  const {
330
326
  resolve = exports.resolve.default,
@@ -421,10 +417,10 @@ exports.imports = function* (parentURL, source, imports, artifacts, lexer, visit
421
417
  if (source !== null) {
422
418
  addResolution(imports, specifier, matchedConditions, url)
423
419
 
424
- const attributes = entry.attributes
420
+ let attributes = entry.attributes
425
421
 
426
422
  if (attributes.imports) {
427
- attributes.imports = imports[attributes.imports].default
423
+ attributes = { ...attributes, imports: imports[attributes.imports].default }
428
424
  }
429
425
 
430
426
  yield {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bare-module-traverse",
3
- "version": "1.8.0",
3
+ "version": "1.8.2",
4
4
  "description": "Low-level module graph traversal for Bare",
5
5
  "exports": {
6
6
  ".": {