sandboxedjs 0.1.37 → 0.1.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.
@@ -21729,6 +21729,9 @@ var CommonJsEngine = class {
21729
21729
  return target.exports;
21730
21730
  }
21731
21731
  resolve(specifier, importer, kind = "require") {
21732
+ if (specifier.startsWith("file://")) {
21733
+ specifier = pathFromFileUrl(specifier);
21734
+ }
21732
21735
  const builtin = this.builtin(specifier);
21733
21736
  if (builtin.found) return specifier.replace(/^node:/, "");
21734
21737
  if (specifier.startsWith("#")) {
@@ -22093,6 +22096,11 @@ function ownKeys(target) {
22093
22096
  }
22094
22097
  return keys;
22095
22098
  }
22099
+ function pathFromFileUrl(url) {
22100
+ const withoutScheme = url.slice("file://".length).replace(/^localhost/, "");
22101
+ const path = withoutScheme.split(/[?#]/, 1)[0];
22102
+ return decodeURIComponent(path) || "/";
22103
+ }
22096
22104
  function fileUrl(path) {
22097
22105
  return `file://${path.split("/").map(encodeURIComponent).join("/")}`;
22098
22106
  }
@@ -29548,6 +29556,7 @@ function createCoreModules(options) {
29548
29556
  }
29549
29557
  });
29550
29558
  processObject.stdin = stdin;
29559
+ Reflect.deleteProperty(processObject, "browser");
29551
29560
  const fs = createFsModule(volume, () => cwd, options.stdinPath);
29552
29561
  const path = createPathModule(() => cwd);
29553
29562
  const consoleObject = new Console(stdoutWrite, stderrWrite);