@e-n-v/env 0.0.7 → 0.0.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 (103) hide show
  1. package/dist/{BooleanMap-B7MeMkJC.d.ts → BooleanMap-BPQuO3Ae.d.ts} +1 -3
  2. package/dist/{BooleanMap-D93UJnv5.d.cts → BooleanMap-CX_YrPCf.d.cts} +1 -3
  3. package/dist/EnvChannelOptions-BbKeuO-o.d.cts +366 -0
  4. package/dist/EnvChannelOptions-BbKeuO-o.d.ts +366 -0
  5. package/dist/{EnvSource-DA3ZGlES.js → EnvSource-WAGWqRVM.js} +6 -10
  6. package/dist/{EnvSource-BVnmdHku.cjs → EnvSource-s8F_M_6O.cjs} +21 -28
  7. package/dist/EnvVarSchema-CDZGmnex.cjs +15 -0
  8. package/dist/EnvVarSchema-Dr6q7jf6.js +10 -0
  9. package/dist/{ProcessEnvChannel-Do4-yiLI.d.ts → ProcessEnvChannel-CwhV7_EB.d.ts} +2 -4
  10. package/dist/{ProcessEnvChannel-D465c-dp.d.cts → ProcessEnvChannel-DWHPZePe.d.cts} +2 -4
  11. package/dist/channels.cjs +3 -4
  12. package/dist/channels.d.cts +3 -4
  13. package/dist/channels.d.ts +3 -4
  14. package/dist/channels.js +2 -4
  15. package/dist/cli.cjs +10 -23
  16. package/dist/cli.d.cts +1 -1
  17. package/dist/cli.d.ts +1 -1
  18. package/dist/cli.js +7 -13
  19. package/dist/core.cjs +13 -14
  20. package/dist/core.d.cts +147 -6
  21. package/dist/core.d.ts +147 -6
  22. package/dist/core.js +9 -11
  23. package/dist/{custom-Bt_wnxIu.js → custom-Bd-jLg80.js} +3 -12
  24. package/dist/{custom-D_Rqjm09.cjs → custom-Dyb9TnER.cjs} +48 -58
  25. package/dist/files.cjs +6 -6
  26. package/dist/files.d.cts +2 -2
  27. package/dist/files.d.ts +2 -2
  28. package/dist/files.js +2 -5
  29. package/dist/{parse-awxwtQ1N.d.ts → index-B2eNij2x.d.cts} +1 -2
  30. package/dist/{parse-5fpTbjTr.d.cts → index-BHTM8nxS.d.ts} +1 -2
  31. package/dist/{prompt-DG8haZjn.d.ts → index-BKBW9Dxs.d.cts} +3 -4
  32. package/dist/{prompt-lmZdPaBh.d.cts → index-CEyOIRdj.d.ts} +3 -4
  33. package/dist/{EnvModel-BiT0OiDZ.d.ts → index-Cb0abjLf.d.ts} +59 -7
  34. package/dist/{EnvModel-I0fWZZ_n.d.cts → index-Cz3frUwZ.d.cts} +58 -6
  35. package/dist/index.cjs +27 -30
  36. package/dist/index.d.cts +11 -13
  37. package/dist/index.d.ts +11 -13
  38. package/dist/index.js +8 -14
  39. package/dist/model.cjs +10 -11
  40. package/dist/model.d.cts +2 -35
  41. package/dist/model.d.ts +2 -35
  42. package/dist/model.js +2 -6
  43. package/dist/parse.cjs +14 -14
  44. package/dist/parse.d.cts +5 -8
  45. package/dist/parse.d.ts +5 -8
  46. package/dist/parse.js +4 -7
  47. package/dist/preprocessors-BKuIcZa1.d.ts +83 -0
  48. package/dist/preprocessors-DFVyF0c7.d.cts +83 -0
  49. package/dist/prompt.cjs +12 -15
  50. package/dist/prompt.d.cts +5 -10
  51. package/dist/prompt.d.ts +5 -10
  52. package/dist/prompt.js +3 -9
  53. package/dist/{redis-Cazgs3_J.cjs → redis-CyTF0SYT.cjs} +260 -268
  54. package/dist/{redis-DXhlNtvD.js → redis-D18f4ztf.js} +15 -22
  55. package/dist/{index-UQm0jdkG.d.cts → redis-DsW-Vkwq.d.cts} +2 -6
  56. package/dist/{index-ClKndmJv.d.ts → redis-tRD4nAy_.d.ts} +2 -6
  57. package/dist/{resolveChannel-v9BDsw-M.js → resolveChannel-D1Fzl4TL.js} +59 -63
  58. package/dist/{resolveChannel-CjAuxy3p.cjs → resolveChannel-DxZNYdDe.cjs} +84 -92
  59. package/dist/{chunk-pbleEpgJ.cjs → rolldown-runtime-C0BPl7ul.cjs} +15 -16
  60. package/dist/{chunk-Bp6m_JJh.js → rolldown-runtime-D7D4PA-g.js} +4 -4
  61. package/dist/{schema-DdDa3Qjy.d.cts → schema-B-JLVS42.d.ts} +1 -3
  62. package/dist/{schema-CHypJTDK.d.ts → schema-B1i83alz.d.cts} +1 -3
  63. package/dist/schema-CtP5lpU1.js +11 -0
  64. package/dist/schema-D9nJKipf.cjs +22 -0
  65. package/dist/schemas/zod.cjs +42 -340
  66. package/dist/schemas/zod.d.cts +112 -114
  67. package/dist/schemas/zod.d.ts +112 -114
  68. package/dist/schemas/zod.js +111 -401
  69. package/dist/schemas.cjs +152 -155
  70. package/dist/schemas.d.cts +1 -2
  71. package/dist/schemas.d.ts +1 -2
  72. package/dist/schemas.js +2 -6
  73. package/dist/{src-CdqOYilA.cjs → src-5GYFbR9n.cjs} +21 -24
  74. package/dist/{src-BrNrE0hX.js → src-8rEOvFG5.js} +11 -14
  75. package/dist/{src-DI-VW4dW.js → src-CdzAzdq-.js} +77 -110
  76. package/dist/{src-B5Qu-M-r.js → src-Cg49gGJb.js} +9 -43
  77. package/dist/{src-dO72HN6e.cjs → src-CttkcdpE.cjs} +90 -130
  78. package/dist/{src-PHSSk-t3.cjs → src-D5KzIEH_.cjs} +130 -110
  79. package/dist/{src-DVdOONrX.cjs → src-DB0Har0j.cjs} +911 -932
  80. package/dist/{src-DQaQ28lz.js → src-DWc-WWjX.js} +107 -89
  81. package/dist/{src-vBXlFkSP.js → src-DvUBRBe3.js} +115 -136
  82. package/dist/{src-DywfI0fM.cjs → src-TZx_e95f.cjs} +78 -131
  83. package/dist/{vars-DF9DoAF4.d.ts → vars-DtzGL5Nc.d.cts} +1 -4
  84. package/dist/{vars-KUgv2rti.d.cts → vars-obKYxaSu.d.ts} +1 -4
  85. package/dist/vars.cjs +175 -160
  86. package/dist/vars.d.cts +2 -6
  87. package/dist/vars.d.ts +2 -6
  88. package/dist/vars.js +21 -9
  89. package/package.json +3 -2
  90. package/dist/EnvChannelOptions-BPkWDrmr.d.cts +0 -108
  91. package/dist/EnvChannelOptions-CRwDLWjd.d.ts +0 -108
  92. package/dist/coerce-DNIuYAx4.js +0 -11028
  93. package/dist/coerce-b7UVodS9.cjs +0 -12365
  94. package/dist/model-BNDYMM9l.d.ts +0 -29
  95. package/dist/model-CJMnbGuS.d.cts +0 -29
  96. package/dist/validate-8HbVniNt.d.cts +0 -204
  97. package/dist/validate-CE8hQ5JG.d.ts +0 -204
  98. package/dist/vars-BHXXBiY1.cjs +0 -27
  99. package/dist/vars-FOuH_HuL.js +0 -22
  100. /package/dist/{EnvChannel-LMIRYvT1.d.cts → EnvChannel-CfSwa_25.d.cts} +0 -0
  101. /package/dist/{EnvChannel-w27PEm7x.d.ts → EnvChannel-CfSwa_25.d.ts} +0 -0
  102. /package/dist/{StringEnvVarSchema-BwSGgmeG.d.ts → StringEnvVarSchema-D9Jr1Aws.d.cts} +0 -0
  103. /package/dist/{StringEnvVarSchema-DnsZTIS0.d.cts → StringEnvVarSchema-D9Jr1Aws.d.ts} +0 -0
