( a: T, b: T | undefined, )
| 328 | * Shallow compare objects. |
| 329 | */ |
| 330 | export function shallowEqualObjects<T extends Record<string, any>>( |
| 331 | a: T, |
| 332 | b: T | undefined, |
| 333 | ): boolean { |
| 334 | if (!b || Object.keys(a).length !== Object.keys(b).length) { |
| 335 | return false |
| 336 | } |
| 337 | |
| 338 | for (const key in a) { |
| 339 | if (a[key] !== b[key]) { |
| 340 | return false |
| 341 | } |
| 342 | } |
| 343 | |
| 344 | return true |
| 345 | } |
| 346 | |
| 347 | export function isPlainArray(value: unknown): value is Array<unknown> { |
| 348 | return Array.isArray(value) && value.length === Object.keys(value).length |
no outgoing calls
no test coverage detected