MCPcopy Create free account
hub / github.com/Snapchat/Valdi / arrayEquals

Function arrayEquals

src/valdi_modules/src/valdi/coreutils/src/ArrayUtils.ts:7–20  ·  view source on GitHub ↗
(left: T[], right: T[])

Source from the content-addressed store, hash-verified

5 * Check whether two arrays contains the same items. *
6 */
7export function arrayEquals<T>(left: T[], right: T[]): boolean {
8 const length = left.length;
9 if (length !== right.length) {
10 return false;
11 }
12
13 for (let i = 0; i < length; i++) {
14 if (left[i] !== right[i]) {
15 return false;
16 }
17 }
18
19 return true;
20}
21
22/**
23 * Like Array.map() but lazy. It will allocate a new array

Callers 1

setAttributeOnElementMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected