Hyperlinkv0.8.0-beta.28

HashMap

HashMap.hasconsteffect/HashMap.ts:440
<K1 extends K, K>(key: K1): <K, V>(self: HashMap<K, V>) => boolean
<K1 extends K, K, V>(self: HashMap<K, V>, key: K1): boolean

Checks whether the specified key has an entry in the HashMap.

Example (Checking for keys)

import { HashMap } from "effect"

const map = HashMap.make(["a", 1], ["b", 2])

console.log(HashMap.has(map, "a")) // true
console.log(HashMap.has(map, "c")) // false

// Using pipe syntax
const hasB = HashMap.has("b")(map)
console.log(hasB) // true
elements
Source effect/HashMap.ts:4404 lines
export const has: {
  <K1 extends K, K>(key: K1): <K, V>(self: HashMap<K, V>) => boolean
  <K1 extends K, K, V>(self: HashMap<K, V>, key: K1): boolean
} = internal.has
Referenced by 2 symbols