MCPcopy
hub / github.com/bombshell-dev/clack / constructor

Method constructor

packages/core/src/prompts/text.ts:25–42  ·  view source on GitHub ↗
(opts: TextOptions)

Source from the content-addressed store, hash-verified

23 return this._cursor;
24 }
25 constructor(opts: TextOptions) {
26 super({
27 ...opts,
28 initialUserInput: opts.initialUserInput ?? opts.initialValue,
29 });
30
31 this.on('userInput', (input) => {
32 this._setValue(input);
33 });
34 this.on('finalize', () => {
35 if (!this.value) {
36 this.value = opts.defaultValue;
37 }
38 if (this.value === undefined) {
39 this.value = '';
40 }
41 });
42 }
43}

Callers

nothing calls this directly

Calls 2

onMethod · 0.80
_setValueMethod · 0.80

Tested by

no test coverage detected