Merging this separately so the commit with the tooling change is readable. This is a follow-on to #1167 which turned prettier on.
18 lines
297 B
JavaScript
18 lines
297 B
JavaScript
'use strict'
|
|
|
|
// Execute a synchronous block and invoke a standard error-first callback with
|
|
// the result.
|
|
function nodeifySync(resultFn, callback) {
|
|
let result, error
|
|
|
|
try {
|
|
result = resultFn()
|
|
} catch (e) {
|
|
error = e
|
|
}
|
|
|
|
callback(error, result)
|
|
}
|
|
|
|
module.exports = nodeifySync
|