MCPcopy
hub / github.com/date-fns/date-fns / findIndex

Function findIndex

pkgs/core/src/locale/_lib/buildMatchFn/index.ts:126–136  ·  pkgs/core/src/locale/_lib/buildMatchFn/index.ts::findIndex
(
  array: Item[],
  predicate: (item: Item) => boolean,
)

Source from the content-addressed store, hash-verified

124}
125
126function findIndex<Item>(
127 array: Item[],
128 predicate: (item: Item) => boolean,
129): number | undefined {
130 for (let key = 0; key < array.length; key++) {
131 if (predicate(array[key])) {
132 return key;
133 }
134 }
135 return undefined;
136}

Callers 1

buildMatchFnFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected