MCPcopy
hub / github.com/Effect-TS/effect / array

Function array

packages/effect/src/Order.ts:221–233  ·  view source on GitHub ↗
(O: Order<A>)

Source from the content-addressed store, hash-verified

219 * @since 2.0.0
220 */
221export const array = <A>(O: Order<A>): Order<ReadonlyArray<A>> =>
222 make((self, that) => {
223 const aLen = self.length
224 const bLen = that.length
225 const len = Math.min(aLen, bLen)
226 for (let i = 0; i < len; i++) {
227 const o = O(self[i], that[i])
228 if (o !== 0) {
229 return o
230 }
231 }
232 return number(aLen, bLen)
233 })
234
235/**
236 * This function creates and returns a new `Order` for a struct of values based on the given `Order`s

Callers

nothing calls this directly

Calls 2

makeFunction · 0.70
numberFunction · 0.70

Tested by

no test coverage detected