Skip to content
This repository was archived by the owner on May 3, 2024. It is now read-only.

Commit 46c2114

Browse files
committed
Whitespace fix.
1 parent d92060c commit 46c2114

File tree

1 file changed

+56
-53
lines changed

1 file changed

+56
-53
lines changed

index.js

Lines changed: 56 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -10,80 +10,83 @@ const formatStringForUID = content =>
1010
.replace(/[^\w\.]+/g, '-')
1111
.replace(/^-|-$/g, '');
1212

13-
const parser = (content, filename) => dox.parseComments(content, {'raw': true}).reduce((prev, curr) => {
13+
const parser = (content, filename) =>
14+
dox.parseComments(content, {'raw': true}).reduce((prev, curr) => {
1415

15-
if (!curr.ignore && curr.ctx) {
16+
if (!curr.ignore && curr.ctx) {
1617

17-
prev.push({
18-
'uid': formatStringForUID(`${filename}-${curr.ctx.string}`),
19-
'isPrivate': curr.isPrivate,
20-
'type': curr.ctx.type,
21-
'name': formatStringForName(curr.ctx.string),
22-
'description': curr.description.full,
23-
'params': curr.tags.filter(tag => tag.type === 'param' && !tag.name.match(/\./))
24-
.reduce((prev, curr) => {
18+
prev.push({
19+
'uid': formatStringForUID(`${filename}-${curr.ctx.string}`),
20+
'isPrivate': curr.isPrivate,
21+
'type': curr.ctx.type,
22+
'name': formatStringForName(curr.ctx.string),
23+
'description': curr.description.full,
24+
'params': curr.tags.filter(tag =>
25+
tag.type === 'param' && !tag.name.match(/\./))
26+
.reduce((prev, curr) => {
2527

26-
if (prev) {
28+
if (prev) {
2729

28-
return `${prev}, ${curr.name.replace(/\[|\]/g, '')}`;
30+
return `${prev}, ${curr.name.replace(/\[|\]/g, '')}`;
2931

30-
}
32+
}
3133

32-
return `${curr.name.replace(/\[|\]/g, '')}`;
34+
return `${curr.name.replace(/\[|\]/g, '')}`;
3335

34-
}, ''),
35-
'tags': {
36-
'example': curr.tags.filter(tag => tag.type === 'example')
37-
.reduce((prev, curr) => {
36+
}, ''),
37+
'tags': {
38+
'example': curr.tags.filter(tag => tag.type === 'example')
39+
.reduce((prev, curr) => {
3840

39-
prev.push(curr.string);
41+
prev.push(curr.string);
4042

41-
return prev;
43+
return prev;
4244

43-
}, []),
44-
'param': curr.tags.filter(tag => tag.type === 'param')
45-
.reduce((prev, curr) => {
45+
}, []),
46+
'param': curr.tags.filter(tag => tag.type === 'param')
47+
.reduce((prev, curr) => {
4648

47-
prev.push({
48-
'name': curr.name.replace(/\[|\]/g, ''),
49-
'isOptional': curr.optional,
50-
'types': curr.types,
51-
'description': curr.description
52-
});
49+
prev.push({
50+
'name': curr.name.replace(/\[|\]/g, ''),
51+
'isOptional': curr.optional,
52+
'types': curr.types,
53+
'description': curr.description
54+
});
5355

54-
return prev;
56+
return prev;
5557

56-
}, []),
57-
'property': curr.tags.filter(tag => tag.type === 'property')
58-
.reduce((prev, curr) => {
58+
}, []),
59+
'property': curr.tags.filter(tag => tag.type === 'property')
60+
.reduce((prev, curr) => {
5961

60-
prev.push({
61-
'name': curr.name,
62-
'types': curr.types,
63-
'description': curr.description
64-
});
62+
prev.push({
63+
'name': curr.name,
64+
'types': curr.types,
65+
'description': curr.description
66+
});
6567

66-
return prev;
68+
return prev;
6769

68-
}, []),
69-
'return': curr.tags.filter(tag => tag.type === 'return' || tag.type === 'returns')
70-
.reduce((prev, curr) => {
70+
}, []),
71+
'return': curr.tags.filter(tag =>
72+
tag.type === 'return' || tag.type === 'returns')
73+
.reduce((prev, curr) => {
7174

72-
prev.push({
73-
'types': curr.types,
74-
'description': curr.description
75-
});
75+
prev.push({
76+
'types': curr.types,
77+
'description': curr.description
78+
});
7679

77-
return prev;
80+
return prev;
7881

79-
}, [])
80-
}
81-
});
82+
}, [])
83+
}
84+
});
8285

83-
}
86+
}
8487

85-
return prev;
88+
return prev;
8689

87-
}, []);
90+
}, []);
8891

8992
module.exports = parser;

0 commit comments

Comments
 (0)