Home Reference Source Repository
import Query from 'Uri/src/Query.js'
public class | source

Query

Class to manage query part of URL

Constructor Summary

Public Constructor
public

constructor(f: string, ctx: object): instance

Member Summary

Public Members
public

ctx: *

Method Summary

Public Methods
public

add(obj: object): instance

Add a query string

public

clear(): instance

Remove the query string

public

get(): array

Get the query string

public

merge(obj: object): instance

Merge with the query string - replaces query string values if they exist

public

set(or: obj): instance

Set with the query string - replaces existing query string

public

toString(uri: boolen): string

Get string representatio of the path or the uri

Public Constructors

public constructor(f: string, ctx: object): instance source

Params:

NameTypeAttributeDescription
f string

query string

ctx object

context of uri instance

Return:

instance

for chaining

Public Members

public ctx: * source

Public Methods

public add(obj: object): instance source

Add a query string

Params:

NameTypeAttributeDescription
obj object

{name: 'value'}

Return:

instance

for chaining

public clear(): instance source

Remove the query string

Return:

instance

for chaining

public get(): array source

Get the query string

Return:

array

representing the query string

public merge(obj: object): instance source

Merge with the query string - replaces query string values if they exist

Params:

NameTypeAttributeDescription
obj object

{name: 'value'}

Return:

instance

for chaining

public set(or: obj): instance source

Set with the query string - replaces existing query string

Params:

NameTypeAttributeDescription
or obj

{string} ...q

Return:

instance

for chaining

public toString(uri: boolen): string source

Get string representatio of the path or the uri

Params:

NameTypeAttributeDescription
uri boolen

if true return string represention of uri

Return:

string

query or uri as string