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 149949d commit 18f5e8fCopy full SHA for 18f5e8f
lib/node_modules/@stdlib/string/base/replace-after/lib/main.js
@@ -29,10 +29,6 @@
29
* @param {string} replacement - replacement string
30
* @param {string} search - search string
31
* @param {integer} [fromIndex=0] - index at which to start the search
32
-* @throws {TypeError} first argument must be a string
33
-* @throws {TypeError} second argument must be a string
34
-* @throws {TypeError} third argument must be a string
35
-* @throws {TypeError} fourth argument must be an integer
36
* @returns {string} substring
37
*
38
* @example
@@ -61,6 +57,9 @@
61
57
*/
62
58
function replaceAfter( str, replacement, search, fromIndex ) {
63
59
var idx;
60
+ if (str === '' || search === '') {
+ return str;
+ }
64
if ( arguments.length > 3 ) {
65
idx = str.indexOf( search, fromIndex );
66
} else {
0 commit comments