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

Function struct

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

Source from the content-addressed store, hash-verified

240 * @since 2.0.0
241 */
242export const struct = <R extends { readonly [x: string]: Order<any> }>(
243 fields: R
244): Order<{ [K in keyof R]: [R[K]] extends [Order<infer A>] ? A : never }> => {
245 const keys = Object.keys(fields)
246 return make((self, that) => {
247 for (const key of keys) {
248 const o = fields[key](self[key], that[key])
249 if (o !== 0) {
250 return o
251 }
252 }
253 return 0
254 })
255}
256
257/**
258 * Test whether one value is _strictly less than_ another.

Callers 2

_caseFunction · 0.70
taggedFunction · 0.70

Calls 2

keysMethod · 0.80
makeFunction · 0.70

Tested by

no test coverage detected