mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-22 22:03:30 +08:00
added util functions for checking if arrays (sorted and unsorted) are equal
This commit is contained in:
parent
7a678a2cdf
commit
d5ae0466bb
1 changed files with 8 additions and 0 deletions
|
@ -1251,3 +1251,11 @@ export function isPasswordStrong(password: string): boolean {
|
|||
const isLong = password.length >= 8;
|
||||
return hasCapital && hasNumber && hasSpecial && isLong;
|
||||
}
|
||||
|
||||
export function areUnsortedArraysEqual<T>(a: T[], b: T[]): boolean {
|
||||
return a.length === b.length && a.every((v) => b.includes(v));
|
||||
}
|
||||
|
||||
export function areSortedArraysEqual<T>(a: T[], b: T[]): boolean {
|
||||
return a.length === b.length && a.every((v, i) => v === b[i]);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue