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

Function cleanUndefinedValues

out/cli.cjs:68226–68242  ·  view source on GitHub ↗
(config8)

Source from the content-addressed store, hash-verified

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 );
68229 return acc;
68230 }, {});
68231};
68232var cleanUndefinedValues = (config8) => {
68233 return Object.fromEntries(
68234 Object.entries(config8).map(([_7, v5]) => {
68235 try {
68236 if (typeof v5 === "string") {
68237 if (v5 === "undefined") return [_7, void 0];
68238 if (v5 === "null") return [_7, null];
68239 const parsedValue = JSON.parse(v5);
68240 return [_7, parsedValue];
68241 }
68242 return [_7, v5];
68243 } catch (error) {
68244 return [_7, v5];
68245 }

Callers 1

getConfigFunction · 0.70

Calls 2

entriesMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…