MCPcopy
hub / github.com/di-sukharev/opencommit / mergeConfigs

Function mergeConfigs

out/cli.cjs:68216–68225  ·  view source on GitHub ↗
(main, fallback)

Source from the content-addressed store, hash-verified

68214var getGlobalConfig = (configPath = defaultConfigPath) => {
68215 const isGlobalConfigFileExist = getIsGlobalConfigFileExist(configPath);
68216 if (!isGlobalConfigFileExist) {
68217 return { ...DEFAULT_CONFIG };
68218 }
68219 const configFile = (0, import_fs.readFileSync)(configPath, "utf8");
68220 return (0, import_ini.parse)(configFile);
68221};
68222var mergeConfigs = (main, fallback) => {
68223 const allKeys = /* @__PURE__ */ new Set([...Object.keys(main), ...Object.keys(fallback)]);
68224 return Array.from(allKeys).reduce((acc, key) => {
68225 const mainValue = main[key];
68226 acc[key] = parseConfigVarValue(
68227 mainValue !== void 0 ? mainValue : fallback[key]
68228 );

Callers 2

getConfigFunction · 0.70
setConfigFunction · 0.70

Calls 3

parseConfigVarValueFunction · 0.70
keysMethod · 0.45
fromMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…