@e-n-v/env 0.0.5 → 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 (108) hide show
  1. package/dist/{BooleanMap-DmFnCA-O.d.ts → BooleanMap-BPQuO3Ae.d.ts} +1 -3
  2. package/dist/{BooleanMap-B2eIP3tZ.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/{StringEnvVarSchema-B8MT7htU.d.ts → StringEnvVarSchema-D9Jr1Aws.d.cts} +5 -3
  12. package/dist/{StringEnvVarSchema-BF6C0nyT.d.cts → StringEnvVarSchema-D9Jr1Aws.d.ts} +5 -3
  13. package/dist/channels.cjs +3 -4
  14. package/dist/channels.d.cts +3 -4
  15. package/dist/channels.d.ts +3 -4
  16. package/dist/channels.js +2 -4
  17. package/dist/cli.cjs +10 -23
  18. package/dist/cli.d.cts +1 -1
  19. package/dist/cli.d.ts +1 -1
  20. package/dist/cli.js +7 -13
  21. package/dist/core.cjs +13 -14
  22. package/dist/core.d.cts +147 -6
  23. package/dist/core.d.ts +147 -6
  24. package/dist/core.js +9 -11
  25. package/dist/{custom-Bt_wnxIu.js → custom-Bd-jLg80.js} +3 -12
  26. package/dist/{custom-D_Rqjm09.cjs → custom-Dyb9TnER.cjs} +48 -58
  27. package/dist/files.cjs +6 -6
  28. package/dist/files.d.cts +2 -2
  29. package/dist/files.d.ts +2 -2
  30. package/dist/files.js +2 -5
  31. package/dist/{parse-DwtLpVhC.d.ts → index-B2eNij2x.d.cts} +1 -2
  32. package/dist/{parse-BT1QSa5e.d.cts → index-BHTM8nxS.d.ts} +1 -2
  33. package/dist/{prompt-yKdccbtZ.d.ts → index-BKBW9Dxs.d.cts} +3 -4
  34. package/dist/{prompt-C5WudV9x.d.cts → index-CEyOIRdj.d.ts} +3 -4
  35. package/dist/{EnvModel-CrGclUpJ.d.cts → index-Cb0abjLf.d.ts} +59 -7
  36. package/dist/{EnvModel-D8rt0EJ6.d.ts → index-Cz3frUwZ.d.cts} +58 -6
  37. package/dist/index.cjs +33 -0
  38. package/dist/index.d.cts +19 -0
  39. package/dist/index.d.ts +19 -0
  40. package/dist/index.js +15 -0
  41. package/dist/model.cjs +10 -11
  42. package/dist/model.d.cts +2 -35
  43. package/dist/model.d.ts +2 -35
  44. package/dist/model.js +2 -6
  45. package/dist/parse.cjs +14 -14
  46. package/dist/parse.d.cts +5 -8
  47. package/dist/parse.d.ts +5 -8
  48. package/dist/parse.js +4 -7
  49. package/dist/preprocessors-BKuIcZa1.d.ts +83 -0
  50. package/dist/preprocessors-DFVyF0c7.d.cts +83 -0
  51. package/dist/prompt.cjs +12 -15
  52. package/dist/prompt.d.cts +5 -10
  53. package/dist/prompt.d.ts +5 -10
  54. package/dist/prompt.js +3 -9
  55. package/dist/{redis-EcC7TX3K.cjs → redis-CyTF0SYT.cjs} +321 -253
  56. package/dist/{redis-CJOpRPjc.js → redis-D18f4ztf.js} +76 -37
  57. package/dist/{index-Dq_0aeAL.d.ts → redis-DsW-Vkwq.d.cts} +26 -6
  58. package/dist/{index-D8pslhp4.d.cts → redis-tRD4nAy_.d.ts} +26 -6
  59. package/dist/{resolveChannel-v9BDsw-M.js → resolveChannel-D1Fzl4TL.js} +59 -63
  60. package/dist/{resolveChannel-CjAuxy3p.cjs → resolveChannel-DxZNYdDe.cjs} +84 -92
  61. package/dist/{chunk-pbleEpgJ.cjs → rolldown-runtime-C0BPl7ul.cjs} +15 -16
  62. package/dist/{chunk-Bp6m_JJh.js → rolldown-runtime-D7D4PA-g.js} +4 -4
  63. package/dist/{schema-jN4EtvEP.d.ts → schema-B-JLVS42.d.ts} +1 -3
  64. package/dist/{schema-DH4GiW9A.d.cts → schema-B1i83alz.d.cts} +1 -3
  65. package/dist/schema-CtP5lpU1.js +11 -0
  66. package/dist/schema-D9nJKipf.cjs +22 -0
  67. package/dist/schemas/zod.cjs +112 -359
  68. package/dist/schemas/zod.d.cts +117 -87
  69. package/dist/schemas/zod.d.ts +117 -87
  70. package/dist/schemas/zod.js +116 -377
  71. package/dist/schemas.cjs +152 -133
  72. package/dist/schemas.d.cts +2 -3
  73. package/dist/schemas.d.ts +2 -3
  74. package/dist/schemas.js +2 -6
  75. package/dist/{src-Cjo2XA4n.cjs → src-5GYFbR9n.cjs} +21 -25
  76. package/dist/{src-BBwjK5SK.js → src-8rEOvFG5.js} +11 -15
  77. package/dist/{src-Dtv7TlJx.js → src-CdzAzdq-.js} +100 -114
  78. package/dist/{src-CLTURaoo.js → src-Cg49gGJb.js} +18 -44
  79. package/dist/{src-DWYoqPX1.cjs → src-CttkcdpE.cjs} +114 -133
  80. package/dist/{src-XjL5cyPG.cjs → src-D5KzIEH_.cjs} +130 -107
  81. package/dist/src-DB0Har0j.cjs +1632 -0
  82. package/dist/{src-CVdUqK3q.js → src-DWc-WWjX.js} +107 -86
  83. package/dist/{src-B7FG1rak.js → src-DvUBRBe3.js} +205 -116
  84. package/dist/{src-meUnCASg.cjs → src-TZx_e95f.cjs} +87 -132
  85. package/dist/{vars-BNVI6k89.d.ts → vars-DtzGL5Nc.d.cts} +1 -4
  86. package/dist/{vars-CptZRPX5.d.cts → vars-obKYxaSu.d.ts} +1 -4
  87. package/dist/vars.cjs +175 -138
  88. package/dist/vars.d.cts +3 -7
  89. package/dist/vars.d.ts +3 -7
  90. package/dist/vars.js +21 -9
  91. package/package.json +9 -8
  92. package/dist/EnvChannelOptions-BPkWDrmr.d.cts +0 -108
  93. package/dist/EnvChannelOptions-CRwDLWjd.d.ts +0 -108
  94. package/dist/coerce-DNIuYAx4.js +0 -11028
  95. package/dist/coerce-b7UVodS9.cjs +0 -12365
  96. package/dist/model-Dic8IJsf.d.ts +0 -29
  97. package/dist/model-ft0WhSSS.d.cts +0 -29
  98. package/dist/root.cjs +0 -36
  99. package/dist/root.d.cts +0 -21
  100. package/dist/root.d.ts +0 -21
  101. package/dist/root.js +0 -21
  102. package/dist/src-DZmpNGrQ.cjs +0 -1411
  103. package/dist/validate-BxA3a-ns.d.cts +0 -203
  104. package/dist/validate-CyxrRacF.d.ts +0 -203
  105. package/dist/vars-CYOaskkK.cjs +0 -27
  106. package/dist/vars-DOW0LiiN.js +0 -22
  107. /package/dist/{EnvChannel-LMIRYvT1.d.cts → EnvChannel-CfSwa_25.d.cts} +0 -0
  108. /package/dist/{EnvChannel-w27PEm7x.d.ts → EnvChannel-CfSwa_25.d.ts} +0 -0
@@ -1,203 +0,0 @@
1
- import { d as EnvVarType, f as Processor } from "./StringEnvVarSchema-BF6C0nyT.cjs";
2
- import { n as Preprocessor, t as BooleanMap } from "./BooleanMap-B2eIP3tZ.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
- process?: Processor<T>;
11
- }
12
- //#endregion
13
- //#region ../core/src/processing/types/Check.d.ts
14
- /**
15
- * Check type definition.
16
- * A check returns an array of requirement strings if the check fails, or an empty array if valid.
17
- */
18
- type Check<T> = (value: T) => string[];
19
- //#endregion
20
- //#region ../core/src/processing/processors/typed/string.d.ts
21
- /**
22
- * String processor with optional validation checks.
23
- * This is the primary string processor - the base stringProcessor() calls this with no checks.
24
- */
25
- declare function string(...checks: Array<Check<string>>): Processor<string>;
26
- //#endregion
27
- //#region ../core/src/processing/processors/typed/number.d.ts
28
- /**
29
- * Number processor with optional validation checks.
30
- * This is the primary number processor - the base numberProcessor() calls this with no checks.
31
- */
32
- declare function number(...checks: Array<Check<number>>): Processor<number>;
33
- //#endregion
34
- //#region ../core/src/processing/processors/typed/boolean.d.ts
35
- /**
36
- * Boolean processor.
37
- * This is the primary boolean processor - the base booleanProcessor() calls this.
38
- */
39
- declare function boolean(): Processor<boolean>;
40
- //#endregion
41
- //#region ../core/src/processing/processors/typed/enumeration.d.ts
42
- /**
43
- * Enum processor with optional validation checks.
44
- * This is the primary enum processor - the base enumProcessor() calls this with no checks.
45
- */
46
- declare function enumeration(allowedValues: readonly string[], ...checks: Array<Check<string>>): Processor<string>;
47
- //#endregion
48
- //#region ../core/src/processing/processors/processors.d.ts
49
- /**
50
- * Default processors for environment variable types.
51
- * Each processor factory returns a function that takes a value and returns T | undefined.
52
- * Returns undefined for empty/null values, throws descriptive errors for invalid values.
53
- */
54
- declare const processors: {
55
- readonly boolean: typeof boolean;
56
- readonly enum: typeof enumeration;
57
- readonly number: typeof number;
58
- readonly string: typeof string;
59
- };
60
- //#endregion
61
- //#region ../core/src/processing/preprocessors/preprocessors.d.ts
62
- /**
63
- * Default preprocessors map for each environment variable type
64
- */
65
- declare const preprocessors: {
66
- readonly boolean: (options?: BooleanMap) => Preprocessor<boolean>;
67
- readonly enum: () => Preprocessor<string>;
68
- readonly number: () => Preprocessor<number>;
69
- readonly string: () => Preprocessor<string>;
70
- };
71
- //#endregion
72
- //#region ../core/src/processing/options/PreprocessorOptions.d.ts
73
- type PreprocessorOptions = Partial<{
74
- /**
75
- * Custom string preprocessing function
76
- * Receives the string value and should return a string value
77
- * @param value - The raw string value from the environment variable
78
- * @returns Preprocessed string value
79
- */
80
- string?: Preprocessor<string> | boolean;
81
- /**
82
- * Custom number preprocessing function
83
- * Receives the string value and should return a string or the target number type
84
- * @param value - The raw string value from the environment variable
85
- * @returns Preprocessed string or number value
86
- */
87
- number?: Preprocessor<number> | boolean;
88
- /**
89
- * Custom boolean preprocessing function
90
- * Receives the string value and should return a string or the target boolean type
91
- * @param value - The raw string value from the environment variable
92
- * @returns Preprocessed string or boolean value
93
- */
94
- boolean?: boolean | Preprocessor<boolean> | BooleanMap;
95
- /**
96
- * Custom enum preprocessing function
97
- * Receives the string value and should return a string value
98
- * @param value - The raw string value from the environment variable
99
- * @returns Preprocessed string value
100
- */
101
- enum?: Preprocessor<string> | boolean;
102
- }>;
103
- //#endregion
104
- //#region ../core/src/processing/preprocessors/resolvePreprocessor.d.ts
105
- type DefaultPreprocessor<T extends EnvVarType> = T extends "number" ? Preprocessor<number> : T extends "boolean" ? Preprocessor<boolean> : Preprocessor<string>;
106
- /**
107
- * Resolve the effective preprocessor for a given environment variable type.
108
- * Respects custom overrides and falls back to built-in defaults (number, boolean).
109
- */
110
- declare function resolvePreprocessor<T extends EnvVarType>(envVarType: T, preprocessorOptions?: PreprocessorOptions): DefaultPreprocessor<T> | undefined;
111
- //#endregion
112
- //#region ../core/src/processing/checks/minLength.d.ts
113
- /**
114
- * String check: minimum length.
115
- */
116
- declare function minLength(min: number, trait?: string): Check<string>;
117
- //#endregion
118
- //#region ../core/src/processing/checks/maxLength.d.ts
119
- /**
120
- * String check: maximum length.
121
- */
122
- declare function maxLength(max: number, trait?: string): Check<string>;
123
- //#endregion
124
- //#region ../core/src/processing/checks/lengthBetween.d.ts
125
- /**
126
- * String check: length within a range.
127
- */
128
- declare function lengthBetween(min: number, max: number, trait?: string): Check<string>;
129
- //#endregion
130
- //#region ../core/src/processing/checks/exactLength.d.ts
131
- /**
132
- * String check: exact length.
133
- */
134
- declare function exactLength(length: number, trait?: string): Check<string>;
135
- //#endregion
136
- //#region ../core/src/processing/checks/pattern.d.ts
137
- /**
138
- * String check: regex pattern match.
139
- */
140
- declare function pattern(regex: RegExp, trait: string | readonly string[]): Check<string>;
141
- //#endregion
142
- //#region ../core/src/processing/checks/url.d.ts
143
- /**
144
- * String check: valid URL.
145
- */
146
- declare function url(trait?: string): Check<string>;
147
- //#endregion
148
- //#region ../core/src/processing/checks/oneOf.d.ts
149
- /**
150
- * String check: value must be one of the provided values.
151
- */
152
- declare function oneOf<T extends string>(values: readonly T[], trait?: string): Check<string>;
153
- //#endregion
154
- //#region ../core/src/processing/checks/integer.d.ts
155
- /**
156
- * Number check: must be an integer.
157
- */
158
- declare function integer(trait?: string): Check<number>;
159
- //#endregion
160
- //#region ../core/src/processing/checks/min.d.ts
161
- /**
162
- * Number check: minimum value.
163
- */
164
- declare function min(minimum: number, trait?: string): Check<number>;
165
- //#endregion
166
- //#region ../core/src/processing/checks/max.d.ts
167
- /**
168
- * Number check: maximum value.
169
- */
170
- declare function max(maximum: number, trait?: string): Check<number>;
171
- //#endregion
172
- //#region ../core/src/processing/checks/between.d.ts
173
- /**
174
- * Number check: value within a range.
175
- */
176
- declare function between(minimum: number, maximum: number, trait?: string): Check<number>;
177
- //#endregion
178
- //#region ../core/src/processing/checks/custom.d.ts
179
- /**
180
- * Custom check with user-defined validation function.
181
- * Can return multiple traits.
182
- */
183
- declare function custom<T>(fn: (value: T) => boolean, ...traits: string[]): Check<T>;
184
- //#endregion
185
- //#region ../core/src/processing/helpers/toList.d.ts
186
- /**
187
- * Convert array of items to natural language list.
188
- * Examples:
189
- * - [] => ""
190
- * - ["one"] => "one"
191
- * - ["one", "two"] => "one and two"
192
- * - ["one", "two", "three"] => "one, two, and three"
193
- */
194
- declare function toList(items: string[]): string;
195
- //#endregion
196
- //#region ../core/src/processing/helpers/validate.d.ts
197
- /**
198
- * Run checks and aggregate errors.
199
- * Throws an error with all validation requirements if any check fails.
200
- */
201
- declare function validate<T>(value: T, checks: Array<Check<T>>): T;
202
- //#endregion
203
- 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,203 +0,0 @@
1
- import { d as EnvVarType, f as Processor } from "./StringEnvVarSchema-B8MT7htU.js";
2
- import { n as Preprocessor, t as BooleanMap } from "./BooleanMap-DmFnCA-O.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
- process?: Processor<T>;
11
- }
12
- //#endregion
13
- //#region ../core/src/processing/types/Check.d.ts
14
- /**
15
- * Check type definition.
16
- * A check returns an array of requirement strings if the check fails, or an empty array if valid.
17
- */
18
- type Check<T> = (value: T) => string[];
19
- //#endregion
20
- //#region ../core/src/processing/processors/typed/string.d.ts
21
- /**
22
- * String processor with optional validation checks.
23
- * This is the primary string processor - the base stringProcessor() calls this with no checks.
24
- */
25
- declare function string(...checks: Array<Check<string>>): Processor<string>;
26
- //#endregion
27
- //#region ../core/src/processing/processors/typed/number.d.ts
28
- /**
29
- * Number processor with optional validation checks.
30
- * This is the primary number processor - the base numberProcessor() calls this with no checks.
31
- */
32
- declare function number(...checks: Array<Check<number>>): Processor<number>;
33
- //#endregion
34
- //#region ../core/src/processing/processors/typed/boolean.d.ts
35
- /**
36
- * Boolean processor.
37
- * This is the primary boolean processor - the base booleanProcessor() calls this.
38
- */
39
- declare function boolean(): Processor<boolean>;
40
- //#endregion
41
- //#region ../core/src/processing/processors/typed/enumeration.d.ts
42
- /**
43
- * Enum processor with optional validation checks.
44
- * This is the primary enum processor - the base enumProcessor() calls this with no checks.
45
- */
46
- declare function enumeration(allowedValues: readonly string[], ...checks: Array<Check<string>>): Processor<string>;
47
- //#endregion
48
- //#region ../core/src/processing/processors/processors.d.ts
49
- /**
50
- * Default processors for environment variable types.
51
- * Each processor factory returns a function that takes a value and returns T | undefined.
52
- * Returns undefined for empty/null values, throws descriptive errors for invalid values.
53
- */
54
- declare const processors: {
55
- readonly boolean: typeof boolean;
56
- readonly enum: typeof enumeration;
57
- readonly number: typeof number;
58
- readonly string: typeof string;
59
- };
60
- //#endregion
61
- //#region ../core/src/processing/preprocessors/preprocessors.d.ts
62
- /**
63
- * Default preprocessors map for each environment variable type
64
- */
65
- declare const preprocessors: {
66
- readonly boolean: (options?: BooleanMap) => Preprocessor<boolean>;
67
- readonly enum: () => Preprocessor<string>;
68
- readonly number: () => Preprocessor<number>;
69
- readonly string: () => Preprocessor<string>;
70
- };
71
- //#endregion
72
- //#region ../core/src/processing/options/PreprocessorOptions.d.ts
73
- type PreprocessorOptions = Partial<{
74
- /**
75
- * Custom string preprocessing function
76
- * Receives the string value and should return a string value
77
- * @param value - The raw string value from the environment variable
78
- * @returns Preprocessed string value
79
- */
80
- string?: Preprocessor<string> | boolean;
81
- /**
82
- * Custom number preprocessing function
83
- * Receives the string value and should return a string or the target number type
84
- * @param value - The raw string value from the environment variable
85
- * @returns Preprocessed string or number value
86
- */
87
- number?: Preprocessor<number> | boolean;
88
- /**
89
- * Custom boolean preprocessing function
90
- * Receives the string value and should return a string or the target boolean type
91
- * @param value - The raw string value from the environment variable
92
- * @returns Preprocessed string or boolean value
93
- */
94
- boolean?: boolean | Preprocessor<boolean> | BooleanMap;
95
- /**
96
- * Custom enum preprocessing function
97
- * Receives the string value and should return a string value
98
- * @param value - The raw string value from the environment variable
99
- * @returns Preprocessed string value
100
- */
101
- enum?: Preprocessor<string> | boolean;
102
- }>;
103
- //#endregion
104
- //#region ../core/src/processing/preprocessors/resolvePreprocessor.d.ts
105
- type DefaultPreprocessor<T extends EnvVarType> = T extends "number" ? Preprocessor<number> : T extends "boolean" ? Preprocessor<boolean> : Preprocessor<string>;
106
- /**
107
- * Resolve the effective preprocessor for a given environment variable type.
108
- * Respects custom overrides and falls back to built-in defaults (number, boolean).
109
- */
110
- declare function resolvePreprocessor<T extends EnvVarType>(envVarType: T, preprocessorOptions?: PreprocessorOptions): DefaultPreprocessor<T> | undefined;
111
- //#endregion
112
- //#region ../core/src/processing/checks/minLength.d.ts
113
- /**
114
- * String check: minimum length.
115
- */
116
- declare function minLength(min: number, trait?: string): Check<string>;
117
- //#endregion
118
- //#region ../core/src/processing/checks/maxLength.d.ts
119
- /**
120
- * String check: maximum length.
121
- */
122
- declare function maxLength(max: number, trait?: string): Check<string>;
123
- //#endregion
124
- //#region ../core/src/processing/checks/lengthBetween.d.ts
125
- /**
126
- * String check: length within a range.
127
- */
128
- declare function lengthBetween(min: number, max: number, trait?: string): Check<string>;
129
- //#endregion
130
- //#region ../core/src/processing/checks/exactLength.d.ts
131
- /**
132
- * String check: exact length.
133
- */
134
- declare function exactLength(length: number, trait?: string): Check<string>;
135
- //#endregion
136
- //#region ../core/src/processing/checks/pattern.d.ts
137
- /**
138
- * String check: regex pattern match.
139
- */
140
- declare function pattern(regex: RegExp, trait: string | readonly string[]): Check<string>;
141
- //#endregion
142
- //#region ../core/src/processing/checks/url.d.ts
143
- /**
144
- * String check: valid URL.
145
- */
146
- declare function url(trait?: string): Check<string>;
147
- //#endregion
148
- //#region ../core/src/processing/checks/oneOf.d.ts
149
- /**
150
- * String check: value must be one of the provided values.
151
- */
152
- declare function oneOf<T extends string>(values: readonly T[], trait?: string): Check<string>;
153
- //#endregion
154
- //#region ../core/src/processing/checks/integer.d.ts
155
- /**
156
- * Number check: must be an integer.
157
- */
158
- declare function integer(trait?: string): Check<number>;
159
- //#endregion
160
- //#region ../core/src/processing/checks/min.d.ts
161
- /**
162
- * Number check: minimum value.
163
- */
164
- declare function min(minimum: number, trait?: string): Check<number>;
165
- //#endregion
166
- //#region ../core/src/processing/checks/max.d.ts
167
- /**
168
- * Number check: maximum value.
169
- */
170
- declare function max(maximum: number, trait?: string): Check<number>;
171
- //#endregion
172
- //#region ../core/src/processing/checks/between.d.ts
173
- /**
174
- * Number check: value within a range.
175
- */
176
- declare function between(minimum: number, maximum: number, trait?: string): Check<number>;
177
- //#endregion
178
- //#region ../core/src/processing/checks/custom.d.ts
179
- /**
180
- * Custom check with user-defined validation function.
181
- * Can return multiple traits.
182
- */
183
- declare function custom<T>(fn: (value: T) => boolean, ...traits: string[]): Check<T>;
184
- //#endregion
185
- //#region ../core/src/processing/helpers/toList.d.ts
186
- /**
187
- * Convert array of items to natural language list.
188
- * Examples:
189
- * - [] => ""
190
- * - ["one"] => "one"
191
- * - ["one", "two"] => "one and two"
192
- * - ["one", "two", "three"] => "one, two, and three"
193
- */
194
- declare function toList(items: string[]): string;
195
- //#endregion
196
- //#region ../core/src/processing/helpers/validate.d.ts
197
- /**
198
- * Run checks and aggregate errors.
199
- * Throws an error with all validation requirements if any check fails.
200
- */
201
- declare function validate<T>(value: T, checks: Array<Check<T>>): T;
202
- //#endregion
203
- 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-XjL5cyPG.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-CVdUqK3q.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 };