reykit 1.0.196 → 1.0.198
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.js +53 -15
- package/dist/src/index.d.ts +3 -2
- package/dist/src/lib/index.d.ts +2 -1
- package/dist/src/lib/rand.d.ts +14 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -50522,22 +50522,58 @@ async function Ok(a, i) {
|
|
|
50522
50522
|
const wk = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
50523
50523
|
__proto__: null,
|
|
50524
50524
|
request: Ok
|
|
50525
|
-
}, Symbol.toStringTag, { value: "Module" }))
|
|
50525
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
50526
|
+
function Nk(a = 32, i = "dlp") {
|
|
50527
|
+
let u;
|
|
50528
|
+
switch (i) {
|
|
50529
|
+
case "d":
|
|
50530
|
+
u = "0123456789";
|
|
50531
|
+
break;
|
|
50532
|
+
case "l":
|
|
50533
|
+
u = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
50534
|
+
break;
|
|
50535
|
+
case "p":
|
|
50536
|
+
u = `~!@#$%^&*()_+-={}[]|\\:;"'<>,.?/`;
|
|
50537
|
+
break;
|
|
50538
|
+
case "dl":
|
|
50539
|
+
u = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
50540
|
+
break;
|
|
50541
|
+
case "dp":
|
|
50542
|
+
u = `0123456789~!@#$%^&*()_+-={}[]|\\:;"'<>,.?/`;
|
|
50543
|
+
break;
|
|
50544
|
+
case "lp":
|
|
50545
|
+
u = `abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ~!@#$%^&*()_+-={}[]|\\:;"'<>,.?/`;
|
|
50546
|
+
break;
|
|
50547
|
+
case "dlp":
|
|
50548
|
+
u = `0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ~!@#$%^&*()_+-={}[]|\\:;"'<>,.?/`;
|
|
50549
|
+
break;
|
|
50550
|
+
}
|
|
50551
|
+
const d = [];
|
|
50552
|
+
for (let g = 0; g < a; g++) {
|
|
50553
|
+
const y = Math.floor(Math.random() * u.length);
|
|
50554
|
+
d.push(u[y]);
|
|
50555
|
+
}
|
|
50556
|
+
return d.join("");
|
|
50557
|
+
}
|
|
50558
|
+
const Mk = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
50559
|
+
__proto__: null,
|
|
50560
|
+
randChar: Nk
|
|
50561
|
+
}, Symbol.toStringTag, { value: "Module" })), Ak = /^((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/, Dk = /^https?:\/\/[^\s/$.?#].[^\s]*$/, zk = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/, _k = /^1[3-9]\d{9}$/, jk = /^[\u4e00-\u9fa5]+$/, Uk = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
50526
50562
|
__proto__: null,
|
|
50527
|
-
PATTERN_CN:
|
|
50528
|
-
PATTERN_EMAIL:
|
|
50529
|
-
PATTERN_IP:
|
|
50530
|
-
PATTERN_PHONE:
|
|
50531
|
-
PATTERN_URL:
|
|
50563
|
+
PATTERN_CN: jk,
|
|
50564
|
+
PATTERN_EMAIL: zk,
|
|
50565
|
+
PATTERN_IP: Ak,
|
|
50566
|
+
PATTERN_PHONE: _k,
|
|
50567
|
+
PATTERN_URL: Dk
|
|
50532
50568
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
50533
|
-
function
|
|
50569
|
+
function Vk() {
|
|
50534
50570
|
const a = /* @__PURE__ */ new Date();
|
|
50535
50571
|
return a.getFullYear() + "-" + String(a.getMonth() + 1).padStart(2, "0") + "-" + String(a.getDate()).padStart(2, "0") + "T" + String(a.getHours()).padStart(2, "0") + ":" + String(a.getMinutes()).padStart(2, "0");
|
|
50536
50572
|
}
|
|
50537
|
-
const
|
|
50573
|
+
const Hk = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
50538
50574
|
__proto__: null,
|
|
50539
|
-
datetimeLocal:
|
|
50540
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
50575
|
+
datetimeLocal: Vk
|
|
50576
|
+
}, Symbol.toStringTag, { value: "Module" })), eY = {
|
|
50541
50577
|
component: pk,
|
|
50542
50578
|
ui: Bj,
|
|
50543
50579
|
captcha: gk,
|
|
@@ -50545,9 +50581,10 @@ const Uk = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
50545
50581
|
data: ik,
|
|
50546
50582
|
image: Ck,
|
|
50547
50583
|
net: wk,
|
|
50548
|
-
|
|
50584
|
+
rand: Mk,
|
|
50585
|
+
re: Uk,
|
|
50549
50586
|
react: r6,
|
|
50550
|
-
time:
|
|
50587
|
+
time: Hk,
|
|
50551
50588
|
twc: H6,
|
|
50552
50589
|
window: Sk
|
|
50553
50590
|
};
|
|
@@ -50556,12 +50593,13 @@ export {
|
|
|
50556
50593
|
gk as captcha,
|
|
50557
50594
|
pk as component,
|
|
50558
50595
|
ik as data,
|
|
50559
|
-
|
|
50596
|
+
eY as default,
|
|
50560
50597
|
Ck as image,
|
|
50561
50598
|
wk as net,
|
|
50562
|
-
|
|
50599
|
+
Mk as rand,
|
|
50600
|
+
Uk as re,
|
|
50563
50601
|
r6 as react,
|
|
50564
|
-
|
|
50602
|
+
Hk as time,
|
|
50565
50603
|
H6 as twc,
|
|
50566
50604
|
Bj as ui,
|
|
50567
50605
|
Sk as window
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { captcha, base, data, image, net, re, react, time, twc, window } from './lib';
|
|
1
|
+
import { captcha, base, data, image, net, rand, re, react, time, twc, window } from './lib';
|
|
2
2
|
/**
|
|
3
3
|
* @Time : 2026-03-11
|
|
4
4
|
* @Author : Rey
|
|
@@ -15,6 +15,7 @@ declare const _default: {
|
|
|
15
15
|
data: typeof data;
|
|
16
16
|
image: typeof image;
|
|
17
17
|
net: typeof net;
|
|
18
|
+
rand: typeof rand;
|
|
18
19
|
re: typeof re;
|
|
19
20
|
react: typeof react;
|
|
20
21
|
time: typeof time;
|
|
@@ -22,4 +23,4 @@ declare const _default: {
|
|
|
22
23
|
window: typeof window;
|
|
23
24
|
};
|
|
24
25
|
export default _default;
|
|
25
|
-
export { component, ui, captcha, base, data, image, net, re, react, time, twc, window };
|
|
26
|
+
export { component, ui, captcha, base, data, image, net, rand, re, react, time, twc, window };
|
package/dist/src/lib/index.d.ts
CHANGED
|
@@ -3,9 +3,10 @@ import * as base from './base';
|
|
|
3
3
|
import * as data from './data';
|
|
4
4
|
import * as image from './image';
|
|
5
5
|
import * as net from './net';
|
|
6
|
+
import * as rand from './rand';
|
|
6
7
|
import * as re from './re';
|
|
7
8
|
import * as react from './react';
|
|
8
9
|
import * as time from './time';
|
|
9
10
|
import * as twc from './twc';
|
|
10
11
|
import * as window from './window';
|
|
11
|
-
export { captcha, base, data, image, net, re, react, time, twc, window };
|
|
12
|
+
export { captcha, base, data, image, net, rand, re, react, time, twc, window };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @Time : 2026-08-05
|
|
3
|
+
* @Author : Rey
|
|
4
|
+
* @Contact : reyxbo@163.com
|
|
5
|
+
* @Explain : Random methods.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Generate random characters.
|
|
9
|
+
*
|
|
10
|
+
* @param length - Character length.
|
|
11
|
+
* @param style - Character style.
|
|
12
|
+
* @returns Random characters.
|
|
13
|
+
*/
|
|
14
|
+
export declare function randChar(length?: number, style?: 'd' | 'l' | 'p' | 'dl' | 'dp' | 'lp' | 'dlp'): string;
|