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

Method confirmOperation

deps/npm/lib/trust-cmd.js:150–166  ·  view source on GitHub ↗
(yes)

Source from the content-addressed store, hash-verified

148 }
149
150 async confirmOperation (yes) {
151 // Ask for confirmation unless --yes flag is set
152 if (yes === true) {
153 return
154 }
155 if (yes === false) {
156 throw new Error('User cancelled operation')
157 }
158 const confirm = await input.read(
159 () => _read({ prompt: 'Do you want to proceed? (y/N) ', default: 'n' })
160 )
161 const normalized = confirm.toLowerCase()
162 if (['y', 'yes'].includes(normalized)) {
163 return
164 }
165 throw new Error('User cancelled operation')
166 }
167
168 getFrontendUrl ({ pkgName }) {
169 if (this.registryIsDefault) {

Callers 1

createConfigCommandMethod · 0.95

Calls 3

includesMethod · 0.80
_readFunction · 0.50
readMethod · 0.45

Tested by

no test coverage detected