(a: any[] | string, b: any[] | string)
| 105 | |
| 106 | /** Compares two arrays element-by-element for deep equality. */ |
| 107 | export function compareArrays(a: any[] | string, b: any[] | string): boolean { |
| 108 | const length = a.length; |
| 109 | |
| 110 | if (length !== b.length) { |
| 111 | return false; |
| 112 | } |
| 113 | |
| 114 | for (let i = length; i-- !== 0; ) { |
| 115 | // eslint-disable-next-line @typescript-eslint/no-use-before-define |
| 116 | if (!equals(a[i], b[i])) { |
| 117 | return false; |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | return true; |
| 122 | } |
| 123 | |
| 124 | /** Compares two boolean values, treating numeric 0/1 as false/true. */ |
| 125 | export function compareBooleans(a: unknown, b: unknown): boolean { |
no test coverage detected