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

Function Struct

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

Source from the content-addressed store, hash-verified

640 * @since 4.0.0
641 */
642export function Struct<R extends Record<PropertyKey, Order<any>>>(
643 fields: R
644): Order<{ readonly [K in keyof R]: [R[K]] extends [Order<infer A>] ? A : never }> {
645 const keys = InternalRecord.ownEnumerableKeys(fields) as Array<keyof R>
646 return make((self, that) => {
647 for (const key of keys) {
648 const o = fields[key](self[key], that[key])
649 if (o !== 0) {
650 return o
651 }
652 }
653 return 0
654 })
655}
656
657/**
658 * 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