MCPcopy Create free account
hub / github.com/appium/appium / copyForDefaultsDeep

Function copyForDefaultsDeep

packages/appium/lib/utils/object.ts:264–273  ·  view source on GitHub ↗

* Copies a value for defaultsDeep: plain objects are copied recursively; * other values (including functions) are reused by reference. * * @param value - Value to copy * @returns Copy safe for further defaults merging

(value: unknown)

Source from the content-addressed store, hash-verified

262 * @returns Copy safe for further defaults merging
263 */
264function copyForDefaultsDeep(value: unknown): unknown {
265 if (!util.isPlainObject(value)) {
266 return value;
267 }
268 const out: Record<string, unknown> = {};
269 for (const [key, val] of Object.entries(value)) {
270 out[key] = copyForDefaultsDeep(val);
271 }
272 return out;
273}
274
275/**
276 * Fills `undefined` keys in a clone of `target` from `source` (recursive for plain objects).

Callers 1

fillUndefinedDeepFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected