Hyperlinkv0.8.0-beta.28

HashMap

HashMap.someconsteffect/HashMap.ts:1211
<K, A>(predicate: (a: NoInfer<A>, k: K) => boolean): (
  self: HashMap<K, A>
) => boolean
<K, A>(self: HashMap<K, A>, predicate: (a: A, k: K) => boolean): boolean

Checks whether any entry in a hashmap meets a specific condition.

Example (Checking for any matching entry)

import { HashMap } from "effect"

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

console.log(HashMap.some(map, (value) => value > 2)) // true
console.log(HashMap.some(map, (value) => value > 5)) // false
elements
export const some: {
  <K, A>(predicate: (a: NoInfer<A>, k: K) => boolean): (self: HashMap<K, A>) => boolean
  <K, A>(self: HashMap<K, A>, predicate: (a: A, k: K) => boolean): boolean
} = internal.some
Referenced by 1 symbols