@hpcc-js/wasm 1.16.0 → 1.16.2
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 +2 -2
- package/dist/expat.es6.js +5 -6
- package/dist/expat.es6.js.map +1 -1
- package/dist/expat.js +5 -6
- package/dist/expat.js.map +1 -1
- package/dist/graphviz.es6.js +5 -6
- package/dist/graphviz.es6.js.map +1 -1
- package/dist/graphviz.js +5 -6
- package/dist/graphviz.js.map +1 -1
- package/dist/graphvizlib.wasm +0 -0
- package/dist/index.es6.js +5 -6
- package/dist/index.es6.js.map +1 -1
- package/dist/index.js +5 -6
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/index.node.es6.js +5 -6
- package/dist/index.node.es6.js.map +1 -1
- package/dist/index.node.js +5 -6
- package/dist/index.node.js.map +1 -1
- package/package.json +1 -1
- package/types/util.d.ts.map +1 -1
package/dist/index.js
CHANGED
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
'default': cpp$1
|
|
25
25
|
});
|
|
26
26
|
|
|
27
|
+
var _a, _b, _c, _d;
|
|
27
28
|
function getGlobal() {
|
|
28
29
|
if (typeof self !== "undefined") {
|
|
29
30
|
return self;
|
|
@@ -57,11 +58,8 @@
|
|
|
57
58
|
}
|
|
58
59
|
return str;
|
|
59
60
|
}
|
|
60
|
-
let scriptDir =
|
|
61
|
-
|
|
62
|
-
typeof document !== 'undefined' && document.currentScript ? document.currentScript.src :
|
|
63
|
-
"";
|
|
64
|
-
scriptDir = scriptDir.substr(0, scriptDir.replace(/[?#].*/, "").lastIndexOf('/') + 1);
|
|
61
|
+
let scriptDir = (_d = (_c = (_b = (_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) === null || _a === void 0 ? void 0 : _a.currentScript) === null || _b === void 0 ? void 0 : _b.src) !== null && _c !== void 0 ? _c : __filename) !== null && _d !== void 0 ? _d : "./dummy.js";
|
|
62
|
+
scriptDir = scriptDir.substring(0, scriptDir.replace(/[?#].*/, "").lastIndexOf('/') + 1);
|
|
65
63
|
async function browserFetch(wasmUrl) {
|
|
66
64
|
return fetch(wasmUrl, { credentials: 'same-origin' }).then(response => {
|
|
67
65
|
if (!response.ok) {
|
|
@@ -83,7 +81,8 @@
|
|
|
83
81
|
});
|
|
84
82
|
}
|
|
85
83
|
async function loadWasm(_wasmLib, filename, wf, wasmBinary) {
|
|
86
|
-
|
|
84
|
+
let wasmUrl = `${trimEnd(wf || wasmFolder() || scriptDir, "/")}/${trimStart(`${filename}.wasm`, "/")}`;
|
|
85
|
+
wasmUrl = URL && globalThis.document ? new URL(wasmUrl, document.baseURI).href : wasmUrl;
|
|
87
86
|
if (!g_wasmCache[wasmUrl]) {
|
|
88
87
|
g_wasmCache[wasmUrl] = _loadWasm(_wasmLib, wasmUrl, wasmBinary);
|
|
89
88
|
}
|