MCPcopy Index your code
hub / github.com/devcontainers/cli / findLastIndex

Function findLastIndex

src/spec-node/dockerfileUtils.ts:216–223  ·  view source on GitHub ↗
(array: T[], predicate: (value: T, index: number, obj: T[]) => boolean, position = array.length - 1)

Source from the content-addressed store, hash-verified

214}
215
216function findLastIndex<T>(array: T[], predicate: (value: T, index: number, obj: T[]) => boolean, position = array.length - 1): number {
217 for (let i = position; i >= 0; i--) {
218 if (predicate(array[i], i, array)) {
219 return i;
220 }
221 }
222 return -1;
223}
224
225// not expected to be called externally (exposed for testing)
226export function ensureDockerfileHasFinalStageName(dockerfile: string, defaultLastStageName: string): { lastStageName: string; modifiedDockerfile: string | undefined } {

Callers 2

findUserStatementFunction · 0.85
findValueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected