MCPcopy Create free account
hub / github.com/effect-app/libs / isSubrecordBy

Function isSubrecordBy

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

Source from the content-addressed store, hash-verified

1092 */
1093export const isSubrecordBy = <A>(equivalence: Equivalence<A>): {
1094 <K extends string>(that: ReadonlyRecord<K, A>): (self: ReadonlyRecord<K, A>) => boolean
1095 <K extends string>(self: ReadonlyRecord<K, A>, that: ReadonlyRecord<K, A>): boolean
1096} =>
1097 dual(2, <K extends string>(self: ReadonlyRecord<K, A>, that: ReadonlyRecord<K, A>): boolean => {
1098 for (const key of keys(self)) {
1099 if (!has(that, key) || !equivalence(self[key], that[key])) {
1100 return false
1101 }
1102 }
1103 return true
1104 })
1105
1106/**
1107 * Checks whether the first record is a subrecord of the second record.
1108 *

Callers 2

Record.tsFile · 0.85
makeEquivalenceFunction · 0.85

Calls 2

keysFunction · 0.70
hasFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…