Files
SnowLuma/.pnpm-store/v11/files/09/69be22392ce2f276ca96a1331a6e2bb0d5d76c0bc95d4377d47b17c43b5f7b2534c3581acfb4692da25f75f4f34397b12ba473629f780052608c5414a629d8
TanTan 2a69b23b47
Dev Build / cleanup (push) Canceled after 0s
Dev Build / typecheck (push) Canceled after 0s
Dev Build / build (linux-arm64, ubuntu-24.04-arm, linux-arm64) (push) Canceled after 0s
Dev Build / build (linux-x64, ubuntu-latest, linux-x64) (push) Canceled after 0s
Dev Build / build (win-x64, windows-latest, win32-x64) (push) Canceled after 0s
Dev Build / dispatch-dev-docker (push) Skipped
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

20 lines
495 B
Plaintext

"use strict";
function returnValue(value) {
return value;
}
function formatMessage(message, callback = returnValue) {
return message.reduce((prev, curr, index) => {
let msg;
if (curr instanceof Error) {
msg = curr.stack || curr.message;
} else if (typeof curr === "object") {
msg = JSON.stringify(curr);
} else {
msg = String(curr);
}
msg = callback(msg);
return index === 0 ? msg : `${prev} ${msg}`;
}, "");
}
module.exports = formatMessage;