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 d5046a0daf
commit 0b70cbb2bf
3436 changed files with 867051 additions and 92 deletions
+22
View File
@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.asError = void 0;
/**
* Converts an unknown thrown value into an Error instance.
* If `e` is already an Error, wraps it; if a string, uses it as the message;
* otherwise JSON-serializes it as the error message.
*
* @param e - The unknown value to convert
* @returns An Error instance
*/
const asError = (e) => {
if (e instanceof Error) {
return e;
}
if (typeof e === 'string') {
return new Error(`${e}`);
}
return new Error(`${JSON.stringify(e)}`);
};
exports.asError = asError;
//# sourceMappingURL=asError.js.map