sandboxedjs 0.1.38 → 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.
- package/dist/index.cjs +8 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/worker-entry.js +8 -0
- package/dist/worker-entry.js.map +1 -1
- package/package.json +1 -1
package/dist/worker-entry.js
CHANGED
|
@@ -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
|
}
|