Skip to content

Commit

Permalink
Changed String.endsWith implementation to use javascript endsWith
Browse files Browse the repository at this point in the history
  • Loading branch information
dengjeffrey committed Jan 5, 2019
1 parent a756f47 commit 51e83d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/parser/string-methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module.exports = {
throw new Error(`${substr} is not a string.`);
}

return str.indexOf(substr) + substr.length === str.length;
return str.endsWith(substr);
},

replace(str, substr, replacement) {
Expand Down

0 comments on commit 51e83d6

Please sign in to comment.