MCPcopy Create free account
hub / github.com/cortexkit/magic-context / compactObject

Function compactObject

packages/cli/src/commands/setup-pi.ts:84–89  ·  view source on GitHub ↗
(obj: T)

Source from the content-addressed store, hash-verified

82}
83
84function compactObject<T extends Record<string, unknown>>(obj: T): T {
85 for (const key of Object.keys(obj)) {
86 if (obj[key] === undefined) delete obj[key];
87 }
88 return obj;
89}
90
91/**
92 * Compare two semver-ish strings (X.Y.Z, ignores any pre-release or build

Callers 2

writeMagicContextConfigFunction · 0.85
chooseEmbeddingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected