Methods
(static) arrayOf(array, predicate) → {Boolean}
Check if all items in an array match a predicate
Parameters:
Name | Type | Description |
---|---|---|
array |
Array | |
predicate |
predicateFn |
Returns:
- Type
- Boolean
(static) autobind(methodNames, instance)
Bind all methods of an object to itself
Parameters:
Name | Type | Description |
---|---|---|
methodNames |
Array.<function()> | |
instance |
Object |
(static) captialize(string) → {string}
Captialize a string
Parameters:
Name | Type | Description |
---|---|---|
string |
string |
Returns:
- Type
- string
(static) clamp(value, min, max) → {number}
Clamp a value between a min and max value
Parameters:
Name | Type | Description |
---|---|---|
value |
number | |
min |
number | |
max |
number |
Returns:
- Type
- number
(static) distanceTo(pointA, pointB) → {number}
Calculate the distance between pointA and pointB
Parameters:
Name | Type | Description |
---|---|---|
pointA |
Point | |
pointB |
Point |
Returns:
Distance
- Type
- number
(static) extend(object, …sources) → {Object}
Extend an Object
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
object |
Object | Destination object | |
sources |
Object |
<repeatable> |
Source objects |
Returns:
Destination object, extended with members from sources
- Type
- Object
(static) includes(array, value) → {boolean}
Check if a value is included in an array
Parameters:
Name | Type | Description |
---|---|---|
array |
Array | |
value |
number |
Returns:
- Type
- boolean
(static) isDefined(value) → {Boolean}
Check if a value is defined
Parameters:
Name | Type | Description |
---|---|---|
value |
* |
Returns:
- Type
- Boolean
(static) isEmpty(obj) → {Boolean}
Check if an object is empty
Parameters:
Name | Type | Description |
---|---|---|
obj |
Object | Array |
Returns:
- Type
- Boolean
(static) isNumber(value) → {Boolean}
Check if a value is a number
Parameters:
Name | Type | Description |
---|---|---|
value |
* |
Returns:
- Type
- Boolean
(static) isObject(value) → {Boolean}
Check if a value is an object
Parameters:
Name | Type | Description |
---|---|---|
value |
* |
Returns:
- Type
- Boolean
(static) length(numA, numB) → {number}
Calculate the absolute difference between two numbers
Parameters:
Name | Type | Description |
---|---|---|
numA |
number | |
numB |
number |
Returns:
- Type
- number
(static) objectOf(object, predicate, keys) → {Boolean}
Check if all items in an object match a predicate
Parameters:
Name | Type | Description |
---|---|---|
object |
Object | |
predicate |
predicateFn | |
keys |
Array.<string> |
Returns:
- Type
- Boolean
(static) omit(obj, omitKeys) → {Object}
Return a new object without the specified keys
Parameters:
Name | Type | Description |
---|---|---|
obj |
Object | |
omitKeys |
Array.<string> |
Returns:
- Type
- Object
Type Definitions
predicateFn(value) → {boolean}
Parameters:
Name | Type | Description |
---|---|---|
value |
* |
Returns:
- Type
- boolean