Comparing version 0.0.6 to 0.0.7
@@ -53,4 +53,11 @@ "use strict"; | ||
if (typeof caches === "undefined" && typeof global !== "undefined" && typeof window === "undefined") { | ||
let nodepkg = './kv-storage-module'; | ||
const runnode = yield Promise.resolve(`${nodepkg}`).then(s => __importStar(require(s))); | ||
let runnode; | ||
try { | ||
const url = './kv-storage-module'; | ||
runnode = yield Promise.resolve(`${url}`).then(s => __importStar(require(s))); | ||
} | ||
catch (_a) { | ||
const url = './kv-storage-module.js'; | ||
runnode = yield Promise.resolve(`${url}`).then(s => __importStar(require(s))); | ||
} | ||
const dbnode = yield runnode.KVStorageModule.init({ | ||
@@ -64,3 +71,3 @@ dataDirName: databaseName, | ||
case 'deno': | ||
if (typeof caches !== "undefined" && typeof global === "undefined" && typeof window !== "undefined") { | ||
if ((typeof caches !== "undefined" && typeof global !== "undefined" && typeof window === "undefined") || (typeof caches !== "undefined" && typeof global === "undefined" && typeof window !== "undefined")) { | ||
let rundeno; | ||
@@ -71,3 +78,3 @@ try { | ||
} | ||
catch (_a) { | ||
catch (_b) { | ||
const url = './kv-storage-module.js'; | ||
@@ -85,4 +92,11 @@ rundeno = yield Promise.resolve(`${url}`).then(s => __importStar(require(s))); | ||
if (typeof caches === "undefined" && typeof global !== "undefined" && typeof window === "undefined") { | ||
let bunpkg = './kv-storage-module'; | ||
const runbun = yield Promise.resolve(`${bunpkg}`).then(s => __importStar(require(s))); | ||
let runbun; | ||
try { | ||
const url = './kv-storage-module'; | ||
runbun = yield Promise.resolve(`${url}`).then(s => __importStar(require(s))); | ||
} | ||
catch (_c) { | ||
const url = './kv-storage-module.js'; | ||
runbun = yield Promise.resolve(`${url}`).then(s => __importStar(require(s))); | ||
} | ||
const dbbun = yield runbun.KVStorageModule.init({ | ||
@@ -89,0 +103,0 @@ dataDirName: databaseName, |
@@ -17,4 +17,11 @@ export async function KVStorage({ runtime = 'node', databaseName = 'kvstorage', storageName = 'storage', databaseBinding }) { | ||
if (typeof caches === "undefined" && typeof global !== "undefined" && typeof window === "undefined") { | ||
let nodepkg = './kv-storage-module'; | ||
const runnode = await import(nodepkg); | ||
let runnode; | ||
try { | ||
const url = './kv-storage-module'; | ||
runnode = await import(url); | ||
} | ||
catch { | ||
const url = './kv-storage-module.js'; | ||
runnode = await import(url); | ||
} | ||
const dbnode = await runnode.KVStorageModule.init({ | ||
@@ -28,3 +35,3 @@ dataDirName: databaseName, | ||
case 'deno': | ||
if (typeof caches !== "undefined" && typeof global === "undefined" && typeof window !== "undefined") { | ||
if ((typeof caches !== "undefined" && typeof global !== "undefined" && typeof window === "undefined") || (typeof caches !== "undefined" && typeof global === "undefined" && typeof window !== "undefined")) { | ||
let rundeno; | ||
@@ -48,4 +55,11 @@ try { | ||
if (typeof caches === "undefined" && typeof global !== "undefined" && typeof window === "undefined") { | ||
let bunpkg = './kv-storage-module'; | ||
const runbun = await import(bunpkg); | ||
let runbun; | ||
try { | ||
const url = './kv-storage-module'; | ||
runbun = await import(url); | ||
} | ||
catch { | ||
const url = './kv-storage-module.js'; | ||
runbun = await import(url); | ||
} | ||
const dbbun = await runbun.KVStorageModule.init({ | ||
@@ -52,0 +66,0 @@ dataDirName: databaseName, |
@@ -23,4 +23,11 @@ (function (global, factory) { | ||
if (typeof caches === "undefined" && typeof global !== "undefined" && typeof window === "undefined") { | ||
let nodepkg = './kv-storage-module'; | ||
const runnode = await import(nodepkg); | ||
let runnode; | ||
try { | ||
const url = './kv-storage-module'; | ||
runnode = await import(url); | ||
} | ||
catch { | ||
const url = './kv-storage-module.js'; | ||
runnode = await import(url); | ||
} | ||
const dbnode = await runnode.KVStorageModule.init({ | ||
@@ -34,3 +41,3 @@ dataDirName: databaseName, | ||
case 'deno': | ||
if (typeof caches !== "undefined" && typeof global === "undefined" && typeof window !== "undefined") { | ||
if ((typeof caches !== "undefined" && typeof global !== "undefined" && typeof window === "undefined") || (typeof caches !== "undefined" && typeof global === "undefined" && typeof window !== "undefined")) { | ||
let rundeno; | ||
@@ -54,4 +61,11 @@ try { | ||
if (typeof caches === "undefined" && typeof global !== "undefined" && typeof window === "undefined") { | ||
let bunpkg = './kv-storage-module'; | ||
const runbun = await import(bunpkg); | ||
let runbun; | ||
try { | ||
const url = './kv-storage-module'; | ||
runbun = await import(url); | ||
} | ||
catch { | ||
const url = './kv-storage-module.js'; | ||
runbun = await import(url); | ||
} | ||
const dbbun = await runbun.KVStorageModule.init({ | ||
@@ -58,0 +72,0 @@ dataDirName: databaseName, |
{ | ||
"name": "kv-storage", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "Create data storage that uses a simple key-value method for Node, Browser, Deno, Bun, Cloudflare Workers", | ||
@@ -5,0 +5,0 @@ "main": "dist/cjs/kv-storage.js", |
@@ -24,3 +24,3 @@ # kv-storage | ||
```javascript | ||
<script src="https://cdn.jsdelivr.net/npm/kv-storage@0.0.6/dist/umd/kv-storage.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/kv-storage@0.0.7/dist/umd/kv-storage.js"></script> | ||
``` | ||
@@ -36,7 +36,7 @@ | ||
//Node, Browser, Bun & Cloudflare ES Modules import style | ||
//Node, Browser, Deno, Bun & Cloudflare ES Modules import style | ||
import {KVStorage} from 'kv-storage' | ||
//Deno import style | ||
import {KVStorage} from 'npm:kv-storage' | ||
import {KVStorage} from 'npm:kv-storage@0.0.7' | ||
@@ -87,3 +87,3 @@ //Node, Browser, Deno & Bun Initialization | ||
```javascript | ||
//Node & Bun ES Modules example | ||
//Node, Deno & Bun ES Modules example | ||
import {KVStorage} from 'kv-storage' | ||
@@ -105,3 +105,3 @@ | ||
```javascript | ||
<script src="https://cdn.jsdelivr.net/npm/kv-storage@0.0.6/dist/umd/kv-storage.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/kv-storage@0.0.7/dist/umd/kv-storage.js"></script> | ||
<script> | ||
@@ -128,3 +128,3 @@ //Browser using CDN example | ||
//Browser ES Modules example | ||
import {KVStorage} from 'https://cdn.jsdelivr.net/npm/kv-storage@0.0.6/dist/mjs/kv-storage.js' | ||
import {KVStorage} from 'https://cdn.jsdelivr.net/npm/kv-storage@0.0.7/dist/mjs/kv-storage.js' | ||
@@ -147,3 +147,3 @@ void async function main() { | ||
//Deno example | ||
import {KVStorage} from 'npm:kv-storage' | ||
import {KVStorage} from 'npm:kv-storage@0.0.7' | ||
@@ -150,0 +150,0 @@ void async function main() { |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
64946
1378
0
6