util-array

Methods

(inner) checkIfDifferOnKey(arr1, arr2, key) → {Array.<Object>}

Given two array of objects, check whether object differs on the given key
Parameters:
Name Type Description
arr1 Array.<Object> input arr1
arr2 Array.<Object> inpur arr2, to be evaluated with
key key of the the object on which difference needs to be checked
Since:
  • 0.0.9
Source:

(inner) copy(arr, mapFnopt) → {Array}

Copy array from input array, manipulating the values via a mapper function
Parameters:
Name Type Attributes Description
arr Array.<any> inout array
mapFn mapperFunction <optional>
mapper function to transform array values
Since:
  • 0.0.4
Source:

(inner) findObjectByKey(array, key, value) → {Object}

Find a particular object based on key from an array of objects
Parameters:
Name Type Description
array Array.<Object> Array of objects
key String Key to be searched
value String/Number value to be matched
Since:
  • 0.0.9
Source:

(inner) findObjectIndexByKey(array, key, value) → {Object}

Find a particular object index based on key from an array of objects
Parameters:
Name Type Description
array Array Array of objects
key String Key to be searched
value String/Number Value to be matched
Since:
  • 0.0.9
Source:

(inner) sortOnKey(arr, key)

Sort Array of objects on the given key of object
Parameters:
Name Type Description
arr Array of objects to be sorted
key key of the object on which sorting is required
Since:
  • 0.0.9
Source:

Type Definitions

mapperFunction(value)

mapper function
Parameters:
Name Type Description
value * array value
Since:
  • 0.0.4
Source: