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

Commit cf6e53e

Browse files
committed
Added formatStringForParam function.
1 parent 46c2114 commit cf6e53e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

index.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ const formatStringForName = content =>
44
content.toString()
55
.replace(/\.prototype|\(\)/g, '');
66

7+
const formatStringForParam = content =>
8+
content.toString()
9+
.replace(/\[|\]/g, '');
10+
711
const formatStringForUID = content =>
812
content.toString()
913
.toLowerCase()
@@ -27,11 +31,11 @@ const parser = (content, filename) =>
2731

2832
if (prev) {
2933

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

3236
}
3337

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

3640
}, ''),
3741
'tags': {
@@ -47,7 +51,7 @@ const parser = (content, filename) =>
4751
.reduce((prev, curr) => {
4852

4953
prev.push({
50-
'name': curr.name.replace(/\[|\]/g, ''),
54+
'name': formatStringForParam(curr.name),
5155
'isOptional': curr.optional,
5256
'types': curr.types,
5357
'description': curr.description

0 commit comments

Comments
 (0)