We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 47c26c3 commit 2eebd4fCopy full SHA for 2eebd4f
index.js
@@ -31,7 +31,9 @@ var flatten = require('lodash.flatten');
31
* @return {array}
32
*/
33
function replaceString(str, match, fn) {
34
- if (typeof str !== 'string' || !str) {
+ if (str === '') {
35
+ return str;
36
+ } else if (!str || !isString(str)) {
37
throw new TypeError('First argument to react-string-replace#replaceString must be a string');
38
}
39
0 commit comments