(collection: object, key: unknown)
| 10 | * `collection.hasOwnProperty(key)`. |
| 11 | */ |
| 12 | export function has(collection: object, key: unknown): boolean { |
| 13 | return isImmutable(collection) |
| 14 | ? // @ts-expect-error key might be a number or symbol, which is not handled be Record key type |
| 15 | collection.has(key) |
| 16 | : // @ts-expect-error key might be anything else than PropertyKey, and will return false in that case but runtime is OK |
| 17 | isDataStructure(collection) && hasOwnProperty.call(collection, key); |
| 18 | } |
no test coverage detected