윤규리

rebase

1 +<<<<<<< HEAD
1 const { response } = require('express'); 2 const { response } = require('express');
2 const fetch = require('node-fetch') 3 const fetch = require('node-fetch')
3 4
...@@ -92,4 +93,18 @@ function getXY(hospitals, addNum) { ...@@ -92,4 +93,18 @@ function getXY(hospitals, addNum) {
92 // for loop 다 돈 다음에 return하도록 수정해야함 (하실수 있는분?) 93 // for loop 다 돈 다음에 return하도록 수정해야함 (하실수 있는분?)
93 } 94 }
94 95
95 -module.exports = {getAddress, getXY};
...\ No newline at end of file ...\ No newline at end of file
96 +module.exports = {getAddress, getXY};
97 +=======
98 +// 모듈을 읽어 들입니다.
99 +const request = require('request');
100 +// 요청을 위한 상수를 선언합니다: TOKEN은 자신의 것을 입력해주세요.
101 +const TARGET_URL = 'https://notify-api.line.me/api/notify';
102 +const TOKEN = '2lGVtxPmn2VOsRczarnwqvQ6cMFOpCMnk3QHA4Ykd2E';
103 +
104 +GET /v2/local/search/address.${FORMAT} HTTP/1.1
105 +Host: dapi.kakao.com
106 +Authorization: KakaoAK ${REST_API_KEY}
107 +
108 +curl -X GET "https://dapi.kakao.com/v2/local/search/address.json?analyze_type=similar&page=1&size=10&query=${ask}" \
109 + -H "Authorization: KakaoAK c14234ba46c574c73715276c5644f397"
110 +>>>>>>> bef06db (Init Address.js)
......
...@@ -55,10 +55,34 @@ try { ...@@ -55,10 +55,34 @@ try {
55 cert: fs.readFileSync('./rootca.crt' ,'utf8'), 55 cert: fs.readFileSync('./rootca.crt' ,'utf8'),
56 }; 56 };
57 57
58 +<<<<<<< HEAD
58 HTTPS.createServer(option, app).listen(sslport, () => { 59 HTTPS.createServer(option, app).listen(sslport, () => {
59 console.log(`[HTTPS] Server is started on port ${sslport}`); 60 console.log(`[HTTPS] Server is started on port ${sslport}`);
60 }); 61 });
61 } catch (error) { 62 } catch (error) {
62 console.log('[HTTPS] HTTPS 오류가 발생하였습니다. HTTPS 서버는 실행되지 않습니다.'); 63 console.log('[HTTPS] HTTPS 오류가 발생하였습니다. HTTPS 서버는 실행되지 않습니다.');
63 console.log(error); 64 console.log(error);
64 - }
...\ No newline at end of file ...\ No newline at end of file
65 + }
66 +=======
67 + if (question === '테스트') {
68 + const data = {
69 + 'version': '2.0',
70 + 'template': {
71 + 'outputs': [{
72 + 'simpleText': {
73 + 'text': '테스트'
74 + }
75 + }],
76 + 'quickReplies': [{
77 + 'label': goMain,
78 + 'action': 'message',
79 + 'messageText': goMain
80 + }]
81 + }
82 + }
83 + }
84 + res.json(data);
85 +});
86 +
87 +app.listen(23023, () => console.log('node on 23023'));
88 +>>>>>>> bef06db (Init Address.js)
......
...@@ -4,7 +4,10 @@ ...@@ -4,7 +4,10 @@
4 "requires": true, 4 "requires": true,
5 "packages": { 5 "packages": {
6 <<<<<<< HEAD 6 <<<<<<< HEAD
7 +<<<<<<< HEAD
8 +=======
7 ======= 9 =======
10 +>>>>>>> bef06db (Init Address.js)
8 "node_modules/accepts": { 11 "node_modules/accepts": {
9 "version": "1.3.8", 12 "version": "1.3.8",
10 "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", 13 "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",
...@@ -17,6 +20,7 @@ ...@@ -17,6 +20,7 @@
17 "node": ">= 0.6" 20 "node": ">= 0.6"
18 } 21 }
19 }, 22 },
23 +<<<<<<< HEAD
20 >>>>>>> main 24 >>>>>>> main
21 "node_modules/ajv": { 25 "node_modules/ajv": {
22 "version": "6.12.6", 26 "version": "6.12.6",
...@@ -35,11 +39,14 @@ ...@@ -35,11 +39,14 @@
35 }, 39 },
36 <<<<<<< HEAD 40 <<<<<<< HEAD
37 ======= 41 =======
42 +=======
43 +>>>>>>> bef06db (Init Address.js)
38 "node_modules/array-flatten": { 44 "node_modules/array-flatten": {
39 "version": "1.1.1", 45 "version": "1.1.1",
40 "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", 46 "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
41 "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" 47 "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg=="
42 }, 48 },
49 +<<<<<<< HEAD
43 >>>>>>> main 50 >>>>>>> main
44 "node_modules/asn1": { 51 "node_modules/asn1": {
45 "version": "0.2.6", 52 "version": "0.2.6",
...@@ -85,6 +92,8 @@ ...@@ -85,6 +92,8 @@
85 }, 92 },
86 <<<<<<< HEAD 93 <<<<<<< HEAD
87 ======= 94 =======
95 +=======
96 +>>>>>>> bef06db (Init Address.js)
88 "node_modules/body-parser": { 97 "node_modules/body-parser": {
89 "version": "1.20.1", 98 "version": "1.20.1",
90 "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", 99 "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz",
...@@ -108,6 +117,7 @@ ...@@ -108,6 +117,7 @@
108 "npm": "1.2.8000 || >= 1.4.16" 117 "npm": "1.2.8000 || >= 1.4.16"
109 } 118 }
110 }, 119 },
120 +<<<<<<< HEAD
111 "node_modules/body-parser/node_modules/qs": { 121 "node_modules/body-parser/node_modules/qs": {
112 "version": "6.11.0", 122 "version": "6.11.0",
113 "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", 123 "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz",
...@@ -122,6 +132,8 @@ ...@@ -122,6 +132,8 @@
122 "url": "https://github.com/sponsors/ljharb" 132 "url": "https://github.com/sponsors/ljharb"
123 } 133 }
124 }, 134 },
135 +=======
136 +>>>>>>> bef06db (Init Address.js)
125 "node_modules/bytes": { 137 "node_modules/bytes": {
126 "version": "3.1.2", 138 "version": "3.1.2",
127 "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", 139 "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
...@@ -142,6 +154,7 @@ ...@@ -142,6 +154,7 @@
142 "url": "https://github.com/sponsors/ljharb" 154 "url": "https://github.com/sponsors/ljharb"
143 } 155 }
144 }, 156 },
157 +<<<<<<< HEAD
145 >>>>>>> main 158 >>>>>>> main
146 "node_modules/caseless": { 159 "node_modules/caseless": {
147 "version": "0.12.0", 160 "version": "0.12.0",
...@@ -161,6 +174,8 @@ ...@@ -161,6 +174,8 @@
161 }, 174 },
162 <<<<<<< HEAD 175 <<<<<<< HEAD
163 ======= 176 =======
177 +=======
178 +>>>>>>> bef06db (Init Address.js)
164 "node_modules/content-disposition": { 179 "node_modules/content-disposition": {
165 "version": "0.5.4", 180 "version": "0.5.4",
166 "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", 181 "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz",
...@@ -193,6 +208,7 @@ ...@@ -193,6 +208,7 @@
193 "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", 208 "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
194 "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" 209 "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ=="
195 }, 210 },
211 +<<<<<<< HEAD
196 >>>>>>> main 212 >>>>>>> main
197 "node_modules/core-util-is": { 213 "node_modules/core-util-is": {
198 "version": "1.0.2", 214 "version": "1.0.2",
...@@ -212,6 +228,8 @@ ...@@ -212,6 +228,8 @@
212 }, 228 },
213 <<<<<<< HEAD 229 <<<<<<< HEAD
214 ======= 230 =======
231 +=======
232 +>>>>>>> bef06db (Init Address.js)
215 "node_modules/debug": { 233 "node_modules/debug": {
216 "version": "2.6.9", 234 "version": "2.6.9",
217 "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", 235 "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
...@@ -220,6 +238,7 @@ ...@@ -220,6 +238,7 @@
220 "ms": "2.0.0" 238 "ms": "2.0.0"
221 } 239 }
222 }, 240 },
241 +<<<<<<< HEAD
223 >>>>>>> main 242 >>>>>>> main
224 "node_modules/delayed-stream": { 243 "node_modules/delayed-stream": {
225 "version": "1.0.0", 244 "version": "1.0.0",
...@@ -231,6 +250,8 @@ ...@@ -231,6 +250,8 @@
231 }, 250 },
232 <<<<<<< HEAD 251 <<<<<<< HEAD
233 ======= 252 =======
253 +=======
254 +>>>>>>> bef06db (Init Address.js)
234 "node_modules/depd": { 255 "node_modules/depd": {
235 "version": "2.0.0", 256 "version": "2.0.0",
236 "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", 257 "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
...@@ -248,6 +269,7 @@ ...@@ -248,6 +269,7 @@
248 "npm": "1.2.8000 || >= 1.4.16" 269 "npm": "1.2.8000 || >= 1.4.16"
249 } 270 }
250 }, 271 },
272 +<<<<<<< HEAD
251 >>>>>>> main 273 >>>>>>> main
252 "node_modules/ecc-jsbn": { 274 "node_modules/ecc-jsbn": {
253 "version": "0.1.2", 275 "version": "0.1.2",
...@@ -260,6 +282,8 @@ ...@@ -260,6 +282,8 @@
260 }, 282 },
261 <<<<<<< HEAD 283 <<<<<<< HEAD
262 ======= 284 =======
285 +=======
286 +>>>>>>> bef06db (Init Address.js)
263 "node_modules/ee-first": { 287 "node_modules/ee-first": {
264 "version": "1.1.1", 288 "version": "1.1.1",
265 "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", 289 "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
...@@ -273,6 +297,7 @@ ...@@ -273,6 +297,7 @@
273 "node": ">= 0.8" 297 "node": ">= 0.8"
274 } 298 }
275 }, 299 },
300 +<<<<<<< HEAD
276 "node_modules/encoding": { 301 "node_modules/encoding": {
277 "version": "0.1.13", 302 "version": "0.1.13",
278 "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", 303 "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz",
...@@ -292,6 +317,8 @@ ...@@ -292,6 +317,8 @@
292 "node": ">=0.10.0" 317 "node": ">=0.10.0"
293 } 318 }
294 }, 319 },
320 +=======
321 +>>>>>>> bef06db (Init Address.js)
295 "node_modules/escape-html": { 322 "node_modules/escape-html": {
296 "version": "1.0.3", 323 "version": "1.0.3",
297 "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", 324 "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
...@@ -346,6 +373,7 @@ ...@@ -346,6 +373,7 @@
346 "node": ">= 0.10.0" 373 "node": ">= 0.10.0"
347 } 374 }
348 }, 375 },
376 +<<<<<<< HEAD
349 "node_modules/express/node_modules/qs": { 377 "node_modules/express/node_modules/qs": {
350 "version": "6.11.0", 378 "version": "6.11.0",
351 "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", 379 "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz",
...@@ -386,6 +414,8 @@ ...@@ -386,6 +414,8 @@
386 }, 414 },
387 <<<<<<< HEAD 415 <<<<<<< HEAD
388 ======= 416 =======
417 +=======
418 +>>>>>>> bef06db (Init Address.js)
389 "node_modules/finalhandler": { 419 "node_modules/finalhandler": {
390 "version": "1.2.0", 420 "version": "1.2.0",
391 "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", 421 "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz",
...@@ -403,6 +433,7 @@ ...@@ -403,6 +433,7 @@
403 "node": ">= 0.8" 433 "node": ">= 0.8"
404 } 434 }
405 }, 435 },
436 +<<<<<<< HEAD
406 >>>>>>> main 437 >>>>>>> main
407 "node_modules/forever-agent": { 438 "node_modules/forever-agent": {
408 "version": "0.6.1", 439 "version": "0.6.1",
...@@ -427,6 +458,8 @@ ...@@ -427,6 +458,8 @@
427 }, 458 },
428 <<<<<<< HEAD 459 <<<<<<< HEAD
429 ======= 460 =======
461 +=======
462 +>>>>>>> bef06db (Init Address.js)
430 "node_modules/forwarded": { 463 "node_modules/forwarded": {
431 "version": "0.2.0", 464 "version": "0.2.0",
432 "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", 465 "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
...@@ -461,6 +494,7 @@ ...@@ -461,6 +494,7 @@
461 "url": "https://github.com/sponsors/ljharb" 494 "url": "https://github.com/sponsors/ljharb"
462 } 495 }
463 }, 496 },
497 +<<<<<<< HEAD
464 >>>>>>> main 498 >>>>>>> main
465 "node_modules/getpass": { 499 "node_modules/getpass": {
466 "version": "0.1.7", 500 "version": "0.1.7",
...@@ -493,6 +527,8 @@ ...@@ -493,6 +527,8 @@
493 }, 527 },
494 <<<<<<< HEAD 528 <<<<<<< HEAD
495 ======= 529 =======
530 +=======
531 +>>>>>>> bef06db (Init Address.js)
496 "node_modules/has": { 532 "node_modules/has": {
497 "version": "1.0.3", 533 "version": "1.0.3",
498 "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", 534 "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
...@@ -530,6 +566,7 @@ ...@@ -530,6 +566,7 @@
530 "node": ">= 0.8" 566 "node": ">= 0.8"
531 } 567 }
532 }, 568 },
569 +<<<<<<< HEAD
533 >>>>>>> main 570 >>>>>>> main
534 "node_modules/http-signature": { 571 "node_modules/http-signature": {
535 "version": "1.2.0", 572 "version": "1.2.0",
...@@ -547,6 +584,8 @@ ...@@ -547,6 +584,8 @@
547 }, 584 },
548 <<<<<<< HEAD 585 <<<<<<< HEAD
549 ======= 586 =======
587 +=======
588 +>>>>>>> bef06db (Init Address.js)
550 "node_modules/iconv-lite": { 589 "node_modules/iconv-lite": {
551 "version": "0.4.24", 590 "version": "0.4.24",
552 "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", 591 "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
...@@ -571,6 +610,7 @@ ...@@ -571,6 +610,7 @@
571 "node": ">= 0.10" 610 "node": ">= 0.10"
572 } 611 }
573 }, 612 },
613 +<<<<<<< HEAD
574 >>>>>>> main 614 >>>>>>> main
575 "node_modules/is-typedarray": { 615 "node_modules/is-typedarray": {
576 "version": "1.0.0", 616 "version": "1.0.0",
...@@ -626,6 +666,8 @@ ...@@ -626,6 +666,8 @@
626 }, 666 },
627 <<<<<<< HEAD 667 <<<<<<< HEAD
628 ======= 668 =======
669 +=======
670 +>>>>>>> bef06db (Init Address.js)
629 "node_modules/media-typer": { 671 "node_modules/media-typer": {
630 "version": "0.3.0", 672 "version": "0.3.0",
631 "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", 673 "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
...@@ -658,7 +700,10 @@ ...@@ -658,7 +700,10 @@
658 "node": ">=4" 700 "node": ">=4"
659 } 701 }
660 }, 702 },
703 +<<<<<<< HEAD
661 >>>>>>> main 704 >>>>>>> main
705 +=======
706 +>>>>>>> bef06db (Init Address.js)
662 "node_modules/mime-db": { 707 "node_modules/mime-db": {
663 "version": "1.52.0", 708 "version": "1.52.0",
664 "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", 709 "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
...@@ -679,7 +724,10 @@ ...@@ -679,7 +724,10 @@
679 } 724 }
680 }, 725 },
681 <<<<<<< HEAD 726 <<<<<<< HEAD
727 +<<<<<<< HEAD
682 ======= 728 =======
729 +=======
730 +>>>>>>> bef06db (Init Address.js)
683 "node_modules/ms": { 731 "node_modules/ms": {
684 "version": "2.0.0", 732 "version": "2.0.0",
685 "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 733 "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
...@@ -693,6 +741,7 @@ ...@@ -693,6 +741,7 @@
693 "node": ">= 0.6" 741 "node": ">= 0.6"
694 } 742 }
695 }, 743 },
744 +<<<<<<< HEAD
696 "node_modules/node-fetch": { 745 "node_modules/node-fetch": {
697 "version": "2.6.7", 746 "version": "2.6.7",
698 "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", 747 "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
...@@ -737,6 +786,8 @@ ...@@ -737,6 +786,8 @@
737 }, 786 },
738 <<<<<<< HEAD 787 <<<<<<< HEAD
739 ======= 788 =======
789 +=======
790 +>>>>>>> bef06db (Init Address.js)
740 "node_modules/object-inspect": { 791 "node_modules/object-inspect": {
741 "version": "1.12.2", 792 "version": "1.12.2",
742 "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", 793 "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz",
...@@ -769,6 +820,7 @@ ...@@ -769,6 +820,7 @@
769 "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", 820 "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
770 "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" 821 "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ=="
771 }, 822 },
823 +<<<<<<< HEAD
772 >>>>>>> main 824 >>>>>>> main
773 "node_modules/performance-now": { 825 "node_modules/performance-now": {
774 "version": "2.1.0", 826 "version": "2.1.0",
...@@ -777,6 +829,8 @@ ...@@ -777,6 +829,8 @@
777 }, 829 },
778 <<<<<<< HEAD 830 <<<<<<< HEAD
779 ======= 831 =======
832 +=======
833 +>>>>>>> bef06db (Init Address.js)
780 "node_modules/proxy-addr": { 834 "node_modules/proxy-addr": {
781 "version": "2.0.7", 835 "version": "2.0.7",
782 "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", 836 "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
...@@ -789,6 +843,7 @@ ...@@ -789,6 +843,7 @@
789 "node": ">= 0.10" 843 "node": ">= 0.10"
790 } 844 }
791 }, 845 },
846 +<<<<<<< HEAD
792 >>>>>>> main 847 >>>>>>> main
793 "node_modules/psl": { 848 "node_modules/psl": {
794 "version": "1.9.0", 849 "version": "1.9.0",
...@@ -813,6 +868,22 @@ ...@@ -813,6 +868,22 @@
813 }, 868 },
814 <<<<<<< HEAD 869 <<<<<<< HEAD
815 ======= 870 =======
871 +=======
872 + "node_modules/qs": {
873 + "version": "6.11.0",
874 + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz",
875 + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==",
876 + "dependencies": {
877 + "side-channel": "^1.0.4"
878 + },
879 + "engines": {
880 + "node": ">=0.6"
881 + },
882 + "funding": {
883 + "url": "https://github.com/sponsors/ljharb"
884 + }
885 + },
886 +>>>>>>> bef06db (Init Address.js)
816 "node_modules/range-parser": { 887 "node_modules/range-parser": {
817 "version": "1.2.1", 888 "version": "1.2.1",
818 "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", 889 "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
...@@ -835,6 +906,7 @@ ...@@ -835,6 +906,7 @@
835 "node": ">= 0.8" 906 "node": ">= 0.8"
836 } 907 }
837 }, 908 },
909 +<<<<<<< HEAD
838 >>>>>>> main 910 >>>>>>> main
839 "node_modules/request": { 911 "node_modules/request": {
840 "version": "2.88.2", 912 "version": "2.88.2",
...@@ -867,6 +939,8 @@ ...@@ -867,6 +939,8 @@
867 "node": ">= 6" 939 "node": ">= 6"
868 } 940 }
869 }, 941 },
942 +=======
943 +>>>>>>> bef06db (Init Address.js)
870 "node_modules/safe-buffer": { 944 "node_modules/safe-buffer": {
871 "version": "5.2.1", 945 "version": "5.2.1",
872 "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", 946 "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
...@@ -892,12 +966,15 @@ ...@@ -892,12 +966,15 @@
892 "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" 966 "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
893 }, 967 },
894 <<<<<<< HEAD 968 <<<<<<< HEAD
969 +<<<<<<< HEAD
895 ======= 970 =======
896 "node_modules/sax": { 971 "node_modules/sax": {
897 "version": "1.2.4", 972 "version": "1.2.4",
898 "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", 973 "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
899 "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" 974 "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
900 }, 975 },
976 +=======
977 +>>>>>>> bef06db (Init Address.js)
901 "node_modules/send": { 978 "node_modules/send": {
902 "version": "0.18.0", 979 "version": "0.18.0",
903 "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", 980 "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz",
...@@ -958,6 +1035,7 @@ ...@@ -958,6 +1035,7 @@
958 "url": "https://github.com/sponsors/ljharb" 1035 "url": "https://github.com/sponsors/ljharb"
959 } 1036 }
960 }, 1037 },
1038 +<<<<<<< HEAD
961 >>>>>>> main 1039 >>>>>>> main
962 "node_modules/sshpk": { 1040 "node_modules/sshpk": {
963 "version": "1.17.0", 1041 "version": "1.17.0",
...@@ -985,6 +1063,8 @@ ...@@ -985,6 +1063,8 @@
985 }, 1063 },
986 <<<<<<< HEAD 1064 <<<<<<< HEAD
987 ======= 1065 =======
1066 +=======
1067 +>>>>>>> bef06db (Init Address.js)
988 "node_modules/statuses": { 1068 "node_modules/statuses": {
989 "version": "2.0.1", 1069 "version": "2.0.1",
990 "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", 1070 "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz",
...@@ -1001,6 +1081,7 @@ ...@@ -1001,6 +1081,7 @@
1001 "node": ">=0.6" 1081 "node": ">=0.6"
1002 } 1082 }
1003 }, 1083 },
1084 +<<<<<<< HEAD
1004 >>>>>>> main 1085 >>>>>>> main
1005 "node_modules/tough-cookie": { 1086 "node_modules/tough-cookie": {
1006 "version": "2.5.0", 1087 "version": "2.5.0",
...@@ -1040,6 +1121,8 @@ ...@@ -1040,6 +1121,8 @@
1040 }, 1121 },
1041 <<<<<<< HEAD 1122 <<<<<<< HEAD
1042 ======= 1123 =======
1124 +=======
1125 +>>>>>>> bef06db (Init Address.js)
1043 "node_modules/type-is": { 1126 "node_modules/type-is": {
1044 "version": "1.6.18", 1127 "version": "1.6.18",
1045 "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", 1128 "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
...@@ -1060,6 +1143,7 @@ ...@@ -1060,6 +1143,7 @@
1060 "node": ">= 0.8" 1143 "node": ">= 0.8"
1061 } 1144 }
1062 }, 1145 },
1146 +<<<<<<< HEAD
1063 >>>>>>> main 1147 >>>>>>> main
1064 "node_modules/uri-js": { 1148 "node_modules/uri-js": {
1065 "version": "4.4.1", 1149 "version": "4.4.1",
...@@ -1071,6 +1155,8 @@ ...@@ -1071,6 +1155,8 @@
1071 }, 1155 },
1072 <<<<<<< HEAD 1156 <<<<<<< HEAD
1073 ======= 1157 =======
1158 +=======
1159 +>>>>>>> bef06db (Init Address.js)
1074 "node_modules/utils-merge": { 1160 "node_modules/utils-merge": {
1075 "version": "1.0.1", 1161 "version": "1.0.1",
1076 "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", 1162 "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
...@@ -1079,6 +1165,7 @@ ...@@ -1079,6 +1165,7 @@
1079 "node": ">= 0.4.0" 1165 "node": ">= 0.4.0"
1080 } 1166 }
1081 }, 1167 },
1168 +<<<<<<< HEAD
1082 >>>>>>> main 1169 >>>>>>> main
1083 "node_modules/uuid": { 1170 "node_modules/uuid": {
1084 "version": "3.4.0", 1171 "version": "3.4.0",
...@@ -1091,6 +1178,8 @@ ...@@ -1091,6 +1178,8 @@
1091 }, 1178 },
1092 <<<<<<< HEAD 1179 <<<<<<< HEAD
1093 ======= 1180 =======
1181 +=======
1182 +>>>>>>> bef06db (Init Address.js)
1094 "node_modules/vary": { 1183 "node_modules/vary": {
1095 "version": "1.1.2", 1184 "version": "1.1.2",
1096 "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", 1185 "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
...@@ -1098,6 +1187,7 @@ ...@@ -1098,6 +1187,7 @@
1098 "engines": { 1187 "engines": {
1099 "node": ">= 0.8" 1188 "node": ">= 0.8"
1100 } 1189 }
1190 +<<<<<<< HEAD
1101 }, 1191 },
1102 >>>>>>> main 1192 >>>>>>> main
1103 "node_modules/verror": { 1193 "node_modules/verror": {
...@@ -1140,6 +1230,8 @@ ...@@ -1140,6 +1230,8 @@
1140 "xml-js": "bin/cli.js" 1230 "xml-js": "bin/cli.js"
1141 } 1231 }
1142 >>>>>>> main 1232 >>>>>>> main
1233 +=======
1234 +>>>>>>> bef06db (Init Address.js)
1143 } 1235 }
1144 } 1236 }
1145 } 1237 }
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
13 "func-name-matching": 0, 13 "func-name-matching": 0,
14 "id-length": [2, { "min": 1, "max": 25, "properties": "never" }], 14 "id-length": [2, { "min": 1, "max": 25, "properties": "never" }],
15 "indent": [2, 4], 15 "indent": [2, 4],
16 +<<<<<<< HEAD
16 "max-lines-per-function": 0, 17 "max-lines-per-function": 0,
17 "max-params": [2, 12], 18 "max-params": [2, 12],
18 "max-statements": [2, 45], 19 "max-statements": [2, 45],
...@@ -20,6 +21,14 @@ ...@@ -20,6 +21,14 @@
20 "no-continue": 1, 21 "no-continue": 1,
21 "no-magic-numbers": 0, 22 "no-magic-numbers": 0,
22 "no-param-reassign": 1, 23 "no-param-reassign": 1,
24 +=======
25 + "max-lines-per-function": [2, { "max": 150 }],
26 + "max-params": [2, 16],
27 + "max-statements": [2, 53],
28 + "multiline-comment-style": 0,
29 + "no-continue": 1,
30 + "no-magic-numbers": 0,
31 +>>>>>>> bef06db (Init Address.js)
23 "no-restricted-syntax": [2, "BreakStatement", "DebuggerStatement", "ForInStatement", "LabeledStatement", "WithStatement"], 32 "no-restricted-syntax": [2, "BreakStatement", "DebuggerStatement", "ForInStatement", "LabeledStatement", "WithStatement"],
24 }, 33 },
25 34
...@@ -27,10 +36,19 @@ ...@@ -27,10 +36,19 @@
27 { 36 {
28 "files": "test/**", 37 "files": "test/**",
29 "rules": { 38 "rules": {
39 +<<<<<<< HEAD
30 "max-lines-per-function": 0, 40 "max-lines-per-function": 0,
31 "max-statements": 0, 41 "max-statements": 0,
32 "no-extend-native": 0, 42 "no-extend-native": 0,
33 "function-paren-newline": 0, 43 "function-paren-newline": 0,
44 +=======
45 + "function-paren-newline": 0,
46 + "max-lines-per-function": 0,
47 + "max-statements": 0,
48 + "no-buffer-constructor": 0,
49 + "no-extend-native": 0,
50 + "no-throw-literal": 0,
51 +>>>>>>> bef06db (Init Address.js)
34 }, 52 },
35 }, 53 },
36 ], 54 ],
......
1 +<<<<<<< HEAD
2 +=======
3 +## **6.11.0
4 +- [New] [Fix] `stringify`: revert 0e903c0; add `commaRoundTrip` option (#442)
5 +- [readme] fix version badge
6 +
7 +## **6.10.5**
8 +- [Fix] `stringify`: with `arrayFormat: comma`, properly include an explicit `[]` on a single-item array (#434)
9 +
10 +## **6.10.4**
11 +- [Fix] `stringify`: with `arrayFormat: comma`, include an explicit `[]` on a single-item array (#441)
12 +- [meta] use `npmignore` to autogenerate an npmignore file
13 +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `has-symbol`, `object-inspect`, `tape`
14 +
15 +## **6.10.3**
16 +- [Fix] `parse`: ignore `__proto__` keys (#428)
17 +- [Robustness] `stringify`: avoid relying on a global `undefined` (#427)
18 +- [actions] reuse common workflows
19 +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `object-inspect`, `tape`
20 +
21 +## **6.10.2**
22 +- [Fix] `stringify`: actually fix cyclic references (#426)
23 +- [Fix] `stringify`: avoid encoding arrayformat comma when `encodeValuesOnly = true` (#424)
24 +- [readme] remove travis badge; add github actions/codecov badges; update URLs
25 +- [Docs] add note and links for coercing primitive values (#408)
26 +- [actions] update codecov uploader
27 +- [actions] update workflows
28 +- [Tests] clean up stringify tests slightly
29 +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `object-inspect`, `safe-publish-latest`, `tape`
30 +
31 +## **6.10.1**
32 +- [Fix] `stringify`: avoid exception on repeated object values (#402)
33 +
34 +## **6.10.0**
35 +- [New] `stringify`: throw on cycles, instead of an infinite loop (#395, #394, #393)
36 +- [New] `parse`: add `allowSparse` option for collapsing arrays with missing indices (#312)
37 +- [meta] fix README.md (#399)
38 +- [meta] only run `npm run dist` in publish, not install
39 +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `has-symbols`, `tape`
40 +- [Tests] fix tests on node v0.6
41 +- [Tests] use `ljharb/actions/node/install` instead of `ljharb/actions/node/run`
42 +- [Tests] Revert "[meta] ignore eclint transitive audit warning"
43 +
44 +## **6.9.7**
45 +- [Fix] `parse`: ignore `__proto__` keys (#428)
46 +- [Fix] `stringify`: avoid encoding arrayformat comma when `encodeValuesOnly = true` (#424)
47 +- [Robustness] `stringify`: avoid relying on a global `undefined` (#427)
48 +- [readme] remove travis badge; add github actions/codecov badges; update URLs
49 +- [Docs] add note and links for coercing primitive values (#408)
50 +- [Tests] clean up stringify tests slightly
51 +- [meta] fix README.md (#399)
52 +- Revert "[meta] ignore eclint transitive audit warning"
53 +- [actions] backport actions from main
54 +- [Dev Deps] backport updates from main
55 +
56 +## **6.9.6**
57 +- [Fix] restore `dist` dir; mistakenly removed in d4f6c32
58 +
59 +## **6.9.5**
60 +- [Fix] `stringify`: do not encode parens for RFC1738
61 +- [Fix] `stringify`: fix arrayFormat comma with empty array/objects (#350)
62 +- [Refactor] `format`: remove `util.assign` call
63 +- [meta] add "Allow Edits" workflow; update rebase workflow
64 +- [actions] switch Automatic Rebase workflow to `pull_request_target` event
65 +- [Tests] `stringify`: add tests for #378
66 +- [Tests] migrate tests to Github Actions
67 +- [Tests] run `nyc` on all tests; use `tape` runner
68 +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `browserify`, `mkdirp`, `object-inspect`, `tape`; add `aud`
69 +
70 +## **6.9.4**
71 +- [Fix] `stringify`: when `arrayFormat` is `comma`, respect `serializeDate` (#364)
72 +- [Refactor] `stringify`: reduce branching (part of #350)
73 +- [Refactor] move `maybeMap` to `utils`
74 +- [Dev Deps] update `browserify`, `tape`
75 +
76 +## **6.9.3**
77 +- [Fix] proper comma parsing of URL-encoded commas (#361)
78 +- [Fix] parses comma delimited array while having percent-encoded comma treated as normal text (#336)
79 +
80 +## **6.9.2**
81 +- [Fix] `parse`: Fix parsing array from object with `comma` true (#359)
82 +- [Fix] `parse`: throw a TypeError instead of an Error for bad charset (#349)
83 +- [meta] ignore eclint transitive audit warning
84 +- [meta] fix indentation in package.json
85 +- [meta] add tidelift marketing copy
86 +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `object-inspect`, `has-symbols`, `tape`, `mkdirp`, `iconv-lite`
87 +- [actions] add automatic rebasing / merge commit blocking
88 +
89 +## **6.9.1**
90 +- [Fix] `parse`: with comma true, handle field that holds an array of arrays (#335)
91 +- [Fix] `parse`: with comma true, do not split non-string values (#334)
92 +- [meta] add `funding` field
93 +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`
94 +- [Tests] use shared travis-ci config
95 +
96 +## **6.9.0**
97 +- [New] `parse`/`stringify`: Pass extra key/value argument to `decoder` (#333)
98 +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `evalmd`
99 +- [Tests] `parse`: add passing `arrayFormat` tests
100 +- [Tests] add `posttest` using `npx aud` to run `npm audit` without a lockfile
101 +- [Tests] up to `node` `v12.10`, `v11.15`, `v10.16`, `v8.16`
102 +- [Tests] `Buffer.from` in node v5.0-v5.9 and v4.0-v4.4 requires a TypedArray
103 +
104 +## **6.8.3**
105 +- [Fix] `parse`: ignore `__proto__` keys (#428)
106 +- [Robustness] `stringify`: avoid relying on a global `undefined` (#427)
107 +- [Fix] `stringify`: avoid encoding arrayformat comma when `encodeValuesOnly = true` (#424)
108 +- [readme] remove travis badge; add github actions/codecov badges; update URLs
109 +- [Tests] clean up stringify tests slightly
110 +- [Docs] add note and links for coercing primitive values (#408)
111 +- [meta] fix README.md (#399)
112 +- [actions] backport actions from main
113 +- [Dev Deps] backport updates from main
114 +- [Refactor] `stringify`: reduce branching
115 +- [meta] do not publish workflow files
116 +
117 +## **6.8.2**
118 +- [Fix] proper comma parsing of URL-encoded commas (#361)
119 +- [Fix] parses comma delimited array while having percent-encoded comma treated as normal text (#336)
120 +
121 +## **6.8.1**
122 +- [Fix] `parse`: Fix parsing array from object with `comma` true (#359)
123 +- [Fix] `parse`: throw a TypeError instead of an Error for bad charset (#349)
124 +- [Fix] `parse`: with comma true, handle field that holds an array of arrays (#335)
125 +- [fix] `parse`: with comma true, do not split non-string values (#334)
126 +- [meta] add tidelift marketing copy
127 +- [meta] add `funding` field
128 +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`, `safe-publish-latest`, `evalmd`, `has-symbols`, `iconv-lite`, `mkdirp`, `object-inspect`
129 +- [Tests] `parse`: add passing `arrayFormat` tests
130 +- [Tests] use shared travis-ci configs
131 +- [Tests] `Buffer.from` in node v5.0-v5.9 and v4.0-v4.4 requires a TypedArray
132 +- [actions] add automatic rebasing / merge commit blocking
133 +
134 +## **6.8.0**
135 +- [New] add `depth=false` to preserve the original key; [Fix] `depth=0` should preserve the original key (#326)
136 +- [New] [Fix] stringify symbols and bigints
137 +- [Fix] ensure node 0.12 can stringify Symbols
138 +- [Fix] fix for an impossible situation: when the formatter is called with a non-string value
139 +- [Refactor] `formats`: tiny bit of cleanup.
140 +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `browserify`, `safe-publish-latest`, `iconv-lite`, `tape`
141 +- [Tests] add tests for `depth=0` and `depth=false` behavior, both current and intuitive/intended (#326)
142 +- [Tests] use `eclint` instead of `editorconfig-tools`
143 +- [docs] readme: add security note
144 +- [meta] add github sponsorship
145 +- [meta] add FUNDING.yml
146 +- [meta] Clean up license text so it’s properly detected as BSD-3-Clause
147 +
148 +## **6.7.3**
149 +- [Fix] `parse`: ignore `__proto__` keys (#428)
150 +- [Fix] `stringify`: avoid encoding arrayformat comma when `encodeValuesOnly = true` (#424)
151 +- [Robustness] `stringify`: avoid relying on a global `undefined` (#427)
152 +- [readme] remove travis badge; add github actions/codecov badges; update URLs
153 +- [Docs] add note and links for coercing primitive values (#408)
154 +- [meta] fix README.md (#399)
155 +- [meta] do not publish workflow files
156 +- [actions] backport actions from main
157 +- [Dev Deps] backport updates from main
158 +- [Tests] use `nyc` for coverage
159 +- [Tests] clean up stringify tests slightly
160 +
161 +## **6.7.2**
162 +- [Fix] proper comma parsing of URL-encoded commas (#361)
163 +- [Fix] parses comma delimited array while having percent-encoded comma treated as normal text (#336)
164 +
165 +## **6.7.1**
166 +- [Fix] `parse`: Fix parsing array from object with `comma` true (#359)
167 +- [Fix] `parse`: with comma true, handle field that holds an array of arrays (#335)
168 +- [fix] `parse`: with comma true, do not split non-string values (#334)
169 +- [Fix] `parse`: throw a TypeError instead of an Error for bad charset (#349)
170 +- [Fix] fix for an impossible situation: when the formatter is called with a non-string value
171 +- [Refactor] `formats`: tiny bit of cleanup.
172 +- readme: add security note
173 +- [meta] add tidelift marketing copy
174 +- [meta] add `funding` field
175 +- [meta] add FUNDING.yml
176 +- [meta] Clean up license text so it’s properly detected as BSD-3-Clause
177 +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`, `safe-publish-latest`, `evalmd`, `iconv-lite`, `mkdirp`, `object-inspect`, `browserify`
178 +- [Tests] `parse`: add passing `arrayFormat` tests
179 +- [Tests] use shared travis-ci configs
180 +- [Tests] `Buffer.from` in node v5.0-v5.9 and v4.0-v4.4 requires a TypedArray
181 +- [Tests] add tests for `depth=0` and `depth=false` behavior, both current and intuitive/intended
182 +- [Tests] use `eclint` instead of `editorconfig-tools`
183 +- [actions] add automatic rebasing / merge commit blocking
184 +
185 +## **6.7.0**
186 +- [New] `stringify`/`parse`: add `comma` as an `arrayFormat` option (#276, #219)
187 +- [Fix] correctly parse nested arrays (#212)
188 +- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source, also with an array source
189 +- [Robustness] `stringify`: cache `Object.prototype.hasOwnProperty`
190 +- [Refactor] `utils`: `isBuffer`: small tweak; add tests
191 +- [Refactor] use cached `Array.isArray`
192 +- [Refactor] `parse`/`stringify`: make a function to normalize the options
193 +- [Refactor] `utils`: reduce observable [[Get]]s
194 +- [Refactor] `stringify`/`utils`: cache `Array.isArray`
195 +- [Tests] always use `String(x)` over `x.toString()`
196 +- [Tests] fix Buffer tests to work in node < 4.5 and node < 5.10
197 +- [Tests] temporarily allow coverage to fail
198 +
199 +## **6.6.1**
200 +- [Fix] `parse`: ignore `__proto__` keys (#428)
201 +- [Fix] fix for an impossible situation: when the formatter is called with a non-string value
202 +- [Fix] `utils.merge`: avoid a crash with a null target and an array source
203 +- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source
204 +- [Fix] correctly parse nested arrays
205 +- [Robustness] `stringify`: avoid relying on a global `undefined` (#427)
206 +- [Robustness] `stringify`: cache `Object.prototype.hasOwnProperty`
207 +- [Refactor] `formats`: tiny bit of cleanup.
208 +- [Refactor] `utils`: `isBuffer`: small tweak; add tests
209 +- [Refactor]: `stringify`/`utils`: cache `Array.isArray`
210 +- [Refactor] `utils`: reduce observable [[Get]]s
211 +- [Refactor] use cached `Array.isArray`
212 +- [Refactor] `parse`/`stringify`: make a function to normalize the options
213 +- [readme] remove travis badge; add github actions/codecov badges; update URLs
214 +- [Docs] Clarify the need for "arrayLimit" option
215 +- [meta] fix README.md (#399)
216 +- [meta] do not publish workflow files
217 +- [meta] Clean up license text so it’s properly detected as BSD-3-Clause
218 +- [meta] add FUNDING.yml
219 +- [meta] Fixes typo in CHANGELOG.md
220 +- [actions] backport actions from main
221 +- [Tests] fix Buffer tests to work in node < 4.5 and node < 5.10
222 +- [Tests] always use `String(x)` over `x.toString()`
223 +- [Dev Deps] backport from main
224 +
225 +## **6.6.0**
226 +- [New] Add support for iso-8859-1, utf8 "sentinel" and numeric entities (#268)
227 +- [New] move two-value combine to a `utils` function (#189)
228 +- [Fix] `stringify`: fix a crash with `strictNullHandling` and a custom `filter`/`serializeDate` (#279)
229 +- [Fix] when `parseArrays` is false, properly handle keys ending in `[]` (#260)
230 +- [Fix] `stringify`: do not crash in an obscure combo of `interpretNumericEntities`, a bad custom `decoder`, & `iso-8859-1`
231 +- [Fix] `utils`: `merge`: fix crash when `source` is a truthy primitive & no options are provided
232 +- [refactor] `stringify`: Avoid arr = arr.concat(...), push to the existing instance (#269)
233 +- [Refactor] `parse`: only need to reassign the var once
234 +- [Refactor] `parse`/`stringify`: clean up `charset` options checking; fix defaults
235 +- [Refactor] add missing defaults
236 +- [Refactor] `parse`: one less `concat` call
237 +- [Refactor] `utils`: `compactQueue`: make it explicitly side-effecting
238 +- [Dev Deps] update `browserify`, `eslint`, `@ljharb/eslint-config`, `iconv-lite`, `safe-publish-latest`, `tape`
239 +- [Tests] up to `node` `v10.10`, `v9.11`, `v8.12`, `v6.14`, `v4.9`; pin included builds to LTS
240 +
241 +>>>>>>> bef06db (Init Address.js)
1 ## **6.5.3** 242 ## **6.5.3**
2 - [Fix] `parse`: ignore `__proto__` keys (#428) 243 - [Fix] `parse`: ignore `__proto__` keys (#428)
3 - [Fix]` `utils.merge`: avoid a crash with a null target and a truthy non-array source 244 - [Fix]` `utils.merge`: avoid a crash with a null target and a truthy non-array source
...@@ -48,6 +289,30 @@ ...@@ -48,6 +289,30 @@
48 - [Tests] up to `node` `v8.1`, `v7.10`, `v6.11`; npm v4.6 breaks on node < v1; npm v5+ breaks on node < v4 289 - [Tests] up to `node` `v8.1`, `v7.10`, `v6.11`; npm v4.6 breaks on node < v1; npm v5+ breaks on node < v4
49 - [Tests] add `editorconfig-tools` 290 - [Tests] add `editorconfig-tools`
50 291
292 +<<<<<<< HEAD
293 +=======
294 +## **6.4.1**
295 +- [Fix] `parse`: ignore `__proto__` keys (#428)
296 +- [Fix] fix for an impossible situation: when the formatter is called with a non-string value
297 +- [Fix] use `safer-buffer` instead of `Buffer` constructor
298 +- [Fix] `utils.merge`: avoid a crash with a null target and an array source
299 +- [Fix]` `utils.merge`: avoid a crash with a null target and a truthy non-array source
300 +- [Fix] `stringify`: fix a crash with `strictNullHandling` and a custom `filter`/`serializeDate` (#279)
301 +- [Fix] `utils`: `merge`: fix crash when `source` is a truthy primitive & no options are provided
302 +- [Fix] when `parseArrays` is false, properly handle keys ending in `[]`
303 +- [Robustness] `stringify`: avoid relying on a global `undefined` (#427)
304 +- [Refactor] use cached `Array.isArray`
305 +- [Refactor] `stringify`: Avoid arr = arr.concat(...), push to the existing instance (#269)
306 +- [readme] remove travis badge; add github actions/codecov badges; update URLs
307 +- [Docs] Clarify the need for "arrayLimit" option
308 +- [meta] fix README.md (#399)
309 +- [meta] Clean up license text so it’s properly detected as BSD-3-Clause
310 +- [meta] add FUNDING.yml
311 +- [actions] backport actions from main
312 +- [Tests] remove nonexistent tape option
313 +- [Dev Deps] backport from main
314 +
315 +>>>>>>> bef06db (Init Address.js)
51 ## **6.4.0** 316 ## **6.4.0**
52 - [New] `qs.stringify`: add `encodeValuesOnly` option 317 - [New] `qs.stringify`: add `encodeValuesOnly` option
53 - [Fix] follow `allowPrototypes` option during merge (#201, #201) 318 - [Fix] follow `allowPrototypes` option during merge (#201, #201)
...@@ -57,6 +322,29 @@ ...@@ -57,6 +322,29 @@
57 - [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds 322 - [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds
58 - [eslint] reduce warnings 323 - [eslint] reduce warnings
59 324
325 +<<<<<<< HEAD
326 +=======
327 +## **6.3.3**
328 +- [Fix] `parse`: ignore `__proto__` keys (#428)
329 +- [Fix] fix for an impossible situation: when the formatter is called with a non-string value
330 +- [Fix] `utils.merge`: avoid a crash with a null target and an array source
331 +- [Fix]` `utils.merge`: avoid a crash with a null target and a truthy non-array source
332 +- [Fix] `stringify`: fix a crash with `strictNullHandling` and a custom `filter`/`serializeDate` (#279)
333 +- [Fix] `utils`: `merge`: fix crash when `source` is a truthy primitive & no options are provided
334 +- [Fix] when `parseArrays` is false, properly handle keys ending in `[]`
335 +- [Robustness] `stringify`: avoid relying on a global `undefined` (#427)
336 +- [Refactor] use cached `Array.isArray`
337 +- [Refactor] `stringify`: Avoid arr = arr.concat(...), push to the existing instance (#269)
338 +- [Docs] Clarify the need for "arrayLimit" option
339 +- [meta] fix README.md (#399)
340 +- [meta] Clean up license text so it’s properly detected as BSD-3-Clause
341 +- [meta] add FUNDING.yml
342 +- [actions] backport actions from main
343 +- [Tests] use `safer-buffer` instead of `Buffer` constructor
344 +- [Tests] remove nonexistent tape option
345 +- [Dev Deps] backport from main
346 +
347 +>>>>>>> bef06db (Init Address.js)
60 ## **6.3.2** 348 ## **6.3.2**
61 - [Fix] follow `allowPrototypes` option during merge (#201, #200) 349 - [Fix] follow `allowPrototypes` option during merge (#201, #200)
62 - [Dev Deps] update `eslint` 350 - [Dev Deps] update `eslint`
...@@ -90,6 +378,26 @@ ...@@ -90,6 +378,26 @@
90 - [Tests] skip Object.create tests when null objects are not available 378 - [Tests] skip Object.create tests when null objects are not available
91 - [Tests] Turn on eslint for test files (#175) 379 - [Tests] Turn on eslint for test files (#175)
92 380
381 +<<<<<<< HEAD
382 +=======
383 +## **6.2.4**
384 +- [Fix] `parse`: ignore `__proto__` keys (#428)
385 +- [Fix] `utils.merge`: avoid a crash with a null target and an array source
386 +- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source
387 +- [Fix] `utils`: `merge`: fix crash when `source` is a truthy primitive & no options are provided
388 +- [Fix] when `parseArrays` is false, properly handle keys ending in `[]`
389 +- [Robustness] `stringify`: avoid relying on a global `undefined` (#427)
390 +- [Refactor] use cached `Array.isArray`
391 +- [Docs] Clarify the need for "arrayLimit" option
392 +- [meta] fix README.md (#399)
393 +- [meta] Clean up license text so it’s properly detected as BSD-3-Clause
394 +- [meta] add FUNDING.yml
395 +- [actions] backport actions from main
396 +- [Tests] use `safer-buffer` instead of `Buffer` constructor
397 +- [Tests] remove nonexistent tape option
398 +- [Dev Deps] backport from main
399 +
400 +>>>>>>> bef06db (Init Address.js)
93 ## **6.2.3** 401 ## **6.2.3**
94 - [Fix] follow `allowPrototypes` option during merge (#201, #200) 402 - [Fix] follow `allowPrototypes` option during merge (#201, #200)
95 - [Fix] chmod a-x 403 - [Fix] chmod a-x
......
1 +<<<<<<< HEAD
1 # qs <sup>[![Version Badge][2]][1]</sup> 2 # qs <sup>[![Version Badge][2]][1]</sup>
3 +=======
4 +# qs <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
5 +>>>>>>> bef06db (Init Address.js)
2 6
3 [![github actions][actions-image]][actions-url] 7 [![github actions][actions-image]][actions-url]
4 [![coverage][codecov-image]][codecov-url] 8 [![coverage][codecov-image]][codecov-url]
...@@ -147,6 +151,65 @@ var withDots = qs.parse('a.b=c', { allowDots: true }); ...@@ -147,6 +151,65 @@ var withDots = qs.parse('a.b=c', { allowDots: true });
147 assert.deepEqual(withDots, { a: { b: 'c' } }); 151 assert.deepEqual(withDots, { a: { b: 'c' } });
148 ``` 152 ```
149 153
154 +<<<<<<< HEAD
155 +=======
156 +If you have to deal with legacy browsers or services, there's
157 +also support for decoding percent-encoded octets as iso-8859-1:
158 +
159 +```javascript
160 +var oldCharset = qs.parse('a=%A7', { charset: 'iso-8859-1' });
161 +assert.deepEqual(oldCharset, { a: '§' });
162 +```
163 +
164 +Some services add an initial `utf8=✓` value to forms so that old
165 +Internet Explorer versions are more likely to submit the form as
166 +utf-8. Additionally, the server can check the value against wrong
167 +encodings of the checkmark character and detect that a query string
168 +or `application/x-www-form-urlencoded` body was *not* sent as
169 +utf-8, eg. if the form had an `accept-charset` parameter or the
170 +containing page had a different character set.
171 +
172 +**qs** supports this mechanism via the `charsetSentinel` option.
173 +If specified, the `utf8` parameter will be omitted from the
174 +returned object. It will be used to switch to `iso-8859-1`/`utf-8`
175 +mode depending on how the checkmark is encoded.
176 +
177 +**Important**: When you specify both the `charset` option and the
178 +`charsetSentinel` option, the `charset` will be overridden when
179 +the request contains a `utf8` parameter from which the actual
180 +charset can be deduced. In that sense the `charset` will behave
181 +as the default charset rather than the authoritative charset.
182 +
183 +```javascript
184 +var detectedAsUtf8 = qs.parse('utf8=%E2%9C%93&a=%C3%B8', {
185 + charset: 'iso-8859-1',
186 + charsetSentinel: true
187 +});
188 +assert.deepEqual(detectedAsUtf8, { a: 'ø' });
189 +
190 +// Browsers encode the checkmark as &#10003; when submitting as iso-8859-1:
191 +var detectedAsIso8859_1 = qs.parse('utf8=%26%2310003%3B&a=%F8', {
192 + charset: 'utf-8',
193 + charsetSentinel: true
194 +});
195 +assert.deepEqual(detectedAsIso8859_1, { a: 'ø' });
196 +```
197 +
198 +If you want to decode the `&#...;` syntax to the actual character,
199 +you can specify the `interpretNumericEntities` option as well:
200 +
201 +```javascript
202 +var detectedAsIso8859_1 = qs.parse('a=%26%239786%3B', {
203 + charset: 'iso-8859-1',
204 + interpretNumericEntities: true
205 +});
206 +assert.deepEqual(detectedAsIso8859_1, { a: '☺' });
207 +```
208 +
209 +It also works when the charset has been detected in `charsetSentinel`
210 +mode.
211 +
212 +>>>>>>> bef06db (Init Address.js)
150 ### Parsing Arrays 213 ### Parsing Arrays
151 214
152 **qs** can also parse arrays using a similar `[]` notation: 215 **qs** can also parse arrays using a similar `[]` notation:
...@@ -172,6 +235,16 @@ var noSparse = qs.parse('a[1]=b&a[15]=c'); ...@@ -172,6 +235,16 @@ var noSparse = qs.parse('a[1]=b&a[15]=c');
172 assert.deepEqual(noSparse, { a: ['b', 'c'] }); 235 assert.deepEqual(noSparse, { a: ['b', 'c'] });
173 ``` 236 ```
174 237
238 +<<<<<<< HEAD
239 +=======
240 +You may also use `allowSparse` option to parse sparse arrays:
241 +
242 +```javascript
243 +var sparseArray = qs.parse('a[1]=2&a[3]=5', { allowSparse: true });
244 +assert.deepEqual(sparseArray, { a: [, '2', , '5'] });
245 +```
246 +
247 +>>>>>>> bef06db (Init Address.js)
175 Note that an empty string is also a value, and will be preserved: 248 Note that an empty string is also a value, and will be preserved:
176 249
177 ```javascript 250 ```javascript
...@@ -218,6 +291,27 @@ var arraysOfObjects = qs.parse('a[][b]=c'); ...@@ -218,6 +291,27 @@ var arraysOfObjects = qs.parse('a[][b]=c');
218 assert.deepEqual(arraysOfObjects, { a: [{ b: 'c' }] }); 291 assert.deepEqual(arraysOfObjects, { a: [{ b: 'c' }] });
219 ``` 292 ```
220 293
294 +<<<<<<< HEAD
295 +=======
296 +Some people use comma to join array, **qs** can parse it:
297 +```javascript
298 +var arraysOfObjects = qs.parse('a=b,c', { comma: true })
299 +assert.deepEqual(arraysOfObjects, { a: ['b', 'c'] })
300 +```
301 +(_this cannot convert nested objects, such as `a={b:1},{c:d}`_)
302 +
303 +### Parsing primitive/scalar values (numbers, booleans, null, etc)
304 +
305 +By default, all values are parsed as strings. This behavior will not change and is explained in [issue #91](https://github.com/ljharb/qs/issues/91).
306 +
307 +```javascript
308 +var primitiveValues = qs.parse('a=15&b=true&c=null');
309 +assert.deepEqual(primitiveValues, { a: '15', b: 'true', c: 'null' });
310 +```
311 +
312 +If you wish to auto-convert values which look like numbers, booleans, and other values into their primitive counterparts, you can use the [query-types Express JS middleware](https://github.com/xpepermint/query-types) which will auto-convert all request query parameters.
313 +
314 +>>>>>>> bef06db (Init Address.js)
221 ### Stringifying 315 ### Stringifying
222 316
223 [](#preventEval) 317 [](#preventEval)
...@@ -317,8 +411,17 @@ qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' }) ...@@ -317,8 +411,17 @@ qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' })
317 // 'a[]=b&a[]=c' 411 // 'a[]=b&a[]=c'
318 qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' }) 412 qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' })
319 // 'a=b&a=c' 413 // 'a=b&a=c'
414 +<<<<<<< HEAD
320 ``` 415 ```
321 416
417 +=======
418 +qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'comma' })
419 +// 'a=b,c'
420 +```
421 +
422 +Note: when using `arrayFormat` set to `'comma'`, you can also pass the `commaRoundTrip` option set to `true` or `false`, to append `[]` on single-item arrays, so that they can round trip through a parse.
423 +
424 +>>>>>>> bef06db (Init Address.js)
322 When objects are stringified, by default they use bracket notation: 425 When objects are stringified, by default they use bracket notation:
323 426
324 ```javascript 427 ```javascript
...@@ -451,10 +554,47 @@ var nullsSkipped = qs.stringify({ a: 'b', c: null}, { skipNulls: true }); ...@@ -451,10 +554,47 @@ var nullsSkipped = qs.stringify({ a: 'b', c: null}, { skipNulls: true });
451 assert.equal(nullsSkipped, 'a=b'); 554 assert.equal(nullsSkipped, 'a=b');
452 ``` 555 ```
453 556
557 +<<<<<<< HEAD
454 ### Dealing with special character sets 558 ### Dealing with special character sets
455 559
456 By default the encoding and decoding of characters is done in `utf-8`. If you 560 By default the encoding and decoding of characters is done in `utf-8`. If you
457 wish to encode querystrings to a different character set (i.e. 561 wish to encode querystrings to a different character set (i.e.
562 +=======
563 +If you're communicating with legacy systems, you can switch to `iso-8859-1`
564 +using the `charset` option:
565 +
566 +```javascript
567 +var iso = qs.stringify({ æ: 'æ' }, { charset: 'iso-8859-1' });
568 +assert.equal(iso, '%E6=%E6');
569 +```
570 +
571 +Characters that don't exist in `iso-8859-1` will be converted to numeric
572 +entities, similar to what browsers do:
573 +
574 +```javascript
575 +var numeric = qs.stringify({ a: '☺' }, { charset: 'iso-8859-1' });
576 +assert.equal(numeric, 'a=%26%239786%3B');
577 +```
578 +
579 +You can use the `charsetSentinel` option to announce the character by
580 +including an `utf8=✓` parameter with the proper encoding if the checkmark,
581 +similar to what Ruby on Rails and others do when submitting forms.
582 +
583 +```javascript
584 +var sentinel = qs.stringify({ a: '☺' }, { charsetSentinel: true });
585 +assert.equal(sentinel, 'utf8=%E2%9C%93&a=%E2%98%BA');
586 +
587 +var isoSentinel = qs.stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'iso-8859-1' });
588 +assert.equal(isoSentinel, 'utf8=%26%2310003%3B&a=%E6');
589 +```
590 +
591 +### Dealing with special character sets
592 +
593 +By default the encoding and decoding of characters is done in `utf-8`,
594 +and `iso-8859-1` support is also built in via the `charset` parameter.
595 +
596 +If you wish to encode querystrings to a different character set (i.e.
597 +>>>>>>> bef06db (Init Address.js)
458 [Shift JIS](https://en.wikipedia.org/wiki/Shift_JIS)) you can use the 598 [Shift JIS](https://en.wikipedia.org/wiki/Shift_JIS)) you can use the
459 [`qs-iconv`](https://github.com/martinheidegger/qs-iconv) library: 599 [`qs-iconv`](https://github.com/martinheidegger/qs-iconv) library:
460 600
......
...@@ -4,8 +4,18 @@ ...@@ -4,8 +4,18 @@
4 var replace = String.prototype.replace; 4 var replace = String.prototype.replace;
5 var percentTwenties = /%20/g; 5 var percentTwenties = /%20/g;
6 6
7 +<<<<<<< HEAD
7 module.exports = { 8 module.exports = {
8 'default': 'RFC3986', 9 'default': 'RFC3986',
10 +=======
11 +var Format = {
12 + RFC1738: 'RFC1738',
13 + RFC3986: 'RFC3986'
14 +};
15 +
16 +module.exports = {
17 + 'default': Format.RFC3986,
18 +>>>>>>> bef06db (Init Address.js)
9 formatters: { 19 formatters: {
10 RFC1738: function (value) { 20 RFC1738: function (value) {
11 return replace.call(value, percentTwenties, '+'); 21 return replace.call(value, percentTwenties, '+');
...@@ -14,8 +24,13 @@ module.exports = { ...@@ -14,8 +24,13 @@ module.exports = {
14 return String(value); 24 return String(value);
15 } 25 }
16 }, 26 },
27 +<<<<<<< HEAD
17 RFC1738: 'RFC1738', 28 RFC1738: 'RFC1738',
18 RFC3986: 'RFC3986' 29 RFC3986: 'RFC3986'
30 +=======
31 + RFC1738: Format.RFC1738,
32 + RFC3986: Format.RFC3986
33 +>>>>>>> bef06db (Init Address.js)
19 }; 34 };
20 35
21 },{}],2:[function(require,module,exports){ 36 },{}],2:[function(require,module,exports){
...@@ -37,26 +52,97 @@ module.exports = { ...@@ -37,26 +52,97 @@ module.exports = {
37 var utils = require('./utils'); 52 var utils = require('./utils');
38 53
39 var has = Object.prototype.hasOwnProperty; 54 var has = Object.prototype.hasOwnProperty;
55 +<<<<<<< HEAD
56 +=======
57 +var isArray = Array.isArray;
58 +>>>>>>> bef06db (Init Address.js)
40 59
41 var defaults = { 60 var defaults = {
42 allowDots: false, 61 allowDots: false,
43 allowPrototypes: false, 62 allowPrototypes: false,
63 +<<<<<<< HEAD
44 arrayLimit: 20, 64 arrayLimit: 20,
45 decoder: utils.decode, 65 decoder: utils.decode,
46 delimiter: '&', 66 delimiter: '&',
47 depth: 5, 67 depth: 5,
48 parameterLimit: 1000, 68 parameterLimit: 1000,
69 +=======
70 + allowSparse: false,
71 + arrayLimit: 20,
72 + charset: 'utf-8',
73 + charsetSentinel: false,
74 + comma: false,
75 + decoder: utils.decode,
76 + delimiter: '&',
77 + depth: 5,
78 + ignoreQueryPrefix: false,
79 + interpretNumericEntities: false,
80 + parameterLimit: 1000,
81 + parseArrays: true,
82 +>>>>>>> bef06db (Init Address.js)
49 plainObjects: false, 83 plainObjects: false,
50 strictNullHandling: false 84 strictNullHandling: false
51 }; 85 };
52 86
87 +<<<<<<< HEAD
88 +=======
89 +var interpretNumericEntities = function (str) {
90 + return str.replace(/&#(\d+);/g, function ($0, numberStr) {
91 + return String.fromCharCode(parseInt(numberStr, 10));
92 + });
93 +};
94 +
95 +var parseArrayValue = function (val, options) {
96 + if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
97 + return val.split(',');
98 + }
99 +
100 + return val;
101 +};
102 +
103 +// This is what browsers will submit when the ✓ character occurs in an
104 +// application/x-www-form-urlencoded body and the encoding of the page containing
105 +// the form is iso-8859-1, or when the submitted form has an accept-charset
106 +// attribute of iso-8859-1. Presumably also with other charsets that do not contain
107 +// the ✓ character, such as us-ascii.
108 +var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('&#10003;')
109 +
110 +// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.
111 +var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
112 +
113 +>>>>>>> bef06db (Init Address.js)
53 var parseValues = function parseQueryStringValues(str, options) { 114 var parseValues = function parseQueryStringValues(str, options) {
54 var obj = {}; 115 var obj = {};
55 var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str; 116 var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
56 var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit; 117 var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
57 var parts = cleanStr.split(options.delimiter, limit); 118 var parts = cleanStr.split(options.delimiter, limit);
119 +<<<<<<< HEAD
58 120
59 for (var i = 0; i < parts.length; ++i) { 121 for (var i = 0; i < parts.length; ++i) {
122 +=======
123 + var skipIndex = -1; // Keep track of where the utf8 sentinel was found
124 + var i;
125 +
126 + var charset = options.charset;
127 + if (options.charsetSentinel) {
128 + for (i = 0; i < parts.length; ++i) {
129 + if (parts[i].indexOf('utf8=') === 0) {
130 + if (parts[i] === charsetSentinel) {
131 + charset = 'utf-8';
132 + } else if (parts[i] === isoSentinel) {
133 + charset = 'iso-8859-1';
134 + }
135 + skipIndex = i;
136 + i = parts.length; // The eslint settings do not allow break;
137 + }
138 + }
139 + }
140 +
141 + for (i = 0; i < parts.length; ++i) {
142 + if (i === skipIndex) {
143 + continue;
144 + }
145 +>>>>>>> bef06db (Init Address.js)
60 var part = parts[i]; 146 var part = parts[i];
61 147
62 var bracketEqualsPos = part.indexOf(']='); 148 var bracketEqualsPos = part.indexOf(']=');
...@@ -64,6 +150,7 @@ var parseValues = function parseQueryStringValues(str, options) { ...@@ -64,6 +150,7 @@ var parseValues = function parseQueryStringValues(str, options) {
64 150
65 var key, val; 151 var key, val;
66 if (pos === -1) { 152 if (pos === -1) {
153 +<<<<<<< HEAD
67 key = options.decoder(part, defaults.decoder); 154 key = options.decoder(part, defaults.decoder);
68 val = options.strictNullHandling ? null : ''; 155 val = options.strictNullHandling ? null : '';
69 } else { 156 } else {
...@@ -72,6 +159,30 @@ var parseValues = function parseQueryStringValues(str, options) { ...@@ -72,6 +159,30 @@ var parseValues = function parseQueryStringValues(str, options) {
72 } 159 }
73 if (has.call(obj, key)) { 160 if (has.call(obj, key)) {
74 obj[key] = [].concat(obj[key]).concat(val); 161 obj[key] = [].concat(obj[key]).concat(val);
162 +=======
163 + key = options.decoder(part, defaults.decoder, charset, 'key');
164 + val = options.strictNullHandling ? null : '';
165 + } else {
166 + key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
167 + val = utils.maybeMap(
168 + parseArrayValue(part.slice(pos + 1), options),
169 + function (encodedVal) {
170 + return options.decoder(encodedVal, defaults.decoder, charset, 'value');
171 + }
172 + );
173 + }
174 +
175 + if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
176 + val = interpretNumericEntities(val);
177 + }
178 +
179 + if (part.indexOf('[]=') > -1) {
180 + val = isArray(val) ? [val] : val;
181 + }
182 +
183 + if (has.call(obj, key)) {
184 + obj[key] = utils.combine(obj[key], val);
185 +>>>>>>> bef06db (Init Address.js)
75 } else { 186 } else {
76 obj[key] = val; 187 obj[key] = val;
77 } 188 }
...@@ -80,8 +191,13 @@ var parseValues = function parseQueryStringValues(str, options) { ...@@ -80,8 +191,13 @@ var parseValues = function parseQueryStringValues(str, options) {
80 return obj; 191 return obj;
81 }; 192 };
82 193
194 +<<<<<<< HEAD
83 var parseObject = function (chain, val, options) { 195 var parseObject = function (chain, val, options) {
84 var leaf = val; 196 var leaf = val;
197 +=======
198 +var parseObject = function (chain, val, options, valuesParsed) {
199 + var leaf = valuesParsed ? val : parseArrayValue(val, options);
200 +>>>>>>> bef06db (Init Address.js)
85 201
86 for (var i = chain.length - 1; i >= 0; --i) { 202 for (var i = chain.length - 1; i >= 0; --i) {
87 var obj; 203 var obj;
...@@ -115,7 +231,11 @@ var parseObject = function (chain, val, options) { ...@@ -115,7 +231,11 @@ var parseObject = function (chain, val, options) {
115 return leaf; 231 return leaf;
116 }; 232 };
117 233
234 +<<<<<<< HEAD
118 var parseKeys = function parseQueryStringKeys(givenKey, val, options) { 235 var parseKeys = function parseQueryStringKeys(givenKey, val, options) {
236 +=======
237 +var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
238 +>>>>>>> bef06db (Init Address.js)
119 if (!givenKey) { 239 if (!givenKey) {
120 return; 240 return;
121 } 241 }
...@@ -130,15 +250,23 @@ var parseKeys = function parseQueryStringKeys(givenKey, val, options) { ...@@ -130,15 +250,23 @@ var parseKeys = function parseQueryStringKeys(givenKey, val, options) {
130 250
131 // Get the parent 251 // Get the parent
132 252
253 +<<<<<<< HEAD
133 var segment = brackets.exec(key); 254 var segment = brackets.exec(key);
255 +=======
256 + var segment = options.depth > 0 && brackets.exec(key);
257 +>>>>>>> bef06db (Init Address.js)
134 var parent = segment ? key.slice(0, segment.index) : key; 258 var parent = segment ? key.slice(0, segment.index) : key;
135 259
136 // Stash the parent if it exists 260 // Stash the parent if it exists
137 261
138 var keys = []; 262 var keys = [];
139 if (parent) { 263 if (parent) {
264 +<<<<<<< HEAD
140 // If we aren't using plain objects, optionally prefix keys 265 // If we aren't using plain objects, optionally prefix keys
141 // that would overwrite object prototype properties 266 // that would overwrite object prototype properties
267 +=======
268 + // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
269 +>>>>>>> bef06db (Init Address.js)
142 if (!options.plainObjects && has.call(Object.prototype, parent)) { 270 if (!options.plainObjects && has.call(Object.prototype, parent)) {
143 if (!options.allowPrototypes) { 271 if (!options.allowPrototypes) {
144 return; 272 return;
...@@ -151,7 +279,11 @@ var parseKeys = function parseQueryStringKeys(givenKey, val, options) { ...@@ -151,7 +279,11 @@ var parseKeys = function parseQueryStringKeys(givenKey, val, options) {
151 // Loop through children appending to the array until we hit depth 279 // Loop through children appending to the array until we hit depth
152 280
153 var i = 0; 281 var i = 0;
282 +<<<<<<< HEAD
154 while ((segment = child.exec(key)) !== null && i < options.depth) { 283 while ((segment = child.exec(key)) !== null && i < options.depth) {
284 +=======
285 + while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
286 +>>>>>>> bef06db (Init Address.js)
155 i += 1; 287 i += 1;
156 if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) { 288 if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
157 if (!options.allowPrototypes) { 289 if (!options.allowPrototypes) {
...@@ -167,6 +299,7 @@ var parseKeys = function parseQueryStringKeys(givenKey, val, options) { ...@@ -167,6 +299,7 @@ var parseKeys = function parseQueryStringKeys(givenKey, val, options) {
167 keys.push('[' + key.slice(segment.index) + ']'); 299 keys.push('[' + key.slice(segment.index) + ']');
168 } 300 }
169 301
302 +<<<<<<< HEAD
170 return parseObject(keys, val, options); 303 return parseObject(keys, val, options);
171 }; 304 };
172 305
...@@ -188,6 +321,48 @@ module.exports = function (str, opts) { ...@@ -188,6 +321,48 @@ module.exports = function (str, opts) {
188 options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : defaults.allowPrototypes; 321 options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : defaults.allowPrototypes;
189 options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : defaults.parameterLimit; 322 options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : defaults.parameterLimit;
190 options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling; 323 options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling;
324 +=======
325 + return parseObject(keys, val, options, valuesParsed);
326 +};
327 +
328 +var normalizeParseOptions = function normalizeParseOptions(opts) {
329 + if (!opts) {
330 + return defaults;
331 + }
332 +
333 + if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {
334 + throw new TypeError('Decoder has to be a function.');
335 + }
336 +
337 + if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
338 + throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
339 + }
340 + var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
341 +
342 + return {
343 + allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
344 + allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
345 + allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,
346 + arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
347 + charset: charset,
348 + charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
349 + comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
350 + decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
351 + delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
352 + // eslint-disable-next-line no-implicit-coercion, no-extra-parens
353 + depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,
354 + ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
355 + interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
356 + parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
357 + parseArrays: opts.parseArrays !== false,
358 + plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
359 + strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
360 + };
361 +};
362 +
363 +module.exports = function (str, opts) {
364 + var options = normalizeParseOptions(opts);
365 +>>>>>>> bef06db (Init Address.js)
191 366
192 if (str === '' || str === null || typeof str === 'undefined') { 367 if (str === '' || str === null || typeof str === 'undefined') {
193 return options.plainObjects ? Object.create(null) : {}; 368 return options.plainObjects ? Object.create(null) : {};
...@@ -201,23 +376,45 @@ module.exports = function (str, opts) { ...@@ -201,23 +376,45 @@ module.exports = function (str, opts) {
201 var keys = Object.keys(tempObj); 376 var keys = Object.keys(tempObj);
202 for (var i = 0; i < keys.length; ++i) { 377 for (var i = 0; i < keys.length; ++i) {
203 var key = keys[i]; 378 var key = keys[i];
379 +<<<<<<< HEAD
204 var newObj = parseKeys(key, tempObj[key], options); 380 var newObj = parseKeys(key, tempObj[key], options);
205 obj = utils.merge(obj, newObj, options); 381 obj = utils.merge(obj, newObj, options);
206 } 382 }
207 383
384 +=======
385 + var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');
386 + obj = utils.merge(obj, newObj, options);
387 + }
388 +
389 + if (options.allowSparse === true) {
390 + return obj;
391 + }
392 +
393 +>>>>>>> bef06db (Init Address.js)
208 return utils.compact(obj); 394 return utils.compact(obj);
209 }; 395 };
210 396
211 },{"./utils":5}],4:[function(require,module,exports){ 397 },{"./utils":5}],4:[function(require,module,exports){
212 'use strict'; 398 'use strict';
213 399
400 +<<<<<<< HEAD
401 +var utils = require('./utils');
402 +var formats = require('./formats');
403 +=======
404 +var getSideChannel = require('side-channel');
214 var utils = require('./utils'); 405 var utils = require('./utils');
215 var formats = require('./formats'); 406 var formats = require('./formats');
407 +var has = Object.prototype.hasOwnProperty;
408 +>>>>>>> bef06db (Init Address.js)
216 409
217 var arrayPrefixGenerators = { 410 var arrayPrefixGenerators = {
218 brackets: function brackets(prefix) { 411 brackets: function brackets(prefix) {
219 return prefix + '[]'; 412 return prefix + '[]';
220 }, 413 },
414 +<<<<<<< HEAD
415 +=======
416 + comma: 'comma',
417 +>>>>>>> bef06db (Init Address.js)
221 indices: function indices(prefix, key) { 418 indices: function indices(prefix, key) {
222 return prefix + '[' + key + ']'; 419 return prefix + '[' + key + ']';
223 }, 420 },
...@@ -227,6 +424,10 @@ var arrayPrefixGenerators = { ...@@ -227,6 +424,10 @@ var arrayPrefixGenerators = {
227 }; 424 };
228 425
229 var isArray = Array.isArray; 426 var isArray = Array.isArray;
427 +<<<<<<< HEAD
428 +=======
429 +var split = String.prototype.split;
430 +>>>>>>> bef06db (Init Address.js)
230 var push = Array.prototype.push; 431 var push = Array.prototype.push;
231 var pushToArray = function (arr, valueOrArray) { 432 var pushToArray = function (arr, valueOrArray) {
232 push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]); 433 push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);
...@@ -234,11 +435,27 @@ var pushToArray = function (arr, valueOrArray) { ...@@ -234,11 +435,27 @@ var pushToArray = function (arr, valueOrArray) {
234 435
235 var toISO = Date.prototype.toISOString; 436 var toISO = Date.prototype.toISOString;
236 437
438 +<<<<<<< HEAD
439 +var defaults = {
440 +=======
441 +var defaultFormat = formats['default'];
237 var defaults = { 442 var defaults = {
443 + addQueryPrefix: false,
444 + allowDots: false,
445 + charset: 'utf-8',
446 + charsetSentinel: false,
447 +>>>>>>> bef06db (Init Address.js)
238 delimiter: '&', 448 delimiter: '&',
239 encode: true, 449 encode: true,
240 encoder: utils.encode, 450 encoder: utils.encode,
241 encodeValuesOnly: false, 451 encodeValuesOnly: false,
452 +<<<<<<< HEAD
453 +=======
454 + format: defaultFormat,
455 + formatter: formats.formatters[defaultFormat],
456 + // deprecated
457 + indices: false,
458 +>>>>>>> bef06db (Init Address.js)
242 serializeDate: function serializeDate(date) { 459 serializeDate: function serializeDate(date) {
243 return toISO.call(date); 460 return toISO.call(date);
244 }, 461 },
...@@ -246,10 +463,27 @@ var defaults = { ...@@ -246,10 +463,27 @@ var defaults = {
246 strictNullHandling: false 463 strictNullHandling: false
247 }; 464 };
248 465
466 +<<<<<<< HEAD
467 +=======
468 +var isNonNullishPrimitive = function isNonNullishPrimitive(v) {
469 + return typeof v === 'string'
470 + || typeof v === 'number'
471 + || typeof v === 'boolean'
472 + || typeof v === 'symbol'
473 + || typeof v === 'bigint';
474 +};
475 +
476 +var sentinel = {};
477 +
478 +>>>>>>> bef06db (Init Address.js)
249 var stringify = function stringify( 479 var stringify = function stringify(
250 object, 480 object,
251 prefix, 481 prefix,
252 generateArrayPrefix, 482 generateArrayPrefix,
483 +<<<<<<< HEAD
484 +=======
485 + commaRoundTrip,
486 +>>>>>>> bef06db (Init Address.js)
253 strictNullHandling, 487 strictNullHandling,
254 skipNulls, 488 skipNulls,
255 encoder, 489 encoder,
...@@ -257,28 +491,87 @@ var stringify = function stringify( ...@@ -257,28 +491,87 @@ var stringify = function stringify(
257 sort, 491 sort,
258 allowDots, 492 allowDots,
259 serializeDate, 493 serializeDate,
494 +<<<<<<< HEAD
260 formatter, 495 formatter,
261 encodeValuesOnly 496 encodeValuesOnly
262 ) { 497 ) {
263 var obj = object; 498 var obj = object;
499 +=======
500 + format,
501 + formatter,
502 + encodeValuesOnly,
503 + charset,
504 + sideChannel
505 +) {
506 + var obj = object;
507 +
508 + var tmpSc = sideChannel;
509 + var step = 0;
510 + var findFlag = false;
511 + while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) {
512 + // Where object last appeared in the ref tree
513 + var pos = tmpSc.get(object);
514 + step += 1;
515 + if (typeof pos !== 'undefined') {
516 + if (pos === step) {
517 + throw new RangeError('Cyclic object value');
518 + } else {
519 + findFlag = true; // Break while
520 + }
521 + }
522 + if (typeof tmpSc.get(sentinel) === 'undefined') {
523 + step = 0;
524 + }
525 + }
526 +
527 +>>>>>>> bef06db (Init Address.js)
264 if (typeof filter === 'function') { 528 if (typeof filter === 'function') {
265 obj = filter(prefix, obj); 529 obj = filter(prefix, obj);
266 } else if (obj instanceof Date) { 530 } else if (obj instanceof Date) {
267 obj = serializeDate(obj); 531 obj = serializeDate(obj);
532 +<<<<<<< HEAD
533 +=======
534 + } else if (generateArrayPrefix === 'comma' && isArray(obj)) {
535 + obj = utils.maybeMap(obj, function (value) {
536 + if (value instanceof Date) {
537 + return serializeDate(value);
538 + }
539 + return value;
540 + });
541 +>>>>>>> bef06db (Init Address.js)
268 } 542 }
269 543
270 if (obj === null) { 544 if (obj === null) {
271 if (strictNullHandling) { 545 if (strictNullHandling) {
546 +<<<<<<< HEAD
272 return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder) : prefix; 547 return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder) : prefix;
548 +=======
549 + return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key', format) : prefix;
550 +>>>>>>> bef06db (Init Address.js)
273 } 551 }
274 552
275 obj = ''; 553 obj = '';
276 } 554 }
277 555
556 +<<<<<<< HEAD
278 if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || utils.isBuffer(obj)) { 557 if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || utils.isBuffer(obj)) {
279 if (encoder) { 558 if (encoder) {
280 var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder); 559 var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder);
281 return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder))]; 560 return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder))];
561 +=======
562 + if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {
563 + if (encoder) {
564 + var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format);
565 + if (generateArrayPrefix === 'comma' && encodeValuesOnly) {
566 + var valuesArray = split.call(String(obj), ',');
567 + var valuesJoined = '';
568 + for (var i = 0; i < valuesArray.length; ++i) {
569 + valuesJoined += (i === 0 ? '' : ',') + formatter(encoder(valuesArray[i], defaults.encoder, charset, 'value', format));
570 + }
571 + return [formatter(keyValue) + (commaRoundTrip && isArray(obj) && valuesArray.length === 1 ? '[]' : '') + '=' + valuesJoined];
572 + }
573 + return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))];
574 +>>>>>>> bef06db (Init Address.js)
282 } 575 }
283 return [formatter(prefix) + '=' + formatter(String(obj))]; 576 return [formatter(prefix) + '=' + formatter(String(obj))];
284 } 577 }
...@@ -290,13 +583,21 @@ var stringify = function stringify( ...@@ -290,13 +583,21 @@ var stringify = function stringify(
290 } 583 }
291 584
292 var objKeys; 585 var objKeys;
586 +<<<<<<< HEAD
293 if (isArray(filter)) { 587 if (isArray(filter)) {
588 +=======
589 + if (generateArrayPrefix === 'comma' && isArray(obj)) {
590 + // we need to join elements in
591 + objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
592 + } else if (isArray(filter)) {
593 +>>>>>>> bef06db (Init Address.js)
294 objKeys = filter; 594 objKeys = filter;
295 } else { 595 } else {
296 var keys = Object.keys(obj); 596 var keys = Object.keys(obj);
297 objKeys = sort ? keys.sort(sort) : keys; 597 objKeys = sort ? keys.sort(sort) : keys;
298 } 598 }
299 599
600 +<<<<<<< HEAD
300 for (var i = 0; i < objKeys.length; ++i) { 601 for (var i = 0; i < objKeys.length; ++i) {
301 var key = objKeys[i]; 602 var key = objKeys[i];
302 603
...@@ -335,11 +636,49 @@ var stringify = function stringify( ...@@ -335,11 +636,49 @@ var stringify = function stringify(
335 encodeValuesOnly 636 encodeValuesOnly
336 )); 637 ));
337 } 638 }
639 +=======
640 + var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? prefix + '[]' : prefix;
641 +
642 + for (var j = 0; j < objKeys.length; ++j) {
643 + var key = objKeys[j];
644 + var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];
645 +
646 + if (skipNulls && value === null) {
647 + continue;
648 + }
649 +
650 + var keyPrefix = isArray(obj)
651 + ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, key) : adjustedPrefix
652 + : adjustedPrefix + (allowDots ? '.' + key : '[' + key + ']');
653 +
654 + sideChannel.set(object, step);
655 + var valueSideChannel = getSideChannel();
656 + valueSideChannel.set(sentinel, sideChannel);
657 + pushToArray(values, stringify(
658 + value,
659 + keyPrefix,
660 + generateArrayPrefix,
661 + commaRoundTrip,
662 + strictNullHandling,
663 + skipNulls,
664 + encoder,
665 + filter,
666 + sort,
667 + allowDots,
668 + serializeDate,
669 + format,
670 + formatter,
671 + encodeValuesOnly,
672 + charset,
673 + valueSideChannel
674 + ));
675 +>>>>>>> bef06db (Init Address.js)
338 } 676 }
339 677
340 return values; 678 return values;
341 }; 679 };
342 680
681 +<<<<<<< HEAD
343 module.exports = function (object, opts) { 682 module.exports = function (object, opts) {
344 var obj = object; 683 var obj = object;
345 var options = opts ? utils.assign({}, opts) : {}; 684 var options = opts ? utils.assign({}, opts) : {};
...@@ -363,6 +702,59 @@ module.exports = function (object, opts) { ...@@ -363,6 +702,59 @@ module.exports = function (object, opts) {
363 throw new TypeError('Unknown format option provided.'); 702 throw new TypeError('Unknown format option provided.');
364 } 703 }
365 var formatter = formats.formatters[options.format]; 704 var formatter = formats.formatters[options.format];
705 +=======
706 +var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
707 + if (!opts) {
708 + return defaults;
709 + }
710 +
711 + if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
712 + throw new TypeError('Encoder has to be a function.');
713 + }
714 +
715 + var charset = opts.charset || defaults.charset;
716 + if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
717 + throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
718 + }
719 +
720 + var format = formats['default'];
721 + if (typeof opts.format !== 'undefined') {
722 + if (!has.call(formats.formatters, opts.format)) {
723 + throw new TypeError('Unknown format option provided.');
724 + }
725 + format = opts.format;
726 + }
727 + var formatter = formats.formatters[format];
728 +
729 + var filter = defaults.filter;
730 + if (typeof opts.filter === 'function' || isArray(opts.filter)) {
731 + filter = opts.filter;
732 + }
733 +
734 + return {
735 + addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,
736 + allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
737 + charset: charset,
738 + charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
739 + delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,
740 + encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,
741 + encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,
742 + encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,
743 + filter: filter,
744 + format: format,
745 + formatter: formatter,
746 + serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate,
747 + skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls,
748 + sort: typeof opts.sort === 'function' ? opts.sort : null,
749 + strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
750 + };
751 +};
752 +
753 +module.exports = function (object, opts) {
754 + var obj = object;
755 + var options = normalizeStringifyOptions(opts);
756 +
757 +>>>>>>> bef06db (Init Address.js)
366 var objKeys; 758 var objKeys;
367 var filter; 759 var filter;
368 760
...@@ -381,20 +773,35 @@ module.exports = function (object, opts) { ...@@ -381,20 +773,35 @@ module.exports = function (object, opts) {
381 } 773 }
382 774
383 var arrayFormat; 775 var arrayFormat;
776 +<<<<<<< HEAD
384 if (options.arrayFormat in arrayPrefixGenerators) { 777 if (options.arrayFormat in arrayPrefixGenerators) {
385 arrayFormat = options.arrayFormat; 778 arrayFormat = options.arrayFormat;
386 } else if ('indices' in options) { 779 } else if ('indices' in options) {
387 arrayFormat = options.indices ? 'indices' : 'repeat'; 780 arrayFormat = options.indices ? 'indices' : 'repeat';
781 +=======
782 + if (opts && opts.arrayFormat in arrayPrefixGenerators) {
783 + arrayFormat = opts.arrayFormat;
784 + } else if (opts && 'indices' in opts) {
785 + arrayFormat = opts.indices ? 'indices' : 'repeat';
786 +>>>>>>> bef06db (Init Address.js)
388 } else { 787 } else {
389 arrayFormat = 'indices'; 788 arrayFormat = 'indices';
390 } 789 }
391 790
392 var generateArrayPrefix = arrayPrefixGenerators[arrayFormat]; 791 var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
792 +<<<<<<< HEAD
793 +=======
794 + if (opts && 'commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
795 + throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
796 + }
797 + var commaRoundTrip = generateArrayPrefix === 'comma' && opts && opts.commaRoundTrip;
798 +>>>>>>> bef06db (Init Address.js)
393 799
394 if (!objKeys) { 800 if (!objKeys) {
395 objKeys = Object.keys(obj); 801 objKeys = Object.keys(obj);
396 } 802 }
397 803
804 +<<<<<<< HEAD
398 if (sort) { 805 if (sort) {
399 objKeys.sort(sort); 806 objKeys.sort(sort);
400 } 807 }
...@@ -403,12 +810,24 @@ module.exports = function (object, opts) { ...@@ -403,12 +810,24 @@ module.exports = function (object, opts) {
403 var key = objKeys[i]; 810 var key = objKeys[i];
404 811
405 if (skipNulls && obj[key] === null) { 812 if (skipNulls && obj[key] === null) {
813 +=======
814 + if (options.sort) {
815 + objKeys.sort(options.sort);
816 + }
817 +
818 + var sideChannel = getSideChannel();
819 + for (var i = 0; i < objKeys.length; ++i) {
820 + var key = objKeys[i];
821 +
822 + if (options.skipNulls && obj[key] === null) {
823 +>>>>>>> bef06db (Init Address.js)
406 continue; 824 continue;
407 } 825 }
408 pushToArray(keys, stringify( 826 pushToArray(keys, stringify(
409 obj[key], 827 obj[key],
410 key, 828 key,
411 generateArrayPrefix, 829 generateArrayPrefix,
830 +<<<<<<< HEAD
412 strictNullHandling, 831 strictNullHandling,
413 skipNulls, 832 skipNulls,
414 encode ? encoder : null, 833 encode ? encoder : null,
...@@ -431,6 +850,47 @@ module.exports = function (object, opts) { ...@@ -431,6 +850,47 @@ module.exports = function (object, opts) {
431 'use strict'; 850 'use strict';
432 851
433 var has = Object.prototype.hasOwnProperty; 852 var has = Object.prototype.hasOwnProperty;
853 +=======
854 + commaRoundTrip,
855 + options.strictNullHandling,
856 + options.skipNulls,
857 + options.encode ? options.encoder : null,
858 + options.filter,
859 + options.sort,
860 + options.allowDots,
861 + options.serializeDate,
862 + options.format,
863 + options.formatter,
864 + options.encodeValuesOnly,
865 + options.charset,
866 + sideChannel
867 + ));
868 + }
869 +
870 + var joined = keys.join(options.delimiter);
871 + var prefix = options.addQueryPrefix === true ? '?' : '';
872 +
873 + if (options.charsetSentinel) {
874 + if (options.charset === 'iso-8859-1') {
875 + // encodeURIComponent('&#10003;'), the "numeric entity" representation of a checkmark
876 + prefix += 'utf8=%26%2310003%3B&';
877 + } else {
878 + // encodeURIComponent('✓')
879 + prefix += 'utf8=%E2%9C%93&';
880 + }
881 + }
882 +
883 + return joined.length > 0 ? prefix + joined : '';
884 +};
885 +
886 +},{"./formats":1,"./utils":5,"side-channel":16}],5:[function(require,module,exports){
887 +'use strict';
888 +
889 +var formats = require('./formats');
890 +
891 +var has = Object.prototype.hasOwnProperty;
892 +var isArray = Array.isArray;
893 +>>>>>>> bef06db (Init Address.js)
434 894
435 var hexTable = (function () { 895 var hexTable = (function () {
436 var array = []; 896 var array = [];
...@@ -442,6 +902,7 @@ var hexTable = (function () { ...@@ -442,6 +902,7 @@ var hexTable = (function () {
442 }()); 902 }());
443 903
444 var compactQueue = function compactQueue(queue) { 904 var compactQueue = function compactQueue(queue) {
905 +<<<<<<< HEAD
445 var obj; 906 var obj;
446 907
447 while (queue.length) { 908 while (queue.length) {
...@@ -449,6 +910,13 @@ var compactQueue = function compactQueue(queue) { ...@@ -449,6 +910,13 @@ var compactQueue = function compactQueue(queue) {
449 obj = item.obj[item.prop]; 910 obj = item.obj[item.prop];
450 911
451 if (Array.isArray(obj)) { 912 if (Array.isArray(obj)) {
913 +=======
914 + while (queue.length > 1) {
915 + var item = queue.pop();
916 + var obj = item.obj[item.prop];
917 +
918 + if (isArray(obj)) {
919 +>>>>>>> bef06db (Init Address.js)
452 var compacted = []; 920 var compacted = [];
453 921
454 for (var j = 0; j < obj.length; ++j) { 922 for (var j = 0; j < obj.length; ++j) {
...@@ -460,8 +928,11 @@ var compactQueue = function compactQueue(queue) { ...@@ -460,8 +928,11 @@ var compactQueue = function compactQueue(queue) {
460 item.obj[item.prop] = compacted; 928 item.obj[item.prop] = compacted;
461 } 929 }
462 } 930 }
931 +<<<<<<< HEAD
463 932
464 return obj; 933 return obj;
934 +=======
935 +>>>>>>> bef06db (Init Address.js)
465 }; 936 };
466 937
467 var arrayToObject = function arrayToObject(source, options) { 938 var arrayToObject = function arrayToObject(source, options) {
...@@ -476,12 +947,20 @@ var arrayToObject = function arrayToObject(source, options) { ...@@ -476,12 +947,20 @@ var arrayToObject = function arrayToObject(source, options) {
476 }; 947 };
477 948
478 var merge = function merge(target, source, options) { 949 var merge = function merge(target, source, options) {
950 +<<<<<<< HEAD
951 +=======
952 + /* eslint no-param-reassign: 0 */
953 +>>>>>>> bef06db (Init Address.js)
479 if (!source) { 954 if (!source) {
480 return target; 955 return target;
481 } 956 }
482 957
483 if (typeof source !== 'object') { 958 if (typeof source !== 'object') {
959 +<<<<<<< HEAD
484 if (Array.isArray(target)) { 960 if (Array.isArray(target)) {
961 +=======
962 + if (isArray(target)) {
963 +>>>>>>> bef06db (Init Address.js)
485 target.push(source); 964 target.push(source);
486 } else if (target && typeof target === 'object') { 965 } else if (target && typeof target === 'object') {
487 if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) { 966 if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) {
...@@ -499,11 +978,19 @@ var merge = function merge(target, source, options) { ...@@ -499,11 +978,19 @@ var merge = function merge(target, source, options) {
499 } 978 }
500 979
501 var mergeTarget = target; 980 var mergeTarget = target;
981 +<<<<<<< HEAD
502 if (Array.isArray(target) && !Array.isArray(source)) { 982 if (Array.isArray(target) && !Array.isArray(source)) {
503 mergeTarget = arrayToObject(target, options); 983 mergeTarget = arrayToObject(target, options);
504 } 984 }
505 985
506 if (Array.isArray(target) && Array.isArray(source)) { 986 if (Array.isArray(target) && Array.isArray(source)) {
987 +=======
988 + if (isArray(target) && !isArray(source)) {
989 + mergeTarget = arrayToObject(target, options);
990 + }
991 +
992 + if (isArray(target) && isArray(source)) {
993 +>>>>>>> bef06db (Init Address.js)
507 source.forEach(function (item, i) { 994 source.forEach(function (item, i) {
508 if (has.call(target, i)) { 995 if (has.call(target, i)) {
509 var targetItem = target[i]; 996 var targetItem = target[i];
...@@ -538,6 +1025,7 @@ var assign = function assignSingleSource(target, source) { ...@@ -538,6 +1025,7 @@ var assign = function assignSingleSource(target, source) {
538 }, target); 1025 }, target);
539 }; 1026 };
540 1027
1028 +<<<<<<< HEAD
541 var decode = function (str) { 1029 var decode = function (str) {
542 try { 1030 try {
543 return decodeURIComponent(str.replace(/\+/g, ' ')); 1031 return decodeURIComponent(str.replace(/\+/g, ' '));
...@@ -547,13 +1035,45 @@ var decode = function (str) { ...@@ -547,13 +1035,45 @@ var decode = function (str) {
547 }; 1035 };
548 1036
549 var encode = function encode(str) { 1037 var encode = function encode(str) {
1038 +=======
1039 +var decode = function (str, decoder, charset) {
1040 + var strWithoutPlus = str.replace(/\+/g, ' ');
1041 + if (charset === 'iso-8859-1') {
1042 + // unescape never throws, no try...catch needed:
1043 + return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
1044 + }
1045 + // utf-8
1046 + try {
1047 + return decodeURIComponent(strWithoutPlus);
1048 + } catch (e) {
1049 + return strWithoutPlus;
1050 + }
1051 +};
1052 +
1053 +var encode = function encode(str, defaultEncoder, charset, kind, format) {
1054 +>>>>>>> bef06db (Init Address.js)
550 // This code was originally written by Brian White (mscdex) for the io.js core querystring library. 1055 // This code was originally written by Brian White (mscdex) for the io.js core querystring library.
551 // It has been adapted here for stricter adherence to RFC 3986 1056 // It has been adapted here for stricter adherence to RFC 3986
552 if (str.length === 0) { 1057 if (str.length === 0) {
553 return str; 1058 return str;
554 } 1059 }
555 1060
1061 +<<<<<<< HEAD
556 var string = typeof str === 'string' ? str : String(str); 1062 var string = typeof str === 'string' ? str : String(str);
1063 +=======
1064 + var string = str;
1065 + if (typeof str === 'symbol') {
1066 + string = Symbol.prototype.toString.call(str);
1067 + } else if (typeof str !== 'string') {
1068 + string = String(str);
1069 + }
1070 +
1071 + if (charset === 'iso-8859-1') {
1072 + return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {
1073 + return '%26%23' + parseInt($0.slice(2), 16) + '%3B';
1074 + });
1075 + }
1076 +>>>>>>> bef06db (Init Address.js)
557 1077
558 var out = ''; 1078 var out = '';
559 for (var i = 0; i < string.length; ++i) { 1079 for (var i = 0; i < string.length; ++i) {
...@@ -567,6 +1087,10 @@ var encode = function encode(str) { ...@@ -567,6 +1087,10 @@ var encode = function encode(str) {
567 || (c >= 0x30 && c <= 0x39) // 0-9 1087 || (c >= 0x30 && c <= 0x39) // 0-9
568 || (c >= 0x41 && c <= 0x5A) // a-z 1088 || (c >= 0x41 && c <= 0x5A) // a-z
569 || (c >= 0x61 && c <= 0x7A) // A-Z 1089 || (c >= 0x61 && c <= 0x7A) // A-Z
1090 +<<<<<<< HEAD
1091 +=======
1092 + || (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( )
1093 +>>>>>>> bef06db (Init Address.js)
570 ) { 1094 ) {
571 out += string.charAt(i); 1095 out += string.charAt(i);
572 continue; 1096 continue;
...@@ -618,7 +1142,13 @@ var compact = function compact(value) { ...@@ -618,7 +1142,13 @@ var compact = function compact(value) {
618 } 1142 }
619 } 1143 }
620 1144
1145 +<<<<<<< HEAD
621 return compactQueue(queue); 1146 return compactQueue(queue);
1147 +=======
1148 + compactQueue(queue);
1149 +
1150 + return value;
1151 +>>>>>>> bef06db (Init Address.js)
622 }; 1152 };
623 1153
624 var isRegExp = function isRegExp(obj) { 1154 var isRegExp = function isRegExp(obj) {
...@@ -626,23 +1156,1224 @@ var isRegExp = function isRegExp(obj) { ...@@ -626,23 +1156,1224 @@ var isRegExp = function isRegExp(obj) {
626 }; 1156 };
627 1157
628 var isBuffer = function isBuffer(obj) { 1158 var isBuffer = function isBuffer(obj) {
1159 +<<<<<<< HEAD
629 if (obj === null || typeof obj === 'undefined') { 1160 if (obj === null || typeof obj === 'undefined') {
1161 +=======
1162 + if (!obj || typeof obj !== 'object') {
1163 +>>>>>>> bef06db (Init Address.js)
630 return false; 1164 return false;
631 } 1165 }
632 1166
633 return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); 1167 return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
634 }; 1168 };
635 1169
1170 +<<<<<<< HEAD
1171 +module.exports = {
1172 + arrayToObject: arrayToObject,
1173 + assign: assign,
1174 +=======
1175 +var combine = function combine(a, b) {
1176 + return [].concat(a, b);
1177 +};
1178 +
1179 +var maybeMap = function maybeMap(val, fn) {
1180 + if (isArray(val)) {
1181 + var mapped = [];
1182 + for (var i = 0; i < val.length; i += 1) {
1183 + mapped.push(fn(val[i]));
1184 + }
1185 + return mapped;
1186 + }
1187 + return fn(val);
1188 +};
1189 +
636 module.exports = { 1190 module.exports = {
637 arrayToObject: arrayToObject, 1191 arrayToObject: arrayToObject,
638 assign: assign, 1192 assign: assign,
1193 + combine: combine,
1194 +>>>>>>> bef06db (Init Address.js)
639 compact: compact, 1195 compact: compact,
640 decode: decode, 1196 decode: decode,
641 encode: encode, 1197 encode: encode,
642 isBuffer: isBuffer, 1198 isBuffer: isBuffer,
643 isRegExp: isRegExp, 1199 isRegExp: isRegExp,
1200 +<<<<<<< HEAD
644 merge: merge 1201 merge: merge
645 }; 1202 };
646 1203
647 },{}]},{},[2])(2) 1204 },{}]},{},[2])(2)
1205 +=======
1206 + maybeMap: maybeMap,
1207 + merge: merge
1208 +};
1209 +
1210 +},{"./formats":1}],6:[function(require,module,exports){
1211 +
1212 +},{}],7:[function(require,module,exports){
1213 +'use strict';
1214 +
1215 +var GetIntrinsic = require('get-intrinsic');
1216 +
1217 +var callBind = require('./');
1218 +
1219 +var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));
1220 +
1221 +module.exports = function callBoundIntrinsic(name, allowMissing) {
1222 + var intrinsic = GetIntrinsic(name, !!allowMissing);
1223 + if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
1224 + return callBind(intrinsic);
1225 + }
1226 + return intrinsic;
1227 +};
1228 +
1229 +},{"./":8,"get-intrinsic":11}],8:[function(require,module,exports){
1230 +'use strict';
1231 +
1232 +var bind = require('function-bind');
1233 +var GetIntrinsic = require('get-intrinsic');
1234 +
1235 +var $apply = GetIntrinsic('%Function.prototype.apply%');
1236 +var $call = GetIntrinsic('%Function.prototype.call%');
1237 +var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
1238 +
1239 +var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
1240 +var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
1241 +var $max = GetIntrinsic('%Math.max%');
1242 +
1243 +if ($defineProperty) {
1244 + try {
1245 + $defineProperty({}, 'a', { value: 1 });
1246 + } catch (e) {
1247 + // IE 8 has a broken defineProperty
1248 + $defineProperty = null;
1249 + }
1250 +}
1251 +
1252 +module.exports = function callBind(originalFunction) {
1253 + var func = $reflectApply(bind, $call, arguments);
1254 + if ($gOPD && $defineProperty) {
1255 + var desc = $gOPD(func, 'length');
1256 + if (desc.configurable) {
1257 + // original length, plus the receiver, minus any additional arguments (after the receiver)
1258 + $defineProperty(
1259 + func,
1260 + 'length',
1261 + { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
1262 + );
1263 + }
1264 + }
1265 + return func;
1266 +};
1267 +
1268 +var applyBind = function applyBind() {
1269 + return $reflectApply(bind, $apply, arguments);
1270 +};
1271 +
1272 +if ($defineProperty) {
1273 + $defineProperty(module.exports, 'apply', { value: applyBind });
1274 +} else {
1275 + module.exports.apply = applyBind;
1276 +}
1277 +
1278 +},{"function-bind":10,"get-intrinsic":11}],9:[function(require,module,exports){
1279 +'use strict';
1280 +
1281 +/* eslint no-invalid-this: 1 */
1282 +
1283 +var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
1284 +var slice = Array.prototype.slice;
1285 +var toStr = Object.prototype.toString;
1286 +var funcType = '[object Function]';
1287 +
1288 +module.exports = function bind(that) {
1289 + var target = this;
1290 + if (typeof target !== 'function' || toStr.call(target) !== funcType) {
1291 + throw new TypeError(ERROR_MESSAGE + target);
1292 + }
1293 + var args = slice.call(arguments, 1);
1294 +
1295 + var bound;
1296 + var binder = function () {
1297 + if (this instanceof bound) {
1298 + var result = target.apply(
1299 + this,
1300 + args.concat(slice.call(arguments))
1301 + );
1302 + if (Object(result) === result) {
1303 + return result;
1304 + }
1305 + return this;
1306 + } else {
1307 + return target.apply(
1308 + that,
1309 + args.concat(slice.call(arguments))
1310 + );
1311 + }
1312 + };
1313 +
1314 + var boundLength = Math.max(0, target.length - args.length);
1315 + var boundArgs = [];
1316 + for (var i = 0; i < boundLength; i++) {
1317 + boundArgs.push('$' + i);
1318 + }
1319 +
1320 + bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
1321 +
1322 + if (target.prototype) {
1323 + var Empty = function Empty() {};
1324 + Empty.prototype = target.prototype;
1325 + bound.prototype = new Empty();
1326 + Empty.prototype = null;
1327 + }
1328 +
1329 + return bound;
1330 +};
1331 +
1332 +},{}],10:[function(require,module,exports){
1333 +'use strict';
1334 +
1335 +var implementation = require('./implementation');
1336 +
1337 +module.exports = Function.prototype.bind || implementation;
1338 +
1339 +},{"./implementation":9}],11:[function(require,module,exports){
1340 +'use strict';
1341 +
1342 +var undefined;
1343 +
1344 +var $SyntaxError = SyntaxError;
1345 +var $Function = Function;
1346 +var $TypeError = TypeError;
1347 +
1348 +// eslint-disable-next-line consistent-return
1349 +var getEvalledConstructor = function (expressionSyntax) {
1350 + try {
1351 + return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
1352 + } catch (e) {}
1353 +};
1354 +
1355 +var $gOPD = Object.getOwnPropertyDescriptor;
1356 +if ($gOPD) {
1357 + try {
1358 + $gOPD({}, '');
1359 + } catch (e) {
1360 + $gOPD = null; // this is IE 8, which has a broken gOPD
1361 + }
1362 +}
1363 +
1364 +var throwTypeError = function () {
1365 + throw new $TypeError();
1366 +};
1367 +var ThrowTypeError = $gOPD
1368 + ? (function () {
1369 + try {
1370 + // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
1371 + arguments.callee; // IE 8 does not throw here
1372 + return throwTypeError;
1373 + } catch (calleeThrows) {
1374 + try {
1375 + // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
1376 + return $gOPD(arguments, 'callee').get;
1377 + } catch (gOPDthrows) {
1378 + return throwTypeError;
1379 + }
1380 + }
1381 + }())
1382 + : throwTypeError;
1383 +
1384 +var hasSymbols = require('has-symbols')();
1385 +
1386 +var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto
1387 +
1388 +var needsEval = {};
1389 +
1390 +var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array);
1391 +
1392 +var INTRINSICS = {
1393 + '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,
1394 + '%Array%': Array,
1395 + '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
1396 + '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined,
1397 + '%AsyncFromSyncIteratorPrototype%': undefined,
1398 + '%AsyncFunction%': needsEval,
1399 + '%AsyncGenerator%': needsEval,
1400 + '%AsyncGeneratorFunction%': needsEval,
1401 + '%AsyncIteratorPrototype%': needsEval,
1402 + '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,
1403 + '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,
1404 + '%Boolean%': Boolean,
1405 + '%DataView%': typeof DataView === 'undefined' ? undefined : DataView,
1406 + '%Date%': Date,
1407 + '%decodeURI%': decodeURI,
1408 + '%decodeURIComponent%': decodeURIComponent,
1409 + '%encodeURI%': encodeURI,
1410 + '%encodeURIComponent%': encodeURIComponent,
1411 + '%Error%': Error,
1412 + '%eval%': eval, // eslint-disable-line no-eval
1413 + '%EvalError%': EvalError,
1414 + '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,
1415 + '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,
1416 + '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,
1417 + '%Function%': $Function,
1418 + '%GeneratorFunction%': needsEval,
1419 + '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,
1420 + '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,
1421 + '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,
1422 + '%isFinite%': isFinite,
1423 + '%isNaN%': isNaN,
1424 + '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined,
1425 + '%JSON%': typeof JSON === 'object' ? JSON : undefined,
1426 + '%Map%': typeof Map === 'undefined' ? undefined : Map,
1427 + '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()),
1428 + '%Math%': Math,
1429 + '%Number%': Number,
1430 + '%Object%': Object,
1431 + '%parseFloat%': parseFloat,
1432 + '%parseInt%': parseInt,
1433 + '%Promise%': typeof Promise === 'undefined' ? undefined : Promise,
1434 + '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,
1435 + '%RangeError%': RangeError,
1436 + '%ReferenceError%': ReferenceError,
1437 + '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
1438 + '%RegExp%': RegExp,
1439 + '%Set%': typeof Set === 'undefined' ? undefined : Set,
1440 + '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()),
1441 + '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
1442 + '%String%': String,
1443 + '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined,
1444 + '%Symbol%': hasSymbols ? Symbol : undefined,
1445 + '%SyntaxError%': $SyntaxError,
1446 + '%ThrowTypeError%': ThrowTypeError,
1447 + '%TypedArray%': TypedArray,
1448 + '%TypeError%': $TypeError,
1449 + '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,
1450 + '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,
1451 + '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,
1452 + '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,
1453 + '%URIError%': URIError,
1454 + '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,
1455 + '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,
1456 + '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet
1457 +};
1458 +
1459 +var doEval = function doEval(name) {
1460 + var value;
1461 + if (name === '%AsyncFunction%') {
1462 + value = getEvalledConstructor('async function () {}');
1463 + } else if (name === '%GeneratorFunction%') {
1464 + value = getEvalledConstructor('function* () {}');
1465 + } else if (name === '%AsyncGeneratorFunction%') {
1466 + value = getEvalledConstructor('async function* () {}');
1467 + } else if (name === '%AsyncGenerator%') {
1468 + var fn = doEval('%AsyncGeneratorFunction%');
1469 + if (fn) {
1470 + value = fn.prototype;
1471 + }
1472 + } else if (name === '%AsyncIteratorPrototype%') {
1473 + var gen = doEval('%AsyncGenerator%');
1474 + if (gen) {
1475 + value = getProto(gen.prototype);
1476 + }
1477 + }
1478 +
1479 + INTRINSICS[name] = value;
1480 +
1481 + return value;
1482 +};
1483 +
1484 +var LEGACY_ALIASES = {
1485 + '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
1486 + '%ArrayPrototype%': ['Array', 'prototype'],
1487 + '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
1488 + '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
1489 + '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
1490 + '%ArrayProto_values%': ['Array', 'prototype', 'values'],
1491 + '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
1492 + '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
1493 + '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
1494 + '%BooleanPrototype%': ['Boolean', 'prototype'],
1495 + '%DataViewPrototype%': ['DataView', 'prototype'],
1496 + '%DatePrototype%': ['Date', 'prototype'],
1497 + '%ErrorPrototype%': ['Error', 'prototype'],
1498 + '%EvalErrorPrototype%': ['EvalError', 'prototype'],
1499 + '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
1500 + '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
1501 + '%FunctionPrototype%': ['Function', 'prototype'],
1502 + '%Generator%': ['GeneratorFunction', 'prototype'],
1503 + '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
1504 + '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
1505 + '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
1506 + '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
1507 + '%JSONParse%': ['JSON', 'parse'],
1508 + '%JSONStringify%': ['JSON', 'stringify'],
1509 + '%MapPrototype%': ['Map', 'prototype'],
1510 + '%NumberPrototype%': ['Number', 'prototype'],
1511 + '%ObjectPrototype%': ['Object', 'prototype'],
1512 + '%ObjProto_toString%': ['Object', 'prototype', 'toString'],
1513 + '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
1514 + '%PromisePrototype%': ['Promise', 'prototype'],
1515 + '%PromiseProto_then%': ['Promise', 'prototype', 'then'],
1516 + '%Promise_all%': ['Promise', 'all'],
1517 + '%Promise_reject%': ['Promise', 'reject'],
1518 + '%Promise_resolve%': ['Promise', 'resolve'],
1519 + '%RangeErrorPrototype%': ['RangeError', 'prototype'],
1520 + '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
1521 + '%RegExpPrototype%': ['RegExp', 'prototype'],
1522 + '%SetPrototype%': ['Set', 'prototype'],
1523 + '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
1524 + '%StringPrototype%': ['String', 'prototype'],
1525 + '%SymbolPrototype%': ['Symbol', 'prototype'],
1526 + '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
1527 + '%TypedArrayPrototype%': ['TypedArray', 'prototype'],
1528 + '%TypeErrorPrototype%': ['TypeError', 'prototype'],
1529 + '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
1530 + '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
1531 + '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
1532 + '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
1533 + '%URIErrorPrototype%': ['URIError', 'prototype'],
1534 + '%WeakMapPrototype%': ['WeakMap', 'prototype'],
1535 + '%WeakSetPrototype%': ['WeakSet', 'prototype']
1536 +};
1537 +
1538 +var bind = require('function-bind');
1539 +var hasOwn = require('has');
1540 +var $concat = bind.call(Function.call, Array.prototype.concat);
1541 +var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
1542 +var $replace = bind.call(Function.call, String.prototype.replace);
1543 +var $strSlice = bind.call(Function.call, String.prototype.slice);
1544 +
1545 +/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
1546 +var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
1547 +var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
1548 +var stringToPath = function stringToPath(string) {
1549 + var first = $strSlice(string, 0, 1);
1550 + var last = $strSlice(string, -1);
1551 + if (first === '%' && last !== '%') {
1552 + throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');
1553 + } else if (last === '%' && first !== '%') {
1554 + throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');
1555 + }
1556 + var result = [];
1557 + $replace(string, rePropName, function (match, number, quote, subString) {
1558 + result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;
1559 + });
1560 + return result;
1561 +};
1562 +/* end adaptation */
1563 +
1564 +var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
1565 + var intrinsicName = name;
1566 + var alias;
1567 + if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
1568 + alias = LEGACY_ALIASES[intrinsicName];
1569 + intrinsicName = '%' + alias[0] + '%';
1570 + }
1571 +
1572 + if (hasOwn(INTRINSICS, intrinsicName)) {
1573 + var value = INTRINSICS[intrinsicName];
1574 + if (value === needsEval) {
1575 + value = doEval(intrinsicName);
1576 + }
1577 + if (typeof value === 'undefined' && !allowMissing) {
1578 + throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
1579 + }
1580 +
1581 + return {
1582 + alias: alias,
1583 + name: intrinsicName,
1584 + value: value
1585 + };
1586 + }
1587 +
1588 + throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
1589 +};
1590 +
1591 +module.exports = function GetIntrinsic(name, allowMissing) {
1592 + if (typeof name !== 'string' || name.length === 0) {
1593 + throw new $TypeError('intrinsic name must be a non-empty string');
1594 + }
1595 + if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
1596 + throw new $TypeError('"allowMissing" argument must be a boolean');
1597 + }
1598 +
1599 + var parts = stringToPath(name);
1600 + var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
1601 +
1602 + var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
1603 + var intrinsicRealName = intrinsic.name;
1604 + var value = intrinsic.value;
1605 + var skipFurtherCaching = false;
1606 +
1607 + var alias = intrinsic.alias;
1608 + if (alias) {
1609 + intrinsicBaseName = alias[0];
1610 + $spliceApply(parts, $concat([0, 1], alias));
1611 + }
1612 +
1613 + for (var i = 1, isOwn = true; i < parts.length; i += 1) {
1614 + var part = parts[i];
1615 + var first = $strSlice(part, 0, 1);
1616 + var last = $strSlice(part, -1);
1617 + if (
1618 + (
1619 + (first === '"' || first === "'" || first === '`')
1620 + || (last === '"' || last === "'" || last === '`')
1621 + )
1622 + && first !== last
1623 + ) {
1624 + throw new $SyntaxError('property names with quotes must have matching quotes');
1625 + }
1626 + if (part === 'constructor' || !isOwn) {
1627 + skipFurtherCaching = true;
1628 + }
1629 +
1630 + intrinsicBaseName += '.' + part;
1631 + intrinsicRealName = '%' + intrinsicBaseName + '%';
1632 +
1633 + if (hasOwn(INTRINSICS, intrinsicRealName)) {
1634 + value = INTRINSICS[intrinsicRealName];
1635 + } else if (value != null) {
1636 + if (!(part in value)) {
1637 + if (!allowMissing) {
1638 + throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
1639 + }
1640 + return void undefined;
1641 + }
1642 + if ($gOPD && (i + 1) >= parts.length) {
1643 + var desc = $gOPD(value, part);
1644 + isOwn = !!desc;
1645 +
1646 + // By convention, when a data property is converted to an accessor
1647 + // property to emulate a data property that does not suffer from
1648 + // the override mistake, that accessor's getter is marked with
1649 + // an `originalValue` property. Here, when we detect this, we
1650 + // uphold the illusion by pretending to see that original data
1651 + // property, i.e., returning the value rather than the getter
1652 + // itself.
1653 + if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
1654 + value = desc.get;
1655 + } else {
1656 + value = value[part];
1657 + }
1658 + } else {
1659 + isOwn = hasOwn(value, part);
1660 + value = value[part];
1661 + }
1662 +
1663 + if (isOwn && !skipFurtherCaching) {
1664 + INTRINSICS[intrinsicRealName] = value;
1665 + }
1666 + }
1667 + }
1668 + return value;
1669 +};
1670 +
1671 +},{"function-bind":10,"has":14,"has-symbols":12}],12:[function(require,module,exports){
1672 +'use strict';
1673 +
1674 +var origSymbol = typeof Symbol !== 'undefined' && Symbol;
1675 +var hasSymbolSham = require('./shams');
1676 +
1677 +module.exports = function hasNativeSymbols() {
1678 + if (typeof origSymbol !== 'function') { return false; }
1679 + if (typeof Symbol !== 'function') { return false; }
1680 + if (typeof origSymbol('foo') !== 'symbol') { return false; }
1681 + if (typeof Symbol('bar') !== 'symbol') { return false; }
1682 +
1683 + return hasSymbolSham();
1684 +};
1685 +
1686 +},{"./shams":13}],13:[function(require,module,exports){
1687 +'use strict';
1688 +
1689 +/* eslint complexity: [2, 18], max-statements: [2, 33] */
1690 +module.exports = function hasSymbols() {
1691 + if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
1692 + if (typeof Symbol.iterator === 'symbol') { return true; }
1693 +
1694 + var obj = {};
1695 + var sym = Symbol('test');
1696 + var symObj = Object(sym);
1697 + if (typeof sym === 'string') { return false; }
1698 +
1699 + if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
1700 + if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
1701 +
1702 + // temp disabled per https://github.com/ljharb/object.assign/issues/17
1703 + // if (sym instanceof Symbol) { return false; }
1704 + // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
1705 + // if (!(symObj instanceof Symbol)) { return false; }
1706 +
1707 + // if (typeof Symbol.prototype.toString !== 'function') { return false; }
1708 + // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
1709 +
1710 + var symVal = 42;
1711 + obj[sym] = symVal;
1712 + for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
1713 + if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
1714 +
1715 + if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
1716 +
1717 + var syms = Object.getOwnPropertySymbols(obj);
1718 + if (syms.length !== 1 || syms[0] !== sym) { return false; }
1719 +
1720 + if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
1721 +
1722 + if (typeof Object.getOwnPropertyDescriptor === 'function') {
1723 + var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
1724 + if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
1725 + }
1726 +
1727 + return true;
1728 +};
1729 +
1730 +},{}],14:[function(require,module,exports){
1731 +'use strict';
1732 +
1733 +var bind = require('function-bind');
1734 +
1735 +module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty);
1736 +
1737 +},{"function-bind":10}],15:[function(require,module,exports){
1738 +var hasMap = typeof Map === 'function' && Map.prototype;
1739 +var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;
1740 +var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;
1741 +var mapForEach = hasMap && Map.prototype.forEach;
1742 +var hasSet = typeof Set === 'function' && Set.prototype;
1743 +var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;
1744 +var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;
1745 +var setForEach = hasSet && Set.prototype.forEach;
1746 +var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;
1747 +var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;
1748 +var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;
1749 +var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
1750 +var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;
1751 +var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
1752 +var booleanValueOf = Boolean.prototype.valueOf;
1753 +var objectToString = Object.prototype.toString;
1754 +var functionToString = Function.prototype.toString;
1755 +var $match = String.prototype.match;
1756 +var $slice = String.prototype.slice;
1757 +var $replace = String.prototype.replace;
1758 +var $toUpperCase = String.prototype.toUpperCase;
1759 +var $toLowerCase = String.prototype.toLowerCase;
1760 +var $test = RegExp.prototype.test;
1761 +var $concat = Array.prototype.concat;
1762 +var $join = Array.prototype.join;
1763 +var $arrSlice = Array.prototype.slice;
1764 +var $floor = Math.floor;
1765 +var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;
1766 +var gOPS = Object.getOwnPropertySymbols;
1767 +var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;
1768 +var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';
1769 +// ie, `has-tostringtag/shams
1770 +var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')
1771 + ? Symbol.toStringTag
1772 + : null;
1773 +var isEnumerable = Object.prototype.propertyIsEnumerable;
1774 +
1775 +var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (
1776 + [].__proto__ === Array.prototype // eslint-disable-line no-proto
1777 + ? function (O) {
1778 + return O.__proto__; // eslint-disable-line no-proto
1779 + }
1780 + : null
1781 +);
1782 +
1783 +function addNumericSeparator(num, str) {
1784 + if (
1785 + num === Infinity
1786 + || num === -Infinity
1787 + || num !== num
1788 + || (num && num > -1000 && num < 1000)
1789 + || $test.call(/e/, str)
1790 + ) {
1791 + return str;
1792 + }
1793 + var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
1794 + if (typeof num === 'number') {
1795 + var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)
1796 + if (int !== num) {
1797 + var intStr = String(int);
1798 + var dec = $slice.call(str, intStr.length + 1);
1799 + return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');
1800 + }
1801 + }
1802 + return $replace.call(str, sepRegex, '$&_');
1803 +}
1804 +
1805 +var utilInspect = require('./util.inspect');
1806 +var inspectCustom = utilInspect.custom;
1807 +var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
1808 +
1809 +module.exports = function inspect_(obj, options, depth, seen) {
1810 + var opts = options || {};
1811 +
1812 + if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {
1813 + throw new TypeError('option "quoteStyle" must be "single" or "double"');
1814 + }
1815 + if (
1816 + has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'
1817 + ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity
1818 + : opts.maxStringLength !== null
1819 + )
1820 + ) {
1821 + throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
1822 + }
1823 + var customInspect = has(opts, 'customInspect') ? opts.customInspect : true;
1824 + if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {
1825 + throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`');
1826 + }
1827 +
1828 + if (
1829 + has(opts, 'indent')
1830 + && opts.indent !== null
1831 + && opts.indent !== '\t'
1832 + && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)
1833 + ) {
1834 + throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
1835 + }
1836 + if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {
1837 + throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
1838 + }
1839 + var numericSeparator = opts.numericSeparator;
1840 +
1841 + if (typeof obj === 'undefined') {
1842 + return 'undefined';
1843 + }
1844 + if (obj === null) {
1845 + return 'null';
1846 + }
1847 + if (typeof obj === 'boolean') {
1848 + return obj ? 'true' : 'false';
1849 + }
1850 +
1851 + if (typeof obj === 'string') {
1852 + return inspectString(obj, opts);
1853 + }
1854 + if (typeof obj === 'number') {
1855 + if (obj === 0) {
1856 + return Infinity / obj > 0 ? '0' : '-0';
1857 + }
1858 + var str = String(obj);
1859 + return numericSeparator ? addNumericSeparator(obj, str) : str;
1860 + }
1861 + if (typeof obj === 'bigint') {
1862 + var bigIntStr = String(obj) + 'n';
1863 + return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;
1864 + }
1865 +
1866 + var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;
1867 + if (typeof depth === 'undefined') { depth = 0; }
1868 + if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {
1869 + return isArray(obj) ? '[Array]' : '[Object]';
1870 + }
1871 +
1872 + var indent = getIndent(opts, depth);
1873 +
1874 + if (typeof seen === 'undefined') {
1875 + seen = [];
1876 + } else if (indexOf(seen, obj) >= 0) {
1877 + return '[Circular]';
1878 + }
1879 +
1880 + function inspect(value, from, noIndent) {
1881 + if (from) {
1882 + seen = $arrSlice.call(seen);
1883 + seen.push(from);
1884 + }
1885 + if (noIndent) {
1886 + var newOpts = {
1887 + depth: opts.depth
1888 + };
1889 + if (has(opts, 'quoteStyle')) {
1890 + newOpts.quoteStyle = opts.quoteStyle;
1891 + }
1892 + return inspect_(value, newOpts, depth + 1, seen);
1893 + }
1894 + return inspect_(value, opts, depth + 1, seen);
1895 + }
1896 +
1897 + if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable
1898 + var name = nameOf(obj);
1899 + var keys = arrObjKeys(obj, inspect);
1900 + return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');
1901 + }
1902 + if (isSymbol(obj)) {
1903 + var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj);
1904 + return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;
1905 + }
1906 + if (isElement(obj)) {
1907 + var s = '<' + $toLowerCase.call(String(obj.nodeName));
1908 + var attrs = obj.attributes || [];
1909 + for (var i = 0; i < attrs.length; i++) {
1910 + s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);
1911 + }
1912 + s += '>';
1913 + if (obj.childNodes && obj.childNodes.length) { s += '...'; }
1914 + s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>';
1915 + return s;
1916 + }
1917 + if (isArray(obj)) {
1918 + if (obj.length === 0) { return '[]'; }
1919 + var xs = arrObjKeys(obj, inspect);
1920 + if (indent && !singleLineValues(xs)) {
1921 + return '[' + indentedJoin(xs, indent) + ']';
1922 + }
1923 + return '[ ' + $join.call(xs, ', ') + ' ]';
1924 + }
1925 + if (isError(obj)) {
1926 + var parts = arrObjKeys(obj, inspect);
1927 + if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {
1928 + return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';
1929 + }
1930 + if (parts.length === 0) { return '[' + String(obj) + ']'; }
1931 + return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';
1932 + }
1933 + if (typeof obj === 'object' && customInspect) {
1934 + if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {
1935 + return utilInspect(obj, { depth: maxDepth - depth });
1936 + } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {
1937 + return obj.inspect();
1938 + }
1939 + }
1940 + if (isMap(obj)) {
1941 + var mapParts = [];
1942 + mapForEach.call(obj, function (value, key) {
1943 + mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));
1944 + });
1945 + return collectionOf('Map', mapSize.call(obj), mapParts, indent);
1946 + }
1947 + if (isSet(obj)) {
1948 + var setParts = [];
1949 + setForEach.call(obj, function (value) {
1950 + setParts.push(inspect(value, obj));
1951 + });
1952 + return collectionOf('Set', setSize.call(obj), setParts, indent);
1953 + }
1954 + if (isWeakMap(obj)) {
1955 + return weakCollectionOf('WeakMap');
1956 + }
1957 + if (isWeakSet(obj)) {
1958 + return weakCollectionOf('WeakSet');
1959 + }
1960 + if (isWeakRef(obj)) {
1961 + return weakCollectionOf('WeakRef');
1962 + }
1963 + if (isNumber(obj)) {
1964 + return markBoxed(inspect(Number(obj)));
1965 + }
1966 + if (isBigInt(obj)) {
1967 + return markBoxed(inspect(bigIntValueOf.call(obj)));
1968 + }
1969 + if (isBoolean(obj)) {
1970 + return markBoxed(booleanValueOf.call(obj));
1971 + }
1972 + if (isString(obj)) {
1973 + return markBoxed(inspect(String(obj)));
1974 + }
1975 + if (!isDate(obj) && !isRegExp(obj)) {
1976 + var ys = arrObjKeys(obj, inspect);
1977 + var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
1978 + var protoTag = obj instanceof Object ? '' : 'null prototype';
1979 + var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';
1980 + var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';
1981 + var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');
1982 + if (ys.length === 0) { return tag + '{}'; }
1983 + if (indent) {
1984 + return tag + '{' + indentedJoin(ys, indent) + '}';
1985 + }
1986 + return tag + '{ ' + $join.call(ys, ', ') + ' }';
1987 + }
1988 + return String(obj);
1989 +};
1990 +
1991 +function wrapQuotes(s, defaultStyle, opts) {
1992 + var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'";
1993 + return quoteChar + s + quoteChar;
1994 +}
1995 +
1996 +function quote(s) {
1997 + return $replace.call(String(s), /"/g, '&quot;');
1998 +}
1999 +
2000 +function isArray(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
2001 +function isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
2002 +function isRegExp(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
2003 +function isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
2004 +function isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
2005 +function isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
2006 +function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
2007 +
2008 +// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives
2009 +function isSymbol(obj) {
2010 + if (hasShammedSymbols) {
2011 + return obj && typeof obj === 'object' && obj instanceof Symbol;
2012 + }
2013 + if (typeof obj === 'symbol') {
2014 + return true;
2015 + }
2016 + if (!obj || typeof obj !== 'object' || !symToString) {
2017 + return false;
2018 + }
2019 + try {
2020 + symToString.call(obj);
2021 + return true;
2022 + } catch (e) {}
2023 + return false;
2024 +}
2025 +
2026 +function isBigInt(obj) {
2027 + if (!obj || typeof obj !== 'object' || !bigIntValueOf) {
2028 + return false;
2029 + }
2030 + try {
2031 + bigIntValueOf.call(obj);
2032 + return true;
2033 + } catch (e) {}
2034 + return false;
2035 +}
2036 +
2037 +var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };
2038 +function has(obj, key) {
2039 + return hasOwn.call(obj, key);
2040 +}
2041 +
2042 +function toStr(obj) {
2043 + return objectToString.call(obj);
2044 +}
2045 +
2046 +function nameOf(f) {
2047 + if (f.name) { return f.name; }
2048 + var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/);
2049 + if (m) { return m[1]; }
2050 + return null;
2051 +}
2052 +
2053 +function indexOf(xs, x) {
2054 + if (xs.indexOf) { return xs.indexOf(x); }
2055 + for (var i = 0, l = xs.length; i < l; i++) {
2056 + if (xs[i] === x) { return i; }
2057 + }
2058 + return -1;
2059 +}
2060 +
2061 +function isMap(x) {
2062 + if (!mapSize || !x || typeof x !== 'object') {
2063 + return false;
2064 + }
2065 + try {
2066 + mapSize.call(x);
2067 + try {
2068 + setSize.call(x);
2069 + } catch (s) {
2070 + return true;
2071 + }
2072 + return x instanceof Map; // core-js workaround, pre-v2.5.0
2073 + } catch (e) {}
2074 + return false;
2075 +}
2076 +
2077 +function isWeakMap(x) {
2078 + if (!weakMapHas || !x || typeof x !== 'object') {
2079 + return false;
2080 + }
2081 + try {
2082 + weakMapHas.call(x, weakMapHas);
2083 + try {
2084 + weakSetHas.call(x, weakSetHas);
2085 + } catch (s) {
2086 + return true;
2087 + }
2088 + return x instanceof WeakMap; // core-js workaround, pre-v2.5.0
2089 + } catch (e) {}
2090 + return false;
2091 +}
2092 +
2093 +function isWeakRef(x) {
2094 + if (!weakRefDeref || !x || typeof x !== 'object') {
2095 + return false;
2096 + }
2097 + try {
2098 + weakRefDeref.call(x);
2099 + return true;
2100 + } catch (e) {}
2101 + return false;
2102 +}
2103 +
2104 +function isSet(x) {
2105 + if (!setSize || !x || typeof x !== 'object') {
2106 + return false;
2107 + }
2108 + try {
2109 + setSize.call(x);
2110 + try {
2111 + mapSize.call(x);
2112 + } catch (m) {
2113 + return true;
2114 + }
2115 + return x instanceof Set; // core-js workaround, pre-v2.5.0
2116 + } catch (e) {}
2117 + return false;
2118 +}
2119 +
2120 +function isWeakSet(x) {
2121 + if (!weakSetHas || !x || typeof x !== 'object') {
2122 + return false;
2123 + }
2124 + try {
2125 + weakSetHas.call(x, weakSetHas);
2126 + try {
2127 + weakMapHas.call(x, weakMapHas);
2128 + } catch (s) {
2129 + return true;
2130 + }
2131 + return x instanceof WeakSet; // core-js workaround, pre-v2.5.0
2132 + } catch (e) {}
2133 + return false;
2134 +}
2135 +
2136 +function isElement(x) {
2137 + if (!x || typeof x !== 'object') { return false; }
2138 + if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {
2139 + return true;
2140 + }
2141 + return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';
2142 +}
2143 +
2144 +function inspectString(str, opts) {
2145 + if (str.length > opts.maxStringLength) {
2146 + var remaining = str.length - opts.maxStringLength;
2147 + var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');
2148 + return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
2149 + }
2150 + // eslint-disable-next-line no-control-regex
2151 + var s = $replace.call($replace.call(str, /(['\\])/g, '\\$1'), /[\x00-\x1f]/g, lowbyte);
2152 + return wrapQuotes(s, 'single', opts);
2153 +}
2154 +
2155 +function lowbyte(c) {
2156 + var n = c.charCodeAt(0);
2157 + var x = {
2158 + 8: 'b',
2159 + 9: 't',
2160 + 10: 'n',
2161 + 12: 'f',
2162 + 13: 'r'
2163 + }[n];
2164 + if (x) { return '\\' + x; }
2165 + return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));
2166 +}
2167 +
2168 +function markBoxed(str) {
2169 + return 'Object(' + str + ')';
2170 +}
2171 +
2172 +function weakCollectionOf(type) {
2173 + return type + ' { ? }';
2174 +}
2175 +
2176 +function collectionOf(type, size, entries, indent) {
2177 + var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');
2178 + return type + ' (' + size + ') {' + joinedEntries + '}';
2179 +}
2180 +
2181 +function singleLineValues(xs) {
2182 + for (var i = 0; i < xs.length; i++) {
2183 + if (indexOf(xs[i], '\n') >= 0) {
2184 + return false;
2185 + }
2186 + }
2187 + return true;
2188 +}
2189 +
2190 +function getIndent(opts, depth) {
2191 + var baseIndent;
2192 + if (opts.indent === '\t') {
2193 + baseIndent = '\t';
2194 + } else if (typeof opts.indent === 'number' && opts.indent > 0) {
2195 + baseIndent = $join.call(Array(opts.indent + 1), ' ');
2196 + } else {
2197 + return null;
2198 + }
2199 + return {
2200 + base: baseIndent,
2201 + prev: $join.call(Array(depth + 1), baseIndent)
2202 + };
2203 +}
2204 +
2205 +function indentedJoin(xs, indent) {
2206 + if (xs.length === 0) { return ''; }
2207 + var lineJoiner = '\n' + indent.prev + indent.base;
2208 + return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev;
2209 +}
2210 +
2211 +function arrObjKeys(obj, inspect) {
2212 + var isArr = isArray(obj);
2213 + var xs = [];
2214 + if (isArr) {
2215 + xs.length = obj.length;
2216 + for (var i = 0; i < obj.length; i++) {
2217 + xs[i] = has(obj, i) ? inspect(obj[i], obj) : '';
2218 + }
2219 + }
2220 + var syms = typeof gOPS === 'function' ? gOPS(obj) : [];
2221 + var symMap;
2222 + if (hasShammedSymbols) {
2223 + symMap = {};
2224 + for (var k = 0; k < syms.length; k++) {
2225 + symMap['$' + syms[k]] = syms[k];
2226 + }
2227 + }
2228 +
2229 + for (var key in obj) { // eslint-disable-line no-restricted-syntax
2230 + if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
2231 + if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
2232 + if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {
2233 + // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section
2234 + continue; // eslint-disable-line no-restricted-syntax, no-continue
2235 + } else if ($test.call(/[^\w$]/, key)) {
2236 + xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));
2237 + } else {
2238 + xs.push(key + ': ' + inspect(obj[key], obj));
2239 + }
2240 + }
2241 + if (typeof gOPS === 'function') {
2242 + for (var j = 0; j < syms.length; j++) {
2243 + if (isEnumerable.call(obj, syms[j])) {
2244 + xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));
2245 + }
2246 + }
2247 + }
2248 + return xs;
2249 +}
2250 +
2251 +},{"./util.inspect":6}],16:[function(require,module,exports){
2252 +'use strict';
2253 +
2254 +var GetIntrinsic = require('get-intrinsic');
2255 +var callBound = require('call-bind/callBound');
2256 +var inspect = require('object-inspect');
2257 +
2258 +var $TypeError = GetIntrinsic('%TypeError%');
2259 +var $WeakMap = GetIntrinsic('%WeakMap%', true);
2260 +var $Map = GetIntrinsic('%Map%', true);
2261 +
2262 +var $weakMapGet = callBound('WeakMap.prototype.get', true);
2263 +var $weakMapSet = callBound('WeakMap.prototype.set', true);
2264 +var $weakMapHas = callBound('WeakMap.prototype.has', true);
2265 +var $mapGet = callBound('Map.prototype.get', true);
2266 +var $mapSet = callBound('Map.prototype.set', true);
2267 +var $mapHas = callBound('Map.prototype.has', true);
2268 +
2269 +/*
2270 + * This function traverses the list returning the node corresponding to the
2271 + * given key.
2272 + *
2273 + * That node is also moved to the head of the list, so that if it's accessed
2274 + * again we don't need to traverse the whole list. By doing so, all the recently
2275 + * used nodes can be accessed relatively quickly.
2276 + */
2277 +var listGetNode = function (list, key) { // eslint-disable-line consistent-return
2278 + for (var prev = list, curr; (curr = prev.next) !== null; prev = curr) {
2279 + if (curr.key === key) {
2280 + prev.next = curr.next;
2281 + curr.next = list.next;
2282 + list.next = curr; // eslint-disable-line no-param-reassign
2283 + return curr;
2284 + }
2285 + }
2286 +};
2287 +
2288 +var listGet = function (objects, key) {
2289 + var node = listGetNode(objects, key);
2290 + return node && node.value;
2291 +};
2292 +var listSet = function (objects, key, value) {
2293 + var node = listGetNode(objects, key);
2294 + if (node) {
2295 + node.value = value;
2296 + } else {
2297 + // Prepend the new node to the beginning of the list
2298 + objects.next = { // eslint-disable-line no-param-reassign
2299 + key: key,
2300 + next: objects.next,
2301 + value: value
2302 + };
2303 + }
2304 +};
2305 +var listHas = function (objects, key) {
2306 + return !!listGetNode(objects, key);
2307 +};
2308 +
2309 +module.exports = function getSideChannel() {
2310 + var $wm;
2311 + var $m;
2312 + var $o;
2313 + var channel = {
2314 + assert: function (key) {
2315 + if (!channel.has(key)) {
2316 + throw new $TypeError('Side channel does not contain ' + inspect(key));
2317 + }
2318 + },
2319 + get: function (key) { // eslint-disable-line consistent-return
2320 + if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
2321 + if ($wm) {
2322 + return $weakMapGet($wm, key);
2323 + }
2324 + } else if ($Map) {
2325 + if ($m) {
2326 + return $mapGet($m, key);
2327 + }
2328 + } else {
2329 + if ($o) { // eslint-disable-line no-lonely-if
2330 + return listGet($o, key);
2331 + }
2332 + }
2333 + },
2334 + has: function (key) {
2335 + if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
2336 + if ($wm) {
2337 + return $weakMapHas($wm, key);
2338 + }
2339 + } else if ($Map) {
2340 + if ($m) {
2341 + return $mapHas($m, key);
2342 + }
2343 + } else {
2344 + if ($o) { // eslint-disable-line no-lonely-if
2345 + return listHas($o, key);
2346 + }
2347 + }
2348 + return false;
2349 + },
2350 + set: function (key, value) {
2351 + if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
2352 + if (!$wm) {
2353 + $wm = new $WeakMap();
2354 + }
2355 + $weakMapSet($wm, key, value);
2356 + } else if ($Map) {
2357 + if (!$m) {
2358 + $m = new $Map();
2359 + }
2360 + $mapSet($m, key, value);
2361 + } else {
2362 + if (!$o) {
2363 + /*
2364 + * Initialize the linked list as an empty node, so that we don't have
2365 + * to special-case handling of the first node: we can always refer to
2366 + * it as (previous node).next, instead of something like (list).head
2367 + */
2368 + $o = { key: {}, next: null };
2369 + }
2370 + listSet($o, key, value);
2371 + }
2372 + }
2373 + };
2374 + return channel;
2375 +};
2376 +
2377 +},{"call-bind/callBound":7,"get-intrinsic":11,"object-inspect":15}]},{},[2])(2)
2378 +>>>>>>> bef06db (Init Address.js)
648 }); 2379 });
......
...@@ -3,8 +3,18 @@ ...@@ -3,8 +3,18 @@
3 var replace = String.prototype.replace; 3 var replace = String.prototype.replace;
4 var percentTwenties = /%20/g; 4 var percentTwenties = /%20/g;
5 5
6 +<<<<<<< HEAD
6 module.exports = { 7 module.exports = {
7 'default': 'RFC3986', 8 'default': 'RFC3986',
9 +=======
10 +var Format = {
11 + RFC1738: 'RFC1738',
12 + RFC3986: 'RFC3986'
13 +};
14 +
15 +module.exports = {
16 + 'default': Format.RFC3986,
17 +>>>>>>> bef06db (Init Address.js)
8 formatters: { 18 formatters: {
9 RFC1738: function (value) { 19 RFC1738: function (value) {
10 return replace.call(value, percentTwenties, '+'); 20 return replace.call(value, percentTwenties, '+');
...@@ -13,6 +23,11 @@ module.exports = { ...@@ -13,6 +23,11 @@ module.exports = {
13 return String(value); 23 return String(value);
14 } 24 }
15 }, 25 },
26 +<<<<<<< HEAD
16 RFC1738: 'RFC1738', 27 RFC1738: 'RFC1738',
17 RFC3986: 'RFC3986' 28 RFC3986: 'RFC3986'
29 +=======
30 + RFC1738: Format.RFC1738,
31 + RFC3986: Format.RFC3986
32 +>>>>>>> bef06db (Init Address.js)
18 }; 33 };
......
...@@ -3,26 +3,97 @@ ...@@ -3,26 +3,97 @@
3 var utils = require('./utils'); 3 var utils = require('./utils');
4 4
5 var has = Object.prototype.hasOwnProperty; 5 var has = Object.prototype.hasOwnProperty;
6 +<<<<<<< HEAD
7 +=======
8 +var isArray = Array.isArray;
9 +>>>>>>> bef06db (Init Address.js)
6 10
7 var defaults = { 11 var defaults = {
8 allowDots: false, 12 allowDots: false,
9 allowPrototypes: false, 13 allowPrototypes: false,
14 +<<<<<<< HEAD
10 arrayLimit: 20, 15 arrayLimit: 20,
11 decoder: utils.decode, 16 decoder: utils.decode,
12 delimiter: '&', 17 delimiter: '&',
13 depth: 5, 18 depth: 5,
14 parameterLimit: 1000, 19 parameterLimit: 1000,
20 +=======
21 + allowSparse: false,
22 + arrayLimit: 20,
23 + charset: 'utf-8',
24 + charsetSentinel: false,
25 + comma: false,
26 + decoder: utils.decode,
27 + delimiter: '&',
28 + depth: 5,
29 + ignoreQueryPrefix: false,
30 + interpretNumericEntities: false,
31 + parameterLimit: 1000,
32 + parseArrays: true,
33 +>>>>>>> bef06db (Init Address.js)
15 plainObjects: false, 34 plainObjects: false,
16 strictNullHandling: false 35 strictNullHandling: false
17 }; 36 };
18 37
38 +<<<<<<< HEAD
39 +=======
40 +var interpretNumericEntities = function (str) {
41 + return str.replace(/&#(\d+);/g, function ($0, numberStr) {
42 + return String.fromCharCode(parseInt(numberStr, 10));
43 + });
44 +};
45 +
46 +var parseArrayValue = function (val, options) {
47 + if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
48 + return val.split(',');
49 + }
50 +
51 + return val;
52 +};
53 +
54 +// This is what browsers will submit when the ✓ character occurs in an
55 +// application/x-www-form-urlencoded body and the encoding of the page containing
56 +// the form is iso-8859-1, or when the submitted form has an accept-charset
57 +// attribute of iso-8859-1. Presumably also with other charsets that do not contain
58 +// the ✓ character, such as us-ascii.
59 +var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('&#10003;')
60 +
61 +// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.
62 +var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
63 +
64 +>>>>>>> bef06db (Init Address.js)
19 var parseValues = function parseQueryStringValues(str, options) { 65 var parseValues = function parseQueryStringValues(str, options) {
20 var obj = {}; 66 var obj = {};
21 var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str; 67 var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
22 var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit; 68 var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
23 var parts = cleanStr.split(options.delimiter, limit); 69 var parts = cleanStr.split(options.delimiter, limit);
70 +<<<<<<< HEAD
24 71
25 for (var i = 0; i < parts.length; ++i) { 72 for (var i = 0; i < parts.length; ++i) {
73 +=======
74 + var skipIndex = -1; // Keep track of where the utf8 sentinel was found
75 + var i;
76 +
77 + var charset = options.charset;
78 + if (options.charsetSentinel) {
79 + for (i = 0; i < parts.length; ++i) {
80 + if (parts[i].indexOf('utf8=') === 0) {
81 + if (parts[i] === charsetSentinel) {
82 + charset = 'utf-8';
83 + } else if (parts[i] === isoSentinel) {
84 + charset = 'iso-8859-1';
85 + }
86 + skipIndex = i;
87 + i = parts.length; // The eslint settings do not allow break;
88 + }
89 + }
90 + }
91 +
92 + for (i = 0; i < parts.length; ++i) {
93 + if (i === skipIndex) {
94 + continue;
95 + }
96 +>>>>>>> bef06db (Init Address.js)
26 var part = parts[i]; 97 var part = parts[i];
27 98
28 var bracketEqualsPos = part.indexOf(']='); 99 var bracketEqualsPos = part.indexOf(']=');
...@@ -30,6 +101,7 @@ var parseValues = function parseQueryStringValues(str, options) { ...@@ -30,6 +101,7 @@ var parseValues = function parseQueryStringValues(str, options) {
30 101
31 var key, val; 102 var key, val;
32 if (pos === -1) { 103 if (pos === -1) {
104 +<<<<<<< HEAD
33 key = options.decoder(part, defaults.decoder); 105 key = options.decoder(part, defaults.decoder);
34 val = options.strictNullHandling ? null : ''; 106 val = options.strictNullHandling ? null : '';
35 } else { 107 } else {
...@@ -38,6 +110,30 @@ var parseValues = function parseQueryStringValues(str, options) { ...@@ -38,6 +110,30 @@ var parseValues = function parseQueryStringValues(str, options) {
38 } 110 }
39 if (has.call(obj, key)) { 111 if (has.call(obj, key)) {
40 obj[key] = [].concat(obj[key]).concat(val); 112 obj[key] = [].concat(obj[key]).concat(val);
113 +=======
114 + key = options.decoder(part, defaults.decoder, charset, 'key');
115 + val = options.strictNullHandling ? null : '';
116 + } else {
117 + key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
118 + val = utils.maybeMap(
119 + parseArrayValue(part.slice(pos + 1), options),
120 + function (encodedVal) {
121 + return options.decoder(encodedVal, defaults.decoder, charset, 'value');
122 + }
123 + );
124 + }
125 +
126 + if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
127 + val = interpretNumericEntities(val);
128 + }
129 +
130 + if (part.indexOf('[]=') > -1) {
131 + val = isArray(val) ? [val] : val;
132 + }
133 +
134 + if (has.call(obj, key)) {
135 + obj[key] = utils.combine(obj[key], val);
136 +>>>>>>> bef06db (Init Address.js)
41 } else { 137 } else {
42 obj[key] = val; 138 obj[key] = val;
43 } 139 }
...@@ -46,8 +142,13 @@ var parseValues = function parseQueryStringValues(str, options) { ...@@ -46,8 +142,13 @@ var parseValues = function parseQueryStringValues(str, options) {
46 return obj; 142 return obj;
47 }; 143 };
48 144
145 +<<<<<<< HEAD
49 var parseObject = function (chain, val, options) { 146 var parseObject = function (chain, val, options) {
50 var leaf = val; 147 var leaf = val;
148 +=======
149 +var parseObject = function (chain, val, options, valuesParsed) {
150 + var leaf = valuesParsed ? val : parseArrayValue(val, options);
151 +>>>>>>> bef06db (Init Address.js)
51 152
52 for (var i = chain.length - 1; i >= 0; --i) { 153 for (var i = chain.length - 1; i >= 0; --i) {
53 var obj; 154 var obj;
...@@ -81,7 +182,11 @@ var parseObject = function (chain, val, options) { ...@@ -81,7 +182,11 @@ var parseObject = function (chain, val, options) {
81 return leaf; 182 return leaf;
82 }; 183 };
83 184
185 +<<<<<<< HEAD
84 var parseKeys = function parseQueryStringKeys(givenKey, val, options) { 186 var parseKeys = function parseQueryStringKeys(givenKey, val, options) {
187 +=======
188 +var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
189 +>>>>>>> bef06db (Init Address.js)
85 if (!givenKey) { 190 if (!givenKey) {
86 return; 191 return;
87 } 192 }
...@@ -96,15 +201,23 @@ var parseKeys = function parseQueryStringKeys(givenKey, val, options) { ...@@ -96,15 +201,23 @@ var parseKeys = function parseQueryStringKeys(givenKey, val, options) {
96 201
97 // Get the parent 202 // Get the parent
98 203
204 +<<<<<<< HEAD
99 var segment = brackets.exec(key); 205 var segment = brackets.exec(key);
206 +=======
207 + var segment = options.depth > 0 && brackets.exec(key);
208 +>>>>>>> bef06db (Init Address.js)
100 var parent = segment ? key.slice(0, segment.index) : key; 209 var parent = segment ? key.slice(0, segment.index) : key;
101 210
102 // Stash the parent if it exists 211 // Stash the parent if it exists
103 212
104 var keys = []; 213 var keys = [];
105 if (parent) { 214 if (parent) {
215 +<<<<<<< HEAD
106 // If we aren't using plain objects, optionally prefix keys 216 // If we aren't using plain objects, optionally prefix keys
107 // that would overwrite object prototype properties 217 // that would overwrite object prototype properties
218 +=======
219 + // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
220 +>>>>>>> bef06db (Init Address.js)
108 if (!options.plainObjects && has.call(Object.prototype, parent)) { 221 if (!options.plainObjects && has.call(Object.prototype, parent)) {
109 if (!options.allowPrototypes) { 222 if (!options.allowPrototypes) {
110 return; 223 return;
...@@ -117,7 +230,11 @@ var parseKeys = function parseQueryStringKeys(givenKey, val, options) { ...@@ -117,7 +230,11 @@ var parseKeys = function parseQueryStringKeys(givenKey, val, options) {
117 // Loop through children appending to the array until we hit depth 230 // Loop through children appending to the array until we hit depth
118 231
119 var i = 0; 232 var i = 0;
233 +<<<<<<< HEAD
120 while ((segment = child.exec(key)) !== null && i < options.depth) { 234 while ((segment = child.exec(key)) !== null && i < options.depth) {
235 +=======
236 + while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
237 +>>>>>>> bef06db (Init Address.js)
121 i += 1; 238 i += 1;
122 if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) { 239 if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
123 if (!options.allowPrototypes) { 240 if (!options.allowPrototypes) {
...@@ -133,6 +250,7 @@ var parseKeys = function parseQueryStringKeys(givenKey, val, options) { ...@@ -133,6 +250,7 @@ var parseKeys = function parseQueryStringKeys(givenKey, val, options) {
133 keys.push('[' + key.slice(segment.index) + ']'); 250 keys.push('[' + key.slice(segment.index) + ']');
134 } 251 }
135 252
253 +<<<<<<< HEAD
136 return parseObject(keys, val, options); 254 return parseObject(keys, val, options);
137 }; 255 };
138 256
...@@ -154,6 +272,48 @@ module.exports = function (str, opts) { ...@@ -154,6 +272,48 @@ module.exports = function (str, opts) {
154 options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : defaults.allowPrototypes; 272 options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : defaults.allowPrototypes;
155 options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : defaults.parameterLimit; 273 options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : defaults.parameterLimit;
156 options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling; 274 options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling;
275 +=======
276 + return parseObject(keys, val, options, valuesParsed);
277 +};
278 +
279 +var normalizeParseOptions = function normalizeParseOptions(opts) {
280 + if (!opts) {
281 + return defaults;
282 + }
283 +
284 + if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {
285 + throw new TypeError('Decoder has to be a function.');
286 + }
287 +
288 + if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
289 + throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
290 + }
291 + var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
292 +
293 + return {
294 + allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
295 + allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
296 + allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,
297 + arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
298 + charset: charset,
299 + charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
300 + comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
301 + decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
302 + delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
303 + // eslint-disable-next-line no-implicit-coercion, no-extra-parens
304 + depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,
305 + ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
306 + interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
307 + parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
308 + parseArrays: opts.parseArrays !== false,
309 + plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
310 + strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
311 + };
312 +};
313 +
314 +module.exports = function (str, opts) {
315 + var options = normalizeParseOptions(opts);
316 +>>>>>>> bef06db (Init Address.js)
157 317
158 if (str === '' || str === null || typeof str === 'undefined') { 318 if (str === '' || str === null || typeof str === 'undefined') {
159 return options.plainObjects ? Object.create(null) : {}; 319 return options.plainObjects ? Object.create(null) : {};
...@@ -167,9 +327,20 @@ module.exports = function (str, opts) { ...@@ -167,9 +327,20 @@ module.exports = function (str, opts) {
167 var keys = Object.keys(tempObj); 327 var keys = Object.keys(tempObj);
168 for (var i = 0; i < keys.length; ++i) { 328 for (var i = 0; i < keys.length; ++i) {
169 var key = keys[i]; 329 var key = keys[i];
330 +<<<<<<< HEAD
170 var newObj = parseKeys(key, tempObj[key], options); 331 var newObj = parseKeys(key, tempObj[key], options);
171 obj = utils.merge(obj, newObj, options); 332 obj = utils.merge(obj, newObj, options);
172 } 333 }
173 334
335 +=======
336 + var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');
337 + obj = utils.merge(obj, newObj, options);
338 + }
339 +
340 + if (options.allowSparse === true) {
341 + return obj;
342 + }
343 +
344 +>>>>>>> bef06db (Init Address.js)
174 return utils.compact(obj); 345 return utils.compact(obj);
175 }; 346 };
......
1 'use strict'; 1 'use strict';
2 2
3 +<<<<<<< HEAD
3 var utils = require('./utils'); 4 var utils = require('./utils');
4 var formats = require('./formats'); 5 var formats = require('./formats');
6 +=======
7 +var getSideChannel = require('side-channel');
8 +var utils = require('./utils');
9 +var formats = require('./formats');
10 +var has = Object.prototype.hasOwnProperty;
11 +>>>>>>> bef06db (Init Address.js)
5 12
6 var arrayPrefixGenerators = { 13 var arrayPrefixGenerators = {
7 brackets: function brackets(prefix) { 14 brackets: function brackets(prefix) {
8 return prefix + '[]'; 15 return prefix + '[]';
9 }, 16 },
17 +<<<<<<< HEAD
18 +=======
19 + comma: 'comma',
20 +>>>>>>> bef06db (Init Address.js)
10 indices: function indices(prefix, key) { 21 indices: function indices(prefix, key) {
11 return prefix + '[' + key + ']'; 22 return prefix + '[' + key + ']';
12 }, 23 },
...@@ -16,6 +27,10 @@ var arrayPrefixGenerators = { ...@@ -16,6 +27,10 @@ var arrayPrefixGenerators = {
16 }; 27 };
17 28
18 var isArray = Array.isArray; 29 var isArray = Array.isArray;
30 +<<<<<<< HEAD
31 +=======
32 +var split = String.prototype.split;
33 +>>>>>>> bef06db (Init Address.js)
19 var push = Array.prototype.push; 34 var push = Array.prototype.push;
20 var pushToArray = function (arr, valueOrArray) { 35 var pushToArray = function (arr, valueOrArray) {
21 push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]); 36 push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);
...@@ -23,11 +38,27 @@ var pushToArray = function (arr, valueOrArray) { ...@@ -23,11 +38,27 @@ var pushToArray = function (arr, valueOrArray) {
23 38
24 var toISO = Date.prototype.toISOString; 39 var toISO = Date.prototype.toISOString;
25 40
41 +<<<<<<< HEAD
26 var defaults = { 42 var defaults = {
43 +=======
44 +var defaultFormat = formats['default'];
45 +var defaults = {
46 + addQueryPrefix: false,
47 + allowDots: false,
48 + charset: 'utf-8',
49 + charsetSentinel: false,
50 +>>>>>>> bef06db (Init Address.js)
27 delimiter: '&', 51 delimiter: '&',
28 encode: true, 52 encode: true,
29 encoder: utils.encode, 53 encoder: utils.encode,
30 encodeValuesOnly: false, 54 encodeValuesOnly: false,
55 +<<<<<<< HEAD
56 +=======
57 + format: defaultFormat,
58 + formatter: formats.formatters[defaultFormat],
59 + // deprecated
60 + indices: false,
61 +>>>>>>> bef06db (Init Address.js)
31 serializeDate: function serializeDate(date) { 62 serializeDate: function serializeDate(date) {
32 return toISO.call(date); 63 return toISO.call(date);
33 }, 64 },
...@@ -35,10 +66,27 @@ var defaults = { ...@@ -35,10 +66,27 @@ var defaults = {
35 strictNullHandling: false 66 strictNullHandling: false
36 }; 67 };
37 68
69 +<<<<<<< HEAD
70 +=======
71 +var isNonNullishPrimitive = function isNonNullishPrimitive(v) {
72 + return typeof v === 'string'
73 + || typeof v === 'number'
74 + || typeof v === 'boolean'
75 + || typeof v === 'symbol'
76 + || typeof v === 'bigint';
77 +};
78 +
79 +var sentinel = {};
80 +
81 +>>>>>>> bef06db (Init Address.js)
38 var stringify = function stringify( 82 var stringify = function stringify(
39 object, 83 object,
40 prefix, 84 prefix,
41 generateArrayPrefix, 85 generateArrayPrefix,
86 +<<<<<<< HEAD
87 +=======
88 + commaRoundTrip,
89 +>>>>>>> bef06db (Init Address.js)
42 strictNullHandling, 90 strictNullHandling,
43 skipNulls, 91 skipNulls,
44 encoder, 92 encoder,
...@@ -46,28 +94,87 @@ var stringify = function stringify( ...@@ -46,28 +94,87 @@ var stringify = function stringify(
46 sort, 94 sort,
47 allowDots, 95 allowDots,
48 serializeDate, 96 serializeDate,
97 +<<<<<<< HEAD
49 formatter, 98 formatter,
50 encodeValuesOnly 99 encodeValuesOnly
51 ) { 100 ) {
52 var obj = object; 101 var obj = object;
102 +=======
103 + format,
104 + formatter,
105 + encodeValuesOnly,
106 + charset,
107 + sideChannel
108 +) {
109 + var obj = object;
110 +
111 + var tmpSc = sideChannel;
112 + var step = 0;
113 + var findFlag = false;
114 + while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) {
115 + // Where object last appeared in the ref tree
116 + var pos = tmpSc.get(object);
117 + step += 1;
118 + if (typeof pos !== 'undefined') {
119 + if (pos === step) {
120 + throw new RangeError('Cyclic object value');
121 + } else {
122 + findFlag = true; // Break while
123 + }
124 + }
125 + if (typeof tmpSc.get(sentinel) === 'undefined') {
126 + step = 0;
127 + }
128 + }
129 +
130 +>>>>>>> bef06db (Init Address.js)
53 if (typeof filter === 'function') { 131 if (typeof filter === 'function') {
54 obj = filter(prefix, obj); 132 obj = filter(prefix, obj);
55 } else if (obj instanceof Date) { 133 } else if (obj instanceof Date) {
56 obj = serializeDate(obj); 134 obj = serializeDate(obj);
135 +<<<<<<< HEAD
136 +=======
137 + } else if (generateArrayPrefix === 'comma' && isArray(obj)) {
138 + obj = utils.maybeMap(obj, function (value) {
139 + if (value instanceof Date) {
140 + return serializeDate(value);
141 + }
142 + return value;
143 + });
144 +>>>>>>> bef06db (Init Address.js)
57 } 145 }
58 146
59 if (obj === null) { 147 if (obj === null) {
60 if (strictNullHandling) { 148 if (strictNullHandling) {
149 +<<<<<<< HEAD
61 return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder) : prefix; 150 return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder) : prefix;
151 +=======
152 + return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key', format) : prefix;
153 +>>>>>>> bef06db (Init Address.js)
62 } 154 }
63 155
64 obj = ''; 156 obj = '';
65 } 157 }
66 158
159 +<<<<<<< HEAD
67 if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || utils.isBuffer(obj)) { 160 if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || utils.isBuffer(obj)) {
68 if (encoder) { 161 if (encoder) {
69 var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder); 162 var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder);
70 return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder))]; 163 return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder))];
164 +=======
165 + if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {
166 + if (encoder) {
167 + var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format);
168 + if (generateArrayPrefix === 'comma' && encodeValuesOnly) {
169 + var valuesArray = split.call(String(obj), ',');
170 + var valuesJoined = '';
171 + for (var i = 0; i < valuesArray.length; ++i) {
172 + valuesJoined += (i === 0 ? '' : ',') + formatter(encoder(valuesArray[i], defaults.encoder, charset, 'value', format));
173 + }
174 + return [formatter(keyValue) + (commaRoundTrip && isArray(obj) && valuesArray.length === 1 ? '[]' : '') + '=' + valuesJoined];
175 + }
176 + return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))];
177 +>>>>>>> bef06db (Init Address.js)
71 } 178 }
72 return [formatter(prefix) + '=' + formatter(String(obj))]; 179 return [formatter(prefix) + '=' + formatter(String(obj))];
73 } 180 }
...@@ -79,13 +186,21 @@ var stringify = function stringify( ...@@ -79,13 +186,21 @@ var stringify = function stringify(
79 } 186 }
80 187
81 var objKeys; 188 var objKeys;
189 +<<<<<<< HEAD
82 if (isArray(filter)) { 190 if (isArray(filter)) {
191 +=======
192 + if (generateArrayPrefix === 'comma' && isArray(obj)) {
193 + // we need to join elements in
194 + objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
195 + } else if (isArray(filter)) {
196 +>>>>>>> bef06db (Init Address.js)
83 objKeys = filter; 197 objKeys = filter;
84 } else { 198 } else {
85 var keys = Object.keys(obj); 199 var keys = Object.keys(obj);
86 objKeys = sort ? keys.sort(sort) : keys; 200 objKeys = sort ? keys.sort(sort) : keys;
87 } 201 }
88 202
203 +<<<<<<< HEAD
89 for (var i = 0; i < objKeys.length; ++i) { 204 for (var i = 0; i < objKeys.length; ++i) {
90 var key = objKeys[i]; 205 var key = objKeys[i];
91 206
...@@ -124,11 +239,49 @@ var stringify = function stringify( ...@@ -124,11 +239,49 @@ var stringify = function stringify(
124 encodeValuesOnly 239 encodeValuesOnly
125 )); 240 ));
126 } 241 }
242 +=======
243 + var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? prefix + '[]' : prefix;
244 +
245 + for (var j = 0; j < objKeys.length; ++j) {
246 + var key = objKeys[j];
247 + var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];
248 +
249 + if (skipNulls && value === null) {
250 + continue;
251 + }
252 +
253 + var keyPrefix = isArray(obj)
254 + ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, key) : adjustedPrefix
255 + : adjustedPrefix + (allowDots ? '.' + key : '[' + key + ']');
256 +
257 + sideChannel.set(object, step);
258 + var valueSideChannel = getSideChannel();
259 + valueSideChannel.set(sentinel, sideChannel);
260 + pushToArray(values, stringify(
261 + value,
262 + keyPrefix,
263 + generateArrayPrefix,
264 + commaRoundTrip,
265 + strictNullHandling,
266 + skipNulls,
267 + encoder,
268 + filter,
269 + sort,
270 + allowDots,
271 + serializeDate,
272 + format,
273 + formatter,
274 + encodeValuesOnly,
275 + charset,
276 + valueSideChannel
277 + ));
278 +>>>>>>> bef06db (Init Address.js)
127 } 279 }
128 280
129 return values; 281 return values;
130 }; 282 };
131 283
284 +<<<<<<< HEAD
132 module.exports = function (object, opts) { 285 module.exports = function (object, opts) {
133 var obj = object; 286 var obj = object;
134 var options = opts ? utils.assign({}, opts) : {}; 287 var options = opts ? utils.assign({}, opts) : {};
...@@ -152,6 +305,59 @@ module.exports = function (object, opts) { ...@@ -152,6 +305,59 @@ module.exports = function (object, opts) {
152 throw new TypeError('Unknown format option provided.'); 305 throw new TypeError('Unknown format option provided.');
153 } 306 }
154 var formatter = formats.formatters[options.format]; 307 var formatter = formats.formatters[options.format];
308 +=======
309 +var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
310 + if (!opts) {
311 + return defaults;
312 + }
313 +
314 + if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
315 + throw new TypeError('Encoder has to be a function.');
316 + }
317 +
318 + var charset = opts.charset || defaults.charset;
319 + if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
320 + throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
321 + }
322 +
323 + var format = formats['default'];
324 + if (typeof opts.format !== 'undefined') {
325 + if (!has.call(formats.formatters, opts.format)) {
326 + throw new TypeError('Unknown format option provided.');
327 + }
328 + format = opts.format;
329 + }
330 + var formatter = formats.formatters[format];
331 +
332 + var filter = defaults.filter;
333 + if (typeof opts.filter === 'function' || isArray(opts.filter)) {
334 + filter = opts.filter;
335 + }
336 +
337 + return {
338 + addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,
339 + allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
340 + charset: charset,
341 + charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
342 + delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,
343 + encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,
344 + encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,
345 + encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,
346 + filter: filter,
347 + format: format,
348 + formatter: formatter,
349 + serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate,
350 + skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls,
351 + sort: typeof opts.sort === 'function' ? opts.sort : null,
352 + strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
353 + };
354 +};
355 +
356 +module.exports = function (object, opts) {
357 + var obj = object;
358 + var options = normalizeStringifyOptions(opts);
359 +
360 +>>>>>>> bef06db (Init Address.js)
155 var objKeys; 361 var objKeys;
156 var filter; 362 var filter;
157 363
...@@ -170,20 +376,35 @@ module.exports = function (object, opts) { ...@@ -170,20 +376,35 @@ module.exports = function (object, opts) {
170 } 376 }
171 377
172 var arrayFormat; 378 var arrayFormat;
379 +<<<<<<< HEAD
173 if (options.arrayFormat in arrayPrefixGenerators) { 380 if (options.arrayFormat in arrayPrefixGenerators) {
174 arrayFormat = options.arrayFormat; 381 arrayFormat = options.arrayFormat;
175 } else if ('indices' in options) { 382 } else if ('indices' in options) {
176 arrayFormat = options.indices ? 'indices' : 'repeat'; 383 arrayFormat = options.indices ? 'indices' : 'repeat';
384 +=======
385 + if (opts && opts.arrayFormat in arrayPrefixGenerators) {
386 + arrayFormat = opts.arrayFormat;
387 + } else if (opts && 'indices' in opts) {
388 + arrayFormat = opts.indices ? 'indices' : 'repeat';
389 +>>>>>>> bef06db (Init Address.js)
177 } else { 390 } else {
178 arrayFormat = 'indices'; 391 arrayFormat = 'indices';
179 } 392 }
180 393
181 var generateArrayPrefix = arrayPrefixGenerators[arrayFormat]; 394 var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
395 +<<<<<<< HEAD
396 +=======
397 + if (opts && 'commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
398 + throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
399 + }
400 + var commaRoundTrip = generateArrayPrefix === 'comma' && opts && opts.commaRoundTrip;
401 +>>>>>>> bef06db (Init Address.js)
182 402
183 if (!objKeys) { 403 if (!objKeys) {
184 objKeys = Object.keys(obj); 404 objKeys = Object.keys(obj);
185 } 405 }
186 406
407 +<<<<<<< HEAD
187 if (sort) { 408 if (sort) {
188 objKeys.sort(sort); 409 objKeys.sort(sort);
189 } 410 }
...@@ -192,12 +413,24 @@ module.exports = function (object, opts) { ...@@ -192,12 +413,24 @@ module.exports = function (object, opts) {
192 var key = objKeys[i]; 413 var key = objKeys[i];
193 414
194 if (skipNulls && obj[key] === null) { 415 if (skipNulls && obj[key] === null) {
416 +=======
417 + if (options.sort) {
418 + objKeys.sort(options.sort);
419 + }
420 +
421 + var sideChannel = getSideChannel();
422 + for (var i = 0; i < objKeys.length; ++i) {
423 + var key = objKeys[i];
424 +
425 + if (options.skipNulls && obj[key] === null) {
426 +>>>>>>> bef06db (Init Address.js)
195 continue; 427 continue;
196 } 428 }
197 pushToArray(keys, stringify( 429 pushToArray(keys, stringify(
198 obj[key], 430 obj[key],
199 key, 431 key,
200 generateArrayPrefix, 432 generateArrayPrefix,
433 +<<<<<<< HEAD
201 strictNullHandling, 434 strictNullHandling,
202 skipNulls, 435 skipNulls,
203 encode ? encoder : null, 436 encode ? encoder : null,
...@@ -213,5 +446,36 @@ module.exports = function (object, opts) { ...@@ -213,5 +446,36 @@ module.exports = function (object, opts) {
213 var joined = keys.join(delimiter); 446 var joined = keys.join(delimiter);
214 var prefix = options.addQueryPrefix === true ? '?' : ''; 447 var prefix = options.addQueryPrefix === true ? '?' : '';
215 448
449 +=======
450 + commaRoundTrip,
451 + options.strictNullHandling,
452 + options.skipNulls,
453 + options.encode ? options.encoder : null,
454 + options.filter,
455 + options.sort,
456 + options.allowDots,
457 + options.serializeDate,
458 + options.format,
459 + options.formatter,
460 + options.encodeValuesOnly,
461 + options.charset,
462 + sideChannel
463 + ));
464 + }
465 +
466 + var joined = keys.join(options.delimiter);
467 + var prefix = options.addQueryPrefix === true ? '?' : '';
468 +
469 + if (options.charsetSentinel) {
470 + if (options.charset === 'iso-8859-1') {
471 + // encodeURIComponent('&#10003;'), the "numeric entity" representation of a checkmark
472 + prefix += 'utf8=%26%2310003%3B&';
473 + } else {
474 + // encodeURIComponent('✓')
475 + prefix += 'utf8=%E2%9C%93&';
476 + }
477 + }
478 +
479 +>>>>>>> bef06db (Init Address.js)
216 return joined.length > 0 ? prefix + joined : ''; 480 return joined.length > 0 ? prefix + joined : '';
217 }; 481 };
......
1 'use strict'; 1 'use strict';
2 2
3 +<<<<<<< HEAD
3 var has = Object.prototype.hasOwnProperty; 4 var has = Object.prototype.hasOwnProperty;
5 +=======
6 +var formats = require('./formats');
7 +
8 +var has = Object.prototype.hasOwnProperty;
9 +var isArray = Array.isArray;
10 +>>>>>>> bef06db (Init Address.js)
4 11
5 var hexTable = (function () { 12 var hexTable = (function () {
6 var array = []; 13 var array = [];
...@@ -12,6 +19,7 @@ var hexTable = (function () { ...@@ -12,6 +19,7 @@ var hexTable = (function () {
12 }()); 19 }());
13 20
14 var compactQueue = function compactQueue(queue) { 21 var compactQueue = function compactQueue(queue) {
22 +<<<<<<< HEAD
15 var obj; 23 var obj;
16 24
17 while (queue.length) { 25 while (queue.length) {
...@@ -19,6 +27,13 @@ var compactQueue = function compactQueue(queue) { ...@@ -19,6 +27,13 @@ var compactQueue = function compactQueue(queue) {
19 obj = item.obj[item.prop]; 27 obj = item.obj[item.prop];
20 28
21 if (Array.isArray(obj)) { 29 if (Array.isArray(obj)) {
30 +=======
31 + while (queue.length > 1) {
32 + var item = queue.pop();
33 + var obj = item.obj[item.prop];
34 +
35 + if (isArray(obj)) {
36 +>>>>>>> bef06db (Init Address.js)
22 var compacted = []; 37 var compacted = [];
23 38
24 for (var j = 0; j < obj.length; ++j) { 39 for (var j = 0; j < obj.length; ++j) {
...@@ -30,8 +45,11 @@ var compactQueue = function compactQueue(queue) { ...@@ -30,8 +45,11 @@ var compactQueue = function compactQueue(queue) {
30 item.obj[item.prop] = compacted; 45 item.obj[item.prop] = compacted;
31 } 46 }
32 } 47 }
48 +<<<<<<< HEAD
33 49
34 return obj; 50 return obj;
51 +=======
52 +>>>>>>> bef06db (Init Address.js)
35 }; 53 };
36 54
37 var arrayToObject = function arrayToObject(source, options) { 55 var arrayToObject = function arrayToObject(source, options) {
...@@ -46,12 +64,20 @@ var arrayToObject = function arrayToObject(source, options) { ...@@ -46,12 +64,20 @@ var arrayToObject = function arrayToObject(source, options) {
46 }; 64 };
47 65
48 var merge = function merge(target, source, options) { 66 var merge = function merge(target, source, options) {
67 +<<<<<<< HEAD
68 +=======
69 + /* eslint no-param-reassign: 0 */
70 +>>>>>>> bef06db (Init Address.js)
49 if (!source) { 71 if (!source) {
50 return target; 72 return target;
51 } 73 }
52 74
53 if (typeof source !== 'object') { 75 if (typeof source !== 'object') {
76 +<<<<<<< HEAD
54 if (Array.isArray(target)) { 77 if (Array.isArray(target)) {
78 +=======
79 + if (isArray(target)) {
80 +>>>>>>> bef06db (Init Address.js)
55 target.push(source); 81 target.push(source);
56 } else if (target && typeof target === 'object') { 82 } else if (target && typeof target === 'object') {
57 if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) { 83 if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) {
...@@ -69,11 +95,19 @@ var merge = function merge(target, source, options) { ...@@ -69,11 +95,19 @@ var merge = function merge(target, source, options) {
69 } 95 }
70 96
71 var mergeTarget = target; 97 var mergeTarget = target;
98 +<<<<<<< HEAD
72 if (Array.isArray(target) && !Array.isArray(source)) { 99 if (Array.isArray(target) && !Array.isArray(source)) {
73 mergeTarget = arrayToObject(target, options); 100 mergeTarget = arrayToObject(target, options);
74 } 101 }
75 102
76 if (Array.isArray(target) && Array.isArray(source)) { 103 if (Array.isArray(target) && Array.isArray(source)) {
104 +=======
105 + if (isArray(target) && !isArray(source)) {
106 + mergeTarget = arrayToObject(target, options);
107 + }
108 +
109 + if (isArray(target) && isArray(source)) {
110 +>>>>>>> bef06db (Init Address.js)
77 source.forEach(function (item, i) { 111 source.forEach(function (item, i) {
78 if (has.call(target, i)) { 112 if (has.call(target, i)) {
79 var targetItem = target[i]; 113 var targetItem = target[i];
...@@ -108,6 +142,7 @@ var assign = function assignSingleSource(target, source) { ...@@ -108,6 +142,7 @@ var assign = function assignSingleSource(target, source) {
108 }, target); 142 }, target);
109 }; 143 };
110 144
145 +<<<<<<< HEAD
111 var decode = function (str) { 146 var decode = function (str) {
112 try { 147 try {
113 return decodeURIComponent(str.replace(/\+/g, ' ')); 148 return decodeURIComponent(str.replace(/\+/g, ' '));
...@@ -117,13 +152,45 @@ var decode = function (str) { ...@@ -117,13 +152,45 @@ var decode = function (str) {
117 }; 152 };
118 153
119 var encode = function encode(str) { 154 var encode = function encode(str) {
155 +=======
156 +var decode = function (str, decoder, charset) {
157 + var strWithoutPlus = str.replace(/\+/g, ' ');
158 + if (charset === 'iso-8859-1') {
159 + // unescape never throws, no try...catch needed:
160 + return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
161 + }
162 + // utf-8
163 + try {
164 + return decodeURIComponent(strWithoutPlus);
165 + } catch (e) {
166 + return strWithoutPlus;
167 + }
168 +};
169 +
170 +var encode = function encode(str, defaultEncoder, charset, kind, format) {
171 +>>>>>>> bef06db (Init Address.js)
120 // This code was originally written by Brian White (mscdex) for the io.js core querystring library. 172 // This code was originally written by Brian White (mscdex) for the io.js core querystring library.
121 // It has been adapted here for stricter adherence to RFC 3986 173 // It has been adapted here for stricter adherence to RFC 3986
122 if (str.length === 0) { 174 if (str.length === 0) {
123 return str; 175 return str;
124 } 176 }
125 177
178 +<<<<<<< HEAD
126 var string = typeof str === 'string' ? str : String(str); 179 var string = typeof str === 'string' ? str : String(str);
180 +=======
181 + var string = str;
182 + if (typeof str === 'symbol') {
183 + string = Symbol.prototype.toString.call(str);
184 + } else if (typeof str !== 'string') {
185 + string = String(str);
186 + }
187 +
188 + if (charset === 'iso-8859-1') {
189 + return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {
190 + return '%26%23' + parseInt($0.slice(2), 16) + '%3B';
191 + });
192 + }
193 +>>>>>>> bef06db (Init Address.js)
127 194
128 var out = ''; 195 var out = '';
129 for (var i = 0; i < string.length; ++i) { 196 for (var i = 0; i < string.length; ++i) {
...@@ -137,6 +204,10 @@ var encode = function encode(str) { ...@@ -137,6 +204,10 @@ var encode = function encode(str) {
137 || (c >= 0x30 && c <= 0x39) // 0-9 204 || (c >= 0x30 && c <= 0x39) // 0-9
138 || (c >= 0x41 && c <= 0x5A) // a-z 205 || (c >= 0x41 && c <= 0x5A) // a-z
139 || (c >= 0x61 && c <= 0x7A) // A-Z 206 || (c >= 0x61 && c <= 0x7A) // A-Z
207 +<<<<<<< HEAD
208 +=======
209 + || (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( )
210 +>>>>>>> bef06db (Init Address.js)
140 ) { 211 ) {
141 out += string.charAt(i); 212 out += string.charAt(i);
142 continue; 213 continue;
...@@ -188,7 +259,13 @@ var compact = function compact(value) { ...@@ -188,7 +259,13 @@ var compact = function compact(value) {
188 } 259 }
189 } 260 }
190 261
262 +<<<<<<< HEAD
191 return compactQueue(queue); 263 return compactQueue(queue);
264 +=======
265 + compactQueue(queue);
266 +
267 + return value;
268 +>>>>>>> bef06db (Init Address.js)
192 }; 269 };
193 270
194 var isRegExp = function isRegExp(obj) { 271 var isRegExp = function isRegExp(obj) {
...@@ -196,20 +273,50 @@ var isRegExp = function isRegExp(obj) { ...@@ -196,20 +273,50 @@ var isRegExp = function isRegExp(obj) {
196 }; 273 };
197 274
198 var isBuffer = function isBuffer(obj) { 275 var isBuffer = function isBuffer(obj) {
276 +<<<<<<< HEAD
199 if (obj === null || typeof obj === 'undefined') { 277 if (obj === null || typeof obj === 'undefined') {
278 +=======
279 + if (!obj || typeof obj !== 'object') {
280 +>>>>>>> bef06db (Init Address.js)
200 return false; 281 return false;
201 } 282 }
202 283
203 return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); 284 return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
204 }; 285 };
205 286
287 +<<<<<<< HEAD
288 +module.exports = {
289 + arrayToObject: arrayToObject,
290 + assign: assign,
291 +=======
292 +var combine = function combine(a, b) {
293 + return [].concat(a, b);
294 +};
295 +
296 +var maybeMap = function maybeMap(val, fn) {
297 + if (isArray(val)) {
298 + var mapped = [];
299 + for (var i = 0; i < val.length; i += 1) {
300 + mapped.push(fn(val[i]));
301 + }
302 + return mapped;
303 + }
304 + return fn(val);
305 +};
306 +
206 module.exports = { 307 module.exports = {
207 arrayToObject: arrayToObject, 308 arrayToObject: arrayToObject,
208 assign: assign, 309 assign: assign,
310 + combine: combine,
311 +>>>>>>> bef06db (Init Address.js)
209 compact: compact, 312 compact: compact,
210 decode: decode, 313 decode: decode,
211 encode: encode, 314 encode: encode,
212 isBuffer: isBuffer, 315 isBuffer: isBuffer,
213 isRegExp: isRegExp, 316 isRegExp: isRegExp,
317 +<<<<<<< HEAD
318 +=======
319 + maybeMap: maybeMap,
320 +>>>>>>> bef06db (Init Address.js)
214 merge: merge 321 merge: merge
215 }; 322 };
......
...@@ -2,11 +2,21 @@ ...@@ -2,11 +2,21 @@
2 "name": "qs", 2 "name": "qs",
3 "description": "A querystring parser that supports nesting and arrays, with a depth limit", 3 "description": "A querystring parser that supports nesting and arrays, with a depth limit",
4 "homepage": "https://github.com/ljharb/qs", 4 "homepage": "https://github.com/ljharb/qs",
5 +<<<<<<< HEAD
5 "version": "6.5.3", 6 "version": "6.5.3",
7 +=======
8 + "version": "6.11.0",
9 +>>>>>>> bef06db (Init Address.js)
6 "repository": { 10 "repository": {
7 "type": "git", 11 "type": "git",
8 "url": "https://github.com/ljharb/qs.git" 12 "url": "https://github.com/ljharb/qs.git"
9 }, 13 },
14 +<<<<<<< HEAD
15 +=======
16 + "funding": {
17 + "url": "https://github.com/sponsors/ljharb"
18 + },
19 +>>>>>>> bef06db (Init Address.js)
10 "main": "lib/index.js", 20 "main": "lib/index.js",
11 "contributors": [ 21 "contributors": [
12 { 22 {
...@@ -17,11 +27,20 @@ ...@@ -17,11 +27,20 @@
17 ], 27 ],
18 "keywords": [ 28 "keywords": [
19 "querystring", 29 "querystring",
30 +<<<<<<< HEAD
20 "qs" 31 "qs"
32 +=======
33 + "qs",
34 + "query",
35 + "url",
36 + "parse",
37 + "stringify"
38 +>>>>>>> bef06db (Init Address.js)
21 ], 39 ],
22 "engines": { 40 "engines": {
23 "node": ">=0.6" 41 "node": ">=0.6"
24 }, 42 },
43 +<<<<<<< HEAD
25 "devDependencies": { 44 "devDependencies": {
26 "@ljharb/eslint-config": "^20.1.0", 45 "@ljharb/eslint-config": "^20.1.0",
27 "aud": "^1.1.5", 46 "aud": "^1.1.5",
...@@ -51,4 +70,51 @@ ...@@ -51,4 +70,51 @@
51 "dist": "mkdirp dist && browserify --standalone Qs lib/index.js > dist/qs.js" 70 "dist": "mkdirp dist && browserify --standalone Qs lib/index.js > dist/qs.js"
52 }, 71 },
53 "license": "BSD-3-Clause" 72 "license": "BSD-3-Clause"
73 +=======
74 + "dependencies": {
75 + "side-channel": "^1.0.4"
76 + },
77 + "devDependencies": {
78 + "@ljharb/eslint-config": "^21.0.0",
79 + "aud": "^2.0.0",
80 + "browserify": "^16.5.2",
81 + "eclint": "^2.8.1",
82 + "eslint": "=8.8.0",
83 + "evalmd": "^0.0.19",
84 + "for-each": "^0.3.3",
85 + "has-symbols": "^1.0.3",
86 + "iconv-lite": "^0.5.1",
87 + "in-publish": "^2.0.1",
88 + "mkdirp": "^0.5.5",
89 + "npmignore": "^0.3.0",
90 + "nyc": "^10.3.2",
91 + "object-inspect": "^1.12.2",
92 + "qs-iconv": "^1.0.4",
93 + "safe-publish-latest": "^2.0.0",
94 + "safer-buffer": "^2.1.2",
95 + "tape": "^5.5.3"
96 + },
97 + "scripts": {
98 + "prepack": "npmignore --auto --commentLines=autogenerated",
99 + "prepublishOnly": "safe-publish-latest && npm run dist",
100 + "prepublish": "not-in-publish || npm run prepublishOnly",
101 + "pretest": "npm run --silent readme && npm run --silent lint",
102 + "test": "npm run tests-only",
103 + "tests-only": "nyc tape 'test/**/*.js'",
104 + "posttest": "aud --production",
105 + "readme": "evalmd README.md",
106 + "postlint": "eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git' | grep -v dist/)",
107 + "lint": "eslint --ext=js,mjs .",
108 + "dist": "mkdirp dist && browserify --standalone Qs lib/index.js > dist/qs.js"
109 + },
110 + "license": "BSD-3-Clause",
111 + "publishConfig": {
112 + "ignore": [
113 + "!dist/*",
114 + "bower.json",
115 + "component.json",
116 + ".github/workflows"
117 + ]
118 + }
119 +>>>>>>> bef06db (Init Address.js)
54 } 120 }
......
...@@ -32,6 +32,41 @@ test('parse()', function (t) { ...@@ -32,6 +32,41 @@ test('parse()', function (t) {
32 st.end(); 32 st.end();
33 }); 33 });
34 34
35 +<<<<<<< HEAD
36 +=======
37 + t.test('arrayFormat: brackets allows only explicit arrays', function (st) {
38 + st.deepEqual(qs.parse('a[]=b&a[]=c', { arrayFormat: 'brackets' }), { a: ['b', 'c'] });
39 + st.deepEqual(qs.parse('a[0]=b&a[1]=c', { arrayFormat: 'brackets' }), { a: ['b', 'c'] });
40 + st.deepEqual(qs.parse('a=b,c', { arrayFormat: 'brackets' }), { a: 'b,c' });
41 + st.deepEqual(qs.parse('a=b&a=c', { arrayFormat: 'brackets' }), { a: ['b', 'c'] });
42 + st.end();
43 + });
44 +
45 + t.test('arrayFormat: indices allows only indexed arrays', function (st) {
46 + st.deepEqual(qs.parse('a[]=b&a[]=c', { arrayFormat: 'indices' }), { a: ['b', 'c'] });
47 + st.deepEqual(qs.parse('a[0]=b&a[1]=c', { arrayFormat: 'indices' }), { a: ['b', 'c'] });
48 + st.deepEqual(qs.parse('a=b,c', { arrayFormat: 'indices' }), { a: 'b,c' });
49 + st.deepEqual(qs.parse('a=b&a=c', { arrayFormat: 'indices' }), { a: ['b', 'c'] });
50 + st.end();
51 + });
52 +
53 + t.test('arrayFormat: comma allows only comma-separated arrays', function (st) {
54 + st.deepEqual(qs.parse('a[]=b&a[]=c', { arrayFormat: 'comma' }), { a: ['b', 'c'] });
55 + st.deepEqual(qs.parse('a[0]=b&a[1]=c', { arrayFormat: 'comma' }), { a: ['b', 'c'] });
56 + st.deepEqual(qs.parse('a=b,c', { arrayFormat: 'comma' }), { a: 'b,c' });
57 + st.deepEqual(qs.parse('a=b&a=c', { arrayFormat: 'comma' }), { a: ['b', 'c'] });
58 + st.end();
59 + });
60 +
61 + t.test('arrayFormat: repeat allows only repeated values', function (st) {
62 + st.deepEqual(qs.parse('a[]=b&a[]=c', { arrayFormat: 'repeat' }), { a: ['b', 'c'] });
63 + st.deepEqual(qs.parse('a[0]=b&a[1]=c', { arrayFormat: 'repeat' }), { a: ['b', 'c'] });
64 + st.deepEqual(qs.parse('a=b,c', { arrayFormat: 'repeat' }), { a: 'b,c' });
65 + st.deepEqual(qs.parse('a=b&a=c', { arrayFormat: 'repeat' }), { a: ['b', 'c'] });
66 + st.end();
67 + });
68 +
69 +>>>>>>> bef06db (Init Address.js)
35 t.test('allows enabling dot notation', function (st) { 70 t.test('allows enabling dot notation', function (st) {
36 st.deepEqual(qs.parse('a.b=c'), { 'a.b': 'c' }); 71 st.deepEqual(qs.parse('a.b=c'), { 'a.b': 'c' });
37 st.deepEqual(qs.parse('a.b=c', { allowDots: true }), { a: { b: 'c' } }); 72 st.deepEqual(qs.parse('a.b=c', { allowDots: true }), { a: { b: 'c' } });
...@@ -52,6 +87,21 @@ test('parse()', function (t) { ...@@ -52,6 +87,21 @@ test('parse()', function (t) {
52 st.end(); 87 st.end();
53 }); 88 });
54 89
90 +<<<<<<< HEAD
91 +=======
92 + t.test('uses original key when depth = 0', function (st) {
93 + st.deepEqual(qs.parse('a[0]=b&a[1]=c', { depth: 0 }), { 'a[0]': 'b', 'a[1]': 'c' });
94 + st.deepEqual(qs.parse('a[0][0]=b&a[0][1]=c&a[1]=d&e=2', { depth: 0 }), { 'a[0][0]': 'b', 'a[0][1]': 'c', 'a[1]': 'd', e: '2' });
95 + st.end();
96 + });
97 +
98 + t.test('uses original key when depth = false', function (st) {
99 + st.deepEqual(qs.parse('a[0]=b&a[1]=c', { depth: false }), { 'a[0]': 'b', 'a[1]': 'c' });
100 + st.deepEqual(qs.parse('a[0][0]=b&a[0][1]=c&a[1]=d&e=2', { depth: false }), { 'a[0][0]': 'b', 'a[0][1]': 'c', 'a[1]': 'd', e: '2' });
101 + st.end();
102 + });
103 +
104 +>>>>>>> bef06db (Init Address.js)
55 t.deepEqual(qs.parse('a=b&a=c'), { a: ['b', 'c'] }, 'parses a simple array'); 105 t.deepEqual(qs.parse('a=b&a=c'), { a: ['b', 'c'] }, 'parses a simple array');
56 106
57 t.test('parses an explicit array', function (st) { 107 t.test('parses an explicit array', function (st) {
...@@ -96,6 +146,12 @@ test('parse()', function (t) { ...@@ -96,6 +146,12 @@ test('parse()', function (t) {
96 t.test('limits specific array indices to arrayLimit', function (st) { 146 t.test('limits specific array indices to arrayLimit', function (st) {
97 st.deepEqual(qs.parse('a[20]=a', { arrayLimit: 20 }), { a: ['a'] }); 147 st.deepEqual(qs.parse('a[20]=a', { arrayLimit: 20 }), { a: ['a'] });
98 st.deepEqual(qs.parse('a[21]=a', { arrayLimit: 20 }), { a: { 21: 'a' } }); 148 st.deepEqual(qs.parse('a[21]=a', { arrayLimit: 20 }), { a: { 21: 'a' } });
149 +<<<<<<< HEAD
150 +=======
151 +
152 + st.deepEqual(qs.parse('a[20]=a'), { a: ['a'] });
153 + st.deepEqual(qs.parse('a[21]=a'), { a: { 21: 'a' } });
154 +>>>>>>> bef06db (Init Address.js)
99 st.end(); 155 st.end();
100 }); 156 });
101 157
...@@ -225,6 +281,18 @@ test('parse()', function (t) { ...@@ -225,6 +281,18 @@ test('parse()', function (t) {
225 st.end(); 281 st.end();
226 }); 282 });
227 283
284 +<<<<<<< HEAD
285 +=======
286 + t.test('parses sparse arrays', function (st) {
287 + /* eslint no-sparse-arrays: 0 */
288 + st.deepEqual(qs.parse('a[4]=1&a[1]=2', { allowSparse: true }), { a: [, '2', , , '1'] });
289 + st.deepEqual(qs.parse('a[1][b][2][c]=1', { allowSparse: true }), { a: [, { b: [, , { c: '1' }] }] });
290 + st.deepEqual(qs.parse('a[1][2][3][c]=1', { allowSparse: true }), { a: [, [, , [, , , { c: '1' }]]] });
291 + st.deepEqual(qs.parse('a[1][2][3][c][1]=1', { allowSparse: true }), { a: [, [, , [, , , { c: [, '1'] }]]] });
292 + st.end();
293 + });
294 +
295 +>>>>>>> bef06db (Init Address.js)
228 t.test('parses semi-parsed strings', function (st) { 296 t.test('parses semi-parsed strings', function (st) {
229 st.deepEqual(qs.parse({ 'a[b]': 'c' }), { a: { b: 'c' } }); 297 st.deepEqual(qs.parse({ 'a[b]': 'c' }), { a: { b: 'c' } });
230 st.deepEqual(qs.parse({ 'a[b]': 'c', 'a[d]': 'e' }), { a: { b: 'c', d: 'e' } }); 298 st.deepEqual(qs.parse({ 'a[b]': 'c', 'a[d]': 'e' }), { a: { b: 'c', d: 'e' } });
...@@ -325,6 +393,10 @@ test('parse()', function (t) { ...@@ -325,6 +393,10 @@ test('parse()', function (t) {
325 st.deepEqual(qs.parse('?foo=bar', { ignoreQueryPrefix: true }), { foo: 'bar' }); 393 st.deepEqual(qs.parse('?foo=bar', { ignoreQueryPrefix: true }), { foo: 'bar' });
326 st.deepEqual(qs.parse('foo=bar', { ignoreQueryPrefix: true }), { foo: 'bar' }); 394 st.deepEqual(qs.parse('foo=bar', { ignoreQueryPrefix: true }), { foo: 'bar' });
327 st.deepEqual(qs.parse('?foo=bar', { ignoreQueryPrefix: false }), { '?foo': 'bar' }); 395 st.deepEqual(qs.parse('?foo=bar', { ignoreQueryPrefix: false }), { '?foo': 'bar' });
396 +<<<<<<< HEAD
397 +=======
398 +
399 +>>>>>>> bef06db (Init Address.js)
328 st.end(); 400 st.end();
329 }); 401 });
330 402
...@@ -347,6 +419,65 @@ test('parse()', function (t) { ...@@ -347,6 +419,65 @@ test('parse()', function (t) {
347 st.end(); 419 st.end();
348 }); 420 });
349 421
422 +<<<<<<< HEAD
423 +=======
424 + t.test('parses string with comma as array divider', function (st) {
425 + st.deepEqual(qs.parse('foo=bar,tee', { comma: true }), { foo: ['bar', 'tee'] });
426 + st.deepEqual(qs.parse('foo[bar]=coffee,tee', { comma: true }), { foo: { bar: ['coffee', 'tee'] } });
427 + st.deepEqual(qs.parse('foo=', { comma: true }), { foo: '' });
428 + st.deepEqual(qs.parse('foo', { comma: true }), { foo: '' });
429 + st.deepEqual(qs.parse('foo', { comma: true, strictNullHandling: true }), { foo: null });
430 +
431 + // test cases inversed from from stringify tests
432 + st.deepEqual(qs.parse('a[0]=c'), { a: ['c'] });
433 + st.deepEqual(qs.parse('a[]=c'), { a: ['c'] });
434 + st.deepEqual(qs.parse('a[]=c', { comma: true }), { a: ['c'] });
435 +
436 + st.deepEqual(qs.parse('a[0]=c&a[1]=d'), { a: ['c', 'd'] });
437 + st.deepEqual(qs.parse('a[]=c&a[]=d'), { a: ['c', 'd'] });
438 + st.deepEqual(qs.parse('a=c,d', { comma: true }), { a: ['c', 'd'] });
439 +
440 + st.end();
441 + });
442 +
443 + t.test('parses values with comma as array divider', function (st) {
444 + st.deepEqual(qs.parse({ foo: 'bar,tee' }, { comma: false }), { foo: 'bar,tee' });
445 + st.deepEqual(qs.parse({ foo: 'bar,tee' }, { comma: true }), { foo: ['bar', 'tee'] });
446 + st.end();
447 + });
448 +
449 + t.test('use number decoder, parses string that has one number with comma option enabled', function (st) {
450 + var decoder = function (str, defaultDecoder, charset, type) {
451 + if (!isNaN(Number(str))) {
452 + return parseFloat(str);
453 + }
454 + return defaultDecoder(str, defaultDecoder, charset, type);
455 + };
456 +
457 + st.deepEqual(qs.parse('foo=1', { comma: true, decoder: decoder }), { foo: 1 });
458 + st.deepEqual(qs.parse('foo=0', { comma: true, decoder: decoder }), { foo: 0 });
459 +
460 + st.end();
461 + });
462 +
463 + t.test('parses brackets holds array of arrays when having two parts of strings with comma as array divider', function (st) {
464 + st.deepEqual(qs.parse('foo[]=1,2,3&foo[]=4,5,6', { comma: true }), { foo: [['1', '2', '3'], ['4', '5', '6']] });
465 + st.deepEqual(qs.parse('foo[]=1,2,3&foo[]=', { comma: true }), { foo: [['1', '2', '3'], ''] });
466 + st.deepEqual(qs.parse('foo[]=1,2,3&foo[]=,', { comma: true }), { foo: [['1', '2', '3'], ['', '']] });
467 + st.deepEqual(qs.parse('foo[]=1,2,3&foo[]=a', { comma: true }), { foo: [['1', '2', '3'], 'a'] });
468 +
469 + st.end();
470 + });
471 +
472 + t.test('parses comma delimited array while having percent-encoded comma treated as normal text', function (st) {
473 + st.deepEqual(qs.parse('foo=a%2Cb', { comma: true }), { foo: 'a,b' });
474 + st.deepEqual(qs.parse('foo=a%2C%20b,d', { comma: true }), { foo: ['a, b', 'd'] });
475 + st.deepEqual(qs.parse('foo=a%2C%20b,c%2C%20d', { comma: true }), { foo: ['a, b', 'c, d'] });
476 +
477 + st.end();
478 + });
479 +
480 +>>>>>>> bef06db (Init Address.js)
350 t.test('parses an object in dot notation', function (st) { 481 t.test('parses an object in dot notation', function (st) {
351 var input = { 482 var input = {
352 'user.name': { 'pop[bob]': 3 }, 483 'user.name': { 'pop[bob]': 3 },
...@@ -645,5 +776,101 @@ test('parse()', function (t) { ...@@ -645,5 +776,101 @@ test('parse()', function (t) {
645 st.end(); 776 st.end();
646 }); 777 });
647 778
779 +<<<<<<< HEAD
780 +=======
781 + t.test('throws if an invalid charset is specified', function (st) {
782 + st['throws'](function () {
783 + qs.parse('a=b', { charset: 'foobar' });
784 + }, new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'));
785 + st.end();
786 + });
787 +
788 + t.test('parses an iso-8859-1 string if asked to', function (st) {
789 + st.deepEqual(qs.parse('%A2=%BD', { charset: 'iso-8859-1' }), { '¢': '½' });
790 + st.end();
791 + });
792 +
793 + var urlEncodedCheckmarkInUtf8 = '%E2%9C%93';
794 + var urlEncodedOSlashInUtf8 = '%C3%B8';
795 + var urlEncodedNumCheckmark = '%26%2310003%3B';
796 + var urlEncodedNumSmiley = '%26%239786%3B';
797 +
798 + t.test('prefers an utf-8 charset specified by the utf8 sentinel to a default charset of iso-8859-1', function (st) {
799 + st.deepEqual(qs.parse('utf8=' + urlEncodedCheckmarkInUtf8 + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true, charset: 'iso-8859-1' }), { ø: 'ø' });
800 + st.end();
801 + });
802 +
803 + t.test('prefers an iso-8859-1 charset specified by the utf8 sentinel to a default charset of utf-8', function (st) {
804 + st.deepEqual(qs.parse('utf8=' + urlEncodedNumCheckmark + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true, charset: 'utf-8' }), { 'ø': 'ø' });
805 + st.end();
806 + });
807 +
808 + t.test('does not require the utf8 sentinel to be defined before the parameters whose decoding it affects', function (st) {
809 + st.deepEqual(qs.parse('a=' + urlEncodedOSlashInUtf8 + '&utf8=' + urlEncodedNumCheckmark, { charsetSentinel: true, charset: 'utf-8' }), { a: 'ø' });
810 + st.end();
811 + });
812 +
813 + t.test('should ignore an utf8 sentinel with an unknown value', function (st) {
814 + st.deepEqual(qs.parse('utf8=foo&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true, charset: 'utf-8' }), { ø: 'ø' });
815 + st.end();
816 + });
817 +
818 + t.test('uses the utf8 sentinel to switch to utf-8 when no default charset is given', function (st) {
819 + st.deepEqual(qs.parse('utf8=' + urlEncodedCheckmarkInUtf8 + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true }), { ø: 'ø' });
820 + st.end();
821 + });
822 +
823 + t.test('uses the utf8 sentinel to switch to iso-8859-1 when no default charset is given', function (st) {
824 + st.deepEqual(qs.parse('utf8=' + urlEncodedNumCheckmark + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true }), { 'ø': 'ø' });
825 + st.end();
826 + });
827 +
828 + t.test('interprets numeric entities in iso-8859-1 when `interpretNumericEntities`', function (st) {
829 + st.deepEqual(qs.parse('foo=' + urlEncodedNumSmiley, { charset: 'iso-8859-1', interpretNumericEntities: true }), { foo: '☺' });
830 + st.end();
831 + });
832 +
833 + t.test('handles a custom decoder returning `null`, in the `iso-8859-1` charset, when `interpretNumericEntities`', function (st) {
834 + st.deepEqual(qs.parse('foo=&bar=' + urlEncodedNumSmiley, {
835 + charset: 'iso-8859-1',
836 + decoder: function (str, defaultDecoder, charset) {
837 + return str ? defaultDecoder(str, defaultDecoder, charset) : null;
838 + },
839 + interpretNumericEntities: true
840 + }), { foo: null, bar: '☺' });
841 + st.end();
842 + });
843 +
844 + t.test('does not interpret numeric entities in iso-8859-1 when `interpretNumericEntities` is absent', function (st) {
845 + st.deepEqual(qs.parse('foo=' + urlEncodedNumSmiley, { charset: 'iso-8859-1' }), { foo: '&#9786;' });
846 + st.end();
847 + });
848 +
849 + t.test('does not interpret numeric entities when the charset is utf-8, even when `interpretNumericEntities`', function (st) {
850 + st.deepEqual(qs.parse('foo=' + urlEncodedNumSmiley, { charset: 'utf-8', interpretNumericEntities: true }), { foo: '&#9786;' });
851 + st.end();
852 + });
853 +
854 + t.test('does not interpret %uXXXX syntax in iso-8859-1 mode', function (st) {
855 + st.deepEqual(qs.parse('%u263A=%u263A', { charset: 'iso-8859-1' }), { '%u263A': '%u263A' });
856 + st.end();
857 + });
858 +
859 + t.test('allows for decoding keys and values differently', function (st) {
860 + var decoder = function (str, defaultDecoder, charset, type) {
861 + if (type === 'key') {
862 + return defaultDecoder(str, defaultDecoder, charset, type).toLowerCase();
863 + }
864 + if (type === 'value') {
865 + return defaultDecoder(str, defaultDecoder, charset, type).toUpperCase();
866 + }
867 + throw 'this should never happen! type: ' + type;
868 + };
869 +
870 + st.deepEqual(qs.parse('KeY=vAlUe', { decoder: decoder }), { key: 'VALUE' });
871 + st.end();
872 + });
873 +
874 +>>>>>>> bef06db (Init Address.js)
648 t.end(); 875 t.end();
649 }); 876 });
......
...@@ -5,6 +5,11 @@ var qs = require('../'); ...@@ -5,6 +5,11 @@ var qs = require('../');
5 var utils = require('../lib/utils'); 5 var utils = require('../lib/utils');
6 var iconv = require('iconv-lite'); 6 var iconv = require('iconv-lite');
7 var SaferBuffer = require('safer-buffer').Buffer; 7 var SaferBuffer = require('safer-buffer').Buffer;
8 +<<<<<<< HEAD
9 +=======
10 +var hasSymbols = require('has-symbols');
11 +var hasBigInt = typeof BigInt === 'function';
12 +>>>>>>> bef06db (Init Address.js)
8 13
9 test('stringify()', function (t) { 14 test('stringify()', function (t) {
10 t.test('stringifies a querystring object', function (st) { 15 t.test('stringifies a querystring object', function (st) {
...@@ -28,6 +33,42 @@ test('stringify()', function (t) { ...@@ -28,6 +33,42 @@ test('stringify()', function (t) {
28 st.end(); 33 st.end();
29 }); 34 });
30 35
36 +<<<<<<< HEAD
37 +=======
38 + t.test('stringifies symbols', { skip: !hasSymbols() }, function (st) {
39 + st.equal(qs.stringify(Symbol.iterator), '');
40 + st.equal(qs.stringify([Symbol.iterator]), '0=Symbol%28Symbol.iterator%29');
41 + st.equal(qs.stringify({ a: Symbol.iterator }), 'a=Symbol%28Symbol.iterator%29');
42 + st.equal(
43 + qs.stringify({ a: [Symbol.iterator] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }),
44 + 'a[]=Symbol%28Symbol.iterator%29'
45 + );
46 + st.end();
47 + });
48 +
49 + t.test('stringifies bigints', { skip: !hasBigInt }, function (st) {
50 + var three = BigInt(3);
51 + var encodeWithN = function (value, defaultEncoder, charset) {
52 + var result = defaultEncoder(value, defaultEncoder, charset);
53 + return typeof value === 'bigint' ? result + 'n' : result;
54 + };
55 + st.equal(qs.stringify(three), '');
56 + st.equal(qs.stringify([three]), '0=3');
57 + st.equal(qs.stringify([three], { encoder: encodeWithN }), '0=3n');
58 + st.equal(qs.stringify({ a: three }), 'a=3');
59 + st.equal(qs.stringify({ a: three }, { encoder: encodeWithN }), 'a=3n');
60 + st.equal(
61 + qs.stringify({ a: [three] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }),
62 + 'a[]=3'
63 + );
64 + st.equal(
65 + qs.stringify({ a: [three] }, { encodeValuesOnly: true, encoder: encodeWithN, arrayFormat: 'brackets' }),
66 + 'a[]=3n'
67 + );
68 + st.end();
69 + });
70 +
71 +>>>>>>> bef06db (Init Address.js)
31 t.test('adds query prefix', function (st) { 72 t.test('adds query prefix', function (st) {
32 st.equal(qs.stringify({ a: 'b' }, { addQueryPrefix: true }), '?a=b'); 73 st.equal(qs.stringify({ a: 'b' }, { addQueryPrefix: true }), '?a=b');
33 st.end(); 74 st.end();
...@@ -69,6 +110,14 @@ test('stringify()', function (t) { ...@@ -69,6 +110,14 @@ test('stringify()', function (t) {
69 'brackets => brackets' 110 'brackets => brackets'
70 ); 111 );
71 st.equal( 112 st.equal(
113 +<<<<<<< HEAD
114 +=======
115 + qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'comma' }),
116 + 'a=b%2Cc%2Cd',
117 + 'comma => comma'
118 + );
119 + st.equal(
120 +>>>>>>> bef06db (Init Address.js)
72 qs.stringify({ a: ['b', 'c', 'd'] }), 121 qs.stringify({ a: ['b', 'c', 'd'] }),
73 'a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d', 122 'a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d',
74 'default => indices' 123 'default => indices'
...@@ -91,10 +140,50 @@ test('stringify()', function (t) { ...@@ -91,10 +140,50 @@ test('stringify()', function (t) {
91 st.end(); 140 st.end();
92 }); 141 });
93 142
143 +<<<<<<< HEAD
94 t.test('stringifies a nested array value', function (st) { 144 t.test('stringifies a nested array value', function (st) {
95 st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { arrayFormat: 'indices' }), 'a%5Bb%5D%5B0%5D=c&a%5Bb%5D%5B1%5D=d'); 145 st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { arrayFormat: 'indices' }), 'a%5Bb%5D%5B0%5D=c&a%5Bb%5D%5B1%5D=d');
96 st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { arrayFormat: 'brackets' }), 'a%5Bb%5D%5B%5D=c&a%5Bb%5D%5B%5D=d'); 146 st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { arrayFormat: 'brackets' }), 'a%5Bb%5D%5B%5D=c&a%5Bb%5D%5B%5D=d');
97 st.equal(qs.stringify({ a: { b: ['c', 'd'] } }), 'a%5Bb%5D%5B0%5D=c&a%5Bb%5D%5B1%5D=d'); 147 st.equal(qs.stringify({ a: { b: ['c', 'd'] } }), 'a%5Bb%5D%5B0%5D=c&a%5Bb%5D%5B1%5D=d');
148 +=======
149 + t.test('stringifies an array value with one item vs multiple items', function (st) {
150 + st.test('non-array item', function (s2t) {
151 + s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a=c');
152 + s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a=c');
153 + s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c');
154 + s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true }), 'a=c');
155 +
156 + s2t.end();
157 + });
158 +
159 + st.test('array with a single item', function (s2t) {
160 + s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[0]=c');
161 + s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[]=c');
162 + s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c');
163 + s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'comma', commaRoundTrip: true }), 'a[]=c'); // so it parses back as an array
164 + s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true }), 'a[0]=c');
165 +
166 + s2t.end();
167 + });
168 +
169 + st.test('array with multiple items', function (s2t) {
170 + s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[0]=c&a[1]=d');
171 + s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[]=c&a[]=d');
172 + s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c,d');
173 + s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true }), 'a[0]=c&a[1]=d');
174 +
175 + s2t.end();
176 + });
177 +
178 + st.end();
179 + });
180 +
181 + t.test('stringifies a nested array value', function (st) {
182 + st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[b][0]=c&a[b][1]=d');
183 + st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[b][]=c&a[b][]=d');
184 + st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a[b]=c,d');
185 + st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true }), 'a[b][0]=c&a[b][1]=d');
186 +>>>>>>> bef06db (Init Address.js)
98 st.end(); 187 st.end();
99 }); 188 });
100 189
...@@ -102,7 +191,11 @@ test('stringify()', function (t) { ...@@ -102,7 +191,11 @@ test('stringify()', function (t) {
102 st.equal( 191 st.equal(
103 qs.stringify( 192 qs.stringify(
104 { a: { b: ['c', 'd'] } }, 193 { a: { b: ['c', 'd'] } },
194 +<<<<<<< HEAD
105 { allowDots: true, encode: false, arrayFormat: 'indices' } 195 { allowDots: true, encode: false, arrayFormat: 'indices' }
196 +=======
197 + { allowDots: true, encodeValuesOnly: true, arrayFormat: 'indices' }
198 +>>>>>>> bef06db (Init Address.js)
106 ), 199 ),
107 'a.b[0]=c&a.b[1]=d', 200 'a.b[0]=c&a.b[1]=d',
108 'indices: stringifies with dots + indices' 201 'indices: stringifies with dots + indices'
...@@ -110,7 +203,11 @@ test('stringify()', function (t) { ...@@ -110,7 +203,11 @@ test('stringify()', function (t) {
110 st.equal( 203 st.equal(
111 qs.stringify( 204 qs.stringify(
112 { a: { b: ['c', 'd'] } }, 205 { a: { b: ['c', 'd'] } },
206 +<<<<<<< HEAD
113 { allowDots: true, encode: false, arrayFormat: 'brackets' } 207 { allowDots: true, encode: false, arrayFormat: 'brackets' }
208 +=======
209 + { allowDots: true, encodeValuesOnly: true, arrayFormat: 'brackets' }
210 +>>>>>>> bef06db (Init Address.js)
114 ), 211 ),
115 'a.b[]=c&a.b[]=d', 212 'a.b[]=c&a.b[]=d',
116 'brackets: stringifies with dots + brackets' 213 'brackets: stringifies with dots + brackets'
...@@ -118,7 +215,19 @@ test('stringify()', function (t) { ...@@ -118,7 +215,19 @@ test('stringify()', function (t) {
118 st.equal( 215 st.equal(
119 qs.stringify( 216 qs.stringify(
120 { a: { b: ['c', 'd'] } }, 217 { a: { b: ['c', 'd'] } },
218 +<<<<<<< HEAD
121 { allowDots: true, encode: false } 219 { allowDots: true, encode: false }
220 +=======
221 + { allowDots: true, encodeValuesOnly: true, arrayFormat: 'comma' }
222 + ),
223 + 'a.b=c,d',
224 + 'comma: stringifies with dots + comma'
225 + );
226 + st.equal(
227 + qs.stringify(
228 + { a: { b: ['c', 'd'] } },
229 + { allowDots: true, encodeValuesOnly: true }
230 +>>>>>>> bef06db (Init Address.js)
122 ), 231 ),
123 'a.b[0]=c&a.b[1]=d', 232 'a.b[0]=c&a.b[1]=d',
124 'default: stringifies with dots + indices' 233 'default: stringifies with dots + indices'
...@@ -129,12 +238,20 @@ test('stringify()', function (t) { ...@@ -129,12 +238,20 @@ test('stringify()', function (t) {
129 t.test('stringifies an object inside an array', function (st) { 238 t.test('stringifies an object inside an array', function (st) {
130 st.equal( 239 st.equal(
131 qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'indices' }), 240 qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'indices' }),
241 +<<<<<<< HEAD
132 'a%5B0%5D%5Bb%5D=c', 242 'a%5B0%5D%5Bb%5D=c',
243 +=======
244 + 'a%5B0%5D%5Bb%5D=c', // a[0][b]=c
245 +>>>>>>> bef06db (Init Address.js)
133 'indices => brackets' 246 'indices => brackets'
134 ); 247 );
135 st.equal( 248 st.equal(
136 qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'brackets' }), 249 qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'brackets' }),
250 +<<<<<<< HEAD
137 'a%5B%5D%5Bb%5D=c', 251 'a%5B%5D%5Bb%5D=c',
252 +=======
253 + 'a%5B%5D%5Bb%5D=c', // a[][b]=c
254 +>>>>>>> bef06db (Init Address.js)
138 'brackets => brackets' 255 'brackets => brackets'
139 ); 256 );
140 st.equal( 257 st.equal(
...@@ -166,17 +283,35 @@ test('stringify()', function (t) { ...@@ -166,17 +283,35 @@ test('stringify()', function (t) {
166 283
167 t.test('stringifies an array with mixed objects and primitives', function (st) { 284 t.test('stringifies an array with mixed objects and primitives', function (st) {
168 st.equal( 285 st.equal(
286 +<<<<<<< HEAD
169 qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encode: false, arrayFormat: 'indices' }), 287 qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encode: false, arrayFormat: 'indices' }),
288 +=======
289 + qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'indices' }),
290 +>>>>>>> bef06db (Init Address.js)
170 'a[0][b]=1&a[1]=2&a[2]=3', 291 'a[0][b]=1&a[1]=2&a[2]=3',
171 'indices => indices' 292 'indices => indices'
172 ); 293 );
173 st.equal( 294 st.equal(
295 +<<<<<<< HEAD
174 qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encode: false, arrayFormat: 'brackets' }), 296 qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encode: false, arrayFormat: 'brackets' }),
297 +=======
298 + qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }),
299 +>>>>>>> bef06db (Init Address.js)
175 'a[][b]=1&a[]=2&a[]=3', 300 'a[][b]=1&a[]=2&a[]=3',
176 'brackets => brackets' 301 'brackets => brackets'
177 ); 302 );
178 st.equal( 303 st.equal(
304 +<<<<<<< HEAD
179 qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encode: false }), 305 qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encode: false }),
306 +=======
307 + qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'comma' }),
308 + '???',
309 + 'brackets => brackets',
310 + { skip: 'TODO: figure out what this should do' }
311 + );
312 + st.equal(
313 + qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true }),
314 +>>>>>>> bef06db (Init Address.js)
180 'a[0][b]=1&a[1]=2&a[2]=3', 315 'a[0][b]=1&a[1]=2&a[2]=3',
181 'default => indices' 316 'default => indices'
182 ); 317 );
...@@ -287,6 +422,32 @@ test('stringify()', function (t) { ...@@ -287,6 +422,32 @@ test('stringify()', function (t) {
287 st.end(); 422 st.end();
288 }); 423 });
289 424
425 +<<<<<<< HEAD
426 +=======
427 + t.test('stringifies an empty array in different arrayFormat', function (st) {
428 + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false }), 'b[0]=&c=c');
429 + // arrayFormat default
430 + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'indices' }), 'b[0]=&c=c');
431 + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets' }), 'b[]=&c=c');
432 + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'repeat' }), 'b=&c=c');
433 + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma' }), 'b=&c=c');
434 + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', commaRoundTrip: true }), 'b[]=&c=c');
435 + // with strictNullHandling
436 + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'indices', strictNullHandling: true }), 'b[0]&c=c');
437 + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets', strictNullHandling: true }), 'b[]&c=c');
438 + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'repeat', strictNullHandling: true }), 'b&c=c');
439 + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', strictNullHandling: true }), 'b&c=c');
440 + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', strictNullHandling: true, commaRoundTrip: true }), 'b[]&c=c');
441 + // with skipNulls
442 + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'indices', skipNulls: true }), 'c=c');
443 + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets', skipNulls: true }), 'c=c');
444 + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'repeat', skipNulls: true }), 'c=c');
445 + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', skipNulls: true }), 'c=c');
446 +
447 + st.end();
448 + });
449 +
450 +>>>>>>> bef06db (Init Address.js)
290 t.test('stringifies a null object', { skip: !Object.create }, function (st) { 451 t.test('stringifies a null object', { skip: !Object.create }, function (st) {
291 var obj = Object.create(null); 452 var obj = Object.create(null);
292 obj.a = 'b'; 453 obj.a = 'b';
...@@ -363,7 +524,11 @@ test('stringify()', function (t) { ...@@ -363,7 +524,11 @@ test('stringify()', function (t) {
363 st.end(); 524 st.end();
364 }); 525 });
365 526
527 +<<<<<<< HEAD
366 t.test('doesn\'t blow up when Buffer global is missing', function (st) { 528 t.test('doesn\'t blow up when Buffer global is missing', function (st) {
529 +=======
530 + t.test('does not blow up when Buffer global is missing', function (st) {
531 +>>>>>>> bef06db (Init Address.js)
367 var tempBuffer = global.Buffer; 532 var tempBuffer = global.Buffer;
368 delete global.Buffer; 533 delete global.Buffer;
369 var result = qs.stringify({ a: 'b', c: 'd' }); 534 var result = qs.stringify({ a: 'b', c: 'd' });
...@@ -372,6 +537,60 @@ test('stringify()', function (t) { ...@@ -372,6 +537,60 @@ test('stringify()', function (t) {
372 st.end(); 537 st.end();
373 }); 538 });
374 539
540 +<<<<<<< HEAD
541 +=======
542 + t.test('does not crash when parsing circular references', function (st) {
543 + var a = {};
544 + a.b = a;
545 +
546 + st['throws'](
547 + function () { qs.stringify({ 'foo[bar]': 'baz', 'foo[baz]': a }); },
548 + /RangeError: Cyclic object value/,
549 + 'cyclic values throw'
550 + );
551 +
552 + var circular = {
553 + a: 'value'
554 + };
555 + circular.a = circular;
556 + st['throws'](
557 + function () { qs.stringify(circular); },
558 + /RangeError: Cyclic object value/,
559 + 'cyclic values throw'
560 + );
561 +
562 + var arr = ['a'];
563 + st.doesNotThrow(
564 + function () { qs.stringify({ x: arr, y: arr }); },
565 + 'non-cyclic values do not throw'
566 + );
567 +
568 + st.end();
569 + });
570 +
571 + t.test('non-circular duplicated references can still work', function (st) {
572 + var hourOfDay = {
573 + 'function': 'hour_of_day'
574 + };
575 +
576 + var p1 = {
577 + 'function': 'gte',
578 + arguments: [hourOfDay, 0]
579 + };
580 + var p2 = {
581 + 'function': 'lte',
582 + arguments: [hourOfDay, 23]
583 + };
584 +
585 + st.equal(
586 + qs.stringify({ filters: { $and: [p1, p2] } }, { encodeValuesOnly: true }),
587 + 'filters[$and][0][function]=gte&filters[$and][0][arguments][0][function]=hour_of_day&filters[$and][0][arguments][1]=0&filters[$and][1][function]=lte&filters[$and][1][arguments][0][function]=hour_of_day&filters[$and][1][arguments][1]=23'
588 + );
589 +
590 + st.end();
591 + });
592 +
593 +>>>>>>> bef06db (Init Address.js)
375 t.test('selects properties when filter=array', function (st) { 594 t.test('selects properties when filter=array', function (st) {
376 st.equal(qs.stringify({ a: 'b' }, { filter: ['a'] }), 'a=b'); 595 st.equal(qs.stringify({ a: 'b' }, { filter: ['a'] }), 'a=b');
377 st.equal(qs.stringify({ a: 1 }, { filter: [] }), ''); 596 st.equal(qs.stringify({ a: 1 }, { filter: [] }), '');
...@@ -546,6 +765,7 @@ test('stringify()', function (t) { ...@@ -546,6 +765,7 @@ test('stringify()', function (t) {
546 'custom serializeDate function called' 765 'custom serializeDate function called'
547 ); 766 );
548 767
768 +<<<<<<< HEAD
549 st.end(); 769 st.end();
550 }); 770 });
551 771
...@@ -553,6 +773,42 @@ test('stringify()', function (t) { ...@@ -553,6 +773,42 @@ test('stringify()', function (t) {
553 st.equal(qs.stringify({ a: 'b c' }, { format: qs.formats.RFC1738 }), 'a=b+c'); 773 st.equal(qs.stringify({ a: 'b c' }, { format: qs.formats.RFC1738 }), 'a=b+c');
554 st.equal(qs.stringify({ 'a b': 'c d' }, { format: qs.formats.RFC1738 }), 'a+b=c+d'); 774 st.equal(qs.stringify({ 'a b': 'c d' }, { format: qs.formats.RFC1738 }), 'a+b=c+d');
555 st.equal(qs.stringify({ 'a b': SaferBuffer.from('a b') }, { format: qs.formats.RFC1738 }), 'a+b=a+b'); 775 st.equal(qs.stringify({ 'a b': SaferBuffer.from('a b') }, { format: qs.formats.RFC1738 }), 'a+b=a+b');
776 +=======
777 + st.equal(
778 + qs.stringify(
779 + { a: [date] },
780 + {
781 + serializeDate: function (d) { return d.getTime(); },
782 + arrayFormat: 'comma'
783 + }
784 + ),
785 + 'a=' + date.getTime(),
786 + 'works with arrayFormat comma'
787 + );
788 + st.equal(
789 + qs.stringify(
790 + { a: [date] },
791 + {
792 + serializeDate: function (d) { return d.getTime(); },
793 + arrayFormat: 'comma',
794 + commaRoundTrip: true
795 + }
796 + ),
797 + 'a%5B%5D=' + date.getTime(),
798 + 'works with arrayFormat comma'
799 + );
800 +
801 + st.end();
802 + });
803 +
804 + t.test('RFC 1738 serialization', function (st) {
805 + st.equal(qs.stringify({ a: 'b c' }, { format: qs.formats.RFC1738 }), 'a=b+c');
806 + st.equal(qs.stringify({ 'a b': 'c d' }, { format: qs.formats.RFC1738 }), 'a+b=c+d');
807 + st.equal(qs.stringify({ 'a b': SaferBuffer.from('a b') }, { format: qs.formats.RFC1738 }), 'a+b=a+b');
808 +
809 + st.equal(qs.stringify({ 'foo(ref)': 'bar' }, { format: qs.formats.RFC1738 }), 'foo(ref)=bar');
810 +
811 +>>>>>>> bef06db (Init Address.js)
556 st.end(); 812 st.end();
557 }); 813 });
558 814
...@@ -560,16 +816,25 @@ test('stringify()', function (t) { ...@@ -560,16 +816,25 @@ test('stringify()', function (t) {
560 st.equal(qs.stringify({ a: 'b c' }, { format: qs.formats.RFC3986 }), 'a=b%20c'); 816 st.equal(qs.stringify({ a: 'b c' }, { format: qs.formats.RFC3986 }), 'a=b%20c');
561 st.equal(qs.stringify({ 'a b': 'c d' }, { format: qs.formats.RFC3986 }), 'a%20b=c%20d'); 817 st.equal(qs.stringify({ 'a b': 'c d' }, { format: qs.formats.RFC3986 }), 'a%20b=c%20d');
562 st.equal(qs.stringify({ 'a b': SaferBuffer.from('a b') }, { format: qs.formats.RFC3986 }), 'a%20b=a%20b'); 818 st.equal(qs.stringify({ 'a b': SaferBuffer.from('a b') }, { format: qs.formats.RFC3986 }), 'a%20b=a%20b');
819 +<<<<<<< HEAD
820 +=======
821 +
822 +>>>>>>> bef06db (Init Address.js)
563 st.end(); 823 st.end();
564 }); 824 });
565 825
566 t.test('Backward compatibility to RFC 3986', function (st) { 826 t.test('Backward compatibility to RFC 3986', function (st) {
567 st.equal(qs.stringify({ a: 'b c' }), 'a=b%20c'); 827 st.equal(qs.stringify({ a: 'b c' }), 'a=b%20c');
568 st.equal(qs.stringify({ 'a b': SaferBuffer.from('a b') }), 'a%20b=a%20b'); 828 st.equal(qs.stringify({ 'a b': SaferBuffer.from('a b') }), 'a%20b=a%20b');
829 +<<<<<<< HEAD
830 +=======
831 +
832 +>>>>>>> bef06db (Init Address.js)
569 st.end(); 833 st.end();
570 }); 834 });
571 835
572 t.test('Edge cases and unknown formats', function (st) { 836 t.test('Edge cases and unknown formats', function (st) {
837 +<<<<<<< HEAD
573 ['UFO1234', false, 1234, null, {}, []].forEach( 838 ['UFO1234', false, 1234, null, {}, []].forEach(
574 function (format) { 839 function (format) {
575 st['throws']( 840 st['throws'](
...@@ -580,6 +845,16 @@ test('stringify()', function (t) { ...@@ -580,6 +845,16 @@ test('stringify()', function (t) {
580 ); 845 );
581 } 846 }
582 ); 847 );
848 +=======
849 + ['UFO1234', false, 1234, null, {}, []].forEach(function (format) {
850 + st['throws'](
851 + function () {
852 + qs.stringify({ a: 'b c' }, { format: format });
853 + },
854 + new TypeError('Unknown format option provided.')
855 + );
856 + });
857 +>>>>>>> bef06db (Init Address.js)
583 st.end(); 858 st.end();
584 }); 859 });
585 860
...@@ -611,6 +886,41 @@ test('stringify()', function (t) { ...@@ -611,6 +886,41 @@ test('stringify()', function (t) {
611 st.end(); 886 st.end();
612 }); 887 });
613 888
889 +<<<<<<< HEAD
890 +=======
891 + t.test('throws if an invalid charset is specified', function (st) {
892 + st['throws'](function () {
893 + qs.stringify({ a: 'b' }, { charset: 'foobar' });
894 + }, new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'));
895 + st.end();
896 + });
897 +
898 + t.test('respects a charset of iso-8859-1', function (st) {
899 + st.equal(qs.stringify({ æ: 'æ' }, { charset: 'iso-8859-1' }), '%E6=%E6');
900 + st.end();
901 + });
902 +
903 + t.test('encodes unrepresentable chars as numeric entities in iso-8859-1 mode', function (st) {
904 + st.equal(qs.stringify({ a: '☺' }, { charset: 'iso-8859-1' }), 'a=%26%239786%3B');
905 + st.end();
906 + });
907 +
908 + t.test('respects an explicit charset of utf-8 (the default)', function (st) {
909 + st.equal(qs.stringify({ a: 'æ' }, { charset: 'utf-8' }), 'a=%C3%A6');
910 + st.end();
911 + });
912 +
913 + t.test('adds the right sentinel when instructed to and the charset is utf-8', function (st) {
914 + st.equal(qs.stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'utf-8' }), 'utf8=%E2%9C%93&a=%C3%A6');
915 + st.end();
916 + });
917 +
918 + t.test('adds the right sentinel when instructed to and the charset is iso-8859-1', function (st) {
919 + st.equal(qs.stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'iso-8859-1' }), 'utf8=%26%2310003%3B&a=%E6');
920 + st.end();
921 + });
922 +
923 +>>>>>>> bef06db (Init Address.js)
614 t.test('does not mutate the options argument', function (st) { 924 t.test('does not mutate the options argument', function (st) {
615 var options = {}; 925 var options = {};
616 qs.stringify({}, options); 926 qs.stringify({}, options);
...@@ -638,5 +948,55 @@ test('stringify()', function (t) { ...@@ -638,5 +948,55 @@ test('stringify()', function (t) {
638 st.end(); 948 st.end();
639 }); 949 });
640 950
951 +<<<<<<< HEAD
952 +=======
953 + t.test('allows for encoding keys and values differently', function (st) {
954 + var encoder = function (str, defaultEncoder, charset, type) {
955 + if (type === 'key') {
956 + return defaultEncoder(str, defaultEncoder, charset, type).toLowerCase();
957 + }
958 + if (type === 'value') {
959 + return defaultEncoder(str, defaultEncoder, charset, type).toUpperCase();
960 + }
961 + throw 'this should never happen! type: ' + type;
962 + };
963 +
964 + st.deepEqual(qs.stringify({ KeY: 'vAlUe' }, { encoder: encoder }), 'key=VALUE');
965 + st.end();
966 + });
967 +
968 + t.test('objects inside arrays', function (st) {
969 + var obj = { a: { b: { c: 'd', e: 'f' } } };
970 + var withArray = { a: { b: [{ c: 'd', e: 'f' }] } };
971 +
972 + st.equal(qs.stringify(obj, { encode: false }), 'a[b][c]=d&a[b][e]=f', 'no array, no arrayFormat');
973 + st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'bracket' }), 'a[b][c]=d&a[b][e]=f', 'no array, bracket');
974 + st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'indices' }), 'a[b][c]=d&a[b][e]=f', 'no array, indices');
975 + st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'comma' }), 'a[b][c]=d&a[b][e]=f', 'no array, comma');
976 +
977 + st.equal(qs.stringify(withArray, { encode: false }), 'a[b][0][c]=d&a[b][0][e]=f', 'array, no arrayFormat');
978 + st.equal(qs.stringify(withArray, { encode: false, arrayFormat: 'bracket' }), 'a[b][0][c]=d&a[b][0][e]=f', 'array, bracket');
979 + st.equal(qs.stringify(withArray, { encode: false, arrayFormat: 'indices' }), 'a[b][0][c]=d&a[b][0][e]=f', 'array, indices');
980 + st.equal(
981 + qs.stringify(withArray, { encode: false, arrayFormat: 'comma' }),
982 + '???',
983 + 'array, comma',
984 + { skip: 'TODO: figure out what this should do' }
985 + );
986 +
987 + st.end();
988 + });
989 +
990 + t.test('stringifies sparse arrays', function (st) {
991 + /* eslint no-sparse-arrays: 0 */
992 + st.equal(qs.stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true }), 'a[1]=2&a[4]=1');
993 + st.equal(qs.stringify({ a: [, { b: [, , { c: '1' }] }] }, { encodeValuesOnly: true }), 'a[1][b][2][c]=1');
994 + st.equal(qs.stringify({ a: [, [, , [, , , { c: '1' }]]] }, { encodeValuesOnly: true }), 'a[1][2][3][c]=1');
995 + st.equal(qs.stringify({ a: [, [, , [, , , { c: [, '1'] }]]] }, { encodeValuesOnly: true }), 'a[1][2][3][c][1]=1');
996 +
997 + st.end();
998 + });
999 +
1000 +>>>>>>> bef06db (Init Address.js)
641 t.end(); 1001 t.end();
642 }); 1002 });
......
1 'use strict'; 1 'use strict';
2 2
3 var test = require('tape'); 3 var test = require('tape');
4 +<<<<<<< HEAD
5 +=======
6 +var inspect = require('object-inspect');
7 +var SaferBuffer = require('safer-buffer').Buffer;
8 +var forEach = require('for-each');
9 +>>>>>>> bef06db (Init Address.js)
4 var utils = require('../lib/utils'); 10 var utils = require('../lib/utils');
5 11
6 test('merge()', function (t) { 12 test('merge()', function (t) {
...@@ -63,3 +69,74 @@ test('assign()', function (t) { ...@@ -63,3 +69,74 @@ test('assign()', function (t) {
63 69
64 t.end(); 70 t.end();
65 }); 71 });
72 +<<<<<<< HEAD
73 +=======
74 +
75 +test('combine()', function (t) {
76 + t.test('both arrays', function (st) {
77 + var a = [1];
78 + var b = [2];
79 + var combined = utils.combine(a, b);
80 +
81 + st.deepEqual(a, [1], 'a is not mutated');
82 + st.deepEqual(b, [2], 'b is not mutated');
83 + st.notEqual(a, combined, 'a !== combined');
84 + st.notEqual(b, combined, 'b !== combined');
85 + st.deepEqual(combined, [1, 2], 'combined is a + b');
86 +
87 + st.end();
88 + });
89 +
90 + t.test('one array, one non-array', function (st) {
91 + var aN = 1;
92 + var a = [aN];
93 + var bN = 2;
94 + var b = [bN];
95 +
96 + var combinedAnB = utils.combine(aN, b);
97 + st.deepEqual(b, [bN], 'b is not mutated');
98 + st.notEqual(aN, combinedAnB, 'aN + b !== aN');
99 + st.notEqual(a, combinedAnB, 'aN + b !== a');
100 + st.notEqual(bN, combinedAnB, 'aN + b !== bN');
101 + st.notEqual(b, combinedAnB, 'aN + b !== b');
102 + st.deepEqual([1, 2], combinedAnB, 'first argument is array-wrapped when not an array');
103 +
104 + var combinedABn = utils.combine(a, bN);
105 + st.deepEqual(a, [aN], 'a is not mutated');
106 + st.notEqual(aN, combinedABn, 'a + bN !== aN');
107 + st.notEqual(a, combinedABn, 'a + bN !== a');
108 + st.notEqual(bN, combinedABn, 'a + bN !== bN');
109 + st.notEqual(b, combinedABn, 'a + bN !== b');
110 + st.deepEqual([1, 2], combinedABn, 'second argument is array-wrapped when not an array');
111 +
112 + st.end();
113 + });
114 +
115 + t.test('neither is an array', function (st) {
116 + var combined = utils.combine(1, 2);
117 + st.notEqual(1, combined, '1 + 2 !== 1');
118 + st.notEqual(2, combined, '1 + 2 !== 2');
119 + st.deepEqual([1, 2], combined, 'both arguments are array-wrapped when not an array');
120 +
121 + st.end();
122 + });
123 +
124 + t.end();
125 +});
126 +
127 +test('isBuffer()', function (t) {
128 + forEach([null, undefined, true, false, '', 'abc', 42, 0, NaN, {}, [], function () {}, /a/g], function (x) {
129 + t.equal(utils.isBuffer(x), false, inspect(x) + ' is not a buffer');
130 + });
131 +
132 + var fakeBuffer = { constructor: Buffer };
133 + t.equal(utils.isBuffer(fakeBuffer), false, 'fake buffer is not a buffer');
134 +
135 + var saferBuffer = SaferBuffer.from('abc');
136 + t.equal(utils.isBuffer(saferBuffer), true, 'SaferBuffer instance is a buffer');
137 +
138 + var buffer = Buffer.from && Buffer.alloc ? Buffer.from('abc') : new Buffer('abc');
139 + t.equal(utils.isBuffer(buffer), true, 'real Buffer instance is a buffer');
140 + t.end();
141 +});
142 +>>>>>>> bef06db (Init Address.js)
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
6 "": { 6 "": {
7 "dependencies": { 7 "dependencies": {
8 <<<<<<< HEAD 8 <<<<<<< HEAD
9 +<<<<<<< HEAD
9 "request": "^2.88.2" 10 "request": "^2.88.2"
10 ======= 11 =======
11 "express": "^4.18.2", 12 "express": "^4.18.2",
...@@ -13,6 +14,9 @@ ...@@ -13,6 +14,9 @@
13 "node-fetch-npm": "^2.0.4", 14 "node-fetch-npm": "^2.0.4",
14 "request": "^2.88.2", 15 "request": "^2.88.2",
15 "xml-js": "^1.6.11" 16 "xml-js": "^1.6.11"
17 +=======
18 + "express": "^4.18.2"
19 +>>>>>>> bef06db (Init Address.js)
16 } 20 }
17 }, 21 },
18 "node_modules/accepts": { 22 "node_modules/accepts": {
...@@ -25,6 +29,7 @@ ...@@ -25,6 +29,7 @@
25 }, 29 },
26 "engines": { 30 "engines": {
27 "node": ">= 0.6" 31 "node": ">= 0.6"
32 +<<<<<<< HEAD
28 >>>>>>> main 33 >>>>>>> main
29 } 34 }
30 }, 35 },
...@@ -45,11 +50,16 @@ ...@@ -45,11 +50,16 @@
45 }, 50 },
46 <<<<<<< HEAD 51 <<<<<<< HEAD
47 ======= 52 =======
53 +=======
54 + }
55 + },
56 +>>>>>>> bef06db (Init Address.js)
48 "node_modules/array-flatten": { 57 "node_modules/array-flatten": {
49 "version": "1.1.1", 58 "version": "1.1.1",
50 "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", 59 "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
51 "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" 60 "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg=="
52 }, 61 },
62 +<<<<<<< HEAD
53 >>>>>>> main 63 >>>>>>> main
54 "node_modules/asn1": { 64 "node_modules/asn1": {
55 "version": "0.2.6", 65 "version": "0.2.6",
...@@ -95,6 +105,8 @@ ...@@ -95,6 +105,8 @@
95 }, 105 },
96 <<<<<<< HEAD 106 <<<<<<< HEAD
97 ======= 107 =======
108 +=======
109 +>>>>>>> bef06db (Init Address.js)
98 "node_modules/body-parser": { 110 "node_modules/body-parser": {
99 "version": "1.20.1", 111 "version": "1.20.1",
100 "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", 112 "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz",
...@@ -118,6 +130,7 @@ ...@@ -118,6 +130,7 @@
118 "npm": "1.2.8000 || >= 1.4.16" 130 "npm": "1.2.8000 || >= 1.4.16"
119 } 131 }
120 }, 132 },
133 +<<<<<<< HEAD
121 "node_modules/body-parser/node_modules/qs": { 134 "node_modules/body-parser/node_modules/qs": {
122 "version": "6.11.0", 135 "version": "6.11.0",
123 "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", 136 "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz",
...@@ -132,6 +145,8 @@ ...@@ -132,6 +145,8 @@
132 "url": "https://github.com/sponsors/ljharb" 145 "url": "https://github.com/sponsors/ljharb"
133 } 146 }
134 }, 147 },
148 +=======
149 +>>>>>>> bef06db (Init Address.js)
135 "node_modules/bytes": { 150 "node_modules/bytes": {
136 "version": "3.1.2", 151 "version": "3.1.2",
137 "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", 152 "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
...@@ -152,6 +167,7 @@ ...@@ -152,6 +167,7 @@
152 "url": "https://github.com/sponsors/ljharb" 167 "url": "https://github.com/sponsors/ljharb"
153 } 168 }
154 }, 169 },
170 +<<<<<<< HEAD
155 >>>>>>> main 171 >>>>>>> main
156 "node_modules/caseless": { 172 "node_modules/caseless": {
157 "version": "0.12.0", 173 "version": "0.12.0",
...@@ -171,6 +187,8 @@ ...@@ -171,6 +187,8 @@
171 }, 187 },
172 <<<<<<< HEAD 188 <<<<<<< HEAD
173 ======= 189 =======
190 +=======
191 +>>>>>>> bef06db (Init Address.js)
174 "node_modules/content-disposition": { 192 "node_modules/content-disposition": {
175 "version": "0.5.4", 193 "version": "0.5.4",
176 "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", 194 "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz",
...@@ -203,6 +221,7 @@ ...@@ -203,6 +221,7 @@
203 "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", 221 "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
204 "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" 222 "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ=="
205 }, 223 },
224 +<<<<<<< HEAD
206 >>>>>>> main 225 >>>>>>> main
207 "node_modules/core-util-is": { 226 "node_modules/core-util-is": {
208 "version": "1.0.2", 227 "version": "1.0.2",
...@@ -222,6 +241,8 @@ ...@@ -222,6 +241,8 @@
222 }, 241 },
223 <<<<<<< HEAD 242 <<<<<<< HEAD
224 ======= 243 =======
244 +=======
245 +>>>>>>> bef06db (Init Address.js)
225 "node_modules/debug": { 246 "node_modules/debug": {
226 "version": "2.6.9", 247 "version": "2.6.9",
227 "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", 248 "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
...@@ -230,6 +251,7 @@ ...@@ -230,6 +251,7 @@
230 "ms": "2.0.0" 251 "ms": "2.0.0"
231 } 252 }
232 }, 253 },
254 +<<<<<<< HEAD
233 >>>>>>> main 255 >>>>>>> main
234 "node_modules/delayed-stream": { 256 "node_modules/delayed-stream": {
235 "version": "1.0.0", 257 "version": "1.0.0",
...@@ -241,6 +263,8 @@ ...@@ -241,6 +263,8 @@
241 }, 263 },
242 <<<<<<< HEAD 264 <<<<<<< HEAD
243 ======= 265 =======
266 +=======
267 +>>>>>>> bef06db (Init Address.js)
244 "node_modules/depd": { 268 "node_modules/depd": {
245 "version": "2.0.0", 269 "version": "2.0.0",
246 "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", 270 "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
...@@ -258,6 +282,7 @@ ...@@ -258,6 +282,7 @@
258 "npm": "1.2.8000 || >= 1.4.16" 282 "npm": "1.2.8000 || >= 1.4.16"
259 } 283 }
260 }, 284 },
285 +<<<<<<< HEAD
261 >>>>>>> main 286 >>>>>>> main
262 "node_modules/ecc-jsbn": { 287 "node_modules/ecc-jsbn": {
263 "version": "0.1.2", 288 "version": "0.1.2",
...@@ -270,6 +295,8 @@ ...@@ -270,6 +295,8 @@
270 }, 295 },
271 <<<<<<< HEAD 296 <<<<<<< HEAD
272 ======= 297 =======
298 +=======
299 +>>>>>>> bef06db (Init Address.js)
273 "node_modules/ee-first": { 300 "node_modules/ee-first": {
274 "version": "1.1.1", 301 "version": "1.1.1",
275 "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", 302 "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
...@@ -283,6 +310,7 @@ ...@@ -283,6 +310,7 @@
283 "node": ">= 0.8" 310 "node": ">= 0.8"
284 } 311 }
285 }, 312 },
313 +<<<<<<< HEAD
286 "node_modules/encoding": { 314 "node_modules/encoding": {
287 "version": "0.1.13", 315 "version": "0.1.13",
288 "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", 316 "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz",
...@@ -302,6 +330,8 @@ ...@@ -302,6 +330,8 @@
302 "node": ">=0.10.0" 330 "node": ">=0.10.0"
303 } 331 }
304 }, 332 },
333 +=======
334 +>>>>>>> bef06db (Init Address.js)
305 "node_modules/escape-html": { 335 "node_modules/escape-html": {
306 "version": "1.0.3", 336 "version": "1.0.3",
307 "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", 337 "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
...@@ -356,6 +386,7 @@ ...@@ -356,6 +386,7 @@
356 "node": ">= 0.10.0" 386 "node": ">= 0.10.0"
357 } 387 }
358 }, 388 },
389 +<<<<<<< HEAD
359 "node_modules/express/node_modules/qs": { 390 "node_modules/express/node_modules/qs": {
360 "version": "6.11.0", 391 "version": "6.11.0",
361 "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", 392 "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz",
...@@ -396,6 +427,8 @@ ...@@ -396,6 +427,8 @@
396 }, 427 },
397 <<<<<<< HEAD 428 <<<<<<< HEAD
398 ======= 429 =======
430 +=======
431 +>>>>>>> bef06db (Init Address.js)
399 "node_modules/finalhandler": { 432 "node_modules/finalhandler": {
400 "version": "1.2.0", 433 "version": "1.2.0",
401 "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", 434 "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz",
...@@ -413,6 +446,7 @@ ...@@ -413,6 +446,7 @@
413 "node": ">= 0.8" 446 "node": ">= 0.8"
414 } 447 }
415 }, 448 },
449 +<<<<<<< HEAD
416 >>>>>>> main 450 >>>>>>> main
417 "node_modules/forever-agent": { 451 "node_modules/forever-agent": {
418 "version": "0.6.1", 452 "version": "0.6.1",
...@@ -437,6 +471,8 @@ ...@@ -437,6 +471,8 @@
437 }, 471 },
438 <<<<<<< HEAD 472 <<<<<<< HEAD
439 ======= 473 =======
474 +=======
475 +>>>>>>> bef06db (Init Address.js)
440 "node_modules/forwarded": { 476 "node_modules/forwarded": {
441 "version": "0.2.0", 477 "version": "0.2.0",
442 "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", 478 "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
...@@ -471,6 +507,7 @@ ...@@ -471,6 +507,7 @@
471 "url": "https://github.com/sponsors/ljharb" 507 "url": "https://github.com/sponsors/ljharb"
472 } 508 }
473 }, 509 },
510 +<<<<<<< HEAD
474 >>>>>>> main 511 >>>>>>> main
475 "node_modules/getpass": { 512 "node_modules/getpass": {
476 "version": "0.1.7", 513 "version": "0.1.7",
...@@ -503,6 +540,8 @@ ...@@ -503,6 +540,8 @@
503 }, 540 },
504 <<<<<<< HEAD 541 <<<<<<< HEAD
505 ======= 542 =======
543 +=======
544 +>>>>>>> bef06db (Init Address.js)
506 "node_modules/has": { 545 "node_modules/has": {
507 "version": "1.0.3", 546 "version": "1.0.3",
508 "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", 547 "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
...@@ -540,6 +579,7 @@ ...@@ -540,6 +579,7 @@
540 "node": ">= 0.8" 579 "node": ">= 0.8"
541 } 580 }
542 }, 581 },
582 +<<<<<<< HEAD
543 >>>>>>> main 583 >>>>>>> main
544 "node_modules/http-signature": { 584 "node_modules/http-signature": {
545 "version": "1.2.0", 585 "version": "1.2.0",
...@@ -557,6 +597,8 @@ ...@@ -557,6 +597,8 @@
557 }, 597 },
558 <<<<<<< HEAD 598 <<<<<<< HEAD
559 ======= 599 =======
600 +=======
601 +>>>>>>> bef06db (Init Address.js)
560 "node_modules/iconv-lite": { 602 "node_modules/iconv-lite": {
561 "version": "0.4.24", 603 "version": "0.4.24",
562 "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", 604 "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
...@@ -581,6 +623,7 @@ ...@@ -581,6 +623,7 @@
581 "node": ">= 0.10" 623 "node": ">= 0.10"
582 } 624 }
583 }, 625 },
626 +<<<<<<< HEAD
584 >>>>>>> main 627 >>>>>>> main
585 "node_modules/is-typedarray": { 628 "node_modules/is-typedarray": {
586 "version": "1.0.0", 629 "version": "1.0.0",
...@@ -636,6 +679,8 @@ ...@@ -636,6 +679,8 @@
636 }, 679 },
637 <<<<<<< HEAD 680 <<<<<<< HEAD
638 ======= 681 =======
682 +=======
683 +>>>>>>> bef06db (Init Address.js)
639 "node_modules/media-typer": { 684 "node_modules/media-typer": {
640 "version": "0.3.0", 685 "version": "0.3.0",
641 "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", 686 "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
...@@ -668,7 +713,10 @@ ...@@ -668,7 +713,10 @@
668 "node": ">=4" 713 "node": ">=4"
669 } 714 }
670 }, 715 },
716 +<<<<<<< HEAD
671 >>>>>>> main 717 >>>>>>> main
718 +=======
719 +>>>>>>> bef06db (Init Address.js)
672 "node_modules/mime-db": { 720 "node_modules/mime-db": {
673 "version": "1.52.0", 721 "version": "1.52.0",
674 "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", 722 "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
...@@ -689,7 +737,10 @@ ...@@ -689,7 +737,10 @@
689 } 737 }
690 }, 738 },
691 <<<<<<< HEAD 739 <<<<<<< HEAD
740 +<<<<<<< HEAD
741 +=======
692 ======= 742 =======
743 +>>>>>>> bef06db (Init Address.js)
693 "node_modules/ms": { 744 "node_modules/ms": {
694 "version": "2.0.0", 745 "version": "2.0.0",
695 "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 746 "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
...@@ -703,6 +754,7 @@ ...@@ -703,6 +754,7 @@
703 "node": ">= 0.6" 754 "node": ">= 0.6"
704 } 755 }
705 }, 756 },
757 +<<<<<<< HEAD
706 "node_modules/node-fetch": { 758 "node_modules/node-fetch": {
707 "version": "2.6.7", 759 "version": "2.6.7",
708 "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", 760 "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
...@@ -747,6 +799,8 @@ ...@@ -747,6 +799,8 @@
747 }, 799 },
748 <<<<<<< HEAD 800 <<<<<<< HEAD
749 ======= 801 =======
802 +=======
803 +>>>>>>> bef06db (Init Address.js)
750 "node_modules/object-inspect": { 804 "node_modules/object-inspect": {
751 "version": "1.12.2", 805 "version": "1.12.2",
752 "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", 806 "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz",
...@@ -779,6 +833,7 @@ ...@@ -779,6 +833,7 @@
779 "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", 833 "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
780 "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" 834 "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ=="
781 }, 835 },
836 +<<<<<<< HEAD
782 >>>>>>> main 837 >>>>>>> main
783 "node_modules/performance-now": { 838 "node_modules/performance-now": {
784 "version": "2.1.0", 839 "version": "2.1.0",
...@@ -787,6 +842,8 @@ ...@@ -787,6 +842,8 @@
787 }, 842 },
788 <<<<<<< HEAD 843 <<<<<<< HEAD
789 ======= 844 =======
845 +=======
846 +>>>>>>> bef06db (Init Address.js)
790 "node_modules/proxy-addr": { 847 "node_modules/proxy-addr": {
791 "version": "2.0.7", 848 "version": "2.0.7",
792 "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", 849 "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
...@@ -799,6 +856,7 @@ ...@@ -799,6 +856,7 @@
799 "node": ">= 0.10" 856 "node": ">= 0.10"
800 } 857 }
801 }, 858 },
859 +<<<<<<< HEAD
802 >>>>>>> main 860 >>>>>>> main
803 "node_modules/psl": { 861 "node_modules/psl": {
804 "version": "1.9.0", 862 "version": "1.9.0",
...@@ -823,6 +881,22 @@ ...@@ -823,6 +881,22 @@
823 }, 881 },
824 <<<<<<< HEAD 882 <<<<<<< HEAD
825 ======= 883 =======
884 +=======
885 + "node_modules/qs": {
886 + "version": "6.11.0",
887 + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz",
888 + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==",
889 + "dependencies": {
890 + "side-channel": "^1.0.4"
891 + },
892 + "engines": {
893 + "node": ">=0.6"
894 + },
895 + "funding": {
896 + "url": "https://github.com/sponsors/ljharb"
897 + }
898 + },
899 +>>>>>>> bef06db (Init Address.js)
826 "node_modules/range-parser": { 900 "node_modules/range-parser": {
827 "version": "1.2.1", 901 "version": "1.2.1",
828 "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", 902 "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
...@@ -845,6 +919,7 @@ ...@@ -845,6 +919,7 @@
845 "node": ">= 0.8" 919 "node": ">= 0.8"
846 } 920 }
847 }, 921 },
922 +<<<<<<< HEAD
848 >>>>>>> main 923 >>>>>>> main
849 "node_modules/request": { 924 "node_modules/request": {
850 "version": "2.88.2", 925 "version": "2.88.2",
...@@ -877,6 +952,8 @@ ...@@ -877,6 +952,8 @@
877 "node": ">= 6" 952 "node": ">= 6"
878 } 953 }
879 }, 954 },
955 +=======
956 +>>>>>>> bef06db (Init Address.js)
880 "node_modules/safe-buffer": { 957 "node_modules/safe-buffer": {
881 "version": "5.2.1", 958 "version": "5.2.1",
882 "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", 959 "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
...@@ -902,12 +979,15 @@ ...@@ -902,12 +979,15 @@
902 "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" 979 "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
903 }, 980 },
904 <<<<<<< HEAD 981 <<<<<<< HEAD
982 +<<<<<<< HEAD
905 ======= 983 =======
906 "node_modules/sax": { 984 "node_modules/sax": {
907 "version": "1.2.4", 985 "version": "1.2.4",
908 "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", 986 "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
909 "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" 987 "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
910 }, 988 },
989 +=======
990 +>>>>>>> bef06db (Init Address.js)
911 "node_modules/send": { 991 "node_modules/send": {
912 "version": "0.18.0", 992 "version": "0.18.0",
913 "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", 993 "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz",
...@@ -968,6 +1048,7 @@ ...@@ -968,6 +1048,7 @@
968 "url": "https://github.com/sponsors/ljharb" 1048 "url": "https://github.com/sponsors/ljharb"
969 } 1049 }
970 }, 1050 },
1051 +<<<<<<< HEAD
971 >>>>>>> main 1052 >>>>>>> main
972 "node_modules/sshpk": { 1053 "node_modules/sshpk": {
973 "version": "1.17.0", 1054 "version": "1.17.0",
...@@ -995,6 +1076,8 @@ ...@@ -995,6 +1076,8 @@
995 }, 1076 },
996 <<<<<<< HEAD 1077 <<<<<<< HEAD
997 ======= 1078 =======
1079 +=======
1080 +>>>>>>> bef06db (Init Address.js)
998 "node_modules/statuses": { 1081 "node_modules/statuses": {
999 "version": "2.0.1", 1082 "version": "2.0.1",
1000 "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", 1083 "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz",
...@@ -1011,6 +1094,7 @@ ...@@ -1011,6 +1094,7 @@
1011 "node": ">=0.6" 1094 "node": ">=0.6"
1012 } 1095 }
1013 }, 1096 },
1097 +<<<<<<< HEAD
1014 >>>>>>> main 1098 >>>>>>> main
1015 "node_modules/tough-cookie": { 1099 "node_modules/tough-cookie": {
1016 "version": "2.5.0", 1100 "version": "2.5.0",
...@@ -1050,6 +1134,8 @@ ...@@ -1050,6 +1134,8 @@
1050 }, 1134 },
1051 <<<<<<< HEAD 1135 <<<<<<< HEAD
1052 ======= 1136 =======
1137 +=======
1138 +>>>>>>> bef06db (Init Address.js)
1053 "node_modules/type-is": { 1139 "node_modules/type-is": {
1054 "version": "1.6.18", 1140 "version": "1.6.18",
1055 "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", 1141 "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
...@@ -1070,6 +1156,7 @@ ...@@ -1070,6 +1156,7 @@
1070 "node": ">= 0.8" 1156 "node": ">= 0.8"
1071 } 1157 }
1072 }, 1158 },
1159 +<<<<<<< HEAD
1073 >>>>>>> main 1160 >>>>>>> main
1074 "node_modules/uri-js": { 1161 "node_modules/uri-js": {
1075 "version": "4.4.1", 1162 "version": "4.4.1",
...@@ -1081,6 +1168,8 @@ ...@@ -1081,6 +1168,8 @@
1081 }, 1168 },
1082 <<<<<<< HEAD 1169 <<<<<<< HEAD
1083 ======= 1170 =======
1171 +=======
1172 +>>>>>>> bef06db (Init Address.js)
1084 "node_modules/utils-merge": { 1173 "node_modules/utils-merge": {
1085 "version": "1.0.1", 1174 "version": "1.0.1",
1086 "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", 1175 "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
...@@ -1089,6 +1178,7 @@ ...@@ -1089,6 +1178,7 @@
1089 "node": ">= 0.4.0" 1178 "node": ">= 0.4.0"
1090 } 1179 }
1091 }, 1180 },
1181 +<<<<<<< HEAD
1092 >>>>>>> main 1182 >>>>>>> main
1093 "node_modules/uuid": { 1183 "node_modules/uuid": {
1094 "version": "3.4.0", 1184 "version": "3.4.0",
...@@ -1101,6 +1191,8 @@ ...@@ -1101,6 +1191,8 @@
1101 }, 1191 },
1102 <<<<<<< HEAD 1192 <<<<<<< HEAD
1103 ======= 1193 =======
1194 +=======
1195 +>>>>>>> bef06db (Init Address.js)
1104 "node_modules/vary": { 1196 "node_modules/vary": {
1105 "version": "1.1.2", 1197 "version": "1.1.2",
1106 "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", 1198 "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
...@@ -1108,6 +1200,7 @@ ...@@ -1108,6 +1200,7 @@
1108 "engines": { 1200 "engines": {
1109 "node": ">= 0.8" 1201 "node": ">= 0.8"
1110 } 1202 }
1203 +<<<<<<< HEAD
1111 }, 1204 },
1112 >>>>>>> main 1205 >>>>>>> main
1113 "node_modules/verror": { 1206 "node_modules/verror": {
...@@ -1152,6 +1245,8 @@ ...@@ -1152,6 +1245,8 @@
1152 "bin": { 1245 "bin": {
1153 "xml-js": "bin/cli.js" 1246 "xml-js": "bin/cli.js"
1154 } 1247 }
1248 +=======
1249 +>>>>>>> bef06db (Init Address.js)
1155 } 1250 }
1156 }, 1251 },
1157 "dependencies": { 1252 "dependencies": {
...@@ -1164,6 +1259,7 @@ ...@@ -1164,6 +1259,7 @@
1164 "negotiator": "0.6.3" 1259 "negotiator": "0.6.3"
1165 } 1260 }
1166 }, 1261 },
1262 +<<<<<<< HEAD
1167 >>>>>>> main 1263 >>>>>>> main
1168 "ajv": { 1264 "ajv": {
1169 "version": "6.12.6", 1265 "version": "6.12.6",
...@@ -1178,11 +1274,14 @@ ...@@ -1178,11 +1274,14 @@
1178 }, 1274 },
1179 <<<<<<< HEAD 1275 <<<<<<< HEAD
1180 ======= 1276 =======
1277 +=======
1278 +>>>>>>> bef06db (Init Address.js)
1181 "array-flatten": { 1279 "array-flatten": {
1182 "version": "1.1.1", 1280 "version": "1.1.1",
1183 "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", 1281 "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
1184 "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" 1282 "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg=="
1185 }, 1283 },
1284 +<<<<<<< HEAD
1186 >>>>>>> main 1285 >>>>>>> main
1187 "asn1": { 1286 "asn1": {
1188 "version": "0.2.6", 1287 "version": "0.2.6",
...@@ -1222,6 +1321,8 @@ ...@@ -1222,6 +1321,8 @@
1222 }, 1321 },
1223 <<<<<<< HEAD 1322 <<<<<<< HEAD
1224 ======= 1323 =======
1324 +=======
1325 +>>>>>>> bef06db (Init Address.js)
1225 "body-parser": { 1326 "body-parser": {
1226 "version": "1.20.1", 1327 "version": "1.20.1",
1227 "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", 1328 "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz",
...@@ -1239,6 +1340,7 @@ ...@@ -1239,6 +1340,7 @@
1239 "raw-body": "2.5.1", 1340 "raw-body": "2.5.1",
1240 "type-is": "~1.6.18", 1341 "type-is": "~1.6.18",
1241 "unpipe": "1.0.0" 1342 "unpipe": "1.0.0"
1343 +<<<<<<< HEAD
1242 }, 1344 },
1243 "dependencies": { 1345 "dependencies": {
1244 "qs": { 1346 "qs": {
...@@ -1249,6 +1351,8 @@ ...@@ -1249,6 +1351,8 @@
1249 "side-channel": "^1.0.4" 1351 "side-channel": "^1.0.4"
1250 } 1352 }
1251 } 1353 }
1354 +=======
1355 +>>>>>>> bef06db (Init Address.js)
1252 } 1356 }
1253 }, 1357 },
1254 "bytes": { 1358 "bytes": {
...@@ -1265,6 +1369,7 @@ ...@@ -1265,6 +1369,7 @@
1265 "get-intrinsic": "^1.0.2" 1369 "get-intrinsic": "^1.0.2"
1266 } 1370 }
1267 }, 1371 },
1372 +<<<<<<< HEAD
1268 >>>>>>> main 1373 >>>>>>> main
1269 "caseless": { 1374 "caseless": {
1270 "version": "0.12.0", 1375 "version": "0.12.0",
...@@ -1281,6 +1386,8 @@ ...@@ -1281,6 +1386,8 @@
1281 }, 1386 },
1282 <<<<<<< HEAD 1387 <<<<<<< HEAD
1283 ======= 1388 =======
1389 +=======
1390 +>>>>>>> bef06db (Init Address.js)
1284 "content-disposition": { 1391 "content-disposition": {
1285 "version": "0.5.4", 1392 "version": "0.5.4",
1286 "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", 1393 "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz",
...@@ -1304,6 +1411,7 @@ ...@@ -1304,6 +1411,7 @@
1304 "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", 1411 "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
1305 "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" 1412 "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ=="
1306 }, 1413 },
1414 +<<<<<<< HEAD
1307 >>>>>>> main 1415 >>>>>>> main
1308 "core-util-is": { 1416 "core-util-is": {
1309 "version": "1.0.2", 1417 "version": "1.0.2",
...@@ -1320,6 +1428,8 @@ ...@@ -1320,6 +1428,8 @@
1320 }, 1428 },
1321 <<<<<<< HEAD 1429 <<<<<<< HEAD
1322 ======= 1430 =======
1431 +=======
1432 +>>>>>>> bef06db (Init Address.js)
1323 "debug": { 1433 "debug": {
1324 "version": "2.6.9", 1434 "version": "2.6.9",
1325 "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", 1435 "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
...@@ -1328,6 +1438,7 @@ ...@@ -1328,6 +1438,7 @@
1328 "ms": "2.0.0" 1438 "ms": "2.0.0"
1329 } 1439 }
1330 }, 1440 },
1441 +<<<<<<< HEAD
1331 >>>>>>> main 1442 >>>>>>> main
1332 "delayed-stream": { 1443 "delayed-stream": {
1333 "version": "1.0.0", 1444 "version": "1.0.0",
...@@ -1336,6 +1447,8 @@ ...@@ -1336,6 +1447,8 @@
1336 }, 1447 },
1337 <<<<<<< HEAD 1448 <<<<<<< HEAD
1338 ======= 1449 =======
1450 +=======
1451 +>>>>>>> bef06db (Init Address.js)
1339 "depd": { 1452 "depd": {
1340 "version": "2.0.0", 1453 "version": "2.0.0",
1341 "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", 1454 "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
...@@ -1346,6 +1459,7 @@ ...@@ -1346,6 +1459,7 @@
1346 "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", 1459 "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz",
1347 "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==" 1460 "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg=="
1348 }, 1461 },
1462 +<<<<<<< HEAD
1349 >>>>>>> main 1463 >>>>>>> main
1350 "ecc-jsbn": { 1464 "ecc-jsbn": {
1351 "version": "0.1.2", 1465 "version": "0.1.2",
...@@ -1358,6 +1472,8 @@ ...@@ -1358,6 +1472,8 @@
1358 }, 1472 },
1359 <<<<<<< HEAD 1473 <<<<<<< HEAD
1360 ======= 1474 =======
1475 +=======
1476 +>>>>>>> bef06db (Init Address.js)
1361 "ee-first": { 1477 "ee-first": {
1362 "version": "1.1.1", 1478 "version": "1.1.1",
1363 "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", 1479 "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
...@@ -1368,6 +1484,7 @@ ...@@ -1368,6 +1484,7 @@
1368 "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", 1484 "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
1369 "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==" 1485 "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w=="
1370 }, 1486 },
1487 +<<<<<<< HEAD
1371 "encoding": { 1488 "encoding": {
1372 "version": "0.1.13", 1489 "version": "0.1.13",
1373 "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", 1490 "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz",
...@@ -1386,6 +1503,8 @@ ...@@ -1386,6 +1503,8 @@
1386 } 1503 }
1387 } 1504 }
1388 }, 1505 },
1506 +=======
1507 +>>>>>>> bef06db (Init Address.js)
1389 "escape-html": { 1508 "escape-html": {
1390 "version": "1.0.3", 1509 "version": "1.0.3",
1391 "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", 1510 "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
...@@ -1432,6 +1551,7 @@ ...@@ -1432,6 +1551,7 @@
1432 "type-is": "~1.6.18", 1551 "type-is": "~1.6.18",
1433 "utils-merge": "1.0.1", 1552 "utils-merge": "1.0.1",
1434 "vary": "~1.1.2" 1553 "vary": "~1.1.2"
1554 +<<<<<<< HEAD
1435 }, 1555 },
1436 "dependencies": { 1556 "dependencies": {
1437 "qs": { 1557 "qs": {
...@@ -1467,6 +1587,10 @@ ...@@ -1467,6 +1587,10 @@
1467 }, 1587 },
1468 <<<<<<< HEAD 1588 <<<<<<< HEAD
1469 ======= 1589 =======
1590 +=======
1591 + }
1592 + },
1593 +>>>>>>> bef06db (Init Address.js)
1470 "finalhandler": { 1594 "finalhandler": {
1471 "version": "1.2.0", 1595 "version": "1.2.0",
1472 "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", 1596 "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz",
...@@ -1481,6 +1605,7 @@ ...@@ -1481,6 +1605,7 @@
1481 "unpipe": "~1.0.0" 1605 "unpipe": "~1.0.0"
1482 } 1606 }
1483 }, 1607 },
1608 +<<<<<<< HEAD
1484 >>>>>>> main 1609 >>>>>>> main
1485 "forever-agent": { 1610 "forever-agent": {
1486 "version": "0.6.1", 1611 "version": "0.6.1",
...@@ -1499,6 +1624,8 @@ ...@@ -1499,6 +1624,8 @@
1499 }, 1624 },
1500 <<<<<<< HEAD 1625 <<<<<<< HEAD
1501 ======= 1626 =======
1627 +=======
1628 +>>>>>>> bef06db (Init Address.js)
1502 "forwarded": { 1629 "forwarded": {
1503 "version": "0.2.0", 1630 "version": "0.2.0",
1504 "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", 1631 "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
...@@ -1524,6 +1651,7 @@ ...@@ -1524,6 +1651,7 @@
1524 "has-symbols": "^1.0.3" 1651 "has-symbols": "^1.0.3"
1525 } 1652 }
1526 }, 1653 },
1654 +<<<<<<< HEAD
1527 >>>>>>> main 1655 >>>>>>> main
1528 "getpass": { 1656 "getpass": {
1529 "version": "0.1.7", 1657 "version": "0.1.7",
...@@ -1549,6 +1677,8 @@ ...@@ -1549,6 +1677,8 @@
1549 }, 1677 },
1550 <<<<<<< HEAD 1678 <<<<<<< HEAD
1551 ======= 1679 =======
1680 +=======
1681 +>>>>>>> bef06db (Init Address.js)
1552 "has": { 1682 "has": {
1553 "version": "1.0.3", 1683 "version": "1.0.3",
1554 "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", 1684 "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
...@@ -1574,6 +1704,7 @@ ...@@ -1574,6 +1704,7 @@
1574 "toidentifier": "1.0.1" 1704 "toidentifier": "1.0.1"
1575 } 1705 }
1576 }, 1706 },
1707 +<<<<<<< HEAD
1577 >>>>>>> main 1708 >>>>>>> main
1578 "http-signature": { 1709 "http-signature": {
1579 "version": "1.2.0", 1710 "version": "1.2.0",
...@@ -1587,6 +1718,8 @@ ...@@ -1587,6 +1718,8 @@
1587 }, 1718 },
1588 <<<<<<< HEAD 1719 <<<<<<< HEAD
1589 ======= 1720 =======
1721 +=======
1722 +>>>>>>> bef06db (Init Address.js)
1590 "iconv-lite": { 1723 "iconv-lite": {
1591 "version": "0.4.24", 1724 "version": "0.4.24",
1592 "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", 1725 "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
...@@ -1605,6 +1738,7 @@ ...@@ -1605,6 +1738,7 @@
1605 "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", 1738 "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
1606 "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" 1739 "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g=="
1607 }, 1740 },
1741 +<<<<<<< HEAD
1608 >>>>>>> main 1742 >>>>>>> main
1609 "is-typedarray": { 1743 "is-typedarray": {
1610 "version": "1.0.0", 1744 "version": "1.0.0",
...@@ -1657,6 +1791,8 @@ ...@@ -1657,6 +1791,8 @@
1657 }, 1791 },
1658 <<<<<<< HEAD 1792 <<<<<<< HEAD
1659 ======= 1793 =======
1794 +=======
1795 +>>>>>>> bef06db (Init Address.js)
1660 "media-typer": { 1796 "media-typer": {
1661 "version": "0.3.0", 1797 "version": "0.3.0",
1662 "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", 1798 "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
...@@ -1677,7 +1813,10 @@ ...@@ -1677,7 +1813,10 @@
1677 "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", 1813 "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
1678 "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" 1814 "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg=="
1679 }, 1815 },
1816 +<<<<<<< HEAD
1680 >>>>>>> main 1817 >>>>>>> main
1818 +=======
1819 +>>>>>>> bef06db (Init Address.js)
1681 "mime-db": { 1820 "mime-db": {
1682 "version": "1.52.0", 1821 "version": "1.52.0",
1683 "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", 1822 "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
...@@ -1692,7 +1831,10 @@ ...@@ -1692,7 +1831,10 @@
1692 } 1831 }
1693 }, 1832 },
1694 <<<<<<< HEAD 1833 <<<<<<< HEAD
1834 +<<<<<<< HEAD
1835 +=======
1695 ======= 1836 =======
1837 +>>>>>>> bef06db (Init Address.js)
1696 "ms": { 1838 "ms": {
1697 "version": "2.0.0", 1839 "version": "2.0.0",
1698 "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 1840 "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
...@@ -1703,6 +1845,7 @@ ...@@ -1703,6 +1845,7 @@
1703 "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", 1845 "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz",
1704 "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" 1846 "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg=="
1705 }, 1847 },
1848 +<<<<<<< HEAD
1706 "node-fetch": { 1849 "node-fetch": {
1707 "version": "2.6.7", 1850 "version": "2.6.7",
1708 "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", 1851 "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
...@@ -1729,6 +1872,8 @@ ...@@ -1729,6 +1872,8 @@
1729 }, 1872 },
1730 <<<<<<< HEAD 1873 <<<<<<< HEAD
1731 ======= 1874 =======
1875 +=======
1876 +>>>>>>> bef06db (Init Address.js)
1732 "object-inspect": { 1877 "object-inspect": {
1733 "version": "1.12.2", 1878 "version": "1.12.2",
1734 "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", 1879 "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz",
...@@ -1752,6 +1897,7 @@ ...@@ -1752,6 +1897,7 @@
1752 "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", 1897 "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
1753 "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" 1898 "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ=="
1754 }, 1899 },
1900 +<<<<<<< HEAD
1755 >>>>>>> main 1901 >>>>>>> main
1756 "performance-now": { 1902 "performance-now": {
1757 "version": "2.1.0", 1903 "version": "2.1.0",
...@@ -1760,6 +1906,8 @@ ...@@ -1760,6 +1906,8 @@
1760 }, 1906 },
1761 <<<<<<< HEAD 1907 <<<<<<< HEAD
1762 ======= 1908 =======
1909 +=======
1910 +>>>>>>> bef06db (Init Address.js)
1763 "proxy-addr": { 1911 "proxy-addr": {
1764 "version": "2.0.7", 1912 "version": "2.0.7",
1765 "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", 1913 "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
...@@ -1769,6 +1917,7 @@ ...@@ -1769,6 +1917,7 @@
1769 "ipaddr.js": "1.9.1" 1917 "ipaddr.js": "1.9.1"
1770 } 1918 }
1771 }, 1919 },
1920 +<<<<<<< HEAD
1772 >>>>>>> main 1921 >>>>>>> main
1773 "psl": { 1922 "psl": {
1774 "version": "1.9.0", 1923 "version": "1.9.0",
...@@ -1787,6 +1936,16 @@ ...@@ -1787,6 +1936,16 @@
1787 }, 1936 },
1788 <<<<<<< HEAD 1937 <<<<<<< HEAD
1789 ======= 1938 =======
1939 +=======
1940 + "qs": {
1941 + "version": "6.11.0",
1942 + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz",
1943 + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==",
1944 + "requires": {
1945 + "side-channel": "^1.0.4"
1946 + }
1947 + },
1948 +>>>>>>> bef06db (Init Address.js)
1790 "range-parser": { 1949 "range-parser": {
1791 "version": "1.2.1", 1950 "version": "1.2.1",
1792 "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", 1951 "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
...@@ -1803,6 +1962,7 @@ ...@@ -1803,6 +1962,7 @@
1803 "unpipe": "1.0.0" 1962 "unpipe": "1.0.0"
1804 } 1963 }
1805 }, 1964 },
1965 +<<<<<<< HEAD
1806 >>>>>>> main 1966 >>>>>>> main
1807 "request": { 1967 "request": {
1808 "version": "2.88.2", 1968 "version": "2.88.2",
...@@ -1831,6 +1991,8 @@ ...@@ -1831,6 +1991,8 @@
1831 "uuid": "^3.3.2" 1991 "uuid": "^3.3.2"
1832 } 1992 }
1833 }, 1993 },
1994 +=======
1995 +>>>>>>> bef06db (Init Address.js)
1834 "safe-buffer": { 1996 "safe-buffer": {
1835 "version": "5.2.1", 1997 "version": "5.2.1",
1836 "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", 1998 "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
...@@ -1842,12 +2004,15 @@ ...@@ -1842,12 +2004,15 @@
1842 "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" 2004 "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
1843 }, 2005 },
1844 <<<<<<< HEAD 2006 <<<<<<< HEAD
2007 +<<<<<<< HEAD
1845 ======= 2008 =======
1846 "sax": { 2009 "sax": {
1847 "version": "1.2.4", 2010 "version": "1.2.4",
1848 "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", 2011 "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
1849 "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" 2012 "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
1850 }, 2013 },
2014 +=======
2015 +>>>>>>> bef06db (Init Address.js)
1851 "send": { 2016 "send": {
1852 "version": "0.18.0", 2017 "version": "0.18.0",
1853 "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", 2018 "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz",
...@@ -1901,6 +2066,7 @@ ...@@ -1901,6 +2066,7 @@
1901 "object-inspect": "^1.9.0" 2066 "object-inspect": "^1.9.0"
1902 } 2067 }
1903 }, 2068 },
2069 +<<<<<<< HEAD
1904 >>>>>>> main 2070 >>>>>>> main
1905 "sshpk": { 2071 "sshpk": {
1906 "version": "1.17.0", 2072 "version": "1.17.0",
...@@ -1920,6 +2086,8 @@ ...@@ -1920,6 +2086,8 @@
1920 }, 2086 },
1921 <<<<<<< HEAD 2087 <<<<<<< HEAD
1922 ======= 2088 =======
2089 +=======
2090 +>>>>>>> bef06db (Init Address.js)
1923 "statuses": { 2091 "statuses": {
1924 "version": "2.0.1", 2092 "version": "2.0.1",
1925 "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", 2093 "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz",
...@@ -1930,6 +2098,7 @@ ...@@ -1930,6 +2098,7 @@
1930 "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", 2098 "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
1931 "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==" 2099 "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA=="
1932 }, 2100 },
2101 +<<<<<<< HEAD
1933 >>>>>>> main 2102 >>>>>>> main
1934 "tough-cookie": { 2103 "tough-cookie": {
1935 "version": "2.5.0", 2104 "version": "2.5.0",
...@@ -1963,6 +2132,8 @@ ...@@ -1963,6 +2132,8 @@
1963 }, 2132 },
1964 <<<<<<< HEAD 2133 <<<<<<< HEAD
1965 ======= 2134 =======
2135 +=======
2136 +>>>>>>> bef06db (Init Address.js)
1966 "type-is": { 2137 "type-is": {
1967 "version": "1.6.18", 2138 "version": "1.6.18",
1968 "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", 2139 "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
...@@ -1977,6 +2148,7 @@ ...@@ -1977,6 +2148,7 @@
1977 "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", 2148 "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
1978 "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==" 2149 "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ=="
1979 }, 2150 },
2151 +<<<<<<< HEAD
1980 >>>>>>> main 2152 >>>>>>> main
1981 "uri-js": { 2153 "uri-js": {
1982 "version": "4.4.1", 2154 "version": "4.4.1",
...@@ -1988,11 +2160,14 @@ ...@@ -1988,11 +2160,14 @@
1988 }, 2160 },
1989 <<<<<<< HEAD 2161 <<<<<<< HEAD
1990 ======= 2162 =======
2163 +=======
2164 +>>>>>>> bef06db (Init Address.js)
1991 "utils-merge": { 2165 "utils-merge": {
1992 "version": "1.0.1", 2166 "version": "1.0.1",
1993 "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", 2167 "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
1994 "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==" 2168 "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA=="
1995 }, 2169 },
2170 +<<<<<<< HEAD
1996 >>>>>>> main 2171 >>>>>>> main
1997 "uuid": { 2172 "uuid": {
1998 "version": "3.4.0", 2173 "version": "3.4.0",
...@@ -2001,10 +2176,13 @@ ...@@ -2001,10 +2176,13 @@
2001 }, 2176 },
2002 <<<<<<< HEAD 2177 <<<<<<< HEAD
2003 ======= 2178 =======
2179 +=======
2180 +>>>>>>> bef06db (Init Address.js)
2004 "vary": { 2181 "vary": {
2005 "version": "1.1.2", 2182 "version": "1.1.2",
2006 "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", 2183 "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
2007 "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==" 2184 "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg=="
2185 +<<<<<<< HEAD
2008 }, 2186 },
2009 >>>>>>> main 2187 >>>>>>> main
2010 "verror": { 2188 "verror": {
...@@ -2041,6 +2219,8 @@ ...@@ -2041,6 +2219,8 @@
2041 "sax": "^1.2.4" 2219 "sax": "^1.2.4"
2042 } 2220 }
2043 >>>>>>> main 2221 >>>>>>> main
2222 +=======
2223 +>>>>>>> bef06db (Init Address.js)
2044 } 2224 }
2045 } 2225 }
2046 } 2226 }
......
1 { 1 {
2 "dependencies": { 2 "dependencies": {
3 <<<<<<< HEAD 3 <<<<<<< HEAD
4 +<<<<<<< HEAD
4 "request": "^2.88.2" 5 "request": "^2.88.2"
5 ======= 6 =======
6 "express": "^4.18.2", 7 "express": "^4.18.2",
...@@ -9,5 +10,8 @@ ...@@ -9,5 +10,8 @@
9 "request": "^2.88.2", 10 "request": "^2.88.2",
10 "xml-js": "^1.6.11" 11 "xml-js": "^1.6.11"
11 >>>>>>> main 12 >>>>>>> main
13 +=======
14 + "express": "^4.18.2"
15 +>>>>>>> bef06db (Init Address.js)
12 } 16 }
13 } 17 }
......