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

Function array

packages/effect/src/internal/schema/toArbitrary.ts:81–91  ·  view source on GitHub ↗
(fc: typeof FastCheck, ctx: Context, item: FastCheck.Arbitrary<any>, terminal = false)

Source from the content-addressed store, hash-verified

79}
80
81function array(fc: typeof FastCheck, ctx: Context, item: FastCheck.Arbitrary<any>, terminal = false) {
82 const constraint = ctx.constraint
83 const arrayConstraints = lengthToFastCheckConstraints(constraint)
84 validateArrayConstraints(arrayConstraints, "array")
85 return arrayWithConstraints(
86 fc,
87 item,
88 terminal ? { ...arrayConstraints, maxLength: arrayConstraints?.minLength ?? 0 } : arrayConstraints,
89 constraint?.unique ? Equal.equals : undefined
90 )
91}
92
93function appendArray(
94 fc: typeof FastCheck,

Callers 4

hashFunction · 0.85
transformValueFunction · 0.85
terminalFunction · 0.85
baseFunction · 0.85

Calls 3

validateArrayConstraintsFunction · 0.85
arrayWithConstraintsFunction · 0.85

Tested by

no test coverage detected