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