(prompts, title, instructions, cb)
| 102 | } |
| 103 | |
| 104 | prompt(prompts, title, instructions, cb) { |
| 105 | if (!Array.isArray(prompts)) |
| 106 | prompts = [ prompts ]; |
| 107 | |
| 108 | if (typeof title === 'function') { |
| 109 | cb = title; |
| 110 | title = instructions = undefined; |
| 111 | } else if (typeof instructions === 'function') { |
| 112 | cb = instructions; |
| 113 | instructions = undefined; |
| 114 | } else if (typeof cb !== 'function') { |
| 115 | cb = undefined; |
| 116 | } |
| 117 | |
| 118 | for (let i = 0; i < prompts.length; ++i) { |
| 119 | if (typeof prompts[i] === 'string') { |
| 120 | prompts[i] = { |
| 121 | prompt: prompts[i], |
| 122 | echo: true |
| 123 | }; |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | this._cb = cb; |
| 128 | this._initialResponse = true; |
| 129 | |
| 130 | this._protocol.authInfoReq(title, instructions, prompts); |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | class PKAuthContext extends AuthContext { |
no test coverage detected