@sv443-network/userutils 10.0.5 → 10.0.6
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/CHANGELOG.md +6 -0
- package/dist/UserUtils.cjs +5 -5
- package/dist/UserUtils.mjs +5 -5
- package/dist/UserUtils.umd.js +5 -5
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/dist/UserUtils.cjs
CHANGED
|
@@ -114,7 +114,7 @@ __export(lib_exports, {
|
|
|
114
114
|
});
|
|
115
115
|
module.exports = __toCommonJS(lib_exports);
|
|
116
116
|
|
|
117
|
-
// node_modules/.pnpm/@sv443-network+coreutils@3.0.
|
|
117
|
+
// node_modules/.pnpm/@sv443-network+coreutils@3.0.5/node_modules/@sv443-network/coreutils/dist/CoreUtils.mjs
|
|
118
118
|
function bitSetHas(bitSet, checkVal) {
|
|
119
119
|
return (bitSet & checkVal) === checkVal;
|
|
120
120
|
}
|
|
@@ -574,7 +574,7 @@ var DataStore = class {
|
|
|
574
574
|
encodeData;
|
|
575
575
|
decodeData;
|
|
576
576
|
compressionFormat = "deflate-raw";
|
|
577
|
-
memoryCache
|
|
577
|
+
memoryCache;
|
|
578
578
|
engine;
|
|
579
579
|
options;
|
|
580
580
|
/**
|
|
@@ -601,7 +601,7 @@ var DataStore = class {
|
|
|
601
601
|
this.id = opts.id;
|
|
602
602
|
this.formatVersion = opts.formatVersion;
|
|
603
603
|
this.defaultData = opts.defaultData;
|
|
604
|
-
this.memoryCache =
|
|
604
|
+
this.memoryCache = opts.memoryCache ?? true;
|
|
605
605
|
this.cachedData = this.memoryCache ? opts.defaultData : {};
|
|
606
606
|
this.migrations = opts.migrations;
|
|
607
607
|
if (opts.migrateIds)
|
|
@@ -699,7 +699,7 @@ var DataStore = class {
|
|
|
699
699
|
/**
|
|
700
700
|
* Returns a copy of the data from the in-memory cache.
|
|
701
701
|
* Use {@linkcode loadData()} to get fresh data from persistent storage (usually not necessary since the cache should always exactly reflect persistent storage).
|
|
702
|
-
* ⚠️
|
|
702
|
+
* ⚠️ Only available when `memoryCache` is `true` (default). When set to `false`, this produces a type and runtime error - use {@linkcode loadData()} instead.
|
|
703
703
|
*/
|
|
704
704
|
getData() {
|
|
705
705
|
if (!this.memoryCache)
|
|
@@ -776,7 +776,7 @@ var DataStore = class {
|
|
|
776
776
|
if (!resetOnError)
|
|
777
777
|
throw new MigrationError(`Error while running migration function for format version '${fmtVer}'`, { cause: err });
|
|
778
778
|
await this.saveDefaultData();
|
|
779
|
-
return this.
|
|
779
|
+
return this.engine.deepCopy(this.defaultData);
|
|
780
780
|
}
|
|
781
781
|
}
|
|
782
782
|
}
|
package/dist/UserUtils.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// node_modules/.pnpm/@sv443-network+coreutils@3.0.
|
|
1
|
+
// node_modules/.pnpm/@sv443-network+coreutils@3.0.5/node_modules/@sv443-network/coreutils/dist/CoreUtils.mjs
|
|
2
2
|
function bitSetHas(bitSet, checkVal) {
|
|
3
3
|
return (bitSet & checkVal) === checkVal;
|
|
4
4
|
}
|
|
@@ -458,7 +458,7 @@ var DataStore = class {
|
|
|
458
458
|
encodeData;
|
|
459
459
|
decodeData;
|
|
460
460
|
compressionFormat = "deflate-raw";
|
|
461
|
-
memoryCache
|
|
461
|
+
memoryCache;
|
|
462
462
|
engine;
|
|
463
463
|
options;
|
|
464
464
|
/**
|
|
@@ -485,7 +485,7 @@ var DataStore = class {
|
|
|
485
485
|
this.id = opts.id;
|
|
486
486
|
this.formatVersion = opts.formatVersion;
|
|
487
487
|
this.defaultData = opts.defaultData;
|
|
488
|
-
this.memoryCache =
|
|
488
|
+
this.memoryCache = opts.memoryCache ?? true;
|
|
489
489
|
this.cachedData = this.memoryCache ? opts.defaultData : {};
|
|
490
490
|
this.migrations = opts.migrations;
|
|
491
491
|
if (opts.migrateIds)
|
|
@@ -583,7 +583,7 @@ var DataStore = class {
|
|
|
583
583
|
/**
|
|
584
584
|
* Returns a copy of the data from the in-memory cache.
|
|
585
585
|
* Use {@linkcode loadData()} to get fresh data from persistent storage (usually not necessary since the cache should always exactly reflect persistent storage).
|
|
586
|
-
* ⚠️
|
|
586
|
+
* ⚠️ Only available when `memoryCache` is `true` (default). When set to `false`, this produces a type and runtime error - use {@linkcode loadData()} instead.
|
|
587
587
|
*/
|
|
588
588
|
getData() {
|
|
589
589
|
if (!this.memoryCache)
|
|
@@ -660,7 +660,7 @@ var DataStore = class {
|
|
|
660
660
|
if (!resetOnError)
|
|
661
661
|
throw new MigrationError(`Error while running migration function for format version '${fmtVer}'`, { cause: err });
|
|
662
662
|
await this.saveDefaultData();
|
|
663
|
-
return this.
|
|
663
|
+
return this.engine.deepCopy(this.defaultData);
|
|
664
664
|
}
|
|
665
665
|
}
|
|
666
666
|
}
|
package/dist/UserUtils.umd.js
CHANGED
|
@@ -183,7 +183,7 @@ __export(lib_exports, {
|
|
|
183
183
|
});
|
|
184
184
|
module.exports = __toCommonJS(lib_exports);
|
|
185
185
|
|
|
186
|
-
// node_modules/.pnpm/@sv443-network+coreutils@3.0.
|
|
186
|
+
// node_modules/.pnpm/@sv443-network+coreutils@3.0.5/node_modules/@sv443-network/coreutils/dist/CoreUtils.mjs
|
|
187
187
|
function bitSetHas(bitSet, checkVal) {
|
|
188
188
|
return (bitSet & checkVal) === checkVal;
|
|
189
189
|
}
|
|
@@ -668,7 +668,7 @@ var DataStore = class {
|
|
|
668
668
|
__publicField(this, "encodeData");
|
|
669
669
|
__publicField(this, "decodeData");
|
|
670
670
|
__publicField(this, "compressionFormat", "deflate-raw");
|
|
671
|
-
__publicField(this, "memoryCache"
|
|
671
|
+
__publicField(this, "memoryCache");
|
|
672
672
|
__publicField(this, "engine");
|
|
673
673
|
__publicField(this, "options");
|
|
674
674
|
/**
|
|
@@ -685,7 +685,7 @@ var DataStore = class {
|
|
|
685
685
|
this.id = opts.id;
|
|
686
686
|
this.formatVersion = opts.formatVersion;
|
|
687
687
|
this.defaultData = opts.defaultData;
|
|
688
|
-
this.memoryCache =
|
|
688
|
+
this.memoryCache = (_a = opts.memoryCache) != null ? _a : true;
|
|
689
689
|
this.cachedData = this.memoryCache ? opts.defaultData : {};
|
|
690
690
|
this.migrations = opts.migrations;
|
|
691
691
|
if (opts.migrateIds)
|
|
@@ -790,7 +790,7 @@ var DataStore = class {
|
|
|
790
790
|
/**
|
|
791
791
|
* Returns a copy of the data from the in-memory cache.
|
|
792
792
|
* Use {@linkcode loadData()} to get fresh data from persistent storage (usually not necessary since the cache should always exactly reflect persistent storage).
|
|
793
|
-
* ⚠️
|
|
793
|
+
* ⚠️ Only available when `memoryCache` is `true` (default). When set to `false`, this produces a type and runtime error - use {@linkcode loadData()} instead.
|
|
794
794
|
*/
|
|
795
795
|
getData() {
|
|
796
796
|
if (!this.memoryCache)
|
|
@@ -872,7 +872,7 @@ var DataStore = class {
|
|
|
872
872
|
if (!resetOnError)
|
|
873
873
|
throw new MigrationError(`Error while running migration function for format version '${fmtVer}'`, { cause: err });
|
|
874
874
|
yield this.saveDefaultData();
|
|
875
|
-
return this.
|
|
875
|
+
return this.engine.deepCopy(this.defaultData);
|
|
876
876
|
}
|
|
877
877
|
}
|
|
878
878
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sv443-network/userutils",
|
|
3
3
|
"libName": "UserUtils",
|
|
4
|
-
"version": "10.0.
|
|
4
|
+
"version": "10.0.6",
|
|
5
5
|
"description": "General purpose DOM/GreaseMonkey library that allows you to register listeners for when CSS selectors exist, intercept events, create persistent & synchronous data stores, modify the DOM more easily and much more",
|
|
6
6
|
"main": "dist/UserUtils.mjs",
|
|
7
7
|
"module": "dist/UserUtils.mjs",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"homepage": "https://github.com/Sv443-Network/UserUtils",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@sv443-network/coreutils": "3.0.
|
|
36
|
+
"@sv443-network/coreutils": "3.0.5",
|
|
37
37
|
"nanoevents": "9.1.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|