Returns true if child exists within possibleParent. By default it only looks at the immediate parent (maxDepth: 0). Use Number.MAX_SAFE_INTEGER for searching recursively upwards (or hasAnyParent)

  • Type Parameters

    Parameters

    • child: T

      Child being sought

    • possibleParent: T

      Possible parent of child

    • eq: IsEqual<T> = ...

      Equality comparison function. isEqualDefault used by default.

    • maxDepth: number = 0

      Max depth of traversal. Default of 0 only looks for immediate parent.

    Returns boolean