Skip to content

Commit 2eebd4f

Browse files
committed
Allow emptry strings within results array. Closes
1 parent 47c26c3 commit 2eebd4f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ var flatten = require('lodash.flatten');
3131
* @return {array}
3232
*/
3333
function replaceString(str, match, fn) {
34-
if (typeof str !== 'string' || !str) {
34+
if (str === '') {
35+
return str;
36+
} else if (!str || !isString(str)) {
3537
throw new TypeError('First argument to react-string-replace#replaceString must be a string');
3638
}
3739

0 commit comments

Comments
 (0)