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

Function choice

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

Source from the content-addressed store, hash-verified

573 * @since 4.0.0
574 */
575export const choice = <
576 const Kind extends ParamKind,
577 const Choices extends ReadonlyArray<string>
578>(kind: Kind, name: string, choices: Choices): Param<Kind, Choices[number]> => {
579 const mappedChoices = choices.map((value) => [value, value] as const)
580 return choiceWithValue(kind, name, mappedChoices)
581}
582
583/**
584 * Creates a path parameter that accepts file or directory paths.

Callers

nothing calls this directly

Calls 2

choiceWithValueFunction · 0.70
mapMethod · 0.45

Tested by

no test coverage detected