Skip to content

Commit

Permalink
Use String#slice instead of #substr
Browse files Browse the repository at this point in the history
  • Loading branch information
papandreou committed Aug 1, 2018
1 parent 376ec83 commit 6ff0e39
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ var encode = function encode(str, defaultEncoder, charset) {

if (charset === 'iso-8859-1') {
return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {
return '%26%23' + parseInt($0.substr(2), 16) + '%3B';
return '%26%23' + parseInt($0.slice(2), 16) + '%3B';
});
}

Expand Down

0 comments on commit 6ff0e39

Please sign in to comment.