MCPcopy Index your code
hub / github.com/nodejs/node / fullObjectGraph

Function fullObjectGraph

test/parallel/test-util-inspect.js:3662–3682  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

3660 }
3661
3662 function fullObjectGraph(value) {
3663 const graph = new Set([value]);
3664
3665 for (const entry of graph) {
3666 if ((typeof entry !== 'object' && typeof entry !== 'function') ||
3667 entry === null) {
3668 continue;
3669 }
3670
3671 graph.add(Object.getPrototypeOf(entry));
3672 const descriptors = Object.values(
3673 Object.getOwnPropertyDescriptors(entry));
3674 for (const descriptor of descriptors) {
3675 graph.add(descriptor.value);
3676 graph.add(descriptor.set);
3677 graph.add(descriptor.get);
3678 }
3679 }
3680
3681 return graph;
3682 }
3683
3684 // Consistency check.
3685 assert(fullObjectGraph(globalThis).has(Function.prototype));

Callers 1

Calls 2

addMethod · 0.65
valuesMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…