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

Function Struct

packages/effect/src/Order.ts:618–631  ·  view source on GitHub ↗
(
  fields: R
)

Source from the content-addressed store, hash-verified

616 * @since 4.0.0
617 */
618export function Struct<const R extends { readonly [x: string]: Order<any> }>(
619 fields: R
620): Order<{ [K in keyof R]: [R[K]] extends [Order<infer A>] ? A : never }> {
621 const keys = Object.keys(fields)
622 return make((self, that) => {
623 for (const key of keys) {
624 const o = fields[key](self[key], that[key])
625 if (o !== 0) {
626 return o
627 }
628 }
629 return 0
630 })
631}
632
633/**
634 * Checks whether one value is strictly less than another according to the given order.

Callers

nothing calls this directly

Calls 1

makeFunction · 0.70

Tested by

no test coverage detected