@percepta/utils 0.1.6 → 0.1.8

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.
Files changed (35) hide show
  1. package/dist/cjs/config/getEnvConfig.d.ts +158 -32
  2. package/dist/cjs/config/getEnvConfig.d.ts.map +1 -1
  3. package/dist/cjs/config/getEnvConfig.js +6 -2
  4. package/dist/cjs/config/getEnvConfig.js.map +1 -1
  5. package/dist/cjs/tsconfig.tsbuildinfo +1 -1
  6. package/dist/cjs/utils/index.d.ts +2 -0
  7. package/dist/cjs/utils/index.d.ts.map +1 -1
  8. package/dist/cjs/utils/index.js +2 -0
  9. package/dist/cjs/utils/index.js.map +1 -1
  10. package/dist/cjs/utils/replaceAt.d.ts +10 -0
  11. package/dist/cjs/utils/replaceAt.d.ts.map +1 -0
  12. package/dist/cjs/utils/replaceAt.js +17 -0
  13. package/dist/cjs/utils/replaceAt.js.map +1 -0
  14. package/dist/cjs/utils/zodKeyedTypeUnion.d.ts +17 -0
  15. package/dist/cjs/utils/zodKeyedTypeUnion.d.ts.map +1 -0
  16. package/dist/cjs/utils/zodKeyedTypeUnion.js +15 -0
  17. package/dist/cjs/utils/zodKeyedTypeUnion.js.map +1 -0
  18. package/dist/esnext/config/getEnvConfig.d.ts +158 -32
  19. package/dist/esnext/config/getEnvConfig.d.ts.map +1 -1
  20. package/dist/esnext/config/getEnvConfig.js +6 -2
  21. package/dist/esnext/config/getEnvConfig.js.map +1 -1
  22. package/dist/esnext/tsconfig.tsbuildinfo +1 -1
  23. package/dist/esnext/utils/index.d.ts +2 -0
  24. package/dist/esnext/utils/index.d.ts.map +1 -1
  25. package/dist/esnext/utils/index.js +2 -0
  26. package/dist/esnext/utils/index.js.map +1 -1
  27. package/dist/esnext/utils/replaceAt.d.ts +10 -0
  28. package/dist/esnext/utils/replaceAt.d.ts.map +1 -0
  29. package/dist/esnext/utils/replaceAt.js +14 -0
  30. package/dist/esnext/utils/replaceAt.js.map +1 -0
  31. package/dist/esnext/utils/zodKeyedTypeUnion.d.ts +17 -0
  32. package/dist/esnext/utils/zodKeyedTypeUnion.d.ts.map +1 -0
  33. package/dist/esnext/utils/zodKeyedTypeUnion.js +12 -0
  34. package/dist/esnext/utils/zodKeyedTypeUnion.js.map +1 -0
  35. package/package.json +4 -3
@@ -1,4 +1,6 @@
1
1
  export * from "./assertNever";
2
2
  export * from "./logNever";
3
3
  export * from "./promiseAllValues";
4
+ export * from "./replaceAt";
5
+ export * from "./zodKeyedTypeUnion";
4
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC"}
@@ -17,4 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./assertNever"), exports);
18
18
  __exportStar(require("./logNever"), exports);
19
19
  __exportStar(require("./promiseAllValues"), exports);
20
+ __exportStar(require("./replaceAt"), exports);
21
+ __exportStar(require("./zodKeyedTypeUnion"), exports);
20
22
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,6CAA2B;AAC3B,qDAAmC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,6CAA2B;AAC3B,qDAAmC;AACnC,8CAA4B;AAC5B,sDAAoC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Returns a new array with the element at the specified index replaced.
3
+ *
4
+ * @param array The source array
5
+ * @param index The index of the element to replace
6
+ * @param value The new value to insert at the index
7
+ * @returns A new array with the replacement applied
8
+ */
9
+ export declare function replaceAt<T>(array: T[], index: number, value: T): T[];
10
+ //# sourceMappingURL=replaceAt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replaceAt.d.ts","sourceRoot":"","sources":["../../../src/utils/replaceAt.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,CAIrE"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.replaceAt = replaceAt;
4
+ /**
5
+ * Returns a new array with the element at the specified index replaced.
6
+ *
7
+ * @param array The source array
8
+ * @param index The index of the element to replace
9
+ * @param value The new value to insert at the index
10
+ * @returns A new array with the replacement applied
11
+ */
12
+ function replaceAt(array, index, value) {
13
+ const newArray = [...array];
14
+ newArray[index] = value;
15
+ return newArray;
16
+ }
17
+ //# sourceMappingURL=replaceAt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replaceAt.js","sourceRoot":"","sources":["../../../src/utils/replaceAt.ts"],"names":[],"mappings":";;AAQA,8BAIC;AAZD;;;;;;;GAOG;AACH,SAAgB,SAAS,CAAI,KAAU,EAAE,KAAa,EAAE,KAAQ;IAC9D,MAAM,QAAQ,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;IACxB,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { type KeyedTypeUnion, type ValueForTypeKey } from "keyed-type-union";
2
+ import { z } from "zod";
3
+ type SchemasByType<TTypeUnion extends KeyedTypeUnion<Record<string, unknown>, TTypeKey>, TTypeKey extends string = "type"> = {
4
+ [TType in TTypeUnion[TTypeKey]]: z.ZodType<ValueForTypeKey<TTypeUnion, TType, TTypeKey>>;
5
+ };
6
+ /**
7
+ * Creates a Zod schema for a discriminated union of type-union types.
8
+ * We can use this util alongside keyed-type-union for stricter type union patterns.
9
+ *
10
+ * @param schemasByType A record of type keys to their corresponding Zod schemas.
11
+ * @param typeKey The optional key used to discriminate between the different types in the union.
12
+ * @returns A Zod schema for the discriminated union.
13
+ */
14
+ export declare function zodKeyedTypeUnion<TTypeUnion extends KeyedTypeUnion<Record<string, unknown>>>(schemasByType: SchemasByType<TTypeUnion>): z.ZodType<TTypeUnion>;
15
+ export declare function zodKeyedTypeUnion<TTypeUnion extends KeyedTypeUnion<Record<string, unknown>, TTypeKey>, TTypeKey extends string>(schemasByType: SchemasByType<TTypeUnion, TTypeKey>, typeKey: TTypeKey): z.ZodType<TTypeUnion>;
16
+ export {};
17
+ //# sourceMappingURL=zodKeyedTypeUnion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zodKeyedTypeUnion.d.ts","sourceRoot":"","sources":["../../../src/utils/zodKeyedTypeUnion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,KAAK,aAAa,CAChB,UAAU,SAAS,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,CAAC,EACpE,QAAQ,SAAS,MAAM,GAAG,MAAM,IAC9B;KACD,KAAK,IAAI,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,CACxC,eAAe,CAAC,UAAU,EAAE,KAAK,EAAE,QAAQ,CAAC,CAC7C;CACF,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,SAAS,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAC1D,aAAa,EAAE,aAAa,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AACnE,wBAAgB,iBAAiB,CAC/B,UAAU,SAAS,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,CAAC,EACpE,QAAQ,SAAS,MAAM,EAEvB,aAAa,EAAE,aAAa,CAAC,UAAU,EAAE,QAAQ,CAAC,EAClD,OAAO,EAAE,QAAQ,GAChB,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.zodKeyedTypeUnion = zodKeyedTypeUnion;
4
+ const zod_1 = require("zod");
5
+ function zodKeyedTypeUnion(schemasByType, typeKey = "type") {
6
+ /**
7
+ * There are a lot of casts here because of our fancy generics.
8
+ * We won't worry about them for now; we'll just use our tests to ensure runtime safety.
9
+ */
10
+ return zod_1.z.discriminatedUnion(typeKey, Object.entries(schemasByType).map(([type, schema]) => zod_1.z.object({
11
+ [typeKey]: zod_1.z.literal(type),
12
+ [type]: schema,
13
+ })));
14
+ }
15
+ //# sourceMappingURL=zodKeyedTypeUnion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zodKeyedTypeUnion.js","sourceRoot":"","sources":["../../../src/utils/zodKeyedTypeUnion.ts"],"names":[],"mappings":";;AA8BA,8CAoBC;AAjDD,6BAAwB;AA6BxB,SAAgB,iBAAiB,CAI/B,aAAkD,EAClD,UAAoB,MAAe;IAEnC;;;OAGG;IACH,OAAO,OAAC,CAAC,kBAAkB,CACzB,OAAO,EACP,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,EAAE,CACnD,OAAC,CAAC,MAAM,CAAC;QACP,CAAC,OAAO,CAAC,EAAE,OAAC,CAAC,OAAO,CAAC,IAAI,CAAC;QAC1B,CAAC,IAAI,CAAC,EAAE,MAAe;KACxB,CAAC,CACM,CACF,CAAC;AACb,CAAC"}
@@ -1,38 +1,164 @@
1
1
  import { z } from "zod";
2
2
  export declare const BASE_ENV_SCHEMA: z.ZodObject<{
3
- NODE_ENV: z.ZodDefault<z.ZodEnum<["development", "production", "test"]>>;
4
- LOG_LEVEL: z.ZodDefault<z.ZodEnum<["debug", "info", "warn", "error"]>>;
5
- }, "strip", z.ZodTypeAny, {
6
- NODE_ENV: "development" | "production" | "test";
7
- LOG_LEVEL: "debug" | "info" | "warn" | "error";
8
- }, {
9
- NODE_ENV?: "development" | "production" | "test" | undefined;
10
- LOG_LEVEL?: "debug" | "info" | "warn" | "error" | undefined;
11
- }>;
3
+ NODE_ENV: z.ZodDefault<z.ZodEnum<{
4
+ development: "development";
5
+ production: "production";
6
+ test: "test";
7
+ }>>;
8
+ LOG_LEVEL: z.ZodDefault<z.ZodPipe<z.ZodString, z.ZodEnum<{
9
+ debug: "debug";
10
+ info: "info";
11
+ warn: "warn";
12
+ error: "error";
13
+ }>>>;
14
+ }, z.core.$strip>;
12
15
  export type BaseEnvConfig = z.infer<typeof BASE_ENV_SCHEMA>;
