@vope/utils 1.6.2 → 1.6.4
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/calc.d.ts +13 -0
- package/dist/calc.js +22 -0
- package/dist/cron.d.ts +74 -35
- package/dist/cron.js +65 -65
- package/dist/dic.d.ts +31 -0
- package/dist/dic.js +94 -0
- package/dist/index.cjs.js +202 -88
- package/dist/index.d.ts +3 -1
- package/dist/index.js +24 -19
- package/dist/parse/num.js +5 -4
- package/package.json +81 -81
- package/sub_storage/offline.cjs.js +0 -1
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isCalc, calc } from "./calc";
|
|
1
2
|
import { clamp } from "./clamp";
|
|
2
3
|
import { classnames } from "./classnames";
|
|
3
4
|
import { compareVersion } from "./compare/version";
|
|
@@ -5,8 +6,9 @@ import { deepWeakEqual } from "./compare/weak-equal";
|
|
|
5
6
|
import { hash8json } from "./convert/json";
|
|
6
7
|
import { hash8object } from "./convert/object";
|
|
7
8
|
import { hash8strings } from "./convert/strings";
|
|
8
|
-
import { weekDic, default_max_second, default_min_second, default_max_minute, default_min_minute, default_max_hour, default_min_hour, default_max_day, default_min_day, default_max_month, default_min_month, default_max_week, default_min_week, createCronRegexText,
|
|
9
|
+
import { weekDic, default_max_second, default_min_second, default_max_minute, default_min_minute, default_max_hour, default_min_hour, default_max_day, default_min_day, default_max_month, default_min_month, default_max_week, default_min_week, createCronRegexText, InvalidUnit, isInvalidUnit, DayLastUnit, isDayLastUnit, WeekLastUnit, isWeekLastUnit, WildcardUnit, isWildcardUnit, RangeUnit, isRangeUnit, AggUnit, isAggUnit, Cron } from "./cron";
|
|
9
10
|
import { desensEncrypt, desensDecrypt, desensReplace } from "./desens";
|
|
11
|
+
import { default as default2 } from "./dic";
|
|
10
12
|
import { getEncoding } from "./encoding";
|
|
11
13
|
import { inputRegex } from "./input-regex";
|
|
12
14
|
import { isClass } from "./is/class";
|
|
@@ -18,8 +20,8 @@ import { MemoryBasic } from "./memory/basic";
|
|
|
18
20
|
import { MemoryList } from "./memory/list";
|
|
19
21
|
import { MemoryPower } from "./memory/power";
|
|
20
22
|
import { MemorySimple } from "./memory/simple";
|
|
21
|
-
import { default as
|
|
22
|
-
import { default as
|
|
23
|
+
import { default as default3 } from "./neo4j-anchors";
|
|
24
|
+
import { default as default4 } from "./neo4j";
|
|
23
25
|
import { once } from "./once";
|
|
24
26
|
import { parseNum } from "./parse/num";
|
|
25
27
|
import { deconPowersSum } from "./power/decon";
|
|
@@ -27,29 +29,31 @@ import { rotateAngle } from "./rotate/angle";
|
|
|
27
29
|
import { rotateRad } from "./rotate/rad";
|
|
28
30
|
import { cubeURLParams, flatURLParams } from "./serialize/url-params";
|
|
29
31
|
import { css } from "./style/css";
|
|
30
|
-
import { default as
|
|
32
|
+
import { default as default5 } from "./subscriber";
|
|
31
33
|
import { FlexTable } from "./table/flex";
|
|
32
34
|
import { Union } from "./union";
|
|
33
35
|
import { joinPaths } from "./url/join";
|
|
34
36
|
import { connectURLParams } from "./url/params";
|
|
35
37
|
import { wait } from "./wait";
|
|
36
38
|
export {
|
|
39
|
+
AggUnit,
|
|
37
40
|
Cron,
|
|
38
|
-
|
|
39
|
-
|
|
41
|
+
DayLastUnit,
|
|
42
|
+
default2 as DicRollup,
|
|
40
43
|
FlexTable,
|
|
41
|
-
|
|
44
|
+
InvalidUnit,
|
|
42
45
|
MemoryBasic,
|
|
43
46
|
MemoryList,
|
|
44
47
|
MemoryPower,
|
|
45
48
|
MemorySimple,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
default4 as Neo4j,
|
|
50
|
+
default3 as Neo4jAhchors,
|
|
51
|
+
RangeUnit,
|
|
52
|
+
default5 as Subscriber,
|
|
50
53
|
Union,
|
|
51
|
-
|
|
52
|
-
|
|
54
|
+
WeekLastUnit,
|
|
55
|
+
WildcardUnit,
|
|
56
|
+
calc,
|
|
53
57
|
clamp,
|
|
54
58
|
classnames,
|
|
55
59
|
compareVersion,
|
|
@@ -80,16 +84,17 @@ export {
|
|
|
80
84
|
hash8object,
|
|
81
85
|
hash8strings,
|
|
82
86
|
inputRegex,
|
|
87
|
+
isAggUnit,
|
|
88
|
+
isCalc,
|
|
83
89
|
isClass,
|
|
84
|
-
|
|
85
|
-
isDigitsValue,
|
|
90
|
+
isDayLastUnit,
|
|
86
91
|
isEmpty,
|
|
87
|
-
|
|
92
|
+
isInvalidUnit,
|
|
88
93
|
isKey,
|
|
89
94
|
isNull,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
95
|
+
isRangeUnit,
|
|
96
|
+
isWeekLastUnit,
|
|
97
|
+
isWildcardUnit,
|
|
93
98
|
joinPaths,
|
|
94
99
|
loadImage,
|
|
95
100
|
once,
|
package/dist/parse/num.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { isNumber } from "lodash-es";
|
|
2
|
-
const
|
|
2
|
+
const { MAX_SAFE_INTEGER, NaN } = Number;
|
|
3
|
+
const pow = Math.floor(Math.log10(MAX_SAFE_INTEGER));
|
|
3
4
|
const re_num = /^([-+]?)0*(\d+)(?:(n)|(?:\.(\d+))?(?:[Ee]([-+]?)(\d+))?)$/;
|
|
4
5
|
const parseNum = (num) => {
|
|
5
6
|
if (isNumber(num) || typeof num === "bigint") return num;
|
|
6
7
|
const match = num.match(re_num);
|
|
7
|
-
if (!match) return
|
|
8
|
+
if (!match) return NaN;
|
|
8
9
|
const [, valueSymbol, integer, bigint, decimal, powSymbol, powValue] = match;
|
|
9
10
|
if (bigint === "n") return BigInt(valueSymbol + integer);
|
|
10
11
|
const powSize = integer.length - 1 + (powValue ? powSymbol === "-" ? -powValue : +powValue : 0);
|
|
11
|
-
if (powSize < pow || powSize === pow && +integer.slice(0, -1) <
|
|
12
|
+
if (powSize < pow || powSize === pow && +integer.slice(0, -1) < MAX_SAFE_INTEGER / 10) return +num;
|
|
12
13
|
try {
|
|
13
14
|
const bigValue = BigInt(integer.slice(0, powSize + 1).padEnd(powSize + 1, "0"));
|
|
14
15
|
let smallValue;
|
|
@@ -23,7 +24,7 @@ const parseNum = (num) => {
|
|
|
23
24
|
const value = bigValue + smallValue;
|
|
24
25
|
return valueSymbol === "-" ? value * BigInt(-1) : value;
|
|
25
26
|
} catch {
|
|
26
|
-
return
|
|
27
|
+
return NaN;
|
|
27
28
|
}
|
|
28
29
|
};
|
|
29
30
|
export {
|
package/package.json
CHANGED
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@vope/utils",
|
|
3
|
-
"version": "1.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.
|
|
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.1.
|
|
70
|
-
"csstype": "^3.1.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.6.4",
|
|
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.1.2",
|
|
70
|
+
"csstype": "^3.1.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
|
+
}
|