Skip to content

Commit 18f5e8f

Browse files
feat: main.js updated
1 parent 149949d commit 18f5e8f

File tree

1 file changed

+3
-4
lines changed
  • lib/node_modules/@stdlib/string/base/replace-after/lib

1 file changed

+3
-4
lines changed

lib/node_modules/@stdlib/string/base/replace-after/lib/main.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@
2929
* @param {string} replacement - replacement string
3030
* @param {string} search - search string
3131
* @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
3632
* @returns {string} substring
3733
*
3834
* @example
@@ -61,6 +57,9 @@
6157
*/
6258
function replaceAfter( str, replacement, search, fromIndex ) {
6359
var idx;
60+
if (str === '' || search === '') {
61+
return str;
62+
}
6463
if ( arguments.length > 3 ) {
6564
idx = str.indexOf( search, fromIndex );
6665
} else {

0 commit comments

Comments
 (0)