We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e067210 commit 030a98cCopy full SHA for 030a98c
1 file changed
src/loader/loader.ts
@@ -26,7 +26,13 @@ export async function loadSchema(
26
} satisfies JitiOptions),
27
);
28
29
- const rawSchema = (await jiti.import(entryPath)) as InputObject;
+ let rawSchema = (await jiti.import(entryPath)) as InputObject;
30
+
31
+ const rawSchemaKeys = Object.keys(rawSchema);
32
+ if (rawSchemaKeys.length === 1 && rawSchemaKeys[0] === "default") {
33
+ rawSchema = (rawSchema as any).default;
34
+ }
35
36
const schema = await resolveSchema(rawSchema, options.defaults, {
37
ignoreDefaults: options.ignoreDefaults,
38
});
0 commit comments