Class URI

Index

Constructor methods

Methods

Constructor methods

constructor(): URI

Returns

URI

constructor(uri: string): URI

Parameters

  • uri: string

Returns

URI

constructor(options: URIOptions): URI

Parameters

Returns

URI

Methods

public absoluteTo(path: string): URI

Parameters

  • path: string

Returns

URI

public addFragment(fragment: string): URI

Parameters

  • fragment: string

Returns

URI

public static addQuery(data: Object, prop: string, value: string): Object

Parameters

  • data: Object
  • prop: string
  • value: string

Returns

Object

public static addQuery(data: Object, qryObj: Object): Object

Parameters

  • data: Object
  • qryObj: Object

Returns

Object

public addQuery(qry: string): URI

Parameters

  • qry: string

Returns

URI

public addQuery(qry: Object): URI

Parameters

  • qry: Object

Returns

URI

public addSearch(qry: string): URI

Parameters

  • qry: string

Returns

URI

public addSearch(qry: Object): URI

Parameters

  • qry: Object

Returns

URI

public authority(): string

Returns

string

public authority(authority: string): URI

Parameters

  • authority: string

Returns

URI

public static build(parts: { protocol: string; username: string; password: string; hostname: string; port: string; path: string; query: string; fragment: string; }): string

Parameters

  • parts: { protocol: string; username: string; password: string; hostname: string; port: string; path: string; query: string; fragment: string; }

Returns

string

public static buildAuthority(parts: { username?: string; password?: string; hostname?: string; port?: string; }): string

Parameters

  • parts: { username?: string; password?: string; hostname?: string; port?: string; }

Returns

string

public static buildHost(parts: { hostname?: string; port?: string; }): string

Parameters

  • parts: { hostname?: string; port?: string; }

Returns

string

public static buildQuery(qry: Object): string

Parameters

  • qry: Object

Returns

string

public static buildQuery(qry: Object, duplicates: boolean): string

Parameters

  • qry: Object
  • duplicates: boolean

Returns

string

public static buildUserinfo(parts: { username?: string; password?: string; }): string

Parameters

  • parts: { username?: string; password?: string; }

Returns

string

public clone(): URI

Returns

URI

public static commonPath(path1: string, path2: string): string

Parameters

  • path1: string
  • path2: string

Returns

string

public static decode(str: string): string

Parameters

  • str: string

Returns

string

public static decodeQuery(qry: string): string

Parameters

  • qry: string

Returns

string

public directory(): string

Returns

string

public directory(dir: boolean): string

Parameters

  • dir: boolean

Returns

string

public directory(dir: string): URI

Parameters

  • dir: string

Returns

URI

public domain(): string

Returns

string

public domain(domain: boolean): string

Parameters

  • domain: boolean

Returns

string

public domain(domain: string): URI

Parameters

  • domain: string

Returns

URI

public static encode(str: string): string

Parameters

  • str: string

Returns

string

public static encodeQuery(qry: string): string

Parameters

  • qry: string

Returns

string

public static encodeReserved(str: string): string

Parameters

  • str: string

Returns

string

public equals(): boolean

Returns

boolean

public equals(url: string): boolean

Parameters

  • url: string

Returns

boolean

public static expand(template: string, vals: Object): URI

Parameters

  • template: string
  • vals: Object

Returns

URI

public filename(): string

Returns

string

public filename(file: boolean): string

Parameters

  • file: boolean

Returns

string

public filename(file: string): URI

Parameters

  • file: string

Returns

URI

public fragment(): string

Returns

string

public fragment(fragment: string): URI

Parameters

  • fragment: string

Returns

URI

public fragmentPrefix(prefix: string): any

Parameters

  • prefix: string

Returns

any

public hash(): string

Returns

string

public hash(hash: string): URI

Parameters

  • hash: string

Returns

URI

public host(): string

Returns

string

public host(host: string): URI

Parameters

  • host: string

Returns

URI

public hostname(): string

Returns

string

public hostname(hostname: string): URI

Parameters

  • hostname: string

Returns

URI

public href(): string

Returns

string

public href(url: string)

Parameters

  • url: string

public is(qry: string): boolean

Parameters

  • qry: string

Returns

boolean

public iso8859(): URI

Returns

URI

public static iso8859()

public normalize(): URI

Returns

URI

public normalizeFragment(): URI

Returns

URI

public normalizeHash(): URI

Returns

URI

public normalizeHostname(): URI

Returns

URI

public normalizePath(): URI

Returns

URI

public normalizePathname(): URI

Returns

URI

public normalizePort(): URI

Returns

URI

public normalizeProtocol(): URI

Returns

URI

public normalizeQuery(): URI

Returns

