MCPcopy Create free account
hub / github.com/activejs/activejs / sanitizeIndices

Function sanitizeIndices

packages/core/src/utils/funcs.ts:62–74  ·  view source on GitHub ↗
(indices: number[], arrLength: number)

Source from the content-addressed store, hash-verified

60 * @internal please do not use.
61 */
62export function sanitizeIndices(indices: number[], arrLength: number): number[] {
63 const sanitizedIndices = [];
64
65 indices.forEach(index => {
66 index = normalizeIndex(index, arrLength);
67
68 if (index < arrLength && isValidIndex(index)) {
69 sanitizedIndices.push(index);
70 }
71 });
72
73 return deDuplicate(sanitizedIndices);
74}
75
76/**
77 * @internal please do not use.

Callers 3

removeMethod · 0.90
deleteMethod · 0.90
list-unit.spec.tsFile · 0.90

Calls 4

normalizeIndexFunction · 0.85
isValidIndexFunction · 0.85
deDuplicateFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected