@lntvow/utils 2.4.0 → 2.4.2
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/index.cjs +1 -1
- package/dist/index.d.ts +13 -0
- package/dist/index.mjs +316 -303
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
function
|
|
1
|
+
function Z0(...t) {
|
|
2
2
|
return t.reduce((e, n) => function(...r) {
|
|
3
3
|
return n(e(...r));
|
|
4
4
|
});
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function P0(...t) {
|
|
7
7
|
return t.reduce((e, n) => function(...r) {
|
|
8
8
|
return e(n(...r));
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function U0(t, e = 500) {
|
|
12
12
|
let n = null;
|
|
13
13
|
return function(...r) {
|
|
14
14
|
n && clearTimeout(n), n = setTimeout(() => {
|
|
@@ -18,18 +18,18 @@ function Z0(t, e = 500) {
|
|
|
18
18
|
}
|
|
19
19
|
const S0 = Object.prototype.toString, o0 = (t) => S0.call(t);
|
|
20
20
|
let f0 = null;
|
|
21
|
-
function
|
|
21
|
+
function k0(t) {
|
|
22
22
|
i0(t) && (f0 = t);
|
|
23
23
|
}
|
|
24
|
-
const
|
|
24
|
+
const z0 = (t, ...e) => {
|
|
25
25
|
const n = e.length === 0 ? "" : e.length === 1 ? e[0] : e;
|
|
26
26
|
console.log(
|
|
27
27
|
`%c ${t} `,
|
|
28
28
|
"padding: 2px; border-radius: 3px; color: #fff; background: #000; font-weight: bold;",
|
|
29
29
|
n
|
|
30
30
|
), f0 && f0(t, n);
|
|
31
|
-
},
|
|
32
|
-
function
|
|
31
|
+
}, W0 = (...t) => console.warn(...t), V0 = (...t) => console.error(...t), q0 = (t) => o0(t) === "[object Map]", X0 = (t) => o0(t) === "[object Set]", O0 = (t) => o0(t) === "[object Date]", x0 = (t) => o0(t) === "[object RegExp]", i0 = (t) => typeof t == "function", s0 = (t) => typeof t == "number", A0 = (t) => typeof t == "string", B0 = (t) => typeof t == "symbol", W = (t) => t !== null && typeof t == "object", J0 = (t) => W(t) && i0(t.then) && i0(t.catch), r0 = (t) => t == null, G0 = (t) => t === void 0, K0 = (t) => t === null, Q0 = (t) => t != null, t2 = (t) => typeof t == "boolean", n0 = Array.isArray, d0 = (t, e) => Object.hasOwn(t, e), e2 = (t, e) => t !== e;
|
|
32
|
+
function h0(t) {
|
|
33
33
|
const e = /* @__PURE__ */ new WeakMap();
|
|
34
34
|
function n(r) {
|
|
35
35
|
if (O0(r))
|
|
@@ -63,22 +63,30 @@ class m0 extends Error {
|
|
|
63
63
|
function V(t, e) {
|
|
64
64
|
throw new m0(`[${t}] ${e}`);
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function C0(t, e) {
|
|
67
67
|
if (process.env.NODE_ENV !== "production") {
|
|
68
68
|
const n = A0(t) ? new m0(`[${t}] ${e}`) : t;
|
|
69
69
|
console.warn(n);
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
+
const E0 = ({
|
|
73
|
+
from: t,
|
|
74
|
+
replacement: e,
|
|
75
|
+
version: n,
|
|
76
|
+
type: r = "API"
|
|
77
|
+
}) => {
|
|
78
|
+
C0(`${r}`, `${t} is about to be deprecated in version ${n}, please use ${e} instead.`);
|
|
79
|
+
};
|
|
72
80
|
function k(t, e, n) {
|
|
73
|
-
return (!W(t) || !W(e)) && V("deepMerge", "template 和 source 必须是对象"), n0(t) ?
|
|
81
|
+
return (!W(t) || !W(e)) && V("deepMerge", "template 和 source 必须是对象"), n0(t) ? _0(t, e, n) : L0(t, e, n);
|
|
74
82
|
}
|
|
75
|
-
function
|
|
83
|
+
function L0(t, e, n) {
|
|
76
84
|
const r = e0(e, n);
|
|
77
85
|
return Object.keys(t).forEach((f) => {
|
|
78
86
|
r0(e[f]) ? r[f] = e0(t[f], n) : r[f] = W(t[f]) && W(e[f]) ? k(t[f], e[f], n) : e0(e[f], n);
|
|
79
87
|
}), r;
|
|
80
88
|
}
|
|
81
|
-
function
|
|
89
|
+
function _0(t, e, n) {
|
|
82
90
|
if (n0(e)) {
|
|
83
91
|
const r = e0(e, n);
|
|
84
92
|
return r.push(...e0(t, n)), r;
|
|
@@ -87,9 +95,9 @@ function E0(t, e, n) {
|
|
|
87
95
|
}
|
|
88
96
|
function e0(t, e) {
|
|
89
97
|
const { deepClone: n = !0 } = e || {};
|
|
90
|
-
return n ?
|
|
98
|
+
return n ? h0(t) : t;
|
|
91
99
|
}
|
|
92
|
-
function
|
|
100
|
+
function j0(t, e) {
|
|
93
101
|
const { decode: n } = k({ decode: !0 }, e || {}), r = {};
|
|
94
102
|
t.startsWith("?") && (t = t.slice(1)), t.includes("?") && (t = t.slice(t.indexOf("?") + 1));
|
|
95
103
|
const d = t.split("&").filter(Boolean);
|
|
@@ -107,16 +115,16 @@ function $0(t, e) {
|
|
|
107
115
|
}
|
|
108
116
|
return r.join("&");
|
|
109
117
|
}
|
|
110
|
-
function
|
|
118
|
+
function T0(t, e, n) {
|
|
111
119
|
const r = k({ encode: !0 }, n || {}), d = $0(e, r);
|
|
112
120
|
return t.includes("?") ? t.endsWith("?") || t.endsWith("&") ? `${t}${d}` : `${t}&${d}` : `${t}?${d}`;
|
|
113
121
|
}
|
|
114
|
-
const
|
|
115
|
-
parse:
|
|
122
|
+
const n2 = {
|
|
123
|
+
parse: j0,
|
|
116
124
|
stringify: $0,
|
|
117
|
-
appendQueryString:
|
|
125
|
+
appendQueryString: T0
|
|
118
126
|
};
|
|
119
|
-
function
|
|
127
|
+
function r2(t, e = 500) {
|
|
120
128
|
let n = null;
|
|
121
129
|
return function(...r) {
|
|
122
130
|
if (r0(n))
|
|
@@ -128,25 +136,28 @@ function n2(t, e = 500) {
|
|
|
128
136
|
}
|
|
129
137
|
};
|
|
130
138
|
}
|
|
131
|
-
function
|
|
139
|
+
function i2(t) {
|
|
132
140
|
return /^-?\d{1,3}\.\d{6}$/.test(t);
|
|
133
141
|
}
|
|
134
|
-
function
|
|
142
|
+
function o2(t) {
|
|
135
143
|
return !r0(t) && /^[\dA-Za-z\u4E00-\u9FA5]+$/.test(t);
|
|
136
144
|
}
|
|
137
|
-
function
|
|
145
|
+
function s2(t) {
|
|
138
146
|
return !r0(t) && /^[A-Za-z\u4E00-\u9FA5]+$/.test(t);
|
|
139
147
|
}
|
|
140
|
-
function
|
|
148
|
+
function a2(t) {
|
|
141
149
|
return !r0(t) && /^[\d!"#$%&'()*+,./:;<=>?@A-Z[\\\]^_`{|}~]+$/.test(t);
|
|
142
150
|
}
|
|
143
151
|
function u2(t) {
|
|
144
152
|
return /^[\dA-Z_]+$/.test(t);
|
|
145
153
|
}
|
|
154
|
+
function c2(t) {
|
|
155
|
+
return E0({ from: "validatorEmail", replacement: "isEmail", version: "2.4.0" }), /^([\w-])+@([\w-])+(\.[\w-])+/.test(t);
|
|
156
|
+
}
|
|
146
157
|
function g0(t) {
|
|
147
158
|
return n0(t) ? t : [t];
|
|
148
159
|
}
|
|
149
|
-
function
|
|
160
|
+
function f2(t, e) {
|
|
150
161
|
return (!W(t) || !W(e)) && V("deepMerge", "template 和 source 必须是对象"), n0(t) ? void 0 : p0(t, e);
|
|
151
162
|
}
|
|
152
163
|
function p0(t, e) {
|
|
@@ -156,22 +167,22 @@ function p0(t, e) {
|
|
|
156
167
|
W(d) && W(f) ? n[r] = p0(d, f) : Object.is(d, f) || (n[r] = f);
|
|
157
168
|
}), n;
|
|
158
169
|
}
|
|
159
|
-
function
|
|
160
|
-
const n =
|
|
170
|
+
function d2(t, e) {
|
|
171
|
+
const n = h0(t);
|
|
161
172
|
return g0(e).forEach((d) => {
|
|
162
173
|
d0(n, d) && delete n[d];
|
|
163
174
|
}), n;
|
|
164
175
|
}
|
|
165
|
-
function
|
|
176
|
+
function l2(t, e) {
|
|
166
177
|
const n = {};
|
|
167
178
|
return g0(e).forEach((d) => {
|
|
168
179
|
d0(t, d) && (n[d] = t[d]);
|
|
169
180
|
}), n;
|
|
170
181
|
}
|
|
171
|
-
function
|
|
182
|
+
function h2(t, e) {
|
|
172
183
|
return (!s0(t) || t <= 0) && V("generateRandomArray", "num 必须大于0"), i0(e) || V("generateRandomArray", "cb 必须是函数"), Array.from({ length: t }).fill(0).map((n, r) => e(n, r));
|
|
173
184
|
}
|
|
174
|
-
function
|
|
185
|
+
function m2() {
|
|
175
186
|
return `#${Math.random().toString(16).slice(2, 8).padEnd(6, "0")}`;
|
|
176
187
|
}
|
|
177
188
|
var M0 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
@@ -183,62 +194,62 @@ var D0 = { exports: {} };
|
|
|
183
194
|
(function(n, r) {
|
|
184
195
|
t.exports = r();
|
|
185
196
|
})(M0, function() {
|
|
186
|
-
var n = 1e3, r = 6e4, d = 36e5, f = "millisecond", Y = "second", y = "minute", _ = "hour", M = "day", q = "week", x = "month", Q = "quarter", C = "year", J = "date",
|
|
187
|
-
var s = ["th", "st", "nd", "rd"], i =
|
|
188
|
-
return "[" +
|
|
189
|
-
} }, j = function(
|
|
190
|
-
var
|
|
191
|
-
return !
|
|
192
|
-
}, I = { s: j, z: function(
|
|
193
|
-
var s = -
|
|
194
|
-
return (s <= 0 ? "+" : "-") + j(
|
|
195
|
-
}, m: function
|
|
197
|
+
var n = 1e3, r = 6e4, d = 36e5, f = "millisecond", Y = "second", y = "minute", _ = "hour", M = "day", q = "week", x = "month", Q = "quarter", C = "year", J = "date", h = "Invalid Date", g = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, D = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, w = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(u) {
|
|
198
|
+
var s = ["th", "st", "nd", "rd"], i = u % 100;
|
|
199
|
+
return "[" + u + (s[(i - 20) % 10] || s[i] || s[0]) + "]";
|
|
200
|
+
} }, j = function(u, s, i) {
|
|
201
|
+
var a = String(u);
|
|
202
|
+
return !a || a.length >= s ? u : "" + Array(s + 1 - a.length).join(i) + u;
|
|
203
|
+
}, I = { s: j, z: function(u) {
|
|
204
|
+
var s = -u.utcOffset(), i = Math.abs(s), a = Math.floor(i / 60), o = i % 60;
|
|
205
|
+
return (s <= 0 ? "+" : "-") + j(a, 2, "0") + ":" + j(o, 2, "0");
|
|
206
|
+
}, m: function u(s, i) {
|
|
196
207
|
if (s.date() < i.date())
|
|
197
|
-
return -
|
|
198
|
-
var
|
|
199
|
-
return +(-(
|
|
200
|
-
}, a: function(
|
|
201
|
-
return
|
|
202
|
-
}, p: function(
|
|
203
|
-
return { M: x, y: C, w: q, d: M, D: J, h: _, m: y, s: Y, ms: f, Q }[
|
|
204
|
-
}, u: function(
|
|
205
|
-
return
|
|
208
|
+
return -u(i, s);
|
|
209
|
+
var a = 12 * (i.year() - s.year()) + (i.month() - s.month()), o = s.clone().add(a, x), c = i - o < 0, l = s.clone().add(a + (c ? -1 : 1), x);
|
|
210
|
+
return +(-(a + (i - o) / (c ? o - l : l - o)) || 0);
|
|
211
|
+
}, a: function(u) {
|
|
212
|
+
return u < 0 ? Math.ceil(u) || 0 : Math.floor(u);
|
|
213
|
+
}, p: function(u) {
|
|
214
|
+
return { M: x, y: C, w: q, d: M, D: J, h: _, m: y, s: Y, ms: f, Q }[u] || String(u || "").toLowerCase().replace(/s$/, "");
|
|
215
|
+
}, u: function(u) {
|
|
216
|
+
return u === void 0;
|
|
206
217
|
} }, Z = "en", E = {};
|
|
207
218
|
E[Z] = w;
|
|
208
|
-
var H = "$isDayjsObject", T = function(
|
|
209
|
-
return
|
|
210
|
-
}, N = function
|
|
219
|
+
var H = "$isDayjsObject", T = function(u) {
|
|
220
|
+
return u instanceof A || !(!u || !u[H]);
|
|
221
|
+
}, N = function u(s, i, a) {
|
|
211
222
|
var o;
|
|
212
223
|
if (!s)
|
|
213
224
|
return Z;
|
|
214
225
|
if (typeof s == "string") {
|
|
215
226
|
var c = s.toLowerCase();
|
|
216
227
|
E[c] && (o = c), i && (E[c] = i, o = c);
|
|
217
|
-
var
|
|
218
|
-
if (!o &&
|
|
219
|
-
return
|
|
228
|
+
var l = s.split("-");
|
|
229
|
+
if (!o && l.length > 1)
|
|
230
|
+
return u(l[0]);
|
|
220
231
|
} else {
|
|
221
232
|
var $ = s.name;
|
|
222
233
|
E[$] = s, o = $;
|
|
223
234
|
}
|
|
224
|
-
return !
|
|
225
|
-
}, p = function(
|
|
226
|
-
if (T(
|
|
227
|
-
return
|
|
235
|
+
return !a && o && (Z = o), o || !a && Z;
|
|
236
|
+
}, p = function(u, s) {
|
|
237
|
+
if (T(u))
|
|
238
|
+
return u.clone();
|
|
228
239
|
var i = typeof s == "object" ? s : {};
|
|
229
|
-
return i.date =
|
|
240
|
+
return i.date = u, i.args = arguments, new A(i);
|
|
230
241
|
}, m = I;
|
|
231
|
-
m.l = N, m.i = T, m.w = function(
|
|
232
|
-
return p(
|
|
242
|
+
m.l = N, m.i = T, m.w = function(u, s) {
|
|
243
|
+
return p(u, { locale: s.$L, utc: s.$u, x: s.$x, $offset: s.$offset });
|
|
233
244
|
};
|
|
234
245
|
var A = function() {
|
|
235
|
-
function
|
|
246
|
+
function u(i) {
|
|
236
247
|
this.$L = N(i.locale, null, !0), this.parse(i), this.$x = this.$x || i.x || {}, this[H] = !0;
|
|
237
248
|
}
|
|
238
|
-
var s =
|
|
249
|
+
var s = u.prototype;
|
|
239
250
|
return s.parse = function(i) {
|
|
240
|
-
this.$d = function(
|
|
241
|
-
var o =
|
|
251
|
+
this.$d = function(a) {
|
|
252
|
+
var o = a.date, c = a.utc;
|
|
242
253
|
if (o === null)
|
|
243
254
|
return /* @__PURE__ */ new Date(NaN);
|
|
244
255
|
if (m.u(o))
|
|
@@ -246,10 +257,10 @@ var D0 = { exports: {} };
|
|
|
246
257
|
if (o instanceof Date)
|
|
247
258
|
return new Date(o);
|
|
248
259
|
if (typeof o == "string" && !/Z$/i.test(o)) {
|
|
249
|
-
var
|
|
250
|
-
if (
|
|
251
|
-
var $ =
|
|
252
|
-
return c ? new Date(Date.UTC(
|
|
260
|
+
var l = o.match(g);
|
|
261
|
+
if (l) {
|
|
262
|
+
var $ = l[2] - 1 || 0, v = (l[7] || "0").substring(0, 3);
|
|
263
|
+
return c ? new Date(Date.UTC(l[1], $, l[3] || 1, l[4] || 0, l[5] || 0, l[6] || 0, v)) : new Date(l[1], $, l[3] || 1, l[4] || 0, l[5] || 0, l[6] || 0, v);
|
|
253
264
|
}
|
|
254
265
|
}
|
|
255
266
|
return new Date(o);
|
|
@@ -260,86 +271,86 @@ var D0 = { exports: {} };
|
|
|
260
271
|
}, s.$utils = function() {
|
|
261
272
|
return m;
|
|
262
273
|
}, s.isValid = function() {
|
|
263
|
-
return this.$d.toString() !==
|
|
264
|
-
}, s.isSame = function(i,
|
|
274
|
+
return this.$d.toString() !== h;
|
|
275
|
+
}, s.isSame = function(i, a) {
|
|
265
276
|
var o = p(i);
|
|
266
|
-
return this.startOf(
|
|
267
|
-
}, s.isAfter = function(i,
|
|
268
|
-
return p(i) < this.startOf(
|
|
269
|
-
}, s.isBefore = function(i,
|
|
270
|
-
return this.endOf(
|
|
271
|
-
}, s.$g = function(i,
|
|
272
|
-
return m.u(i) ? this[
|
|
277
|
+
return this.startOf(a) <= o && o <= this.endOf(a);
|
|
278
|
+
}, s.isAfter = function(i, a) {
|
|
279
|
+
return p(i) < this.startOf(a);
|
|
280
|
+
}, s.isBefore = function(i, a) {
|
|
281
|
+
return this.endOf(a) < p(i);
|
|
282
|
+
}, s.$g = function(i, a, o) {
|
|
283
|
+
return m.u(i) ? this[a] : this.set(o, i);
|
|
273
284
|
}, s.unix = function() {
|
|
274
285
|
return Math.floor(this.valueOf() / 1e3);
|
|
275
286
|
}, s.valueOf = function() {
|
|
276
287
|
return this.$d.getTime();
|
|
277
|
-
}, s.startOf = function(i,
|
|
278
|
-
var o = this, c = !!m.u(
|
|
288
|
+
}, s.startOf = function(i, a) {
|
|
289
|
+
var o = this, c = !!m.u(a) || a, l = m.p(i), $ = function(U, O) {
|
|
279
290
|
var F = m.w(o.$u ? Date.UTC(o.$y, O, U) : new Date(o.$y, O, U), o);
|
|
280
291
|
return c ? F : F.endOf(M);
|
|
281
|
-
},
|
|
292
|
+
}, v = function(U, O) {
|
|
282
293
|
return m.w(o.toDate()[U].apply(o.toDate("s"), (c ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(O)), o);
|
|
283
|
-
},
|
|
284
|
-
switch (
|
|
294
|
+
}, b = this.$W, S = this.$M, L = this.$D, G = "set" + (this.$u ? "UTC" : "");
|
|
295
|
+
switch (l) {
|
|
285
296
|
case C:
|
|
286
297
|
return c ? $(1, 0) : $(31, 11);
|
|
287
298
|
case x:
|
|
288
299
|
return c ? $(1, S) : $(0, S + 1);
|
|
289
300
|
case q:
|
|
290
|
-
var z = this.$locale().weekStart || 0, X = (
|
|
301
|
+
var z = this.$locale().weekStart || 0, X = (b < z ? b + 7 : b) - z;
|
|
291
302
|
return $(c ? L - X : L + (6 - X), S);
|
|
292
303
|
case M:
|
|
293
304
|
case J:
|
|
294
|
-
return
|
|
305
|
+
return v(G + "Hours", 0);
|
|
295
306
|
case _:
|
|
296
|
-
return
|
|
307
|
+
return v(G + "Minutes", 1);
|
|
297
308
|
case y:
|
|
298
|
-
return
|
|
309
|
+
return v(G + "Seconds", 2);
|
|
299
310
|
case Y:
|
|
300
|
-
return
|
|
311
|
+
return v(G + "Milliseconds", 3);
|
|
301
312
|
default:
|
|
302
313
|
return this.clone();
|
|
303
314
|
}
|
|
304
315
|
}, s.endOf = function(i) {
|
|
305
316
|
return this.startOf(i, !1);
|
|
306
|
-
}, s.$set = function(i,
|
|
307
|
-
var o, c = m.p(i),
|
|
317
|
+
}, s.$set = function(i, a) {
|
|
318
|
+
var o, c = m.p(i), l = "set" + (this.$u ? "UTC" : ""), $ = (o = {}, o[M] = l + "Date", o[J] = l + "Date", o[x] = l + "Month", o[C] = l + "FullYear", o[_] = l + "Hours", o[y] = l + "Minutes", o[Y] = l + "Seconds", o[f] = l + "Milliseconds", o)[c], v = c === M ? this.$D + (a - this.$W) : a;
|
|
308
319
|
if (c === x || c === C) {
|
|
309
|
-
var
|
|
310
|
-
|
|
320
|
+
var b = this.clone().set(J, 1);
|
|
321
|
+
b.$d[$](v), b.init(), this.$d = b.set(J, Math.min(this.$D, b.daysInMonth())).$d;
|
|
311
322
|
} else
|
|
312
|
-
$ && this.$d[$](
|
|
323
|
+
$ && this.$d[$](v);
|
|
313
324
|
return this.init(), this;
|
|
314
|
-
}, s.set = function(i,
|
|
315
|
-
return this.clone().$set(i,
|
|
325
|
+
}, s.set = function(i, a) {
|
|
326
|
+
return this.clone().$set(i, a);
|
|
316
327
|
}, s.get = function(i) {
|
|
317
328
|
return this[m.p(i)]();
|
|
318
|
-
}, s.add = function(i,
|
|
329
|
+
}, s.add = function(i, a) {
|
|
319
330
|
var o, c = this;
|
|
320
331
|
i = Number(i);
|
|
321
|
-
var
|
|
332
|
+
var l = m.p(a), $ = function(S) {
|
|
322
333
|
var L = p(c);
|
|
323
334
|
return m.w(L.date(L.date() + Math.round(S * i)), c);
|
|
324
335
|
};
|
|
325
|
-
if (
|
|
336
|
+
if (l === x)
|
|
326
337
|
return this.set(x, this.$M + i);
|
|
327
|
-
if (
|
|
338
|
+
if (l === C)
|
|
328
339
|
return this.set(C, this.$y + i);
|
|
329
|
-
if (
|
|
340
|
+
if (l === M)
|
|
330
341
|
return $(1);
|
|
331
|
-
if (
|
|
342
|
+
if (l === q)
|
|
332
343
|
return $(7);
|
|
333
|
-
var
|
|
334
|
-
return m.w(
|
|
335
|
-
}, s.subtract = function(i,
|
|
336
|
-
return this.add(-1 * i,
|
|
344
|
+
var v = (o = {}, o[y] = r, o[_] = d, o[Y] = n, o)[l] || 1, b = this.$d.getTime() + i * v;
|
|
345
|
+
return m.w(b, this);
|
|
346
|
+
}, s.subtract = function(i, a) {
|
|
347
|
+
return this.add(-1 * i, a);
|
|
337
348
|
}, s.format = function(i) {
|
|
338
|
-
var
|
|
349
|
+
var a = this, o = this.$locale();
|
|
339
350
|
if (!this.isValid())
|
|
340
|
-
return o.invalidDate ||
|
|
341
|
-
var c = i || "YYYY-MM-DDTHH:mm:ssZ",
|
|
342
|
-
return O && (O[F] || O(
|
|
351
|
+
return o.invalidDate || h;
|
|
352
|
+
var c = i || "YYYY-MM-DDTHH:mm:ssZ", l = m.z(this), $ = this.$H, v = this.$m, b = this.$M, S = o.weekdays, L = o.months, G = o.meridiem, z = function(O, F, B, K) {
|
|
353
|
+
return O && (O[F] || O(a, c)) || B[F].slice(0, K);
|
|
343
354
|
}, X = function(O) {
|
|
344
355
|
return m.s($ % 12 || 12, O, "0");
|
|
345
356
|
}, U = G || function(O, F, B) {
|
|
@@ -350,29 +361,29 @@ var D0 = { exports: {} };
|
|
|
350
361
|
return F || function(B) {
|
|
351
362
|
switch (B) {
|
|
352
363
|
case "YY":
|
|
353
|
-
return String(
|
|
364
|
+
return String(a.$y).slice(-2);
|
|
354
365
|
case "YYYY":
|
|
355
|
-
return m.s(
|
|
366
|
+
return m.s(a.$y, 4, "0");
|
|
356
367
|
case "M":
|
|
357
|
-
return
|
|
368
|
+
return b + 1;
|
|
358
369
|
case "MM":
|
|
359
|
-
return m.s(
|
|
370
|
+
return m.s(b + 1, 2, "0");
|
|
360
371
|
case "MMM":
|
|
361
|
-
return z(o.monthsShort,
|
|
372
|
+
return z(o.monthsShort, b, L, 3);
|
|
362
373
|
case "MMMM":
|
|
363
|
-
return z(L,
|
|
374
|
+
return z(L, b);
|
|
364
375
|
case "D":
|
|
365
|
-
return
|
|
376
|
+
return a.$D;
|
|
366
377
|
case "DD":
|
|
367
|
-
return m.s(
|
|
378
|
+
return m.s(a.$D, 2, "0");
|
|
368
379
|
case "d":
|
|
369
|
-
return String(
|
|
380
|
+
return String(a.$W);
|
|
370
381
|
case "dd":
|
|
371
|
-
return z(o.weekdaysMin,
|
|
382
|
+
return z(o.weekdaysMin, a.$W, S, 2);
|
|
372
383
|
case "ddd":
|
|
373
|
-
return z(o.weekdaysShort,
|
|
384
|
+
return z(o.weekdaysShort, a.$W, S, 3);
|
|
374
385
|
case "dddd":
|
|
375
|
-
return S[
|
|
386
|
+
return S[a.$W];
|
|
376
387
|
case "H":
|
|
377
388
|
return String($);
|
|
378
389
|
case "HH":
|
|
@@ -382,30 +393,30 @@ var D0 = { exports: {} };
|
|
|
382
393
|
case "hh":
|
|
383
394
|
return X(2);
|
|
384
395
|
case "a":
|
|
385
|
-
return U($,
|
|
396
|
+
return U($, v, !0);
|
|
386
397
|
case "A":
|
|
387
|
-
return U($,
|
|
398
|
+
return U($, v, !1);
|
|
388
399
|
case "m":
|
|
389
|
-
return String(
|
|
400
|
+
return String(v);
|
|
390
401
|
case "mm":
|
|
391
|
-
return m.s(
|
|
402
|
+
return m.s(v, 2, "0");
|
|
392
403
|
case "s":
|
|
393
|
-
return String(
|
|
404
|
+
return String(a.$s);
|
|
394
405
|
case "ss":
|
|
395
|
-
return m.s(
|
|
406
|
+
return m.s(a.$s, 2, "0");
|
|
396
407
|
case "SSS":
|
|
397
|
-
return m.s(
|
|
408
|
+
return m.s(a.$ms, 3, "0");
|
|
398
409
|
case "Z":
|
|
399
|
-
return
|
|
410
|
+
return l;
|
|
400
411
|
}
|
|
401
412
|
return null;
|
|
402
|
-
}(O) ||
|
|
413
|
+
}(O) || l.replace(":", "");
|
|
403
414
|
});
|
|
404
415
|
}, s.utcOffset = function() {
|
|
405
416
|
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
406
|
-
}, s.diff = function(i,
|
|
407
|
-
var c,
|
|
408
|
-
return m.m(
|
|
417
|
+
}, s.diff = function(i, a, o) {
|
|
418
|
+
var c, l = this, $ = m.p(a), v = p(i), b = (v.utcOffset() - this.utcOffset()) * r, S = this - v, L = function() {
|
|
419
|
+
return m.m(l, v);
|
|
409
420
|
};
|
|
410
421
|
switch ($) {
|
|
411
422
|
case C:
|
|
@@ -418,10 +429,10 @@ var D0 = { exports: {} };
|
|
|
418
429
|
c = L() / 3;
|
|
419
430
|
break;
|
|
420
431
|
case q:
|
|
421
|
-
c = (S -
|
|
432
|
+
c = (S - b) / 6048e5;
|
|
422
433
|
break;
|
|
423
434
|
case M:
|
|
424
|
-
c = (S -
|
|
435
|
+
c = (S - b) / 864e5;
|
|
425
436
|
break;
|
|
426
437
|
case _:
|
|
427
438
|
c = S / d;
|
|
@@ -440,10 +451,10 @@ var D0 = { exports: {} };
|
|
|
440
451
|
return this.endOf(x).$D;
|
|
441
452
|
}, s.$locale = function() {
|
|
442
453
|
return E[this.$L];
|
|
443
|
-
}, s.locale = function(i,
|
|
454
|
+
}, s.locale = function(i, a) {
|
|
444
455
|
if (!i)
|
|
445
456
|
return this.$L;
|
|
446
|
-
var o = this.clone(), c = N(i,
|
|
457
|
+
var o = this.clone(), c = N(i, a, !0);
|
|
447
458
|
return c && (o.$L = c), o;
|
|
448
459
|
}, s.clone = function() {
|
|
449
460
|
return m.w(this.$d, this);
|
|
@@ -455,90 +466,90 @@ var D0 = { exports: {} };
|
|
|
455
466
|
return this.$d.toISOString();
|
|
456
467
|
}, s.toString = function() {
|
|
457
468
|
return this.$d.toUTCString();
|
|
458
|
-
},
|
|
469
|
+
}, u;
|
|
459
470
|
}(), P = A.prototype;
|
|
460
|
-
return p.prototype = P, [["$ms", f], ["$s", Y], ["$m", y], ["$H", _], ["$W", M], ["$M", x], ["$y", C], ["$D", J]].forEach(function(
|
|
461
|
-
P[
|
|
462
|
-
return this.$g(s,
|
|
471
|
+
return p.prototype = P, [["$ms", f], ["$s", Y], ["$m", y], ["$H", _], ["$W", M], ["$M", x], ["$y", C], ["$D", J]].forEach(function(u) {
|
|
472
|
+
P[u[1]] = function(s) {
|
|
473
|
+
return this.$g(s, u[0], u[1]);
|
|
463
474
|
};
|
|
464
|
-
}), p.extend = function(
|
|
465
|
-
return
|
|
466
|
-
}, p.locale = N, p.isDayjs = T, p.unix = function(
|
|
467
|
-
return p(1e3 *
|
|
475
|
+
}), p.extend = function(u, s) {
|
|
476
|
+
return u.$i || (u(s, A, p), u.$i = !0), p;
|
|
477
|
+
}, p.locale = N, p.isDayjs = T, p.unix = function(u) {
|
|
478
|
+
return p(1e3 * u);
|
|
468
479
|
}, p.en = E[Z], p.Ls = E, p.p = {}, p;
|
|
469
480
|
});
|
|
470
481
|
})(D0);
|
|
471
|
-
var
|
|
472
|
-
const R = /* @__PURE__ */ y0(
|
|
482
|
+
var F0 = D0.exports;
|
|
483
|
+
const R = /* @__PURE__ */ y0(F0);
|
|
473
484
|
var w0 = { exports: {} };
|
|
474
485
|
(function(t, e) {
|
|
475
486
|
(function(n, r) {
|
|
476
487
|
t.exports = r();
|
|
477
488
|
})(M0, function() {
|
|
478
|
-
var n = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, r = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, d = /\d\d/, f = /\d\d?/, Y = /\d*[^-_:/,()\s\d]+/, y = {}, _ = function(
|
|
479
|
-
return (
|
|
480
|
-
}, M = function(
|
|
489
|
+
var n = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, r = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, d = /\d\d/, f = /\d\d?/, Y = /\d*[^-_:/,()\s\d]+/, y = {}, _ = function(h) {
|
|
490
|
+
return (h = +h) + (h > 68 ? 1900 : 2e3);
|
|
491
|
+
}, M = function(h) {
|
|
481
492
|
return function(g) {
|
|
482
|
-
this[
|
|
493
|
+
this[h] = +g;
|
|
483
494
|
};
|
|
484
|
-
}, q = [/[+-]\d\d:?(\d\d)?|Z/, function(
|
|
495
|
+
}, q = [/[+-]\d\d:?(\d\d)?|Z/, function(h) {
|
|
485
496
|
(this.zone || (this.zone = {})).offset = function(g) {
|
|
486
497
|
if (!g || g === "Z")
|
|
487
498
|
return 0;
|
|
488
499
|
var D = g.match(/([+-]|\d\d)/g), w = 60 * D[1] + (+D[2] || 0);
|
|
489
500
|
return w === 0 ? 0 : D[0] === "+" ? -w : w;
|
|
490
|
-
}(
|
|
491
|
-
}], x = function(
|
|
492
|
-
var g = y[
|
|
501
|
+
}(h);
|
|
502
|
+
}], x = function(h) {
|
|
503
|
+
var g = y[h];
|
|
493
504
|
return g && (g.indexOf ? g : g.s.concat(g.f));
|
|
494
|
-
}, Q = function(
|
|
505
|
+
}, Q = function(h, g) {
|
|
495
506
|
var D, w = y.meridiem;
|
|
496
507
|
if (w) {
|
|
497
508
|
for (var j = 1; j <= 24; j += 1)
|
|
498
|
-
if (
|
|
509
|
+
if (h.indexOf(w(j, 0, g)) > -1) {
|
|
499
510
|
D = j > 12;
|
|
500
511
|
break;
|
|
501
512
|
}
|
|
502
513
|
} else
|
|
503
|
-
D =
|
|
514
|
+
D = h === (g ? "pm" : "PM");
|
|
504
515
|
return D;
|
|
505
|
-
}, C = { A: [Y, function(
|
|
506
|
-
this.afternoon = Q(
|
|
507
|
-
}], a: [Y, function(
|
|
508
|
-
this.afternoon = Q(
|
|
509
|
-
}], S: [/\d/, function(
|
|
510
|
-
this.milliseconds = 100 * +
|
|
511
|
-
}], SS: [d, function(
|
|
512
|
-
this.milliseconds = 10 * +
|
|
513
|
-
}], SSS: [/\d{3}/, function(
|
|
514
|
-
this.milliseconds = +
|
|
515
|
-
}], s: [f, M("seconds")], ss: [f, M("seconds")], m: [f, M("minutes")], mm: [f, M("minutes")], H: [f, M("hours")], h: [f, M("hours")], HH: [f, M("hours")], hh: [f, M("hours")], D: [f, M("day")], DD: [d, M("day")], Do: [Y, function(
|
|
516
|
-
var g = y.ordinal, D =
|
|
516
|
+
}, C = { A: [Y, function(h) {
|
|
517
|
+
this.afternoon = Q(h, !1);
|
|
518
|
+
}], a: [Y, function(h) {
|
|
519
|
+
this.afternoon = Q(h, !0);
|
|
520
|
+
}], S: [/\d/, function(h) {
|
|
521
|
+
this.milliseconds = 100 * +h;
|
|
522
|
+
}], SS: [d, function(h) {
|
|
523
|
+
this.milliseconds = 10 * +h;
|
|
524
|
+
}], SSS: [/\d{3}/, function(h) {
|
|
525
|
+
this.milliseconds = +h;
|
|
526
|
+
}], s: [f, M("seconds")], ss: [f, M("seconds")], m: [f, M("minutes")], mm: [f, M("minutes")], H: [f, M("hours")], h: [f, M("hours")], HH: [f, M("hours")], hh: [f, M("hours")], D: [f, M("day")], DD: [d, M("day")], Do: [Y, function(h) {
|
|
527
|
+
var g = y.ordinal, D = h.match(/\d+/);
|
|
517
528
|
if (this.day = D[0], g)
|
|
518
529
|
for (var w = 1; w <= 31; w += 1)
|
|
519
|
-
g(w).replace(/\[|\]/g, "") ===
|
|
520
|
-
}], M: [f, M("month")], MM: [d, M("month")], MMM: [Y, function(
|
|
530
|
+
g(w).replace(/\[|\]/g, "") === h && (this.day = w);
|
|
531
|
+
}], M: [f, M("month")], MM: [d, M("month")], MMM: [Y, function(h) {
|
|
521
532
|
var g = x("months"), D = (x("monthsShort") || g.map(function(w) {
|
|
522
533
|
return w.slice(0, 3);
|
|
523
|
-
})).indexOf(
|
|
534
|
+
})).indexOf(h) + 1;
|
|
524
535
|
if (D < 1)
|
|
525
536
|
throw new Error();
|
|
526
537
|
this.month = D % 12 || D;
|
|
527
|
-
}], MMMM: [Y, function(
|
|
528
|
-
var g = x("months").indexOf(
|
|
538
|
+
}], MMMM: [Y, function(h) {
|
|
539
|
+
var g = x("months").indexOf(h) + 1;
|
|
529
540
|
if (g < 1)
|
|
530
541
|
throw new Error();
|
|
531
542
|
this.month = g % 12 || g;
|
|
532
|
-
}], Y: [/[+-]?\d+/, M("year")], YY: [d, function(
|
|
533
|
-
this.year = _(
|
|
543
|
+
}], Y: [/[+-]?\d+/, M("year")], YY: [d, function(h) {
|
|
544
|
+
this.year = _(h);
|
|
534
545
|
}], YYYY: [/\d{4}/, M("year")], Z: q, ZZ: q };
|
|
535
|
-
function J(
|
|
546
|
+
function J(h) {
|
|
536
547
|
var g, D;
|
|
537
|
-
g =
|
|
538
|
-
for (var w = (
|
|
548
|
+
g = h, D = y && y.formats;
|
|
549
|
+
for (var w = (h = g.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(N, p, m) {
|
|
539
550
|
var A = m && m.toUpperCase();
|
|
540
|
-
return p || D[m] || n[m] || D[A].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(P,
|
|
541
|
-
return
|
|
551
|
+
return p || D[m] || n[m] || D[A].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(P, u, s) {
|
|
552
|
+
return u || s.slice(1);
|
|
542
553
|
});
|
|
543
554
|
})).match(r), j = w.length, I = 0; I < j; I += 1) {
|
|
544
555
|
var Z = w[I], E = C[Z], H = E && E[0], T = E && E[1];
|
|
@@ -550,21 +561,21 @@ var w0 = { exports: {} };
|
|
|
550
561
|
if (typeof P == "string")
|
|
551
562
|
A += P.length;
|
|
552
563
|
else {
|
|
553
|
-
var
|
|
554
|
-
s.call(p,
|
|
564
|
+
var u = P.regex, s = P.parser, i = N.slice(A), a = u.exec(i)[0];
|
|
565
|
+
s.call(p, a), N = N.replace(a, "");
|
|
555
566
|
}
|
|
556
567
|
}
|
|
557
568
|
return function(o) {
|
|
558
569
|
var c = o.afternoon;
|
|
559
570
|
if (c !== void 0) {
|
|
560
|
-
var
|
|
561
|
-
c ?
|
|
571
|
+
var l = o.hours;
|
|
572
|
+
c ? l < 12 && (o.hours += 12) : l === 12 && (o.hours = 0), delete o.afternoon;
|
|
562
573
|
}
|
|
563
574
|
}(p), p;
|
|
564
575
|
};
|
|
565
576
|
}
|
|
566
|
-
return function(
|
|
567
|
-
D.p.customParseFormat = !0,
|
|
577
|
+
return function(h, g, D) {
|
|
578
|
+
D.p.customParseFormat = !0, h && h.parseTwoDigitYear && (_ = h.parseTwoDigitYear);
|
|
568
579
|
var w = g.prototype, j = w.parse;
|
|
569
580
|
w.parse = function(I) {
|
|
570
581
|
var Z = I.date, E = I.utc, H = I.args;
|
|
@@ -572,27 +583,27 @@ var w0 = { exports: {} };
|
|
|
572
583
|
var T = H[1];
|
|
573
584
|
if (typeof T == "string") {
|
|
574
585
|
var N = H[2] === !0, p = H[3] === !0, m = N || p, A = H[2];
|
|
575
|
-
p && (A = H[2]), y = this.$locale(), !N && A && (y = D.Ls[A]), this.$d = function(i,
|
|
586
|
+
p && (A = H[2]), y = this.$locale(), !N && A && (y = D.Ls[A]), this.$d = function(i, a, o) {
|
|
576
587
|
try {
|
|
577
|
-
if (["x", "X"].indexOf(
|
|
578
|
-
return new Date((
|
|
579
|
-
var c = J(
|
|
580
|
-
|
|
581
|
-
var B =
|
|
582
|
-
return z ? new Date(Date.UTC(O, F, U, B, K,
|
|
588
|
+
if (["x", "X"].indexOf(a) > -1)
|
|
589
|
+
return new Date((a === "X" ? 1e3 : 1) * i);
|
|
590
|
+
var c = J(a)(i), l = c.year, $ = c.month, v = c.day, b = c.hours, S = c.minutes, L = c.seconds, G = c.milliseconds, z = c.zone, X = /* @__PURE__ */ new Date(), U = v || (l || $ ? 1 : X.getDate()), O = l || X.getFullYear(), F = 0;
|
|
591
|
+
l && !$ || (F = $ > 0 ? $ - 1 : X.getMonth());
|
|
592
|
+
var B = b || 0, K = S || 0, u0 = L || 0, c0 = G || 0;
|
|
593
|
+
return z ? new Date(Date.UTC(O, F, U, B, K, u0, c0 + 60 * z.offset * 1e3)) : o ? new Date(Date.UTC(O, F, U, B, K, u0, c0)) : new Date(O, F, U, B, K, u0, c0);
|
|
583
594
|
} catch {
|
|
584
595
|
return /* @__PURE__ */ new Date("");
|
|
585
596
|
}
|
|
586
597
|
}(Z, T, E), this.init(), A && A !== !0 && (this.$L = this.locale(A).$L), m && Z != this.format(T) && (this.$d = /* @__PURE__ */ new Date("")), y = {};
|
|
587
598
|
} else if (T instanceof Array)
|
|
588
|
-
for (var P = T.length,
|
|
589
|
-
H[1] = T[
|
|
599
|
+
for (var P = T.length, u = 1; u <= P; u += 1) {
|
|
600
|
+
H[1] = T[u - 1];
|
|
590
601
|
var s = D.apply(this, H);
|
|
591
602
|
if (s.isValid()) {
|
|
592
603
|
this.$d = s.$d, this.$L = s.$L, this.init();
|
|
593
604
|
break;
|
|
594
605
|
}
|
|
595
|
-
|
|
606
|
+
u === P && (this.$d = /* @__PURE__ */ new Date(""));
|
|
596
607
|
}
|
|
597
608
|
else
|
|
598
609
|
j.call(this, I);
|
|
@@ -600,15 +611,15 @@ var w0 = { exports: {} };
|
|
|
600
611
|
};
|
|
601
612
|
});
|
|
602
613
|
})(w0);
|
|
603
|
-
var
|
|
604
|
-
const
|
|
614
|
+
var H0 = w0.exports;
|
|
615
|
+
const v0 = /* @__PURE__ */ y0(H0);
|
|
605
616
|
function t0(t = {}) {
|
|
606
617
|
s0(t) && (t = { max: t });
|
|
607
618
|
const { min: e = 0, max: n = Number.MAX_SAFE_INTEGER } = t, r = Math.ceil(e), d = Math.floor(n);
|
|
608
619
|
return r === d ? r : (d < r && (n >= e && V("generateRandomInteger", `未找到 ${e} 和 ${n} 之间的整数值`), V("generateRandomInteger", `最大值 ${n} 应大于最小值 ${e}`)), Math.floor(Math.random() * (d - r + 1) + r));
|
|
609
620
|
}
|
|
610
|
-
R.extend(
|
|
611
|
-
function
|
|
621
|
+
R.extend(v0);
|
|
622
|
+
function b0(t = {}) {
|
|
612
623
|
const e = {
|
|
613
624
|
start: "1800-01-01 00:00:00",
|
|
614
625
|
end: R().format("YYYY-MM-DD HH:mm:ss"),
|
|
@@ -616,9 +627,9 @@ function v0(t = {}) {
|
|
|
616
627
|
}, { start: n, end: r, format: d } = k(e, t);
|
|
617
628
|
(!R(n).isValid() || !R(r).isValid()) && V("generateRandomDate", "start end 参数必须是合法的时间格式");
|
|
618
629
|
const f = R(n).year(), Y = R(r).year(), y = t0({ min: f, max: Y }), _ = t0({ min: 1, max: 12 }), M = t0({ min: 1, max: 31 }), q = t0(23), x = t0(59), Q = t0(59), C = R(`${y}-${_}-${M} ${q}:${x}:${Q}`);
|
|
619
|
-
return C.isBefore(R(n)) || C.isAfter(R(r)) ? (console.log("不合法时间", R(C).format("YYYY-MM-DD HH:mm:ss")),
|
|
630
|
+
return C.isBefore(R(n)) || C.isAfter(R(r)) ? (console.log("不合法时间", R(C).format("YYYY-MM-DD HH:mm:ss")), b0(t)) : C.format(d);
|
|
620
631
|
}
|
|
621
|
-
function
|
|
632
|
+
function N0(t, e = {}) {
|
|
622
633
|
const { lowerCase: n, upperCase: r, number: d } = k({ lowerCase: !0, upperCase: !0, number: !0 }, e);
|
|
623
634
|
n || r || d || V("generateRandomString", "lowerCase upperCase number 至少需要一个参数为true");
|
|
624
635
|
let f = "";
|
|
@@ -630,14 +641,14 @@ function F0(t, e = {}) {
|
|
|
630
641
|
}
|
|
631
642
|
return Y;
|
|
632
643
|
}
|
|
633
|
-
function
|
|
644
|
+
function a0(t) {
|
|
634
645
|
return t[Math.floor(Math.random() * t.length)];
|
|
635
646
|
}
|
|
636
|
-
function
|
|
647
|
+
function $2() {
|
|
637
648
|
const t = ["gmail.com", "yahoo.com", "outlook.com", "example.com", "qq.com", "163.com"];
|
|
638
|
-
return `${
|
|
649
|
+
return `${N0(10)}@${a0(t)}`;
|
|
639
650
|
}
|
|
640
|
-
function
|
|
651
|
+
function g2(t = {}) {
|
|
641
652
|
s0(t) && (t = { max: t });
|
|
642
653
|
const { min: e = 0, max: n = 1, fractionDigits: r = 2 } = t;
|
|
643
654
|
if (e === n)
|
|
@@ -646,11 +657,11 @@ function m2(t = {}) {
|
|
|
646
657
|
throw new Error(`最大值 ${n} 应大于最小值 ${e}`);
|
|
647
658
|
return Math.random() * (n - e) + e;
|
|
648
659
|
}
|
|
649
|
-
function
|
|
660
|
+
function l0(t, e) {
|
|
650
661
|
(!s0(t) || t <= 0) && V("generateRandomStringFromSource", "num 必须大于0"), (!n0(e) || e.length === 0) && V("generateRandomStringFromSource", "source 不能为空数组");
|
|
651
662
|
let n = "";
|
|
652
663
|
for (let r = 0; r < t; r++)
|
|
653
|
-
n +=
|
|
664
|
+
n += a0(e);
|
|
654
665
|
return n;
|
|
655
666
|
}
|
|
656
667
|
const Y0 = {
|
|
@@ -3826,172 +3837,174 @@ const Y0 = {
|
|
|
3826
3837
|
香港特别行政区: "810000",
|
|
3827
3838
|
澳门特别行政区: "820000"
|
|
3828
3839
|
};
|
|
3829
|
-
function
|
|
3830
|
-
const t =
|
|
3840
|
+
function p2() {
|
|
3841
|
+
const t = a0(Object.values(Y0)), e = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
|
|
3831
3842
|
return [
|
|
3832
3843
|
t,
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3844
|
+
b0({ format: "YYYYMMDD" }),
|
|
3845
|
+
l0(3, e),
|
|
3846
|
+
l0(1, [...e, "X", "x"])
|
|
3836
3847
|
].join("");
|
|
3837
3848
|
}
|
|
3838
|
-
function
|
|
3839
|
-
return
|
|
3849
|
+
function M2() {
|
|
3850
|
+
return a0(["13", "14", "15", "16", "17", "18", "19"]) + t0(999999999).toString().padEnd(9, "0");
|
|
3840
3851
|
}
|
|
3841
|
-
function
|
|
3852
|
+
function y2(t) {
|
|
3842
3853
|
return /^\d+$/.test(t);
|
|
3843
3854
|
}
|
|
3844
|
-
function
|
|
3855
|
+
function D2(t) {
|
|
3845
3856
|
return /^[\u4E00-\u9FA5]+$/.test(t);
|
|
3846
3857
|
}
|
|
3847
|
-
function
|
|
3858
|
+
function w2(t) {
|
|
3848
3859
|
return /^[A-Za-z]+$/.test(t);
|
|
3849
3860
|
}
|
|
3850
|
-
function
|
|
3861
|
+
function v2(t) {
|
|
3851
3862
|
return /^[A-Z]+$/.test(t);
|
|
3852
3863
|
}
|
|
3853
|
-
function
|
|
3864
|
+
function b2(t) {
|
|
3854
3865
|
return /^[\dA-Z]+$/.test(t);
|
|
3855
3866
|
}
|
|
3856
|
-
function
|
|
3867
|
+
function Y2(t) {
|
|
3857
3868
|
return /^[\dA-Z\u4E00-\u9FA5]+$/.test(t);
|
|
3858
3869
|
}
|
|
3859
|
-
function
|
|
3870
|
+
function S2(t) {
|
|
3860
3871
|
return /^[a-z]+$/.test(t);
|
|
3861
3872
|
}
|
|
3862
|
-
function
|
|
3873
|
+
function O2(t) {
|
|
3863
3874
|
return /^[\da-z]+$/.test(t);
|
|
3864
3875
|
}
|
|
3865
|
-
function
|
|
3876
|
+
function x2(t) {
|
|
3866
3877
|
return /^[\da-z\u4E00-\u9FA5]+$/.test(t);
|
|
3867
3878
|
}
|
|
3868
|
-
function
|
|
3879
|
+
function A2(t, e = {}) {
|
|
3869
3880
|
const { integer: n } = k({ integer: !0 }, e);
|
|
3870
3881
|
return n ? /^-?(0|[1-9]\d*)(\.\d+)?$/.test(t) : /^-?(0|[1-9]\d*)\.\d+$/.test(t);
|
|
3871
3882
|
}
|
|
3872
|
-
function
|
|
3883
|
+
function C2(t, e = {}) {
|
|
3873
3884
|
const { integer: n } = k({ integer: !0 }, e);
|
|
3874
3885
|
return n ? /^[1-9]\d*\.?\d*|^0\.\d*[1-9]\d*$/.test(t) : /^[1-9]\d*\.\d*|^0\.\d*[1-9]\d*$/.test(t);
|
|
3875
3886
|
}
|
|
3876
|
-
function
|
|
3887
|
+
function E2(t, e = {}) {
|
|
3877
3888
|
const { integer: n } = k({ integer: !0 }, e);
|
|
3878
3889
|
return n ? /^-[1-9]\d*\.?\d*|^-0\.\d*[1-9]\d*$/.test(t) : /^-[1-9]\d*\.\d*|^-0\.\d*[1-9]\d*$/.test(t);
|
|
3879
3890
|
}
|
|
3880
|
-
function
|
|
3891
|
+
function L2(t, e = {}) {
|
|
3881
3892
|
const { integer: n } = k({ integer: !0 }, e);
|
|
3882
3893
|
return n ? /^(0|[1-9]\d*)(\.\d+)?$/.test(t) : /^(0|[1-9]\d*)\.\d+$/.test(t);
|
|
3883
3894
|
}
|
|
3884
|
-
function
|
|
3895
|
+
function _2(t, e = {}) {
|
|
3885
3896
|
const { integer: n } = k({ integer: !0 }, e);
|
|
3886
3897
|
return n ? /^(-?0(\.0+)?|-(0|[1-9]\d*)(\.\d+)?)$/.test(t) : /^(-?0\.0+|-(0|[1-9]\d*)\.\d+)$/.test(t);
|
|
3887
3898
|
}
|
|
3888
|
-
function
|
|
3899
|
+
function j2(t) {
|
|
3889
3900
|
return /^-?(0|[1-9]\d*)$/.test(t);
|
|
3890
3901
|
}
|
|
3891
|
-
function
|
|
3902
|
+
function T2(t) {
|
|
3892
3903
|
return /^[1-9]\d*$/.test(t);
|
|
3893
3904
|
}
|
|
3894
|
-
function
|
|
3905
|
+
function F2(t) {
|
|
3895
3906
|
return /^(0|[1-9]\d*)$/.test(t);
|
|
3896
3907
|
}
|
|
3897
|
-
function
|
|
3908
|
+
function H2(t) {
|
|
3898
3909
|
return /^-([1-9]\d*)$/.test(t);
|
|
3899
3910
|
}
|
|
3900
|
-
function
|
|
3911
|
+
function N2(t) {
|
|
3901
3912
|
return /^(0|-(0|[1-9]\d*))$/.test(t);
|
|
3902
3913
|
}
|
|
3903
|
-
function
|
|
3914
|
+
function R2(t) {
|
|
3904
3915
|
return /^1[3-9]\d{9}$/.test(t);
|
|
3905
3916
|
}
|
|
3906
|
-
function
|
|
3917
|
+
function I2(t) {
|
|
3907
3918
|
return /^([\w-])+@([\w-])+(\.[\w-])+/.test(t);
|
|
3908
3919
|
}
|
|
3909
|
-
function
|
|
3920
|
+
function Z2(t) {
|
|
3910
3921
|
return t === "";
|
|
3911
3922
|
}
|
|
3912
|
-
function
|
|
3913
|
-
return R.extend(
|
|
3923
|
+
function R0(t, e = "YYYY-MM-DD HH:mm:ss") {
|
|
3924
|
+
return R.extend(v0), R(t, e, !0).isValid();
|
|
3914
3925
|
}
|
|
3915
|
-
function
|
|
3926
|
+
function P2(t) {
|
|
3916
3927
|
let e = /^[1-9]\d{5}(18|19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3}[\dXx]$/.test(t);
|
|
3917
|
-
return !e || (e = Object.values(Y0).includes(t.slice(0, 6)), !e) || (e =
|
|
3928
|
+
return !e || (e = Object.values(Y0).includes(t.slice(0, 6)), !e) || (e = R0(t.slice(6, 14), "YYYYMMDD"), !e), e;
|
|
3918
3929
|
}
|
|
3919
3930
|
export {
|
|
3920
3931
|
g0 as castArray,
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3932
|
+
f2 as compareProperties,
|
|
3933
|
+
Z0 as compose,
|
|
3934
|
+
P0 as composeRight,
|
|
3935
|
+
U0 as debounce,
|
|
3936
|
+
C0 as debugWarn,
|
|
3937
|
+
h0 as deepClone,
|
|
3927
3938
|
k as deepMerge,
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
h2 as
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3939
|
+
E0 as deprecated,
|
|
3940
|
+
V0 as error,
|
|
3941
|
+
d2 as excludeProperties,
|
|
3942
|
+
l2 as extractProperties,
|
|
3943
|
+
h2 as generateRandomArray,
|
|
3944
|
+
m2 as generateRandomColor,
|
|
3945
|
+
b0 as generateRandomDate,
|
|
3946
|
+
$2 as generateRandomEmail,
|
|
3947
|
+
g2 as generateRandomFloat,
|
|
3948
|
+
p2 as generateRandomIdCard,
|
|
3937
3949
|
t0 as generateRandomInteger,
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3950
|
+
M2 as generateRandomMobilePhone,
|
|
3951
|
+
N0 as generateRandomString,
|
|
3952
|
+
l0 as generateRandomStringFromSource,
|
|
3953
|
+
a0 as getRandomItem,
|
|
3954
|
+
e2 as hasChanged,
|
|
3943
3955
|
d0 as hasOwn,
|
|
3944
|
-
|
|
3956
|
+
k0 as initLog,
|
|
3945
3957
|
n0 as isArray,
|
|
3946
|
-
|
|
3947
|
-
|
|
3958
|
+
t2 as isBoolean,
|
|
3959
|
+
D2 as isChinese,
|
|
3948
3960
|
O0 as isDate,
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3961
|
+
R0 as isDateString,
|
|
3962
|
+
Q0 as isDef,
|
|
3963
|
+
I2 as isEmail,
|
|
3964
|
+
Z2 as isEmptyString,
|
|
3965
|
+
w2 as isEnglishAphabet,
|
|
3966
|
+
A2 as isFloat,
|
|
3955
3967
|
i0 as isFunction,
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
+
P2 as isIdCard,
|
|
3969
|
+
j2 as isInteger,
|
|
3970
|
+
S2 as isLowerCase,
|
|
3971
|
+
O2 as isLowerCaseAndNumber,
|
|
3972
|
+
x2 as isLowerCaseAndNumberAndChinese,
|
|
3973
|
+
q0 as isMap,
|
|
3974
|
+
R2 as isMobilePhone,
|
|
3975
|
+
E2 as isNegativeFloat,
|
|
3976
|
+
_2 as isNegativeFloatOrZero,
|
|
3977
|
+
H2 as isNegativeInteger,
|
|
3978
|
+
N2 as isNegativeIntegerOrZero,
|
|
3979
|
+
K0 as isNull,
|
|
3968
3980
|
s0 as isNumber,
|
|
3969
|
-
|
|
3981
|
+
y2 as isNumberOrNumberString,
|
|
3970
3982
|
W as isObject,
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3983
|
+
C2 as isPositiveFloat,
|
|
3984
|
+
L2 as isPositiveFloatOrZero,
|
|
3985
|
+
T2 as isPositiveInteger,
|
|
3986
|
+
F2 as isPositiveIntegerOrZero,
|
|
3987
|
+
J0 as isPromise,
|
|
3976
3988
|
x0 as isRegExp,
|
|
3977
|
-
|
|
3989
|
+
X0 as isSet,
|
|
3978
3990
|
A0 as isString,
|
|
3979
|
-
|
|
3991
|
+
B0 as isSymbol,
|
|
3980
3992
|
r0 as isUndef,
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3993
|
+
G0 as isUndefined,
|
|
3994
|
+
v2 as isUpperCase,
|
|
3995
|
+
b2 as isUpperCaseAndNumber,
|
|
3996
|
+
Y2 as isUpperCaseAndNumberAndChinese,
|
|
3997
|
+
z0 as log,
|
|
3986
3998
|
S0 as objectToString,
|
|
3987
|
-
|
|
3988
|
-
|
|
3999
|
+
n2 as qs,
|
|
4000
|
+
r2 as throttle,
|
|
3989
4001
|
V as throwError,
|
|
3990
4002
|
o0 as toTypeString,
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
4003
|
+
s2 as validatorChineseOrEnglish,
|
|
4004
|
+
o2 as validatorChineseOrEnglishOrNumber,
|
|
4005
|
+
c2 as validatorEmail,
|
|
4006
|
+
i2 as validatorLatitudeOrLongitude,
|
|
4007
|
+
a2 as validatorUppercaseOrNumbersOrSpecial,
|
|
3995
4008
|
u2 as validatorUppercaseOrNumbersOrUnderline,
|
|
3996
|
-
|
|
4009
|
+
W0 as warn
|
|
3997
4010
|
};
|