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

    Function asURI

    • Creates a validated URI from a string.

      Validates URIs according to RFC 3986, restricting identifiers to ASCII characters only. For non-absolute variants, normalizes paths by removing . segments and resolving .. segments.

      Parameters

      • value: string

        The string to convert to a URI

      • variant: Variant = "absolute"

        The identifier variant to validate against (default: "absolute")

      Returns string

      The validated and normalized URI

      RangeError If the value is not a valid ASCII-only URI for the specified variant, or if .. segments would climb above the root