browser-ava 1.3.37 → 1.3.39

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.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  [![npm](https://img.shields.io/npm/v/browser-ava.svg)](https://www.npmjs.com/package/browser-ava)
2
2
  [![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
3
- [![Open Bundle](https://bundlejs.com/badge-light.svg)](https://bundlejs.com/?q=browser-ava)
3
+ [![bundlejs](https://deno.bundlejs.com/?q=browser-ava\&badge=detailed)](https://bundlejs.com/?q=browser-ava)
4
4
  [![downloads](http://img.shields.io/npm/dm/browser-ava.svg?style=flat-square)](https://npmjs.org/package/browser-ava)
5
5
  [![GitHub Issues](https://img.shields.io/github/issues/arlac77/browser-ava.svg?style=flat-square)](https://github.com/arlac77/browser-ava/issues)
6
6
  [![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Farlac77%2Fbrowser-ava%2Fbadge\&style=flat)](https://actions-badge.atrox.dev/arlac77/browser-ava/goto)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "browser-ava",
3
- "version": "1.3.37",
3
+ "version": "1.3.39",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -41,7 +41,7 @@
41
41
  "ava": "^5.2.0",
42
42
  "c8": "^7.13.0",
43
43
  "execa": "^7.1.1",
44
- "semantic-release": "^21.0.1"
44
+ "semantic-release": "^21.0.2"
45
45
  },
46
46
  "engines": {
47
47
  "node": ">=16.20.0"
package/src/resolver.mjs CHANGED
@@ -16,8 +16,8 @@ const importsConditionOrder = ["browser", "default"];
16
16
  const exportsConditionOrder = ["browser", "module", "import", ".", "default"];
17
17
 
18
18
  /**
19
- * find module inside a package
20
- * @param {string} parts
19
+ * Find module inside a package.
20
+ * @param {string[]} parts
21
21
  * @param {Object} pkg package.json content
22
22
  * @returns {string|undefined} module file name relative to package
23
23
  */
@@ -84,18 +84,22 @@ async function findPackage(path) {
84
84
  }
85
85
 
86
86
  /**
87
- * Maps import url from node to browser view.
87
+ * Maps import url from node to browser view.
88
88
  * @param {string} name module to resolve
89
- * @param {string} file where to start resolving (base)
89
+ * @param {string} base where to start resolving
90
90
  * @returns {Promise<string>} resolved import url
91
91
  */
92
- export async function resolveImport(name, file) {
92
+ export async function resolveImport(name, base) {
93
93
  if (name.match(/^[\/\.]/)) {
94
- return resolve(dirname(file), name);
94
+ return resolve(dirname(base), name);
95
95
  }
96
- let { pkg, path } = await findPackage(file);
96
+ let { pkg, path } = await findPackage(base);
97
97
 
98
- const parts = name.split(/\//);
98
+ let parts = name.split(/\//);
99
+
100
+ if (parts[0][0] === "@") {
101
+ parts = [parts[0] + "/" + parts[1], ...parts.slice(2)];
102
+ }
99
103
 
100
104
  const e = resolveExports(parts, pkg) || resolveImports(name, pkg);
101
105