module:MURL

module:MURL

URL class to build and operate on URLs.

Constructor

new (require("MURL"))(url)

Description:
  • Constructor.

Parameters:
Name Type Description
url null | string

URL.

Methods

setAPIVersion(version)

Description:
  • Set API version.

Parameters:
Name Type Description
version string

API version.

setFields(fields)

Description:
  • Property.

Parameters:
Name Type Description
fields Array.<string>

Fields.

setIncludeFields(fields)

Description:
  • Property.

Parameters:
Name Type Description
fields Array.<string>

Fields.

setFilters(filters)

Description:
  • Property.

Parameters:
Name Type Description
filters Array.<string>

Filters.

setPagination(pageNumber, pageObjectCount)

Description:
  • Set pagination.

Parameters:
Name Type Description
pageNumber int

Page number.

pageObjectCount int

Object count per page.

build() → {string}

Description:
  • Build the URL.

Returns:

Built URL.

Type
string

buildWithParameters(parameters) → {string}

Description:
  • Build the URL.

Parameters:
Name Type Description
parameters object

Parameters as key, value pairs.

Returns:

Built URL.

Type
string

(static) replaceParameter(parameter, value)

Description:
  • Replace parameters in the current URL.

    This method replaces history state.

Parameters:
Name Type Description
parameter string

Parameters.

value string

Value.

(static) buildParameters(parameters) → {string}

Description:
  • Build given parameters, so they can be used in a URL.

Parameters:
Name Type Description
parameters Object

Parameters.

Returns:

String representation of the parameters.

Type
string

(static) getHREF() → {string}

Description:
  • Get href.

Returns:

HREF.

Type
string

(static) getHash() → {string}

Description:
  • Get hash.

Returns:

Hash.

Type
string

(static) getQueryParameters() → {Object.<string, string>}

Description:
  • Get query parameters provided in the URL.

Returns:

Query parameters.

Type
Object.<string, string>

(static) getHashPath(withHash) → {string}

Description:
  • Get hash path

Parameters:
Name Type Description
withHash boolean

Whether to get the path has symbol included.

Returns:

Hash path.

Type
string