(promise, cb)
| 78 | } |
| 79 | |
| 80 | const tryCallback = (promise, cb) => { |
| 81 | if (typeof cb !== 'function') return promise |
| 82 | |
| 83 | return promise.then(value => { |
| 84 | setTimeout(() => cb(null, value), 0) |
| 85 | }, error => { |
| 86 | setTimeout(() => cb(error, null), 0) |
| 87 | }) |
| 88 | } |
| 89 | |
| 90 | const batchRequest = (client, path, params, cb) => { |
| 91 | return tryCallback( |
no outgoing calls
no test coverage detected