( a: T, b: T | undefined, )
| 304 | * Shallow compare objects. |
| 305 | */ |
| 306 | export function shallowEqualObjects<T extends Record<string, any>>( |
| 307 | a: T, |
| 308 | b: T | undefined, |
| 309 | ): boolean { |
| 310 | if (!b || Object.keys(a).length !== Object.keys(b).length) { |
| 311 | return false |
| 312 | } |
| 313 | |
| 314 | for (const key in a) { |
| 315 | if (a[key] !== b[key]) { |
| 316 | return false |
| 317 | } |
| 318 | } |
| 319 | |
| 320 | return true |
| 321 | } |
| 322 | |
| 323 | export function isPlainArray(value: unknown): value is Array<unknown> { |
| 324 | return Array.isArray(value) && value.length === Object.keys(value).length |
no outgoing calls
no test coverage detected
searching dependent graphs…