MCPcopy Create free account
hub / github.com/activejs/activejs / deepObjectExtract

Function deepObjectExtract

packages/core/src/tests/utils.ts:535–548  ·  view source on GitHub ↗
(o, r = [])

Source from the content-addressed store, hash-verified

533 }
534
535 const deepObjectExtract = (o, r = []) => {
536 if (o == null || typeof o !== 'object') {
537 return r;
538 }
539
540 r.push(o);
541
542 if (!Array.isArray(o)) {
543 o = Object.values(o);
544 }
545
546 o.forEach(c => deepObjectExtract(c, r));
547 return r;
548 };
549
550 const AO = deepObjectExtract(A);
551 const BO = deepObjectExtract(B);

Callers 1

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected