File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,31 +13,28 @@ function arrify(value) {
1313}
1414
1515function extractAndParseYAML ( text ) {
16- text = text . trim ( ) ;
17-
18- text = text . replace ( / ^ < ! - - Y A M L / , '' )
16+ text = text . trim ( )
17+ . replace ( / ^ < ! - - Y A M L / , '' )
1918. replace ( / - - > $ / , '' ) ;
2019
2120// js-yaml.safeLoad() throws on error
2221const meta = yaml . safeLoad ( text ) ;
2322
24- const added = meta . added ;
25- if ( added ) {
23+ if ( meta . added ) {
2624// Since semver-minors can trickle down to previous major versions,
2725// features may have been added in multiple versions.
28- meta . added = arrify ( added ) ;
26+ meta . added = arrify ( meta . added ) ;
2927}
3028
31- const deprecated = meta . deprecated ;
32- if ( deprecated ) {
29+ if ( meta . deprecated ) {
3330// Treat deprecated like added for consistency.
34- meta . deprecated = arrify ( deprecated ) ;
31+ meta . deprecated = arrify ( meta . deprecated ) ;
3532}
3633
3734meta . changes = meta . changes || [ ] ;
38- meta . changes . forEach ( ( entry ) => {
35+ for ( const entry of meta . changes ) {
3936entry . description = entry . description . replace ( / ^ \^ \s * / , '' ) ;
40- } ) ;
37+ }
4138
4239return meta ;
4340}
You can’t perform that action at this time.
0 commit comments