tiny-essentials 1.19.0 → 1.19.1
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/v1/TinyEssentials.js +6 -6
- package/dist/v1/TinyEssentials.min.js +1 -1
- package/dist/v1/TinyLocalStorage.js +6 -6
- package/dist/v1/TinyLocalStorage.min.js +1 -1
- package/dist/v1/TinyUploadClicker.js +6 -6
- package/dist/v1/TinyUploadClicker.min.js +1 -1
- package/dist/v1/libs/TinyLocalStorage.cjs +6 -6
- package/dist/v1/libs/TinyLocalStorage.mjs +6 -6
- package/package.json +1 -1
|
@@ -392,7 +392,7 @@ class TinyLocalStorage {
|
|
|
392
392
|
}
|
|
393
393
|
const encoded = this.#setJson(name, data);
|
|
394
394
|
this.emit('setJson', name, data);
|
|
395
|
-
this.#localStorage.setItem(name, JSON.stringify(encoded));
|
|
395
|
+
return this.#localStorage.setItem(name, JSON.stringify(encoded));
|
|
396
396
|
}
|
|
397
397
|
/**
|
|
398
398
|
* Retrieves a value from `localStorage`.
|
|
@@ -454,8 +454,8 @@ class TinyLocalStorage {
|
|
|
454
454
|
if (!(data instanceof Date))
|
|
455
455
|
throw new Error('Value must be a Date.');
|
|
456
456
|
const encoded = this.#setJson(name, data);
|
|
457
|
-
this.#localStorage.setItem(name, JSON.stringify(encoded));
|
|
458
457
|
this.emit('setDate', name, data);
|
|
458
|
+
return this.#localStorage.setItem(name, JSON.stringify(encoded));
|
|
459
459
|
}
|
|
460
460
|
/**
|
|
461
461
|
* Retrieves a Date from localStorage.
|
|
@@ -475,8 +475,8 @@ class TinyLocalStorage {
|
|
|
475
475
|
if (!(data instanceof RegExp))
|
|
476
476
|
throw new Error('Value must be a RegExp.');
|
|
477
477
|
const encoded = this.#setJson(name, data);
|
|
478
|
-
this.#localStorage.setItem(name, JSON.stringify(encoded));
|
|
479
478
|
this.emit('setRegExp', name, data);
|
|
479
|
+
return this.#localStorage.setItem(name, JSON.stringify(encoded));
|
|
480
480
|
}
|
|
481
481
|
/**
|
|
482
482
|
* Retrieves a RegExp from localStorage.
|
|
@@ -496,8 +496,8 @@ class TinyLocalStorage {
|
|
|
496
496
|
if (typeof data !== 'bigint')
|
|
497
497
|
throw new Error('Value must be a BigInt.');
|
|
498
498
|
const encoded = this.#setJson(name, data);
|
|
499
|
-
this.#localStorage.setItem(name, JSON.stringify(encoded));
|
|
500
499
|
this.emit('setBigInt', name, data);
|
|
500
|
+
return this.#localStorage.setItem(name, JSON.stringify(encoded));
|
|
501
501
|
}
|
|
502
502
|
/**
|
|
503
503
|
* Retrieves a BigInt from localStorage.
|
|
@@ -518,8 +518,8 @@ class TinyLocalStorage {
|
|
|
518
518
|
if (typeof data !== 'symbol')
|
|
519
519
|
throw new Error('Value must be a Symbol.');
|
|
520
520
|
const encoded = this.#setJson(name, data);
|
|
521
|
-
this.#localStorage.setItem(name, JSON.stringify(encoded));
|
|
522
521
|
this.emit('setSymbol', name, data);
|
|
522
|
+
return this.#localStorage.setItem(name, JSON.stringify(encoded));
|
|
523
523
|
}
|
|
524
524
|
/**
|
|
525
525
|
* Retrieves a Symbol from localStorage.
|
|
@@ -673,7 +673,7 @@ class TinyLocalStorage {
|
|
|
673
673
|
* Clears all data from `localStorage`.
|
|
674
674
|
*/
|
|
675
675
|
clearLocalStorage() {
|
|
676
|
-
this.#localStorage.clear();
|
|
676
|
+
return this.#localStorage.clear();
|
|
677
677
|
}
|
|
678
678
|
/**
|
|
679
679
|
* Destroys the storage instance by removing the storage event listener.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tiny-essentials",
|
|
3
|
-
"version": "1.19.
|
|
3
|
+
"version": "1.19.1",
|
|
4
4
|
"description": "Collection of small, essential scripts designed to be used across various projects. These simple utilities are crafted for speed, ease of use, and versatility.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "npm run test:mjs && npm run test:cjs && npm run test:js",
|