node-env-resolver 4.0.0 → 5.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/README.md +289 -251
- package/dist/audit.d.cts +29 -0
- package/dist/audit.d.ts +8 -7
- package/dist/builder.cjs +1 -1
- package/dist/builder.d.cts +149 -0
- package/dist/builder.d.ts +17 -14
- package/dist/builder.js +1 -1
- package/dist/chunk-4YVXFL3I.cjs +9 -0
- package/dist/chunk-6FXCXA4R.cjs +11 -0
- package/dist/chunk-BFLXBLZ3.cjs +1 -0
- package/dist/chunk-BJ2QNYTS.js +11 -0
- package/dist/chunk-DIXI6MUB.js +9 -0
- package/dist/chunk-P3TTYVEW.js +16 -0
- package/dist/chunk-UCLEPPLS.cjs +16 -0
- package/dist/chunk-ZMRT37K3.js +1 -0
- package/dist/cli.d.cts +52 -0
- package/dist/cli.d.ts +9 -6
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +150 -0
- package/dist/index.d.ts +86 -77
- package/dist/index.js +1 -1
- package/dist/resolver.cjs +1 -1
- package/dist/resolver.d.cts +20 -0
- package/dist/resolver.d.ts +8 -5
- package/dist/resolver.js +1 -1
- package/dist/resolvers.cjs +1 -1
- package/dist/resolvers.d.cts +407 -0
- package/dist/resolvers.d.ts +289 -22
- package/dist/resolvers.js +1 -1
- package/dist/types.cjs +1 -1
- package/dist/types.d.cts +74 -0
- package/dist/types.d.ts +58 -172
- package/dist/types.js +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.d.cts +213 -0
- package/dist/utils.d.ts +28 -26
- package/dist/utils.js +1 -1
- package/dist/valibot.cjs +1 -1
- package/dist/valibot.d.cts +156 -0
- package/dist/valibot.d.ts +11 -8
- package/dist/valibot.js +1 -1
- package/dist/validation-types.d.cts +29 -0
- package/dist/validation-types.d.ts +4 -3
- package/dist/validators.cjs +2 -1
- package/dist/validators.d.cts +116 -0
- package/dist/validators.d.ts +46 -18
- package/dist/validators.js +2 -1
- package/dist/web.cjs +4 -4
- package/dist/web.d.cts +69 -0
- package/dist/web.d.ts +28 -10
- package/dist/web.js +4 -4
- package/dist/zod.cjs +1 -1
- package/dist/zod.d.cts +135 -0
- package/dist/zod.d.ts +11 -8
- package/dist/zod.js +1 -1
- package/package.json +7 -7
- package/dist/advanced-features.test.d.ts +0 -2
- package/dist/advanced-features.test.d.ts.map +0 -1
- package/dist/audit.d.ts.map +0 -1
- package/dist/audit.test.d.ts +0 -2
- package/dist/audit.test.d.ts.map +0 -1
- package/dist/builder.d.ts.map +0 -1
- package/dist/chunk-54OHKWZJ.js +0 -1
- package/dist/chunk-FCFDGYTF.cjs +0 -15
- package/dist/chunk-HCVTYYLE.js +0 -9
- package/dist/chunk-IU5TG3HL.js +0 -15
- package/dist/chunk-J7ZHEMRP.js +0 -9
- package/dist/chunk-NKPXKLF7.js +0 -1
- package/dist/chunk-P3ZWKKKW.cjs +0 -1
- package/dist/chunk-THFGEKYL.cjs +0 -9
- package/dist/chunk-ULL4WKTV.cjs +0 -9
- package/dist/chunk-XPGSWVRT.cjs +0 -1
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.test.d.ts +0 -2
- package/dist/cli.test.d.ts.map +0 -1
- package/dist/composition.test.d.ts +0 -7
- package/dist/composition.test.d.ts.map +0 -1
- package/dist/computed.test.d.ts +0 -2
- package/dist/computed.test.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.test.d.ts +0 -2
- package/dist/index.test.d.ts.map +0 -1
- package/dist/nested.test.d.ts +0 -2
- package/dist/nested.test.d.ts.map +0 -1
- package/dist/performance.test.d.ts +0 -7
- package/dist/performance.test.d.ts.map +0 -1
- package/dist/priority.test.d.ts +0 -6
- package/dist/priority.test.d.ts.map +0 -1
- package/dist/providers.d.ts +0 -11
- package/dist/providers.d.ts.map +0 -1
- package/dist/resolver.d.ts.map +0 -1
- package/dist/resolvers.d.ts.map +0 -1
- package/dist/resolvers.test.d.ts +0 -2
- package/dist/resolvers.test.d.ts.map +0 -1
- package/dist/sync-resolvers.test.d.ts +0 -2
- package/dist/sync-resolvers.test.d.ts.map +0 -1
- package/dist/type-inference.test.d.ts +0 -2
- package/dist/type-inference.test.d.ts.map +0 -1
- package/dist/type-override.test.d.ts +0 -2
- package/dist/type-override.test.d.ts.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/utils.d.ts.map +0 -1
- package/dist/utils.test.d.ts +0 -2
- package/dist/utils.test.d.ts.map +0 -1
- package/dist/valibot.d.ts.map +0 -1
- package/dist/validation-types.d.ts.map +0 -1
- package/dist/validators.d.ts.map +0 -1
- package/dist/web.d.ts.map +0 -1
- package/dist/zod.d.ts.map +0 -1
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
import { Resolver, SyncResolver, Validator } from './types.cjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Built-in resolvers for environment variable resolution
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
interface DotenvOptions {
|
|
8
|
+
path?: string;
|
|
9
|
+
expand?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare function dotenv(options?: string | DotenvOptions): Resolver;
|
|
12
|
+
declare function processEnv(): SyncResolver;
|
|
13
|
+
/**
|
|
14
|
+
* Load configuration from package.json
|
|
15
|
+
* Reads version, name, and config fields by default
|
|
16
|
+
*
|
|
17
|
+
* @param options Optional configuration
|
|
18
|
+
* @returns Resolver that loads from package.json
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* import { packageJson } from 'node-env-resolver/resolvers';
|
|
23
|
+
*
|
|
24
|
+
* // Loads: VERSION, NAME, CONFIG_* from package.json
|
|
25
|
+
* const config = await resolveAsync([
|
|
26
|
+
* packageJson(),
|
|
27
|
+
* { VERSION: string(), NAME: string() }
|
|
28
|
+
* ]);
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
declare function packageJson(options?: {
|
|
32
|
+
path?: string;
|
|
33
|
+
fields?: string[];
|
|
34
|
+
}): Resolver;
|
|
35
|
+
/**
|
|
36
|
+
* Load configuration from a remote HTTP/HTTPS endpoint
|
|
37
|
+
* Expects JSON response
|
|
38
|
+
*
|
|
39
|
+
* @param url URL to fetch config from
|
|
40
|
+
* @param options Optional fetch options
|
|
41
|
+
* @returns Resolver that loads from HTTP
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* import { http } from 'node-env-resolver/resolvers';
|
|
46
|
+
*
|
|
47
|
+
* // Fetch config from remote endpoint
|
|
48
|
+
* const config = await resolveAsync([
|
|
49
|
+
* http('https://config.example.com/app.json'),
|
|
50
|
+
* { PORT: 3000, API_KEY: string() }
|
|
51
|
+
* ]);
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
declare function http(url: string, options?: RequestInit & {
|
|
55
|
+
timeout?: number;
|
|
56
|
+
}): Resolver;
|
|
57
|
+
/**
|
|
58
|
+
* Load configuration from a JSON file
|
|
59
|
+
*
|
|
60
|
+
* @param path Path to JSON file (relative to cwd)
|
|
61
|
+
* @returns Resolver that loads from JSON file
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```ts
|
|
65
|
+
* import { resolve } from 'node-env-resolver';
|
|
66
|
+
* import { json } from 'node-env-resolver/resolvers';
|
|
67
|
+
*
|
|
68
|
+
* const config = await resolveAsync(
|
|
69
|
+
* [json('config.json'), { PORT: 3000 }]
|
|
70
|
+
* );
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
declare function json(path?: string): Resolver;
|
|
74
|
+
/**
|
|
75
|
+
* Load secrets from a directory (Docker secrets / Kubernetes mounted secrets)
|
|
76
|
+
* Each file in the directory becomes an environment variable (filename = key, content = value)
|
|
77
|
+
*
|
|
78
|
+
* @param path Path to secrets directory (relative to cwd)
|
|
79
|
+
* @returns Resolver that loads from secrets directory
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```ts
|
|
83
|
+
* import { resolve } from 'node-env-resolver';
|
|
84
|
+
* import { secrets } from 'node-env-resolver/resolvers';
|
|
85
|
+
*
|
|
86
|
+
* const config = await resolveAsync(
|
|
87
|
+
* [secrets('/run/secrets'), { DB_PASSWORD: string() }]
|
|
88
|
+
* );
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
declare function secrets(path?: string): Resolver;
|
|
92
|
+
/**
|
|
93
|
+
* YAML configuration file resolver interface
|
|
94
|
+
* Requires 'js-yaml' as a peer dependency (install separately for tree-shaking)
|
|
95
|
+
*/
|
|
96
|
+
interface YamlOptions {
|
|
97
|
+
path?: string;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Load configuration from a YAML file
|
|
101
|
+
* Requires 'js-yaml' package to be installed separately
|
|
102
|
+
*
|
|
103
|
+
* @param options Path string or options object
|
|
104
|
+
* @returns Resolver that loads from YAML file
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* ```ts
|
|
108
|
+
* import { resolve } from 'node-env-resolver';
|
|
109
|
+
* import { yaml } from 'node-env-resolver/resolvers';
|
|
110
|
+
*
|
|
111
|
+
* const config = await resolveAsync(
|
|
112
|
+
* [yaml('config.yaml'), { PORT: 3000 }]
|
|
113
|
+
* );
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
declare function yaml(options?: string | YamlOptions): Resolver;
|
|
117
|
+
/**
|
|
118
|
+
* TOML configuration file resolver interface
|
|
119
|
+
* Requires 'smol-toml' as a peer dependency (install separately for tree-shaking)
|
|
120
|
+
*/
|
|
121
|
+
interface TomlOptions {
|
|
122
|
+
path?: string;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Load configuration from a TOML file
|
|
126
|
+
* Requires 'smol-toml' package to be installed separately
|
|
127
|
+
*
|
|
128
|
+
* @param options Path string or options object
|
|
129
|
+
* @returns Resolver that loads from TOML file
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* ```ts
|
|
133
|
+
* import { resolve } from 'node-env-resolver';
|
|
134
|
+
* import { toml } from 'node-env-resolver/resolvers';
|
|
135
|
+
*
|
|
136
|
+
* const config = await resolveAsync(
|
|
137
|
+
* [toml('config.toml'), { PORT: 3000 }]
|
|
138
|
+
* );
|
|
139
|
+
* ```
|
|
140
|
+
*/
|
|
141
|
+
declare function toml(options?: string | TomlOptions): Resolver;
|
|
142
|
+
declare function string<Opts extends {
|
|
143
|
+
default?: string;
|
|
144
|
+
optional?: boolean;
|
|
145
|
+
min?: number;
|
|
146
|
+
max?: number;
|
|
147
|
+
allowEmpty?: boolean;
|
|
148
|
+
pattern?: string;
|
|
149
|
+
} = Record<string, never>>(opts?: Opts): Opts extends {
|
|
150
|
+
optional: true;
|
|
151
|
+
} ? Validator<string> & {
|
|
152
|
+
optional: true;
|
|
153
|
+
default?: Opts['default'];
|
|
154
|
+
} : Validator<string> & {
|
|
155
|
+
optional?: Opts['optional'];
|
|
156
|
+
default?: Opts['default'];
|
|
157
|
+
};
|
|
158
|
+
declare function number<Opts extends {
|
|
159
|
+
default?: number;
|
|
160
|
+
optional?: boolean;
|
|
161
|
+
min?: number;
|
|
162
|
+
max?: number;
|
|
163
|
+
} = Record<string, never>>(opts?: Opts): Opts extends {
|
|
164
|
+
optional: true;
|
|
165
|
+
} ? Validator<number> & {
|
|
166
|
+
optional: true;
|
|
167
|
+
default?: Opts['default'];
|
|
168
|
+
} : Validator<number> & {
|
|
169
|
+
optional?: Opts['optional'];
|
|
170
|
+
default?: Opts['default'];
|
|
171
|
+
};
|
|
172
|
+
declare function boolean<Opts extends {
|
|
173
|
+
default?: boolean;
|
|
174
|
+
optional?: boolean;
|
|
175
|
+
} = Record<string, never>>(opts?: Opts): Opts extends {
|
|
176
|
+
optional: true;
|
|
177
|
+
} ? Validator<boolean> & {
|
|
178
|
+
optional: true;
|
|
179
|
+
default?: Opts['default'];
|
|
180
|
+
} : Validator<boolean> & {
|
|
181
|
+
optional?: Opts['optional'];
|
|
182
|
+
default?: Opts['default'];
|
|
183
|
+
};
|
|
184
|
+
declare function url<Opts extends {
|
|
185
|
+
default?: string;
|
|
186
|
+
optional?: boolean;
|
|
187
|
+
} = Record<string, never>>(opts?: Opts): Opts extends {
|
|
188
|
+
optional: true;
|
|
189
|
+
} ? Validator<string> & {
|
|
190
|
+
optional: true;
|
|
191
|
+
default?: Opts['default'];
|
|
192
|
+
} : Validator<string> & {
|
|
193
|
+
optional?: Opts['optional'];
|
|
194
|
+
default?: Opts['default'];
|
|
195
|
+
};
|
|
196
|
+
declare function email<Opts extends {
|
|
197
|
+
default?: string;
|
|
198
|
+
optional?: boolean;
|
|
199
|
+
} = Record<string, never>>(opts?: Opts): Opts extends {
|
|
200
|
+
optional: true;
|
|
201
|
+
} ? Validator<string> & {
|
|
202
|
+
optional: true;
|
|
203
|
+
default?: Opts['default'];
|
|
204
|
+
} : Validator<string> & {
|
|
205
|
+
optional?: Opts['optional'];
|
|
206
|
+
default?: Opts['default'];
|
|
207
|
+
};
|
|
208
|
+
declare function port<Opts extends {
|
|
209
|
+
default?: number;
|
|
210
|
+
optional?: boolean;
|
|
211
|
+
} = Record<string, never>>(opts?: Opts): Opts extends {
|
|
212
|
+
optional: true;
|
|
213
|
+
} ? Validator<number> & {
|
|
214
|
+
optional: true;
|
|
215
|
+
default?: Opts['default'];
|
|
216
|
+
} : Validator<number> & {
|
|
217
|
+
optional?: Opts['optional'];
|
|
218
|
+
default?: Opts['default'];
|
|
219
|
+
};
|
|
220
|
+
declare function postgres<Opts extends {
|
|
221
|
+
default?: string;
|
|
222
|
+
optional?: boolean;
|
|
223
|
+
} = Record<string, never>>(opts?: Opts): Opts extends {
|
|
224
|
+
optional: true;
|
|
225
|
+
} ? Validator<string> & {
|
|
226
|
+
optional: true;
|
|
227
|
+
default?: Opts['default'];
|
|
228
|
+
} : Validator<string> & {
|
|
229
|
+
optional?: Opts['optional'];
|
|
230
|
+
default?: Opts['default'];
|
|
231
|
+
};
|
|
232
|
+
declare function mysql<Opts extends {
|
|
233
|
+
default?: string;
|
|
234
|
+
optional?: boolean;
|
|
235
|
+
} = Record<string, never>>(opts?: Opts): Opts extends {
|
|
236
|
+
optional: true;
|
|
237
|
+
} ? Validator<string> & {
|
|
238
|
+
optional: true;
|
|
239
|
+
default?: Opts['default'];
|
|
240
|
+
} : Validator<string> & {
|
|
241
|
+
optional?: Opts['optional'];
|
|
242
|
+
default?: Opts['default'];
|
|
243
|
+
};
|
|
244
|
+
declare function mongodb<Opts extends {
|
|
245
|
+
default?: string;
|
|
246
|
+
optional?: boolean;
|
|
247
|
+
} = Record<string, never>>(opts?: Opts): Opts extends {
|
|
248
|
+
optional: true;
|
|
249
|
+
} ? Validator<string> & {
|
|
250
|
+
optional: true;
|
|
251
|
+
default?: Opts['default'];
|
|
252
|
+
} : Validator<string> & {
|
|
253
|
+
optional?: Opts['optional'];
|
|
254
|
+
default?: Opts['default'];
|
|
255
|
+
};
|
|
256
|
+
declare function redis<Opts extends {
|
|
257
|
+
default?: string;
|
|
258
|
+
optional?: boolean;
|
|
259
|
+
} = Record<string, never>>(opts?: Opts): Opts extends {
|
|
260
|
+
optional: true;
|
|
261
|
+
} ? Validator<string> & {
|
|
262
|
+
optional: true;
|
|
263
|
+
default?: Opts['default'];
|
|
264
|
+
} : Validator<string> & {
|
|
265
|
+
optional?: Opts['optional'];
|
|
266
|
+
default?: Opts['default'];
|
|
267
|
+
};
|
|
268
|
+
declare function https<Opts extends {
|
|
269
|
+
default?: string;
|
|
270
|
+
optional?: boolean;
|
|
271
|
+
} = Record<string, never>>(opts?: Opts): Opts extends {
|
|
272
|
+
optional: true;
|
|
273
|
+
} ? Validator<string> & {
|
|
274
|
+
optional: true;
|
|
275
|
+
default?: Opts['default'];
|
|
276
|
+
} : Validator<string> & {
|
|
277
|
+
optional?: Opts['optional'];
|
|
278
|
+
default?: Opts['default'];
|
|
279
|
+
};
|
|
280
|
+
declare function stringArray<Opts extends {
|
|
281
|
+
default?: string[];
|
|
282
|
+
optional?: boolean;
|
|
283
|
+
separator?: string;
|
|
284
|
+
} = Record<string, never>>(opts?: Opts): Opts extends {
|
|
285
|
+
optional: true;
|
|
286
|
+
} ? Validator<string[]> & {
|
|
287
|
+
optional: true;
|
|
288
|
+
default?: Opts['default'];
|
|
289
|
+
} : Validator<string[]> & {
|
|
290
|
+
optional?: Opts['optional'];
|
|
291
|
+
default?: Opts['default'];
|
|
292
|
+
};
|
|
293
|
+
declare function numberArray<Opts extends {
|
|
294
|
+
default?: number[];
|
|
295
|
+
optional?: boolean;
|
|
296
|
+
separator?: string;
|
|
297
|
+
} = Record<string, never>>(opts?: Opts): Opts extends {
|
|
298
|
+
optional: true;
|
|
299
|
+
} ? Validator<number[]> & {
|
|
300
|
+
optional: true;
|
|
301
|
+
default?: Opts['default'];
|
|
302
|
+
} : Validator<number[]> & {
|
|
303
|
+
optional?: Opts['optional'];
|
|
304
|
+
default?: Opts['default'];
|
|
305
|
+
};
|
|
306
|
+
declare function urlArray<Opts extends {
|
|
307
|
+
default?: string[];
|
|
308
|
+
optional?: boolean;
|
|
309
|
+
separator?: string;
|
|
310
|
+
} = Record<string, never>>(opts?: Opts): Opts extends {
|
|
311
|
+
optional: true;
|
|
312
|
+
} ? Validator<string[]> & {
|
|
313
|
+
optional: true;
|
|
314
|
+
default?: Opts['default'];
|
|
315
|
+
} : Validator<string[]> & {
|
|
316
|
+
optional?: Opts['optional'];
|
|
317
|
+
default?: Opts['default'];
|
|
318
|
+
};
|
|
319
|
+
declare function enums<T extends readonly (string | number)[], Opts extends {
|
|
320
|
+
default?: T[number];
|
|
321
|
+
optional?: boolean;
|
|
322
|
+
} = Record<string, never>>(values: T, opts?: Opts): Opts extends {
|
|
323
|
+
optional: true;
|
|
324
|
+
} ? Validator<T[number]> & {
|
|
325
|
+
optional: true;
|
|
326
|
+
default?: Opts['default'];
|
|
327
|
+
} : Validator<T[number]> & {
|
|
328
|
+
optional?: Opts['optional'];
|
|
329
|
+
default?: Opts['default'];
|
|
330
|
+
};
|
|
331
|
+
declare function duration<Opts extends {
|
|
332
|
+
default?: number;
|
|
333
|
+
optional?: boolean;
|
|
334
|
+
} = Record<string, never>>(opts?: Opts): Opts extends {
|
|
335
|
+
optional: true;
|
|
336
|
+
} ? Validator<number> & {
|
|
337
|
+
optional: true;
|
|
338
|
+
default?: Opts['default'];
|
|
339
|
+
} : Validator<number> & {
|
|
340
|
+
optional?: Opts['optional'];
|
|
341
|
+
default?: Opts['default'];
|
|
342
|
+
};
|
|
343
|
+
declare function file<Opts extends {
|
|
344
|
+
default?: string;
|
|
345
|
+
optional?: boolean;
|
|
346
|
+
secretsDir?: string;
|
|
347
|
+
} = Record<string, never>>(opts?: Opts): Opts extends {
|
|
348
|
+
optional: true;
|
|
349
|
+
} ? Validator<string> & {
|
|
350
|
+
optional: true;
|
|
351
|
+
default?: Opts['default'];
|
|
352
|
+
secretsDir?: Opts['secretsDir'];
|
|
353
|
+
} : Validator<string> & {
|
|
354
|
+
optional?: Opts['optional'];
|
|
355
|
+
default?: Opts['default'];
|
|
356
|
+
secretsDir?: Opts['secretsDir'];
|
|
357
|
+
};
|
|
358
|
+
declare function secret<Opts extends {
|
|
359
|
+
default?: string;
|
|
360
|
+
optional?: boolean;
|
|
361
|
+
} = Record<string, never>>(opts?: Opts): Opts extends {
|
|
362
|
+
optional: true;
|
|
363
|
+
} ? Validator<string> & {
|
|
364
|
+
optional: true;
|
|
365
|
+
default?: Opts['default'];
|
|
366
|
+
} : Validator<string> & {
|
|
367
|
+
optional?: Opts['optional'];
|
|
368
|
+
default?: Opts['default'];
|
|
369
|
+
};
|
|
370
|
+
declare function custom<T = unknown, Opts extends {
|
|
371
|
+
default?: T;
|
|
372
|
+
optional?: boolean;
|
|
373
|
+
} = Record<string, never>>(validator: (value: string) => T, opts?: Opts): Opts extends {
|
|
374
|
+
optional: true;
|
|
375
|
+
} ? Validator<T> & {
|
|
376
|
+
optional: true;
|
|
377
|
+
default?: Opts['default'];
|
|
378
|
+
} : Validator<T> & {
|
|
379
|
+
optional?: Opts['optional'];
|
|
380
|
+
default?: Opts['default'];
|
|
381
|
+
};
|
|
382
|
+
declare function date<Opts extends {
|
|
383
|
+
default?: string;
|
|
384
|
+
optional?: boolean;
|
|
385
|
+
} = Record<string, never>>(opts?: Opts): Opts extends {
|
|
386
|
+
optional: true;
|
|
387
|
+
} ? Validator<string> & {
|
|
388
|
+
optional: true;
|
|
389
|
+
default?: Opts['default'];
|
|
390
|
+
} : Validator<string> & {
|
|
391
|
+
optional?: Opts['optional'];
|
|
392
|
+
default?: Opts['default'];
|
|
393
|
+
};
|
|
394
|
+
declare function timestamp<Opts extends {
|
|
395
|
+
default?: number;
|
|
396
|
+
optional?: boolean;
|
|
397
|
+
} = Record<string, never>>(opts?: Opts): Opts extends {
|
|
398
|
+
optional: true;
|
|
399
|
+
} ? Validator<number> & {
|
|
400
|
+
optional: true;
|
|
401
|
+
default?: Opts['default'];
|
|
402
|
+
} : Validator<number> & {
|
|
403
|
+
optional?: Opts['optional'];
|
|
404
|
+
default?: Opts['default'];
|
|
405
|
+
};
|
|
406
|
+
|
|
407
|
+
export { type DotenvOptions, type TomlOptions, type YamlOptions, boolean, custom, date, dotenv, duration, email, enums, file, http, https, json, mongodb, mysql, number, numberArray, packageJson, port, postgres, processEnv, redis, secret, secrets, string, stringArray, timestamp, toml, url, urlArray, yaml };
|