Files
url_tracker_tool/node_modules/standard-as-callback/built/index.js
Andrei 58f8093689 Rebrand from 'Redirect Intelligence v2' to 'URL Tracker Tool V2' throughout UI
- Updated all component headers and documentation
- Changed navbar and footer branding
- Updated homepage hero badge
- Modified page title in index.html
- Simplified footer text to 'Built with ❤️'
- Consistent V2 capitalization across all references
2025-08-19 19:12:23 +00:00

42 lines
1.3 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("./utils");
function throwLater(e) {
setTimeout(function () {
throw e;
}, 0);
}
function asCallback(promise, nodeback, options) {
if (typeof nodeback === "function") {
promise.then((val) => {
let ret;
if (options !== undefined &&
Object(options).spread &&
Array.isArray(val)) {
ret = utils_1.tryCatch(nodeback).apply(undefined, [null].concat(val));
}
else {
ret =
val === undefined
? utils_1.tryCatch(nodeback)(null)
: utils_1.tryCatch(nodeback)(null, val);
}
if (ret === utils_1.errorObj) {
throwLater(ret.e);
}
}, (cause) => {
if (!cause) {
const newReason = new Error(cause + "");
Object.assign(newReason, { cause });
cause = newReason;
}
const ret = utils_1.tryCatch(nodeback)(cause);
if (ret === utils_1.errorObj) {
throwLater(ret.e);
}
});
}
return promise;
}
exports.default = asCallback;