@@ -129,7 +129,7 @@ const qsWeirdObjects = [
129129 [ { regexp : / ./ g } , 'regexp=' , { 'regexp' : '' } ] ,
130130 // eslint-disable-next-line no-unescaped-regexp-dot
131131 [ { regexp : new RegExp ( '.' , 'g' ) } , 'regexp=' , { 'regexp' : '' } ] ,
132- [ { fn : function ( ) { } } , 'fn=' , { 'fn' : '' } ] ,
132+ [ { fn : ( ) => { } } , 'fn=' , { 'fn' : '' } ] ,
133133 [ { fn : new Function ( '' ) } , 'fn=' , { 'fn' : '' } ] ,
134134 [ { math : Math } , 'math=' , { 'math' : '' } ] ,
135135 [ { e : extendedFunction } , 'e=' , { 'e' : '' } ] ,
@@ -192,7 +192,7 @@ function check(actual, expected, input) {
192192 `Expected keys: ${ inspect ( expectedKeys ) } ` ;
193193 }
194194 assert . deepStrictEqual ( actualKeys , expectedKeys , msg ) ;
195- expectedKeys . forEach ( function ( key ) {
195+ expectedKeys . forEach ( ( key ) => {
196196 if ( typeof input === 'string' ) {
197197 msg = `Input: ${ inspect ( input ) } \n` +
198198 `Key: ${ inspect ( key ) } \n` +
@@ -206,21 +206,21 @@ function check(actual, expected, input) {
206206}
207207
208208// test that the canonical qs is parsed properly.
209- qsTestCases . forEach ( function ( testCase ) {
209+ qsTestCases . forEach ( ( testCase ) => {
210210 check ( qs . parse ( testCase [ 0 ] ) , testCase [ 2 ] , testCase [ 0 ] ) ;
211211} ) ;
212212
213213// test that the colon test cases can do the same
214- qsColonTestCases . forEach ( function ( testCase ) {
214+ qsColonTestCases . forEach ( ( testCase ) => {
215215 check ( qs . parse ( testCase [ 0 ] , ';' , ':' ) , testCase [ 2 ] , testCase [ 0 ] ) ;
216216} ) ;
217217
218218// test the weird objects, that they get parsed properly
219- qsWeirdObjects . forEach ( function ( testCase ) {
219+ qsWeirdObjects . forEach ( ( testCase ) => {
220220 check ( qs . parse ( testCase [ 1 ] ) , testCase [ 2 ] , testCase [ 1 ] ) ;
221221} ) ;
222222
223- qsNoMungeTestCases . forEach ( function ( testCase ) {
223+ qsNoMungeTestCases . forEach ( ( testCase ) => {
224224 assert . deepStrictEqual ( testCase [ 0 ] , qs . stringify ( testCase [ 1 ] , '&' , '=' ) ) ;
225225} ) ;
226226
@@ -258,15 +258,15 @@ qsNoMungeTestCases.forEach(function(testCase) {
258258// now test stringifying
259259
260260// basic
261- qsTestCases . forEach ( function ( testCase ) {
261+ qsTestCases . forEach ( ( testCase ) => {
262262 assert . strictEqual ( testCase [ 1 ] , qs . stringify ( testCase [ 2 ] ) ) ;
263263} ) ;
264264
265- qsColonTestCases . forEach ( function ( testCase ) {
265+ qsColonTestCases . forEach ( ( testCase ) => {
266266 assert . strictEqual ( testCase [ 1 ] , qs . stringify ( testCase [ 2 ] , ';' , ':' ) ) ;
267267} ) ;
268268
269- qsWeirdObjects . forEach ( function ( testCase ) {
269+ qsWeirdObjects . forEach ( ( testCase ) => {
270270 assert . strictEqual ( testCase [ 1 ] , qs . stringify ( testCase [ 0 ] ) ) ;
271271} ) ;
272272
@@ -300,7 +300,7 @@ assert.strictEqual('foo=', qs.stringify({ foo: Infinity }));
300300 assert . strictEqual ( f , 'a=b&q=x%3Dy%26y%3Dz' ) ;
301301}
302302
303- assert . doesNotThrow ( function ( ) {
303+ assert . doesNotThrow ( ( ) => {
304304 qs . parse ( undefined ) ;
305305} ) ;
306306
@@ -432,15 +432,15 @@ check(qs.parse('%\u0100=%\u0101'), { '%Ā': '%ā' });
432432}
433433
434434// Test QueryString.unescapeBuffer
435- qsUnescapeTestCases . forEach ( function ( testCase ) {
435+ qsUnescapeTestCases . forEach ( ( testCase ) => {
436436 assert . strictEqual ( qs . unescape ( testCase [ 0 ] ) , testCase [ 1 ] ) ;
437437 assert . strictEqual ( qs . unescapeBuffer ( testCase [ 0 ] ) . toString ( ) , testCase [ 1 ] ) ;
438438} ) ;
439439
440440// test overriding .unescape
441441{
442442 const prevUnescape = qs . unescape ;
443- qs . unescape = function ( str ) {
443+ qs . unescape = ( str ) => {
444444 return str . replace ( / o / g, '_' ) ;
445445 } ;
446446 check (
0 commit comments