File tree 1 file changed +8
-11
lines changed
1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -13,31 +13,28 @@ function arrify(value) {
13
13
}
14
14
15
15
function 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 / , '' )
19
18
. replace ( / - - > $ / , '' ) ;
20
19
21
20
// js-yaml.safeLoad() throws on error
22
21
const meta = yaml . safeLoad ( text ) ;
23
22
24
- const added = meta . added ;
25
- if ( added ) {
23
+ if ( meta . added ) {
26
24
// Since semver-minors can trickle down to previous major versions,
27
25
// features may have been added in multiple versions.
28
- meta . added = arrify ( added ) ;
26
+ meta . added = arrify ( meta . added ) ;
29
27
}
30
28
31
- const deprecated = meta . deprecated ;
32
- if ( deprecated ) {
29
+ if ( meta . deprecated ) {
33
30
// Treat deprecated like added for consistency.
34
- meta . deprecated = arrify ( deprecated ) ;
31
+ meta . deprecated = arrify ( meta . deprecated ) ;
35
32
}
36
33
37
34
meta . changes = meta . changes || [ ] ;
38
- meta . changes . forEach ( ( entry ) => {
35
+ for ( const entry of meta . changes ) {
39
36
entry . description = entry . description . replace ( / ^ \^ \s * / , '' ) ;
40
- } ) ;
37
+ }
41
38
42
39
return meta ;
43
40
}
You can’t perform that action at this time.
0 commit comments