Function toCanonicalUriPath

  • Converts a URI path to the canonical version by splitting on slashes, decoding any percent-based encodings, and then encoding any special characters. This function is used to clean unwanted characters in the components of the provided path.

    Parameters

    • path: string

      The path to convert to its canonical URI path form.

    Returns string

    The canonical URI path form of the provided path.