Skip to content

Commit

Permalink
Merge branch 'add-unit-tests' into unit-tests-for-aws-secrets-manager
Browse files Browse the repository at this point in the history
  • Loading branch information
neo-Lucas-Johannson committed Jan 9, 2025
2 parents c51c676 + edd45e6 commit f4d2b6b
Show file tree
Hide file tree
Showing 27 changed files with 6,897 additions and 2,569 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @iansu
* @iansu @Neo-Malcolm-Fischer @AD-Blue
8,841 changes: 6,360 additions & 2,481 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions packages/config-dug/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
**/build
**/coverage
**/node_modules
.eslintrc.cjs
16 changes: 16 additions & 0 deletions packages/config-dug/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
extends: ['eslint-config-neo/config-backend'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
parserOptions: {
project: ['./tsconfig.cjs.json', './test/tsconfig.json'],
sourceType: 'module',
},
rules: {
jest: 'off',
'jest/no-commented-out-tests': 'off',
'jest/no-deprecated-functions': 'off',
'jest/valid-expect': 'off',
'jest/valid-expect-in-promise': 'off',
},
};
16 changes: 12 additions & 4 deletions packages/config-dug/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "config-dug",
"version": "2.0.0-alpha.0",
"version": "2.0.0-alpha.1",
"description": "Config management library for Node.js with support for multiple environments, config files, environment variables and plugins",
"author": "Neo Financial Engineering <[email protected]>",
"license": "MIT",
Expand Down Expand Up @@ -41,19 +41,27 @@
"build": "tsc -b tsconfig.cjs.json tsconfig.esm.json tsconfig.types.json",
"watch": "tsc -b tsconfig.cjs.json tsconfig.esm.json tsconfig.types.json --watch",
"clean": "rimraf build",
"prepublishOnly": "npm run clean && npm run build",
"test": "vitest run --config ./test/vitest.config.ts"
"format": "prettier --write \"**/*.{ts,tsx,js,json,graphql,md}\"",
"format:check": "prettier --debug-check \"**/*.{ts,tsx,js,json,graphql,md}\"",
"lint": "eslint .",
"test": "NODE_ENV=test TZ=UTC vitest run --config vite.config.js --isolate=false",
"prepublishOnly": "npm run clean && npm run build"
},
"dependencies": {
"chalk": "^4.1.2",
"change-case": "^4.1.2",
"debug": "^4.3.4",
"zod": "^3.21.4"
"ms": "^2.1.3",
"zod": "^3.23.8"
},
"devDependencies": {
"@tsconfig/node18": "^1.0.3",
"@types/debug": "^4.1.7",
"@types/node": "^18.11.18",
"eslint-config-neo": "^0.12.0",
"typescript": "^5.0.4"
},
"optionalDependencies": {
"@rollup/rollup-linux-x64-gnu": "^4.9.6"
}
}
58 changes: 28 additions & 30 deletions packages/config-dug/src/config-dug.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import EventEmitter from 'events';
import createDebug from 'debug';
import { z } from 'zod';
import * as changeKeys from './lib/change-case-keys';

