Files
NapCatQQ/.pnpm-store/v3/files/cb/41aea1add519be22322fbf53c21e492bd4d45f5d74debdecbf44bf05d1cb5645dc47b4ab880340ad40cebc8b32595b655e8028a222058b0d9c1d3c1c1aa9f0
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

73 lines
1.5 KiB
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
const util_js_1 = require("../util.cjs");
const zeroWidth = {
line: 0,
start: 0,
delimiter: 0,
postDelimiter: 0,
tag: 0,
postTag: 0,
name: 0,
postName: 0,
type: 0,
postType: 0,
description: 0,
end: 0,
lineEnd: 0
};
const headers = {
lineEnd: 'CR'
};
const fields = Object.keys(zeroWidth);
const repr = x => (0, util_js_1.isSpace)(x) ? `{${x.length}}` : x;
const frame = line => '|' + line.join('|') + '|';
const align = (width, tokens) => Object.keys(tokens).map(k => repr(tokens[k]).padEnd(width[k]));
function inspect({
source
}) {
var _a, _b;
if (source.length === 0) return '';
const width = Object.assign({}, zeroWidth);
for (const f of fields) width[f] = ((_a = headers[f]) !== null && _a !== void 0 ? _a : f).length;
for (const {
number,
tokens
} of source) {
width.line = Math.max(width.line, number.toString().length);
for (const k in tokens) width[k] = Math.max(width[k], repr(tokens[k]).length);
}
const lines = [[], []];
for (const f of fields) lines[0].push(((_b = headers[f]) !== null && _b !== void 0 ? _b : f).padEnd(width[f]));
for (const f of fields) lines[1].push('-'.padEnd(width[f], '-'));
for (const {
number,
tokens
} of source) {
const line = number.toString().padStart(width.line);
lines.push([line, ...align(width, tokens)]);
}
return lines.map(frame).join('\n');
}
exports.default = inspect;
//# sourceMappingURL=inspect.cjs.map