MCPcopy Create free account
hub / github.com/omkarcloud/botasaurus / wrapDbOperationInPromise

Function wrapDbOperationInPromise

js/botasaurus-server-js/src/utils.ts:142–149  ·  view source on GitHub ↗
(operation: any)

Source from the content-addressed store, hash-verified

140
141// Wrap NeDB operations in promises since it uses callbacks
142function wrapDbOperationInPromise<A=any>(operation: any): Promise<A> {
143 return new Promise((resolve, reject) => {
144 operation((err: Error, result: any) => {
145 if (err) reject(err)
146 else resolve(result)
147 })
148 })
149}
150function isNoentError(error: any) {
151 return error.code === 'ENOENT'
152}

Callers 4

performCreateAllTaskFunction · 0.90
queryTasksFunction · 0.90
queryTasksWithFiltersFunction · 0.90
executeDownloadTaskListFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected