Methods
-
createMap(data, objKey)
-
Creates map {unique value data} for array of object {data} taking supplied key {objKey} into consideration.
Parameters:
Name Type Description data
Array Array Object who's map is to be created.
objKey
string Parameter against which key value is created for map.
Returns:
map of data element with respect to specified {objKey} where key is the objKey and value is specific element.
- Type
- Object
-
debounce(func [, timeout])
-
add debounce time for passef function
Parameters:
Name Type Argument Default Description func
function Function for which debounce need to be added
timeout
number <optional>
300 wait period before function trigger
Returns:
debounced function with wait for trigger until timeout
- Type
- function
-
deepCopy(target, source1, sourceN)
-
Creates deep copy of all the passed object merging all the data into 1st parameter ( target object ).
Parameters:
Name Type Description target
T An object that will receive the new properties if additional objects are passed in.
source1
T An object containing additional properties to merge in.
sourceN
Array.<T> Additional objects containing properties to merge in.
Returns:
Deep copied object containing all the properties of passed parameters.
- Type
- T
-
getUiqueIdentifier()
-
returns random string which can be used as an unique identifier
Returns:
{string}
- Type
- *
-
hasKey(obj, key)
-
Identifies if a particular key is present into Object or not and based on this returns boolean.
Parameters:
Name Type Description obj
Object Source Object against which key needs to be identified.
key
string Property which need to be verified into source object.
Returns:
true if key exists and false if not.
- Type
- boolean
-
isArray(object)
-
Identifies if argument is Array or not.
Parameters:
Name Type Description object
* Source data which need to be identitied if Array or not.
Returns:
status as true if Array and false if not.
- Type
- boolean
-
isBoolean(object)
-
Identifies if argument is boolean or not.
Parameters:
Name Type Description object
* Source data which is defined or not.
Returns:
status as true if defined and false if not.
- Type
- boolean
-
isDefined(value)
-
Identifies if argument is defined or not that is its value should not be null, undefined or ''.
Parameters:
Name Type Description value
* Source data which need to be identitied if defined or not.
Returns:
returns false if undefined or null or empty string.
- Type
- boolean
-
isEmptyObject(object)
-
Identifies if Object is empty or not.
Parameters:
Name Type Description object
* Source data which need to be validated.
Returns:
status as true if not an empty Object and false if empty.
- Type
- boolean
-
isFunction(object)
-
Identifies if passed argument is function or not.
Parameters:
Name Type Description object
* Parameter which needs to be validated.
Returns:
return true is parameter is function.
- Type
- boolean
-
isObject(object)
-
Verifies if passed argument is Object or not
Parameters:
Name Type Description object
* Argument which needs to be validated
Returns:
return true if passed argument is Object
- Type
- boolean
-
isUndefined(value)
-
Identifies if argument is defined or not that is its value should not be null, undefined or ''.
Parameters:
Name Type Description value
* Source data which need to be identitied if defined or not.
Returns:
returns true if undefined or null or empty string.
- Type
- boolean
-
noop(value)
-
noop
Parameters:
Name Type Description value
* accepts anyumber of arguments.
Returns:
return undefined
- Type
- void
-
sort(data, comparator)
-
sort array based on multiple criteria
Parameters:
Name Type Description data
Array.<T> comparator
Array.<string> Returns:
{T[]}
- Type
- *