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

Function keyValuePair

packages/effect/src/unstable/cli/Param.ts:872–886  ·  view source on GitHub ↗
(
  kind: Kind,
  name: string
)

Source from the content-addressed store, hash-verified

870 * @since 4.0.0
871 */
872export const keyValuePair = <Kind extends ParamKind>(
873 kind: Kind,
874 name: string
875): Param<Kind, Record<string, string>> =>
876 map(
877 variadic(
878 makeSingle({
879 name,
880 primitiveType: Primitive.keyValuePair,
881 kind
882 }),
883 { min: 1 }
884 ),
885 (objects) => Object.fromEntries(objects.flatMap(Object.entries))
886 )
887
888/**
889 * Creates an empty sentinel parameter that always fails to parse.

Callers

nothing calls this directly

Calls 3

mapFunction · 0.85
variadicFunction · 0.85
makeSingleFunction · 0.70

Tested by

no test coverage detected