0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

[ci] format

This commit is contained in:
bluwy 2023-05-18 09:42:07 +00:00 committed by fredkbot
parent cada10a466
commit 28d4d22f7b

View file

@ -211,16 +211,23 @@ export const AstroConfigSchema = z.object({
hybridOutput: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.experimental.hybridOutput), hybridOutput: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.experimental.hybridOutput),
}) })
.passthrough() .passthrough()
.refine(d => { .refine(
const validKeys = Object.keys(ASTRO_CONFIG_DEFAULTS.experimental) (d) => {
const invalidKeys = Object.keys(d).filter(key => !validKeys.includes(key)) const validKeys = Object.keys(ASTRO_CONFIG_DEFAULTS.experimental);
if (invalidKeys.length > 0) return false const invalidKeys = Object.keys(d).filter((key) => !validKeys.includes(key));
return true if (invalidKeys.length > 0) return false;
}, d => { return true;
const validKeys = Object.keys(ASTRO_CONFIG_DEFAULTS.experimental) },
const invalidKeys = Object.keys(d).filter(key => !validKeys.includes(key)) (d) => {
return { message: `Invalid experimental key: \`${invalidKeys.join(', ')}\`. \nMake sure the spelling is correct, and that your Astro version supports this experiment.\nSee https://docs.astro.build/en/reference/configuration-reference/#experimental-flags for more information.` }; const validKeys = Object.keys(ASTRO_CONFIG_DEFAULTS.experimental);
}) const invalidKeys = Object.keys(d).filter((key) => !validKeys.includes(key));
return {
message: `Invalid experimental key: \`${invalidKeys.join(
', '
)}\`. \nMake sure the spelling is correct, and that your Astro version supports this experiment.\nSee https://docs.astro.build/en/reference/configuration-reference/#experimental-flags for more information.`,
};
}
)
.optional() .optional()
.default({}), .default({}),
legacy: z.object({}).optional().default({}), legacy: z.object({}).optional().default({}),