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

Function struct

packages/effect/src/Equivalence.ts:223–235  ·  view source on GitHub ↗
(
  fields: R
)

Source from the content-addressed store, hash-verified

221 * @since 2.0.0
222 */
223export const struct = <R extends Record<string, Equivalence<any>>>(
224 fields: R
225): Equivalence<{ readonly [K in keyof R]: [R[K]] extends [Equivalence<infer A>] ? A : never }> => {
226 const keys = Object.keys(fields)
227 return make((self, that) => {
228 for (const key of keys) {
229 if (!fields[key](self[key], that[key])) {
230 return false
231 }
232 }
233 return true
234 })
235}

Callers

nothing calls this directly

Calls 2

keysMethod · 0.80
makeFunction · 0.70

Tested by

no test coverage detected