utils

Various tools.

License:
  • Apache-2.0
Source:

Members

(inner) timeUnit

Time units represented in milliseconds.

  • second - 1000 milliseconds
  • minute - 60 seconds
  • hour - 60 minutes
  • day - 24 hours
  • week - 7 days
  • month - [average month]: 30.4375 days (365.25 days / 12)
  • quarter - [average quarter]: 3 months (365.25 days / 4)
  • year - [average year]: 365.25 days
Source:

Methods

(inner) btquote(x)

Wrap typeof output string with square brackets.

Source:
Parameters:
Name Type Description
x
Returns:

wrapped typeof string

(inner) devEnv(strictopt) → {Boolean}

Determine runtime environment (is it development or not?). devEnv() -> true/false

When strict is not set to true then "development environment" can be simulated by storing value of any type under "dev" key in browser's sessionStorage, e.g. sessionStorage[dev] = true.

Source:
Parameters:
Name Type Attributes Default Description
strict Boolean <optional>
false
Returns:
Type:
Boolean

(inner) getLibConfig() → {Object}

Get useful library configuration variables.

Source:
Returns:
Type:
Object

(inner) getProcess() → {Object}

Return global process variable if it exists. Also give "transform-inline-environment-variables" plugin a chance.

Source:
Returns:
Type:
Object

(inner) isBrowser() → {Boolean}

Check current runtime environment.

Source:
Returns:
Type:
Boolean

(inner) rgb()

JSS color helper.

Source:
Returns:

Wrapped JSS rgb() string.

(inner) rgba()

JSS color helper (with alpha).

Source:
Returns:

Wrapped JSS rgba() string.

(inner) run(main) → {void}

Run "main" function: - in browser on "load" event, - via setTimeout if there's no event API available

Source:
Parameters:
Name Type Description
main function
Returns:
Type:
void

(inner) timing(fn)

Measure fn working time.

Source:
Parameters:
Name Type Description
fn

asynchronous function to measure

Returns:

Object containing result, start and duration fields.

(inner) to_(name) → {function}

Assign argument to the global object. Async-console-dev-helper.

Source:
Parameters:
Name Type Description
name String
Returns:
Type:
function

(*) => *

(inner) url()

JSS url helper.

Source:
Returns:

Wrapped JSS url() string.

Various tools.

License:
  • Apache-2.0
Source:

Members

(inner) timeUnit

Time units represented in milliseconds.

  • second - 1000 milliseconds
  • minute - 60 seconds
  • hour - 60 minutes
  • day - 24 hours
  • week - 7 days
  • month - [average month]: 30.4375 days (365.25 days / 12)
  • quarter - [average quarter]: 3 months (365.25 days / 4)
  • year - [average year]: 365.25 days
Source:

Methods

(inner) btquote(x)

Wrap typeof output string with square brackets.

Source:
Parameters:
Name Type Description
x
Returns:

wrapped typeof string

(inner) devEnv(strictopt) → {Boolean}

Determine runtime environment (is it development or not?). devEnv() -> true/false

When strict is not set to true then "development environment" can be simulated by storing value of any type under "dev" key in browser's sessionStorage, e.g. sessionStorage[dev] = true.

Source:
Parameters:
Name Type Attributes Default Description
strict Boolean <optional>
false
Returns:
Type:
Boolean

(inner) getLibConfig() → {Object}

Get useful library configuration variables.

Source:
Returns:
Type:
Object

(inner) getProcess() → {Object}

Return global process variable if it exists. Also give "transform-inline-environment-variables" plugin a chance.

Source:
Returns:
Type:
Object

(inner) isBrowser() → {Boolean}

Check current runtime environment.

Source:
Returns:
Type:
Boolean

(inner) rgb()

JSS color helper.

Source:
Returns:

Wrapped JSS rgb() string.

(inner) rgba()

JSS color helper (with alpha).

Source:
Returns:

Wrapped JSS rgba() string.

(inner) run(main) → {void}

Run "main" function: - in browser on "load" event, - via setTimeout if there's no event API available

Source:
Parameters:
Name Type Description
main function
Returns:
Type:
void

(inner) timing(fn)

Measure fn working time.

Source:
Parameters:
Name Type Description
fn

asynchronous function to measure

Returns:

Object containing result, start and duration fields.

(inner) to_(name) → {function}

Assign argument to the global object. Async-console-dev-helper.

Source:
Parameters:
Name Type Description
name String
Returns:
Type:
function

(*) => *

(inner) url()

JSS url helper.

Source:
Returns:

Wrapped JSS url() string.

Various tools.

License:
  • Apache-2.0
Source:

Members

(inner) timeUnit

Time units represented in milliseconds.

  • second - 1000 milliseconds
  • minute - 60 seconds
  • hour - 60 minutes
  • day - 24 hours
  • week - 7 days
  • month - [average month]: 30.4375 days (365.25 days / 12)
  • quarter - [average quarter]: 3 months (365.25 days / 4)
  • year - [average year]: 365.25 days
Source:

Methods

(inner) btquote(x)

Wrap typeof output string with square brackets.

Source:
Parameters:
Name Type Description
x
Returns:

wrapped typeof string

(inner) devEnv(strictopt) → {Boolean}

Determine runtime environment (is it development or not?). devEnv() -> true/false

When strict is not set to true then "development environment" can be simulated by storing value of any type under "dev" key in browser's sessionStorage, e.g. sessionStorage[dev] = true.

Source:
Parameters:
Name Type Attributes Default Description
strict Boolean <optional>
false
Returns:
Type:
Boolean

(inner) getLibConfig() → {Object}

Get useful library configuration variables.

Source:
Returns:
Type:
Object

(inner) getProcess() → {Object}

Return global process variable if it exists. Also give "transform-inline-environment-variables" plugin a chance.

Source:
Returns:
Type:
Object

(inner) isBrowser() → {Boolean}

Check current runtime environment.

Source:
Returns:
Type:
Boolean

(inner) rgb()

JSS color helper.

Source:
Returns:

Wrapped JSS rgb() string.

(inner) rgba()

JSS color helper (with alpha).

Source:
Returns:

Wrapped JSS rgba() string.

(inner) run(main) → {void}

Run "main" function: - in browser on "load" event, - via setTimeout if there's no event API available

Source:
Parameters:
Name Type Description
main function
Returns:
Type:
void

(inner) timing(fn)

Measure fn working time.

Source:
Parameters:
Name Type Description
fn

asynchronous function to measure

Returns:

Object containing result, start and duration fields.

(inner) to_(name) → {function}

Assign argument to the global object. Async-console-dev-helper.

Source:
Parameters:
Name Type Description
name String
Returns:
Type:
function

(*) => *

(inner) url()

JSS url helper.

Source:
Returns:

Wrapped JSS url() string.