UNPKG

astro

Version:

Astro is a modern site builder with web best practices, performance, and DX front-of-mind.

16 lines (15 loc) 565 B
import { errorMap } from "../errors/index.js"; import { AstroConfigRefinedSchema, createRelativeSchema } from "./schemas/index.js"; async function validateConfig(userConfig, root, cmd) { const AstroConfigRelativeSchema = createRelativeSchema(cmd, root); return await validateConfigRefined( await AstroConfigRelativeSchema.parseAsync(userConfig, { errorMap }) ); } async function validateConfigRefined(updatedConfig) { return await AstroConfigRefinedSchema.parseAsync(updatedConfig, { errorMap }); } export { validateConfig, validateConfigRefined };