Skip to content

Commit 1a4c5ec

Browse files
committed
Merge pull request react-bootstrap#924 from AlexKVal/docsGen
Small regexp refactorings.
2 parents 80d1780 + 2275a28 commit 1a4c5ec

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

docs/generate-metadata.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ let cleanDoclets = desc => {
1616
return (idx === -1 ? desc : desc.substr(0, idx )).trim();
1717
};
1818

19-
let cleanDocletValue = str => str.replace(/^\{/, '').replace(/\}$/, '');
19+
let cleanDocletValue = str => str.replace(/^\{|\}$/g, '');
2020

21-
let isLiteral = str => str.trim()[0] === '"' || str.trim()[0] === "'";
21+
let isLiteral = str => (/^('|")/).test(str.trim());
2222

2323
/**
2424
* parse out description doclets to an object and remove the comment

docs/src/PropTable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Label from '../../src/Label';
55
import Table from '../../src/Table';
66

77

8-
let cleanDocletValue = str => str.replace(/^\{/, '').replace(/\}$/, '');
8+
let cleanDocletValue = str => str.replace(/^\{|\}$/g, '');
99

1010
const PropTable = React.createClass({
1111

0 commit comments

Comments
 (0)