diff --git a/lib/node_modules/@stdlib/string/substring-after-last/lib/main.js b/lib/node_modules/@stdlib/string/substring-after-last/lib/main.js index 89d1d6855dd9..787a3409cd4d 100644 --- a/lib/node_modules/@stdlib/string/substring-after-last/lib/main.js +++ b/lib/node_modules/@stdlib/string/substring-after-last/lib/main.js @@ -72,7 +72,7 @@ function substringAfterLast( str, search, fromIndex ) { } if ( arguments.length > 2 ) { if ( !isInteger( fromIndex ) ) { - throw new TypeError( format( 'invalid argument. Third argument must be a nonnegative integer. Value: `%s`.', fromIndex ) ); + throw new TypeError( format( 'invalid argument. Third argument must be an integer. Value: `%s`.', fromIndex ) ); } idx = str.lastIndexOf( search, fromIndex ); } else { diff --git a/lib/node_modules/@stdlib/string/substring-after-last/test/test.js b/lib/node_modules/@stdlib/string/substring-after-last/test/test.js index a14b06581f8d..4968d710a196 100644 --- a/lib/node_modules/@stdlib/string/substring-after-last/test/test.js +++ b/lib/node_modules/@stdlib/string/substring-after-last/test/test.js @@ -88,6 +88,15 @@ tape( 'the function throws an error if not provided a string as its second argum } }); +tape( 'the function throws an error if the start index is not an integer', function test( t ) { + t.throws( badValue, /Third argument must be an integer\./, 'reports that the start index must be an integer' ); + t.end(); + + function badValue() { + substringAfterLast( 'beep', 'b', -1.5 ); + } +}); + tape( 'the function returns the substring after the last occurrence of a provided search string', function test( t ) { var expected; var actual;