MCPcopy Index your code
hub / github.com/Effect-TS/effect / isSubrecordBy

Function isSubrecordBy

packages/effect/src/Record.ts:990–1001  ·  view source on GitHub ↗
(equivalence: Equivalence<A>)

Source from the content-addressed store, hash-verified

988 * @since 2.0.0
989 */
990export const isSubrecordBy = <A>(equivalence: Equivalence<A>): {
991 <K extends string>(that: ReadonlyRecord<K, A>): (self: ReadonlyRecord<K, A>) => boolean
992 <K extends string>(self: ReadonlyRecord<K, A>, that: ReadonlyRecord<K, A>): boolean
993} =>
994 dual(2, <K extends string>(self: ReadonlyRecord<K, A>, that: ReadonlyRecord<K, A>): boolean => {
995 for (const key of keys(self)) {
996 if (!has(that, key) || !equivalence(self[key], that[key])) {
997 return false
998 }
999 }
1000 return true
1001 })
1002
1003/**
1004 * Check if one record is a subrecord of another, meaning it contains all the keys and values found in the second record.

Callers 2

Record.tsFile · 0.85
getEquivalenceFunction · 0.85

Calls 3

equivalenceFunction · 0.85
keysFunction · 0.70
hasFunction · 0.50

Tested by

no test coverage detected