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

Function choice

packages/cli/src/internal/options.ts:262–270  ·  view source on GitHub ↗
(
  name: string,
  choices: C
)

Source from the content-addressed store, hash-verified

260
261/** @internal */
262export const choice = <A extends string, C extends ReadonlyArray<A>>(
263 name: string,
264 choices: C
265): Options.Options<C[number]> => {
266 const primitive = InternalPrimitive.choice(
267 Arr.map(choices, (choice) => [choice, choice])
268 )
269 return makeSingle(name, Arr.empty(), primitive)
270}
271
272/** @internal */
273export const choiceWithValue = <const C extends ReadonlyArray<[string, any]>>(

Callers

nothing calls this directly

Calls 2

makeSingleFunction · 0.70
mapMethod · 0.65

Tested by

no test coverage detected