bdv2-theme-converter/utils

Methods

(static) checkMark(msg) → {string}

Returns a checkmarked message.

Parameters:
Name Type Description
msg string

The original message.

Source:
Returns:

The checkmarked message.

Type
string

(static) indent(type, width) → {string}

Returns an indent string of tabs or spaces.

Parameters:
Name Type Description
type string | number

Can be one of tab or space, or a number.

width number

The width of the indent string.

Source:
Throws:

Will throw an error on invalid type or width.

Returns:

The indent string.

Type
string

(static) isEmpty(obj) → {boolean}

Checks whether the given object is empty.

Parameters:
Name Type Description
obj Object

The object to be checked.

Source:
Returns:
Type
boolean

(static) isNumber(arg) → {boolean}

Checks whether the given argument is a finite number.

Parameters:
Name Type Description
arg *

The argument to be checked.

Source:
Returns:
Type
boolean

(static) isObject(arg) → {boolean}

Checks whether the given argument is an object.

Parameters:
Name Type Description
arg *

The argument to be checked.

Source:
Returns:
Type
boolean

(static) merge() → {Object}

Merges multiple objects into one. If the objects share keys, the rightmost object's value will be used.

Parameters:
Name Type Attributes Description
...obj Object <repeatable>

The objects to merge.

Source:
Returns:

The merged object.

Type
Object

(static) mkdirRecursive(dir)

Creates missing directories recursively.

Parameters:
Name Type Description
dir string

The directory path to create.

Since:
  • 0.1.2
Source:
See:

(static) renameKeys(obj, newKeys) → {Object}

Renames an object's keys.

Parameters:
Name Type Description
obj Object

The source object.

newKeys Object

An object with the old keys as keys and the new keys as values.

Source:
Returns:

The source object with the keys renamed.

Type
Object

(static) stripEmpty(obj) → {Object}

Removes null, undefined, and empty values from an object.

Parameters:
Name Type Description
obj Object

The object to be stripped.

Since:
  • 0.1.1
Source:
Returns:

The stripped object.

Type
Object