ji-type-schema 1.0.0

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 ADDED
@@ -0,0 +1,139 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ booleanSchema: () => booleanSchema,
24
+ numberSchema: () => numberSchema,
25
+ objectSchema: () => objectSchema,
26
+ stringSchema: () => stringSchema
27
+ });
28
+ module.exports = __toCommonJS(index_exports);
29
+
30
+ // BaseSchema.ts
31
+ var BaseSchema = class {
32
+ normalizeError(e) {
33
+ if (Array.isArray(e)) {
34
+ return e;
35
+ }
36
+ if (e instanceof Error) {
37
+ return [{ message: e.message }];
38
+ }
39
+ return [{ message: "Invalid value" }];
40
+ }
41
+ safeParse(input) {
42
+ try {
43
+ return { success: true, data: this.parse(input) };
44
+ } catch (e) {
45
+ return {
46
+ success: false,
47
+ errors: this.normalizeError(e)
48
+ };
49
+ }
50
+ }
51
+ };
52
+
53
+ // schema/stringSchema.ts
54
+ var StringSchema = class extends BaseSchema {
55
+ parse(input) {
56
+ if (typeof input !== "string") {
57
+ throw new Error("Expected string");
58
+ }
59
+ return input;
60
+ }
61
+ };
62
+
63
+ // handler/string.ts
64
+ var stringSchema = () => new StringSchema();
65
+
66
+ // schema/numberSchema.ts
67
+ var NumberSchema = class extends BaseSchema {
68
+ parse(input) {
69
+ if (typeof input !== "number") {
70
+ throw new Error("Expected number");
71
+ }
72
+ return input;
73
+ }
74
+ };
75
+
76
+ // handler/number.ts
77
+ var numberSchema = () => new NumberSchema();
78
+
79
+ // schema/booleanSchema.ts
80
+ var BooleanSchema = class extends BaseSchema {
81
+ parse(input) {
82
+ if (typeof input !== "boolean") {
83
+ throw new Error("Expect boolean");
84
+ }
85
+ return input;
86
+ }
87
+ };
88
+
89
+ // handler/boolean.ts
90
+ var booleanSchema = () => new BooleanSchema();
91
+
92
+ // schema/objectSchema.ts
93
+ var ObjectSchema = class extends BaseSchema {
94
+ constructor(shape) {
95
+ super();
96
+ this.shape = shape;
97
+ }
98
+ parse(input) {
99
+ if (typeof input !== "object" || input === null) {
100
+ throw new Error("Expected object");
101
+ }
102
+ const result = {};
103
+ const errors = [];
104
+ for (const key in this.shape) {
105
+ const schema = this.shape[key];
106
+ const value = input[key];
107
+ const parsed = schema.safeParse(value);
108
+ if (!parsed.success) {
109
+ parsed.errors.forEach((err) => {
110
+ errors.push({
111
+ path: [key, ...err.path ?? []],
112
+ message: err.message
113
+ });
114
+ });
115
+ } else {
116
+ result[key] = parsed.data;
117
+ }
118
+ }
119
+ if (errors.length > 0) {
120
+ const error = new Error("Object validation failed");
121
+ error.errors = errors;
122
+ throw error;
123
+ }
124
+ return result;
125
+ }
126
+ };
127
+
128
+ // handler/object.ts
129
+ var objectSchema = (shape) => {
130
+ return new ObjectSchema(shape);
131
+ };
132
+ // Annotate the CommonJS export names for ESM import in node:
133
+ 0 && (module.exports = {
134
+ booleanSchema,
135
+ numberSchema,
136
+ objectSchema,
137
+ stringSchema
138
+ });
139
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../index.ts","../BaseSchema.ts","../schema/stringSchema.ts","../handler/string.ts","../schema/numberSchema.ts","../handler/number.ts","../schema/booleanSchema.ts","../handler/boolean.ts","../schema/objectSchema.ts","../handler/object.ts"],"sourcesContent":["export { stringSchema } from \"./handler/string\";\nexport { numberSchema } from \"./handler/number\";\nexport { booleanSchema } from \"./handler/boolean\";\nexport { objectSchema } from \"./handler/object\";\n\nexport type { Infer } from \"./interface/ISchema\";\nexport type { ValidationError } from \"./interface/ISchema\";\n","import { ISchema, SafeParseResult, ValidationError } from \"./interface/ISchema\";\n\nexport abstract class BaseSchema<T> implements ISchema<T> {\n abstract parse(input: unknown): T;\n\n protected normalizeError(e: unknown): ValidationError[] {\n if (Array.isArray(e)) {\n return e;\n }\n\n if (e instanceof Error) {\n return [{ message: e.message }];\n }\n\n return [{ message: \"Invalid value\" }];\n }\n\n safeParse(input: unknown): SafeParseResult<T> {\n try {\n return { success: true, data: this.parse(input) };\n } catch (e) {\n return {\n success: false,\n errors: this.normalizeError(e),\n };\n }\n }\n}\n","import { BaseSchema } from \"../BaseSchema\";\n\nexport class StringSchema extends BaseSchema<string> {\n parse(input: unknown): string {\n if (typeof input !== \"string\") {\n throw new Error(\"Expected string\");\n }\n return input;\n }\n}\n","import { StringSchema } from \"../schema/stringSchema\";\n\nexport const stringSchema = () => new StringSchema();\n","import { BaseSchema } from \"../BaseSchema\";\n\nexport class NumberSchema extends BaseSchema<number> {\n parse(input: unknown): number {\n if (typeof input !== \"number\") {\n throw new Error(\"Expected number\");\n }\n return input;\n }\n}\n","import { NumberSchema } from \"../schema/numberSchema\";\n\nexport const numberSchema = () => new NumberSchema();\n","import { BaseSchema } from \"../BaseSchema\";\n\nexport class BooleanSchema extends BaseSchema<boolean> {\n parse(input: unknown): boolean {\n if (typeof input !== \"boolean\") {\n throw new Error(\"Expect boolean\");\n }\n return input;\n }\n}\n","import { BooleanSchema } from \"../schema/booleanSchema\";\n\nexport const booleanSchema = () => new BooleanSchema();\n","import { BaseSchema } from \"../BaseSchema\";\nimport { Infer, ISchema, ValidationError } from \"../interface/ISchema\";\n\n/**\n * Record<string, ISchema<unknown>: string의 키값을 가지는 ISchema interface를 가지는 value\n * TShape: Record를 확장하는 Generic\n */\nexport class ObjectSchema<\n TShape extends Record<string, ISchema<unknown>>\n> extends BaseSchema<{ [K in keyof TShape]: Infer<TShape[K]> }> {\n constructor(private readonly shape: TShape) {\n super();\n }\n\n parse(input: unknown) {\n if (typeof input !== \"object\" || input === null) {\n throw new Error(\"Expected object\");\n }\n\n const result: any = {};\n const errors: ValidationError[] = [];\n\n for (const key in this.shape) {\n const schema = this.shape[key];\n const value = (input as any)[key];\n\n const parsed = schema.safeParse(value);\n\n if (!parsed.success) {\n parsed.errors.forEach((err) => {\n errors.push({\n path: [key, ...(err.path ?? [])],\n message: err.message,\n });\n });\n } else {\n result[key] = parsed.data;\n }\n }\n\n if (errors.length > 0) {\n const error = new Error(\"Object validation failed\");\n (error as any).errors = errors;\n throw error;\n }\n\n return result;\n }\n}\n","import { Infer, ISchema } from \"../interface/ISchema\";\nimport { ObjectSchema } from \"../schema/objectSchema\";\n\nexport const objectSchema = <TShape extends Record<string, ISchema<unknown>>>(\n shape: TShape\n): ISchema<{ [K in keyof TShape]: Infer<TShape[K]> }> => {\n return new ObjectSchema(shape);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEO,IAAe,aAAf,MAAmD;AAAA,EAG9C,eAAe,GAA+B;AACtD,QAAI,MAAM,QAAQ,CAAC,GAAG;AACpB,aAAO;AAAA,IACT;AAEA,QAAI,aAAa,OAAO;AACtB,aAAO,CAAC,EAAE,SAAS,EAAE,QAAQ,CAAC;AAAA,IAChC;AAEA,WAAO,CAAC,EAAE,SAAS,gBAAgB,CAAC;AAAA,EACtC;AAAA,EAEA,UAAU,OAAoC;AAC5C,QAAI;AACF,aAAO,EAAE,SAAS,MAAM,MAAM,KAAK,MAAM,KAAK,EAAE;AAAA,IA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CAAC,KAAK,GAAI,IAAI,QAAQ,CAAC,CAAE;AAAA,YAC/B,SAAS,IAAI;AAAA,UACf,CAAC;AAAA,QACH,CAAC;AAAA,MACH,OAAO;AACL,eAAO,GAAG,IAAI,OAAO;AAAA,MACvB;AAAA,IACF;AAEA,QAAI,OAAO,SAAS,GAAG;AACrB,YAAM,QAAQ,IAAI,MAAM,0BAA0B;AAClD,MAAC,MAAc,SAAS;AACxB,YAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AACF;;;AC7CO,IAAM,eAAe,CAC1B,UACuD;AACvD,SAAO,IAAI,aAAa,KAAK;AAC/B;","names":[]}
@@ -0,0 +1,50 @@
1
+ type Path = (string | number)[];
2
+ type ValidationError = {
3
+ path?: Path;
4
+ message: string;
5
+ };
6
+ type SafeParseResult<T> = {
7
+ success: true;
8
+ data: T;
9
+ } | {
10
+ success: false;
11
+ errors: ValidationError[];
12
+ };
13
+ interface ISchema<T> {
14
+ parse(input: unknown): T;
15
+ safeParse(input: unknown): SafeParseResult<T>;
16
+ }
17
+ /**
18
+ * Infer는 ISchema<...>을 구현한 타입만 받을수 있다.
19
+ * T extends ISchema<infer U> ? U : never 👉 T가 ISchema<...>의 형태라면 그 안의 타입을 U라고 추론해서 반환해라.
20
+ * infer U 👉 타입 역추론. ex) ISchema<string> => U = string, ISchema<number> => U = number
21
+ */
22
+ type Infer<T extends ISchema<any>> = T extends ISchema<infer U> ? U : never;
23
+
24
+ declare abstract class BaseSchema<T> implements ISchema<T> {
25
+ abstract parse(input: unknown): T;
26
+ protected normalizeError(e: unknown): ValidationError[];
27
+ safeParse(input: unknown): SafeParseResult<T>;
28
+ }
29
+
30
+ declare class StringSchema extends BaseSchema<string> {
31
+ parse(input: unknown): string;
32
+ }
33
+
34
+ declare const stringSchema: () => StringSchema;
35
+
36
+ declare class NumberSchema extends BaseSchema<number> {
37
+ parse(input: unknown): number;
38
+ }
39
+
40
+ declare const numberSchema: () => NumberSchema;
41
+
42
+ declare class BooleanSchema extends BaseSchema<boolean> {
43
+ parse(input: unknown): boolean;
44
+ }
45
+
46
+ declare const booleanSchema: () => BooleanSchema;
47
+
48
+ declare const objectSchema: <TShape extends Record<string, ISchema<unknown>>>(shape: TShape) => ISchema<{ [K in keyof TShape]: Infer<TShape[K]>; }>;
49
+
50
+ export { type Infer, type ValidationError, booleanSchema, numberSchema, objectSchema, stringSchema };
@@ -0,0 +1,50 @@
1
+ type Path = (string | number)[];
2
+ type ValidationError = {
3
+ path?: Path;
4
+ message: string;
5
+ };
6
+ type SafeParseResult<T> = {
7
+ success: true;
8
+ data: T;
9
+ } | {
10
+ success: false;
11
+ errors: ValidationError[];
12
+ };
13
+ interface ISchema<T> {
14
+ parse(input: unknown): T;
15
+ safeParse(input: unknown): SafeParseResult<T>;
16
+ }
17
+ /**
18
+ * Infer는 ISchema<...>을 구현한 타입만 받을수 있다.
19
+ * T extends ISchema<infer U> ? U : never 👉 T가 ISchema<...>의 형태라면 그 안의 타입을 U라고 추론해서 반환해라.
20
+ * infer U 👉 타입 역추론. ex) ISchema<string> => U = string, ISchema<number> => U = number
21
+ */
22
+ type Infer<T extends ISchema<any>> = T extends ISchema<infer U> ? U : never;
23
+
24
+ declare abstract class BaseSchema<T> implements ISchema<T> {
25
+ abstract parse(input: unknown): T;
26
+ protected normalizeError(e: unknown): ValidationError[];
27
+ safeParse(input: unknown): SafeParseResult<T>;
28
+ }
29
+
30
+ declare class StringSchema extends BaseSchema<string> {
31
+ parse(input: unknown): string;
32
+ }
33
+
34
+ declare const stringSchema: () => StringSchema;
35
+
36
+ declare class NumberSchema extends BaseSchema<number> {
37
+ parse(input: unknown): number;
38
+ }
39
+
40
+ declare const numberSchema: () => NumberSchema;
41
+
42
+ declare class BooleanSchema extends BaseSchema<boolean> {
43
+ parse(input: unknown): boolean;
44
+ }
45
+
46
+ declare const booleanSchema: () => BooleanSchema;
47
+
48
+ declare const objectSchema: <TShape extends Record<string, ISchema<unknown>>>(shape: TShape) => ISchema<{ [K in keyof TShape]: Infer<TShape[K]>; }>;
49
+
50
+ export { type Infer, type ValidationError, booleanSchema, numberSchema, objectSchema, stringSchema };
package/dist/index.js ADDED
@@ -0,0 +1,109 @@
1
+ // BaseSchema.ts
2
+ var BaseSchema = class {
3
+ normalizeError(e) {
4
+ if (Array.isArray(e)) {
5
+ return e;
6
+ }
7
+ if (e instanceof Error) {
8
+ return [{ message: e.message }];
9
+ }
10
+ return [{ message: "Invalid value" }];
11
+ }
12
+ safeParse(input) {
13
+ try {
14
+ return { success: true, data: this.parse(input) };
15
+ } catch (e) {
16
+ return {
17
+ success: false,
18
+ errors: this.normalizeError(e)
19
+ };
20
+ }
21
+ }
22
+ };
23
+
24
+ // schema/stringSchema.ts
25
+ var StringSchema = class extends BaseSchema {
26
+ parse(input) {
27
+ if (typeof input !== "string") {
28
+ throw new Error("Expected string");
29
+ }
30
+ return input;
31
+ }
32
+ };
33
+
34
+ // handler/string.ts
35
+ var stringSchema = () => new StringSchema();
36
+
37
+ // schema/numberSchema.ts
38
+ var NumberSchema = class extends BaseSchema {
39
+ parse(input) {
40
+ if (typeof input !== "number") {
41
+ throw new Error("Expected number");
42
+ }
43
+ return input;
44
+ }
45
+ };
46
+
47
+ // handler/number.ts
48
+ var numberSchema = () => new NumberSchema();
49
+
50
+ // schema/booleanSchema.ts
51
+ var BooleanSchema = class extends BaseSchema {
52
+ parse(input) {
53
+ if (typeof input !== "boolean") {
54
+ throw new Error("Expect boolean");
55
+ }
56
+ return input;
57
+ }
58
+ };
59
+
60
+ // handler/boolean.ts
61
+ var booleanSchema = () => new BooleanSchema();
62
+
63
+ // schema/objectSchema.ts
64
+ var ObjectSchema = class extends BaseSchema {
65
+ constructor(shape) {
66
+ super();
67
+ this.shape = shape;
68
+ }
69
+ parse(input) {
70
+ if (typeof input !== "object" || input === null) {
71
+ throw new Error("Expected object");
72
+ }
73
+ const result = {};
74
+ const errors = [];
75
+ for (const key in this.shape) {
76
+ const schema = this.shape[key];
77
+ const value = input[key];
78
+ const parsed = schema.safeParse(value);
79
+ if (!parsed.success) {
80
+ parsed.errors.forEach((err) => {
81
+ errors.push({
82
+ path: [key, ...err.path ?? []],
83
+ message: err.message
84
+ });
85
+ });
86
+ } else {
87
+ result[key] = parsed.data;
88
+ }
89
+ }
90
+ if (errors.length > 0) {
91
+ const error = new Error("Object validation failed");
92
+ error.errors = errors;
93
+ throw error;
94
+ }
95
+ return result;
96
+ }
97
+ };
98
+
99
+ // handler/object.ts
100
+ var objectSchema = (shape) => {
101
+ return new ObjectSchema(shape);
102
+ };
103
+ export {
104
+ booleanSchema,
105
+ numberSchema,
106
+ objectSchema,
107
+ stringSchema
108
+ };
109
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../BaseSchema.ts","../schema/stringSchema.ts","../handler/string.ts","../schema/numberSchema.ts","../handler/number.ts","../schema/booleanSchema.ts","../handler/boolean.ts","../schema/objectSchema.ts","../handler/object.ts"],"sourcesContent":["import { ISchema, SafeParseResult, ValidationError } from \"./interface/ISchema\";\n\nexport abstract class BaseSchema<T> implements ISchema<T> {\n abstract parse(input: unknown): T;\n\n protected normalizeError(e: unknown): ValidationError[] {\n if (Array.isArray(e)) {\n return e;\n }\n\n if (e instanceof Error) {\n return [{ message: e.message }];\n }\n\n return [{ message: \"Invalid value\" }];\n }\n\n safeParse(input: unknown): SafeParseResult<T> {\n try {\n return { success: true, data: this.parse(input) };\n } catch (e) {\n return {\n success: false,\n errors: this.normalizeError(e),\n };\n }\n }\n}\n","import { BaseSchema } from \"../BaseSchema\";\n\nexport class StringSchema extends BaseSchema<string> {\n parse(input: unknown): string {\n if (typeof input !== \"string\") {\n throw new Error(\"Expected string\");\n }\n return input;\n }\n}\n","import { StringSchema } from \"../schema/stringSchema\";\n\nexport const stringSchema = () => new StringSchema();\n","import { BaseSchema } from \"../BaseSchema\";\n\nexport class NumberSchema extends BaseSchema<number> {\n parse(input: unknown): number {\n if (typeof input !== \"number\") {\n throw new Error(\"Expected number\");\n }\n return input;\n }\n}\n","import { NumberSchema } from \"../schema/numberSchema\";\n\nexport const numberSchema = () => new NumberSchema();\n","import { BaseSchema } from \"../BaseSchema\";\n\nexport class BooleanSchema extends BaseSchema<boolean> {\n parse(input: unknown): boolean {\n if (typeof input !== \"boolean\") {\n throw new Error(\"Expect boolean\");\n }\n return input;\n }\n}\n","import { BooleanSchema } from \"../schema/booleanSchema\";\n\nexport const booleanSchema = () => new BooleanSchema();\n","import { BaseSchema } from \"../BaseSchema\";\nimport { Infer, ISchema, ValidationError } from \"../interface/ISchema\";\n\n/**\n * Record<string, ISchema<unknown>: string의 키값을 가지는 ISchema interface를 가지는 value\n * TShape: Record를 확장하는 Generic\n */\nexport class ObjectSchema<\n TShape extends Record<string, ISchema<unknown>>\n> extends BaseSchema<{ [K in keyof TShape]: Infer<TShape[K]> }> {\n constructor(private readonly shape: TShape) {\n super();\n }\n\n parse(input: unknown) {\n if (typeof input !== \"object\" || input === null) {\n throw new Error(\"Expected object\");\n }\n\n const result: any = {};\n const errors: ValidationError[] = [];\n\n for (const key in this.shape) {\n const schema = this.shape[key];\n const value = (input as any)[key];\n\n const parsed = schema.safeParse(value);\n\n if (!parsed.success) {\n parsed.errors.forEach((err) => {\n errors.push({\n path: [key, ...(err.path ?? [])],\n message: err.message,\n });\n });\n } else {\n result[key] = parsed.data;\n }\n }\n\n if (errors.length > 0) {\n const error = new Error(\"Object validation failed\");\n (error as any).errors = errors;\n throw error;\n }\n\n return result;\n }\n}\n","import { Infer, ISchema } from \"../interface/ISchema\";\nimport { ObjectSchema } from \"../schema/objectSchema\";\n\nexport const objectSchema = <TShape extends Record<string, ISchema<unknown>>>(\n shape: TShape\n): ISchema<{ [K in keyof TShape]: Infer<TShape[K]> }> => {\n return new ObjectSchema(shape);\n};\n"],"mappings":";AAEO,IAAe,aAAf,MAAmD;AAAA,EAG9C,eAAe,GAA+B;AACtD,QAAI,MAAM,QAAQ,CAAC,GAAG;AACpB,aAAO;AAAA,IACT;AAEA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AAEnC,eAAW,OAAO,KAAK,OAAO;AAC5B,YAAM,SAAS,KAAK,MAAM,GAAG;AAC7B,YAAM,QAAS,MAAc,GAAG;AAEhC,YAAM,SAAS,OAAO,UAAU,KAAK;AAErC,UAAI,CAAC,OAAO,SAAS;AACnB,eAAO,OAAO,QAAQ,CAAC,QAAQ;AAC7B,iBAAO,KAAK;AAAA,YACV,MAAM,CAAC,KAAK,GAAI,IAAI,QAAQ,CAAC,CAAE;AAAA,YAC/B,SAAS,IAAI;AAAA,UACf,CAAC;AAAA,QACH,CAAC;AAAA,MACH,OAAO;AACL,eAAO,GAAG,IAAI,OAAO;AAAA,MACvB;AAAA,IACF;AAEA,QAAI,OAAO,SAAS,GAAG;AACrB,YAAM,QAAQ,IAAI,MAAM,0BAA0B;AAClD,MAAC,MAAc,SAAS;AACxB,YAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AACF;;;AC7CO,IAAM,eAAe,CAC1B,UACuD;AACvD,SAAO,IAAI,aAAa,KAAK;AAC/B;","names":[]}
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "ji-type-schema",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "type": "module",
6
+ "main": "./dist/index.cjs",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js",
13
+ "require": "./dist/index.cjs"
14
+ }
15
+ },
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "scripts": {
20
+ "build": "tsup",
21
+ "prepublishOnly": "pnpm build",
22
+ "test": "echo \"Error: no test specified\" && exit 1"
23
+ },
24
+ "sideEffects": false,
25
+ "keywords": [],
26
+ "author": "",
27
+ "license": "ISC",
28
+ "packageManager": "pnpm@10.13.1",
29
+ "devDependencies": {
30
+ "tsup": "^8.0.1",
31
+ "typescript": "^5.5.4"
32
+ }
33
+ }