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

    Function internalize

    • Extracts a root-relative reference.

      • Hierarchical identifiers: Returns the root-relative path (starting with /) if scheme and authority match
      • Opaque identifiers: Returns the scheme-specific part if schemes match

      Parameters

      • base: string

        The absolute base identifier providing the scheme and authority context

      • reference: string

        The reference to internalize

      Returns string

      A root-relative reference if same origin, or the normalized absolute reference otherwise

      RangeError If base is not a valid absolute identifier or reference is not a valid relative reference, for instance because it carries an isolated UTF-16 surrogate

      RangeError If the resolved path contains tree-climbing segments that would go above the root