indexeddbshim 17.4.1 → 17.4.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/dist/indexeddbshim-Key.js +1 -1
- package/dist/indexeddbshim-Key.min.js +1 -1
- package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs +6 -10
- package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs.map +1 -1
- package/dist/indexeddbshim-UnicodeIdentifiers.js +6 -10
- package/dist/indexeddbshim-UnicodeIdentifiers.js.map +1 -1
- package/dist/indexeddbshim-UnicodeIdentifiers.min.js +1 -1
- package/dist/indexeddbshim-UnicodeIdentifiers.min.js.map +1 -1
- package/dist/indexeddbshim-node.cjs +6 -10
- package/dist/indexeddbshim-node.cjs.map +1 -1
- package/dist/indexeddbshim-noninvasive.js +6 -10
- package/dist/indexeddbshim-noninvasive.js.map +1 -1
- package/dist/indexeddbshim-noninvasive.min.js +1 -1
- package/dist/indexeddbshim-noninvasive.min.js.map +1 -1
- package/dist/indexeddbshim.js +6 -10
- package/dist/indexeddbshim.js.map +1 -1
- package/dist/indexeddbshim.min.js +1 -1
- package/dist/indexeddbshim.min.js.map +1 -1
- package/dist/setGlobalVars.d.ts +4 -4
- package/dist/setGlobalVars.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/setGlobalVars.js +5 -6
package/dist/setGlobalVars.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export type ShimIndexedDB = (IDBFactory | object) & {
|
|
|
16
16
|
__setConnectionQueueOrigin: (origin?: string) => void;
|
|
17
17
|
};
|
|
18
18
|
export type Integer = number;
|
|
19
|
-
export type ShimmedObject = (typeof globalThis |
|
|
19
|
+
export type ShimmedObject = (typeof globalThis | Record<string, unknown>) & {
|
|
20
20
|
indexedDB?: Partial<IDBFactory>;
|
|
21
21
|
IDBFactory: typeof IDBFactory;
|
|
22
22
|
IDBOpenDBRequest: typeof IDBOpenDBRequest;
|
|
@@ -54,7 +54,7 @@ import { createDOMException } from './DOMException.js';
|
|
|
54
54
|
* @typedef {number} Integer
|
|
55
55
|
*/
|
|
56
56
|
/**
|
|
57
|
-
* @typedef {(typeof globalThis|
|
|
57
|
+
* @typedef {(typeof globalThis|Record<string, unknown>) & {
|
|
58
58
|
* indexedDB?: Partial<IDBFactory>,
|
|
59
59
|
* IDBFactory: typeof IDBFactory,
|
|
60
60
|
* IDBOpenDBRequest: typeof IDBOpenDBRequest,
|
|
@@ -69,10 +69,10 @@ import { createDOMException } from './DOMException.js';
|
|
|
69
69
|
*/
|
|
70
70
|
/**
|
|
71
71
|
*
|
|
72
|
-
* @param {
|
|
72
|
+
* @param {typeof globalThis | Record<string, unknown>} [idb]
|
|
73
73
|
* @param {Partial<import('./CFG.js').ConfigValues>} [initialConfig]
|
|
74
74
|
* @returns {ShimmedObject}
|
|
75
75
|
*/
|
|
76
|
-
declare function setGlobalVars(idb?:
|
|
76
|
+
declare function setGlobalVars(idb?: typeof globalThis | Record<string, unknown>, initialConfig?: Partial<import("./CFG.js").ConfigValues>): ShimmedObject;
|
|
77
77
|
import { IDBFactory } from './IDBFactory.js';
|
|
78
78
|
//# sourceMappingURL=setGlobalVars.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setGlobalVars.d.ts","sourceRoot":"","sources":["../src/setGlobalVars.js"],"names":[],"mappings":";;uBAkBa,GAAG;+BAKL,OAAO,UAAU,EAAE,iBAAiB,GAC1C,OAAO,CAAC,OAAO,UAAU,EAAE,YAAY,CAAC,QAClC,QAAQ;wBAoCN,CACR,IAAI,EAAE,OAAO,UAAU,EAAE,iBAAiB,KACvC,OAAO,UAAU,EAAE,WAAW;oCAIzB,CAAC,GAAG,EAAE;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAA;CAC1B,KAAK,IAAI;4BAIA,CAAC,UAAU,GAAC,MAAM,CAAC,GAAG;IAC5B,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,O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AO,UAAU,CAAC;IAC9B,kBAAkB,EAAE,OAAO,kBAAkB,CAAC;IAC9C,SAAS,EAAE,OAAO,SAAS,CAAC;IAC5B,WAAW,EAAE,OAAO,WAAW,CAAC;IAChC,cAAc,EAAE,OAAO,cAAc,CAAC;IACtC,WAAW,EAAE,OAAO,WAAW,CAAC;IAChC,aAAa,CAAC,EAAE,aAAa,CAAA;CAC9B;mCAhG+C,mBAAmB;AAwDtE;;;;GAIG;AAEH;;;;;GAKG;AAEH;;;;;;;;;GASG;AAEH;;GAEG;AAEH;;;;;;;;;;;;;GAaG;AAEH;;;;;GAKG;AACH,qCAJW,OAAO,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,kBAC3C,OAAO,CAAC,OAAO,UAAU,EAAE,YAAY,CAAC,GACtC,aAAa,CAiTzB;2BAvZ8C,iBAAiB"}
|
package/package.json
CHANGED
package/src/setGlobalVars.js
CHANGED
|
@@ -87,7 +87,7 @@ function setConfig (prop, val) {
|
|
|
87
87
|
*/
|
|
88
88
|
|
|
89
89
|
/**
|
|
90
|
-
* @typedef {(typeof globalThis|
|
|
90
|
+
* @typedef {(typeof globalThis|Record<string, unknown>) & {
|
|
91
91
|
* indexedDB?: Partial<IDBFactory>,
|
|
92
92
|
* IDBFactory: typeof IDBFactory,
|
|
93
93
|
* IDBOpenDBRequest: typeof IDBOpenDBRequest,
|
|
@@ -103,7 +103,7 @@ function setConfig (prop, val) {
|
|
|
103
103
|
|
|
104
104
|
/**
|
|
105
105
|
*
|
|
106
|
-
* @param {
|
|
106
|
+
* @param {typeof globalThis | Record<string, unknown>} [idb]
|
|
107
107
|
* @param {Partial<import('./CFG.js').ConfigValues>} [initialConfig]
|
|
108
108
|
* @returns {ShimmedObject}
|
|
109
109
|
*/
|
|
@@ -111,7 +111,9 @@ function setGlobalVars (idb, initialConfig) {
|
|
|
111
111
|
if (initialConfig) {
|
|
112
112
|
setConfig(initialConfig);
|
|
113
113
|
}
|
|
114
|
-
const IDB =
|
|
114
|
+
const IDB = /** @type {ShimmedObject & {[key: string]: unknown}} */ (
|
|
115
|
+
/** @type {unknown} */ (idb || globalThis || {})
|
|
116
|
+
);
|
|
115
117
|
/**
|
|
116
118
|
* @typedef {any} AnyClass
|
|
117
119
|
*/
|
|
@@ -133,14 +135,12 @@ function setGlobalVars (idb, initialConfig) {
|
|
|
133
135
|
if (!propDesc || !Object.defineProperty) {
|
|
134
136
|
try {
|
|
135
137
|
// Try setting the property. This will fail if the property is read-only.
|
|
136
|
-
// @ts-expect-error It's ok
|
|
137
138
|
IDB[name] = value;
|
|
138
139
|
} catch (e) {
|
|
139
140
|
console.log(e);
|
|
140
141
|
}
|
|
141
142
|
}
|
|
142
143
|
if (
|
|
143
|
-
// @ts-expect-error It's ok
|
|
144
144
|
IDB[name] !== value &&
|
|
145
145
|
Object.defineProperty
|
|
146
146
|
) {
|
|
@@ -179,7 +179,6 @@ function setGlobalVars (idb, initialConfig) {
|
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
-
// @ts-expect-error It's ok
|
|
183
182
|
if (IDB[name] !== value) {
|
|
184
183
|
if (typeof console !== 'undefined' && console.warn) {
|
|
185
184
|
console.warn('Unable to shim ' + name);
|