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

Function select

packages/effect/src/unstable/cli/Prompt.ts:1136–1147  ·  view source on GitHub ↗
(options: SelectOptions<A>)

Source from the content-addressed store, hash-verified

1134 * @since 4.0.0
1135 */
1136export const select = <const A>(options: SelectOptions<A>): Prompt<A> => {
1137 const opts: SelectOptionsReq<A> = {
1138 maxPerPage: 10,
1139 ...options
1140 }
1141 const initialIndex = getSelectInitialIndex(opts.choices)
1142 return custom(initialIndex, {
1143 render: handleSelectRender(opts),
1144 process: handleSelectProcess(opts),
1145 clear: handleSelectClear(opts)
1146 })
1147}
1148
1149/**
1150 * Creates a prompt that lets users filter select choices by typing.

Callers

nothing calls this directly

Calls 5

getSelectInitialIndexFunction · 0.85
handleSelectRenderFunction · 0.85
handleSelectProcessFunction · 0.85
handleSelectClearFunction · 0.85
customFunction · 0.70

Tested by

no test coverage detected