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

Function Select

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

Source from the content-addressed store, hash-verified

1299 * @since 4.0.0
1300 */
1301export const Select = <const A>(options: SelectOptions<A>): Prompt<A> => {
1302 const opts: SelectOptionsReq<A> = {
1303 maxPerPage: 10,
1304 ...options
1305 }
1306 const initialIndex = getSelectInitialIndex(opts.choices)
1307 return Custom(initialIndex, {
1308 render: handleSelectRender(opts),
1309 process: handleSelectProcess(opts),
1310 clear: handleSelectClear(opts)
1311 })
1312}
1313
1314/**
1315 * Creates a prompt that lets users filter select choices by typing.

Callers 8

Select.tst.tsFile · 0.50
Select.test.tsFile · 0.50
select.tsFile · 0.50
tiles.tsFile · 0.50
App.tsFile · 0.50

Calls 5

getSelectInitialIndexFunction · 0.85
handleSelectRenderFunction · 0.85
handleSelectProcessFunction · 0.85
handleSelectClearFunction · 0.85
CustomFunction · 0.70

Tested by

no test coverage detected