aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/api/sqlite3-vfs-opfs.c-pp.js
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2023-01-27 03:18:16 +0000
committerstephan <stephan@noemail.net>2023-01-27 03:18:16 +0000
commita0013fbe879fb59843c69610af56b5b9141c9614 (patch)
tree745f6a4773549b0e3956276f9b53ec560eaa7666 /ext/wasm/api/sqlite3-vfs-opfs.c-pp.js
parent67bfea4ea6fb3bba1425079301727d350132cde0 (diff)
downloadsqlite-a0013fbe879fb59843c69610af56b5b9141c9614.tar.gz
sqlite-a0013fbe879fb59843c69610af56b5b9141c9614.zip
More work on creating a separate sqlite3.js build which is hopefully friendly to JS bundlers.
FossilOrigin-Name: b7b896fb448a7f46eb88eadadb1359255aec637a384cabcdd526276a02f4f0b4
Diffstat (limited to 'ext/wasm/api/sqlite3-vfs-opfs.c-pp.js')
-rw-r--r--ext/wasm/api/sqlite3-vfs-opfs.c-pp.js21
1 files changed, 14 insertions, 7 deletions
diff --git a/ext/wasm/api/sqlite3-vfs-opfs.c-pp.js b/ext/wasm/api/sqlite3-vfs-opfs.c-pp.js
index 451f0019c..aeda62aa2 100644
--- a/ext/wasm/api/sqlite3-vfs-opfs.c-pp.js
+++ b/ext/wasm/api/sqlite3-vfs-opfs.c-pp.js
@@ -100,13 +100,20 @@ const installOpfsVfs = function callee(options){
if(!options || 'object'!==typeof options){
options = Object.create(null);
}
- const urlParams = new URL(self.location.href).searchParams;
- if(undefined===options.verbose){
- options.verbose = urlParams.has('opfs-verbose')
- ? (+urlParams.get('opfs-verbose') || 2) : 1;
- }
- if(undefined===options.sanityChecks){
- options.sanityChecks = urlParams.has('opfs-sanity-check');
+ const urlParams =
+//#if target=es6-bundler-friendly
+ undefined;
+//#else
+ new URL(self.location.href).searchParams;
+//#endif
+ if(urlParams){
+ if(undefined===options.verbose){
+ options.verbose = urlParams.has('opfs-verbose')
+ ? (+urlParams.get('opfs-verbose') || 2) : 1;
+ }
+ if(undefined===options.sanityChecks){
+ options.sanityChecks = urlParams.has('opfs-sanity-check');
+ }
}
if(undefined===options.proxyUri){
options.proxyUri = callee.defaultProxyUri;