@@ -40,50 +40,26 @@ const parser = (content, filename) =>
40
40
} , '' ) ,
41
41
'tags' : {
42
42
'example' : curr . tags . filter ( tag => tag . type === 'example' )
43
- . reduce ( ( prev , curr ) => {
44
-
45
- prev . push ( curr . string ) ;
46
-
47
- return prev ;
48
-
49
- } , [ ] ) ,
43
+ . map ( tag => tag . string ) ,
50
44
'param' : curr . tags . filter ( tag => tag . type === 'param' )
51
- . reduce ( ( prev , curr ) => {
52
-
53
- prev . push ( {
54
- 'name' : formatStringForParam ( curr . name ) ,
55
- 'isOptional' : curr . optional ,
56
- 'types' : curr . types ,
57
- 'description' : curr . description
58
- } ) ;
59
-
60
- return prev ;
61
-
62
- } , [ ] ) ,
45
+ . map ( tag => ( {
46
+ 'name' : formatStringForParam ( tag . name ) ,
47
+ 'isOptional' : tag . optional ,
48
+ 'types' : tag . types ,
49
+ 'description' : tag . description
50
+ } ) ) ,
63
51
'property' : curr . tags . filter ( tag => tag . type === 'property' )
64
- . reduce ( ( prev , curr ) => {
65
-
66
- prev . push ( {
67
- 'name' : curr . name ,
68
- 'types' : curr . types ,
69
- 'description' : curr . description
70
- } ) ;
71
-
72
- return prev ;
73
-
74
- } , [ ] ) ,
52
+ . map ( tag => ( {
53
+ 'name' : tag . name ,
54
+ 'types' : tag . types ,
55
+ 'description' : tag . description
56
+ } ) ) ,
75
57
'return' : curr . tags . filter ( tag =>
76
58
tag . type === 'return' || tag . type === 'returns' )
77
- . reduce ( ( prev , curr ) => {
78
-
79
- prev . push ( {
80
- 'types' : curr . types ,
81
- 'description' : curr . description
82
- } ) ;
83
-
84
- return prev ;
85
-
86
- } , [ ] )
59
+ . map ( tag => ( {
60
+ 'types' : tag . types ,
61
+ 'description' : tag . description
62
+ } ) )
87
63
}
88
64
} ) ;
89
65
0 commit comments