first commit

This commit is contained in:
2026-03-10 16:18:05 +00:00
commit 11f9c069b5
31635 changed files with 3187747 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createPendingSpawnAsync = createPendingSpawnAsync;
function createPendingSpawnAsync(actionAsync, spawnAsync) {
// Manually rsolve the child promise whenever the prepending async action is resolved.
// Avoid `childReject` to prevent "unhandled promise rejection" for one of the two promises.
let childResolve;
const child = new Promise((resolve, reject) => {
childResolve = resolve;
});
const pendingPromise = new Promise((spawnResolve, spawnReject) => {
actionAsync()
.then((result) => {
const spawnPromise = spawnAsync(result);
childResolve(spawnPromise.child);
spawnPromise.then(spawnResolve).catch(spawnReject);
})
.catch((error) => {
childResolve(null);
spawnReject(error);
});
});
pendingPromise.child = child;
return pendingPromise;
}
//# sourceMappingURL=spawn.js.map