MCPcopy Index your code
hub / github.com/nodejs/node / Interface

Function Interface

lib/readline.js:101–121  ·  view source on GitHub ↗
(input, output, completer, terminal)

Source from the content-addressed store, hash-verified

99let addAbortListener;
100
101function Interface(input, output, completer, terminal) {
102 if (!(this instanceof Interface)) {
103 return new Interface(input, output, completer, terminal);
104 }
105
106 if (input?.input &&
107 typeof input.completer === 'function' && input.completer.length !== 2) {
108 const { completer } = input;
109 input.completer = (v, cb) => cb(null, completer(v));
110 } else if (typeof completer === 'function' && completer.length !== 2) {
111 const realCompleter = completer;
112 completer = (v, cb) => cb(null, realCompleter(v));
113 }
114
115 FunctionPrototypeCall(InterfaceConstructor, this,
116 input, output, completer, terminal);
117
118 if (process.env.TERM === 'dumb') {
119 this._ttyWrite = FunctionPrototypeBind(_ttyWriteDumb, this);
120 }
121}
122
123ObjectSetPrototypeOf(Interface.prototype, _Interface.prototype);
124ObjectSetPrototypeOf(Interface, _Interface);

Callers

nothing calls this directly

Calls 2

cbFunction · 0.50
completerFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…