Update scripts

This commit is contained in:
freearhey 2025-02-27 20:55:39 +03:00
parent 5d52197f9c
commit 3fd1a03eea
5 changed files with 109 additions and 69 deletions

View file

@ -25,11 +25,11 @@ const FIELDS = new Dictionary({
export class IssueParser {
parse(issue: { number: number; body: string; labels: { name: string }[] }): Issue {
const fields = issue.body.split('###')
const fields = typeof issue.body === 'string' ? issue.body.split('###') : []
const data = new Dictionary()
fields.forEach((field: string) => {
const parsed = field.split(/\r?\n/).filter(Boolean)
const parsed = typeof field === 'string' ? field.split(/\r?\n/).filter(Boolean) : []
let _label = parsed.shift()
_label = _label ? _label.trim() : ''
let _value = parsed.join('\r\n')