File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
lib/node_modules/@stdlib/string/base/replace-after/lib Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 29
29
* @param {string } replacement - replacement string
30
30
* @param {string } search - search string
31
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
32
* @returns {string } substring
37
33
*
38
34
* @example
61
57
*/
62
58
function replaceAfter ( str , replacement , search , fromIndex ) {
63
59
var idx ;
60
+ if ( str === '' || search === '' ) {
61
+ return str ;
62
+ }
64
63
if ( arguments . length > 3 ) {
65
64
idx = str . indexOf ( search , fromIndex ) ;
66
65
} else {
You can’t perform that action at this time.
0 commit comments