UNPKG

@web3r/flowerkit

Version:

Tree-shakable JavaScript and TypeScript utility library for frontend/browser apps: DOM, events, arrays, objects, strings, date, JSON, and network helpers (ESM/CJS, SSR-friendly).

14 lines (13 loc) 461 B
/** * Checks if items of given Array is same * @template T * @param {Array<T>} arr source Array * @returns {boolean} * @example * // How to check if all records are equal in an array? * const arr = [ 1, 1, 1 ]; * const isSame = isItemsEqual(arr); * console.log(isSame); // => true */ const isItemsEqual=arr=>{if(arr.length===0)return true;const first=arr[0];return arr.every(val=>val===first)};export{isItemsEqual}; //# sourceMappingURL=index.mjs.map