Hyperlinkv0.8.0-beta.28

HashMap

HashMap.everyconsteffect/HashMap.ts:1233
<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 all entries in a hashmap meets a specific condition.

Example (Checking all entries)

import { HashMap } from "effect"

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

console.log(HashMap.every(map, (value) => value > 0)) // true
console.log(HashMap.every(map, (value) => value > 1)) // false
elements
export const every: {
  <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.every
Referenced by 1 symbols