@@ -1,29 +0,0 @@
1
- import { a as SupportedSchema, n as EnvModelOptions, t as EnvModel } from "./EnvModel-BiT0OiDZ.js";
2
-
3
- //#region ../models/src/model.d.ts
4
-
5
- /**
6
- * Create an environment variable model
7
- *
8
- * Sugar utility for creating EnvModel instances with full type inference
9
- *
10
- * @param options - Model options
11
- * @returns EnvModel instance with inferred types
12
- *
13
- * @example
14
- * ```typescript
15
- * import { define, s } from "@e-n-v/models";
16
- *
17
- * export default define({
18
- * schemas: {
19
- * PORT: s.number({ default: 3000 }),
20
- * DATABASE_URL: s.string(),
21
- * DEBUG: s.boolean({ default: false })
22
- * },
23
- * preprocess: true
24
- * });
25
- * ```
26
- */
27
- declare function define<T extends Record<string, SupportedSchema>>(options: EnvModelOptions<T>): EnvModel<T>;
28
- //#endregion
29
- export { define as t };
@@ -1,29 +0,0 @@
1
- import { a as SupportedSchema, n as EnvModelOptions, t as EnvModel } from "./EnvModel-I0fWZZ_n.cjs";
2
-
3
- //#region ../models/src/model.d.ts
4
-
5
- /**
6
- * Create an environment variable model
7
- *
8
- * Sugar utility for creating EnvModel instances with full type inference
9
- *
10
- * @param options - Model options
11
- * @returns EnvModel instance with inferred types
12
- *
13
- * @example
14
- * ```typescript
15
- * import { define, s } from "@e-n-v/models";
16
- *
17
- * export default define({
18
- * schemas: {
19
- * PORT: s.number({ default: 3000 }),
20
- * DATABASE_URL: s.string(),
21
- * DEBUG: s.boolean({ default: false })
22
- * },
23
- * preprocess: true
24
- * });
25
- * ```
26
- */
27
- declare function define<T extends Record<string, SupportedSchema>>(options: EnvModelOptions<T>): EnvModel<T>;
28
- //#endregion
29
- export { define as t };
@@ -1,204 +0,0 @@
1
- import { d as EnvVarType, f as Processor } from "./StringEnvVarSchema-DnsZTIS0.cjs";
2
- import { n as Preprocessor, t as BooleanMap } from "./BooleanMap-D93UJnv5.cjs";
3
-
4
- //#region ../core/src/schemas/EnvVarSchemaDetails.d.ts
5
- interface EnvVarSchemaDetails<T> {
6
- type: EnvVarType;
7
- required: boolean;
8
- default?: T;
9
- description?: string;
10
- link?: string;
11
- process?: Processor<T>;
12
- }
13
- //#endregion
14
- //#region ../core/src/processing/types/Check.d.ts
15
- /**
16
- * Check type definition.
17
- * A check returns an array of requirement strings if the check fails, or an empty array if valid.
18
- */
19
- type Check<T> = (value: T) => string[];
20
- //#endregion
21
- //#region ../core/src/processing/processors/typed/string.d.ts
22
- /**
23
- * String processor with optional validation checks.
24
- * This is the primary string processor - the base stringProcessor() calls this with no checks.
25
- */
26
- declare function string(...checks: Array<Check<string>>): Processor<string>;
27
- //#endregion
28
- //#region ../core/src/processing/processors/typed/number.d.ts
29
- /**
30
- * Number processor with optional validation checks.
31
- * This is the primary number processor - the base numberProcessor() calls this with no checks.
32
- */
33
- declare function number(...checks: Array<Check<number>>): Processor<number>;
34
- //#endregion
35
- //#region ../core/src/processing/processors/typed/boolean.d.ts
36
- /**
37
- * Boolean processor.
38
- * This is the primary boolean processor - the base booleanProcessor() calls this.
39
- */
40
- declare function boolean(): Processor<boolean>;
41
- //#endregion
42
- //#region ../core/src/processing/processors/typed/enumeration.d.ts
43
- /**
44
- * Enum processor with optional validation checks.
45
- * This is the primary enum processor - the base enumProcessor() calls this with no checks.
46
- */
47
- declare function enumeration(allowedValues: readonly string[], ...checks: Array<Check<string>>): Processor<string>;
48
- //#endregion
49
- //#region ../core/src/processing/processors/processors.d.ts
50
- /**
51
- * Default processors for environment variable types.
52
- * Each processor factory returns a function that takes a value and returns T | undefined.
53
- * Returns undefined for empty/null values, throws descriptive errors for invalid values.
54
- */
55
- declare const processors: {
56
- readonly boolean: typeof boolean;
57
- readonly enum: typeof enumeration;
58
- readonly number: typeof number;
59
- readonly string: typeof string;
60
- };
61
- //#endregion
62
- //#region ../core/src/processing/preprocessors/preprocessors.d.ts
63
- /**
64
- * Default preprocessors map for each environment variable type
65
- */
66
- declare const preprocessors: {
67
- readonly boolean: (options?: BooleanMap) => Preprocessor<boolean>;
68
- readonly enum: () => Preprocessor<string>;
69
- readonly number: () => Preprocessor<number>;
70
- readonly string: () => Preprocessor<string>;
71
- };
72
- //#endregion
73
- //#region ../core/src/processing/options/PreprocessorOptions.d.ts
74
- type PreprocessorOptions = Partial<{
75
- /**
76
- * Custom string preprocessing function
77
- * Receives the string value and should return a string value
78
- * @param value - The raw string value from the environment variable
79
- * @returns Preprocessed string value
80
- */
81
- string?: Preprocessor<string> | boolean;
82
- /**
83
- * Custom number preprocessing function
84
- * Receives the string value and should return a string or the target number type
85
- * @param value - The raw string value from the environment variable
86
- * @returns Preprocessed string or number value
87
- */
88
- number?: Preprocessor<number> | boolean;
89
- /**
90
- * Custom boolean preprocessing function
91
- * Receives the string value and should return a string or the target boolean type
92
- * @param value - The raw string value from the environment variable
93
- * @returns Preprocessed string or boolean value
94
- */
95
- boolean?: boolean | Preprocessor<boolean> | BooleanMap;
96
- /**
97
- * Custom enum preprocessing function
98
- * Receives the string value and should return a string value
99
- * @param value - The raw string value from the environment variable
100
- * @returns Preprocessed string value
101
- */
102
- enum?: Preprocessor<string> | boolean;
103
- }>;
104
- //#endregion
105
- //#region ../core/src/processing/preprocessors/resolvePreprocessor.d.ts
106
- type DefaultPreprocessor<T extends EnvVarType> = T extends "number" ? Preprocessor<number> : T extends "boolean" ? Preprocessor<boolean> : Preprocessor<string>;
107
- /**
108
- * Resolve the effective preprocessor for a given environment variable type.
109
- * Respects custom overrides and falls back to built-in defaults (number, boolean).
110
- */
111
- declare function resolvePreprocessor<T extends EnvVarType>(envVarType: T, preprocessorOptions?: PreprocessorOptions): DefaultPreprocessor<T> | undefined;
112
- //#endregion
113
- //#region ../core/src/processing/checks/minLength.d.ts
114
- /**
115
- * String check: minimum length.
116
- */
117
- declare function minLength(min: number, trait?: string): Check<string>;
118
- //#endregion
119
- //#region ../core/src/processing/checks/maxLength.d.ts
120
- /**
121
- * String check: maximum length.
122
- */
123
- declare function maxLength(max: number, trait?: string): Check<string>;
124
- //#endregion
125
- //#region ../core/src/processing/checks/lengthBetween.d.ts
126
- /**
127
- * String check: length within a range.
128
- */
129
- declare function lengthBetween(min: number, max: number, trait?: string): Check<string>;
130
- //#endregion
131
- //#region ../core/src/processing/checks/exactLength.d.ts
132
- /**
133
- * String check: exact length.
134
- */
135
- declare function exactLength(length: number, trait?: string): Check<string>;
136
- //#endregion
137
- //#region ../core/src/processing/checks/pattern.d.ts
138
- /**
139
- * String check: regex pattern match.
140
- */
141
- declare function pattern(regex: RegExp, trait: string | readonly string[]): Check<string>;
142
- //#endregion
143
- //#region ../core/src/processing/checks/url.d.ts
144
- /**
145
- * String check: valid URL.
146
- */
147
- declare function url(trait?: string): Check<string>;
148
- //#endregion
149
- //#region ../core/src/processing/checks/oneOf.d.ts
150
- /**
151
- * String check: value must be one of the provided values.
152
- */
153
- declare function oneOf<T extends string>(values: readonly T[], trait?: string): Check<string>;
154
- //#endregion
155
- //#region ../core/src/processing/checks/integer.d.ts
156
- /**
157
- * Number check: must be an integer.
158
- */
159
- declare function integer(trait?: string): Check<number>;
160
- //#endregion
161
- //#region ../core/src/processing/checks/min.d.ts
162
- /**
163
- * Number check: minimum value.
164
- */
165
- declare function min(minimum: number, trait?: string): Check<number>;
166
- //#endregion
167
- //#region ../core/src/processing/checks/max.d.ts
168
- /**
169
- * Number check: maximum value.
170
- */
171
- declare function max(maximum: number, trait?: string): Check<number>;
172
- //#endregion
173
- //#region ../core/src/processing/checks/between.d.ts
174
- /**
175
- * Number check: value within a range.
176
- */
177
- declare function between(minimum: number, maximum: number, trait?: string): Check<number>;
178
- //#endregion
179
- //#region ../core/src/processing/checks/custom.d.ts
180
- /**
181
- * Custom check with user-defined validation function.
182
- * Can return multiple traits.
183
- */
184
- declare function custom<T>(fn: (value: T) => boolean, ...traits: string[]): Check<T>;
185
- //#endregion
186
- //#region ../core/src/processing/helpers/toList.d.ts
187
- /**
188
- * Convert array of items to natural language list.
189
- * Examples:
190
- * - [] => ""
191
- * - ["one"] => "one"
192
- * - ["one", "two"] => "one and two"
193
- * - ["one", "two", "three"] => "one, two, and three"
194
- */
195
- declare function toList(items: string[]): string;
196
- //#endregion
197
- //#region ../core/src/processing/helpers/validate.d.ts
198
- /**
199
- * Run checks and aggregate errors.
200
- * Throws an error with all validation requirements if any check fails.
201
- */
202
- declare function validate<T>(value: T, checks: Array<Check<T>>): T;
203
- //#endregion
204
- export { Check as C, string as S, preprocessors as _, max as a, boolean as b, oneOf as c, exactLength as d, lengthBetween as f, PreprocessorOptions as g, resolvePreprocessor as h, between as i, url as l, minLength as m, toList as n, min as o, maxLength as p, custom as r, integer as s, validate as t, pattern as u, processors as v, EnvVarSchemaDetails as w, number as x, enumeration as y };
@@ -1,204 +0,0 @@
1
- import { d as EnvVarType, f as Processor } from "./StringEnvVarSchema-BwSGgmeG.js";
2
- import { n as Preprocessor, t as BooleanMap } from "./BooleanMap-B7MeMkJC.js";
3
-
4
- //#region ../core/src/schemas/EnvVarSchemaDetails.d.ts
5
- interface EnvVarSchemaDetails<T> {
6
- type: EnvVarType;
7
- required: boolean;
8
- default?: T;
9
- description?: string;
10
- link?: string;
11
- process?: Processor<T>;
12
- }
13
- //#endregion
14
- //#region ../core/src/processing/types/Check.d.ts
15
- /**
16
- * Check type definition.
17
- * A check returns an array of requirement strings if the check fails, or an empty array if valid.
18
- */
19
- type Check<T> = (value: T) => string[];
20
- //#endregion
21
- //#region ../core/src/processing/processors/typed/string.d.ts
22
- /**
23
- * String processor with optional validation checks.
24
- * This is the primary string processor - the base stringProcessor() calls this with no checks.
25
- */
26
- declare function string(...checks: Array<Check<string>>): Processor<string>;
27
- //#endregion
28
- //#region ../core/src/processing/processors/typed/number.d.ts
29
- /**
30
- * Number processor with optional validation checks.
31
- * This is the primary number processor - the base numberProcessor() calls this with no checks.
32
- */
33
- declare function number(...checks: Array<Check<number>>): Processor<number>;
34
- //#endregion
35
- //#region ../core/src/processing/processors/typed/boolean.d.ts
36
- /**
37
- * Boolean processor.
38
- * This is the primary boolean processor - the base booleanProcessor() calls this.
39
- */
40
- declare function boolean(): Processor<boolean>;
41
- //#endregion
42
- //#region ../core/src/processing/processors/typed/enumeration.d.ts
43
- /**
44
- * Enum processor with optional validation checks.
45
- * This is the primary enum processor - the base enumProcessor() calls this with no checks.
46
- */
47
- declare function enumeration(allowedValues: readonly string[], ...checks: Array<Check<string>>): Processor<string>;
48
- //#endregion
49
- //#region ../core/src/processing/processors/processors.d.ts
50
- /**
51
- * Default processors for environment variable types.
52
- * Each processor factory returns a function that takes a value and returns T | undefined.
53
- * Returns undefined for empty/null values, throws descriptive errors for invalid values.
54
- */
55
- declare const processors: {
56
- readonly boolean: typeof boolean;
57
- readonly enum: typeof enumeration;
58
- readonly number: typeof number;
59
- readonly string: typeof string;
60
- };
61
- //#endregion
62
- //#region ../core/src/processing/preprocessors/preprocessors.d.ts
63
- /**
64
- * Default preprocessors map for each environment variable type
65
- */
66
- declare const preprocessors: {
67
- readonly boolean: (options?: BooleanMap) => Preprocessor<boolean>;
68
- readonly enum: () => Preprocessor<string>;
69
- readonly number: () => Preprocessor<number>;
70
- readonly string: () => Preprocessor<string>;
71
- };
72
- //#endregion
73
- //#region ../core/src/processing/options/PreprocessorOptions.d.ts
74
- type PreprocessorOptions = Partial<{
75
- /**
76
- * Custom string preprocessing function
77
- * Receives the string value and should return a string value
78
- * @param value - The raw string value from the environment variable
79
- * @returns Preprocessed string value
80
- */
81
- string?: Preprocessor<string> | boolean;
82
- /**
83
- * Custom number preprocessing function
84
- * Receives the string value and should return a string or the target number type
85
- * @param value - The raw string value from the environment variable
86
- * @returns Preprocessed string or number value
87
- */
88
- number?: Preprocessor<number> | boolean;
89
- /**
90
- * Custom boolean preprocessing function
91
- * Receives the string value and should return a string or the target boolean type
92
- * @param value - The raw string value from the environment variable
93
- * @returns Preprocessed string or boolean value
94
- */
95
- boolean?: boolean | Preprocessor<boolean> | BooleanMap;
96
- /**
97
- * Custom enum preprocessing function
98
- * Receives the string value and should return a string value
99
- * @param value - The raw string value from the environment variable
100
- * @returns Preprocessed string value
101
- */
102
- enum?: Preprocessor<string> | boolean;
103
- }>;
104
- //#endregion
105
- //#region ../core/src/processing/preprocessors/resolvePreprocessor.d.ts
106
- type DefaultPreprocessor<T extends EnvVarType> = T extends "number" ? Preprocessor<number> : T extends "boolean" ? Preprocessor<boolean> : Preprocessor<string>;
107
- /**
108
- * Resolve the effective preprocessor for a given environment variable type.
109
- * Respects custom overrides and falls back to built-in defaults (number, boolean).
110
- */
111
- declare function resolvePreprocessor<T extends EnvVarType>(envVarType: T, preprocessorOptions?: PreprocessorOptions): DefaultPreprocessor<T> | undefined;
112
- //#endregion
113
- //#region ../core/src/processing/checks/minLength.d.ts
114
- /**
115
- * String check: minimum length.
116
- */
117
- declare function minLength(min: number, trait?: string): Check<string>;
118
- //#endregion
119
- //#region ../core/src/processing/checks/maxLength.d.ts
120
- /**
121
- * String check: maximum length.
122
- */
123
- declare function maxLength(max: number, trait?: string): Check<string>;
124
- //#endregion
125
- //#region ../core/src/processing/checks/lengthBetween.d.ts
126
- /**
127
- * String check: length within a range.
128
- */
129
- declare function lengthBetween(min: number, max: number, trait?: string): Check<string>;
130
- //#endregion
131
- //#region ../core/src/processing/checks/exactLength.d.ts
132
- /**
133
- * String check: exact length.
134
- */
135
- declare function exactLength(length: number, trait?: string): Check<string>;
136
- //#endregion
137
- //#region ../core/src/processing/checks/pattern.d.ts
138
- /**
139
- * String check: regex pattern match.
140
- */
141
- declare function pattern(regex: RegExp, trait: string | readonly string[]): Check<string>;
142
- //#endregion
143
- //#region ../core/src/processing/checks/url.d.ts
144
- /**
145
- * String check: valid URL.
146
- */
147
- declare function url(trait?: string): Check<string>;
148
- //#endregion
149
- //#region ../core/src/processing/checks/oneOf.d.ts
150
- /**
151
- * String check: value must be one of the provided values.
152
- */
153
- declare function oneOf<T extends string>(values: readonly T[], trait?: string): Check<string>;
154
- //#endregion
155
- //#region ../core/src/processing/checks/integer.d.ts
156
- /**
157
- * Number check: must be an integer.
158
- */
159
- declare function integer(trait?: string): Check<number>;
160
- //#endregion
161
- //#region ../core/src/processing/checks/min.d.ts
162
- /**
163
- * Number check: minimum value.
164
- */
165
- declare function min(minimum: number, trait?: string): Check<number>;
166
- //#endregion
167
- //#region ../core/src/processing/checks/max.d.ts
168
- /**
169
- * Number check: maximum value.
170
- */
171
- declare function max(maximum: number, trait?: string): Check<number>;
172
- //#endregion
173
- //#region ../core/src/processing/checks/between.d.ts
174
- /**
175
- * Number check: value within a range.
176
- */
177
- declare function between(minimum: number, maximum: number, trait?: string): Check<number>;
178
- //#endregion
179
- //#region ../core/src/processing/checks/custom.d.ts
180
- /**
181
- * Custom check with user-defined validation function.
182
- * Can return multiple traits.
183
- */
184
- declare function custom<T>(fn: (value: T) => boolean, ...traits: string[]): Check<T>;
185
- //#endregion
186
- //#region ../core/src/processing/helpers/toList.d.ts
187
- /**
188
- * Convert array of items to natural language list.
189
- * Examples:
190
- * - [] => ""
191
- * - ["one"] => "one"
192
- * - ["one", "two"] => "one and two"
193
- * - ["one", "two", "three"] => "one, two, and three"
194
- */
195
- declare function toList(items: string[]): string;
196
- //#endregion
197
- //#region ../core/src/processing/helpers/validate.d.ts
198
- /**
199
- * Run checks and aggregate errors.
200
- * Throws an error with all validation requirements if any check fails.
201
- */
202
- declare function validate<T>(value: T, checks: Array<Check<T>>): T;
203
- //#endregion
204
- export { Check as C, string as S, preprocessors as _, max as a, boolean as b, oneOf as c, exactLength as d, lengthBetween as f, PreprocessorOptions as g, resolvePreprocessor as h, between as i, url as l, minLength as m, toList as n, min as o, maxLength as p, custom as r, integer as s, validate as t, pattern as u, processors as v, EnvVarSchemaDetails as w, number as x, enumeration as y };
@@ -1,27 +0,0 @@
1
- const require_src = require('./src-PHSSk-t3.cjs');
2
-
3
- //#region src/vars.ts
4
- /**
5
- * Sugar helper for creating environment variable models with predefined schemas
6
- *
7
- * @param schemas - Object containing environment variable schemas
8
- * @returns EnvModel instance with inferred types
9
- *
10
- * @example
11
- * ```typescript
12
- * import vars, { NODE_ENV, PORT } from "@e-n-v/env/vars";
13
- *
14
- * export default vars({ NODE_ENV, PORT });
15
- * ```
16
- */
17
- function vars(schemas) {
18
- return require_src.define({ schemas });
19
- }
20
-
21
- //#endregion
22
- Object.defineProperty(exports, 'vars', {
23
- enumerable: true,
24
- get: function () {
25
- return vars;
26
- }
27
- });
@@ -1,22 +0,0 @@
1
- import { t as define } from "./src-DQaQ28lz.js";
2
-
3
- //#region src/vars.ts
4
- /**
5
- * Sugar helper for creating environment variable models with predefined schemas
6
- *
7
- * @param schemas - Object containing environment variable schemas
8
- * @returns EnvModel instance with inferred types
9
- *
10
- * @example
11
- * ```typescript
12
- * import vars, { NODE_ENV, PORT } from "@e-n-v/env/vars";
13
- *
14
- * export default vars({ NODE_ENV, PORT });
15
- * ```
16
- */
17
- function vars(schemas) {
18
- return define({ schemas });
19
- }
20
-
21
- //#endregion
22
- export { vars as t };