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

Function arrayWithConstraints

packages/effect/src/internal/schema/toArbitrary.ts:70–79  ·  view source on GitHub ↗
(
  fc: typeof FastCheck,
  item: FastCheck.Arbitrary<any>,
  constraint: FastCheck.ArrayConstraints | undefined,
  comparator?: ((a: any, b: any) => boolean) | undefined
)

Source from the content-addressed store, hash-verified

68}
69
70function arrayWithConstraints(
71 fc: typeof FastCheck,
72 item: FastCheck.Arbitrary<any>,
73 constraint: FastCheck.ArrayConstraints | undefined,
74 comparator?: ((a: any, b: any) => boolean) | undefined
75) {
76 return comparator
77 ? fc.uniqueArray(item, { ...constraint, comparator })
78 : fc.array(item, constraint)
79}
80
81function array(fc: typeof FastCheck, ctx: Context, item: FastCheck.Arbitrary<any>, terminal = false) {
82 const constraint = ctx.constraint

Callers 3

arrayFunction · 0.85
terminalFunction · 0.85
baseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected