MCPcopy
hub / github.com/pinokiocomputer/pinokio / buildReleaseNotesPreview

Function buildReleaseNotesPreview

full.js:72–94  ·  view source on GitHub ↗
(notes)

Source from the content-addressed store, hash-verified

70 return String(value).replace(/<[^>]*>/g, '')
71}
72const buildReleaseNotesPreview = (notes) => {
73 if (!notes) {
74 return ''
75 }
76 let text = ''
77 if (Array.isArray(notes)) {
78 text = notes.map((note) => note && (note.note || note.releaseNotes || note.title || '')).join('\n')
79 } else if (typeof notes === 'string') {
80 text = notes
81 } else {
82 text = String(notes)
83 }
84 const cleaned = stripHtmlTags(text).replace(/\r/g, '')
85 const lines = cleaned.split('\n').map((line) => line.trim()).filter(Boolean)
86 if (!lines.length) {
87 return ''
88 }
89 const firstLine = lines[0]
90 if (firstLine.length > 140) {
91 return `${firstLine.slice(0, 137)}...`
92 }
93 return firstLine
94}
95const buildProgressLabel = (progress) => {
96 if (!progress || typeof progress.percent !== 'number') {
97 return ''

Callers 1

buildUpdateBannerPayloadFunction · 0.85

Calls 1

stripHtmlTagsFunction · 0.85

Tested by

no test coverage detected