Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/rimbu/hashed/main/index.ts>Hasher.objectDeepHasher

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
function Hasher.objectDeepHasher
import { Hasher } from "https://deno.land/x/rimbu@1.0.4/hashed/main/index.ts";
const { objectDeepHasher } = Hasher;

Returns a Hasher instance that hashes objects of key type K and value type V. If a value if an object or array, it will recursively hash its values.

Examples

Example 1

const h = Hasher.objectDeepHasher()
console.log(h.hash({ a: 1, b: 2 }) === h.hash({ b: 2, a: 1 }))
// => true

Type Parameters

K extends string | number | symbol
optional
V = any

Returns

Hasher<Record<K, V>>