@vef-framework/shared 1.0.135 → 2.0.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/README +15 -0
- package/dist/cjs/color/color-ops.cjs +76 -0
- package/dist/cjs/color/index.cjs +24 -0
- package/dist/cjs/color/name.cjs +49 -0
- package/dist/cjs/color/palette.cjs +126 -0
- package/dist/cjs/constants/color-names.cjs +1580 -0
- package/dist/cjs/constants/color-palettes.cjs +372 -0
- package/dist/cjs/constants/index.cjs +14 -0
- package/dist/cjs/index.cjs +339 -0
- package/dist/cjs/types/color.cjs +3 -0
- package/dist/cjs/types/common.cjs +3 -0
- package/dist/cjs/types/deep-keys.cjs +3 -0
- package/dist/cjs/types/index.cjs +7 -0
- package/dist/cjs/utils/chrono.cjs +139 -0
- package/dist/cjs/utils/equal.cjs +175 -0
- package/dist/cjs/utils/error.cjs +60 -0
- package/dist/cjs/utils/event.cjs +62 -0
- package/dist/cjs/utils/format.cjs +31 -0
- package/dist/cjs/utils/function.cjs +49 -0
- package/dist/cjs/utils/id.cjs +38 -0
- package/dist/cjs/utils/index.cjs +86 -0
- package/dist/cjs/utils/key.cjs +34 -0
- package/dist/cjs/utils/lib.cjs +234 -0
- package/dist/cjs/utils/object.cjs +20 -0
- package/dist/cjs/utils/path.cjs +63 -0
- package/dist/cjs/utils/pinyin.cjs +53 -0
- package/dist/cjs/utils/security.cjs +44 -0
- package/dist/cjs/utils/string.cjs +13 -0
- package/dist/cjs/utils/task.cjs +17 -0
- package/dist/cjs/utils/tree.cjs +262 -0
- package/dist/cjs/utils/zod.cjs +14 -0
- package/dist/es/color/color-ops.js +62 -0
- package/dist/es/color/index.js +4 -0
- package/dist/es/color/name.js +45 -0
- package/dist/es/color/palette.js +122 -0
- package/dist/es/constants/color-names.js +1575 -0
- package/dist/es/constants/color-palettes.js +367 -0
- package/dist/es/constants/index.js +3 -0
- package/dist/es/index.js +30 -0
- package/dist/es/types/color.js +1 -0
- package/dist/es/types/common.js +1 -0
- package/dist/es/types/deep-keys.js +1 -0
- package/dist/es/types/index.js +4 -0
- package/dist/es/utils/chrono.js +121 -0
- package/dist/es/utils/equal.js +170 -0
- package/dist/es/utils/error.js +33 -0
- package/dist/es/utils/event.js +57 -0
- package/dist/es/utils/format.js +26 -0
- package/dist/es/utils/function.js +41 -0
- package/dist/es/utils/id.js +34 -0
- package/dist/es/utils/index.js +18 -0
- package/dist/es/utils/key.js +30 -0
- package/dist/es/utils/lib.js +10 -0
- package/dist/es/utils/object.js +16 -0
- package/dist/es/utils/path.js +49 -0
- package/dist/es/utils/pinyin.js +47 -0
- package/dist/es/utils/security.js +39 -0
- package/dist/es/utils/string.js +9 -0
- package/dist/es/utils/task.js +13 -0
- package/dist/es/utils/tree.js +252 -0
- package/dist/es/utils/zod.js +6 -0
- package/dist/types/color/color-ops.d.ts +84 -0
- package/dist/types/color/index.d.ts +3 -0
- package/dist/types/color/name.d.ts +7 -0
- package/dist/types/color/palette.d.ts +8 -0
- package/dist/types/constants/color-names.d.ts +11 -0
- package/dist/types/constants/color-palettes.d.ts +823 -0
- package/dist/types/constants/index.d.ts +2 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/types/color.d.ts +73 -0
- package/dist/types/types/common.d.ts +25 -0
- package/dist/types/types/deep-keys.d.ts +9 -0
- package/dist/types/types/index.d.ts +3 -0
- package/dist/types/utils/chrono.d.ts +162 -0
- package/dist/types/utils/equal.d.ts +16 -0
- package/dist/types/utils/error.d.ts +38 -0
- package/dist/types/utils/event.d.ts +68 -0
- package/dist/types/utils/format.d.ts +33 -0
- package/dist/types/utils/function.d.ts +59 -0
- package/{types → dist/types/utils}/id.d.ts +2 -2
- package/dist/types/utils/index.d.ts +17 -0
- package/dist/types/utils/key.d.ts +7 -0
- package/dist/types/utils/lib.d.ts +5 -0
- package/dist/types/utils/object.d.ts +9 -0
- package/dist/types/utils/path.d.ts +76 -0
- package/dist/types/utils/pinyin.d.ts +41 -0
- package/dist/types/utils/security.d.ts +18 -0
- package/dist/types/utils/string.d.ts +7 -0
- package/dist/types/utils/task.d.ts +6 -0
- package/dist/types/utils/tree.d.ts +208 -0
- package/dist/types/utils/zod.d.ts +1 -0
- package/package.json +58 -57
- package/README.md +0 -25
- package/cjs/color.cjs +0 -2
- package/cjs/constants.cjs +0 -2
- package/cjs/context.cjs +0 -2
- package/cjs/dom.cjs +0 -2
- package/cjs/error.cjs +0 -2
- package/cjs/event.cjs +0 -2
- package/cjs/expression.cjs +0 -2
- package/cjs/function.cjs +0 -2
- package/cjs/id.cjs +0 -2
- package/cjs/index.cjs +0 -2
- package/cjs/json.cjs +0 -2
- package/cjs/module.cjs +0 -2
- package/cjs/path.cjs +0 -2
- package/cjs/pinyin.cjs +0 -2
- package/cjs/security.cjs +0 -2
- package/cjs/store.cjs +0 -2
- package/cjs/styles.cjs +0 -2
- package/cjs/temporal.cjs +0 -2
- package/cjs/theme-variables.cjs +0 -2
- package/cjs/types.cjs +0 -2
- package/cjs/utils.cjs +0 -2
- package/cjs/validation.cjs +0 -2
- package/cjs/yaml.cjs +0 -2
- package/cjs/zod.cjs +0 -2
- package/esm/color.js +0 -2
- package/esm/constants.js +0 -2
- package/esm/context.js +0 -2
- package/esm/dom.js +0 -2
- package/esm/error.js +0 -2
- package/esm/event.js +0 -2
- package/esm/expression.js +0 -2
- package/esm/function.js +0 -2
- package/esm/id.js +0 -2
- package/esm/index.js +0 -2
- package/esm/json.js +0 -2
- package/esm/module.js +0 -2
- package/esm/path.js +0 -2
- package/esm/pinyin.js +0 -2
- package/esm/security.js +0 -2
- package/esm/store.js +0 -2
- package/esm/styles.js +0 -2
- package/esm/temporal.js +0 -2
- package/esm/theme-variables.js +0 -2
- package/esm/types.js +0 -2
- package/esm/utils.js +0 -2
- package/esm/validation.js +0 -2
- package/esm/yaml.js +0 -2
- package/esm/zod.js +0 -2
- package/types/color.d.ts +0 -7
- package/types/constants.d.ts +0 -28
- package/types/context.d.ts +0 -21
- package/types/dom.d.ts +0 -9
- package/types/error.d.ts +0 -16
- package/types/event.d.ts +0 -6
- package/types/expression.d.ts +0 -23
- package/types/function.d.ts +0 -8
- package/types/index.d.ts +0 -23
- package/types/json.d.ts +0 -7
- package/types/module.d.ts +0 -7
- package/types/path.d.ts +0 -43
- package/types/pinyin.d.ts +0 -14
- package/types/security.d.ts +0 -16
- package/types/store.d.ts +0 -78
- package/types/styles.d.ts +0 -21
- package/types/temporal.d.ts +0 -18
- package/types/theme-variables.d.ts +0 -348
- package/types/types.d.ts +0 -905
- package/types/utils.d.ts +0 -77
- package/types/validation.d.ts +0 -38
- package/types/yaml.d.ts +0 -7
- package/types/zod.d.ts +0 -6
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
/*! @vef-framework/shared v2.0.0 made with ❤️ by Venus | 2025-11-25T10:06:28.916Z */
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
+
|
|
6
|
+
require('./color/index.cjs');
|
|
7
|
+
require('./constants/index.cjs');
|
|
8
|
+
require('./types/index.cjs');
|
|
9
|
+
require('./utils/index.cjs');
|
|
10
|
+
const colorOps = require('./color/color-ops.cjs');
|
|
11
|
+
const name = require('./color/name.cjs');
|
|
12
|
+
const palette = require('./color/palette.cjs');
|
|
13
|
+
const colorNames = require('./constants/color-names.cjs');
|
|
14
|
+
const colorPalettes = require('./constants/color-palettes.cjs');
|
|
15
|
+
const chrono = require('./utils/chrono.cjs');
|
|
16
|
+
const equal = require('./utils/equal.cjs');
|
|
17
|
+
const error = require('./utils/error.cjs');
|
|
18
|
+
const event = require('./utils/event.cjs');
|
|
19
|
+
const format = require('./utils/format.cjs');
|
|
20
|
+
const _function = require('./utils/function.cjs');
|
|
21
|
+
const id = require('./utils/id.cjs');
|
|
22
|
+
const key = require('./utils/key.cjs');
|
|
23
|
+
const klona = require('klona');
|
|
24
|
+
const qs = require('qs');
|
|
25
|
+
const radashi = require('radashi');
|
|
26
|
+
const lib = require('./utils/lib.cjs');
|
|
27
|
+
const object = require('./utils/object.cjs');
|
|
28
|
+
const path = require('./utils/path.cjs');
|
|
29
|
+
const pinyin = require('./utils/pinyin.cjs');
|
|
30
|
+
const security = require('./utils/security.cjs');
|
|
31
|
+
const string = require('./utils/string.cjs');
|
|
32
|
+
const task = require('./utils/task.cjs');
|
|
33
|
+
const tree = require('./utils/tree.cjs');
|
|
34
|
+
const zod = require('zod');
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
exports.convertHslToHex = colorOps.convertHslToHex;
|
|
39
|
+
exports.convertTransparentToOpaque = colorOps.convertTransparentToOpaque;
|
|
40
|
+
exports.getColorDifference = colorOps.getColorDifference;
|
|
41
|
+
exports.isValidColor = colorOps.isValidColor;
|
|
42
|
+
exports.isWhiteColor = colorOps.isWhiteColor;
|
|
43
|
+
exports.mixColor = colorOps.mixColor;
|
|
44
|
+
exports.setColorAlpha = colorOps.setColorAlpha;
|
|
45
|
+
exports.toHexColor = colorOps.toHexColor;
|
|
46
|
+
exports.toHslColor = colorOps.toHslColor;
|
|
47
|
+
exports.toHsvColor = colorOps.toHsvColor;
|
|
48
|
+
exports.toRgbColor = colorOps.toRgbColor;
|
|
49
|
+
exports.getColorName = name.getColorName;
|
|
50
|
+
exports.getColorPalette = palette.getColorPalette;
|
|
51
|
+
exports.colorEntries = colorNames.colorEntries;
|
|
52
|
+
exports.colorNameMap = colorNames.colorNameMap;
|
|
53
|
+
exports.colorPaletteMap = colorPalettes.colorPaletteMap;
|
|
54
|
+
exports.colorPalettes = colorPalettes.colorPalettes;
|
|
55
|
+
exports.DEFAULT_DATETIME_FORMAT = chrono.DEFAULT_DATETIME_FORMAT;
|
|
56
|
+
exports.DEFAULT_DATE_FORMAT = chrono.DEFAULT_DATE_FORMAT;
|
|
57
|
+
exports.DEFAULT_TIME_FORMAT = chrono.DEFAULT_TIME_FORMAT;
|
|
58
|
+
exports.LOCALIZED_DATETIME_FORMAT = chrono.LOCALIZED_DATETIME_FORMAT;
|
|
59
|
+
exports.LOCALIZED_DATE_FORMAT = chrono.LOCALIZED_DATE_FORMAT;
|
|
60
|
+
exports.formatDate = chrono.formatDate;
|
|
61
|
+
exports.formatDuration = chrono.formatDuration;
|
|
62
|
+
exports.getLocalizedDateTime = chrono.getLocalizedDateTime;
|
|
63
|
+
exports.getNow = chrono.getNow;
|
|
64
|
+
exports.getNowDateString = chrono.getNowDateString;
|
|
65
|
+
exports.getNowDateTimeString = chrono.getNowDateTimeString;
|
|
66
|
+
exports.getNowTimeString = chrono.getNowTimeString;
|
|
67
|
+
exports.getTemporalFormats = chrono.getTemporalFormats;
|
|
68
|
+
exports.parseDate = chrono.parseDate;
|
|
69
|
+
exports.tryParseDate = chrono.tryParseDate;
|
|
70
|
+
exports.isDeepEqual = equal.isDeepEqual;
|
|
71
|
+
exports.isShallowEqual = equal.isShallowEqual;
|
|
72
|
+
exports.filterUserFrame = error.filterUserFrame;
|
|
73
|
+
exports.getCurrentStack = error.getCurrentStack;
|
|
74
|
+
exports.getCurrentStackSync = error.getCurrentStackSync;
|
|
75
|
+
exports.getSanitizedErrorStack = error.getSanitizedErrorStack;
|
|
76
|
+
exports.parseErrorStack = error.parseErrorStack;
|
|
77
|
+
exports.EventEmitter = event.EventEmitter;
|
|
78
|
+
exports.createEventEmitter = event.createEventEmitter;
|
|
79
|
+
exports.formatBytes = format.formatBytes;
|
|
80
|
+
exports.formatNumber = format.formatNumber;
|
|
81
|
+
exports.createThrowNotImplementedFn = _function.createThrowNotImplementedFn;
|
|
82
|
+
exports.identity = _function.identity;
|
|
83
|
+
exports.invokeAwaitableFn = _function.invokeAwaitableFn;
|
|
84
|
+
exports.isAsyncFunction = _function.isAsyncFunction;
|
|
85
|
+
exports.throwNotImplemented = _function.throwNotImplemented;
|
|
86
|
+
exports.generateId = id.generateId;
|
|
87
|
+
exports.hashKey = key.hashKey;
|
|
88
|
+
Object.defineProperty(exports, "cloneDeep", {
|
|
89
|
+
enumerable: true,
|
|
90
|
+
get: () => klona.klona
|
|
91
|
+
});
|
|
92
|
+
Object.defineProperty(exports, "decodeQueryString", {
|
|
93
|
+
enumerable: true,
|
|
94
|
+
get: () => qs.parse
|
|
95
|
+
});
|
|
96
|
+
Object.defineProperty(exports, "encodeQueryString", {
|
|
97
|
+
enumerable: true,
|
|
98
|
+
get: () => qs.stringify
|
|
99
|
+
});
|
|
100
|
+
Object.defineProperty(exports, "always", {
|
|
101
|
+
enumerable: true,
|
|
102
|
+
get: () => radashi.always
|
|
103
|
+
});
|
|
104
|
+
Object.defineProperty(exports, "assign", {
|
|
105
|
+
enumerable: true,
|
|
106
|
+
get: () => radashi.assign
|
|
107
|
+
});
|
|
108
|
+
Object.defineProperty(exports, "camelCase", {
|
|
109
|
+
enumerable: true,
|
|
110
|
+
get: () => radashi.camel
|
|
111
|
+
});
|
|
112
|
+
Object.defineProperty(exports, "capitalize", {
|
|
113
|
+
enumerable: true,
|
|
114
|
+
get: () => radashi.capitalize
|
|
115
|
+
});
|
|
116
|
+
Object.defineProperty(exports, "cluster", {
|
|
117
|
+
enumerable: true,
|
|
118
|
+
get: () => radashi.cluster
|
|
119
|
+
});
|
|
120
|
+
Object.defineProperty(exports, "debounce", {
|
|
121
|
+
enumerable: true,
|
|
122
|
+
get: () => radashi.debounce
|
|
123
|
+
});
|
|
124
|
+
Object.defineProperty(exports, "first", {
|
|
125
|
+
enumerable: true,
|
|
126
|
+
get: () => radashi.first
|
|
127
|
+
});
|
|
128
|
+
Object.defineProperty(exports, "get", {
|
|
129
|
+
enumerable: true,
|
|
130
|
+
get: () => radashi.get
|
|
131
|
+
});
|
|
132
|
+
Object.defineProperty(exports, "isArray", {
|
|
133
|
+
enumerable: true,
|
|
134
|
+
get: () => radashi.isArray
|
|
135
|
+
});
|
|
136
|
+
Object.defineProperty(exports, "isBigInt", {
|
|
137
|
+
enumerable: true,
|
|
138
|
+
get: () => radashi.isBigInt
|
|
139
|
+
});
|
|
140
|
+
Object.defineProperty(exports, "isBoolean", {
|
|
141
|
+
enumerable: true,
|
|
142
|
+
get: () => radashi.isBoolean
|
|
143
|
+
});
|
|
144
|
+
Object.defineProperty(exports, "isDate", {
|
|
145
|
+
enumerable: true,
|
|
146
|
+
get: () => radashi.isDate
|
|
147
|
+
});
|
|
148
|
+
Object.defineProperty(exports, "isEmpty", {
|
|
149
|
+
enumerable: true,
|
|
150
|
+
get: () => radashi.isEmpty
|
|
151
|
+
});
|
|
152
|
+
Object.defineProperty(exports, "isError", {
|
|
153
|
+
enumerable: true,
|
|
154
|
+
get: () => radashi.isError
|
|
155
|
+
});
|
|
156
|
+
Object.defineProperty(exports, "isFloat", {
|
|
157
|
+
enumerable: true,
|
|
158
|
+
get: () => radashi.isFloat
|
|
159
|
+
});
|
|
160
|
+
Object.defineProperty(exports, "isFunction", {
|
|
161
|
+
enumerable: true,
|
|
162
|
+
get: () => radashi.isFunction
|
|
163
|
+
});
|
|
164
|
+
Object.defineProperty(exports, "isInt", {
|
|
165
|
+
enumerable: true,
|
|
166
|
+
get: () => radashi.isInt
|
|
167
|
+
});
|
|
168
|
+
Object.defineProperty(exports, "isIntString", {
|
|
169
|
+
enumerable: true,
|
|
170
|
+
get: () => radashi.isIntString
|
|
171
|
+
});
|
|
172
|
+
Object.defineProperty(exports, "isMap", {
|
|
173
|
+
enumerable: true,
|
|
174
|
+
get: () => radashi.isMap
|
|
175
|
+
});
|
|
176
|
+
Object.defineProperty(exports, "isNullish", {
|
|
177
|
+
enumerable: true,
|
|
178
|
+
get: () => radashi.isNullish
|
|
179
|
+
});
|
|
180
|
+
Object.defineProperty(exports, "isNumber", {
|
|
181
|
+
enumerable: true,
|
|
182
|
+
get: () => radashi.isNumber
|
|
183
|
+
});
|
|
184
|
+
Object.defineProperty(exports, "isObject", {
|
|
185
|
+
enumerable: true,
|
|
186
|
+
get: () => radashi.isObject
|
|
187
|
+
});
|
|
188
|
+
Object.defineProperty(exports, "isPlainObject", {
|
|
189
|
+
enumerable: true,
|
|
190
|
+
get: () => radashi.isPlainObject
|
|
191
|
+
});
|
|
192
|
+
Object.defineProperty(exports, "isPrimitive", {
|
|
193
|
+
enumerable: true,
|
|
194
|
+
get: () => radashi.isPrimitive
|
|
195
|
+
});
|
|
196
|
+
Object.defineProperty(exports, "isPromise", {
|
|
197
|
+
enumerable: true,
|
|
198
|
+
get: () => radashi.isPromise
|
|
199
|
+
});
|
|
200
|
+
Object.defineProperty(exports, "isRegExp", {
|
|
201
|
+
enumerable: true,
|
|
202
|
+
get: () => radashi.isRegExp
|
|
203
|
+
});
|
|
204
|
+
Object.defineProperty(exports, "isSet", {
|
|
205
|
+
enumerable: true,
|
|
206
|
+
get: () => radashi.isSet
|
|
207
|
+
});
|
|
208
|
+
Object.defineProperty(exports, "isString", {
|
|
209
|
+
enumerable: true,
|
|
210
|
+
get: () => radashi.isString
|
|
211
|
+
});
|
|
212
|
+
Object.defineProperty(exports, "isSymbol", {
|
|
213
|
+
enumerable: true,
|
|
214
|
+
get: () => radashi.isSymbol
|
|
215
|
+
});
|
|
216
|
+
Object.defineProperty(exports, "isUndefined", {
|
|
217
|
+
enumerable: true,
|
|
218
|
+
get: () => radashi.isUndefined
|
|
219
|
+
});
|
|
220
|
+
Object.defineProperty(exports, "isWeakMap", {
|
|
221
|
+
enumerable: true,
|
|
222
|
+
get: () => radashi.isWeakMap
|
|
223
|
+
});
|
|
224
|
+
Object.defineProperty(exports, "isWeakSet", {
|
|
225
|
+
enumerable: true,
|
|
226
|
+
get: () => radashi.isWeakSet
|
|
227
|
+
});
|
|
228
|
+
Object.defineProperty(exports, "kebabCase", {
|
|
229
|
+
enumerable: true,
|
|
230
|
+
get: () => radashi.dash
|
|
231
|
+
});
|
|
232
|
+
Object.defineProperty(exports, "last", {
|
|
233
|
+
enumerable: true,
|
|
234
|
+
get: () => radashi.last
|
|
235
|
+
});
|
|
236
|
+
Object.defineProperty(exports, "max", {
|
|
237
|
+
enumerable: true,
|
|
238
|
+
get: () => radashi.max
|
|
239
|
+
});
|
|
240
|
+
Object.defineProperty(exports, "memoize", {
|
|
241
|
+
enumerable: true,
|
|
242
|
+
get: () => radashi.memo
|
|
243
|
+
});
|
|
244
|
+
Object.defineProperty(exports, "min", {
|
|
245
|
+
enumerable: true,
|
|
246
|
+
get: () => radashi.min
|
|
247
|
+
});
|
|
248
|
+
Object.defineProperty(exports, "noop", {
|
|
249
|
+
enumerable: true,
|
|
250
|
+
get: () => radashi.noop
|
|
251
|
+
});
|
|
252
|
+
Object.defineProperty(exports, "omit", {
|
|
253
|
+
enumerable: true,
|
|
254
|
+
get: () => radashi.omit
|
|
255
|
+
});
|
|
256
|
+
Object.defineProperty(exports, "once", {
|
|
257
|
+
enumerable: true,
|
|
258
|
+
get: () => radashi.once
|
|
259
|
+
});
|
|
260
|
+
Object.defineProperty(exports, "pascalCase", {
|
|
261
|
+
enumerable: true,
|
|
262
|
+
get: () => radashi.pascal
|
|
263
|
+
});
|
|
264
|
+
Object.defineProperty(exports, "pick", {
|
|
265
|
+
enumerable: true,
|
|
266
|
+
get: () => radashi.pick
|
|
267
|
+
});
|
|
268
|
+
Object.defineProperty(exports, "set", {
|
|
269
|
+
enumerable: true,
|
|
270
|
+
get: () => radashi.set
|
|
271
|
+
});
|
|
272
|
+
Object.defineProperty(exports, "similarity", {
|
|
273
|
+
enumerable: true,
|
|
274
|
+
get: () => radashi.similarity
|
|
275
|
+
});
|
|
276
|
+
Object.defineProperty(exports, "snakeCase", {
|
|
277
|
+
enumerable: true,
|
|
278
|
+
get: () => radashi.snake
|
|
279
|
+
});
|
|
280
|
+
Object.defineProperty(exports, "sum", {
|
|
281
|
+
enumerable: true,
|
|
282
|
+
get: () => radashi.sum
|
|
283
|
+
});
|
|
284
|
+
Object.defineProperty(exports, "template", {
|
|
285
|
+
enumerable: true,
|
|
286
|
+
get: () => radashi.template
|
|
287
|
+
});
|
|
288
|
+
Object.defineProperty(exports, "throttle", {
|
|
289
|
+
enumerable: true,
|
|
290
|
+
get: () => radashi.throttle
|
|
291
|
+
});
|
|
292
|
+
Object.defineProperty(exports, "toFloat", {
|
|
293
|
+
enumerable: true,
|
|
294
|
+
get: () => radashi.toFloat
|
|
295
|
+
});
|
|
296
|
+
Object.defineProperty(exports, "toInt", {
|
|
297
|
+
enumerable: true,
|
|
298
|
+
get: () => radashi.toInt
|
|
299
|
+
});
|
|
300
|
+
Object.defineProperty(exports, "trim", {
|
|
301
|
+
enumerable: true,
|
|
302
|
+
get: () => radashi.trim
|
|
303
|
+
});
|
|
304
|
+
Object.defineProperty(exports, "unique", {
|
|
305
|
+
enumerable: true,
|
|
306
|
+
get: () => radashi.unique
|
|
307
|
+
});
|
|
308
|
+
exports.alwaysFalse = lib.alwaysFalse;
|
|
309
|
+
exports.alwaysTrue = lib.alwaysTrue;
|
|
310
|
+
exports.mergeWith = object.mergeWith;
|
|
311
|
+
exports.formatPath = path.formatPath;
|
|
312
|
+
exports.getBaseName = path.getBaseName;
|
|
313
|
+
exports.getDirName = path.getDirName;
|
|
314
|
+
exports.getExtName = path.getExtName;
|
|
315
|
+
exports.getRelativePath = path.getRelativePath;
|
|
316
|
+
exports.isAbsolutePath = path.isAbsolutePath;
|
|
317
|
+
exports.joinPaths = path.joinPaths;
|
|
318
|
+
exports.normalizePath = path.normalizePath;
|
|
319
|
+
exports.parsePath = path.parsePath;
|
|
320
|
+
exports.pathSeparator = path.pathSeparator;
|
|
321
|
+
exports.resolvePath = path.resolvePath;
|
|
322
|
+
exports.getPinyin = pinyin.getPinyin;
|
|
323
|
+
exports.getPinyinInitials = pinyin.getPinyinInitials;
|
|
324
|
+
exports.withPinyin = pinyin.withPinyin;
|
|
325
|
+
exports.decryptUsingRSA = security.decryptUsingRSA;
|
|
326
|
+
exports.encryptUsingRSA = security.encryptUsingRSA;
|
|
327
|
+
exports.constantCase = string.constantCase;
|
|
328
|
+
exports.scheduleMicrotask = task.scheduleMicrotask;
|
|
329
|
+
exports.buildTree = tree.buildTree;
|
|
330
|
+
exports.filterTree = tree.filterTree;
|
|
331
|
+
exports.filterTreeWithAncestors = tree.filterTreeWithAncestors;
|
|
332
|
+
exports.findNodeInTree = tree.findNodeInTree;
|
|
333
|
+
exports.flattenTree = tree.flattenTree;
|
|
334
|
+
exports.mapTree = tree.mapTree;
|
|
335
|
+
exports.traverseTree = tree.traverseTree;
|
|
336
|
+
Object.defineProperty(exports, "z", {
|
|
337
|
+
enumerable: true,
|
|
338
|
+
get: () => zod.z
|
|
339
|
+
});
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/*! @vef-framework/shared v2.0.0 made with ❤️ by Venus | 2025-11-25T10:06:28.916Z */
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
+
|
|
6
|
+
const dayjs = require('dayjs');
|
|
7
|
+
const locale = require('dayjs/locale/zh-cn');
|
|
8
|
+
const customParseFormat = require('dayjs/plugin/customParseFormat');
|
|
9
|
+
const duration = require('dayjs/plugin/duration');
|
|
10
|
+
const localizedFormat = require('dayjs/plugin/localizedFormat');
|
|
11
|
+
const relativeTime = require('dayjs/plugin/relativeTime');
|
|
12
|
+
|
|
13
|
+
dayjs.locale(locale);
|
|
14
|
+
dayjs.extend(localizedFormat);
|
|
15
|
+
dayjs.extend(customParseFormat);
|
|
16
|
+
dayjs.extend(duration);
|
|
17
|
+
dayjs.extend(relativeTime);
|
|
18
|
+
const DEFAULT_DATE_FORMAT = "YYYY-MM-DD";
|
|
19
|
+
const DEFAULT_TIME_FORMAT = "HH:mm:ss";
|
|
20
|
+
const DEFAULT_DATETIME_FORMAT = "YYYY-MM-DD HH:mm:ss";
|
|
21
|
+
const LOCALIZED_DATETIME_FORMAT = "LLLL";
|
|
22
|
+
const LOCALIZED_DATE_FORMAT = "LLdddd";
|
|
23
|
+
const YEAR_FORMATS = ["YYYY"];
|
|
24
|
+
const QUARTER_FORMATS = ["YYYY-Q季度"];
|
|
25
|
+
const MONTH_FORMATS = [
|
|
26
|
+
"YYYY-MM",
|
|
27
|
+
"YYYY/MM",
|
|
28
|
+
"YYYY.MM",
|
|
29
|
+
"YYYYMM"
|
|
30
|
+
];
|
|
31
|
+
const WEEK_FORMATS = ["YYYY-wo"];
|
|
32
|
+
const DATE_FORMATS = [
|
|
33
|
+
"YYYY-MM-DD",
|
|
34
|
+
"YYYY/MM/DD",
|
|
35
|
+
"YYYY.MM.DD",
|
|
36
|
+
"YYYYMMDD",
|
|
37
|
+
"YY/MM/DD",
|
|
38
|
+
"YY.MM.DD",
|
|
39
|
+
"YYMMDD"
|
|
40
|
+
];
|
|
41
|
+
const TIME_FORMATS = ["HH:mm:ss", "HH.mm.ss", "HHmmss"];
|
|
42
|
+
const HOUR_FORMATS = ["HH"];
|
|
43
|
+
const MINUTE_FORMATS = ["HH:mm", "HH.mm", "HHmm"];
|
|
44
|
+
const DATETIME_FORMATS = [
|
|
45
|
+
"YYYY-MM-DD HH:mm:ss",
|
|
46
|
+
"YYYY/MM/DD HH:mm:ss",
|
|
47
|
+
"YYYY.MM.DD HH.mm.ss",
|
|
48
|
+
"YYYYMMDDHHmmss",
|
|
49
|
+
"YY/MM/DD HH:mm:ss",
|
|
50
|
+
"YY.MM.DD HH:mm:ss",
|
|
51
|
+
"YY.MM.DD HH.mm.ss",
|
|
52
|
+
"YYMMDDHHmmss"
|
|
53
|
+
];
|
|
54
|
+
function formatDuration(seconds, unit = "seconds") {
|
|
55
|
+
const duration2 = dayjs.duration(seconds, unit);
|
|
56
|
+
const days = Math.floor(duration2.asDays());
|
|
57
|
+
const hours = duration2.hours();
|
|
58
|
+
const minutes = duration2.minutes();
|
|
59
|
+
if (days > 0) {
|
|
60
|
+
return `${days}天${hours}小时${minutes}分钟`;
|
|
61
|
+
}
|
|
62
|
+
if (hours > 0) {
|
|
63
|
+
return `${hours}小时${minutes}分钟`;
|
|
64
|
+
}
|
|
65
|
+
return `${minutes}分钟`;
|
|
66
|
+
}
|
|
67
|
+
function parseDate(date, format = DEFAULT_DATETIME_FORMAT) {
|
|
68
|
+
if (date instanceof Date) {
|
|
69
|
+
return dayjs(date);
|
|
70
|
+
}
|
|
71
|
+
return format ? dayjs(date, format) : dayjs(date);
|
|
72
|
+
}
|
|
73
|
+
function tryParseDate(date) {
|
|
74
|
+
for (const format of DATETIME_FORMATS) {
|
|
75
|
+
const parsed = dayjs(date, format, true);
|
|
76
|
+
if (parsed.isValid()) {
|
|
77
|
+
return parsed;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
for (const format of DATE_FORMATS) {
|
|
81
|
+
const parsed = dayjs(date, format, true);
|
|
82
|
+
if (parsed.isValid()) {
|
|
83
|
+
return parsed;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
const defaultParsed = dayjs(date);
|
|
87
|
+
if (defaultParsed.isValid()) {
|
|
88
|
+
return defaultParsed;
|
|
89
|
+
}
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
function formatDate(date, format = DEFAULT_DATETIME_FORMAT) {
|
|
93
|
+
return date.format(format);
|
|
94
|
+
}
|
|
95
|
+
function getNow() {
|
|
96
|
+
return dayjs();
|
|
97
|
+
}
|
|
98
|
+
function getNowDateString() {
|
|
99
|
+
return dayjs().format(DEFAULT_DATE_FORMAT);
|
|
100
|
+
}
|
|
101
|
+
function getNowTimeString() {
|
|
102
|
+
return dayjs().format(DEFAULT_TIME_FORMAT);
|
|
103
|
+
}
|
|
104
|
+
function getNowDateTimeString() {
|
|
105
|
+
return dayjs().format(DEFAULT_DATETIME_FORMAT);
|
|
106
|
+
}
|
|
107
|
+
function getLocalizedDateTime(includeTime = true) {
|
|
108
|
+
return dayjs().format(includeTime ? LOCALIZED_DATETIME_FORMAT : LOCALIZED_DATE_FORMAT);
|
|
109
|
+
}
|
|
110
|
+
const FORMAT_MAP = {
|
|
111
|
+
year: YEAR_FORMATS,
|
|
112
|
+
quarter: QUARTER_FORMATS,
|
|
113
|
+
month: MONTH_FORMATS,
|
|
114
|
+
week: WEEK_FORMATS,
|
|
115
|
+
date: DATE_FORMATS,
|
|
116
|
+
time: TIME_FORMATS,
|
|
117
|
+
hour: HOUR_FORMATS,
|
|
118
|
+
minute: MINUTE_FORMATS,
|
|
119
|
+
datetime: DATETIME_FORMATS
|
|
120
|
+
};
|
|
121
|
+
function getTemporalFormats(mode) {
|
|
122
|
+
return FORMAT_MAP[mode];
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
exports.DEFAULT_DATETIME_FORMAT = DEFAULT_DATETIME_FORMAT;
|
|
126
|
+
exports.DEFAULT_DATE_FORMAT = DEFAULT_DATE_FORMAT;
|
|
127
|
+
exports.DEFAULT_TIME_FORMAT = DEFAULT_TIME_FORMAT;
|
|
128
|
+
exports.LOCALIZED_DATETIME_FORMAT = LOCALIZED_DATETIME_FORMAT;
|
|
129
|
+
exports.LOCALIZED_DATE_FORMAT = LOCALIZED_DATE_FORMAT;
|
|
130
|
+
exports.formatDate = formatDate;
|
|
131
|
+
exports.formatDuration = formatDuration;
|
|
132
|
+
exports.getLocalizedDateTime = getLocalizedDateTime;
|
|
133
|
+
exports.getNow = getNow;
|
|
134
|
+
exports.getNowDateString = getNowDateString;
|
|
135
|
+
exports.getNowDateTimeString = getNowDateTimeString;
|
|
136
|
+
exports.getNowTimeString = getNowTimeString;
|
|
137
|
+
exports.getTemporalFormats = getTemporalFormats;
|
|
138
|
+
exports.parseDate = parseDate;
|
|
139
|
+
exports.tryParseDate = tryParseDate;
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/*! @vef-framework/shared v2.0.0 made with ❤️ by Venus | 2025-11-25T10:06:28.916Z */
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
+
|
|
6
|
+
function isShallowEqual(value1, value2) {
|
|
7
|
+
if (Object.is(value1, value2)) {
|
|
8
|
+
return true;
|
|
9
|
+
}
|
|
10
|
+
if (typeof value1 !== "object" || value1 === null || typeof value2 !== "object" || value2 === null) {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
if (value1 instanceof Map && value2 instanceof Map) {
|
|
14
|
+
if (value1.size !== value2.size) {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
for (const [k, v] of value1) {
|
|
18
|
+
if (!value2.has(k) || !Object.is(v, value2.get(k))) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
if (value1 instanceof Set && value2 instanceof Set) {
|
|
25
|
+
if (value1.size !== value2.size) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
for (const v of value1) {
|
|
29
|
+
if (!value2.has(v)) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
const isArray1 = Array.isArray(value1);
|
|
36
|
+
const isArray2 = Array.isArray(value2);
|
|
37
|
+
if (isArray1 !== isArray2) {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
if (value1.constructor !== value2.constructor) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
const keysA = Object.keys(value1);
|
|
44
|
+
if (keysA.length !== Object.keys(value2).length) {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
for (const element of keysA) {
|
|
48
|
+
if (!Object.hasOwn(value2, element) || !Object.is(value1[element], value2[element])) {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
function isDeepEqual(value1, value2) {
|
|
55
|
+
const { valueOf, toString } = Object.prototype;
|
|
56
|
+
const visited = /* @__PURE__ */ new WeakMap();
|
|
57
|
+
const compareValues = (currentFirst, currentSecond) => {
|
|
58
|
+
if (currentFirst === currentSecond) {
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
if (typeof currentFirst !== "object" || typeof currentSecond !== "object" || !currentFirst || !currentSecond) {
|
|
62
|
+
return currentFirst !== currentFirst && currentSecond !== currentSecond;
|
|
63
|
+
}
|
|
64
|
+
if (Object.getPrototypeOf(currentFirst) !== Object.getPrototypeOf(currentSecond)) {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
const { constructor } = currentFirst;
|
|
68
|
+
if (constructor === Date) {
|
|
69
|
+
return currentFirst.getTime() === currentSecond.getTime();
|
|
70
|
+
}
|
|
71
|
+
if (constructor === RegExp) {
|
|
72
|
+
const firstRegex = currentFirst;
|
|
73
|
+
const secondRegex = currentSecond;
|
|
74
|
+
return firstRegex.source === secondRegex.source && firstRegex.flags === secondRegex.flags;
|
|
75
|
+
}
|
|
76
|
+
if (constructor === Set) {
|
|
77
|
+
const firstSet = currentFirst;
|
|
78
|
+
const secondSet = currentSecond;
|
|
79
|
+
if (firstSet.size !== secondSet.size) {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
for (const value of firstSet) {
|
|
83
|
+
let found = false;
|
|
84
|
+
for (const secondValue of secondSet) {
|
|
85
|
+
if (compareValues(value, secondValue)) {
|
|
86
|
+
found = true;
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (!found) {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
if (constructor === ArrayBuffer) {
|
|
97
|
+
const firstView = new DataView(currentFirst);
|
|
98
|
+
const secondView = new DataView(currentSecond);
|
|
99
|
+
return compareValues(firstView, secondView);
|
|
100
|
+
}
|
|
101
|
+
if (constructor === DataView || ArrayBuffer.isView(currentFirst)) {
|
|
102
|
+
let firstView;
|
|
103
|
+
let secondView;
|
|
104
|
+
if (constructor === DataView) {
|
|
105
|
+
firstView = currentFirst;
|
|
106
|
+
secondView = currentSecond;
|
|
107
|
+
} else {
|
|
108
|
+
const firstTyped = currentFirst;
|
|
109
|
+
const secondTyped = currentSecond;
|
|
110
|
+
firstView = new DataView(firstTyped.buffer, firstTyped.byteOffset, firstTyped.byteLength);
|
|
111
|
+
secondView = new DataView(secondTyped.buffer, secondTyped.byteOffset, secondTyped.byteLength);
|
|
112
|
+
}
|
|
113
|
+
if (firstView.byteLength !== secondView.byteLength) {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
for (let index = firstView.byteLength; index-- !== 0; ) {
|
|
117
|
+
if (firstView.getUint8(index) !== secondView.getUint8(index)) {
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return true;
|
|
122
|
+
}
|
|
123
|
+
if (visited.has(currentFirst) && visited.get(currentFirst) === currentSecond) {
|
|
124
|
+
return true;
|
|
125
|
+
}
|
|
126
|
+
visited.set(currentFirst, currentSecond);
|
|
127
|
+
if (constructor === Array) {
|
|
128
|
+
const firstArray = currentFirst;
|
|
129
|
+
const secondArray = currentSecond;
|
|
130
|
+
if (firstArray.length !== secondArray.length) {
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
for (let index = firstArray.length; index-- !== 0; ) {
|
|
134
|
+
if (!compareValues(firstArray[index], secondArray[index])) {
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return true;
|
|
139
|
+
}
|
|
140
|
+
if (constructor === Map) {
|
|
141
|
+
const firstMap = currentFirst;
|
|
142
|
+
const secondMap = currentSecond;
|
|
143
|
+
if (firstMap.size !== secondMap.size) {
|
|
144
|
+
return false;
|
|
145
|
+
}
|
|
146
|
+
for (const [key, value] of firstMap) {
|
|
147
|
+
if (!secondMap.has(key) || !compareValues(value, secondMap.get(key))) {
|
|
148
|
+
return false;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return true;
|
|
152
|
+
}
|
|
153
|
+
const firstAsAny = currentFirst;
|
|
154
|
+
const secondAsAny = currentSecond;
|
|
155
|
+
if (firstAsAny.valueOf !== valueOf && typeof firstAsAny.valueOf === "function" && typeof secondAsAny.valueOf === "function") {
|
|
156
|
+
return firstAsAny.valueOf() === secondAsAny.valueOf();
|
|
157
|
+
}
|
|
158
|
+
if (firstAsAny.toString !== toString && typeof firstAsAny.toString === "function" && typeof secondAsAny.toString === "function") {
|
|
159
|
+
return firstAsAny.toString() === secondAsAny.toString();
|
|
160
|
+
}
|
|
161
|
+
const firstKeys = Object.keys(currentFirst);
|
|
162
|
+
let currentKey;
|
|
163
|
+
for (let index = firstKeys.length; index-- !== 0; ) {
|
|
164
|
+
currentKey = firstKeys[index];
|
|
165
|
+
if (!Object.hasOwn(currentSecond, currentKey) || !compareValues(firstAsAny[currentKey], secondAsAny[currentKey])) {
|
|
166
|
+
return false;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
return Object.keys(currentSecond).length === firstKeys.length;
|
|
170
|
+
};
|
|
171
|
+
return compareValues(value1, value2);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
exports.isDeepEqual = isDeepEqual;
|
|
175
|
+
exports.isShallowEqual = isShallowEqual;
|