@web3r/flowerkit
Version:
A collection of more than 60 often used utility JS functions that simplify frontend development.
13 lines (12 loc) • 429 B
JavaScript
import ow from"ow";
/**
* Checks if items of given Array is same
* @param arr{Array} - source Array
* @return {boolean}
* @example
* // How to check if all records are equal in array?
* const arr = [ 1, 1, 1 ];
* const isSame = isItemsEqual(arr);
* console.log(isSame); // => true
*/const isItemsEqual=arr=>{ow(arr,ow.array);return arr.every((val=>val===arr[0]))};export{isItemsEqual};
//# sourceMappingURL=index.js.map