uri-js

  • Version 4.4.1
  • Published
  • 470 kB
  • 1 dependency
  • BSD-2-Clause license

Install

npm i uri-js
yarn add uri-js
pnpm add uri-js

Overview

An RFC 3986/3987 compliant, scheme extendable URI/IRI parsing/validating/resolving library for JavaScript.

Index

Variables

variable SCHEMES

const SCHEMES: {
[scheme: string]: URISchemeHandler<URIComponents, URIOptions, URIComponents>;
};

    Functions

    function equal

    equal: {
    (uriA: string, uriB: string, options?: URIOptions): boolean;
    (uriA: URIComponents, uriB: URIComponents, options?: URIOptions): boolean;
    };

      function escapeComponent

      escapeComponent: (str: string, options?: URIOptions) => string;

        function normalize

        normalize: {
        (uri: string, options?: URIOptions): string;
        (uri: URIComponents, options?: URIOptions): URIComponents;
        };

          function parse

          parse: (uriString: string, options?: URIOptions) => URIComponents;

            function pctDecChars

            pctDecChars: (str: string) => string;

              function pctEncChar

              pctEncChar: (chr: string) => string;

                function removeDotSegments

                removeDotSegments: (input: string) => string;

                  function resolve

                  resolve: (baseURI: string, relativeURI: string, options?: URIOptions) => string;

                    function resolveComponents

                    resolveComponents: (
                    base: URIComponents,
                    relative: URIComponents,
                    options?: URIOptions,
                    skipNormalization?: boolean
                    ) => URIComponents;

                      function serialize

                      serialize: (components: URIComponents, options?: URIOptions) => string;

                        function unescapeComponent

                        unescapeComponent: (str: string, options?: URIOptions) => string;

                          Interfaces

                          interface URIComponents

                          interface URIComponents {}

                            property error

                            error?: string;

                              property fragment

                              fragment?: string;

                                property host

                                host?: string;

                                  property path

                                  path?: string;

                                    property port

                                    port?: number | string;

                                      property query

                                      query?: string;

                                        property reference

                                        reference?: string;

                                          property scheme

                                          scheme?: string;

                                            property userinfo

                                            userinfo?: string;

                                              interface URIOptions

                                              interface URIOptions {}

                                                property absolutePath

                                                absolutePath?: boolean;

                                                  property domainHost

                                                  domainHost?: boolean;

                                                    property iri

                                                    iri?: boolean;

                                                      property reference

                                                      reference?: string;

                                                        property scheme

                                                        scheme?: string;

                                                          property tolerant

                                                          tolerant?: boolean;

                                                            property unicodeSupport

                                                            unicodeSupport?: boolean;

                                                              interface URIRegExps

                                                              interface URIRegExps {}

                                                                property ESCAPE

                                                                ESCAPE: RegExp;

                                                                  property IPV4ADDRESS

                                                                  IPV4ADDRESS: RegExp;

                                                                    property IPV6ADDRESS

                                                                    IPV6ADDRESS: RegExp;

                                                                      property NOT_FRAGMENT

                                                                      NOT_FRAGMENT: RegExp;

                                                                        property NOT_HOST

                                                                        NOT_HOST: RegExp;

                                                                          property NOT_PATH

                                                                          NOT_PATH: RegExp;

                                                                            property NOT_PATH_NOSCHEME

                                                                            NOT_PATH_NOSCHEME: RegExp;

                                                                              property NOT_QUERY

                                                                              NOT_QUERY: RegExp;

                                                                                property NOT_SCHEME

                                                                                NOT_SCHEME: RegExp;

                                                                                  property NOT_USERINFO

                                                                                  NOT_USERINFO: RegExp;

                                                                                    property OTHER_CHARS

                                                                                    OTHER_CHARS: RegExp;

                                                                                      property PCT_ENCODED

                                                                                      PCT_ENCODED: RegExp;

                                                                                        property UNRESERVED

                                                                                        UNRESERVED: RegExp;

                                                                                          interface URISchemeHandler

                                                                                          interface URISchemeHandler<
                                                                                          Components extends URIComponents = URIComponents,
                                                                                          Options extends URIOptions = URIOptions,
                                                                                          ParentComponents extends URIComponents = URIComponents
                                                                                          > {}

                                                                                            property absolutePath

                                                                                            absolutePath?: boolean;

                                                                                              property domainHost

                                                                                              domainHost?: boolean;

                                                                                                property scheme

                                                                                                scheme: string;

                                                                                                  property unicodeSupport

                                                                                                  unicodeSupport?: boolean;

                                                                                                    method parse

                                                                                                    parse: (components: ParentComponents, options: Options) => Components;

                                                                                                      method serialize

                                                                                                      serialize: (components: Components, options: Options) => ParentComponents;

                                                                                                        Package Files (1)

                                                                                                        Dependencies (1)

                                                                                                        Dev Dependencies (11)

                                                                                                        Peer Dependencies (0)

                                                                                                        No peer dependencies.

                                                                                                        Badge

                                                                                                        To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                        You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/uri-js.

                                                                                                        • Markdown
                                                                                                          [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/uri-js)
                                                                                                        • HTML
                                                                                                          <a href="https://www.jsdocs.io/package/uri-js"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>