Fix StartOS 0.4 TypeScript packaging to match SDK API

This commit is contained in:
MacPro
2026-04-09 15:10:44 -05:00
parent 68ec875ee7
commit 8298c083c7
3436 changed files with 867051 additions and 92 deletions
+31
View File
@@ -0,0 +1,31 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.setupUninit = setupUninit;
exports.setupOnUninit = setupOnUninit;
/**
* Composes multiple uninit handlers into a single `ExpectedExports.uninit`-compatible function.
* Handlers are executed sequentially in the order provided.
*
* @param uninits - One or more uninit handlers to compose
*/
function setupUninit(...uninits) {
return async (opts) => {
for (const uninit of uninits) {
if ('uninit' in uninit)
await uninit.uninit(opts.effects, opts.target);
else
await uninit(opts.effects, opts.target);
}
};
}
/** Normalizes a {@link UninitScriptOrFn} into a {@link UninitScript} object. */
function setupOnUninit(onUninit) {
return 'uninit' in onUninit
? onUninit
: {
uninit: async (effects, target) => {
await onUninit(effects, target);
},
};
}
//# sourceMappingURL=setupUninit.js.map