Home Reference Source Test Repository

Function

Static Public Summary
public

checkVersion(version: String, minVersion: String, maxVersion: String)

Checks if a version is within the provided range.

public

isObject(thing: Object): bool

Returns true if the specified value is an object (i.e.

public

nobatch(message: String): Function

Generates a decorator function ensuring an operation is not performed from within a batch request.

public

Transforms an object into an URL query string, stripping out any undefined values.

public

support(min: String, max: String): Function

Generates a decorator function ensuring a version check is performed against the provided requirements before executing it.

Static Public

public checkVersion(version: String, minVersion: String, maxVersion: String) source

import {checkVersion} from 'kinto-client/lib/utils.js'

Checks if a version is within the provided range.

Params:

NameTypeAttributeDescription
version String

The version to check.

minVersion String

The minimum supported version (inclusive).

maxVersion String

The minimum supported version (exclusive).

Throw:

Error

If the version is outside of the provided range.

public isObject(thing: Object): bool source

import {isObject} from 'kinto-client/lib/utils.js'

Returns true if the specified value is an object (i.e. not an array nor null).

Params:

NameTypeAttributeDescription
thing Object

The value to inspect.

Return:

bool

public nobatch(message: String): Function source

import {nobatch} from 'kinto-client/lib/utils.js'

Generates a decorator function ensuring an operation is not performed from within a batch request.

Params:

NameTypeAttributeDescription
message String

The error message to throw.

Return:

Function

public qsify(obj: Object): String source

import {qsify} from 'kinto-client/lib/utils.js'

Transforms an object into an URL query string, stripping out any undefined values.

Params:

NameTypeAttributeDescription
obj Object

Return:

String

Test:

public support(min: String, max: String): Function source

import {support} from 'kinto-client/lib/utils.js'

Generates a decorator function ensuring a version check is performed against the provided requirements before executing it.

Params:

NameTypeAttributeDescription
min String

The required min version (inclusive).

max String

The required max version (inclusive).

Return:

Function