@vope/utils 1.8.1 → 1.9.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/CHANGELOG.md +89 -0
- package/dist/cron.js +8 -0
- package/dist/index.cjs.js +14 -2
- package/dist/memory/basic.js +3 -2
- package/dist/neo4j-anchors.js +1 -0
- package/dist/union.js +2 -0
- package/package.json +23 -22
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [1.9.1] - 2026-05-11
|
|
9
|
+
### Fixed
|
|
10
|
+
- 修复升级依赖 typescript 引起的 .d.ts 文件生成路径错误问题
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
- 发布 [CHANGELOG.md](./CHANGELOG.md) 文件
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## [1.9.0] - 2026-05-11
|
|
17
|
+
### Changed
|
|
18
|
+
- 升级依赖
|
|
19
|
+
|
|
20
|
+
## [1.8.0] - 2026-05-11
|
|
21
|
+
### Changed
|
|
22
|
+
- 优化 [forBfsEach](src/each.ts) ,减少迭代次数
|
|
23
|
+
- 重构 [inputRegex](src/input-regex.ts) ,优先使用浏览器自带的 RegExp.escape 方法,同时对 polyfill 进行强化
|
|
24
|
+
- 升级依赖 typescript 到 6.0.3
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
## [1.7.6] - 2026-04-08
|
|
28
|
+
|
|
29
|
+
### Added
|
|
30
|
+
- 添加 [forDfsStackEach](src/each.ts) 方法,支撑在树结构中类似于统计子节点的数据量场景
|
|
31
|
+
|
|
32
|
+
### Changed
|
|
33
|
+
- [OfflineStorage](src/storage//offline.ts) 添加 @ts-ignore 忽略 ts 错误信息
|
|
34
|
+
- 将 shims.env.d.ts 重命名为 shime.env.d.ts
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
## [1.7.5] - 2026-04-03
|
|
38
|
+
|
|
39
|
+
### Added
|
|
40
|
+
- [`FlatTree.getSub`](src/flat-tree.ts) 方法支持设置参数value=null时获取所有顶级节点
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
## [1.7.4] - 2026-04-01
|
|
44
|
+
|
|
45
|
+
### Added
|
|
46
|
+
- 添加 [`FlatTree.getSub`](src/flat-tree.ts) 方法,支持获取子节点及回调处理
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
## [1.7.3] - 2026-03-25
|
|
50
|
+
|
|
51
|
+
### Changed
|
|
52
|
+
- 修改 README.md
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
## [1.7.2] - 2026-03-24
|
|
56
|
+
|
|
57
|
+
### Added
|
|
58
|
+
- 添加 [forBfsEach](src/each.ts) 和 [forDfsEach](src/each.ts) 函数及其测试
|
|
59
|
+
- 添加 [FlatTree](src/flat-tree.ts) 类及其测试,支持树结构的扁平化存储和遍历(包括 BFS 和 DFS 模式)
|
|
60
|
+
- 添加 [Union](src/union.ts) 命名空间导出,现在可通过 Union.Status 推导出 Union 实例的联合状态
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
## [1.7.1] - 2026-01-06
|
|
64
|
+
|
|
65
|
+
### Added
|
|
66
|
+
- [MemorySimple](src/memory/simple.ts) 添加 emit 配置参数
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
## [1.7.0] - 2025-11-26
|
|
70
|
+
|
|
71
|
+
### Added
|
|
72
|
+
- 添加 [asyncLock](src/async-lock.ts) 功能
|
|
73
|
+
- 添加 [calc.getExpMN](src/calc.ts) 计算函数
|
|
74
|
+
- 添加 [calc.multiply](src/calc.ts) 计算函数
|
|
75
|
+
- 添加 [calc.divide](src/calc.ts) 计算函数
|
|
76
|
+
- 添加 [disableEnumerable](src/disable-enumerable.ts) 功能
|
|
77
|
+
- 添加 [indexSort](src/index-sort.ts) 功能
|
|
78
|
+
- 添加 版本变更日志
|
|
79
|
+
|
|
80
|
+
### Fixed
|
|
81
|
+
- 修复 [Subscriber.$off](src/subscriber.ts) 实例方法调用且之前未 $once 时报错的问题
|
|
82
|
+
|
|
83
|
+
### Changed
|
|
84
|
+
- 优化 [calc.formatter](src/calc.ts) 函数
|
|
85
|
+
- 优化 [calc.clamp](src/calc.ts) 函数
|
|
86
|
+
- [MemoryBasic](src/memory/basic.ts) 添加 emit 配置项,原 list 和 memorys 属性改成 [LIST_SYMBOL] 和 [MEMORYS_SYMBOL]
|
|
87
|
+
- namespace [Memory](src/memory/basic.ts) 移到 memory/basic.ts 内
|
|
88
|
+
- 使用 AI 优化测试用例
|
|
89
|
+
- 更新 csstype 依赖到 3.2.3
|
package/dist/cron.js
CHANGED
|
@@ -11,6 +11,7 @@ class Dic {
|
|
|
11
11
|
this.keys = hash8json(dics, "key");
|
|
12
12
|
this.values = hash8json(dics, "value");
|
|
13
13
|
}
|
|
14
|
+
dics;
|
|
14
15
|
keys;
|
|
15
16
|
values;
|
|
16
17
|
item(key) {
|
|
@@ -265,6 +266,7 @@ class InvalidUnit {
|
|
|
265
266
|
constructor(isEnableInvalid) {
|
|
266
267
|
this.isEnableInvalid = isEnableInvalid;
|
|
267
268
|
}
|
|
269
|
+
isEnableInvalid;
|
|
268
270
|
text() {
|
|
269
271
|
return this.isEnableInvalid ? "?" : "*";
|
|
270
272
|
}
|
|
@@ -274,6 +276,7 @@ class LastValue {
|
|
|
274
276
|
constructor(value) {
|
|
275
277
|
this.value = value;
|
|
276
278
|
}
|
|
279
|
+
value;
|
|
277
280
|
}
|
|
278
281
|
class DayLastUnit extends LastValue {
|
|
279
282
|
text() {
|
|
@@ -299,6 +302,8 @@ class RangeUnit {
|
|
|
299
302
|
this.start = start;
|
|
300
303
|
this.stop = stop;
|
|
301
304
|
}
|
|
305
|
+
start;
|
|
306
|
+
stop;
|
|
302
307
|
text() {
|
|
303
308
|
return `${this.start}-${this.stop}`;
|
|
304
309
|
}
|
|
@@ -309,6 +314,8 @@ class AggUnit {
|
|
|
309
314
|
this.values = values;
|
|
310
315
|
this.increment = increment;
|
|
311
316
|
}
|
|
317
|
+
values;
|
|
318
|
+
increment;
|
|
312
319
|
text() {
|
|
313
320
|
const { values, increment } = this;
|
|
314
321
|
let tmp;
|
|
@@ -431,6 +438,7 @@ class Parse {
|
|
|
431
438
|
this.year = this.parse(year);
|
|
432
439
|
}
|
|
433
440
|
}
|
|
441
|
+
cron;
|
|
434
442
|
second;
|
|
435
443
|
minute;
|
|
436
444
|
hour;
|
package/dist/index.cjs.js
CHANGED
|
@@ -386,6 +386,7 @@ var Dic = class {
|
|
|
386
386
|
this.keys = hash8json(dics, "key");
|
|
387
387
|
this.values = hash8json(dics, "value");
|
|
388
388
|
}
|
|
389
|
+
dics;
|
|
389
390
|
keys;
|
|
390
391
|
values;
|
|
391
392
|
item(key) {
|
|
@@ -640,6 +641,7 @@ var InvalidUnit = class {
|
|
|
640
641
|
constructor(isEnableInvalid) {
|
|
641
642
|
this.isEnableInvalid = isEnableInvalid;
|
|
642
643
|
}
|
|
644
|
+
isEnableInvalid;
|
|
643
645
|
text() {
|
|
644
646
|
return this.isEnableInvalid ? "?" : "*";
|
|
645
647
|
}
|
|
@@ -649,6 +651,7 @@ var LastValue = class {
|
|
|
649
651
|
constructor(value) {
|
|
650
652
|
this.value = value;
|
|
651
653
|
}
|
|
654
|
+
value;
|
|
652
655
|
};
|
|
653
656
|
var DayLastUnit = class extends LastValue {
|
|
654
657
|
text() {
|
|
@@ -674,6 +677,8 @@ var RangeUnit = class {
|
|
|
674
677
|
this.start = start;
|
|
675
678
|
this.stop = stop;
|
|
676
679
|
}
|
|
680
|
+
start;
|
|
681
|
+
stop;
|
|
677
682
|
text() {
|
|
678
683
|
return `${this.start}-${this.stop}`;
|
|
679
684
|
}
|
|
@@ -684,6 +689,8 @@ var AggUnit = class {
|
|
|
684
689
|
this.values = values;
|
|
685
690
|
this.increment = increment;
|
|
686
691
|
}
|
|
692
|
+
values;
|
|
693
|
+
increment;
|
|
687
694
|
text() {
|
|
688
695
|
const { values, increment } = this;
|
|
689
696
|
let tmp;
|
|
@@ -806,6 +813,7 @@ var Parse = class {
|
|
|
806
813
|
this.year = this.parse(year);
|
|
807
814
|
}
|
|
808
815
|
}
|
|
816
|
+
cron;
|
|
809
817
|
second;
|
|
810
818
|
minute;
|
|
811
819
|
hour;
|
|
@@ -1570,8 +1578,8 @@ var loadImage = (src) => {
|
|
|
1570
1578
|
var PUSH = 1;
|
|
1571
1579
|
var RESET = 2;
|
|
1572
1580
|
var DELETE = 0;
|
|
1573
|
-
var LIST_SYMBOL = Symbol();
|
|
1574
|
-
var MEMORYS_SYMBOL = Symbol();
|
|
1581
|
+
var LIST_SYMBOL = /* @__PURE__ */ Symbol();
|
|
1582
|
+
var MEMORYS_SYMBOL = /* @__PURE__ */ Symbol();
|
|
1575
1583
|
var MemoryBasic = class _MemoryBasic {
|
|
1576
1584
|
/**
|
|
1577
1585
|
* @param key 用于对数据进行分类的key
|
|
@@ -1583,6 +1591,7 @@ var MemoryBasic = class _MemoryBasic {
|
|
|
1583
1591
|
this.#reflex = config.reflex;
|
|
1584
1592
|
this.#emit = config.emit;
|
|
1585
1593
|
}
|
|
1594
|
+
key;
|
|
1586
1595
|
static PUSH = PUSH;
|
|
1587
1596
|
static RESET = RESET;
|
|
1588
1597
|
static DELETE = DELETE;
|
|
@@ -1903,6 +1912,7 @@ var Neo4jAhchors = class {
|
|
|
1903
1912
|
this.neo4j = neo4j;
|
|
1904
1913
|
this.config = Object.assign({}, config);
|
|
1905
1914
|
}
|
|
1915
|
+
neo4j;
|
|
1906
1916
|
config;
|
|
1907
1917
|
#anchors = {};
|
|
1908
1918
|
getDir(start, end) {
|
|
@@ -2498,6 +2508,8 @@ var Union = class {
|
|
|
2498
2508
|
this.key = key;
|
|
2499
2509
|
this.formatter = formatter2;
|
|
2500
2510
|
}
|
|
2511
|
+
key;
|
|
2512
|
+
formatter;
|
|
2501
2513
|
#data = {};
|
|
2502
2514
|
#options = {};
|
|
2503
2515
|
#raws = {};
|
package/dist/memory/basic.js
CHANGED
|
@@ -2,8 +2,8 @@ import { hash8strings } from "../convert/strings";
|
|
|
2
2
|
const PUSH = 1;
|
|
3
3
|
const RESET = 2;
|
|
4
4
|
const DELETE = 0;
|
|
5
|
-
const LIST_SYMBOL = Symbol();
|
|
6
|
-
const MEMORYS_SYMBOL = Symbol();
|
|
5
|
+
const LIST_SYMBOL = /* @__PURE__ */ Symbol();
|
|
6
|
+
const MEMORYS_SYMBOL = /* @__PURE__ */ Symbol();
|
|
7
7
|
class MemoryBasic {
|
|
8
8
|
/**
|
|
9
9
|
* @param key 用于对数据进行分类的key
|
|
@@ -15,6 +15,7 @@ class MemoryBasic {
|
|
|
15
15
|
this.#reflex = config.reflex;
|
|
16
16
|
this.#emit = config.emit;
|
|
17
17
|
}
|
|
18
|
+
key;
|
|
18
19
|
static PUSH = PUSH;
|
|
19
20
|
static RESET = RESET;
|
|
20
21
|
static DELETE = DELETE;
|
package/dist/neo4j-anchors.js
CHANGED
package/dist/union.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vope/utils",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -37,40 +37,41 @@
|
|
|
37
37
|
"license": "ISC",
|
|
38
38
|
"files": [
|
|
39
39
|
"dist",
|
|
40
|
-
"sub_storage"
|
|
40
|
+
"sub_storage",
|
|
41
|
+
"CHANGELOG.md"
|
|
41
42
|
],
|
|
42
43
|
"devDependencies": {
|
|
43
|
-
"@babel/parser": "^7.
|
|
44
|
-
"@babel/traverse": "^7.
|
|
45
|
-
"@babel/types": "^7.
|
|
44
|
+
"@babel/parser": "^7.29.3",
|
|
45
|
+
"@babel/traverse": "^7.29.0",
|
|
46
|
+
"@babel/types": "^7.29.0",
|
|
46
47
|
"@rollup/plugin-alias": "^5.1.1",
|
|
47
|
-
"@rollup/plugin-commonjs": "^
|
|
48
|
+
"@rollup/plugin-commonjs": "^29.0.2",
|
|
48
49
|
"@rollup/plugin-json": "^6.1.0",
|
|
49
|
-
"@rollup/plugin-node-resolve": "^16.0.
|
|
50
|
-
"@rollup/plugin-typescript": "^12.
|
|
51
|
-
"@types/babel__traverse": "^7.
|
|
52
|
-
"@types/mocha": "^10.0.
|
|
53
|
-
"@types/node": "^
|
|
50
|
+
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
51
|
+
"@rollup/plugin-typescript": "^12.3.0",
|
|
52
|
+
"@types/babel__traverse": "^7.28.0",
|
|
53
|
+
"@types/mocha": "^10.0.10",
|
|
54
|
+
"@types/node": "^24.12.3",
|
|
54
55
|
"@types/sm-crypto": "^0.3.4",
|
|
55
|
-
"esbuild": "^0.
|
|
56
|
-
"glob": "^
|
|
57
|
-
"iconv-lite": "^0.
|
|
58
|
-
"mocha": "^
|
|
59
|
-
"puppeteer": "^24.
|
|
60
|
-
"rimraf": "^
|
|
61
|
-
"rollup": "^4.
|
|
56
|
+
"esbuild": "^0.28.0",
|
|
57
|
+
"glob": "^13.0.6",
|
|
58
|
+
"iconv-lite": "^0.7.2",
|
|
59
|
+
"mocha": "^11.7.5",
|
|
60
|
+
"puppeteer": "^24.43.0",
|
|
61
|
+
"rimraf": "^6.1.3",
|
|
62
|
+
"rollup": "^4.60.3",
|
|
62
63
|
"tslib": "^2.8.1",
|
|
63
64
|
"typescript": "^6.0.3",
|
|
64
|
-
"uuid": "^
|
|
65
|
+
"uuid": "^14.0.0"
|
|
65
66
|
},
|
|
66
67
|
"dependencies": {
|
|
67
68
|
"@type-challenges/utils": "^0.1.1",
|
|
68
69
|
"@types/lodash-es": "^4.17.12",
|
|
69
|
-
"@vope/types": "^1.
|
|
70
|
+
"@vope/types": "^1.3.0",
|
|
70
71
|
"csstype": "^3.2.3",
|
|
71
72
|
"localforage": "^1.10.0",
|
|
72
|
-
"lodash-es": "^4.
|
|
73
|
-
"sm-crypto": "^0.
|
|
73
|
+
"lodash-es": "^4.18.1",
|
|
74
|
+
"sm-crypto": "^0.4.0"
|
|
74
75
|
},
|
|
75
76
|
"pnpm": {
|
|
76
77
|
"onlyBuiltDependencies": [
|