Files
NapCatQQ/.pnpm-store/v3/files/b9/0b2e267154d51bcf2b5db7f856a22f3f4ada2f34715d3af765f4a466147f3858ab0e8686e3a1a2238d4bc9c4dfe71bff88cc6028d446844fe24f77ed6b6d7d
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

23 lines
547 B
Plaintext

module.exports = extractDescription
// Extracts description from contents of a readme file in markdown format
function extractDescription (d) {
if (!d) {
return
}
if (d === 'ERROR: No README data found!') {
return
}
// the first block of text before the first heading
// that isn't the first line heading
d = d.trim().split('\n')
for (var s = 0; d[s] && d[s].trim().match(/^(#|$)/); s++) {
;
}
var l = d.length
for (var e = s + 1; e < l && d[e].trim(); e++) {
;
}
return d.slice(s, e).join(' ').trim()
}