Members
:string
unsafeUIDCompute an 'unsafe' UID. While unsafe, it'll still do a decent job of being unique over the course of a session, but is based on Math.random() so limited and possibly redundant
Methods
(p_base, p_source) → {object}
AppendAppends the value of an Object into another. First-level properties only, no overwriting.
Parameters:
Name | Type | Description |
---|---|---|
p_base |
object | The base object to append into |
p_source |
object | The reference object to fetch values from |
(p_oldArray, p_newArray, p_out, p_in)
ArrayDiffCreates a diff of two array, and 'old' one and a 'new' one, and outputs the result into two array (out & in) that must be provided.
Parameters:
Name | Type | Description |
---|---|---|
p_oldArray |
array | The old array to compare p_newArray against |
p_newArray |
array | The new array to compare p_oldArray against |
p_out |
array | Empty Array, will be filled with the items that are present in p_oldArray, but not in p_newArray |
p_in |
array | Empty Array, will be filled with the items that are not in p_oldArray, but present in p_newArray |
(p_oldArray, p_newArray, p_outCallback, p_inCallback)
ArrayDiffCallbacksCreates a diff of two array, and 'old' one and a 'new' one, and call functions for each item that has been either added or removed
Parameters:
Name | Type | Description |
---|---|---|
p_oldArray |
array | The old array to compare p_newArray against |
p_newArray |
array | The new array to compare p_oldArray against |
p_outCallback |
array | Will be called each time an item is present in p_oldArray, but not in p_newArray |
p_inCallback |
array | Will be called each time an item is not in p_oldArray, but present in p_newArray |
(p_string) → {string}
CamelSplitSplit a 'CamelCase' string into a 'Camel Case' one
Parameters:
Name | Type | Description |
---|---|---|
p_string |
string | The string to split |
(p_obj, p_returnNewEmpty) → {object}
ClearDeletes all properties on an a given object. First-level properties only.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
p_obj |
object | The object to be emptied |
|
p_returnNewEmpty |
boolean |
false
|
Wether to return a new empty object or not |
(p_base) → {object}
CloneClone an Object.
Parameters:
Name | Type | Description |
---|---|---|
p_base |
object | The base object to clone |
(p_base) → {array}
CloneArrayClone an Array. Recursive.
Parameters:
Name | Type | Description |
---|---|---|
p_base |
array | The base object to clone |
(p_a, p_b)
DateDiffA - B
Parameters:
Name | Type | Description |
---|---|---|
p_a |
* | |
p_b |
* |
(p_obj, p_returnNewEmpty) → {object}
DeepClearDeletes all properties on an a given object, and clears any value that is an object or an array itself. Recursive.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
p_obj |
object | The object to be emptied |
|
p_returnNewEmpty |
boolean |
false
|
Wether to return a new empty object or not |
(p_arr)
DeepClearArrayEmpty an array and clears any value that is an object or an array itself. Recursive.
Parameters:
Name | Type | Description |
---|---|---|
p_arr |
array | The object to be emptied |
(…args) → {*}
DefaultReturns the first non-void value
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
args |
* |
<repeatable> |
A list of values to test |
(p_obj, p_key, p_value)
EnsureEnsure a value is set on a object.
Parameters:
Name | Type | Description |
---|---|---|
p_obj |
object | The target object |
p_key |
string | The property's name |
p_value |
* | The default value to set the property to if it does not exists |
(p_obj, p_kvp)
EnsureMultipleEnsure a value is set on a object.
Parameters:
Name | Type | Description |
---|---|---|
p_obj |
object | The target object |
p_kvp |
object | The property's name |
(p_string) → {string}
FixSlashReplaces \
with /
Parameters:
Name | Type | Description |
---|---|---|
p_string |
string | The string to sanitize |
(p_obj, p_key, p_fallback) → {*}
GetAttempts to get the property value on a given object.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
p_obj |
object | The object to extract the property value from |
|
p_key |
string | The property's name |
|
p_fallback |
* |
null
|
The fallback value that will be returned if the property cannot be found, or if its value is 'void' |
(p_from, p_to) → {number}
InheritanceDistanceChecks the 'inheritance distance' between two Classe or Instances thereof. p_to should be a 'distant child' of p_from, not the other way around.
Parameters:
Name | Type | Description |
---|---|---|
p_from |
Object | class | The base Class or Instance |
p_to |
Object | class | The target Class or Instance |
(p_value) → {boolean}
isArrayDetermine if a value is an Array
Parameters:
Name | Type | Description |
---|---|---|
p_value |
* | The value to test |
(val) → {boolean}
isArrayBufferDetermine if a value is an ArrayBuffer
Parameters:
Name | Type | Description |
---|---|---|
val |
object | The value to test |
(p_value) → {boolean}
isBoolDetermine if a value is a Boolean
Parameters:
Name | Type | Description |
---|---|---|
p_value |
* | The value to test |
(p_value) → {boolean}
isEmptyDetermine if an object is empty
Parameters:
Name | Type | Description |
---|---|---|
p_value |
* | The value to test |
(p_value) → {boolean}
isFuncDetermine if a value is a Function
Parameters:
Name | Type | Description |
---|---|---|
p_value |
* | The value to test |
(p_source, p_target) → {boolean}
isInstanceOfDetermine if a (source) Class or Instance of a constructor is an instance of another (target) Class or Instance of a given Class. *
Parameters:
Name | Type | Description |
---|---|---|
p_source |
Object | function | The value to test |
p_target |
Object | function | The value to test against |
(p_value, …args) → {boolean}
isNotChecks whether a value is not equal to any of the provided ones
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
p_value |
* | The value to test |
|
args |
* |
<repeatable> |
The values to test against |
(p_value) → {boolean}
isNumberDetermine if a value is a Number
Parameters:
Name | Type | Description |
---|---|---|
p_value |
* | The value to test |
(p_value) → {boolean}
isObjectDetermine if a value is an Object
Parameters:
Name | Type | Description |
---|---|---|
p_value |
* | The value to test |
(p_source, p_other) → {boolean}
isSameChecks whether two objects contains exactly the same values
Parameters:
Name | Type | Description |
---|---|---|
p_source |
object | The object to test |
p_other |
object | The object to test against |
(p_source, p_other) → {boolean}
isSameArrayChecks whether two arrays contains exactly the same values at the same index
Parameters:
Name | Type | Description |
---|---|---|
p_source |
array | The array to test |
p_other |
array | The array to test against |
(p_value) → {boolean}
isStringDetermine if a value is a string
Parameters:
Name | Type | Description |
---|---|---|
p_value |
* | The value to test |
(p_value) → {boolean}
isSymbolDetermine if a value is an Object
Parameters:
Name | Type | Description |
---|---|---|
p_value |
* | The value to test |
(p_value) → {boolean}
isUndefinedDetermine if a value is undefined
Parameters:
Name | Type | Description |
---|---|---|
p_value |
* | The value to test |
(p_value) → {boolean}
isVoidDetermine if a value is either undefined or null
Parameters:
Name | Type | Description |
---|---|---|
p_value |
* | The value to test |
(p_array, p_joinStr, p_fromIndex, p_toIndex) → {string}
JoinJoin the content of an array from/to specific indices
Parameters:
Name | Type | Default | Description |
---|---|---|---|
p_array |
array | The array to join |
|
p_joinStr |
string | string to join with |
|
p_fromIndex |
number |
0
|
Start join index |
p_toIndex |
number | End join index |
(p_base, p_source, p_skipExisting) → {object}
MergeMerges the value of an Object into another. Recursive, overwrites (unless p_skipExisting === true)
Parameters:
Name | Type | Default | Description |
---|---|---|---|
p_base |
object | The base object to append into |
|
p_source |
object | The reference object to fetch values from |
|
p_skipExisting |
object |
false
|
Whether or not to overwrite on existing values |
(p_base, p_source) → {array}
MergeArrayAdd missing content from p_source into p_base (no duplicates)
Parameters:
Name | Type | Description |
---|---|---|
p_base |
array | |
p_source |
array |
(p_num, p_size)
PadPad a number with leading 0's
Parameters:
Name | Type | Default | Description |
---|---|---|---|
p_num |
number | ||
p_size |
number |
2
|
(p_stringPath)
ParsePathBreaks down a path into an object to the following format : { path:[catalog, catalog, ...], item:tailName, ext:extention, }
Parameters:
Name | Type | Description |
---|---|---|
p_stringPath |
string |
(p_base, p_source, p_mergeArrays)
SetMissingCopy values from p_source currently missing in p_base. Merge object properties
Parameters:
Name | Type | Default | Description |
---|---|---|---|
p_base |
* | ||
p_source |
* | ||
p_mergeArrays |
* |
false
|
if true, will unshift array values from source into base when the two values are arrays. |
(p_base, p_source)
SetOverwriteSet values from p_source to p_base, overriding existing values. Merge objects properties.
Parameters:
Name | Type | Description |
---|---|---|
p_base |
* | |
p_source |
* |
(p_str) → {boolean}
StartWithNumberChecks whether a string starts with a digit.
Parameters:
Name | Type | Description |
---|---|---|
p_str |
string | String to test |
(p_str) → {boolean}
ValidIdentifierChecks whether a string is a valid identifier.
Parameters:
Name | Type | Description |
---|---|---|
p_str |
string | String to test |