@yamlresume/core
    Preparing search index...

    Function collectAllKeys

    • Tree walker function to collect all possible keys from an object recursively

      This function traverses an object tree and collects all property keys at any depth. It handles arrays, nested objects, and prevents infinite loops from circular references.

      Parameters

      • obj: unknown

        The object to walk through

      • keys: Set<string | number | symbol> = ...

        Set to collect all keys (optional, used for recursion)

      • visited: WeakSet<object> = ...

        Set to track visited objects to prevent circular references (optional, used for recursion)

      Returns Set<string | number | symbol>

      Set containing all keys found in the object tree

      const obj = {
      a: 1,
      b: {
      c: 2,
      d: [{ e: 3 }]
      }
      }
      const keys = collectAllKeys(obj)
      // keys will contain: Set(['a', 'b', 'c', 'd', 'e'])