@jsenv/node-esm-resolution 1.0.0 → 1.0.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/node-esm-resolution",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -212,8 +212,7 @@ const applyPackageResolve = (packageSpecifier, resolutionContext) => {
212
212
  url: `node:${packageSpecifier}`,
213
213
  }
214
214
  }
215
- const { packageName, packageSubpath } =
216
- parsePackageSpecifier(packageSpecifier)
215
+ let { packageName, packageSubpath } = parsePackageSpecifier(packageSpecifier)
217
216
  if (
218
217
  packageName[0] === "." ||
219
218
  packageName.includes("\\") ||
@@ -228,6 +227,10 @@ const applyPackageResolve = (packageSpecifier, resolutionContext) => {
228
227
  if (packageSubpath.endsWith("/")) {
229
228
  throw new Error("invalid module specifier")
230
229
  }
230
+ const questionCharIndex = packageName.indexOf("?")
231
+ if (questionCharIndex > -1) {
232
+ packageName = packageName.slice(0, questionCharIndex)
233
+ }
231
234
  const selfResolution = applyPackageSelfResolution(packageSubpath, {
232
235
  ...resolutionContext,
233
236
  packageName,