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

Function mapFromSelf_

packages/effect/src/Schema.ts:7619–7637  ·  view source on GitHub ↗
(
  key: K,
  value: V,
  description: string
)

Source from the content-addressed store, hash-verified

7617{}
7618
7619const mapFromSelf_ = <K extends Schema.Any, V extends Schema.Any>(
7620 key: K,
7621 value: V,
7622 description: string
7623): ReadonlyMapFromSelf<K, V> =>
7624 declare(
7625 [key, value],
7626 {
7627 decode: (Key, Value) => readonlyMapParse(ParseResult.decodeUnknown(Array$(Tuple(Key, Value)))),
7628 encode: (Key, Value) => readonlyMapParse(ParseResult.encodeUnknown(Array$(Tuple(Key, Value))))
7629 },
7630 {
7631 typeConstructor: { _tag: "ReadonlyMap" },
7632 description,
7633 pretty: readonlyMapPretty,
7634 arbitrary: mapArbitrary,
7635 equivalence: readonlyMapEquivalence
7636 }
7637 )
7638
7639/**
7640 * @category ReadonlyMap

Callers 2

ReadonlyMapFromSelfFunction · 0.85
MapFromSelfFunction · 0.85

Calls 4

declareInterface · 0.85
readonlyMapParseFunction · 0.85
Array$Function · 0.70
TupleFunction · 0.70

Tested by

no test coverage detected