MCPcopy Create free account
hub / github.com/Effect-TS/effect / structureKeys

Function structureKeys

packages/effect/src/Hash.ts:410–416  ·  view source on GitHub ↗
(o: object, keys: Iterable<PropertyKey>)

Source from the content-addressed store, hash-verified

408 * @since 2.0.0
409 */
410export const structureKeys = (o: object, keys: Iterable<PropertyKey>) => {
411 let h = 12289
412 for (const key of keys) {
413 h ^= combine(hash(key), hash((o as any)[key]))
414 }
415 return optimize(h)
416}
417
418/**
419 * Computes a structural hash for an object using Effect's object key collection.

Callers 1

structureFunction · 0.85

Calls 3

hashFunction · 0.85
optimizeFunction · 0.85
combineFunction · 0.50

Tested by

no test coverage detected