diff --git a/src/cli.ts b/src/cli.ts index f70b364..1c4266f 100755 --- a/src/cli.ts +++ b/src/cli.ts @@ -14,7 +14,9 @@ async function main() { } const { loadSchema } = await import("./loader/loader"); - const schema = await loadSchema(entryPath, { inferDefaults: args.defaults }); + const schema = await loadSchema(entryPath, { + ignoreDefaults: args.ignoreDefaults, + }); if (args.write) { const json = JSON.stringify(schema, null, 2); const outfile = resolve( diff --git a/src/loader/loader.ts b/src/loader/loader.ts index 2f362d4..86f9242 100644 --- a/src/loader/loader.ts +++ b/src/loader/loader.ts @@ -10,7 +10,7 @@ type JITIOptions = Parameters[1]; export interface LoaderOptions { jiti?: JITIOptions; defaults?: Record; - inferDefaults?: boolean; + ignoreDefaults?: boolean; } export async function loadSchema( @@ -32,11 +32,9 @@ export async function loadSchema( const resolvedEntryPath = _jitiRequire.resolve(entryPath); const rawSchema = _jitiRequire(resolvedEntryPath); - const schema = await resolveSchema( - rawSchema, - options.defaults, - options.inferDefaults - ); + const schema = await resolveSchema(rawSchema, options.defaults, { + ignoreDefaults: options.ignoreDefaults, + }); return schema; }