(equivalence: Equivalence<A>)
| 988 | * @since 2.0.0 |
| 989 | */ |
| 990 | export 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. |
no test coverage detected