MCPcopy Create free account
hub / github.com/ProNextJS/declarative-routing / writeConfig

Function writeConfig

src/config.ts:39–49  ·  view source on GitHub ↗
(config: Config)

Source from the content-addressed store, hash-verified

37}
38
39export function writeConfig(config: Config) {
40 const cfg = ConfigSchema.safeParse(config);
41 if (!cfg.success) {
42 console.error("Invalid config");
43 throw new Error(cfg.error.issues.map((i) => i.message).join("\n"));
44 }
45 fs.writeFileSync(
46 path.resolve(`./${CONFIG}`),
47 JSON.stringify(cfg.data, null, 2)
48 );
49}
50
51export const absoluteFilePath = (config: Config, fpath: string) =>
52 path.resolve(config.src || "", fpath);

Callers 3

setupQwikCityFunction · 0.90
setupNextFunction · 0.90
setupReactRouterFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected