@vef-framework/shared 2.0.11 → 2.1.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.
- package/dist/cjs/_internal/_rolldown/runtime.cjs +1 -0
- package/dist/cjs/color/color-ops.cjs +1 -1
- package/dist/cjs/color/index.cjs +1 -1
- package/dist/cjs/color/name.cjs +1 -1
- package/dist/cjs/color/palette.cjs +1 -1
- package/dist/cjs/constants/color-names.cjs +1 -1
- package/dist/cjs/constants/color-palettes.cjs +1 -1
- package/dist/cjs/constants/index.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/types/color.cjs +0 -1
- package/dist/cjs/types/common.cjs +0 -1
- package/dist/cjs/types/deep-keys.cjs +0 -1
- package/dist/cjs/types/index.cjs +0 -1
- package/dist/cjs/utils/chrono.cjs +1 -1
- package/dist/cjs/utils/equal.cjs +1 -1
- package/dist/cjs/utils/error.cjs +2 -3
- package/dist/cjs/utils/event.cjs +1 -1
- package/dist/cjs/utils/format.cjs +1 -1
- package/dist/cjs/utils/function.cjs +1 -1
- package/dist/cjs/utils/id.cjs +1 -1
- package/dist/cjs/utils/index.cjs +1 -1
- package/dist/cjs/utils/key.cjs +1 -1
- package/dist/cjs/utils/lib.cjs +1 -1
- package/dist/cjs/utils/object.cjs +1 -1
- package/dist/cjs/utils/path.cjs +1 -1
- package/dist/cjs/utils/pinyin.cjs +1 -1
- package/dist/cjs/utils/security.cjs +1 -1
- package/dist/cjs/utils/string.cjs +1 -1
- package/dist/cjs/utils/table.cjs +1 -1
- package/dist/cjs/utils/task.cjs +1 -1
- package/dist/cjs/utils/tree.cjs +1 -1
- package/dist/cjs/utils/zod.cjs +1 -1
- package/dist/es/color/color-ops.js +55 -68
- package/dist/es/color/index.js +4 -18
- package/dist/es/color/name.js +25 -27
- package/dist/es/color/palette.js +70 -82
- package/dist/es/constants/color-names.js +1572 -1572
- package/dist/es/constants/color-palettes.js +1085 -360
- package/dist/es/constants/index.js +3 -8
- package/dist/es/index.js +25 -167
- 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 +1 -3
- package/dist/es/utils/chrono.js +77 -92
- package/dist/es/utils/equal.js +83 -118
- package/dist/es/utils/error.js +27 -29
- package/dist/es/utils/event.js +27 -51
- package/dist/es/utils/format.js +27 -18
- package/dist/es/utils/function.js +26 -36
- package/dist/es/utils/id.js +21 -21
- package/dist/es/utils/index.js +18 -81
- package/dist/es/utils/key.js +17 -23
- package/dist/es/utils/lib.js +8 -64
- package/dist/es/utils/object.js +12 -12
- package/dist/es/utils/path.js +37 -58
- package/dist/es/utils/pinyin.js +41 -43
- package/dist/es/utils/security.js +73 -31
- package/dist/es/utils/string.js +19 -7
- package/dist/es/utils/table.js +13 -13
- package/dist/es/utils/task.js +6 -7
- package/dist/es/utils/tree.js +159 -181
- package/dist/es/utils/zod.js +7 -7
- package/dist/types/constants/color-names.d.ts +2 -2
- package/dist/types/constants/color-palettes.d.ts +2 -2
- package/dist/types/src/color/color-ops.d.ts +84 -0
- package/dist/types/src/color/index.d.ts +3 -0
- package/dist/types/src/color/name.d.ts +7 -0
- package/dist/types/src/color/palette.d.ts +8 -0
- package/dist/types/src/constants/color-names.d.ts +11 -0
- package/dist/types/src/constants/color-palettes.d.ts +823 -0
- package/dist/types/src/constants/index.d.ts +2 -0
- package/dist/types/src/index.d.ts +4 -0
- package/dist/types/src/types/color.d.ts +25 -0
- package/dist/types/src/types/common.d.ts +29 -0
- package/dist/types/src/types/deep-keys.d.ts +37 -0
- package/dist/types/src/types/index.d.ts +3 -0
- package/dist/types/src/utils/chrono.d.ts +152 -0
- package/dist/types/src/utils/equal.d.ts +16 -0
- package/dist/types/src/utils/error.d.ts +22 -0
- package/dist/types/src/utils/event.d.ts +46 -0
- package/dist/types/src/utils/format.d.ts +31 -0
- package/dist/types/src/utils/function.d.ts +27 -0
- package/dist/types/src/utils/id.d.ts +6 -0
- package/dist/types/src/utils/index.d.ts +18 -0
- package/dist/types/src/utils/key.d.ts +5 -0
- package/dist/types/src/utils/lib.d.ts +5 -0
- package/dist/types/src/utils/object.d.ts +9 -0
- package/dist/types/src/utils/path.d.ts +13 -0
- package/dist/types/src/utils/pinyin.d.ts +40 -0
- package/dist/types/src/utils/security.d.ts +60 -0
- package/dist/types/src/utils/string.d.ts +15 -0
- package/dist/types/src/utils/table.d.ts +25 -0
- package/dist/types/src/utils/task.d.ts +4 -0
- package/dist/types/src/utils/tree.d.ts +216 -0
- package/dist/types/src/utils/zod.d.ts +2 -0
- package/dist/types/types/color.d.ts +1 -49
- package/dist/types/types/common.d.ts +7 -3
- package/dist/types/types/deep-keys.d.ts +28 -0
- package/dist/types/utils/chrono.d.ts +3 -13
- package/dist/types/utils/error.d.ts +5 -21
- package/dist/types/utils/event.d.ts +9 -31
- package/dist/types/utils/format.d.ts +0 -2
- package/dist/types/utils/function.d.ts +4 -36
- package/dist/types/utils/id.d.ts +2 -2
- package/dist/types/utils/key.d.ts +2 -4
- package/dist/types/utils/path.d.ts +7 -70
- package/dist/types/utils/pinyin.d.ts +2 -3
- package/dist/types/utils/security.d.ts +44 -2
- package/dist/types/utils/string.d.ts +8 -0
- package/dist/types/utils/table.d.ts +1 -0
- package/dist/types/utils/task.d.ts +1 -3
- package/dist/types/utils/tree.d.ts +8 -0
- package/dist/types/utils/zod.d.ts +1 -0
- package/package.json +13 -13
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
e as colorEntries,
|
|
5
|
-
t as colorNameMap,
|
|
6
|
-
a as colorPaletteMap,
|
|
7
|
-
c as colorPalettes
|
|
8
|
-
};
|
|
1
|
+
/*! @vef-framework/shared v2.1.0 made by Venus | 2026-03-27T07:12:59.574Z */
|
|
2
|
+
import "./color-names.js";
|
|
3
|
+
import "./color-palettes.js";
|
package/dist/es/index.js
CHANGED
|
@@ -1,167 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
import "./
|
|
3
|
-
import "./
|
|
4
|
-
import "./utils/
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
|
|
26
|
-
import { constantCase as qt } from "./utils/string.js";
|
|
27
|
-
import { shouldUpdateByKeys as Kt } from "./utils/table.js";
|
|
28
|
-
import { scheduleMicrotask as Zt } from "./utils/task.js";
|
|
29
|
-
import { buildTree as Gt, filterTree as Jt, filterTreeWithAncestors as Xt, findNodeInTree as Yt, flattenTree as $t, mapTree as er, traverseTree as tr } from "./utils/tree.js";
|
|
30
|
-
import { z as or } from "zod";
|
|
31
|
-
export {
|
|
32
|
-
I as DEFAULT_DATETIME_FORMAT,
|
|
33
|
-
k as DEFAULT_DATE_FORMAT,
|
|
34
|
-
M as DEFAULT_TIME_FORMAT,
|
|
35
|
-
$ as EventEmitter,
|
|
36
|
-
b as LOCALIZED_DATETIME_FORMAT,
|
|
37
|
-
w as LOCALIZED_DATE_FORMAT,
|
|
38
|
-
Ae as always,
|
|
39
|
-
yt as alwaysFalse,
|
|
40
|
-
At as alwaysTrue,
|
|
41
|
-
de as assign,
|
|
42
|
-
Gt as buildTree,
|
|
43
|
-
De as camelCase,
|
|
44
|
-
Ce as capitalize,
|
|
45
|
-
Te as cloneDeep,
|
|
46
|
-
Se as cluster,
|
|
47
|
-
D as colorEntries,
|
|
48
|
-
C as colorNameMap,
|
|
49
|
-
F as colorPaletteMap,
|
|
50
|
-
P as colorPalettes,
|
|
51
|
-
qt as constantCase,
|
|
52
|
-
s as convertHslToHex,
|
|
53
|
-
m as convertTransparentToOpaque,
|
|
54
|
-
ee as createEventEmitter,
|
|
55
|
-
ie as createThrowNotImplementedFn,
|
|
56
|
-
Fe as debounce,
|
|
57
|
-
he as decodeQueryString,
|
|
58
|
-
Bt as decryptUsingRSA,
|
|
59
|
-
ue as encodeQueryString,
|
|
60
|
-
Ht as encryptUsingRSA,
|
|
61
|
-
Jt as filterTree,
|
|
62
|
-
Xt as filterTreeWithAncestors,
|
|
63
|
-
Z as filterUserFrame,
|
|
64
|
-
Yt as findNodeInTree,
|
|
65
|
-
Pe as first,
|
|
66
|
-
$t as flattenTree,
|
|
67
|
-
re as formatBytes,
|
|
68
|
-
v as formatDate,
|
|
69
|
-
O as formatDuration,
|
|
70
|
-
oe as formatNumber,
|
|
71
|
-
St as formatPath,
|
|
72
|
-
fe as generateId,
|
|
73
|
-
Ne as get,
|
|
74
|
-
Ft as getBaseName,
|
|
75
|
-
n as getColorDifference,
|
|
76
|
-
u as getColorName,
|
|
77
|
-
A as getColorPalette,
|
|
78
|
-
V as getCurrentStack,
|
|
79
|
-
G as getCurrentStackSync,
|
|
80
|
-
Pt as getDirName,
|
|
81
|
-
Nt as getExtName,
|
|
82
|
-
R as getLocalizedDateTime,
|
|
83
|
-
_ as getNow,
|
|
84
|
-
L as getNowDateString,
|
|
85
|
-
U as getNowDateTimeString,
|
|
86
|
-
z as getNowTimeString,
|
|
87
|
-
_t as getPinyin,
|
|
88
|
-
Lt as getPinyinInitials,
|
|
89
|
-
It as getRelativePath,
|
|
90
|
-
J as getSanitizedErrorStack,
|
|
91
|
-
B as getTemporalFormats,
|
|
92
|
-
ge as hashKey,
|
|
93
|
-
se as identity,
|
|
94
|
-
me as invokeAwaitableFn,
|
|
95
|
-
kt as isAbsolutePath,
|
|
96
|
-
Ie as isArray,
|
|
97
|
-
ne as isAsyncFunction,
|
|
98
|
-
ke as isBigInt,
|
|
99
|
-
Me as isBoolean,
|
|
100
|
-
be as isDate,
|
|
101
|
-
j as isDeepEqual,
|
|
102
|
-
we as isEmpty,
|
|
103
|
-
ve as isError,
|
|
104
|
-
Oe as isFloat,
|
|
105
|
-
Re as isFunction,
|
|
106
|
-
_e as isInt,
|
|
107
|
-
Le as isIntString,
|
|
108
|
-
Ue as isMap,
|
|
109
|
-
ze as isNullish,
|
|
110
|
-
Be as isNumber,
|
|
111
|
-
He as isObject,
|
|
112
|
-
We as isPlainObject,
|
|
113
|
-
qe as isPrimitive,
|
|
114
|
-
je as isPromise,
|
|
115
|
-
Ke as isRegExp,
|
|
116
|
-
Qe as isSet,
|
|
117
|
-
K as isShallowEqual,
|
|
118
|
-
Ze as isString,
|
|
119
|
-
Ve as isSymbol,
|
|
120
|
-
Ge as isUndefined,
|
|
121
|
-
l as isValidColor,
|
|
122
|
-
Je as isWeakMap,
|
|
123
|
-
Xe as isWeakSet,
|
|
124
|
-
p as isWhiteColor,
|
|
125
|
-
Mt as joinPaths,
|
|
126
|
-
Ye as kebabCase,
|
|
127
|
-
$e as last,
|
|
128
|
-
er as mapTree,
|
|
129
|
-
et as max,
|
|
130
|
-
tt as memoize,
|
|
131
|
-
Dt as mergeWith,
|
|
132
|
-
rt as min,
|
|
133
|
-
f as mixColor,
|
|
134
|
-
ot as noop,
|
|
135
|
-
bt as normalizePath,
|
|
136
|
-
at as omit,
|
|
137
|
-
it as once,
|
|
138
|
-
H as parseDate,
|
|
139
|
-
X as parseErrorStack,
|
|
140
|
-
wt as parsePath,
|
|
141
|
-
st as pascalCase,
|
|
142
|
-
vt as pathSeparator,
|
|
143
|
-
mt as pick,
|
|
144
|
-
Ot as resolvePath,
|
|
145
|
-
Zt as scheduleMicrotask,
|
|
146
|
-
nt as set,
|
|
147
|
-
c as setColorAlpha,
|
|
148
|
-
Kt as shouldUpdateByKeys,
|
|
149
|
-
lt as similarity,
|
|
150
|
-
pt as snakeCase,
|
|
151
|
-
ft as sum,
|
|
152
|
-
ct as template,
|
|
153
|
-
gt as throttle,
|
|
154
|
-
le as throwNotImplemented,
|
|
155
|
-
xt as toFloat,
|
|
156
|
-
g as toHexColor,
|
|
157
|
-
x as toHslColor,
|
|
158
|
-
T as toHsvColor,
|
|
159
|
-
Tt as toInt,
|
|
160
|
-
E as toRgbColor,
|
|
161
|
-
tr as traverseTree,
|
|
162
|
-
Et as trim,
|
|
163
|
-
W as tryParseDate,
|
|
164
|
-
ht as unique,
|
|
165
|
-
Ut as withPinyin,
|
|
166
|
-
or as z
|
|
167
|
-
};
|
|
1
|
+
/*! @vef-framework/shared v2.1.0 made by Venus | 2026-03-27T07:12:59.574Z */
|
|
2
|
+
import { convertHslToHex as e, convertTransparentToOpaque as t, getColorDifference as n, isValidColor as r, isWhiteColor as i, mixColor as a, setColorAlpha as o, toHexColor as s, toHslColor as c, toHsvColor as l, toRgbColor as u } from "./color/color-ops.js";
|
|
3
|
+
import { colorEntries as d, colorNameMap as f } from "./constants/color-names.js";
|
|
4
|
+
import { DEFAULT_DATETIME_FORMAT as p, DEFAULT_DATE_FORMAT as m, DEFAULT_TIME_FORMAT as h, LOCALIZED_DATETIME_FORMAT as g, LOCALIZED_DATE_FORMAT as _, formatDate as v, formatDuration as y, getLocalizedDateTime as b, getNow as x, getNowDateString as S, getNowDateTimeString as C, getNowTimeString as w, getTemporalFormats as T, parseDate as E, tryParseDate as D } from "./utils/chrono.js";
|
|
5
|
+
import { isDeepEqual as O, isShallowEqual as k } from "./utils/equal.js";
|
|
6
|
+
import { formatPath as A, getBaseName as j, getDirName as M, getExtName as N, getRelativePath as P, isAbsolutePath as F, joinPaths as I, normalizePath as L, parsePath as R, pathSeparator as z, resolvePath as B } from "./utils/path.js";
|
|
7
|
+
import { filterUserFrame as V, getCurrentStack as H, getCurrentStackSync as U, getSanitizedErrorStack as W, parseErrorStack as G } from "./utils/error.js";
|
|
8
|
+
import { EventEmitter as K, createEventEmitter as q } from "./utils/event.js";
|
|
9
|
+
import { formatBytes as J, formatNumber as Y } from "./utils/format.js";
|
|
10
|
+
import { createThrowNotImplementedFn as X, identity as Z, invokeAwaitableFn as Q, isAsyncFunction as $, throwNotImplemented as ee } from "./utils/function.js";
|
|
11
|
+
import { generateId as te } from "./utils/id.js";
|
|
12
|
+
import { always as ne, alwaysFalse as re, alwaysTrue as ie, assign as ae, camelCase as oe, capitalize as se, cloneDeep as ce, cluster as le, debounce as ue, decodeQueryString as de, encodeQueryString as fe, first as pe, get as me, isArray as he, isBigInt as ge, isBoolean as _e, isDate as ve, isEmpty as ye, isError as be, isFloat as xe, isFunction as Se, isInt as Ce, isIntString as we, isMap as Te, isNullish as Ee, isNumber as De, isObject as Oe, isPlainObject as ke, isPrimitive as Ae, isPromise as je, isRegExp as Me, isSet as Ne, isString as Pe, isSymbol as Fe, isUndefined as Ie, isWeakMap as Le, isWeakSet as Re, kebabCase as ze, last as Be, max as Ve, memoize as He, min as Ue, noop as We, omit as Ge, once as Ke, pascalCase as qe, pick as Je, set as Ye, similarity as Xe, snakeCase as Ze, sum as Qe, template as $e, throttle as et, toFloat as tt, toInt as nt, trim as rt, unique as it } from "./utils/lib.js";
|
|
13
|
+
import { hashKey as at } from "./utils/key.js";
|
|
14
|
+
import { mergeWith as ot } from "./utils/object.js";
|
|
15
|
+
import { getPinyin as st, getPinyinInitials as ct, withPinyin as lt } from "./utils/pinyin.js";
|
|
16
|
+
import { decryptUsingRSA as ut, encryptUsingRSA as dt, obfuscateDecode as ft, obfuscateDecodeFromBase64 as pt, obfuscateDecodeFromHex as mt, obfuscateEncode as ht, obfuscateEncodeToBase64 as gt, obfuscateEncodeToHex as _t } from "./utils/security.js";
|
|
17
|
+
import { constantCase as vt, stringify as yt } from "./utils/string.js";
|
|
18
|
+
import { shouldUpdateByKeys as bt } from "./utils/table.js";
|
|
19
|
+
import { scheduleMicrotask as xt } from "./utils/task.js";
|
|
20
|
+
import { buildTree as St, filterTree as Ct, filterTreeWithAncestors as wt, findNodeInTree as Tt, flattenTree as Et, mapTree as Dt, traverseTree as Ot } from "./utils/tree.js";
|
|
21
|
+
import { z as kt } from "./utils/zod.js";
|
|
22
|
+
import { colorPaletteMap as At, colorPalettes as jt } from "./constants/color-palettes.js";
|
|
23
|
+
import { getColorName as Mt } from "./color/name.js";
|
|
24
|
+
import { getColorPalette as Nt } from "./color/palette.js";
|
|
25
|
+
export { p as DEFAULT_DATETIME_FORMAT, m as DEFAULT_DATE_FORMAT, h as DEFAULT_TIME_FORMAT, K as EventEmitter, g as LOCALIZED_DATETIME_FORMAT, _ as LOCALIZED_DATE_FORMAT, ne as always, re as alwaysFalse, ie as alwaysTrue, ae as assign, St as buildTree, oe as camelCase, se as capitalize, ce as cloneDeep, le as cluster, d as colorEntries, f as colorNameMap, At as colorPaletteMap, jt as colorPalettes, vt as constantCase, e as convertHslToHex, t as convertTransparentToOpaque, q as createEventEmitter, X as createThrowNotImplementedFn, ue as debounce, de as decodeQueryString, ut as decryptUsingRSA, fe as encodeQueryString, dt as encryptUsingRSA, Ct as filterTree, wt as filterTreeWithAncestors, V as filterUserFrame, Tt as findNodeInTree, pe as first, Et as flattenTree, J as formatBytes, v as formatDate, y as formatDuration, Y as formatNumber, A as formatPath, te as generateId, me as get, j as getBaseName, n as getColorDifference, Mt as getColorName, Nt as getColorPalette, H as getCurrentStack, U as getCurrentStackSync, M as getDirName, N as getExtName, b as getLocalizedDateTime, x as getNow, S as getNowDateString, C as getNowDateTimeString, w as getNowTimeString, st as getPinyin, ct as getPinyinInitials, P as getRelativePath, W as getSanitizedErrorStack, T as getTemporalFormats, at as hashKey, Z as identity, Q as invokeAwaitableFn, F as isAbsolutePath, he as isArray, $ as isAsyncFunction, ge as isBigInt, _e as isBoolean, ve as isDate, O as isDeepEqual, ye as isEmpty, be as isError, xe as isFloat, Se as isFunction, Ce as isInt, we as isIntString, Te as isMap, Ee as isNullish, De as isNumber, Oe as isObject, ke as isPlainObject, Ae as isPrimitive, je as isPromise, Me as isRegExp, Ne as isSet, k as isShallowEqual, Pe as isString, Fe as isSymbol, Ie as isUndefined, r as isValidColor, Le as isWeakMap, Re as isWeakSet, i as isWhiteColor, I as joinPaths, ze as kebabCase, Be as last, Dt as mapTree, Ve as max, He as memoize, ot as mergeWith, Ue as min, a as mixColor, We as noop, L as normalizePath, ft as obfuscateDecode, pt as obfuscateDecodeFromBase64, mt as obfuscateDecodeFromHex, ht as obfuscateEncode, gt as obfuscateEncodeToBase64, _t as obfuscateEncodeToHex, Ge as omit, Ke as once, E as parseDate, G as parseErrorStack, R as parsePath, qe as pascalCase, z as pathSeparator, Je as pick, B as resolvePath, xt as scheduleMicrotask, Ye as set, o as setColorAlpha, bt as shouldUpdateByKeys, Xe as similarity, Ze as snakeCase, yt as stringify, Qe as sum, $e as template, et as throttle, ee as throwNotImplemented, tt as toFloat, s as toHexColor, c as toHslColor, l as toHsvColor, nt as toInt, u as toRgbColor, Ot as traverseTree, rt as trim, D as tryParseDate, it as unique, lt as withPinyin, kt as z };
|
package/dist/es/types/color.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
/*! @vef-framework/shared v2.1.0 made by Venus | 2026-03-27T07:12:59.574Z */
|
package/dist/es/types/common.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
/*! @vef-framework/shared v2.1.0 made by Venus | 2026-03-27T07:12:59.574Z */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
/*! @vef-framework/shared v2.1.0 made by Venus | 2026-03-27T07:12:59.574Z */
|
package/dist/es/types/index.js
CHANGED
package/dist/es/utils/chrono.js
CHANGED
|
@@ -1,104 +1,89 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
t.extend(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
1
|
+
/*! @vef-framework/shared v2.1.0 made by Venus | 2026-03-27T07:12:59.574Z */
|
|
2
|
+
import e from "dayjs";
|
|
3
|
+
import t from "dayjs/locale/zh-cn";
|
|
4
|
+
import n from "dayjs/plugin/customParseFormat";
|
|
5
|
+
import r from "dayjs/plugin/duration";
|
|
6
|
+
import i from "dayjs/plugin/localizedFormat";
|
|
7
|
+
import a from "dayjs/plugin/relativeTime";
|
|
8
|
+
e.locale(t), e.extend(i), e.extend(n), e.extend(r), e.extend(a);
|
|
9
|
+
var o = "YYYY-MM-DD", s = "HH:mm:ss", c = "YYYY-MM-DD HH:mm:ss", l = "LLLL", u = "LLdddd", d = ["YYYY"], f = ["YYYY-Q季度"], p = [
|
|
10
|
+
"YYYY-MM",
|
|
11
|
+
"YYYY/MM",
|
|
12
|
+
"YYYY.MM",
|
|
13
|
+
"YYYYMM"
|
|
14
|
+
], m = ["YYYY-wo"], h = [
|
|
15
|
+
"YYYY-MM-DD",
|
|
16
|
+
"YYYY/MM/DD",
|
|
17
|
+
"YYYY.MM.DD",
|
|
18
|
+
"YYYYMMDD",
|
|
19
|
+
"YY/MM/DD",
|
|
20
|
+
"YY.MM.DD",
|
|
21
|
+
"YYMMDD"
|
|
22
|
+
], g = [
|
|
23
|
+
"HH:mm:ss",
|
|
24
|
+
"HH.mm.ss",
|
|
25
|
+
"HHmmss"
|
|
26
|
+
], _ = ["HH"], v = [
|
|
27
|
+
"HH:mm",
|
|
28
|
+
"HH.mm",
|
|
29
|
+
"HHmm"
|
|
30
|
+
], y = [
|
|
31
|
+
"YYYY-MM-DD HH:mm:ss",
|
|
32
|
+
"YYYY/MM/DD HH:mm:ss",
|
|
33
|
+
"YYYY.MM.DD HH.mm.ss",
|
|
34
|
+
"YYYYMMDDHHmmss",
|
|
35
|
+
"YY/MM/DD HH:mm:ss",
|
|
36
|
+
"YY.MM.DD HH:mm:ss",
|
|
37
|
+
"YY.MM.DD HH.mm.ss",
|
|
38
|
+
"YYMMDDHHmmss"
|
|
34
39
|
];
|
|
35
|
-
function
|
|
36
|
-
|
|
37
|
-
|
|
40
|
+
function b(t, n = "seconds") {
|
|
41
|
+
let r = e.duration(t, n), i = Math.floor(r.asDays()), a = r.hours(), o = r.minutes();
|
|
42
|
+
return i > 0 ? `${i}天${a}小时${o}分钟` : a > 0 ? `${a}小时${o}分钟` : `${o}分钟`;
|
|
38
43
|
}
|
|
39
|
-
function
|
|
40
|
-
|
|
44
|
+
function x(t, n = c) {
|
|
45
|
+
return t instanceof Date ? e(t) : n ? e(t, n) : e(t);
|
|
41
46
|
}
|
|
42
|
-
function
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
if (Y.isValid())
|
|
51
|
-
return Y;
|
|
52
|
-
}
|
|
53
|
-
const r = t(o);
|
|
54
|
-
return r.isValid() ? r : null;
|
|
47
|
+
function S(t) {
|
|
48
|
+
let n = [...y, ...h];
|
|
49
|
+
for (let r of n) {
|
|
50
|
+
let n = e(t, r, !0);
|
|
51
|
+
if (n.isValid()) return n;
|
|
52
|
+
}
|
|
53
|
+
let r = e(t);
|
|
54
|
+
return r.isValid() ? r : null;
|
|
55
55
|
}
|
|
56
|
-
function
|
|
57
|
-
|
|
56
|
+
function C(e, t = c) {
|
|
57
|
+
return e.format(t);
|
|
58
58
|
}
|
|
59
|
-
function
|
|
60
|
-
|
|
59
|
+
function w() {
|
|
60
|
+
return e();
|
|
61
61
|
}
|
|
62
|
-
function
|
|
63
|
-
|
|
62
|
+
function T() {
|
|
63
|
+
return e().format(o);
|
|
64
64
|
}
|
|
65
|
-
function
|
|
66
|
-
|
|
65
|
+
function E() {
|
|
66
|
+
return e().format(s);
|
|
67
67
|
}
|
|
68
|
-
function
|
|
69
|
-
|
|
68
|
+
function D() {
|
|
69
|
+
return e().format(c);
|
|
70
70
|
}
|
|
71
|
-
function
|
|
72
|
-
|
|
71
|
+
function O(t = !0) {
|
|
72
|
+
return e().format(t ? l : u);
|
|
73
73
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
74
|
+
var k = {
|
|
75
|
+
year: d,
|
|
76
|
+
quarter: f,
|
|
77
|
+
month: p,
|
|
78
|
+
week: m,
|
|
79
|
+
date: h,
|
|
80
|
+
time: g,
|
|
81
|
+
hour: _,
|
|
82
|
+
minute: v,
|
|
83
|
+
datetime: y
|
|
84
84
|
};
|
|
85
|
-
function
|
|
86
|
-
|
|
85
|
+
function A(e) {
|
|
86
|
+
return k[e];
|
|
87
87
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
T as DEFAULT_DATE_FORMAT,
|
|
91
|
-
H as DEFAULT_TIME_FORMAT,
|
|
92
|
-
A as LOCALIZED_DATETIME_FORMAT,
|
|
93
|
-
E as LOCALIZED_DATE_FORMAT,
|
|
94
|
-
y as formatDate,
|
|
95
|
-
$ as formatDuration,
|
|
96
|
-
Q as getLocalizedDateTime,
|
|
97
|
-
P as getNow,
|
|
98
|
-
V as getNowDateString,
|
|
99
|
-
C as getNowDateTimeString,
|
|
100
|
-
z as getNowTimeString,
|
|
101
|
-
Z as getTemporalFormats,
|
|
102
|
-
h as parseDate,
|
|
103
|
-
x as tryParseDate
|
|
104
|
-
};
|
|
88
|
+
//#endregion
|
|
89
|
+
export { c as DEFAULT_DATETIME_FORMAT, o as DEFAULT_DATE_FORMAT, s as DEFAULT_TIME_FORMAT, l as LOCALIZED_DATETIME_FORMAT, u as LOCALIZED_DATE_FORMAT, C as formatDate, b as formatDuration, O as getLocalizedDateTime, w as getNow, T as getNowDateString, D as getNowDateTimeString, E as getNowTimeString, A as getTemporalFormats, x as parseDate, S as tryParseDate };
|
package/dist/es/utils/equal.js
CHANGED
|
@@ -1,120 +1,85 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
const O = Array.isArray(n), h = Array.isArray(o);
|
|
23
|
-
if (O !== h || n.constructor !== o.constructor)
|
|
24
|
-
return !1;
|
|
25
|
-
const l = Object.keys(n);
|
|
26
|
-
if (l.length !== Object.keys(o).length)
|
|
27
|
-
return !1;
|
|
28
|
-
for (const r of l)
|
|
29
|
-
if (!Object.hasOwn(o, r) || !Object.is(n[r], o[r]))
|
|
30
|
-
return !1;
|
|
31
|
-
return !0;
|
|
1
|
+
/*! @vef-framework/shared v2.1.0 made by Venus | 2026-03-27T07:12:59.574Z */
|
|
2
|
+
//#region src/utils/equal.ts
|
|
3
|
+
function e(e, t) {
|
|
4
|
+
if (Object.is(e, t)) return !0;
|
|
5
|
+
if (typeof e != "object" || !e || typeof t != "object" || !t) return !1;
|
|
6
|
+
if (e instanceof Map && t instanceof Map) {
|
|
7
|
+
if (e.size !== t.size) return !1;
|
|
8
|
+
for (let [n, r] of e) if (!t.has(n) || !Object.is(r, t.get(n))) return !1;
|
|
9
|
+
return !0;
|
|
10
|
+
}
|
|
11
|
+
if (e instanceof Set && t instanceof Set) {
|
|
12
|
+
if (e.size !== t.size) return !1;
|
|
13
|
+
for (let n of e) if (!t.has(n)) return !1;
|
|
14
|
+
return !0;
|
|
15
|
+
}
|
|
16
|
+
if (Array.isArray(e) !== Array.isArray(t) || e.constructor !== t.constructor) return !1;
|
|
17
|
+
let n = Object.keys(e), r = Object.keys(t);
|
|
18
|
+
if (n.length !== r.length) return !1;
|
|
19
|
+
for (let r of n) if (!Object.hasOwn(t, r) || !Object.is(e[r], t[r])) return !1;
|
|
20
|
+
return !0;
|
|
32
21
|
}
|
|
33
|
-
function
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
if (a === Map) {
|
|
95
|
-
const t = e, s = f;
|
|
96
|
-
if (t.size !== s.size)
|
|
97
|
-
return !1;
|
|
98
|
-
for (const [i, y] of t)
|
|
99
|
-
if (!s.has(i) || !r(y, s.get(i)))
|
|
100
|
-
return !1;
|
|
101
|
-
return !0;
|
|
102
|
-
}
|
|
103
|
-
const g = e, b = f;
|
|
104
|
-
if (g.valueOf !== O && typeof g.valueOf == "function" && typeof b.valueOf == "function")
|
|
105
|
-
return g.valueOf() === b.valueOf();
|
|
106
|
-
if (g.toString !== h && typeof g.toString == "function" && typeof b.toString == "function")
|
|
107
|
-
return g.toString() === b.toString();
|
|
108
|
-
const w = Object.keys(e);
|
|
109
|
-
let p;
|
|
110
|
-
for (let t = w.length; t-- !== 0; )
|
|
111
|
-
if (p = w[t], !Object.hasOwn(f, p) || !r(g[p], b[p]))
|
|
112
|
-
return !1;
|
|
113
|
-
return Object.keys(f).length === w.length;
|
|
114
|
-
};
|
|
115
|
-
return r(n, o);
|
|
22
|
+
function t(e, t) {
|
|
23
|
+
let { valueOf: n, toString: r } = Object.prototype, i = /* @__PURE__ */ new WeakMap(), a = (e, t) => {
|
|
24
|
+
if (e === t) return !0;
|
|
25
|
+
if (typeof e != "object" || typeof t != "object" || !e || !t) return e !== e && t !== t;
|
|
26
|
+
if (Object.getPrototypeOf(e) !== Object.getPrototypeOf(t)) return !1;
|
|
27
|
+
let { constructor: o } = e;
|
|
28
|
+
if (o === Date) return e.getTime() === t.getTime();
|
|
29
|
+
if (o === RegExp) {
|
|
30
|
+
let n = e, r = t;
|
|
31
|
+
return n.source === r.source && n.flags === r.flags;
|
|
32
|
+
}
|
|
33
|
+
if (o === Set) {
|
|
34
|
+
let n = e, r = t;
|
|
35
|
+
if (n.size !== r.size) return !1;
|
|
36
|
+
for (let e of n) {
|
|
37
|
+
let t = !1;
|
|
38
|
+
for (let n of r) if (a(e, n)) {
|
|
39
|
+
t = !0;
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
if (!t) return !1;
|
|
43
|
+
}
|
|
44
|
+
return !0;
|
|
45
|
+
}
|
|
46
|
+
if (o === ArrayBuffer) return a(new DataView(e), new DataView(t));
|
|
47
|
+
if (o === DataView || ArrayBuffer.isView(e)) {
|
|
48
|
+
let n, r;
|
|
49
|
+
if (o === DataView) n = e, r = t;
|
|
50
|
+
else {
|
|
51
|
+
let i = e, a = t;
|
|
52
|
+
n = new DataView(i.buffer, i.byteOffset, i.byteLength), r = new DataView(a.buffer, a.byteOffset, a.byteLength);
|
|
53
|
+
}
|
|
54
|
+
if (n.byteLength !== r.byteLength) return !1;
|
|
55
|
+
for (let e = n.byteLength; e-- !== 0;) if (n.getUint8(e) !== r.getUint8(e)) return !1;
|
|
56
|
+
return !0;
|
|
57
|
+
}
|
|
58
|
+
if (i.has(e) && i.get(e) === t) return !0;
|
|
59
|
+
if (i.set(e, t), o === Array) {
|
|
60
|
+
let n = e, r = t;
|
|
61
|
+
if (n.length !== r.length) return !1;
|
|
62
|
+
for (let e = n.length; e-- !== 0;) if (!a(n[e], r[e])) return !1;
|
|
63
|
+
return !0;
|
|
64
|
+
}
|
|
65
|
+
if (o === Map) {
|
|
66
|
+
let n = e, r = t;
|
|
67
|
+
if (n.size !== r.size) return !1;
|
|
68
|
+
for (let [e, t] of n) if (!r.has(e) || !a(t, r.get(e))) return !1;
|
|
69
|
+
return !0;
|
|
70
|
+
}
|
|
71
|
+
let s = e, c = t;
|
|
72
|
+
if (s.valueOf !== n && typeof s.valueOf == "function" && typeof c.valueOf == "function") return s.valueOf() === c.valueOf();
|
|
73
|
+
if (s.toString !== r && typeof s.toString == "function" && typeof c.toString == "function") return s.toString() === c.toString();
|
|
74
|
+
let l = Object.keys(e), u = Object.keys(t);
|
|
75
|
+
if (l.length !== u.length) return !1;
|
|
76
|
+
for (let e = l.length; e-- !== 0;) {
|
|
77
|
+
let n = l[e];
|
|
78
|
+
if (!Object.hasOwn(t, n) || !a(s[n], c[n])) return !1;
|
|
79
|
+
}
|
|
80
|
+
return !0;
|
|
81
|
+
};
|
|
82
|
+
return a(e, t);
|
|
116
83
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
j as isShallowEqual
|
|
120
|
-
};
|
|
84
|
+
//#endregion
|
|
85
|
+
export { t as isDeepEqual, e as isShallowEqual };
|