Internal utilities.
- Source:
Methods
addConstantTo()
Adds a constant to the given object, the constant is not enumerable and not configurable.
assertBoolean(…elements) → {boolean}
Asserts that all elements are boolean primitives, otherwise a
Rac.Exception.failedAssert is thrown.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
elements |
boolean
|
<repeatable> |
assertExists(…parameters) → {boolean}
Asserts that all passed parameters are objects or primitives. If any
parameter is null or undefined a Rac.Exception.failedAssert
is thrown.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
parameters |
Object
|
primitive
|
<repeatable> |
assertNumber(…elements) → {boolean}
Asserts that all elements are number primitives and not NaN, otherwise
a Rac.Exception.failedAssert is thrown.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
elements |
number
|
<repeatable> |
assertString(…elements) → {boolean}
Asserts that all elements are string primitives, otherwise
a Rac.Exception.failedAssert is thrown.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
elements |
string
|
<repeatable> |
assertType(type, …elements) → {boolean}
Asserts that all elements are objects or the given typeo, otherwise a
Rac.Exception.failedAssert is thrown.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
type |
function
|
||
elements |
Object
|
<repeatable> |
cutDigits(number, digitsopt, nullable) → {string}
Returns a string of number format using fixed-point notation or the
complete number string.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
number |
number
|
The number to format |
|
digits |
number
|
<optional> <nullable> |
The amount of digits to print, or |
typeName(obj) → {string}
Returns the constructor name of obj, or its type name.
Convenience function for debugging and errors.
Parameters:
| Name | Type | Description |
|---|---|---|
obj |
object
|
An |