MCPcopy Index your code
hub / github.com/cameri/nostream / askForConfirmation

Function askForConfirmation

src/clean-db.ts:186–198  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

184}
185
186const askForConfirmation = async (): Promise<boolean> => {
187 const readline = createInterface({
188 input: process.stdin,
189 output: process.stdout,
190 })
191
192 const answer = await new Promise<string>((resolve) => {
193 readline.question("Type 'DELETE' to confirm: ", (input) => resolve(input))
194 })
195
196 readline.close()
197 return answer.trim() === 'DELETE'
198}
199
200const runAllDelete = async (dbClient: Knex): Promise<boolean> => {
201 const hasEventTagsTable = await dbClient.schema.hasTable('event_tags')

Callers 1

runCleanDbFunction · 0.85

Calls 1

closeMethod · 0.65

Tested by

no test coverage detected