Utilities
Installation
npm i -D @davidcraig/utils
Helpers
Object
hasProp
(obj, prop) - Checks if the property exists on the provided object.
Array
reduceSumByKey
(array, key) - Takes an array of objects, and performs reduce (sum) on the values keyed by the provided key on each object.
Misc
hasValue
(val) - Checks if the given value is not null and is not undefined