MCPcopy Create free account
hub / github.com/continuedev/continue / resolveSerializedConfig

Function resolveSerializedConfig

core/config/load.ts:74–96  ·  view source on GitHub ↗
(
  filepath: string,
)

Source from the content-addressed store, hash-verified

72import { validateConfig } from "./validation.js";
73
74export function resolveSerializedConfig(
75 filepath: string,
76): SerializedContinueConfig {
77 let content = fs.readFileSync(filepath, "utf8");
78 const config = JSONC.parse(content) as unknown as SerializedContinueConfig;
79 if (config.env && Array.isArray(config.env)) {
80 const env = {
81 ...process.env,
82 ...getContinueDotEnv(),
83 };
84
85 config.env.forEach((envVar) => {
86 if (envVar in env) {
87 content = (content as any).replaceAll(
88 new RegExp(`"${envVar}"`, "g"),
89 `"${env[envVar]}"`,
90 );
91 }
92 });
93 }
94
95 return JSONC.parse(content) as unknown as SerializedContinueConfig;
96}
97
98const configMergeKeys = {
99 models: (a: any, b: any) => a.title === b.title,

Callers 2

migrateJsonSharedConfigFunction · 0.90
loadSerializedConfigFunction · 0.85

Calls 1

getContinueDotEnvFunction · 0.90

Tested by

no test coverage detected