Files
NapCatQQ/.pnpm-store/v3/files/3b/64346f588204c0517a52735a7e4727a30087d8da98826ae74770d5f646dce0de9f4527ba8d2e81e5dd4449edd1300aa22a860ba140cbb5b70d86a735544150
T
TanTan e311ca3275
Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

20 lines
808 B
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.formatErrorCtor = void 0;
function formatDependency(params, idx) {
if (params === null) {
return `at position #${idx}`;
}
const argName = params.split(",")[idx].trim();
return `"${argName}" at position #${idx}`;
}
function composeErrorMessage(msg, e, indent = " ") {
return [msg, ...e.message.split("\n").map(l => indent + l)].join("\n");
}
function formatErrorCtor(ctor, paramIdx, error) {
const [, params = null] = ctor.toString().match(/constructor\(([\w, ]+)\)/) || [];
const dep = formatDependency(params, paramIdx);
return composeErrorMessage(`Cannot inject the dependency ${dep} of "${ctor.name}" constructor. Reason:`, error);
}
exports.formatErrorCtor = formatErrorCtor;