UNPKG

@sidequest/core

Version:

@sidequest/core is the core package of SideQuest, a distributed background job queue for Node.js and TypeScript applications.

20 lines (17 loc) 507 B
import { serializeError } from './serialize-error.js'; /** * Converts a string, Error, or ErrorData to ErrorData format. * @param error The error input (string, Error, or ErrorData). * @returns The error as ErrorData. */ function toErrorData(error) { if (error instanceof Error) { return serializeError(error); } else if (typeof error === "string") { return { message: error }; } return error; } export { toErrorData }; //# sourceMappingURL=parse-error-data.js.map