Module: utils

Methods

(inner) hasOwnProperty(item, key) → {boolean}

Safe `hasOwnProperty` check.

Parameters:
Name Type Description
item Object The object to check.
key string The property name.
Source:
Returns:
`true` if the object has the given own property.
Type
boolean

(inner) isDefined(input) → {boolean}

Check if a value is defined (not `undefined`).

Parameters:
Name Type Description
input * The value to check.
Source:
Returns:
`true` if the value is not `undefined`.
Type
boolean

(inner) isNotSet(item) → {boolean}

Check if a value is not set (`null` or `undefined`).

Parameters:
Name Type Description
item * The value to check.
Source:
Returns:
`true` if the value is `null` or `undefined`.
Type
boolean

(inner) isSet(item) → {boolean}

Check if a value is set (not `null` and not `undefined`).

Parameters:
Name Type Description
item * The value to check.
Source:
Returns:
`true` if the value is neither `null` nor `undefined`.
Type
boolean

(inner) isUndefined(input) → {boolean}

Check if a value is `undefined`.

Parameters:
Name Type Description
input * The value to check.
Source:
Returns:
`true` if the value is `undefined`.
Type
boolean

(inner) valueOrDefault(value, def) → {*}

Return a value, falling back to a default if the value is not set.

Parameters:
Name Type Description
value * The value to return if set.
def * The default to return if `value` is `null` or `undefined`.
Source:
Returns:
The value if set, otherwise the default.
Type
*