MCPcopy Create free account
hub / github.com/bombshell-dev/clack / computeLabel

Function computeLabel

packages/prompts/src/select.ts:86–94  ·  view source on GitHub ↗
(label: string, format: (text: string) => string)

Source from the content-addressed store, hash-verified

84}
85
86const computeLabel = (label: string, format: (text: string) => string) => {
87 if (!label.includes('\n')) {
88 return format(label);
89 }
90 return label
91 .split('\n')
92 .map((line) => format(line))
93 .join('\n');
94};
95
96export const select = <Value>(opts: SelectOptions<Value>) => {
97 const opt = (

Callers 1

optFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected