@kevisual/api 0.0.50 → 0.0.51

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kevisual/api",
3
- "version": "0.0.50",
3
+ "version": "0.0.51",
4
4
  "description": "",
5
5
  "main": "mod.ts",
6
6
  "scripts": {
@@ -39,6 +39,7 @@
39
39
  "@kevisual/context": "^0.0.6",
40
40
  "@kevisual/js-filter": "^0.0.5",
41
41
  "@kevisual/load": "^0.0.6",
42
+ "@paralleldrive/cuid2": "^3.3.0",
42
43
  "es-toolkit": "^1.44.0",
43
44
  "eventemitter3": "^5.0.4",
44
45
  "fuse.js": "^7.1.0",
@@ -56,6 +57,7 @@
56
57
  "./proxy": "./query/query-proxy/index.ts",
57
58
  "./secret": "./query/query-secret/index.ts",
58
59
  "./resources": "./query/query-resources/index.ts",
60
+ "./utils-node": "./dist/utils-node.js",
59
61
  "./utils": "./dist/utils.js",
60
62
  "./query-secret": "./dist/query-secret.js",
61
63
  "./query-mark": "./dist/query-mark.js",
@@ -1,9 +1,12 @@
1
1
  import { customAlphabet } from 'nanoid';
2
+ import { createId } from '@paralleldrive/cuid2';
2
3
 
3
4
  export const letter = 'abcdefghijklmnopqrstuvwxyz';
4
5
  export const number = '0123456789';
5
6
  const alphanumeric = `${letter}${number}`;
6
7
  export const alphanumericWithDash = `${alphanumeric}-`;
8
+
9
+ export const cuid2 = createId;
7
10
  /**
8
11
  * 创建一个随机的字母字符串
9
12
  */
@@ -12,12 +15,12 @@ export const uuid = customAlphabet(letter);
12
15
  /**
13
16
  * 创建一个随机的 id,包含字母和数字
14
17
  */
15
- export const nanoid = customAlphabet(alphanumeric, 10);
18
+ export const nanoid = customAlphabet(alphanumeric, 16);
16
19
 
17
20
  /**
18
21
  * 创建一个随机的 id,包含字母、数字和短横线
19
22
  */
20
- export const nanoidWithDash = customAlphabet(alphanumericWithDash, 10);
23
+ export const nanoidWithDash = customAlphabet(alphanumericWithDash, 16);
21
24
 
22
25
  /**
23
26
  * 创建一个随机的 id,以字母开头的字符串