13
16
  export declare function createEnvConfig<TExtension extends z.ZodRawShape>(extensionSchema: z.ZodObject<TExtension>): {
14
- getEnvConfig: () => z.objectUtil.addQuestionMarks<z.baseObjectOutputType<z.objectUtil.extendShape<{
15
- NODE_ENV: z.ZodDefault<z.ZodEnum<["development", "production", "test"]>>;
16
- LOG_LEVEL: z.ZodDefault<z.ZodEnum<["debug", "info", "warn", "error"]>>;
17
- }, TExtension>>, any> extends infer T ? { [k in keyof T]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<z.objectUtil.extendShape<{
18
- NODE_ENV: z.ZodDefault<z.ZodEnum<["development", "production", "test"]>>;
19
- LOG_LEVEL: z.ZodDefault<z.ZodEnum<["debug", "info", "warn", "error"]>>;
20
- }, TExtension>>, any>[k]; } : never;
21
- schema: z.ZodObject<z.objectUtil.extendShape<{
22
- NODE_ENV: z.ZodDefault<z.ZodEnum<["development", "production", "test"]>>;
23
- LOG_LEVEL: z.ZodDefault<z.ZodEnum<["debug", "info", "warn", "error"]>>;
24
- }, TExtension>, z.UnknownKeysParam, z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<z.objectUtil.extendShape<{
25
- NODE_ENV: z.ZodDefault<z.ZodEnum<["development", "production", "test"]>>;
26
- LOG_LEVEL: z.ZodDefault<z.ZodEnum<["debug", "info", "warn", "error"]>>;
27
- }, TExtension>>, any> extends infer T ? { [k in keyof T]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<z.objectUtil.extendShape<{
28
- NODE_ENV: z.ZodDefault<z.ZodEnum<["development", "production", "test"]>>;
29
- LOG_LEVEL: z.ZodDefault<z.ZodEnum<["debug", "info", "warn", "error"]>>;
30
- }, TExtension>>, any>[k]; } : never, z.baseObjectInputType<z.objectUtil.extendShape<{
31
- NODE_ENV: z.ZodDefault<z.ZodEnum<["development", "production", "test"]>>;
32
- LOG_LEVEL: z.ZodDefault<z.ZodEnum<["debug", "info", "warn", "error"]>>;
33
- }, TExtension>> extends infer T_1 ? { [k_1 in keyof T_1]: z.baseObjectInputType<z.objectUtil.extendShape<{
34
- NODE_ENV: z.ZodDefault<z.ZodEnum<["development", "production", "test"]>>;
35
- LOG_LEVEL: z.ZodDefault<z.ZodEnum<["debug", "info", "warn", "error"]>>;
36
- }, TExtension>>[k_1]; } : never>;
17
+ getEnvConfig: () => z.core.$InferObjectOutput<(("NODE_ENV" | "LOG_LEVEL") & keyof TExtension extends never ? {
18
+ NODE_ENV: z.ZodDefault<z.ZodEnum<{
19
+ development: "development";
20
+ production: "production";
21
+ test: "test";
22
+ }>>;
23
+ LOG_LEVEL: z.ZodDefault<z.ZodPipe<z.ZodString, z.ZodEnum<{
24
+ debug: "debug";
25
+ info: "info";
26
+ warn: "warn";
27
+ error: "error";
28
+ }>>>;
29
+ } & TExtension : ({
30
+ NODE_ENV: z.ZodDefault<z.ZodEnum<{
31
+ development: "development";
32
+ production: "production";
33
+ test: "test";
34
+ }>>;
35
+ LOG_LEVEL: z.ZodDefault<z.ZodPipe<z.ZodString, z.ZodEnum<{
36
+ debug: "debug";
37
+ info: "info";
38
+ warn: "warn";
39
+ error: "error";
40
+ }>>>;
41
+ } extends infer T_2 extends z.core.util.SomeObject ? { [K in keyof T_2 as K extends keyof TExtension ? never : K]: {
42
+ NODE_ENV: z.ZodDefault<z.ZodEnum<{
43
+ development: "development";
44
+ production: "production";
45
+ test: "test";
46
+ }>>;
47
+ LOG_LEVEL: z.ZodDefault<z.ZodPipe<z.ZodString, z.ZodEnum<{
48
+ debug: "debug";
49
+ info: "info";
50
+ warn: "warn";
51
+ error: "error";
52
+ }>>>;
53
+ }[K]; } : never) & { [K_1 in keyof TExtension]: TExtension[K_1]; }) extends infer T ? { [k in keyof T]: (("NODE_ENV" | "LOG_LEVEL") & keyof TExtension extends never ? {
54
+ NODE_ENV: z.ZodDefault<z.ZodEnum<{
55
+ development: "development";
56
+ production: "production";
57
+ test: "test";
58
+ }>>;
59
+ LOG_LEVEL: z.ZodDefault<z.ZodPipe<z.ZodString, z.ZodEnum<{
60
+ debug: "debug";
61
+ info: "info";
62
+ warn: "warn";
63
+ error: "error";
64
+ }>>>;
65
+ } & TExtension : ({
66
+ NODE_ENV: z.ZodDefault<z.ZodEnum<{
67
+ development: "development";
68
+ production: "production";
69
+ test: "test";
70
+ }>>;
71
+ LOG_LEVEL: z.ZodDefault<z.ZodPipe<z.ZodString, z.ZodEnum<{
72
+ debug: "debug";
73
+ info: "info";
74
+ warn: "warn";
75
+ error: "error";
76
+ }>>>;
77
+ } extends infer T_1 extends z.core.util.SomeObject ? { [K in keyof T_1 as K extends keyof TExtension ? never : K]: {
78
+ NODE_ENV: z.ZodDefault<z.ZodEnum<{
79
+ development: "development";
80
+ production: "production";
81
+ test: "test";
82
+ }>>;
83
+ LOG_LEVEL: z.ZodDefault<z.ZodPipe<z.ZodString, z.ZodEnum<{
84
+ debug: "debug";
85
+ info: "info";
86
+ warn: "warn";
87
+ error: "error";
88
+ }>>>;
89
+ }[K]; } : never) & { [K_1 in keyof TExtension]: TExtension[K_1]; })[k]; } : never, {}>;
90
+ schema: z.ZodObject<(("NODE_ENV" | "LOG_LEVEL") & keyof TExtension extends never ? {
91
+ NODE_ENV: z.ZodDefault<z.ZodEnum<{
92
+ development: "development";
93
+ production: "production";
94
+ test: "test";
95
+ }>>;
96
+ LOG_LEVEL: z.ZodDefault<z.ZodPipe<z.ZodString, z.ZodEnum<{
97
+ debug: "debug";
98
+ info: "info";
99
+ warn: "warn";
100
+ error: "error";
101
+ }>>>;
102
+ } & TExtension : ({
103
+ NODE_ENV: z.ZodDefault<z.ZodEnum<{
104
+ development: "development";
105
+ production: "production";
106
+ test: "test";
107
+ }>>;
108
+ LOG_LEVEL: z.ZodDefault<z.ZodPipe<z.ZodString, z.ZodEnum<{
109
+ debug: "debug";
110
+ info: "info";
111
+ warn: "warn";
112
+ error: "error";
113
+ }>>>;
114
+ } extends infer T_2 extends z.core.util.SomeObject ? { [K in keyof T_2 as K extends keyof TExtension ? never : K]: {
115
+ NODE_ENV: z.ZodDefault<z.ZodEnum<{
116
+ development: "development";
117
+ production: "production";
118
+ test: "test";
119
+ }>>;
120
+ LOG_LEVEL: z.ZodDefault<z.ZodPipe<z.ZodString, z.ZodEnum<{
121
+ debug: "debug";
122
+ info: "info";
123
+ warn: "warn";
124
+ error: "error";
125
+ }>>>;
126
+ }[K]; } : never) & { [K_1 in keyof TExtension]: TExtension[K_1]; }) extends infer T ? { [k in keyof T]: (("NODE_ENV" | "LOG_LEVEL") & keyof TExtension extends never ? {
127
+ NODE_ENV: z.ZodDefault<z.ZodEnum<{
128
+ development: "development";
129
+ production: "production";
130
+ test: "test";
131
+ }>>;
132
+ LOG_LEVEL: z.ZodDefault<z.ZodPipe<z.ZodString, z.ZodEnum<{
133
+ debug: "debug";
134
+ info: "info";
135
+ warn: "warn";
136
+ error: "error";
137
+ }>>>;
138
+ } & TExtension : ({
139
+ NODE_ENV: z.ZodDefault<z.ZodEnum<{
140
+ development: "development";
141
+ production: "production";
142
+ test: "test";
143
+ }>>;
144
+ LOG_LEVEL: z.ZodDefault<z.ZodPipe<z.ZodString, z.ZodEnum<{
145
+ debug: "debug";
146
+ info: "info";
147
+ warn: "warn";
148
+ error: "error";
149
+ }>>>;
150
+ } extends infer T_1 extends z.core.util.SomeObject ? { [K in keyof T_1 as K extends keyof TExtension ? never : K]: {
151
+ NODE_ENV: z.ZodDefault<z.ZodEnum<{
152
+ development: "development";
153
+ production: "production";
154
+ test: "test";
155
+ }>>;
156
+ LOG_LEVEL: z.ZodDefault<z.ZodPipe<z.ZodString, z.ZodEnum<{
157
+ debug: "debug";
158
+ info: "info";
159
+ warn: "warn";
160
+ error: "error";
161
+ }>>>;
162
+ }[K]; } : never) & { [K_1 in keyof TExtension]: TExtension[K_1]; })[k]; } : never, z.core.$strip>;
37
163
  };
