| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent bda3311 commit 9564f7a
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -43,4 +43,4 @@ function extractAndParseYAML(text) { | |||
| 43 | 43 | return meta; | |
| 44 | 44 | } | |
| 45 | 45 | ||
| 46 | - module.exports = { isYAMLBlock, extractAndParseYAML }; | ||
| 46 | + module.exports = { arrify, isYAMLBlock, extractAndParseYAML }; | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -308,7 +308,9 @@ function parseYAML(text) { | |||
| 308 | 308 | .use(htmlStringify) | |
| 309 | 309 | .processSync(change.description).toString(); | |
| 310 | 310 | ||
| 311 | - result += `<tr><td>${change.version}</td>\n` + | ||
| 311 | + const version = common.arrify(change.version).join(', '); | ||
| 312 | + | ||
| 313 | + result += `<tr><td>${version}</td>\n` + | ||
| 312 | 314 | `<td>${description}</td></tr>\n`; | |
| 313 | 315 | }); | |
| 314 | 316 | ||
@@ -326,10 +328,16 @@ function parseYAML(text) { | |||
| 326 | 328 | return result; | |
| 327 | 329 | } | |
| 328 | 330 | ||
| 331 | + function minVersion(a) { | ||
| 332 | + return common.arrify(a).reduce((min, e) => { | ||
| 333 | + return !min || versionSort(min, e) < 0 ? e : min; | ||
| 334 | + }); | ||
| 335 | + } | ||
| 336 | + | ||
| 329 | 337 | const numberRe = /^\d*/; | |
| 330 | 338 | function versionSort(a, b) { | |
| 331 | - a = a.trim(); | ||
| 332 | - b = b.trim(); | ||
| 339 | + a = minVersion(a).trim(); | ||
| 340 | + b = minVersion(b).trim(); | ||
| 333 | 341 | let i = 0; // Common prefix length. | |
| 334 | 342 | while (i < a.length && i < b.length && a[i] === b[i]) i++; | |
| 335 | 343 | a = a.substr(i); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments