MCPcopy Create free account
hub / github.com/instantdb/instant / immutableRemoveUndefined

Function immutableRemoveUndefined

client/packages/core/src/utils/object.js:37–48  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

35}
36
37export function immutableRemoveUndefined(obj) {
38 if (!isObject(obj)) {
39 return obj;
40 }
41 const result = {};
42 for (const [key, value] of Object.entries(obj)) {
43 if (value === undefined) continue;
44
45 result[key] = value;
46 }
47 return result;
48}
49
50export function immutableDeepMerge(target, source) {
51 if (!isObject(target) || !isObject(source)) {

Callers 3

expandCreateFunction · 0.90
expandUpdateFunction · 0.90
expandDeepMergeFunction · 0.90

Calls 1

isObjectFunction · 0.85

Tested by

no test coverage detected