@metreeca/core - v0.9.19
    Preparing search index...

    Function nests

    • Checks if a parent identifier nests a child identifier.

      Returns true if child's path is equal to or extends parent's path at a segment boundary, meaning parent is a path prefix of child when compared segment by segment.

      Both identifiers must be absolute hierarchical (scheme + root-relative path); returns false for opaque, internal, or relative references. Query strings and fragments are ignored — only the path component is compared.

      A parent always nests itself (nests(x, x) is true). Segment-boundary matching prevents false positives (e.g., /a/b does not nest /a/bc).

      Parameters

      • parent: string

        The potential parent identifier

      • child: string

        The potential child identifier

      Returns boolean

      true if parent nests child; false otherwise

      RangeError If either argument is not a valid identifier