URI

public normalizeSearch(): URI

Returns

URI

public static parse(url: string): { protocol: string; username: string; password: string; hostname: string; port: string; path: string; query: string; fragment: string; }

Parameters

  • url: string

Returns

{ protocol: string; username: string; password: string; hostname: string; port: string; path: string; query: string; fragment: string; }

public static parseAuthority(url: string, parts: { username?: string; password?: string; hostname?: string; port?: string; }): string

Parameters

  • url: string
  • parts: { username?: string; password?: string; hostname?: string; port?: string; }

Returns

string

public static parseHost(url: string, parts: { hostname?: string; port?: string; }): string

Parameters

  • url: string
  • parts: { hostname?: string; port?: string; }

Returns

string

public static parseQuery(url: string): Object

Parameters

  • url: string

Returns

Object

public static parseUserinfo(url: string, parts: { username?: string; password?: string; }): string

Parameters

  • url: string
  • parts: { username?: string; password?: string; }

Returns

string

public password(): string

Returns

string

public password(pw: string): URI

Parameters

  • pw: string

Returns

URI

public path(): string

Returns

string

public path(path: boolean): string

Parameters

  • path: boolean

Returns

string

public path(path: string): URI

Parameters

  • path: string

Returns

URI

public pathname(): string

Returns

string

public pathname(path: boolean): string

Parameters

  • path: boolean

Returns

string

public pathname(path: string): URI

Parameters

  • path: string

Returns

URI

public port(): string

Returns

string

public port(port: string): URI

Parameters

  • port: string

Returns

URI

public protocol(): string

Returns

string

public protocol(protocol: string): URI

Parameters

  • protocol: string

Returns

URI

public query(): string

Returns

string

public query(qry: string): URI

Parameters

  • qry: string

Returns

URI

public query(qry: boolean): Object

Parameters

  • qry: boolean

Returns

Object

public query(qry: Object): URI

Parameters

  • qry: Object

Returns

URI

public readable(): string

Returns

string

public relativeTo(path: string): URI

Parameters

  • path: string

Returns

URI

public removeQuery(qry: string): URI

Parameters

  • qry: string

Returns

URI

public removeQuery(qry: Object): URI

Parameters

  • qry: Object

Returns

URI

public static removeQuery(data: Object, prop: string, value: string): Object

Parameters

  • data: Object
  • prop: string
  • value: string

Returns

Object

public static removeQuery(data: Object, props: Array<string>): Object

Parameters

  • data: Object
  • props: Array<string>

Returns

Object

public static removeQuery(data: Object, props: Object): Object

Parameters

  • data: Object
  • props: Object

Returns

Object

public removeSearch(qry: string): URI

Parameters

  • qry: string

Returns

URI

public removeSearch(qry: Object): URI

Parameters

  • qry: Object

Returns

URI

public resource(): string

Returns

string

public resource(resource: string): URI

Parameters

  • resource: string

Returns

URI

public scheme(): string

Returns

string

public scheme(protocol: string): URI

Parameters

  • protocol: string

Returns

URI

public search(): string

Returns

string

public search(qry: string): URI

Parameters

  • qry: string

Returns

URI

public search(qry: boolean): Object

Parameters

  • qry: boolean

Returns

Object

public search(qry: Object): URI

Parameters

  • qry: Object

Returns

URI

public segment(): Array<string>

Returns

Array<string>

public segment(segments: Array<string>): string

Parameters

  • segments: Array<string>

Returns

string

public segment(position: number): string

Parameters

  • position: number

Returns

string

public segment(position: number, level: string): string

Parameters

  • position: number
  • level: string

Returns

string

public segment(level: string): string

Parameters

  • level: string

Returns

string

public subdomain(): string

Returns

string

public subdomain(subdomain: string): URI

Parameters

  • subdomain: string

Returns

URI

public suffix(): string

Returns

string

public suffix(suffix: boolean): string

Parameters

  • suffix: boolean

Returns

string

public suffix(suffix: string): URI

Parameters

  • suffix: string

Returns

URI

public tld(): string

Returns

string

public tld(tld: boolean): string

Parameters

  • tld: boolean

Returns

string

public tld(tld: string): URI

Parameters

  • tld: string

Returns

URI

public unicode(): URI

Returns

URI

public static unicode()

public userinfo(): string

Returns

string

public userinfo(userinfo: string): URI

Parameters

  • userinfo: string

Returns

URI

public username(): string

Returns

string

public username(uname: string): URI

Parameters

  • uname: string

Returns

URI

public valueOf(): string

Returns

string

public static withinString(source: string, func: (url: string) => string): string

Parameters

  • source: string
  • func: (url: string) => string

Returns

string