sandboxedjs 0.1.21 → 0.1.22
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 +11 -4
- package/dist/index.cjs +18 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +18 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -22158,6 +22158,8 @@ var RESERVED_FOR_INTERPRETER = /* @__PURE__ */ new Set(["lib", "dev", "proc"]);
|
|
|
22158
22158
|
var pyodideModule = null;
|
|
22159
22159
|
var indexUrl;
|
|
22160
22160
|
var moduleUrl;
|
|
22161
|
+
var DEFAULT_BROWSER_INDEX_URL = "https://cdn.jsdelivr.net/pyodide/v0.28.3/full/";
|
|
22162
|
+
var isNode2 = typeof process !== "undefined" && process.versions != null && process.versions.node != null;
|
|
22161
22163
|
function configureCPython(options = {}) {
|
|
22162
22164
|
if (options.indexURL !== void 0) indexUrl = options.indexURL;
|
|
22163
22165
|
if (options.moduleURL !== void 0) {
|
|
@@ -22167,19 +22169,27 @@ function configureCPython(options = {}) {
|
|
|
22167
22169
|
}
|
|
22168
22170
|
function importPyodide() {
|
|
22169
22171
|
if (!pyodideModule) {
|
|
22170
|
-
|
|
22171
|
-
|
|
22172
|
-
|
|
22173
|
-
|
|
22174
|
-
|
|
22175
|
-
|
|
22172
|
+
if (moduleUrl) {
|
|
22173
|
+
pyodideModule = import(
|
|
22174
|
+
/* @vite-ignore */
|
|
22175
|
+
/* webpackIgnore: true */
|
|
22176
|
+
moduleUrl
|
|
22177
|
+
);
|
|
22178
|
+
} else if (isNode2) {
|
|
22179
|
+
pyodideModule = nodeOnlyModule("pyodide");
|
|
22180
|
+
} else {
|
|
22181
|
+
pyodideModule = import(
|
|
22182
|
+
/* @vite-ignore */
|
|
22183
|
+
/* webpackIgnore: true */
|
|
22184
|
+
`${DEFAULT_BROWSER_INDEX_URL}pyodide.mjs`
|
|
22185
|
+
);
|
|
22186
|
+
}
|
|
22176
22187
|
}
|
|
22177
22188
|
return pyodideModule;
|
|
22178
22189
|
}
|
|
22179
|
-
var isNode2 = typeof process !== "undefined" && process.versions != null && process.versions.node != null;
|
|
22180
22190
|
async function resolveIndexUrl() {
|
|
22181
22191
|
if (indexUrl) return indexUrl;
|
|
22182
|
-
if (!isNode2) return
|
|
22192
|
+
if (!isNode2) return DEFAULT_BROWSER_INDEX_URL;
|
|
22183
22193
|
try {
|
|
22184
22194
|
const { createRequire } = await nodeBuiltin("module");
|
|
22185
22195
|
const path = await nodeBuiltin("path");
|