@vope/utils 1.7.6 → 1.9.0

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.
Files changed (55) hide show
  1. package/dist/cron.js +8 -0
  2. package/dist/each.js +7 -5
  3. package/dist/index.cjs.js +33 -11
  4. package/dist/input-regex.js +12 -4
  5. package/dist/memory/basic.js +3 -2
  6. package/dist/neo4j-anchors.js +1 -0
  7. package/dist/src/input-regex.d.ts +14 -0
  8. package/dist/union.js +2 -0
  9. package/package.json +81 -81
  10. package/sub_storage/package.json +0 -1
  11. package/dist/input-regex.d.ts +0 -12
  12. /package/dist/{async-lock.d.ts → src/async-lock.d.ts} +0 -0
  13. /package/dist/{calc.d.ts → src/calc.d.ts} +0 -0
  14. /package/dist/{clamp.d.ts → src/clamp.d.ts} +0 -0
  15. /package/dist/{classnames.d.ts → src/classnames.d.ts} +0 -0
  16. /package/dist/{compare → src/compare}/version.d.ts +0 -0
  17. /package/dist/{compare → src/compare}/weak-equal.d.ts +0 -0
  18. /package/dist/{convert → src/convert}/json.d.ts +0 -0
  19. /package/dist/{convert → src/convert}/object.d.ts +0 -0
  20. /package/dist/{convert → src/convert}/strings.d.ts +0 -0
  21. /package/dist/{cron.d.ts → src/cron.d.ts} +0 -0
  22. /package/dist/{desens.d.ts → src/desens.d.ts} +0 -0
  23. /package/dist/{dic.d.ts → src/dic.d.ts} +0 -0
  24. /package/dist/{disable-enumerable.d.ts → src/disable-enumerable.d.ts} +0 -0
  25. /package/dist/{each.d.ts → src/each.d.ts} +0 -0
  26. /package/dist/{encoding.d.ts → src/encoding.d.ts} +0 -0
  27. /package/dist/{flat-tree.d.ts → src/flat-tree.d.ts} +0 -0
  28. /package/dist/{index-sort.d.ts → src/index-sort.d.ts} +0 -0
  29. /package/dist/{index.d.ts → src/index.d.ts} +0 -0
  30. /package/dist/{is → src/is}/class.d.ts +0 -0
  31. /package/dist/{is → src/is}/empty.d.ts +0 -0
  32. /package/dist/{is → src/is}/key.d.ts +0 -0
  33. /package/dist/{is → src/is}/null.d.ts +0 -0
  34. /package/dist/{load → src/load}/image.d.ts +0 -0
  35. /package/dist/{memory → src/memory}/basic.d.ts +0 -0
  36. /package/dist/{memory → src/memory}/list.d.ts +0 -0
  37. /package/dist/{memory → src/memory}/power.d.ts +0 -0
  38. /package/dist/{memory → src/memory}/simple.d.ts +0 -0
  39. /package/dist/{neo4j-anchors.d.ts → src/neo4j-anchors.d.ts} +0 -0
  40. /package/dist/{neo4j.d.ts → src/neo4j.d.ts} +0 -0
  41. /package/dist/{once.d.ts → src/once.d.ts} +0 -0
  42. /package/dist/{parse → src/parse}/num.d.ts +0 -0
  43. /package/dist/{power → src/power}/decon.d.ts +0 -0
  44. /package/dist/{rotate → src/rotate}/angle.d.ts +0 -0
  45. /package/dist/{rotate → src/rotate}/rad.d.ts +0 -0
  46. /package/dist/{serialize → src/serialize}/url-params.d.ts +0 -0
  47. /package/dist/{storage → src/storage}/offline.d.ts +0 -0
  48. /package/dist/{style → src/style}/css.d.ts +0 -0
  49. /package/dist/{subscriber.d.ts → src/subscriber.d.ts} +0 -0
  50. /package/dist/{table → src/table}/flex.d.ts +0 -0
  51. /package/dist/{union.d.ts → src/union.d.ts} +0 -0
  52. /package/dist/{url → src/url}/join.d.ts +0 -0
  53. /package/dist/{url → src/url}/params.d.ts +0 -0
  54. /package/dist/{wait.d.ts → src/wait.d.ts} +0 -0
  55. /package/sub_storage/{offline.d.ts → src/storage/offline.d.ts} +0 -0
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/each.js CHANGED
@@ -1,9 +1,11 @@
1
1
  const forBfsEach = (list, up, callback) => {
2
- const stack = Array.isArray(list) ? list.slice() : Array.from(list);
3
- for (const value of stack) {
4
- if (!callback(value)) break;
5
- const result = up(value);
6
- result === void 0 || stack.push(...result);
2
+ const stack = [list];
3
+ for (const list2 of stack) {
4
+ for (const value of list2) {
5
+ if (!callback(value)) break;
6
+ const result = up(value);
7
+ result === void 0 || stack.push(result);
8
+ }
7
9
  }
8
10
  };
9
11
  const reverseMergeIn = (from, to = []) => {
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;
@@ -1173,11 +1181,13 @@ var disable_enumerable_default = (data, key) => {
1173
1181
 
1174
1182
  // src/each.ts
1175
1183
  var forBfsEach = (list, up, callback) => {
1176
- const stack = Array.isArray(list) ? list.slice() : Array.from(list);
1177
- for (const value of stack) {
1178
- if (!callback(value)) break;
1179
- const result = up(value);
1180
- result === void 0 || stack.push(...result);
1184
+ const stack = [list];
1185
+ for (const list2 of stack) {
1186
+ for (const value of list2) {
1187
+ if (!callback(value)) break;
1188
+ const result = up(value);
1189
+ result === void 0 || stack.push(result);
1190
+ }
1181
1191
  }
1182
1192
  };
1183
1193
  var reverseMergeIn = (from, to = []) => {
@@ -1513,10 +1523,18 @@ var index_sort_default = (list, key) => {
1513
1523
  };
1514
1524
 
1515
1525
  // src/input-regex.ts
1516
- var RE_REGEX = /[$()*+.[?\\^{|]/g;
1517
- var RE_STRING = /[$()*+.[?\\^{|-]/g;
1518
- function inputRegex(text, flags) {
1519
- return flags === false ? text.replace(RE_STRING, ($0) => "\\" + $0) : new RegExp(text.replace(RE_REGEX, ($0) => "\\" + $0), flags);
1526
+ var spaces = {
1527
+ "\f": "f",
1528
+ "\n": "n",
1529
+ "\r": "r",
1530
+ " ": "t",
1531
+ "\v": "v"
1532
+ };
1533
+ var RE_REGEX = /(^[\d\a-zA-Z]|[-,=<>#&!%:;@~'`" ])|([$\\.*+^?()[\]{}|/])|([\f\n\r\t\v])/g;
1534
+ function inputRegex(text, flags, polyfill) {
1535
+ const { escape } = RegExp;
1536
+ const tmp = !polyfill && escape ? escape(text) : text.replace(RE_REGEX, ($0, $1, $2) => "\\" + ($1 ? "x" + $0.charCodeAt(0).toString(16) : $2 ? $0 : spaces[$0]));
1537
+ return flags === false ? tmp : new RegExp(tmp, flags);
1520
1538
  }
1521
1539
 
1522
1540
  // src/is/class.ts
@@ -1560,8 +1578,8 @@ var loadImage = (src) => {
1560
1578
  var PUSH = 1;
1561
1579
  var RESET = 2;
1562
1580
  var DELETE = 0;
1563
- var LIST_SYMBOL = Symbol();
1564
- var MEMORYS_SYMBOL = Symbol();
1581
+ var LIST_SYMBOL = /* @__PURE__ */ Symbol();
1582
+ var MEMORYS_SYMBOL = /* @__PURE__ */ Symbol();
1565
1583
  var MemoryBasic = class _MemoryBasic {
1566
1584
  /**
1567
1585
  * @param key 用于对数据进行分类的key
@@ -1573,6 +1591,7 @@ var MemoryBasic = class _MemoryBasic {
1573
1591
  this.#reflex = config.reflex;
1574
1592
  this.#emit = config.emit;
1575
1593
  }
1594
+ key;
1576
1595
  static PUSH = PUSH;
1577
1596
  static RESET = RESET;
1578
1597
  static DELETE = DELETE;
@@ -1893,6 +1912,7 @@ var Neo4jAhchors = class {
1893
1912
  this.neo4j = neo4j;
1894
1913
  this.config = Object.assign({}, config);
1895
1914
  }
1915
+ neo4j;
1896
1916
  config;
1897
1917
  #anchors = {};
1898
1918
  getDir(start, end) {
@@ -2488,6 +2508,8 @@ var Union = class {
2488
2508
  this.key = key;
2489
2509
  this.formatter = formatter2;
2490
2510
  }
2511
+ key;
2512
+ formatter;
2491
2513
  #data = {};
2492
2514
  #options = {};
2493
2515
  #raws = {};
@@ -1,7 +1,15 @@
1
- const RE_REGEX = /[$()*+.[?\\^{|]/g;
2
- const RE_STRING = /[$()*+.[?\\^{|-]/g;
3
- function inputRegex(text, flags) {
4
- return flags === false ? text.replace(RE_STRING, ($0) => "\\" + $0) : new RegExp(text.replace(RE_REGEX, ($0) => "\\" + $0), flags);
1
+ const spaces = {
2
+ "\f": "f",
3
+ "\n": "n",
4
+ "\r": "r",
5
+ " ": "t",
6
+ "\v": "v"
7
+ };
8
+ const RE_REGEX = /(^[\d\a-zA-Z]|[-,=<>#&!%:;@~'`" ])|([$\\.*+^?()[\]{}|/])|([\f\n\r\t\v])/g;
9
+ function inputRegex(text, flags, polyfill) {
10
+ const { escape } = RegExp;
11
+ const tmp = !polyfill && escape ? escape(text) : text.replace(RE_REGEX, ($0, $1, $2) => "\\" + ($1 ? "x" + $0.charCodeAt(0).toString(16) : $2 ? $0 : spaces[$0]));
12
+ return flags === false ? tmp : new RegExp(tmp, flags);
5
13
  }
6
14
  export {
7
15
  inputRegex
@@ -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;
@@ -4,6 +4,7 @@ class Neo4jAhchors {
4
4
  this.neo4j = neo4j;
5
5
  this.config = Object.assign({}, config);
6
6
  }
7
+ neo4j;
7
8
  config;
8
9
  #anchors = {};
9
10
  getDir(start, end) {
@@ -0,0 +1,14 @@
1
+ /**
2
+ * 处理输入文本中的特殊字符,用于转换正则表达式
3
+ * @param text
4
+ * @param flags 表示输出正则表达式
5
+ * @param polyfill 是否强制使用polyfill,默认为自动兼容,该参数主要在测试代码环境中使用
6
+ */
7
+ export declare function inputRegex(text: string, flags?: string, polyfill?: boolean): RegExp;
8
+ /**
9
+ * 处理输入文本中的特殊字符,用于转换正则表达式
10
+ * @param text
11
+ * @param flags 表示输出字符串,该字符串将作为正则表达式的一部分
12
+ * @param polyfill 是否强制使用polyfill,默认为自动兼容,该参数主要在测试代码环境中使用
13
+ */
14
+ export declare function inputRegex(text: string, flags: false, polyfill?: boolean): string;
package/dist/union.js CHANGED
@@ -3,6 +3,8 @@ class Union {
3
3
  this.key = key;
4
4
  this.formatter = formatter;
5
5
  }
6
+ key;
7
+ formatter;
6
8
  #data = {};
7
9
  #options = {};
8
10
  #raws = {};
package/package.json CHANGED
@@ -1,81 +1,81 @@
1
- {
2
- "name": "@vope/utils",
3
- "version": "1.7.6",
4
- "description": "",
5
- "publishConfig": {
6
- "access": "public",
7
- "registry": "https://registry.npmjs.org/"
8
- },
9
- "types": "./dist/index.d.ts",
10
- "typings": "./dist/index.d.ts",
11
- "module": "./dist/index.js",
12
- "main": "./dist/index.js",
13
- "scripts": {
14
- "start": "esbuild ./start.ts --outfile=start.cjs --format=cjs & node ./start.cjs",
15
- "poststart": "esbuild ./pre.ts --outfile=pre.cjs --format=cjs & node ./pre.cjs",
16
- "build": "npm run start & node ./build.cjs",
17
- "premocha": "node ./build.cjs --type=test",
18
- "mocha": "mocha __tests/**/*.js",
19
- "test": "npm run mocha",
20
- "prepublishOnly": "npm run build & npm run test",
21
- "debug": "npm run start & npm run premocha",
22
- "clean": "rimraf start.cjs pre.cjs build.cjs src/index.ts dist/ __tests/ __examples/ sub_storage/"
23
- },
24
- "exports": {
25
- ".": {
26
- "types": "./dist/index.d.ts",
27
- "import": "./dist/index.js",
28
- "require": "./dist/index.cjs.js"
29
- },
30
- "./storage": {
31
- "types": "./sub_storage/offline.d.ts",
32
- "import": "./sub_storage/offline.js",
33
- "require": "./sub_storage/offline.cjs.js"
34
- }
35
- },
36
- "author": "vope",
37
- "license": "ISC",
38
- "files": [
39
- "dist",
40
- "sub_storage"
41
- ],
42
- "devDependencies": {
43
- "@babel/parser": "^7.26.9",
44
- "@babel/traverse": "^7.26.9",
45
- "@babel/types": "^7.26.9",
46
- "@rollup/plugin-alias": "^5.1.1",
47
- "@rollup/plugin-commonjs": "^28.0.2",
48
- "@rollup/plugin-json": "^6.1.0",
49
- "@rollup/plugin-node-resolve": "^16.0.0",
50
- "@rollup/plugin-typescript": "^12.1.2",
51
- "@types/babel__traverse": "^7.20.6",
52
- "@types/mocha": "^10.0.6",
53
- "@types/node": "^22.13.5",
54
- "@types/sm-crypto": "^0.3.4",
55
- "esbuild": "^0.25.0",
56
- "glob": "^11.0.1",
57
- "iconv-lite": "^0.6.3",
58
- "mocha": "^10.2.0",
59
- "puppeteer": "^24.3.0",
60
- "rimraf": "^5.0.5",
61
- "rollup": "^4.34.8",
62
- "tslib": "^2.8.1",
63
- "typescript": "^5.9.2",
64
- "uuid": "^11.1.0"
65
- },
66
- "dependencies": {
67
- "@type-challenges/utils": "^0.1.1",
68
- "@types/lodash-es": "^4.17.12",
69
- "@vope/types": "^1.2.0",
70
- "csstype": "^3.2.3",
71
- "localforage": "^1.10.0",
72
- "lodash-es": "^4.17.21",
73
- "sm-crypto": "^0.3.13"
74
- },
75
- "pnpm": {
76
- "onlyBuiltDependencies": [
77
- "esbuild",
78
- "puppeteer"
79
- ]
80
- }
81
- }
1
+ {
2
+ "name": "@vope/utils",
3
+ "version": "1.9.0",
4
+ "description": "",
5
+ "publishConfig": {
6
+ "access": "public",
7
+ "registry": "https://registry.npmjs.org/"
8
+ },
9
+ "types": "./dist/index.d.ts",
10
+ "typings": "./dist/index.d.ts",
11
+ "module": "./dist/index.js",
12
+ "main": "./dist/index.js",
13
+ "scripts": {
14
+ "start": "esbuild ./start.ts --outfile=start.cjs --format=cjs & node ./start.cjs",
15
+ "poststart": "esbuild ./pre.ts --outfile=pre.cjs --format=cjs & node ./pre.cjs",
16
+ "build": "npm run start & node ./build.cjs",
17
+ "premocha": "node ./build.cjs --type=test",
18
+ "mocha": "mocha __tests/**/*.js",
19
+ "test": "npm run mocha",
20
+ "prepublishOnly": "npm run build & npm run test",
21
+ "debug": "npm run start & npm run premocha",
22
+ "clean": "rimraf start.cjs pre.cjs build.cjs src/index.ts dist/ __tests/ __examples/ sub_storage/"
23
+ },
24
+ "exports": {
25
+ ".": {
26
+ "types": "./dist/index.d.ts",
27
+ "import": "./dist/index.js",
28
+ "require": "./dist/index.cjs.js"
29
+ },
30
+ "./storage": {
31
+ "types": "./sub_storage/offline.d.ts",
32
+ "import": "./sub_storage/offline.js",
33
+ "require": "./sub_storage/offline.cjs.js"
34
+ }
35
+ },
36
+ "author": "vope",
37
+ "license": "ISC",
38
+ "files": [
39
+ "dist",
40
+ "sub_storage"
41
+ ],
42
+ "devDependencies": {
43
+ "@babel/parser": "^7.29.3",
44
+ "@babel/traverse": "^7.29.0",
45
+ "@babel/types": "^7.29.0",
46
+ "@rollup/plugin-alias": "^5.1.1",
47
+ "@rollup/plugin-commonjs": "^29.0.2",
48
+ "@rollup/plugin-json": "^6.1.0",
49
+ "@rollup/plugin-node-resolve": "^16.0.3",
50
+ "@rollup/plugin-typescript": "^12.3.0",
51
+ "@types/babel__traverse": "^7.28.0",
52
+ "@types/mocha": "^10.0.10",
53
+ "@types/node": "^24.12.3",
54
+ "@types/sm-crypto": "^0.3.4",
55
+ "esbuild": "^0.28.0",
56
+ "glob": "^13.0.6",
57
+ "iconv-lite": "^0.7.2",
58
+ "mocha": "^11.7.5",
59
+ "puppeteer": "^24.43.0",
60
+ "rimraf": "^6.1.3",
61
+ "rollup": "^4.60.3",
62
+ "tslib": "^2.8.1",
63
+ "typescript": "^6.0.3",
64
+ "uuid": "^14.0.0"
65
+ },
66
+ "dependencies": {
67
+ "@type-challenges/utils": "^0.1.1",
68
+ "@types/lodash-es": "^4.17.12",
69
+ "@vope/types": "^1.3.0",
70
+ "csstype": "^3.2.3",
71
+ "localforage": "^1.10.0",
72
+ "lodash-es": "^4.18.1",
73
+ "sm-crypto": "^0.4.0"
74
+ },
75
+ "pnpm": {
76
+ "onlyBuiltDependencies": [
77
+ "esbuild",
78
+ "puppeteer"
79
+ ]
80
+ }
81
+ }
@@ -1,5 +1,4 @@
1
1
  {
2
- "types": "offline.d.ts",
3
2
  "import": "offline.js",
4
3
  "require": "offline.cjs.js"
5
4
  }
@@ -1,12 +0,0 @@
1
- /**
2
- * 处理输入文本中的特殊字符,用于转换正则表达式
3
- * @param text
4
- * @param flags 表示输出正则表达式
5
- */
6
- export declare function inputRegex(text: string, flags?: string): RegExp;
7
- /**
8
- * 处理输入文本中的特殊字符,用于转换正则表达式
9
- * @param text
10
- * @param flags 表示输出字符串,该字符串将作为正则表达式的一部分
11
- */
12
- export declare function inputRegex(text: string, flags: false): string;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes