/
githubmirror
/
angular
Обзор
Документация
Войти
/
githubmirror
/
angular
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/forms/signals/src/util/array.ts
24 строки
656 B
Alex Rickabaugh
perf(forms): optimize reactivity by using shallow array equality
01 май 2026, 01:41
Не верифицирован
01 май 2026, 01:41
e053609
Код
Авторство
О чём код?
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ /** * Checks shallow equality of two arrays. * Returns true if both are arrays and have the same elements in the same order. */ export function shallowArrayEquals<T>( a: readonly T[] | undefined, b: readonly T[] | undefined, ): boolean { if (a === b) return true; if (!a || !b) return false; if (a.length !== b.length) return false; for (let i = 0; i < a.length; i++) { if (!Object.is(a[i], b[i])) return false; } return true; }