MCPcopy Index your code
hub / github.com/SeleniumHQ/selenium / checkedCall

Function checkedCall

javascript/selenium-webdriver/io/index.js:29–43  ·  view source on GitHub ↗

* @param {!Function} fn . * @return {!Promise } . * @template T

(fn)

Source from the content-addressed store, hash-verified

27 * @template T
28 */
29function checkedCall(fn) {
30 return new Promise((resolve, reject) => {
31 try {
32 fn((err, value) => {
33 if (err) {
34 reject(err)
35 } else {
36 resolve(value)
37 }
38 })
39 } catch (e) {
40 reject(e)
41 }
42 })
43}
44
45/**
46 * Recursively removes a directory and all of its contents. This is equivalent

Callers 8

statFunction · 0.85
tmpDirFunction · 0.85
tmpFileFunction · 0.85
readFunction · 0.85
writeFunction · 0.85
mkdirFunction · 0.85
mkdirpFunction · 0.85
walkDirFunction · 0.85

Calls 3

fnFunction · 0.50
rejectFunction · 0.50
resolveFunction · 0.50

Tested by

no test coverage detected