38
164
  //# sourceMappingURL=getEnvConfig.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getEnvConfig.d.ts","sourceRoot":"","sources":["../../../src/config/getEnvConfig.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,eAAe;;;;;;;;;EAK1B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAG5D,wBAAgB,eAAe,CAAC,UAAU,SAAS,CAAC,CAAC,WAAW,EAC9D,eAAe,EAAE,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;EAezC"}
1
+ {"version":3,"file":"getEnvConfig.d.ts","sourceRoot":"","sources":["../../../src/config/getEnvConfig.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,eAAe;;;;;;;;;;;;iBAS1B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAG5D,wBAAgB,eAAe,CAAC,UAAU,SAAS,CAAC,CAAC,WAAW,EAC9D,eAAe,EAAE,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAezC"}
@@ -5,11 +5,15 @@ export const BASE_ENV_SCHEMA = z.object({
5
5
  NODE_ENV: z
6
6
  .enum(["development", "production", "test"])
7
7
  .default("development"),
8
- LOG_LEVEL: z.enum(["debug", "info", "warn", "error"]).default("info"),
8
+ LOG_LEVEL: z
9
+ .string()
10
+ .toLowerCase()
11
+ .pipe(z.enum(["debug", "info", "warn", "error"]))
12
+ .default("info"),
9
13
  });
10
14
  // Factory that creates a configured getEnvConfig
11
15
  export function createEnvConfig(extensionSchema) {
12
- const schema = BASE_ENV_SCHEMA.merge(extensionSchema);
16
+ const schema = BASE_ENV_SCHEMA.extend(extensionSchema.shape);
13
17
  let _cached;
14
18
  function getEnvConfig() {
15
19
  if (_cached == null) {
@@ -1 +1 @@
1
- {"version":3,"file":"getEnvConfig.js","sourceRoot":"","sources":["../../../src/config/getEnvConfig.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,gCAAgC;AAChC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,QAAQ,EAAE,CAAC;SACR,IAAI,CAAC,C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