lakutata
Version:
An IoC-based universal application framework.
26 lines (20 loc) • 527 B
JavaScript
import { IsPromiseLike as e } from "../../helpers/IsPromiseLike.mjs";
import "../../helpers/IsPromise.mjs";
import "util/types";
function t(t, n, r) {
async function s() {
await Promise.resolve();
await Reflect.apply(n, t, r !== null && r !== undefined ? r : []);
delete t["then"];
return t;
}
if (e(t)) {
i(t, Promise.resolve(t).then(s));
} else {
i(t, s());
}
}
function i(e, t) {
e.then = t.then.bind(t);
}
export { t as AppendAsyncConstructor };