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

Function Tuple

packages/effect/src/Equivalence.ts:541–555  ·  view source on GitHub ↗
(
  elements: Elements
)

Source from the content-addressed store, hash-verified

539 * @since 4.0.0
540 */
541export function Tuple<const Elements extends ReadonlyArray<Equivalence<any>>>(
542 elements: Elements
543): Equivalence<{ readonly [I in keyof Elements]: [Elements[I]] extends [Equivalence<infer A>] ? A : never }> {
544 return make((self, that) => {
545 if (self.length !== that.length) {
546 return false
547 }
548 for (let i = 0; i < self.length; i++) {
549 if (!elements[i](self[i], that[i])) {
550 return false
551 }
552 }
553 return true
554 })
555}
556
557/**
558 * @since 4.0.0

Callers

nothing calls this directly

Calls 1

makeFunction · 0.70

Tested by

no test coverage detected