MCPcopy
hub / github.com/immutable-js/immutable-js / has

Function has

src/functional/has.ts:12–18  ·  view source on GitHub ↗
(collection: object, key: unknown)

Source from the content-addressed store, hash-verified

10 * `collection.hasOwnProperty(key)`.
11 */
12export 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}

Callers 1

getFunction · 0.90

Calls 3

isImmutableFunction · 0.90
isDataStructureFunction · 0.85
hasMethod · 0.65

Tested by

no test coverage detected