From 6ff0e394a911991930b2c477f7a70691798e1a59 Mon Sep 17 00:00:00 2001 From: Andreas Lind Date: Wed, 1 Aug 2018 15:46:47 +0200 Subject: [PATCH] Use String#slice instead of #substr https://github.com/ljharb/qs/pull/268#discussion_r206742835 --- lib/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils.js b/lib/utils.js index f513cca9..7390c9ef 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -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'; }); }