import { getOptions, ConfigDugOptions, ConfigDugOptionsWithDefaults } from './lib/options.js';
import { recordOrigin, recordOriginDefaults, mergeOrigins } from './lib/origins.js';
import { ConfigDugOptions, ConfigDugOptionsWithDefaults, getOptions } from './lib/options.js';
import { mergeOrigins, recordOrigin, recordOriginDefaults } from './lib/origins.js';
import { logger } from './lib/logger.js';
import { ConfigDugError } from './lib/errors.js';
import { loadConfigFile } from './lib/config-file.js';
Expand Down Expand Up @@ -127,7 +128,7 @@ class ConfigDug<T extends ConfigDugSchema> extends EventEmitter {
if (this.loaded === true) {
debug('config already loaded');

return Promise.resolve();
return;
}

await this.loadConfig();
Expand All @@ -150,17 +151,13 @@ class ConfigDug<T extends ConfigDugSchema> extends EventEmitter {

private async loadConfig(): Promise<void> {
const environmentName = getEnvironmentName(this.options.envKey);

if (!this.pluginsInitialized) {
await this.initializePlugins();
this.pluginsInitialized = true;
}
const environmentVariables = this.loadEnvironment(Object.keys(this.schema));

this.valueOrigins = {};
this.rawValues = {
...(await this.loadConfigFile('config.default')),
...(await this.loadConfigFile(`config.${environmentName}`)),
...(await this.loadPlugins()),
...(await this.loadPlugins(environmentVariables)),
...(await this.loadLocalConfigFile(`config.${environmentName}.local`)),
...(await this.loadLocalConfigFile('config.local')),
...this.loadEnvironment(Object.keys(this.schema)),
Expand Down Expand Up @@ -192,12 +189,13 @@ class ConfigDug<T extends ConfigDugSchema> extends EventEmitter {
}

const [resolvedFilename, values] = await loadConfigFile(filename, this.options.basePath, ['js', 'cjs', 'mjs']);
const keyCorrectedValues = changeKeys[this.options.keyStyle](values);

if (resolvedFilename) {
this.valueOrigins = recordOrigin(this.valueOrigins, values, resolvedFilename);
this.valueOrigins = recordOrigin(this.valueOrigins, keyCorrectedValues, resolvedFilename);
}

return values;
return keyCorrectedValues;
}

private async loadLocalConfigFile(filename: string): Promise<UntypedConfig> {
Expand All @@ -210,13 +208,14 @@ class ConfigDug<T extends ConfigDugSchema> extends EventEmitter {
}

const [resolvedFilename, values] = await loadConfigFile(filename, this.options.basePath, ['js', 'cjs', 'mjs']);
const keyCorrectedValues = changeKeys[this.options.keyStyle](values);

if (resolvedFilename) {
this.options.warnOnLocalConfigFile && logger.warn(`Loaded local config file: ${resolvedFilename}`);
this.valueOrigins = recordOrigin(this.valueOrigins, values, resolvedFilename);
this.valueOrigins = recordOrigin(this.valueOrigins, keyCorrectedValues, resolvedFilename);
}

return values;
return keyCorrectedValues;
}

private loadEnvironment(keys: string[]): UntypedConfig {
Expand All @@ -229,39 +228,38 @@ class ConfigDug<T extends ConfigDugSchema> extends EventEmitter {
}

const values = loadEnvironment(keys);

this.valueOrigins = recordOrigin(this.valueOrigins, values, 'environment');

return values;
}

private async initializePlugins(): Promise<void> {
debug('initialize plugins');
private async loadPlugins(values: UntypedConfig): Promise<UntypedConfig> {
let nextPluginReloadIn: number | undefined;

for (const plugin of this.options.plugins) {
if (typeof plugin.initialize === 'function') {
await plugin.initialize(this.options);
if (!plugin.isInitialized()) {

Check failure on line 240 in packages/config-dug/src/config-dug.ts

View workflow job for this annotation

GitHub Actions / build (18)

packages/plugin-aws-secrets-manager/test/aws-secrets-manager.test.ts > ConfigDug with AWSSecretsManagerPlugin > should load config values from AWS Secrets Manager

ZodError: [ { "code": "invalid_return_type", "returnTypeError": { "issues": [ { "code": "invalid_type", "expected": "boolean", "received": "undefined", "path": [], "message": "Required" } ], "name": "ZodError" }, "path": [ "plugins", 0, "isInitialized" ], "message": "Invalid function return type" } ] ❯ Object.<anonymous> node_modules/zod/lib/types.js:2868:27 ❯ Object.isInitialized node_modules/zod/lib/types.js:2865:40 ❯ ConfigDug.loadPlugins packages/config-dug/src/config-dug.ts:240:19 ❯ ConfigDug.loadConfig packages/config-dug/src/config-dug.ts:160:22 ❯ ConfigDug.load packages/config-dug/src/config-dug.ts:134:5 ❯ packages/plugin-aws-secrets-manager/test/aws-secrets-manager.test.ts:102:5 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { issues: [ { code: 'invalid_return_type', returnTypeError: { stack: 'ZodError: [\n {\n "code": "invalid_type",\n "expected": "boolean",\n "received": "undefined",\n "path": [],\n "message": "Required"\n }\n]\n at Object.get error [as error] (/home/runner/work/config-dug/config-dug/node_modules/zod/lib/types.js:55:31)\n at Object.<anonymous> (/home/runner/work/config-dug/config-dug/node_modules/zod/lib/types.js:2868:91)\n at Object.isInitialized (/home/runner/work/config-dug/config-dug/node_modules/zod/lib/types.js:2865:40)\n at ConfigDug.loadPlugins (/home/runner/work/config-dug/config-dug/packages/config-dug/src/config-dug.ts:240:19)\n at ConfigDug.loadConfig (/home/runner/work/config-dug/config-dug/packages/config-dug/src/config-dug.ts:160:22)\n at ConfigDug.load (/home/runner/work/config-dug/config-dug/packages/config-dug/src/config-dug.ts:134:5)\n at /home/runner/work/config-dug/config-dug/packages/plugin-aws-secrets-manager/test/aws-secrets-manager.test.ts:102:5\n at file:///home/runner/work/config-dug/config-dug/node_modules/@vitest/runner/dist/index.js:533:5\n at runTest (file:///home/runner/work/config-dug/config-dug/node_modules/@vitest/runner/dist/index.js:1056:11)\n at runSuite (file:///home/runner/work/config-dug/config-dug/node_modules/@vitest/runner/dist/index.js:1205:15)', issues: [ { code: 'invalid_type', expected: 'boolean', received: 'undefined', path: [], message: 'Required' } ], addIssue: 'Function<anonymous>', addIssues: 'Function<anonymous>', name: 'ZodError', constructor: 'Function<ZodError>', errors: [ { code: 'invalid_type', expected: 'boolean', received: 'undefined', path: [], message: 'Required' } ], format: 'Function<format>', toString: 'Function<toString>', message: '[\n {\n "code": "invalid_type",\n "expected": "boolean",\n "received": "undefined",\n "path": [],\n "message": "Required"\n }\n]', isEmpty: false, flatten: 'Function<flatten>', formErrors: { formErrors: [ 'Required' ], fieldErrors: {} } }, path: [ 'plugins', +0, 'isInitialized' ], message: 'Invalid function return type' } ], addIssue: 'Function<anonymous>', addIssues: 'Function<anonymous>', errors: [ { code: 'invalid_return_type', returnTypeError: { stack: 'ZodError: [\n {\n "code": "invalid_type",\n "expected": "boolean",\n "received": "undefined",\n "path": [],\n "message": "Required"\n }\n]\n at Object.get error [as error] (/home/runner/work/config-dug/config-dug/node_modules/zod/lib/types.js:55:31)\n at Object.<anonymous> (/home/runner/work/config-dug/config-dug/node_modules/zod/lib/types.js:2868:91)\n at Object.isInitialized (/home/runner/work/config-dug/config-dug/node_modules/zod/lib/types.js:2865:40)\n at ConfigDug.loadPlugins (/home/runner/work/config-dug/config-dug/packages/config-dug/src/config-dug.ts:240:19)\n at ConfigDug.loadConfig (/home/runner/work/config-dug/config-dug/packages/config-dug/src/config-dug.ts:160:22)\n at ConfigDug.load (/home/runner/work/config-dug/config-dug/packages/config-dug/src/config-dug.ts:134:5)\n at /home/runner/work/config-dug/config-dug/packages/plugin-aws-secrets-manager/test/aws-secrets-manager.test.ts:102:5\n at fi

Check failure on line 240 in packages/config-dug/src/config-dug.ts

View workflow job for this annotation

GitHub Actions / build (20)

packages/plugin-aws-secrets-manager/test/aws-secrets-manager.test.ts > ConfigDug with AWSSecretsManagerPlugin > should load config values from AWS Secrets Manager

ZodError: [ { "code": "invalid_return_type", "returnTypeError": { "issues": [ { "code": "invalid_type", "expected": "boolean", "received": "undefined", "path": [], "message": "Required" } ], "name": "ZodError" }, "path": [ "plugins", 0, "isInitialized" ], "message": "Invalid function return type" } ] ❯ Object.<anonymous> node_modules/zod/lib/types.js:2868:27 ❯ Object.isInitialized node_modules/zod/lib/types.js:2865:40 ❯ ConfigDug.loadPlugins packages/config-dug/src/config-dug.ts:240:19 ❯ ConfigDug.loadConfig packages/config-dug/src/config-dug.ts:160:22 ❯ ConfigDug.load packages/config-dug/src/config-dug.ts:134:5 ❯ packages/plugin-aws-secrets-manager/test/aws-secrets-manager.test.ts:102:5 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { issues: [ { code: 'invalid_return_type', returnTypeError: { stack: 'ZodError: [\n {\n "code": "invalid_type",\n "expected": "boolean",\n "received": "undefined",\n "path": [],\n "message": "Required"\n }\n]\n at Object.get error [as error] (/home/runner/work/config-dug/config-dug/node_modules/zod/lib/types.js:55:31)\n at Object.<anonymous> (/home/runner/work/config-dug/config-dug/node_modules/zod/lib/types.js:2868:91)\n at Object.isInitialized (/home/runner/work/config-dug/config-dug/node_modules/zod/lib/types.js:2865:40)\n at ConfigDug.loadPlugins (/home/runner/work/config-dug/config-dug/packages/config-dug/src/config-dug.ts:240:19)\n at ConfigDug.loadConfig (/home/runner/work/config-dug/config-dug/packages/config-dug/src/config-dug.ts:160:22)\n at ConfigDug.load (/home/runner/work/config-dug/config-dug/packages/config-dug/src/config-dug.ts:134:5)\n at /home/runner/work/config-dug/config-dug/packages/plugin-aws-secrets-manager/test/aws-secrets-manager.test.ts:102:5\n at file:///home/runner/work/config-dug/config-dug/node_modules/@vitest/runner/dist/index.js:533:5\n at runTest (file:///home/runner/work/config-dug/config-dug/node_modules/@vitest/runner/dist/index.js:1056:11)\n at runSuite (file:///home/runner/work/config-dug/config-dug/node_modules/@vitest/runner/dist/index.js:1205:15)', issues: [ { code: 'invalid_type', expected: 'boolean', received: 'undefined', path: [], message: 'Required' } ], addIssue: 'Function<anonymous>', addIssues: 'Function<anonymous>', name: 'ZodError', constructor: 'Function<ZodError>', errors: [ { code: 'invalid_type', expected: 'boolean', received: 'undefined', path: [], message: 'Required' } ], format: 'Function<format>', toString: 'Function<toString>', message: '[\n {\n "code": "invalid_type",\n "expected": "boolean",\n "received": "undefined",\n "path": [],\n "message": "Required"\n }\n]', isEmpty: false, flatten: 'Function<flatten>', formErrors: { formErrors: [ 'Required' ], fieldErrors: {} } }, path: [ 'plugins', +0, 'isInitialized' ], message: 'Invalid function return type' } ], addIssue: 'Function<anonymous>', addIssues: 'Function<anonymous>', errors: [ { code: 'invalid_return_type', returnTypeError: { stack: 'ZodError: [\n {\n "code": "invalid_type",\n "expected": "boolean",\n "received": "undefined",\n "path": [],\n "message": "Required"\n }\n]\n at Object.get error [as error] (/home/runner/work/config-dug/config-dug/node_modules/zod/lib/types.js:55:31)\n at Object.<anonymous> (/home/runner/work/config-dug/config-dug/node_modules/zod/lib/types.js:2868:91)\n at Object.isInitialized (/home/runner/work/config-dug/config-dug/node_modules/zod/lib/types.js:2865:40)\n at ConfigDug.loadPlugins (/home/runner/work/config-dug/config-dug/packages/config-dug/src/config-dug.ts:240:19)\n at ConfigDug.loadConfig (/home/runner/work/config-dug/config-dug/packages/config-dug/src/config-dug.ts:160:22)\n at ConfigDug.load (/home/runner/work/config-dug/config-dug/packages/config-dug/src/config-dug.ts:134:5)\n at /home/runner/work/config-dug/config-dug/packages/plugin-aws-secrets-manager/test/aws-secrets-manager.test.ts:102:5\n at fi
await plugin.initialize(this.options, values);
}
}
}

private async loadPlugins(): Promise<UntypedConfig> {
let values: UntypedConfig = {};

for (const plugin of this.options.plugins) {
const pluginReturnValue: ConfigDugPluginOutput = await plugin.load();

values = { ...values, ...pluginReturnValue.values };

const keyCorrectedValues = changeKeys[this.options.keyStyle](pluginReturnValue.values);
values = { ...values, ...keyCorrectedValues };
this.valueOrigins = mergeOrigins(this.valueOrigins, pluginReturnValue.valueOrigins);

if (pluginReturnValue.nextReloadIn) {
this.reloadTimeout = setTimeout(async () => {
await this.reload();
}, pluginReturnValue.nextReloadIn);
// We will reload in time for the nearest plugin reload
nextPluginReloadIn = nextPluginReloadIn
? Math.min(nextPluginReloadIn, pluginReturnValue.nextReloadIn)
: pluginReturnValue.nextReloadIn;
}
}

if (nextPluginReloadIn) {
this.reloadTimeout = setTimeout(async () => {
await this.reload();
}, nextPluginReloadIn);
}

debug('plugin values', values);

return values;
Expand Down
3 changes: 2 additions & 1 deletion packages/config-dug/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ export { z } from 'zod';

export { ConfigDug, ConfigDugSchema, ConfigDugConfig, UntypedConfig, ValueOrigins } from './config-dug.js';
export { ConfigDugError } from './lib/errors.js';
export type { ConfigDugPlugin, ConfigDugPluginOutput } from './lib/plugin.js';
export { BaseConfigDugPlugin } from './lib/plugin.js';
export type { ConfigDugPlugin, ConfigDugPluginOptions, ConfigDugPluginOutput } from './lib/plugin.js';
export type { ConfigDugOptions } from './lib/options.js';
45 changes: 45 additions & 0 deletions packages/config-dug/src/lib/change-case-keys.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Implementation from https://www.npmjs.com/package/change-case
import * as changeCase from 'change-case';
import { UntypedConfig } from '../config-dug';

export enum KeyStyle {
camelCase = 'camelCase',
capitalCase = 'capitalCase',
constantCase = 'constantCase',
dotCase = 'dotCase',
noCase = 'noCase',
pascalCase = 'pascalCase',
pathCase = 'pathCase',
sentenceCase = 'sentenceCase',
snakeCase = 'snakeCase',
}

const isObject = (object: unknown) => object !== null && typeof object === 'object';

function changeKeysFactory<Options extends changeCase.Options = changeCase.Options>(
changeCase: (input: string, options?: changeCase.Options) => string
): (object: UntypedConfig, depth?: number, options?: Options) => UntypedConfig {
return function changeKeys(object: UntypedConfig, depth = 1, options?: Options): UntypedConfig {
if (depth === 0 || !isObject(object)) return {};

const result: Record<string, unknown> = Object.create(Object.getPrototypeOf(object));

Object.keys(object as object).forEach((key) => {
const value = (object as Record<string, unknown>)[key];
const changedKey = changeCase(key, options);
result[changedKey] = value;
});

return result;
};
}

export const camelCase = changeKeysFactory(changeCase.camelCase);
export const capitalCase = changeKeysFactory(changeCase.capitalCase);
export const constantCase = changeKeysFactory(changeCase.constantCase);
export const dotCase = changeKeysFactory(changeCase.dotCase);
export const noCase = changeKeysFactory(changeCase.noCase);
export const pascalCase = changeKeysFactory(changeCase.pascalCase);
export const pathCase = changeKeysFactory(changeCase.pathCase);
export const sentenceCase = changeKeysFactory(changeCase.sentenceCase);
export const snakeCase = changeKeysFactory(changeCase.snakeCase);
2 changes: 1 addition & 1 deletion packages/config-dug/src/lib/config-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const loadConfigFile = async (
}
}

return Promise.resolve([undefined, {}]);
return [undefined, {}];
};

export { loadConfigFile };
9 changes: 5 additions & 4 deletions packages/config-dug/src/lib/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ const getEnvironmentName = (envKey: string): string => {

const environmentName = process.env[envKey];

if (!environmentName) {
if (environmentName) {
debug('resolved environment name', environmentName);

return environmentName;
} else {
debug('unable to load environment name, defaulting to `development`');
logger.warn(`Unable to load environment from ${envKey}. Defaulting to \`development\`.`);

return 'development';
} else {
debug('resolved environment name', environmentName);
return environmentName;
}
};

Expand Down
9 changes: 6 additions & 3 deletions packages/config-dug/src/lib/options.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { z } from 'zod';
import { pluginSchema } from './plugin';
import { KeyStyle } from './change-case-keys';

export type ConfigDugOptions = z.infer<typeof optionsSchema>;
export type ConfigDugOptionsWithDefaults = z.infer<typeof optionsWithDefaultsSchema>;
Expand All @@ -7,10 +9,10 @@ const optionsSchema = z
.object({
basePath: z.string().optional(),
envKey: z.string().optional(),
keyStyle: z.nativeEnum(KeyStyle).optional(),
loadConfigFiles: z.boolean().optional(),
loadEnvironment: z.boolean().optional(),
// TODO: Add plugin types
plugins: z.array(z.any()).optional(),
plugins: z.array(pluginSchema).optional(),
printConfig: z.boolean().optional(),
strict: z.boolean().optional(),
warnOnLocalConfigFile: z.boolean().optional(),
Expand All @@ -20,9 +22,10 @@ const optionsSchema = z
const optionsWithDefaultsSchema = z.object({
basePath: z.string().default(process.cwd()),
envKey: z.string().default('APP_ENV'),
keyStyle: z.nativeEnum(KeyStyle).default(KeyStyle.camelCase),
loadConfigFiles: z.boolean().default(true),
loadEnvironment: z.boolean().default(true),
plugins: z.array(z.any()).default([]),
plugins: z.array(pluginSchema).default([]),
printConfig: z.boolean().default(false),
strict: z.boolean().default(false),
warnOnLocalConfigFile: z.boolean().default(true),
Expand Down
2 changes: 1 addition & 1 deletion packages/config-dug/src/lib/origins.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import createDebug from 'debug';

import { ValueOrigins, UntypedConfig } from '../config-dug.js';
import { UntypedConfig, ValueOrigins } from '../config-dug.js';

const debug = createDebug('config-dug:lib:origins');

Expand Down
6 changes: 3 additions & 3 deletions packages/config-dug/src/lib/parser.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { z } from 'zod';

import { ConfigDugSchema, ConfigDugConfig, UntypedConfig, ValueOrigins } from '../config-dug.js';
import { ConfigDugConfig, ConfigDugSchema, UntypedConfig } from '../config-dug.js';
import { getSchemaWithPreprocessor } from './preprocessor.js';
import { ErrorWithContext, reportErrors, errorMap } from './reporter.js';
import { errorMap, ErrorWithContext, reportErrors } from './reporter.js';
import { logger } from './logger.js';

const parseConfig = <T extends ConfigDugSchema>(
Expand Down Expand Up @@ -45,7 +45,7 @@ const parseConfig = <T extends ConfigDugSchema>(
defaultValue = schemaOrExtendedSchema.schema._def.defaultValue();
defaults.push(key);
}

schemaOrExtendedSchema.schema.parse;
parsed[key] = strict
? schemaOrExtendedSchema.schema.parse(value, { errorMap })
: getSchemaWithPreprocessor(schemaOrExtendedSchema.schema).parse(value, { errorMap });
Expand Down
Loading

0 comments on commit f4d2b6b

Please sign in to comment.