MCPcopy Create free account
hub / github.com/TruthHun/BookStack / nodebackForPromise

Function nodebackForPromise

static/word2md/mammoth.browser.js:6638–6653  ·  view source on GitHub ↗
(promise, multiArgs)

Source from the content-addressed store, hash-verified

6636}
6637
6638function nodebackForPromise(promise, multiArgs) {
6639 return function(err, value) {
6640 if (promise === null) return;
6641 if (err) {
6642 var wrapped = wrapAsOperationalError(maybeWrapAsError(err));
6643 promise._attachExtraTrace(wrapped);
6644 promise._reject(wrapped);
6645 } else if (!multiArgs) {
6646 promise._fulfill(value);
6647 } else {
6648 var $_len = arguments.length;var args = new Array(Math.max($_len - 1, 0)); for(var $_i = 1; $_i < $_len; ++$_i) {args[$_i - 1] = arguments[$_i];};
6649 promise._fulfill(args);
6650 }
6651 promise = null;
6652 };
6653}
6654
6655module.exports = nodebackForPromise;
6656

Callers 2

mammoth.browser.jsFile · 0.70
promisifiedFunction · 0.70

Calls 2

wrapAsOperationalErrorFunction · 0.70
maybeWrapAsErrorFunction · 0.70

Tested by

no test coverage detected