-first commit

This commit is contained in:
2025-11-11 12:36:06 +07:00
commit b99c214434
5683 changed files with 713336 additions and 0 deletions

41
node_modules/standard-as-callback/built/index.js generated vendored Normal file
View File

@@ -0,0 +1,41 @@
"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;