Checks if a parent identifier nests a child identifier.
Nesting holds if the path of child is equal to or extends the path of parent at a segment boundary, that is if
parent is a path prefix of child when compared segment by segment: a parent always nests itself
(isNestedIRI(x, x) is true), while segment-boundary matching prevents false positives (/a/b doesn't nest
/a/bc).
Nesting is defined only for absolute hierarchical identifiers, that is a scheme followed by a root-relative path;
opaque, internal, and relative references are reported as not nesting, as are strings carrying an isolated UTF-16
surrogate. Query strings and fragments are ignored: only the path component is compared.
Parameters
parent: string
The potential parent identifier
child: string
The potential child identifier
Returns boolean
true if parent and child are both valid "hierarchical" identifiers sharing the same origin and
parent nests child; false otherwise
Checks if a parent identifier nests a child identifier.
Nesting holds if the path of
childis equal to or extends the path ofparentat a segment boundary, that is ifparentis a path prefix ofchildwhen compared segment by segment: a parent always nests itself (isNestedIRI(x, x)is true), while segment-boundary matching prevents false positives (/a/bdoesn't nest/a/bc).Nesting is defined only for absolute hierarchical identifiers, that is a scheme followed by a root-relative path; opaque, internal, and relative references are reported as not nesting, as are strings carrying an isolated UTF-16 surrogate. Query strings and fragments are ignored: only the path component is compared.