MCPcopy Index your code
hub / github.com/Effect-TS/effect / setArbitrary

Function setArbitrary

packages/effect/src/Schema.ts:7770–7773  ·  view source on GitHub ↗
(item: LazyArbitrary<A>, ctx: ArbitraryGenerationContext)

Source from the content-addressed store, hash-verified

7768
7769const setArbitrary =
7770 <A>(item: LazyArbitrary<A>, ctx: ArbitraryGenerationContext): LazyArbitrary<ReadonlySet<A>> => (fc) => {
7771 const items = fc.array(item(fc))
7772 return (ctx.depthIdentifier !== undefined ? fc.oneof(ctx, fc.constant([]), items) : items).map((as) => new Set(as))
7773 }
7774
7775const readonlySetPretty = <A>(item: pretty_.Pretty<A>): pretty_.Pretty<ReadonlySet<A>> => (set) =>
7776 `new Set([${Array.from(set.values()).map((a) => item(a)).join(", ")}])`

Callers

nothing calls this directly

Calls 3

itemFunction · 0.85
arrayMethod · 0.80
mapMethod · 0.65

Tested by

no test coverage detected