MCPcopy Index your code
hub / github.com/Opencode-DCP/opencode-dynamic-context-pruning / loadConfigFile

Function loadConfigFile

lib/config.ts:785–802  ·  view source on GitHub ↗
(configPath: string)

Source from the content-addressed store, hash-verified

783}
784
785function loadConfigFile(configPath: string): ConfigLoadResult {
786 let fileContent = ""
787 try {
788 fileContent = readFileSync(configPath, "utf-8")
789 } catch {
790 return { data: null }
791 }
792
793 try {
794 const parsed = parse(fileContent, undefined, { allowTrailingComma: true })
795 if (parsed === undefined || parsed === null) {
796 return { data: null, parseError: "Config file is empty or invalid" }
797 }
798 return { data: parsed }
799 } catch (error: any) {
800 return { data: null, parseError: error.message || "Failed to parse config" }
801 }
802}
803
804function mergeStrategies(
805 base: PluginConfig["strategies"],

Callers 1

getConfigFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected