Function hasProperty

    • Determines whether an accessor path exists on an object.

      Traversal aborts immediately when a property is missing, an intermediate value cannot be traversed, or an invalid array index is encountered. Properties whose values are undefined or null are considered present.

      Array indexes may only be accessed by number through the array accessor form.

      Parameters

      • data: object

        An object to inspect.

      • accessor: SafeAccessor

        A dotted string accessor or an array of exact string, number, or symbol property keys.

      Returns boolean

      Whether the complete accessor path exists.