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

Function normalisedValue

packages/core/src/prompts/autocomplete.ts:39–47  ·  view source on GitHub ↗
(multiple: boolean, values: T[] | undefined)

Source from the content-addressed store, hash-verified

37}
38
39function normalisedValue<T>(multiple: boolean, values: T[] | undefined): T | T[] | undefined {
40 if (!values) {
41 return undefined;
42 }
43 if (multiple) {
44 return values;
45 }
46 return values[0];
47}
48
49export interface AutocompleteOptions<T extends OptionLike>
50 extends PromptOptions<T['value'] | T['value'][], AutocompletePrompt<T>> {

Callers 1

#onKeyMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected