Function safeKeyIterator

    • Returns an iterator of property-key accessor arrays useful with safeAccess and safeSet by traversing the given object. Enumerable string and symbol keys are included, and array indexes are emitted as numbers.

      Note: Keys are only generated for ordinary objects and arrays; Map and Set are not indexed.

      Parameters

      • data: object

        An object to traverse for accessor keys.

      • Optionaloptions: { arrayIndex?: boolean; hasOwnOnly?: boolean }

        Options.

        • OptionalarrayIndex?: boolean

          Set to false to exclude numeric array indexes. Enumerable symbol properties on arrays remain included; default: true.

        • OptionalhasOwnOnly?: boolean

          Set to false to include enumerable prototype properties; default: true.

      Returns IterableIterator<readonly PropertyKey[]>

      Safe key iterator.