MCPcopy Create free account
hub / github.com/handsontable/handsontable / arrayEach

Function arrayEach

handsontable/src/helpers/array.ts:160–182  ·  view source on GitHub ↗
(
  array: T[] | Iterable<T>, iteratee: (value: T, index: number, array: T[]) => unknown)

Source from the content-addressed store, hash-verified

158 * @returns {Array} Returns `array`.
159 */
160export function arrayEach<T>(
161 array: T[] | Iterable<T>, iteratee: (value: T, index: number, array: T[]) => unknown): T[] {
162 let index = 0;
163 let iterable: T[];
164
165 if (Array.isArray(array)) {
166 iterable = array;
167 } else {
168 iterable = Array.from(array);
169 }
170
171 const length = iterable.length;
172
173 while (index < length) {
174 if (iteratee(iterable[index], index, iterable) === false) {
175 break;
176 }
177
178 index += 1;
179 }
180
181 return iterable;
182}
183
184/**
185 * Calculate sum value for each item of the array.

Callers 15

removeRowFunction · 0.90
removeColFunction · 0.90
CoreFunction · 0.90
getParentOverlayMethod · 0.90
removeHooksByKeyFunction · 0.90
getHeightsMethod · 0.90
getWidthsMethod · 0.90
createColGroupsColMethod · 0.90
createRowMethod · 0.90
createColMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…