@kevisual/kit 0.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/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "@kevisual/kit",
3
+ "version": "0.0.1",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "files": [
10
+ "patch"
11
+ ],
12
+ "keywords": [],
13
+ "author": "abearxiong <xiongxiao@xiongxiao.me> (https://www.xiongxiao.me)",
14
+ "license": "MIT",
15
+ "packageManager": "pnpm@10.33.0",
16
+ "type": "module",
17
+ "publishConfig": {
18
+ "access": "public"
19
+ },
20
+ "exports": {
21
+ "./patch/*": "./patch/*"
22
+ },
23
+ "dependencies": {
24
+ "@astrojs/starlight": "^0.38.3",
25
+ "astro": "^6.1.5",
26
+ "nanoid": "^5.1.7"
27
+ }
28
+ }
@@ -0,0 +1,28 @@
1
+ // Inline implementation of nanoid/non-secure to avoid ESM import issues
2
+ // This is based on the nanoid v3 non-secure implementation
3
+
4
+ const urlAlphabet =
5
+ 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'
6
+
7
+ export const customAlphabet = (alphabet: string, defaultSize = 21) => {
8
+ return (size = defaultSize) => {
9
+ let id = ''
10
+ let i = size | 0
11
+ while (i--) {
12
+ id += alphabet[(Math.random() * alphabet.length) | 0]
13
+ }
14
+ return id
15
+ }
16
+ }
17
+
18
+ export const nanoid = (size = 21) => {
19
+ let id = ''
20
+ let i = size | 0
21
+ while (i--) {
22
+ id += urlAlphabet[(Math.random() * 64) | 0]
23
+ }
24
+ return id
25
+ }
26
+
27
+ // Default export for CommonJS interop
28
+ export default { nanoid, customAlphabet };