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

Function mapArbitrary

packages/effect/src/Schema.ts:7566–7575  ·  view source on GitHub ↗
(
  key: LazyArbitrary<K>,
  value: LazyArbitrary<V>,
  ctx: ArbitraryGenerationContext
)

Source from the content-addressed store, hash-verified

7564}
7565
7566const mapArbitrary = <K, V>(
7567 key: LazyArbitrary<K>,
7568 value: LazyArbitrary<V>,
7569 ctx: ArbitraryGenerationContext
7570): LazyArbitrary<Map<K, V>> => {
7571 return (fc) => {
7572 const items = fc.array(fc.tuple(key(fc), value(fc)))
7573 return (ctx.depthIdentifier !== undefined ? fc.oneof(ctx, fc.constant([]), items) : items).map((as) => new Map(as))
7574 }
7575}
7576
7577const readonlyMapPretty = <K, V>(
7578 key: pretty_.Pretty<K>,

Callers

nothing calls this directly

Calls 4

arrayMethod · 0.80
valueFunction · 0.70
mapMethod · 0.65
keyFunction · 0.50

Tested by

no test coverage detected