Members
(static) inherits
Inherit the prototype methods from one constructor into another.
(inner) path
Module dependencies.
Methods
(static) breakCircularDeps(inputObj) → {*}
Replaces any detected circular dependency with the string '[Circular]'
Mutates original object
Parameters:
Name | Type | Description |
---|---|---|
inputObj | * |
Returns:
- Type
- *
(static) clamp(value, range) → {number}
Clamps a numeric value to an inclusive range.
Parameters:
Name | Type | Description |
---|---|---|
value | number | Value to be clamped. |
range | Array:.<number:> | Two element array specifying [min, max] range. |
Returns:
clamped value
- Type
- number
(static) clean(str) → {string}
Strip the function definition from str
, and re-indent for pre whitespace.
Parameters:
Name | Type | Description |
---|---|---|
str | string |
Returns:
- Type
- string
(static) createMap(…objopt) → {Object}
A "map" is an object with no prototype, for our purposes. In some cases
this would be more appropriate than a Map
, especially if your environment
doesn't support it. Recommended for use in Mocha's public APIs.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
obj | * | <optional> <repeatable> | Arguments to |
Returns:
An object with no prototype, having ...obj
properties
- Type
- Object
(static) defineConstants(…objopt) → {Object}
This differs from createMap only in that
the argument must be non-empty, because the result is frozen.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
obj | * | <optional> <repeatable> | Arguments to |
Throws:
if argument is not a non-empty object.
- Type
- TypeError
Returns:
A frozen object with no prototype, having ...obj
properties
- Type
- Object
(static) getMochaID(objopt) → {string|void}
Retrieves a Mocha ID from an object, if present.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
obj | * | <optional> | Object |
Returns:
- Type
- string | void
(static) isPromise(value) → {boolean}
Crude, but effective.
Parameters:
Name | Type | Description |
---|---|---|
value | * |
Returns:
Whether or not value
is a Promise
- Type
- boolean
(static) noop()
It's a noop.
(static) stackTraceFilter() → {function}
This Filter based on mocha-clean
module.(see: github.com/rstacruz/mocha-clean
)
When invoking this function you get a filter function that get the Error.stack as an input,
and return a prettify output.
(i.e: strip Mocha and internal node functions from stack trace).
Returns:
- Type
- function
(static) uniqueID() → {string}
Creates a new unique identifier
Does not create cryptographically safe ids.
Trivial copy of nanoid/non-secure
Returns:
Unique identifier
- Type
- string