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

    Function relativize

    • Creates a relative reference from base to reference.

      • Hierarchical identifiers: Computes the shortest path-relative reference that, when resolved against base, yields reference
      • Opaque identifiers: Returns the scheme-specific part if schemes match

      Type Parameters

      • T extends string

        The identifier type (URI or IRI)

      Parameters

      • base: string | T

        The absolute base identifier

      • reference: string | T

        The reference to relativize

      Returns T

      A relative reference from base to reference, or the normalized absolute reference if not relativizable

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