@vef-framework/shared 2.0.4 → 2.0.6
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/cjs/color/color-ops.cjs +1 -76
- package/dist/cjs/color/index.cjs +1 -24
- package/dist/cjs/color/name.cjs +1 -49
- package/dist/cjs/color/palette.cjs +1 -126
- package/dist/cjs/constants/color-names.cjs +1 -1580
- package/dist/cjs/constants/color-palettes.cjs +1 -372
- package/dist/cjs/constants/index.cjs +1 -14
- package/dist/cjs/index.cjs +1 -339
- package/dist/cjs/types/color.cjs +1 -3
- package/dist/cjs/types/common.cjs +1 -3
- package/dist/cjs/types/deep-keys.cjs +1 -3
- package/dist/cjs/types/index.cjs +1 -7
- package/dist/cjs/utils/chrono.cjs +1 -139
- package/dist/cjs/utils/equal.cjs +1 -175
- package/dist/cjs/utils/error.cjs +3 -60
- package/dist/cjs/utils/event.cjs +1 -62
- package/dist/cjs/utils/format.cjs +1 -31
- package/dist/cjs/utils/function.cjs +1 -49
- package/dist/cjs/utils/id.cjs +1 -38
- package/dist/cjs/utils/index.cjs +1 -86
- package/dist/cjs/utils/key.cjs +1 -34
- package/dist/cjs/utils/lib.cjs +1 -234
- package/dist/cjs/utils/object.cjs +1 -20
- package/dist/cjs/utils/path.cjs +1 -63
- package/dist/cjs/utils/pinyin.cjs +1 -53
- package/dist/cjs/utils/security.cjs +1 -44
- package/dist/cjs/utils/string.cjs +1 -13
- package/dist/cjs/utils/task.cjs +1 -17
- package/dist/cjs/utils/tree.cjs +1 -262
- package/dist/cjs/utils/zod.cjs +1 -14
- package/dist/es/color/color-ops.js +64 -58
- package/dist/es/color/index.js +18 -4
- package/dist/es/color/name.js +24 -37
- package/dist/es/color/palette.js +67 -100
- package/dist/es/constants/color-names.js +6 -9
- package/dist/es/constants/color-palettes.js +8 -15
- package/dist/es/constants/index.js +8 -3
- package/dist/es/index.js +165 -30
- package/dist/es/types/color.js +1 -1
- package/dist/es/types/common.js +1 -1
- package/dist/es/types/deep-keys.js +1 -1
- package/dist/es/types/index.js +3 -4
- package/dist/es/utils/chrono.js +71 -88
- package/dist/es/utils/equal.js +111 -161
- package/dist/es/utils/error.js +28 -25
- package/dist/es/utils/event.js +18 -23
- package/dist/es/utils/format.js +16 -22
- package/dist/es/utils/function.js +32 -32
- package/dist/es/utils/id.js +18 -27
- package/dist/es/utils/index.js +80 -18
- package/dist/es/utils/key.js +19 -25
- package/dist/es/utils/lib.js +64 -10
- package/dist/es/utils/object.js +11 -14
- package/dist/es/utils/path.js +57 -48
- package/dist/es/utils/pinyin.js +28 -29
- package/dist/es/utils/security.js +29 -37
- package/dist/es/utils/string.js +7 -8
- package/dist/es/utils/task.js +7 -12
- package/dist/es/utils/tree.js +156 -219
- package/dist/es/utils/zod.js +7 -6
- package/package.json +1 -1
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return fn.constructor.name === "AsyncFunction" || Object.prototype.toString.call(fn) === "[object AsyncFunction]" || fn.toString().startsWith("async ");
|
|
1
|
+
function m(t) {
|
|
2
|
+
return t.constructor.name === "AsyncFunction" || Object.prototype.toString.call(t) === "[object AsyncFunction]" || t.toString().startsWith("async ");
|
|
4
3
|
}
|
|
5
|
-
async function
|
|
4
|
+
async function y(t, e, c) {
|
|
6
5
|
const {
|
|
7
|
-
onInvoke,
|
|
8
|
-
onSuccess,
|
|
9
|
-
onError,
|
|
10
|
-
onFinally
|
|
11
|
-
} =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
let context;
|
|
6
|
+
onInvoke: i,
|
|
7
|
+
onSuccess: s,
|
|
8
|
+
onError: l,
|
|
9
|
+
onFinally: u
|
|
10
|
+
} = c, r = t(...e);
|
|
11
|
+
if (r instanceof Promise) {
|
|
12
|
+
let o;
|
|
15
13
|
try {
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
onError?.(error, context);
|
|
22
|
-
throw error;
|
|
14
|
+
o = i?.();
|
|
15
|
+
const n = await r;
|
|
16
|
+
return s?.(n, o), n;
|
|
17
|
+
} catch (n) {
|
|
18
|
+
throw l?.(n, o), n;
|
|
23
19
|
} finally {
|
|
24
|
-
|
|
20
|
+
u?.(o);
|
|
25
21
|
}
|
|
26
|
-
} else
|
|
27
|
-
return
|
|
28
|
-
}
|
|
22
|
+
} else
|
|
23
|
+
return r;
|
|
29
24
|
}
|
|
30
|
-
function
|
|
31
|
-
return
|
|
25
|
+
function p(t) {
|
|
26
|
+
return t;
|
|
32
27
|
}
|
|
33
|
-
function
|
|
34
|
-
return () =>
|
|
28
|
+
function w(t) {
|
|
29
|
+
return () => a(t);
|
|
35
30
|
}
|
|
36
|
-
function
|
|
37
|
-
const
|
|
38
|
-
throw new Error(
|
|
31
|
+
function a(t) {
|
|
32
|
+
const e = t ? `${t} not implemented` : "Not implemented";
|
|
33
|
+
throw new Error(e);
|
|
39
34
|
}
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
export {
|
|
36
|
+
w as createThrowNotImplementedFn,
|
|
37
|
+
p as identity,
|
|
38
|
+
y as invokeAwaitableFn,
|
|
39
|
+
m as isAsyncFunction,
|
|
40
|
+
a as throwNotImplemented
|
|
41
|
+
};
|
package/dist/es/utils/id.js
CHANGED
|
@@ -1,34 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
function isFingerprintSupported() {
|
|
6
|
-
if (isNullish(navigator)) {
|
|
7
|
-
return false;
|
|
8
|
-
}
|
|
9
|
-
if (navigator.userAgent.includes("jsdom")) {
|
|
10
|
-
return false;
|
|
11
|
-
}
|
|
12
|
-
return true;
|
|
1
|
+
import { init as r } from "@paralleldrive/cuid2";
|
|
2
|
+
import { isNullish as n } from "radashi";
|
|
3
|
+
function o() {
|
|
4
|
+
return !(n(navigator) || navigator.userAgent.includes("jsdom"));
|
|
13
5
|
}
|
|
14
|
-
let
|
|
6
|
+
let e = r({
|
|
15
7
|
length: 16,
|
|
16
8
|
// vef-framework default fingerprint
|
|
17
9
|
fingerprint: "0cd902ccad1f26c27b8db84af2282b7b"
|
|
18
10
|
});
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
fingerprint
|
|
25
|
-
});
|
|
26
|
-
}).catch((error) => {
|
|
27
|
-
console.error("Failed to initialize fingerprint:", error);
|
|
11
|
+
o() && import("@fingerprintjs/fingerprintjs").then(({ load: t }) => t()).then((t) => t.get()).then((t) => {
|
|
12
|
+
const i = t.visitorId;
|
|
13
|
+
e = r({
|
|
14
|
+
length: 16,
|
|
15
|
+
fingerprint: i
|
|
28
16
|
});
|
|
17
|
+
}).catch((t) => {
|
|
18
|
+
console.error("Failed to initialize fingerprint:", t);
|
|
19
|
+
});
|
|
20
|
+
function c() {
|
|
21
|
+
return e();
|
|
29
22
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export { generateId };
|
|
23
|
+
export {
|
|
24
|
+
c as generateId
|
|
25
|
+
};
|
package/dist/es/utils/index.js
CHANGED
|
@@ -1,18 +1,80 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { DEFAULT_DATETIME_FORMAT as o, DEFAULT_DATE_FORMAT as a, DEFAULT_TIME_FORMAT as i, LOCALIZED_DATETIME_FORMAT as m, LOCALIZED_DATE_FORMAT as n, formatDate as s, formatDuration as p, getLocalizedDateTime as T, getNow as f, getNowDateString as l, getNowDateTimeString as g, getNowTimeString as E, getTemporalFormats as A, parseDate as D, tryParseDate as h } from "./chrono.js";
|
|
2
|
+
import { isDeepEqual as c, isShallowEqual as F } from "./equal.js";
|
|
3
|
+
import { filterUserFrame as S, getCurrentStack as d, getCurrentStackSync as u, getSanitizedErrorStack as w, parseErrorStack as N } from "./error.js";
|
|
4
|
+
import { EventEmitter as I, createEventEmitter as _ } from "./event.js";
|
|
5
|
+
import { formatBytes as L, formatNumber as R } from "./format.js";
|
|
6
|
+
import { createThrowNotImplementedFn as k, identity as v, invokeAwaitableFn as U, isAsyncFunction as C, throwNotImplemented as b } from "./function.js";
|
|
7
|
+
import { generateId as q } from "./id.js";
|
|
8
|
+
import { hashKey as W } from "./key.js";
|
|
9
|
+
import { alwaysFalse as j, alwaysTrue as K } from "./lib.js";
|
|
10
|
+
import { mergeWith as H } from "./object.js";
|
|
11
|
+
import { formatPath as Q, getBaseName as V, getDirName as X, getExtName as Y, getRelativePath as $, isAbsolutePath as ee, joinPaths as te, normalizePath as re, parsePath as oe, pathSeparator as ae, resolvePath as ie } from "./path.js";
|
|
12
|
+
import { getPinyin as ne, getPinyinInitials as se, withPinyin as pe } from "./pinyin.js";
|
|
13
|
+
import { decryptUsingRSA as fe, encryptUsingRSA as le } from "./security.js";
|
|
14
|
+
import { constantCase as Ee } from "./string.js";
|
|
15
|
+
import { scheduleMicrotask as De } from "./task.js";
|
|
16
|
+
import { buildTree as xe, filterTree as ce, filterTreeWithAncestors as Fe, findNodeInTree as ye, flattenTree as Se, mapTree as de, traverseTree as ue } from "./tree.js";
|
|
17
|
+
import "./zod.js";
|
|
18
|
+
export {
|
|
19
|
+
o as DEFAULT_DATETIME_FORMAT,
|
|
20
|
+
a as DEFAULT_DATE_FORMAT,
|
|
21
|
+
i as DEFAULT_TIME_FORMAT,
|
|
22
|
+
I as EventEmitter,
|
|
23
|
+
m as LOCALIZED_DATETIME_FORMAT,
|
|
24
|
+
n as LOCALIZED_DATE_FORMAT,
|
|
25
|
+
j as alwaysFalse,
|
|
26
|
+
K as alwaysTrue,
|
|
27
|
+
xe as buildTree,
|
|
28
|
+
Ee as constantCase,
|
|
29
|
+
_ as createEventEmitter,
|
|
30
|
+
k as createThrowNotImplementedFn,
|
|
31
|
+
fe as decryptUsingRSA,
|
|
32
|
+
le as encryptUsingRSA,
|
|
33
|
+
ce as filterTree,
|
|
34
|
+
Fe as filterTreeWithAncestors,
|
|
35
|
+
S as filterUserFrame,
|
|
36
|
+
ye as findNodeInTree,
|
|
37
|
+
Se as flattenTree,
|
|
38
|
+
L as formatBytes,
|
|
39
|
+
s as formatDate,
|
|
40
|
+
p as formatDuration,
|
|
41
|
+
R as formatNumber,
|
|
42
|
+
Q as formatPath,
|
|
43
|
+
q as generateId,
|
|
44
|
+
V as getBaseName,
|
|
45
|
+
d as getCurrentStack,
|
|
46
|
+
u as getCurrentStackSync,
|
|
47
|
+
X as getDirName,
|
|
48
|
+
Y as getExtName,
|
|
49
|
+
T as getLocalizedDateTime,
|
|
50
|
+
f as getNow,
|
|
51
|
+
l as getNowDateString,
|
|
52
|
+
g as getNowDateTimeString,
|
|
53
|
+
E as getNowTimeString,
|
|
54
|
+
ne as getPinyin,
|
|
55
|
+
se as getPinyinInitials,
|
|
56
|
+
$ as getRelativePath,
|
|
57
|
+
w as getSanitizedErrorStack,
|
|
58
|
+
A as getTemporalFormats,
|
|
59
|
+
W as hashKey,
|
|
60
|
+
v as identity,
|
|
61
|
+
U as invokeAwaitableFn,
|
|
62
|
+
ee as isAbsolutePath,
|
|
63
|
+
C as isAsyncFunction,
|
|
64
|
+
c as isDeepEqual,
|
|
65
|
+
F as isShallowEqual,
|
|
66
|
+
te as joinPaths,
|
|
67
|
+
de as mapTree,
|
|
68
|
+
H as mergeWith,
|
|
69
|
+
re as normalizePath,
|
|
70
|
+
D as parseDate,
|
|
71
|
+
N as parseErrorStack,
|
|
72
|
+
oe as parsePath,
|
|
73
|
+
ae as pathSeparator,
|
|
74
|
+
ie as resolvePath,
|
|
75
|
+
De as scheduleMicrotask,
|
|
76
|
+
b as throwNotImplemented,
|
|
77
|
+
ue as traverseTree,
|
|
78
|
+
h as tryParseDate,
|
|
79
|
+
pe as withPinyin
|
|
80
|
+
};
|
package/dist/es/utils/key.js
CHANGED
|
@@ -1,30 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
function hashKey(key) {
|
|
1
|
+
import "./lib.js";
|
|
2
|
+
import { isPlainObject as c } from "radashi";
|
|
3
|
+
function m(n) {
|
|
6
4
|
return JSON.stringify(
|
|
7
|
-
|
|
8
|
-
(
|
|
9
|
-
if (
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
for (const key2 of Object.keys(symbolResult).toSorted()) {
|
|
21
|
-
result[`@@${key2}`] = symbolResult[key2];
|
|
22
|
-
}
|
|
23
|
-
return result;
|
|
5
|
+
n,
|
|
6
|
+
(f, o) => {
|
|
7
|
+
if (c(o)) {
|
|
8
|
+
const e = Object.keys(o).toSorted(), y = Object.getOwnPropertySymbols(o), r = {};
|
|
9
|
+
for (const t of e)
|
|
10
|
+
r[t] = o[t];
|
|
11
|
+
const s = {};
|
|
12
|
+
for (const t of y)
|
|
13
|
+
s[t.toString()] = o[t];
|
|
14
|
+
for (const t of Object.keys(s).toSorted())
|
|
15
|
+
r[`@@${t}`] = s[t];
|
|
16
|
+
return r;
|
|
24
17
|
}
|
|
25
|
-
return
|
|
18
|
+
return o;
|
|
26
19
|
}
|
|
27
20
|
);
|
|
28
21
|
}
|
|
29
|
-
|
|
30
|
-
|
|
22
|
+
export {
|
|
23
|
+
m as hashKey
|
|
24
|
+
};
|
package/dist/es/utils/lib.js
CHANGED
|
@@ -1,10 +1,64 @@
|
|
|
1
|
-
|
|
2
|
-
import { always } from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { always as s } from "radashi";
|
|
2
|
+
import { always as r, assign as n, camel as l, capitalize as m, cluster as c, debounce as p, first as u, get as y, isArray as g, isBigInt as f, isBoolean as b, isDate as d, isEmpty as k, isError as S, isFloat as x, isFunction as w, isInt as C, isIntString as F, isMap as I, isNullish as h, isNumber as E, isObject as P, isPlainObject as j, isPrimitive as z, isPromise as B, isRegExp as D, isSet as M, isString as N, isSymbol as O, isUndefined as Q, isWeakMap as W, isWeakSet as q, dash as v, last as A, max as R, memo as T, min as U, noop as G, omit as H, once as J, pascal as K, pick as L, set as V, similarity as X, snake as Y, sum as Z, template as _, throttle as $, toFloat as ss, toInt as es, trim as is, unique as as } from "radashi";
|
|
3
|
+
import { klona as os } from "klona";
|
|
4
|
+
import { parse as ns, stringify as ls } from "qs";
|
|
5
|
+
const i = s(!0), a = s(!1);
|
|
6
|
+
export {
|
|
7
|
+
r as always,
|
|
8
|
+
a as alwaysFalse,
|
|
9
|
+
i as alwaysTrue,
|
|
10
|
+
n as assign,
|
|
11
|
+
l as camelCase,
|
|
12
|
+
m as capitalize,
|
|
13
|
+
os as cloneDeep,
|
|
14
|
+
c as cluster,
|
|
15
|
+
p as debounce,
|
|
16
|
+
ns as decodeQueryString,
|
|
17
|
+
ls as encodeQueryString,
|
|
18
|
+
u as first,
|
|
19
|
+
y as get,
|
|
20
|
+
g as isArray,
|
|
21
|
+
f as isBigInt,
|
|
22
|
+
b as isBoolean,
|
|
23
|
+
d as isDate,
|
|
24
|
+
k as isEmpty,
|
|
25
|
+
S as isError,
|
|
26
|
+
x as isFloat,
|
|
27
|
+
w as isFunction,
|
|
28
|
+
C as isInt,
|
|
29
|
+
F as isIntString,
|
|
30
|
+
I as isMap,
|
|
31
|
+
h as isNullish,
|
|
32
|
+
E as isNumber,
|
|
33
|
+
P as isObject,
|
|
34
|
+
j as isPlainObject,
|
|
35
|
+
z as isPrimitive,
|
|
36
|
+
B as isPromise,
|
|
37
|
+
D as isRegExp,
|
|
38
|
+
M as isSet,
|
|
39
|
+
N as isString,
|
|
40
|
+
O as isSymbol,
|
|
41
|
+
Q as isUndefined,
|
|
42
|
+
W as isWeakMap,
|
|
43
|
+
q as isWeakSet,
|
|
44
|
+
v as kebabCase,
|
|
45
|
+
A as last,
|
|
46
|
+
R as max,
|
|
47
|
+
T as memoize,
|
|
48
|
+
U as min,
|
|
49
|
+
G as noop,
|
|
50
|
+
H as omit,
|
|
51
|
+
J as once,
|
|
52
|
+
K as pascalCase,
|
|
53
|
+
L as pick,
|
|
54
|
+
V as set,
|
|
55
|
+
X as similarity,
|
|
56
|
+
Y as snakeCase,
|
|
57
|
+
Z as sum,
|
|
58
|
+
_ as template,
|
|
59
|
+
$ as throttle,
|
|
60
|
+
ss as toFloat,
|
|
61
|
+
es as toInt,
|
|
62
|
+
is as trim,
|
|
63
|
+
as as unique
|
|
64
|
+
};
|
package/dist/es/utils/object.js
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const targetKey = key;
|
|
9
|
-
if (overrideExisting || isUndefined(target[targetKey])) {
|
|
10
|
-
target[targetKey] = value;
|
|
11
|
-
}
|
|
1
|
+
import "./lib.js";
|
|
2
|
+
import { isUndefined as o } from "radashi";
|
|
3
|
+
function m(e, r, f = !1) {
|
|
4
|
+
const s = Object.entries(r).filter(([t, i]) => !o(i));
|
|
5
|
+
for (const [t, i] of s) {
|
|
6
|
+
const n = t;
|
|
7
|
+
(f || o(e[n])) && (e[n] = i);
|
|
12
8
|
}
|
|
13
|
-
return
|
|
9
|
+
return e;
|
|
14
10
|
}
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
export {
|
|
12
|
+
m as mergeWith
|
|
13
|
+
};
|
package/dist/es/utils/path.js
CHANGED
|
@@ -1,49 +1,58 @@
|
|
|
1
|
-
|
|
2
|
-
import path from 'path-browserify';
|
|
3
|
-
|
|
1
|
+
import o from "path-browserify";
|
|
4
2
|
const {
|
|
5
|
-
basename,
|
|
6
|
-
dirname,
|
|
7
|
-
extname,
|
|
8
|
-
isAbsolute,
|
|
9
|
-
join,
|
|
10
|
-
normalize,
|
|
11
|
-
parse,
|
|
12
|
-
relative,
|
|
13
|
-
resolve,
|
|
14
|
-
format,
|
|
15
|
-
sep:
|
|
16
|
-
} =
|
|
17
|
-
function
|
|
18
|
-
const
|
|
19
|
-
return
|
|
20
|
-
}
|
|
21
|
-
function
|
|
22
|
-
return
|
|
23
|
-
}
|
|
24
|
-
function
|
|
25
|
-
return
|
|
26
|
-
}
|
|
27
|
-
function
|
|
28
|
-
return
|
|
29
|
-
}
|
|
30
|
-
function
|
|
31
|
-
return
|
|
32
|
-
}
|
|
33
|
-
function
|
|
34
|
-
return
|
|
35
|
-
}
|
|
36
|
-
function
|
|
37
|
-
return
|
|
38
|
-
}
|
|
39
|
-
function
|
|
40
|
-
return
|
|
41
|
-
}
|
|
42
|
-
function
|
|
43
|
-
return
|
|
44
|
-
}
|
|
45
|
-
function
|
|
46
|
-
return
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
3
|
+
basename: a,
|
|
4
|
+
dirname: u,
|
|
5
|
+
extname: n,
|
|
6
|
+
isAbsolute: i,
|
|
7
|
+
join: s,
|
|
8
|
+
normalize: f,
|
|
9
|
+
parse: c,
|
|
10
|
+
relative: m,
|
|
11
|
+
resolve: h,
|
|
12
|
+
format: l,
|
|
13
|
+
sep: P
|
|
14
|
+
} = o;
|
|
15
|
+
function v(t, e = !0) {
|
|
16
|
+
const r = e ? void 0 : n(t);
|
|
17
|
+
return a(t, r);
|
|
18
|
+
}
|
|
19
|
+
function g(t) {
|
|
20
|
+
return n(t);
|
|
21
|
+
}
|
|
22
|
+
function x(t) {
|
|
23
|
+
return u(t);
|
|
24
|
+
}
|
|
25
|
+
function b(...t) {
|
|
26
|
+
return s(...t);
|
|
27
|
+
}
|
|
28
|
+
function N(t) {
|
|
29
|
+
return i(t);
|
|
30
|
+
}
|
|
31
|
+
function d(t) {
|
|
32
|
+
return f(t);
|
|
33
|
+
}
|
|
34
|
+
function j(t) {
|
|
35
|
+
return c(t);
|
|
36
|
+
}
|
|
37
|
+
function z(t) {
|
|
38
|
+
return l(t);
|
|
39
|
+
}
|
|
40
|
+
function A(t, e) {
|
|
41
|
+
return m(t, e);
|
|
42
|
+
}
|
|
43
|
+
function B(...t) {
|
|
44
|
+
return h(...t);
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
z as formatPath,
|
|
48
|
+
v as getBaseName,
|
|
49
|
+
x as getDirName,
|
|
50
|
+
g as getExtName,
|
|
51
|
+
A as getRelativePath,
|
|
52
|
+
N as isAbsolutePath,
|
|
53
|
+
b as joinPaths,
|
|
54
|
+
d as normalizePath,
|
|
55
|
+
j as parsePath,
|
|
56
|
+
P as pathSeparator,
|
|
57
|
+
B as resolvePath
|
|
58
|
+
};
|
package/dist/es/utils/pinyin.js
CHANGED
|
@@ -1,47 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
addDict(ModernChineseDict);
|
|
8
|
-
const baseOptions = {
|
|
1
|
+
import a from "@pinyin-pro/data/modern";
|
|
2
|
+
import { addDict as c, pinyin as o } from "pinyin-pro";
|
|
3
|
+
import "./lib.js";
|
|
4
|
+
import { isString as f } from "radashi";
|
|
5
|
+
c(a);
|
|
6
|
+
const r = {
|
|
9
7
|
type: "array",
|
|
10
8
|
toneType: "none",
|
|
11
|
-
multiple:
|
|
9
|
+
multiple: !1,
|
|
12
10
|
nonZh: "consecutive",
|
|
13
11
|
surname: "head"
|
|
14
12
|
};
|
|
15
|
-
function
|
|
16
|
-
return
|
|
17
|
-
|
|
13
|
+
function u(n) {
|
|
14
|
+
return o(
|
|
15
|
+
n,
|
|
18
16
|
{
|
|
19
|
-
...
|
|
17
|
+
...r,
|
|
20
18
|
pattern: "pinyin"
|
|
21
19
|
}
|
|
22
20
|
);
|
|
23
21
|
}
|
|
24
|
-
function
|
|
25
|
-
return
|
|
26
|
-
|
|
22
|
+
function m(n) {
|
|
23
|
+
return o(
|
|
24
|
+
n,
|
|
27
25
|
{
|
|
28
|
-
...
|
|
26
|
+
...r,
|
|
29
27
|
pattern: "first"
|
|
30
28
|
}
|
|
31
29
|
);
|
|
32
30
|
}
|
|
33
|
-
function
|
|
34
|
-
const
|
|
35
|
-
for (const
|
|
36
|
-
const
|
|
37
|
-
if (
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
result[pinyinKey] = getPinyin(value).join("");
|
|
41
|
-
result[initialsKey] = getPinyinInitials(value).join("");
|
|
31
|
+
function g(n, ...s) {
|
|
32
|
+
const i = { ...n };
|
|
33
|
+
for (const t of s) {
|
|
34
|
+
const e = n[t];
|
|
35
|
+
if (f(e)) {
|
|
36
|
+
const p = `${t}Pinyin`, y = `${t}PinyinInitials`;
|
|
37
|
+
i[p] = u(e).join(""), i[y] = m(e).join("");
|
|
42
38
|
}
|
|
43
39
|
}
|
|
44
|
-
return
|
|
40
|
+
return i;
|
|
45
41
|
}
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
export {
|
|
43
|
+
u as getPinyin,
|
|
44
|
+
m as getPinyinInitials,
|
|
45
|
+
g as withPinyin
|
|
46
|
+
};
|
|
@@ -1,39 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
if (
|
|
8
|
-
throw new Error(`Failed to encrypt data [${
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const encrypted = rsa.encrypt(value);
|
|
16
|
-
if (!encrypted) {
|
|
17
|
-
console.error("Failed to encrypt data using RSA", value);
|
|
18
|
-
throw new Error(`Failed to encrypt data [${value}] using RSA`);
|
|
19
|
-
}
|
|
20
|
-
return encrypted;
|
|
1
|
+
import i from "jsencrypt";
|
|
2
|
+
import "./lib.js";
|
|
3
|
+
import { isNullish as e } from "radashi";
|
|
4
|
+
function a(r, t) {
|
|
5
|
+
if (e(r))
|
|
6
|
+
throw new Error(`Failed to encrypt data [${r}] using RSA`);
|
|
7
|
+
if (!t || t.trim() === "")
|
|
8
|
+
throw new Error(`Failed to encrypt data [${r}] using RSA`);
|
|
9
|
+
const n = new i();
|
|
10
|
+
n.setPublicKey(t);
|
|
11
|
+
const o = n.encrypt(r);
|
|
12
|
+
if (!o)
|
|
13
|
+
throw console.error("Failed to encrypt data using RSA", r), new Error(`Failed to encrypt data [${r}] using RSA`);
|
|
14
|
+
return o;
|
|
21
15
|
}
|
|
22
|
-
function
|
|
23
|
-
if (
|
|
24
|
-
throw new Error(`Failed to decrypt data [${
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
console.error("Failed to decrypt data using RSA", value);
|
|
34
|
-
throw new Error(`Failed to decrypt data [${value}] using RSA`);
|
|
35
|
-
}
|
|
36
|
-
return decrypted;
|
|
16
|
+
function p(r, t) {
|
|
17
|
+
if (e(r))
|
|
18
|
+
throw new Error(`Failed to decrypt data [${r}] using RSA`);
|
|
19
|
+
if (!t || t.trim() === "")
|
|
20
|
+
throw new Error(`Failed to decrypt data [${r}] using RSA`);
|
|
21
|
+
const n = new i();
|
|
22
|
+
n.setPrivateKey(t);
|
|
23
|
+
const o = n.decrypt(r);
|
|
24
|
+
if (!o)
|
|
25
|
+
throw console.error("Failed to decrypt data using RSA", r), new Error(`Failed to decrypt data [${r}] using RSA`);
|
|
26
|
+
return o;
|
|
37
27
|
}
|
|
38
|
-
|
|
39
|
-
|
|
28
|
+
export {
|
|
29
|
+
p as decryptUsingRSA,
|
|
30
|
+
a as encryptUsingRSA
|
|
31
|
+
};
|
package/dist/es/utils/string.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
function constantCase(value) {
|
|
6
|
-
return snake(value).toUpperCase();
|
|
1
|
+
import "./lib.js";
|
|
2
|
+
import { snake as o } from "radashi";
|
|
3
|
+
function n(t) {
|
|
4
|
+
return o(t).toUpperCase();
|
|
7
5
|
}
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
export {
|
|
7
|
+
n as constantCase
|
|
8
|
+
};
|