@livestore/sqlite-wasm 3.46.0-build3 → 3.46.0-build4
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
|
@@ -631,6 +631,18 @@ var sqlite3InitModule = (() => {
|
|
|
631
631
|
!isDataURI(binaryFile) &&
|
|
632
632
|
typeof fetch == 'function'
|
|
633
633
|
) {
|
|
634
|
+
const isNode =
|
|
635
|
+
typeof process !== 'undefined' &&
|
|
636
|
+
process.versions != null &&
|
|
637
|
+
process.versions.node != null;
|
|
638
|
+
if (isNode) {
|
|
639
|
+
return import('fs').then((fs) => {
|
|
640
|
+
const buffer = fs.readFileSync(binaryFile.replace('file://', ''));
|
|
641
|
+
const bytes = new Uint8Array(buffer);
|
|
642
|
+
return WebAssembly.instantiate(bytes, imports).then(callback);
|
|
643
|
+
});
|
|
644
|
+
}
|
|
645
|
+
|
|
634
646
|
return fetch(binaryFile, { credentials: 'same-origin' }).then(
|
|
635
647
|
(response) => {
|
|
636
648
|
// Suppress closure warning here since the upstream definition for
|