@jiaozi-dev/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/README.md ADDED
@@ -0,0 +1,49 @@
1
+ # @jiaozi-dev/kit
2
+
3
+ A modern, type-safe TypeScript utility kit.
4
+
5
+ ## Features
6
+
7
+ - 🌲 Zero dependencies & Tree-shakable
8
+ - πŸ›‘οΈ 100% Type-safe
9
+
10
+ ## Installation
11
+
12
+ ```bash
13
+ npm install @jiaozi-dev/kit
14
+ ```
15
+
16
+ ```bash
17
+ yarn add @jiaozi-dev/kit
18
+ ```
19
+
20
+ ```bash
21
+ pnpm add @jiaozi-dev/kit
22
+ ```
23
+
24
+ ## Enum
25
+
26
+ ```typescript
27
+ import { Enum } from "@jiaozi-dev/kit";
28
+
29
+ const STATUS = Enum({
30
+ Success: "success",
31
+ Warning: "warning",
32
+ Error: "error",
33
+ });
34
+ type STATUS = Enum<typeof STATUS>;
35
+
36
+ // inferred as
37
+ const STATUS: Readonly<{
38
+ readonly Success: "success";
39
+ readonly Warning: "warning";
40
+ readonly Error: "error";
41
+ }>;
42
+ type STATUS = "success" | "warning" | "error";
43
+ ```
44
+
45
+ ## ...
46
+
47
+ ## πŸ₯Ÿ Jiaozi
48
+
49
+ Jiaozi(ι₯Ίε­) is a beloved Chinese delicacy, where a simple dough wrapper securely encases rich and delicious fillings.πŸ˜‹
package/dist/index.cjs ADDED
@@ -0,0 +1,2 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});function e(e){return Object.freeze(e)}exports.Enum=e;
2
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../src/enum/Enum.ts"],"sourcesContent":["/**\r\n * @example\r\n * ```typescript\r\n const STATUS = Enum({\r\n Success: \"success\",\r\n Warning: \"warning\",\r\n Error: \"error\",\r\n });\r\n type STATUS = Enum<typeof STATUS>;\r\n ```\r\n */\r\nexport function Enum<const T extends object>(object: T): Readonly<T> {\r\n return Object.freeze(object);\r\n}\r\n\r\nexport type Enum<T extends object> = T[keyof T];\r\n"],"mappings":"mEAWA,SAAgB,EAA6B,EAAwB,CACjE,OAAO,OAAO,OAAO,EAAO"}
@@ -0,0 +1,17 @@
1
+ //#region src/enum/Enum.d.ts
2
+ /**
3
+ * @example
4
+ * ```typescript
5
+ const STATUS = Enum({
6
+ Success: "success",
7
+ Warning: "warning",
8
+ Error: "error",
9
+ });
10
+ type STATUS = Enum<typeof STATUS>;
11
+ ```
12
+ */
13
+ declare function Enum<const T extends object>(object: T): Readonly<T>;
14
+ type Enum<T extends object> = T[keyof T];
15
+ //#endregion
16
+ export { Enum };
17
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1,17 @@
1
+ //#region src/enum/Enum.d.ts
2
+ /**
3
+ * @example
4
+ * ```typescript
5
+ const STATUS = Enum({
6
+ Success: "success",
7
+ Warning: "warning",
8
+ Error: "error",
9
+ });
10
+ type STATUS = Enum<typeof STATUS>;
11
+ ```
12
+ */
13
+ declare function Enum<const T extends object>(object: T): Readonly<T>;
14
+ type Enum<T extends object> = T[keyof T];
15
+ //#endregion
16
+ export { Enum };
17
+ //# sourceMappingURL=index.d.ts.map
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ function e(e){return Object.freeze(e)}export{e as Enum};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/enum/Enum.ts"],"sourcesContent":["/**\r\n * @example\r\n * ```typescript\r\n const STATUS = Enum({\r\n Success: \"success\",\r\n Warning: \"warning\",\r\n Error: \"error\",\r\n });\r\n type STATUS = Enum<typeof STATUS>;\r\n ```\r\n */\r\nexport function Enum<const T extends object>(object: T): Readonly<T> {\r\n return Object.freeze(object);\r\n}\r\n\r\nexport type Enum<T extends object> = T[keyof T];\r\n"],"mappings":"AAWA,SAAgB,EAA6B,EAAwB,CACjE,OAAO,OAAO,OAAO,EAAO"}
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@jiaozi-dev/kit",
3
+ "version": "0.0.1",
4
+ "description": "A modern, type-safe TypeScript utility kit.",
5
+ "type": "module",
6
+ "main": "./dist/index.cjs",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/index.js",
12
+ "require": "./dist/index.cjs",
13
+ "types": "./dist/index.d.ts"
14
+ }
15
+ },
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "scripts": {
20
+ "dev": "tsdown --watch",
21
+ "build": "tsdown"
22
+ },
23
+ "devDependencies": {
24
+ "tsdown": "^0.21.7",
25
+ "typescript": "^6.0.2"
26
+ },
27
+ "keywords": [
28
+ "jiaozi-dev",
29
+ "kit",
30
+ "enum"
31
+ ],
32
+ "sideEffects": false,
33
+ "author": "yxdtg",
34
+ "license": "MIT"
35
+ }