@daysnap/utils 0.1.11 → 0.1.13
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/docs/classes/Storage.md +239 -0
- package/docs/interfaces/EventBusCallback.md +1 -1
- package/docs/interfaces/StorageManager.md +4 -4
- package/docs/interfaces/Trap.md +5 -5
- package/docs/modules.md +203 -141
- package/es/{chunk-3OUQEOSR.js → chunk-2SUOLGG5.js} +1 -1
- package/es/chunk-56QUZDMU.js +67 -0
- package/es/{chunk-NOT3VNHC.js → chunk-A3YS6665.js} +5 -1
- package/es/{chunk-UMUYJJ3M.js → chunk-DLAUZWWO.js} +1 -1
- package/es/chunk-HNKJXGCC.js +19 -0
- package/es/{chunk-HREC4YYI.js → chunk-JZKIIY3L.js} +2 -2
- package/es/{chunk-3IKNCOC3.js → chunk-ORI5P5UA.js} +2 -2
- package/es/{chunk-KG436SDV.js → chunk-PSACVUUL.js} +1 -1
- package/es/{chunk-EY27J7WJ.js → chunk-S6ZV2M6N.js} +1 -1
- package/es/{chunk-YGYLI2DC.js → chunk-TZ2EQSRZ.js} +1 -1
- package/es/{chunk-I65EJPPI.js → chunk-UMJU7UF2.js} +1 -1
- package/es/{chunk-PE43T234.js → chunk-WXD7J2FR.js} +2 -2
- package/es/filterEmptyValue.js +2 -2
- package/es/formartDateToZN.js +3 -3
- package/es/formatDate.js +2 -2
- package/es/getDateBoundsByMonths.d.ts +7 -0
- package/es/getDateBoundsByMonths.js +9 -0
- package/es/getMonthBounds.js +3 -3
- package/es/getRandom.js +2 -2
- package/es/getRandomNumber.js +3 -3
- package/es/getRangeDate.js +3 -3
- package/es/getWeekday.js +2 -2
- package/es/index.d.ts +2 -0
- package/es/index.js +45 -37
- package/es/isValidDate.js +2 -2
- package/es/listGenerator.d.ts +1 -0
- package/es/listGenerator.js +1 -1
- package/es/normalizeDate.js +1 -1
- package/es/storage/index.d.ts +1 -0
- package/es/storage/index.js +5 -1
- package/es/storage/storage.d.ts +40 -0
- package/es/storage/storage.js +8 -0
- package/lib/{chunk-XJIRG4UL.cjs → chunk-2C3XINC3.cjs} +1 -1
- package/lib/chunk-44UMWNOZ.cjs +19 -0
- package/lib/{chunk-P3BVNREA.cjs → chunk-6TABJ32L.cjs} +2 -2
- package/lib/{chunk-BPNPYUBR.cjs → chunk-BQ7SLF6C.cjs} +2 -2
- package/lib/chunk-GQFHHWIV.cjs +67 -0
- package/lib/{chunk-RTTG26O5.cjs → chunk-HEVW5ZN2.cjs} +5 -1
- package/lib/{chunk-EJV6YDGC.cjs → chunk-IGD442DS.cjs} +2 -2
- package/lib/{chunk-GLLD74FC.cjs → chunk-JFPD5JTY.cjs} +2 -2
- package/lib/{chunk-CANF5KF5.cjs → chunk-KT3FWGJG.cjs} +4 -4
- package/lib/{chunk-2DCEWABW.cjs → chunk-NEFFCHO5.cjs} +5 -5
- package/lib/{chunk-LJYE7HIT.cjs → chunk-SOBKBDEC.cjs} +2 -2
- package/lib/{chunk-ELDXB7BZ.cjs → chunk-SZOUFWPJ.cjs} +4 -4
- package/lib/filterEmptyValue.cjs +3 -3
- package/lib/formartDateToZN.cjs +4 -4
- package/lib/formatDate.cjs +3 -3
- package/lib/getDateBoundsByMonths.cjs +9 -0
- package/lib/getDateBoundsByMonths.d.cts +7 -0
- package/lib/getMonthBounds.cjs +4 -4
- package/lib/getRandom.cjs +3 -3
- package/lib/getRandomNumber.cjs +4 -4
- package/lib/getRangeDate.cjs +4 -4
- package/lib/getWeekday.cjs +3 -3
- package/lib/index.cjs +38 -30
- package/lib/index.d.cts +2 -0
- package/lib/isValidDate.cjs +3 -3
- package/lib/listGenerator.cjs +2 -2
- package/lib/listGenerator.d.cts +1 -0
- package/lib/normalizeDate.cjs +2 -2
- package/lib/storage/index.cjs +6 -2
- package/lib/storage/index.d.cts +1 -0
- package/lib/storage/storage.cjs +8 -0
- package/lib/storage/storage.d.cts +40 -0
- package/package.json +1 -1
- package/es/{chunk-IJCLLBSR.js → chunk-LG2TIXRB.js} +0 -0
- package/es/{chunk-4WQPAGCE.js → chunk-NXEL6RMI.js} +3 -3
- package/lib/{chunk-C522WKFY.cjs → chunk-2PEWYRYD.cjs} +0 -0
- package/lib/{chunk-6LOBB2KW.cjs → chunk-PYFTXKFI.cjs} +3 -3
package/lib/isValidDate.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var _chunkSOBKBDECcjs = require('./chunk-SOBKBDEC.cjs');
|
|
4
|
+
require('./chunk-HEVW5ZN2.cjs');
|
|
5
5
|
require('./chunk-T5JI3MEC.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.isValidDate =
|
|
8
|
+
exports.isValidDate = _chunkSOBKBDECcjs.isValidDate;
|
package/lib/listGenerator.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk2C3XINC3cjs = require('./chunk-2C3XINC3.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
exports.listGenerator =
|
|
6
|
+
exports.listGenerator = _chunk2C3XINC3cjs.listGenerator;
|
package/lib/listGenerator.d.cts
CHANGED
package/lib/normalizeDate.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkHEVW5ZN2cjs = require('./chunk-HEVW5ZN2.cjs');
|
|
4
4
|
require('./chunk-T5JI3MEC.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
exports.normalizeDate =
|
|
7
|
+
exports.normalizeDate = _chunkHEVW5ZN2cjs.normalizeDate;
|
package/lib/storage/index.cjs
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunk2PEWYRYDcjs = require('../chunk-2PEWYRYD.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunk4YOKT62Rcjs = require('../chunk-4YOKT62R.cjs');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
var _chunkGQFHHWIVcjs = require('../chunk-GQFHHWIV.cjs');
|
|
8
11
|
require('../chunk-5PB5B4HH.cjs');
|
|
9
12
|
require('../chunk-OSEQ7XR6.cjs');
|
|
10
13
|
|
|
11
14
|
|
|
12
15
|
|
|
13
16
|
|
|
14
|
-
|
|
17
|
+
|
|
18
|
+
exports.Storage = _chunkGQFHHWIVcjs.Storage; exports.factory = _chunk4YOKT62Rcjs.factory; exports.getCache = _chunk2PEWYRYDcjs.getCache; exports.getLocal = _chunk2PEWYRYDcjs.getLocal;
|
package/lib/storage/index.d.cts
CHANGED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
interface StorageLike {
|
|
2
|
+
getItem: (key: string) => string | null;
|
|
3
|
+
setItem: (key: string, value: string) => void;
|
|
4
|
+
removeItem: (key: string) => void;
|
|
5
|
+
}
|
|
6
|
+
declare class Storage<T = any> {
|
|
7
|
+
private readonly key;
|
|
8
|
+
private readonly storage;
|
|
9
|
+
private value;
|
|
10
|
+
constructor(key: string, storage: StorageLike);
|
|
11
|
+
/**
|
|
12
|
+
* 设置值
|
|
13
|
+
*/
|
|
14
|
+
setItem(val: T): T;
|
|
15
|
+
/**
|
|
16
|
+
* 获取值
|
|
17
|
+
*/
|
|
18
|
+
getItem(): T | null;
|
|
19
|
+
getItem(defaultVal: Partial<T>): T;
|
|
20
|
+
/**
|
|
21
|
+
* 删除值
|
|
22
|
+
*/
|
|
23
|
+
removeItem(): void;
|
|
24
|
+
/**
|
|
25
|
+
* 更新值
|
|
26
|
+
*/
|
|
27
|
+
updateItem(val: Partial<T>): T;
|
|
28
|
+
/**
|
|
29
|
+
* 获取值后,删除存储的值
|
|
30
|
+
*/
|
|
31
|
+
getItemOnce(): T | null;
|
|
32
|
+
getItemOnce(defaultVal: Partial<T>): T;
|
|
33
|
+
/**
|
|
34
|
+
* 优先从缓存中获取值
|
|
35
|
+
*/
|
|
36
|
+
getItemWithCache(): T | null;
|
|
37
|
+
getItemWithCache(defaultVal: Partial<T>): T;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export { Storage };
|
package/package.json
CHANGED
|
File without changes
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isEmptyObject
|
|
3
|
+
} from "./chunk-GVYBTJDA.js";
|
|
1
4
|
import {
|
|
2
5
|
isFunction
|
|
3
6
|
} from "./chunk-WCZPEH7E.js";
|
|
@@ -7,9 +10,6 @@ import {
|
|
|
7
10
|
import {
|
|
8
11
|
isEmptyArray
|
|
9
12
|
} from "./chunk-ELR2DZ56.js";
|
|
10
|
-
import {
|
|
11
|
-
isEmptyObject
|
|
12
|
-
} from "./chunk-GVYBTJDA.js";
|
|
13
13
|
import {
|
|
14
14
|
isObject
|
|
15
15
|
} from "./chunk-XCSSSEK2.js";
|
|
File without changes
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
+
var _chunk5XVQSGWZcjs = require('./chunk-5XVQSGWZ.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
3
6
|
var _chunkOHDNJMMWcjs = require('./chunk-OHDNJMMW.cjs');
|
|
4
7
|
|
|
5
8
|
|
|
@@ -9,9 +12,6 @@ var _chunkA2J34A3Kcjs = require('./chunk-A2J34A3K.cjs');
|
|
|
9
12
|
var _chunkX3A4TUQLcjs = require('./chunk-X3A4TUQL.cjs');
|
|
10
13
|
|
|
11
14
|
|
|
12
|
-
var _chunk5XVQSGWZcjs = require('./chunk-5XVQSGWZ.cjs');
|
|
13
|
-
|
|
14
|
-
|
|
15
15
|
var _chunkOSEQ7XR6cjs = require('./chunk-OSEQ7XR6.cjs');
|
|
16
16
|
|
|
17
17
|
// src/filterEmptyValue.ts
|