elseware-nodejs 1.11.2 → 1.11.4
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 +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -10,12 +10,12 @@ import { SignOptions, JwtPayload } from 'jsonwebtoken';
|
|
|
10
10
|
|
|
11
11
|
declare const DEFAULT_ALLOWED_ORIGINS: string[];
|
|
12
12
|
|
|
13
|
-
interface LoadEnvOptions<TSchema extends ZodTypeAny,
|
|
13
|
+
interface LoadEnvOptions<TSchema extends ZodTypeAny, TOutput = infer<TSchema>> {
|
|
14
14
|
schema: TSchema;
|
|
15
|
-
transform?: (env: infer<TSchema>) =>
|
|
15
|
+
transform?: (env: infer<TSchema>) => TOutput;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
declare function loadEnv<TSchema extends ZodTypeAny,
|
|
18
|
+
declare function loadEnv<TSchema extends ZodTypeAny, TOutput = infer<TSchema>>(options: LoadEnvOptions<TSchema, TOutput>): TOutput;
|
|
19
19
|
|
|
20
20
|
interface AppErrorOptions {
|
|
21
21
|
code?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -10,12 +10,12 @@ import { SignOptions, JwtPayload } from 'jsonwebtoken';
|
|
|
10
10
|
|
|
11
11
|
declare const DEFAULT_ALLOWED_ORIGINS: string[];
|
|
12
12
|
|
|
13
|
-
interface LoadEnvOptions<TSchema extends ZodTypeAny,
|
|
13
|
+
interface LoadEnvOptions<TSchema extends ZodTypeAny, TOutput = infer<TSchema>> {
|
|
14
14
|
schema: TSchema;
|
|
15
|
-
transform?: (env: infer<TSchema>) =>
|
|
15
|
+
transform?: (env: infer<TSchema>) => TOutput;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
declare function loadEnv<TSchema extends ZodTypeAny,
|
|
18
|
+
declare function loadEnv<TSchema extends ZodTypeAny, TOutput = infer<TSchema>>(options: LoadEnvOptions<TSchema, TOutput>): TOutput;
|
|
19
19
|
|
|
20
20
|
interface AppErrorOptions {
|
|
21
21
|
code?: string;
|
package/dist/index.js
CHANGED
|
@@ -128,7 +128,7 @@ function loadEnv(options) {
|
|
|
128
128
|
function handleValidationError(error) {
|
|
129
129
|
logger.error("Environment validation failed");
|
|
130
130
|
const grouped = {};
|
|
131
|
-
error.issues
|
|
131
|
+
for (const issue of error.issues) {
|
|
132
132
|
const key = issue.path.join(".") || "unknown";
|
|
133
133
|
const rawValue = key !== "unknown" ? process.env[key] : void 0;
|
|
134
134
|
const safeValue = key.toLowerCase().includes("secret") ? "***" : rawValue;
|
|
@@ -139,7 +139,7 @@ function handleValidationError(error) {
|
|
|
139
139
|
].filter(Boolean).join(" | ");
|
|
140
140
|
grouped[key] ??= [];
|
|
141
141
|
grouped[key].push(message);
|
|
142
|
-
}
|
|
142
|
+
}
|
|
143
143
|
Object.entries(grouped).forEach(([key, messages]) => {
|
|
144
144
|
logger.error(`ENV: ${key}`);
|
|
145
145
|
messages.forEach((message) => logger.error(` - ${message}`));
|