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

Function array

packages/effect/src/Equivalence.ts:200–214  ·  view source on GitHub ↗
(item: Equivalence<A>)

Source from the content-addressed store, hash-verified

198 * @since 2.0.0
199 */
200export const array = <A>(item: Equivalence<A>): Equivalence<ReadonlyArray<A>> =>
201 make((self, that) => {
202 if (self.length !== that.length) {
203 return false
204 }
205
206 for (let i = 0; i < self.length; i++) {
207 const isEq = item(self[i], that[i])
208 if (!isEq) {
209 return false
210 }
211 }
212
213 return true
214 })
215
216/**
217 * Given a struct of `Equivalence`s returns a new `Equivalence` that compares values of a struct

Callers

nothing calls this directly

Calls 2

itemFunction · 0.85
makeFunction · 0.70

Tested by

no test coverage detected