From d1c41f4c0142468cef340d4bdae4104c842ef75d Mon Sep 17 00:00:00 2001 From: NunoSempere Date: Fri, 15 Oct 2021 11:40:05 +0200 Subject: [PATCH] feat: Added predictions from Peter Wildeford MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Wildeford, nÊe Hurford - Also removed node_modules from tracking --- .gitignore | 3 +- node_modules/.bin/is-docker | 1 - node_modules/.bin/json2csv | 1 - node_modules/.package-lock.json | 936 --- node_modules/axios/CHANGELOG.md | 685 -- node_modules/axios/LICENSE | 19 - node_modules/axios/README.md | 800 -- node_modules/axios/UPGRADE_GUIDE.md | 162 - node_modules/axios/dist/axios.js | 1756 ---- node_modules/axios/dist/axios.map | 1 - node_modules/axios/dist/axios.min.js | 3 - node_modules/axios/dist/axios.min.map | 1 - node_modules/axios/index.d.ts | 161 - node_modules/axios/index.js | 1 - node_modules/axios/lib/adapters/README.md | 37 - node_modules/axios/lib/adapters/http.js | 303 - node_modules/axios/lib/adapters/xhr.js | 179 - node_modules/axios/lib/axios.js | 56 - node_modules/axios/lib/cancel/Cancel.js | 19 - node_modules/axios/lib/cancel/CancelToken.js | 57 - node_modules/axios/lib/cancel/isCancel.js | 5 - node_modules/axios/lib/core/Axios.js | 95 - .../axios/lib/core/InterceptorManager.js | 52 - node_modules/axios/lib/core/README.md | 7 - node_modules/axios/lib/core/buildFullPath.js | 20 - node_modules/axios/lib/core/createError.js | 18 - .../axios/lib/core/dispatchRequest.js | 79 - node_modules/axios/lib/core/enhanceError.js | 42 - node_modules/axios/lib/core/mergeConfig.js | 87 - node_modules/axios/lib/core/settle.js | 25 - node_modules/axios/lib/core/transformData.js | 20 - node_modules/axios/lib/defaults.js | 98 - node_modules/axios/lib/helpers/README.md | 7 - node_modules/axios/lib/helpers/bind.js | 11 - node_modules/axios/lib/helpers/buildURL.js | 70 - node_modules/axios/lib/helpers/combineURLs.js | 14 - node_modules/axios/lib/helpers/cookies.js | 53 - .../axios/lib/helpers/deprecatedMethod.js | 24 - .../axios/lib/helpers/isAbsoluteURL.js | 14 - .../axios/lib/helpers/isAxiosError.js | 11 - .../axios/lib/helpers/isURLSameOrigin.js | 68 - .../axios/lib/helpers/normalizeHeaderName.js | 12 - .../axios/lib/helpers/parseHeaders.js | 53 - node_modules/axios/lib/helpers/spread.js | 27 - node_modules/axios/lib/utils.js | 351 - node_modules/axios/package.json | 116 - node_modules/commander/CHANGELOG.md | 361 - node_modules/commander/LICENSE | 22 - node_modules/commander/Readme.md | 791 -- node_modules/commander/index.js | 1881 ----- node_modules/commander/package.json | 86 - node_modules/commander/typings/index.d.ts | 410 - node_modules/follow-redirects/LICENSE | 18 - node_modules/follow-redirects/README.md | 148 - node_modules/follow-redirects/debug.js | 9 - node_modules/follow-redirects/http.js | 1 - node_modules/follow-redirects/https.js | 1 - node_modules/follow-redirects/index.js | 504 -- node_modules/follow-redirects/package.json | 98 - node_modules/fs/README.md | 9 - node_modules/fs/package.json | 48 - node_modules/is-docker/cli.js | 5 - node_modules/is-docker/index.d.ts | 15 - node_modules/is-docker/index.js | 29 - node_modules/is-docker/license | 9 - node_modules/is-docker/package.json | 80 - node_modules/is-docker/readme.md | 27 - node_modules/is-wsl/index.d.ts | 15 - node_modules/is-wsl/index.js | 31 - node_modules/is-wsl/license | 9 - node_modules/is-wsl/package.json | 80 - node_modules/is-wsl/readme.md | 36 - node_modules/json2csv/.eslintrc | 10 - node_modules/json2csv/.gitattributes | 3 - node_modules/json2csv/CHANGELOG.md | 600 -- node_modules/json2csv/LICENSE.md | 14 - node_modules/json2csv/README.md | 970 --- node_modules/json2csv/bin/json2csv.js | 183 - .../json2csv/bin/utils/TablePrinter.js | 117 - .../json2csv/bin/utils/parseNdjson.js | 11 - node_modules/json2csv/dist/json2csv.esm.js | 2337 ------ node_modules/json2csv/dist/json2csv.umd.js | 7424 ----------------- .../json2csv/lib/JSON2CSVAsyncParser.js | 60 - node_modules/json2csv/lib/JSON2CSVBase.js | 186 - node_modules/json2csv/lib/JSON2CSVParser.js | 81 - .../json2csv/lib/JSON2CSVTransform.js | 203 - node_modules/json2csv/lib/json2csv.js | 44 - .../json2csv/lib/transforms/flatten.js | 37 - .../json2csv/lib/transforms/unwind.js | 63 - node_modules/json2csv/lib/utils.js | 66 - node_modules/json2csv/package.json | 103 - node_modules/json2csv/rollup.config.js | 46 - node_modules/jsonparse/.npmignore | 1 - node_modules/jsonparse/LICENSE | 24 - node_modules/jsonparse/README.markdown | 11 - node_modules/jsonparse/bench.js | 26 - .../jsonparse/examples/twitterfeed.js | 30 - node_modules/jsonparse/jsonparse.js | 413 - node_modules/jsonparse/package.json | 61 - node_modules/jsonparse/samplejson/basic.json | 167 - node_modules/jsonparse/samplejson/basic2.json | 180 - node_modules/jsonparse/test/big-token.js | 24 - node_modules/jsonparse/test/boundary.js | 110 - node_modules/jsonparse/test/offset.js | 67 - node_modules/jsonparse/test/primitives.js | 57 - node_modules/jsonparse/test/surrogate.js | 26 - node_modules/jsonparse/test/unvalid.js | 15 - node_modules/jsonparse/test/utf8.js | 38 - node_modules/lodash.get/LICENSE | 47 - node_modules/lodash.get/README.md | 18 - node_modules/lodash.get/index.js | 931 --- node_modules/lodash.get/package.json | 72 - node_modules/open/index.d.ts | 88 - node_modules/open/index.js | 172 - node_modules/open/license | 9 - node_modules/open/package.json | 95 - node_modules/open/readme.md | 154 - node_modules/open/xdg-open | 1066 --- node_modules/papaparse/.eslintrc.js | 279 - node_modules/papaparse/.travis.yml | 6 - node_modules/papaparse/Gruntfile.js | 27 - node_modules/papaparse/LICENSE | 20 - node_modules/papaparse/README.md | 67 - node_modules/papaparse/bower.json | 40 - node_modules/papaparse/package.json | 88 - node_modules/papaparse/papaparse.js | 1934 ----- node_modules/papaparse/papaparse.min.js | 7 - node_modules/papaparse/player/player.css | 1045 --- node_modules/papaparse/player/player.html | 78 - node_modules/papaparse/player/player.js | 180 - node_modules/papaparse/tests/.eslintrc.js | 9 - node_modules/papaparse/tests/long-sample.csv | 8 - node_modules/papaparse/tests/node-tests.js | 290 - .../papaparse/tests/sample-header.csv | 3 - node_modules/papaparse/tests/sample.csv | 2 - node_modules/papaparse/tests/test-cases.js | 2569 ------ node_modules/papaparse/tests/test.js | 20 - node_modules/papaparse/tests/tests.html | 22 - .../papaparse/tests/verylong-sample.csv | 2001 ----- package-lock.json | 527 +- package.json | 1 + src/index.js | 87 +- src/platforms/csetforetell-fetch.js | 182 +- src/platforms/wildeford-fetch.js | 120 + src/utils/.mergeEverything.js.swp | Bin 0 -> 12288 bytes src/utils/doEverything.js | 3 +- src/utils/mergeEverything.js | 2 +- src/utils/mongo-wrapper.js | 259 +- src/utils/pullSuperforecastsManually.sh | 4 +- src/utils/stars.js | 471 +- 150 files changed, 1141 insertions(+), 36953 deletions(-) delete mode 120000 node_modules/.bin/is-docker delete mode 120000 node_modules/.bin/json2csv delete mode 100644 node_modules/.package-lock.json delete mode 100644 node_modules/axios/CHANGELOG.md delete mode 100644 node_modules/axios/LICENSE delete mode 100755 node_modules/axios/README.md delete mode 100644 node_modules/axios/UPGRADE_GUIDE.md delete mode 100644 node_modules/axios/dist/axios.js delete mode 100644 node_modules/axios/dist/axios.map delete mode 100644 node_modules/axios/dist/axios.min.js delete mode 100644 node_modules/axios/dist/axios.min.map delete mode 100644 node_modules/axios/index.d.ts delete mode 100644 node_modules/axios/index.js delete mode 100644 node_modules/axios/lib/adapters/README.md delete mode 100755 node_modules/axios/lib/adapters/http.js delete mode 100644 node_modules/axios/lib/adapters/xhr.js delete mode 100644 node_modules/axios/lib/axios.js delete mode 100644 node_modules/axios/lib/cancel/Cancel.js delete mode 100644 node_modules/axios/lib/cancel/CancelToken.js delete mode 100644 node_modules/axios/lib/cancel/isCancel.js delete mode 100644 node_modules/axios/lib/core/Axios.js delete mode 100644 node_modules/axios/lib/core/InterceptorManager.js delete mode 100644 node_modules/axios/lib/core/README.md delete mode 100644 node_modules/axios/lib/core/buildFullPath.js delete mode 100644 node_modules/axios/lib/core/createError.js delete mode 100644 node_modules/axios/lib/core/dispatchRequest.js delete mode 100644 node_modules/axios/lib/core/enhanceError.js delete mode 100644 node_modules/axios/lib/core/mergeConfig.js delete mode 100644 node_modules/axios/lib/core/settle.js delete mode 100644 node_modules/axios/lib/core/transformData.js delete mode 100644 node_modules/axios/lib/defaults.js delete mode 100644 node_modules/axios/lib/helpers/README.md delete mode 100644 node_modules/axios/lib/helpers/bind.js delete mode 100644 node_modules/axios/lib/helpers/buildURL.js delete mode 100644 node_modules/axios/lib/helpers/combineURLs.js delete mode 100644 node_modules/axios/lib/helpers/cookies.js delete mode 100644 node_modules/axios/lib/helpers/deprecatedMethod.js delete mode 100644 node_modules/axios/lib/helpers/isAbsoluteURL.js delete mode 100644 node_modules/axios/lib/helpers/isAxiosError.js delete mode 100644 node_modules/axios/lib/helpers/isURLSameOrigin.js delete mode 100644 node_modules/axios/lib/helpers/normalizeHeaderName.js delete mode 100644 node_modules/axios/lib/helpers/parseHeaders.js delete mode 100644 node_modules/axios/lib/helpers/spread.js delete mode 100644 node_modules/axios/lib/utils.js delete mode 100644 node_modules/axios/package.json delete mode 100644 node_modules/commander/CHANGELOG.md delete mode 100644 node_modules/commander/LICENSE delete mode 100644 node_modules/commander/Readme.md delete mode 100644 node_modules/commander/index.js delete mode 100644 node_modules/commander/package.json delete mode 100644 node_modules/commander/typings/index.d.ts delete mode 100644 node_modules/follow-redirects/LICENSE delete mode 100644 node_modules/follow-redirects/README.md delete mode 100644 node_modules/follow-redirects/debug.js delete mode 100644 node_modules/follow-redirects/http.js delete mode 100644 node_modules/follow-redirects/https.js delete mode 100644 node_modules/follow-redirects/index.js delete mode 100644 node_modules/follow-redirects/package.json delete mode 100644 node_modules/fs/README.md delete mode 100644 node_modules/fs/package.json delete mode 100755 node_modules/is-docker/cli.js delete mode 100644 node_modules/is-docker/index.d.ts delete mode 100644 node_modules/is-docker/index.js delete mode 100644 node_modules/is-docker/license delete mode 100644 node_modules/is-docker/package.json delete mode 100644 node_modules/is-docker/readme.md delete mode 100644 node_modules/is-wsl/index.d.ts delete mode 100644 node_modules/is-wsl/index.js delete mode 100644 node_modules/is-wsl/license delete mode 100644 node_modules/is-wsl/package.json delete mode 100644 node_modules/is-wsl/readme.md delete mode 100644 node_modules/json2csv/.eslintrc delete mode 100644 node_modules/json2csv/.gitattributes delete mode 100644 node_modules/json2csv/CHANGELOG.md delete mode 100644 node_modules/json2csv/LICENSE.md delete mode 100644 node_modules/json2csv/README.md delete mode 100755 node_modules/json2csv/bin/json2csv.js delete mode 100644 node_modules/json2csv/bin/utils/TablePrinter.js delete mode 100644 node_modules/json2csv/bin/utils/parseNdjson.js delete mode 100644 node_modules/json2csv/dist/json2csv.esm.js delete mode 100644 node_modules/json2csv/dist/json2csv.umd.js delete mode 100644 node_modules/json2csv/lib/JSON2CSVAsyncParser.js delete mode 100644 node_modules/json2csv/lib/JSON2CSVBase.js delete mode 100644 node_modules/json2csv/lib/JSON2CSVParser.js delete mode 100644 node_modules/json2csv/lib/JSON2CSVTransform.js delete mode 100644 node_modules/json2csv/lib/json2csv.js delete mode 100644 node_modules/json2csv/lib/transforms/flatten.js delete mode 100644 node_modules/json2csv/lib/transforms/unwind.js delete mode 100644 node_modules/json2csv/lib/utils.js delete mode 100644 node_modules/json2csv/package.json delete mode 100644 node_modules/json2csv/rollup.config.js delete mode 100644 node_modules/jsonparse/.npmignore delete mode 100644 node_modules/jsonparse/LICENSE delete mode 100644 node_modules/jsonparse/README.markdown delete mode 100644 node_modules/jsonparse/bench.js delete mode 100644 node_modules/jsonparse/examples/twitterfeed.js delete mode 100644 node_modules/jsonparse/jsonparse.js delete mode 100644 node_modules/jsonparse/package.json delete mode 100644 node_modules/jsonparse/samplejson/basic.json delete mode 100644 node_modules/jsonparse/samplejson/basic2.json delete mode 100644 node_modules/jsonparse/test/big-token.js delete mode 100644 node_modules/jsonparse/test/boundary.js delete mode 100644 node_modules/jsonparse/test/offset.js delete mode 100644 node_modules/jsonparse/test/primitives.js delete mode 100644 node_modules/jsonparse/test/surrogate.js delete mode 100644 node_modules/jsonparse/test/unvalid.js delete mode 100644 node_modules/jsonparse/test/utf8.js delete mode 100644 node_modules/lodash.get/LICENSE delete mode 100644 node_modules/lodash.get/README.md delete mode 100644 node_modules/lodash.get/index.js delete mode 100644 node_modules/lodash.get/package.json delete mode 100644 node_modules/open/index.d.ts delete mode 100644 node_modules/open/index.js delete mode 100644 node_modules/open/license delete mode 100644 node_modules/open/package.json delete mode 100644 node_modules/open/readme.md delete mode 100755 node_modules/open/xdg-open delete mode 100644 node_modules/papaparse/.eslintrc.js delete mode 100644 node_modules/papaparse/.travis.yml delete mode 100644 node_modules/papaparse/Gruntfile.js delete mode 100644 node_modules/papaparse/LICENSE delete mode 100644 node_modules/papaparse/README.md delete mode 100644 node_modules/papaparse/bower.json delete mode 100644 node_modules/papaparse/package.json delete mode 100755 node_modules/papaparse/papaparse.js delete mode 100644 node_modules/papaparse/papaparse.min.js delete mode 100644 node_modules/papaparse/player/player.css delete mode 100644 node_modules/papaparse/player/player.html delete mode 100644 node_modules/papaparse/player/player.js delete mode 100644 node_modules/papaparse/tests/.eslintrc.js delete mode 100644 node_modules/papaparse/tests/long-sample.csv delete mode 100644 node_modules/papaparse/tests/node-tests.js delete mode 100644 node_modules/papaparse/tests/sample-header.csv delete mode 100644 node_modules/papaparse/tests/sample.csv delete mode 100644 node_modules/papaparse/tests/test-cases.js delete mode 100644 node_modules/papaparse/tests/test.js delete mode 100644 node_modules/papaparse/tests/tests.html delete mode 100644 node_modules/papaparse/tests/verylong-sample.csv create mode 100644 src/platforms/wildeford-fetch.js create mode 100644 src/utils/.mergeEverything.js.swp diff --git a/.gitignore b/.gitignore index 77b83e8..d25c617 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ ## Node modules node_modules/ +node_modules/* ## Security **/betfaircertificates/ @@ -11,4 +12,4 @@ NotesHeroku.md AlgoliaNotes.md ## Build artifacts -done.txt \ No newline at end of file +done.txt diff --git a/node_modules/.bin/is-docker b/node_modules/.bin/is-docker deleted file mode 120000 index 9896ba5..0000000 --- a/node_modules/.bin/is-docker +++ /dev/null @@ -1 +0,0 @@ -../is-docker/cli.js \ No newline at end of file diff --git a/node_modules/.bin/json2csv b/node_modules/.bin/json2csv deleted file mode 120000 index 2eed657..0000000 --- a/node_modules/.bin/json2csv +++ /dev/null @@ -1 +0,0 @@ -../json2csv/bin/json2csv.js \ No newline at end of file diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json deleted file mode 100644 index 3acf998..0000000 --- a/node_modules/.package-lock.json +++ /dev/null @@ -1,936 +0,0 @@ -{ - "name": "metaforecasts", - "version": "0.3.0", - "lockfileVersion": 2, - "requires": true, - "packages": { - "node_modules/@algolia/cache-browser-local-storage": { - "version": "4.10.3", - "resolved": "https://registry.npmjs.org/@algolia/cache-browser-local-storage/-/cache-browser-local-storage-4.10.3.tgz", - "integrity": "sha512-TD1N7zg5lb56/PLjjD4bBl2eccEvVHhC7yfgFu2r9k5tf+gvbGxEZ3NhRZVKu2MObUIcEy2VR4LVLxOQu45Hlg==", - "dependencies": { - "@algolia/cache-common": "4.10.3" - } - }, - "node_modules/@algolia/cache-common": { - "version": "4.10.3", - "resolved": "https://registry.npmjs.org/@algolia/cache-common/-/cache-common-4.10.3.tgz", - "integrity": "sha512-q13cPPUmtf8a2suBC4kySSr97EyulSXuxUkn7l1tZUCX/k1y5KNheMp8npBy8Kc8gPPmHpacxddRSfOncjiKFw==" - }, - "node_modules/@algolia/cache-in-memory": { - "version": "4.10.3", - "resolved": "https://registry.npmjs.org/@algolia/cache-in-memory/-/cache-in-memory-4.10.3.tgz", - "integrity": "sha512-JhPajhOXAjUP+TZrZTh6KJpF5VKTKyWK2aR1cD8NtrcVHwfGS7fTyfXfVm5BqBqkD9U0gVvufUt/mVyI80aZww==", - "dependencies": { - "@algolia/cache-common": "4.10.3" - } - }, - "node_modules/@algolia/client-account": { - "version": "4.10.3", - "resolved": "https://registry.npmjs.org/@algolia/client-account/-/client-account-4.10.3.tgz", - "integrity": "sha512-S/IsJB4s+e1xYctdpW3nAbwrR2y3pjSo9X21fJGoiGeIpTRdvQG7nydgsLkhnhcgAdLnmqBapYyAqMGmlcyOkg==", - "dependencies": { - "@algolia/client-common": "4.10.3", - "@algolia/client-search": "4.10.3", - "@algolia/transporter": "4.10.3" - } - }, - "node_modules/@algolia/client-analytics": { - "version": "4.10.3", - "resolved": "https://registry.npmjs.org/@algolia/client-analytics/-/client-analytics-4.10.3.tgz", - "integrity": "sha512-vlHTbBqJktRgclh3v7bPQLfZvFIqY4erNFIZA5C7nisCj9oLeTgzefoUrr+R90+I+XjfoLxnmoeigS1Z1yg1vw==", - "dependencies": { - "@algolia/client-common": "4.10.3", - "@algolia/client-search": "4.10.3", - "@algolia/requester-common": "4.10.3", - "@algolia/transporter": "4.10.3" - } - }, - "node_modules/@algolia/client-common": { - "version": "4.10.3", - "resolved": "https://registry.npmjs.org/@algolia/client-common/-/client-common-4.10.3.tgz", - "integrity": "sha512-uFyP2Z14jG2hsFRbAoavna6oJf4NTXaSDAZgouZUZlHlBp5elM38sjNeA5HR9/D9J/GjwaB1SgB7iUiIWYBB4w==", - "dependencies": { - "@algolia/requester-common": "4.10.3", - "@algolia/transporter": "4.10.3" - } - }, - "node_modules/@algolia/client-personalization": { - "version": "4.10.3", - "resolved": "https://registry.npmjs.org/@algolia/client-personalization/-/client-personalization-4.10.3.tgz", - "integrity": "sha512-NS7Nx8EJ/nduGXT8CFo5z7kLF0jnFehTP3eC+z+GOEESH3rrs7uR12IZHxv5QhQswZa9vl925zCOZDcDVoENCg==", - "dependencies": { - "@algolia/client-common": "4.10.3", - "@algolia/requester-common": "4.10.3", - "@algolia/transporter": "4.10.3" - } - }, - "node_modules/@algolia/client-search": { - "version": "4.10.3", - "resolved": "https://registry.npmjs.org/@algolia/client-search/-/client-search-4.10.3.tgz", - "integrity": "sha512-Zwnp2G94IrNFKWCG/k7epI5UswRkPvL9FCt7/slXe2bkjP2y/HA37gzRn+9tXoLVRwd7gBzrtOA4jFKIyjrtVw==", - "dependencies": { - "@algolia/client-common": "4.10.3", - "@algolia/requester-common": "4.10.3", - "@algolia/transporter": "4.10.3" - } - }, - "node_modules/@algolia/logger-common": { - "version": "4.10.3", - "resolved": "https://registry.npmjs.org/@algolia/logger-common/-/logger-common-4.10.3.tgz", - "integrity": "sha512-M6xi+qov2bkgg1H9e1Qtvq/E/eKsGcgz8RBbXNzqPIYoDGZNkv+b3b8YMo3dxd4Wd6M24HU1iqF3kmr1LaXndg==" - }, - "node_modules/@algolia/logger-console": { - "version": "4.10.3", - "resolved": "https://registry.npmjs.org/@algolia/logger-console/-/logger-console-4.10.3.tgz", - "integrity": "sha512-vVgRI7b4PHjgBdRkv/cRz490twvkLoGdpC4VYzIouSrKj8SIVLRhey3qgXk7oQXi3xoxVAv6NrklHfpO8Bpx0w==", - "dependencies": { - "@algolia/logger-common": "4.10.3" - } - }, - "node_modules/@algolia/requester-browser-xhr": { - "version": "4.10.3", - "resolved": "https://registry.npmjs.org/@algolia/requester-browser-xhr/-/requester-browser-xhr-4.10.3.tgz", - "integrity": "sha512-4WIk1zreFbc1EF6+gsfBTQvwSNjWc20zJAAExRWql/Jq5yfVHmwOqi/CajA53/cXKFBqo80DAMRvOiwP+hOLYw==", - "dependencies": { - "@algolia/requester-common": "4.10.3" - } - }, - "node_modules/@algolia/requester-common": { - "version": "4.10.3", - "resolved": "https://registry.npmjs.org/@algolia/requester-common/-/requester-common-4.10.3.tgz", - "integrity": "sha512-PNfLHmg0Hujugs3rx55uz/ifv7b9HVdSFQDb2hj0O5xZaBEuQCNOXC6COrXR8+9VEfqp2swpg7zwgtqFxh+BtQ==" - }, - "node_modules/@algolia/requester-node-http": { - "version": "4.10.3", - "resolved": "https://registry.npmjs.org/@algolia/requester-node-http/-/requester-node-http-4.10.3.tgz", - "integrity": "sha512-A9ZcGfEvgqf0luJApdNcIhsRh6MShn2zn2tbjwjGG1joF81w+HUY+BWuLZn56vGwAA9ZB9n00IoJJpxibbfofg==", - "dependencies": { - "@algolia/requester-common": "4.10.3" - } - }, - "node_modules/@algolia/transporter": { - "version": "4.10.3", - "resolved": "https://registry.npmjs.org/@algolia/transporter/-/transporter-4.10.3.tgz", - "integrity": "sha512-n1lRyKDbrckbMEgm7QXtj3nEWUuzA3aKLzVQ43/F/RCFib15j4IwtmYhXR6OIBRSc7+T0Hm48S0J6F+HeYCQkw==", - "dependencies": { - "@algolia/cache-common": "4.10.3", - "@algolia/logger-common": "4.10.3", - "@algolia/requester-common": "4.10.3" - } - }, - "node_modules/@sindresorhus/is": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-2.1.1.tgz", - "integrity": "sha512-/aPsuoj/1Dw/kzhkgz+ES6TxG0zfTMGLwuK2ZG00k/iJzYHTLCE8mVU8EPqEOp/lmxPoq1C1C9RYToRKb2KEfg==", - "engines": { - "node": ">=10" - } - }, - "node_modules/@szmarczak/http-timer": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-4.0.5.tgz", - "integrity": "sha512-PyRA9sm1Yayuj5OIoJ1hGt2YISX45w9WcFbh6ddT0Z/0yaFxOtGLInr4jUfU1EAFVs0Yfyfev4RNwBlUaHdlDQ==", - "dependencies": { - "defer-to-connect": "^2.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@types/cacheable-request": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.1.tgz", - "integrity": "sha512-ykFq2zmBGOCbpIXtoVbz4SKY5QriWPh3AjyU4G74RYbtt5yOc5OfaY75ftjg7mikMOla1CTGpX3lLbuJh8DTrQ==", - "dependencies": { - "@types/http-cache-semantics": "*", - "@types/keyv": "*", - "@types/node": "*", - "@types/responselike": "*" - } - }, - "node_modules/@types/http-cache-semantics": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.0.tgz", - "integrity": "sha512-c3Xy026kOF7QOTn00hbIllV1dLR9hG9NkSrLQgCVs8NF6sBU+VGWjD3wLPhmh1TYAc7ugCFsvHYMN4VcBN1U1A==" - }, - "node_modules/@types/keyv": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.1.tgz", - "integrity": "sha512-MPtoySlAZQ37VoLaPcTHCu1RWJ4llDkULYZIzOYxlhxBqYPB0RsRlmMU0R6tahtFe27mIdkHV+551ZWV4PLmVw==", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/node": { - "version": "14.14.28", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.28.tgz", - "integrity": "sha512-lg55ArB+ZiHHbBBttLpzD07akz0QPrZgUODNakeC09i62dnrywr9mFErHuaPlB6I7z+sEbK+IYmplahvplCj2g==" - }, - "node_modules/@types/responselike": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.0.tgz", - "integrity": "sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/algoliasearch": { - "version": "4.10.3", - "resolved": "https://registry.npmjs.org/algoliasearch/-/algoliasearch-4.10.3.tgz", - "integrity": "sha512-OLY0AWlPKGLbSaw14ivMB7BT5fPdp8VdzY4L8FtzZnqmLKsyes24cltGlf7/X96ACkYEcT390SReCDt/9SUIRg==", - "dependencies": { - "@algolia/cache-browser-local-storage": "4.10.3", - "@algolia/cache-common": "4.10.3", - "@algolia/cache-in-memory": "4.10.3", - "@algolia/client-account": "4.10.3", - "@algolia/client-analytics": "4.10.3", - "@algolia/client-common": "4.10.3", - "@algolia/client-personalization": "4.10.3", - "@algolia/client-search": "4.10.3", - "@algolia/logger-common": "4.10.3", - "@algolia/logger-console": "4.10.3", - "@algolia/requester-browser-xhr": "4.10.3", - "@algolia/requester-common": "4.10.3", - "@algolia/requester-node-http": "4.10.3", - "@algolia/transporter": "4.10.3" - } - }, - "node_modules/axios": { - "version": "0.21.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", - "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", - "dependencies": { - "follow-redirects": "^1.10.0" - } - }, - "node_modules/bl": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/bl/-/bl-2.2.1.tgz", - "integrity": "sha512-6Pesp1w0DEX1N550i/uGV/TqucVL4AM/pgThFSN/Qq9si1/DF9aIHs1BxD8V/QU0HoeHO6cQRTAuYnLPKq1e4g==", - "dependencies": { - "readable-stream": "^2.3.5", - "safe-buffer": "^5.1.1" - } - }, - "node_modules/boolbase": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", - "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=" - }, - "node_modules/bson": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/bson/-/bson-1.1.6.tgz", - "integrity": "sha512-EvVNVeGo4tHxwi8L6bPj3y3itEvStdwvvlojVxxbyYfoaxJ6keLgrTuKdyfEAszFK+H3olzBuafE0yoh0D1gdg==", - "engines": { - "node": ">=0.6.19" - } - }, - "node_modules/cacheable-lookup": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-2.0.1.tgz", - "integrity": "sha512-EMMbsiOTcdngM/K6gV/OxF2x0t07+vMOWxZNSCRQMjO2MY2nhZQ6OYhOOpyQrbhqsgtvKGI7hcq6xjnA92USjg==", - "dependencies": { - "@types/keyv": "^3.1.1", - "keyv": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/cacheable-request": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.1.tgz", - "integrity": "sha512-lt0mJ6YAnsrBErpTMWeu5kl/tg9xMAWjavYTN6VQXM1A/teBITuNcccXsCxF0tDQQJf9DfAaX5O4e0zp0KlfZw==", - "dependencies": { - "clone-response": "^1.0.2", - "get-stream": "^5.1.0", - "http-cache-semantics": "^4.0.0", - "keyv": "^4.0.0", - "lowercase-keys": "^2.0.0", - "normalize-url": "^4.1.0", - "responselike": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cheerio": { - "version": "1.0.0-rc.10", - "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.10.tgz", - "integrity": "sha512-g0J0q/O6mW8z5zxQ3A8E8J1hUgp4SMOvEoW/x84OwyHKe/Zccz83PVT4y5Crcr530FV6NgmKI1qvGTKVl9XXVw==", - "dependencies": { - "cheerio-select": "^1.5.0", - "dom-serializer": "^1.3.2", - "domhandler": "^4.2.0", - "htmlparser2": "^6.1.0", - "parse5": "^6.0.1", - "parse5-htmlparser2-tree-adapter": "^6.0.1", - "tslib": "^2.2.0" - }, - "engines": { - "node": ">= 6" - }, - "funding": { - "url": "https://github.com/cheeriojs/cheerio?sponsor=1" - } - }, - "node_modules/cheerio-select": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-1.5.0.tgz", - "integrity": "sha512-qocaHPv5ypefh6YNxvnbABM07KMxExbtbfuJoIie3iZXX1ERwYmJcIiRrr9H05ucQP1k28dav8rpdDgjQd8drg==", - "dependencies": { - "css-select": "^4.1.3", - "css-what": "^5.0.1", - "domelementtype": "^2.2.0", - "domhandler": "^4.2.0", - "domutils": "^2.7.0" - }, - "funding": { - "url": "https://github.com/sponsors/fb55" - } - }, - "node_modules/clone-response": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", - "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", - "dependencies": { - "mimic-response": "^1.0.0" - } - }, - "node_modules/clone-response/node_modules/mimic-response": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", - "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", - "engines": { - "node": ">=4" - } - }, - "node_modules/commander": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", - "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", - "engines": { - "node": ">= 6" - } - }, - "node_modules/core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" - }, - "node_modules/css-select": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-4.1.3.tgz", - "integrity": "sha512-gT3wBNd9Nj49rAbmtFHj1cljIAOLYSX1nZ8CB7TBO3INYckygm5B7LISU/szY//YmdiSLbJvDLOx9VnMVpMBxA==", - "dependencies": { - "boolbase": "^1.0.0", - "css-what": "^5.0.0", - "domhandler": "^4.2.0", - "domutils": "^2.6.0", - "nth-check": "^2.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/fb55" - } - }, - "node_modules/css-what": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/css-what/-/css-what-5.0.1.tgz", - "integrity": "sha512-FYDTSHb/7KXsWICVsxdmiExPjCfRC4qRFBdVwv7Ax9hMnvMmEjP9RfxTEZ3qPZGmADDn2vAKSo9UcN1jKVYscg==", - "engines": { - "node": ">= 6" - }, - "funding": { - "url": "https://github.com/sponsors/fb55" - } - }, - "node_modules/decompress-response": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-5.0.0.tgz", - "integrity": "sha512-TLZWWybuxWgoW7Lykv+gq9xvzOsUjQ9tF09Tj6NSTYGMTCHNXzrPnD6Hi+TgZq19PyTAGH4Ll/NIM/eTGglnMw==", - "dependencies": { - "mimic-response": "^2.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/defer-to-connect": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.0.tgz", - "integrity": "sha512-bYL2d05vOSf1JEZNx5vSAtPuBMkX8K9EUutg7zlKvTqKXHt7RhWJFbmd7qakVuf13i+IkGmp6FwSsONOf6VYIg==", - "engines": { - "node": ">=10" - } - }, - "node_modules/denque": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/denque/-/denque-1.5.0.tgz", - "integrity": "sha512-CYiCSgIF1p6EUByQPlGkKnP1M9g0ZV3qMIrqMqZqdwazygIA/YP2vrbcyl1h/WppKJTdl1F85cXIle+394iDAQ==", - "engines": { - "node": ">=0.10" - } - }, - "node_modules/dom-serializer": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.3.2.tgz", - "integrity": "sha512-5c54Bk5Dw4qAxNOI1pFEizPSjVsx5+bpJKmL2kPn8JhBUq2q09tTCa3mjijun2NfK78NMouDYNMBkOrPZiS+ig==", - "dependencies": { - "domelementtype": "^2.0.1", - "domhandler": "^4.2.0", - "entities": "^2.0.0" - }, - "funding": { - "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" - } - }, - "node_modules/domelementtype": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.2.0.tgz", - "integrity": "sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/fb55" - } - ] - }, - "node_modules/domhandler": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.2.0.tgz", - "integrity": "sha512-zk7sgt970kzPks2Bf+dwT/PLzghLnsivb9CcxkvR8Mzr66Olr0Ofd8neSbglHJHaHa2MadfoSdNlKYAaafmWfA==", - "dependencies": { - "domelementtype": "^2.2.0" - }, - "engines": { - "node": ">= 4" - }, - "funding": { - "url": "https://github.com/fb55/domhandler?sponsor=1" - } - }, - "node_modules/domutils": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.7.0.tgz", - "integrity": "sha512-8eaHa17IwJUPAiB+SoTYBo5mCdeMgdcAoXJ59m6DT1vw+5iLS3gNoqYaRowaBKtGVrOF1Jz4yDTgYKLK2kvfJg==", - "dependencies": { - "dom-serializer": "^1.0.1", - "domelementtype": "^2.2.0", - "domhandler": "^4.2.0" - }, - "funding": { - "url": "https://github.com/fb55/domutils?sponsor=1" - } - }, - "node_modules/duplexer3": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", - "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=" - }, - "node_modules/end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dependencies": { - "once": "^1.4.0" - } - }, - "node_modules/entities": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz", - "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==", - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } - }, - "node_modules/follow-redirects": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.1.tgz", - "integrity": "sha512-SSG5xmZh1mkPGyKzjZP8zLjltIfpW32Y5QpdNJyjcfGxK3qo3NDDkZOZSFiGn1A6SclQxY9GzEwAHQ3dmYRWpg==", - "engines": { - "node": ">=4.0" - } - }, - "node_modules/fs": { - "version": "0.0.1-security", - "resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz", - "integrity": "sha1-invTcYa23d84E/I4WLV+yq9eQdQ=" - }, - "node_modules/get-stream": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", - "dependencies": { - "pump": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/got": { - "version": "10.7.0", - "resolved": "https://registry.npmjs.org/got/-/got-10.7.0.tgz", - "integrity": "sha512-aWTDeNw9g+XqEZNcTjMMZSy7B7yE9toWOFYip7ofFTLleJhvZwUxxTxkTpKvF+p1SAA4VHmuEy7PiHTHyq8tJg==", - "dependencies": { - "@sindresorhus/is": "^2.0.0", - "@szmarczak/http-timer": "^4.0.0", - "@types/cacheable-request": "^6.0.1", - "cacheable-lookup": "^2.0.0", - "cacheable-request": "^7.0.1", - "decompress-response": "^5.0.0", - "duplexer3": "^0.1.4", - "get-stream": "^5.0.0", - "lowercase-keys": "^2.0.0", - "mimic-response": "^2.1.0", - "p-cancelable": "^2.0.0", - "p-event": "^4.0.0", - "responselike": "^2.0.0", - "to-readable-stream": "^2.0.0", - "type-fest": "^0.10.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/htmlparser2": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-6.1.0.tgz", - "integrity": "sha512-gyyPk6rgonLFEDGoeRgQNaEUvdJ4ktTmmUh/h2t7s+M8oPpIPxgNACWa+6ESR57kXstwqPiCut0V8NRpcwgU7A==", - "funding": [ - "https://github.com/fb55/htmlparser2?sponsor=1", - { - "type": "github", - "url": "https://github.com/sponsors/fb55" - } - ], - "dependencies": { - "domelementtype": "^2.0.1", - "domhandler": "^4.0.0", - "domutils": "^2.5.2", - "entities": "^2.0.0" - } - }, - "node_modules/http-cache-semantics": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", - "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==" - }, - "node_modules/https": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/https/-/https-1.0.0.tgz", - "integrity": "sha1-PDfHrhqO65ZpBKKtHpdaGUt+06Q=" - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "node_modules/is-docker": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.1.1.tgz", - "integrity": "sha512-ZOoqiXfEwtGknTiuDEy8pN2CfE3TxMHprvNer1mXiqwkOT77Rw3YVrUQ52EqAOU3QAWDQ+bQdx7HJzrv7LS2Hw==", - "bin": { - "is-docker": "cli.js" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-wsl": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", - "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", - "dependencies": { - "is-docker": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "node_modules/isomorphic-fetch": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-3.0.0.tgz", - "integrity": "sha512-qvUtwJ3j6qwsF3jLxkZ72qCgjMysPzDfeV240JHiGZsANBYd+EEuu35v7dfrJ9Up0Ak07D7GGSkGhCHTqg/5wA==", - "dependencies": { - "node-fetch": "^2.6.1", - "whatwg-fetch": "^3.4.1" - } - }, - "node_modules/json-buffer": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", - "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==" - }, - "node_modules/json2csv": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/json2csv/-/json2csv-5.0.5.tgz", - "integrity": "sha512-/UyvnfuUghRM+C/AiQ02X0LS+/AKfugcwaWo/gAz1pi203v29sUMrMSNEC088i+h0EG39eSsmeL9Z0iK+9MM0A==", - "dependencies": { - "commander": "^6.1.0", - "jsonparse": "^1.3.1", - "lodash.get": "^4.4.2" - }, - "bin": { - "json2csv": "bin/json2csv.js" - }, - "engines": { - "node": ">= 10", - "npm": ">= 6.13.0" - } - }, - "node_modules/jsonparse": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", - "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", - "engines": [ - "node >= 0.2.0" - ] - }, - "node_modules/keyv": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.0.3.tgz", - "integrity": "sha512-zdGa2TOpSZPq5mU6iowDARnMBZgtCqJ11dJROFi6tg6kTn4nuUdU09lFyLFSaHrWqpIJ+EBq4E8/Dc0Vx5vLdA==", - "dependencies": { - "json-buffer": "3.0.1" - } - }, - "node_modules/lodash.get": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", - "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=" - }, - "node_modules/lowercase-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", - "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", - "engines": { - "node": ">=8" - } - }, - "node_modules/memory-pager": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz", - "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==", - "optional": true - }, - "node_modules/mimic-response": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz", - "integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==", - "engines": { - "node": ">=8" - } - }, - "node_modules/mongodb": { - "version": "3.6.6", - "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.6.6.tgz", - "integrity": "sha512-WlirMiuV1UPbej5JeCMqE93JRfZ/ZzqE7nJTwP85XzjAF4rRSeq2bGCb1cjfoHLOF06+HxADaPGqT0g3SbVT1w==", - "dependencies": { - "bl": "^2.2.1", - "bson": "^1.1.4", - "denque": "^1.4.1", - "optional-require": "^1.0.2", - "safe-buffer": "^5.1.2" - }, - "engines": { - "node": ">=4" - }, - "optionalDependencies": { - "saslprep": "^1.0.0" - }, - "peerDependenciesMeta": { - "aws4": { - "optional": true - }, - "bson-ext": { - "optional": true - }, - "kerberos": { - "optional": true - }, - "mongodb-client-encryption": { - "optional": true - }, - "mongodb-extjson": { - "optional": true - }, - "snappy": { - "optional": true - } - } - }, - "node_modules/node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", - "engines": { - "node": "4.x || >=6.0.0" - } - }, - "node_modules/normalize-url": { - "version": "4.5.1", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.1.tgz", - "integrity": "sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA==", - "engines": { - "node": ">=8" - } - }, - "node_modules/nth-check": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.0.0.tgz", - "integrity": "sha512-i4sc/Kj8htBrAiH1viZ0TgU8Y5XqCaV/FziYK6TBczxmeKm3AEFWqqF3195yKudrarqy7Zu80Ra5dobFjn9X/Q==", - "dependencies": { - "boolbase": "^1.0.0" - }, - "funding": { - "url": "https://github.com/fb55/nth-check?sponsor=1" - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/open": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/open/-/open-7.3.1.tgz", - "integrity": "sha512-f2wt9DCBKKjlFbjzGb8MOAW8LH8F0mrs1zc7KTjAJ9PZNQbfenzWbNP1VZJvw6ICMG9r14Ah6yfwPn7T7i646A==", - "dependencies": { - "is-docker": "^2.0.0", - "is-wsl": "^2.1.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/optional-require": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/optional-require/-/optional-require-1.0.2.tgz", - "integrity": "sha512-HZubVd6IfHsbnpdNF/ICaSAzBUEW1TievpkjY3tB4Jnk8L7+pJ3conPzUt3Mn/6OZx9uzTDOHYPGA8/AxYHBOg==", - "engines": { - "node": ">=4" - } - }, - "node_modules/p-cancelable": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.0.0.tgz", - "integrity": "sha512-wvPXDmbMmu2ksjkB4Z3nZWTSkJEb9lqVdMaCKpZUGJG9TMiNp9XcbG3fn9fPKjem04fJMJnXoyFPk2FmgiaiNg==", - "engines": { - "node": ">=8" - } - }, - "node_modules/p-event": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/p-event/-/p-event-4.2.0.tgz", - "integrity": "sha512-KXatOjCRXXkSePPb1Nbi0p0m+gQAwdlbhi4wQKJPI1HsMQS9g+Sqp2o+QHziPr7eYJyOZet836KoHEVM1mwOrQ==", - "dependencies": { - "p-timeout": "^3.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", - "engines": { - "node": ">=4" - } - }, - "node_modules/p-timeout": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-3.2.0.tgz", - "integrity": "sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==", - "dependencies": { - "p-finally": "^1.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/papaparse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/papaparse/-/papaparse-5.3.0.tgz", - "integrity": "sha512-Lb7jN/4bTpiuGPrYy4tkKoUS8sTki8zacB5ke1p5zolhcSE4TlWgrlsxjrDTbG/dFVh07ck7X36hUf/b5V68pg==" - }, - "node_modules/parse5": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", - "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==" - }, - "node_modules/parse5-htmlparser2-tree-adapter": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-6.0.1.tgz", - "integrity": "sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA==", - "dependencies": { - "parse5": "^6.0.1" - } - }, - "node_modules/process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" - }, - "node_modules/pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/readable-stream/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "node_modules/responselike": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/responselike/-/responselike-2.0.0.tgz", - "integrity": "sha512-xH48u3FTB9VsZw7R+vvgaKeLKzT6jOogbQhEe/jewwnZgzPcnyWui2Av6JpoYZF/91uueC+lqhWqeURw5/qhCw==", - "dependencies": { - "lowercase-keys": "^2.0.0" - } - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/saslprep": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/saslprep/-/saslprep-1.0.3.tgz", - "integrity": "sha512-/MY/PEMbk2SuY5sScONwhUDsV2p77Znkb/q3nSVstq/yQzYJOH/Azh29p9oJLsl3LnQwSvZDKagDGBsBwSooag==", - "optional": true, - "dependencies": { - "sparse-bitfield": "^3.0.3" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/sparse-bitfield": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz", - "integrity": "sha1-/0rm5oZWBWuks+eSqzM004JzyhE=", - "optional": true, - "dependencies": { - "memory-pager": "^1.0.2" - } - }, - "node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/string_decoder/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "node_modules/tabletojson": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/tabletojson/-/tabletojson-2.0.4.tgz", - "integrity": "sha512-5dDbixNflxrU93MPKfJni1QHO2e6d2UP6Ve6kHyxxZy6wpLTcUAsJzUf+H7Yg08eQOpJsnevJ2olrMYIH09Zsw==", - "dependencies": { - "cheerio": "^1.0.0-rc.3", - "got": "^10.7.0", - "tunnel": "0.0.6" - }, - "engines": { - "node": "*" - } - }, - "node_modules/textversionjs": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/textversionjs/-/textversionjs-1.1.3.tgz", - "integrity": "sha1-G3AK73gEZ3hoguKKsSb3fKMmoeg=" - }, - "node_modules/to-readable-stream": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-2.1.0.tgz", - "integrity": "sha512-o3Qa6DGg1CEXshSdvWNX2sN4QHqg03SPq7U6jPXRahlQdl5dK8oXjkU/2/sGrnOZKeGV1zLSO8qPwyKklPPE7w==", - "engines": { - "node": ">=8" - } - }, - "node_modules/tslib": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", - "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" - }, - "node_modules/tunnel": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", - "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", - "engines": { - "node": ">=0.6.11 <=0.7.0 || >=0.7.3" - } - }, - "node_modules/type-fest": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.10.0.tgz", - "integrity": "sha512-EUV9jo4sffrwlg8s0zDhP0T2WD3pru5Xi0+HTE3zTUmBaZNhfkite9PdSJwdXLwPVW0jnAHT56pZHIOYckPEiw==", - "engines": { - "node": ">=8" - } - }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - }, - "node_modules/whatwg-fetch": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.6.2.tgz", - "integrity": "sha512-bJlen0FcuU/0EMLrdbJ7zOnW6ITZLrZMIarMUVmdKtsGvZna8vxKYaexICWPfZ8qwf9fzNq+UEIZrnSaApt6RA==" - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - } - } -} diff --git a/node_modules/axios/CHANGELOG.md b/node_modules/axios/CHANGELOG.md deleted file mode 100644 index 6f11ac1..0000000 --- a/node_modules/axios/CHANGELOG.md +++ /dev/null @@ -1,685 +0,0 @@ -# Changelog - -### 0.21.1 (December 21, 2020) - -Fixes and Functionality: - -- Hotfix: Prevent SSRF (#3410) -- Protocol not parsed when setting proxy config from env vars (#3070) -- Updating axios in types to be lower case (#2797) -- Adding a type guard for `AxiosError` (#2949) - -Internal and Tests: - -- Remove the skipping of the `socket` http test (#3364) -- Use different socket for Win32 test (#3375) - -Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub: - -- Daniel Lopretto -- Jason Kwok -- Jay -- Jonathan Foster -- Remco Haszing -- Xianming Zhong - -### 0.21.0 (October 23, 2020) - -Fixes and Functionality: - -- Fixing requestHeaders.Authorization ([#3287](https://github.com/axios/axios/pull/3287)) -- Fixing node types ([#3237](https://github.com/axios/axios/pull/3237)) -- Fixing axios.delete ignores config.data ([#3282](https://github.com/axios/axios/pull/3282)) -- Revert "Fixing overwrite Blob/File type as Content-Type in browser. (#1773)" ([#3289](https://github.com/axios/axios/pull/3289)) -- Fixing an issue that type 'null' and 'undefined' is not assignable to validateStatus when typescript strict option is enabled ([#3200](https://github.com/axios/axios/pull/3200)) - -Internal and Tests: - -- Lock travis to not use node v15 ([#3361](https://github.com/axios/axios/pull/3361)) - -Documentation: - -- Fixing simple typo, existant -> existent ([#3252](https://github.com/axios/axios/pull/3252)) -- Fixing typos ([#3309](https://github.com/axios/axios/pull/3309)) - -Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub: - -- Allan Cruz <57270969+Allanbcruz@users.noreply.github.com> -- George Cheng -- Jay -- Kevin Kirsche -- Remco Haszing -- Taemin Shin -- Tim Gates -- Xianming Zhong - -### 0.20.0 (August 20, 2020) - -Release of 0.20.0-pre as a full release with no other changes. - -### 0.20.0-pre (July 15, 2020) - -Fixes and Functionality: - -- Fixing response with utf-8 BOM can not parse to json ([#2419](https://github.com/axios/axios/pull/2419)) - - fix: remove byte order marker (UTF-8 BOM) when transform response - - fix: remove BOM only utf-8 - - test: utf-8 BOM - - fix: incorrect param name -- Refactor mergeConfig without utils.deepMerge ([#2844](https://github.com/axios/axios/pull/2844)) - - Adding failing test - - Fixing #2587 default custom config persisting - - Adding Concat keys and filter duplicates - - Fixed value from CPE - - update for review feedbacks - - no deepMerge - - only merge between plain objects - - fix rename - - always merge config by mergeConfig - - extract function mergeDeepProperties - - refactor mergeConfig with all keys, and add special logic for validateStatus - - add test for resetting headers - - add lots of tests and fix a bug - - should not inherit `data` - - use simple toString -- Fixing overwrite Blob/File type as Content-Type in browser. ([#1773](https://github.com/axios/axios/pull/1773)) -- Fixing an issue that type 'null' is not assignable to validateStatus ([#2773](https://github.com/axios/axios/pull/2773)) -- Fixing special char encoding ([#1671](https://github.com/axios/axios/pull/1671)) - - removing @ character from replacement list since it is a reserved character - - Updating buildURL test to not include the @ character - - Removing console logs -- Fixing password encoding with special characters in basic authentication ([#1492](https://github.com/axios/axios/pull/1492)) - - Fixing password encoding with special characters in basic authentication - - Adding test to check if password with non-Latin1 characters pass -- Fixing 'Network Error' in react native android ([#1487](https://github.com/axios/axios/pull/1487)) - There is a bug in react native Android platform when using get method. It will trigger a 'Network Error' when passing the requestData which is an empty string to request.send function. So if the requestData is an empty string we can set it to null as well to fix the bug. -- Fixing Cookie Helper with Asyc Components ([#1105](https://github.com/axios/axios/pull/1105)) ([#1107](https://github.com/axios/axios/pull/1107)) -- Fixing 'progressEvent' type ([#2851](https://github.com/axios/axios/pull/2851)) - - Fix 'progressEvent' type - - Update axios.ts -- Fixing getting local files (file://) failed ([#2470](https://github.com/axios/axios/pull/2470)) - - fix issue #2416, #2396 - - fix Eslint warn - - Modify judgment conditions - - add unit test - - update unit test - - update unit test -- Allow PURGE method in typings ([#2191](https://github.com/axios/axios/pull/2191)) -- Adding option to disable automatic decompression ([#2661](https://github.com/axios/axios/pull/2661)) - - Adding ability to disable auto decompression - - Updating decompress documentation in README - - Fixing test\unit\adapters\http.js lint errors - - Adding test for disabling auto decompression - - Removing changes that fixed lint errors in tests - - Removing formatting change to unit test -- Add independent `maxBodyLength` option ([#2781](https://github.com/axios/axios/pull/2781)) - - Add independent option to set the maximum size of the request body - - Remove maxBodyLength check - - Update README - - Assert for error code and message -- Adding responseEncoding to mergeConfig ([#1745](https://github.com/axios/axios/pull/1745)) -- Compatible with follow-redirect aborts the request ([#2689](https://github.com/axios/axios/pull/2689)) - - Compatible with follow-redirect aborts the request - - Use the error code -- Fix merging of params ([#2656](https://github.com/axios/axios/pull/2656)) - - Name function to avoid ESLint func-names warning - - Switch params config to merge list and update tests - - Restore testing of both false and null - - Restore test cases for keys without defaults - - Include test for non-object values that aren't false-y. -- Revert `finally` as `then` ([#2683](https://github.com/axios/axios/pull/2683)) - -Internal and Tests: - -- Fix stale bot config ([#3049](https://github.com/axios/axios/pull/3049)) - - fix stale bot config - - fix multiple lines -- Add days and change name to work ([#3035](https://github.com/axios/axios/pull/3035)) -- Update close-issues.yml ([#3031](https://github.com/axios/axios/pull/3031)) - - Update close-issues.yml - Update close message to read better 😄 - - Fix use of quotations - Use single quotes as per other .yml files - - Remove user name form message -- Add GitHub actions to close stale issues/prs ([#3029](https://github.com/axios/axios/pull/3029)) - - prepare stale actions - - update messages - - Add exempt labels and lighten up comments -- Add GitHub actions to close invalid issues ([#3022](https://github.com/axios/axios/pull/3022)) - - add close actions - - fix with checkout - - update issue templates - - add reminder - - update close message -- Add test with Node.js 12 ([#2860](https://github.com/axios/axios/pull/2860)) - - test with Node.js 12 - - test with latest -- Adding console log on sandbox server startup ([#2210](https://github.com/axios/axios/pull/2210)) - - Adding console log on sandbox server startup - - Update server.js - Add server error handling - - Update server.js - Better error message, remove retry. -- Adding tests for method `options` type definitions ([#1996](https://github.com/axios/axios/pull/1996)) - Update tests. -- Add test for redirecting with too large response ([#2695](https://github.com/axios/axios/pull/2695)) -- Fixing unit test failure in Windows OS ([#2601](https://github.com/axios/axios/pull/2601)) -- Fixing issue for HEAD method and gzipped response ([#2666](https://github.com/axios/axios/pull/2666)) -- Fix tests in browsers ([#2748](https://github.com/axios/axios/pull/2748)) -- chore: add `jsdelivr` and `unpkg` support ([#2443](https://github.com/axios/axios/pull/2443)) - -Documentation: - -- Adding support for URLSearchParams in node ([#1900](https://github.com/axios/axios/pull/1900)) - - Adding support for URLSearchParams in node - - Remove un-needed code - - Update utils.js - - Make changes as suggested -- Adding table of content (preview) ([#3050](https://github.com/axios/axios/pull/3050)) - - add toc (preview) - - remove toc in toc - Signed-off-by: Moni - - fix sublinks - - fix indentation - - remove redundant table links - - update caps and indent - - remove axios -- Replace 'blacklist' with 'blocklist' ([#3006](https://github.com/axios/axios/pull/3006)) -- docs(): Detailed config options environment. ([#2088](https://github.com/axios/axios/pull/2088)) - - docs(): Detailed config options environment. - - Update README.md -- Include axios-data-unpacker in ECOSYSTEM.md ([#2080](https://github.com/axios/axios/pull/2080)) -- Allow opening examples in Gitpod ([#1958](https://github.com/axios/axios/pull/1958)) -- Remove axios.all() and axios.spread() from Readme.md ([#2727](https://github.com/axios/axios/pull/2727)) - - remove axios.all(), axios.spread() - - replace example - - axios.all() -> Promise.all() - - axios.spread(function (acct, perms)) -> function (acct, perms) - - add deprecated mark -- Update README.md ([#2887](https://github.com/axios/axios/pull/2887)) - Small change to the data attribute doc of the config. A request body can also be set for DELETE methods but this wasn't mentioned in the documentation (it only mentioned POST, PUT and PATCH). Took my some 10-20 minutes until I realized that I don't need to manipulate the request body with transformRequest in the case of DELETE. -- Include swagger-taxos-codegen in ECOSYSTEM.md ([#2162](https://github.com/axios/axios/pull/2162)) -- Add CDNJS version badge in README.md ([#878](https://github.com/axios/axios/pull/878)) - This badge will show the version on CDNJS! -- Documentation update to clear up ambiguity in code examples ([#2928](https://github.com/axios/axios/pull/2928)) - - Made an adjustment to the documentation to clear up any ambiguity around the use of "fs". This should help clear up that the code examples with "fs" cannot be used on the client side. -- Update README.md about validateStatus ([#2912](https://github.com/axios/axios/pull/2912)) - Rewrote the comment from "Reject only if the status code is greater than or equal to 500" to "Resolve only if the status code is less than 500" -- Updating documentation for usage form-data ([#2805](https://github.com/axios/axios/pull/2805)) - Closes #2049 -- Fixing CHANGELOG.md issue link ([#2784](https://github.com/axios/axios/pull/2784)) -- Include axios-hooks in ECOSYSTEM.md ([#2003](https://github.com/axios/axios/pull/2003)) -- Added Response header access instructions ([#1901](https://github.com/axios/axios/pull/1901)) - - Added Response header access instructions - - Added note about using bracket notation -- Add `onUploadProgress` and `onDownloadProgress` are browser only ([#2763](https://github.com/axios/axios/pull/2763)) - Saw in #928 and #1966 that `onUploadProgress` and `onDownloadProgress` only work in the browser and was missing that from the README. -- Update ' sign to ` in proxy spec ([#2778](https://github.com/axios/axios/pull/2778)) -- Adding jsDelivr link in README ([#1110](https://github.com/axios/axios/pull/1110)) - - Adding jsDelivr link - - Add SRI - - Remove SRI - -Huge thanks to everyone who contributed to this release via code (authors listed -below) or via reviews and triaging on GitHub: - -- Alan Wang -- Alexandru Ungureanu -- Anubhav Srivastava -- Benny Neugebauer -- Cr <631807682@qq.com> -- David -- David Ko -- David Tanner -- Emily Morehouse -- Felipe Martins -- Fonger <5862369+Fonger@users.noreply.github.com> -- Frostack -- George Cheng -- grumblerchester -- Gustavo LÃŗpez -- hexaez <45806662+hexaez@users.noreply.github.com> -- huangzuizui -- Ian Wijma -- Jay -- jeffjing -- jennynju <46782518+jennynju@users.noreply.github.com> -- Jimmy Liao <52391190+jimmy-liao-gogoro@users.noreply.github.com> -- Jonathan Sharpe -- JounQin -- Justin Beckwith -- Kamil Posiadała <3dcreator.pl@gmail.com> -- Lukas Drgon -- marcinx -- Martti Laine -- Michał Zarach -- Moni -- Motonori Iwata <121048+iwata@users.noreply.github.com> -- Nikita Galkin -- Petr Mares -- Philippe Recto -- Remco Haszing -- rockcs1992 -- Ryan Bown -- Samina Fu -- Simone Busoli -- Spencer von der Ohe -- Sven Efftinge -- Taegyeoung Oh -- Taemin Shin -- Thibault Ehrhart <1208424+ehrhart@users.noreply.github.com> -- Xianming Zhong -- Yasu Flores -- Zac Delventhal - -### 0.19.2 (Jan 20, 2020) - -- Remove unnecessary XSS check ([#2679](https://github.com/axios/axios/pull/2679)) (see ([#2646](https://github.com/axios/axios/issues/2646)) for discussion) - -### 0.19.1 (Jan 7, 2020) - -Fixes and Functionality: - -- Fixing invalid agent issue ([#1904](https://github.com/axios/axios/pull/1904)) -- Fix ignore set withCredentials false ([#2582](https://github.com/axios/axios/pull/2582)) -- Delete useless default to hash ([#2458](https://github.com/axios/axios/pull/2458)) -- Fix HTTP/HTTPs agents passing to follow-redirect ([#1904](https://github.com/axios/axios/pull/1904)) -- Fix ignore set withCredentials false ([#2582](https://github.com/axios/axios/pull/2582)) -- Fix CI build failure ([#2570](https://github.com/axios/axios/pull/2570)) -- Remove dependency on is-buffer from package.json ([#1816](https://github.com/axios/axios/pull/1816)) -- Adding options typings ([#2341](https://github.com/axios/axios/pull/2341)) -- Adding Typescript HTTP method definition for LINK and UNLINK. ([#2444](https://github.com/axios/axios/pull/2444)) -- Update dist with newest changes, fixes Custom Attributes issue -- Change syntax to see if build passes ([#2488](https://github.com/axios/axios/pull/2488)) -- Update Webpack + deps, remove now unnecessary polyfills ([#2410](https://github.com/axios/axios/pull/2410)) -- Fix to prevent XSS, throw an error when the URL contains a JS script ([#2464](https://github.com/axios/axios/pull/2464)) -- Add custom timeout error copy in config ([#2275](https://github.com/axios/axios/pull/2275)) -- Add error toJSON example ([#2466](https://github.com/axios/axios/pull/2466)) -- Fixing Vulnerability A Fortify Scan finds a critical Cross-Site Scripâ€Ļ ([#2451](https://github.com/axios/axios/pull/2451)) -- Fixing subdomain handling on no_proxy ([#2442](https://github.com/axios/axios/pull/2442)) -- Make redirection from HTTP to HTTPS work ([#2426](https://github.com/axios/axios/pull/2426)) and ([#2547](https://github.com/axios/axios/pull/2547)) -- Add toJSON property to AxiosError type ([#2427](https://github.com/axios/axios/pull/2427)) -- Fixing socket hang up error on node side for slow response. ([#1752](https://github.com/axios/axios/pull/1752)) -- Alternative syntax to send data into the body ([#2317](https://github.com/axios/axios/pull/2317)) -- Fixing custom config options ([#2207](https://github.com/axios/axios/pull/2207)) -- Fixing set `config.method` after mergeConfig for Axios.prototype.request ([#2383](https://github.com/axios/axios/pull/2383)) -- Axios create url bug ([#2290](https://github.com/axios/axios/pull/2290)) -- Do not modify config.url when using a relative baseURL (resolves [#1628](https://github.com/axios/axios/issues/1098)) ([#2391](https://github.com/axios/axios/pull/2391)) -- Add typescript HTTP method definition for LINK and UNLINK ([#2444](https://github.com/axios/axios/pull/2444)) - -Internal: - -- Revert "Update Webpack + deps, remove now unnecessary polyfills" ([#2479](https://github.com/axios/axios/pull/2479)) -- Order of if/else blocks is causing unit tests mocking XHR. ([#2201](https://github.com/axios/axios/pull/2201)) -- Add license badge ([#2446](https://github.com/axios/axios/pull/2446)) -- Fix travis CI build [#2386](https://github.com/axios/axios/pull/2386) -- Fix cancellation error on build master. #2290 #2207 ([#2407](https://github.com/axios/axios/pull/2407)) - -Documentation: - -- Fixing typo in CHANGELOG.md: s/Functionallity/Functionality ([#2639](https://github.com/axios/axios/pull/2639)) -- Fix badge, use master branch ([#2538](https://github.com/axios/axios/pull/2538)) -- Fix typo in changelog [#2193](https://github.com/axios/axios/pull/2193) -- Document fix ([#2514](https://github.com/axios/axios/pull/2514)) -- Update docs with no_proxy change, issue #2484 ([#2513](https://github.com/axios/axios/pull/2513)) -- Fixing missing words in docs template ([#2259](https://github.com/axios/axios/pull/2259)) -- 🐛Fix request finally documentation in README ([#2189](https://github.com/axios/axios/pull/2189)) -- updating spelling and adding link to docs ([#2212](https://github.com/axios/axios/pull/2212)) -- docs: minor tweak ([#2404](https://github.com/axios/axios/pull/2404)) -- Update response interceptor docs ([#2399](https://github.com/axios/axios/pull/2399)) -- Update README.md ([#2504](https://github.com/axios/axios/pull/2504)) -- Fix word 'sintaxe' to 'syntax' in README.md ([#2432](https://github.com/axios/axios/pull/2432)) -- updating README: notes on CommonJS autocomplete ([#2256](https://github.com/axios/axios/pull/2256)) -- Fix grammar in README.md ([#2271](https://github.com/axios/axios/pull/2271)) -- Doc fixes, minor examples cleanup ([#2198](https://github.com/axios/axios/pull/2198)) - -### 0.19.0 (May 30, 2019) - -Fixes and Functionality: - -- Added support for no_proxy env variable ([#1693](https://github.com/axios/axios/pull/1693/files)) - Chance Dickson -- Unzip response body only for statuses != 204 ([#1129](https://github.com/axios/axios/pull/1129)) - drawski -- Destroy stream on exceeding maxContentLength (fixes [#1098](https://github.com/axios/axios/issues/1098)) ([#1485](https://github.com/axios/axios/pull/1485)) - Gadzhi Gadzhiev -- Makes Axios error generic to use AxiosResponse ([#1738](https://github.com/axios/axios/pull/1738)) - Suman Lama -- Fixing Mocha tests by locking follow-redirects version to 1.5.10 ([#1993](https://github.com/axios/axios/pull/1993)) - grumblerchester -- Allow uppercase methods in typings. ([#1781](https://github.com/axios/axios/pull/1781)) - Ken Powers -- Fixing building url with hash mark ([#1771](https://github.com/axios/axios/pull/1771)) - Anatoly Ryabov -- This commit fix building url with hash map (fragment identifier) when parameters are present: they must not be added after `#`, because client cut everything after `#` -- Preserve HTTP method when following redirect ([#1758](https://github.com/axios/axios/pull/1758)) - Rikki Gibson -- Add `getUri` signature to TypeScript definition. ([#1736](https://github.com/axios/axios/pull/1736)) - Alexander Trauzzi -- Adding isAxiosError flag to errors thrown by axios ([#1419](https://github.com/axios/axios/pull/1419)) - Ayush Gupta - -Internal: - -- Fixing .eslintrc without extension ([#1789](https://github.com/axios/axios/pull/1789)) - Manoel -- Fix failing SauceLabs tests by updating configuration - Emily Morehouse -- Add issue templates - Emily Morehouse - -Documentation: - -- Consistent coding style in README ([#1787](https://github.com/axios/axios/pull/1787)) - Ali Servet Donmez -- Add information about auth parameter to README ([#2166](https://github.com/axios/axios/pull/2166)) - xlaguna -- Add DELETE to list of methods that allow data as a config option ([#2169](https://github.com/axios/axios/pull/2169)) - Daniela Borges Matos de Carvalho -- Update ECOSYSTEM.md - Add Axios Endpoints ([#2176](https://github.com/axios/axios/pull/2176)) - Renan -- Add r2curl in ECOSYSTEM ([#2141](https://github.com/axios/axios/pull/2141)) - ėœ ėšŠėš° / CX -- Update README.md - Add instructions for installing with yarn ([#2036](https://github.com/axios/axios/pull/2036)) - Victor Hermes -- Fixing spacing for README.md ([#2066](https://github.com/axios/axios/pull/2066)) - Josh McCarty -- Update README.md. - Change `.then` to `.finally` in example code ([#2090](https://github.com/axios/axios/pull/2090)) - Omar Cai -- Clarify what values responseType can have in Node ([#2121](https://github.com/axios/axios/pull/2121)) - Tyler Breisacher -- docs(ECOSYSTEM): add axios-api-versioning ([#2020](https://github.com/axios/axios/pull/2020)) - Weffe -- It seems that `responseType: 'blob'` doesn't actually work in Node (when I tried using it, response.data was a string, not a Blob, since Node doesn't have Blobs), so this clarifies that this option should only be used in the browser -- Update README.md. - Add Querystring library note ([#1896](https://github.com/axios/axios/pull/1896)) - Dmitriy Eroshenko -- Add react-hooks-axios to Libraries section of ECOSYSTEM.md ([#1925](https://github.com/axios/axios/pull/1925)) - Cody Chan -- Clarify in README that default timeout is 0 (no timeout) ([#1750](https://github.com/axios/axios/pull/1750)) - Ben Standefer - -### 0.19.0-beta.1 (Aug 9, 2018) - -**NOTE:** This is a beta version of this release. There may be functionality that is broken in -certain browsers, though we suspect that builds are hanging and not erroring. See -https://saucelabs.com/u/axios for the most up-to-date information. - -New Functionality: - -- Add getUri method ([#1712](https://github.com/axios/axios/issues/1712)) -- Add support for no_proxy env variable ([#1693](https://github.com/axios/axios/issues/1693)) -- Add toJSON to decorated Axios errors to facilitate serialization ([#1625](https://github.com/axios/axios/issues/1625)) -- Add second then on axios call ([#1623](https://github.com/axios/axios/issues/1623)) -- Typings: allow custom return types -- Add option to specify character set in responses (with http adapter) - -Fixes: - -- Fix Keep defaults local to instance ([#385](https://github.com/axios/axios/issues/385)) -- Correctly catch exception in http test ([#1475](https://github.com/axios/axios/issues/1475)) -- Fix accept header normalization ([#1698](https://github.com/axios/axios/issues/1698)) -- Fix http adapter to allow HTTPS connections via HTTP ([#959](https://github.com/axios/axios/issues/959)) -- Fix Removes usage of deprecated Buffer constructor. ([#1555](https://github.com/axios/axios/issues/1555), [#1622](https://github.com/axios/axios/issues/1622)) -- Fix defaults to use httpAdapter if available ([#1285](https://github.com/axios/axios/issues/1285)) - - Fixing defaults to use httpAdapter if available - - Use a safer, cross-platform method to detect the Node environment -- Fix Reject promise if request is cancelled by the browser ([#537](https://github.com/axios/axios/issues/537)) -- [Typescript] Fix missing type parameters on delete/head methods -- [NS]: Send `false` flag isStandardBrowserEnv for Nativescript -- Fix missing type parameters on delete/head -- Fix Default method for an instance always overwritten by get -- Fix type error when socketPath option in AxiosRequestConfig -- Capture errors on request data streams -- Decorate resolve and reject to clear timeout in all cases - -Huge thanks to everyone who contributed to this release via code (authors listed -below) or via reviews and triaging on GitHub: - -- Andrew Scott -- Anthony Gauthier -- arpit -- ascott18 -- Benedikt RÃļtsch -- Chance Dickson -- Dave Stewart -- Deric Cain -- Guillaume Briday -- Jacob Wejendorp -- Jim Lynch -- johntron -- Justin Beckwith -- Justin Beckwith -- Khaled Garbaya -- Lim Jing Rong -- Mark van den Broek -- Martti Laine -- mattridley -- mattridley -- Nicolas Del Valle -- Nilegfx -- pbarbiero -- Rikki Gibson -- Sako Hartounian -- Shane Fitzpatrick -- Stephan Schneider -- Steven -- Tim Garthwaite -- Tim Johns -- Yutaro Miyazaki - -### 0.18.0 (Feb 19, 2018) - -- Adding support for UNIX Sockets when running with Node.js ([#1070](https://github.com/axios/axios/pull/1070)) -- Fixing typings ([#1177](https://github.com/axios/axios/pull/1177)): - - AxiosRequestConfig.proxy: allows type false - - AxiosProxyConfig: added auth field -- Adding function signature in AxiosInstance interface so AxiosInstance can be invoked ([#1192](https://github.com/axios/axios/pull/1192), [#1254](https://github.com/axios/axios/pull/1254)) -- Allowing maxContentLength to pass through to redirected calls as maxBodyLength in follow-redirects config ([#1287](https://github.com/axios/axios/pull/1287)) -- Fixing configuration when using an instance - method can now be set ([#1342](https://github.com/axios/axios/pull/1342)) - -### 0.17.1 (Nov 11, 2017) - -- Fixing issue with web workers ([#1160](https://github.com/axios/axios/pull/1160)) -- Allowing overriding transport ([#1080](https://github.com/axios/axios/pull/1080)) -- Updating TypeScript typings ([#1165](https://github.com/axios/axios/pull/1165), [#1125](https://github.com/axios/axios/pull/1125), [#1131](https://github.com/axios/axios/pull/1131)) - -### 0.17.0 (Oct 21, 2017) - -- **BREAKING** Fixing issue with `baseURL` and interceptors ([#950](https://github.com/axios/axios/pull/950)) -- **BREAKING** Improving handing of duplicate headers ([#874](https://github.com/axios/axios/pull/874)) -- Adding support for disabling proxies ([#691](https://github.com/axios/axios/pull/691)) -- Updating TypeScript typings with generic type parameters ([#1061](https://github.com/axios/axios/pull/1061)) - -### 0.16.2 (Jun 3, 2017) - -- Fixing issue with including `buffer` in bundle ([#887](https://github.com/axios/axios/pull/887)) -- Including underlying request in errors ([#830](https://github.com/axios/axios/pull/830)) -- Convert `method` to lowercase ([#930](https://github.com/axios/axios/pull/930)) - -### 0.16.1 (Apr 8, 2017) - -- Improving HTTP adapter to return last request in case of redirects ([#828](https://github.com/axios/axios/pull/828)) -- Updating `follow-redirects` dependency ([#829](https://github.com/axios/axios/pull/829)) -- Adding support for passing `Buffer` in node ([#773](https://github.com/axios/axios/pull/773)) - -### 0.16.0 (Mar 31, 2017) - -- **BREAKING** Removing `Promise` from axios typings in favor of built-in type declarations ([#480](https://github.com/axios/axios/issues/480)) -- Adding `options` shortcut method ([#461](https://github.com/axios/axios/pull/461)) -- Fixing issue with using `responseType: 'json'` in browsers incompatible with XHR Level 2 ([#654](https://github.com/axios/axios/pull/654)) -- Improving React Native detection ([#731](https://github.com/axios/axios/pull/731)) -- Fixing `combineURLs` to support empty `relativeURL` ([#581](https://github.com/axios/axios/pull/581)) -- Removing `PROTECTION_PREFIX` support ([#561](https://github.com/axios/axios/pull/561)) - -### 0.15.3 (Nov 27, 2016) - -- Fixing issue with custom instances and global defaults ([#443](https://github.com/axios/axios/issues/443)) -- Renaming `axios.d.ts` to `index.d.ts` ([#519](https://github.com/axios/axios/issues/519)) -- Adding `get`, `head`, and `delete` to `defaults.headers` ([#509](https://github.com/axios/axios/issues/509)) -- Fixing issue with `btoa` and IE ([#507](https://github.com/axios/axios/issues/507)) -- Adding support for proxy authentication ([#483](https://github.com/axios/axios/pull/483)) -- Improving HTTP adapter to use `http` protocol by default ([#493](https://github.com/axios/axios/pull/493)) -- Fixing proxy issues ([#491](https://github.com/axios/axios/pull/491)) - -### 0.15.2 (Oct 17, 2016) - -- Fixing issue with calling `cancel` after response has been received ([#482](https://github.com/axios/axios/issues/482)) - -### 0.15.1 (Oct 14, 2016) - -- Fixing issue with UMD ([#485](https://github.com/axios/axios/issues/485)) - -### 0.15.0 (Oct 10, 2016) - -- Adding cancellation support ([#452](https://github.com/axios/axios/pull/452)) -- Moving default adapter to global defaults ([#437](https://github.com/axios/axios/pull/437)) -- Fixing issue with `file` URI scheme ([#440](https://github.com/axios/axios/pull/440)) -- Fixing issue with `params` objects that have no prototype ([#445](https://github.com/axios/axios/pull/445)) - -### 0.14.0 (Aug 27, 2016) - -- **BREAKING** Updating TypeScript definitions ([#419](https://github.com/axios/axios/pull/419)) -- **BREAKING** Replacing `agent` option with `httpAgent` and `httpsAgent` ([#387](https://github.com/axios/axios/pull/387)) -- **BREAKING** Splitting `progress` event handlers into `onUploadProgress` and `onDownloadProgress` ([#423](https://github.com/axios/axios/pull/423)) -- Adding support for `http_proxy` and `https_proxy` environment variables ([#366](https://github.com/axios/axios/pull/366)) -- Fixing issue with `auth` config option and `Authorization` header ([#397](https://github.com/axios/axios/pull/397)) -- Don't set XSRF header if `xsrfCookieName` is `null` ([#406](https://github.com/axios/axios/pull/406)) - -### 0.13.1 (Jul 16, 2016) - -- Fixing issue with response data not being transformed on error ([#378](https://github.com/axios/axios/issues/378)) - -### 0.13.0 (Jul 13, 2016) - -- **BREAKING** Improved error handling ([#345](https://github.com/axios/axios/pull/345)) -- **BREAKING** Response transformer now invoked in dispatcher not adapter ([10eb238](https://github.com/axios/axios/commit/10eb23865101f9347570552c04e9d6211376e25e)) -- **BREAKING** Request adapters now return a `Promise` ([157efd5](https://github.com/axios/axios/commit/157efd5615890301824e3121cc6c9d2f9b21f94a)) -- Fixing issue with `withCredentials` not being overwritten ([#343](https://github.com/axios/axios/issues/343)) -- Fixing regression with request transformer being called before request interceptor ([#352](https://github.com/axios/axios/issues/352)) -- Fixing custom instance defaults ([#341](https://github.com/axios/axios/issues/341)) -- Fixing instances created from `axios.create` to have same API as default axios ([#217](https://github.com/axios/axios/issues/217)) - -### 0.12.0 (May 31, 2016) - -- Adding support for `URLSearchParams` ([#317](https://github.com/axios/axios/pull/317)) -- Adding `maxRedirects` option ([#307](https://github.com/axios/axios/pull/307)) - -### 0.11.1 (May 17, 2016) - -- Fixing IE CORS support ([#313](https://github.com/axios/axios/pull/313)) -- Fixing detection of `FormData` ([#325](https://github.com/axios/axios/pull/325)) -- Adding `Axios` class to exports ([#321](https://github.com/axios/axios/pull/321)) - -### 0.11.0 (Apr 26, 2016) - -- Adding support for Stream with HTTP adapter ([#296](https://github.com/axios/axios/pull/296)) -- Adding support for custom HTTP status code error ranges ([#308](https://github.com/axios/axios/pull/308)) -- Fixing issue with ArrayBuffer ([#299](https://github.com/axios/axios/pull/299)) - -### 0.10.0 (Apr 20, 2016) - -- Fixing issue with some requests sending `undefined` instead of `null` ([#250](https://github.com/axios/axios/pull/250)) -- Fixing basic auth for HTTP adapter ([#252](https://github.com/axios/axios/pull/252)) -- Fixing request timeout for XHR adapter ([#227](https://github.com/axios/axios/pull/227)) -- Fixing IE8 support by using `onreadystatechange` instead of `onload` ([#249](https://github.com/axios/axios/pull/249)) -- Fixing IE9 cross domain requests ([#251](https://github.com/axios/axios/pull/251)) -- Adding `maxContentLength` option ([#275](https://github.com/axios/axios/pull/275)) -- Fixing XHR support for WebWorker environment ([#279](https://github.com/axios/axios/pull/279)) -- Adding request instance to response ([#200](https://github.com/axios/axios/pull/200)) - -### 0.9.1 (Jan 24, 2016) - -- Improving handling of request timeout in node ([#124](https://github.com/axios/axios/issues/124)) -- Fixing network errors not rejecting ([#205](https://github.com/axios/axios/pull/205)) -- Fixing issue with IE rejecting on HTTP 204 ([#201](https://github.com/axios/axios/issues/201)) -- Fixing host/port when following redirects ([#198](https://github.com/axios/axios/pull/198)) - -### 0.9.0 (Jan 18, 2016) - -- Adding support for custom adapters -- Fixing Content-Type header being removed when data is false ([#195](https://github.com/axios/axios/pull/195)) -- Improving XDomainRequest implementation ([#185](https://github.com/axios/axios/pull/185)) -- Improving config merging and order of precedence ([#183](https://github.com/axios/axios/pull/183)) -- Fixing XDomainRequest support for only <= IE9 ([#182](https://github.com/axios/axios/pull/182)) - -### 0.8.1 (Dec 14, 2015) - -- Adding support for passing XSRF token for cross domain requests when using `withCredentials` ([#168](https://github.com/axios/axios/pull/168)) -- Fixing error with format of basic auth header ([#178](https://github.com/axios/axios/pull/173)) -- Fixing error with JSON payloads throwing `InvalidStateError` in some cases ([#174](https://github.com/axios/axios/pull/174)) - -### 0.8.0 (Dec 11, 2015) - -- Adding support for creating instances of axios ([#123](https://github.com/axios/axios/pull/123)) -- Fixing http adapter to use `Buffer` instead of `String` in case of `responseType === 'arraybuffer'` ([#128](https://github.com/axios/axios/pull/128)) -- Adding support for using custom parameter serializer with `paramsSerializer` option ([#121](https://github.com/axios/axios/pull/121)) -- Fixing issue in IE8 caused by `forEach` on `arguments` ([#127](https://github.com/axios/axios/pull/127)) -- Adding support for following redirects in node ([#146](https://github.com/axios/axios/pull/146)) -- Adding support for transparent decompression if `content-encoding` is set ([#149](https://github.com/axios/axios/pull/149)) -- Adding support for transparent XDomainRequest to handle cross domain requests in IE9 ([#140](https://github.com/axios/axios/pull/140)) -- Adding support for HTTP basic auth via Authorization header ([#167](https://github.com/axios/axios/pull/167)) -- Adding support for baseURL option ([#160](https://github.com/axios/axios/pull/160)) - -### 0.7.0 (Sep 29, 2015) - -- Fixing issue with minified bundle in IE8 ([#87](https://github.com/axios/axios/pull/87)) -- Adding support for passing agent in node ([#102](https://github.com/axios/axios/pull/102)) -- Adding support for returning result from `axios.spread` for chaining ([#106](https://github.com/axios/axios/pull/106)) -- Fixing typescript definition ([#105](https://github.com/axios/axios/pull/105)) -- Fixing default timeout config for node ([#112](https://github.com/axios/axios/pull/112)) -- Adding support for use in web workers, and react-native ([#70](https://github.com/axios/axios/issue/70)), ([#98](https://github.com/axios/axios/pull/98)) -- Adding support for fetch like API `axios(url[, config])` ([#116](https://github.com/axios/axios/issues/116)) - -### 0.6.0 (Sep 21, 2015) - -- Removing deprecated success/error aliases -- Fixing issue with array params not being properly encoded ([#49](https://github.com/axios/axios/pull/49)) -- Fixing issue with User-Agent getting overridden ([#69](https://github.com/axios/axios/issues/69)) -- Adding support for timeout config ([#56](https://github.com/axios/axios/issues/56)) -- Removing es6-promise dependency -- Fixing issue preventing `length` to be used as a parameter ([#91](https://github.com/axios/axios/pull/91)) -- Fixing issue with IE8 ([#85](https://github.com/axios/axios/pull/85)) -- Converting build to UMD - -### 0.5.4 (Apr 08, 2015) - -- Fixing issue with FormData not being sent ([#53](https://github.com/axios/axios/issues/53)) - -### 0.5.3 (Apr 07, 2015) - -- Using JSON.parse unconditionally when transforming response string ([#55](https://github.com/axios/axios/issues/55)) - -### 0.5.2 (Mar 13, 2015) - -- Adding support for `statusText` in response ([#46](https://github.com/axios/axios/issues/46)) - -### 0.5.1 (Mar 10, 2015) - -- Fixing issue using strict mode ([#45](https://github.com/axios/axios/issues/45)) -- Fixing issue with standalone build ([#47](https://github.com/axios/axios/issues/47)) - -### 0.5.0 (Jan 23, 2015) - -- Adding support for intercepetors ([#14](https://github.com/axios/axios/issues/14)) -- Updating es6-promise dependency - -### 0.4.2 (Dec 10, 2014) - -- Fixing issue with `Content-Type` when using `FormData` ([#22](https://github.com/axios/axios/issues/22)) -- Adding support for TypeScript ([#25](https://github.com/axios/axios/issues/25)) -- Fixing issue with standalone build ([#29](https://github.com/axios/axios/issues/29)) -- Fixing issue with verbs needing to be capitalized in some browsers ([#30](https://github.com/axios/axios/issues/30)) - -### 0.4.1 (Oct 15, 2014) - -- Adding error handling to request for node.js ([#18](https://github.com/axios/axios/issues/18)) - -### 0.4.0 (Oct 03, 2014) - -- Adding support for `ArrayBuffer` and `ArrayBufferView` ([#10](https://github.com/axios/axios/issues/10)) -- Adding support for utf-8 for node.js ([#13](https://github.com/axios/axios/issues/13)) -- Adding support for SSL for node.js ([#12](https://github.com/axios/axios/issues/12)) -- Fixing incorrect `Content-Type` header ([#9](https://github.com/axios/axios/issues/9)) -- Adding standalone build without bundled es6-promise ([#11](https://github.com/axios/axios/issues/11)) -- Deprecating `success`/`error` in favor of `then`/`catch` - -### 0.3.1 (Sep 16, 2014) - -- Fixing missing post body when using node.js ([#3](https://github.com/axios/axios/issues/3)) - -### 0.3.0 (Sep 16, 2014) - -- Fixing `success` and `error` to properly receive response data as individual arguments ([#8](https://github.com/axios/axios/issues/8)) -- Updating `then` and `catch` to receive response data as a single object ([#6](https://github.com/axios/axios/issues/6)) -- Fixing issue with `all` not working ([#7](https://github.com/axios/axios/issues/7)) - -### 0.2.2 (Sep 14, 2014) - -- Fixing bundling with browserify ([#4](https://github.com/axios/axios/issues/4)) - -### 0.2.1 (Sep 12, 2014) - -- Fixing build problem causing ridiculous file sizes - -### 0.2.0 (Sep 12, 2014) - -- Adding support for `all` and `spread` -- Adding support for node.js ([#1](https://github.com/axios/axios/issues/1)) - -### 0.1.0 (Aug 29, 2014) - -- Initial release diff --git a/node_modules/axios/LICENSE b/node_modules/axios/LICENSE deleted file mode 100644 index d36c80e..0000000 --- a/node_modules/axios/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2014-present Matt Zabriskie - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/axios/README.md b/node_modules/axios/README.md deleted file mode 100755 index 44264f6..0000000 --- a/node_modules/axios/README.md +++ /dev/null @@ -1,800 +0,0 @@ -# axios - -[![npm version](https://img.shields.io/npm/v/axios.svg?style=flat-square)](https://www.npmjs.org/package/axios) -[![CDNJS](https://img.shields.io/cdnjs/v/axios.svg?style=flat-square)](https://cdnjs.com/libraries/axios) -[![build status](https://img.shields.io/travis/axios/axios/master.svg?style=flat-square)](https://travis-ci.org/axios/axios) -[![code coverage](https://img.shields.io/coveralls/mzabriskie/axios.svg?style=flat-square)](https://coveralls.io/r/mzabriskie/axios) -[![install size](https://packagephobia.now.sh/badge?p=axios)](https://packagephobia.now.sh/result?p=axios) -[![npm downloads](https://img.shields.io/npm/dm/axios.svg?style=flat-square)](http://npm-stat.com/charts.html?package=axios) -[![gitter chat](https://img.shields.io/gitter/room/mzabriskie/axios.svg?style=flat-square)](https://gitter.im/mzabriskie/axios) -[![code helpers](https://www.codetriage.com/axios/axios/badges/users.svg)](https://www.codetriage.com/axios/axios) - -Promise based HTTP client for the browser and node.js -## Table of Contents - - - [Features](#features) - - [Browser Support](#browser-support) - - [Installing](#installing) - - [Example](#example) - - [Axios API](#axios-api) - - [Request method aliases](#request-method-aliases) - - [Concurrency (Deprecated)](#concurrency-deprecated) - - [Creating an instance](#creating-an-instance) - - [Instance methods](#instance-methods) - - [Request Config](#request-config) - - [Response Schema](#response-schema) - - [Config Defaults](#config-defaults) - - [Global axios defaults](#global-axios-defaults) - - [Custom instance defaults](#custom-instance-defaults) - - [Config order of precedence](#config-order-of-precedence) - - [Interceptors](#interceptors) - - [Handling Errors](#handling-errors) - - [Cancellation](#cancellation) - - [Using application/x-www-form-urlencoded format](#using-applicationx-www-form-urlencoded-format) - - [Browser](#browser) - - [Node.js](#nodejs) - - [Query string](#query-string) - - [Form data](#form-data) - - [Semver](#semver) - - [Promises](#promises) - - [TypeScript](#typescript) - - [Resources](#resources) - - [Credits](#credits) - - [License](#license) - -## Features - -- Make [XMLHttpRequests](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) from the browser -- Make [http](http://nodejs.org/api/http.html) requests from node.js -- Supports the [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) API -- Intercept request and response -- Transform request and response data -- Cancel requests -- Automatic transforms for JSON data -- Client side support for protecting against [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery) - -## Browser Support - -![Chrome](https://raw.github.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png) | ![Firefox](https://raw.github.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png) | ![Safari](https://raw.github.com/alrra/browser-logos/master/src/safari/safari_48x48.png) | ![Opera](https://raw.github.com/alrra/browser-logos/master/src/opera/opera_48x48.png) | ![Edge](https://raw.github.com/alrra/browser-logos/master/src/edge/edge_48x48.png) | ![IE](https://raw.github.com/alrra/browser-logos/master/src/archive/internet-explorer_9-11/internet-explorer_9-11_48x48.png) | ---- | --- | --- | --- | --- | --- | -Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | 11 ✔ | - -[![Browser Matrix](https://saucelabs.com/open_sauce/build_matrix/axios.svg)](https://saucelabs.com/u/axios) - -## Installing - -Using npm: - -```bash -$ npm install axios -``` - -Using bower: - -```bash -$ bower install axios -``` - -Using yarn: - -```bash -$ yarn add axios -``` - -Using jsDelivr CDN: - -```html - -``` - -Using unpkg CDN: - -```html - -``` - -## Example - -### note: CommonJS usage -In order to gain the TypeScript typings (for intellisense / autocomplete) while using CommonJS imports with `require()` use the following approach: - -```js -const axios = require('axios').default; - -// axios. will now provide autocomplete and parameter typings -``` - -Performing a `GET` request - -```js -const axios = require('axios'); - -// Make a request for a user with a given ID -axios.get('/user?ID=12345') - .then(function (response) { - // handle success - console.log(response); - }) - .catch(function (error) { - // handle error - console.log(error); - }) - .then(function () { - // always executed - }); - -// Optionally the request above could also be done as -axios.get('/user', { - params: { - ID: 12345 - } - }) - .then(function (response) { - console.log(response); - }) - .catch(function (error) { - console.log(error); - }) - .then(function () { - // always executed - }); - -// Want to use async/await? Add the `async` keyword to your outer function/method. -async function getUser() { - try { - const response = await axios.get('/user?ID=12345'); - console.log(response); - } catch (error) { - console.error(error); - } -} -``` - -> **NOTE:** `async/await` is part of ECMAScript 2017 and is not supported in Internet -> Explorer and older browsers, so use with caution. - -Performing a `POST` request - -```js -axios.post('/user', { - firstName: 'Fred', - lastName: 'Flintstone' - }) - .then(function (response) { - console.log(response); - }) - .catch(function (error) { - console.log(error); - }); -``` - -Performing multiple concurrent requests - -```js -function getUserAccount() { - return axios.get('/user/12345'); -} - -function getUserPermissions() { - return axios.get('/user/12345/permissions'); -} - -Promise.all([getUserAccount(), getUserPermissions()]) - .then(function (results) { - const acct = results[0]; - const perm = results[1]; - }); -``` - -## axios API - -Requests can be made by passing the relevant config to `axios`. - -##### axios(config) - -```js -// Send a POST request -axios({ - method: 'post', - url: '/user/12345', - data: { - firstName: 'Fred', - lastName: 'Flintstone' - } -}); -``` - -```js -// GET request for remote image in node.js -axios({ - method: 'get', - url: 'http://bit.ly/2mTM3nY', - responseType: 'stream' -}) - .then(function (response) { - response.data.pipe(fs.createWriteStream('ada_lovelace.jpg')) - }); -``` - -##### axios(url[, config]) - -```js -// Send a GET request (default method) -axios('/user/12345'); -``` - -### Request method aliases - -For convenience aliases have been provided for all supported request methods. - -##### axios.request(config) -##### axios.get(url[, config]) -##### axios.delete(url[, config]) -##### axios.head(url[, config]) -##### axios.options(url[, config]) -##### axios.post(url[, data[, config]]) -##### axios.put(url[, data[, config]]) -##### axios.patch(url[, data[, config]]) - -###### NOTE -When using the alias methods `url`, `method`, and `data` properties don't need to be specified in config. - -### Concurrency (Deprecated) -Please use `Promise.all` to replace the below functions. - -Helper functions for dealing with concurrent requests. - -axios.all(iterable) -axios.spread(callback) - -### Creating an instance - -You can create a new instance of axios with a custom config. - -##### axios.create([config]) - -```js -const instance = axios.create({ - baseURL: 'https://some-domain.com/api/', - timeout: 1000, - headers: {'X-Custom-Header': 'foobar'} -}); -``` - -### Instance methods - -The available instance methods are listed below. The specified config will be merged with the instance config. - -##### axios#request(config) -##### axios#get(url[, config]) -##### axios#delete(url[, config]) -##### axios#head(url[, config]) -##### axios#options(url[, config]) -##### axios#post(url[, data[, config]]) -##### axios#put(url[, data[, config]]) -##### axios#patch(url[, data[, config]]) -##### axios#getUri([config]) - -## Request Config - -These are the available config options for making requests. Only the `url` is required. Requests will default to `GET` if `method` is not specified. - -```js -{ - // `url` is the server URL that will be used for the request - url: '/user', - - // `method` is the request method to be used when making the request - method: 'get', // default - - // `baseURL` will be prepended to `url` unless `url` is absolute. - // It can be convenient to set `baseURL` for an instance of axios to pass relative URLs - // to methods of that instance. - baseURL: 'https://some-domain.com/api/', - - // `transformRequest` allows changes to the request data before it is sent to the server - // This is only applicable for request methods 'PUT', 'POST', 'PATCH' and 'DELETE' - // The last function in the array must return a string or an instance of Buffer, ArrayBuffer, - // FormData or Stream - // You may modify the headers object. - transformRequest: [function (data, headers) { - // Do whatever you want to transform the data - - return data; - }], - - // `transformResponse` allows changes to the response data to be made before - // it is passed to then/catch - transformResponse: [function (data) { - // Do whatever you want to transform the data - - return data; - }], - - // `headers` are custom headers to be sent - headers: {'X-Requested-With': 'XMLHttpRequest'}, - - // `params` are the URL parameters to be sent with the request - // Must be a plain object or a URLSearchParams object - params: { - ID: 12345 - }, - - // `paramsSerializer` is an optional function in charge of serializing `params` - // (e.g. https://www.npmjs.com/package/qs, http://api.jquery.com/jquery.param/) - paramsSerializer: function (params) { - return Qs.stringify(params, {arrayFormat: 'brackets'}) - }, - - // `data` is the data to be sent as the request body - // Only applicable for request methods 'PUT', 'POST', 'DELETE , and 'PATCH' - // When no `transformRequest` is set, must be of one of the following types: - // - string, plain object, ArrayBuffer, ArrayBufferView, URLSearchParams - // - Browser only: FormData, File, Blob - // - Node only: Stream, Buffer - data: { - firstName: 'Fred' - }, - - // syntax alternative to send data into the body - // method post - // only the value is sent, not the key - data: 'Country=Brasil&City=Belo Horizonte', - - // `timeout` specifies the number of milliseconds before the request times out. - // If the request takes longer than `timeout`, the request will be aborted. - timeout: 1000, // default is `0` (no timeout) - - // `withCredentials` indicates whether or not cross-site Access-Control requests - // should be made using credentials - withCredentials: false, // default - - // `adapter` allows custom handling of requests which makes testing easier. - // Return a promise and supply a valid response (see lib/adapters/README.md). - adapter: function (config) { - /* ... */ - }, - - // `auth` indicates that HTTP Basic auth should be used, and supplies credentials. - // This will set an `Authorization` header, overwriting any existing - // `Authorization` custom headers you have set using `headers`. - // Please note that only HTTP Basic auth is configurable through this parameter. - // For Bearer tokens and such, use `Authorization` custom headers instead. - auth: { - username: 'janedoe', - password: 's00pers3cret' - }, - - // `responseType` indicates the type of data that the server will respond with - // options are: 'arraybuffer', 'document', 'json', 'text', 'stream' - // browser only: 'blob' - responseType: 'json', // default - - // `responseEncoding` indicates encoding to use for decoding responses (Node.js only) - // Note: Ignored for `responseType` of 'stream' or client-side requests - responseEncoding: 'utf8', // default - - // `xsrfCookieName` is the name of the cookie to use as a value for xsrf token - xsrfCookieName: 'XSRF-TOKEN', // default - - // `xsrfHeaderName` is the name of the http header that carries the xsrf token value - xsrfHeaderName: 'X-XSRF-TOKEN', // default - - // `onUploadProgress` allows handling of progress events for uploads - // browser only - onUploadProgress: function (progressEvent) { - // Do whatever you want with the native progress event - }, - - // `onDownloadProgress` allows handling of progress events for downloads - // browser only - onDownloadProgress: function (progressEvent) { - // Do whatever you want with the native progress event - }, - - // `maxContentLength` defines the max size of the http response content in bytes allowed in node.js - maxContentLength: 2000, - - // `maxBodyLength` (Node only option) defines the max size of the http request content in bytes allowed - maxBodyLength: 2000, - - // `validateStatus` defines whether to resolve or reject the promise for a given - // HTTP response status code. If `validateStatus` returns `true` (or is set to `null` - // or `undefined`), the promise will be resolved; otherwise, the promise will be - // rejected. - validateStatus: function (status) { - return status >= 200 && status < 300; // default - }, - - // `maxRedirects` defines the maximum number of redirects to follow in node.js. - // If set to 0, no redirects will be followed. - maxRedirects: 5, // default - - // `socketPath` defines a UNIX Socket to be used in node.js. - // e.g. '/var/run/docker.sock' to send requests to the docker daemon. - // Only either `socketPath` or `proxy` can be specified. - // If both are specified, `socketPath` is used. - socketPath: null, // default - - // `httpAgent` and `httpsAgent` define a custom agent to be used when performing http - // and https requests, respectively, in node.js. This allows options to be added like - // `keepAlive` that are not enabled by default. - httpAgent: new http.Agent({ keepAlive: true }), - httpsAgent: new https.Agent({ keepAlive: true }), - - // `proxy` defines the hostname, port, and protocol of the proxy server. - // You can also define your proxy using the conventional `http_proxy` and - // `https_proxy` environment variables. If you are using environment variables - // for your proxy configuration, you can also define a `no_proxy` environment - // variable as a comma-separated list of domains that should not be proxied. - // Use `false` to disable proxies, ignoring environment variables. - // `auth` indicates that HTTP Basic auth should be used to connect to the proxy, and - // supplies credentials. - // This will set an `Proxy-Authorization` header, overwriting any existing - // `Proxy-Authorization` custom headers you have set using `headers`. - // If the proxy server uses HTTPS, then you must set the protocol to `https`. - proxy: { - protocol: 'https', - host: '127.0.0.1', - port: 9000, - auth: { - username: 'mikeymike', - password: 'rapunz3l' - } - }, - - // `cancelToken` specifies a cancel token that can be used to cancel the request - // (see Cancellation section below for details) - cancelToken: new CancelToken(function (cancel) { - }), - - // `decompress` indicates whether or not the response body should be decompressed - // automatically. If set to `true` will also remove the 'content-encoding' header - // from the responses objects of all decompressed responses - // - Node only (XHR cannot turn off decompression) - decompress: true // default - -} -``` - -## Response Schema - -The response for a request contains the following information. - -```js -{ - // `data` is the response that was provided by the server - data: {}, - - // `status` is the HTTP status code from the server response - status: 200, - - // `statusText` is the HTTP status message from the server response - statusText: 'OK', - - // `headers` the HTTP headers that the server responded with - // All header names are lower cased and can be accessed using the bracket notation. - // Example: `response.headers['content-type']` - headers: {}, - - // `config` is the config that was provided to `axios` for the request - config: {}, - - // `request` is the request that generated this response - // It is the last ClientRequest instance in node.js (in redirects) - // and an XMLHttpRequest instance in the browser - request: {} -} -``` - -When using `then`, you will receive the response as follows: - -```js -axios.get('/user/12345') - .then(function (response) { - console.log(response.data); - console.log(response.status); - console.log(response.statusText); - console.log(response.headers); - console.log(response.config); - }); -``` - -When using `catch`, or passing a [rejection callback](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then) as second parameter of `then`, the response will be available through the `error` object as explained in the [Handling Errors](#handling-errors) section. - -## Config Defaults - -You can specify config defaults that will be applied to every request. - -### Global axios defaults - -```js -axios.defaults.baseURL = 'https://api.example.com'; -axios.defaults.headers.common['Authorization'] = AUTH_TOKEN; -axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; -``` - -### Custom instance defaults - -```js -// Set config defaults when creating the instance -const instance = axios.create({ - baseURL: 'https://api.example.com' -}); - -// Alter defaults after instance has been created -instance.defaults.headers.common['Authorization'] = AUTH_TOKEN; -``` - -### Config order of precedence - -Config will be merged with an order of precedence. The order is library defaults found in [lib/defaults.js](https://github.com/axios/axios/blob/master/lib/defaults.js#L28), then `defaults` property of the instance, and finally `config` argument for the request. The latter will take precedence over the former. Here's an example. - -```js -// Create an instance using the config defaults provided by the library -// At this point the timeout config value is `0` as is the default for the library -const instance = axios.create(); - -// Override timeout default for the library -// Now all requests using this instance will wait 2.5 seconds before timing out -instance.defaults.timeout = 2500; - -// Override timeout for this request as it's known to take a long time -instance.get('/longRequest', { - timeout: 5000 -}); -``` - -## Interceptors - -You can intercept requests or responses before they are handled by `then` or `catch`. - -```js -// Add a request interceptor -axios.interceptors.request.use(function (config) { - // Do something before request is sent - return config; - }, function (error) { - // Do something with request error - return Promise.reject(error); - }); - -// Add a response interceptor -axios.interceptors.response.use(function (response) { - // Any status code that lie within the range of 2xx cause this function to trigger - // Do something with response data - return response; - }, function (error) { - // Any status codes that falls outside the range of 2xx cause this function to trigger - // Do something with response error - return Promise.reject(error); - }); -``` - -If you need to remove an interceptor later you can. - -```js -const myInterceptor = axios.interceptors.request.use(function () {/*...*/}); -axios.interceptors.request.eject(myInterceptor); -``` - -You can add interceptors to a custom instance of axios. - -```js -const instance = axios.create(); -instance.interceptors.request.use(function () {/*...*/}); -``` - -## Handling Errors - -```js -axios.get('/user/12345') - .catch(function (error) { - if (error.response) { - // The request was made and the server responded with a status code - // that falls out of the range of 2xx - console.log(error.response.data); - console.log(error.response.status); - console.log(error.response.headers); - } else if (error.request) { - // The request was made but no response was received - // `error.request` is an instance of XMLHttpRequest in the browser and an instance of - // http.ClientRequest in node.js - console.log(error.request); - } else { - // Something happened in setting up the request that triggered an Error - console.log('Error', error.message); - } - console.log(error.config); - }); -``` - -Using the `validateStatus` config option, you can define HTTP code(s) that should throw an error. - -```js -axios.get('/user/12345', { - validateStatus: function (status) { - return status < 500; // Resolve only if the status code is less than 500 - } -}) -``` - -Using `toJSON` you get an object with more information about the HTTP error. - -```js -axios.get('/user/12345') - .catch(function (error) { - console.log(error.toJSON()); - }); -``` - -## Cancellation - -You can cancel a request using a *cancel token*. - -> The axios cancel token API is based on the withdrawn [cancelable promises proposal](https://github.com/tc39/proposal-cancelable-promises). - -You can create a cancel token using the `CancelToken.source` factory as shown below: - -```js -const CancelToken = axios.CancelToken; -const source = CancelToken.source(); - -axios.get('/user/12345', { - cancelToken: source.token -}).catch(function (thrown) { - if (axios.isCancel(thrown)) { - console.log('Request canceled', thrown.message); - } else { - // handle error - } -}); - -axios.post('/user/12345', { - name: 'new name' -}, { - cancelToken: source.token -}) - -// cancel the request (the message parameter is optional) -source.cancel('Operation canceled by the user.'); -``` - -You can also create a cancel token by passing an executor function to the `CancelToken` constructor: - -```js -const CancelToken = axios.CancelToken; -let cancel; - -axios.get('/user/12345', { - cancelToken: new CancelToken(function executor(c) { - // An executor function receives a cancel function as a parameter - cancel = c; - }) -}); - -// cancel the request -cancel(); -``` - -> Note: you can cancel several requests with the same cancel token. - -## Using application/x-www-form-urlencoded format - -By default, axios serializes JavaScript objects to `JSON`. To send data in the `application/x-www-form-urlencoded` format instead, you can use one of the following options. - -### Browser - -In a browser, you can use the [`URLSearchParams`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) API as follows: - -```js -const params = new URLSearchParams(); -params.append('param1', 'value1'); -params.append('param2', 'value2'); -axios.post('/foo', params); -``` - -> Note that `URLSearchParams` is not supported by all browsers (see [caniuse.com](http://www.caniuse.com/#feat=urlsearchparams)), but there is a [polyfill](https://github.com/WebReflection/url-search-params) available (make sure to polyfill the global environment). - -Alternatively, you can encode data using the [`qs`](https://github.com/ljharb/qs) library: - -```js -const qs = require('qs'); -axios.post('/foo', qs.stringify({ 'bar': 123 })); -``` - -Or in another way (ES6), - -```js -import qs from 'qs'; -const data = { 'bar': 123 }; -const options = { - method: 'POST', - headers: { 'content-type': 'application/x-www-form-urlencoded' }, - data: qs.stringify(data), - url, -}; -axios(options); -``` - -### Node.js - -#### Query string - -In node.js, you can use the [`querystring`](https://nodejs.org/api/querystring.html) module as follows: - -```js -const querystring = require('querystring'); -axios.post('http://something.com/', querystring.stringify({ foo: 'bar' })); -``` - -or ['URLSearchParams'](https://nodejs.org/api/url.html#url_class_urlsearchparams) from ['url module'](https://nodejs.org/api/url.html) as follows: - -```js -const url = require('url'); -const params = new url.URLSearchParams({ foo: 'bar' }); -axios.post('http://something.com/', params.toString()); -``` - -You can also use the [`qs`](https://github.com/ljharb/qs) library. - -###### NOTE -The `qs` library is preferable if you need to stringify nested objects, as the `querystring` method has known issues with that use case (https://github.com/nodejs/node-v0.x-archive/issues/1665). - -#### Form data - -In node.js, you can use the [`form-data`](https://github.com/form-data/form-data) library as follows: - -```js -const FormData = require('form-data'); - -const form = new FormData(); -form.append('my_field', 'my value'); -form.append('my_buffer', new Buffer(10)); -form.append('my_file', fs.createReadStream('/foo/bar.jpg')); - -axios.post('https://example.com', form, { headers: form.getHeaders() }) -``` - -Alternatively, use an interceptor: - -```js -axios.interceptors.request.use(config => { - if (config.data instanceof FormData) { - Object.assign(config.headers, config.data.getHeaders()); - } - return config; -}); -``` - -## Semver - -Until axios reaches a `1.0` release, breaking changes will be released with a new minor version. For example `0.5.1`, and `0.5.4` will have the same API, but `0.6.0` will have breaking changes. - -## Promises - -axios depends on a native ES6 Promise implementation to be [supported](http://caniuse.com/promises). -If your environment doesn't support ES6 Promises, you can [polyfill](https://github.com/jakearchibald/es6-promise). - -## TypeScript -axios includes [TypeScript](http://typescriptlang.org) definitions. -```typescript -import axios from 'axios'; -axios.get('/user?ID=12345'); -``` - -## Resources - -* [Changelog](https://github.com/axios/axios/blob/master/CHANGELOG.md) -* [Upgrade Guide](https://github.com/axios/axios/blob/master/UPGRADE_GUIDE.md) -* [Ecosystem](https://github.com/axios/axios/blob/master/ECOSYSTEM.md) -* [Contributing Guide](https://github.com/axios/axios/blob/master/CONTRIBUTING.md) -* [Code of Conduct](https://github.com/axios/axios/blob/master/CODE_OF_CONDUCT.md) - -## Credits - -axios is heavily inspired by the [$http service](https://docs.angularjs.org/api/ng/service/$http) provided in [Angular](https://angularjs.org/). Ultimately axios is an effort to provide a standalone `$http`-like service for use outside of Angular. - -## License - -[MIT](LICENSE) diff --git a/node_modules/axios/UPGRADE_GUIDE.md b/node_modules/axios/UPGRADE_GUIDE.md deleted file mode 100644 index 745e804..0000000 --- a/node_modules/axios/UPGRADE_GUIDE.md +++ /dev/null @@ -1,162 +0,0 @@ -# Upgrade Guide - -### 0.15.x -> 0.16.0 - -#### `Promise` Type Declarations - -The `Promise` type declarations have been removed from the axios typings in favor of the built-in type declarations. If you use axios in a TypeScript project that targets `ES5`, please make sure to include the `es2015.promise` lib. Please see [this post](https://blog.mariusschulz.com/2016/11/25/typescript-2-0-built-in-type-declarations) for details. - -### 0.13.x -> 0.14.0 - -#### TypeScript Definitions - -The axios TypeScript definitions have been updated to match the axios API and use the ES2015 module syntax. - -Please use the following `import` statement to import axios in TypeScript: - -```typescript -import axios from 'axios'; - -axios.get('/foo') - .then(response => console.log(response)) - .catch(error => console.log(error)); -``` - -#### `agent` Config Option - -The `agent` config option has been replaced with two new options: `httpAgent` and `httpsAgent`. Please use them instead. - -```js -{ - // Define a custom agent for HTTP - httpAgent: new http.Agent({ keepAlive: true }), - // Define a custom agent for HTTPS - httpsAgent: new https.Agent({ keepAlive: true }) -} -``` - -#### `progress` Config Option - -The `progress` config option has been replaced with the `onUploadProgress` and `onDownloadProgress` options. - -```js -{ - // Define a handler for upload progress events - onUploadProgress: function (progressEvent) { - // ... - }, - - // Define a handler for download progress events - onDownloadProgress: function (progressEvent) { - // ... - } -} -``` - -### 0.12.x -> 0.13.0 - -The `0.13.0` release contains several changes to custom adapters and error handling. - -#### Error Handling - -Previous to this release an error could either be a server response with bad status code or an actual `Error`. With this release Promise will always reject with an `Error`. In the case that a response was received, the `Error` will also include the response. - -```js -axios.get('/user/12345') - .catch((error) => { - console.log(error.message); - console.log(error.code); // Not always specified - console.log(error.config); // The config that was used to make the request - console.log(error.response); // Only available if response was received from the server - }); -``` - -#### Request Adapters - -This release changes a few things about how request adapters work. Please take note if you are using your own custom adapter. - -1. Response transformer is now called outside of adapter. -2. Request adapter returns a `Promise`. - -This means that you no longer need to invoke `transformData` on response data. You will also no longer receive `resolve` and `reject` as arguments in your adapter. - -Previous code: - -```js -function myAdapter(resolve, reject, config) { - var response = { - data: transformData( - responseData, - responseHeaders, - config.transformResponse - ), - status: request.status, - statusText: request.statusText, - headers: responseHeaders - }; - settle(resolve, reject, response); -} -``` - -New code: - -```js -function myAdapter(config) { - return new Promise(function (resolve, reject) { - var response = { - data: responseData, - status: request.status, - statusText: request.statusText, - headers: responseHeaders - }; - settle(resolve, reject, response); - }); -} -``` - -See the related commits for more details: -- [Response transformers](https://github.com/axios/axios/commit/10eb23865101f9347570552c04e9d6211376e25e) -- [Request adapter Promise](https://github.com/axios/axios/commit/157efd5615890301824e3121cc6c9d2f9b21f94a) - -### 0.5.x -> 0.6.0 - -The `0.6.0` release contains mostly bug fixes, but there are a couple things to be aware of when upgrading. - -#### ES6 Promise Polyfill - -Up until the `0.6.0` release ES6 `Promise` was being polyfilled using [es6-promise](https://github.com/jakearchibald/es6-promise). With this release, the polyfill has been removed, and you will need to supply it yourself if your environment needs it. - -```js -require('es6-promise').polyfill(); -var axios = require('axios'); -``` - -This will polyfill the global environment, and only needs to be done once. - -#### `axios.success`/`axios.error` - -The `success`, and `error` aliases were deprecated in [0.4.0](https://github.com/axios/axios/blob/master/CHANGELOG.md#040-oct-03-2014). As of this release they have been removed entirely. Instead please use `axios.then`, and `axios.catch` respectively. - -```js -axios.get('some/url') - .then(function (res) { - /* ... */ - }) - .catch(function (err) { - /* ... */ - }); -``` - -#### UMD - -Previous versions of axios shipped with an AMD, CommonJS, and Global build. This has all been rolled into a single UMD build. - -```js -// AMD -require(['bower_components/axios/dist/axios'], function (axios) { - /* ... */ -}); - -// CommonJS -var axios = require('axios/dist/axios'); -``` diff --git a/node_modules/axios/dist/axios.js b/node_modules/axios/dist/axios.js deleted file mode 100644 index 6dd94bd..0000000 --- a/node_modules/axios/dist/axios.js +++ /dev/null @@ -1,1756 +0,0 @@ -/* axios v0.21.1 | (c) 2020 by Matt Zabriskie */ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); - else if(typeof exports === 'object') - exports["axios"] = factory(); - else - root["axios"] = factory(); -})(this, function() { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) -/******/ return installedModules[moduleId].exports; -/******/ -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ exports: {}, -/******/ id: moduleId, -/******/ loaded: false -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.loaded = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(0); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports, __webpack_require__) { - - module.exports = __webpack_require__(1); - -/***/ }), -/* 1 */ -/***/ (function(module, exports, __webpack_require__) { - - 'use strict'; - - var utils = __webpack_require__(2); - var bind = __webpack_require__(3); - var Axios = __webpack_require__(4); - var mergeConfig = __webpack_require__(22); - var defaults = __webpack_require__(10); - - /** - * Create an instance of Axios - * - * @param {Object} defaultConfig The default config for the instance - * @return {Axios} A new instance of Axios - */ - function createInstance(defaultConfig) { - var context = new Axios(defaultConfig); - var instance = bind(Axios.prototype.request, context); - - // Copy axios.prototype to instance - utils.extend(instance, Axios.prototype, context); - - // Copy context to instance - utils.extend(instance, context); - - return instance; - } - - // Create the default instance to be exported - var axios = createInstance(defaults); - - // Expose Axios class to allow class inheritance - axios.Axios = Axios; - - // Factory for creating new instances - axios.create = function create(instanceConfig) { - return createInstance(mergeConfig(axios.defaults, instanceConfig)); - }; - - // Expose Cancel & CancelToken - axios.Cancel = __webpack_require__(23); - axios.CancelToken = __webpack_require__(24); - axios.isCancel = __webpack_require__(9); - - // Expose all/spread - axios.all = function all(promises) { - return Promise.all(promises); - }; - axios.spread = __webpack_require__(25); - - // Expose isAxiosError - axios.isAxiosError = __webpack_require__(26); - - module.exports = axios; - - // Allow use of default import syntax in TypeScript - module.exports.default = axios; - - -/***/ }), -/* 2 */ -/***/ (function(module, exports, __webpack_require__) { - - 'use strict'; - - var bind = __webpack_require__(3); - - /*global toString:true*/ - - // utils is a library of generic helper functions non-specific to axios - - var toString = Object.prototype.toString; - - /** - * Determine if a value is an Array - * - * @param {Object} val The value to test - * @returns {boolean} True if value is an Array, otherwise false - */ - function isArray(val) { - return toString.call(val) === '[object Array]'; - } - - /** - * Determine if a value is undefined - * - * @param {Object} val The value to test - * @returns {boolean} True if the value is undefined, otherwise false - */ - function isUndefined(val) { - return typeof val === 'undefined'; - } - - /** - * Determine if a value is a Buffer - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Buffer, otherwise false - */ - function isBuffer(val) { - return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) - && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val); - } - - /** - * Determine if a value is an ArrayBuffer - * - * @param {Object} val The value to test - * @returns {boolean} True if value is an ArrayBuffer, otherwise false - */ - function isArrayBuffer(val) { - return toString.call(val) === '[object ArrayBuffer]'; - } - - /** - * Determine if a value is a FormData - * - * @param {Object} val The value to test - * @returns {boolean} True if value is an FormData, otherwise false - */ - function isFormData(val) { - return (typeof FormData !== 'undefined') && (val instanceof FormData); - } - - /** - * Determine if a value is a view on an ArrayBuffer - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false - */ - function isArrayBufferView(val) { - var result; - if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { - result = ArrayBuffer.isView(val); - } else { - result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer); - } - return result; - } - - /** - * Determine if a value is a String - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a String, otherwise false - */ - function isString(val) { - return typeof val === 'string'; - } - - /** - * Determine if a value is a Number - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Number, otherwise false - */ - function isNumber(val) { - return typeof val === 'number'; - } - - /** - * Determine if a value is an Object - * - * @param {Object} val The value to test - * @returns {boolean} True if value is an Object, otherwise false - */ - function isObject(val) { - return val !== null && typeof val === 'object'; - } - - /** - * Determine if a value is a plain Object - * - * @param {Object} val The value to test - * @return {boolean} True if value is a plain Object, otherwise false - */ - function isPlainObject(val) { - if (toString.call(val) !== '[object Object]') { - return false; - } - - var prototype = Object.getPrototypeOf(val); - return prototype === null || prototype === Object.prototype; - } - - /** - * Determine if a value is a Date - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Date, otherwise false - */ - function isDate(val) { - return toString.call(val) === '[object Date]'; - } - - /** - * Determine if a value is a File - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a File, otherwise false - */ - function isFile(val) { - return toString.call(val) === '[object File]'; - } - - /** - * Determine if a value is a Blob - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Blob, otherwise false - */ - function isBlob(val) { - return toString.call(val) === '[object Blob]'; - } - - /** - * Determine if a value is a Function - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Function, otherwise false - */ - function isFunction(val) { - return toString.call(val) === '[object Function]'; - } - - /** - * Determine if a value is a Stream - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Stream, otherwise false - */ - function isStream(val) { - return isObject(val) && isFunction(val.pipe); - } - - /** - * Determine if a value is a URLSearchParams object - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a URLSearchParams object, otherwise false - */ - function isURLSearchParams(val) { - return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams; - } - - /** - * Trim excess whitespace off the beginning and end of a string - * - * @param {String} str The String to trim - * @returns {String} The String freed of excess whitespace - */ - function trim(str) { - return str.replace(/^\s*/, '').replace(/\s*$/, ''); - } - - /** - * Determine if we're running in a standard browser environment - * - * This allows axios to run in a web worker, and react-native. - * Both environments support XMLHttpRequest, but not fully standard globals. - * - * web workers: - * typeof window -> undefined - * typeof document -> undefined - * - * react-native: - * navigator.product -> 'ReactNative' - * nativescript - * navigator.product -> 'NativeScript' or 'NS' - */ - function isStandardBrowserEnv() { - if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || - navigator.product === 'NativeScript' || - navigator.product === 'NS')) { - return false; - } - return ( - typeof window !== 'undefined' && - typeof document !== 'undefined' - ); - } - - /** - * Iterate over an Array or an Object invoking a function for each item. - * - * If `obj` is an Array callback will be called passing - * the value, index, and complete array for each item. - * - * If 'obj' is an Object callback will be called passing - * the value, key, and complete object for each property. - * - * @param {Object|Array} obj The object to iterate - * @param {Function} fn The callback to invoke for each item - */ - function forEach(obj, fn) { - // Don't bother if no value provided - if (obj === null || typeof obj === 'undefined') { - return; - } - - // Force an array if not already something iterable - if (typeof obj !== 'object') { - /*eslint no-param-reassign:0*/ - obj = [obj]; - } - - if (isArray(obj)) { - // Iterate over array values - for (var i = 0, l = obj.length; i < l; i++) { - fn.call(null, obj[i], i, obj); - } - } else { - // Iterate over object keys - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - fn.call(null, obj[key], key, obj); - } - } - } - } - - /** - * Accepts varargs expecting each argument to be an object, then - * immutably merges the properties of each object and returns result. - * - * When multiple objects contain the same key the later object in - * the arguments list will take precedence. - * - * Example: - * - * ```js - * var result = merge({foo: 123}, {foo: 456}); - * console.log(result.foo); // outputs 456 - * ``` - * - * @param {Object} obj1 Object to merge - * @returns {Object} Result of all merge properties - */ - function merge(/* obj1, obj2, obj3, ... */) { - var result = {}; - function assignValue(val, key) { - if (isPlainObject(result[key]) && isPlainObject(val)) { - result[key] = merge(result[key], val); - } else if (isPlainObject(val)) { - result[key] = merge({}, val); - } else if (isArray(val)) { - result[key] = val.slice(); - } else { - result[key] = val; - } - } - - for (var i = 0, l = arguments.length; i < l; i++) { - forEach(arguments[i], assignValue); - } - return result; - } - - /** - * Extends object a by mutably adding to it the properties of object b. - * - * @param {Object} a The object to be extended - * @param {Object} b The object to copy properties from - * @param {Object} thisArg The object to bind function to - * @return {Object} The resulting value of object a - */ - function extend(a, b, thisArg) { - forEach(b, function assignValue(val, key) { - if (thisArg && typeof val === 'function') { - a[key] = bind(val, thisArg); - } else { - a[key] = val; - } - }); - return a; - } - - /** - * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) - * - * @param {string} content with BOM - * @return {string} content value without BOM - */ - function stripBOM(content) { - if (content.charCodeAt(0) === 0xFEFF) { - content = content.slice(1); - } - return content; - } - - module.exports = { - isArray: isArray, - isArrayBuffer: isArrayBuffer, - isBuffer: isBuffer, - isFormData: isFormData, - isArrayBufferView: isArrayBufferView, - isString: isString, - isNumber: isNumber, - isObject: isObject, - isPlainObject: isPlainObject, - isUndefined: isUndefined, - isDate: isDate, - isFile: isFile, - isBlob: isBlob, - isFunction: isFunction, - isStream: isStream, - isURLSearchParams: isURLSearchParams, - isStandardBrowserEnv: isStandardBrowserEnv, - forEach: forEach, - merge: merge, - extend: extend, - trim: trim, - stripBOM: stripBOM - }; - - -/***/ }), -/* 3 */ -/***/ (function(module, exports) { - - 'use strict'; - - module.exports = function bind(fn, thisArg) { - return function wrap() { - var args = new Array(arguments.length); - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i]; - } - return fn.apply(thisArg, args); - }; - }; - - -/***/ }), -/* 4 */ -/***/ (function(module, exports, __webpack_require__) { - - 'use strict'; - - var utils = __webpack_require__(2); - var buildURL = __webpack_require__(5); - var InterceptorManager = __webpack_require__(6); - var dispatchRequest = __webpack_require__(7); - var mergeConfig = __webpack_require__(22); - - /** - * Create a new instance of Axios - * - * @param {Object} instanceConfig The default config for the instance - */ - function Axios(instanceConfig) { - this.defaults = instanceConfig; - this.interceptors = { - request: new InterceptorManager(), - response: new InterceptorManager() - }; - } - - /** - * Dispatch a request - * - * @param {Object} config The config specific for this request (merged with this.defaults) - */ - Axios.prototype.request = function request(config) { - /*eslint no-param-reassign:0*/ - // Allow for axios('example/url'[, config]) a la fetch API - if (typeof config === 'string') { - config = arguments[1] || {}; - config.url = arguments[0]; - } else { - config = config || {}; - } - - config = mergeConfig(this.defaults, config); - - // Set config.method - if (config.method) { - config.method = config.method.toLowerCase(); - } else if (this.defaults.method) { - config.method = this.defaults.method.toLowerCase(); - } else { - config.method = 'get'; - } - - // Hook up interceptors middleware - var chain = [dispatchRequest, undefined]; - var promise = Promise.resolve(config); - - this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { - chain.unshift(interceptor.fulfilled, interceptor.rejected); - }); - - this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { - chain.push(interceptor.fulfilled, interceptor.rejected); - }); - - while (chain.length) { - promise = promise.then(chain.shift(), chain.shift()); - } - - return promise; - }; - - Axios.prototype.getUri = function getUri(config) { - config = mergeConfig(this.defaults, config); - return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, ''); - }; - - // Provide aliases for supported request methods - utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { - /*eslint func-names:0*/ - Axios.prototype[method] = function(url, config) { - return this.request(mergeConfig(config || {}, { - method: method, - url: url, - data: (config || {}).data - })); - }; - }); - - utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { - /*eslint func-names:0*/ - Axios.prototype[method] = function(url, data, config) { - return this.request(mergeConfig(config || {}, { - method: method, - url: url, - data: data - })); - }; - }); - - module.exports = Axios; - - -/***/ }), -/* 5 */ -/***/ (function(module, exports, __webpack_require__) { - - 'use strict'; - - var utils = __webpack_require__(2); - - function encode(val) { - return encodeURIComponent(val). - replace(/%3A/gi, ':'). - replace(/%24/g, '$'). - replace(/%2C/gi, ','). - replace(/%20/g, '+'). - replace(/%5B/gi, '['). - replace(/%5D/gi, ']'); - } - - /** - * Build a URL by appending params to the end - * - * @param {string} url The base of the url (e.g., http://www.google.com) - * @param {object} [params] The params to be appended - * @returns {string} The formatted url - */ - module.exports = function buildURL(url, params, paramsSerializer) { - /*eslint no-param-reassign:0*/ - if (!params) { - return url; - } - - var serializedParams; - if (paramsSerializer) { - serializedParams = paramsSerializer(params); - } else if (utils.isURLSearchParams(params)) { - serializedParams = params.toString(); - } else { - var parts = []; - - utils.forEach(params, function serialize(val, key) { - if (val === null || typeof val === 'undefined') { - return; - } - - if (utils.isArray(val)) { - key = key + '[]'; - } else { - val = [val]; - } - - utils.forEach(val, function parseValue(v) { - if (utils.isDate(v)) { - v = v.toISOString(); - } else if (utils.isObject(v)) { - v = JSON.stringify(v); - } - parts.push(encode(key) + '=' + encode(v)); - }); - }); - - serializedParams = parts.join('&'); - } - - if (serializedParams) { - var hashmarkIndex = url.indexOf('#'); - if (hashmarkIndex !== -1) { - url = url.slice(0, hashmarkIndex); - } - - url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; - } - - return url; - }; - - -/***/ }), -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { - - 'use strict'; - - var utils = __webpack_require__(2); - - function InterceptorManager() { - this.handlers = []; - } - - /** - * Add a new interceptor to the stack - * - * @param {Function} fulfilled The function to handle `then` for a `Promise` - * @param {Function} rejected The function to handle `reject` for a `Promise` - * - * @return {Number} An ID used to remove interceptor later - */ - InterceptorManager.prototype.use = function use(fulfilled, rejected) { - this.handlers.push({ - fulfilled: fulfilled, - rejected: rejected - }); - return this.handlers.length - 1; - }; - - /** - * Remove an interceptor from the stack - * - * @param {Number} id The ID that was returned by `use` - */ - InterceptorManager.prototype.eject = function eject(id) { - if (this.handlers[id]) { - this.handlers[id] = null; - } - }; - - /** - * Iterate over all the registered interceptors - * - * This method is particularly useful for skipping over any - * interceptors that may have become `null` calling `eject`. - * - * @param {Function} fn The function to call for each interceptor - */ - InterceptorManager.prototype.forEach = function forEach(fn) { - utils.forEach(this.handlers, function forEachHandler(h) { - if (h !== null) { - fn(h); - } - }); - }; - - module.exports = InterceptorManager; - - -/***/ }), -/* 7 */ -/***/ (function(module, exports, __webpack_require__) { - - 'use strict'; - - var utils = __webpack_require__(2); - var transformData = __webpack_require__(8); - var isCancel = __webpack_require__(9); - var defaults = __webpack_require__(10); - - /** - * Throws a `Cancel` if cancellation has been requested. - */ - function throwIfCancellationRequested(config) { - if (config.cancelToken) { - config.cancelToken.throwIfRequested(); - } - } - - /** - * Dispatch a request to the server using the configured adapter. - * - * @param {object} config The config that is to be used for the request - * @returns {Promise} The Promise to be fulfilled - */ - module.exports = function dispatchRequest(config) { - throwIfCancellationRequested(config); - - // Ensure headers exist - config.headers = config.headers || {}; - - // Transform request data - config.data = transformData( - config.data, - config.headers, - config.transformRequest - ); - - // Flatten headers - config.headers = utils.merge( - config.headers.common || {}, - config.headers[config.method] || {}, - config.headers - ); - - utils.forEach( - ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], - function cleanHeaderConfig(method) { - delete config.headers[method]; - } - ); - - var adapter = config.adapter || defaults.adapter; - - return adapter(config).then(function onAdapterResolution(response) { - throwIfCancellationRequested(config); - - // Transform response data - response.data = transformData( - response.data, - response.headers, - config.transformResponse - ); - - return response; - }, function onAdapterRejection(reason) { - if (!isCancel(reason)) { - throwIfCancellationRequested(config); - - // Transform response data - if (reason && reason.response) { - reason.response.data = transformData( - reason.response.data, - reason.response.headers, - config.transformResponse - ); - } - } - - return Promise.reject(reason); - }); - }; - - -/***/ }), -/* 8 */ -/***/ (function(module, exports, __webpack_require__) { - - 'use strict'; - - var utils = __webpack_require__(2); - - /** - * Transform the data for a request or a response - * - * @param {Object|String} data The data to be transformed - * @param {Array} headers The headers for the request or response - * @param {Array|Function} fns A single function or Array of functions - * @returns {*} The resulting transformed data - */ - module.exports = function transformData(data, headers, fns) { - /*eslint no-param-reassign:0*/ - utils.forEach(fns, function transform(fn) { - data = fn(data, headers); - }); - - return data; - }; - - -/***/ }), -/* 9 */ -/***/ (function(module, exports) { - - 'use strict'; - - module.exports = function isCancel(value) { - return !!(value && value.__CANCEL__); - }; - - -/***/ }), -/* 10 */ -/***/ (function(module, exports, __webpack_require__) { - - 'use strict'; - - var utils = __webpack_require__(2); - var normalizeHeaderName = __webpack_require__(11); - - var DEFAULT_CONTENT_TYPE = { - 'Content-Type': 'application/x-www-form-urlencoded' - }; - - function setContentTypeIfUnset(headers, value) { - if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { - headers['Content-Type'] = value; - } - } - - function getDefaultAdapter() { - var adapter; - if (typeof XMLHttpRequest !== 'undefined') { - // For browsers use XHR adapter - adapter = __webpack_require__(12); - } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') { - // For node use HTTP adapter - adapter = __webpack_require__(12); - } - return adapter; - } - - var defaults = { - adapter: getDefaultAdapter(), - - transformRequest: [function transformRequest(data, headers) { - normalizeHeaderName(headers, 'Accept'); - normalizeHeaderName(headers, 'Content-Type'); - if (utils.isFormData(data) || - utils.isArrayBuffer(data) || - utils.isBuffer(data) || - utils.isStream(data) || - utils.isFile(data) || - utils.isBlob(data) - ) { - return data; - } - if (utils.isArrayBufferView(data)) { - return data.buffer; - } - if (utils.isURLSearchParams(data)) { - setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); - return data.toString(); - } - if (utils.isObject(data)) { - setContentTypeIfUnset(headers, 'application/json;charset=utf-8'); - return JSON.stringify(data); - } - return data; - }], - - transformResponse: [function transformResponse(data) { - /*eslint no-param-reassign:0*/ - if (typeof data === 'string') { - try { - data = JSON.parse(data); - } catch (e) { /* Ignore */ } - } - return data; - }], - - /** - * A timeout in milliseconds to abort a request. If set to 0 (default) a - * timeout is not created. - */ - timeout: 0, - - xsrfCookieName: 'XSRF-TOKEN', - xsrfHeaderName: 'X-XSRF-TOKEN', - - maxContentLength: -1, - maxBodyLength: -1, - - validateStatus: function validateStatus(status) { - return status >= 200 && status < 300; - } - }; - - defaults.headers = { - common: { - 'Accept': 'application/json, text/plain, */*' - } - }; - - utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { - defaults.headers[method] = {}; - }); - - utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { - defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); - }); - - module.exports = defaults; - - -/***/ }), -/* 11 */ -/***/ (function(module, exports, __webpack_require__) { - - 'use strict'; - - var utils = __webpack_require__(2); - - module.exports = function normalizeHeaderName(headers, normalizedName) { - utils.forEach(headers, function processHeader(value, name) { - if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { - headers[normalizedName] = value; - delete headers[name]; - } - }); - }; - - -/***/ }), -/* 12 */ -/***/ (function(module, exports, __webpack_require__) { - - 'use strict'; - - var utils = __webpack_require__(2); - var settle = __webpack_require__(13); - var cookies = __webpack_require__(16); - var buildURL = __webpack_require__(5); - var buildFullPath = __webpack_require__(17); - var parseHeaders = __webpack_require__(20); - var isURLSameOrigin = __webpack_require__(21); - var createError = __webpack_require__(14); - - module.exports = function xhrAdapter(config) { - return new Promise(function dispatchXhrRequest(resolve, reject) { - var requestData = config.data; - var requestHeaders = config.headers; - - if (utils.isFormData(requestData)) { - delete requestHeaders['Content-Type']; // Let the browser set it - } - - var request = new XMLHttpRequest(); - - // HTTP basic authentication - if (config.auth) { - var username = config.auth.username || ''; - var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; - requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); - } - - var fullPath = buildFullPath(config.baseURL, config.url); - request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); - - // Set the request timeout in MS - request.timeout = config.timeout; - - // Listen for ready state - request.onreadystatechange = function handleLoad() { - if (!request || request.readyState !== 4) { - return; - } - - // The request errored out and we didn't get a response, this will be - // handled by onerror instead - // With one exception: request that using file: protocol, most browsers - // will return status as 0 even though it's a successful request - if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { - return; - } - - // Prepare the response - var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null; - var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response; - var response = { - data: responseData, - status: request.status, - statusText: request.statusText, - headers: responseHeaders, - config: config, - request: request - }; - - settle(resolve, reject, response); - - // Clean up request - request = null; - }; - - // Handle browser request cancellation (as opposed to a manual cancellation) - request.onabort = function handleAbort() { - if (!request) { - return; - } - - reject(createError('Request aborted', config, 'ECONNABORTED', request)); - - // Clean up request - request = null; - }; - - // Handle low level network errors - request.onerror = function handleError() { - // Real errors are hidden from us by the browser - // onerror should only fire if it's a network error - reject(createError('Network Error', config, null, request)); - - // Clean up request - request = null; - }; - - // Handle timeout - request.ontimeout = function handleTimeout() { - var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded'; - if (config.timeoutErrorMessage) { - timeoutErrorMessage = config.timeoutErrorMessage; - } - reject(createError(timeoutErrorMessage, config, 'ECONNABORTED', - request)); - - // Clean up request - request = null; - }; - - // Add xsrf header - // This is only done if running in a standard browser environment. - // Specifically not if we're in a web worker, or react-native. - if (utils.isStandardBrowserEnv()) { - // Add xsrf header - var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? - cookies.read(config.xsrfCookieName) : - undefined; - - if (xsrfValue) { - requestHeaders[config.xsrfHeaderName] = xsrfValue; - } - } - - // Add headers to the request - if ('setRequestHeader' in request) { - utils.forEach(requestHeaders, function setRequestHeader(val, key) { - if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { - // Remove Content-Type if data is undefined - delete requestHeaders[key]; - } else { - // Otherwise add header to the request - request.setRequestHeader(key, val); - } - }); - } - - // Add withCredentials to request if needed - if (!utils.isUndefined(config.withCredentials)) { - request.withCredentials = !!config.withCredentials; - } - - // Add responseType to request if needed - if (config.responseType) { - try { - request.responseType = config.responseType; - } catch (e) { - // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2. - // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function. - if (config.responseType !== 'json') { - throw e; - } - } - } - - // Handle progress if needed - if (typeof config.onDownloadProgress === 'function') { - request.addEventListener('progress', config.onDownloadProgress); - } - - // Not all browsers support upload events - if (typeof config.onUploadProgress === 'function' && request.upload) { - request.upload.addEventListener('progress', config.onUploadProgress); - } - - if (config.cancelToken) { - // Handle cancellation - config.cancelToken.promise.then(function onCanceled(cancel) { - if (!request) { - return; - } - - request.abort(); - reject(cancel); - // Clean up request - request = null; - }); - } - - if (!requestData) { - requestData = null; - } - - // Send the request - request.send(requestData); - }); - }; - - -/***/ }), -/* 13 */ -/***/ (function(module, exports, __webpack_require__) { - - 'use strict'; - - var createError = __webpack_require__(14); - - /** - * Resolve or reject a Promise based on response status. - * - * @param {Function} resolve A function that resolves the promise. - * @param {Function} reject A function that rejects the promise. - * @param {object} response The response. - */ - module.exports = function settle(resolve, reject, response) { - var validateStatus = response.config.validateStatus; - if (!response.status || !validateStatus || validateStatus(response.status)) { - resolve(response); - } else { - reject(createError( - 'Request failed with status code ' + response.status, - response.config, - null, - response.request, - response - )); - } - }; - - -/***/ }), -/* 14 */ -/***/ (function(module, exports, __webpack_require__) { - - 'use strict'; - - var enhanceError = __webpack_require__(15); - - /** - * Create an Error with the specified message, config, error code, request and response. - * - * @param {string} message The error message. - * @param {Object} config The config. - * @param {string} [code] The error code (for example, 'ECONNABORTED'). - * @param {Object} [request] The request. - * @param {Object} [response] The response. - * @returns {Error} The created error. - */ - module.exports = function createError(message, config, code, request, response) { - var error = new Error(message); - return enhanceError(error, config, code, request, response); - }; - - -/***/ }), -/* 15 */ -/***/ (function(module, exports) { - - 'use strict'; - - /** - * Update an Error with the specified config, error code, and response. - * - * @param {Error} error The error to update. - * @param {Object} config The config. - * @param {string} [code] The error code (for example, 'ECONNABORTED'). - * @param {Object} [request] The request. - * @param {Object} [response] The response. - * @returns {Error} The error. - */ - module.exports = function enhanceError(error, config, code, request, response) { - error.config = config; - if (code) { - error.code = code; - } - - error.request = request; - error.response = response; - error.isAxiosError = true; - - error.toJSON = function toJSON() { - return { - // Standard - message: this.message, - name: this.name, - // Microsoft - description: this.description, - number: this.number, - // Mozilla - fileName: this.fileName, - lineNumber: this.lineNumber, - columnNumber: this.columnNumber, - stack: this.stack, - // Axios - config: this.config, - code: this.code - }; - }; - return error; - }; - - -/***/ }), -/* 16 */ -/***/ (function(module, exports, __webpack_require__) { - - 'use strict'; - - var utils = __webpack_require__(2); - - module.exports = ( - utils.isStandardBrowserEnv() ? - - // Standard browser envs support document.cookie - (function standardBrowserEnv() { - return { - write: function write(name, value, expires, path, domain, secure) { - var cookie = []; - cookie.push(name + '=' + encodeURIComponent(value)); - - if (utils.isNumber(expires)) { - cookie.push('expires=' + new Date(expires).toGMTString()); - } - - if (utils.isString(path)) { - cookie.push('path=' + path); - } - - if (utils.isString(domain)) { - cookie.push('domain=' + domain); - } - - if (secure === true) { - cookie.push('secure'); - } - - document.cookie = cookie.join('; '); - }, - - read: function read(name) { - var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); - return (match ? decodeURIComponent(match[3]) : null); - }, - - remove: function remove(name) { - this.write(name, '', Date.now() - 86400000); - } - }; - })() : - - // Non standard browser env (web workers, react-native) lack needed support. - (function nonStandardBrowserEnv() { - return { - write: function write() {}, - read: function read() { return null; }, - remove: function remove() {} - }; - })() - ); - - -/***/ }), -/* 17 */ -/***/ (function(module, exports, __webpack_require__) { - - 'use strict'; - - var isAbsoluteURL = __webpack_require__(18); - var combineURLs = __webpack_require__(19); - - /** - * Creates a new URL by combining the baseURL with the requestedURL, - * only when the requestedURL is not already an absolute URL. - * If the requestURL is absolute, this function returns the requestedURL untouched. - * - * @param {string} baseURL The base URL - * @param {string} requestedURL Absolute or relative URL to combine - * @returns {string} The combined full path - */ - module.exports = function buildFullPath(baseURL, requestedURL) { - if (baseURL && !isAbsoluteURL(requestedURL)) { - return combineURLs(baseURL, requestedURL); - } - return requestedURL; - }; - - -/***/ }), -/* 18 */ -/***/ (function(module, exports) { - - 'use strict'; - - /** - * Determines whether the specified URL is absolute - * - * @param {string} url The URL to test - * @returns {boolean} True if the specified URL is absolute, otherwise false - */ - module.exports = function isAbsoluteURL(url) { - // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). - // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed - // by any combination of letters, digits, plus, period, or hyphen. - return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url); - }; - - -/***/ }), -/* 19 */ -/***/ (function(module, exports) { - - 'use strict'; - - /** - * Creates a new URL by combining the specified URLs - * - * @param {string} baseURL The base URL - * @param {string} relativeURL The relative URL - * @returns {string} The combined URL - */ - module.exports = function combineURLs(baseURL, relativeURL) { - return relativeURL - ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') - : baseURL; - }; - - -/***/ }), -/* 20 */ -/***/ (function(module, exports, __webpack_require__) { - - 'use strict'; - - var utils = __webpack_require__(2); - - // Headers whose duplicates are ignored by node - // c.f. https://nodejs.org/api/http.html#http_message_headers - var ignoreDuplicateOf = [ - 'age', 'authorization', 'content-length', 'content-type', 'etag', - 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', - 'last-modified', 'location', 'max-forwards', 'proxy-authorization', - 'referer', 'retry-after', 'user-agent' - ]; - - /** - * Parse headers into an object - * - * ``` - * Date: Wed, 27 Aug 2014 08:58:49 GMT - * Content-Type: application/json - * Connection: keep-alive - * Transfer-Encoding: chunked - * ``` - * - * @param {String} headers Headers needing to be parsed - * @returns {Object} Headers parsed into an object - */ - module.exports = function parseHeaders(headers) { - var parsed = {}; - var key; - var val; - var i; - - if (!headers) { return parsed; } - - utils.forEach(headers.split('\n'), function parser(line) { - i = line.indexOf(':'); - key = utils.trim(line.substr(0, i)).toLowerCase(); - val = utils.trim(line.substr(i + 1)); - - if (key) { - if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) { - return; - } - if (key === 'set-cookie') { - parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]); - } else { - parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; - } - } - }); - - return parsed; - }; - - -/***/ }), -/* 21 */ -/***/ (function(module, exports, __webpack_require__) { - - 'use strict'; - - var utils = __webpack_require__(2); - - module.exports = ( - utils.isStandardBrowserEnv() ? - - // Standard browser envs have full support of the APIs needed to test - // whether the request URL is of the same origin as current location. - (function standardBrowserEnv() { - var msie = /(msie|trident)/i.test(navigator.userAgent); - var urlParsingNode = document.createElement('a'); - var originURL; - - /** - * Parse a URL to discover it's components - * - * @param {String} url The URL to be parsed - * @returns {Object} - */ - function resolveURL(url) { - var href = url; - - if (msie) { - // IE needs attribute set twice to normalize properties - urlParsingNode.setAttribute('href', href); - href = urlParsingNode.href; - } - - urlParsingNode.setAttribute('href', href); - - // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils - return { - href: urlParsingNode.href, - protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', - host: urlParsingNode.host, - search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', - hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', - hostname: urlParsingNode.hostname, - port: urlParsingNode.port, - pathname: (urlParsingNode.pathname.charAt(0) === '/') ? - urlParsingNode.pathname : - '/' + urlParsingNode.pathname - }; - } - - originURL = resolveURL(window.location.href); - - /** - * Determine if a URL shares the same origin as the current location - * - * @param {String} requestURL The URL to test - * @returns {boolean} True if URL shares the same origin, otherwise false - */ - return function isURLSameOrigin(requestURL) { - var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; - return (parsed.protocol === originURL.protocol && - parsed.host === originURL.host); - }; - })() : - - // Non standard browser envs (web workers, react-native) lack needed support. - (function nonStandardBrowserEnv() { - return function isURLSameOrigin() { - return true; - }; - })() - ); - - -/***/ }), -/* 22 */ -/***/ (function(module, exports, __webpack_require__) { - - 'use strict'; - - var utils = __webpack_require__(2); - - /** - * Config-specific merge-function which creates a new config-object - * by merging two configuration objects together. - * - * @param {Object} config1 - * @param {Object} config2 - * @returns {Object} New object resulting from merging config2 to config1 - */ - module.exports = function mergeConfig(config1, config2) { - // eslint-disable-next-line no-param-reassign - config2 = config2 || {}; - var config = {}; - - var valueFromConfig2Keys = ['url', 'method', 'data']; - var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params']; - var defaultToConfig2Keys = [ - 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer', - 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName', - 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress', - 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent', - 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding' - ]; - var directMergeKeys = ['validateStatus']; - - function getMergedValue(target, source) { - if (utils.isPlainObject(target) && utils.isPlainObject(source)) { - return utils.merge(target, source); - } else if (utils.isPlainObject(source)) { - return utils.merge({}, source); - } else if (utils.isArray(source)) { - return source.slice(); - } - return source; - } - - function mergeDeepProperties(prop) { - if (!utils.isUndefined(config2[prop])) { - config[prop] = getMergedValue(config1[prop], config2[prop]); - } else if (!utils.isUndefined(config1[prop])) { - config[prop] = getMergedValue(undefined, config1[prop]); - } - } - - utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) { - if (!utils.isUndefined(config2[prop])) { - config[prop] = getMergedValue(undefined, config2[prop]); - } - }); - - utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties); - - utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) { - if (!utils.isUndefined(config2[prop])) { - config[prop] = getMergedValue(undefined, config2[prop]); - } else if (!utils.isUndefined(config1[prop])) { - config[prop] = getMergedValue(undefined, config1[prop]); - } - }); - - utils.forEach(directMergeKeys, function merge(prop) { - if (prop in config2) { - config[prop] = getMergedValue(config1[prop], config2[prop]); - } else if (prop in config1) { - config[prop] = getMergedValue(undefined, config1[prop]); - } - }); - - var axiosKeys = valueFromConfig2Keys - .concat(mergeDeepPropertiesKeys) - .concat(defaultToConfig2Keys) - .concat(directMergeKeys); - - var otherKeys = Object - .keys(config1) - .concat(Object.keys(config2)) - .filter(function filterAxiosKeys(key) { - return axiosKeys.indexOf(key) === -1; - }); - - utils.forEach(otherKeys, mergeDeepProperties); - - return config; - }; - - -/***/ }), -/* 23 */ -/***/ (function(module, exports) { - - 'use strict'; - - /** - * A `Cancel` is an object that is thrown when an operation is canceled. - * - * @class - * @param {string=} message The message. - */ - function Cancel(message) { - this.message = message; - } - - Cancel.prototype.toString = function toString() { - return 'Cancel' + (this.message ? ': ' + this.message : ''); - }; - - Cancel.prototype.__CANCEL__ = true; - - module.exports = Cancel; - - -/***/ }), -/* 24 */ -/***/ (function(module, exports, __webpack_require__) { - - 'use strict'; - - var Cancel = __webpack_require__(23); - - /** - * A `CancelToken` is an object that can be used to request cancellation of an operation. - * - * @class - * @param {Function} executor The executor function. - */ - function CancelToken(executor) { - if (typeof executor !== 'function') { - throw new TypeError('executor must be a function.'); - } - - var resolvePromise; - this.promise = new Promise(function promiseExecutor(resolve) { - resolvePromise = resolve; - }); - - var token = this; - executor(function cancel(message) { - if (token.reason) { - // Cancellation has already been requested - return; - } - - token.reason = new Cancel(message); - resolvePromise(token.reason); - }); - } - - /** - * Throws a `Cancel` if cancellation has been requested. - */ - CancelToken.prototype.throwIfRequested = function throwIfRequested() { - if (this.reason) { - throw this.reason; - } - }; - - /** - * Returns an object that contains a new `CancelToken` and a function that, when called, - * cancels the `CancelToken`. - */ - CancelToken.source = function source() { - var cancel; - var token = new CancelToken(function executor(c) { - cancel = c; - }); - return { - token: token, - cancel: cancel - }; - }; - - module.exports = CancelToken; - - -/***/ }), -/* 25 */ -/***/ (function(module, exports) { - - 'use strict'; - - /** - * Syntactic sugar for invoking a function and expanding an array for arguments. - * - * Common use case would be to use `Function.prototype.apply`. - * - * ```js - * function f(x, y, z) {} - * var args = [1, 2, 3]; - * f.apply(null, args); - * ``` - * - * With `spread` this example can be re-written. - * - * ```js - * spread(function(x, y, z) {})([1, 2, 3]); - * ``` - * - * @param {Function} callback - * @returns {Function} - */ - module.exports = function spread(callback) { - return function wrap(arr) { - return callback.apply(null, arr); - }; - }; - - -/***/ }), -/* 26 */ -/***/ (function(module, exports) { - - 'use strict'; - - /** - * Determines whether the payload is an error thrown by Axios - * - * @param {*} payload The value to test - * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false - */ - module.exports = function isAxiosError(payload) { - return (typeof payload === 'object') && (payload.isAxiosError === true); - }; - - -/***/ }) -/******/ ]) -}); -; -//# sourceMappingURL=axios.map \ No newline at end of file diff --git a/node_modules/axios/dist/axios.map b/node_modules/axios/dist/axios.map deleted file mode 100644 index 6d61f7e..0000000 --- a/node_modules/axios/dist/axios.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 0ad9e9f79033ec4fb28f","webpack:///./index.js","webpack:///./lib/axios.js","webpack:///./lib/utils.js","webpack:///./lib/helpers/bind.js","webpack:///./lib/core/Axios.js","webpack:///./lib/helpers/buildURL.js","webpack:///./lib/core/InterceptorManager.js","webpack:///./lib/core/dispatchRequest.js","webpack:///./lib/core/transformData.js","webpack:///./lib/cancel/isCancel.js","webpack:///./lib/defaults.js","webpack:///./lib/helpers/normalizeHeaderName.js","webpack:///./lib/adapters/xhr.js","webpack:///./lib/core/settle.js","webpack:///./lib/core/createError.js","webpack:///./lib/core/enhanceError.js","webpack:///./lib/helpers/cookies.js","webpack:///./lib/core/buildFullPath.js","webpack:///./lib/helpers/isAbsoluteURL.js","webpack:///./lib/helpers/combineURLs.js","webpack:///./lib/helpers/parseHeaders.js","webpack:///./lib/helpers/isURLSameOrigin.js","webpack:///./lib/core/mergeConfig.js","webpack:///./lib/cancel/Cancel.js","webpack:///./lib/cancel/CancelToken.js","webpack:///./lib/helpers/spread.js","webpack:///./lib/helpers/isAxiosError.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;ACtCA,yC;;;;;;ACAA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,aAAY,MAAM;AAClB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;;;;;;ACvDA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,aAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,aAAa;AACxB,YAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oCAAmC,OAAO;AAC1C;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAuB,SAAS,GAAG,SAAS;AAC5C,4BAA2B;AAC3B;AACA;AACA,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL,6BAA4B;AAC5B,MAAK;AACL;AACA,MAAK;AACL;AACA;AACA;;AAEA,wCAAuC,OAAO;AAC9C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,aAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,IAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,aAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AC9VA;;AAEA;AACA;AACA;AACA,oBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;;;;;;;ACVA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA,IAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iDAAgD;AAChD;AACA;AACA,0BAAyB;AACzB,MAAK;AACL;AACA,EAAC;;AAED;AACA;AACA;AACA,iDAAgD;AAChD;AACA;AACA;AACA,MAAK;AACL;AACA,EAAC;;AAED;;;;;;;AC9FA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA,IAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,QAAO;AACP,MAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;ACrEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,SAAS;AACpB,YAAW,SAAS;AACpB;AACA,aAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;;AAEA;;;;;;;ACnDA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,gCAA+B;AAC/B,wCAAuC;AACvC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,IAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,IAAG;AACH;;;;;;;AC9EA;;AAEA;;AAEA;AACA;AACA;AACA,YAAW,cAAc;AACzB,YAAW,MAAM;AACjB,YAAW,eAAe;AAC1B,cAAa,EAAE;AACf;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;;;;;;;ACnBA;;AAEA;AACA;AACA;;;;;;;ACJA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAwE;AACxE;AACA;AACA;AACA,wDAAuD;AACvD;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,QAAO,YAAY;AACnB;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAC;;AAED;AACA;AACA,EAAC;;AAED;;;;;;;ACjGA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;;;;;;;ACXA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,6CAA4C;AAC5C;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,QAAO;AACP;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAO;AACP;;AAEA;AACA;AACA;;AAEA;AACA;AACA,IAAG;AACH;;;;;;;AClLA;;AAEA;;AAEA;AACA;AACA;AACA,YAAW,SAAS;AACpB,YAAW,SAAS;AACpB,YAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACxBA;;AAEA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,cAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;;;;;;;ACjBA;;AAEA;AACA;AACA;AACA,YAAW,MAAM;AACjB,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,cAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACzCA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,2CAA0C;AAC1C,UAAS;;AAET;AACA,6DAA4D,wBAAwB;AACpF;AACA,UAAS;;AAET;AACA;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA,mCAAkC;AAClC,gCAA+B,aAAa,EAAE;AAC9C;AACA;AACA,MAAK;AACL;;;;;;;ACpDA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACnBA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACbA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;;;;;;ACbA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAiB,eAAe;;AAEhC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA,IAAG;;AAEH;AACA;;;;;;;ACpDA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAc,OAAO;AACrB,iBAAgB;AAChB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,eAAc,OAAO;AACrB,iBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;;;;;;;ACnEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAK;AACL,4BAA2B;AAC3B,MAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAG;;AAEH;;AAEA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA;AACA;;;;;;;ACtFA;;AAEA;AACA;AACA;AACA;AACA,YAAW,QAAQ;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;;;;;;AClBA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACxDA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAA+B;AAC/B;AACA;AACA,YAAW,SAAS;AACpB,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;;;;;;;AC1BA;;AAEA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA","file":"axios.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"axios\"] = factory();\n\telse\n\t\troot[\"axios\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 0ad9e9f79033ec4fb28f","module.exports = require('./lib/axios');\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./index.js\n// module id = 0\n// module chunks = 0","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(mergeConfig(axios.defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/axios.js\n// module id = 1\n// module chunks = 0","'use strict';\n\nvar bind = require('./helpers/bind');\n\n/*global toString:true*/\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/utils.js\n// module id = 2\n// module chunks = 0","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/bind.js\n// module id = 3\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n // Hook up interceptors middleware\n var chain = [dispatchRequest, undefined];\n var promise = Promise.resolve(config);\n\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n chain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n chain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/Axios.js\n// module id = 4\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/buildURL.js\n// module id = 5\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/InterceptorManager.js\n// module id = 6\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData(\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData(\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData(\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/dispatchRequest.js\n// module id = 7\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn(data, headers);\n });\n\n return data;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/transformData.js\n// module id = 8\n// module chunks = 0","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/cancel/isCancel.js\n// module id = 9\n// module chunks = 0","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nvar defaults = {\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data)) {\n setContentTypeIfUnset(headers, 'application/json;charset=utf-8');\n return JSON.stringify(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n /*eslint no-param-reassign:0*/\n if (typeof data === 'string') {\n try {\n data = JSON.parse(data);\n } catch (e) { /* Ignore */ }\n }\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/defaults.js\n// module id = 10\n// module chunks = 0","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/normalizeHeaderName.js\n// module id = 11\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n // Listen for ready state\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n };\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(timeoutErrorMessage, config, 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (config.responseType) {\n try {\n request.responseType = config.responseType;\n } catch (e) {\n // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.\n // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.\n if (config.responseType !== 'json') {\n throw e;\n }\n }\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/adapters/xhr.js\n// module id = 12\n// module chunks = 0","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/settle.js\n// module id = 13\n// module chunks = 0","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/createError.js\n// module id = 14\n// module chunks = 0","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/enhanceError.js\n// module id = 15\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/cookies.js\n// module id = 16\n// module chunks = 0","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/buildFullPath.js\n// module id = 17\n// module chunks = 0","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/isAbsoluteURL.js\n// module id = 18\n// module chunks = 0","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/combineURLs.js\n// module id = 19\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/parseHeaders.js\n// module id = 20\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/isURLSameOrigin.js\n// module id = 21\n// module chunks = 0","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n var valueFromConfig2Keys = ['url', 'method', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n var defaultToConfig2Keys = [\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n ];\n var directMergeKeys = ['validateStatus'];\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n }\n\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n }\n });\n\n utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n utils.forEach(directMergeKeys, function merge(prop) {\n if (prop in config2) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n var axiosKeys = valueFromConfig2Keys\n .concat(mergeDeepPropertiesKeys)\n .concat(defaultToConfig2Keys)\n .concat(directMergeKeys);\n\n var otherKeys = Object\n .keys(config1)\n .concat(Object.keys(config2))\n .filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n\n utils.forEach(otherKeys, mergeDeepProperties);\n\n return config;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/mergeConfig.js\n// module id = 22\n// module chunks = 0","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/cancel/Cancel.js\n// module id = 23\n// module chunks = 0","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/cancel/CancelToken.js\n// module id = 24\n// module chunks = 0","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/spread.js\n// module id = 25\n// module chunks = 0","'use strict';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return (typeof payload === 'object') && (payload.isAxiosError === true);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/isAxiosError.js\n// module id = 26\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file diff --git a/node_modules/axios/dist/axios.min.js b/node_modules/axios/dist/axios.min.js deleted file mode 100644 index fc6c8b6..0000000 --- a/node_modules/axios/dist/axios.min.js +++ /dev/null @@ -1,3 +0,0 @@ -/* axios v0.21.1 | (c) 2020 by Matt Zabriskie */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.axios=t():e.axios=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";function r(e){var t=new i(e),n=s(i.prototype.request,t);return o.extend(n,i.prototype,t),o.extend(n,t),n}var o=n(2),s=n(3),i=n(4),a=n(22),u=n(10),c=r(u);c.Axios=i,c.create=function(e){return r(a(c.defaults,e))},c.Cancel=n(23),c.CancelToken=n(24),c.isCancel=n(9),c.all=function(e){return Promise.all(e)},c.spread=n(25),c.isAxiosError=n(26),e.exports=c,e.exports.default=c},function(e,t,n){"use strict";function r(e){return"[object Array]"===R.call(e)}function o(e){return"undefined"==typeof e}function s(e){return null!==e&&!o(e)&&null!==e.constructor&&!o(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function i(e){return"[object ArrayBuffer]"===R.call(e)}function a(e){return"undefined"!=typeof FormData&&e instanceof FormData}function u(e){var t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer}function c(e){return"string"==typeof e}function f(e){return"number"==typeof e}function p(e){return null!==e&&"object"==typeof e}function d(e){if("[object Object]"!==R.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function l(e){return"[object Date]"===R.call(e)}function h(e){return"[object File]"===R.call(e)}function m(e){return"[object Blob]"===R.call(e)}function y(e){return"[object Function]"===R.call(e)}function g(e){return p(e)&&y(e.pipe)}function v(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams}function x(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}function w(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)}function b(e,t){if(null!==e&&"undefined"!=typeof e)if("object"!=typeof e&&(e=[e]),r(e))for(var n=0,o=e.length;n=200&&e<300}};u.headers={common:{Accept:"application/json, text/plain, */*"}},s.forEach(["delete","get","head"],function(e){u.headers[e]={}}),s.forEach(["post","put","patch"],function(e){u.headers[e]=s.merge(a)}),e.exports=u},function(e,t,n){"use strict";var r=n(2);e.exports=function(e,t){r.forEach(e,function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])})}},function(e,t,n){"use strict";var r=n(2),o=n(13),s=n(16),i=n(5),a=n(17),u=n(20),c=n(21),f=n(14);e.exports=function(e){return new Promise(function(t,n){var p=e.data,d=e.headers;r.isFormData(p)&&delete d["Content-Type"];var l=new XMLHttpRequest;if(e.auth){var h=e.auth.username||"",m=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";d.Authorization="Basic "+btoa(h+":"+m)}var y=a(e.baseURL,e.url);if(l.open(e.method.toUpperCase(),i(y,e.params,e.paramsSerializer),!0),l.timeout=e.timeout,l.onreadystatechange=function(){if(l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in l?u(l.getAllResponseHeaders()):null,s=e.responseType&&"text"!==e.responseType?l.response:l.responseText,i={data:s,status:l.status,statusText:l.statusText,headers:r,config:e,request:l};o(t,n,i),l=null}},l.onabort=function(){l&&(n(f("Request aborted",e,"ECONNABORTED",l)),l=null)},l.onerror=function(){n(f("Network Error",e,null,l)),l=null},l.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(f(t,e,"ECONNABORTED",l)),l=null},r.isStandardBrowserEnv()){var g=(e.withCredentials||c(y))&&e.xsrfCookieName?s.read(e.xsrfCookieName):void 0;g&&(d[e.xsrfHeaderName]=g)}if("setRequestHeader"in l&&r.forEach(d,function(e,t){"undefined"==typeof p&&"content-type"===t.toLowerCase()?delete d[t]:l.setRequestHeader(t,e)}),r.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),e.responseType)try{l.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&l.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then(function(e){l&&(l.abort(),n(e),l=null)}),p||(p=null),l.send(p)})}},function(e,t,n){"use strict";var r=n(14);e.exports=function(e,t,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},function(e,t,n){"use strict";var r=n(15);e.exports=function(e,t,n,o,s){var i=new Error(e);return r(i,t,n,o,s)}},function(e,t){"use strict";e.exports=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},function(e,t,n){"use strict";var r=n(2);e.exports=r.isStandardBrowserEnv()?function(){return{write:function(e,t,n,o,s,i){var a=[];a.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),r.isString(o)&&a.push("path="+o),r.isString(s)&&a.push("domain="+s),i===!0&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},function(e,t,n){"use strict";var r=n(18),o=n(19);e.exports=function(e,t){return e&&!r(t)?o(e,t):t}},function(e,t){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,n){"use strict";var r=n(2),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,s,i={};return e?(r.forEach(e.split("\n"),function(e){if(s=e.indexOf(":"),t=r.trim(e.substr(0,s)).toLowerCase(),n=r.trim(e.substr(s+1)),t){if(i[t]&&o.indexOf(t)>=0)return;"set-cookie"===t?i[t]=(i[t]?i[t]:[]).concat([n]):i[t]=i[t]?i[t]+", "+n:n}}),i):i}},function(e,t,n){"use strict";var r=n(2);e.exports=r.isStandardBrowserEnv()?function(){function e(e){var t=e;return n&&(o.setAttribute("href",t),t=o.href),o.setAttribute("href",t),{href:o.href,protocol:o.protocol?o.protocol.replace(/:$/,""):"",host:o.host,search:o.search?o.search.replace(/^\?/,""):"",hash:o.hash?o.hash.replace(/^#/,""):"",hostname:o.hostname,port:o.port,pathname:"/"===o.pathname.charAt(0)?o.pathname:"/"+o.pathname}}var t,n=/(msie|trident)/i.test(navigator.userAgent),o=document.createElement("a");return t=e(window.location.href),function(n){var o=r.isString(n)?e(n):n;return o.protocol===t.protocol&&o.host===t.host}}():function(){return function(){return!0}}()},function(e,t,n){"use strict";var r=n(2);e.exports=function(e,t){function n(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function o(o){r.isUndefined(t[o])?r.isUndefined(e[o])||(s[o]=n(void 0,e[o])):s[o]=n(e[o],t[o])}t=t||{};var s={},i=["url","method","data"],a=["headers","auth","proxy","params"],u=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],c=["validateStatus"];r.forEach(i,function(e){r.isUndefined(t[e])||(s[e]=n(void 0,t[e]))}),r.forEach(a,o),r.forEach(u,function(o){r.isUndefined(t[o])?r.isUndefined(e[o])||(s[o]=n(void 0,e[o])):s[o]=n(void 0,t[o])}),r.forEach(c,function(r){r in t?s[r]=n(e[r],t[r]):r in e&&(s[r]=n(void 0,e[r]))});var f=i.concat(a).concat(u).concat(c),p=Object.keys(e).concat(Object.keys(t)).filter(function(e){return f.indexOf(e)===-1});return r.forEach(p,o),s}},function(e,t){"use strict";function n(e){this.message=e}n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,e.exports=n},function(e,t,n){"use strict";function r(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var n=this;e(function(e){n.reason||(n.reason=new o(e),t(n.reason))})}var o=n(23);r.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},r.source=function(){var e,t=new r(function(t){e=t});return{token:t,cancel:e}},e.exports=r},function(e,t){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t){"use strict";e.exports=function(e){return"object"==typeof e&&e.isAxiosError===!0}}])}); -//# sourceMappingURL=axios.min.map \ No newline at end of file diff --git a/node_modules/axios/dist/axios.min.map b/node_modules/axios/dist/axios.min.map deleted file mode 100644 index a897631..0000000 --- a/node_modules/axios/dist/axios.min.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///axios.min.js","webpack:///webpack/bootstrap 081842adca0968bb3270","webpack:///./index.js","webpack:///./lib/axios.js","webpack:///./lib/utils.js","webpack:///./lib/helpers/bind.js","webpack:///./lib/core/Axios.js","webpack:///./lib/helpers/buildURL.js","webpack:///./lib/core/InterceptorManager.js","webpack:///./lib/core/dispatchRequest.js","webpack:///./lib/core/transformData.js","webpack:///./lib/cancel/isCancel.js","webpack:///./lib/defaults.js","webpack:///./lib/helpers/normalizeHeaderName.js","webpack:///./lib/adapters/xhr.js","webpack:///./lib/core/settle.js","webpack:///./lib/core/createError.js","webpack:///./lib/core/enhanceError.js","webpack:///./lib/helpers/cookies.js","webpack:///./lib/core/buildFullPath.js","webpack:///./lib/helpers/isAbsoluteURL.js","webpack:///./lib/helpers/combineURLs.js","webpack:///./lib/helpers/parseHeaders.js","webpack:///./lib/helpers/isURLSameOrigin.js","webpack:///./lib/core/mergeConfig.js","webpack:///./lib/cancel/Cancel.js","webpack:///./lib/cancel/CancelToken.js","webpack:///./lib/helpers/spread.js","webpack:///./lib/helpers/isAxiosError.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","createInstance","defaultConfig","context","Axios","instance","bind","prototype","request","utils","extend","mergeConfig","defaults","axios","create","instanceConfig","Cancel","CancelToken","isCancel","all","promises","Promise","spread","isAxiosError","default","isArray","val","toString","isUndefined","isBuffer","constructor","isArrayBuffer","isFormData","FormData","isArrayBufferView","result","ArrayBuffer","isView","buffer","isString","isNumber","isObject","isPlainObject","Object","getPrototypeOf","isDate","isFile","isBlob","isFunction","isStream","pipe","isURLSearchParams","URLSearchParams","trim","str","replace","isStandardBrowserEnv","navigator","product","window","document","forEach","obj","fn","i","l","length","key","hasOwnProperty","merge","assignValue","slice","arguments","a","b","thisArg","stripBOM","content","charCodeAt","args","Array","apply","interceptors","InterceptorManager","response","buildURL","dispatchRequest","config","url","method","toLowerCase","chain","undefined","promise","resolve","interceptor","unshift","fulfilled","rejected","push","then","shift","getUri","params","paramsSerializer","data","encode","encodeURIComponent","serializedParams","parts","v","toISOString","JSON","stringify","join","hashmarkIndex","indexOf","handlers","use","eject","h","throwIfCancellationRequested","cancelToken","throwIfRequested","transformData","headers","transformRequest","common","adapter","transformResponse","reason","reject","fns","value","__CANCEL__","setContentTypeIfUnset","getDefaultAdapter","XMLHttpRequest","process","normalizeHeaderName","DEFAULT_CONTENT_TYPE","Content-Type","parse","e","timeout","xsrfCookieName","xsrfHeaderName","maxContentLength","maxBodyLength","validateStatus","status","Accept","normalizedName","name","toUpperCase","settle","cookies","buildFullPath","parseHeaders","isURLSameOrigin","createError","requestData","requestHeaders","auth","username","password","unescape","Authorization","btoa","fullPath","baseURL","open","onreadystatechange","readyState","responseURL","responseHeaders","getAllResponseHeaders","responseData","responseType","responseText","statusText","onabort","onerror","ontimeout","timeoutErrorMessage","xsrfValue","withCredentials","read","setRequestHeader","onDownloadProgress","addEventListener","onUploadProgress","upload","cancel","abort","send","enhanceError","message","code","error","Error","toJSON","description","number","fileName","lineNumber","columnNumber","stack","write","expires","path","domain","secure","cookie","Date","toGMTString","match","RegExp","decodeURIComponent","remove","now","isAbsoluteURL","combineURLs","requestedURL","test","relativeURL","ignoreDuplicateOf","parsed","split","line","substr","concat","resolveURL","href","msie","urlParsingNode","setAttribute","protocol","host","search","hash","hostname","port","pathname","charAt","originURL","userAgent","createElement","location","requestURL","config1","config2","getMergedValue","target","source","mergeDeepProperties","prop","valueFromConfig2Keys","mergeDeepPropertiesKeys","defaultToConfig2Keys","directMergeKeys","axiosKeys","otherKeys","keys","filter","executor","TypeError","resolvePromise","token","callback","arr","payload"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,UAAAH,GACA,gBAAAC,SACAA,QAAA,MAAAD,IAEAD,EAAA,MAAAC,KACCK,KAAA,WACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAP,OAGA,IAAAC,GAAAO,EAAAD,IACAP,WACAS,GAAAF,EACAG,QAAA,EAUA,OANAL,GAAAE,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAS,QAAA,EAGAT,EAAAD,QAvBA,GAAAQ,KAqCA,OATAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,GAGAR,EAAA,KDgBM,SAAUL,EAAQD,EAASM,GEtDjCL,EAAAD,QAAAM,EAAA,IF4DM,SAAUL,EAAQD,EAASM,GG5DjC,YAcA,SAAAS,GAAAC,GACA,GAAAC,GAAA,GAAAC,GAAAF,GACAG,EAAAC,EAAAF,EAAAG,UAAAC,QAAAL,EAQA,OALAM,GAAAC,OAAAL,EAAAD,EAAAG,UAAAJ,GAGAM,EAAAC,OAAAL,EAAAF,GAEAE,EAtBA,GAAAI,GAAAjB,EAAA,GACAc,EAAAd,EAAA,GACAY,EAAAZ,EAAA,GACAmB,EAAAnB,EAAA,IACAoB,EAAApB,EAAA,IAsBAqB,EAAAZ,EAAAW,EAGAC,GAAAT,QAGAS,EAAAC,OAAA,SAAAC,GACA,MAAAd,GAAAU,EAAAE,EAAAD,SAAAG,KAIAF,EAAAG,OAAAxB,EAAA,IACAqB,EAAAI,YAAAzB,EAAA,IACAqB,EAAAK,SAAA1B,EAAA,GAGAqB,EAAAM,IAAA,SAAAC,GACA,MAAAC,SAAAF,IAAAC,IAEAP,EAAAS,OAAA9B,EAAA,IAGAqB,EAAAU,aAAA/B,EAAA,IAEAL,EAAAD,QAAA2B,EAGA1B,EAAAD,QAAAsC,QAAAX,GHmEM,SAAU1B,EAAQD,EAASM,GI1HjC,YAgBA,SAAAiC,GAAAC,GACA,yBAAAC,EAAA9B,KAAA6B,GASA,QAAAE,GAAAF,GACA,yBAAAA,GASA,QAAAG,GAAAH,GACA,cAAAA,IAAAE,EAAAF,IAAA,OAAAA,EAAAI,cAAAF,EAAAF,EAAAI,cACA,kBAAAJ,GAAAI,YAAAD,UAAAH,EAAAI,YAAAD,SAAAH,GASA,QAAAK,GAAAL,GACA,+BAAAC,EAAA9B,KAAA6B,GASA,QAAAM,GAAAN,GACA,yBAAAO,WAAAP,YAAAO,UASA,QAAAC,GAAAR,GACA,GAAAS,EAMA,OAJAA,GADA,mBAAAC,0BAAA,OACAA,YAAAC,OAAAX,GAEA,GAAAA,EAAA,QAAAA,EAAAY,iBAAAF,aAWA,QAAAG,GAAAb,GACA,sBAAAA,GASA,QAAAc,GAAAd,GACA,sBAAAA,GASA,QAAAe,GAAAf,GACA,cAAAA,GAAA,gBAAAA,GASA,QAAAgB,GAAAhB,GACA,uBAAAC,EAAA9B,KAAA6B,GACA,QAGA,IAAAnB,GAAAoC,OAAAC,eAAAlB,EACA,eAAAnB,OAAAoC,OAAApC,UASA,QAAAsC,GAAAnB,GACA,wBAAAC,EAAA9B,KAAA6B,GASA,QAAAoB,GAAApB,GACA,wBAAAC,EAAA9B,KAAA6B,GASA,QAAAqB,GAAArB,GACA,wBAAAC,EAAA9B,KAAA6B,GASA,QAAAsB,GAAAtB,GACA,4BAAAC,EAAA9B,KAAA6B,GASA,QAAAuB,GAAAvB,GACA,MAAAe,GAAAf,IAAAsB,EAAAtB,EAAAwB,MASA,QAAAC,GAAAzB,GACA,yBAAA0B,kBAAA1B,YAAA0B,iBASA,QAAAC,GAAAC,GACA,MAAAA,GAAAC,QAAA,WAAAA,QAAA,WAkBA,QAAAC,KACA,0BAAAC,YAAA,gBAAAA,UAAAC,SACA,iBAAAD,UAAAC,SACA,OAAAD,UAAAC,WAIA,mBAAAC,SACA,mBAAAC,WAgBA,QAAAC,GAAAC,EAAAC,GAEA,UAAAD,GAAA,mBAAAA,GAUA,GALA,gBAAAA,KAEAA,OAGArC,EAAAqC,GAEA,OAAAE,GAAA,EAAAC,EAAAH,EAAAI,OAAmCF,EAAAC,EAAOD,IAC1CD,EAAAlE,KAAA,KAAAiE,EAAAE,KAAAF,OAIA,QAAAK,KAAAL,GACAnB,OAAApC,UAAA6D,eAAAvE,KAAAiE,EAAAK,IACAJ,EAAAlE,KAAA,KAAAiE,EAAAK,KAAAL,GAuBA,QAAAO,KAEA,QAAAC,GAAA5C,EAAAyC,GACAzB,EAAAP,EAAAgC,KAAAzB,EAAAhB,GACAS,EAAAgC,GAAAE,EAAAlC,EAAAgC,GAAAzC,GACKgB,EAAAhB,GACLS,EAAAgC,GAAAE,KAA4B3C,GACvBD,EAAAC,GACLS,EAAAgC,GAAAzC,EAAA6C,QAEApC,EAAAgC,GAAAzC,EAIA,OAbAS,MAaA6B,EAAA,EAAAC,EAAAO,UAAAN,OAAuCF,EAAAC,EAAOD,IAC9CH,EAAAW,UAAAR,GAAAM,EAEA,OAAAnC,GAWA,QAAAzB,GAAA+D,EAAAC,EAAAC,GAQA,MAPAd,GAAAa,EAAA,SAAAhD,EAAAyC,GACAQ,GAAA,kBAAAjD,GACA+C,EAAAN,GAAA7D,EAAAoB,EAAAiD,GAEAF,EAAAN,GAAAzC,IAGA+C,EASA,QAAAG,GAAAC,GAIA,MAHA,SAAAA,EAAAC,WAAA,KACAD,IAAAN,MAAA,IAEAM,EAlUA,GAAAvE,GAAAd,EAAA,GAMAmC,EAAAgB,OAAApC,UAAAoB,QA+TAxC,GAAAD,SACAuC,UACAM,gBACAF,WACAG,aACAE,oBACAK,WACAC,WACAC,WACAC,gBACAd,cACAiB,SACAC,SACAC,SACAC,aACAC,WACAE,oBACAK,uBACAK,UACAQ,QACA3D,SACA2C,OACAuB,aJkIM,SAAUzF,EAAQD,GK/dxB,YAEAC,GAAAD,QAAA,SAAA6E,EAAAY,GACA,kBAEA,OADAI,GAAA,GAAAC,OAAAR,UAAAN,QACAF,EAAA,EAAmBA,EAAAe,EAAAb,OAAiBF,IACpCe,EAAAf,GAAAQ,UAAAR,EAEA,OAAAD,GAAAkB,MAAAN,EAAAI,MLweM,SAAU5F,EAAQD,EAASM,GMhfjC,YAaA,SAAAY,GAAAW,GACAzB,KAAAsB,SAAAG,EACAzB,KAAA4F,cACA1E,QAAA,GAAA2E,GACAC,SAAA,GAAAD,IAfA,GAAA1E,GAAAjB,EAAA,GACA6F,EAAA7F,EAAA,GACA2F,EAAA3F,EAAA,GACA8F,EAAA9F,EAAA,GACAmB,EAAAnB,EAAA,GAoBAY,GAAAG,UAAAC,QAAA,SAAA+E,GAGA,gBAAAA,IACAA,EAAAf,UAAA,OACAe,EAAAC,IAAAhB,UAAA,IAEAe,QAGAA,EAAA5E,EAAArB,KAAAsB,SAAA2E,GAGAA,EAAAE,OACAF,EAAAE,OAAAF,EAAAE,OAAAC,cACGpG,KAAAsB,SAAA6E,OACHF,EAAAE,OAAAnG,KAAAsB,SAAA6E,OAAAC,cAEAH,EAAAE,OAAA,KAIA,IAAAE,IAAAL,EAAAM,QACAC,EAAAxE,QAAAyE,QAAAP,EAUA,KARAjG,KAAA4F,aAAA1E,QAAAqD,QAAA,SAAAkC,GACAJ,EAAAK,QAAAD,EAAAE,UAAAF,EAAAG,YAGA5G,KAAA4F,aAAAE,SAAAvB,QAAA,SAAAkC,GACAJ,EAAAQ,KAAAJ,EAAAE,UAAAF,EAAAG,YAGAP,EAAAzB,QACA2B,IAAAO,KAAAT,EAAAU,QAAAV,EAAAU,QAGA,OAAAR,IAGAzF,EAAAG,UAAA+F,OAAA,SAAAf,GAEA,MADAA,GAAA5E,EAAArB,KAAAsB,SAAA2E,GACAF,EAAAE,EAAAC,IAAAD,EAAAgB,OAAAhB,EAAAiB,kBAAAjD,QAAA,WAIA9C,EAAAoD,SAAA,0CAAA4B,GAEArF,EAAAG,UAAAkF,GAAA,SAAAD,EAAAD,GACA,MAAAjG,MAAAkB,QAAAG,EAAA4E,OACAE,SACAD,MACAiB,MAAAlB,OAAyBkB,WAKzBhG,EAAAoD,SAAA,+BAAA4B,GAEArF,EAAAG,UAAAkF,GAAA,SAAAD,EAAAiB,EAAAlB,GACA,MAAAjG,MAAAkB,QAAAG,EAAA4E,OACAE,SACAD,MACAiB,aAKAtH,EAAAD,QAAAkB,GNufM,SAAUjB,EAAQD,EAASM,GOrlBjC,YAIA,SAAAkH,GAAAhF,GACA,MAAAiF,oBAAAjF,GACA6B,QAAA,aACAA,QAAA,YACAA,QAAA,aACAA,QAAA,YACAA,QAAA,aACAA,QAAA,aATA,GAAA9C,GAAAjB,EAAA,EAmBAL,GAAAD,QAAA,SAAAsG,EAAAe,EAAAC,GAEA,IAAAD,EACA,MAAAf,EAGA,IAAAoB,EACA,IAAAJ,EACAI,EAAAJ,EAAAD,OACG,IAAA9F,EAAA0C,kBAAAoD,GACHK,EAAAL,EAAA5E,eACG,CACH,GAAAkF,KAEApG,GAAAoD,QAAA0C,EAAA,SAAA7E,EAAAyC,GACA,OAAAzC,GAAA,mBAAAA,KAIAjB,EAAAgB,QAAAC,GACAyC,GAAA,KAEAzC,MAGAjB,EAAAoD,QAAAnC,EAAA,SAAAoF,GACArG,EAAAoC,OAAAiE,GACAA,IAAAC,cACStG,EAAAgC,SAAAqE,KACTA,EAAAE,KAAAC,UAAAH,IAEAD,EAAAV,KAAAO,EAAAvC,GAAA,IAAAuC,EAAAI,SAIAF,EAAAC,EAAAK,KAAA,KAGA,GAAAN,EAAA,CACA,GAAAO,GAAA3B,EAAA4B,QAAA,IACAD,MAAA,IACA3B,IAAAjB,MAAA,EAAA4C,IAGA3B,MAAA4B,QAAA,mBAAAR,EAGA,MAAApB,KP6lBM,SAAUrG,EAAQD,EAASM,GQjqBjC,YAIA,SAAA2F,KACA7F,KAAA+H,YAHA,GAAA5G,GAAAjB,EAAA,EAcA2F,GAAA5E,UAAA+G,IAAA,SAAArB,EAAAC,GAKA,MAJA5G,MAAA+H,SAAAlB,MACAF,YACAC,aAEA5G,KAAA+H,SAAAnD,OAAA,GAQAiB,EAAA5E,UAAAgH,MAAA,SAAA5H,GACAL,KAAA+H,SAAA1H,KACAL,KAAA+H,SAAA1H,GAAA,OAYAwF,EAAA5E,UAAAsD,QAAA,SAAAE,GACAtD,EAAAoD,QAAAvE,KAAA+H,SAAA,SAAAG,GACA,OAAAA,GACAzD,EAAAyD,MAKArI,EAAAD,QAAAiG,GRwqBM,SAAUhG,EAAQD,EAASM,GS3tBjC,YAUA,SAAAiI,GAAAlC,GACAA,EAAAmC,aACAnC,EAAAmC,YAAAC,mBAVA,GAAAlH,GAAAjB,EAAA,GACAoI,EAAApI,EAAA,GACA0B,EAAA1B,EAAA,GACAoB,EAAApB,EAAA,GAiBAL,GAAAD,QAAA,SAAAqG,GACAkC,EAAAlC,GAGAA,EAAAsC,QAAAtC,EAAAsC,YAGAtC,EAAAkB,KAAAmB,EACArC,EAAAkB,KACAlB,EAAAsC,QACAtC,EAAAuC,kBAIAvC,EAAAsC,QAAApH,EAAA4D,MACAkB,EAAAsC,QAAAE,WACAxC,EAAAsC,QAAAtC,EAAAE,YACAF,EAAAsC,SAGApH,EAAAoD,SACA,qDACA,SAAA4B,SACAF,GAAAsC,QAAApC,IAIA,IAAAuC,GAAAzC,EAAAyC,SAAApH,EAAAoH,OAEA,OAAAA,GAAAzC,GAAAa,KAAA,SAAAhB,GAUA,MATAqC,GAAAlC,GAGAH,EAAAqB,KAAAmB,EACAxC,EAAAqB,KACArB,EAAAyC,QACAtC,EAAA0C,mBAGA7C,GACG,SAAA8C,GAcH,MAbAhH,GAAAgH,KACAT,EAAAlC,GAGA2C,KAAA9C,WACA8C,EAAA9C,SAAAqB,KAAAmB,EACAM,EAAA9C,SAAAqB,KACAyB,EAAA9C,SAAAyC,QACAtC,EAAA0C,qBAKA5G,QAAA8G,OAAAD,OTouBM,SAAU/I,EAAQD,EAASM,GUhzBjC,YAEA,IAAAiB,GAAAjB,EAAA,EAUAL,GAAAD,QAAA,SAAAuH,EAAAoB,EAAAO,GAMA,MAJA3H,GAAAoD,QAAAuE,EAAA,SAAArE,GACA0C,EAAA1C,EAAA0C,EAAAoB,KAGApB,IVwzBM,SAAUtH,EAAQD,GW10BxB,YAEAC,GAAAD,QAAA,SAAAmJ,GACA,SAAAA,MAAAC,cXk1BM,SAAUnJ,EAAQD,EAASM,GYr1BjC,YASA,SAAA+I,GAAAV,EAAAQ,IACA5H,EAAAmB,YAAAiG,IAAApH,EAAAmB,YAAAiG,EAAA,mBACAA,EAAA,gBAAAQ,GAIA,QAAAG,KACA,GAAAR,EAQA,OAPA,mBAAAS,gBAEAT,EAAAxI,EAAA,IACG,mBAAAkJ,UAAA,qBAAA/F,OAAApC,UAAAoB,SAAA9B,KAAA6I,WAEHV,EAAAxI,EAAA,KAEAwI,EAtBA,GAAAvH,GAAAjB,EAAA,GACAmJ,EAAAnJ,EAAA,IAEAoJ,GACAC,eAAA,qCAqBAjI,GACAoH,QAAAQ,IAEAV,kBAAA,SAAArB,EAAAoB,GAGA,MAFAc,GAAAd,EAAA,UACAc,EAAAd,EAAA,gBACApH,EAAAuB,WAAAyE,IACAhG,EAAAsB,cAAA0E,IACAhG,EAAAoB,SAAA4E,IACAhG,EAAAwC,SAAAwD,IACAhG,EAAAqC,OAAA2D,IACAhG,EAAAsC,OAAA0D,GAEAA,EAEAhG,EAAAyB,kBAAAuE,GACAA,EAAAnE,OAEA7B,EAAA0C,kBAAAsD,IACA8B,EAAAV,EAAA,mDACApB,EAAA9E,YAEAlB,EAAAgC,SAAAgE,IACA8B,EAAAV,EAAA,kCACAb,KAAAC,UAAAR,IAEAA,IAGAwB,mBAAA,SAAAxB,GAEA,mBAAAA,GACA,IACAA,EAAAO,KAAA8B,MAAArC,GACO,MAAAsC,IAEP,MAAAtC,KAOAuC,QAAA,EAEAC,eAAA,aACAC,eAAA,eAEAC,kBAAA,EACAC,eAAA,EAEAC,eAAA,SAAAC,GACA,MAAAA,IAAA,KAAAA,EAAA,KAIA1I,GAAAiH,SACAE,QACAwB,OAAA,sCAIA9I,EAAAoD,SAAA,gCAAA4B,GACA7E,EAAAiH,QAAApC,QAGAhF,EAAAoD,SAAA,+BAAA4B,GACA7E,EAAAiH,QAAApC,GAAAhF,EAAA4D,MAAAuE,KAGAzJ,EAAAD,QAAA0B,GZ41BM,SAAUzB,EAAQD,EAASM,Ga77BjC,YAEA,IAAAiB,GAAAjB,EAAA,EAEAL,GAAAD,QAAA,SAAA2I,EAAA2B,GACA/I,EAAAoD,QAAAgE,EAAA,SAAAQ,EAAAoB,GACAA,IAAAD,GAAAC,EAAAC,gBAAAF,EAAAE,gBACA7B,EAAA2B,GAAAnB,QACAR,GAAA4B,Qbu8BM,SAAUtK,EAAQD,EAASM,Gc/8BjC,YAEA,IAAAiB,GAAAjB,EAAA,GACAmK,EAAAnK,EAAA,IACAoK,EAAApK,EAAA,IACA6F,EAAA7F,EAAA,GACAqK,EAAArK,EAAA,IACAsK,EAAAtK,EAAA,IACAuK,EAAAvK,EAAA,IACAwK,EAAAxK,EAAA,GAEAL,GAAAD,QAAA,SAAAqG,GACA,UAAAlE,SAAA,SAAAyE,EAAAqC,GACA,GAAA8B,GAAA1E,EAAAkB,KACAyD,EAAA3E,EAAAsC,OAEApH,GAAAuB,WAAAiI,UACAC,GAAA,eAGA,IAAA1J,GAAA,GAAAiI,eAGA,IAAAlD,EAAA4E,KAAA,CACA,GAAAC,GAAA7E,EAAA4E,KAAAC,UAAA,GACAC,EAAA9E,EAAA4E,KAAAE,SAAAC,SAAA3D,mBAAApB,EAAA4E,KAAAE,WAAA,EACAH,GAAAK,cAAA,SAAAC,KAAAJ,EAAA,IAAAC,GAGA,GAAAI,GAAAZ,EAAAtE,EAAAmF,QAAAnF,EAAAC,IA4EA,IA3EAhF,EAAAmK,KAAApF,EAAAE,OAAAiE,cAAArE,EAAAoF,EAAAlF,EAAAgB,OAAAhB,EAAAiB,mBAAA,GAGAhG,EAAAwI,QAAAzD,EAAAyD,QAGAxI,EAAAoK,mBAAA,WACA,GAAApK,GAAA,IAAAA,EAAAqK,aAQA,IAAArK,EAAA8I,QAAA9I,EAAAsK,aAAA,IAAAtK,EAAAsK,YAAA1D,QAAA,WAKA,GAAA2D,GAAA,yBAAAvK,GAAAsJ,EAAAtJ,EAAAwK,yBAAA,KACAC,EAAA1F,EAAA2F,cAAA,SAAA3F,EAAA2F,aAAA1K,EAAA4E,SAAA5E,EAAA2K,aACA/F,GACAqB,KAAAwE,EACA3B,OAAA9I,EAAA8I,OACA8B,WAAA5K,EAAA4K,WACAvD,QAAAkD,EACAxF,SACA/E,UAGAmJ,GAAA7D,EAAAqC,EAAA/C,GAGA5E,EAAA,OAIAA,EAAA6K,QAAA,WACA7K,IAIA2H,EAAA6B,EAAA,kBAAAzE,EAAA,eAAA/E,IAGAA,EAAA,OAIAA,EAAA8K,QAAA,WAGAnD,EAAA6B,EAAA,gBAAAzE,EAAA,KAAA/E,IAGAA,EAAA,MAIAA,EAAA+K,UAAA,WACA,GAAAC,GAAA,cAAAjG,EAAAyD,QAAA,aACAzD,GAAAiG,sBACAA,EAAAjG,EAAAiG,qBAEArD,EAAA6B,EAAAwB,EAAAjG,EAAA,eACA/E,IAGAA,EAAA,MAMAC,EAAA+C,uBAAA,CAEA,GAAAiI,IAAAlG,EAAAmG,iBAAA3B,EAAAU,KAAAlF,EAAA0D,eACAW,EAAA+B,KAAApG,EAAA0D,gBACArD,MAEA6F,KACAvB,EAAA3E,EAAA2D,gBAAAuC,GAuBA,GAlBA,oBAAAjL,IACAC,EAAAoD,QAAAqG,EAAA,SAAAxI,EAAAyC,GACA,mBAAA8F,IAAA,iBAAA9F,EAAAuB,oBAEAwE,GAAA/F,GAGA3D,EAAAoL,iBAAAzH,EAAAzC,KAMAjB,EAAAmB,YAAA2D,EAAAmG,mBACAlL,EAAAkL,kBAAAnG,EAAAmG,iBAIAnG,EAAA2F,aACA,IACA1K,EAAA0K,aAAA3F,EAAA2F,aACO,MAAAnC,GAGP,YAAAxD,EAAA2F,aACA,KAAAnC,GAMA,kBAAAxD,GAAAsG,oBACArL,EAAAsL,iBAAA,WAAAvG,EAAAsG,oBAIA,kBAAAtG,GAAAwG,kBAAAvL,EAAAwL,QACAxL,EAAAwL,OAAAF,iBAAA,WAAAvG,EAAAwG,kBAGAxG,EAAAmC,aAEAnC,EAAAmC,YAAA7B,QAAAO,KAAA,SAAA6F,GACAzL,IAIAA,EAAA0L,QACA/D,EAAA8D,GAEAzL,EAAA,QAIAyJ,IACAA,EAAA,MAIAzJ,EAAA2L,KAAAlC,Odw9BM,SAAU9K,EAAQD,EAASM,GexoCjC,YAEA,IAAAwK,GAAAxK,EAAA,GASAL,GAAAD,QAAA,SAAA4G,EAAAqC,EAAA/C,GACA,GAAAiE,GAAAjE,EAAAG,OAAA8D,cACAjE,GAAAkE,QAAAD,MAAAjE,EAAAkE,QAGAnB,EAAA6B,EACA,mCAAA5E,EAAAkE,OACAlE,EAAAG,OACA,KACAH,EAAA5E,QACA4E,IAPAU,EAAAV,KfypCM,SAAUjG,EAAQD,EAASM,GgBvqCjC,YAEA,IAAA4M,GAAA5M,EAAA,GAYAL,GAAAD,QAAA,SAAAmN,EAAA9G,EAAA+G,EAAA9L,EAAA4E,GACA,GAAAmH,GAAA,GAAAC,OAAAH,EACA,OAAAD,GAAAG,EAAAhH,EAAA+G,EAAA9L,EAAA4E,KhB+qCM,SAAUjG,EAAQD,GiB/rCxB,YAYAC,GAAAD,QAAA,SAAAqN,EAAAhH,EAAA+G,EAAA9L,EAAA4E,GA4BA,MA3BAmH,GAAAhH,SACA+G,IACAC,EAAAD,QAGAC,EAAA/L,UACA+L,EAAAnH,WACAmH,EAAAhL,cAAA,EAEAgL,EAAAE,OAAA,WACA,OAEAJ,QAAA/M,KAAA+M,QACA5C,KAAAnK,KAAAmK,KAEAiD,YAAApN,KAAAoN,YACAC,OAAArN,KAAAqN,OAEAC,SAAAtN,KAAAsN,SACAC,WAAAvN,KAAAuN,WACAC,aAAAxN,KAAAwN,aACAC,MAAAzN,KAAAyN,MAEAxH,OAAAjG,KAAAiG,OACA+G,KAAAhN,KAAAgN,OAGAC,IjBusCM,SAAUpN,EAAQD,EAASM,GkB/uCjC,YAEA,IAAAiB,GAAAjB,EAAA,EAEAL,GAAAD,QACAuB,EAAA+C,uBAGA,WACA,OACAwJ,MAAA,SAAAvD,EAAApB,EAAA4E,EAAAC,EAAAC,EAAAC,GACA,GAAAC,KACAA,GAAAlH,KAAAsD,EAAA,IAAA9C,mBAAA0B,IAEA5H,EAAA+B,SAAAyK,IACAI,EAAAlH,KAAA,cAAAmH,MAAAL,GAAAM,eAGA9M,EAAA8B,SAAA2K,IACAG,EAAAlH,KAAA,QAAA+G,GAGAzM,EAAA8B,SAAA4K,IACAE,EAAAlH,KAAA,UAAAgH,GAGAC,KAAA,GACAC,EAAAlH,KAAA,UAGAvC,SAAAyJ,SAAAnG,KAAA,OAGAyE,KAAA,SAAAlC,GACA,GAAA+D,GAAA5J,SAAAyJ,OAAAG,MAAA,GAAAC,QAAA,aAA4DhE,EAAA,aAC5D,OAAA+D,GAAAE,mBAAAF,EAAA,UAGAG,OAAA,SAAAlE,GACAnK,KAAA0N,MAAAvD,EAAA,GAAA6D,KAAAM,MAAA,YAMA,WACA,OACAZ,MAAA,aACArB,KAAA,WAA+B,aAC/BgC,OAAA,kBlByvCM,SAAUxO,EAAQD,EAASM,GmB1yCjC,YAEA,IAAAqO,GAAArO,EAAA,IACAsO,EAAAtO,EAAA,GAWAL,GAAAD,QAAA,SAAAwL,EAAAqD,GACA,MAAArD,KAAAmD,EAAAE,GACAD,EAAApD,EAAAqD,GAEAA,InBkzCM,SAAU5O,EAAQD,GoBp0CxB,YAQAC,GAAAD,QAAA,SAAAsG,GAIA,sCAAAwI,KAAAxI,KpB40CM,SAAUrG,EAAQD,GqBx1CxB,YASAC,GAAAD,QAAA,SAAAwL,EAAAuD,GACA,MAAAA,GACAvD,EAAAnH,QAAA,eAAA0K,EAAA1K,QAAA,WACAmH,IrBg2CM,SAAUvL,EAAQD,EAASM,GsB52CjC,YAEA,IAAAiB,GAAAjB,EAAA,GAIA0O,GACA,6DACA,kEACA,gEACA,qCAgBA/O,GAAAD,QAAA,SAAA2I,GACA,GACA1D,GACAzC,EACAsC,EAHAmK,IAKA,OAAAtG,IAEApH,EAAAoD,QAAAgE,EAAAuG,MAAA,eAAAC,GAKA,GAJArK,EAAAqK,EAAAjH,QAAA,KACAjD,EAAA1D,EAAA4C,KAAAgL,EAAAC,OAAA,EAAAtK,IAAA0B,cACAhE,EAAAjB,EAAA4C,KAAAgL,EAAAC,OAAAtK,EAAA,IAEAG,EAAA,CACA,GAAAgK,EAAAhK,IAAA+J,EAAA9G,QAAAjD,IAAA,EACA,MAEA,gBAAAA,EACAgK,EAAAhK,IAAAgK,EAAAhK,GAAAgK,EAAAhK,OAAAoK,QAAA7M,IAEAyM,EAAAhK,GAAAgK,EAAAhK,GAAAgK,EAAAhK,GAAA,KAAAzC,OAKAyM,GAnBiBA,ItBu4CX,SAAUhP,EAAQD,EAASM,GuBv6CjC,YAEA,IAAAiB,GAAAjB,EAAA,EAEAL,GAAAD,QACAuB,EAAA+C,uBAIA,WAWA,QAAAgL,GAAAhJ,GACA,GAAAiJ,GAAAjJ,CAWA,OATAkJ,KAEAC,EAAAC,aAAA,OAAAH,GACAA,EAAAE,EAAAF,MAGAE,EAAAC,aAAA,OAAAH,IAIAA,KAAAE,EAAAF,KACAI,SAAAF,EAAAE,SAAAF,EAAAE,SAAAtL,QAAA,YACAuL,KAAAH,EAAAG,KACAC,OAAAJ,EAAAI,OAAAJ,EAAAI,OAAAxL,QAAA,aACAyL,KAAAL,EAAAK,KAAAL,EAAAK,KAAAzL,QAAA,YACA0L,SAAAN,EAAAM,SACAC,KAAAP,EAAAO,KACAC,SAAA,MAAAR,EAAAQ,SAAAC,OAAA,GACAT,EAAAQ,SACA,IAAAR,EAAAQ,UAhCA,GAEAE,GAFAX,EAAA,kBAAAV,KAAAvK,UAAA6L,WACAX,EAAA/K,SAAA2L,cAAA,IA2CA,OARAF,GAAAb,EAAA7K,OAAA6L,SAAAf,MAQA,SAAAgB,GACA,GAAAtB,GAAA1N,EAAA8B,SAAAkN,GAAAjB,EAAAiB,IACA,OAAAtB,GAAAU,WAAAQ,EAAAR,UACAV,EAAAW,OAAAO,EAAAP,SAKA,WACA,kBACA,cvBi7CM,SAAU3P,EAAQD,EAASM,GwBj/CjC,YAEA,IAAAiB,GAAAjB,EAAA,EAUAL,GAAAD,QAAA,SAAAwQ,EAAAC,GAgBA,QAAAC,GAAAC,EAAAC,GACA,MAAArP,GAAAiC,cAAAmN,IAAApP,EAAAiC,cAAAoN,GACArP,EAAA4D,MAAAwL,EAAAC,GACKrP,EAAAiC,cAAAoN,GACLrP,EAAA4D,SAA2ByL,GACtBrP,EAAAgB,QAAAqO,GACLA,EAAAvL,QAEAuL,EAGA,QAAAC,GAAAC,GACAvP,EAAAmB,YAAA+N,EAAAK,IAEKvP,EAAAmB,YAAA8N,EAAAM,MACLzK,EAAAyK,GAAAJ,EAAAhK,OAAA8J,EAAAM,KAFAzK,EAAAyK,GAAAJ,EAAAF,EAAAM,GAAAL,EAAAK,IA3BAL,OACA,IAAApK,MAEA0K,GAAA,uBACAC,GAAA,mCACAC,GACA,oEACA,uFACA,sEACA,0EACA,4DAEAC,GAAA,iBAqBA3P,GAAAoD,QAAAoM,EAAA,SAAAD,GACAvP,EAAAmB,YAAA+N,EAAAK,MACAzK,EAAAyK,GAAAJ,EAAAhK,OAAA+J,EAAAK,OAIAvP,EAAAoD,QAAAqM,EAAAH,GAEAtP,EAAAoD,QAAAsM,EAAA,SAAAH,GACAvP,EAAAmB,YAAA+N,EAAAK,IAEKvP,EAAAmB,YAAA8N,EAAAM,MACLzK,EAAAyK,GAAAJ,EAAAhK,OAAA8J,EAAAM,KAFAzK,EAAAyK,GAAAJ,EAAAhK,OAAA+J,EAAAK,MAMAvP,EAAAoD,QAAAuM,EAAA,SAAAJ,GACAA,IAAAL,GACApK,EAAAyK,GAAAJ,EAAAF,EAAAM,GAAAL,EAAAK,IACKA,IAAAN,KACLnK,EAAAyK,GAAAJ,EAAAhK,OAAA8J,EAAAM,MAIA,IAAAK,GAAAJ,EACA1B,OAAA2B,GACA3B,OAAA4B,GACA5B,OAAA6B,GAEAE,EAAA3N,OACA4N,KAAAb,GACAnB,OAAA5L,OAAA4N,KAAAZ,IACAa,OAAA,SAAArM,GACA,MAAAkM,GAAAjJ,QAAAjD,MAAA,GAKA,OAFA1D,GAAAoD,QAAAyM,EAAAP,GAEAxK,IxBy/CM,SAAUpG,EAAQD,GyB9kDxB,YAQA,SAAA8B,GAAAqL,GACA/M,KAAA+M,UAGArL,EAAAT,UAAAoB,SAAA,WACA,gBAAArC,KAAA+M,QAAA,KAAA/M,KAAA+M,QAAA,KAGArL,EAAAT,UAAA+H,YAAA,EAEAnJ,EAAAD,QAAA8B,GzBqlDM,SAAU7B,EAAQD,EAASM,G0BvmDjC,YAUA,SAAAyB,GAAAwP,GACA,qBAAAA,GACA,SAAAC,WAAA,+BAGA,IAAAC,EACArR,MAAAuG,QAAA,GAAAxE,SAAA,SAAAyE,GACA6K,EAAA7K,GAGA,IAAA8K,GAAAtR,IACAmR,GAAA,SAAApE,GACAuE,EAAA1I,SAKA0I,EAAA1I,OAAA,GAAAlH,GAAAqL,GACAsE,EAAAC,EAAA1I,WA1BA,GAAAlH,GAAAxB,EAAA,GAiCAyB,GAAAV,UAAAoH,iBAAA,WACA,GAAArI,KAAA4I,OACA,KAAA5I,MAAA4I,QAQAjH,EAAA6O,OAAA,WACA,GAAA7D,GACA2E,EAAA,GAAA3P,GAAA,SAAAlB,GACAkM,EAAAlM,GAEA,QACA6Q,QACA3E,WAIA9M,EAAAD,QAAA+B,G1B8mDM,SAAU9B,EAAQD,G2BtqDxB,YAsBAC,GAAAD,QAAA,SAAA2R,GACA,gBAAAC,GACA,MAAAD,GAAA5L,MAAA,KAAA6L,M3B+qDM,SAAU3R,EAAQD,G4BvsDxB,YAQAC,GAAAD,QAAA,SAAA6R,GACA,sBAAAA,MAAAxP,gBAAA","file":"axios.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"axios\"] = factory();\n\telse\n\t\troot[\"axios\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"axios\"] = factory();\n\telse\n\t\troot[\"axios\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __webpack_require__(1);\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\tvar bind = __webpack_require__(3);\n\tvar Axios = __webpack_require__(4);\n\tvar mergeConfig = __webpack_require__(22);\n\tvar defaults = __webpack_require__(10);\n\t\n\t/**\n\t * Create an instance of Axios\n\t *\n\t * @param {Object} defaultConfig The default config for the instance\n\t * @return {Axios} A new instance of Axios\n\t */\n\tfunction createInstance(defaultConfig) {\n\t var context = new Axios(defaultConfig);\n\t var instance = bind(Axios.prototype.request, context);\n\t\n\t // Copy axios.prototype to instance\n\t utils.extend(instance, Axios.prototype, context);\n\t\n\t // Copy context to instance\n\t utils.extend(instance, context);\n\t\n\t return instance;\n\t}\n\t\n\t// Create the default instance to be exported\n\tvar axios = createInstance(defaults);\n\t\n\t// Expose Axios class to allow class inheritance\n\taxios.Axios = Axios;\n\t\n\t// Factory for creating new instances\n\taxios.create = function create(instanceConfig) {\n\t return createInstance(mergeConfig(axios.defaults, instanceConfig));\n\t};\n\t\n\t// Expose Cancel & CancelToken\n\taxios.Cancel = __webpack_require__(23);\n\taxios.CancelToken = __webpack_require__(24);\n\taxios.isCancel = __webpack_require__(9);\n\t\n\t// Expose all/spread\n\taxios.all = function all(promises) {\n\t return Promise.all(promises);\n\t};\n\taxios.spread = __webpack_require__(25);\n\t\n\t// Expose isAxiosError\n\taxios.isAxiosError = __webpack_require__(26);\n\t\n\tmodule.exports = axios;\n\t\n\t// Allow use of default import syntax in TypeScript\n\tmodule.exports.default = axios;\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar bind = __webpack_require__(3);\n\t\n\t/*global toString:true*/\n\t\n\t// utils is a library of generic helper functions non-specific to axios\n\t\n\tvar toString = Object.prototype.toString;\n\t\n\t/**\n\t * Determine if a value is an Array\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is an Array, otherwise false\n\t */\n\tfunction isArray(val) {\n\t return toString.call(val) === '[object Array]';\n\t}\n\t\n\t/**\n\t * Determine if a value is undefined\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if the value is undefined, otherwise false\n\t */\n\tfunction isUndefined(val) {\n\t return typeof val === 'undefined';\n\t}\n\t\n\t/**\n\t * Determine if a value is a Buffer\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a Buffer, otherwise false\n\t */\n\tfunction isBuffer(val) {\n\t return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n\t && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n\t}\n\t\n\t/**\n\t * Determine if a value is an ArrayBuffer\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n\t */\n\tfunction isArrayBuffer(val) {\n\t return toString.call(val) === '[object ArrayBuffer]';\n\t}\n\t\n\t/**\n\t * Determine if a value is a FormData\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is an FormData, otherwise false\n\t */\n\tfunction isFormData(val) {\n\t return (typeof FormData !== 'undefined') && (val instanceof FormData);\n\t}\n\t\n\t/**\n\t * Determine if a value is a view on an ArrayBuffer\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n\t */\n\tfunction isArrayBufferView(val) {\n\t var result;\n\t if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n\t result = ArrayBuffer.isView(val);\n\t } else {\n\t result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n\t }\n\t return result;\n\t}\n\t\n\t/**\n\t * Determine if a value is a String\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a String, otherwise false\n\t */\n\tfunction isString(val) {\n\t return typeof val === 'string';\n\t}\n\t\n\t/**\n\t * Determine if a value is a Number\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a Number, otherwise false\n\t */\n\tfunction isNumber(val) {\n\t return typeof val === 'number';\n\t}\n\t\n\t/**\n\t * Determine if a value is an Object\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is an Object, otherwise false\n\t */\n\tfunction isObject(val) {\n\t return val !== null && typeof val === 'object';\n\t}\n\t\n\t/**\n\t * Determine if a value is a plain Object\n\t *\n\t * @param {Object} val The value to test\n\t * @return {boolean} True if value is a plain Object, otherwise false\n\t */\n\tfunction isPlainObject(val) {\n\t if (toString.call(val) !== '[object Object]') {\n\t return false;\n\t }\n\t\n\t var prototype = Object.getPrototypeOf(val);\n\t return prototype === null || prototype === Object.prototype;\n\t}\n\t\n\t/**\n\t * Determine if a value is a Date\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a Date, otherwise false\n\t */\n\tfunction isDate(val) {\n\t return toString.call(val) === '[object Date]';\n\t}\n\t\n\t/**\n\t * Determine if a value is a File\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a File, otherwise false\n\t */\n\tfunction isFile(val) {\n\t return toString.call(val) === '[object File]';\n\t}\n\t\n\t/**\n\t * Determine if a value is a Blob\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a Blob, otherwise false\n\t */\n\tfunction isBlob(val) {\n\t return toString.call(val) === '[object Blob]';\n\t}\n\t\n\t/**\n\t * Determine if a value is a Function\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a Function, otherwise false\n\t */\n\tfunction isFunction(val) {\n\t return toString.call(val) === '[object Function]';\n\t}\n\t\n\t/**\n\t * Determine if a value is a Stream\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a Stream, otherwise false\n\t */\n\tfunction isStream(val) {\n\t return isObject(val) && isFunction(val.pipe);\n\t}\n\t\n\t/**\n\t * Determine if a value is a URLSearchParams object\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n\t */\n\tfunction isURLSearchParams(val) {\n\t return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n\t}\n\t\n\t/**\n\t * Trim excess whitespace off the beginning and end of a string\n\t *\n\t * @param {String} str The String to trim\n\t * @returns {String} The String freed of excess whitespace\n\t */\n\tfunction trim(str) {\n\t return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n\t}\n\t\n\t/**\n\t * Determine if we're running in a standard browser environment\n\t *\n\t * This allows axios to run in a web worker, and react-native.\n\t * Both environments support XMLHttpRequest, but not fully standard globals.\n\t *\n\t * web workers:\n\t * typeof window -> undefined\n\t * typeof document -> undefined\n\t *\n\t * react-native:\n\t * navigator.product -> 'ReactNative'\n\t * nativescript\n\t * navigator.product -> 'NativeScript' or 'NS'\n\t */\n\tfunction isStandardBrowserEnv() {\n\t if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n\t navigator.product === 'NativeScript' ||\n\t navigator.product === 'NS')) {\n\t return false;\n\t }\n\t return (\n\t typeof window !== 'undefined' &&\n\t typeof document !== 'undefined'\n\t );\n\t}\n\t\n\t/**\n\t * Iterate over an Array or an Object invoking a function for each item.\n\t *\n\t * If `obj` is an Array callback will be called passing\n\t * the value, index, and complete array for each item.\n\t *\n\t * If 'obj' is an Object callback will be called passing\n\t * the value, key, and complete object for each property.\n\t *\n\t * @param {Object|Array} obj The object to iterate\n\t * @param {Function} fn The callback to invoke for each item\n\t */\n\tfunction forEach(obj, fn) {\n\t // Don't bother if no value provided\n\t if (obj === null || typeof obj === 'undefined') {\n\t return;\n\t }\n\t\n\t // Force an array if not already something iterable\n\t if (typeof obj !== 'object') {\n\t /*eslint no-param-reassign:0*/\n\t obj = [obj];\n\t }\n\t\n\t if (isArray(obj)) {\n\t // Iterate over array values\n\t for (var i = 0, l = obj.length; i < l; i++) {\n\t fn.call(null, obj[i], i, obj);\n\t }\n\t } else {\n\t // Iterate over object keys\n\t for (var key in obj) {\n\t if (Object.prototype.hasOwnProperty.call(obj, key)) {\n\t fn.call(null, obj[key], key, obj);\n\t }\n\t }\n\t }\n\t}\n\t\n\t/**\n\t * Accepts varargs expecting each argument to be an object, then\n\t * immutably merges the properties of each object and returns result.\n\t *\n\t * When multiple objects contain the same key the later object in\n\t * the arguments list will take precedence.\n\t *\n\t * Example:\n\t *\n\t * ```js\n\t * var result = merge({foo: 123}, {foo: 456});\n\t * console.log(result.foo); // outputs 456\n\t * ```\n\t *\n\t * @param {Object} obj1 Object to merge\n\t * @returns {Object} Result of all merge properties\n\t */\n\tfunction merge(/* obj1, obj2, obj3, ... */) {\n\t var result = {};\n\t function assignValue(val, key) {\n\t if (isPlainObject(result[key]) && isPlainObject(val)) {\n\t result[key] = merge(result[key], val);\n\t } else if (isPlainObject(val)) {\n\t result[key] = merge({}, val);\n\t } else if (isArray(val)) {\n\t result[key] = val.slice();\n\t } else {\n\t result[key] = val;\n\t }\n\t }\n\t\n\t for (var i = 0, l = arguments.length; i < l; i++) {\n\t forEach(arguments[i], assignValue);\n\t }\n\t return result;\n\t}\n\t\n\t/**\n\t * Extends object a by mutably adding to it the properties of object b.\n\t *\n\t * @param {Object} a The object to be extended\n\t * @param {Object} b The object to copy properties from\n\t * @param {Object} thisArg The object to bind function to\n\t * @return {Object} The resulting value of object a\n\t */\n\tfunction extend(a, b, thisArg) {\n\t forEach(b, function assignValue(val, key) {\n\t if (thisArg && typeof val === 'function') {\n\t a[key] = bind(val, thisArg);\n\t } else {\n\t a[key] = val;\n\t }\n\t });\n\t return a;\n\t}\n\t\n\t/**\n\t * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n\t *\n\t * @param {string} content with BOM\n\t * @return {string} content value without BOM\n\t */\n\tfunction stripBOM(content) {\n\t if (content.charCodeAt(0) === 0xFEFF) {\n\t content = content.slice(1);\n\t }\n\t return content;\n\t}\n\t\n\tmodule.exports = {\n\t isArray: isArray,\n\t isArrayBuffer: isArrayBuffer,\n\t isBuffer: isBuffer,\n\t isFormData: isFormData,\n\t isArrayBufferView: isArrayBufferView,\n\t isString: isString,\n\t isNumber: isNumber,\n\t isObject: isObject,\n\t isPlainObject: isPlainObject,\n\t isUndefined: isUndefined,\n\t isDate: isDate,\n\t isFile: isFile,\n\t isBlob: isBlob,\n\t isFunction: isFunction,\n\t isStream: isStream,\n\t isURLSearchParams: isURLSearchParams,\n\t isStandardBrowserEnv: isStandardBrowserEnv,\n\t forEach: forEach,\n\t merge: merge,\n\t extend: extend,\n\t trim: trim,\n\t stripBOM: stripBOM\n\t};\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = function bind(fn, thisArg) {\n\t return function wrap() {\n\t var args = new Array(arguments.length);\n\t for (var i = 0; i < args.length; i++) {\n\t args[i] = arguments[i];\n\t }\n\t return fn.apply(thisArg, args);\n\t };\n\t};\n\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\tvar buildURL = __webpack_require__(5);\n\tvar InterceptorManager = __webpack_require__(6);\n\tvar dispatchRequest = __webpack_require__(7);\n\tvar mergeConfig = __webpack_require__(22);\n\t\n\t/**\n\t * Create a new instance of Axios\n\t *\n\t * @param {Object} instanceConfig The default config for the instance\n\t */\n\tfunction Axios(instanceConfig) {\n\t this.defaults = instanceConfig;\n\t this.interceptors = {\n\t request: new InterceptorManager(),\n\t response: new InterceptorManager()\n\t };\n\t}\n\t\n\t/**\n\t * Dispatch a request\n\t *\n\t * @param {Object} config The config specific for this request (merged with this.defaults)\n\t */\n\tAxios.prototype.request = function request(config) {\n\t /*eslint no-param-reassign:0*/\n\t // Allow for axios('example/url'[, config]) a la fetch API\n\t if (typeof config === 'string') {\n\t config = arguments[1] || {};\n\t config.url = arguments[0];\n\t } else {\n\t config = config || {};\n\t }\n\t\n\t config = mergeConfig(this.defaults, config);\n\t\n\t // Set config.method\n\t if (config.method) {\n\t config.method = config.method.toLowerCase();\n\t } else if (this.defaults.method) {\n\t config.method = this.defaults.method.toLowerCase();\n\t } else {\n\t config.method = 'get';\n\t }\n\t\n\t // Hook up interceptors middleware\n\t var chain = [dispatchRequest, undefined];\n\t var promise = Promise.resolve(config);\n\t\n\t this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n\t chain.unshift(interceptor.fulfilled, interceptor.rejected);\n\t });\n\t\n\t this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n\t chain.push(interceptor.fulfilled, interceptor.rejected);\n\t });\n\t\n\t while (chain.length) {\n\t promise = promise.then(chain.shift(), chain.shift());\n\t }\n\t\n\t return promise;\n\t};\n\t\n\tAxios.prototype.getUri = function getUri(config) {\n\t config = mergeConfig(this.defaults, config);\n\t return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n\t};\n\t\n\t// Provide aliases for supported request methods\n\tutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n\t /*eslint func-names:0*/\n\t Axios.prototype[method] = function(url, config) {\n\t return this.request(mergeConfig(config || {}, {\n\t method: method,\n\t url: url,\n\t data: (config || {}).data\n\t }));\n\t };\n\t});\n\t\n\tutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n\t /*eslint func-names:0*/\n\t Axios.prototype[method] = function(url, data, config) {\n\t return this.request(mergeConfig(config || {}, {\n\t method: method,\n\t url: url,\n\t data: data\n\t }));\n\t };\n\t});\n\t\n\tmodule.exports = Axios;\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\t\n\tfunction encode(val) {\n\t return encodeURIComponent(val).\n\t replace(/%3A/gi, ':').\n\t replace(/%24/g, '$').\n\t replace(/%2C/gi, ',').\n\t replace(/%20/g, '+').\n\t replace(/%5B/gi, '[').\n\t replace(/%5D/gi, ']');\n\t}\n\t\n\t/**\n\t * Build a URL by appending params to the end\n\t *\n\t * @param {string} url The base of the url (e.g., http://www.google.com)\n\t * @param {object} [params] The params to be appended\n\t * @returns {string} The formatted url\n\t */\n\tmodule.exports = function buildURL(url, params, paramsSerializer) {\n\t /*eslint no-param-reassign:0*/\n\t if (!params) {\n\t return url;\n\t }\n\t\n\t var serializedParams;\n\t if (paramsSerializer) {\n\t serializedParams = paramsSerializer(params);\n\t } else if (utils.isURLSearchParams(params)) {\n\t serializedParams = params.toString();\n\t } else {\n\t var parts = [];\n\t\n\t utils.forEach(params, function serialize(val, key) {\n\t if (val === null || typeof val === 'undefined') {\n\t return;\n\t }\n\t\n\t if (utils.isArray(val)) {\n\t key = key + '[]';\n\t } else {\n\t val = [val];\n\t }\n\t\n\t utils.forEach(val, function parseValue(v) {\n\t if (utils.isDate(v)) {\n\t v = v.toISOString();\n\t } else if (utils.isObject(v)) {\n\t v = JSON.stringify(v);\n\t }\n\t parts.push(encode(key) + '=' + encode(v));\n\t });\n\t });\n\t\n\t serializedParams = parts.join('&');\n\t }\n\t\n\t if (serializedParams) {\n\t var hashmarkIndex = url.indexOf('#');\n\t if (hashmarkIndex !== -1) {\n\t url = url.slice(0, hashmarkIndex);\n\t }\n\t\n\t url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n\t }\n\t\n\t return url;\n\t};\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\t\n\tfunction InterceptorManager() {\n\t this.handlers = [];\n\t}\n\t\n\t/**\n\t * Add a new interceptor to the stack\n\t *\n\t * @param {Function} fulfilled The function to handle `then` for a `Promise`\n\t * @param {Function} rejected The function to handle `reject` for a `Promise`\n\t *\n\t * @return {Number} An ID used to remove interceptor later\n\t */\n\tInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n\t this.handlers.push({\n\t fulfilled: fulfilled,\n\t rejected: rejected\n\t });\n\t return this.handlers.length - 1;\n\t};\n\t\n\t/**\n\t * Remove an interceptor from the stack\n\t *\n\t * @param {Number} id The ID that was returned by `use`\n\t */\n\tInterceptorManager.prototype.eject = function eject(id) {\n\t if (this.handlers[id]) {\n\t this.handlers[id] = null;\n\t }\n\t};\n\t\n\t/**\n\t * Iterate over all the registered interceptors\n\t *\n\t * This method is particularly useful for skipping over any\n\t * interceptors that may have become `null` calling `eject`.\n\t *\n\t * @param {Function} fn The function to call for each interceptor\n\t */\n\tInterceptorManager.prototype.forEach = function forEach(fn) {\n\t utils.forEach(this.handlers, function forEachHandler(h) {\n\t if (h !== null) {\n\t fn(h);\n\t }\n\t });\n\t};\n\t\n\tmodule.exports = InterceptorManager;\n\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\tvar transformData = __webpack_require__(8);\n\tvar isCancel = __webpack_require__(9);\n\tvar defaults = __webpack_require__(10);\n\t\n\t/**\n\t * Throws a `Cancel` if cancellation has been requested.\n\t */\n\tfunction throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}\n\t\n\t/**\n\t * Dispatch a request to the server using the configured adapter.\n\t *\n\t * @param {object} config The config that is to be used for the request\n\t * @returns {Promise} The Promise to be fulfilled\n\t */\n\tmodule.exports = function dispatchRequest(config) {\n\t throwIfCancellationRequested(config);\n\t\n\t // Ensure headers exist\n\t config.headers = config.headers || {};\n\t\n\t // Transform request data\n\t config.data = transformData(\n\t config.data,\n\t config.headers,\n\t config.transformRequest\n\t );\n\t\n\t // Flatten headers\n\t config.headers = utils.merge(\n\t config.headers.common || {},\n\t config.headers[config.method] || {},\n\t config.headers\n\t );\n\t\n\t utils.forEach(\n\t ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n\t function cleanHeaderConfig(method) {\n\t delete config.headers[method];\n\t }\n\t );\n\t\n\t var adapter = config.adapter || defaults.adapter;\n\t\n\t return adapter(config).then(function onAdapterResolution(response) {\n\t throwIfCancellationRequested(config);\n\t\n\t // Transform response data\n\t response.data = transformData(\n\t response.data,\n\t response.headers,\n\t config.transformResponse\n\t );\n\t\n\t return response;\n\t }, function onAdapterRejection(reason) {\n\t if (!isCancel(reason)) {\n\t throwIfCancellationRequested(config);\n\t\n\t // Transform response data\n\t if (reason && reason.response) {\n\t reason.response.data = transformData(\n\t reason.response.data,\n\t reason.response.headers,\n\t config.transformResponse\n\t );\n\t }\n\t }\n\t\n\t return Promise.reject(reason);\n\t });\n\t};\n\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\t\n\t/**\n\t * Transform the data for a request or a response\n\t *\n\t * @param {Object|String} data The data to be transformed\n\t * @param {Array} headers The headers for the request or response\n\t * @param {Array|Function} fns A single function or Array of functions\n\t * @returns {*} The resulting transformed data\n\t */\n\tmodule.exports = function transformData(data, headers, fns) {\n\t /*eslint no-param-reassign:0*/\n\t utils.forEach(fns, function transform(fn) {\n\t data = fn(data, headers);\n\t });\n\t\n\t return data;\n\t};\n\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = function isCancel(value) {\n\t return !!(value && value.__CANCEL__);\n\t};\n\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\tvar normalizeHeaderName = __webpack_require__(11);\n\t\n\tvar DEFAULT_CONTENT_TYPE = {\n\t 'Content-Type': 'application/x-www-form-urlencoded'\n\t};\n\t\n\tfunction setContentTypeIfUnset(headers, value) {\n\t if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n\t headers['Content-Type'] = value;\n\t }\n\t}\n\t\n\tfunction getDefaultAdapter() {\n\t var adapter;\n\t if (typeof XMLHttpRequest !== 'undefined') {\n\t // For browsers use XHR adapter\n\t adapter = __webpack_require__(12);\n\t } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n\t // For node use HTTP adapter\n\t adapter = __webpack_require__(12);\n\t }\n\t return adapter;\n\t}\n\t\n\tvar defaults = {\n\t adapter: getDefaultAdapter(),\n\t\n\t transformRequest: [function transformRequest(data, headers) {\n\t normalizeHeaderName(headers, 'Accept');\n\t normalizeHeaderName(headers, 'Content-Type');\n\t if (utils.isFormData(data) ||\n\t utils.isArrayBuffer(data) ||\n\t utils.isBuffer(data) ||\n\t utils.isStream(data) ||\n\t utils.isFile(data) ||\n\t utils.isBlob(data)\n\t ) {\n\t return data;\n\t }\n\t if (utils.isArrayBufferView(data)) {\n\t return data.buffer;\n\t }\n\t if (utils.isURLSearchParams(data)) {\n\t setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n\t return data.toString();\n\t }\n\t if (utils.isObject(data)) {\n\t setContentTypeIfUnset(headers, 'application/json;charset=utf-8');\n\t return JSON.stringify(data);\n\t }\n\t return data;\n\t }],\n\t\n\t transformResponse: [function transformResponse(data) {\n\t /*eslint no-param-reassign:0*/\n\t if (typeof data === 'string') {\n\t try {\n\t data = JSON.parse(data);\n\t } catch (e) { /* Ignore */ }\n\t }\n\t return data;\n\t }],\n\t\n\t /**\n\t * A timeout in milliseconds to abort a request. If set to 0 (default) a\n\t * timeout is not created.\n\t */\n\t timeout: 0,\n\t\n\t xsrfCookieName: 'XSRF-TOKEN',\n\t xsrfHeaderName: 'X-XSRF-TOKEN',\n\t\n\t maxContentLength: -1,\n\t maxBodyLength: -1,\n\t\n\t validateStatus: function validateStatus(status) {\n\t return status >= 200 && status < 300;\n\t }\n\t};\n\t\n\tdefaults.headers = {\n\t common: {\n\t 'Accept': 'application/json, text/plain, */*'\n\t }\n\t};\n\t\n\tutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n\t defaults.headers[method] = {};\n\t});\n\t\n\tutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n\t defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n\t});\n\t\n\tmodule.exports = defaults;\n\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\t\n\tmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n\t utils.forEach(headers, function processHeader(value, name) {\n\t if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n\t headers[normalizedName] = value;\n\t delete headers[name];\n\t }\n\t });\n\t};\n\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\tvar settle = __webpack_require__(13);\n\tvar cookies = __webpack_require__(16);\n\tvar buildURL = __webpack_require__(5);\n\tvar buildFullPath = __webpack_require__(17);\n\tvar parseHeaders = __webpack_require__(20);\n\tvar isURLSameOrigin = __webpack_require__(21);\n\tvar createError = __webpack_require__(14);\n\t\n\tmodule.exports = function xhrAdapter(config) {\n\t return new Promise(function dispatchXhrRequest(resolve, reject) {\n\t var requestData = config.data;\n\t var requestHeaders = config.headers;\n\t\n\t if (utils.isFormData(requestData)) {\n\t delete requestHeaders['Content-Type']; // Let the browser set it\n\t }\n\t\n\t var request = new XMLHttpRequest();\n\t\n\t // HTTP basic authentication\n\t if (config.auth) {\n\t var username = config.auth.username || '';\n\t var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n\t requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n\t }\n\t\n\t var fullPath = buildFullPath(config.baseURL, config.url);\n\t request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\t\n\t // Set the request timeout in MS\n\t request.timeout = config.timeout;\n\t\n\t // Listen for ready state\n\t request.onreadystatechange = function handleLoad() {\n\t if (!request || request.readyState !== 4) {\n\t return;\n\t }\n\t\n\t // The request errored out and we didn't get a response, this will be\n\t // handled by onerror instead\n\t // With one exception: request that using file: protocol, most browsers\n\t // will return status as 0 even though it's a successful request\n\t if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n\t return;\n\t }\n\t\n\t // Prepare the response\n\t var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n\t var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;\n\t var response = {\n\t data: responseData,\n\t status: request.status,\n\t statusText: request.statusText,\n\t headers: responseHeaders,\n\t config: config,\n\t request: request\n\t };\n\t\n\t settle(resolve, reject, response);\n\t\n\t // Clean up request\n\t request = null;\n\t };\n\t\n\t // Handle browser request cancellation (as opposed to a manual cancellation)\n\t request.onabort = function handleAbort() {\n\t if (!request) {\n\t return;\n\t }\n\t\n\t reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\t\n\t // Clean up request\n\t request = null;\n\t };\n\t\n\t // Handle low level network errors\n\t request.onerror = function handleError() {\n\t // Real errors are hidden from us by the browser\n\t // onerror should only fire if it's a network error\n\t reject(createError('Network Error', config, null, request));\n\t\n\t // Clean up request\n\t request = null;\n\t };\n\t\n\t // Handle timeout\n\t request.ontimeout = function handleTimeout() {\n\t var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n\t if (config.timeoutErrorMessage) {\n\t timeoutErrorMessage = config.timeoutErrorMessage;\n\t }\n\t reject(createError(timeoutErrorMessage, config, 'ECONNABORTED',\n\t request));\n\t\n\t // Clean up request\n\t request = null;\n\t };\n\t\n\t // Add xsrf header\n\t // This is only done if running in a standard browser environment.\n\t // Specifically not if we're in a web worker, or react-native.\n\t if (utils.isStandardBrowserEnv()) {\n\t // Add xsrf header\n\t var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n\t cookies.read(config.xsrfCookieName) :\n\t undefined;\n\t\n\t if (xsrfValue) {\n\t requestHeaders[config.xsrfHeaderName] = xsrfValue;\n\t }\n\t }\n\t\n\t // Add headers to the request\n\t if ('setRequestHeader' in request) {\n\t utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n\t if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n\t // Remove Content-Type if data is undefined\n\t delete requestHeaders[key];\n\t } else {\n\t // Otherwise add header to the request\n\t request.setRequestHeader(key, val);\n\t }\n\t });\n\t }\n\t\n\t // Add withCredentials to request if needed\n\t if (!utils.isUndefined(config.withCredentials)) {\n\t request.withCredentials = !!config.withCredentials;\n\t }\n\t\n\t // Add responseType to request if needed\n\t if (config.responseType) {\n\t try {\n\t request.responseType = config.responseType;\n\t } catch (e) {\n\t // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.\n\t // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.\n\t if (config.responseType !== 'json') {\n\t throw e;\n\t }\n\t }\n\t }\n\t\n\t // Handle progress if needed\n\t if (typeof config.onDownloadProgress === 'function') {\n\t request.addEventListener('progress', config.onDownloadProgress);\n\t }\n\t\n\t // Not all browsers support upload events\n\t if (typeof config.onUploadProgress === 'function' && request.upload) {\n\t request.upload.addEventListener('progress', config.onUploadProgress);\n\t }\n\t\n\t if (config.cancelToken) {\n\t // Handle cancellation\n\t config.cancelToken.promise.then(function onCanceled(cancel) {\n\t if (!request) {\n\t return;\n\t }\n\t\n\t request.abort();\n\t reject(cancel);\n\t // Clean up request\n\t request = null;\n\t });\n\t }\n\t\n\t if (!requestData) {\n\t requestData = null;\n\t }\n\t\n\t // Send the request\n\t request.send(requestData);\n\t });\n\t};\n\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar createError = __webpack_require__(14);\n\t\n\t/**\n\t * Resolve or reject a Promise based on response status.\n\t *\n\t * @param {Function} resolve A function that resolves the promise.\n\t * @param {Function} reject A function that rejects the promise.\n\t * @param {object} response The response.\n\t */\n\tmodule.exports = function settle(resolve, reject, response) {\n\t var validateStatus = response.config.validateStatus;\n\t if (!response.status || !validateStatus || validateStatus(response.status)) {\n\t resolve(response);\n\t } else {\n\t reject(createError(\n\t 'Request failed with status code ' + response.status,\n\t response.config,\n\t null,\n\t response.request,\n\t response\n\t ));\n\t }\n\t};\n\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar enhanceError = __webpack_require__(15);\n\t\n\t/**\n\t * Create an Error with the specified message, config, error code, request and response.\n\t *\n\t * @param {string} message The error message.\n\t * @param {Object} config The config.\n\t * @param {string} [code] The error code (for example, 'ECONNABORTED').\n\t * @param {Object} [request] The request.\n\t * @param {Object} [response] The response.\n\t * @returns {Error} The created error.\n\t */\n\tmodule.exports = function createError(message, config, code, request, response) {\n\t var error = new Error(message);\n\t return enhanceError(error, config, code, request, response);\n\t};\n\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\t/**\n\t * Update an Error with the specified config, error code, and response.\n\t *\n\t * @param {Error} error The error to update.\n\t * @param {Object} config The config.\n\t * @param {string} [code] The error code (for example, 'ECONNABORTED').\n\t * @param {Object} [request] The request.\n\t * @param {Object} [response] The response.\n\t * @returns {Error} The error.\n\t */\n\tmodule.exports = function enhanceError(error, config, code, request, response) {\n\t error.config = config;\n\t if (code) {\n\t error.code = code;\n\t }\n\t\n\t error.request = request;\n\t error.response = response;\n\t error.isAxiosError = true;\n\t\n\t error.toJSON = function toJSON() {\n\t return {\n\t // Standard\n\t message: this.message,\n\t name: this.name,\n\t // Microsoft\n\t description: this.description,\n\t number: this.number,\n\t // Mozilla\n\t fileName: this.fileName,\n\t lineNumber: this.lineNumber,\n\t columnNumber: this.columnNumber,\n\t stack: this.stack,\n\t // Axios\n\t config: this.config,\n\t code: this.code\n\t };\n\t };\n\t return error;\n\t};\n\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\t\n\tmodule.exports = (\n\t utils.isStandardBrowserEnv() ?\n\t\n\t // Standard browser envs support document.cookie\n\t (function standardBrowserEnv() {\n\t return {\n\t write: function write(name, value, expires, path, domain, secure) {\n\t var cookie = [];\n\t cookie.push(name + '=' + encodeURIComponent(value));\n\t\n\t if (utils.isNumber(expires)) {\n\t cookie.push('expires=' + new Date(expires).toGMTString());\n\t }\n\t\n\t if (utils.isString(path)) {\n\t cookie.push('path=' + path);\n\t }\n\t\n\t if (utils.isString(domain)) {\n\t cookie.push('domain=' + domain);\n\t }\n\t\n\t if (secure === true) {\n\t cookie.push('secure');\n\t }\n\t\n\t document.cookie = cookie.join('; ');\n\t },\n\t\n\t read: function read(name) {\n\t var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n\t return (match ? decodeURIComponent(match[3]) : null);\n\t },\n\t\n\t remove: function remove(name) {\n\t this.write(name, '', Date.now() - 86400000);\n\t }\n\t };\n\t })() :\n\t\n\t // Non standard browser env (web workers, react-native) lack needed support.\n\t (function nonStandardBrowserEnv() {\n\t return {\n\t write: function write() {},\n\t read: function read() { return null; },\n\t remove: function remove() {}\n\t };\n\t })()\n\t);\n\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar isAbsoluteURL = __webpack_require__(18);\n\tvar combineURLs = __webpack_require__(19);\n\t\n\t/**\n\t * Creates a new URL by combining the baseURL with the requestedURL,\n\t * only when the requestedURL is not already an absolute URL.\n\t * If the requestURL is absolute, this function returns the requestedURL untouched.\n\t *\n\t * @param {string} baseURL The base URL\n\t * @param {string} requestedURL Absolute or relative URL to combine\n\t * @returns {string} The combined full path\n\t */\n\tmodule.exports = function buildFullPath(baseURL, requestedURL) {\n\t if (baseURL && !isAbsoluteURL(requestedURL)) {\n\t return combineURLs(baseURL, requestedURL);\n\t }\n\t return requestedURL;\n\t};\n\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\t/**\n\t * Determines whether the specified URL is absolute\n\t *\n\t * @param {string} url The URL to test\n\t * @returns {boolean} True if the specified URL is absolute, otherwise false\n\t */\n\tmodule.exports = function isAbsoluteURL(url) {\n\t // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n\t // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n\t // by any combination of letters, digits, plus, period, or hyphen.\n\t return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n\t};\n\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\t/**\n\t * Creates a new URL by combining the specified URLs\n\t *\n\t * @param {string} baseURL The base URL\n\t * @param {string} relativeURL The relative URL\n\t * @returns {string} The combined URL\n\t */\n\tmodule.exports = function combineURLs(baseURL, relativeURL) {\n\t return relativeURL\n\t ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n\t : baseURL;\n\t};\n\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\t\n\t// Headers whose duplicates are ignored by node\n\t// c.f. https://nodejs.org/api/http.html#http_message_headers\n\tvar ignoreDuplicateOf = [\n\t 'age', 'authorization', 'content-length', 'content-type', 'etag',\n\t 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n\t 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n\t 'referer', 'retry-after', 'user-agent'\n\t];\n\t\n\t/**\n\t * Parse headers into an object\n\t *\n\t * ```\n\t * Date: Wed, 27 Aug 2014 08:58:49 GMT\n\t * Content-Type: application/json\n\t * Connection: keep-alive\n\t * Transfer-Encoding: chunked\n\t * ```\n\t *\n\t * @param {String} headers Headers needing to be parsed\n\t * @returns {Object} Headers parsed into an object\n\t */\n\tmodule.exports = function parseHeaders(headers) {\n\t var parsed = {};\n\t var key;\n\t var val;\n\t var i;\n\t\n\t if (!headers) { return parsed; }\n\t\n\t utils.forEach(headers.split('\\n'), function parser(line) {\n\t i = line.indexOf(':');\n\t key = utils.trim(line.substr(0, i)).toLowerCase();\n\t val = utils.trim(line.substr(i + 1));\n\t\n\t if (key) {\n\t if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n\t return;\n\t }\n\t if (key === 'set-cookie') {\n\t parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n\t } else {\n\t parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n\t }\n\t }\n\t });\n\t\n\t return parsed;\n\t};\n\n\n/***/ }),\n/* 21 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\t\n\tmodule.exports = (\n\t utils.isStandardBrowserEnv() ?\n\t\n\t // Standard browser envs have full support of the APIs needed to test\n\t // whether the request URL is of the same origin as current location.\n\t (function standardBrowserEnv() {\n\t var msie = /(msie|trident)/i.test(navigator.userAgent);\n\t var urlParsingNode = document.createElement('a');\n\t var originURL;\n\t\n\t /**\n\t * Parse a URL to discover it's components\n\t *\n\t * @param {String} url The URL to be parsed\n\t * @returns {Object}\n\t */\n\t function resolveURL(url) {\n\t var href = url;\n\t\n\t if (msie) {\n\t // IE needs attribute set twice to normalize properties\n\t urlParsingNode.setAttribute('href', href);\n\t href = urlParsingNode.href;\n\t }\n\t\n\t urlParsingNode.setAttribute('href', href);\n\t\n\t // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n\t return {\n\t href: urlParsingNode.href,\n\t protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n\t host: urlParsingNode.host,\n\t search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n\t hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n\t hostname: urlParsingNode.hostname,\n\t port: urlParsingNode.port,\n\t pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n\t urlParsingNode.pathname :\n\t '/' + urlParsingNode.pathname\n\t };\n\t }\n\t\n\t originURL = resolveURL(window.location.href);\n\t\n\t /**\n\t * Determine if a URL shares the same origin as the current location\n\t *\n\t * @param {String} requestURL The URL to test\n\t * @returns {boolean} True if URL shares the same origin, otherwise false\n\t */\n\t return function isURLSameOrigin(requestURL) {\n\t var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n\t return (parsed.protocol === originURL.protocol &&\n\t parsed.host === originURL.host);\n\t };\n\t })() :\n\t\n\t // Non standard browser envs (web workers, react-native) lack needed support.\n\t (function nonStandardBrowserEnv() {\n\t return function isURLSameOrigin() {\n\t return true;\n\t };\n\t })()\n\t);\n\n\n/***/ }),\n/* 22 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\t\n\t/**\n\t * Config-specific merge-function which creates a new config-object\n\t * by merging two configuration objects together.\n\t *\n\t * @param {Object} config1\n\t * @param {Object} config2\n\t * @returns {Object} New object resulting from merging config2 to config1\n\t */\n\tmodule.exports = function mergeConfig(config1, config2) {\n\t // eslint-disable-next-line no-param-reassign\n\t config2 = config2 || {};\n\t var config = {};\n\t\n\t var valueFromConfig2Keys = ['url', 'method', 'data'];\n\t var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n\t var defaultToConfig2Keys = [\n\t 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n\t 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n\t 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n\t 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n\t 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n\t ];\n\t var directMergeKeys = ['validateStatus'];\n\t\n\t function getMergedValue(target, source) {\n\t if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n\t return utils.merge(target, source);\n\t } else if (utils.isPlainObject(source)) {\n\t return utils.merge({}, source);\n\t } else if (utils.isArray(source)) {\n\t return source.slice();\n\t }\n\t return source;\n\t }\n\t\n\t function mergeDeepProperties(prop) {\n\t if (!utils.isUndefined(config2[prop])) {\n\t config[prop] = getMergedValue(config1[prop], config2[prop]);\n\t } else if (!utils.isUndefined(config1[prop])) {\n\t config[prop] = getMergedValue(undefined, config1[prop]);\n\t }\n\t }\n\t\n\t utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n\t if (!utils.isUndefined(config2[prop])) {\n\t config[prop] = getMergedValue(undefined, config2[prop]);\n\t }\n\t });\n\t\n\t utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\t\n\t utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n\t if (!utils.isUndefined(config2[prop])) {\n\t config[prop] = getMergedValue(undefined, config2[prop]);\n\t } else if (!utils.isUndefined(config1[prop])) {\n\t config[prop] = getMergedValue(undefined, config1[prop]);\n\t }\n\t });\n\t\n\t utils.forEach(directMergeKeys, function merge(prop) {\n\t if (prop in config2) {\n\t config[prop] = getMergedValue(config1[prop], config2[prop]);\n\t } else if (prop in config1) {\n\t config[prop] = getMergedValue(undefined, config1[prop]);\n\t }\n\t });\n\t\n\t var axiosKeys = valueFromConfig2Keys\n\t .concat(mergeDeepPropertiesKeys)\n\t .concat(defaultToConfig2Keys)\n\t .concat(directMergeKeys);\n\t\n\t var otherKeys = Object\n\t .keys(config1)\n\t .concat(Object.keys(config2))\n\t .filter(function filterAxiosKeys(key) {\n\t return axiosKeys.indexOf(key) === -1;\n\t });\n\t\n\t utils.forEach(otherKeys, mergeDeepProperties);\n\t\n\t return config;\n\t};\n\n\n/***/ }),\n/* 23 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\t/**\n\t * A `Cancel` is an object that is thrown when an operation is canceled.\n\t *\n\t * @class\n\t * @param {string=} message The message.\n\t */\n\tfunction Cancel(message) {\n\t this.message = message;\n\t}\n\t\n\tCancel.prototype.toString = function toString() {\n\t return 'Cancel' + (this.message ? ': ' + this.message : '');\n\t};\n\t\n\tCancel.prototype.__CANCEL__ = true;\n\t\n\tmodule.exports = Cancel;\n\n\n/***/ }),\n/* 24 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar Cancel = __webpack_require__(23);\n\t\n\t/**\n\t * A `CancelToken` is an object that can be used to request cancellation of an operation.\n\t *\n\t * @class\n\t * @param {Function} executor The executor function.\n\t */\n\tfunction CancelToken(executor) {\n\t if (typeof executor !== 'function') {\n\t throw new TypeError('executor must be a function.');\n\t }\n\t\n\t var resolvePromise;\n\t this.promise = new Promise(function promiseExecutor(resolve) {\n\t resolvePromise = resolve;\n\t });\n\t\n\t var token = this;\n\t executor(function cancel(message) {\n\t if (token.reason) {\n\t // Cancellation has already been requested\n\t return;\n\t }\n\t\n\t token.reason = new Cancel(message);\n\t resolvePromise(token.reason);\n\t });\n\t}\n\t\n\t/**\n\t * Throws a `Cancel` if cancellation has been requested.\n\t */\n\tCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n\t if (this.reason) {\n\t throw this.reason;\n\t }\n\t};\n\t\n\t/**\n\t * Returns an object that contains a new `CancelToken` and a function that, when called,\n\t * cancels the `CancelToken`.\n\t */\n\tCancelToken.source = function source() {\n\t var cancel;\n\t var token = new CancelToken(function executor(c) {\n\t cancel = c;\n\t });\n\t return {\n\t token: token,\n\t cancel: cancel\n\t };\n\t};\n\t\n\tmodule.exports = CancelToken;\n\n\n/***/ }),\n/* 25 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\t/**\n\t * Syntactic sugar for invoking a function and expanding an array for arguments.\n\t *\n\t * Common use case would be to use `Function.prototype.apply`.\n\t *\n\t * ```js\n\t * function f(x, y, z) {}\n\t * var args = [1, 2, 3];\n\t * f.apply(null, args);\n\t * ```\n\t *\n\t * With `spread` this example can be re-written.\n\t *\n\t * ```js\n\t * spread(function(x, y, z) {})([1, 2, 3]);\n\t * ```\n\t *\n\t * @param {Function} callback\n\t * @returns {Function}\n\t */\n\tmodule.exports = function spread(callback) {\n\t return function wrap(arr) {\n\t return callback.apply(null, arr);\n\t };\n\t};\n\n\n/***/ }),\n/* 26 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\t/**\n\t * Determines whether the payload is an error thrown by Axios\n\t *\n\t * @param {*} payload The value to test\n\t * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n\t */\n\tmodule.exports = function isAxiosError(payload) {\n\t return (typeof payload === 'object') && (payload.isAxiosError === true);\n\t};\n\n\n/***/ })\n/******/ ])\n});\n;\n\n\n// WEBPACK FOOTER //\n// axios.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 081842adca0968bb3270","module.exports = require('./lib/axios');\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./index.js\n// module id = 0\n// module chunks = 0","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(mergeConfig(axios.defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/axios.js\n// module id = 1\n// module chunks = 0","'use strict';\n\nvar bind = require('./helpers/bind');\n\n/*global toString:true*/\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/utils.js\n// module id = 2\n// module chunks = 0","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/bind.js\n// module id = 3\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n // Hook up interceptors middleware\n var chain = [dispatchRequest, undefined];\n var promise = Promise.resolve(config);\n\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n chain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n chain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/Axios.js\n// module id = 4\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/buildURL.js\n// module id = 5\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/InterceptorManager.js\n// module id = 6\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData(\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData(\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData(\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/dispatchRequest.js\n// module id = 7\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn(data, headers);\n });\n\n return data;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/transformData.js\n// module id = 8\n// module chunks = 0","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/cancel/isCancel.js\n// module id = 9\n// module chunks = 0","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nvar defaults = {\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data)) {\n setContentTypeIfUnset(headers, 'application/json;charset=utf-8');\n return JSON.stringify(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n /*eslint no-param-reassign:0*/\n if (typeof data === 'string') {\n try {\n data = JSON.parse(data);\n } catch (e) { /* Ignore */ }\n }\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/defaults.js\n// module id = 10\n// module chunks = 0","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/normalizeHeaderName.js\n// module id = 11\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n // Listen for ready state\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n };\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(timeoutErrorMessage, config, 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (config.responseType) {\n try {\n request.responseType = config.responseType;\n } catch (e) {\n // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.\n // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.\n if (config.responseType !== 'json') {\n throw e;\n }\n }\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/adapters/xhr.js\n// module id = 12\n// module chunks = 0","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/settle.js\n// module id = 13\n// module chunks = 0","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/createError.js\n// module id = 14\n// module chunks = 0","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/enhanceError.js\n// module id = 15\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/cookies.js\n// module id = 16\n// module chunks = 0","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/buildFullPath.js\n// module id = 17\n// module chunks = 0","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/isAbsoluteURL.js\n// module id = 18\n// module chunks = 0","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/combineURLs.js\n// module id = 19\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/parseHeaders.js\n// module id = 20\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/isURLSameOrigin.js\n// module id = 21\n// module chunks = 0","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n var valueFromConfig2Keys = ['url', 'method', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n var defaultToConfig2Keys = [\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n ];\n var directMergeKeys = ['validateStatus'];\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n }\n\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n }\n });\n\n utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n utils.forEach(directMergeKeys, function merge(prop) {\n if (prop in config2) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n var axiosKeys = valueFromConfig2Keys\n .concat(mergeDeepPropertiesKeys)\n .concat(defaultToConfig2Keys)\n .concat(directMergeKeys);\n\n var otherKeys = Object\n .keys(config1)\n .concat(Object.keys(config2))\n .filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n\n utils.forEach(otherKeys, mergeDeepProperties);\n\n return config;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/mergeConfig.js\n// module id = 22\n// module chunks = 0","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/cancel/Cancel.js\n// module id = 23\n// module chunks = 0","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/cancel/CancelToken.js\n// module id = 24\n// module chunks = 0","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/spread.js\n// module id = 25\n// module chunks = 0","'use strict';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return (typeof payload === 'object') && (payload.isAxiosError === true);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/isAxiosError.js\n// module id = 26\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file diff --git a/node_modules/axios/index.d.ts b/node_modules/axios/index.d.ts deleted file mode 100644 index c74e93c..0000000 --- a/node_modules/axios/index.d.ts +++ /dev/null @@ -1,161 +0,0 @@ -export interface AxiosTransformer { - (data: any, headers?: any): any; -} - -export interface AxiosAdapter { - (config: AxiosRequestConfig): AxiosPromise; -} - -export interface AxiosBasicCredentials { - username: string; - password: string; -} - -export interface AxiosProxyConfig { - host: string; - port: number; - auth?: { - username: string; - password:string; - }; - protocol?: string; -} - -export type Method = - | 'get' | 'GET' - | 'delete' | 'DELETE' - | 'head' | 'HEAD' - | 'options' | 'OPTIONS' - | 'post' | 'POST' - | 'put' | 'PUT' - | 'patch' | 'PATCH' - | 'purge' | 'PURGE' - | 'link' | 'LINK' - | 'unlink' | 'UNLINK' - -export type ResponseType = - | 'arraybuffer' - | 'blob' - | 'document' - | 'json' - | 'text' - | 'stream' - -export interface AxiosRequestConfig { - url?: string; - method?: Method; - baseURL?: string; - transformRequest?: AxiosTransformer | AxiosTransformer[]; - transformResponse?: AxiosTransformer | AxiosTransformer[]; - headers?: any; - params?: any; - paramsSerializer?: (params: any) => string; - data?: any; - timeout?: number; - timeoutErrorMessage?: string; - withCredentials?: boolean; - adapter?: AxiosAdapter; - auth?: AxiosBasicCredentials; - responseType?: ResponseType; - xsrfCookieName?: string; - xsrfHeaderName?: string; - onUploadProgress?: (progressEvent: any) => void; - onDownloadProgress?: (progressEvent: any) => void; - maxContentLength?: number; - validateStatus?: ((status: number) => boolean) | null; - maxBodyLength?: number; - maxRedirects?: number; - socketPath?: string | null; - httpAgent?: any; - httpsAgent?: any; - proxy?: AxiosProxyConfig | false; - cancelToken?: CancelToken; - decompress?: boolean; -} - -export interface AxiosResponse { - data: T; - status: number; - statusText: string; - headers: any; - config: AxiosRequestConfig; - request?: any; -} - -export interface AxiosError extends Error { - config: AxiosRequestConfig; - code?: string; - request?: any; - response?: AxiosResponse; - isAxiosError: boolean; - toJSON: () => object; -} - -export interface AxiosPromise extends Promise> { -} - -export interface CancelStatic { - new (message?: string): Cancel; -} - -export interface Cancel { - message: string; -} - -export interface Canceler { - (message?: string): void; -} - -export interface CancelTokenStatic { - new (executor: (cancel: Canceler) => void): CancelToken; - source(): CancelTokenSource; -} - -export interface CancelToken { - promise: Promise; - reason?: Cancel; - throwIfRequested(): void; -} - -export interface CancelTokenSource { - token: CancelToken; - cancel: Canceler; -} - -export interface AxiosInterceptorManager { - use(onFulfilled?: (value: V) => V | Promise, onRejected?: (error: any) => any): number; - eject(id: number): void; -} - -export interface AxiosInstance { - (config: AxiosRequestConfig): AxiosPromise; - (url: string, config?: AxiosRequestConfig): AxiosPromise; - defaults: AxiosRequestConfig; - interceptors: { - request: AxiosInterceptorManager; - response: AxiosInterceptorManager; - }; - getUri(config?: AxiosRequestConfig): string; - request> (config: AxiosRequestConfig): Promise; - get>(url: string, config?: AxiosRequestConfig): Promise; - delete>(url: string, config?: AxiosRequestConfig): Promise; - head>(url: string, config?: AxiosRequestConfig): Promise; - options>(url: string, config?: AxiosRequestConfig): Promise; - post>(url: string, data?: any, config?: AxiosRequestConfig): Promise; - put>(url: string, data?: any, config?: AxiosRequestConfig): Promise; - patch>(url: string, data?: any, config?: AxiosRequestConfig): Promise; -} - -export interface AxiosStatic extends AxiosInstance { - create(config?: AxiosRequestConfig): AxiosInstance; - Cancel: CancelStatic; - CancelToken: CancelTokenStatic; - isCancel(value: any): boolean; - all(values: (T | Promise)[]): Promise; - spread(callback: (...args: T[]) => R): (array: T[]) => R; - isAxiosError(payload: any): payload is AxiosError; -} - -declare const axios: AxiosStatic; - -export default axios; diff --git a/node_modules/axios/index.js b/node_modules/axios/index.js deleted file mode 100644 index 79dfd09..0000000 --- a/node_modules/axios/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/axios'); \ No newline at end of file diff --git a/node_modules/axios/lib/adapters/README.md b/node_modules/axios/lib/adapters/README.md deleted file mode 100644 index 68f1118..0000000 --- a/node_modules/axios/lib/adapters/README.md +++ /dev/null @@ -1,37 +0,0 @@ -# axios // adapters - -The modules under `adapters/` are modules that handle dispatching a request and settling a returned `Promise` once a response is received. - -## Example - -```js -var settle = require('./../core/settle'); - -module.exports = function myAdapter(config) { - // At this point: - // - config has been merged with defaults - // - request transformers have already run - // - request interceptors have already run - - // Make the request using config provided - // Upon response settle the Promise - - return new Promise(function(resolve, reject) { - - var response = { - data: responseData, - status: request.status, - statusText: request.statusText, - headers: responseHeaders, - config: config, - request: request - }; - - settle(resolve, reject, response); - - // From here: - // - response transformers will run - // - response interceptors will run - }); -} -``` diff --git a/node_modules/axios/lib/adapters/http.js b/node_modules/axios/lib/adapters/http.js deleted file mode 100755 index f32241f..0000000 --- a/node_modules/axios/lib/adapters/http.js +++ /dev/null @@ -1,303 +0,0 @@ -'use strict'; - -var utils = require('./../utils'); -var settle = require('./../core/settle'); -var buildFullPath = require('../core/buildFullPath'); -var buildURL = require('./../helpers/buildURL'); -var http = require('http'); -var https = require('https'); -var httpFollow = require('follow-redirects').http; -var httpsFollow = require('follow-redirects').https; -var url = require('url'); -var zlib = require('zlib'); -var pkg = require('./../../package.json'); -var createError = require('../core/createError'); -var enhanceError = require('../core/enhanceError'); - -var isHttps = /https:?/; - -/** - * - * @param {http.ClientRequestArgs} options - * @param {AxiosProxyConfig} proxy - * @param {string} location - */ -function setProxy(options, proxy, location) { - options.hostname = proxy.host; - options.host = proxy.host; - options.port = proxy.port; - options.path = location; - - // Basic proxy authorization - if (proxy.auth) { - var base64 = Buffer.from(proxy.auth.username + ':' + proxy.auth.password, 'utf8').toString('base64'); - options.headers['Proxy-Authorization'] = 'Basic ' + base64; - } - - // If a proxy is used, any redirects must also pass through the proxy - options.beforeRedirect = function beforeRedirect(redirection) { - redirection.headers.host = redirection.host; - setProxy(redirection, proxy, redirection.href); - }; -} - -/*eslint consistent-return:0*/ -module.exports = function httpAdapter(config) { - return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) { - var resolve = function resolve(value) { - resolvePromise(value); - }; - var reject = function reject(value) { - rejectPromise(value); - }; - var data = config.data; - var headers = config.headers; - - // Set User-Agent (required by some servers) - // Only set header if it hasn't been set in config - // See https://github.com/axios/axios/issues/69 - if (!headers['User-Agent'] && !headers['user-agent']) { - headers['User-Agent'] = 'axios/' + pkg.version; - } - - if (data && !utils.isStream(data)) { - if (Buffer.isBuffer(data)) { - // Nothing to do... - } else if (utils.isArrayBuffer(data)) { - data = Buffer.from(new Uint8Array(data)); - } else if (utils.isString(data)) { - data = Buffer.from(data, 'utf-8'); - } else { - return reject(createError( - 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream', - config - )); - } - - // Add Content-Length header if data exists - headers['Content-Length'] = data.length; - } - - // HTTP basic authentication - var auth = undefined; - if (config.auth) { - var username = config.auth.username || ''; - var password = config.auth.password || ''; - auth = username + ':' + password; - } - - // Parse url - var fullPath = buildFullPath(config.baseURL, config.url); - var parsed = url.parse(fullPath); - var protocol = parsed.protocol || 'http:'; - - if (!auth && parsed.auth) { - var urlAuth = parsed.auth.split(':'); - var urlUsername = urlAuth[0] || ''; - var urlPassword = urlAuth[1] || ''; - auth = urlUsername + ':' + urlPassword; - } - - if (auth) { - delete headers.Authorization; - } - - var isHttpsRequest = isHttps.test(protocol); - var agent = isHttpsRequest ? config.httpsAgent : config.httpAgent; - - var options = { - path: buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\?/, ''), - method: config.method.toUpperCase(), - headers: headers, - agent: agent, - agents: { http: config.httpAgent, https: config.httpsAgent }, - auth: auth - }; - - if (config.socketPath) { - options.socketPath = config.socketPath; - } else { - options.hostname = parsed.hostname; - options.port = parsed.port; - } - - var proxy = config.proxy; - if (!proxy && proxy !== false) { - var proxyEnv = protocol.slice(0, -1) + '_proxy'; - var proxyUrl = process.env[proxyEnv] || process.env[proxyEnv.toUpperCase()]; - if (proxyUrl) { - var parsedProxyUrl = url.parse(proxyUrl); - var noProxyEnv = process.env.no_proxy || process.env.NO_PROXY; - var shouldProxy = true; - - if (noProxyEnv) { - var noProxy = noProxyEnv.split(',').map(function trim(s) { - return s.trim(); - }); - - shouldProxy = !noProxy.some(function proxyMatch(proxyElement) { - if (!proxyElement) { - return false; - } - if (proxyElement === '*') { - return true; - } - if (proxyElement[0] === '.' && - parsed.hostname.substr(parsed.hostname.length - proxyElement.length) === proxyElement) { - return true; - } - - return parsed.hostname === proxyElement; - }); - } - - if (shouldProxy) { - proxy = { - host: parsedProxyUrl.hostname, - port: parsedProxyUrl.port, - protocol: parsedProxyUrl.protocol - }; - - if (parsedProxyUrl.auth) { - var proxyUrlAuth = parsedProxyUrl.auth.split(':'); - proxy.auth = { - username: proxyUrlAuth[0], - password: proxyUrlAuth[1] - }; - } - } - } - } - - if (proxy) { - options.headers.host = parsed.hostname + (parsed.port ? ':' + parsed.port : ''); - setProxy(options, proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path); - } - - var transport; - var isHttpsProxy = isHttpsRequest && (proxy ? isHttps.test(proxy.protocol) : true); - if (config.transport) { - transport = config.transport; - } else if (config.maxRedirects === 0) { - transport = isHttpsProxy ? https : http; - } else { - if (config.maxRedirects) { - options.maxRedirects = config.maxRedirects; - } - transport = isHttpsProxy ? httpsFollow : httpFollow; - } - - if (config.maxBodyLength > -1) { - options.maxBodyLength = config.maxBodyLength; - } - - // Create the request - var req = transport.request(options, function handleResponse(res) { - if (req.aborted) return; - - // uncompress the response body transparently if required - var stream = res; - - // return the last request in case of redirects - var lastRequest = res.req || req; - - - // if no content, is HEAD request or decompress disabled we should not decompress - if (res.statusCode !== 204 && lastRequest.method !== 'HEAD' && config.decompress !== false) { - switch (res.headers['content-encoding']) { - /*eslint default-case:0*/ - case 'gzip': - case 'compress': - case 'deflate': - // add the unzipper to the body stream processing pipeline - stream = stream.pipe(zlib.createUnzip()); - - // remove the content-encoding in order to not confuse downstream operations - delete res.headers['content-encoding']; - break; - } - } - - var response = { - status: res.statusCode, - statusText: res.statusMessage, - headers: res.headers, - config: config, - request: lastRequest - }; - - if (config.responseType === 'stream') { - response.data = stream; - settle(resolve, reject, response); - } else { - var responseBuffer = []; - stream.on('data', function handleStreamData(chunk) { - responseBuffer.push(chunk); - - // make sure the content length is not over the maxContentLength if specified - if (config.maxContentLength > -1 && Buffer.concat(responseBuffer).length > config.maxContentLength) { - stream.destroy(); - reject(createError('maxContentLength size of ' + config.maxContentLength + ' exceeded', - config, null, lastRequest)); - } - }); - - stream.on('error', function handleStreamError(err) { - if (req.aborted) return; - reject(enhanceError(err, config, null, lastRequest)); - }); - - stream.on('end', function handleStreamEnd() { - var responseData = Buffer.concat(responseBuffer); - if (config.responseType !== 'arraybuffer') { - responseData = responseData.toString(config.responseEncoding); - if (!config.responseEncoding || config.responseEncoding === 'utf8') { - responseData = utils.stripBOM(responseData); - } - } - - response.data = responseData; - settle(resolve, reject, response); - }); - } - }); - - // Handle errors - req.on('error', function handleRequestError(err) { - if (req.aborted && err.code !== 'ERR_FR_TOO_MANY_REDIRECTS') return; - reject(enhanceError(err, config, null, req)); - }); - - // Handle request timeout - if (config.timeout) { - // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system. - // And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET. - // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up. - // And then these socket which be hang up will devoring CPU little by little. - // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect. - req.setTimeout(config.timeout, function handleRequestTimeout() { - req.abort(); - reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED', req)); - }); - } - - if (config.cancelToken) { - // Handle cancellation - config.cancelToken.promise.then(function onCanceled(cancel) { - if (req.aborted) return; - - req.abort(); - reject(cancel); - }); - } - - // Send the request - if (utils.isStream(data)) { - data.on('error', function handleStreamError(err) { - reject(enhanceError(err, config, null, req)); - }).pipe(req); - } else { - req.end(data); - } - }); -}; diff --git a/node_modules/axios/lib/adapters/xhr.js b/node_modules/axios/lib/adapters/xhr.js deleted file mode 100644 index 3027752..0000000 --- a/node_modules/axios/lib/adapters/xhr.js +++ /dev/null @@ -1,179 +0,0 @@ -'use strict'; - -var utils = require('./../utils'); -var settle = require('./../core/settle'); -var cookies = require('./../helpers/cookies'); -var buildURL = require('./../helpers/buildURL'); -var buildFullPath = require('../core/buildFullPath'); -var parseHeaders = require('./../helpers/parseHeaders'); -var isURLSameOrigin = require('./../helpers/isURLSameOrigin'); -var createError = require('../core/createError'); - -module.exports = function xhrAdapter(config) { - return new Promise(function dispatchXhrRequest(resolve, reject) { - var requestData = config.data; - var requestHeaders = config.headers; - - if (utils.isFormData(requestData)) { - delete requestHeaders['Content-Type']; // Let the browser set it - } - - var request = new XMLHttpRequest(); - - // HTTP basic authentication - if (config.auth) { - var username = config.auth.username || ''; - var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; - requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); - } - - var fullPath = buildFullPath(config.baseURL, config.url); - request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); - - // Set the request timeout in MS - request.timeout = config.timeout; - - // Listen for ready state - request.onreadystatechange = function handleLoad() { - if (!request || request.readyState !== 4) { - return; - } - - // The request errored out and we didn't get a response, this will be - // handled by onerror instead - // With one exception: request that using file: protocol, most browsers - // will return status as 0 even though it's a successful request - if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { - return; - } - - // Prepare the response - var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null; - var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response; - var response = { - data: responseData, - status: request.status, - statusText: request.statusText, - headers: responseHeaders, - config: config, - request: request - }; - - settle(resolve, reject, response); - - // Clean up request - request = null; - }; - - // Handle browser request cancellation (as opposed to a manual cancellation) - request.onabort = function handleAbort() { - if (!request) { - return; - } - - reject(createError('Request aborted', config, 'ECONNABORTED', request)); - - // Clean up request - request = null; - }; - - // Handle low level network errors - request.onerror = function handleError() { - // Real errors are hidden from us by the browser - // onerror should only fire if it's a network error - reject(createError('Network Error', config, null, request)); - - // Clean up request - request = null; - }; - - // Handle timeout - request.ontimeout = function handleTimeout() { - var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded'; - if (config.timeoutErrorMessage) { - timeoutErrorMessage = config.timeoutErrorMessage; - } - reject(createError(timeoutErrorMessage, config, 'ECONNABORTED', - request)); - - // Clean up request - request = null; - }; - - // Add xsrf header - // This is only done if running in a standard browser environment. - // Specifically not if we're in a web worker, or react-native. - if (utils.isStandardBrowserEnv()) { - // Add xsrf header - var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? - cookies.read(config.xsrfCookieName) : - undefined; - - if (xsrfValue) { - requestHeaders[config.xsrfHeaderName] = xsrfValue; - } - } - - // Add headers to the request - if ('setRequestHeader' in request) { - utils.forEach(requestHeaders, function setRequestHeader(val, key) { - if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { - // Remove Content-Type if data is undefined - delete requestHeaders[key]; - } else { - // Otherwise add header to the request - request.setRequestHeader(key, val); - } - }); - } - - // Add withCredentials to request if needed - if (!utils.isUndefined(config.withCredentials)) { - request.withCredentials = !!config.withCredentials; - } - - // Add responseType to request if needed - if (config.responseType) { - try { - request.responseType = config.responseType; - } catch (e) { - // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2. - // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function. - if (config.responseType !== 'json') { - throw e; - } - } - } - - // Handle progress if needed - if (typeof config.onDownloadProgress === 'function') { - request.addEventListener('progress', config.onDownloadProgress); - } - - // Not all browsers support upload events - if (typeof config.onUploadProgress === 'function' && request.upload) { - request.upload.addEventListener('progress', config.onUploadProgress); - } - - if (config.cancelToken) { - // Handle cancellation - config.cancelToken.promise.then(function onCanceled(cancel) { - if (!request) { - return; - } - - request.abort(); - reject(cancel); - // Clean up request - request = null; - }); - } - - if (!requestData) { - requestData = null; - } - - // Send the request - request.send(requestData); - }); -}; diff --git a/node_modules/axios/lib/axios.js b/node_modules/axios/lib/axios.js deleted file mode 100644 index c6357b0..0000000 --- a/node_modules/axios/lib/axios.js +++ /dev/null @@ -1,56 +0,0 @@ -'use strict'; - -var utils = require('./utils'); -var bind = require('./helpers/bind'); -var Axios = require('./core/Axios'); -var mergeConfig = require('./core/mergeConfig'); -var defaults = require('./defaults'); - -/** - * Create an instance of Axios - * - * @param {Object} defaultConfig The default config for the instance - * @return {Axios} A new instance of Axios - */ -function createInstance(defaultConfig) { - var context = new Axios(defaultConfig); - var instance = bind(Axios.prototype.request, context); - - // Copy axios.prototype to instance - utils.extend(instance, Axios.prototype, context); - - // Copy context to instance - utils.extend(instance, context); - - return instance; -} - -// Create the default instance to be exported -var axios = createInstance(defaults); - -// Expose Axios class to allow class inheritance -axios.Axios = Axios; - -// Factory for creating new instances -axios.create = function create(instanceConfig) { - return createInstance(mergeConfig(axios.defaults, instanceConfig)); -}; - -// Expose Cancel & CancelToken -axios.Cancel = require('./cancel/Cancel'); -axios.CancelToken = require('./cancel/CancelToken'); -axios.isCancel = require('./cancel/isCancel'); - -// Expose all/spread -axios.all = function all(promises) { - return Promise.all(promises); -}; -axios.spread = require('./helpers/spread'); - -// Expose isAxiosError -axios.isAxiosError = require('./helpers/isAxiosError'); - -module.exports = axios; - -// Allow use of default import syntax in TypeScript -module.exports.default = axios; diff --git a/node_modules/axios/lib/cancel/Cancel.js b/node_modules/axios/lib/cancel/Cancel.js deleted file mode 100644 index e0de400..0000000 --- a/node_modules/axios/lib/cancel/Cancel.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -/** - * A `Cancel` is an object that is thrown when an operation is canceled. - * - * @class - * @param {string=} message The message. - */ -function Cancel(message) { - this.message = message; -} - -Cancel.prototype.toString = function toString() { - return 'Cancel' + (this.message ? ': ' + this.message : ''); -}; - -Cancel.prototype.__CANCEL__ = true; - -module.exports = Cancel; diff --git a/node_modules/axios/lib/cancel/CancelToken.js b/node_modules/axios/lib/cancel/CancelToken.js deleted file mode 100644 index 6b46e66..0000000 --- a/node_modules/axios/lib/cancel/CancelToken.js +++ /dev/null @@ -1,57 +0,0 @@ -'use strict'; - -var Cancel = require('./Cancel'); - -/** - * A `CancelToken` is an object that can be used to request cancellation of an operation. - * - * @class - * @param {Function} executor The executor function. - */ -function CancelToken(executor) { - if (typeof executor !== 'function') { - throw new TypeError('executor must be a function.'); - } - - var resolvePromise; - this.promise = new Promise(function promiseExecutor(resolve) { - resolvePromise = resolve; - }); - - var token = this; - executor(function cancel(message) { - if (token.reason) { - // Cancellation has already been requested - return; - } - - token.reason = new Cancel(message); - resolvePromise(token.reason); - }); -} - -/** - * Throws a `Cancel` if cancellation has been requested. - */ -CancelToken.prototype.throwIfRequested = function throwIfRequested() { - if (this.reason) { - throw this.reason; - } -}; - -/** - * Returns an object that contains a new `CancelToken` and a function that, when called, - * cancels the `CancelToken`. - */ -CancelToken.source = function source() { - var cancel; - var token = new CancelToken(function executor(c) { - cancel = c; - }); - return { - token: token, - cancel: cancel - }; -}; - -module.exports = CancelToken; diff --git a/node_modules/axios/lib/cancel/isCancel.js b/node_modules/axios/lib/cancel/isCancel.js deleted file mode 100644 index 051f3ae..0000000 --- a/node_modules/axios/lib/cancel/isCancel.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = function isCancel(value) { - return !!(value && value.__CANCEL__); -}; diff --git a/node_modules/axios/lib/core/Axios.js b/node_modules/axios/lib/core/Axios.js deleted file mode 100644 index c28c413..0000000 --- a/node_modules/axios/lib/core/Axios.js +++ /dev/null @@ -1,95 +0,0 @@ -'use strict'; - -var utils = require('./../utils'); -var buildURL = require('../helpers/buildURL'); -var InterceptorManager = require('./InterceptorManager'); -var dispatchRequest = require('./dispatchRequest'); -var mergeConfig = require('./mergeConfig'); - -/** - * Create a new instance of Axios - * - * @param {Object} instanceConfig The default config for the instance - */ -function Axios(instanceConfig) { - this.defaults = instanceConfig; - this.interceptors = { - request: new InterceptorManager(), - response: new InterceptorManager() - }; -} - -/** - * Dispatch a request - * - * @param {Object} config The config specific for this request (merged with this.defaults) - */ -Axios.prototype.request = function request(config) { - /*eslint no-param-reassign:0*/ - // Allow for axios('example/url'[, config]) a la fetch API - if (typeof config === 'string') { - config = arguments[1] || {}; - config.url = arguments[0]; - } else { - config = config || {}; - } - - config = mergeConfig(this.defaults, config); - - // Set config.method - if (config.method) { - config.method = config.method.toLowerCase(); - } else if (this.defaults.method) { - config.method = this.defaults.method.toLowerCase(); - } else { - config.method = 'get'; - } - - // Hook up interceptors middleware - var chain = [dispatchRequest, undefined]; - var promise = Promise.resolve(config); - - this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { - chain.unshift(interceptor.fulfilled, interceptor.rejected); - }); - - this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { - chain.push(interceptor.fulfilled, interceptor.rejected); - }); - - while (chain.length) { - promise = promise.then(chain.shift(), chain.shift()); - } - - return promise; -}; - -Axios.prototype.getUri = function getUri(config) { - config = mergeConfig(this.defaults, config); - return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, ''); -}; - -// Provide aliases for supported request methods -utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { - /*eslint func-names:0*/ - Axios.prototype[method] = function(url, config) { - return this.request(mergeConfig(config || {}, { - method: method, - url: url, - data: (config || {}).data - })); - }; -}); - -utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { - /*eslint func-names:0*/ - Axios.prototype[method] = function(url, data, config) { - return this.request(mergeConfig(config || {}, { - method: method, - url: url, - data: data - })); - }; -}); - -module.exports = Axios; diff --git a/node_modules/axios/lib/core/InterceptorManager.js b/node_modules/axios/lib/core/InterceptorManager.js deleted file mode 100644 index 50d667b..0000000 --- a/node_modules/axios/lib/core/InterceptorManager.js +++ /dev/null @@ -1,52 +0,0 @@ -'use strict'; - -var utils = require('./../utils'); - -function InterceptorManager() { - this.handlers = []; -} - -/** - * Add a new interceptor to the stack - * - * @param {Function} fulfilled The function to handle `then` for a `Promise` - * @param {Function} rejected The function to handle `reject` for a `Promise` - * - * @return {Number} An ID used to remove interceptor later - */ -InterceptorManager.prototype.use = function use(fulfilled, rejected) { - this.handlers.push({ - fulfilled: fulfilled, - rejected: rejected - }); - return this.handlers.length - 1; -}; - -/** - * Remove an interceptor from the stack - * - * @param {Number} id The ID that was returned by `use` - */ -InterceptorManager.prototype.eject = function eject(id) { - if (this.handlers[id]) { - this.handlers[id] = null; - } -}; - -/** - * Iterate over all the registered interceptors - * - * This method is particularly useful for skipping over any - * interceptors that may have become `null` calling `eject`. - * - * @param {Function} fn The function to call for each interceptor - */ -InterceptorManager.prototype.forEach = function forEach(fn) { - utils.forEach(this.handlers, function forEachHandler(h) { - if (h !== null) { - fn(h); - } - }); -}; - -module.exports = InterceptorManager; diff --git a/node_modules/axios/lib/core/README.md b/node_modules/axios/lib/core/README.md deleted file mode 100644 index 253bc48..0000000 --- a/node_modules/axios/lib/core/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# axios // core - -The modules found in `core/` should be modules that are specific to the domain logic of axios. These modules would most likely not make sense to be consumed outside of the axios module, as their logic is too specific. Some examples of core modules are: - -- Dispatching requests -- Managing interceptors -- Handling config diff --git a/node_modules/axios/lib/core/buildFullPath.js b/node_modules/axios/lib/core/buildFullPath.js deleted file mode 100644 index 00b2b05..0000000 --- a/node_modules/axios/lib/core/buildFullPath.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -var isAbsoluteURL = require('../helpers/isAbsoluteURL'); -var combineURLs = require('../helpers/combineURLs'); - -/** - * Creates a new URL by combining the baseURL with the requestedURL, - * only when the requestedURL is not already an absolute URL. - * If the requestURL is absolute, this function returns the requestedURL untouched. - * - * @param {string} baseURL The base URL - * @param {string} requestedURL Absolute or relative URL to combine - * @returns {string} The combined full path - */ -module.exports = function buildFullPath(baseURL, requestedURL) { - if (baseURL && !isAbsoluteURL(requestedURL)) { - return combineURLs(baseURL, requestedURL); - } - return requestedURL; -}; diff --git a/node_modules/axios/lib/core/createError.js b/node_modules/axios/lib/core/createError.js deleted file mode 100644 index 933680f..0000000 --- a/node_modules/axios/lib/core/createError.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; - -var enhanceError = require('./enhanceError'); - -/** - * Create an Error with the specified message, config, error code, request and response. - * - * @param {string} message The error message. - * @param {Object} config The config. - * @param {string} [code] The error code (for example, 'ECONNABORTED'). - * @param {Object} [request] The request. - * @param {Object} [response] The response. - * @returns {Error} The created error. - */ -module.exports = function createError(message, config, code, request, response) { - var error = new Error(message); - return enhanceError(error, config, code, request, response); -}; diff --git a/node_modules/axios/lib/core/dispatchRequest.js b/node_modules/axios/lib/core/dispatchRequest.js deleted file mode 100644 index c8267ad..0000000 --- a/node_modules/axios/lib/core/dispatchRequest.js +++ /dev/null @@ -1,79 +0,0 @@ -'use strict'; - -var utils = require('./../utils'); -var transformData = require('./transformData'); -var isCancel = require('../cancel/isCancel'); -var defaults = require('../defaults'); - -/** - * Throws a `Cancel` if cancellation has been requested. - */ -function throwIfCancellationRequested(config) { - if (config.cancelToken) { - config.cancelToken.throwIfRequested(); - } -} - -/** - * Dispatch a request to the server using the configured adapter. - * - * @param {object} config The config that is to be used for the request - * @returns {Promise} The Promise to be fulfilled - */ -module.exports = function dispatchRequest(config) { - throwIfCancellationRequested(config); - - // Ensure headers exist - config.headers = config.headers || {}; - - // Transform request data - config.data = transformData( - config.data, - config.headers, - config.transformRequest - ); - - // Flatten headers - config.headers = utils.merge( - config.headers.common || {}, - config.headers[config.method] || {}, - config.headers - ); - - utils.forEach( - ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], - function cleanHeaderConfig(method) { - delete config.headers[method]; - } - ); - - var adapter = config.adapter || defaults.adapter; - - return adapter(config).then(function onAdapterResolution(response) { - throwIfCancellationRequested(config); - - // Transform response data - response.data = transformData( - response.data, - response.headers, - config.transformResponse - ); - - return response; - }, function onAdapterRejection(reason) { - if (!isCancel(reason)) { - throwIfCancellationRequested(config); - - // Transform response data - if (reason && reason.response) { - reason.response.data = transformData( - reason.response.data, - reason.response.headers, - config.transformResponse - ); - } - } - - return Promise.reject(reason); - }); -}; diff --git a/node_modules/axios/lib/core/enhanceError.js b/node_modules/axios/lib/core/enhanceError.js deleted file mode 100644 index b6bc444..0000000 --- a/node_modules/axios/lib/core/enhanceError.js +++ /dev/null @@ -1,42 +0,0 @@ -'use strict'; - -/** - * Update an Error with the specified config, error code, and response. - * - * @param {Error} error The error to update. - * @param {Object} config The config. - * @param {string} [code] The error code (for example, 'ECONNABORTED'). - * @param {Object} [request] The request. - * @param {Object} [response] The response. - * @returns {Error} The error. - */ -module.exports = function enhanceError(error, config, code, request, response) { - error.config = config; - if (code) { - error.code = code; - } - - error.request = request; - error.response = response; - error.isAxiosError = true; - - error.toJSON = function toJSON() { - return { - // Standard - message: this.message, - name: this.name, - // Microsoft - description: this.description, - number: this.number, - // Mozilla - fileName: this.fileName, - lineNumber: this.lineNumber, - columnNumber: this.columnNumber, - stack: this.stack, - // Axios - config: this.config, - code: this.code - }; - }; - return error; -}; diff --git a/node_modules/axios/lib/core/mergeConfig.js b/node_modules/axios/lib/core/mergeConfig.js deleted file mode 100644 index 5a2c10c..0000000 --- a/node_modules/axios/lib/core/mergeConfig.js +++ /dev/null @@ -1,87 +0,0 @@ -'use strict'; - -var utils = require('../utils'); - -/** - * Config-specific merge-function which creates a new config-object - * by merging two configuration objects together. - * - * @param {Object} config1 - * @param {Object} config2 - * @returns {Object} New object resulting from merging config2 to config1 - */ -module.exports = function mergeConfig(config1, config2) { - // eslint-disable-next-line no-param-reassign - config2 = config2 || {}; - var config = {}; - - var valueFromConfig2Keys = ['url', 'method', 'data']; - var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params']; - var defaultToConfig2Keys = [ - 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer', - 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName', - 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress', - 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent', - 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding' - ]; - var directMergeKeys = ['validateStatus']; - - function getMergedValue(target, source) { - if (utils.isPlainObject(target) && utils.isPlainObject(source)) { - return utils.merge(target, source); - } else if (utils.isPlainObject(source)) { - return utils.merge({}, source); - } else if (utils.isArray(source)) { - return source.slice(); - } - return source; - } - - function mergeDeepProperties(prop) { - if (!utils.isUndefined(config2[prop])) { - config[prop] = getMergedValue(config1[prop], config2[prop]); - } else if (!utils.isUndefined(config1[prop])) { - config[prop] = getMergedValue(undefined, config1[prop]); - } - } - - utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) { - if (!utils.isUndefined(config2[prop])) { - config[prop] = getMergedValue(undefined, config2[prop]); - } - }); - - utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties); - - utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) { - if (!utils.isUndefined(config2[prop])) { - config[prop] = getMergedValue(undefined, config2[prop]); - } else if (!utils.isUndefined(config1[prop])) { - config[prop] = getMergedValue(undefined, config1[prop]); - } - }); - - utils.forEach(directMergeKeys, function merge(prop) { - if (prop in config2) { - config[prop] = getMergedValue(config1[prop], config2[prop]); - } else if (prop in config1) { - config[prop] = getMergedValue(undefined, config1[prop]); - } - }); - - var axiosKeys = valueFromConfig2Keys - .concat(mergeDeepPropertiesKeys) - .concat(defaultToConfig2Keys) - .concat(directMergeKeys); - - var otherKeys = Object - .keys(config1) - .concat(Object.keys(config2)) - .filter(function filterAxiosKeys(key) { - return axiosKeys.indexOf(key) === -1; - }); - - utils.forEach(otherKeys, mergeDeepProperties); - - return config; -}; diff --git a/node_modules/axios/lib/core/settle.js b/node_modules/axios/lib/core/settle.js deleted file mode 100644 index 886adb0..0000000 --- a/node_modules/axios/lib/core/settle.js +++ /dev/null @@ -1,25 +0,0 @@ -'use strict'; - -var createError = require('./createError'); - -/** - * Resolve or reject a Promise based on response status. - * - * @param {Function} resolve A function that resolves the promise. - * @param {Function} reject A function that rejects the promise. - * @param {object} response The response. - */ -module.exports = function settle(resolve, reject, response) { - var validateStatus = response.config.validateStatus; - if (!response.status || !validateStatus || validateStatus(response.status)) { - resolve(response); - } else { - reject(createError( - 'Request failed with status code ' + response.status, - response.config, - null, - response.request, - response - )); - } -}; diff --git a/node_modules/axios/lib/core/transformData.js b/node_modules/axios/lib/core/transformData.js deleted file mode 100644 index e065362..0000000 --- a/node_modules/axios/lib/core/transformData.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -var utils = require('./../utils'); - -/** - * Transform the data for a request or a response - * - * @param {Object|String} data The data to be transformed - * @param {Array} headers The headers for the request or response - * @param {Array|Function} fns A single function or Array of functions - * @returns {*} The resulting transformed data - */ -module.exports = function transformData(data, headers, fns) { - /*eslint no-param-reassign:0*/ - utils.forEach(fns, function transform(fn) { - data = fn(data, headers); - }); - - return data; -}; diff --git a/node_modules/axios/lib/defaults.js b/node_modules/axios/lib/defaults.js deleted file mode 100644 index 2b2a1a7..0000000 --- a/node_modules/axios/lib/defaults.js +++ /dev/null @@ -1,98 +0,0 @@ -'use strict'; - -var utils = require('./utils'); -var normalizeHeaderName = require('./helpers/normalizeHeaderName'); - -var DEFAULT_CONTENT_TYPE = { - 'Content-Type': 'application/x-www-form-urlencoded' -}; - -function setContentTypeIfUnset(headers, value) { - if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { - headers['Content-Type'] = value; - } -} - -function getDefaultAdapter() { - var adapter; - if (typeof XMLHttpRequest !== 'undefined') { - // For browsers use XHR adapter - adapter = require('./adapters/xhr'); - } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') { - // For node use HTTP adapter - adapter = require('./adapters/http'); - } - return adapter; -} - -var defaults = { - adapter: getDefaultAdapter(), - - transformRequest: [function transformRequest(data, headers) { - normalizeHeaderName(headers, 'Accept'); - normalizeHeaderName(headers, 'Content-Type'); - if (utils.isFormData(data) || - utils.isArrayBuffer(data) || - utils.isBuffer(data) || - utils.isStream(data) || - utils.isFile(data) || - utils.isBlob(data) - ) { - return data; - } - if (utils.isArrayBufferView(data)) { - return data.buffer; - } - if (utils.isURLSearchParams(data)) { - setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); - return data.toString(); - } - if (utils.isObject(data)) { - setContentTypeIfUnset(headers, 'application/json;charset=utf-8'); - return JSON.stringify(data); - } - return data; - }], - - transformResponse: [function transformResponse(data) { - /*eslint no-param-reassign:0*/ - if (typeof data === 'string') { - try { - data = JSON.parse(data); - } catch (e) { /* Ignore */ } - } - return data; - }], - - /** - * A timeout in milliseconds to abort a request. If set to 0 (default) a - * timeout is not created. - */ - timeout: 0, - - xsrfCookieName: 'XSRF-TOKEN', - xsrfHeaderName: 'X-XSRF-TOKEN', - - maxContentLength: -1, - maxBodyLength: -1, - - validateStatus: function validateStatus(status) { - return status >= 200 && status < 300; - } -}; - -defaults.headers = { - common: { - 'Accept': 'application/json, text/plain, */*' - } -}; - -utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { - defaults.headers[method] = {}; -}); - -utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { - defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); -}); - -module.exports = defaults; diff --git a/node_modules/axios/lib/helpers/README.md b/node_modules/axios/lib/helpers/README.md deleted file mode 100644 index 4ae3419..0000000 --- a/node_modules/axios/lib/helpers/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# axios // helpers - -The modules found in `helpers/` should be generic modules that are _not_ specific to the domain logic of axios. These modules could theoretically be published to npm on their own and consumed by other modules or apps. Some examples of generic modules are things like: - -- Browser polyfills -- Managing cookies -- Parsing HTTP headers diff --git a/node_modules/axios/lib/helpers/bind.js b/node_modules/axios/lib/helpers/bind.js deleted file mode 100644 index 6147c60..0000000 --- a/node_modules/axios/lib/helpers/bind.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -module.exports = function bind(fn, thisArg) { - return function wrap() { - var args = new Array(arguments.length); - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i]; - } - return fn.apply(thisArg, args); - }; -}; diff --git a/node_modules/axios/lib/helpers/buildURL.js b/node_modules/axios/lib/helpers/buildURL.js deleted file mode 100644 index 31595c3..0000000 --- a/node_modules/axios/lib/helpers/buildURL.js +++ /dev/null @@ -1,70 +0,0 @@ -'use strict'; - -var utils = require('./../utils'); - -function encode(val) { - return encodeURIComponent(val). - replace(/%3A/gi, ':'). - replace(/%24/g, '$'). - replace(/%2C/gi, ','). - replace(/%20/g, '+'). - replace(/%5B/gi, '['). - replace(/%5D/gi, ']'); -} - -/** - * Build a URL by appending params to the end - * - * @param {string} url The base of the url (e.g., http://www.google.com) - * @param {object} [params] The params to be appended - * @returns {string} The formatted url - */ -module.exports = function buildURL(url, params, paramsSerializer) { - /*eslint no-param-reassign:0*/ - if (!params) { - return url; - } - - var serializedParams; - if (paramsSerializer) { - serializedParams = paramsSerializer(params); - } else if (utils.isURLSearchParams(params)) { - serializedParams = params.toString(); - } else { - var parts = []; - - utils.forEach(params, function serialize(val, key) { - if (val === null || typeof val === 'undefined') { - return; - } - - if (utils.isArray(val)) { - key = key + '[]'; - } else { - val = [val]; - } - - utils.forEach(val, function parseValue(v) { - if (utils.isDate(v)) { - v = v.toISOString(); - } else if (utils.isObject(v)) { - v = JSON.stringify(v); - } - parts.push(encode(key) + '=' + encode(v)); - }); - }); - - serializedParams = parts.join('&'); - } - - if (serializedParams) { - var hashmarkIndex = url.indexOf('#'); - if (hashmarkIndex !== -1) { - url = url.slice(0, hashmarkIndex); - } - - url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; - } - - return url; -}; diff --git a/node_modules/axios/lib/helpers/combineURLs.js b/node_modules/axios/lib/helpers/combineURLs.js deleted file mode 100644 index f1b58a5..0000000 --- a/node_modules/axios/lib/helpers/combineURLs.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -/** - * Creates a new URL by combining the specified URLs - * - * @param {string} baseURL The base URL - * @param {string} relativeURL The relative URL - * @returns {string} The combined URL - */ -module.exports = function combineURLs(baseURL, relativeURL) { - return relativeURL - ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') - : baseURL; -}; diff --git a/node_modules/axios/lib/helpers/cookies.js b/node_modules/axios/lib/helpers/cookies.js deleted file mode 100644 index 5a8a666..0000000 --- a/node_modules/axios/lib/helpers/cookies.js +++ /dev/null @@ -1,53 +0,0 @@ -'use strict'; - -var utils = require('./../utils'); - -module.exports = ( - utils.isStandardBrowserEnv() ? - - // Standard browser envs support document.cookie - (function standardBrowserEnv() { - return { - write: function write(name, value, expires, path, domain, secure) { - var cookie = []; - cookie.push(name + '=' + encodeURIComponent(value)); - - if (utils.isNumber(expires)) { - cookie.push('expires=' + new Date(expires).toGMTString()); - } - - if (utils.isString(path)) { - cookie.push('path=' + path); - } - - if (utils.isString(domain)) { - cookie.push('domain=' + domain); - } - - if (secure === true) { - cookie.push('secure'); - } - - document.cookie = cookie.join('; '); - }, - - read: function read(name) { - var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); - return (match ? decodeURIComponent(match[3]) : null); - }, - - remove: function remove(name) { - this.write(name, '', Date.now() - 86400000); - } - }; - })() : - - // Non standard browser env (web workers, react-native) lack needed support. - (function nonStandardBrowserEnv() { - return { - write: function write() {}, - read: function read() { return null; }, - remove: function remove() {} - }; - })() -); diff --git a/node_modules/axios/lib/helpers/deprecatedMethod.js b/node_modules/axios/lib/helpers/deprecatedMethod.js deleted file mode 100644 index ed40965..0000000 --- a/node_modules/axios/lib/helpers/deprecatedMethod.js +++ /dev/null @@ -1,24 +0,0 @@ -'use strict'; - -/*eslint no-console:0*/ - -/** - * Supply a warning to the developer that a method they are using - * has been deprecated. - * - * @param {string} method The name of the deprecated method - * @param {string} [instead] The alternate method to use if applicable - * @param {string} [docs] The documentation URL to get further details - */ -module.exports = function deprecatedMethod(method, instead, docs) { - try { - console.warn( - 'DEPRECATED method `' + method + '`.' + - (instead ? ' Use `' + instead + '` instead.' : '') + - ' This method will be removed in a future release.'); - - if (docs) { - console.warn('For more information about usage see ' + docs); - } - } catch (e) { /* Ignore */ } -}; diff --git a/node_modules/axios/lib/helpers/isAbsoluteURL.js b/node_modules/axios/lib/helpers/isAbsoluteURL.js deleted file mode 100644 index d33e992..0000000 --- a/node_modules/axios/lib/helpers/isAbsoluteURL.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -/** - * Determines whether the specified URL is absolute - * - * @param {string} url The URL to test - * @returns {boolean} True if the specified URL is absolute, otherwise false - */ -module.exports = function isAbsoluteURL(url) { - // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). - // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed - // by any combination of letters, digits, plus, period, or hyphen. - return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url); -}; diff --git a/node_modules/axios/lib/helpers/isAxiosError.js b/node_modules/axios/lib/helpers/isAxiosError.js deleted file mode 100644 index 29ff41a..0000000 --- a/node_modules/axios/lib/helpers/isAxiosError.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -/** - * Determines whether the payload is an error thrown by Axios - * - * @param {*} payload The value to test - * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false - */ -module.exports = function isAxiosError(payload) { - return (typeof payload === 'object') && (payload.isAxiosError === true); -}; diff --git a/node_modules/axios/lib/helpers/isURLSameOrigin.js b/node_modules/axios/lib/helpers/isURLSameOrigin.js deleted file mode 100644 index f1d89ad..0000000 --- a/node_modules/axios/lib/helpers/isURLSameOrigin.js +++ /dev/null @@ -1,68 +0,0 @@ -'use strict'; - -var utils = require('./../utils'); - -module.exports = ( - utils.isStandardBrowserEnv() ? - - // Standard browser envs have full support of the APIs needed to test - // whether the request URL is of the same origin as current location. - (function standardBrowserEnv() { - var msie = /(msie|trident)/i.test(navigator.userAgent); - var urlParsingNode = document.createElement('a'); - var originURL; - - /** - * Parse a URL to discover it's components - * - * @param {String} url The URL to be parsed - * @returns {Object} - */ - function resolveURL(url) { - var href = url; - - if (msie) { - // IE needs attribute set twice to normalize properties - urlParsingNode.setAttribute('href', href); - href = urlParsingNode.href; - } - - urlParsingNode.setAttribute('href', href); - - // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils - return { - href: urlParsingNode.href, - protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', - host: urlParsingNode.host, - search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', - hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', - hostname: urlParsingNode.hostname, - port: urlParsingNode.port, - pathname: (urlParsingNode.pathname.charAt(0) === '/') ? - urlParsingNode.pathname : - '/' + urlParsingNode.pathname - }; - } - - originURL = resolveURL(window.location.href); - - /** - * Determine if a URL shares the same origin as the current location - * - * @param {String} requestURL The URL to test - * @returns {boolean} True if URL shares the same origin, otherwise false - */ - return function isURLSameOrigin(requestURL) { - var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; - return (parsed.protocol === originURL.protocol && - parsed.host === originURL.host); - }; - })() : - - // Non standard browser envs (web workers, react-native) lack needed support. - (function nonStandardBrowserEnv() { - return function isURLSameOrigin() { - return true; - }; - })() -); diff --git a/node_modules/axios/lib/helpers/normalizeHeaderName.js b/node_modules/axios/lib/helpers/normalizeHeaderName.js deleted file mode 100644 index 738c9fe..0000000 --- a/node_modules/axios/lib/helpers/normalizeHeaderName.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -var utils = require('../utils'); - -module.exports = function normalizeHeaderName(headers, normalizedName) { - utils.forEach(headers, function processHeader(value, name) { - if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { - headers[normalizedName] = value; - delete headers[name]; - } - }); -}; diff --git a/node_modules/axios/lib/helpers/parseHeaders.js b/node_modules/axios/lib/helpers/parseHeaders.js deleted file mode 100644 index 8af2cc7..0000000 --- a/node_modules/axios/lib/helpers/parseHeaders.js +++ /dev/null @@ -1,53 +0,0 @@ -'use strict'; - -var utils = require('./../utils'); - -// Headers whose duplicates are ignored by node -// c.f. https://nodejs.org/api/http.html#http_message_headers -var ignoreDuplicateOf = [ - 'age', 'authorization', 'content-length', 'content-type', 'etag', - 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', - 'last-modified', 'location', 'max-forwards', 'proxy-authorization', - 'referer', 'retry-after', 'user-agent' -]; - -/** - * Parse headers into an object - * - * ``` - * Date: Wed, 27 Aug 2014 08:58:49 GMT - * Content-Type: application/json - * Connection: keep-alive - * Transfer-Encoding: chunked - * ``` - * - * @param {String} headers Headers needing to be parsed - * @returns {Object} Headers parsed into an object - */ -module.exports = function parseHeaders(headers) { - var parsed = {}; - var key; - var val; - var i; - - if (!headers) { return parsed; } - - utils.forEach(headers.split('\n'), function parser(line) { - i = line.indexOf(':'); - key = utils.trim(line.substr(0, i)).toLowerCase(); - val = utils.trim(line.substr(i + 1)); - - if (key) { - if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) { - return; - } - if (key === 'set-cookie') { - parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]); - } else { - parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; - } - } - }); - - return parsed; -}; diff --git a/node_modules/axios/lib/helpers/spread.js b/node_modules/axios/lib/helpers/spread.js deleted file mode 100644 index 25e3cdd..0000000 --- a/node_modules/axios/lib/helpers/spread.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict'; - -/** - * Syntactic sugar for invoking a function and expanding an array for arguments. - * - * Common use case would be to use `Function.prototype.apply`. - * - * ```js - * function f(x, y, z) {} - * var args = [1, 2, 3]; - * f.apply(null, args); - * ``` - * - * With `spread` this example can be re-written. - * - * ```js - * spread(function(x, y, z) {})([1, 2, 3]); - * ``` - * - * @param {Function} callback - * @returns {Function} - */ -module.exports = function spread(callback) { - return function wrap(arr) { - return callback.apply(null, arr); - }; -}; diff --git a/node_modules/axios/lib/utils.js b/node_modules/axios/lib/utils.js deleted file mode 100644 index 83eb1c6..0000000 --- a/node_modules/axios/lib/utils.js +++ /dev/null @@ -1,351 +0,0 @@ -'use strict'; - -var bind = require('./helpers/bind'); - -/*global toString:true*/ - -// utils is a library of generic helper functions non-specific to axios - -var toString = Object.prototype.toString; - -/** - * Determine if a value is an Array - * - * @param {Object} val The value to test - * @returns {boolean} True if value is an Array, otherwise false - */ -function isArray(val) { - return toString.call(val) === '[object Array]'; -} - -/** - * Determine if a value is undefined - * - * @param {Object} val The value to test - * @returns {boolean} True if the value is undefined, otherwise false - */ -function isUndefined(val) { - return typeof val === 'undefined'; -} - -/** - * Determine if a value is a Buffer - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Buffer, otherwise false - */ -function isBuffer(val) { - return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) - && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val); -} - -/** - * Determine if a value is an ArrayBuffer - * - * @param {Object} val The value to test - * @returns {boolean} True if value is an ArrayBuffer, otherwise false - */ -function isArrayBuffer(val) { - return toString.call(val) === '[object ArrayBuffer]'; -} - -/** - * Determine if a value is a FormData - * - * @param {Object} val The value to test - * @returns {boolean} True if value is an FormData, otherwise false - */ -function isFormData(val) { - return (typeof FormData !== 'undefined') && (val instanceof FormData); -} - -/** - * Determine if a value is a view on an ArrayBuffer - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false - */ -function isArrayBufferView(val) { - var result; - if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { - result = ArrayBuffer.isView(val); - } else { - result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer); - } - return result; -} - -/** - * Determine if a value is a String - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a String, otherwise false - */ -function isString(val) { - return typeof val === 'string'; -} - -/** - * Determine if a value is a Number - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Number, otherwise false - */ -function isNumber(val) { - return typeof val === 'number'; -} - -/** - * Determine if a value is an Object - * - * @param {Object} val The value to test - * @returns {boolean} True if value is an Object, otherwise false - */ -function isObject(val) { - return val !== null && typeof val === 'object'; -} - -/** - * Determine if a value is a plain Object - * - * @param {Object} val The value to test - * @return {boolean} True if value is a plain Object, otherwise false - */ -function isPlainObject(val) { - if (toString.call(val) !== '[object Object]') { - return false; - } - - var prototype = Object.getPrototypeOf(val); - return prototype === null || prototype === Object.prototype; -} - -/** - * Determine if a value is a Date - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Date, otherwise false - */ -function isDate(val) { - return toString.call(val) === '[object Date]'; -} - -/** - * Determine if a value is a File - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a File, otherwise false - */ -function isFile(val) { - return toString.call(val) === '[object File]'; -} - -/** - * Determine if a value is a Blob - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Blob, otherwise false - */ -function isBlob(val) { - return toString.call(val) === '[object Blob]'; -} - -/** - * Determine if a value is a Function - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Function, otherwise false - */ -function isFunction(val) { - return toString.call(val) === '[object Function]'; -} - -/** - * Determine if a value is a Stream - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Stream, otherwise false - */ -function isStream(val) { - return isObject(val) && isFunction(val.pipe); -} - -/** - * Determine if a value is a URLSearchParams object - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a URLSearchParams object, otherwise false - */ -function isURLSearchParams(val) { - return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams; -} - -/** - * Trim excess whitespace off the beginning and end of a string - * - * @param {String} str The String to trim - * @returns {String} The String freed of excess whitespace - */ -function trim(str) { - return str.replace(/^\s*/, '').replace(/\s*$/, ''); -} - -/** - * Determine if we're running in a standard browser environment - * - * This allows axios to run in a web worker, and react-native. - * Both environments support XMLHttpRequest, but not fully standard globals. - * - * web workers: - * typeof window -> undefined - * typeof document -> undefined - * - * react-native: - * navigator.product -> 'ReactNative' - * nativescript - * navigator.product -> 'NativeScript' or 'NS' - */ -function isStandardBrowserEnv() { - if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || - navigator.product === 'NativeScript' || - navigator.product === 'NS')) { - return false; - } - return ( - typeof window !== 'undefined' && - typeof document !== 'undefined' - ); -} - -/** - * Iterate over an Array or an Object invoking a function for each item. - * - * If `obj` is an Array callback will be called passing - * the value, index, and complete array for each item. - * - * If 'obj' is an Object callback will be called passing - * the value, key, and complete object for each property. - * - * @param {Object|Array} obj The object to iterate - * @param {Function} fn The callback to invoke for each item - */ -function forEach(obj, fn) { - // Don't bother if no value provided - if (obj === null || typeof obj === 'undefined') { - return; - } - - // Force an array if not already something iterable - if (typeof obj !== 'object') { - /*eslint no-param-reassign:0*/ - obj = [obj]; - } - - if (isArray(obj)) { - // Iterate over array values - for (var i = 0, l = obj.length; i < l; i++) { - fn.call(null, obj[i], i, obj); - } - } else { - // Iterate over object keys - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - fn.call(null, obj[key], key, obj); - } - } - } -} - -/** - * Accepts varargs expecting each argument to be an object, then - * immutably merges the properties of each object and returns result. - * - * When multiple objects contain the same key the later object in - * the arguments list will take precedence. - * - * Example: - * - * ```js - * var result = merge({foo: 123}, {foo: 456}); - * console.log(result.foo); // outputs 456 - * ``` - * - * @param {Object} obj1 Object to merge - * @returns {Object} Result of all merge properties - */ -function merge(/* obj1, obj2, obj3, ... */) { - var result = {}; - function assignValue(val, key) { - if (isPlainObject(result[key]) && isPlainObject(val)) { - result[key] = merge(result[key], val); - } else if (isPlainObject(val)) { - result[key] = merge({}, val); - } else if (isArray(val)) { - result[key] = val.slice(); - } else { - result[key] = val; - } - } - - for (var i = 0, l = arguments.length; i < l; i++) { - forEach(arguments[i], assignValue); - } - return result; -} - -/** - * Extends object a by mutably adding to it the properties of object b. - * - * @param {Object} a The object to be extended - * @param {Object} b The object to copy properties from - * @param {Object} thisArg The object to bind function to - * @return {Object} The resulting value of object a - */ -function extend(a, b, thisArg) { - forEach(b, function assignValue(val, key) { - if (thisArg && typeof val === 'function') { - a[key] = bind(val, thisArg); - } else { - a[key] = val; - } - }); - return a; -} - -/** - * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) - * - * @param {string} content with BOM - * @return {string} content value without BOM - */ -function stripBOM(content) { - if (content.charCodeAt(0) === 0xFEFF) { - content = content.slice(1); - } - return content; -} - -module.exports = { - isArray: isArray, - isArrayBuffer: isArrayBuffer, - isBuffer: isBuffer, - isFormData: isFormData, - isArrayBufferView: isArrayBufferView, - isString: isString, - isNumber: isNumber, - isObject: isObject, - isPlainObject: isPlainObject, - isUndefined: isUndefined, - isDate: isDate, - isFile: isFile, - isBlob: isBlob, - isFunction: isFunction, - isStream: isStream, - isURLSearchParams: isURLSearchParams, - isStandardBrowserEnv: isStandardBrowserEnv, - forEach: forEach, - merge: merge, - extend: extend, - trim: trim, - stripBOM: stripBOM -}; diff --git a/node_modules/axios/package.json b/node_modules/axios/package.json deleted file mode 100644 index 924c69f..0000000 --- a/node_modules/axios/package.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "_args": [ - [ - "axios@0.21.1", - "/home/nuno/Documents/core/software/fresh/js/metaforecasts/metaforecasts-current" - ] - ], - "_from": "axios@0.21.1", - "_id": "axios@0.21.1", - "_inBundle": false, - "_integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", - "_location": "/axios", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "axios@0.21.1", - "name": "axios", - "escapedName": "axios", - "rawSpec": "0.21.1", - "saveSpec": null, - "fetchSpec": "0.21.1" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", - "_spec": "0.21.1", - "_where": "/home/nuno/Documents/core/software/fresh/js/metaforecasts/metaforecasts-current", - "author": { - "name": "Matt Zabriskie" - }, - "browser": { - "./lib/adapters/http.js": "./lib/adapters/xhr.js" - }, - "bugs": { - "url": "https://github.com/axios/axios/issues" - }, - "bundlesize": [ - { - "path": "./dist/axios.min.js", - "threshold": "5kB" - } - ], - "dependencies": { - "follow-redirects": "^1.10.0" - }, - "description": "Promise based HTTP client for the browser and node.js", - "devDependencies": { - "bundlesize": "^0.17.0", - "coveralls": "^3.0.0", - "es6-promise": "^4.2.4", - "grunt": "^1.0.2", - "grunt-banner": "^0.6.0", - "grunt-cli": "^1.2.0", - "grunt-contrib-clean": "^1.1.0", - "grunt-contrib-watch": "^1.0.0", - "grunt-eslint": "^20.1.0", - "grunt-karma": "^2.0.0", - "grunt-mocha-test": "^0.13.3", - "grunt-ts": "^6.0.0-beta.19", - "grunt-webpack": "^1.0.18", - "istanbul-instrumenter-loader": "^1.0.0", - "jasmine-core": "^2.4.1", - "karma": "^1.3.0", - "karma-chrome-launcher": "^2.2.0", - "karma-coverage": "^1.1.1", - "karma-firefox-launcher": "^1.1.0", - "karma-jasmine": "^1.1.1", - "karma-jasmine-ajax": "^0.1.13", - "karma-opera-launcher": "^1.0.0", - "karma-safari-launcher": "^1.0.0", - "karma-sauce-launcher": "^1.2.0", - "karma-sinon": "^1.0.5", - "karma-sourcemap-loader": "^0.3.7", - "karma-webpack": "^1.7.0", - "load-grunt-tasks": "^3.5.2", - "minimist": "^1.2.0", - "mocha": "^5.2.0", - "sinon": "^4.5.0", - "typescript": "^2.8.1", - "url-search-params": "^0.10.0", - "webpack": "^1.13.1", - "webpack-dev-server": "^1.14.1" - }, - "homepage": "https://github.com/axios/axios", - "jsdelivr": "dist/axios.min.js", - "keywords": [ - "xhr", - "http", - "ajax", - "promise", - "node" - ], - "license": "MIT", - "main": "index.js", - "name": "axios", - "repository": { - "type": "git", - "url": "git+https://github.com/axios/axios.git" - }, - "scripts": { - "build": "NODE_ENV=production grunt build", - "coveralls": "cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js", - "examples": "node ./examples/server.js", - "fix": "eslint --fix lib/**/*.js", - "postversion": "git push && git push --tags", - "preversion": "npm test", - "start": "node ./sandbox/server.js", - "test": "grunt test && bundlesize", - "version": "npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json" - }, - "typings": "./index.d.ts", - "unpkg": "dist/axios.min.js", - "version": "0.21.1" -} diff --git a/node_modules/commander/CHANGELOG.md b/node_modules/commander/CHANGELOG.md deleted file mode 100644 index 9b8359b..0000000 --- a/node_modules/commander/CHANGELOG.md +++ /dev/null @@ -1,361 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) -and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). (Format adopted after v3.0.0.) - - - - -## [6.2.1] (2020-12-13) - -### Fixed - -- some tests failed if directory path included a space ([1390]) - -## [6.2.0] (2020-10-25) - -### Added - -- added 'tsx' file extension for stand-alone executable subcommands ([#1368]) -- documented second parameter to `.description()` to describe command arguments ([#1353]) -- documentation of special cases with options taking varying numbers of option-arguments ([#1332]) -- documentation for terminology ([#1361]) - -### Fixed - -- add missing TypeScript definition for `.addHelpCommand()' ([#1375]) -- removed blank line after "Arguments:" in help, to match "Options:" and "Commands:" ([#1360]) - -### Changed - -- update dependencies - -## [6.1.0] (2020-08-28) - -### Added - -- include URL to relevant section of README for error for potential conflict between Command properties and option values ([#1306]) -- `.combineFlagAndOptionalValue(false)` to ease upgrade path from older versions of Commander ([#1326]) -- allow disabling the built-in help option using `.helpOption(false)` ([#1325]) -- allow just some arguments in `argumentDescription` to `.description()` ([#1323]) - -### Changed - -- tidy async test and remove lint override ([#1312]) - -### Fixed - -- executable subcommand launching when script path not known ([#1322]) - -## [6.0.0] (2020-07-21) - -### Added - -- add support for variadic options ([#1250]) -- allow options to be added with just a short flag ([#1256]) - - *Breaking* the option property has same case as flag. e.g. flag `-n` accessed as `opts().n` (previously uppercase) -- *Breaking* throw an error if there might be a clash between option name and a Command property, with advice on how to resolve ([#1275]) - -### Fixed - -- Options which contain -no- in the middle of the option flag should not be treated as negatable. ([#1301]) - -## [6.0.0-0] (2020-06-20) - -(Released in 6.0.0) - -## [5.1.0] (2020-04-25) - -### Added - -- support for multiple command aliases, the first of which is shown in the auto-generated help ([#531], [#1236]) -- configuration support in `addCommand()` for `hidden` and `isDefault` ([#1232]) - -### Fixed - -- omit masked help flags from the displayed help ([#645], [#1247]) -- remove old short help flag when change help flags using `helpOption` ([#1248]) - -### Changed - -- remove use of `arguments` to improve auto-generated help in editors ([#1235]) -- rename `.command()` configuration `noHelp` to `hidden` (but not remove old support) ([#1232]) -- improvements to documentation -- update dependencies -- update tested versions of node -- eliminate lint errors in TypeScript ([#1208]) - -## [5.0.0] (2020-03-14) - -### Added - -* support for nested commands with action-handlers ([#1] [#764] [#1149]) -* `.addCommand()` for adding a separately configured command ([#764] [#1149]) -* allow a non-executable to be set as the default command ([#742] [#1149]) -* implicit help command when there are subcommands (previously only if executables) ([#1149]) -* customise implicit help command with `.addHelpCommand()` ([#1149]) -* display error message for unknown subcommand, by default ([#432] [#1088] [#1149]) -* display help for missing subcommand, by default ([#1088] [#1149]) -* combined short options as single argument may include boolean flags and value flag and value (e.g. `-a -b -p 80` can be written as `-abp80`) ([#1145]) -* `.parseOption()` includes short flag and long flag expansions ([#1145]) -* `.helpInformation()` returns help text as a string, previously a private routine ([#1169]) -* `.parse()` implicitly uses `process.argv` if arguments not specified ([#1172]) -* optionally specify where `.parse()` arguments "from", if not following node conventions ([#512] [#1172]) -* suggest help option along with unknown command error ([#1179]) -* TypeScript definition for `commands` property of `Command` ([#1184]) -* export `program` property ([#1195]) -* `createCommand` factory method to simplify subclassing ([#1191]) - -### Fixed - -* preserve argument order in subcommands ([#508] [#962] [#1138]) -* do not emit `command:*` for executable subcommands ([#809] [#1149]) -* action handler called whether or not there are non-option arguments ([#1062] [#1149]) -* combining option short flag and value in single argument now works for subcommands ([#1145]) -* only add implicit help command when it will not conflict with other uses of argument ([#1153] [#1149]) -* implicit help command works with command aliases ([#948] [#1149]) -* options are validated whether or not there is an action handler ([#1149]) - -### Changed - -* *Breaking* `.args` contains command arguments with just recognised options removed ([#1032] [#1138]) -* *Breaking* display error if required argument for command is missing ([#995] [#1149]) -* tighten TypeScript definition of custom option processing function passed to `.option()` ([#1119]) -* *Breaking* `.allowUnknownOption()` ([#802] [#1138]) - * unknown options included in arguments passed to command action handler - * unknown options included in `.args` -* only recognised option short flags and long flags are expanded (e.g. `-ab` or `--foo=bar`) ([#1145]) -* *Breaking* `.parseOptions()` ([#1138]) - * `args` in returned result renamed `operands` and does not include anything after first unknown option - * `unknown` in returned result has arguments after first unknown option including operands, not just options and values -* *Breaking* `.on('command:*', callback)` and other command events passed (changed) results from `.parseOptions`, i.e. operands and unknown ([#1138]) -* refactor Option from prototype to class ([#1133]) -* refactor Command from prototype to class ([#1159]) -* changes to error handling ([#1165]) - * throw for author error, not just display message - * preflight for variadic error - * add tips to missing subcommand executable -* TypeScript fluent return types changed to be more subclass friendly, return `this` rather than `Command` ([#1180]) -* `.parseAsync` returns `Promise` to be consistent with `.parse()` ([#1180]) -* update dependencies - -### Removed - -* removed EventEmitter from TypeScript definition for Command, eliminating implicit peer dependency on `@types/node` ([#1146]) -* removed private function `normalize` (the functionality has been integrated into `parseOptions`) ([#1145]) -* `parseExpectedArgs` is now private ([#1149]) - -### Migration Tips - -If you use `.on('command:*')` or more complicated tests to detect an unrecognised subcommand, you may be able to delete the code and rely on the default behaviour. - -If you use `program.args` or more complicated tests to detect a missing subcommand, you may be able to delete the code and rely on the default behaviour. - -If you use `.command('*')` to add a default command, you may be be able to switch to `isDefault:true` with a named command. - -If you want to continue combining short options with optional values as though they were boolean flags, set `combineFlagAndOptionalValue(false)` -to expand `-fb` to `-f -b` rather than `-f b`. - -## [5.0.0-4] (2020-03-03) - -(Released in 5.0.0) - -## [5.0.0-3] (2020-02-20) - -(Released in 5.0.0) - -## [5.0.0-2] (2020-02-10) - -(Released in 5.0.0) - -## [5.0.0-1] (2020-02-08) - -(Released in 5.0.0) - -## [5.0.0-0] (2020-02-02) - -(Released in 5.0.0) - -## [4.1.1] (2020-02-02) - -### Fixed - -* TypeScript definition for `.action()` should include Promise for async ([#1157]) - -## [4.1.0] (2020-01-06) - -### Added - -* two routines to change how option values are handled, and eliminate name clashes with command properties ([#933] [#1102]) - * see storeOptionsAsProperties and passCommandToAction in README -* `.parseAsync` to use instead of `.parse` if supply async action handlers ([#806] [#1118]) - -### Fixed - -* Remove trailing blanks from wrapped help text ([#1096]) - -### Changed - -* update dependencies -* extend security coverage for Commander 2.x to 2020-02-03 -* improvements to README -* improvements to TypeScript definition documentation -* move old versions out of main CHANGELOG -* removed explicit use of `ts-node` in tests - -## [4.0.1] (2019-11-12) - -### Fixed - -* display help when requested, even if there are missing required options ([#1091]) - -## [4.0.0] (2019-11-02) - -### Added - -* automatically wrap and indent help descriptions for options and commands ([#1051]) -* `.exitOverride()` allows override of calls to `process.exit` for additional error handling and to keep program running ([#1040]) -* support for declaring required options with `.requiredOptions()` ([#1071]) -* GitHub Actions support ([#1027]) -* translation links in README - -### Changed - -* dev: switch tests from Sinon+Should to Jest with major rewrite of tests ([#1035]) -* call default subcommand even when there are unknown options ([#1047]) -* *Breaking* Commander is only officially supported on Node 8 and above, and requires Node 6 ([#1053]) - -### Fixed - -* *Breaking* keep command object out of program.args when action handler called ([#1048]) - * also, action handler now passed array of unknown arguments -* complain about unknown options when program argument supplied and action handler ([#1049]) - * this changes parameters to `command:*` event to include unknown arguments -* removed deprecated `customFds` option from call to `child_process.spawn` ([#1052]) -* rework TypeScript declarations to bring all types into imported namespace ([#1081]) - -### Migration Tips - -#### Testing for no arguments - -If you were previously using code like: - -```js -if (!program.args.length) ... -``` - -a partial replacement is: - -```js -if (program.rawArgs.length < 3) ... -``` - -## [4.0.0-1] Prerelease (2019-10-08) - -(Released in 4.0.0) - -## [4.0.0-0] Prerelease (2019-10-01) - -(Released in 4.0.0) - -## Older versions - -* [3.x](./changelogs/CHANGELOG-3.md) -* [2.x](./changelogs/CHANGELOG-2.md) -* [1.x](./changelogs/CHANGELOG-1.md) -* [0.x](./changelogs/CHANGELOG-0.md) - -[#1]: https://github.com/tj/commander.js/issues/1 -[#432]: https://github.com/tj/commander.js/issues/432 -[#508]: https://github.com/tj/commander.js/issues/508 -[#512]: https://github.com/tj/commander.js/issues/512 -[#531]: https://github.com/tj/commander.js/issues/531 -[#645]: https://github.com/tj/commander.js/issues/645 -[#742]: https://github.com/tj/commander.js/issues/742 -[#764]: https://github.com/tj/commander.js/issues/764 -[#802]: https://github.com/tj/commander.js/issues/802 -[#806]: https://github.com/tj/commander.js/issues/806 -[#809]: https://github.com/tj/commander.js/issues/809 -[#948]: https://github.com/tj/commander.js/issues/948 -[#962]: https://github.com/tj/commander.js/issues/962 -[#995]: https://github.com/tj/commander.js/issues/995 -[#1027]: https://github.com/tj/commander.js/pull/1027 -[#1032]: https://github.com/tj/commander.js/issues/1032 -[#1035]: https://github.com/tj/commander.js/pull/1035 -[#1040]: https://github.com/tj/commander.js/pull/1040 -[#1047]: https://github.com/tj/commander.js/pull/1047 -[#1048]: https://github.com/tj/commander.js/pull/1048 -[#1049]: https://github.com/tj/commander.js/pull/1049 -[#1051]: https://github.com/tj/commander.js/pull/1051 -[#1052]: https://github.com/tj/commander.js/pull/1052 -[#1053]: https://github.com/tj/commander.js/pull/1053 -[#1062]: https://github.com/tj/commander.js/pull/1062 -[#1071]: https://github.com/tj/commander.js/pull/1071 -[#1081]: https://github.com/tj/commander.js/pull/1081 -[#1088]: https://github.com/tj/commander.js/issues/1088 -[#1091]: https://github.com/tj/commander.js/pull/1091 -[#1096]: https://github.com/tj/commander.js/pull/1096 -[#1102]: https://github.com/tj/commander.js/pull/1102 -[#1118]: https://github.com/tj/commander.js/pull/1118 -[#1119]: https://github.com/tj/commander.js/pull/1119 -[#1133]: https://github.com/tj/commander.js/pull/1133 -[#1138]: https://github.com/tj/commander.js/pull/1138 -[#1145]: https://github.com/tj/commander.js/pull/1145 -[#1146]: https://github.com/tj/commander.js/pull/1146 -[#1149]: https://github.com/tj/commander.js/pull/1149 -[#1153]: https://github.com/tj/commander.js/issues/1153 -[#1157]: https://github.com/tj/commander.js/pull/1157 -[#1159]: https://github.com/tj/commander.js/pull/1159 -[#1165]: https://github.com/tj/commander.js/pull/1165 -[#1169]: https://github.com/tj/commander.js/pull/1169 -[#1172]: https://github.com/tj/commander.js/pull/1172 -[#1179]: https://github.com/tj/commander.js/pull/1179 -[#1180]: https://github.com/tj/commander.js/pull/1180 -[#1184]: https://github.com/tj/commander.js/pull/1184 -[#1191]: https://github.com/tj/commander.js/pull/1191 -[#1195]: https://github.com/tj/commander.js/pull/1195 -[#1208]: https://github.com/tj/commander.js/pull/1208 -[#1232]: https://github.com/tj/commander.js/pull/1232 -[#1235]: https://github.com/tj/commander.js/pull/1235 -[#1236]: https://github.com/tj/commander.js/pull/1236 -[#1247]: https://github.com/tj/commander.js/pull/1247 -[#1248]: https://github.com/tj/commander.js/pull/1248 -[#1250]: https://github.com/tj/commander.js/pull/1250 -[#1256]: https://github.com/tj/commander.js/pull/1256 -[#1275]: https://github.com/tj/commander.js/pull/1275 -[#1301]: https://github.com/tj/commander.js/issues/1301 -[#1306]: https://github.com/tj/commander.js/pull/1306 -[#1312]: https://github.com/tj/commander.js/pull/1312 -[#1322]: https://github.com/tj/commander.js/pull/1322 -[#1323]: https://github.com/tj/commander.js/pull/1323 -[#1325]: https://github.com/tj/commander.js/pull/1325 -[#1326]: https://github.com/tj/commander.js/pull/1326 -[#1332]: https://github.com/tj/commander.js/pull/1332 -[#1353]: https://github.com/tj/commander.js/pull/1353 -[#1360]: https://github.com/tj/commander.js/pull/1360 -[#1361]: https://github.com/tj/commander.js/pull/1361 -[#1368]: https://github.com/tj/commander.js/pull/1368 -[#1375]: https://github.com/tj/commander.js/pull/1375 -[#1390]: https://github.com/tj/commander.js/pull/1390 - -[Unreleased]: https://github.com/tj/commander.js/compare/master...develop -[6.2.1]: https://github.com/tj/commander.js/compare/v6.2.0..v6.2.1 -[6.2.0]: https://github.com/tj/commander.js/compare/v6.1.0..v6.2.0 -[6.1.0]: https://github.com/tj/commander.js/compare/v6.0.0..v6.1.0 -[6.0.0]: https://github.com/tj/commander.js/compare/v5.1.0..v6.0.0 -[6.0.0-0]: https://github.com/tj/commander.js/compare/v5.1.0..v6.0.0-0 -[5.1.0]: https://github.com/tj/commander.js/compare/v5.0.0..v5.1.0 -[5.0.0]: https://github.com/tj/commander.js/compare/v4.1.1..v5.0.0 -[5.0.0-4]: https://github.com/tj/commander.js/compare/v5.0.0-3..v5.0.0-4 -[5.0.0-3]: https://github.com/tj/commander.js/compare/v5.0.0-2..v5.0.0-3 -[5.0.0-2]: https://github.com/tj/commander.js/compare/v5.0.0-1..v5.0.0-2 -[5.0.0-1]: https://github.com/tj/commander.js/compare/v5.0.0-0..v5.0.0-1 -[5.0.0-0]: https://github.com/tj/commander.js/compare/v4.1.1..v5.0.0-0 -[4.1.1]: https://github.com/tj/commander.js/compare/v4.1.0..v4.1.1 -[4.1.0]: https://github.com/tj/commander.js/compare/v4.0.1..v4.1.0 -[4.0.1]: https://github.com/tj/commander.js/compare/v4.0.0..v4.0.1 -[4.0.0]: https://github.com/tj/commander.js/compare/v3.0.2..v4.0.0 -[4.0.0-1]: https://github.com/tj/commander.js/compare/v4.0.0-0..v4.0.0-1 -[4.0.0-0]: https://github.com/tj/commander.js/compare/v3.0.2...v4.0.0-0 diff --git a/node_modules/commander/LICENSE b/node_modules/commander/LICENSE deleted file mode 100644 index 10f997a..0000000 --- a/node_modules/commander/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2011 TJ Holowaychuk - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/commander/Readme.md b/node_modules/commander/Readme.md deleted file mode 100644 index 45cd755..0000000 --- a/node_modules/commander/Readme.md +++ /dev/null @@ -1,791 +0,0 @@ -# Commander.js - -[![Build Status](https://api.travis-ci.org/tj/commander.js.svg?branch=master)](http://travis-ci.org/tj/commander.js) -[![NPM Version](http://img.shields.io/npm/v/commander.svg?style=flat)](https://www.npmjs.org/package/commander) -[![NPM Downloads](https://img.shields.io/npm/dm/commander.svg?style=flat)](https://npmcharts.com/compare/commander?minimal=true) -[![Install Size](https://packagephobia.now.sh/badge?p=commander)](https://packagephobia.now.sh/result?p=commander) - -The complete solution for [node.js](http://nodejs.org) command-line interfaces. - -Read this in other languages: English | [įŽ€äŊ“中文](./Readme_zh-CN.md) - -- [Commander.js](#commanderjs) - - [Installation](#installation) - - [Declaring _program_ variable](#declaring-program-variable) - - [Options](#options) - - [Common option types, boolean and value](#common-option-types-boolean-and-value) - - [Default option value](#default-option-value) - - [Other option types, negatable boolean and boolean|value](#other-option-types-negatable-boolean-and-booleanvalue) - - [Custom option processing](#custom-option-processing) - - [Required option](#required-option) - - [Variadic option](#variadic-option) - - [Version option](#version-option) - - [Commands](#commands) - - [Specify the argument syntax](#specify-the-argument-syntax) - - [Action handler (sub)commands](#action-handler-subcommands) - - [Stand-alone executable (sub)commands](#stand-alone-executable-subcommands) - - [Automated help](#automated-help) - - [Custom help](#custom-help) - - [.usage and .name](#usage-and-name) - - [.help(cb)](#helpcb) - - [.outputHelp(cb)](#outputhelpcb) - - [.helpInformation()](#helpinformation) - - [.helpOption(flags, description)](#helpoptionflags-description) - - [.addHelpCommand()](#addhelpcommand) - - [Custom event listeners](#custom-event-listeners) - - [Bits and pieces](#bits-and-pieces) - - [.parse() and .parseAsync()](#parse-and-parseasync) - - [Avoiding option name clashes](#avoiding-option-name-clashes) - - [TypeScript](#typescript) - - [createCommand()](#createcommand) - - [Import into ECMAScript Module](#import-into-ecmascript-module) - - [Node options such as `--harmony`](#node-options-such-as---harmony) - - [Debugging stand-alone executable subcommands](#debugging-stand-alone-executable-subcommands) - - [Override exit handling](#override-exit-handling) - - [Examples](#examples) - - [Support](#support) - - [Commander for enterprise](#commander-for-enterprise) - -For information about terms used in this document see: [terminology](./docs/terminology.md) - -## Installation - -```bash -npm install commander -``` - -## Declaring _program_ variable - -Commander exports a global object which is convenient for quick programs. -This is used in the examples in this README for brevity. - -```js -const { program } = require('commander'); -program.version('0.0.1'); -``` - -For larger programs which may use commander in multiple ways, including unit testing, it is better to create a local Command object to use. - -```js -const { Command } = require('commander'); -const program = new Command(); -program.version('0.0.1'); -``` - -## Options - -Options are defined with the `.option()` method, also serving as documentation for the options. Each option can have a short flag (single character) and a long name, separated by a comma or space or vertical bar ('|'). - -The options can be accessed as properties on the Command object. Multi-word options such as "--template-engine" are camel-cased, becoming `program.templateEngine` etc. See also optional new behaviour to [avoid name clashes](#avoiding-option-name-clashes). - -Multiple short flags may optionally be combined in a single argument following the dash: boolean flags, followed by a single option taking a value (possibly followed by the value). -For example `-a -b -p 80` may be written as `-ab -p80` or even `-abp80`. - -You can use `--` to indicate the end of the options, and any remaining arguments will be used without being interpreted. - -Options on the command line are not positional, and can be specified before or after other arguments. - -### Common option types, boolean and value - -The two most used option types are a boolean option, and an option which takes its value -from the following argument (declared with angle brackets like `--expect `). Both are `undefined` unless specified on command line. - -Example file: [options-common.js](./examples/options-common.js) - -```js -program - .option('-d, --debug', 'output extra debugging') - .option('-s, --small', 'small pizza size') - .option('-p, --pizza-type ', 'flavour of pizza'); - -program.parse(process.argv); - -if (program.debug) console.log(program.opts()); -console.log('pizza details:'); -if (program.small) console.log('- small pizza size'); -if (program.pizzaType) console.log(`- ${program.pizzaType}`); -``` - -```bash -$ pizza-options -d -{ debug: true, small: undefined, pizzaType: undefined } -pizza details: -$ pizza-options -p -error: option '-p, --pizza-type ' argument missing -$ pizza-options -ds -p vegetarian -{ debug: true, small: true, pizzaType: 'vegetarian' } -pizza details: -- small pizza size -- vegetarian -$ pizza-options --pizza-type=cheese -pizza details: -- cheese -``` - -`program.parse(arguments)` processes the arguments, leaving any args not consumed by the program options in the `program.args` array. - -### Default option value - -You can specify a default value for an option which takes a value. - -Example file: [options-defaults.js](./examples/options-defaults.js) - -```js -program - .option('-c, --cheese ', 'add the specified type of cheese', 'blue'); - -program.parse(process.argv); - -console.log(`cheese: ${program.cheese}`); -``` - -```bash -$ pizza-options -cheese: blue -$ pizza-options --cheese stilton -cheese: stilton -``` - -### Other option types, negatable boolean and boolean|value - -You can define a boolean option long name with a leading `no-` to set the option value to false when used. -Defined alone this also makes the option true by default. - -If you define `--foo` first, adding `--no-foo` does not change the default value from what it would -otherwise be. You can specify a default boolean value for a boolean option and it can be overridden on command line. - -Example file: [options-negatable.js](./examples/options-negatable.js) - -```js -program - .option('--no-sauce', 'Remove sauce') - .option('--cheese ', 'cheese flavour', 'mozzarella') - .option('--no-cheese', 'plain with no cheese') - .parse(process.argv); - -const sauceStr = program.sauce ? 'sauce' : 'no sauce'; -const cheeseStr = (program.cheese === false) ? 'no cheese' : `${program.cheese} cheese`; -console.log(`You ordered a pizza with ${sauceStr} and ${cheeseStr}`); -``` - -```bash -$ pizza-options -You ordered a pizza with sauce and mozzarella cheese -$ pizza-options --sauce -error: unknown option '--sauce' -$ pizza-options --cheese=blue -You ordered a pizza with sauce and blue cheese -$ pizza-options --no-sauce --no-cheese -You ordered a pizza with no sauce and no cheese -``` - -You can specify an option which may be used as a boolean option but may optionally take an option-argument -(declared with square brackets like `--optional [value]`). - -Example file: [options-boolean-or-value.js](./examples/options-boolean-or-value.js) - -```js -program - .option('-c, --cheese [type]', 'Add cheese with optional type'); - -program.parse(process.argv); - -if (program.cheese === undefined) console.log('no cheese'); -else if (program.cheese === true) console.log('add cheese'); -else console.log(`add cheese type ${program.cheese}`); -``` - -```bash -$ pizza-options -no cheese -$ pizza-options --cheese -add cheese -$ pizza-options --cheese mozzarella -add cheese type mozzarella -``` - -For information about possible ambiguous cases, see [options taking varying arguments](./docs/options-taking-varying-arguments.md). - -### Custom option processing - -You may specify a function to do custom processing of option-arguments. The callback function receives two parameters, -the user specified option-argument and the previous value for the option. It returns the new value for the option. - -This allows you to coerce the option-argument to the desired type, or accumulate values, or do entirely custom processing. - -You can optionally specify the default/starting value for the option after the function parameter. - -Example file: [options-custom-processing.js](./examples/options-custom-processing.js) - -```js -function myParseInt(value, dummyPrevious) { - // parseInt takes a string and an optional radix - return parseInt(value); -} - -function increaseVerbosity(dummyValue, previous) { - return previous + 1; -} - -function collect(value, previous) { - return previous.concat([value]); -} - -function commaSeparatedList(value, dummyPrevious) { - return value.split(','); -} - -program - .option('-f, --float ', 'float argument', parseFloat) - .option('-i, --integer ', 'integer argument', myParseInt) - .option('-v, --verbose', 'verbosity that can be increased', increaseVerbosity, 0) - .option('-c, --collect ', 'repeatable value', collect, []) - .option('-l, --list ', 'comma separated list', commaSeparatedList) -; - -program.parse(process.argv); - -if (program.float !== undefined) console.log(`float: ${program.float}`); -if (program.integer !== undefined) console.log(`integer: ${program.integer}`); -if (program.verbose > 0) console.log(`verbosity: ${program.verbose}`); -if (program.collect.length > 0) console.log(program.collect); -if (program.list !== undefined) console.log(program.list); -``` - -```bash -$ custom -f 1e2 -float: 100 -$ custom --integer 2 -integer: 2 -$ custom -v -v -v -verbose: 3 -$ custom -c a -c b -c c -[ 'a', 'b', 'c' ] -$ custom --list x,y,z -[ 'x', 'y', 'z' ] -``` - -### Required option - -You may specify a required (mandatory) option using `.requiredOption`. The option must have a value after parsing, usually specified on the command line, or perhaps from a default value (say from environment). The method is otherwise the same as `.option` in format, taking flags and description, and optional default value or custom processing. - -Example file: [options-required.js](./examples/options-required.js) - -```js -program - .requiredOption('-c, --cheese ', 'pizza must have cheese'); - -program.parse(process.argv); -``` - -```bash -$ pizza -error: required option '-c, --cheese ' not specified -``` - -### Variadic option - -You may make an option variadic by appending `...` to the value placeholder when declaring the option. On the command line you -can then specify multiple option-arguments, and the parsed option value will be an array. The extra arguments -are read until the first argument starting with a dash. The special argument `--` stops option processing entirely. If a value -is specified in the same argument as the option then no further values are read. - -Example file: [options-variadic.js](./examples/options-variadic.js) - -```js -program - .option('-n, --number ', 'specify numbers') - .option('-l, --letter [letters...]', 'specify letters'); - -program.parse(); - -console.log('Options: ', program.opts()); -console.log('Remaining arguments: ', program.args); -``` - -```bash -$ collect -n 1 2 3 --letter a b c -Options: { number: [ '1', '2', '3' ], letter: [ 'a', 'b', 'c' ] } -Remaining arguments: [] -$ collect --letter=A -n80 operand -Options: { number: [ '80' ], letter: [ 'A' ] } -Remaining arguments: [ 'operand' ] -$ collect --letter -n 1 -n 2 3 -- operand -Options: { number: [ '1', '2', '3' ], letter: true } -Remaining arguments: [ 'operand' ] -``` - -For information about possible ambiguous cases, see [options taking varying arguments](./docs/options-taking-varying-arguments.md). - -### Version option - -The optional `version` method adds handling for displaying the command version. The default option flags are `-V` and `--version`, and when present the command prints the version number and exits. - -```js -program.version('0.0.1'); -``` - -```bash -$ ./examples/pizza -V -0.0.1 -``` - -You may change the flags and description by passing additional parameters to the `version` method, using -the same syntax for flags as the `option` method. - -```js -program.version('0.0.1', '-v, --vers', 'output the current version'); -``` - -## Commands - -You can specify (sub)commands using `.command()` or `.addCommand()`. There are two ways these can be implemented: using an action handler attached to the command, or as a stand-alone executable file (described in more detail later). The subcommands may be nested ([example](./examples/nestedCommands.js)). - -In the first parameter to `.command()` you specify the command name and any command-arguments. The arguments may be `` or `[optional]`, and the last argument may also be `variadic...`. - -You can use `.addCommand()` to add an already configured subcommand to the program. - -For example: - -```js -// Command implemented using action handler (description is supplied separately to `.command`) -// Returns new command for configuring. -program - .command('clone [destination]') - .description('clone a repository into a newly created directory') - .action((source, destination) => { - console.log('clone command called'); - }); - -// Command implemented using stand-alone executable file (description is second parameter to `.command`) -// Returns `this` for adding more commands. -program - .command('start ', 'start named service') - .command('stop [service]', 'stop named service, or all if no name supplied'); - -// Command prepared separately. -// Returns `this` for adding more commands. -program - .addCommand(build.makeBuildCommand()); -``` - -Configuration options can be passed with the call to `.command()` and `.addCommand()`. Specifying `hidden: true` will -remove the command from the generated help output. Specifying `isDefault: true` will run the subcommand if no other -subcommand is specified ([example](./examples/defaultCommand.js)). - -### Specify the argument syntax - -You use `.arguments` to specify the expected command-arguments for the top-level command, and for subcommands they are usually -included in the `.command` call. Angled brackets (e.g. ``) indicate required command-arguments. -Square brackets (e.g. `[optional]`) indicate optional command-arguments. -You can optionally describe the arguments in the help by supplying a hash as second parameter to `.description()`. - -Example file: [env](./examples/env) - -```js -program - .version('0.1.0') - .arguments(' [env]') - .description('test command', { - cmd: 'command to run', - env: 'environment to run test in' - }) - .action(function (cmd, env) { - console.log('command:', cmd); - console.log('environment:', env || 'no environment given'); - }); - -program.parse(process.argv); -``` - - The last argument of a command can be variadic, and only the last argument. To make an argument variadic you - append `...` to the argument name. For example: - -```js -const { program } = require('commander'); - -program - .version('0.1.0') - .command('rmdir [otherDirs...]') - .action(function (dir, otherDirs) { - console.log('rmdir %s', dir); - if (otherDirs) { - otherDirs.forEach(function (oDir) { - console.log('rmdir %s', oDir); - }); - } - }); - -program.parse(process.argv); -``` - -The variadic argument is passed to the action handler as an array. - -### Action handler (sub)commands - -You can add options to a command that uses an action handler. -The action handler gets passed a parameter for each argument you declared, and one additional argument which is the -command object itself. This command argument has the values for the command-specific options added as properties. - -```js -const { program } = require('commander'); - -program - .command('rm ') - .option('-r, --recursive', 'Remove recursively') - .action(function (dir, cmdObj) { - console.log('remove ' + dir + (cmdObj.recursive ? ' recursively' : '')) - }) - -program.parse(process.argv) -``` - -You may supply an `async` action handler, in which case you call `.parseAsync` rather than `.parse`. - -```js -async function run() { /* code goes here */ } - -async function main() { - program - .command('run') - .action(run); - await program.parseAsync(process.argv); -} -``` - -A command's options on the command line are validated when the command is used. Any unknown options will be reported as an error. - -### Stand-alone executable (sub)commands - -When `.command()` is invoked with a description argument, this tells Commander that you're going to use stand-alone executables for subcommands. -Commander will search the executables in the directory of the entry script (like `./examples/pm`) with the name `program-subcommand`, like `pm-install`, `pm-search`. -You can specify a custom name with the `executableFile` configuration option. - -You handle the options for an executable (sub)command in the executable, and don't declare them at the top-level. - -Example file: [pm](./examples/pm) - -```js -program - .version('0.1.0') - .command('install [name]', 'install one or more packages') - .command('search [query]', 'search with optional query') - .command('update', 'update installed packages', { executableFile: 'myUpdateSubCommand' }) - .command('list', 'list packages installed', { isDefault: true }); - -program.parse(process.argv); -``` - -If the program is designed to be installed globally, make sure the executables have proper modes, like `755`. - -## Automated help - -The help information is auto-generated based on the information commander already knows about your program. The default -help option is `-h,--help`. - -Example file: [pizza](./examples/pizza) - -```bash -$ node ./examples/pizza --help -Usage: pizza [options] - -An application for pizzas ordering - -Options: - -V, --version output the version number - -p, --peppers Add peppers - -c, --cheese Add the specified type of cheese (default: "marble") - -C, --no-cheese You do not want any cheese - -h, --help display help for command -``` - -A `help` command is added by default if your command has subcommands. It can be used alone, or with a subcommand name to show -further help for the subcommand. These are effectively the same if the `shell` program has implicit help: - -```bash -shell help -shell --help - -shell help spawn -shell spawn --help -``` - -### Custom help - -You can display extra information by listening for "--help". - -Example file: [custom-help](./examples/custom-help) - -```js -program - .option('-f, --foo', 'enable some foo'); - -// must be before .parse() -program.on('--help', () => { - console.log(''); - console.log('Example call:'); - console.log(' $ custom-help --help'); -}); -``` - -Yields the following help output: - -```Text -Usage: custom-help [options] - -Options: - -f, --foo enable some foo - -h, --help display help for command - -Example call: - $ custom-help --help -``` - -### .usage and .name - -These allow you to customise the usage description in the first line of the help. The name is otherwise -deduced from the (full) program arguments. Given: - -```js -program - .name("my-command") - .usage("[global options] command") -``` - -The help will start with: - -```Text -Usage: my-command [global options] command -``` - -### .help(cb) - -Output help information and exit immediately. Optional callback cb allows post-processing of help text before it is displayed. - -### .outputHelp(cb) - -Output help information without exiting. -Optional callback cb allows post-processing of help text before it is displayed. - -### .helpInformation() - -Get the command help information as a string for processing or displaying yourself. (The text does not include the custom help -from `--help` listeners.) - -### .helpOption(flags, description) - -Override the default help flags and description. Pass false to disable the built-in help option. - -```js -program - .helpOption('-e, --HELP', 'read more information'); -``` - -### .addHelpCommand() - -You can explicitly turn on or off the implicit help command with `.addHelpCommand()` and `.addHelpCommand(false)`. - -You can both turn on and customise the help command by supplying the name and description: - -```js -program.addHelpCommand('assist [command]', 'show assistance'); -``` - -## Custom event listeners - -You can execute custom actions by listening to command and option events. - -```js -program.on('option:verbose', function () { - process.env.VERBOSE = this.verbose; -}); - -program.on('command:*', function (operands) { - console.error(`error: unknown command '${operands[0]}'`); - const availableCommands = program.commands.map(cmd => cmd.name()); - mySuggestBestMatch(operands[0], availableCommands); - process.exitCode = 1; -}); -``` - -## Bits and pieces - -### .parse() and .parseAsync() - -The first argument to `.parse` is the array of strings to parse. You may omit the parameter to implicitly use `process.argv`. - -If the arguments follow different conventions than node you can pass a `from` option in the second parameter: - -- 'node': default, `argv[0]` is the application and `argv[1]` is the script being run, with user parameters after that -- 'electron': `argv[1]` varies depending on whether the electron application is packaged -- 'user': all of the arguments from the user - -For example: - -```js -program.parse(process.argv); // Explicit, node conventions -program.parse(); // Implicit, and auto-detect electron -program.parse(['-f', 'filename'], { from: 'user' }); -``` - -### Avoiding option name clashes - -The original and default behaviour is that the option values are stored -as properties on the program, and the action handler is passed a -command object with the options values stored as properties. -This is very convenient to code, but the downside is possible clashes with -existing properties of Command. - -There are two new routines to change the behaviour, and the default behaviour may change in the future: - -- `storeOptionsAsProperties`: whether to store option values as properties on command object, or store separately (specify false) and access using `.opts()` -- `passCommandToAction`: whether to pass command to action handler, -or just the options (specify false) - -Example file: [storeOptionsAsProperties-action.js](./examples/storeOptionsAsProperties-action.js) - -```js -program - .storeOptionsAsProperties(false) - .passCommandToAction(false); - -program - .name('my-program-name') - .option('-n,--name '); - -program - .command('show') - .option('-a,--action ') - .action((options) => { - console.log(options.action); - }); - -program.parse(process.argv); - -const programOptions = program.opts(); -console.log(programOptions.name); -``` - -### TypeScript - -The Commander package includes its TypeScript Definition file. - -If you use `ts-node` and stand-alone executable subcommands written as `.ts` files, you need to call your program through node to get the subcommands called correctly. e.g. - -```bash -node -r ts-node/register pm.ts -``` - -### createCommand() - -This factory function creates a new command. It is exported and may be used instead of using `new`, like: - -```js -const { createCommand } = require('commander'); -const program = createCommand(); -``` - -`createCommand` is also a method of the Command object, and creates a new command rather than a subcommand. This gets used internally -when creating subcommands using `.command()`, and you may override it to -customise the new subcommand (examples using [subclass](./examples/custom-command-class.js) and [function](./examples/custom-command-function.js)). - -### Import into ECMAScript Module - -Commander is currently a CommonJS package, and the default export can be imported into an ES Module: - -```js -// index.mjs -import commander from 'commander'; -const program = commander.program; -const newCommand = new commander.Command(); -``` - -### Node options such as `--harmony` - -You can enable `--harmony` option in two ways: - -- Use `#! /usr/bin/env node --harmony` in the subcommands scripts. (Note Windows does not support this pattern.) -- Use the `--harmony` option when call the command, like `node --harmony examples/pm publish`. The `--harmony` option will be preserved when spawning subcommand process. - -### Debugging stand-alone executable subcommands - -An executable subcommand is launched as a separate child process. - -If you are using the node inspector for [debugging](https://nodejs.org/en/docs/guides/debugging-getting-started/) executable subcommands using `node --inspect` et al, -the inspector port is incremented by 1 for the spawned subcommand. - -If you are using VSCode to debug executable subcommands you need to set the `"autoAttachChildProcesses": true` flag in your launch.json configuration. - -### Override exit handling - -By default Commander calls `process.exit` when it detects errors, or after displaying the help or version. You can override -this behaviour and optionally supply a callback. The default override throws a `CommanderError`. - -The override callback is passed a `CommanderError` with properties `exitCode` number, `code` string, and `message`. The default override behaviour is to throw the error, except for async handling of executable subcommand completion which carries on. The normal display of error messages or version or help -is not affected by the override which is called after the display. - -```js -program.exitOverride(); - -try { - program.parse(process.argv); -} catch (err) { - // custom processing... -} -``` - -## Examples - -Example file: [deploy](./examples/deploy) - -```js -const { program } = require('commander'); - -program - .version('0.1.0') - .option('-C, --chdir ', 'change the working directory') - .option('-c, --config ', 'set config path. defaults to ./deploy.conf') - .option('-T, --no-tests', 'ignore test hook'); - -program - .command('setup [env]') - .description('run setup commands for all envs') - .option("-s, --setup_mode [mode]", "Which setup mode to use") - .action(function(env, options){ - const mode = options.setup_mode || "normal"; - env = env || 'all'; - console.log('setup for %s env(s) with %s mode', env, mode); - }); - -program - .command('exec ') - .alias('ex') - .description('execute the given remote cmd') - .option("-e, --exec_mode ", "Which exec mode to use") - .action(function(cmd, options){ - console.log('exec "%s" using %s mode', cmd, options.exec_mode); - }).on('--help', function() { - console.log(''); - console.log('Examples:'); - console.log(''); - console.log(' $ deploy exec sequential'); - console.log(' $ deploy exec async'); - }); - -program.parse(process.argv); -``` - -More Demos can be found in the [examples](https://github.com/tj/commander.js/tree/master/examples) directory. - -## Support - -The current version of Commander is fully supported on Long Term Support versions of Node, and is likely to work with Node 6 but not tested. -(For versions of Node below Node 6, use Commander 3.x or 2.x.) - -The main forum for free and community support is the project [Issues](https://github.com/tj/commander.js/issues) on GitHub. - -### Commander for enterprise - -Available as part of the Tidelift Subscription - -The maintainers of Commander and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-commander?utm_source=npm-commander&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/node_modules/commander/index.js b/node_modules/commander/index.js deleted file mode 100644 index c85f725..0000000 --- a/node_modules/commander/index.js +++ /dev/null @@ -1,1881 +0,0 @@ -/** - * Module dependencies. - */ - -const EventEmitter = require('events').EventEmitter; -const spawn = require('child_process').spawn; -const path = require('path'); -const fs = require('fs'); - -// @ts-check - -class Option { - /** - * Initialize a new `Option` with the given `flags` and `description`. - * - * @param {string} flags - * @param {string} description - * @api public - */ - - constructor(flags, description) { - this.flags = flags; - this.required = flags.includes('<'); // A value must be supplied when the option is specified. - this.optional = flags.includes('['); // A value is optional when the option is specified. - // variadic test ignores et al which might be used to describe custom splitting of single argument - this.variadic = /\w\.\.\.[>\]]$/.test(flags); // The option can take multiple values. - this.mandatory = false; // The option must have a value after parsing, which usually means it must be specified on command line. - const optionFlags = _parseOptionFlags(flags); - this.short = optionFlags.shortFlag; - this.long = optionFlags.longFlag; - this.negate = false; - if (this.long) { - this.negate = this.long.startsWith('--no-'); - } - this.description = description || ''; - this.defaultValue = undefined; - } - - /** - * Return option name. - * - * @return {string} - * @api private - */ - - name() { - if (this.long) { - return this.long.replace(/^--/, ''); - } - return this.short.replace(/^-/, ''); - }; - - /** - * Return option name, in a camelcase format that can be used - * as a object attribute key. - * - * @return {string} - * @api private - */ - - attributeName() { - return camelcase(this.name().replace(/^no-/, '')); - }; - - /** - * Check if `arg` matches the short or long flag. - * - * @param {string} arg - * @return {boolean} - * @api private - */ - - is(arg) { - return this.short === arg || this.long === arg; - }; -} - -/** - * CommanderError class - * @class - */ -class CommanderError extends Error { - /** - * Constructs the CommanderError class - * @param {number} exitCode suggested exit code which could be used with process.exit - * @param {string} code an id string representing the error - * @param {string} message human-readable description of the error - * @constructor - */ - constructor(exitCode, code, message) { - super(message); - // properly capture stack trace in Node.js - Error.captureStackTrace(this, this.constructor); - this.name = this.constructor.name; - this.code = code; - this.exitCode = exitCode; - this.nestedError = undefined; - } -} - -class Command extends EventEmitter { - /** - * Initialize a new `Command`. - * - * @param {string} [name] - * @api public - */ - - constructor(name) { - super(); - this.commands = []; - this.options = []; - this.parent = null; - this._allowUnknownOption = false; - this._args = []; - this.rawArgs = null; - this._scriptPath = null; - this._name = name || ''; - this._optionValues = {}; - this._storeOptionsAsProperties = true; // backwards compatible by default - this._storeOptionsAsPropertiesCalled = false; - this._passCommandToAction = true; // backwards compatible by default - this._actionResults = []; - this._actionHandler = null; - this._executableHandler = false; - this._executableFile = null; // custom name for executable - this._defaultCommandName = null; - this._exitCallback = null; - this._aliases = []; - this._combineFlagAndOptionalValue = true; - - this._hidden = false; - this._hasHelpOption = true; - this._helpFlags = '-h, --help'; - this._helpDescription = 'display help for command'; - this._helpShortFlag = '-h'; - this._helpLongFlag = '--help'; - this._hasImplicitHelpCommand = undefined; // Deliberately undefined, not decided whether true or false - this._helpCommandName = 'help'; - this._helpCommandnameAndArgs = 'help [command]'; - this._helpCommandDescription = 'display help for command'; - } - - /** - * Define a command. - * - * There are two styles of command: pay attention to where to put the description. - * - * Examples: - * - * // Command implemented using action handler (description is supplied separately to `.command`) - * program - * .command('clone [destination]') - * .description('clone a repository into a newly created directory') - * .action((source, destination) => { - * console.log('clone command called'); - * }); - * - * // Command implemented using separate executable file (description is second parameter to `.command`) - * program - * .command('start ', 'start named service') - * .command('stop [service]', 'stop named service, or all if no name supplied'); - * - * @param {string} nameAndArgs - command name and arguments, args are `` or `[optional]` and last may also be `variadic...` - * @param {Object|string} [actionOptsOrExecDesc] - configuration options (for action), or description (for executable) - * @param {Object} [execOpts] - configuration options (for executable) - * @return {Command} returns new command for action handler, or `this` for executable command - * @api public - */ - - command(nameAndArgs, actionOptsOrExecDesc, execOpts) { - let desc = actionOptsOrExecDesc; - let opts = execOpts; - if (typeof desc === 'object' && desc !== null) { - opts = desc; - desc = null; - } - opts = opts || {}; - const args = nameAndArgs.split(/ +/); - const cmd = this.createCommand(args.shift()); - - if (desc) { - cmd.description(desc); - cmd._executableHandler = true; - } - if (opts.isDefault) this._defaultCommandName = cmd._name; - - cmd._hidden = !!(opts.noHelp || opts.hidden); - cmd._hasHelpOption = this._hasHelpOption; - cmd._helpFlags = this._helpFlags; - cmd._helpDescription = this._helpDescription; - cmd._helpShortFlag = this._helpShortFlag; - cmd._helpLongFlag = this._helpLongFlag; - cmd._helpCommandName = this._helpCommandName; - cmd._helpCommandnameAndArgs = this._helpCommandnameAndArgs; - cmd._helpCommandDescription = this._helpCommandDescription; - cmd._exitCallback = this._exitCallback; - cmd._storeOptionsAsProperties = this._storeOptionsAsProperties; - cmd._passCommandToAction = this._passCommandToAction; - cmd._combineFlagAndOptionalValue = this._combineFlagAndOptionalValue; - - cmd._executableFile = opts.executableFile || null; // Custom name for executable file, set missing to null to match constructor - this.commands.push(cmd); - cmd._parseExpectedArgs(args); - cmd.parent = this; - - if (desc) return this; - return cmd; - }; - - /** - * Factory routine to create a new unattached command. - * - * See .command() for creating an attached subcommand, which uses this routine to - * create the command. You can override createCommand to customise subcommands. - * - * @param {string} [name] - * @return {Command} new command - * @api public - */ - - createCommand(name) { - return new Command(name); - }; - - /** - * Add a prepared subcommand. - * - * See .command() for creating an attached subcommand which inherits settings from its parent. - * - * @param {Command} cmd - new subcommand - * @param {Object} [opts] - configuration options - * @return {Command} `this` command for chaining - * @api public - */ - - addCommand(cmd, opts) { - if (!cmd._name) throw new Error('Command passed to .addCommand() must have a name'); - - // To keep things simple, block automatic name generation for deeply nested executables. - // Fail fast and detect when adding rather than later when parsing. - function checkExplicitNames(commandArray) { - commandArray.forEach((cmd) => { - if (cmd._executableHandler && !cmd._executableFile) { - throw new Error(`Must specify executableFile for deeply nested executable: ${cmd.name()}`); - } - checkExplicitNames(cmd.commands); - }); - } - checkExplicitNames(cmd.commands); - - opts = opts || {}; - if (opts.isDefault) this._defaultCommandName = cmd._name; - if (opts.noHelp || opts.hidden) cmd._hidden = true; // modifying passed command due to existing implementation - - this.commands.push(cmd); - cmd.parent = this; - return this; - }; - - /** - * Define argument syntax for the command. - * - * @api public - */ - - arguments(desc) { - return this._parseExpectedArgs(desc.split(/ +/)); - }; - - /** - * Override default decision whether to add implicit help command. - * - * addHelpCommand() // force on - * addHelpCommand(false); // force off - * addHelpCommand('help [cmd]', 'display help for [cmd]'); // force on with custom details - * - * @return {Command} `this` command for chaining - * @api public - */ - - addHelpCommand(enableOrNameAndArgs, description) { - if (enableOrNameAndArgs === false) { - this._hasImplicitHelpCommand = false; - } else { - this._hasImplicitHelpCommand = true; - if (typeof enableOrNameAndArgs === 'string') { - this._helpCommandName = enableOrNameAndArgs.split(' ')[0]; - this._helpCommandnameAndArgs = enableOrNameAndArgs; - } - this._helpCommandDescription = description || this._helpCommandDescription; - } - return this; - }; - - /** - * @return {boolean} - * @api private - */ - - _lazyHasImplicitHelpCommand() { - if (this._hasImplicitHelpCommand === undefined) { - this._hasImplicitHelpCommand = this.commands.length && !this._actionHandler && !this._findCommand('help'); - } - return this._hasImplicitHelpCommand; - }; - - /** - * Parse expected `args`. - * - * For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`. - * - * @param {Array} args - * @return {Command} `this` command for chaining - * @api private - */ - - _parseExpectedArgs(args) { - if (!args.length) return; - args.forEach((arg) => { - const argDetails = { - required: false, - name: '', - variadic: false - }; - - switch (arg[0]) { - case '<': - argDetails.required = true; - argDetails.name = arg.slice(1, -1); - break; - case '[': - argDetails.name = arg.slice(1, -1); - break; - } - - if (argDetails.name.length > 3 && argDetails.name.slice(-3) === '...') { - argDetails.variadic = true; - argDetails.name = argDetails.name.slice(0, -3); - } - if (argDetails.name) { - this._args.push(argDetails); - } - }); - this._args.forEach((arg, i) => { - if (arg.variadic && i < this._args.length - 1) { - throw new Error(`only the last argument can be variadic '${arg.name}'`); - } - }); - return this; - }; - - /** - * Register callback to use as replacement for calling process.exit. - * - * @param {Function} [fn] optional callback which will be passed a CommanderError, defaults to throwing - * @return {Command} `this` command for chaining - * @api public - */ - - exitOverride(fn) { - if (fn) { - this._exitCallback = fn; - } else { - this._exitCallback = (err) => { - if (err.code !== 'commander.executeSubCommandAsync') { - throw err; - } else { - // Async callback from spawn events, not useful to throw. - } - }; - } - return this; - }; - - /** - * Call process.exit, and _exitCallback if defined. - * - * @param {number} exitCode exit code for using with process.exit - * @param {string} code an id string representing the error - * @param {string} message human-readable description of the error - * @return never - * @api private - */ - - _exit(exitCode, code, message) { - if (this._exitCallback) { - this._exitCallback(new CommanderError(exitCode, code, message)); - // Expecting this line is not reached. - } - process.exit(exitCode); - }; - - /** - * Register callback `fn` for the command. - * - * Examples: - * - * program - * .command('help') - * .description('display verbose help') - * .action(function() { - * // output help here - * }); - * - * @param {Function} fn - * @return {Command} `this` command for chaining - * @api public - */ - - action(fn) { - const listener = (args) => { - // The .action callback takes an extra parameter which is the command or options. - const expectedArgsCount = this._args.length; - const actionArgs = args.slice(0, expectedArgsCount); - if (this._passCommandToAction) { - actionArgs[expectedArgsCount] = this; - } else { - actionArgs[expectedArgsCount] = this.opts(); - } - // Add the extra arguments so available too. - if (args.length > expectedArgsCount) { - actionArgs.push(args.slice(expectedArgsCount)); - } - - const actionResult = fn.apply(this, actionArgs); - // Remember result in case it is async. Assume parseAsync getting called on root. - let rootCommand = this; - while (rootCommand.parent) { - rootCommand = rootCommand.parent; - } - rootCommand._actionResults.push(actionResult); - }; - this._actionHandler = listener; - return this; - }; - - /** - * Internal routine to check whether there is a clash storing option value with a Command property. - * - * @param {Option} option - * @api private - */ - - _checkForOptionNameClash(option) { - if (!this._storeOptionsAsProperties || this._storeOptionsAsPropertiesCalled) { - // Storing options safely, or user has been explicit and up to them. - return; - } - // User may override help, and hard to tell if worth warning. - if (option.name() === 'help') { - return; - } - - const commandProperty = this._getOptionValue(option.attributeName()); - if (commandProperty === undefined) { - // no clash - return; - } - - let foundClash = true; - if (option.negate) { - // It is ok if define foo before --no-foo. - const positiveLongFlag = option.long.replace(/^--no-/, '--'); - foundClash = !this._findOption(positiveLongFlag); - } else if (option.long) { - const negativeLongFlag = option.long.replace(/^--/, '--no-'); - foundClash = !this._findOption(negativeLongFlag); - } - - if (foundClash) { - throw new Error(`option '${option.name()}' clashes with existing property '${option.attributeName()}' on Command -- call storeOptionsAsProperties(false) to store option values safely, -- or call storeOptionsAsProperties(true) to suppress this check, -- or change option name - -Read more on https://git.io/JJc0W`); - } - }; - - /** - * Internal implementation shared by .option() and .requiredOption() - * - * @param {Object} config - * @param {string} flags - * @param {string} description - * @param {Function|*} [fn] - custom option processing function or default value - * @param {*} [defaultValue] - * @return {Command} `this` command for chaining - * @api private - */ - - _optionEx(config, flags, description, fn, defaultValue) { - const option = new Option(flags, description); - const oname = option.name(); - const name = option.attributeName(); - option.mandatory = !!config.mandatory; - - this._checkForOptionNameClash(option); - - // default as 3rd arg - if (typeof fn !== 'function') { - if (fn instanceof RegExp) { - // This is a bit simplistic (especially no error messages), and probably better handled by caller using custom option processing. - // No longer documented in README, but still present for backwards compatibility. - const regex = fn; - fn = (val, def) => { - const m = regex.exec(val); - return m ? m[0] : def; - }; - } else { - defaultValue = fn; - fn = null; - } - } - - // preassign default value for --no-*, [optional], , or plain flag if boolean value - if (option.negate || option.optional || option.required || typeof defaultValue === 'boolean') { - // when --no-foo we make sure default is true, unless a --foo option is already defined - if (option.negate) { - const positiveLongFlag = option.long.replace(/^--no-/, '--'); - defaultValue = this._findOption(positiveLongFlag) ? this._getOptionValue(name) : true; - } - // preassign only if we have a default - if (defaultValue !== undefined) { - this._setOptionValue(name, defaultValue); - option.defaultValue = defaultValue; - } - } - - // register the option - this.options.push(option); - - // when it's passed assign the value - // and conditionally invoke the callback - this.on('option:' + oname, (val) => { - const oldValue = this._getOptionValue(name); - - // custom processing - if (val !== null && fn) { - val = fn(val, oldValue === undefined ? defaultValue : oldValue); - } else if (val !== null && option.variadic) { - if (oldValue === defaultValue || !Array.isArray(oldValue)) { - val = [val]; - } else { - val = oldValue.concat(val); - } - } - - // unassigned or boolean value - if (typeof oldValue === 'boolean' || typeof oldValue === 'undefined') { - // if no value, negate false, and we have a default, then use it! - if (val == null) { - this._setOptionValue(name, option.negate - ? false - : defaultValue || true); - } else { - this._setOptionValue(name, val); - } - } else if (val !== null) { - // reassign - this._setOptionValue(name, option.negate ? false : val); - } - }); - - return this; - }; - - /** - * Define option with `flags`, `description` and optional - * coercion `fn`. - * - * The `flags` string should contain both the short and long flags, - * separated by comma, a pipe or space. The following are all valid - * all will output this way when `--help` is used. - * - * "-p, --pepper" - * "-p|--pepper" - * "-p --pepper" - * - * Examples: - * - * // simple boolean defaulting to undefined - * program.option('-p, --pepper', 'add pepper'); - * - * program.pepper - * // => undefined - * - * --pepper - * program.pepper - * // => true - * - * // simple boolean defaulting to true (unless non-negated option is also defined) - * program.option('-C, --no-cheese', 'remove cheese'); - * - * program.cheese - * // => true - * - * --no-cheese - * program.cheese - * // => false - * - * // required argument - * program.option('-C, --chdir ', 'change the working directory'); - * - * --chdir /tmp - * program.chdir - * // => "/tmp" - * - * // optional argument - * program.option('-c, --cheese [type]', 'add cheese [marble]'); - * - * @param {string} flags - * @param {string} description - * @param {Function|*} [fn] - custom option processing function or default value - * @param {*} [defaultValue] - * @return {Command} `this` command for chaining - * @api public - */ - - option(flags, description, fn, defaultValue) { - return this._optionEx({}, flags, description, fn, defaultValue); - }; - - /** - * Add a required option which must have a value after parsing. This usually means - * the option must be specified on the command line. (Otherwise the same as .option().) - * - * The `flags` string should contain both the short and long flags, separated by comma, a pipe or space. - * - * @param {string} flags - * @param {string} description - * @param {Function|*} [fn] - custom option processing function or default value - * @param {*} [defaultValue] - * @return {Command} `this` command for chaining - * @api public - */ - - requiredOption(flags, description, fn, defaultValue) { - return this._optionEx({ mandatory: true }, flags, description, fn, defaultValue); - }; - - /** - * Alter parsing of short flags with optional values. - * - * Examples: - * - * // for `.option('-f,--flag [value]'): - * .combineFlagAndOptionalValue(true) // `-f80` is treated like `--flag=80`, this is the default behaviour - * .combineFlagAndOptionalValue(false) // `-fb` is treated like `-f -b` - * - * @param {Boolean} [arg] - if `true` or omitted, an optional value can be specified directly after the flag. - * @api public - */ - combineFlagAndOptionalValue(arg) { - this._combineFlagAndOptionalValue = (arg === undefined) || arg; - return this; - }; - - /** - * Allow unknown options on the command line. - * - * @param {Boolean} [arg] - if `true` or omitted, no error will be thrown - * for unknown options. - * @api public - */ - allowUnknownOption(arg) { - this._allowUnknownOption = (arg === undefined) || arg; - return this; - }; - - /** - * Whether to store option values as properties on command object, - * or store separately (specify false). In both cases the option values can be accessed using .opts(). - * - * @param {boolean} value - * @return {Command} `this` command for chaining - * @api public - */ - - storeOptionsAsProperties(value) { - this._storeOptionsAsPropertiesCalled = true; - this._storeOptionsAsProperties = (value === undefined) || value; - if (this.options.length) { - throw new Error('call .storeOptionsAsProperties() before adding options'); - } - return this; - }; - - /** - * Whether to pass command to action handler, - * or just the options (specify false). - * - * @param {boolean} value - * @return {Command} `this` command for chaining - * @api public - */ - - passCommandToAction(value) { - this._passCommandToAction = (value === undefined) || value; - return this; - }; - - /** - * Store option value - * - * @param {string} key - * @param {Object} value - * @api private - */ - - _setOptionValue(key, value) { - if (this._storeOptionsAsProperties) { - this[key] = value; - } else { - this._optionValues[key] = value; - } - }; - - /** - * Retrieve option value - * - * @param {string} key - * @return {Object} value - * @api private - */ - - _getOptionValue(key) { - if (this._storeOptionsAsProperties) { - return this[key]; - } - return this._optionValues[key]; - }; - - /** - * Parse `argv`, setting options and invoking commands when defined. - * - * The default expectation is that the arguments are from node and have the application as argv[0] - * and the script being run in argv[1], with user parameters after that. - * - * Examples: - * - * program.parse(process.argv); - * program.parse(); // implicitly use process.argv and auto-detect node vs electron conventions - * program.parse(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0] - * - * @param {string[]} [argv] - optional, defaults to process.argv - * @param {Object} [parseOptions] - optionally specify style of options with from: node/user/electron - * @param {string} [parseOptions.from] - where the args are from: 'node', 'user', 'electron' - * @return {Command} `this` command for chaining - * @api public - */ - - parse(argv, parseOptions) { - if (argv !== undefined && !Array.isArray(argv)) { - throw new Error('first parameter to parse must be array or undefined'); - } - parseOptions = parseOptions || {}; - - // Default to using process.argv - if (argv === undefined) { - argv = process.argv; - // @ts-ignore - if (process.versions && process.versions.electron) { - parseOptions.from = 'electron'; - } - } - this.rawArgs = argv.slice(); - - // make it a little easier for callers by supporting various argv conventions - let userArgs; - switch (parseOptions.from) { - case undefined: - case 'node': - this._scriptPath = argv[1]; - userArgs = argv.slice(2); - break; - case 'electron': - // @ts-ignore - if (process.defaultApp) { - this._scriptPath = argv[1]; - userArgs = argv.slice(2); - } else { - userArgs = argv.slice(1); - } - break; - case 'user': - userArgs = argv.slice(0); - break; - default: - throw new Error(`unexpected parse option { from: '${parseOptions.from}' }`); - } - if (!this._scriptPath && process.mainModule) { - this._scriptPath = process.mainModule.filename; - } - - // Guess name, used in usage in help. - this._name = this._name || (this._scriptPath && path.basename(this._scriptPath, path.extname(this._scriptPath))); - - // Let's go! - this._parseCommand([], userArgs); - - return this; - }; - - /** - * Parse `argv`, setting options and invoking commands when defined. - * - * Use parseAsync instead of parse if any of your action handlers are async. Returns a Promise. - * - * The default expectation is that the arguments are from node and have the application as argv[0] - * and the script being run in argv[1], with user parameters after that. - * - * Examples: - * - * program.parseAsync(process.argv); - * program.parseAsync(); // implicitly use process.argv and auto-detect node vs electron conventions - * program.parseAsync(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0] - * - * @param {string[]} [argv] - * @param {Object} [parseOptions] - * @param {string} parseOptions.from - where the args are from: 'node', 'user', 'electron' - * @return {Promise} - * @api public - */ - - parseAsync(argv, parseOptions) { - this.parse(argv, parseOptions); - return Promise.all(this._actionResults).then(() => this); - }; - - /** - * Execute a sub-command executable. - * - * @api private - */ - - _executeSubCommand(subcommand, args) { - args = args.slice(); - let launchWithNode = false; // Use node for source targets so do not need to get permissions correct, and on Windows. - const sourceExt = ['.js', '.ts', '.tsx', '.mjs']; - - // Not checking for help first. Unlikely to have mandatory and executable, and can't robustly test for help flags in external command. - this._checkForMissingMandatoryOptions(); - - // Want the entry script as the reference for command name and directory for searching for other files. - let scriptPath = this._scriptPath; - // Fallback in case not set, due to how Command created or called. - if (!scriptPath && process.mainModule) { - scriptPath = process.mainModule.filename; - } - - let baseDir; - try { - const resolvedLink = fs.realpathSync(scriptPath); - baseDir = path.dirname(resolvedLink); - } catch (e) { - baseDir = '.'; // dummy, probably not going to find executable! - } - - // name of the subcommand, like `pm-install` - let bin = path.basename(scriptPath, path.extname(scriptPath)) + '-' + subcommand._name; - if (subcommand._executableFile) { - bin = subcommand._executableFile; - } - - const localBin = path.join(baseDir, bin); - if (fs.existsSync(localBin)) { - // prefer local `./` to bin in the $PATH - bin = localBin; - } else { - // Look for source files. - sourceExt.forEach((ext) => { - if (fs.existsSync(`${localBin}${ext}`)) { - bin = `${localBin}${ext}`; - } - }); - } - launchWithNode = sourceExt.includes(path.extname(bin)); - - let proc; - if (process.platform !== 'win32') { - if (launchWithNode) { - args.unshift(bin); - // add executable arguments to spawn - args = incrementNodeInspectorPort(process.execArgv).concat(args); - - proc = spawn(process.argv[0], args, { stdio: 'inherit' }); - } else { - proc = spawn(bin, args, { stdio: 'inherit' }); - } - } else { - args.unshift(bin); - // add executable arguments to spawn - args = incrementNodeInspectorPort(process.execArgv).concat(args); - proc = spawn(process.execPath, args, { stdio: 'inherit' }); - } - - const signals = ['SIGUSR1', 'SIGUSR2', 'SIGTERM', 'SIGINT', 'SIGHUP']; - signals.forEach((signal) => { - // @ts-ignore - process.on(signal, () => { - if (proc.killed === false && proc.exitCode === null) { - proc.kill(signal); - } - }); - }); - - // By default terminate process when spawned process terminates. - // Suppressing the exit if exitCallback defined is a bit messy and of limited use, but does allow process to stay running! - const exitCallback = this._exitCallback; - if (!exitCallback) { - proc.on('close', process.exit.bind(process)); - } else { - proc.on('close', () => { - exitCallback(new CommanderError(process.exitCode || 0, 'commander.executeSubCommandAsync', '(close)')); - }); - } - proc.on('error', (err) => { - // @ts-ignore - if (err.code === 'ENOENT') { - const executableMissing = `'${bin}' does not exist - - if '${subcommand._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead - - if the default executable name is not suitable, use the executableFile option to supply a custom name`; - throw new Error(executableMissing); - // @ts-ignore - } else if (err.code === 'EACCES') { - throw new Error(`'${bin}' not executable`); - } - if (!exitCallback) { - process.exit(1); - } else { - const wrappedError = new CommanderError(1, 'commander.executeSubCommandAsync', '(error)'); - wrappedError.nestedError = err; - exitCallback(wrappedError); - } - }); - - // Store the reference to the child process - this.runningCommand = proc; - }; - - /** - * @api private - */ - _dispatchSubcommand(commandName, operands, unknown) { - const subCommand = this._findCommand(commandName); - if (!subCommand) this._helpAndError(); - - if (subCommand._executableHandler) { - this._executeSubCommand(subCommand, operands.concat(unknown)); - } else { - subCommand._parseCommand(operands, unknown); - } - }; - - /** - * Process arguments in context of this command. - * - * @api private - */ - - _parseCommand(operands, unknown) { - const parsed = this.parseOptions(unknown); - operands = operands.concat(parsed.operands); - unknown = parsed.unknown; - this.args = operands.concat(unknown); - - if (operands && this._findCommand(operands[0])) { - this._dispatchSubcommand(operands[0], operands.slice(1), unknown); - } else if (this._lazyHasImplicitHelpCommand() && operands[0] === this._helpCommandName) { - if (operands.length === 1) { - this.help(); - } else { - this._dispatchSubcommand(operands[1], [], [this._helpLongFlag]); - } - } else if (this._defaultCommandName) { - outputHelpIfRequested(this, unknown); // Run the help for default command from parent rather than passing to default command - this._dispatchSubcommand(this._defaultCommandName, operands, unknown); - } else { - if (this.commands.length && this.args.length === 0 && !this._actionHandler && !this._defaultCommandName) { - // probably missing subcommand and no handler, user needs help - this._helpAndError(); - } - - outputHelpIfRequested(this, parsed.unknown); - this._checkForMissingMandatoryOptions(); - if (parsed.unknown.length > 0) { - this.unknownOption(parsed.unknown[0]); - } - - if (this._actionHandler) { - const args = this.args.slice(); - this._args.forEach((arg, i) => { - if (arg.required && args[i] == null) { - this.missingArgument(arg.name); - } else if (arg.variadic) { - args[i] = args.splice(i); - } - }); - - this._actionHandler(args); - this.emit('command:' + this.name(), operands, unknown); - } else if (operands.length) { - if (this._findCommand('*')) { - this._dispatchSubcommand('*', operands, unknown); - } else if (this.listenerCount('command:*')) { - this.emit('command:*', operands, unknown); - } else if (this.commands.length) { - this.unknownCommand(); - } - } else if (this.commands.length) { - // This command has subcommands and nothing hooked up at this level, so display help. - this._helpAndError(); - } else { - // fall through for caller to handle after calling .parse() - } - } - }; - - /** - * Find matching command. - * - * @api private - */ - _findCommand(name) { - if (!name) return undefined; - return this.commands.find(cmd => cmd._name === name || cmd._aliases.includes(name)); - }; - - /** - * Return an option matching `arg` if any. - * - * @param {string} arg - * @return {Option} - * @api private - */ - - _findOption(arg) { - return this.options.find(option => option.is(arg)); - }; - - /** - * Display an error message if a mandatory option does not have a value. - * Lazy calling after checking for help flags from leaf subcommand. - * - * @api private - */ - - _checkForMissingMandatoryOptions() { - // Walk up hierarchy so can call in subcommand after checking for displaying help. - for (let cmd = this; cmd; cmd = cmd.parent) { - cmd.options.forEach((anOption) => { - if (anOption.mandatory && (cmd._getOptionValue(anOption.attributeName()) === undefined)) { - cmd.missingMandatoryOptionValue(anOption); - } - }); - } - }; - - /** - * Parse options from `argv` removing known options, - * and return argv split into operands and unknown arguments. - * - * Examples: - * - * argv => operands, unknown - * --known kkk op => [op], [] - * op --known kkk => [op], [] - * sub --unknown uuu op => [sub], [--unknown uuu op] - * sub -- --unknown uuu op => [sub --unknown uuu op], [] - * - * @param {String[]} argv - * @return {{operands: String[], unknown: String[]}} - * @api public - */ - - parseOptions(argv) { - const operands = []; // operands, not options or values - const unknown = []; // first unknown option and remaining unknown args - let dest = operands; - const args = argv.slice(); - - function maybeOption(arg) { - return arg.length > 1 && arg[0] === '-'; - } - - // parse options - let activeVariadicOption = null; - while (args.length) { - const arg = args.shift(); - - // literal - if (arg === '--') { - if (dest === unknown) dest.push(arg); - dest.push(...args); - break; - } - - if (activeVariadicOption && !maybeOption(arg)) { - this.emit(`option:${activeVariadicOption.name()}`, arg); - continue; - } - activeVariadicOption = null; - - if (maybeOption(arg)) { - const option = this._findOption(arg); - // recognised option, call listener to assign value with possible custom processing - if (option) { - if (option.required) { - const value = args.shift(); - if (value === undefined) this.optionMissingArgument(option); - this.emit(`option:${option.name()}`, value); - } else if (option.optional) { - let value = null; - // historical behaviour is optional value is following arg unless an option - if (args.length > 0 && !maybeOption(args[0])) { - value = args.shift(); - } - this.emit(`option:${option.name()}`, value); - } else { // boolean flag - this.emit(`option:${option.name()}`); - } - activeVariadicOption = option.variadic ? option : null; - continue; - } - } - - // Look for combo options following single dash, eat first one if known. - if (arg.length > 2 && arg[0] === '-' && arg[1] !== '-') { - const option = this._findOption(`-${arg[1]}`); - if (option) { - if (option.required || (option.optional && this._combineFlagAndOptionalValue)) { - // option with value following in same argument - this.emit(`option:${option.name()}`, arg.slice(2)); - } else { - // boolean option, emit and put back remainder of arg for further processing - this.emit(`option:${option.name()}`); - args.unshift(`-${arg.slice(2)}`); - } - continue; - } - } - - // Look for known long flag with value, like --foo=bar - if (/^--[^=]+=/.test(arg)) { - const index = arg.indexOf('='); - const option = this._findOption(arg.slice(0, index)); - if (option && (option.required || option.optional)) { - this.emit(`option:${option.name()}`, arg.slice(index + 1)); - continue; - } - } - - // looks like an option but unknown, unknowns from here - if (arg.length > 1 && arg[0] === '-') { - dest = unknown; - } - - // add arg - dest.push(arg); - } - - return { operands, unknown }; - }; - - /** - * Return an object containing options as key-value pairs - * - * @return {Object} - * @api public - */ - opts() { - if (this._storeOptionsAsProperties) { - // Preserve original behaviour so backwards compatible when still using properties - const result = {}; - const len = this.options.length; - - for (let i = 0; i < len; i++) { - const key = this.options[i].attributeName(); - result[key] = key === this._versionOptionName ? this._version : this[key]; - } - return result; - } - - return this._optionValues; - }; - - /** - * Argument `name` is missing. - * - * @param {string} name - * @api private - */ - - missingArgument(name) { - const message = `error: missing required argument '${name}'`; - console.error(message); - this._exit(1, 'commander.missingArgument', message); - }; - - /** - * `Option` is missing an argument, but received `flag` or nothing. - * - * @param {Option} option - * @param {string} [flag] - * @api private - */ - - optionMissingArgument(option, flag) { - let message; - if (flag) { - message = `error: option '${option.flags}' argument missing, got '${flag}'`; - } else { - message = `error: option '${option.flags}' argument missing`; - } - console.error(message); - this._exit(1, 'commander.optionMissingArgument', message); - }; - - /** - * `Option` does not have a value, and is a mandatory option. - * - * @param {Option} option - * @api private - */ - - missingMandatoryOptionValue(option) { - const message = `error: required option '${option.flags}' not specified`; - console.error(message); - this._exit(1, 'commander.missingMandatoryOptionValue', message); - }; - - /** - * Unknown option `flag`. - * - * @param {string} flag - * @api private - */ - - unknownOption(flag) { - if (this._allowUnknownOption) return; - const message = `error: unknown option '${flag}'`; - console.error(message); - this._exit(1, 'commander.unknownOption', message); - }; - - /** - * Unknown command. - * - * @api private - */ - - unknownCommand() { - const partCommands = [this.name()]; - for (let parentCmd = this.parent; parentCmd; parentCmd = parentCmd.parent) { - partCommands.unshift(parentCmd.name()); - } - const fullCommand = partCommands.join(' '); - const message = `error: unknown command '${this.args[0]}'.` + - (this._hasHelpOption ? ` See '${fullCommand} ${this._helpLongFlag}'.` : ''); - console.error(message); - this._exit(1, 'commander.unknownCommand', message); - }; - - /** - * Set the program version to `str`. - * - * This method auto-registers the "-V, --version" flag - * which will print the version number when passed. - * - * You can optionally supply the flags and description to override the defaults. - * - * @param {string} str - * @param {string} [flags] - * @param {string} [description] - * @return {this | string} `this` command for chaining, or version string if no arguments - * @api public - */ - - version(str, flags, description) { - if (str === undefined) return this._version; - this._version = str; - flags = flags || '-V, --version'; - description = description || 'output the version number'; - const versionOption = new Option(flags, description); - this._versionOptionName = versionOption.attributeName(); - this.options.push(versionOption); - this.on('option:' + versionOption.name(), () => { - process.stdout.write(str + '\n'); - this._exit(0, 'commander.version', str); - }); - return this; - }; - - /** - * Set the description to `str`. - * - * @param {string} str - * @param {Object} [argsDescription] - * @return {string|Command} - * @api public - */ - - description(str, argsDescription) { - if (str === undefined && argsDescription === undefined) return this._description; - this._description = str; - this._argsDescription = argsDescription; - return this; - }; - - /** - * Set an alias for the command. - * - * You may call more than once to add multiple aliases. Only the first alias is shown in the auto-generated help. - * - * @param {string} [alias] - * @return {string|Command} - * @api public - */ - - alias(alias) { - if (alias === undefined) return this._aliases[0]; // just return first, for backwards compatibility - - let command = this; - if (this.commands.length !== 0 && this.commands[this.commands.length - 1]._executableHandler) { - // assume adding alias for last added executable subcommand, rather than this - command = this.commands[this.commands.length - 1]; - } - - if (alias === command._name) throw new Error('Command alias can\'t be the same as its name'); - - command._aliases.push(alias); - return this; - }; - - /** - * Set aliases for the command. - * - * Only the first alias is shown in the auto-generated help. - * - * @param {string[]} [aliases] - * @return {string[]|Command} - * @api public - */ - - aliases(aliases) { - // Getter for the array of aliases is the main reason for having aliases() in addition to alias(). - if (aliases === undefined) return this._aliases; - - aliases.forEach((alias) => this.alias(alias)); - return this; - }; - - /** - * Set / get the command usage `str`. - * - * @param {string} [str] - * @return {String|Command} - * @api public - */ - - usage(str) { - if (str === undefined) { - if (this._usage) return this._usage; - - const args = this._args.map((arg) => { - return humanReadableArgName(arg); - }); - return [].concat( - (this.options.length || this._hasHelpOption ? '[options]' : []), - (this.commands.length ? '[command]' : []), - (this._args.length ? args : []) - ).join(' '); - } - - this._usage = str; - return this; - }; - - /** - * Get or set the name of the command - * - * @param {string} [str] - * @return {String|Command} - * @api public - */ - - name(str) { - if (str === undefined) return this._name; - this._name = str; - return this; - }; - - /** - * Return prepared commands. - * - * @return {Array} - * @api private - */ - - prepareCommands() { - const commandDetails = this.commands.filter((cmd) => { - return !cmd._hidden; - }).map((cmd) => { - const args = cmd._args.map((arg) => { - return humanReadableArgName(arg); - }).join(' '); - - return [ - cmd._name + - (cmd._aliases[0] ? '|' + cmd._aliases[0] : '') + - (cmd.options.length ? ' [options]' : '') + - (args ? ' ' + args : ''), - cmd._description - ]; - }); - - if (this._lazyHasImplicitHelpCommand()) { - commandDetails.push([this._helpCommandnameAndArgs, this._helpCommandDescription]); - } - return commandDetails; - }; - - /** - * Return the largest command length. - * - * @return {number} - * @api private - */ - - largestCommandLength() { - const commands = this.prepareCommands(); - return commands.reduce((max, command) => { - return Math.max(max, command[0].length); - }, 0); - }; - - /** - * Return the largest option length. - * - * @return {number} - * @api private - */ - - largestOptionLength() { - const options = [].slice.call(this.options); - options.push({ - flags: this._helpFlags - }); - - return options.reduce((max, option) => { - return Math.max(max, option.flags.length); - }, 0); - }; - - /** - * Return the largest arg length. - * - * @return {number} - * @api private - */ - - largestArgLength() { - return this._args.reduce((max, arg) => { - return Math.max(max, arg.name.length); - }, 0); - }; - - /** - * Return the pad width. - * - * @return {number} - * @api private - */ - - padWidth() { - let width = this.largestOptionLength(); - if (this._argsDescription && this._args.length) { - if (this.largestArgLength() > width) { - width = this.largestArgLength(); - } - } - - if (this.commands && this.commands.length) { - if (this.largestCommandLength() > width) { - width = this.largestCommandLength(); - } - } - - return width; - }; - - /** - * Return help for options. - * - * @return {string} - * @api private - */ - - optionHelp() { - const width = this.padWidth(); - const columns = process.stdout.columns || 80; - const descriptionWidth = columns - width - 4; - function padOptionDetails(flags, description) { - return pad(flags, width) + ' ' + optionalWrap(description, descriptionWidth, width + 2); - }; - - // Explicit options (including version) - const help = this.options.map((option) => { - const fullDesc = option.description + - ((!option.negate && option.defaultValue !== undefined) ? ' (default: ' + JSON.stringify(option.defaultValue) + ')' : ''); - return padOptionDetails(option.flags, fullDesc); - }); - - // Implicit help - const showShortHelpFlag = this._hasHelpOption && this._helpShortFlag && !this._findOption(this._helpShortFlag); - const showLongHelpFlag = this._hasHelpOption && !this._findOption(this._helpLongFlag); - if (showShortHelpFlag || showLongHelpFlag) { - let helpFlags = this._helpFlags; - if (!showShortHelpFlag) { - helpFlags = this._helpLongFlag; - } else if (!showLongHelpFlag) { - helpFlags = this._helpShortFlag; - } - help.push(padOptionDetails(helpFlags, this._helpDescription)); - } - - return help.join('\n'); - }; - - /** - * Return command help documentation. - * - * @return {string} - * @api private - */ - - commandHelp() { - if (!this.commands.length && !this._lazyHasImplicitHelpCommand()) return ''; - - const commands = this.prepareCommands(); - const width = this.padWidth(); - - const columns = process.stdout.columns || 80; - const descriptionWidth = columns - width - 4; - - return [ - 'Commands:', - commands.map((cmd) => { - const desc = cmd[1] ? ' ' + cmd[1] : ''; - return (desc ? pad(cmd[0], width) : cmd[0]) + optionalWrap(desc, descriptionWidth, width + 2); - }).join('\n').replace(/^/gm, ' '), - '' - ].join('\n'); - }; - - /** - * Return program help documentation. - * - * @return {string} - * @api public - */ - - helpInformation() { - let desc = []; - if (this._description) { - desc = [ - this._description, - '' - ]; - - const argsDescription = this._argsDescription; - if (argsDescription && this._args.length) { - const width = this.padWidth(); - const columns = process.stdout.columns || 80; - const descriptionWidth = columns - width - 5; - desc.push('Arguments:'); - this._args.forEach((arg) => { - desc.push(' ' + pad(arg.name, width) + ' ' + wrap(argsDescription[arg.name] || '', descriptionWidth, width + 4)); - }); - desc.push(''); - } - } - - let cmdName = this._name; - if (this._aliases[0]) { - cmdName = cmdName + '|' + this._aliases[0]; - } - let parentCmdNames = ''; - for (let parentCmd = this.parent; parentCmd; parentCmd = parentCmd.parent) { - parentCmdNames = parentCmd.name() + ' ' + parentCmdNames; - } - const usage = [ - 'Usage: ' + parentCmdNames + cmdName + ' ' + this.usage(), - '' - ]; - - let cmds = []; - const commandHelp = this.commandHelp(); - if (commandHelp) cmds = [commandHelp]; - - let options = []; - if (this._hasHelpOption || this.options.length > 0) { - options = [ - 'Options:', - '' + this.optionHelp().replace(/^/gm, ' '), - '' - ]; - } - - return usage - .concat(desc) - .concat(options) - .concat(cmds) - .join('\n'); - }; - - /** - * Output help information for this command. - * - * When listener(s) are available for the helpLongFlag - * those callbacks are invoked. - * - * @api public - */ - - outputHelp(cb) { - if (!cb) { - cb = (passthru) => { - return passthru; - }; - } - const cbOutput = cb(this.helpInformation()); - if (typeof cbOutput !== 'string' && !Buffer.isBuffer(cbOutput)) { - throw new Error('outputHelp callback must return a string or a Buffer'); - } - process.stdout.write(cbOutput); - this.emit(this._helpLongFlag); - }; - - /** - * You can pass in flags and a description to override the help - * flags and help description for your command. Pass in false to - * disable the built-in help option. - * - * @param {string | boolean} [flags] - * @param {string} [description] - * @return {Command} `this` command for chaining - * @api public - */ - - helpOption(flags, description) { - if (typeof flags === 'boolean') { - this._hasHelpOption = flags; - return this; - } - this._helpFlags = flags || this._helpFlags; - this._helpDescription = description || this._helpDescription; - - const helpFlags = _parseOptionFlags(this._helpFlags); - this._helpShortFlag = helpFlags.shortFlag; - this._helpLongFlag = helpFlags.longFlag; - - return this; - }; - - /** - * Output help information and exit. - * - * @param {Function} [cb] - * @api public - */ - - help(cb) { - this.outputHelp(cb); - // exitCode: preserving original behaviour which was calling process.exit() - // message: do not have all displayed text available so only passing placeholder. - this._exit(process.exitCode || 0, 'commander.help', '(outputHelp)'); - }; - - /** - * Output help information and exit. Display for error situations. - * - * @api private - */ - - _helpAndError() { - this.outputHelp(); - // message: do not have all displayed text available so only passing placeholder. - this._exit(1, 'commander.help', '(outputHelp)'); - }; -}; - -/** - * Expose the root command. - */ - -exports = module.exports = new Command(); -exports.program = exports; // More explicit access to global command. - -/** - * Expose classes - */ - -exports.Command = Command; -exports.Option = Option; -exports.CommanderError = CommanderError; - -/** - * Camel-case the given `flag` - * - * @param {string} flag - * @return {string} - * @api private - */ - -function camelcase(flag) { - return flag.split('-').reduce((str, word) => { - return str + word[0].toUpperCase() + word.slice(1); - }); -} - -/** - * Pad `str` to `width`. - * - * @param {string} str - * @param {number} width - * @return {string} - * @api private - */ - -function pad(str, width) { - const len = Math.max(0, width - str.length); - return str + Array(len + 1).join(' '); -} - -/** - * Wraps the given string with line breaks at the specified width while breaking - * words and indenting every but the first line on the left. - * - * @param {string} str - * @param {number} width - * @param {number} indent - * @return {string} - * @api private - */ -function wrap(str, width, indent) { - const regex = new RegExp('.{1,' + (width - 1) + '}([\\s\u200B]|$)|[^\\s\u200B]+?([\\s\u200B]|$)', 'g'); - const lines = str.match(regex) || []; - return lines.map((line, i) => { - if (line.slice(-1) === '\n') { - line = line.slice(0, line.length - 1); - } - return ((i > 0 && indent) ? Array(indent + 1).join(' ') : '') + line.trimRight(); - }).join('\n'); -} - -/** - * Optionally wrap the given str to a max width of width characters per line - * while indenting with indent spaces. Do not wrap if insufficient width or - * string is manually formatted. - * - * @param {string} str - * @param {number} width - * @param {number} indent - * @return {string} - * @api private - */ -function optionalWrap(str, width, indent) { - // Detect manually wrapped and indented strings by searching for line breaks - // followed by multiple spaces/tabs. - if (str.match(/[\n]\s+/)) return str; - // Do not wrap to narrow columns (or can end up with a word per line). - const minWidth = 40; - if (width < minWidth) return str; - - return wrap(str, width, indent); -} - -/** - * Output help information if help flags specified - * - * @param {Command} cmd - command to output help for - * @param {Array} args - array of options to search for help flags - * @api private - */ - -function outputHelpIfRequested(cmd, args) { - const helpOption = cmd._hasHelpOption && args.find(arg => arg === cmd._helpLongFlag || arg === cmd._helpShortFlag); - if (helpOption) { - cmd.outputHelp(); - // (Do not have all displayed text available so only passing placeholder.) - cmd._exit(0, 'commander.helpDisplayed', '(outputHelp)'); - } -} - -/** - * Takes an argument and returns its human readable equivalent for help usage. - * - * @param {Object} arg - * @return {string} - * @api private - */ - -function humanReadableArgName(arg) { - const nameOutput = arg.name + (arg.variadic === true ? '...' : ''); - - return arg.required - ? '<' + nameOutput + '>' - : '[' + nameOutput + ']'; -} - -/** - * Parse the short and long flag out of something like '-m,--mixed ' - * - * @api private - */ - -function _parseOptionFlags(flags) { - let shortFlag; - let longFlag; - // Use original very loose parsing to maintain backwards compatibility for now, - // which allowed for example unintended `-sw, --short-word` [sic]. - const flagParts = flags.split(/[ |,]+/); - if (flagParts.length > 1 && !/^[[<]/.test(flagParts[1])) shortFlag = flagParts.shift(); - longFlag = flagParts.shift(); - // Add support for lone short flag without significantly changing parsing! - if (!shortFlag && /^-[^-]$/.test(longFlag)) { - shortFlag = longFlag; - longFlag = undefined; - } - return { shortFlag, longFlag }; -} - -/** - * Scan arguments and increment port number for inspect calls (to avoid conflicts when spawning new command). - * - * @param {string[]} args - array of arguments from node.execArgv - * @returns {string[]} - * @api private - */ - -function incrementNodeInspectorPort(args) { - // Testing for these options: - // --inspect[=[host:]port] - // --inspect-brk[=[host:]port] - // --inspect-port=[host:]port - return args.map((arg) => { - if (!arg.startsWith('--inspect')) { - return arg; - } - let debugOption; - let debugHost = '127.0.0.1'; - let debugPort = '9229'; - let match; - if ((match = arg.match(/^(--inspect(-brk)?)$/)) !== null) { - // e.g. --inspect - debugOption = match[1]; - } else if ((match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+)$/)) !== null) { - debugOption = match[1]; - if (/^\d+$/.test(match[3])) { - // e.g. --inspect=1234 - debugPort = match[3]; - } else { - // e.g. --inspect=localhost - debugHost = match[3]; - } - } else if ((match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/)) !== null) { - // e.g. --inspect=localhost:1234 - debugOption = match[1]; - debugHost = match[3]; - debugPort = match[4]; - } - - if (debugOption && debugPort !== '0') { - return `${debugOption}=${debugHost}:${parseInt(debugPort) + 1}`; - } - return arg; - }); -} diff --git a/node_modules/commander/package.json b/node_modules/commander/package.json deleted file mode 100644 index 1706c4c..0000000 --- a/node_modules/commander/package.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "_args": [ - [ - "commander@6.2.1", - "/home/nuno/Documents/core/software/fresh/js/metaforecasts/metaforecasts-current" - ] - ], - "_from": "commander@6.2.1", - "_id": "commander@6.2.1", - "_inBundle": false, - "_integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", - "_location": "/commander", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "commander@6.2.1", - "name": "commander", - "escapedName": "commander", - "rawSpec": "6.2.1", - "saveSpec": null, - "fetchSpec": "6.2.1" - }, - "_requiredBy": [ - "/json2csv" - ], - "_resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", - "_spec": "6.2.1", - "_where": "/home/nuno/Documents/core/software/fresh/js/metaforecasts/metaforecasts-current", - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "bugs": { - "url": "https://github.com/tj/commander.js/issues" - }, - "dependencies": {}, - "description": "the complete solution for node.js command-line programs", - "devDependencies": { - "@types/jest": "^26.0.15", - "@types/node": "^14.14.2", - "@typescript-eslint/eslint-plugin": "^4.5.0", - "eslint": "^7.11.0", - "eslint-config-standard-with-typescript": "^19.0.1", - "eslint-plugin-jest": "^24.1.0", - "jest": "^26.6.0", - "standard": "^15.0.0", - "typescript": "^4.0.3" - }, - "engines": { - "node": ">= 6" - }, - "files": [ - "index.js", - "typings/index.d.ts" - ], - "homepage": "https://github.com/tj/commander.js#readme", - "jest": { - "collectCoverage": true - }, - "keywords": [ - "commander", - "command", - "option", - "parser", - "cli", - "argument", - "args", - "argv" - ], - "license": "MIT", - "main": "index", - "name": "commander", - "repository": { - "type": "git", - "url": "git+https://github.com/tj/commander.js.git" - }, - "scripts": { - "lint": "eslint index.js \"tests/**/*.js\"", - "test": "jest && npm run test-typings", - "test-typings": "tsc -p tsconfig.json", - "typescript-lint": "eslint typings/*.ts" - }, - "typings": "typings/index.d.ts", - "version": "6.2.1" -} diff --git a/node_modules/commander/typings/index.d.ts b/node_modules/commander/typings/index.d.ts deleted file mode 100644 index 479446d..0000000 --- a/node_modules/commander/typings/index.d.ts +++ /dev/null @@ -1,410 +0,0 @@ -// Type definitions for commander -// Original definitions by: Alan Agius , Marcelo Dezem , vvakame , Jules Randolph - -declare namespace commander { - - interface CommanderError extends Error { - code: string; - exitCode: number; - message: string; - nestedError?: string; - } - type CommanderErrorConstructor = new (exitCode: number, code: string, message: string) => CommanderError; - - interface Option { - flags: string; - required: boolean; // A value must be supplied when the option is specified. - optional: boolean; // A value is optional when the option is specified. - mandatory: boolean; // The option must have a value after parsing, which usually means it must be specified on command line. - bool: boolean; - short?: string; - long: string; - description: string; - } - type OptionConstructor = new (flags: string, description?: string) => Option; - - interface ParseOptions { - from: 'node' | 'electron' | 'user'; - } - - interface Command { - [key: string]: any; // options as properties - - args: string[]; - - commands: Command[]; - - /** - * Set the program version to `str`. - * - * This method auto-registers the "-V, --version" flag - * which will print the version number when passed. - * - * You can optionally supply the flags and description to override the defaults. - */ - version(str: string, flags?: string, description?: string): this; - - /** - * Define a command, implemented using an action handler. - * - * @remarks - * The command description is supplied using `.description`, not as a parameter to `.command`. - * - * @example - * ```ts - * program - * .command('clone [destination]') - * .description('clone a repository into a newly created directory') - * .action((source, destination) => { - * console.log('clone command called'); - * }); - * ``` - * - * @param nameAndArgs - command name and arguments, args are `` or `[optional]` and last may also be `variadic...` - * @param opts - configuration options - * @returns new command - */ - command(nameAndArgs: string, opts?: CommandOptions): ReturnType; - /** - * Define a command, implemented in a separate executable file. - * - * @remarks - * The command description is supplied as the second parameter to `.command`. - * - * @example - * ```ts - * program - * .command('start ', 'start named service') - * .command('stop [service]', 'stop named service, or all if no name supplied'); - * ``` - * - * @param nameAndArgs - command name and arguments, args are `` or `[optional]` and last may also be `variadic...` - * @param description - description of executable command - * @param opts - configuration options - * @returns `this` command for chaining - */ - command(nameAndArgs: string, description: string, opts?: commander.ExecutableCommandOptions): this; - - /** - * Factory routine to create a new unattached command. - * - * See .command() for creating an attached subcommand, which uses this routine to - * create the command. You can override createCommand to customise subcommands. - */ - createCommand(name?: string): Command; - - /** - * Add a prepared subcommand. - * - * See .command() for creating an attached subcommand which inherits settings from its parent. - * - * @returns `this` command for chaining - */ - addCommand(cmd: Command, opts?: CommandOptions): this; - - /** - * Define argument syntax for command. - * - * @returns `this` command for chaining - */ - arguments(desc: string): this; - - /** - * Override default decision whether to add implicit help command. - * - * addHelpCommand() // force on - * addHelpCommand(false); // force off - * addHelpCommand('help [cmd]', 'display help for [cmd]'); // force on with custom details - * - * @returns `this` command for chaining - */ - addHelpCommand(enableOrNameAndArgs?: string | boolean, description?: string): this; - - /** - * Register callback to use as replacement for calling process.exit. - */ - exitOverride(callback?: (err: CommanderError) => never|void): this; - - /** - * Register callback `fn` for the command. - * - * @example - * program - * .command('help') - * .description('display verbose help') - * .action(function() { - * // output help here - * }); - * - * @returns `this` command for chaining - */ - action(fn: (...args: any[]) => void | Promise): this; - - /** - * Define option with `flags`, `description` and optional - * coercion `fn`. - * - * The `flags` string should contain both the short and long flags, - * separated by comma, a pipe or space. The following are all valid - * all will output this way when `--help` is used. - * - * "-p, --pepper" - * "-p|--pepper" - * "-p --pepper" - * - * @example - * // simple boolean defaulting to false - * program.option('-p, --pepper', 'add pepper'); - * - * --pepper - * program.pepper - * // => Boolean - * - * // simple boolean defaulting to true - * program.option('-C, --no-cheese', 'remove cheese'); - * - * program.cheese - * // => true - * - * --no-cheese - * program.cheese - * // => false - * - * // required argument - * program.option('-C, --chdir ', 'change the working directory'); - * - * --chdir /tmp - * program.chdir - * // => "/tmp" - * - * // optional argument - * program.option('-c, --cheese [type]', 'add cheese [marble]'); - * - * @returns `this` command for chaining - */ - option(flags: string, description?: string, defaultValue?: string | boolean): this; - option(flags: string, description: string, regexp: RegExp, defaultValue?: string | boolean): this; - option(flags: string, description: string, fn: (value: string, previous: T) => T, defaultValue?: T): this; - - /** - * Define a required option, which must have a value after parsing. This usually means - * the option must be specified on the command line. (Otherwise the same as .option().) - * - * The `flags` string should contain both the short and long flags, separated by comma, a pipe or space. - */ - requiredOption(flags: string, description?: string, defaultValue?: string | boolean): this; - requiredOption(flags: string, description: string, regexp: RegExp, defaultValue?: string | boolean): this; - requiredOption(flags: string, description: string, fn: (value: string, previous: T) => T, defaultValue?: T): this; - - /** - * Whether to store option values as properties on command object, - * or store separately (specify false). In both cases the option values can be accessed using .opts(). - * - * @returns `this` command for chaining - */ - storeOptionsAsProperties(value?: boolean): this; - - /** - * Whether to pass command to action handler, - * or just the options (specify false). - * - * @returns `this` command for chaining - */ - passCommandToAction(value?: boolean): this; - - /** - * Alter parsing of short flags with optional values. - * - * @example - * // for `.option('-f,--flag [value]'): - * .combineFlagAndOptionalValue(true) // `-f80` is treated like `--flag=80`, this is the default behaviour - * .combineFlagAndOptionalValue(false) // `-fb` is treated like `-f -b` - * - * @returns `this` command for chaining - */ - combineFlagAndOptionalValue(arg?: boolean): this; - - /** - * Allow unknown options on the command line. - * - * @param [arg] if `true` or omitted, no error will be thrown for unknown options. - * @returns `this` command for chaining - */ - allowUnknownOption(arg?: boolean): this; - - /** - * Parse `argv`, setting options and invoking commands when defined. - * - * The default expectation is that the arguments are from node and have the application as argv[0] - * and the script being run in argv[1], with user parameters after that. - * - * Examples: - * - * program.parse(process.argv); - * program.parse(); // implicitly use process.argv and auto-detect node vs electron conventions - * program.parse(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0] - * - * @returns `this` command for chaining - */ - parse(argv?: string[], options?: ParseOptions): this; - - /** - * Parse `argv`, setting options and invoking commands when defined. - * - * Use parseAsync instead of parse if any of your action handlers are async. Returns a Promise. - * - * The default expectation is that the arguments are from node and have the application as argv[0] - * and the script being run in argv[1], with user parameters after that. - * - * Examples: - * - * program.parseAsync(process.argv); - * program.parseAsync(); // implicitly use process.argv and auto-detect node vs electron conventions - * program.parseAsync(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0] - * - * @returns Promise - */ - parseAsync(argv?: string[], options?: ParseOptions): Promise; - - /** - * Parse options from `argv` removing known options, - * and return argv split into operands and unknown arguments. - * - * @example - * argv => operands, unknown - * --known kkk op => [op], [] - * op --known kkk => [op], [] - * sub --unknown uuu op => [sub], [--unknown uuu op] - * sub -- --unknown uuu op => [sub --unknown uuu op], [] - */ - parseOptions(argv: string[]): commander.ParseOptionsResult; - - /** - * Return an object containing options as key-value pairs - */ - opts(): { [key: string]: any }; - - /** - * Set the description. - * - * @returns `this` command for chaining - */ - description(str: string, argsDescription?: {[argName: string]: string}): this; - /** - * Get the description. - */ - description(): string; - - /** - * Set an alias for the command. - * - * You may call more than once to add multiple aliases. Only the first alias is shown in the auto-generated help. - * - * @returns `this` command for chaining - */ - alias(alias: string): this; - /** - * Get alias for the command. - */ - alias(): string; - - /** - * Set aliases for the command. - * - * Only the first alias is shown in the auto-generated help. - * - * @returns `this` command for chaining - */ - aliases(aliases: string[]): this; - /** - * Get aliases for the command. - */ - aliases(): string[]; - - /** - * Set the command usage. - * - * @returns `this` command for chaining - */ - usage(str: string): this; - /** - * Get the command usage. - */ - usage(): string; - - /** - * Set the name of the command. - * - * @returns `this` command for chaining - */ - name(str: string): this; - /** - * Get the name of the command. - */ - name(): string; - - /** - * Output help information for this command. - * - * When listener(s) are available for the helpLongFlag - * those callbacks are invoked. - */ - outputHelp(cb?: (str: string) => string): void; - - /** - * Return command help documentation. - */ - helpInformation(): string; - - /** - * You can pass in flags and a description to override the help - * flags and help description for your command. Pass in false - * to disable the built-in help option. - */ - helpOption(flags?: string | boolean, description?: string): this; - - /** - * Output help information and exit. - */ - help(cb?: (str: string) => string): never; - - /** - * Add a listener (callback) for when events occur. (Implemented using EventEmitter.) - * - * @example - * program - * .on('--help', () -> { - * console.log('See web site for more information.'); - * }); - */ - on(event: string | symbol, listener: (...args: any[]) => void): this; - } - type CommandConstructor = new (name?: string) => Command; - - interface CommandOptions { - noHelp?: boolean; // old name for hidden - hidden?: boolean; - isDefault?: boolean; - } - interface ExecutableCommandOptions extends CommandOptions { - executableFile?: string; - } - - interface ParseOptionsResult { - operands: string[]; - unknown: string[]; - } - - interface CommanderStatic extends Command { - program: Command; - Command: CommandConstructor; - Option: OptionConstructor; - CommanderError: CommanderErrorConstructor; - } - -} - -// Declaring namespace AND global -// eslint-disable-next-line @typescript-eslint/no-redeclare -declare const commander: commander.CommanderStatic; -export = commander; diff --git a/node_modules/follow-redirects/LICENSE b/node_modules/follow-redirects/LICENSE deleted file mode 100644 index 742cbad..0000000 --- a/node_modules/follow-redirects/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -Copyright 2014–present Olivier Lalonde , James Talmage , Ruben Verborgh - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/follow-redirects/README.md b/node_modules/follow-redirects/README.md deleted file mode 100644 index 68dfe0e..0000000 --- a/node_modules/follow-redirects/README.md +++ /dev/null @@ -1,148 +0,0 @@ -## Follow Redirects - -Drop-in replacement for Node's `http` and `https` modules that automatically follows redirects. - -[![npm version](https://img.shields.io/npm/v/follow-redirects.svg)](https://www.npmjs.com/package/follow-redirects) -[![Build Status](https://travis-ci.com/follow-redirects/follow-redirects.svg?branch=master)](https://travis-ci.com/follow-redirects/follow-redirects) -[![Coverage Status](https://coveralls.io/repos/follow-redirects/follow-redirects/badge.svg?branch=master)](https://coveralls.io/r/follow-redirects/follow-redirects?branch=master) -[![npm downloads](https://img.shields.io/npm/dm/follow-redirects.svg)](https://www.npmjs.com/package/follow-redirects) -[![Sponsor on GitHub](https://img.shields.io/static/v1?label=Sponsor&message=%F0%9F%92%96&logo=GitHub)](https://github.com/sponsors/RubenVerborgh) - -`follow-redirects` provides [request](https://nodejs.org/api/http.html#http_http_request_options_callback) and [get](https://nodejs.org/api/http.html#http_http_get_options_callback) - methods that behave identically to those found on the native [http](https://nodejs.org/api/http.html#http_http_request_options_callback) and [https](https://nodejs.org/api/https.html#https_https_request_options_callback) - modules, with the exception that they will seamlessly follow redirects. - -```javascript -const { http, https } = require('follow-redirects'); - -http.get('http://bit.ly/900913', response => { - response.on('data', chunk => { - console.log(chunk); - }); -}).on('error', err => { - console.error(err); -}); -``` - -You can inspect the final redirected URL through the `responseUrl` property on the `response`. -If no redirection happened, `responseUrl` is the original request URL. - -```javascript -const request = https.request({ - host: 'bitly.com', - path: '/UHfDGO', -}, response => { - console.log(response.responseUrl); - // 'http://duckduckgo.com/robots.txt' -}); -request.end(); -``` - -## Options -### Global options -Global options are set directly on the `follow-redirects` module: - -```javascript -const followRedirects = require('follow-redirects'); -followRedirects.maxRedirects = 10; -followRedirects.maxBodyLength = 20 * 1024 * 1024; // 20 MB -``` - -The following global options are supported: - -- `maxRedirects` (default: `21`) – sets the maximum number of allowed redirects; if exceeded, an error will be emitted. - -- `maxBodyLength` (default: 10MB) – sets the maximum size of the request body; if exceeded, an error will be emitted. - -### Per-request options -Per-request options are set by passing an `options` object: - -```javascript -const url = require('url'); -const { http, https } = require('follow-redirects'); - -const options = url.parse('http://bit.ly/900913'); -options.maxRedirects = 10; -options.beforeRedirect = (options, { headers }) => { - // Use this to adjust the request options upon redirecting, - // to inspect the latest response headers, - // or to cancel the request by throwing an error - if (options.hostname === "example.com") { - options.auth = "user:password"; - } -}; -http.request(options); -``` - -In addition to the [standard HTTP](https://nodejs.org/api/http.html#http_http_request_options_callback) and [HTTPS options](https://nodejs.org/api/https.html#https_https_request_options_callback), -the following per-request options are supported: -- `followRedirects` (default: `true`) – whether redirects should be followed. - -- `maxRedirects` (default: `21`) – sets the maximum number of allowed redirects; if exceeded, an error will be emitted. - -- `maxBodyLength` (default: 10MB) – sets the maximum size of the request body; if exceeded, an error will be emitted. - -- `beforeRedirect` (default: `undefined`) – optionally change the request `options` on redirects, or abort the request by throwing an error. - -- `agents` (default: `undefined`) – sets the `agent` option per protocol, since HTTP and HTTPS use different agents. Example value: `{ http: new http.Agent(), https: new https.Agent() }` - -- `trackRedirects` (default: `false`) – whether to store the redirected response details into the `redirects` array on the response object. - - -### Advanced usage -By default, `follow-redirects` will use the Node.js default implementations -of [`http`](https://nodejs.org/api/http.html) -and [`https`](https://nodejs.org/api/https.html). -To enable features such as caching and/or intermediate request tracking, -you might instead want to wrap `follow-redirects` around custom protocol implementations: - -```javascript -const { http, https } = require('follow-redirects').wrap({ - http: require('your-custom-http'), - https: require('your-custom-https'), -}); -``` - -Such custom protocols only need an implementation of the `request` method. - -## Browser Usage - -Due to the way the browser works, -the `http` and `https` browser equivalents perform redirects by default. - -By requiring `follow-redirects` this way: -```javascript -const http = require('follow-redirects/http'); -const https = require('follow-redirects/https'); -``` -you can easily tell webpack and friends to replace -`follow-redirect` by the built-in versions: - -```json -{ - "follow-redirects/http" : "http", - "follow-redirects/https" : "https" -} -``` - -## Contributing - -Pull Requests are always welcome. Please [file an issue](https://github.com/follow-redirects/follow-redirects/issues) - detailing your proposal before you invest your valuable time. Additional features and bug fixes should be accompanied - by tests. You can run the test suite locally with a simple `npm test` command. - -## Debug Logging - -`follow-redirects` uses the excellent [debug](https://www.npmjs.com/package/debug) for logging. To turn on logging - set the environment variable `DEBUG=follow-redirects` for debug output from just this module. When running the test - suite it is sometimes advantageous to set `DEBUG=*` to see output from the express server as well. - -## Authors - -- [Ruben Verborgh](https://ruben.verborgh.org/) -- [Olivier Lalonde](mailto:olalonde@gmail.com) -- [James Talmage](mailto:james@talmage.io) - -## License - -[MIT License](https://github.com/follow-redirects/follow-redirects/blob/master/LICENSE) diff --git a/node_modules/follow-redirects/debug.js b/node_modules/follow-redirects/debug.js deleted file mode 100644 index 4c1fa24..0000000 --- a/node_modules/follow-redirects/debug.js +++ /dev/null @@ -1,9 +0,0 @@ -var debug; -try { - /* eslint global-require: off */ - debug = require("debug")("follow-redirects"); -} -catch (error) { - debug = function () { /* */ }; -} -module.exports = debug; diff --git a/node_modules/follow-redirects/http.js b/node_modules/follow-redirects/http.js deleted file mode 100644 index 695e356..0000000 --- a/node_modules/follow-redirects/http.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./").http; diff --git a/node_modules/follow-redirects/https.js b/node_modules/follow-redirects/https.js deleted file mode 100644 index d21c921..0000000 --- a/node_modules/follow-redirects/https.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./").https; diff --git a/node_modules/follow-redirects/index.js b/node_modules/follow-redirects/index.js deleted file mode 100644 index 98db8ee..0000000 --- a/node_modules/follow-redirects/index.js +++ /dev/null @@ -1,504 +0,0 @@ -var url = require("url"); -var URL = url.URL; -var http = require("http"); -var https = require("https"); -var Writable = require("stream").Writable; -var assert = require("assert"); -var debug = require("./debug"); - -// Create handlers that pass events from native requests -var eventHandlers = Object.create(null); -["abort", "aborted", "connect", "error", "socket", "timeout"].forEach(function (event) { - eventHandlers[event] = function (arg1, arg2, arg3) { - this._redirectable.emit(event, arg1, arg2, arg3); - }; -}); - -// Error types with codes -var RedirectionError = createErrorType( - "ERR_FR_REDIRECTION_FAILURE", - "" -); -var TooManyRedirectsError = createErrorType( - "ERR_FR_TOO_MANY_REDIRECTS", - "Maximum number of redirects exceeded" -); -var MaxBodyLengthExceededError = createErrorType( - "ERR_FR_MAX_BODY_LENGTH_EXCEEDED", - "Request body larger than maxBodyLength limit" -); -var WriteAfterEndError = createErrorType( - "ERR_STREAM_WRITE_AFTER_END", - "write after end" -); - -// An HTTP(S) request that can be redirected -function RedirectableRequest(options, responseCallback) { - // Initialize the request - Writable.call(this); - this._sanitizeOptions(options); - this._options = options; - this._ended = false; - this._ending = false; - this._redirectCount = 0; - this._redirects = []; - this._requestBodyLength = 0; - this._requestBodyBuffers = []; - - // Attach a callback if passed - if (responseCallback) { - this.on("response", responseCallback); - } - - // React to responses of native requests - var self = this; - this._onNativeResponse = function (response) { - self._processResponse(response); - }; - - // Perform the first request - this._performRequest(); -} -RedirectableRequest.prototype = Object.create(Writable.prototype); - -// Writes buffered data to the current native request -RedirectableRequest.prototype.write = function (data, encoding, callback) { - // Writing is not allowed if end has been called - if (this._ending) { - throw new WriteAfterEndError(); - } - - // Validate input and shift parameters if necessary - if (!(typeof data === "string" || typeof data === "object" && ("length" in data))) { - throw new TypeError("data should be a string, Buffer or Uint8Array"); - } - if (typeof encoding === "function") { - callback = encoding; - encoding = null; - } - - // Ignore empty buffers, since writing them doesn't invoke the callback - // https://github.com/nodejs/node/issues/22066 - if (data.length === 0) { - if (callback) { - callback(); - } - return; - } - // Only write when we don't exceed the maximum body length - if (this._requestBodyLength + data.length <= this._options.maxBodyLength) { - this._requestBodyLength += data.length; - this._requestBodyBuffers.push({ data: data, encoding: encoding }); - this._currentRequest.write(data, encoding, callback); - } - // Error when we exceed the maximum body length - else { - this.emit("error", new MaxBodyLengthExceededError()); - this.abort(); - } -}; - -// Ends the current native request -RedirectableRequest.prototype.end = function (data, encoding, callback) { - // Shift parameters if necessary - if (typeof data === "function") { - callback = data; - data = encoding = null; - } - else if (typeof encoding === "function") { - callback = encoding; - encoding = null; - } - - // Write data if needed and end - if (!data) { - this._ended = this._ending = true; - this._currentRequest.end(null, null, callback); - } - else { - var self = this; - var currentRequest = this._currentRequest; - this.write(data, encoding, function () { - self._ended = true; - currentRequest.end(null, null, callback); - }); - this._ending = true; - } -}; - -// Sets a header value on the current native request -RedirectableRequest.prototype.setHeader = function (name, value) { - this._options.headers[name] = value; - this._currentRequest.setHeader(name, value); -}; - -// Clears a header value on the current native request -RedirectableRequest.prototype.removeHeader = function (name) { - delete this._options.headers[name]; - this._currentRequest.removeHeader(name); -}; - -// Global timeout for all underlying requests -RedirectableRequest.prototype.setTimeout = function (msecs, callback) { - if (callback) { - this.once("timeout", callback); - } - - if (this.socket) { - startTimer(this, msecs); - } - else { - var self = this; - this._currentRequest.once("socket", function () { - startTimer(self, msecs); - }); - } - - this.once("response", clearTimer); - this.once("error", clearTimer); - - return this; -}; - -function startTimer(request, msecs) { - clearTimeout(request._timeout); - request._timeout = setTimeout(function () { - request.emit("timeout"); - }, msecs); -} - -function clearTimer() { - clearTimeout(this._timeout); -} - -// Proxy all other public ClientRequest methods -[ - "abort", "flushHeaders", "getHeader", - "setNoDelay", "setSocketKeepAlive", -].forEach(function (method) { - RedirectableRequest.prototype[method] = function (a, b) { - return this._currentRequest[method](a, b); - }; -}); - -// Proxy all public ClientRequest properties -["aborted", "connection", "socket"].forEach(function (property) { - Object.defineProperty(RedirectableRequest.prototype, property, { - get: function () { return this._currentRequest[property]; }, - }); -}); - -RedirectableRequest.prototype._sanitizeOptions = function (options) { - // Ensure headers are always present - if (!options.headers) { - options.headers = {}; - } - - // Since http.request treats host as an alias of hostname, - // but the url module interprets host as hostname plus port, - // eliminate the host property to avoid confusion. - if (options.host) { - // Use hostname if set, because it has precedence - if (!options.hostname) { - options.hostname = options.host; - } - delete options.host; - } - - // Complete the URL object when necessary - if (!options.pathname && options.path) { - var searchPos = options.path.indexOf("?"); - if (searchPos < 0) { - options.pathname = options.path; - } - else { - options.pathname = options.path.substring(0, searchPos); - options.search = options.path.substring(searchPos); - } - } -}; - - -// Executes the next native request (initial or redirect) -RedirectableRequest.prototype._performRequest = function () { - // Load the native protocol - var protocol = this._options.protocol; - var nativeProtocol = this._options.nativeProtocols[protocol]; - if (!nativeProtocol) { - this.emit("error", new TypeError("Unsupported protocol " + protocol)); - return; - } - - // If specified, use the agent corresponding to the protocol - // (HTTP and HTTPS use different types of agents) - if (this._options.agents) { - var scheme = protocol.substr(0, protocol.length - 1); - this._options.agent = this._options.agents[scheme]; - } - - // Create the native request - var request = this._currentRequest = - nativeProtocol.request(this._options, this._onNativeResponse); - this._currentUrl = url.format(this._options); - - // Set up event handlers - request._redirectable = this; - for (var event in eventHandlers) { - /* istanbul ignore else */ - if (event) { - request.on(event, eventHandlers[event]); - } - } - - // End a redirected request - // (The first request must be ended explicitly with RedirectableRequest#end) - if (this._isRedirect) { - // Write the request entity and end. - var i = 0; - var self = this; - var buffers = this._requestBodyBuffers; - (function writeNext(error) { - // Only write if this request has not been redirected yet - /* istanbul ignore else */ - if (request === self._currentRequest) { - // Report any write errors - /* istanbul ignore if */ - if (error) { - self.emit("error", error); - } - // Write the next buffer if there are still left - else if (i < buffers.length) { - var buffer = buffers[i++]; - /* istanbul ignore else */ - if (!request.finished) { - request.write(buffer.data, buffer.encoding, writeNext); - } - } - // End the request if `end` has been called on us - else if (self._ended) { - request.end(); - } - } - }()); - } -}; - -// Processes a response from the current native request -RedirectableRequest.prototype._processResponse = function (response) { - // Store the redirected response - var statusCode = response.statusCode; - if (this._options.trackRedirects) { - this._redirects.push({ - url: this._currentUrl, - headers: response.headers, - statusCode: statusCode, - }); - } - - // RFC7231§6.4: The 3xx (Redirection) class of status code indicates - // that further action needs to be taken by the user agent in order to - // fulfill the request. If a Location header field is provided, - // the user agent MAY automatically redirect its request to the URI - // referenced by the Location field value, - // even if the specific status code is not understood. - var location = response.headers.location; - if (location && this._options.followRedirects !== false && - statusCode >= 300 && statusCode < 400) { - // Abort the current request - this._currentRequest.removeAllListeners(); - this._currentRequest.on("error", noop); - this._currentRequest.abort(); - // Discard the remainder of the response to avoid waiting for data - response.destroy(); - - // RFC7231§6.4: A client SHOULD detect and intervene - // in cyclical redirections (i.e., "infinite" redirection loops). - if (++this._redirectCount > this._options.maxRedirects) { - this.emit("error", new TooManyRedirectsError()); - return; - } - - // RFC7231§6.4: Automatic redirection needs to done with - // care for methods not known to be safe, [â€Ļ] - // RFC7231§6.4.2–3: For historical reasons, a user agent MAY change - // the request method from POST to GET for the subsequent request. - if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" || - // RFC7231§6.4.4: The 303 (See Other) status code indicates that - // the server is redirecting the user agent to a different resource [â€Ļ] - // A user agent can perform a retrieval request targeting that URI - // (a GET or HEAD request if using HTTP) [â€Ļ] - (statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) { - this._options.method = "GET"; - // Drop a possible entity and headers related to it - this._requestBodyBuffers = []; - removeMatchingHeaders(/^content-/i, this._options.headers); - } - - // Drop the Host header, as the redirect might lead to a different host - var previousHostName = removeMatchingHeaders(/^host$/i, this._options.headers) || - url.parse(this._currentUrl).hostname; - - // Create the redirected request - var redirectUrl = url.resolve(this._currentUrl, location); - debug("redirecting to", redirectUrl); - this._isRedirect = true; - var redirectUrlParts = url.parse(redirectUrl); - Object.assign(this._options, redirectUrlParts); - - // Drop the Authorization header if redirecting to another host - if (redirectUrlParts.hostname !== previousHostName) { - removeMatchingHeaders(/^authorization$/i, this._options.headers); - } - - // Evaluate the beforeRedirect callback - if (typeof this._options.beforeRedirect === "function") { - var responseDetails = { headers: response.headers }; - try { - this._options.beforeRedirect.call(null, this._options, responseDetails); - } - catch (err) { - this.emit("error", err); - return; - } - this._sanitizeOptions(this._options); - } - - // Perform the redirected request - try { - this._performRequest(); - } - catch (cause) { - var error = new RedirectionError("Redirected request failed: " + cause.message); - error.cause = cause; - this.emit("error", error); - } - } - else { - // The response is not a redirect; return it as-is - response.responseUrl = this._currentUrl; - response.redirects = this._redirects; - this.emit("response", response); - - // Clean up - this._requestBodyBuffers = []; - } -}; - -// Wraps the key/value object of protocols with redirect functionality -function wrap(protocols) { - // Default settings - var exports = { - maxRedirects: 21, - maxBodyLength: 10 * 1024 * 1024, - }; - - // Wrap each protocol - var nativeProtocols = {}; - Object.keys(protocols).forEach(function (scheme) { - var protocol = scheme + ":"; - var nativeProtocol = nativeProtocols[protocol] = protocols[scheme]; - var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol); - - // Executes a request, following redirects - function request(input, options, callback) { - // Parse parameters - if (typeof input === "string") { - var urlStr = input; - try { - input = urlToOptions(new URL(urlStr)); - } - catch (err) { - /* istanbul ignore next */ - input = url.parse(urlStr); - } - } - else if (URL && (input instanceof URL)) { - input = urlToOptions(input); - } - else { - callback = options; - options = input; - input = { protocol: protocol }; - } - if (typeof options === "function") { - callback = options; - options = null; - } - - // Set defaults - options = Object.assign({ - maxRedirects: exports.maxRedirects, - maxBodyLength: exports.maxBodyLength, - }, input, options); - options.nativeProtocols = nativeProtocols; - - assert.equal(options.protocol, protocol, "protocol mismatch"); - debug("options", options); - return new RedirectableRequest(options, callback); - } - - // Executes a GET request, following redirects - function get(input, options, callback) { - var wrappedRequest = wrappedProtocol.request(input, options, callback); - wrappedRequest.end(); - return wrappedRequest; - } - - // Expose the properties on the wrapped protocol - Object.defineProperties(wrappedProtocol, { - request: { value: request, configurable: true, enumerable: true, writable: true }, - get: { value: get, configurable: true, enumerable: true, writable: true }, - }); - }); - return exports; -} - -/* istanbul ignore next */ -function noop() { /* empty */ } - -// from https://github.com/nodejs/node/blob/master/lib/internal/url.js -function urlToOptions(urlObject) { - var options = { - protocol: urlObject.protocol, - hostname: urlObject.hostname.startsWith("[") ? - /* istanbul ignore next */ - urlObject.hostname.slice(1, -1) : - urlObject.hostname, - hash: urlObject.hash, - search: urlObject.search, - pathname: urlObject.pathname, - path: urlObject.pathname + urlObject.search, - href: urlObject.href, - }; - if (urlObject.port !== "") { - options.port = Number(urlObject.port); - } - return options; -} - -function removeMatchingHeaders(regex, headers) { - var lastValue; - for (var header in headers) { - if (regex.test(header)) { - lastValue = headers[header]; - delete headers[header]; - } - } - return lastValue; -} - -function createErrorType(code, defaultMessage) { - function CustomError(message) { - Error.captureStackTrace(this, this.constructor); - this.message = message || defaultMessage; - } - CustomError.prototype = new Error(); - CustomError.prototype.constructor = CustomError; - CustomError.prototype.name = "Error [" + code + "]"; - CustomError.prototype.code = code; - return CustomError; -} - -// Exports -module.exports = wrap({ http: http, https: https }); -module.exports.wrap = wrap; diff --git a/node_modules/follow-redirects/package.json b/node_modules/follow-redirects/package.json deleted file mode 100644 index fd08360..0000000 --- a/node_modules/follow-redirects/package.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "_args": [ - [ - "follow-redirects@1.13.1", - "/home/nuno/Documents/core/software/fresh/js/metaforecasts/metaforecasts-current" - ] - ], - "_from": "follow-redirects@1.13.1", - "_id": "follow-redirects@1.13.1", - "_inBundle": false, - "_integrity": "sha512-SSG5xmZh1mkPGyKzjZP8zLjltIfpW32Y5QpdNJyjcfGxK3qo3NDDkZOZSFiGn1A6SclQxY9GzEwAHQ3dmYRWpg==", - "_location": "/follow-redirects", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "follow-redirects@1.13.1", - "name": "follow-redirects", - "escapedName": "follow-redirects", - "rawSpec": "1.13.1", - "saveSpec": null, - "fetchSpec": "1.13.1" - }, - "_requiredBy": [ - "/axios" - ], - "_resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.1.tgz", - "_spec": "1.13.1", - "_where": "/home/nuno/Documents/core/software/fresh/js/metaforecasts/metaforecasts-current", - "author": { - "name": "Ruben Verborgh", - "email": "ruben@verborgh.org", - "url": "https://ruben.verborgh.org/" - }, - "bugs": { - "url": "https://github.com/follow-redirects/follow-redirects/issues" - }, - "contributors": [ - { - "name": "Olivier Lalonde", - "email": "olalonde@gmail.com", - "url": "http://www.syskall.com" - }, - { - "name": "James Talmage", - "email": "james@talmage.io" - } - ], - "description": "HTTP and HTTPS modules that follow redirects.", - "devDependencies": { - "concat-stream": "^2.0.0", - "eslint": "^5.16.0", - "express": "^4.16.4", - "lolex": "^3.1.0", - "mocha": "^6.0.2", - "nyc": "^14.1.1" - }, - "engines": { - "node": ">=4.0" - }, - "files": [ - "*.js" - ], - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/RubenVerborgh" - } - ], - "homepage": "https://github.com/follow-redirects/follow-redirects", - "keywords": [ - "http", - "https", - "url", - "redirect", - "client", - "location", - "utility" - ], - "license": "MIT", - "main": "index.js", - "name": "follow-redirects", - "peerDependenciesMeta": { - "debug": { - "optional": true - } - }, - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/follow-redirects/follow-redirects.git" - }, - "scripts": { - "lint": "eslint *.js test", - "mocha": "nyc mocha", - "test": "npm run lint && npm run mocha" - }, - "version": "1.13.1" -} diff --git a/node_modules/fs/README.md b/node_modules/fs/README.md deleted file mode 100644 index 5e9a74c..0000000 --- a/node_modules/fs/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# Security holding package - -This package name is not currently in use, but was formerly occupied -by another package. To avoid malicious use, npm is hanging on to the -package name, but loosely, and we'll probably give it to you if you -want it. - -You may adopt this package by contacting support@npmjs.com and -requesting the name. diff --git a/node_modules/fs/package.json b/node_modules/fs/package.json deleted file mode 100644 index 21eb497..0000000 --- a/node_modules/fs/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "_args": [ - [ - "fs@0.0.1-security", - "/home/nuno/Documents/core/software/fresh/js/metaforecasts/metaforecasts-current" - ] - ], - "_from": "fs@0.0.1-security", - "_id": "fs@0.0.1-security", - "_inBundle": false, - "_integrity": "sha1-invTcYa23d84E/I4WLV+yq9eQdQ=", - "_location": "/fs", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "fs@0.0.1-security", - "name": "fs", - "escapedName": "fs", - "rawSpec": "0.0.1-security", - "saveSpec": null, - "fetchSpec": "0.0.1-security" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz", - "_spec": "0.0.1-security", - "_where": "/home/nuno/Documents/core/software/fresh/js/metaforecasts/metaforecasts-current", - "author": "", - "bugs": { - "url": "https://github.com/npm/security-holder/issues" - }, - "description": "This package name is not currently in use, but was formerly occupied by another package. To avoid malicious use, npm is hanging on to the package name, but loosely, and we'll probably give it to you if you want it.", - "homepage": "https://github.com/npm/security-holder#readme", - "keywords": [], - "license": "ISC", - "main": "index.js", - "name": "fs", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/security-holder.git" - }, - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "version": "0.0.1-security" -} diff --git a/node_modules/is-docker/cli.js b/node_modules/is-docker/cli.js deleted file mode 100755 index 58f2861..0000000 --- a/node_modules/is-docker/cli.js +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env node -'use strict'; -const isDocker = require('.'); - -process.exitCode = isDocker() ? 0 : 2; diff --git a/node_modules/is-docker/index.d.ts b/node_modules/is-docker/index.d.ts deleted file mode 100644 index c801881..0000000 --- a/node_modules/is-docker/index.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** -Check if the process is running inside a Docker container. - -@example -``` -import isDocker = require('is-docker'); - -if (isDocker()) { - console.log('Running inside a Docker container'); -} -``` -*/ -declare function isDocker(): boolean; - -export = isDocker; diff --git a/node_modules/is-docker/index.js b/node_modules/is-docker/index.js deleted file mode 100644 index cbb7b6f..0000000 --- a/node_modules/is-docker/index.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict'; -const fs = require('fs'); - -let isDocker; - -function hasDockerEnv() { - try { - fs.statSync('/.dockerenv'); - return true; - } catch (_) { - return false; - } -} - -function hasDockerCGroup() { - try { - return fs.readFileSync('/proc/self/cgroup', 'utf8').includes('docker'); - } catch (_) { - return false; - } -} - -module.exports = () => { - if (isDocker === undefined) { - isDocker = hasDockerEnv() || hasDockerCGroup(); - } - - return isDocker; -}; diff --git a/node_modules/is-docker/license b/node_modules/is-docker/license deleted file mode 100644 index fa7ceba..0000000 --- a/node_modules/is-docker/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (https://sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/is-docker/package.json b/node_modules/is-docker/package.json deleted file mode 100644 index 3a721b7..0000000 --- a/node_modules/is-docker/package.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "_args": [ - [ - "is-docker@2.1.1", - "/home/nuno/Documents/core/software/fresh/js/metaforecasts/metaforecasts-current" - ] - ], - "_from": "is-docker@2.1.1", - "_id": "is-docker@2.1.1", - "_inBundle": false, - "_integrity": "sha512-ZOoqiXfEwtGknTiuDEy8pN2CfE3TxMHprvNer1mXiqwkOT77Rw3YVrUQ52EqAOU3QAWDQ+bQdx7HJzrv7LS2Hw==", - "_location": "/is-docker", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "is-docker@2.1.1", - "name": "is-docker", - "escapedName": "is-docker", - "rawSpec": "2.1.1", - "saveSpec": null, - "fetchSpec": "2.1.1" - }, - "_requiredBy": [ - "/is-wsl", - "/open" - ], - "_resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.1.1.tgz", - "_spec": "2.1.1", - "_where": "/home/nuno/Documents/core/software/fresh/js/metaforecasts/metaforecasts-current", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "https://sindresorhus.com" - }, - "bin": { - "is-docker": "cli.js" - }, - "bugs": { - "url": "https://github.com/sindresorhus/is-docker/issues" - }, - "description": "Check if the process is running inside a Docker container", - "devDependencies": { - "ava": "^1.4.1", - "sinon": "^7.3.2", - "tsd": "^0.7.2", - "xo": "^0.24.0" - }, - "engines": { - "node": ">=8" - }, - "files": [ - "index.js", - "index.d.ts", - "cli.js" - ], - "funding": "https://github.com/sponsors/sindresorhus", - "homepage": "https://github.com/sindresorhus/is-docker#readme", - "keywords": [ - "detect", - "docker", - "dockerized", - "container", - "inside", - "is", - "env", - "environment", - "process" - ], - "license": "MIT", - "name": "is-docker", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/is-docker.git" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "version": "2.1.1" -} diff --git a/node_modules/is-docker/readme.md b/node_modules/is-docker/readme.md deleted file mode 100644 index 0110129..0000000 --- a/node_modules/is-docker/readme.md +++ /dev/null @@ -1,27 +0,0 @@ -# is-docker [![Build Status](https://travis-ci.com/sindresorhus/is-docker.svg?branch=master)](https://travis-ci.com/github/sindresorhus/is-docker) - -> Check if the process is running inside a Docker container - -## Install - -``` -$ npm install is-docker -``` - -## Usage - -```js -const isDocker = require('is-docker'); - -if (isDocker()) { - console.log('Running inside a Docker container'); -} -``` - -## CLI - -``` -$ is-docker -``` - -Exits with code 0 if inside a Docker container and 2 if not. diff --git a/node_modules/is-wsl/index.d.ts b/node_modules/is-wsl/index.d.ts deleted file mode 100644 index d54e4ba..0000000 --- a/node_modules/is-wsl/index.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** -Check if the process is running inside [Windows Subsystem for Linux](https://msdn.microsoft.com/commandline/wsl/about) (Bash on Windows). - -@example -``` -import isWsl = require('is-wsl'); - -// When running inside Windows Subsystem for Linux -console.log(isWsl); -//=> true -``` -*/ -declare const isWsl: boolean; - -export = isWsl; diff --git a/node_modules/is-wsl/index.js b/node_modules/is-wsl/index.js deleted file mode 100644 index eb6313f..0000000 --- a/node_modules/is-wsl/index.js +++ /dev/null @@ -1,31 +0,0 @@ -'use strict'; -const os = require('os'); -const fs = require('fs'); -const isDocker = require('is-docker'); - -const isWsl = () => { - if (process.platform !== 'linux') { - return false; - } - - if (os.release().toLowerCase().includes('microsoft')) { - if (isDocker()) { - return false; - } - - return true; - } - - try { - return fs.readFileSync('/proc/version', 'utf8').toLowerCase().includes('microsoft') ? - !isDocker() : false; - } catch (_) { - return false; - } -}; - -if (process.env.__IS_WSL_TEST__) { - module.exports = isWsl; -} else { - module.exports = isWsl(); -} diff --git a/node_modules/is-wsl/license b/node_modules/is-wsl/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/is-wsl/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/is-wsl/package.json b/node_modules/is-wsl/package.json deleted file mode 100644 index 6342401..0000000 --- a/node_modules/is-wsl/package.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "_args": [ - [ - "is-wsl@2.2.0", - "/home/nuno/Documents/core/software/fresh/js/metaforecasts/metaforecasts-current" - ] - ], - "_from": "is-wsl@2.2.0", - "_id": "is-wsl@2.2.0", - "_inBundle": false, - "_integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", - "_location": "/is-wsl", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "is-wsl@2.2.0", - "name": "is-wsl", - "escapedName": "is-wsl", - "rawSpec": "2.2.0", - "saveSpec": null, - "fetchSpec": "2.2.0" - }, - "_requiredBy": [ - "/open" - ], - "_resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", - "_spec": "2.2.0", - "_where": "/home/nuno/Documents/core/software/fresh/js/metaforecasts/metaforecasts-current", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/is-wsl/issues" - }, - "dependencies": { - "is-docker": "^2.0.0" - }, - "description": "Check if the process is running inside Windows Subsystem for Linux (Bash on Windows)", - "devDependencies": { - "ava": "^1.4.1", - "clear-module": "^3.2.0", - "proxyquire": "^2.1.0", - "tsd": "^0.7.2", - "xo": "^0.24.0" - }, - "engines": { - "node": ">=8" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "homepage": "https://github.com/sindresorhus/is-wsl#readme", - "keywords": [ - "check", - "wsl", - "windows", - "subsystem", - "linux", - "detect", - "bash", - "process", - "console", - "terminal", - "is" - ], - "license": "MIT", - "name": "is-wsl", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/is-wsl.git" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "version": "2.2.0" -} diff --git a/node_modules/is-wsl/readme.md b/node_modules/is-wsl/readme.md deleted file mode 100644 index 5fe44fe..0000000 --- a/node_modules/is-wsl/readme.md +++ /dev/null @@ -1,36 +0,0 @@ -# is-wsl [![Build Status](https://travis-ci.org/sindresorhus/is-wsl.svg?branch=master)](https://travis-ci.org/sindresorhus/is-wsl) - -> Check if the process is running inside [Windows Subsystem for Linux](https://msdn.microsoft.com/commandline/wsl/about) (Bash on Windows) - -Can be useful if you need to work around unimplemented or buggy features in WSL. Supports both WSL 1 and WSL 2. - - -## Install - -``` -$ npm install is-wsl -``` - - -## Usage - -```js -const isWsl = require('is-wsl'); - -// When running inside Windows Subsystem for Linux -console.log(isWsl); -//=> true -``` - - ---- - -
- - Get professional support for this package with a Tidelift subscription - -
- - Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. -
-
diff --git a/node_modules/json2csv/.eslintrc b/node_modules/json2csv/.eslintrc deleted file mode 100644 index da0a550..0000000 --- a/node_modules/json2csv/.eslintrc +++ /dev/null @@ -1,10 +0,0 @@ -{ - "env": { - "node": true, - "es6": true - }, - "parserOptions": { - "ecmaVersion": 8 - }, - "extends": "eslint:recommended" -} diff --git a/node_modules/json2csv/.gitattributes b/node_modules/json2csv/.gitattributes deleted file mode 100644 index 9834512..0000000 --- a/node_modules/json2csv/.gitattributes +++ /dev/null @@ -1,3 +0,0 @@ -* text=auto -test/fixtures/csv/eol.csv text eol=crlf -test/fixtures/csv/escapeEOL.csv text eol=crlf diff --git a/node_modules/json2csv/CHANGELOG.md b/node_modules/json2csv/CHANGELOG.md deleted file mode 100644 index 557d4f5..0000000 --- a/node_modules/json2csv/CHANGELOG.md +++ /dev/null @@ -1,600 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. - -### [5.0.5](https://github.com/zemirco/json2csv/compare/v5.0.4...v5.0.5) (2020-11-16) - - -### Bug Fixes - -* don't mutate original object in unset ([#499](https://github.com/zemirco/json2csv/issues/499)) ([6e4ea5e](https://github.com/zemirco/json2csv/commit/6e4ea5ebdc263006ca6ff45879fbb7e0bd65bef2)) - -### [5.0.4](https://github.com/zemirco/json2csv/compare/v5.0.3...v5.0.4) (2020-11-10) - - -### Bug Fixes - -* Fix issue with unwind and empty arrays creating an extra column ([#496](https://github.com/zemirco/json2csv/issues/496)) ([0b331fc](https://github.com/zemirco/json2csv/commit/0b331fc3ad345f8062abe60f64cb3b43dad30fb0)) - -### [5.0.3](https://github.com/zemirco/json2csv/compare/v5.0.2...v5.0.3) (2020-09-24) - - -### Bug Fixes - -* audit dependencies fix ([d6d0fc7](https://github.com/zemirco/json2csv/commit/d6d0fc78128e01e021414aaf52a65cbcd09a1225)) -* update commander dep ([322e568](https://github.com/zemirco/json2csv/commit/322e568793ec4a64f43ec2ac82c9886177bcc4ed)) - -### [5.0.2](https://github.com/zemirco/json2csv/compare/v5.0.1...v5.0.2) (2020-09-24) - - -### Bug Fixes - -* **cli:** fix relative paths issue in CLI when not streaming ([#488](https://github.com/zemirco/json2csv/issues/488)) ([06079e8](https://github.com/zemirco/json2csv/commit/06079e840128030eacfecde66da11295eb162234)) - -### [5.0.1](https://github.com/zemirco/json2csv/compare/v5.0.0...v5.0.1) (2020-04-28) - - -### Bug Fixes - -* wrong call to processValue ([#454](https://github.com/zemirco/json2csv/issues/454)) ([66abd45](https://github.com/zemirco/json2csv/commit/66abd45)) - -## [5.0.0](https://github.com/zemirco/json2csv/compare/v4.5.2...v5.0.0) (2020-03-15) - - -### ⚠ BREAKING CHANGES - -* Node 8 and 9 no longer supported, use Node 10 or greater. It might still work, but it has reached End-Of-Life. -* module no longer takes `unwind`, `unwindBlank`, `flatten` or the `flattenSeparator` options, instead see the new `transforms` option. CLI options are unchanged from the callers side, but use the built in transforms under the hood. - -* Add support for transforms - -* Add documentation about transforms -* remove extra commonjs build, use starting point in package.json `main` field. -* Renamed `doubleQuote` to `escapedQuote` -* remove `stringify` option -* `--fields-config` option has been removed, use the new `--config` option for all configuration, not just fields. -* Drop node 6 and 7, and add node 11 and 12 - -### Bug Fixes - -* Always error asynchronously from parseAsync method ([#412](https://github.com/zemirco/json2csv/issues/412)) ([16cc044](https://github.com/zemirco/json2csv/commit/16cc044)) -* audit deps ([15992cf](https://github.com/zemirco/json2csv/commit/15992cf)) -* drop Node 8 and 9 ([7295465](https://github.com/zemirco/json2csv/commit/7295465)) -* Make some CLI options mandatory ([#433](https://github.com/zemirco/json2csv/issues/433)) ([bd51527](https://github.com/zemirco/json2csv/commit/bd51527)) -* Remove CommonJS build ([#422](https://github.com/zemirco/json2csv/issues/422)) ([5ce0089](https://github.com/zemirco/json2csv/commit/5ce0089)) -* Remove stringify option ([#419](https://github.com/zemirco/json2csv/issues/419)) ([39f303d](https://github.com/zemirco/json2csv/commit/39f303d)) -* Rename doubleQuote to escapedQuote ([#418](https://github.com/zemirco/json2csv/issues/418)) ([f99408c](https://github.com/zemirco/json2csv/commit/f99408c)) -* update CI node versions ([#413](https://github.com/zemirco/json2csv/issues/413)) ([6fd6c09](https://github.com/zemirco/json2csv/commit/6fd6c09)) -* update commander cli dep ([74aa40a](https://github.com/zemirco/json2csv/commit/74aa40a)) -* update commander dep ([272675b](https://github.com/zemirco/json2csv/commit/272675b)) -* **deps:** audit dependencies ([bf9877a](https://github.com/zemirco/json2csv/commit/bf9877a)) -* **deps:** update commander ([3f099f2](https://github.com/zemirco/json2csv/commit/3f099f2)) -* **security:** fix audit vulnerabilities ([b57715b](https://github.com/zemirco/json2csv/commit/b57715b)) - - -### Features - -* Add support for flattening arrays and change transforms arguments to an object. ([#432](https://github.com/zemirco/json2csv/issues/432)) ([916e448](https://github.com/zemirco/json2csv/commit/916e448)) -* Add support for transforms ([#431](https://github.com/zemirco/json2csv/issues/431)) ([f1d04d0](https://github.com/zemirco/json2csv/commit/f1d04d0)) -* Improve async promise to optionally not return ([#421](https://github.com/zemirco/json2csv/issues/421)) ([3e296f6](https://github.com/zemirco/json2csv/commit/3e296f6)) -* Improves the unwind transform so it unwinds all unwindable fields if â€Ļ ([#434](https://github.com/zemirco/json2csv/issues/434)) ([ec1f301](https://github.com/zemirco/json2csv/commit/ec1f301)) -* replace fields config by a global config ([#338](https://github.com/zemirco/json2csv/issues/338)) ([d6c1c5f](https://github.com/zemirco/json2csv/commit/d6c1c5f)) - -## [4.5.2](https://github.com/zemirco/json2csv/compare/v4.5.1...v4.5.2) (2019-07-05) - - -### Bug Fixes - -* Improve the inference of the header name when using function as value ([#395](https://github.com/zemirco/json2csv/issues/395)) ([590d19a](https://github.com/zemirco/json2csv/commit/590d19a)) - - - - -## [4.4.0](https://github.com/zemirco/json2csv/compare/v4.3.5...v4.4.0) (2019-03-25) - - -### Features - -* Performance improvements and new async api ([#360](https://github.com/zemirco/json2csv/issues/360)) ([d59dea1](https://github.com/zemirco/json2csv/commit/d59dea1)) - - - -## [4.3.5](https://github.com/zemirco/json2csv/compare/v4.3.4...v4.3.5) (2019-02-22) - - -### Bug Fixes - -* audit deps ([3182707](https://github.com/zemirco/json2csv/commit/3182707)) -* unwind of nested fields ([#357](https://github.com/zemirco/json2csv/issues/357)) ([2d69281](https://github.com/zemirco/json2csv/commit/2d69281)) - - - - -## [4.3.4](https://github.com/zemirco/json2csv/compare/v4.3.3...v4.3.4) (2019-02-11) - - -### Bug Fixes - -* issue with fields.value function not receiving correct fields ([#353](https://github.com/zemirco/json2csv/issues/353)) ([851c02f](https://github.com/zemirco/json2csv/commit/851c02f)) - - - - -## [4.3.3](https://github.com/zemirco/json2csv/compare/v4.3.2...v4.3.3) (2019-01-11) - - -### Bug Fixes - -* audit dep fix ([1ef4bcd](https://github.com/zemirco/json2csv/commit/1ef4bcd)) -* Remove invalid reference to flat ([#347](https://github.com/zemirco/json2csv/issues/347)) ([130ef7d](https://github.com/zemirco/json2csv/commit/130ef7d)) -* Remove preferGlobal from package.json ([#346](https://github.com/zemirco/json2csv/issues/346)) ([2b6ad3a](https://github.com/zemirco/json2csv/commit/2b6ad3a)) - - - - -## [4.3.2](https://github.com/zemirco/json2csv/compare/v4.3.1...v4.3.2) (2018-12-08) - - -### Bug Fixes - -* Remove lodash.clonedeep dependency ([#339](https://github.com/zemirco/json2csv/issues/339)) ([d28955a](https://github.com/zemirco/json2csv/commit/d28955a)), closes [#333](https://github.com/zemirco/json2csv/issues/333) - - - - -## [4.3.1](https://github.com/zemirco/json2csv/compare/v4.3.0...v4.3.1) (2018-11-17) - - -### Bug Fixes - -* Return correct exit code on error ([#337](https://github.com/zemirco/json2csv/issues/337)) ([a793de5](https://github.com/zemirco/json2csv/commit/a793de5)) - - - - -# [4.3.0](https://github.com/zemirco/json2csv/compare/v4.2.1...v4.3.0) (2018-11-05) - - -### Bug Fixes - -* Optimize performance around the usage of fields ([#328](https://github.com/zemirco/json2csv/issues/328)) ([d9e4463](https://github.com/zemirco/json2csv/commit/d9e4463)) -* Remove wrong submodule ([#326](https://github.com/zemirco/json2csv/issues/326)) ([6486bb0](https://github.com/zemirco/json2csv/commit/6486bb0)) - - -### Features - -* Add support for objectMode in the stream API ([#325](https://github.com/zemirco/json2csv/issues/325)) ([8f0ae55](https://github.com/zemirco/json2csv/commit/8f0ae55)) - - - - -## [4.2.1](https://github.com/zemirco/json2csv/compare/v4.2.0...v4.2.1) (2018-08-06) - - -### Bug Fixes - -* bug that modifies opts after parsing an object/stream ([#318](https://github.com/zemirco/json2csv/issues/318)) ([f0a4830](https://github.com/zemirco/json2csv/commit/f0a4830)) -* Clean up the flattening separator feature ([#315](https://github.com/zemirco/json2csv/issues/315)) ([ee3d181](https://github.com/zemirco/json2csv/commit/ee3d181)) - - - - -# [4.2.0](https://github.com/zemirco/json2csv/compare/v4.1.6...v4.2.0) (2018-07-31) - - -### Features - -* Added flattenSeparator option ([#314](https://github.com/zemirco/json2csv/issues/314)) ([5c5de9f](https://github.com/zemirco/json2csv/commit/5c5de9f)) - - - - -## [4.1.6](https://github.com/zemirco/json2csv/compare/v4.1.5...v4.1.6) (2018-07-12) - - -### Bug Fixes - -* Update dependencies and remove cli-table2 dependency ([#312](https://github.com/zemirco/json2csv/issues/312)) ([5981ba3](https://github.com/zemirco/json2csv/commit/5981ba3)) - - - - -## [4.1.5](https://github.com/zemirco/json2csv/compare/v4.1.4...v4.1.5) (2018-06-26) - - -### Bug Fixes - -* Process stdin as a stream ([#308](https://github.com/zemirco/json2csv/issues/308)) ([2b186b6](https://github.com/zemirco/json2csv/commit/2b186b6)) - - - - -## [4.1.4](https://github.com/zemirco/json2csv/compare/v4.1.3...v4.1.4) (2018-06-23) - - -### Bug Fixes - -* don't escape tabs ([#305](https://github.com/zemirco/json2csv/issues/305)) ([a36c8e3](https://github.com/zemirco/json2csv/commit/a36c8e3)) - - - - -## [4.1.3](https://github.com/zemirco/json2csv/compare/v4.1.2...v4.1.3) (2018-05-23) - - -### Bug Fixes - -* Escape custom quotes correctly ([#301](https://github.com/zemirco/json2csv/issues/301)) ([7d57208](https://github.com/zemirco/json2csv/commit/7d57208)) - - - - -## [4.1.2](https://github.com/zemirco/json2csv/compare/v4.1.1...v4.1.2) (2018-04-16) - - -### Bug Fixes - -* **tests:** Skip bogus pretty print tests only in old node versions ([#290](https://github.com/zemirco/json2csv/issues/290)) ([0f3b885](https://github.com/zemirco/json2csv/commit/0f3b885)) - - - - -## [4.1.1](https://github.com/zemirco/json2csv/compare/v4.1.0...v4.1.1) (2018-04-16) - - -### Bug Fixes - -* readme CLI's info ([#289](https://github.com/zemirco/json2csv/issues/289)) ([9fe65b3](https://github.com/zemirco/json2csv/commit/9fe65b3)) -* Add tests and docs to unwind-blank feature ([#287](https://github.com/zemirco/json2csv/issues/287)) ([e3d4a05](https://github.com/zemirco/json2csv/commit/e3d4a05)) -* **perf:** Improve unwind performance and maintainability ([#288](https://github.com/zemirco/json2csv/issues/288)) ([80e496d](https://github.com/zemirco/json2csv/commit/80e496d)) - - - - -## [4.1.0](https://github.com/zemirco/json2csv/compare/v4.0.4...v4.1.0) (2018-04-16) - - -### Bug Fixes - -* Avoid redundant deep cloning when unwinding. ([#286](https://github.com/zemirco/json2csv/issues/286)) ([95a6ca9](https://github.com/zemirco/json2csv/commit/95a6ca9)) - - -### Features - -* Add ability to unwind by blanking out instead of repeating data ([#285](https://github.com/zemirco/json2csv/issues/285)) ([61d9808](https://github.com/zemirco/json2csv/commit/61d9808)) - - - - -## [4.0.4](https://github.com/zemirco/json2csv/compare/v4.0.3...v4.0.4) (2018-04-10) - - -### Bug Fixes - -* comment out failing tests ([#283](https://github.com/zemirco/json2csv/issues/283)) ([5b25eaa](https://github.com/zemirco/json2csv/commit/5b25eaa)) -* Support empty array with opts.fields ([#281](https://github.com/zemirco/json2csv/issues/281)) ([eccca89](https://github.com/zemirco/json2csv/commit/eccca89)) -* **tests:** emit correct lines from transform ([#282](https://github.com/zemirco/json2csv/issues/282)) ([2322ddf](https://github.com/zemirco/json2csv/commit/2322ddf)) - - - - -## [4.0.3](https://github.com/zemirco/json2csv/compare/v4.0.2...v4.0.3) (2018-04-09) - - -### Bug Fixes - -* error when a field is null and flatten is used ([#274](https://github.com/zemirco/json2csv/issues/274)) ([1349a94](https://github.com/zemirco/json2csv/commit/1349a94)) -* throw error for empty dataset only if fields not specified ([0d8534e](https://github.com/zemirco/json2csv/commit/0d8534e)) - - - - -## [4.0.2](https://github.com/zemirco/json2csv/compare/v4.0.1...v4.0.2) (2018-03-09) - - -### Bug Fixes - -* **parser:** RangeError ([#271](https://github.com/zemirco/json2csv/issues/271)) ([c8d5a87](https://github.com/zemirco/json2csv/commit/c8d5a87)) - - - - -## [4.0.1](https://github.com/zemirco/json2csv/compare/v4.0.0...v4.0.1) (2018-03-05) - - -### Bug Fixes - -* double quote escaping before new line ([#268](https://github.com/zemirco/json2csv/issues/268)) ([fa991cf](https://github.com/zemirco/json2csv/commit/fa991cf)) - - - - -# [4.0.0](https://github.com/zemirco/json2csv/compare/v4.0.0-alpha.2...v4.0.0) (2018-02-27) - - -### Bug Fixes - -* Replace webpack with rollup packaging ([#266](https://github.com/zemirco/json2csv/issues/266)) ([a9f8020](https://github.com/zemirco/json2csv/commit/a9f8020)) - - -### Features - -* Pass transform options through ([#262](https://github.com/zemirco/json2csv/issues/262)) ([650913f](https://github.com/zemirco/json2csv/commit/650913f)) - - - - -# [4.0.0-alpha.2](https://github.com/zemirco/json2csv/compare/v4.0.0-alpha.1...v4.0.0-alpha.2) (2018-02-25) - - -### Bug Fixes - -* flatten issue with toJSON ([#259](https://github.com/zemirco/json2csv/issues/259)) ([7006d2b](https://github.com/zemirco/json2csv/commit/7006d2b)) - - - - -# [4.0.0-alpha.1](https://github.com/zemirco/json2csv/compare/v4.0.0-alpha.0...v4.0.0-alpha.1) (2018-02-21) - - -### Bug Fixes - -* Remove TypeScript definition ([#256](https://github.com/zemirco/json2csv/issues/256)) ([4f09694](https://github.com/zemirco/json2csv/commit/4f09694)) - - - - -# [4.0.0-alpha.0](https://github.com/zemirco/json2csv/compare/v3.11.5...v4.0.0-alpha.0) (2018-02-21) - - -### Bug Fixes - -* Add CLI tests ([#247](https://github.com/zemirco/json2csv/issues/247)) ([bb8126f](https://github.com/zemirco/json2csv/commit/bb8126f)) -* Add excel string to cli and standardize ([#231](https://github.com/zemirco/json2csv/issues/231)) ([421baad](https://github.com/zemirco/json2csv/commit/421baad)) -* Allow passing ldjson input files ([#220](https://github.com/zemirco/json2csv/issues/220)) ([9c861ed](https://github.com/zemirco/json2csv/commit/9c861ed)) -* Avoid throwing an error on elements that can't be stringified (like functions) ([#223](https://github.com/zemirco/json2csv/issues/223)) ([679c687](https://github.com/zemirco/json2csv/commit/679c687)) -* backslash logic ([#222](https://github.com/zemirco/json2csv/issues/222)) ([29e9445](https://github.com/zemirco/json2csv/commit/29e9445)) -* broken stdin input ([#241](https://github.com/zemirco/json2csv/issues/241)) ([6cb407c](https://github.com/zemirco/json2csv/commit/6cb407c)) -* Combine EOL and newLine parameters ([#219](https://github.com/zemirco/json2csv/issues/219)) ([4668a8b](https://github.com/zemirco/json2csv/commit/4668a8b)) -* header flag ([#221](https://github.com/zemirco/json2csv/issues/221)) ([7f7338f](https://github.com/zemirco/json2csv/commit/7f7338f)) -* outdated jsdoc ([#243](https://github.com/zemirco/json2csv/issues/243)) ([efe9888](https://github.com/zemirco/json2csv/commit/efe9888)) -* pretty print issues ([#242](https://github.com/zemirco/json2csv/issues/242)) ([3bd9655](https://github.com/zemirco/json2csv/commit/3bd9655)) -* Process header cells as any other cell ([#244](https://github.com/zemirco/json2csv/issues/244)) ([1fcde13](https://github.com/zemirco/json2csv/commit/1fcde13)) -* Remove callback support ([2096ade](https://github.com/zemirco/json2csv/commit/2096ade)) -* Remove fieldNames ([#232](https://github.com/zemirco/json2csv/issues/232)) ([6cc74b2](https://github.com/zemirco/json2csv/commit/6cc74b2)) -* Remove path-is-absolute dependency ([#225](https://github.com/zemirco/json2csv/issues/225)) ([f71a3df](https://github.com/zemirco/json2csv/commit/f71a3df)) -* Rename hasCSVColumnTitle to noHeader ([#216](https://github.com/zemirco/json2csv/issues/216)) ([f053c8b](https://github.com/zemirco/json2csv/commit/f053c8b)) -* Rename ld-json to ndjson ([#240](https://github.com/zemirco/json2csv/issues/240)) ([24a7893](https://github.com/zemirco/json2csv/commit/24a7893)) -* Rename unwindPath to unwind ([#230](https://github.com/zemirco/json2csv/issues/230)) ([7143bc7](https://github.com/zemirco/json2csv/commit/7143bc7)) -* Streamify pretty print ([#248](https://github.com/zemirco/json2csv/issues/248)) ([fb7ad53](https://github.com/zemirco/json2csv/commit/fb7ad53)) - - -### Chores - -* Refactor the entire library to ES6 ([#233](https://github.com/zemirco/json2csv/issues/233)) ([dce4d33](https://github.com/zemirco/json2csv/commit/dce4d33)) - - -### Features - -* add doubleQuote to cli, rename other options to line up with the cli ([5e402dc](https://github.com/zemirco/json2csv/commit/5e402dc)) -* Add fields config option to CLI ([#245](https://github.com/zemirco/json2csv/issues/245)) ([74ef666](https://github.com/zemirco/json2csv/commit/74ef666)) -* Add streaming API ([#235](https://github.com/zemirco/json2csv/issues/235)) ([01ca93e](https://github.com/zemirco/json2csv/commit/01ca93e)) -* Split tests in multiple files ([#246](https://github.com/zemirco/json2csv/issues/246)) ([839de77](https://github.com/zemirco/json2csv/commit/839de77)) - - -### BREAKING CHANGES - -* Replaces field-list with field-config -* Remove `preserveNewLinesInValues` option, preserve by default - -* Refactor the entire library to ES6 - -* Fix PR issues - -* Add strict mode for node 4.X -* Remove fieldNames - -* Increase coverage back to 100% -* callback is no longer available, just return the csv from the json2csv. - -- updated tests -- updated readme -* * Rename unwindPath to unwind - -* Fix field-list in CLI -* newLine removed, eol kept. -* Rename del to delimiter to match the cli flag -* Rename quotes to quote to match the cli flag - -* Remove unused double quotes comment - -* Fix noHeader in CLI - -* Revert "Remove unused double quotes comment" - -This reverts commit 250d3e6ddf3062cbdc1e0174493a37fa21197d8e. - -* Add doubleQuote to CLI -* Rename hasCSVColumnTitle to noHeader to keep in line with the CLI - - - - -## [3.11.5](https://github.com/zemirco/json2csv/compare/v3.11.4...v3.11.5) (2017-10-23) - - -### Bug Fixes - -* backslash value not escaped properly ([#202](https://github.com/zemirco/json2csv/issues/202)) ([#204](https://github.com/zemirco/json2csv/issues/204)) ([2cf50f1](https://github.com/zemirco/json2csv/commit/2cf50f1)) - - - - -## [3.11.4](https://github.com/zemirco/json2csv/compare/v3.11.3...v3.11.4) (2017-10-09) - - -### Bug Fixes - -* **security:** Update debug to 3.1.0 for security reasons ([9c7cfaa](https://github.com/zemirco/json2csv/commit/9c7cfaa)) - - - - -## [3.11.3](https://github.com/zemirco/json2csv/compare/v3.11.2...v3.11.3) (2017-10-09) - - - - -## [3.11.2](https://github.com/zemirco/json2csv/compare/v3.11.1...v3.11.2) (2017-09-13) - - -### Bug Fixes - -* Remove extra space character in mode withBOM: true [#190](https://github.com/zemirco/json2csv/issues/190) ([#194](https://github.com/zemirco/json2csv/issues/194)) ([e8b6f6b](https://github.com/zemirco/json2csv/commit/e8b6f6b)) - - - - -## [3.11.1](https://github.com/zemirco/json2csv/compare/v3.11.0...v3.11.1) (2017-08-11) - - -### Bug Fixes - -* **cli:** pass BOM cli option to function ([#193](https://github.com/zemirco/json2csv/issues/193)) ([70cfdfe](https://github.com/zemirco/json2csv/commit/70cfdfe)) - - - - -# [3.11.0](https://github.com/zemirco/json2csv/compare/v3.10.0...v3.11.0) (2017-08-02) - - -### Bug Fixes - -* Handle dates without double-escaping ([#189](https://github.com/zemirco/json2csv/issues/189)) ([ff514ba](https://github.com/zemirco/json2csv/commit/ff514ba)) -* unwind parameter in command line mode ([#191](https://github.com/zemirco/json2csv/issues/191)) ([e706c25](https://github.com/zemirco/json2csv/commit/e706c25)) - - -### Features - -* Added flag to signal if resulting function value should be stringified or not ([#192](https://github.com/zemirco/json2csv/issues/192)) ([aaa6b05](https://github.com/zemirco/json2csv/commit/aaa6b05)) - - - - -# [3.10.0](https://github.com/zemirco/json2csv/compare/v3.9.1...v3.10.0) (2017-07-24) - - -### Features - -* Add BOM character option ([#187](https://github.com/zemirco/json2csv/issues/187)) ([0c799ca](https://github.com/zemirco/json2csv/commit/0c799ca)) - - - - -## [3.9.1](https://github.com/zemirco/json2csv/compare/v3.9.0...v3.9.1) (2017-07-14) - - - - -# [3.9.0](https://github.com/zemirco/json2csv/compare/v3.8.0...v3.9.0) (2017-07-11) - - -### Features - -* Parameter unwindPath for multiple fields ([#174](https://github.com/zemirco/json2csv/issues/174)) ([#183](https://github.com/zemirco/json2csv/issues/183)) ([fbcaa10](https://github.com/zemirco/json2csv/commit/fbcaa10)) - - - - -# [3.8.0](https://github.com/zemirco/json2csv/compare/v3.7.3...v3.8.0) (2017-07-03) - - -### Bug Fixes - -* **docs:** Add a coma in the ReadMe example ([#181](https://github.com/zemirco/json2csv/issues/181)) ([abeb820](https://github.com/zemirco/json2csv/commit/abeb820)) - - -### Features - -* Preserve new lines in cells with option `preserveNewLinesInValues` ([#91](https://github.com/zemirco/json2csv/issues/91)) ([#171](https://github.com/zemirco/json2csv/issues/171)) ([187b701](https://github.com/zemirco/json2csv/commit/187b701)) - - - - -## [3.7.3](https://github.com/zemirco/json2csv/compare/v3.7.1...v3.7.3) (2016-12-08) - - -### Bug Fixes - -* **jsdoc:** JSDoc Editting ([#155](https://github.com/zemirco/json2csv/issues/155)) ([76075d6](https://github.com/zemirco/json2csv/commit/76075d6)) -* **ts:** Fix type definition ([#154](https://github.com/zemirco/json2csv/issues/154)) ([fae53a1](https://github.com/zemirco/json2csv/commit/fae53a1)) - - - -## 3.6.3 / 2016-08-17 - - * Fix crashing on EPIPE error [#134](https://github.com/zemirco/json2csv/pull/134) - * Add UMD build for browser usage [#136](https://github.com/zemirco/json2csv/pull/136) - * Add docs during prepublish - -## 3.6.2 / 2016-07-22 - - * Remove debugger, see [#132](https://github.com/zemirco/json2csv/pull/132) - * Fix changelog typo - -## 3.6.1 / 2016-07-12 - - * Fix auto-fields returning all available fields, even if not available on the first object, see #104 - -## 3.6.0 / 2016-07-07 - - * Make callback optional - * Make callback use `process.nextTick`, so it's not sync - - Thanks @STRML! - -## 3.5.1 / 2016-06-29 - - * Revert [#114](https://github.com/zemirco/json2csv/pull/114), due to more issues - * Update npmignore - * Add a changelog - * Updatee readme - -## 3.5.0 / 2016-06-21 - - * `includeEmptyRows` options added, see [#122](https://github.com/zemirco/json2csv/pull/122) (Thanks @glutentag) - * `-a` or `--include-empty-rows` added for the CLI. - -## 2.2.1 / 2013-11-10 - - * mainly for development e.g. adding code format, update readme.. - -## 2.2.0 / 2013-11-08 - - * not create CSV column title by passing hasCSVColumnTitle: false, into params. - * if field is not exist in object then the field value in CSV will be empty. - * fix data in object format - {...} - -## 2.1.0 / 2013-06-11 - - * quote titles in the first row - -## 2.0.0 / 2013-03-04 - - * err in callback function - -## 1.3.1 / 2013-02-20 - - * fix stdin encoding - -## 1.3.0 / 2013-02-20 - - * support reading from stdin [#9](https://github.com/zeMirco/json2csv/pull/9) - -## 1.2.0 / 2013-02-20 - - * support custom field names [#8](https://github.com/zeMirco/json2csv/pull/8) - -## 1.1.0 / 2013-01-19 - - * add optional custom delimiter diff --git a/node_modules/json2csv/LICENSE.md b/node_modules/json2csv/LICENSE.md deleted file mode 100644 index 0054f10..0000000 --- a/node_modules/json2csv/LICENSE.md +++ /dev/null @@ -1,14 +0,0 @@ -Copyright (C) 2012 [Mirco Zeiss](mailto: mirco.zeiss@gmail.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE -OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/json2csv/README.md b/node_modules/json2csv/README.md deleted file mode 100644 index b6c55f4..0000000 --- a/node_modules/json2csv/README.md +++ /dev/null @@ -1,970 +0,0 @@ -# json2csv - -Converts json into csv with column titles and proper line endings. -Can be used as a module and from the command line. - -[![npm version][npm-badge]][npm-badge-url] -[![Build Status][travis-badge]][travis-badge-url] -[![Coverage Status][coveralls-badge]][coveralls-badge-url] - -See the [CHANGELOG] for details about the latest release. - -## Features - -- Fast and lightweight -- Scalable to infinitely large datasets (using stream processing) -- Support for standard JSON as well as NDJSON -- Advanced data selection (automatic field discovery, underscore-like selectors, custom data getters, default values for missing fields, transforms, etc.) -- Highly customizable (supportting custom quotation marks, delimiters, eol values, etc.) -- Automatic escaping (preserving new lines, quotes, etc. in them) -- Optional headers -- Unicode encoding support -- Pretty printing in table format to stdout - -## How to install - -You can install json2csv as a dependency using NPM. -Requires **Node v10** or higher. - -```sh -# Global so it can be called from anywhere -$ npm install -g json2csv -# or as a dependency of a project -$ npm install json2csv --save -``` - -Also, if you are loading json2csv directly to the browser you can pull it directly from the CDN. - -```html - -``` - -By default, the above script will get the latest release of json2csv. You can also specify a specific version: - -```html - -``` - -## Command Line Interface - -`json2csv` can be called from the command line if installed globally (using the `-g` flag). - -```bash -Usage: json2csv [options] - -Options: - -V, --version output the version number - -i, --input Path and name of the incoming json file. Defaults to stdin. - -o, --output Path and name of the resulting csv file. Defaults to stdout. - -c, --config Specify a file with a valid JSON configuration. - -n, --ndjson Treat the input as NewLine-Delimited JSON. - -s, --no-streaming Process the whole JSON array in memory instead of doing it line by line. - -f, --fields List of fields to process. Defaults to field auto-detection. - -v, --default-value Default value to use for missing fields. - -q, --quote Character(s) to use as quote mark. Defaults to '"'. - -Q, --escaped-quote Character(s) to use as a escaped quote. Defaults to a double `quote`, '""'. - -d, --delimiter Character(s) to use as delimiter. Defaults to ','. (default: ",") - -e, --eol Character(s) to use as End-of-Line for separating rows. Defaults to '\n'. (default: "\n") - -E, --excel-strings Wraps string data to force Excel to interpret it as string even if it contains a number. - -H, --no-header Disable the column name header. - -a, --include-empty-rows Includes empty rows in the resulting CSV output. - -b, --with-bom Includes BOM character at the beginning of the CSV. - -p, --pretty Print output as a pretty table. Use only when printing to console. - --unwind [paths] Creates multiple rows from a single JSON document similar to MongoDB unwind. - --unwind-blank When unwinding, blank out instead of repeating data. Defaults to false. (default: false) - --flatten-objects Flatten nested objects. Defaults to false. (default: false) - --flatten-arrays Flatten nested arrays. Defaults to false. (default: false) - --flatten-separator Flattened keys separator. Defaults to '.'. (default: ".") - -h, --help output usage information -``` - -If no input `-i` is specified the result is expected from to the console standard input. -If no output `-o` is specified the result is printed to the console standard output. -If no fields `-f` or config `-c` are passed the fields of the first element are used since json2csv CLI process the items one at a time. You can use the `--no-streaming` flag to load the entire JSON in memory and get all the headers. However, keep in mind that this is slower and requires much more memory. -Use `-p` to show the result as a table in the console. - -Any option passed through the config file `-c` will be overriden if a specific flag is passed as well. For example, the fields option of the config will be overriden if the fields flag `-f` is used. - -### CLI examples - -All examples use this example [input file](https://github.com/zemirco/json2csv/blob/master/test/fixtures/json/default.json). - -#### Input file and specify fields - -```sh -$ json2csv -i input.json -f carModel,price,color -carModel,price,color -"Audi",10000,"blue" -"BMW",15000,"red" -"Mercedes",20000,"yellow" -"Porsche",30000,"green" -``` - -#### Input file, specify fields and use pretty logging - -```sh -$ json2csv -i input.json -f carModel,price,color -p -``` - -![Screenshot](https://s3.amazonaws.com/zeMirco/github/json2csv/json2csv-pretty.png) - -#### Generating CSV containing only specific fields - -```sh -$ json2csv -i input.json -f carModel,price,color -o out.csv -$ cat out.csv -carModel,price,color -"Audi",10000,"blue" -"BMW",15000,"red" -"Mercedes",20000,"yellow" -"Porsche",30000,"green" -``` - -Same result will be obtained passing the fields config as a file. - -```sh -$ json2csv -i input.json -c fieldsConfig.json -o out.csv -``` - -where the file `fieldsConfig.json` contains - -```json -[ - "carModel", - "price", - "color" -] -``` - -#### Read input from stdin - -```sh -$ json2csv -f price -[{"price":1000},{"price":2000}] -``` - -Hit Enter and afterwards CTRL + D to end reading from stdin. The terminal should show - -``` -price -1000 -2000 -``` - -#### Appending to existing CSV - -Sometimes you want to add some additional rows with the same columns. -This is how you can do that. - -```sh -# Initial creation of csv with headings -$ json2csv -i test.json -f name,version > test.csv -# Append additional rows -$ json2csv -i test.json -f name,version --no-header >> test.csv -``` - -## Javascript module - -`json2csv` can also be use programatically from you javascript codebase. - -### Available Options - -The programatic APIs take a configuration object very equivalent to the CLI options. - -- `fields` - Array of Objects/Strings. Defaults to toplevel JSON attributes. See example below. -- `ndjson` - Only effective on the streaming API. Indicates that data coming through the stream is NDJSON. -- `transforms` - Array of transforms to be applied to each data item. A transform is simply a function that receives a data item and returns the transformed item. -- `defaultValue` - String, default value to use when missing data. Defaults to `` if not specified. (Overridden by `fields[].default`) -- `quote` - String, quote around cell values and column names. Defaults to `"` if not specified. -- `escapedQuote` - String, the value to replace escaped quotes in strings. Defaults to 2x`quotes` (for example `""`) if not specified. -- `delimiter` - String, delimiter of columns. Defaults to `,` if not specified. -- `eol` - String, overrides the default OS line ending (i.e. `\n` on Unix and `\r\n` on Windows). -- `excelStrings` - Boolean, converts string data into normalized Excel style data. -- `header` - Boolean, determines whether or not CSV file will contain a title column. Defaults to `true` if not specified. -- `includeEmptyRows` - Boolean, includes empty rows. Defaults to `false`. -- `withBOM` - Boolean, with BOM character. Defaults to `false`. - -### json2csv parser (Synchronous API) - -`json2csv` can also be used programatically as a synchronous converter using its `parse` method. -```js -const { Parser } = require('json2csv'); - -const fields = ['field1', 'field2', 'field3']; -const opts = { fields }; - -try { - const parser = new Parser(opts); - const csv = parser.parse(myData); - console.log(csv); -} catch (err) { - console.error(err); -} -``` - -you can also use the convenience method `parse` - -```js -const { parse } = require('json2csv'); - -const fields = ['field1', 'field2', 'field3']; -const opts = { fields }; - -try { - const csv = parse(myData, opts); - console.log(csv); -} catch (err) { - console.error(err); -} -``` - -Both of the methods above load the entire JSON in memory and do the whole processing in-memory while blocking Javascript event loop. For that reason is rarely a good reason to use it until your data is very small or your application doesn't do anything else. - -### json2csv async parser (Streaming API) - -The synchronous API has the downside of loading the entire JSON array in memory and blocking javascript's event loop while processing the data. This means that your server won't be able to process more request or your UI will become irresponsive while data is being processed. For those reasons, is rarely a good reason to use it unless your data is very small or your application doesn't do anything else. - -The async parser process the data as a non-blocking stream. This approach ensures a consistent memory footprint and avoid blocking javascript's event loop. Thus, it's better suited for large datasets or system with high concurrency. - -One very important difference between the asynchronous and the synchronous APIs is that using the asynchronous API json objects are processed one by one. In practice, this means that only the fields in the first object of the array are automatically detected and other fields are just ignored. To avoid this, it's advisable to ensure that all the objects contain exactly the same fields or provide the list of fields using the `fields` option. - -The async API uses takes a second options arguments that's directly passed to the underlying streams and accept the same options as the standard [Node.js streams](https://nodejs.org/api/stream.html#stream_new_stream_duplex_options). - -Instances of `AsyncParser` expose three objects: -* *input:* Which allows to push more data -* *processor:* A readable string representing the whole data processing. You can listen to all the standard events of Node.js streams. -* *transform:* The json2csv transform. See bellow for more details. - -```js -const { AsyncParser } = require('json2csv'); - -const fields = ['field1', 'field2', 'field3']; -const opts = { fields }; -const transformOpts = { highWaterMark: 8192 }; - -const asyncParser = new AsyncParser(opts, transformOpts); - -let csv = ''; -asyncParser.processor - .on('data', chunk => (csv += chunk.toString())) - .on('end', () => console.log(csv)) - .on('error', err => console.error(err)); - -// You can also listen for events on the conversion and see how the header or the lines are coming out. -asyncParser.transform - .on('header', header => console.log(header)) - .on('line', line => console.log(line)) - .on('error', err => console.log(err)); - -asyncParser.input.push(data); // This data might come from an HTTP request, etc. -asyncParser.input.push(null); // Sending `null` to a stream signal that no more data is expected and ends it. -``` - -`AsyncParser` also exposes some convenience methods: -* `fromInput` allows you to set the input stream. -* `throughTransform` allows you to add transforms to the stream. -* `toOutput` allows you to set the output stream. -* `promise` returns a promise that resolves when the stream ends or errors. Takes a boolean parameter to indicate if the resulting CSV should be kept in-memory and be resolved by the promise. - -```js -const { createReadStream, createWriteStream } = require('fs'); -const { AsyncParser } = require('json2csv'); - -const fields = ['field1', 'field2', 'field3']; -const opts = { fields }; -const transformOpts = { highWaterMark: 8192 }; - -// Using the promise API -const input = createReadStream(inputPath, { encoding: 'utf8' }); -const asyncParser = new JSON2CSVAsyncParser(opts, transformOpts); -const parsingProcessor = asyncParser.fromInput(input); - -parsingProcessor.promise() - .then(csv => console.log(csv)) - .catch(err => console.error(err)); - -// Using the promise API just to know when the process finnish -// but not actually load the CSV in memory -const input = createReadStream(inputPath, { encoding: 'utf8' }); -const output = createWriteStream(outputPath, { encoding: 'utf8' }); -const asyncParser = new JSON2CSVAsyncParser(opts, transformOpts); -const parsingProcessor = asyncParser.fromInput(input).toOutput(output); - -parsingProcessor.promise(false).catch(err => console.error(err)); -``` - -you can also use the convenience method `parseAsync` which accept both JSON arrays/objects and readable streams and returns a promise. - -```js -const { parseAsync } = require('json2csv'); - -const fields = ['field1', 'field2', 'field3']; -const opts = { fields }; - -parseAsync(myData, opts) - .then(csv => console.log(csv)) - .catch(err => console.error(err)); -``` - -### json2csv transform (Streaming API) - -json2csv also exposes the raw stream transform so you can pipe your json content into it. This is the same Transform that `AsyncParser` uses under the hood. - -```js -const { createReadStream, createWriteStream } = require('fs'); -const { Transform } = require('json2csv'); - -const fields = ['field1', 'field2', 'field3']; -const opts = { fields }; -const transformOpts = { highWaterMark: 16384, encoding: 'utf-8' }; - -const input = createReadStream(inputPath, { encoding: 'utf8' }); -const output = createWriteStream(outputPath, { encoding: 'utf8' }); -const json2csv = new Transform(opts, transformOpts); - -const processor = input.pipe(json2csv).pipe(output); - -// You can also listen for events on the conversion and see how the header or the lines are coming out. -json2csv - .on('header', header => console.log(header)) - .on('line', line => console.log(line)) - .on('error', err => console.log(err)); -``` - -The stream API can also work on object mode. This is useful when you have an input stream in object mode or if you are getting JSON objects one by one and want to convert them to CSV as they come. - -```js -const { Transform } = require("json2csv"); -const { Readable } = require('stream'); - -const input = new Readable({ objectMode: true }); -input._read = () => {}; -// myObjectEmitter is just a fake example representing anything that emit objects. -myObjectEmitter.on('object', obj => input.push(obj)); -// Pushing a null close the stream -myObjectEmitter.end(() => input.push(null)); - -const output = process.stdout; - -const opts = {}; -const transformOpts = { objectMode: true }; - -const json2csv = new Transform(opts, transformOpts); -const processor = input.pipe(json2csv).pipe(output); -``` - -### Data transforms - -json2csv supports data transforms. A transform is simply a function that receives a data item and returns the transformed item. - - -#### Custom transforms - -```js -function (item) { - // apply tranformations or create new object - return transformedItem; -} -``` -or using ES6 -```js -(item) => { - // apply tranformations or create new object - return transformedItem; -} -``` - -For example, let's add a line counter to our CSV, capitalize the car field and change the price to be in Ks (1000s). -```js -let counter = 1; -(item) => ({ counter: counter++, ...item, car: item.car.toUpperCase(), price: item.price / 1000 }); -``` - -#### Built-in transforms - -There is a number of built-in transform provider by the library. - -```js -const { transforms: { unwind, flatten } } = require('json2csv'); -``` - -##### Unwind - -The unwind transform deconstructs an array field from the input item to output a row for each element. Is's similar to MongoDB's $unwind aggregation. - -The transform needs to be instantiated and takes an options object as arguments containing: -- `paths` - Array of String, list the paths to the fields to be unwound. It's mandatory and should not be empty. -- `blankOut` - Boolean, unwind using blank values instead of repeating data. Defaults to `false`. - -```js -// Default -unwind({ paths: ['fieldToUnwind'] }); - -// Blanking out repeated data -unwind({ paths: ['fieldToUnwind'], blankOut: true }); -``` - -##### Flatten -Flatten nested javascript objects into a single level object. - -The transform needs to be instantiated and takes an options object as arguments containing: -- `objects` - Boolean, whether to flatten JSON objects or not. Defaults to `true`. -- `arrays`- Boolean, whether to flatten Arrays or not. Defaults to `false`. -- `separator` - String, separator to use between nested JSON keys when flattening a field. Defaults to `.`. - -```js -// Default -flatten(); - -// Custom separator '__' -flatten({ separator: '_' }); - -// Flatten only arrays -flatten({ objects: false, arrays: true }); -``` - -### Javascript module examples - -#### Example `fields` option -```js -{ - fields: [ - // Supports pathname -> pathvalue - 'simplepath', // equivalent to {value:'simplepath'} - 'path.to.value' // also equivalent to {value:'path.to.value'} - - // Supports label -> simple path - { - label: 'some label', // Optional, column will be labeled 'path.to.something' if not defined) - value: 'path.to.something', // data.path.to.something - default: 'NULL' // default if value is not found (Optional, overrides `defaultValue` for column) - }, - - // Supports label -> derived value - { - label: 'some label', // Optional, column will be labeled with the function name or empty if the function is anonymous - value: (row, field) => row[field.label].toLowerCase() ||field.default, - default: 'NULL' // default if value function returns null or undefined - }, - - // Supports label -> derived value - { - value: (row) => row.arrayField.join(',') - }, - - // Supports label -> derived value - { - value: (row) => `"${row.arrayField.join(',')}"` - }, - ] -} -``` - -#### Example 1 - -```js -const { Parser } = require('json2csv'); - -const myCars = [ - { - "car": "Audi", - "price": 40000, - "color": "blue" - }, { - "car": "BMW", - "price": 35000, - "color": "black" - }, { - "car": "Porsche", - "price": 60000, - "color": "green" - } -]; - -const json2csvParser = new Parser(); -const csv = json2csvParser.parse(myCars); - -console.log(csv); -``` - -will output to console - -``` -"car", "price", "color" -"Audi", 40000, "blue" -"BMW", 35000, "black" -"Porsche", 60000, "green" -``` - -#### Example 2 - -You can choose which fields to include in the CSV. - -```js -const { Parser } = require('json2csv'); -const fields = ['car', 'color']; - -const json2csvParser = new Parser({ fields }); -const csv = json2csvParser.parse(myCars); - -console.log(csv); -``` - -will output to console - -``` -"car", "color" -"Audi", "blue" -"BMW", "black" -"Porsche", "green" -``` - -#### Example 3 - -You can choose custom column names for the exported file. - -```js -const { Parser } = require('json2csv'); - -const fields = [{ - label: 'Car Name', - value: 'car' -},{ - label: 'Price USD', - value: 'price' -}]; - -const json2csvParser = new Parser({ fields }); -const csv = json2csvParser.parse(myCars); - -console.log(csv); -``` - -will output to console - -``` -"Car Name", "Price USD" -"Audi", 40000 -"BMW", 35000 -"Porsche", 60000 -``` - -#### Example 4 - -You can also specify nested properties using dot notation. - -```js -const { Parser } = require('json2csv'); - -const myCars = [ - { - "car": { "make": "Audi", "model": "A3" }, - "price": 40000, - "color": "blue" - }, { - "car": { "make": "BMW", "model": "F20" }, - "price": 35000, - "color": "black" - }, { - "car": { "make": "Porsche", "model": "9PA AF1" }, - "price": 60000, - "color": "green" - } -]; - -const fields = ['car.make', 'car.model', 'price', 'color']; - -const json2csvParser = new Parser({ fields }); -const csv = json2csvParser.parse(myCars); - -console.log(csv); -``` - -will output to console - -``` -"car.make", "car.model", "price", "color" -"Audi", "A3", 40000, "blue" -"BMW", "F20", 35000, "black" -"Porsche", "9PA AF1", 60000, "green" -``` - -#### Example 5 - -Use a custom delimiter to create tsv files using the delimiter option: - -```js -const { Parser } = require('json2csv'); - -const json2csvParser = new Parser({ delimiter: '\t' }); -const tsv = json2csvParser.parse(myCars); - -console.log(tsv); -``` - -will output to console - -``` -"car" "price" "color" -"Audi" 10000 "blue" -"BMW" 15000 "red" -"Mercedes" 20000 "yellow" -"Porsche" 30000 "green" -``` - -If no delimiter is specified, the default `,` is used. - -#### Example 6 - -You can choose custom quotation marks. - -```js -const { Parser } = require('json2csv'); - -const json2csvParser = new Parser({ quote: '' }); -const csv = json2csvParser.parse(myCars); - -console.log(csv); -``` - -will output to console - -``` -car, price, color -Audi, 40000, blue -BMW", 35000, black -Porsche", 60000, green -``` - -#### Example 7 - -You can unwind arrays similar to MongoDB's $unwind operation using the `unwind` transform. - -```js -const { Parser, transforms: { unwind } } = require('json2csv'); - -const myCars = [ - { - "carModel": "Audi", - "price": 0, - "colors": ["blue","green","yellow"] - }, { - "carModel": "BMW", - "price": 15000, - "colors": ["red","blue"] - }, { - "carModel": "Mercedes", - "price": 20000, - "colors": "yellow" - }, { - "carModel": "Porsche", - "price": 30000, - "colors": ["green","teal","aqua"] - } -]; - -const fields = ['carModel', 'price', 'colors']; -const transforms = [unwind({ paths: ['colors'] })]; - -const json2csvParser = new Parser({ fields, transforms }); -const csv = json2csvParser.parse(myCars); - -console.log(csv); -``` - -will output to console - -``` -"carModel","price","colors" -"Audi",0,"blue" -"Audi",0,"green" -"Audi",0,"yellow" -"BMW",15000,"red" -"BMW",15000,"blue" -"Mercedes",20000,"yellow" -"Porsche",30000,"green" -"Porsche",30000,"teal" -"Porsche",30000,"aqua" -``` - -#### Example 8 - -You can also unwind arrays multiple times or with nested objects. - -```js -const { Parser, transforms: { unwind } } = require('json2csv'); - -const myCars = [ - { - "carModel": "BMW", - "price": 15000, - "items": [ - { - "name": "airbag", - "color": "white" - }, { - "name": "dashboard", - "color": "black" - } - ] - }, { - "carModel": "Porsche", - "price": 30000, - "items": [ - { - "name": "airbag", - "items": [ - { - "position": "left", - "color": "white" - }, { - "position": "right", - "color": "gray" - } - ] - }, { - "name": "dashboard", - "items": [ - { - "position": "left", - "color": "gray" - }, { - "position": "right", - "color": "black" - } - ] - } - ] - } -]; - -const fields = ['carModel', 'price', 'items.name', 'items.color', 'items.items.position', 'items.items.color']; -const transforms = [unwind({ paths: ['items', 'items.items'] })]; -const json2csvParser = new Parser({ fields, transforms }); -const csv = json2csvParser.parse(myCars); - -console.log(csv); -``` - -will output to console - -``` -"carModel","price","items.name","items.color","items.items.position","items.items.color" -"BMW",15000,"airbag","white",, -"BMW",15000,"dashboard","black",, -"Porsche",30000,"airbag",,"left","white" -"Porsche",30000,"airbag",,"right","gray" -"Porsche",30000,"dashboard",,"left","gray" -"Porsche",30000,"dashboard",,"right","black" -``` - -#### Example 9 - -You can also unwind arrays blanking the repeated fields. - -```js -const { Parser, transforms: { unwind } } = require('json2csv'); - -const myCars = [ - { - "carModel": "BMW", - "price": 15000, - "items": [ - { - "name": "airbag", - "color": "white" - }, { - "name": "dashboard", - "color": "black" - } - ] - }, { - "carModel": "Porsche", - "price": 30000, - "items": [ - { - "name": "airbag", - "items": [ - { - "position": "left", - "color": "white" - }, { - "position": "right", - "color": "gray" - } - ] - }, { - "name": "dashboard", - "items": [ - { - "position": "left", - "color": "gray" - }, { - "position": "right", - "color": "black" - } - ] - } - ] - } -]; - -const fields = ['carModel', 'price', 'items.name', 'items.color', 'items.items.position', 'items.items.color']; -const transforms = [unwind({ paths: ['items', 'items.items'], blankOut: true })]; - -const json2csvParser = new Parser({ fields, transforms }); -const csv = json2csvParser.parse(myCars); - -console.log(csv); -``` - -will output to console - -``` -"carModel","price","items.name","items.color","items.items.position","items.items.color" -"BMW",15000,"airbag","white",, -,,"dashboard","black",, -"Porsche",30000,"airbag",,"left","white" -,,,,"right","gray" -,,"dashboard",,"left","gray" -,,,,"right","black" -``` - -### Migrations - -#### Migrating from 3.X to 4.X - -What in 3.X used to be -```js -const json2csv = require('json2csv'); -const csv = json2csv({ data: myData, fields: myFields, unwindPath: paths, ... }); -``` - -should be replaced by -```js -const { Parser } = require('json2csv'); -const json2csvParser = new Parser({ fields: myFields, unwind: paths, ... }); -const csv = json2csvParser.parse(myData); -``` - -or the convenience method -```js -const json2csv = require('json2csv'); -const csv = json2csv.parse(myData, { fields: myFields, unwind: paths, ... }); -``` - -Please note that many of the configuration parameters have been slightly renamed. Please check one by one that all your parameters are correct. -You can se the documentation for json2csv 3.11.5 [here](https://github.com/zemirco/json2csv/blob/v3.11.5/README.md). - -#### Migrating from 4.X to 5.X - -In the CLI, the config file option, `-c`, used to be a list of fields and now it's expected to be a full configuration object. - -The `stringify` option hass been removed. - -`doubleQuote` has been renamed to `escapedQuote`. - -The `unwind` and `flatten` -related options has been moved to their own transforms. - -What used to be -```js -const { Parser } = require('json2csv'); -const json2csvParser = new Parser({ unwind: paths, unwindBlank: true, flatten: true, flattenSeparator: '__' }); -const csv = json2csvParser.parse(myData); -``` - -should be replaced by -```js -const { Parser, transforms: { unwind, flatten } } = require('json2csv'); -const json2csvParser = new Parser({ transforms: [unwind({ paths, blankOut: true }), flatten('__')] }); -const csv = json2csvParser.parse(myData); -``` - -You can se the documentation for json2csv v4.X.X [here](https://github.com/zemirco/json2csv/blob/v4/README.md). - -## Known Gotchas - -### Excel support - -#### Avoiding excel autoformatting - -Excel tries to automatically detect the format of every field (number, date, string, etc.) regardless of whether the field is quoted or not. - -This might produce few undesired effects with, for example, serial numbers: -- Large numbers are displayed using scientific notation -- Leading zeros are stripped. - -Enabling the `excelString` option produces an Excel-specific CSV file that forces Excel to interpret string fields as strings. Please note that the CSV will look incorrect if viewing it somewhere else than Excel. - -#### Avoiding CSV injection - -As part of Excel automatically format detection, fields regarded as formulas (starting with `=`, `+`, `-` or `@`) are interpreted regardless of whether the field is quoted or not, creating a security risk (see [CSV Injection](https://www.owasp.org/index.php/CSV_Injection). - -This issue has nothing to do with the CSV format, since CSV knows nothing about formulas, but with how Excel parses CSV files. - -Enabling the `excelString` option produces an Excel-specific CSV file that forces Excel to interpret string fields as strings. Please note that the CSV will look incorrect if viewing it somewhere else than Excel. - -#### Preserving new lines - -Excel only recognizes `\r\n` as valid new line inside a cell. - -#### Unicode Support - -Excel can display Unicode correctly (just setting the `withBOM` option to true). However, Excel can't save unicode so, if you perform any changes to the CSV and save it from Excel, the Unicode characters will not be displayed correctly. - - -### PowerShell escaping - -PowerShell do some estrange double quote escaping escaping which results on each line of the CSV missing the first and last quote if outputting the result directly to stdout. Instead of that, it's advisable that you write the result directly to a file. - -## Building - -json2csv is packaged using `rollup`. You can generate the packages running: - -```sh -npm run build -``` -which generates 3 files under the `dist folder`: - -* `json2csv.umd.js` UMD module transpiled to ES5 -* `json2csv.esm.js` ES5 module (import/export) -* `json2csv.cjs.js` CommonJS module - -When you use packaging tools like webpack and such, they know which version to use depending on your configuration. - -## Testing - -Run the folowing command to check the code style. - -```sh -$ npm run lint -``` - -Run the following command to run the tests and return coverage - -```sh -$ npm run test-with-coverage -``` - -## Contributors - -After you clone the repository you just need to install the required packages for development by runnning following command under json2csv dir. - -```sh -$ npm install -``` - -Before making any pull request please ensure sure that your code is formatted, test are passing and test coverage haven't decreased. (See [Testing](#testing)) - -## License - -See [LICENSE.md]. - -[npm-badge]: https://badge.fury.io/js/json2csv.svg -[npm-badge-url]: http://badge.fury.io/js/json2csv -[travis-badge]: https://travis-ci.org/zemirco/json2csv.svg -[travis-badge-url]: https://travis-ci.org/zemirco/json2csv -[coveralls-badge]: https://coveralls.io/repos/zemirco/json2csv/badge.svg?branch=master -[coveralls-badge-url]: https://coveralls.io/r/zemirco/json2csv?branch=master -[CHANGELOG]: https://github.com/zemirco/json2csv/blob/master/CHANGELOG.md -[LICENSE.md]: https://github.com/zemirco/json2csv/blob/master/LICENSE.md diff --git a/node_modules/json2csv/bin/json2csv.js b/node_modules/json2csv/bin/json2csv.js deleted file mode 100755 index c41aa37..0000000 --- a/node_modules/json2csv/bin/json2csv.js +++ /dev/null @@ -1,183 +0,0 @@ -#!/usr/bin/env node - -'use strict'; - -const { promisify } = require('util'); -const { createReadStream, createWriteStream, readFile: readFileOrig, writeFile: writeFileOrig } = require('fs'); -const os = require('os'); -const { isAbsolute, join } = require('path'); -const program = require('commander'); -const pkg = require('../package'); -const json2csv = require('../lib/json2csv'); -const parseNdJson = require('./utils/parseNdjson'); -const TablePrinter = require('./utils/TablePrinter'); - -const readFile = promisify(readFileOrig); -const writeFile = promisify(writeFileOrig); - -const { unwind, flatten } = json2csv.transforms; -const JSON2CSVParser = json2csv.Parser; -const Json2csvTransform = json2csv.Transform; - -program - .version(pkg.version) - .option('-i, --input ', 'Path and name of the incoming json file. Defaults to stdin.') - .option('-o, --output ', 'Path and name of the resulting csv file. Defaults to stdout.') - .option('-c, --config ', 'Specify a file with a valid JSON configuration.') - .option('-n, --ndjson', 'Treat the input as NewLine-Delimited JSON.') - .option('-s, --no-streaming', 'Process the whole JSON array in memory instead of doing it line by line.') - .option('-f, --fields ', 'List of fields to process. Defaults to field auto-detection.') - .option('-v, --default-value ', 'Default value to use for missing fields.') - .option('-q, --quote ', 'Character(s) to use as quote mark. Defaults to \'"\'.') - .option('-Q, --escaped-quote ', 'Character(s) to use as a escaped quote. Defaults to a double `quote`, \'""\'.') - .option('-d, --delimiter ', 'Character(s) to use as delimiter. Defaults to \',\'.', ',') - .option('-e, --eol ', 'Character(s) to use as End-of-Line for separating rows. Defaults to \'\\n\'.', os.EOL) - .option('-E, --excel-strings','Wraps string data to force Excel to interpret it as string even if it contains a number.') - .option('-H, --no-header', 'Disable the column name header.') - .option('-a, --include-empty-rows', 'Includes empty rows in the resulting CSV output.') - .option('-b, --with-bom', 'Includes BOM character at the beginning of the CSV.') - .option('-p, --pretty', 'Print output as a pretty table. Use only when printing to console.') - // Built-in transforms - .option('--unwind [paths]', 'Creates multiple rows from a single JSON document similar to MongoDB unwind.') - .option('--unwind-blank', 'When unwinding, blank out instead of repeating data. Defaults to false.', false) - .option('--flatten-objects', 'Flatten nested objects. Defaults to false.', false) - .option('--flatten-arrays', 'Flatten nested arrays. Defaults to false.', false) - .option('--flatten-separator ', 'Flattened keys separator. Defaults to \'.\'.', '.') - .parse(process.argv); - -function makePathAbsolute(filePath) { - return (filePath && !isAbsolute(filePath)) - ? join(process.cwd(), filePath) - : filePath; -} - -program.input = makePathAbsolute(program.input); -program.output = makePathAbsolute(program.output); -program.config = makePathAbsolute(program.config); - -// don't fail if piped to e.g. head -/* istanbul ignore next */ -process.stdout.on('error', (error) => { - if (error.code === 'EPIPE') process.exit(1); -}); - -function getInputStream(inputPath) { - if (inputPath) return createReadStream(inputPath, { encoding: 'utf8' }); - - process.stdin.resume(); - process.stdin.setEncoding('utf8'); - return process.stdin; -} - -function getOutputStream(outputPath, config) { - if (outputPath) return createWriteStream(outputPath, { encoding: 'utf8' }); - if (config.pretty) return new TablePrinter(config).writeStream(); - return process.stdout; -} - -async function getInput(inputPath, ndjson) { - if (!inputPath) return getInputFromStdin(); - if (ndjson) return parseNdJson(await readFile(inputPath, 'utf8')); - return require(inputPath); -} - -async function getInputFromStdin() { - return new Promise((resolve, reject) => { - process.stdin.resume(); - process.stdin.setEncoding('utf8'); - - let inputData = ''; - process.stdin.on('data', chunk => (inputData += chunk)); - /* istanbul ignore next */ - process.stdin.on('error', err => reject(new Error('Could not read from stdin', err))); - process.stdin.on('end', () => { - try { - resolve(program.ndjson ? parseNdJson(inputData) : JSON.parse(inputData)); - } catch (err) { - reject(new Error('Invalid data received from stdin', err)); - } - }); - }); -} - -async function processOutput(outputPath, csv, config) { - if (!outputPath) { - // eslint-disable-next-line no-console - config.pretty ? (new TablePrinter(config)).printCSV(csv) : console.log(csv); - return; - } - - await writeFile(outputPath, csv); -} - -async function processInMemory(config, opts) { - const input = await getInput(program.input, config.ndjson); - const output = new JSON2CSVParser(opts).parse(input); - await processOutput(program.output, output, config); -} - -async function processStream(config, opts) { - const input = getInputStream(program.input); - const transform = new Json2csvTransform(opts); - const output = getOutputStream(program.output, config); - - await new Promise((resolve, reject) => { - input.pipe(transform).pipe(output); - input.on('error', reject); - transform.on('error', reject); - output.on('error', reject) - .on('finish', resolve); - }); -} - -(async (program) => { - try { - const config = Object.assign({}, program.config ? require(program.config) : {}, program); - - const transforms = []; - if (config.unwind) { - transforms.push(unwind({ - paths: config.unwind === true ? undefined : config.unwind.split(','), - blankOut: config.unwindBlank - })); - } - - if (config.flattenObjects || config.flattenArrays) { - transforms.push(flatten({ - objects: config.flattenObjects, - arrays: config.flattenArrays, - separator: config.flattenSeparator - })); - } - - const opts = { - transforms, - fields: config.fields - ? (Array.isArray(config.fields) ? config.fields : config.fields.split(',')) - : config.fields, - defaultValue: config.defaultValue, - quote: config.quote, - escapedQuote: config.escapedQuote, - delimiter: config.delimiter, - eol: config.eol, - excelStrings: config.excelStrings, - header: config.header, - includeEmptyRows: config.includeEmptyRows, - withBOM: config.withBom - }; - - await (config.streaming ? processStream : processInMemory)(config, opts); - } catch(err) { - let processedError = err; - if (program.input && err.message.includes(program.input)) { - processedError = new Error(`Invalid input file. (${err.message})`); - } else if (program.output && err.message.includes(program.output)) { - processedError = new Error(`Invalid output file. (${err.message})`); - } else if (program.config && err.message.includes(program.config)) { - processedError = new Error(`Invalid config file. (${err.message})`); - } - // eslint-disable-next-line no-console - console.error(processedError); - process.exit(1); - } -})(program); diff --git a/node_modules/json2csv/bin/utils/TablePrinter.js b/node_modules/json2csv/bin/utils/TablePrinter.js deleted file mode 100644 index 057463a..0000000 --- a/node_modules/json2csv/bin/utils/TablePrinter.js +++ /dev/null @@ -1,117 +0,0 @@ -'use strict'; - -const { Writable } = require('stream'); - -const MIN_CELL_WIDTH = 15; - -class TablePrinter { - constructor(opts) { - this.opts = opts; - this._hasWritten = false; - } - - push(csv) { - const lines = csv.split(this.opts.eol); - - if (!lines.length) return; - - if (!this._hasWritten) this.setColumnWidths(lines[0]); - - const top = this._hasWritten ? this.middleLine : this.topLine; - this.print(top, lines); - this._hasWritten = true; - } - - end(csv) { - let lines = csv.split(this.opts.eol); - if (!this._hasWritten) this.setColumnWidths(lines[0]); - const top = this._hasWritten ? this.middleLine : this.topLine; - this.print(top, lines, this.bottomLine); - } - - printCSV(csv) { - this.end(csv); - } - - setColumnWidths(line) { - this.colWidths = line - .split(this.opts.delimiter) - .map(elem => Math.max(elem.length * 2, MIN_CELL_WIDTH)); - - this.topLine = `┌${this.colWidths.map(i => '─'.repeat(i)).join('â”Ŧ')}┐`; - this.middleLine = `├${this.colWidths.map(i => '─'.repeat(i)).join('â”ŧ')}┤`; - this.bottomLine = `└${this.colWidths.map(i => '─'.repeat(i)).join('┴')}┘`; - } - - print(top, lines, bottom) { - const table = `${top}\n` - + lines - .map(row => this.formatRow(row)) - .join(`\n${this.middleLine}\n`) - + (bottom ? `\n${bottom}` : ''); - - // eslint-disable-next-line no-console - console.log(table); - } - - formatRow(row) { - const wrappedRow = row - .split(this.opts.delimiter) - .map((cell, i) => cell.match(new RegExp(`(.{1,${this.colWidths[i] - 2}})`, 'g')) || []); - - const height = wrappedRow.reduce((acc, cell) => Math.max(acc, cell.length), 0); - - const processedCells = wrappedRow - .map((cell, i) => this.formatCell(cell, height, this.colWidths[i])); - - return Array(height).fill('') - .map((_, i) => `│${processedCells.map(cell => cell[i]).join('│')}│`) - .join('\n'); - } - - formatCell(content, heigth, width) { - const paddedContent = this.padCellHorizontally(content, width); - return this.padCellVertically(paddedContent, heigth, width); - } - - padCellVertically(content, heigth, width) { - const vertPad = heigth - content.length; - const vertPadTop = Math.ceil(vertPad / 2); - const vertPadBottom = vertPad - vertPadTop; - const emptyLine = ' '.repeat(width); - - return [ - ...Array(vertPadTop).fill(emptyLine), - ...content, - ...Array(vertPadBottom).fill(emptyLine) - ]; - } - - padCellHorizontally(content, width) { - return content.map((line) => { - const horPad = width - line.length - 2; - return ` ${line}${' '.repeat(horPad)} `; - }); - } - - writeStream() { - let csv = ''; - const table = this; - return new Writable({ - write(chunk, encoding, callback) { - csv += chunk.toString(); - const index = csv.lastIndexOf(table.opts.eol); - let lines = csv.substring(0, index); - csv = csv.substring(index + 1); - - if (lines) table.push(lines); - callback(); - }, - final() { - table.end(csv); - } - }); - } -} - -module.exports = TablePrinter; diff --git a/node_modules/json2csv/bin/utils/parseNdjson.js b/node_modules/json2csv/bin/utils/parseNdjson.js deleted file mode 100644 index dbc9c67..0000000 --- a/node_modules/json2csv/bin/utils/parseNdjson.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -function parseNdJson(input) { - return input - .split('\n') - .map(line => line.trim()) - .filter(line => line !== '') - .map(line=> JSON.parse(line)); -} - -module.exports = parseNdJson; diff --git a/node_modules/json2csv/dist/json2csv.esm.js b/node_modules/json2csv/dist/json2csv.esm.js deleted file mode 100644 index e612438..0000000 --- a/node_modules/json2csv/dist/json2csv.esm.js +++ /dev/null @@ -1,2337 +0,0 @@ -import stream from 'stream'; -import os from 'os'; - -function _typeof(obj) { - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof = function (obj) { - return typeof obj; - }; - } else { - _typeof = function (obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - - return _typeof(obj); -} - -function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -} - -function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } -} - -function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; -} - -function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - - return obj; -} - -function _inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function"); - } - - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true - } - }); - if (superClass) _setPrototypeOf(subClass, superClass); -} - -function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); -} - -function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - - return _setPrototypeOf(o, p); -} - -function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - - return self; -} - -function _possibleConstructorReturn(self, call) { - if (call && (typeof call === "object" || typeof call === "function")) { - return call; - } - - return _assertThisInitialized(self); -} - -function _toArray(arr) { - return _arrayWithHoles(arr) || _iterableToArray(arr) || _nonIterableRest(); -} - -function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); -} - -function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; - - return arr2; - } -} - -function _arrayWithHoles(arr) { - if (Array.isArray(arr)) return arr; -} - -function _iterableToArray(iter) { - if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); -} - -function _nonIterableSpread() { - throw new TypeError("Invalid attempt to spread non-iterable instance"); -} - -function _nonIterableRest() { - throw new TypeError("Invalid attempt to destructure non-iterable instance"); -} - -var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; - -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** Used to stand-in for `undefined` hash values. */ -var HASH_UNDEFINED = '__lodash_hash_undefined__'; - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0; - -/** `Object#toString` result references. */ -var funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - symbolTag = '[object Symbol]'; - -/** Used to match property names within property paths. */ -var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, - reIsPlainProp = /^\w*$/, - reLeadingDot = /^\./, - rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; - -/** - * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). - */ -var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; - -/** Used to match backslashes in property paths. */ -var reEscapeChar = /\\(\\)?/g; - -/** Used to detect host constructors (Safari). */ -var reIsHostCtor = /^\[object .+?Constructor\]$/; - -/** Detect free variable `global` from Node.js. */ -var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; - -/** Detect free variable `self`. */ -var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - -/** Used as a reference to the global object. */ -var root = freeGlobal || freeSelf || Function('return this')(); - -/** - * Gets the value at `key` of `object`. - * - * @private - * @param {Object} [object] The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. - */ -function getValue(object, key) { - return object == null ? undefined : object[key]; -} - -/** - * Checks if `value` is a host object in IE < 9. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a host object, else `false`. - */ -function isHostObject(value) { - // Many host objects are `Object` objects that can coerce to strings - // despite having improperly defined `toString` methods. - var result = false; - if (value != null && typeof value.toString != 'function') { - try { - result = !!(value + ''); - } catch (e) {} - } - return result; -} - -/** Used for built-in method references. */ -var arrayProto = Array.prototype, - funcProto = Function.prototype, - objectProto = Object.prototype; - -/** Used to detect overreaching core-js shims. */ -var coreJsData = root['__core-js_shared__']; - -/** Used to detect methods masquerading as native. */ -var maskSrcKey = (function() { - var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); - return uid ? ('Symbol(src)_1.' + uid) : ''; -}()); - -/** Used to resolve the decompiled source of functions. */ -var funcToString = funcProto.toString; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** Used to detect if a method is native. */ -var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' -); - -/** Built-in value references. */ -var Symbol$1 = root.Symbol, - splice = arrayProto.splice; - -/* Built-in method references that are verified to be native. */ -var Map = getNative(root, 'Map'), - nativeCreate = getNative(Object, 'create'); - -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol$1 ? Symbol$1.prototype : undefined, - symbolToString = symbolProto ? symbolProto.toString : undefined; - -/** - * Creates a hash object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function Hash(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} - -/** - * Removes all key-value entries from the hash. - * - * @private - * @name clear - * @memberOf Hash - */ -function hashClear() { - this.__data__ = nativeCreate ? nativeCreate(null) : {}; -} - -/** - * Removes `key` and its value from the hash. - * - * @private - * @name delete - * @memberOf Hash - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function hashDelete(key) { - return this.has(key) && delete this.__data__[key]; -} - -/** - * Gets the hash value for `key`. - * - * @private - * @name get - * @memberOf Hash - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function hashGet(key) { - var data = this.__data__; - if (nativeCreate) { - var result = data[key]; - return result === HASH_UNDEFINED ? undefined : result; - } - return hasOwnProperty.call(data, key) ? data[key] : undefined; -} - -/** - * Checks if a hash value for `key` exists. - * - * @private - * @name has - * @memberOf Hash - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function hashHas(key) { - var data = this.__data__; - return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); -} - -/** - * Sets the hash `key` to `value`. - * - * @private - * @name set - * @memberOf Hash - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the hash instance. - */ -function hashSet(key, value) { - var data = this.__data__; - data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; - return this; -} - -// Add methods to `Hash`. -Hash.prototype.clear = hashClear; -Hash.prototype['delete'] = hashDelete; -Hash.prototype.get = hashGet; -Hash.prototype.has = hashHas; -Hash.prototype.set = hashSet; - -/** - * Creates an list cache object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function ListCache(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} - -/** - * Removes all key-value entries from the list cache. - * - * @private - * @name clear - * @memberOf ListCache - */ -function listCacheClear() { - this.__data__ = []; -} - -/** - * Removes `key` and its value from the list cache. - * - * @private - * @name delete - * @memberOf ListCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function listCacheDelete(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - return false; - } - var lastIndex = data.length - 1; - if (index == lastIndex) { - data.pop(); - } else { - splice.call(data, index, 1); - } - return true; -} - -/** - * Gets the list cache value for `key`. - * - * @private - * @name get - * @memberOf ListCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function listCacheGet(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - return index < 0 ? undefined : data[index][1]; -} - -/** - * Checks if a list cache value for `key` exists. - * - * @private - * @name has - * @memberOf ListCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function listCacheHas(key) { - return assocIndexOf(this.__data__, key) > -1; -} - -/** - * Sets the list cache `key` to `value`. - * - * @private - * @name set - * @memberOf ListCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the list cache instance. - */ -function listCacheSet(key, value) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - data.push([key, value]); - } else { - data[index][1] = value; - } - return this; -} - -// Add methods to `ListCache`. -ListCache.prototype.clear = listCacheClear; -ListCache.prototype['delete'] = listCacheDelete; -ListCache.prototype.get = listCacheGet; -ListCache.prototype.has = listCacheHas; -ListCache.prototype.set = listCacheSet; - -/** - * Creates a map cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function MapCache(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} - -/** - * Removes all key-value entries from the map. - * - * @private - * @name clear - * @memberOf MapCache - */ -function mapCacheClear() { - this.__data__ = { - 'hash': new Hash, - 'map': new (Map || ListCache), - 'string': new Hash - }; -} - -/** - * Removes `key` and its value from the map. - * - * @private - * @name delete - * @memberOf MapCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function mapCacheDelete(key) { - return getMapData(this, key)['delete'](key); -} - -/** - * Gets the map value for `key`. - * - * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function mapCacheGet(key) { - return getMapData(this, key).get(key); -} - -/** - * Checks if a map value for `key` exists. - * - * @private - * @name has - * @memberOf MapCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function mapCacheHas(key) { - return getMapData(this, key).has(key); -} - -/** - * Sets the map `key` to `value`. - * - * @private - * @name set - * @memberOf MapCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the map cache instance. - */ -function mapCacheSet(key, value) { - getMapData(this, key).set(key, value); - return this; -} - -// Add methods to `MapCache`. -MapCache.prototype.clear = mapCacheClear; -MapCache.prototype['delete'] = mapCacheDelete; -MapCache.prototype.get = mapCacheGet; -MapCache.prototype.has = mapCacheHas; -MapCache.prototype.set = mapCacheSet; - -/** - * Gets the index at which the `key` is found in `array` of key-value pairs. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } - } - return -1; -} - -/** - * The base implementation of `_.get` without support for default values. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @returns {*} Returns the resolved value. - */ -function baseGet(object, path) { - path = isKey(path, object) ? [path] : castPath(path); - - var index = 0, - length = path.length; - - while (object != null && index < length) { - object = object[toKey(path[index++])]; - } - return (index && index == length) ? object : undefined; -} - -/** - * The base implementation of `_.isNative` without bad shim checks. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. - */ -function baseIsNative(value) { - if (!isObject(value) || isMasked(value)) { - return false; - } - var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); -} - -/** - * The base implementation of `_.toString` which doesn't convert nullish - * values to empty strings. - * - * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. - */ -function baseToString(value) { - // Exit early for strings to avoid a performance hit in some environments. - if (typeof value == 'string') { - return value; - } - if (isSymbol(value)) { - return symbolToString ? symbolToString.call(value) : ''; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; -} - -/** - * Casts `value` to a path array if it's not one. - * - * @private - * @param {*} value The value to inspect. - * @returns {Array} Returns the cast property path array. - */ -function castPath(value) { - return isArray(value) ? value : stringToPath(value); -} - -/** - * Gets the data for `map`. - * - * @private - * @param {Object} map The map to query. - * @param {string} key The reference key. - * @returns {*} Returns the map data. - */ -function getMapData(map, key) { - var data = map.__data__; - return isKeyable(key) - ? data[typeof key == 'string' ? 'string' : 'hash'] - : data.map; -} - -/** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ -function getNative(object, key) { - var value = getValue(object, key); - return baseIsNative(value) ? value : undefined; -} - -/** - * Checks if `value` is a property name and not a property path. - * - * @private - * @param {*} value The value to check. - * @param {Object} [object] The object to query keys on. - * @returns {boolean} Returns `true` if `value` is a property name, else `false`. - */ -function isKey(value, object) { - if (isArray(value)) { - return false; - } - var type = typeof value; - if (type == 'number' || type == 'symbol' || type == 'boolean' || - value == null || isSymbol(value)) { - return true; - } - return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || - (object != null && value in Object(object)); -} - -/** - * Checks if `value` is suitable for use as unique object key. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. - */ -function isKeyable(value) { - var type = typeof value; - return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') - ? (value !== '__proto__') - : (value === null); -} - -/** - * Checks if `func` has its source masked. - * - * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` is masked, else `false`. - */ -function isMasked(func) { - return !!maskSrcKey && (maskSrcKey in func); -} - -/** - * Converts `string` to a property path array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the property path array. - */ -var stringToPath = memoize(function(string) { - string = toString(string); - - var result = []; - if (reLeadingDot.test(string)) { - result.push(''); - } - string.replace(rePropName, function(match, number, quote, string) { - result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); - }); - return result; -}); - -/** - * Converts `value` to a string key if it's not a string or symbol. - * - * @private - * @param {*} value The value to inspect. - * @returns {string|symbol} Returns the key. - */ -function toKey(value) { - if (typeof value == 'string' || isSymbol(value)) { - return value; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; -} - -/** - * Converts `func` to its source code. - * - * @private - * @param {Function} func The function to process. - * @returns {string} Returns the source code. - */ -function toSource(func) { - if (func != null) { - try { - return funcToString.call(func); - } catch (e) {} - try { - return (func + ''); - } catch (e) {} - } - return ''; -} - -/** - * Creates a function that memoizes the result of `func`. If `resolver` is - * provided, it determines the cache key for storing the result based on the - * arguments provided to the memoized function. By default, the first argument - * provided to the memoized function is used as the map cache key. The `func` - * is invoked with the `this` binding of the memoized function. - * - * **Note:** The cache is exposed as the `cache` property on the memoized - * function. Its creation may be customized by replacing the `_.memoize.Cache` - * constructor with one whose instances implement the - * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) - * method interface of `delete`, `get`, `has`, and `set`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to have its output memoized. - * @param {Function} [resolver] The function to resolve the cache key. - * @returns {Function} Returns the new memoized function. - * @example - * - * var object = { 'a': 1, 'b': 2 }; - * var other = { 'c': 3, 'd': 4 }; - * - * var values = _.memoize(_.values); - * values(object); - * // => [1, 2] - * - * values(other); - * // => [3, 4] - * - * object.a = 2; - * values(object); - * // => [1, 2] - * - * // Modify the result cache. - * values.cache.set(object, ['a', 'b']); - * values(object); - * // => ['a', 'b'] - * - * // Replace `_.memoize.Cache`. - * _.memoize.Cache = WeakMap; - */ -function memoize(func, resolver) { - if (typeof func != 'function' || (resolver && typeof resolver != 'function')) { - throw new TypeError(FUNC_ERROR_TEXT); - } - var memoized = function() { - var args = arguments, - key = resolver ? resolver.apply(this, args) : args[0], - cache = memoized.cache; - - if (cache.has(key)) { - return cache.get(key); - } - var result = func.apply(this, args); - memoized.cache = cache.set(key, result); - return result; - }; - memoized.cache = new (memoize.Cache || MapCache); - return memoized; -} - -// Assign cache to `_.memoize`. -memoize.Cache = MapCache; - -/** - * Performs a - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'a': 1 }; - * var other = { 'a': 1 }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ -function eq(value, other) { - return value === other || (value !== value && other !== other); -} - -/** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ -var isArray = Array.isArray; - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a function, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8-9 which returns 'object' for typed array and other constructors. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; -} - -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && objectToString.call(value) == symbolTag); -} - -/** - * Converts `value` to a string. An empty string is returned for `null` - * and `undefined` values. The sign of `-0` is preserved. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {string} Returns the string. - * @example - * - * _.toString(null); - * // => '' - * - * _.toString(-0); - * // => '-0' - * - * _.toString([1, 2, 3]); - * // => '1,2,3' - */ -function toString(value) { - return value == null ? '' : baseToString(value); -} - -/** - * Gets the value at `path` of `object`. If the resolved value is - * `undefined`, the `defaultValue` is returned in its place. - * - * @static - * @memberOf _ - * @since 3.7.0 - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @param {*} [defaultValue] The value returned for `undefined` resolved values. - * @returns {*} Returns the resolved value. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; - * - * _.get(object, 'a[0].b.c'); - * // => 3 - * - * _.get(object, ['a', '0', 'b', 'c']); - * // => 3 - * - * _.get(object, 'a.b.c', 'default'); - * // => 'default' - */ -function get(object, path, defaultValue) { - var result = object == null ? undefined : baseGet(object, path); - return result === undefined ? defaultValue : result; -} - -var lodash_get = get; - -function getProp(obj, path, defaultValue) { - return obj[path] === undefined ? defaultValue : obj[path]; -} - -function setProp(obj, path, value) { - var pathArray = Array.isArray(path) ? path : path.split('.'); - - var _pathArray = _toArray(pathArray), - key = _pathArray[0], - restPath = _pathArray.slice(1); - - var newValue = pathArray.length > 1 ? setProp(obj[key] || {}, restPath, value) : value; - return Object.assign({}, obj, _defineProperty({}, key, newValue)); -} - -function unsetProp(obj, path) { - var pathArray = Array.isArray(path) ? path : path.split('.'); - - var _pathArray2 = _toArray(pathArray), - key = _pathArray2[0], - restPath = _pathArray2.slice(1); - - if (_typeof(obj[key]) !== 'object') { - // This will never be hit in the current code because unwind does the check before calling unsetProp - - /* istanbul ignore next */ - return obj; - } - - if (pathArray.length === 1) { - return Object.keys(obj).filter(function (prop) { - return prop !== key; - }).reduce(function (acc, prop) { - return Object.assign(acc, _defineProperty({}, prop, obj[prop])); - }, {}); - } - - return unsetProp(obj[key], restPath); -} - -function flattenReducer(acc, arr) { - try { - // This is faster but susceptible to `RangeError: Maximum call stack size exceeded` - acc.push.apply(acc, _toConsumableArray(arr)); - return acc; - } catch (err) { - // Fallback to a slower but safer option - return acc.concat(arr); - } -} - -function fastJoin(arr, separator) { - var isFirst = true; - return arr.reduce(function (acc, elem) { - if (elem === null || elem === undefined) { - elem = ''; - } - - if (isFirst) { - isFirst = false; - return "".concat(elem); - } - - return "".concat(acc).concat(separator).concat(elem); - }, ''); -} - -var utils = { - getProp: getProp, - setProp: setProp, - unsetProp: unsetProp, - fastJoin: fastJoin, - flattenReducer: flattenReducer -}; - -var getProp$1 = utils.getProp, - fastJoin$1 = utils.fastJoin, - flattenReducer$1 = utils.flattenReducer; - -var JSON2CSVBase = -/*#__PURE__*/ -function () { - function JSON2CSVBase(opts) { - _classCallCheck(this, JSON2CSVBase); - - this.opts = this.preprocessOpts(opts); - } - /** - * Check passing opts and set defaults. - * - * @param {Json2CsvOptions} opts Options object containing fields, - * delimiter, default value, quote mark, header, etc. - */ - - - _createClass(JSON2CSVBase, [{ - key: "preprocessOpts", - value: function preprocessOpts(opts) { - var processedOpts = Object.assign({}, opts); - processedOpts.transforms = !Array.isArray(processedOpts.transforms) ? processedOpts.transforms ? [processedOpts.transforms] : [] : processedOpts.transforms; - processedOpts.delimiter = processedOpts.delimiter || ','; - processedOpts.eol = processedOpts.eol || os.EOL; - processedOpts.quote = typeof processedOpts.quote === 'string' ? processedOpts.quote : '"'; - processedOpts.escapedQuote = typeof processedOpts.escapedQuote === 'string' ? processedOpts.escapedQuote : "".concat(processedOpts.quote).concat(processedOpts.quote); - processedOpts.header = processedOpts.header !== false; - processedOpts.includeEmptyRows = processedOpts.includeEmptyRows || false; - processedOpts.withBOM = processedOpts.withBOM || false; - return processedOpts; - } - /** - * Check and normalize the fields configuration. - * - * @param {(string|object)[]} fields Fields configuration provided by the user - * or inferred from the data - * @returns {object[]} preprocessed FieldsInfo array - */ - - }, { - key: "preprocessFieldsInfo", - value: function preprocessFieldsInfo(fields) { - var _this = this; - - return fields.map(function (fieldInfo) { - if (typeof fieldInfo === 'string') { - return { - label: fieldInfo, - value: fieldInfo.includes('.') || fieldInfo.includes('[') ? function (row) { - return lodash_get(row, fieldInfo, _this.opts.defaultValue); - } : function (row) { - return getProp$1(row, fieldInfo, _this.opts.defaultValue); - } - }; - } - - if (_typeof(fieldInfo) === 'object') { - var defaultValue = 'default' in fieldInfo ? fieldInfo.default : _this.opts.defaultValue; - - if (typeof fieldInfo.value === 'string') { - return { - label: fieldInfo.label || fieldInfo.value, - value: fieldInfo.value.includes('.') || fieldInfo.value.includes('[') ? function (row) { - return lodash_get(row, fieldInfo.value, defaultValue); - } : function (row) { - return getProp$1(row, fieldInfo.value, defaultValue); - } - }; - } - - if (typeof fieldInfo.value === 'function') { - var label = fieldInfo.label || fieldInfo.value.name || ''; - var field = { - label: label, - default: defaultValue - }; - return { - label: label, - value: function value(row) { - var value = fieldInfo.value(row, field); - return value === null || value === undefined ? defaultValue : value; - } - }; - } - } - - throw new Error('Invalid field info option. ' + JSON.stringify(fieldInfo)); - }); - } - /** - * Create the title row with all the provided fields as column headings - * - * @returns {String} titles as a string - */ - - }, { - key: "getHeader", - value: function getHeader() { - var _this2 = this; - - return fastJoin$1(this.opts.fields.map(function (fieldInfo) { - return _this2.processValue(fieldInfo.label); - }), this.opts.delimiter); - } - /** - * Preprocess each object according to the given transforms (unwind, flatten, etc.). - * @param {Object} row JSON object to be converted in a CSV row - */ - - }, { - key: "preprocessRow", - value: function preprocessRow(row) { - return this.opts.transforms.reduce(function (rows, transform) { - return rows.map(function (row) { - return transform(row); - }).reduce(flattenReducer$1, []); - }, [row]); - } - /** - * Create the content of a specific CSV row - * - * @param {Object} row JSON object to be converted in a CSV row - * @returns {String} CSV string (row) - */ - - }, { - key: "processRow", - value: function processRow(row) { - var _this3 = this; - - if (!row) { - return undefined; - } - - var processedRow = this.opts.fields.map(function (fieldInfo) { - return _this3.processCell(row, fieldInfo); - }); - - if (!this.opts.includeEmptyRows && processedRow.every(function (field) { - return field === undefined; - })) { - return undefined; - } - - return fastJoin$1(processedRow, this.opts.delimiter); - } - /** - * Create the content of a specfic CSV row cell - * - * @param {Object} row JSON object representing the CSV row that the cell belongs to - * @param {FieldInfo} fieldInfo Details of the field to process to be a CSV cell - * @returns {String} CSV string (cell) - */ - - }, { - key: "processCell", - value: function processCell(row, fieldInfo) { - return this.processValue(fieldInfo.value(row)); - } - /** - * Create the content of a specfic CSV row cell - * - * @param {Any} value Value to be included in a CSV cell - * @returns {String} Value stringified and processed - */ - - }, { - key: "processValue", - value: function processValue(value) { - if (value === null || value === undefined) { - return undefined; - } - - var valueType = _typeof(value); - - if (valueType !== 'boolean' && valueType !== 'number' && valueType !== 'string') { - value = JSON.stringify(value); - - if (value === undefined) { - return undefined; - } - - if (value[0] === '"') { - value = value.replace(/^"(.+)"$/, '$1'); - } - } - - if (typeof value === 'string') { - if (value.includes(this.opts.quote)) { - value = value.replace(new RegExp(this.opts.quote, 'g'), this.opts.escapedQuote); - } - - value = "".concat(this.opts.quote).concat(value).concat(this.opts.quote); - - if (this.opts.excelStrings) { - value = "\"=\"".concat(value, "\"\""); - } - } - - return value; - } - }]); - - return JSON2CSVBase; -}(); - -var JSON2CSVBase_1 = JSON2CSVBase; - -var fastJoin$2 = utils.fastJoin, - flattenReducer$2 = utils.flattenReducer; - -var JSON2CSVParser = -/*#__PURE__*/ -function (_JSON2CSVBase) { - _inherits(JSON2CSVParser, _JSON2CSVBase); - - function JSON2CSVParser(opts) { - var _this; - - _classCallCheck(this, JSON2CSVParser); - - _this = _possibleConstructorReturn(this, _getPrototypeOf(JSON2CSVParser).call(this, opts)); - - if (_this.opts.fields) { - _this.opts.fields = _this.preprocessFieldsInfo(_this.opts.fields); - } - - return _this; - } - /** - * Main function that converts json to csv. - * - * @param {Array|Object} data Array of JSON objects to be converted to CSV - * @returns {String} The CSV formated data as a string - */ - - - _createClass(JSON2CSVParser, [{ - key: "parse", - value: function parse(data) { - var processedData = this.preprocessData(data); - - if (!this.opts.fields) { - this.opts.fields = processedData.reduce(function (fields, item) { - Object.keys(item).forEach(function (field) { - if (!fields.includes(field)) { - fields.push(field); - } - }); - return fields; - }, []); - this.opts.fields = this.preprocessFieldsInfo(this.opts.fields); - } - - var header = this.opts.header ? this.getHeader() : ''; - var rows = this.processData(processedData); - var csv = (this.opts.withBOM ? "\uFEFF" : '') + header + (header && rows ? this.opts.eol : '') + rows; - return csv; - } - /** - * Preprocess the data according to the give opts (unwind, flatten, etc.) - and calculate the fields and field names if they are not provided. - * - * @param {Array|Object} data Array or object to be converted to CSV - */ - - }, { - key: "preprocessData", - value: function preprocessData(data) { - var _this2 = this; - - var processedData = Array.isArray(data) ? data : [data]; - - if (!this.opts.fields && (processedData.length === 0 || _typeof(processedData[0]) !== 'object')) { - throw new Error('Data should not be empty or the "fields" option should be included'); - } - - if (this.opts.transforms.length === 0) return processedData; - return processedData.map(function (row) { - return _this2.preprocessRow(row); - }).reduce(flattenReducer$2, []); - } - /** - * Create the content row by row below the header - * - * @param {Array} data Array of JSON objects to be converted to CSV - * @returns {String} CSV string (body) - */ - - }, { - key: "processData", - value: function processData(data) { - var _this3 = this; - - return fastJoin$2(data.map(function (row) { - return _this3.processRow(row); - }).filter(function (row) { - return row; - }), // Filter empty rows - this.opts.eol); - } - }]); - - return JSON2CSVParser; -}(JSON2CSVBase_1); - -var JSON2CSVParser_1 = JSON2CSVParser; - -/*global Buffer*/ -// Named constants with unique integer values -var C = {}; -// Tokens -var LEFT_BRACE = C.LEFT_BRACE = 0x1; -var RIGHT_BRACE = C.RIGHT_BRACE = 0x2; -var LEFT_BRACKET = C.LEFT_BRACKET = 0x3; -var RIGHT_BRACKET = C.RIGHT_BRACKET = 0x4; -var COLON = C.COLON = 0x5; -var COMMA = C.COMMA = 0x6; -var TRUE = C.TRUE = 0x7; -var FALSE = C.FALSE = 0x8; -var NULL = C.NULL = 0x9; -var STRING = C.STRING = 0xa; -var NUMBER = C.NUMBER = 0xb; -// Tokenizer States -var START = C.START = 0x11; -var STOP = C.STOP = 0x12; -var TRUE1 = C.TRUE1 = 0x21; -var TRUE2 = C.TRUE2 = 0x22; -var TRUE3 = C.TRUE3 = 0x23; -var FALSE1 = C.FALSE1 = 0x31; -var FALSE2 = C.FALSE2 = 0x32; -var FALSE3 = C.FALSE3 = 0x33; -var FALSE4 = C.FALSE4 = 0x34; -var NULL1 = C.NULL1 = 0x41; -var NULL2 = C.NULL2 = 0x42; -var NULL3 = C.NULL3 = 0x43; -var NUMBER1 = C.NUMBER1 = 0x51; -var NUMBER3 = C.NUMBER3 = 0x53; -var STRING1 = C.STRING1 = 0x61; -var STRING2 = C.STRING2 = 0x62; -var STRING3 = C.STRING3 = 0x63; -var STRING4 = C.STRING4 = 0x64; -var STRING5 = C.STRING5 = 0x65; -var STRING6 = C.STRING6 = 0x66; -// Parser States -var VALUE = C.VALUE = 0x71; -var KEY = C.KEY = 0x72; -// Parser Modes -var OBJECT = C.OBJECT = 0x81; -var ARRAY = C.ARRAY = 0x82; -// Character constants -var BACK_SLASH = "\\".charCodeAt(0); -var FORWARD_SLASH = "\/".charCodeAt(0); -var BACKSPACE = "\b".charCodeAt(0); -var FORM_FEED = "\f".charCodeAt(0); -var NEWLINE = "\n".charCodeAt(0); -var CARRIAGE_RETURN = "\r".charCodeAt(0); -var TAB = "\t".charCodeAt(0); - -var STRING_BUFFER_SIZE = 64 * 1024; - -function Parser() { - this.tState = START; - this.value = undefined; - - this.string = undefined; // string data - this.stringBuffer = Buffer.alloc ? Buffer.alloc(STRING_BUFFER_SIZE) : new Buffer(STRING_BUFFER_SIZE); - this.stringBufferOffset = 0; - this.unicode = undefined; // unicode escapes - this.highSurrogate = undefined; - - this.key = undefined; - this.mode = undefined; - this.stack = []; - this.state = VALUE; - this.bytes_remaining = 0; // number of bytes remaining in multi byte utf8 char to read after split boundary - this.bytes_in_sequence = 0; // bytes in multi byte utf8 char to read - this.temp_buffs = { "2": new Buffer(2), "3": new Buffer(3), "4": new Buffer(4) }; // for rebuilding chars split before boundary is reached - - // Stream offset - this.offset = -1; -} - -// Slow code to string converter (only used when throwing syntax errors) -Parser.toknam = function (code) { - var keys = Object.keys(C); - for (var i = 0, l = keys.length; i < l; i++) { - var key = keys[i]; - if (C[key] === code) { return key; } - } - return code && ("0x" + code.toString(16)); -}; - -var proto = Parser.prototype; -proto.onError = function (err) { throw err; }; -proto.charError = function (buffer, i) { - this.tState = STOP; - this.onError(new Error("Unexpected " + JSON.stringify(String.fromCharCode(buffer[i])) + " at position " + i + " in state " + Parser.toknam(this.tState))); -}; -proto.appendStringChar = function (char) { - if (this.stringBufferOffset >= STRING_BUFFER_SIZE) { - this.string += this.stringBuffer.toString('utf8'); - this.stringBufferOffset = 0; - } - - this.stringBuffer[this.stringBufferOffset++] = char; -}; -proto.appendStringBuf = function (buf, start, end) { - var size = buf.length; - if (typeof start === 'number') { - if (typeof end === 'number') { - if (end < 0) { - // adding a negative end decreeses the size - size = buf.length - start + end; - } else { - size = end - start; - } - } else { - size = buf.length - start; - } - } - - if (size < 0) { - size = 0; - } - - if (this.stringBufferOffset + size > STRING_BUFFER_SIZE) { - this.string += this.stringBuffer.toString('utf8', 0, this.stringBufferOffset); - this.stringBufferOffset = 0; - } - - buf.copy(this.stringBuffer, this.stringBufferOffset, start, end); - this.stringBufferOffset += size; -}; -proto.write = function (buffer) { - if (typeof buffer === "string") buffer = new Buffer(buffer); - var n; - for (var i = 0, l = buffer.length; i < l; i++) { - if (this.tState === START){ - n = buffer[i]; - this.offset++; - if(n === 0x7b){ this.onToken(LEFT_BRACE, "{"); // { - }else if(n === 0x7d){ this.onToken(RIGHT_BRACE, "}"); // } - }else if(n === 0x5b){ this.onToken(LEFT_BRACKET, "["); // [ - }else if(n === 0x5d){ this.onToken(RIGHT_BRACKET, "]"); // ] - }else if(n === 0x3a){ this.onToken(COLON, ":"); // : - }else if(n === 0x2c){ this.onToken(COMMA, ","); // , - }else if(n === 0x74){ this.tState = TRUE1; // t - }else if(n === 0x66){ this.tState = FALSE1; // f - }else if(n === 0x6e){ this.tState = NULL1; // n - }else if(n === 0x22){ // " - this.string = ""; - this.stringBufferOffset = 0; - this.tState = STRING1; - }else if(n === 0x2d){ this.string = "-"; this.tState = NUMBER1; // - - }else{ - if (n >= 0x30 && n < 0x40) { // 1-9 - this.string = String.fromCharCode(n); this.tState = NUMBER3; - } else if (n === 0x20 || n === 0x09 || n === 0x0a || n === 0x0d) ; else { - return this.charError(buffer, i); - } - } - }else if (this.tState === STRING1){ // After open quote - n = buffer[i]; // get current byte from buffer - // check for carry over of a multi byte char split between data chunks - // & fill temp buffer it with start of this data chunk up to the boundary limit set in the last iteration - if (this.bytes_remaining > 0) { - for (var j = 0; j < this.bytes_remaining; j++) { - this.temp_buffs[this.bytes_in_sequence][this.bytes_in_sequence - this.bytes_remaining + j] = buffer[j]; - } - - this.appendStringBuf(this.temp_buffs[this.bytes_in_sequence]); - this.bytes_in_sequence = this.bytes_remaining = 0; - i = i + j - 1; - } else if (this.bytes_remaining === 0 && n >= 128) { // else if no remainder bytes carried over, parse multi byte (>=128) chars one at a time - if (n <= 193 || n > 244) { - return this.onError(new Error("Invalid UTF-8 character at position " + i + " in state " + Parser.toknam(this.tState))); - } - if ((n >= 194) && (n <= 223)) this.bytes_in_sequence = 2; - if ((n >= 224) && (n <= 239)) this.bytes_in_sequence = 3; - if ((n >= 240) && (n <= 244)) this.bytes_in_sequence = 4; - if ((this.bytes_in_sequence + i) > buffer.length) { // if bytes needed to complete char fall outside buffer length, we have a boundary split - for (var k = 0; k <= (buffer.length - 1 - i); k++) { - this.temp_buffs[this.bytes_in_sequence][k] = buffer[i + k]; // fill temp buffer of correct size with bytes available in this chunk - } - this.bytes_remaining = (i + this.bytes_in_sequence) - buffer.length; - i = buffer.length - 1; - } else { - this.appendStringBuf(buffer, i, i + this.bytes_in_sequence); - i = i + this.bytes_in_sequence - 1; - } - } else if (n === 0x22) { - this.tState = START; - this.string += this.stringBuffer.toString('utf8', 0, this.stringBufferOffset); - this.stringBufferOffset = 0; - this.onToken(STRING, this.string); - this.offset += Buffer.byteLength(this.string, 'utf8') + 1; - this.string = undefined; - } - else if (n === 0x5c) { - this.tState = STRING2; - } - else if (n >= 0x20) { this.appendStringChar(n); } - else { - return this.charError(buffer, i); - } - }else if (this.tState === STRING2){ // After backslash - n = buffer[i]; - if(n === 0x22){ this.appendStringChar(n); this.tState = STRING1; - }else if(n === 0x5c){ this.appendStringChar(BACK_SLASH); this.tState = STRING1; - }else if(n === 0x2f){ this.appendStringChar(FORWARD_SLASH); this.tState = STRING1; - }else if(n === 0x62){ this.appendStringChar(BACKSPACE); this.tState = STRING1; - }else if(n === 0x66){ this.appendStringChar(FORM_FEED); this.tState = STRING1; - }else if(n === 0x6e){ this.appendStringChar(NEWLINE); this.tState = STRING1; - }else if(n === 0x72){ this.appendStringChar(CARRIAGE_RETURN); this.tState = STRING1; - }else if(n === 0x74){ this.appendStringChar(TAB); this.tState = STRING1; - }else if(n === 0x75){ this.unicode = ""; this.tState = STRING3; - }else{ - return this.charError(buffer, i); - } - }else if (this.tState === STRING3 || this.tState === STRING4 || this.tState === STRING5 || this.tState === STRING6){ // unicode hex codes - n = buffer[i]; - // 0-9 A-F a-f - if ((n >= 0x30 && n < 0x40) || (n > 0x40 && n <= 0x46) || (n > 0x60 && n <= 0x66)) { - this.unicode += String.fromCharCode(n); - if (this.tState++ === STRING6) { - var intVal = parseInt(this.unicode, 16); - this.unicode = undefined; - if (this.highSurrogate !== undefined && intVal >= 0xDC00 && intVal < (0xDFFF + 1)) { //<56320,57343> - lowSurrogate - this.appendStringBuf(new Buffer(String.fromCharCode(this.highSurrogate, intVal))); - this.highSurrogate = undefined; - } else if (this.highSurrogate === undefined && intVal >= 0xD800 && intVal < (0xDBFF + 1)) { //<55296,56319> - highSurrogate - this.highSurrogate = intVal; - } else { - if (this.highSurrogate !== undefined) { - this.appendStringBuf(new Buffer(String.fromCharCode(this.highSurrogate))); - this.highSurrogate = undefined; - } - this.appendStringBuf(new Buffer(String.fromCharCode(intVal))); - } - this.tState = STRING1; - } - } else { - return this.charError(buffer, i); - } - } else if (this.tState === NUMBER1 || this.tState === NUMBER3) { - n = buffer[i]; - - switch (n) { - case 0x30: // 0 - case 0x31: // 1 - case 0x32: // 2 - case 0x33: // 3 - case 0x34: // 4 - case 0x35: // 5 - case 0x36: // 6 - case 0x37: // 7 - case 0x38: // 8 - case 0x39: // 9 - case 0x2e: // . - case 0x65: // e - case 0x45: // E - case 0x2b: // + - case 0x2d: // - - this.string += String.fromCharCode(n); - this.tState = NUMBER3; - break; - default: - this.tState = START; - var result = Number(this.string); - - if (isNaN(result)){ - return this.charError(buffer, i); - } - - if ((this.string.match(/[0-9]+/) == this.string) && (result.toString() != this.string)) { - // Long string of digits which is an ID string and not valid and/or safe JavaScript integer Number - this.onToken(STRING, this.string); - } else { - this.onToken(NUMBER, result); - } - - this.offset += this.string.length - 1; - this.string = undefined; - i--; - break; - } - }else if (this.tState === TRUE1){ // r - if (buffer[i] === 0x72) { this.tState = TRUE2; } - else { return this.charError(buffer, i); } - }else if (this.tState === TRUE2){ // u - if (buffer[i] === 0x75) { this.tState = TRUE3; } - else { return this.charError(buffer, i); } - }else if (this.tState === TRUE3){ // e - if (buffer[i] === 0x65) { this.tState = START; this.onToken(TRUE, true); this.offset+= 3; } - else { return this.charError(buffer, i); } - }else if (this.tState === FALSE1){ // a - if (buffer[i] === 0x61) { this.tState = FALSE2; } - else { return this.charError(buffer, i); } - }else if (this.tState === FALSE2){ // l - if (buffer[i] === 0x6c) { this.tState = FALSE3; } - else { return this.charError(buffer, i); } - }else if (this.tState === FALSE3){ // s - if (buffer[i] === 0x73) { this.tState = FALSE4; } - else { return this.charError(buffer, i); } - }else if (this.tState === FALSE4){ // e - if (buffer[i] === 0x65) { this.tState = START; this.onToken(FALSE, false); this.offset+= 4; } - else { return this.charError(buffer, i); } - }else if (this.tState === NULL1){ // u - if (buffer[i] === 0x75) { this.tState = NULL2; } - else { return this.charError(buffer, i); } - }else if (this.tState === NULL2){ // l - if (buffer[i] === 0x6c) { this.tState = NULL3; } - else { return this.charError(buffer, i); } - }else if (this.tState === NULL3){ // l - if (buffer[i] === 0x6c) { this.tState = START; this.onToken(NULL, null); this.offset += 3; } - else { return this.charError(buffer, i); } - } - } -}; -proto.onToken = function (token, value) { - // Override this to get events -}; - -proto.parseError = function (token, value) { - this.tState = STOP; - this.onError(new Error("Unexpected " + Parser.toknam(token) + (value ? ("(" + JSON.stringify(value) + ")") : "") + " in state " + Parser.toknam(this.state))); -}; -proto.push = function () { - this.stack.push({value: this.value, key: this.key, mode: this.mode}); -}; -proto.pop = function () { - var value = this.value; - var parent = this.stack.pop(); - this.value = parent.value; - this.key = parent.key; - this.mode = parent.mode; - this.emit(value); - if (!this.mode) { this.state = VALUE; } -}; -proto.emit = function (value) { - if (this.mode) { this.state = COMMA; } - this.onValue(value); -}; -proto.onValue = function (value) { - // Override me -}; -proto.onToken = function (token, value) { - if(this.state === VALUE){ - if(token === STRING || token === NUMBER || token === TRUE || token === FALSE || token === NULL){ - if (this.value) { - this.value[this.key] = value; - } - this.emit(value); - }else if(token === LEFT_BRACE){ - this.push(); - if (this.value) { - this.value = this.value[this.key] = {}; - } else { - this.value = {}; - } - this.key = undefined; - this.state = KEY; - this.mode = OBJECT; - }else if(token === LEFT_BRACKET){ - this.push(); - if (this.value) { - this.value = this.value[this.key] = []; - } else { - this.value = []; - } - this.key = 0; - this.mode = ARRAY; - this.state = VALUE; - }else if(token === RIGHT_BRACE){ - if (this.mode === OBJECT) { - this.pop(); - } else { - return this.parseError(token, value); - } - }else if(token === RIGHT_BRACKET){ - if (this.mode === ARRAY) { - this.pop(); - } else { - return this.parseError(token, value); - } - }else{ - return this.parseError(token, value); - } - }else if(this.state === KEY){ - if (token === STRING) { - this.key = value; - this.state = COLON; - } else if (token === RIGHT_BRACE) { - this.pop(); - } else { - return this.parseError(token, value); - } - }else if(this.state === COLON){ - if (token === COLON) { this.state = VALUE; } - else { return this.parseError(token, value); } - }else if(this.state === COMMA){ - if (token === COMMA) { - if (this.mode === ARRAY) { this.key++; this.state = VALUE; } - else if (this.mode === OBJECT) { this.state = KEY; } - - } else if (token === RIGHT_BRACKET && this.mode === ARRAY || token === RIGHT_BRACE && this.mode === OBJECT) { - this.pop(); - } else { - return this.parseError(token, value); - } - }else{ - return this.parseError(token, value); - } -}; - -Parser.C = C; - -var jsonparse = Parser; - -var Transform = stream.Transform; - -var JSON2CSVTransform = -/*#__PURE__*/ -function (_Transform) { - _inherits(JSON2CSVTransform, _Transform); - - function JSON2CSVTransform(opts, transformOpts) { - var _this; - - _classCallCheck(this, JSON2CSVTransform); - - _this = _possibleConstructorReturn(this, _getPrototypeOf(JSON2CSVTransform).call(this, transformOpts)); // Inherit methods from JSON2CSVBase since extends doesn't - // allow multiple inheritance and manually preprocess opts - - Object.getOwnPropertyNames(JSON2CSVBase_1.prototype).forEach(function (key) { - return _this[key] = JSON2CSVBase_1.prototype[key]; - }); - _this.opts = _this.preprocessOpts(opts); - _this._data = ''; - _this._hasWritten = false; - - if (_this._readableState.objectMode) { - _this.initObjectModeParse(); - } else if (_this.opts.ndjson) { - _this.initNDJSONParse(); - } else { - _this.initJSONParser(); - } - - if (_this.opts.withBOM) { - _this.push("\uFEFF"); - } - - if (_this.opts.fields) { - _this.opts.fields = _this.preprocessFieldsInfo(_this.opts.fields); - - _this.pushHeader(); - } - - return _this; - } - /** - * Init the transform with a parser to process data in object mode. - * It receives JSON objects one by one and send them to `pushLine for processing. - */ - - - _createClass(JSON2CSVTransform, [{ - key: "initObjectModeParse", - value: function initObjectModeParse() { - var transform = this; - this.parser = { - write: function write(line) { - transform.pushLine(line); - }, - getPendingData: function getPendingData() { - return undefined; - } - }; - } - /** - * Init the transform with a parser to process NDJSON data. - * It maintains a buffer of received data, parses each line - * as JSON and send it to `pushLine for processing. - */ - - }, { - key: "initNDJSONParse", - value: function initNDJSONParse() { - var transform = this; - this.parser = { - _data: '', - write: function write(chunk) { - this._data += chunk.toString(); - - var lines = this._data.split('\n').map(function (line) { - return line.trim(); - }).filter(function (line) { - return line !== ''; - }); - - var pendingData = false; - lines.forEach(function (line, i) { - try { - transform.pushLine(JSON.parse(line)); - } catch (e) { - if (i === lines.length - 1) { - pendingData = true; - } else { - e.message = "Invalid JSON (".concat(line, ")"); - transform.emit('error', e); - } - } - }); - this._data = pendingData ? this._data.slice(this._data.lastIndexOf('\n')) : ''; - }, - getPendingData: function getPendingData() { - return this._data; - } - }; - } - /** - * Init the transform with a parser to process JSON data. - * It maintains a buffer of received data, parses each as JSON - * item if the data is an array or the data itself otherwise - * and send it to `pushLine` for processing. - */ - - }, { - key: "initJSONParser", - value: function initJSONParser() { - var transform = this; - this.parser = new jsonparse(); - - this.parser.onValue = function (value) { - if (this.stack.length !== this.depthToEmit) return; - transform.pushLine(value); - }; - - this.parser._onToken = this.parser.onToken; - - this.parser.onToken = function (token, value) { - transform.parser._onToken(token, value); - - if (this.stack.length === 0 && !transform.opts.fields && this.mode !== jsonparse.C.ARRAY && this.mode !== jsonparse.C.OBJECT) { - this.onError(new Error('Data should not be empty or the "fields" option should be included')); - } - - if (this.stack.length === 1) { - if (this.depthToEmit === undefined) { - // If Array emit its content, else emit itself - this.depthToEmit = this.mode === jsonparse.C.ARRAY ? 1 : 0; - } - - if (this.depthToEmit !== 0 && this.stack.length === 1) { - // No need to store the whole root array in memory - this.value = undefined; - } - } - }; - - this.parser.getPendingData = function () { - return this.value; - }; - - this.parser.onError = function (err) { - if (err.message.includes('Unexpected')) { - err.message = "Invalid JSON (".concat(err.message, ")"); - } - - transform.emit('error', err); - }; - } - /** - * Main function that send data to the parse to be processed. - * - * @param {Buffer} chunk Incoming data - * @param {String} encoding Encoding of the incoming data. Defaults to 'utf8' - * @param {Function} done Called when the proceesing of the supplied chunk is done - */ - - }, { - key: "_transform", - value: function _transform(chunk, encoding, done) { - this.parser.write(chunk); - done(); - } - }, { - key: "_flush", - value: function _flush(done) { - if (this.parser.getPendingData()) { - done(new Error('Invalid data received from stdin', this.parser.getPendingData())); - } - - done(); - } - /** - * Generate the csv header and pushes it downstream. - */ - - }, { - key: "pushHeader", - value: function pushHeader() { - if (this.opts.header) { - var header = this.getHeader(); - this.emit('header', header); - this.push(header); - this._hasWritten = true; - } - } - /** - * Transforms an incoming json data to csv and pushes it downstream. - * - * @param {Object} data JSON object to be converted in a CSV row - */ - - }, { - key: "pushLine", - value: function pushLine(data) { - var _this2 = this; - - var processedData = this.preprocessRow(data); - - if (!this._hasWritten) { - this.opts.fields = this.opts.fields || this.preprocessFieldsInfo(Object.keys(processedData[0])); - this.pushHeader(); - } - - processedData.forEach(function (row) { - var line = _this2.processRow(row, _this2.opts); - - if (line === undefined) return; - - _this2.emit('line', line); - - _this2.push(_this2._hasWritten ? _this2.opts.eol + line : line); - - _this2._hasWritten = true; - }); - } - }]); - - return JSON2CSVTransform; -}(Transform); - -var JSON2CSVTransform_1 = JSON2CSVTransform; - -var Transform$1 = stream.Transform; -var fastJoin$3 = utils.fastJoin; - -var JSON2CSVAsyncParser = -/*#__PURE__*/ -function () { - function JSON2CSVAsyncParser(opts, transformOpts) { - _classCallCheck(this, JSON2CSVAsyncParser); - - this.input = new Transform$1(transformOpts); - - this.input._read = function () {}; - - this.transform = new JSON2CSVTransform_1(opts, transformOpts); - this.processor = this.input.pipe(this.transform); - } - - _createClass(JSON2CSVAsyncParser, [{ - key: "fromInput", - value: function fromInput(input) { - if (this._input) { - throw new Error('Async parser already has an input.'); - } - - this._input = input; - this.input = this._input.pipe(this.processor); - return this; - } - }, { - key: "throughTransform", - value: function throughTransform(transform) { - if (this._output) { - throw new Error('Can\'t add transforms once an output has been added.'); - } - - this.processor = this.processor.pipe(transform); - return this; - } - }, { - key: "toOutput", - value: function toOutput(output) { - if (this._output) { - throw new Error('Async parser already has an output.'); - } - - this._output = output; - this.processor = this.processor.pipe(output); - return this; - } - }, { - key: "promise", - value: function promise() { - var _this = this; - - var returnCSV = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; - return new Promise(function (resolve, reject) { - if (!returnCSV) { - _this.processor.on('finish', function () { - return resolve(); - }).on('error', function (err) { - return reject(err); - }); - - return; - } - - var csvBuffer = []; - - _this.processor.on('data', function (chunk) { - return csvBuffer.push(chunk.toString()); - }).on('finish', function () { - return resolve(fastJoin$3(csvBuffer, '')); - }).on('error', function (err) { - return reject(err); - }); - }); - } - }]); - - return JSON2CSVAsyncParser; -}(); - -var JSON2CSVAsyncParser_1 = JSON2CSVAsyncParser; - -/** - * Performs the flattening of a data row recursively - * - * @param {String} separator Separator to be used as the flattened field name - * @returns {Object => Object} Flattened object - */ -function flatten() { - var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, - _ref$objects = _ref.objects, - objects = _ref$objects === void 0 ? true : _ref$objects, - _ref$arrays = _ref.arrays, - arrays = _ref$arrays === void 0 ? false : _ref$arrays, - _ref$separator = _ref.separator, - separator = _ref$separator === void 0 ? '.' : _ref$separator; - - function step(obj, flatDataRow, currentPath) { - Object.keys(obj).forEach(function (key) { - var newPath = currentPath ? "".concat(currentPath).concat(separator).concat(key) : key; - var value = obj[key]; - - if (objects && _typeof(value) === 'object' && value !== null && !Array.isArray(value) && Object.prototype.toString.call(value.toJSON) !== '[object Function]' && Object.keys(value).length) { - step(value, flatDataRow, newPath); - return; - } - - if (arrays && Array.isArray(value)) { - step(value, flatDataRow, newPath); - return; - } - - flatDataRow[newPath] = value; - }); - return flatDataRow; - } - - return function (dataRow) { - return step(dataRow, {}); - }; -} - -var flatten_1 = flatten; - -var setProp$1 = utils.setProp, - unsetProp$1 = utils.unsetProp, - flattenReducer$3 = utils.flattenReducer; - -function getUnwindablePaths(obj, currentPath) { - return Object.keys(obj).reduce(function (unwindablePaths, key) { - var newPath = currentPath ? "".concat(currentPath, ".").concat(key) : key; - var value = obj[key]; - - if (_typeof(value) === 'object' && value !== null && !Array.isArray(value) && Object.prototype.toString.call(value.toJSON) !== '[object Function]' && Object.keys(value).length) { - unwindablePaths = unwindablePaths.concat(getUnwindablePaths(value, newPath)); - } else if (Array.isArray(value)) { - unwindablePaths.push(newPath); - unwindablePaths = unwindablePaths.concat(value.map(function (arrObj) { - return getUnwindablePaths(arrObj, newPath); - }).reduce(flattenReducer$3, []).filter(function (item, index, arr) { - return arr.indexOf(item) !== index; - })); - } - - return unwindablePaths; - }, []); -} -/** - * Performs the unwind recursively in specified sequence - * - * @param {String[]} unwindPaths The paths as strings to be used to deconstruct the array - * @returns {Object => Array} Array of objects containing all rows after unwind of chosen paths -*/ - - -function unwind() { - var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, - _ref$paths = _ref.paths, - paths = _ref$paths === void 0 ? undefined : _ref$paths, - _ref$blankOut = _ref.blankOut, - blankOut = _ref$blankOut === void 0 ? false : _ref$blankOut; - - function unwindReducer(rows, unwindPath) { - return rows.map(function (row) { - var unwindArray = lodash_get(row, unwindPath); - - if (!Array.isArray(unwindArray)) { - return row; - } - - if (!unwindArray.length) { - return unsetProp$1(row, unwindPath); - } - - return unwindArray.map(function (unwindRow, index) { - var clonedRow = blankOut && index > 0 ? {} : row; - return setProp$1(clonedRow, unwindPath, unwindRow); - }); - }).reduce(flattenReducer$3, []); - } - - paths = Array.isArray(paths) ? paths : paths ? [paths] : undefined; - return function (dataRow) { - return (paths || getUnwindablePaths(dataRow)).reduce(unwindReducer, [dataRow]); - }; -} - -var unwind_1 = unwind; - -var Readable = stream.Readable; -var Parser$1 = JSON2CSVParser_1; -var AsyncParser = JSON2CSVAsyncParser_1; -var Transform$2 = JSON2CSVTransform_1; // Convenience method to keep the API similar to version 3.X - -var parse = function parse(data, opts) { - return new JSON2CSVParser_1(opts).parse(data); -}; - -var parseAsync = function parseAsync(data, opts, transformOpts) { - try { - if (!(data instanceof Readable)) { - transformOpts = Object.assign({}, transformOpts, { - objectMode: true - }); - } - - var asyncParser = new JSON2CSVAsyncParser_1(opts, transformOpts); - var promise = asyncParser.promise(); - - if (Array.isArray(data)) { - data.forEach(function (item) { - return asyncParser.input.push(item); - }); - asyncParser.input.push(null); - } else if (data instanceof Readable) { - asyncParser.fromInput(data); - } else { - asyncParser.input.push(data); - asyncParser.input.push(null); - } - - return promise; - } catch (err) { - return Promise.reject(err); - } -}; - -var transforms = { - flatten: flatten_1, - unwind: unwind_1 -}; -var json2csv = { - Parser: Parser$1, - AsyncParser: AsyncParser, - Transform: Transform$2, - parse: parse, - parseAsync: parseAsync, - transforms: transforms -}; - -export default json2csv; -export { AsyncParser, Parser$1 as Parser, Transform$2 as Transform, parse, parseAsync, transforms }; diff --git a/node_modules/json2csv/dist/json2csv.umd.js b/node_modules/json2csv/dist/json2csv.umd.js deleted file mode 100644 index ce1803c..0000000 --- a/node_modules/json2csv/dist/json2csv.umd.js +++ /dev/null @@ -1,7424 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : - typeof define === 'function' && define.amd ? define(['exports'], factory) : - (global = global || self, factory(global.json2csv = {})); -}(this, function (exports) { 'use strict'; - - var domain; - - // This constructor is used to store event handlers. Instantiating this is - // faster than explicitly calling `Object.create(null)` to get a "clean" empty - // object (tested with v8 v4.9). - function EventHandlers() {} - EventHandlers.prototype = Object.create(null); - - function EventEmitter() { - EventEmitter.init.call(this); - } - - // nodejs oddity - // require('events') === require('events').EventEmitter - EventEmitter.EventEmitter = EventEmitter; - - EventEmitter.usingDomains = false; - - EventEmitter.prototype.domain = undefined; - EventEmitter.prototype._events = undefined; - EventEmitter.prototype._maxListeners = undefined; - - // By default EventEmitters will print a warning if more than 10 listeners are - // added to it. This is a useful default which helps finding memory leaks. - EventEmitter.defaultMaxListeners = 10; - - EventEmitter.init = function() { - this.domain = null; - if (EventEmitter.usingDomains) { - // if there is an active domain, then attach to it. - if (domain.active && !(this instanceof domain.Domain)) ; - } - - if (!this._events || this._events === Object.getPrototypeOf(this)._events) { - this._events = new EventHandlers(); - this._eventsCount = 0; - } - - this._maxListeners = this._maxListeners || undefined; - }; - - // Obviously not all Emitters should be limited to 10. This function allows - // that to be increased. Set to zero for unlimited. - EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) { - if (typeof n !== 'number' || n < 0 || isNaN(n)) - throw new TypeError('"n" argument must be a positive number'); - this._maxListeners = n; - return this; - }; - - function $getMaxListeners(that) { - if (that._maxListeners === undefined) - return EventEmitter.defaultMaxListeners; - return that._maxListeners; - } - - EventEmitter.prototype.getMaxListeners = function getMaxListeners() { - return $getMaxListeners(this); - }; - - // These standalone emit* functions are used to optimize calling of event - // handlers for fast cases because emit() itself often has a variable number of - // arguments and can be deoptimized because of that. These functions always have - // the same number of arguments and thus do not get deoptimized, so the code - // inside them can execute faster. - function emitNone(handler, isFn, self) { - if (isFn) - handler.call(self); - else { - var len = handler.length; - var listeners = arrayClone(handler, len); - for (var i = 0; i < len; ++i) - listeners[i].call(self); - } - } - function emitOne(handler, isFn, self, arg1) { - if (isFn) - handler.call(self, arg1); - else { - var len = handler.length; - var listeners = arrayClone(handler, len); - for (var i = 0; i < len; ++i) - listeners[i].call(self, arg1); - } - } - function emitTwo(handler, isFn, self, arg1, arg2) { - if (isFn) - handler.call(self, arg1, arg2); - else { - var len = handler.length; - var listeners = arrayClone(handler, len); - for (var i = 0; i < len; ++i) - listeners[i].call(self, arg1, arg2); - } - } - function emitThree(handler, isFn, self, arg1, arg2, arg3) { - if (isFn) - handler.call(self, arg1, arg2, arg3); - else { - var len = handler.length; - var listeners = arrayClone(handler, len); - for (var i = 0; i < len; ++i) - listeners[i].call(self, arg1, arg2, arg3); - } - } - - function emitMany(handler, isFn, self, args) { - if (isFn) - handler.apply(self, args); - else { - var len = handler.length; - var listeners = arrayClone(handler, len); - for (var i = 0; i < len; ++i) - listeners[i].apply(self, args); - } - } - - EventEmitter.prototype.emit = function emit(type) { - var er, handler, len, args, i, events, domain; - var doError = (type === 'error'); - - events = this._events; - if (events) - doError = (doError && events.error == null); - else if (!doError) - return false; - - domain = this.domain; - - // If there is no 'error' event listener then throw. - if (doError) { - er = arguments[1]; - if (domain) { - if (!er) - er = new Error('Uncaught, unspecified "error" event'); - er.domainEmitter = this; - er.domain = domain; - er.domainThrown = false; - domain.emit('error', er); - } else if (er instanceof Error) { - throw er; // Unhandled 'error' event - } else { - // At least give some kind of context to the user - var err = new Error('Uncaught, unspecified "error" event. (' + er + ')'); - err.context = er; - throw err; - } - return false; - } - - handler = events[type]; - - if (!handler) - return false; - - var isFn = typeof handler === 'function'; - len = arguments.length; - switch (len) { - // fast cases - case 1: - emitNone(handler, isFn, this); - break; - case 2: - emitOne(handler, isFn, this, arguments[1]); - break; - case 3: - emitTwo(handler, isFn, this, arguments[1], arguments[2]); - break; - case 4: - emitThree(handler, isFn, this, arguments[1], arguments[2], arguments[3]); - break; - // slower - default: - args = new Array(len - 1); - for (i = 1; i < len; i++) - args[i - 1] = arguments[i]; - emitMany(handler, isFn, this, args); - } - - return true; - }; - - function _addListener(target, type, listener, prepend) { - var m; - var events; - var existing; - - if (typeof listener !== 'function') - throw new TypeError('"listener" argument must be a function'); - - events = target._events; - if (!events) { - events = target._events = new EventHandlers(); - target._eventsCount = 0; - } else { - // To avoid recursion in the case that type === "newListener"! Before - // adding it to the listeners, first emit "newListener". - if (events.newListener) { - target.emit('newListener', type, - listener.listener ? listener.listener : listener); - - // Re-assign `events` because a newListener handler could have caused the - // this._events to be assigned to a new object - events = target._events; - } - existing = events[type]; - } - - if (!existing) { - // Optimize the case of one listener. Don't need the extra array object. - existing = events[type] = listener; - ++target._eventsCount; - } else { - if (typeof existing === 'function') { - // Adding the second element, need to change to array. - existing = events[type] = prepend ? [listener, existing] : - [existing, listener]; - } else { - // If we've already got an array, just append. - if (prepend) { - existing.unshift(listener); - } else { - existing.push(listener); - } - } - - // Check for listener leak - if (!existing.warned) { - m = $getMaxListeners(target); - if (m && m > 0 && existing.length > m) { - existing.warned = true; - var w = new Error('Possible EventEmitter memory leak detected. ' + - existing.length + ' ' + type + ' listeners added. ' + - 'Use emitter.setMaxListeners() to increase limit'); - w.name = 'MaxListenersExceededWarning'; - w.emitter = target; - w.type = type; - w.count = existing.length; - emitWarning(w); - } - } - } - - return target; - } - function emitWarning(e) { - typeof console.warn === 'function' ? console.warn(e) : console.log(e); - } - EventEmitter.prototype.addListener = function addListener(type, listener) { - return _addListener(this, type, listener, false); - }; - - EventEmitter.prototype.on = EventEmitter.prototype.addListener; - - EventEmitter.prototype.prependListener = - function prependListener(type, listener) { - return _addListener(this, type, listener, true); - }; - - function _onceWrap(target, type, listener) { - var fired = false; - function g() { - target.removeListener(type, g); - if (!fired) { - fired = true; - listener.apply(target, arguments); - } - } - g.listener = listener; - return g; - } - - EventEmitter.prototype.once = function once(type, listener) { - if (typeof listener !== 'function') - throw new TypeError('"listener" argument must be a function'); - this.on(type, _onceWrap(this, type, listener)); - return this; - }; - - EventEmitter.prototype.prependOnceListener = - function prependOnceListener(type, listener) { - if (typeof listener !== 'function') - throw new TypeError('"listener" argument must be a function'); - this.prependListener(type, _onceWrap(this, type, listener)); - return this; - }; - - // emits a 'removeListener' event iff the listener was removed - EventEmitter.prototype.removeListener = - function removeListener(type, listener) { - var list, events, position, i, originalListener; - - if (typeof listener !== 'function') - throw new TypeError('"listener" argument must be a function'); - - events = this._events; - if (!events) - return this; - - list = events[type]; - if (!list) - return this; - - if (list === listener || (list.listener && list.listener === listener)) { - if (--this._eventsCount === 0) - this._events = new EventHandlers(); - else { - delete events[type]; - if (events.removeListener) - this.emit('removeListener', type, list.listener || listener); - } - } else if (typeof list !== 'function') { - position = -1; - - for (i = list.length; i-- > 0;) { - if (list[i] === listener || - (list[i].listener && list[i].listener === listener)) { - originalListener = list[i].listener; - position = i; - break; - } - } - - if (position < 0) - return this; - - if (list.length === 1) { - list[0] = undefined; - if (--this._eventsCount === 0) { - this._events = new EventHandlers(); - return this; - } else { - delete events[type]; - } - } else { - spliceOne(list, position); - } - - if (events.removeListener) - this.emit('removeListener', type, originalListener || listener); - } - - return this; - }; - - EventEmitter.prototype.removeAllListeners = - function removeAllListeners(type) { - var listeners, events; - - events = this._events; - if (!events) - return this; - - // not listening for removeListener, no need to emit - if (!events.removeListener) { - if (arguments.length === 0) { - this._events = new EventHandlers(); - this._eventsCount = 0; - } else if (events[type]) { - if (--this._eventsCount === 0) - this._events = new EventHandlers(); - else - delete events[type]; - } - return this; - } - - // emit removeListener for all listeners on all events - if (arguments.length === 0) { - var keys = Object.keys(events); - for (var i = 0, key; i < keys.length; ++i) { - key = keys[i]; - if (key === 'removeListener') continue; - this.removeAllListeners(key); - } - this.removeAllListeners('removeListener'); - this._events = new EventHandlers(); - this._eventsCount = 0; - return this; - } - - listeners = events[type]; - - if (typeof listeners === 'function') { - this.removeListener(type, listeners); - } else if (listeners) { - // LIFO order - do { - this.removeListener(type, listeners[listeners.length - 1]); - } while (listeners[0]); - } - - return this; - }; - - EventEmitter.prototype.listeners = function listeners(type) { - var evlistener; - var ret; - var events = this._events; - - if (!events) - ret = []; - else { - evlistener = events[type]; - if (!evlistener) - ret = []; - else if (typeof evlistener === 'function') - ret = [evlistener.listener || evlistener]; - else - ret = unwrapListeners(evlistener); - } - - return ret; - }; - - EventEmitter.listenerCount = function(emitter, type) { - if (typeof emitter.listenerCount === 'function') { - return emitter.listenerCount(type); - } else { - return listenerCount.call(emitter, type); - } - }; - - EventEmitter.prototype.listenerCount = listenerCount; - function listenerCount(type) { - var events = this._events; - - if (events) { - var evlistener = events[type]; - - if (typeof evlistener === 'function') { - return 1; - } else if (evlistener) { - return evlistener.length; - } - } - - return 0; - } - - EventEmitter.prototype.eventNames = function eventNames() { - return this._eventsCount > 0 ? Reflect.ownKeys(this._events) : []; - }; - - // About 1.5x faster than the two-arg version of Array#splice(). - function spliceOne(list, index) { - for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) - list[i] = list[k]; - list.pop(); - } - - function arrayClone(arr, i) { - var copy = new Array(i); - while (i--) - copy[i] = arr[i]; - return copy; - } - - function unwrapListeners(arr) { - var ret = new Array(arr.length); - for (var i = 0; i < ret.length; ++i) { - ret[i] = arr[i].listener || arr[i]; - } - return ret; - } - - var global$1 = (typeof global !== "undefined" ? global : - typeof self !== "undefined" ? self : - typeof window !== "undefined" ? window : {}); - - var lookup = []; - var revLookup = []; - var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array; - var inited = false; - function init () { - inited = true; - var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; - for (var i = 0, len = code.length; i < len; ++i) { - lookup[i] = code[i]; - revLookup[code.charCodeAt(i)] = i; - } - - revLookup['-'.charCodeAt(0)] = 62; - revLookup['_'.charCodeAt(0)] = 63; - } - - function toByteArray (b64) { - if (!inited) { - init(); - } - var i, j, l, tmp, placeHolders, arr; - var len = b64.length; - - if (len % 4 > 0) { - throw new Error('Invalid string. Length must be a multiple of 4') - } - - // the number of equal signs (place holders) - // if there are two placeholders, than the two characters before it - // represent one byte - // if there is only one, then the three characters before it represent 2 bytes - // this is just a cheap hack to not do indexOf twice - placeHolders = b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0; - - // base64 is 4/3 + up to two characters of the original data - arr = new Arr(len * 3 / 4 - placeHolders); - - // if there are placeholders, only get up to the last complete 4 chars - l = placeHolders > 0 ? len - 4 : len; - - var L = 0; - - for (i = 0, j = 0; i < l; i += 4, j += 3) { - tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]; - arr[L++] = (tmp >> 16) & 0xFF; - arr[L++] = (tmp >> 8) & 0xFF; - arr[L++] = tmp & 0xFF; - } - - if (placeHolders === 2) { - tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4); - arr[L++] = tmp & 0xFF; - } else if (placeHolders === 1) { - tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2); - arr[L++] = (tmp >> 8) & 0xFF; - arr[L++] = tmp & 0xFF; - } - - return arr - } - - function tripletToBase64 (num) { - return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F] - } - - function encodeChunk (uint8, start, end) { - var tmp; - var output = []; - for (var i = start; i < end; i += 3) { - tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]); - output.push(tripletToBase64(tmp)); - } - return output.join('') - } - - function fromByteArray (uint8) { - if (!inited) { - init(); - } - var tmp; - var len = uint8.length; - var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes - var output = ''; - var parts = []; - var maxChunkLength = 16383; // must be multiple of 3 - - // go through the array every three bytes, we'll deal with trailing stuff later - for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { - parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength))); - } - - // pad the end with zeros, but make sure to not forget the extra bytes - if (extraBytes === 1) { - tmp = uint8[len - 1]; - output += lookup[tmp >> 2]; - output += lookup[(tmp << 4) & 0x3F]; - output += '=='; - } else if (extraBytes === 2) { - tmp = (uint8[len - 2] << 8) + (uint8[len - 1]); - output += lookup[tmp >> 10]; - output += lookup[(tmp >> 4) & 0x3F]; - output += lookup[(tmp << 2) & 0x3F]; - output += '='; - } - - parts.push(output); - - return parts.join('') - } - - function read (buffer, offset, isLE, mLen, nBytes) { - var e, m; - var eLen = nBytes * 8 - mLen - 1; - var eMax = (1 << eLen) - 1; - var eBias = eMax >> 1; - var nBits = -7; - var i = isLE ? (nBytes - 1) : 0; - var d = isLE ? -1 : 1; - var s = buffer[offset + i]; - - i += d; - - e = s & ((1 << (-nBits)) - 1); - s >>= (-nBits); - nBits += eLen; - for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {} - - m = e & ((1 << (-nBits)) - 1); - e >>= (-nBits); - nBits += mLen; - for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {} - - if (e === 0) { - e = 1 - eBias; - } else if (e === eMax) { - return m ? NaN : ((s ? -1 : 1) * Infinity) - } else { - m = m + Math.pow(2, mLen); - e = e - eBias; - } - return (s ? -1 : 1) * m * Math.pow(2, e - mLen) - } - - function write (buffer, value, offset, isLE, mLen, nBytes) { - var e, m, c; - var eLen = nBytes * 8 - mLen - 1; - var eMax = (1 << eLen) - 1; - var eBias = eMax >> 1; - var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0); - var i = isLE ? 0 : (nBytes - 1); - var d = isLE ? 1 : -1; - var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0; - - value = Math.abs(value); - - if (isNaN(value) || value === Infinity) { - m = isNaN(value) ? 1 : 0; - e = eMax; - } else { - e = Math.floor(Math.log(value) / Math.LN2); - if (value * (c = Math.pow(2, -e)) < 1) { - e--; - c *= 2; - } - if (e + eBias >= 1) { - value += rt / c; - } else { - value += rt * Math.pow(2, 1 - eBias); - } - if (value * c >= 2) { - e++; - c /= 2; - } - - if (e + eBias >= eMax) { - m = 0; - e = eMax; - } else if (e + eBias >= 1) { - m = (value * c - 1) * Math.pow(2, mLen); - e = e + eBias; - } else { - m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); - e = 0; - } - } - - for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} - - e = (e << mLen) | m; - eLen += mLen; - for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} - - buffer[offset + i - d] |= s * 128; - } - - var toString = {}.toString; - - var isArray = Array.isArray || function (arr) { - return toString.call(arr) == '[object Array]'; - }; - - var INSPECT_MAX_BYTES = 50; - - /** - * If `Buffer.TYPED_ARRAY_SUPPORT`: - * === true Use Uint8Array implementation (fastest) - * === false Use Object implementation (most compatible, even IE6) - * - * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, - * Opera 11.6+, iOS 4.2+. - * - * Due to various browser bugs, sometimes the Object implementation will be used even - * when the browser supports typed arrays. - * - * Note: - * - * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances, - * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438. - * - * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function. - * - * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of - * incorrect length in some situations. - - * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they - * get the Object implementation, which is slower but behaves correctly. - */ - Buffer.TYPED_ARRAY_SUPPORT = global$1.TYPED_ARRAY_SUPPORT !== undefined - ? global$1.TYPED_ARRAY_SUPPORT - : true; - - function kMaxLength () { - return Buffer.TYPED_ARRAY_SUPPORT - ? 0x7fffffff - : 0x3fffffff - } - - function createBuffer (that, length) { - if (kMaxLength() < length) { - throw new RangeError('Invalid typed array length') - } - if (Buffer.TYPED_ARRAY_SUPPORT) { - // Return an augmented `Uint8Array` instance, for best performance - that = new Uint8Array(length); - that.__proto__ = Buffer.prototype; - } else { - // Fallback: Return an object instance of the Buffer class - if (that === null) { - that = new Buffer(length); - } - that.length = length; - } - - return that - } - - /** - * The Buffer constructor returns instances of `Uint8Array` that have their - * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of - * `Uint8Array`, so the returned instances will have all the node `Buffer` methods - * and the `Uint8Array` methods. Square bracket notation works as expected -- it - * returns a single octet. - * - * The `Uint8Array` prototype remains unmodified. - */ - - function Buffer (arg, encodingOrOffset, length) { - if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) { - return new Buffer(arg, encodingOrOffset, length) - } - - // Common case. - if (typeof arg === 'number') { - if (typeof encodingOrOffset === 'string') { - throw new Error( - 'If encoding is specified then the first argument must be a string' - ) - } - return allocUnsafe(this, arg) - } - return from(this, arg, encodingOrOffset, length) - } - - Buffer.poolSize = 8192; // not used by this implementation - - // TODO: Legacy, not needed anymore. Remove in next major version. - Buffer._augment = function (arr) { - arr.__proto__ = Buffer.prototype; - return arr - }; - - function from (that, value, encodingOrOffset, length) { - if (typeof value === 'number') { - throw new TypeError('"value" argument must not be a number') - } - - if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) { - return fromArrayBuffer(that, value, encodingOrOffset, length) - } - - if (typeof value === 'string') { - return fromString(that, value, encodingOrOffset) - } - - return fromObject(that, value) - } - - /** - * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError - * if value is a number. - * Buffer.from(str[, encoding]) - * Buffer.from(array) - * Buffer.from(buffer) - * Buffer.from(arrayBuffer[, byteOffset[, length]]) - **/ - Buffer.from = function (value, encodingOrOffset, length) { - return from(null, value, encodingOrOffset, length) - }; - - if (Buffer.TYPED_ARRAY_SUPPORT) { - Buffer.prototype.__proto__ = Uint8Array.prototype; - Buffer.__proto__ = Uint8Array; - } - - function assertSize (size) { - if (typeof size !== 'number') { - throw new TypeError('"size" argument must be a number') - } else if (size < 0) { - throw new RangeError('"size" argument must not be negative') - } - } - - function alloc (that, size, fill, encoding) { - assertSize(size); - if (size <= 0) { - return createBuffer(that, size) - } - if (fill !== undefined) { - // Only pay attention to encoding if it's a string. This - // prevents accidentally sending in a number that would - // be interpretted as a start offset. - return typeof encoding === 'string' - ? createBuffer(that, size).fill(fill, encoding) - : createBuffer(that, size).fill(fill) - } - return createBuffer(that, size) - } - - /** - * Creates a new filled Buffer instance. - * alloc(size[, fill[, encoding]]) - **/ - Buffer.alloc = function (size, fill, encoding) { - return alloc(null, size, fill, encoding) - }; - - function allocUnsafe (that, size) { - assertSize(size); - that = createBuffer(that, size < 0 ? 0 : checked(size) | 0); - if (!Buffer.TYPED_ARRAY_SUPPORT) { - for (var i = 0; i < size; ++i) { - that[i] = 0; - } - } - return that - } - - /** - * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. - * */ - Buffer.allocUnsafe = function (size) { - return allocUnsafe(null, size) - }; - /** - * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. - */ - Buffer.allocUnsafeSlow = function (size) { - return allocUnsafe(null, size) - }; - - function fromString (that, string, encoding) { - if (typeof encoding !== 'string' || encoding === '') { - encoding = 'utf8'; - } - - if (!Buffer.isEncoding(encoding)) { - throw new TypeError('"encoding" must be a valid string encoding') - } - - var length = byteLength(string, encoding) | 0; - that = createBuffer(that, length); - - var actual = that.write(string, encoding); - - if (actual !== length) { - // Writing a hex string, for example, that contains invalid characters will - // cause everything after the first invalid character to be ignored. (e.g. - // 'abxxcd' will be treated as 'ab') - that = that.slice(0, actual); - } - - return that - } - - function fromArrayLike (that, array) { - var length = array.length < 0 ? 0 : checked(array.length) | 0; - that = createBuffer(that, length); - for (var i = 0; i < length; i += 1) { - that[i] = array[i] & 255; - } - return that - } - - function fromArrayBuffer (that, array, byteOffset, length) { - array.byteLength; // this throws if `array` is not a valid ArrayBuffer - - if (byteOffset < 0 || array.byteLength < byteOffset) { - throw new RangeError('\'offset\' is out of bounds') - } - - if (array.byteLength < byteOffset + (length || 0)) { - throw new RangeError('\'length\' is out of bounds') - } - - if (byteOffset === undefined && length === undefined) { - array = new Uint8Array(array); - } else if (length === undefined) { - array = new Uint8Array(array, byteOffset); - } else { - array = new Uint8Array(array, byteOffset, length); - } - - if (Buffer.TYPED_ARRAY_SUPPORT) { - // Return an augmented `Uint8Array` instance, for best performance - that = array; - that.__proto__ = Buffer.prototype; - } else { - // Fallback: Return an object instance of the Buffer class - that = fromArrayLike(that, array); - } - return that - } - - function fromObject (that, obj) { - if (internalIsBuffer(obj)) { - var len = checked(obj.length) | 0; - that = createBuffer(that, len); - - if (that.length === 0) { - return that - } - - obj.copy(that, 0, 0, len); - return that - } - - if (obj) { - if ((typeof ArrayBuffer !== 'undefined' && - obj.buffer instanceof ArrayBuffer) || 'length' in obj) { - if (typeof obj.length !== 'number' || isnan(obj.length)) { - return createBuffer(that, 0) - } - return fromArrayLike(that, obj) - } - - if (obj.type === 'Buffer' && isArray(obj.data)) { - return fromArrayLike(that, obj.data) - } - } - - throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.') - } - - function checked (length) { - // Note: cannot use `length < kMaxLength()` here because that fails when - // length is NaN (which is otherwise coerced to zero.) - if (length >= kMaxLength()) { - throw new RangeError('Attempt to allocate Buffer larger than maximum ' + - 'size: 0x' + kMaxLength().toString(16) + ' bytes') - } - return length | 0 - } - Buffer.isBuffer = isBuffer; - function internalIsBuffer (b) { - return !!(b != null && b._isBuffer) - } - - Buffer.compare = function compare (a, b) { - if (!internalIsBuffer(a) || !internalIsBuffer(b)) { - throw new TypeError('Arguments must be Buffers') - } - - if (a === b) return 0 - - var x = a.length; - var y = b.length; - - for (var i = 0, len = Math.min(x, y); i < len; ++i) { - if (a[i] !== b[i]) { - x = a[i]; - y = b[i]; - break - } - } - - if (x < y) return -1 - if (y < x) return 1 - return 0 - }; - - Buffer.isEncoding = function isEncoding (encoding) { - switch (String(encoding).toLowerCase()) { - case 'hex': - case 'utf8': - case 'utf-8': - case 'ascii': - case 'latin1': - case 'binary': - case 'base64': - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return true - default: - return false - } - }; - - Buffer.concat = function concat (list, length) { - if (!isArray(list)) { - throw new TypeError('"list" argument must be an Array of Buffers') - } - - if (list.length === 0) { - return Buffer.alloc(0) - } - - var i; - if (length === undefined) { - length = 0; - for (i = 0; i < list.length; ++i) { - length += list[i].length; - } - } - - var buffer = Buffer.allocUnsafe(length); - var pos = 0; - for (i = 0; i < list.length; ++i) { - var buf = list[i]; - if (!internalIsBuffer(buf)) { - throw new TypeError('"list" argument must be an Array of Buffers') - } - buf.copy(buffer, pos); - pos += buf.length; - } - return buffer - }; - - function byteLength (string, encoding) { - if (internalIsBuffer(string)) { - return string.length - } - if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' && - (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) { - return string.byteLength - } - if (typeof string !== 'string') { - string = '' + string; - } - - var len = string.length; - if (len === 0) return 0 - - // Use a for loop to avoid recursion - var loweredCase = false; - for (;;) { - switch (encoding) { - case 'ascii': - case 'latin1': - case 'binary': - return len - case 'utf8': - case 'utf-8': - case undefined: - return utf8ToBytes(string).length - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return len * 2 - case 'hex': - return len >>> 1 - case 'base64': - return base64ToBytes(string).length - default: - if (loweredCase) return utf8ToBytes(string).length // assume utf8 - encoding = ('' + encoding).toLowerCase(); - loweredCase = true; - } - } - } - Buffer.byteLength = byteLength; - - function slowToString (encoding, start, end) { - var loweredCase = false; - - // No need to verify that "this.length <= MAX_UINT32" since it's a read-only - // property of a typed array. - - // This behaves neither like String nor Uint8Array in that we set start/end - // to their upper/lower bounds if the value passed is out of range. - // undefined is handled specially as per ECMA-262 6th Edition, - // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. - if (start === undefined || start < 0) { - start = 0; - } - // Return early if start > this.length. Done here to prevent potential uint32 - // coercion fail below. - if (start > this.length) { - return '' - } - - if (end === undefined || end > this.length) { - end = this.length; - } - - if (end <= 0) { - return '' - } - - // Force coersion to uint32. This will also coerce falsey/NaN values to 0. - end >>>= 0; - start >>>= 0; - - if (end <= start) { - return '' - } - - if (!encoding) encoding = 'utf8'; - - while (true) { - switch (encoding) { - case 'hex': - return hexSlice(this, start, end) - - case 'utf8': - case 'utf-8': - return utf8Slice(this, start, end) - - case 'ascii': - return asciiSlice(this, start, end) - - case 'latin1': - case 'binary': - return latin1Slice(this, start, end) - - case 'base64': - return base64Slice(this, start, end) - - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return utf16leSlice(this, start, end) - - default: - if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) - encoding = (encoding + '').toLowerCase(); - loweredCase = true; - } - } - } - - // The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect - // Buffer instances. - Buffer.prototype._isBuffer = true; - - function swap (b, n, m) { - var i = b[n]; - b[n] = b[m]; - b[m] = i; - } - - Buffer.prototype.swap16 = function swap16 () { - var len = this.length; - if (len % 2 !== 0) { - throw new RangeError('Buffer size must be a multiple of 16-bits') - } - for (var i = 0; i < len; i += 2) { - swap(this, i, i + 1); - } - return this - }; - - Buffer.prototype.swap32 = function swap32 () { - var len = this.length; - if (len % 4 !== 0) { - throw new RangeError('Buffer size must be a multiple of 32-bits') - } - for (var i = 0; i < len; i += 4) { - swap(this, i, i + 3); - swap(this, i + 1, i + 2); - } - return this - }; - - Buffer.prototype.swap64 = function swap64 () { - var len = this.length; - if (len % 8 !== 0) { - throw new RangeError('Buffer size must be a multiple of 64-bits') - } - for (var i = 0; i < len; i += 8) { - swap(this, i, i + 7); - swap(this, i + 1, i + 6); - swap(this, i + 2, i + 5); - swap(this, i + 3, i + 4); - } - return this - }; - - Buffer.prototype.toString = function toString () { - var length = this.length | 0; - if (length === 0) return '' - if (arguments.length === 0) return utf8Slice(this, 0, length) - return slowToString.apply(this, arguments) - }; - - Buffer.prototype.equals = function equals (b) { - if (!internalIsBuffer(b)) throw new TypeError('Argument must be a Buffer') - if (this === b) return true - return Buffer.compare(this, b) === 0 - }; - - Buffer.prototype.inspect = function inspect () { - var str = ''; - var max = INSPECT_MAX_BYTES; - if (this.length > 0) { - str = this.toString('hex', 0, max).match(/.{2}/g).join(' '); - if (this.length > max) str += ' ... '; - } - return '' - }; - - Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { - if (!internalIsBuffer(target)) { - throw new TypeError('Argument must be a Buffer') - } - - if (start === undefined) { - start = 0; - } - if (end === undefined) { - end = target ? target.length : 0; - } - if (thisStart === undefined) { - thisStart = 0; - } - if (thisEnd === undefined) { - thisEnd = this.length; - } - - if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { - throw new RangeError('out of range index') - } - - if (thisStart >= thisEnd && start >= end) { - return 0 - } - if (thisStart >= thisEnd) { - return -1 - } - if (start >= end) { - return 1 - } - - start >>>= 0; - end >>>= 0; - thisStart >>>= 0; - thisEnd >>>= 0; - - if (this === target) return 0 - - var x = thisEnd - thisStart; - var y = end - start; - var len = Math.min(x, y); - - var thisCopy = this.slice(thisStart, thisEnd); - var targetCopy = target.slice(start, end); - - for (var i = 0; i < len; ++i) { - if (thisCopy[i] !== targetCopy[i]) { - x = thisCopy[i]; - y = targetCopy[i]; - break - } - } - - if (x < y) return -1 - if (y < x) return 1 - return 0 - }; - - // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, - // OR the last index of `val` in `buffer` at offset <= `byteOffset`. - // - // Arguments: - // - buffer - a Buffer to search - // - val - a string, Buffer, or number - // - byteOffset - an index into `buffer`; will be clamped to an int32 - // - encoding - an optional encoding, relevant is val is a string - // - dir - true for indexOf, false for lastIndexOf - function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { - // Empty buffer means no match - if (buffer.length === 0) return -1 - - // Normalize byteOffset - if (typeof byteOffset === 'string') { - encoding = byteOffset; - byteOffset = 0; - } else if (byteOffset > 0x7fffffff) { - byteOffset = 0x7fffffff; - } else if (byteOffset < -0x80000000) { - byteOffset = -0x80000000; - } - byteOffset = +byteOffset; // Coerce to Number. - if (isNaN(byteOffset)) { - // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer - byteOffset = dir ? 0 : (buffer.length - 1); - } - - // Normalize byteOffset: negative offsets start from the end of the buffer - if (byteOffset < 0) byteOffset = buffer.length + byteOffset; - if (byteOffset >= buffer.length) { - if (dir) return -1 - else byteOffset = buffer.length - 1; - } else if (byteOffset < 0) { - if (dir) byteOffset = 0; - else return -1 - } - - // Normalize val - if (typeof val === 'string') { - val = Buffer.from(val, encoding); - } - - // Finally, search either indexOf (if dir is true) or lastIndexOf - if (internalIsBuffer(val)) { - // Special case: looking for empty string/buffer always fails - if (val.length === 0) { - return -1 - } - return arrayIndexOf(buffer, val, byteOffset, encoding, dir) - } else if (typeof val === 'number') { - val = val & 0xFF; // Search for a byte value [0-255] - if (Buffer.TYPED_ARRAY_SUPPORT && - typeof Uint8Array.prototype.indexOf === 'function') { - if (dir) { - return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset) - } else { - return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset) - } - } - return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir) - } - - throw new TypeError('val must be string, number or Buffer') - } - - function arrayIndexOf (arr, val, byteOffset, encoding, dir) { - var indexSize = 1; - var arrLength = arr.length; - var valLength = val.length; - - if (encoding !== undefined) { - encoding = String(encoding).toLowerCase(); - if (encoding === 'ucs2' || encoding === 'ucs-2' || - encoding === 'utf16le' || encoding === 'utf-16le') { - if (arr.length < 2 || val.length < 2) { - return -1 - } - indexSize = 2; - arrLength /= 2; - valLength /= 2; - byteOffset /= 2; - } - } - - function read (buf, i) { - if (indexSize === 1) { - return buf[i] - } else { - return buf.readUInt16BE(i * indexSize) - } - } - - var i; - if (dir) { - var foundIndex = -1; - for (i = byteOffset; i < arrLength; i++) { - if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { - if (foundIndex === -1) foundIndex = i; - if (i - foundIndex + 1 === valLength) return foundIndex * indexSize - } else { - if (foundIndex !== -1) i -= i - foundIndex; - foundIndex = -1; - } - } - } else { - if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength; - for (i = byteOffset; i >= 0; i--) { - var found = true; - for (var j = 0; j < valLength; j++) { - if (read(arr, i + j) !== read(val, j)) { - found = false; - break - } - } - if (found) return i - } - } - - return -1 - } - - Buffer.prototype.includes = function includes (val, byteOffset, encoding) { - return this.indexOf(val, byteOffset, encoding) !== -1 - }; - - Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { - return bidirectionalIndexOf(this, val, byteOffset, encoding, true) - }; - - Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) { - return bidirectionalIndexOf(this, val, byteOffset, encoding, false) - }; - - function hexWrite (buf, string, offset, length) { - offset = Number(offset) || 0; - var remaining = buf.length - offset; - if (!length) { - length = remaining; - } else { - length = Number(length); - if (length > remaining) { - length = remaining; - } - } - - // must be an even number of digits - var strLen = string.length; - if (strLen % 2 !== 0) throw new TypeError('Invalid hex string') - - if (length > strLen / 2) { - length = strLen / 2; - } - for (var i = 0; i < length; ++i) { - var parsed = parseInt(string.substr(i * 2, 2), 16); - if (isNaN(parsed)) return i - buf[offset + i] = parsed; - } - return i - } - - function utf8Write (buf, string, offset, length) { - return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) - } - - function asciiWrite (buf, string, offset, length) { - return blitBuffer(asciiToBytes(string), buf, offset, length) - } - - function latin1Write (buf, string, offset, length) { - return asciiWrite(buf, string, offset, length) - } - - function base64Write (buf, string, offset, length) { - return blitBuffer(base64ToBytes(string), buf, offset, length) - } - - function ucs2Write (buf, string, offset, length) { - return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) - } - - Buffer.prototype.write = function write (string, offset, length, encoding) { - // Buffer#write(string) - if (offset === undefined) { - encoding = 'utf8'; - length = this.length; - offset = 0; - // Buffer#write(string, encoding) - } else if (length === undefined && typeof offset === 'string') { - encoding = offset; - length = this.length; - offset = 0; - // Buffer#write(string, offset[, length][, encoding]) - } else if (isFinite(offset)) { - offset = offset | 0; - if (isFinite(length)) { - length = length | 0; - if (encoding === undefined) encoding = 'utf8'; - } else { - encoding = length; - length = undefined; - } - // legacy write(string, encoding, offset, length) - remove in v0.13 - } else { - throw new Error( - 'Buffer.write(string, encoding, offset[, length]) is no longer supported' - ) - } - - var remaining = this.length - offset; - if (length === undefined || length > remaining) length = remaining; - - if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { - throw new RangeError('Attempt to write outside buffer bounds') - } - - if (!encoding) encoding = 'utf8'; - - var loweredCase = false; - for (;;) { - switch (encoding) { - case 'hex': - return hexWrite(this, string, offset, length) - - case 'utf8': - case 'utf-8': - return utf8Write(this, string, offset, length) - - case 'ascii': - return asciiWrite(this, string, offset, length) - - case 'latin1': - case 'binary': - return latin1Write(this, string, offset, length) - - case 'base64': - // Warning: maxLength not taken into account in base64Write - return base64Write(this, string, offset, length) - - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return ucs2Write(this, string, offset, length) - - default: - if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) - encoding = ('' + encoding).toLowerCase(); - loweredCase = true; - } - } - }; - - Buffer.prototype.toJSON = function toJSON () { - return { - type: 'Buffer', - data: Array.prototype.slice.call(this._arr || this, 0) - } - }; - - function base64Slice (buf, start, end) { - if (start === 0 && end === buf.length) { - return fromByteArray(buf) - } else { - return fromByteArray(buf.slice(start, end)) - } - } - - function utf8Slice (buf, start, end) { - end = Math.min(buf.length, end); - var res = []; - - var i = start; - while (i < end) { - var firstByte = buf[i]; - var codePoint = null; - var bytesPerSequence = (firstByte > 0xEF) ? 4 - : (firstByte > 0xDF) ? 3 - : (firstByte > 0xBF) ? 2 - : 1; - - if (i + bytesPerSequence <= end) { - var secondByte, thirdByte, fourthByte, tempCodePoint; - - switch (bytesPerSequence) { - case 1: - if (firstByte < 0x80) { - codePoint = firstByte; - } - break - case 2: - secondByte = buf[i + 1]; - if ((secondByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F); - if (tempCodePoint > 0x7F) { - codePoint = tempCodePoint; - } - } - break - case 3: - secondByte = buf[i + 1]; - thirdByte = buf[i + 2]; - if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F); - if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { - codePoint = tempCodePoint; - } - } - break - case 4: - secondByte = buf[i + 1]; - thirdByte = buf[i + 2]; - fourthByte = buf[i + 3]; - if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F); - if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { - codePoint = tempCodePoint; - } - } - } - } - - if (codePoint === null) { - // we did not generate a valid codePoint so insert a - // replacement char (U+FFFD) and advance only 1 byte - codePoint = 0xFFFD; - bytesPerSequence = 1; - } else if (codePoint > 0xFFFF) { - // encode to utf16 (surrogate pair dance) - codePoint -= 0x10000; - res.push(codePoint >>> 10 & 0x3FF | 0xD800); - codePoint = 0xDC00 | codePoint & 0x3FF; - } - - res.push(codePoint); - i += bytesPerSequence; - } - - return decodeCodePointsArray(res) - } - - // Based on http://stackoverflow.com/a/22747272/680742, the browser with - // the lowest limit is Chrome, with 0x10000 args. - // We go 1 magnitude less, for safety - var MAX_ARGUMENTS_LENGTH = 0x1000; - - function decodeCodePointsArray (codePoints) { - var len = codePoints.length; - if (len <= MAX_ARGUMENTS_LENGTH) { - return String.fromCharCode.apply(String, codePoints) // avoid extra slice() - } - - // Decode in chunks to avoid "call stack size exceeded". - var res = ''; - var i = 0; - while (i < len) { - res += String.fromCharCode.apply( - String, - codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) - ); - } - return res - } - - function asciiSlice (buf, start, end) { - var ret = ''; - end = Math.min(buf.length, end); - - for (var i = start; i < end; ++i) { - ret += String.fromCharCode(buf[i] & 0x7F); - } - return ret - } - - function latin1Slice (buf, start, end) { - var ret = ''; - end = Math.min(buf.length, end); - - for (var i = start; i < end; ++i) { - ret += String.fromCharCode(buf[i]); - } - return ret - } - - function hexSlice (buf, start, end) { - var len = buf.length; - - if (!start || start < 0) start = 0; - if (!end || end < 0 || end > len) end = len; - - var out = ''; - for (var i = start; i < end; ++i) { - out += toHex(buf[i]); - } - return out - } - - function utf16leSlice (buf, start, end) { - var bytes = buf.slice(start, end); - var res = ''; - for (var i = 0; i < bytes.length; i += 2) { - res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256); - } - return res - } - - Buffer.prototype.slice = function slice (start, end) { - var len = this.length; - start = ~~start; - end = end === undefined ? len : ~~end; - - if (start < 0) { - start += len; - if (start < 0) start = 0; - } else if (start > len) { - start = len; - } - - if (end < 0) { - end += len; - if (end < 0) end = 0; - } else if (end > len) { - end = len; - } - - if (end < start) end = start; - - var newBuf; - if (Buffer.TYPED_ARRAY_SUPPORT) { - newBuf = this.subarray(start, end); - newBuf.__proto__ = Buffer.prototype; - } else { - var sliceLen = end - start; - newBuf = new Buffer(sliceLen, undefined); - for (var i = 0; i < sliceLen; ++i) { - newBuf[i] = this[i + start]; - } - } - - return newBuf - }; - - /* - * Need to make sure that buffer isn't trying to write out of bounds. - */ - function checkOffset (offset, ext, length) { - if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') - if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') - } - - Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { - offset = offset | 0; - byteLength = byteLength | 0; - if (!noAssert) checkOffset(offset, byteLength, this.length); - - var val = this[offset]; - var mul = 1; - var i = 0; - while (++i < byteLength && (mul *= 0x100)) { - val += this[offset + i] * mul; - } - - return val - }; - - Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { - offset = offset | 0; - byteLength = byteLength | 0; - if (!noAssert) { - checkOffset(offset, byteLength, this.length); - } - - var val = this[offset + --byteLength]; - var mul = 1; - while (byteLength > 0 && (mul *= 0x100)) { - val += this[offset + --byteLength] * mul; - } - - return val - }; - - Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { - if (!noAssert) checkOffset(offset, 1, this.length); - return this[offset] - }; - - Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 2, this.length); - return this[offset] | (this[offset + 1] << 8) - }; - - Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 2, this.length); - return (this[offset] << 8) | this[offset + 1] - }; - - Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length); - - return ((this[offset]) | - (this[offset + 1] << 8) | - (this[offset + 2] << 16)) + - (this[offset + 3] * 0x1000000) - }; - - Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length); - - return (this[offset] * 0x1000000) + - ((this[offset + 1] << 16) | - (this[offset + 2] << 8) | - this[offset + 3]) - }; - - Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { - offset = offset | 0; - byteLength = byteLength | 0; - if (!noAssert) checkOffset(offset, byteLength, this.length); - - var val = this[offset]; - var mul = 1; - var i = 0; - while (++i < byteLength && (mul *= 0x100)) { - val += this[offset + i] * mul; - } - mul *= 0x80; - - if (val >= mul) val -= Math.pow(2, 8 * byteLength); - - return val - }; - - Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { - offset = offset | 0; - byteLength = byteLength | 0; - if (!noAssert) checkOffset(offset, byteLength, this.length); - - var i = byteLength; - var mul = 1; - var val = this[offset + --i]; - while (i > 0 && (mul *= 0x100)) { - val += this[offset + --i] * mul; - } - mul *= 0x80; - - if (val >= mul) val -= Math.pow(2, 8 * byteLength); - - return val - }; - - Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { - if (!noAssert) checkOffset(offset, 1, this.length); - if (!(this[offset] & 0x80)) return (this[offset]) - return ((0xff - this[offset] + 1) * -1) - }; - - Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 2, this.length); - var val = this[offset] | (this[offset + 1] << 8); - return (val & 0x8000) ? val | 0xFFFF0000 : val - }; - - Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 2, this.length); - var val = this[offset + 1] | (this[offset] << 8); - return (val & 0x8000) ? val | 0xFFFF0000 : val - }; - - Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length); - - return (this[offset]) | - (this[offset + 1] << 8) | - (this[offset + 2] << 16) | - (this[offset + 3] << 24) - }; - - Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length); - - return (this[offset] << 24) | - (this[offset + 1] << 16) | - (this[offset + 2] << 8) | - (this[offset + 3]) - }; - - Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length); - return read(this, offset, true, 23, 4) - }; - - Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length); - return read(this, offset, false, 23, 4) - }; - - Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 8, this.length); - return read(this, offset, true, 52, 8) - }; - - Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 8, this.length); - return read(this, offset, false, 52, 8) - }; - - function checkInt (buf, value, offset, ext, max, min) { - if (!internalIsBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance') - if (value > max || value < min) throw new RangeError('"value" argument is out of bounds') - if (offset + ext > buf.length) throw new RangeError('Index out of range') - } - - Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { - value = +value; - offset = offset | 0; - byteLength = byteLength | 0; - if (!noAssert) { - var maxBytes = Math.pow(2, 8 * byteLength) - 1; - checkInt(this, value, offset, byteLength, maxBytes, 0); - } - - var mul = 1; - var i = 0; - this[offset] = value & 0xFF; - while (++i < byteLength && (mul *= 0x100)) { - this[offset + i] = (value / mul) & 0xFF; - } - - return offset + byteLength - }; - - Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { - value = +value; - offset = offset | 0; - byteLength = byteLength | 0; - if (!noAssert) { - var maxBytes = Math.pow(2, 8 * byteLength) - 1; - checkInt(this, value, offset, byteLength, maxBytes, 0); - } - - var i = byteLength - 1; - var mul = 1; - this[offset + i] = value & 0xFF; - while (--i >= 0 && (mul *= 0x100)) { - this[offset + i] = (value / mul) & 0xFF; - } - - return offset + byteLength - }; - - Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0); - if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value); - this[offset] = (value & 0xff); - return offset + 1 - }; - - function objectWriteUInt16 (buf, value, offset, littleEndian) { - if (value < 0) value = 0xffff + value + 1; - for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) { - buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>> - (littleEndian ? i : 1 - i) * 8; - } - } - - Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0); - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value & 0xff); - this[offset + 1] = (value >>> 8); - } else { - objectWriteUInt16(this, value, offset, true); - } - return offset + 2 - }; - - Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0); - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value >>> 8); - this[offset + 1] = (value & 0xff); - } else { - objectWriteUInt16(this, value, offset, false); - } - return offset + 2 - }; - - function objectWriteUInt32 (buf, value, offset, littleEndian) { - if (value < 0) value = 0xffffffff + value + 1; - for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) { - buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff; - } - } - - Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0); - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset + 3] = (value >>> 24); - this[offset + 2] = (value >>> 16); - this[offset + 1] = (value >>> 8); - this[offset] = (value & 0xff); - } else { - objectWriteUInt32(this, value, offset, true); - } - return offset + 4 - }; - - Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0); - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value >>> 24); - this[offset + 1] = (value >>> 16); - this[offset + 2] = (value >>> 8); - this[offset + 3] = (value & 0xff); - } else { - objectWriteUInt32(this, value, offset, false); - } - return offset + 4 - }; - - Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) { - var limit = Math.pow(2, 8 * byteLength - 1); - - checkInt(this, value, offset, byteLength, limit - 1, -limit); - } - - var i = 0; - var mul = 1; - var sub = 0; - this[offset] = value & 0xFF; - while (++i < byteLength && (mul *= 0x100)) { - if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { - sub = 1; - } - this[offset + i] = ((value / mul) >> 0) - sub & 0xFF; - } - - return offset + byteLength - }; - - Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) { - var limit = Math.pow(2, 8 * byteLength - 1); - - checkInt(this, value, offset, byteLength, limit - 1, -limit); - } - - var i = byteLength - 1; - var mul = 1; - var sub = 0; - this[offset + i] = value & 0xFF; - while (--i >= 0 && (mul *= 0x100)) { - if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { - sub = 1; - } - this[offset + i] = ((value / mul) >> 0) - sub & 0xFF; - } - - return offset + byteLength - }; - - Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80); - if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value); - if (value < 0) value = 0xff + value + 1; - this[offset] = (value & 0xff); - return offset + 1 - }; - - Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000); - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value & 0xff); - this[offset + 1] = (value >>> 8); - } else { - objectWriteUInt16(this, value, offset, true); - } - return offset + 2 - }; - - Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000); - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value >>> 8); - this[offset + 1] = (value & 0xff); - } else { - objectWriteUInt16(this, value, offset, false); - } - return offset + 2 - }; - - Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000); - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value & 0xff); - this[offset + 1] = (value >>> 8); - this[offset + 2] = (value >>> 16); - this[offset + 3] = (value >>> 24); - } else { - objectWriteUInt32(this, value, offset, true); - } - return offset + 4 - }; - - Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000); - if (value < 0) value = 0xffffffff + value + 1; - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value >>> 24); - this[offset + 1] = (value >>> 16); - this[offset + 2] = (value >>> 8); - this[offset + 3] = (value & 0xff); - } else { - objectWriteUInt32(this, value, offset, false); - } - return offset + 4 - }; - - function checkIEEE754 (buf, value, offset, ext, max, min) { - if (offset + ext > buf.length) throw new RangeError('Index out of range') - if (offset < 0) throw new RangeError('Index out of range') - } - - function writeFloat (buf, value, offset, littleEndian, noAssert) { - if (!noAssert) { - checkIEEE754(buf, value, offset, 4); - } - write(buf, value, offset, littleEndian, 23, 4); - return offset + 4 - } - - Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { - return writeFloat(this, value, offset, true, noAssert) - }; - - Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { - return writeFloat(this, value, offset, false, noAssert) - }; - - function writeDouble (buf, value, offset, littleEndian, noAssert) { - if (!noAssert) { - checkIEEE754(buf, value, offset, 8); - } - write(buf, value, offset, littleEndian, 52, 8); - return offset + 8 - } - - Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { - return writeDouble(this, value, offset, true, noAssert) - }; - - Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { - return writeDouble(this, value, offset, false, noAssert) - }; - - // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) - Buffer.prototype.copy = function copy (target, targetStart, start, end) { - if (!start) start = 0; - if (!end && end !== 0) end = this.length; - if (targetStart >= target.length) targetStart = target.length; - if (!targetStart) targetStart = 0; - if (end > 0 && end < start) end = start; - - // Copy 0 bytes; we're done - if (end === start) return 0 - if (target.length === 0 || this.length === 0) return 0 - - // Fatal error conditions - if (targetStart < 0) { - throw new RangeError('targetStart out of bounds') - } - if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds') - if (end < 0) throw new RangeError('sourceEnd out of bounds') - - // Are we oob? - if (end > this.length) end = this.length; - if (target.length - targetStart < end - start) { - end = target.length - targetStart + start; - } - - var len = end - start; - var i; - - if (this === target && start < targetStart && targetStart < end) { - // descending copy from end - for (i = len - 1; i >= 0; --i) { - target[i + targetStart] = this[i + start]; - } - } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) { - // ascending copy from start - for (i = 0; i < len; ++i) { - target[i + targetStart] = this[i + start]; - } - } else { - Uint8Array.prototype.set.call( - target, - this.subarray(start, start + len), - targetStart - ); - } - - return len - }; - - // Usage: - // buffer.fill(number[, offset[, end]]) - // buffer.fill(buffer[, offset[, end]]) - // buffer.fill(string[, offset[, end]][, encoding]) - Buffer.prototype.fill = function fill (val, start, end, encoding) { - // Handle string cases: - if (typeof val === 'string') { - if (typeof start === 'string') { - encoding = start; - start = 0; - end = this.length; - } else if (typeof end === 'string') { - encoding = end; - end = this.length; - } - if (val.length === 1) { - var code = val.charCodeAt(0); - if (code < 256) { - val = code; - } - } - if (encoding !== undefined && typeof encoding !== 'string') { - throw new TypeError('encoding must be a string') - } - if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { - throw new TypeError('Unknown encoding: ' + encoding) - } - } else if (typeof val === 'number') { - val = val & 255; - } - - // Invalid ranges are not set to a default, so can range check early. - if (start < 0 || this.length < start || this.length < end) { - throw new RangeError('Out of range index') - } - - if (end <= start) { - return this - } - - start = start >>> 0; - end = end === undefined ? this.length : end >>> 0; - - if (!val) val = 0; - - var i; - if (typeof val === 'number') { - for (i = start; i < end; ++i) { - this[i] = val; - } - } else { - var bytes = internalIsBuffer(val) - ? val - : utf8ToBytes(new Buffer(val, encoding).toString()); - var len = bytes.length; - for (i = 0; i < end - start; ++i) { - this[i + start] = bytes[i % len]; - } - } - - return this - }; - - // HELPER FUNCTIONS - // ================ - - var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g; - - function base64clean (str) { - // Node strips out invalid characters like \n and \t from the string, base64-js does not - str = stringtrim(str).replace(INVALID_BASE64_RE, ''); - // Node converts strings with length < 2 to '' - if (str.length < 2) return '' - // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not - while (str.length % 4 !== 0) { - str = str + '='; - } - return str - } - - function stringtrim (str) { - if (str.trim) return str.trim() - return str.replace(/^\s+|\s+$/g, '') - } - - function toHex (n) { - if (n < 16) return '0' + n.toString(16) - return n.toString(16) - } - - function utf8ToBytes (string, units) { - units = units || Infinity; - var codePoint; - var length = string.length; - var leadSurrogate = null; - var bytes = []; - - for (var i = 0; i < length; ++i) { - codePoint = string.charCodeAt(i); - - // is surrogate component - if (codePoint > 0xD7FF && codePoint < 0xE000) { - // last char was a lead - if (!leadSurrogate) { - // no lead yet - if (codePoint > 0xDBFF) { - // unexpected trail - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); - continue - } else if (i + 1 === length) { - // unpaired lead - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); - continue - } - - // valid lead - leadSurrogate = codePoint; - - continue - } - - // 2 leads in a row - if (codePoint < 0xDC00) { - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); - leadSurrogate = codePoint; - continue - } - - // valid surrogate pair - codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000; - } else if (leadSurrogate) { - // valid bmp char, but last char was a lead - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); - } - - leadSurrogate = null; - - // encode utf8 - if (codePoint < 0x80) { - if ((units -= 1) < 0) break - bytes.push(codePoint); - } else if (codePoint < 0x800) { - if ((units -= 2) < 0) break - bytes.push( - codePoint >> 0x6 | 0xC0, - codePoint & 0x3F | 0x80 - ); - } else if (codePoint < 0x10000) { - if ((units -= 3) < 0) break - bytes.push( - codePoint >> 0xC | 0xE0, - codePoint >> 0x6 & 0x3F | 0x80, - codePoint & 0x3F | 0x80 - ); - } else if (codePoint < 0x110000) { - if ((units -= 4) < 0) break - bytes.push( - codePoint >> 0x12 | 0xF0, - codePoint >> 0xC & 0x3F | 0x80, - codePoint >> 0x6 & 0x3F | 0x80, - codePoint & 0x3F | 0x80 - ); - } else { - throw new Error('Invalid code point') - } - } - - return bytes - } - - function asciiToBytes (str) { - var byteArray = []; - for (var i = 0; i < str.length; ++i) { - // Node's code seems to be doing this and not & 0x7F.. - byteArray.push(str.charCodeAt(i) & 0xFF); - } - return byteArray - } - - function utf16leToBytes (str, units) { - var c, hi, lo; - var byteArray = []; - for (var i = 0; i < str.length; ++i) { - if ((units -= 2) < 0) break - - c = str.charCodeAt(i); - hi = c >> 8; - lo = c % 256; - byteArray.push(lo); - byteArray.push(hi); - } - - return byteArray - } - - - function base64ToBytes (str) { - return toByteArray(base64clean(str)) - } - - function blitBuffer (src, dst, offset, length) { - for (var i = 0; i < length; ++i) { - if ((i + offset >= dst.length) || (i >= src.length)) break - dst[i + offset] = src[i]; - } - return i - } - - function isnan (val) { - return val !== val // eslint-disable-line no-self-compare - } - - - // the following is from is-buffer, also by Feross Aboukhadijeh and with same lisence - // The _isBuffer check is for Safari 5-7 support, because it's missing - // Object.prototype.constructor. Remove this eventually - function isBuffer(obj) { - return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj)) - } - - function isFastBuffer (obj) { - return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) - } - - // For Node v0.10 support. Remove this eventually. - function isSlowBuffer (obj) { - return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isFastBuffer(obj.slice(0, 0)) - } - - // shim for using process in browser - // based off https://github.com/defunctzombie/node-process/blob/master/browser.js - - function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); - } - function defaultClearTimeout () { - throw new Error('clearTimeout has not been defined'); - } - var cachedSetTimeout = defaultSetTimout; - var cachedClearTimeout = defaultClearTimeout; - if (typeof global$1.setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } - if (typeof global$1.clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } - - function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } - // if setTimeout wasn't available but was latter defined - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch(e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch(e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } - - - } - function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } - // if clearTimeout wasn't available but was latter defined - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } - - - - } - var queue = []; - var draining = false; - var currentQueue; - var queueIndex = -1; - - function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } - } - - function drainQueue() { - if (draining) { - return; - } - var timeout = runTimeout(cleanUpNextTick); - draining = true; - - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - runClearTimeout(timeout); - } - function nextTick(fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } - } - // v8 likes predictible objects - function Item(fun, array) { - this.fun = fun; - this.array = array; - } - Item.prototype.run = function () { - this.fun.apply(null, this.array); - }; - - // from https://github.com/kumavis/browser-process-hrtime/blob/master/index.js - var performance = global$1.performance || {}; - var performanceNow = - performance.now || - performance.mozNow || - performance.msNow || - performance.oNow || - performance.webkitNow || - function(){ return (new Date()).getTime() }; - - var inherits; - if (typeof Object.create === 'function'){ - inherits = function inherits(ctor, superCtor) { - // implementation from standard node.js 'util' module - ctor.super_ = superCtor; - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }); - }; - } else { - inherits = function inherits(ctor, superCtor) { - ctor.super_ = superCtor; - var TempCtor = function () {}; - TempCtor.prototype = superCtor.prototype; - ctor.prototype = new TempCtor(); - ctor.prototype.constructor = ctor; - }; - } - var inherits$1 = inherits; - - var formatRegExp = /%[sdj%]/g; - function format(f) { - if (!isString(f)) { - var objects = []; - for (var i = 0; i < arguments.length; i++) { - objects.push(inspect(arguments[i])); - } - return objects.join(' '); - } - - var i = 1; - var args = arguments; - var len = args.length; - var str = String(f).replace(formatRegExp, function(x) { - if (x === '%%') return '%'; - if (i >= len) return x; - switch (x) { - case '%s': return String(args[i++]); - case '%d': return Number(args[i++]); - case '%j': - try { - return JSON.stringify(args[i++]); - } catch (_) { - return '[Circular]'; - } - default: - return x; - } - }); - for (var x = args[i]; i < len; x = args[++i]) { - if (isNull(x) || !isObject(x)) { - str += ' ' + x; - } else { - str += ' ' + inspect(x); - } - } - return str; - } - - // Mark that a method should not be used. - // Returns a modified function which warns once by default. - // If --no-deprecation is set, then it is a no-op. - function deprecate(fn, msg) { - // Allow for deprecating things in the process of starting up. - if (isUndefined(global$1.process)) { - return function() { - return deprecate(fn, msg).apply(this, arguments); - }; - } - - var warned = false; - function deprecated() { - if (!warned) { - { - console.error(msg); - } - warned = true; - } - return fn.apply(this, arguments); - } - - return deprecated; - } - - var debugs = {}; - var debugEnviron; - function debuglog(set) { - if (isUndefined(debugEnviron)) - debugEnviron = ''; - set = set.toUpperCase(); - if (!debugs[set]) { - if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { - var pid = 0; - debugs[set] = function() { - var msg = format.apply(null, arguments); - console.error('%s %d: %s', set, pid, msg); - }; - } else { - debugs[set] = function() {}; - } - } - return debugs[set]; - } - - /** - * Echos the value of a value. Trys to print the value out - * in the best way possible given the different types. - * - * @param {Object} obj The object to print out. - * @param {Object} opts Optional options object that alters the output. - */ - /* legacy: obj, showHidden, depth, colors*/ - function inspect(obj, opts) { - // default options - var ctx = { - seen: [], - stylize: stylizeNoColor - }; - // legacy... - if (arguments.length >= 3) ctx.depth = arguments[2]; - if (arguments.length >= 4) ctx.colors = arguments[3]; - if (isBoolean(opts)) { - // legacy... - ctx.showHidden = opts; - } else if (opts) { - // got an "options" object - _extend(ctx, opts); - } - // set default options - if (isUndefined(ctx.showHidden)) ctx.showHidden = false; - if (isUndefined(ctx.depth)) ctx.depth = 2; - if (isUndefined(ctx.colors)) ctx.colors = false; - if (isUndefined(ctx.customInspect)) ctx.customInspect = true; - if (ctx.colors) ctx.stylize = stylizeWithColor; - return formatValue(ctx, obj, ctx.depth); - } - - // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics - inspect.colors = { - 'bold' : [1, 22], - 'italic' : [3, 23], - 'underline' : [4, 24], - 'inverse' : [7, 27], - 'white' : [37, 39], - 'grey' : [90, 39], - 'black' : [30, 39], - 'blue' : [34, 39], - 'cyan' : [36, 39], - 'green' : [32, 39], - 'magenta' : [35, 39], - 'red' : [31, 39], - 'yellow' : [33, 39] - }; - - // Don't use 'blue' not visible on cmd.exe - inspect.styles = { - 'special': 'cyan', - 'number': 'yellow', - 'boolean': 'yellow', - 'undefined': 'grey', - 'null': 'bold', - 'string': 'green', - 'date': 'magenta', - // "name": intentionally not styling - 'regexp': 'red' - }; - - - function stylizeWithColor(str, styleType) { - var style = inspect.styles[styleType]; - - if (style) { - return '\u001b[' + inspect.colors[style][0] + 'm' + str + - '\u001b[' + inspect.colors[style][1] + 'm'; - } else { - return str; - } - } - - - function stylizeNoColor(str, styleType) { - return str; - } - - - function arrayToHash(array) { - var hash = {}; - - array.forEach(function(val, idx) { - hash[val] = true; - }); - - return hash; - } - - - function formatValue(ctx, value, recurseTimes) { - // Provide a hook for user-specified inspect functions. - // Check that value is an object with an inspect function on it - if (ctx.customInspect && - value && - isFunction(value.inspect) && - // Filter out the util module, it's inspect function is special - value.inspect !== inspect && - // Also filter out any prototype objects using the circular check. - !(value.constructor && value.constructor.prototype === value)) { - var ret = value.inspect(recurseTimes, ctx); - if (!isString(ret)) { - ret = formatValue(ctx, ret, recurseTimes); - } - return ret; - } - - // Primitive types cannot have properties - var primitive = formatPrimitive(ctx, value); - if (primitive) { - return primitive; - } - - // Look up the keys of the object. - var keys = Object.keys(value); - var visibleKeys = arrayToHash(keys); - - if (ctx.showHidden) { - keys = Object.getOwnPropertyNames(value); - } - - // IE doesn't make error fields non-enumerable - // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx - if (isError(value) - && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) { - return formatError(value); - } - - // Some type of object without properties can be shortcutted. - if (keys.length === 0) { - if (isFunction(value)) { - var name = value.name ? ': ' + value.name : ''; - return ctx.stylize('[Function' + name + ']', 'special'); - } - if (isRegExp(value)) { - return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); - } - if (isDate(value)) { - return ctx.stylize(Date.prototype.toString.call(value), 'date'); - } - if (isError(value)) { - return formatError(value); - } - } - - var base = '', array = false, braces = ['{', '}']; - - // Make Array say that they are Array - if (isArray$1(value)) { - array = true; - braces = ['[', ']']; - } - - // Make functions say that they are functions - if (isFunction(value)) { - var n = value.name ? ': ' + value.name : ''; - base = ' [Function' + n + ']'; - } - - // Make RegExps say that they are RegExps - if (isRegExp(value)) { - base = ' ' + RegExp.prototype.toString.call(value); - } - - // Make dates with properties first say the date - if (isDate(value)) { - base = ' ' + Date.prototype.toUTCString.call(value); - } - - // Make error with message first say the error - if (isError(value)) { - base = ' ' + formatError(value); - } - - if (keys.length === 0 && (!array || value.length == 0)) { - return braces[0] + base + braces[1]; - } - - if (recurseTimes < 0) { - if (isRegExp(value)) { - return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); - } else { - return ctx.stylize('[Object]', 'special'); - } - } - - ctx.seen.push(value); - - var output; - if (array) { - output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); - } else { - output = keys.map(function(key) { - return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); - }); - } - - ctx.seen.pop(); - - return reduceToSingleString(output, base, braces); - } - - - function formatPrimitive(ctx, value) { - if (isUndefined(value)) - return ctx.stylize('undefined', 'undefined'); - if (isString(value)) { - var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') - .replace(/'/g, "\\'") - .replace(/\\"/g, '"') + '\''; - return ctx.stylize(simple, 'string'); - } - if (isNumber(value)) - return ctx.stylize('' + value, 'number'); - if (isBoolean(value)) - return ctx.stylize('' + value, 'boolean'); - // For some reason typeof null is "object", so special case here. - if (isNull(value)) - return ctx.stylize('null', 'null'); - } - - - function formatError(value) { - return '[' + Error.prototype.toString.call(value) + ']'; - } - - - function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { - var output = []; - for (var i = 0, l = value.length; i < l; ++i) { - if (hasOwnProperty(value, String(i))) { - output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, - String(i), true)); - } else { - output.push(''); - } - } - keys.forEach(function(key) { - if (!key.match(/^\d+$/)) { - output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, - key, true)); - } - }); - return output; - } - - - function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { - var name, str, desc; - desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; - if (desc.get) { - if (desc.set) { - str = ctx.stylize('[Getter/Setter]', 'special'); - } else { - str = ctx.stylize('[Getter]', 'special'); - } - } else { - if (desc.set) { - str = ctx.stylize('[Setter]', 'special'); - } - } - if (!hasOwnProperty(visibleKeys, key)) { - name = '[' + key + ']'; - } - if (!str) { - if (ctx.seen.indexOf(desc.value) < 0) { - if (isNull(recurseTimes)) { - str = formatValue(ctx, desc.value, null); - } else { - str = formatValue(ctx, desc.value, recurseTimes - 1); - } - if (str.indexOf('\n') > -1) { - if (array) { - str = str.split('\n').map(function(line) { - return ' ' + line; - }).join('\n').substr(2); - } else { - str = '\n' + str.split('\n').map(function(line) { - return ' ' + line; - }).join('\n'); - } - } - } else { - str = ctx.stylize('[Circular]', 'special'); - } - } - if (isUndefined(name)) { - if (array && key.match(/^\d+$/)) { - return str; - } - name = JSON.stringify('' + key); - if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { - name = name.substr(1, name.length - 2); - name = ctx.stylize(name, 'name'); - } else { - name = name.replace(/'/g, "\\'") - .replace(/\\"/g, '"') - .replace(/(^"|"$)/g, "'"); - name = ctx.stylize(name, 'string'); - } - } - - return name + ': ' + str; - } - - - function reduceToSingleString(output, base, braces) { - var length = output.reduce(function(prev, cur) { - if (cur.indexOf('\n') >= 0) ; - return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; - }, 0); - - if (length > 60) { - return braces[0] + - (base === '' ? '' : base + '\n ') + - ' ' + - output.join(',\n ') + - ' ' + - braces[1]; - } - - return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; - } - - - // NOTE: These type checking functions intentionally don't use `instanceof` - // because it is fragile and can be easily faked with `Object.create()`. - function isArray$1(ar) { - return Array.isArray(ar); - } - - function isBoolean(arg) { - return typeof arg === 'boolean'; - } - - function isNull(arg) { - return arg === null; - } - - function isNumber(arg) { - return typeof arg === 'number'; - } - - function isString(arg) { - return typeof arg === 'string'; - } - - function isUndefined(arg) { - return arg === void 0; - } - - function isRegExp(re) { - return isObject(re) && objectToString(re) === '[object RegExp]'; - } - - function isObject(arg) { - return typeof arg === 'object' && arg !== null; - } - - function isDate(d) { - return isObject(d) && objectToString(d) === '[object Date]'; - } - - function isError(e) { - return isObject(e) && - (objectToString(e) === '[object Error]' || e instanceof Error); - } - - function isFunction(arg) { - return typeof arg === 'function'; - } - - function objectToString(o) { - return Object.prototype.toString.call(o); - } - - function _extend(origin, add) { - // Don't do anything if add isn't an object - if (!add || !isObject(add)) return origin; - - var keys = Object.keys(add); - var i = keys.length; - while (i--) { - origin[keys[i]] = add[keys[i]]; - } - return origin; - } - function hasOwnProperty(obj, prop) { - return Object.prototype.hasOwnProperty.call(obj, prop); - } - - function BufferList() { - this.head = null; - this.tail = null; - this.length = 0; - } - - BufferList.prototype.push = function (v) { - var entry = { data: v, next: null }; - if (this.length > 0) this.tail.next = entry;else this.head = entry; - this.tail = entry; - ++this.length; - }; - - BufferList.prototype.unshift = function (v) { - var entry = { data: v, next: this.head }; - if (this.length === 0) this.tail = entry; - this.head = entry; - ++this.length; - }; - - BufferList.prototype.shift = function () { - if (this.length === 0) return; - var ret = this.head.data; - if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; - --this.length; - return ret; - }; - - BufferList.prototype.clear = function () { - this.head = this.tail = null; - this.length = 0; - }; - - BufferList.prototype.join = function (s) { - if (this.length === 0) return ''; - var p = this.head; - var ret = '' + p.data; - while (p = p.next) { - ret += s + p.data; - }return ret; - }; - - BufferList.prototype.concat = function (n) { - if (this.length === 0) return Buffer.alloc(0); - if (this.length === 1) return this.head.data; - var ret = Buffer.allocUnsafe(n >>> 0); - var p = this.head; - var i = 0; - while (p) { - p.data.copy(ret, i); - i += p.data.length; - p = p.next; - } - return ret; - }; - - // Copyright Joyent, Inc. and other Node contributors. - var isBufferEncoding = Buffer.isEncoding - || function(encoding) { - switch (encoding && encoding.toLowerCase()) { - case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true; - default: return false; - } - }; - - - function assertEncoding(encoding) { - if (encoding && !isBufferEncoding(encoding)) { - throw new Error('Unknown encoding: ' + encoding); - } - } - - // StringDecoder provides an interface for efficiently splitting a series of - // buffers into a series of JS strings without breaking apart multi-byte - // characters. CESU-8 is handled as part of the UTF-8 encoding. - // - // @TODO Handling all encodings inside a single object makes it very difficult - // to reason about this code, so it should be split up in the future. - // @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code - // points as used by CESU-8. - function StringDecoder(encoding) { - this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, ''); - assertEncoding(encoding); - switch (this.encoding) { - case 'utf8': - // CESU-8 represents each of Surrogate Pair by 3-bytes - this.surrogateSize = 3; - break; - case 'ucs2': - case 'utf16le': - // UTF-16 represents each of Surrogate Pair by 2-bytes - this.surrogateSize = 2; - this.detectIncompleteChar = utf16DetectIncompleteChar; - break; - case 'base64': - // Base-64 stores 3 bytes in 4 chars, and pads the remainder. - this.surrogateSize = 3; - this.detectIncompleteChar = base64DetectIncompleteChar; - break; - default: - this.write = passThroughWrite; - return; - } - - // Enough space to store all bytes of a single character. UTF-8 needs 4 - // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate). - this.charBuffer = new Buffer(6); - // Number of bytes received for the current incomplete multi-byte character. - this.charReceived = 0; - // Number of bytes expected for the current incomplete multi-byte character. - this.charLength = 0; - } - - // write decodes the given buffer and returns it as JS string that is - // guaranteed to not contain any partial multi-byte characters. Any partial - // character found at the end of the buffer is buffered up, and will be - // returned when calling write again with the remaining bytes. - // - // Note: Converting a Buffer containing an orphan surrogate to a String - // currently works, but converting a String to a Buffer (via `new Buffer`, or - // Buffer#write) will replace incomplete surrogates with the unicode - // replacement character. See https://codereview.chromium.org/121173009/ . - StringDecoder.prototype.write = function(buffer) { - var charStr = ''; - // if our last write ended with an incomplete multibyte character - while (this.charLength) { - // determine how many remaining bytes this buffer has to offer for this char - var available = (buffer.length >= this.charLength - this.charReceived) ? - this.charLength - this.charReceived : - buffer.length; - - // add the new bytes to the char buffer - buffer.copy(this.charBuffer, this.charReceived, 0, available); - this.charReceived += available; - - if (this.charReceived < this.charLength) { - // still not enough chars in this buffer? wait for more ... - return ''; - } - - // remove bytes belonging to the current character from the buffer - buffer = buffer.slice(available, buffer.length); - - // get the character that was split - charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding); - - // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character - var charCode = charStr.charCodeAt(charStr.length - 1); - if (charCode >= 0xD800 && charCode <= 0xDBFF) { - this.charLength += this.surrogateSize; - charStr = ''; - continue; - } - this.charReceived = this.charLength = 0; - - // if there are no more bytes in this buffer, just emit our char - if (buffer.length === 0) { - return charStr; - } - break; - } - - // determine and set charLength / charReceived - this.detectIncompleteChar(buffer); - - var end = buffer.length; - if (this.charLength) { - // buffer the incomplete character bytes we got - buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end); - end -= this.charReceived; - } - - charStr += buffer.toString(this.encoding, 0, end); - - var end = charStr.length - 1; - var charCode = charStr.charCodeAt(end); - // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character - if (charCode >= 0xD800 && charCode <= 0xDBFF) { - var size = this.surrogateSize; - this.charLength += size; - this.charReceived += size; - this.charBuffer.copy(this.charBuffer, size, 0, size); - buffer.copy(this.charBuffer, 0, 0, size); - return charStr.substring(0, end); - } - - // or just emit the charStr - return charStr; - }; - - // detectIncompleteChar determines if there is an incomplete UTF-8 character at - // the end of the given buffer. If so, it sets this.charLength to the byte - // length that character, and sets this.charReceived to the number of bytes - // that are available for this character. - StringDecoder.prototype.detectIncompleteChar = function(buffer) { - // determine how many bytes we have to check at the end of this buffer - var i = (buffer.length >= 3) ? 3 : buffer.length; - - // Figure out if one of the last i bytes of our buffer announces an - // incomplete char. - for (; i > 0; i--) { - var c = buffer[buffer.length - i]; - - // See http://en.wikipedia.org/wiki/UTF-8#Description - - // 110XXXXX - if (i == 1 && c >> 5 == 0x06) { - this.charLength = 2; - break; - } - - // 1110XXXX - if (i <= 2 && c >> 4 == 0x0E) { - this.charLength = 3; - break; - } - - // 11110XXX - if (i <= 3 && c >> 3 == 0x1E) { - this.charLength = 4; - break; - } - } - this.charReceived = i; - }; - - StringDecoder.prototype.end = function(buffer) { - var res = ''; - if (buffer && buffer.length) - res = this.write(buffer); - - if (this.charReceived) { - var cr = this.charReceived; - var buf = this.charBuffer; - var enc = this.encoding; - res += buf.slice(0, cr).toString(enc); - } - - return res; - }; - - function passThroughWrite(buffer) { - return buffer.toString(this.encoding); - } - - function utf16DetectIncompleteChar(buffer) { - this.charReceived = buffer.length % 2; - this.charLength = this.charReceived ? 2 : 0; - } - - function base64DetectIncompleteChar(buffer) { - this.charReceived = buffer.length % 3; - this.charLength = this.charReceived ? 3 : 0; - } - - Readable.ReadableState = ReadableState; - - var debug = debuglog('stream'); - inherits$1(Readable, EventEmitter); - - function prependListener(emitter, event, fn) { - // Sadly this is not cacheable as some libraries bundle their own - // event emitter implementation with them. - if (typeof emitter.prependListener === 'function') { - return emitter.prependListener(event, fn); - } else { - // This is a hack to make sure that our error handler is attached before any - // userland ones. NEVER DO THIS. This is here only because this code needs - // to continue to work with older versions of Node.js that do not include - // the prependListener() method. The goal is to eventually remove this hack. - if (!emitter._events || !emitter._events[event]) - emitter.on(event, fn); - else if (Array.isArray(emitter._events[event])) - emitter._events[event].unshift(fn); - else - emitter._events[event] = [fn, emitter._events[event]]; - } - } - function listenerCount$1 (emitter, type) { - return emitter.listeners(type).length; - } - function ReadableState(options, stream) { - - options = options || {}; - - // object stream flag. Used to make read(n) ignore n and to - // make all the buffer merging and length checks go away - this.objectMode = !!options.objectMode; - - if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.readableObjectMode; - - // the point at which it stops calling _read() to fill the buffer - // Note: 0 is a valid value, means "don't call _read preemptively ever" - var hwm = options.highWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; - - // cast to ints. - this.highWaterMark = ~ ~this.highWaterMark; - - // A linked list is used to store data chunks instead of an array because the - // linked list can remove elements from the beginning faster than - // array.shift() - this.buffer = new BufferList(); - this.length = 0; - this.pipes = null; - this.pipesCount = 0; - this.flowing = null; - this.ended = false; - this.endEmitted = false; - this.reading = false; - - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; - - // whenever we return null, then we set a flag to say - // that we're awaiting a 'readable' event emission. - this.needReadable = false; - this.emittedReadable = false; - this.readableListening = false; - this.resumeScheduled = false; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // when piping, we only care about 'readable' events that happen - // after read()ing all the bytes and not getting any pushback. - this.ranOut = false; - - // the number of writers that are awaiting a drain event in .pipe()s - this.awaitDrain = 0; - - // if true, a maybeReadMore has been scheduled - this.readingMore = false; - - this.decoder = null; - this.encoding = null; - if (options.encoding) { - this.decoder = new StringDecoder(options.encoding); - this.encoding = options.encoding; - } - } - function Readable(options) { - - if (!(this instanceof Readable)) return new Readable(options); - - this._readableState = new ReadableState(options, this); - - // legacy - this.readable = true; - - if (options && typeof options.read === 'function') this._read = options.read; - - EventEmitter.call(this); - } - - // Manually shove something into the read() buffer. - // This returns true if the highWaterMark has not been hit yet, - // similar to how Writable.write() returns true if you should - // write() some more. - Readable.prototype.push = function (chunk, encoding) { - var state = this._readableState; - - if (!state.objectMode && typeof chunk === 'string') { - encoding = encoding || state.defaultEncoding; - if (encoding !== state.encoding) { - chunk = Buffer.from(chunk, encoding); - encoding = ''; - } - } - - return readableAddChunk(this, state, chunk, encoding, false); - }; - - // Unshift should *always* be something directly out of read() - Readable.prototype.unshift = function (chunk) { - var state = this._readableState; - return readableAddChunk(this, state, chunk, '', true); - }; - - Readable.prototype.isPaused = function () { - return this._readableState.flowing === false; - }; - - function readableAddChunk(stream, state, chunk, encoding, addToFront) { - var er = chunkInvalid(state, chunk); - if (er) { - stream.emit('error', er); - } else if (chunk === null) { - state.reading = false; - onEofChunk(stream, state); - } else if (state.objectMode || chunk && chunk.length > 0) { - if (state.ended && !addToFront) { - var e = new Error('stream.push() after EOF'); - stream.emit('error', e); - } else if (state.endEmitted && addToFront) { - var _e = new Error('stream.unshift() after end event'); - stream.emit('error', _e); - } else { - var skipAdd; - if (state.decoder && !addToFront && !encoding) { - chunk = state.decoder.write(chunk); - skipAdd = !state.objectMode && chunk.length === 0; - } - - if (!addToFront) state.reading = false; - - // Don't add to the buffer if we've decoded to an empty string chunk and - // we're not in object mode - if (!skipAdd) { - // if we want the data now, just emit it. - if (state.flowing && state.length === 0 && !state.sync) { - stream.emit('data', chunk); - stream.read(0); - } else { - // update the buffer info. - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); - - if (state.needReadable) emitReadable(stream); - } - } - - maybeReadMore(stream, state); - } - } else if (!addToFront) { - state.reading = false; - } - - return needMoreData(state); - } - - // if it's past the high water mark, we can push in some more. - // Also, if we have no data yet, we can stand some - // more bytes. This is to work around cases where hwm=0, - // such as the repl. Also, if the push() triggered a - // readable event, and the user called read(largeNumber) such that - // needReadable was set, then we ought to push more, so that another - // 'readable' event will be triggered. - function needMoreData(state) { - return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); - } - - // backwards compatibility. - Readable.prototype.setEncoding = function (enc) { - this._readableState.decoder = new StringDecoder(enc); - this._readableState.encoding = enc; - return this; - }; - - // Don't raise the hwm > 8MB - var MAX_HWM = 0x800000; - function computeNewHighWaterMark(n) { - if (n >= MAX_HWM) { - n = MAX_HWM; - } else { - // Get the next highest power of 2 to prevent increasing hwm excessively in - // tiny amounts - n--; - n |= n >>> 1; - n |= n >>> 2; - n |= n >>> 4; - n |= n >>> 8; - n |= n >>> 16; - n++; - } - return n; - } - - // This function is designed to be inlinable, so please take care when making - // changes to the function body. - function howMuchToRead(n, state) { - if (n <= 0 || state.length === 0 && state.ended) return 0; - if (state.objectMode) return 1; - if (n !== n) { - // Only flow one buffer at a time - if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; - } - // If we're asking for more than the current hwm, then raise the hwm. - if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); - if (n <= state.length) return n; - // Don't have enough - if (!state.ended) { - state.needReadable = true; - return 0; - } - return state.length; - } - - // you can override either this method, or the async _read(n) below. - Readable.prototype.read = function (n) { - debug('read', n); - n = parseInt(n, 10); - var state = this._readableState; - var nOrig = n; - - if (n !== 0) state.emittedReadable = false; - - // if we're doing read(0) to trigger a readable event, but we - // already have a bunch of data in the buffer, then just trigger - // the 'readable' event and move on. - if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { - debug('read: emitReadable', state.length, state.ended); - if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); - return null; - } - - n = howMuchToRead(n, state); - - // if we've ended, and we're now clear, then finish it up. - if (n === 0 && state.ended) { - if (state.length === 0) endReadable(this); - return null; - } - - // All the actual chunk generation logic needs to be - // *below* the call to _read. The reason is that in certain - // synthetic stream cases, such as passthrough streams, _read - // may be a completely synchronous operation which may change - // the state of the read buffer, providing enough data when - // before there was *not* enough. - // - // So, the steps are: - // 1. Figure out what the state of things will be after we do - // a read from the buffer. - // - // 2. If that resulting state will trigger a _read, then call _read. - // Note that this may be asynchronous, or synchronous. Yes, it is - // deeply ugly to write APIs this way, but that still doesn't mean - // that the Readable class should behave improperly, as streams are - // designed to be sync/async agnostic. - // Take note if the _read call is sync or async (ie, if the read call - // has returned yet), so that we know whether or not it's safe to emit - // 'readable' etc. - // - // 3. Actually pull the requested chunks out of the buffer and return. - - // if we need a readable event, then we need to do some reading. - var doRead = state.needReadable; - debug('need readable', doRead); - - // if we currently have less than the highWaterMark, then also read some - if (state.length === 0 || state.length - n < state.highWaterMark) { - doRead = true; - debug('length less than watermark', doRead); - } - - // however, if we've ended, then there's no point, and if we're already - // reading, then it's unnecessary. - if (state.ended || state.reading) { - doRead = false; - debug('reading or ended', doRead); - } else if (doRead) { - debug('do read'); - state.reading = true; - state.sync = true; - // if the length is currently zero, then we *need* a readable event. - if (state.length === 0) state.needReadable = true; - // call internal read method - this._read(state.highWaterMark); - state.sync = false; - // If _read pushed data synchronously, then `reading` will be false, - // and we need to re-evaluate how much data we can return to the user. - if (!state.reading) n = howMuchToRead(nOrig, state); - } - - var ret; - if (n > 0) ret = fromList(n, state);else ret = null; - - if (ret === null) { - state.needReadable = true; - n = 0; - } else { - state.length -= n; - } - - if (state.length === 0) { - // If we have nothing in the buffer, then we want to know - // as soon as we *do* get something into the buffer. - if (!state.ended) state.needReadable = true; - - // If we tried to read() past the EOF, then emit end on the next tick. - if (nOrig !== n && state.ended) endReadable(this); - } - - if (ret !== null) this.emit('data', ret); - - return ret; - }; - - function chunkInvalid(state, chunk) { - var er = null; - if (!isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); - } - return er; - } - - function onEofChunk(stream, state) { - if (state.ended) return; - if (state.decoder) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) { - state.buffer.push(chunk); - state.length += state.objectMode ? 1 : chunk.length; - } - } - state.ended = true; - - // emit 'readable' now to make sure it gets picked up. - emitReadable(stream); - } - - // Don't emit readable right away in sync mode, because this can trigger - // another read() call => stack overflow. This way, it might trigger - // a nextTick recursion warning, but that's not so bad. - function emitReadable(stream) { - var state = stream._readableState; - state.needReadable = false; - if (!state.emittedReadable) { - debug('emitReadable', state.flowing); - state.emittedReadable = true; - if (state.sync) nextTick(emitReadable_, stream);else emitReadable_(stream); - } - } - - function emitReadable_(stream) { - debug('emit readable'); - stream.emit('readable'); - flow(stream); - } - - // at this point, the user has presumably seen the 'readable' event, - // and called read() to consume some data. that may have triggered - // in turn another _read(n) call, in which case reading = true if - // it's in progress. - // However, if we're not ended, or reading, and the length < hwm, - // then go ahead and try to read some more preemptively. - function maybeReadMore(stream, state) { - if (!state.readingMore) { - state.readingMore = true; - nextTick(maybeReadMore_, stream, state); - } - } - - function maybeReadMore_(stream, state) { - var len = state.length; - while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { - debug('maybeReadMore read 0'); - stream.read(0); - if (len === state.length) - // didn't get any data, stop spinning. - break;else len = state.length; - } - state.readingMore = false; - } - - // abstract method. to be overridden in specific implementation classes. - // call cb(er, data) where data is <= n in length. - // for virtual (non-string, non-buffer) streams, "length" is somewhat - // arbitrary, and perhaps not very meaningful. - Readable.prototype._read = function (n) { - this.emit('error', new Error('not implemented')); - }; - - Readable.prototype.pipe = function (dest, pipeOpts) { - var src = this; - var state = this._readableState; - - switch (state.pipesCount) { - case 0: - state.pipes = dest; - break; - case 1: - state.pipes = [state.pipes, dest]; - break; - default: - state.pipes.push(dest); - break; - } - state.pipesCount += 1; - debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); - - var doEnd = (!pipeOpts || pipeOpts.end !== false); - - var endFn = doEnd ? onend : cleanup; - if (state.endEmitted) nextTick(endFn);else src.once('end', endFn); - - dest.on('unpipe', onunpipe); - function onunpipe(readable) { - debug('onunpipe'); - if (readable === src) { - cleanup(); - } - } - - function onend() { - debug('onend'); - dest.end(); - } - - // when the dest drains, it reduces the awaitDrain counter - // on the source. This would be more elegant with a .once() - // handler in flow(), but adding and removing repeatedly is - // too slow. - var ondrain = pipeOnDrain(src); - dest.on('drain', ondrain); - - var cleanedUp = false; - function cleanup() { - debug('cleanup'); - // cleanup event handlers once the pipe is broken - dest.removeListener('close', onclose); - dest.removeListener('finish', onfinish); - dest.removeListener('drain', ondrain); - dest.removeListener('error', onerror); - dest.removeListener('unpipe', onunpipe); - src.removeListener('end', onend); - src.removeListener('end', cleanup); - src.removeListener('data', ondata); - - cleanedUp = true; - - // if the reader is waiting for a drain event from this - // specific writer, then it would cause it to never start - // flowing again. - // So, if this is awaiting a drain, then we just call it now. - // If we don't know, then assume that we are waiting for one. - if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); - } - - // If the user pushes more data while we're writing to dest then we'll end up - // in ondata again. However, we only want to increase awaitDrain once because - // dest will only emit one 'drain' event for the multiple writes. - // => Introduce a guard on increasing awaitDrain. - var increasedAwaitDrain = false; - src.on('data', ondata); - function ondata(chunk) { - debug('ondata'); - increasedAwaitDrain = false; - var ret = dest.write(chunk); - if (false === ret && !increasedAwaitDrain) { - // If the user unpiped during `dest.write()`, it is possible - // to get stuck in a permanently paused state if that write - // also returned false. - // => Check whether `dest` is still a piping destination. - if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { - debug('false write response, pause', src._readableState.awaitDrain); - src._readableState.awaitDrain++; - increasedAwaitDrain = true; - } - src.pause(); - } - } - - // if the dest has an error, then stop piping into it. - // however, don't suppress the throwing behavior for this. - function onerror(er) { - debug('onerror', er); - unpipe(); - dest.removeListener('error', onerror); - if (listenerCount$1(dest, 'error') === 0) dest.emit('error', er); - } - - // Make sure our error handler is attached before userland ones. - prependListener(dest, 'error', onerror); - - // Both close and finish should trigger unpipe, but only once. - function onclose() { - dest.removeListener('finish', onfinish); - unpipe(); - } - dest.once('close', onclose); - function onfinish() { - debug('onfinish'); - dest.removeListener('close', onclose); - unpipe(); - } - dest.once('finish', onfinish); - - function unpipe() { - debug('unpipe'); - src.unpipe(dest); - } - - // tell the dest that it's being piped to - dest.emit('pipe', src); - - // start the flow if it hasn't been started already. - if (!state.flowing) { - debug('pipe resume'); - src.resume(); - } - - return dest; - }; - - function pipeOnDrain(src) { - return function () { - var state = src._readableState; - debug('pipeOnDrain', state.awaitDrain); - if (state.awaitDrain) state.awaitDrain--; - if (state.awaitDrain === 0 && src.listeners('data').length) { - state.flowing = true; - flow(src); - } - }; - } - - Readable.prototype.unpipe = function (dest) { - var state = this._readableState; - - // if we're not piping anywhere, then do nothing. - if (state.pipesCount === 0) return this; - - // just one destination. most common case. - if (state.pipesCount === 1) { - // passed in one, but it's not the right one. - if (dest && dest !== state.pipes) return this; - - if (!dest) dest = state.pipes; - - // got a match. - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - if (dest) dest.emit('unpipe', this); - return this; - } - - // slow case. multiple pipe destinations. - - if (!dest) { - // remove all. - var dests = state.pipes; - var len = state.pipesCount; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - - for (var _i = 0; _i < len; _i++) { - dests[_i].emit('unpipe', this); - }return this; - } - - // try to find the right one. - var i = indexOf(state.pipes, dest); - if (i === -1) return this; - - state.pipes.splice(i, 1); - state.pipesCount -= 1; - if (state.pipesCount === 1) state.pipes = state.pipes[0]; - - dest.emit('unpipe', this); - - return this; - }; - - // set up data events if they are asked for - // Ensure readable listeners eventually get something - Readable.prototype.on = function (ev, fn) { - var res = EventEmitter.prototype.on.call(this, ev, fn); - - if (ev === 'data') { - // Start flowing on next tick if stream isn't explicitly paused - if (this._readableState.flowing !== false) this.resume(); - } else if (ev === 'readable') { - var state = this._readableState; - if (!state.endEmitted && !state.readableListening) { - state.readableListening = state.needReadable = true; - state.emittedReadable = false; - if (!state.reading) { - nextTick(nReadingNextTick, this); - } else if (state.length) { - emitReadable(this); - } - } - } - - return res; - }; - Readable.prototype.addListener = Readable.prototype.on; - - function nReadingNextTick(self) { - debug('readable nexttick read 0'); - self.read(0); - } - - // pause() and resume() are remnants of the legacy readable stream API - // If the user uses them, then switch into old mode. - Readable.prototype.resume = function () { - var state = this._readableState; - if (!state.flowing) { - debug('resume'); - state.flowing = true; - resume(this, state); - } - return this; - }; - - function resume(stream, state) { - if (!state.resumeScheduled) { - state.resumeScheduled = true; - nextTick(resume_, stream, state); - } - } - - function resume_(stream, state) { - if (!state.reading) { - debug('resume read 0'); - stream.read(0); - } - - state.resumeScheduled = false; - state.awaitDrain = 0; - stream.emit('resume'); - flow(stream); - if (state.flowing && !state.reading) stream.read(0); - } - - Readable.prototype.pause = function () { - debug('call pause flowing=%j', this._readableState.flowing); - if (false !== this._readableState.flowing) { - debug('pause'); - this._readableState.flowing = false; - this.emit('pause'); - } - return this; - }; - - function flow(stream) { - var state = stream._readableState; - debug('flow', state.flowing); - while (state.flowing && stream.read() !== null) {} - } - - // wrap an old-style stream as the async data source. - // This is *not* part of the readable stream interface. - // It is an ugly unfortunate mess of history. - Readable.prototype.wrap = function (stream) { - var state = this._readableState; - var paused = false; - - var self = this; - stream.on('end', function () { - debug('wrapped end'); - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) self.push(chunk); - } - - self.push(null); - }); - - stream.on('data', function (chunk) { - debug('wrapped data'); - if (state.decoder) chunk = state.decoder.write(chunk); - - // don't skip over falsy values in objectMode - if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; - - var ret = self.push(chunk); - if (!ret) { - paused = true; - stream.pause(); - } - }); - - // proxy all the other methods. - // important when wrapping filters and duplexes. - for (var i in stream) { - if (this[i] === undefined && typeof stream[i] === 'function') { - this[i] = function (method) { - return function () { - return stream[method].apply(stream, arguments); - }; - }(i); - } - } - - // proxy certain important events. - var events = ['error', 'close', 'destroy', 'pause', 'resume']; - forEach(events, function (ev) { - stream.on(ev, self.emit.bind(self, ev)); - }); - - // when we try to consume some more bytes, simply unpause the - // underlying stream. - self._read = function (n) { - debug('wrapped _read', n); - if (paused) { - paused = false; - stream.resume(); - } - }; - - return self; - }; - - // exposed for testing purposes only. - Readable._fromList = fromList; - - // Pluck off n bytes from an array of buffers. - // Length is the combined lengths of all the buffers in the list. - // This function is designed to be inlinable, so please take care when making - // changes to the function body. - function fromList(n, state) { - // nothing buffered - if (state.length === 0) return null; - - var ret; - if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { - // read it all, truncate the list - if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length); - state.buffer.clear(); - } else { - // read part of list - ret = fromListPartial(n, state.buffer, state.decoder); - } - - return ret; - } - - // Extracts only enough buffered data to satisfy the amount requested. - // This function is designed to be inlinable, so please take care when making - // changes to the function body. - function fromListPartial(n, list, hasStrings) { - var ret; - if (n < list.head.data.length) { - // slice is the same for buffers and strings - ret = list.head.data.slice(0, n); - list.head.data = list.head.data.slice(n); - } else if (n === list.head.data.length) { - // first chunk is a perfect match - ret = list.shift(); - } else { - // result spans more than one buffer - ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); - } - return ret; - } - - // Copies a specified amount of characters from the list of buffered data - // chunks. - // This function is designed to be inlinable, so please take care when making - // changes to the function body. - function copyFromBufferString(n, list) { - var p = list.head; - var c = 1; - var ret = p.data; - n -= ret.length; - while (p = p.next) { - var str = p.data; - var nb = n > str.length ? str.length : n; - if (nb === str.length) ret += str;else ret += str.slice(0, n); - n -= nb; - if (n === 0) { - if (nb === str.length) { - ++c; - if (p.next) list.head = p.next;else list.head = list.tail = null; - } else { - list.head = p; - p.data = str.slice(nb); - } - break; - } - ++c; - } - list.length -= c; - return ret; - } - - // Copies a specified amount of bytes from the list of buffered data chunks. - // This function is designed to be inlinable, so please take care when making - // changes to the function body. - function copyFromBuffer(n, list) { - var ret = Buffer.allocUnsafe(n); - var p = list.head; - var c = 1; - p.data.copy(ret); - n -= p.data.length; - while (p = p.next) { - var buf = p.data; - var nb = n > buf.length ? buf.length : n; - buf.copy(ret, ret.length - n, 0, nb); - n -= nb; - if (n === 0) { - if (nb === buf.length) { - ++c; - if (p.next) list.head = p.next;else list.head = list.tail = null; - } else { - list.head = p; - p.data = buf.slice(nb); - } - break; - } - ++c; - } - list.length -= c; - return ret; - } - - function endReadable(stream) { - var state = stream._readableState; - - // If we get here before consuming all the bytes, then that is a - // bug in node. Should never happen. - if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); - - if (!state.endEmitted) { - state.ended = true; - nextTick(endReadableNT, state, stream); - } - } - - function endReadableNT(state, stream) { - // Check that we didn't get one last unshift. - if (!state.endEmitted && state.length === 0) { - state.endEmitted = true; - stream.readable = false; - stream.emit('end'); - } - } - - function forEach(xs, f) { - for (var i = 0, l = xs.length; i < l; i++) { - f(xs[i], i); - } - } - - function indexOf(xs, x) { - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) return i; - } - return -1; - } - - // A bit simpler than readable streams. - Writable.WritableState = WritableState; - inherits$1(Writable, EventEmitter); - - function nop() {} - - function WriteReq(chunk, encoding, cb) { - this.chunk = chunk; - this.encoding = encoding; - this.callback = cb; - this.next = null; - } - - function WritableState(options, stream) { - Object.defineProperty(this, 'buffer', { - get: deprecate(function () { - return this.getBuffer(); - }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.') - }); - options = options || {}; - - // object stream flag to indicate whether or not this stream - // contains buffers or objects. - this.objectMode = !!options.objectMode; - - if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.writableObjectMode; - - // the point at which write() starts returning false - // Note: 0 is a valid value, means that we always return false if - // the entire buffer is not flushed immediately on write() - var hwm = options.highWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; - - // cast to ints. - this.highWaterMark = ~ ~this.highWaterMark; - - this.needDrain = false; - // at the start of calling end() - this.ending = false; - // when end() has been called, and returned - this.ended = false; - // when 'finish' is emitted - this.finished = false; - - // should we decode strings into buffers before passing to _write? - // this is here so that some node-core streams can optimize string - // handling at a lower level. - var noDecode = options.decodeStrings === false; - this.decodeStrings = !noDecode; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // not an actual buffer we keep track of, but a measurement - // of how much we're waiting to get pushed to some underlying - // socket or file. - this.length = 0; - - // a flag to see when we're in the middle of a write. - this.writing = false; - - // when true all writes will be buffered until .uncork() call - this.corked = 0; - - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; - - // a flag to know if we're processing previously buffered items, which - // may call the _write() callback in the same tick, so that we don't - // end up in an overlapped onwrite situation. - this.bufferProcessing = false; - - // the callback that's passed to _write(chunk,cb) - this.onwrite = function (er) { - onwrite(stream, er); - }; - - // the callback that the user supplies to write(chunk,encoding,cb) - this.writecb = null; - - // the amount that is being written when _write is called. - this.writelen = 0; - - this.bufferedRequest = null; - this.lastBufferedRequest = null; - - // number of pending user-supplied write callbacks - // this must be 0 before 'finish' can be emitted - this.pendingcb = 0; - - // emit prefinish if the only thing we're waiting for is _write cbs - // This is relevant for synchronous Transform streams - this.prefinished = false; - - // True if the error was already emitted and should not be thrown again - this.errorEmitted = false; - - // count buffered requests - this.bufferedRequestCount = 0; - - // allocate the first CorkedRequest, there is always - // one allocated and free to use, and we maintain at most two - this.corkedRequestsFree = new CorkedRequest(this); - } - - WritableState.prototype.getBuffer = function writableStateGetBuffer() { - var current = this.bufferedRequest; - var out = []; - while (current) { - out.push(current); - current = current.next; - } - return out; - }; - function Writable(options) { - - // Writable ctor is applied to Duplexes, though they're not - // instanceof Writable, they're instanceof Readable. - if (!(this instanceof Writable) && !(this instanceof Duplex)) return new Writable(options); - - this._writableState = new WritableState(options, this); - - // legacy. - this.writable = true; - - if (options) { - if (typeof options.write === 'function') this._write = options.write; - - if (typeof options.writev === 'function') this._writev = options.writev; - } - - EventEmitter.call(this); - } - - // Otherwise people can pipe Writable streams, which is just wrong. - Writable.prototype.pipe = function () { - this.emit('error', new Error('Cannot pipe, not readable')); - }; - - function writeAfterEnd(stream, cb) { - var er = new Error('write after end'); - // TODO: defer error events consistently everywhere, not just the cb - stream.emit('error', er); - nextTick(cb, er); - } - - // If we get something that is not a buffer, string, null, or undefined, - // and we're not in objectMode, then that's an error. - // Otherwise stream chunks are all considered to be of length=1, and the - // watermarks determine how many objects to keep in the buffer, rather than - // how many bytes or characters. - function validChunk(stream, state, chunk, cb) { - var valid = true; - var er = false; - // Always throw error if a null is written - // if we are not in object mode then throw - // if it is not a buffer, string, or undefined. - if (chunk === null) { - er = new TypeError('May not write null values to stream'); - } else if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); - } - if (er) { - stream.emit('error', er); - nextTick(cb, er); - valid = false; - } - return valid; - } - - Writable.prototype.write = function (chunk, encoding, cb) { - var state = this._writableState; - var ret = false; - - if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (Buffer.isBuffer(chunk)) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; - - if (typeof cb !== 'function') cb = nop; - - if (state.ended) writeAfterEnd(this, cb);else if (validChunk(this, state, chunk, cb)) { - state.pendingcb++; - ret = writeOrBuffer(this, state, chunk, encoding, cb); - } - - return ret; - }; - - Writable.prototype.cork = function () { - var state = this._writableState; - - state.corked++; - }; - - Writable.prototype.uncork = function () { - var state = this._writableState; - - if (state.corked) { - state.corked--; - - if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); - } - }; - - Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { - // node::ParseEncoding() requires lower case. - if (typeof encoding === 'string') encoding = encoding.toLowerCase(); - if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); - this._writableState.defaultEncoding = encoding; - return this; - }; - - function decodeChunk(state, chunk, encoding) { - if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { - chunk = Buffer.from(chunk, encoding); - } - return chunk; - } - - // if we're already writing something, then just put this - // in the queue, and wait our turn. Otherwise, call _write - // If we return false, then we need a drain event, so set that flag. - function writeOrBuffer(stream, state, chunk, encoding, cb) { - chunk = decodeChunk(state, chunk, encoding); - - if (Buffer.isBuffer(chunk)) encoding = 'buffer'; - var len = state.objectMode ? 1 : chunk.length; - - state.length += len; - - var ret = state.length < state.highWaterMark; - // we must ensure that previous needDrain will not be reset to false. - if (!ret) state.needDrain = true; - - if (state.writing || state.corked) { - var last = state.lastBufferedRequest; - state.lastBufferedRequest = new WriteReq(chunk, encoding, cb); - if (last) { - last.next = state.lastBufferedRequest; - } else { - state.bufferedRequest = state.lastBufferedRequest; - } - state.bufferedRequestCount += 1; - } else { - doWrite(stream, state, false, len, chunk, encoding, cb); - } - - return ret; - } - - function doWrite(stream, state, writev, len, chunk, encoding, cb) { - state.writelen = len; - state.writecb = cb; - state.writing = true; - state.sync = true; - if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); - state.sync = false; - } - - function onwriteError(stream, state, sync, er, cb) { - --state.pendingcb; - if (sync) nextTick(cb, er);else cb(er); - - stream._writableState.errorEmitted = true; - stream.emit('error', er); - } - - function onwriteStateUpdate(state) { - state.writing = false; - state.writecb = null; - state.length -= state.writelen; - state.writelen = 0; - } - - function onwrite(stream, er) { - var state = stream._writableState; - var sync = state.sync; - var cb = state.writecb; - - onwriteStateUpdate(state); - - if (er) onwriteError(stream, state, sync, er, cb);else { - // Check if we're actually ready to finish, but don't emit yet - var finished = needFinish(state); - - if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { - clearBuffer(stream, state); - } - - if (sync) { - /**/ - nextTick(afterWrite, stream, state, finished, cb); - /**/ - } else { - afterWrite(stream, state, finished, cb); - } - } - } - - function afterWrite(stream, state, finished, cb) { - if (!finished) onwriteDrain(stream, state); - state.pendingcb--; - cb(); - finishMaybe(stream, state); - } - - // Must force callback to be called on nextTick, so that we don't - // emit 'drain' before the write() consumer gets the 'false' return - // value, and has a chance to attach a 'drain' listener. - function onwriteDrain(stream, state) { - if (state.length === 0 && state.needDrain) { - state.needDrain = false; - stream.emit('drain'); - } - } - - // if there's something in the buffer waiting, then process it - function clearBuffer(stream, state) { - state.bufferProcessing = true; - var entry = state.bufferedRequest; - - if (stream._writev && entry && entry.next) { - // Fast case, write everything using _writev() - var l = state.bufferedRequestCount; - var buffer = new Array(l); - var holder = state.corkedRequestsFree; - holder.entry = entry; - - var count = 0; - while (entry) { - buffer[count] = entry; - entry = entry.next; - count += 1; - } - - doWrite(stream, state, true, state.length, buffer, '', holder.finish); - - // doWrite is almost always async, defer these to save a bit of time - // as the hot path ends with doWrite - state.pendingcb++; - state.lastBufferedRequest = null; - if (holder.next) { - state.corkedRequestsFree = holder.next; - holder.next = null; - } else { - state.corkedRequestsFree = new CorkedRequest(state); - } - } else { - // Slow case, write chunks one-by-one - while (entry) { - var chunk = entry.chunk; - var encoding = entry.encoding; - var cb = entry.callback; - var len = state.objectMode ? 1 : chunk.length; - - doWrite(stream, state, false, len, chunk, encoding, cb); - entry = entry.next; - // if we didn't call the onwrite immediately, then - // it means that we need to wait until it does. - // also, that means that the chunk and cb are currently - // being processed, so move the buffer counter past them. - if (state.writing) { - break; - } - } - - if (entry === null) state.lastBufferedRequest = null; - } - - state.bufferedRequestCount = 0; - state.bufferedRequest = entry; - state.bufferProcessing = false; - } - - Writable.prototype._write = function (chunk, encoding, cb) { - cb(new Error('not implemented')); - }; - - Writable.prototype._writev = null; - - Writable.prototype.end = function (chunk, encoding, cb) { - var state = this._writableState; - - if (typeof chunk === 'function') { - cb = chunk; - chunk = null; - encoding = null; - } else if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); - - // .end() fully uncorks - if (state.corked) { - state.corked = 1; - this.uncork(); - } - - // ignore unnecessary end() calls. - if (!state.ending && !state.finished) endWritable(this, state, cb); - }; - - function needFinish(state) { - return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; - } - - function prefinish(stream, state) { - if (!state.prefinished) { - state.prefinished = true; - stream.emit('prefinish'); - } - } - - function finishMaybe(stream, state) { - var need = needFinish(state); - if (need) { - if (state.pendingcb === 0) { - prefinish(stream, state); - state.finished = true; - stream.emit('finish'); - } else { - prefinish(stream, state); - } - } - return need; - } - - function endWritable(stream, state, cb) { - state.ending = true; - finishMaybe(stream, state); - if (cb) { - if (state.finished) nextTick(cb);else stream.once('finish', cb); - } - state.ended = true; - stream.writable = false; - } - - // It seems a linked list but it is not - // there will be only 2 of these for each stream - function CorkedRequest(state) { - var _this = this; - - this.next = null; - this.entry = null; - - this.finish = function (err) { - var entry = _this.entry; - _this.entry = null; - while (entry) { - var cb = entry.callback; - state.pendingcb--; - cb(err); - entry = entry.next; - } - if (state.corkedRequestsFree) { - state.corkedRequestsFree.next = _this; - } else { - state.corkedRequestsFree = _this; - } - }; - } - - inherits$1(Duplex, Readable); - - var keys = Object.keys(Writable.prototype); - for (var v = 0; v < keys.length; v++) { - var method = keys[v]; - if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; - } - function Duplex(options) { - if (!(this instanceof Duplex)) return new Duplex(options); - - Readable.call(this, options); - Writable.call(this, options); - - if (options && options.readable === false) this.readable = false; - - if (options && options.writable === false) this.writable = false; - - this.allowHalfOpen = true; - if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; - - this.once('end', onend); - } - - // the no-half-open enforcer - function onend() { - // if we allow half-open state, or if the writable side ended, - // then we're ok. - if (this.allowHalfOpen || this._writableState.ended) return; - - // no more data can be written. - // But allow more writes to happen in this tick. - nextTick(onEndNT, this); - } - - function onEndNT(self) { - self.end(); - } - - // a transform stream is a readable/writable stream where you do - inherits$1(Transform, Duplex); - - function TransformState(stream) { - this.afterTransform = function (er, data) { - return afterTransform(stream, er, data); - }; - - this.needTransform = false; - this.transforming = false; - this.writecb = null; - this.writechunk = null; - this.writeencoding = null; - } - - function afterTransform(stream, er, data) { - var ts = stream._transformState; - ts.transforming = false; - - var cb = ts.writecb; - - if (!cb) return stream.emit('error', new Error('no writecb in Transform class')); - - ts.writechunk = null; - ts.writecb = null; - - if (data !== null && data !== undefined) stream.push(data); - - cb(er); - - var rs = stream._readableState; - rs.reading = false; - if (rs.needReadable || rs.length < rs.highWaterMark) { - stream._read(rs.highWaterMark); - } - } - function Transform(options) { - if (!(this instanceof Transform)) return new Transform(options); - - Duplex.call(this, options); - - this._transformState = new TransformState(this); - - // when the writable side finishes, then flush out anything remaining. - var stream = this; - - // start out asking for a readable event once data is transformed. - this._readableState.needReadable = true; - - // we have implemented the _read method, and done the other things - // that Readable wants before the first _read call, so unset the - // sync guard flag. - this._readableState.sync = false; - - if (options) { - if (typeof options.transform === 'function') this._transform = options.transform; - - if (typeof options.flush === 'function') this._flush = options.flush; - } - - this.once('prefinish', function () { - if (typeof this._flush === 'function') this._flush(function (er) { - done(stream, er); - });else done(stream); - }); - } - - Transform.prototype.push = function (chunk, encoding) { - this._transformState.needTransform = false; - return Duplex.prototype.push.call(this, chunk, encoding); - }; - - // This is the part where you do stuff! - // override this function in implementation classes. - // 'chunk' is an input chunk. - // - // Call `push(newChunk)` to pass along transformed output - // to the readable side. You may call 'push' zero or more times. - // - // Call `cb(err)` when you are done with this chunk. If you pass - // an error, then that'll put the hurt on the whole operation. If you - // never call cb(), then you'll never get another chunk. - Transform.prototype._transform = function (chunk, encoding, cb) { - throw new Error('Not implemented'); - }; - - Transform.prototype._write = function (chunk, encoding, cb) { - var ts = this._transformState; - ts.writecb = cb; - ts.writechunk = chunk; - ts.writeencoding = encoding; - if (!ts.transforming) { - var rs = this._readableState; - if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); - } - }; - - // Doesn't matter what the args are here. - // _transform does all the work. - // That we got here means that the readable side wants more data. - Transform.prototype._read = function (n) { - var ts = this._transformState; - - if (ts.writechunk !== null && ts.writecb && !ts.transforming) { - ts.transforming = true; - this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); - } else { - // mark that we need a transform, so that any data that comes in - // will get processed, now that we've asked for it. - ts.needTransform = true; - } - }; - - function done(stream, er) { - if (er) return stream.emit('error', er); - - // if there's nothing in the write buffer, then that means - // that nothing more will ever be provided - var ws = stream._writableState; - var ts = stream._transformState; - - if (ws.length) throw new Error('Calling transform done when ws.length != 0'); - - if (ts.transforming) throw new Error('Calling transform done when still transforming'); - - return stream.push(null); - } - - inherits$1(PassThrough, Transform); - function PassThrough(options) { - if (!(this instanceof PassThrough)) return new PassThrough(options); - - Transform.call(this, options); - } - - PassThrough.prototype._transform = function (chunk, encoding, cb) { - cb(null, chunk); - }; - - inherits$1(Stream, EventEmitter); - Stream.Readable = Readable; - Stream.Writable = Writable; - Stream.Duplex = Duplex; - Stream.Transform = Transform; - Stream.PassThrough = PassThrough; - - // Backwards-compat with node 0.4.x - Stream.Stream = Stream; - - // old-style streams. Note that the pipe method (the only relevant - // part of this class) is overridden in the Readable class. - - function Stream() { - EventEmitter.call(this); - } - - Stream.prototype.pipe = function(dest, options) { - var source = this; - - function ondata(chunk) { - if (dest.writable) { - if (false === dest.write(chunk) && source.pause) { - source.pause(); - } - } - } - - source.on('data', ondata); - - function ondrain() { - if (source.readable && source.resume) { - source.resume(); - } - } - - dest.on('drain', ondrain); - - // If the 'end' option is not supplied, dest.end() will be called when - // source gets the 'end' or 'close' events. Only dest.end() once. - if (!dest._isStdio && (!options || options.end !== false)) { - source.on('end', onend); - source.on('close', onclose); - } - - var didOnEnd = false; - function onend() { - if (didOnEnd) return; - didOnEnd = true; - - dest.end(); - } - - - function onclose() { - if (didOnEnd) return; - didOnEnd = true; - - if (typeof dest.destroy === 'function') dest.destroy(); - } - - // don't leave dangling pipes when there are errors. - function onerror(er) { - cleanup(); - if (EventEmitter.listenerCount(this, 'error') === 0) { - throw er; // Unhandled stream error in pipe. - } - } - - source.on('error', onerror); - dest.on('error', onerror); - - // remove all the event listeners that were added. - function cleanup() { - source.removeListener('data', ondata); - dest.removeListener('drain', ondrain); - - source.removeListener('end', onend); - source.removeListener('close', onclose); - - source.removeListener('error', onerror); - dest.removeListener('error', onerror); - - source.removeListener('end', cleanup); - source.removeListener('close', cleanup); - - dest.removeListener('close', cleanup); - } - - source.on('end', cleanup); - source.on('close', cleanup); - - dest.on('close', cleanup); - - dest.emit('pipe', source); - - // Allow for unix-like usage: A.pipe(B).pipe(C) - return dest; - }; - - function _typeof(obj) { - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof = function (obj) { - return typeof obj; - }; - } else { - _typeof = function (obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - - return _typeof(obj); - } - - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } - - function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - - return obj; - } - - function _inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function"); - } - - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true - } - }); - if (superClass) _setPrototypeOf(subClass, superClass); - } - - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } - - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - - return _setPrototypeOf(o, p); - } - - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - - return self; - } - - function _possibleConstructorReturn(self, call) { - if (call && (typeof call === "object" || typeof call === "function")) { - return call; - } - - return _assertThisInitialized(self); - } - - function _toArray(arr) { - return _arrayWithHoles(arr) || _iterableToArray(arr) || _nonIterableRest(); - } - - function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); - } - - function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; - - return arr2; - } - } - - function _arrayWithHoles(arr) { - if (Array.isArray(arr)) return arr; - } - - function _iterableToArray(iter) { - if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); - } - - function _nonIterableSpread() { - throw new TypeError("Invalid attempt to spread non-iterable instance"); - } - - function _nonIterableRest() { - throw new TypeError("Invalid attempt to destructure non-iterable instance"); - } - - /* - The MIT License (MIT) - - Copyright (c) 2016 CoderPuppy - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. - - */ - var _endianness; - function endianness() { - if (typeof _endianness === 'undefined') { - var a = new ArrayBuffer(2); - var b = new Uint8Array(a); - var c = new Uint16Array(a); - b[0] = 1; - b[1] = 2; - if (c[0] === 258) { - _endianness = 'BE'; - } else if (c[0] === 513){ - _endianness = 'LE'; - } else { - throw new Error('unable to figure out endianess'); - } - } - return _endianness; - } - - function hostname() { - if (typeof global$1.location !== 'undefined') { - return global$1.location.hostname - } else return ''; - } - - function loadavg() { - return []; - } - - function uptime() { - return 0; - } - - function freemem() { - return Number.MAX_VALUE; - } - - function totalmem() { - return Number.MAX_VALUE; - } - - function cpus() { - return []; - } - - function type() { - return 'Browser'; - } - - function release () { - if (typeof global$1.navigator !== 'undefined') { - return global$1.navigator.appVersion; - } - return ''; - } - - function networkInterfaces(){} - function getNetworkInterfaces(){} - - function tmpDir() { - return '/tmp'; - } - var tmpdir = tmpDir; - - var EOL = '\n'; - var os = { - EOL: EOL, - tmpdir: tmpdir, - tmpDir: tmpDir, - networkInterfaces:networkInterfaces, - getNetworkInterfaces: getNetworkInterfaces, - release: release, - type: type, - cpus: cpus, - totalmem: totalmem, - freemem: freemem, - uptime: uptime, - loadavg: loadavg, - hostname: hostname, - endianness: endianness, - }; - - var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; - - /** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - - /** Used as the `TypeError` message for "Functions" methods. */ - var FUNC_ERROR_TEXT = 'Expected a function'; - - /** Used to stand-in for `undefined` hash values. */ - var HASH_UNDEFINED = '__lodash_hash_undefined__'; - - /** Used as references for various `Number` constants. */ - var INFINITY = 1 / 0; - - /** `Object#toString` result references. */ - var funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - symbolTag = '[object Symbol]'; - - /** Used to match property names within property paths. */ - var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, - reIsPlainProp = /^\w*$/, - reLeadingDot = /^\./, - rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; - - /** - * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). - */ - var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; - - /** Used to match backslashes in property paths. */ - var reEscapeChar = /\\(\\)?/g; - - /** Used to detect host constructors (Safari). */ - var reIsHostCtor = /^\[object .+?Constructor\]$/; - - /** Detect free variable `global` from Node.js. */ - var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; - - /** Detect free variable `self`. */ - var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - - /** Used as a reference to the global object. */ - var root = freeGlobal || freeSelf || Function('return this')(); - - /** - * Gets the value at `key` of `object`. - * - * @private - * @param {Object} [object] The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. - */ - function getValue(object, key) { - return object == null ? undefined : object[key]; - } - - /** - * Checks if `value` is a host object in IE < 9. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a host object, else `false`. - */ - function isHostObject(value) { - // Many host objects are `Object` objects that can coerce to strings - // despite having improperly defined `toString` methods. - var result = false; - if (value != null && typeof value.toString != 'function') { - try { - result = !!(value + ''); - } catch (e) {} - } - return result; - } - - /** Used for built-in method references. */ - var arrayProto = Array.prototype, - funcProto = Function.prototype, - objectProto = Object.prototype; - - /** Used to detect overreaching core-js shims. */ - var coreJsData = root['__core-js_shared__']; - - /** Used to detect methods masquerading as native. */ - var maskSrcKey = (function() { - var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); - return uid ? ('Symbol(src)_1.' + uid) : ''; - }()); - - /** Used to resolve the decompiled source of functions. */ - var funcToString = funcProto.toString; - - /** Used to check objects for own properties. */ - var hasOwnProperty$1 = objectProto.hasOwnProperty; - - /** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ - var objectToString$1 = objectProto.toString; - - /** Used to detect if a method is native. */ - var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty$1).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' - ); - - /** Built-in value references. */ - var Symbol$1 = root.Symbol, - splice = arrayProto.splice; - - /* Built-in method references that are verified to be native. */ - var Map = getNative(root, 'Map'), - nativeCreate = getNative(Object, 'create'); - - /** Used to convert symbols to primitives and strings. */ - var symbolProto = Symbol$1 ? Symbol$1.prototype : undefined, - symbolToString = symbolProto ? symbolProto.toString : undefined; - - /** - * Creates a hash object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function Hash(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } - - /** - * Removes all key-value entries from the hash. - * - * @private - * @name clear - * @memberOf Hash - */ - function hashClear() { - this.__data__ = nativeCreate ? nativeCreate(null) : {}; - } - - /** - * Removes `key` and its value from the hash. - * - * @private - * @name delete - * @memberOf Hash - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function hashDelete(key) { - return this.has(key) && delete this.__data__[key]; - } - - /** - * Gets the hash value for `key`. - * - * @private - * @name get - * @memberOf Hash - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function hashGet(key) { - var data = this.__data__; - if (nativeCreate) { - var result = data[key]; - return result === HASH_UNDEFINED ? undefined : result; - } - return hasOwnProperty$1.call(data, key) ? data[key] : undefined; - } - - /** - * Checks if a hash value for `key` exists. - * - * @private - * @name has - * @memberOf Hash - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function hashHas(key) { - var data = this.__data__; - return nativeCreate ? data[key] !== undefined : hasOwnProperty$1.call(data, key); - } - - /** - * Sets the hash `key` to `value`. - * - * @private - * @name set - * @memberOf Hash - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the hash instance. - */ - function hashSet(key, value) { - var data = this.__data__; - data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; - return this; - } - - // Add methods to `Hash`. - Hash.prototype.clear = hashClear; - Hash.prototype['delete'] = hashDelete; - Hash.prototype.get = hashGet; - Hash.prototype.has = hashHas; - Hash.prototype.set = hashSet; - - /** - * Creates an list cache object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function ListCache(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } - - /** - * Removes all key-value entries from the list cache. - * - * @private - * @name clear - * @memberOf ListCache - */ - function listCacheClear() { - this.__data__ = []; - } - - /** - * Removes `key` and its value from the list cache. - * - * @private - * @name delete - * @memberOf ListCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function listCacheDelete(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - return false; - } - var lastIndex = data.length - 1; - if (index == lastIndex) { - data.pop(); - } else { - splice.call(data, index, 1); - } - return true; - } - - /** - * Gets the list cache value for `key`. - * - * @private - * @name get - * @memberOf ListCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function listCacheGet(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - return index < 0 ? undefined : data[index][1]; - } - - /** - * Checks if a list cache value for `key` exists. - * - * @private - * @name has - * @memberOf ListCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function listCacheHas(key) { - return assocIndexOf(this.__data__, key) > -1; - } - - /** - * Sets the list cache `key` to `value`. - * - * @private - * @name set - * @memberOf ListCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the list cache instance. - */ - function listCacheSet(key, value) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - data.push([key, value]); - } else { - data[index][1] = value; - } - return this; - } - - // Add methods to `ListCache`. - ListCache.prototype.clear = listCacheClear; - ListCache.prototype['delete'] = listCacheDelete; - ListCache.prototype.get = listCacheGet; - ListCache.prototype.has = listCacheHas; - ListCache.prototype.set = listCacheSet; - - /** - * Creates a map cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function MapCache(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } - - /** - * Removes all key-value entries from the map. - * - * @private - * @name clear - * @memberOf MapCache - */ - function mapCacheClear() { - this.__data__ = { - 'hash': new Hash, - 'map': new (Map || ListCache), - 'string': new Hash - }; - } - - /** - * Removes `key` and its value from the map. - * - * @private - * @name delete - * @memberOf MapCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function mapCacheDelete(key) { - return getMapData(this, key)['delete'](key); - } - - /** - * Gets the map value for `key`. - * - * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function mapCacheGet(key) { - return getMapData(this, key).get(key); - } - - /** - * Checks if a map value for `key` exists. - * - * @private - * @name has - * @memberOf MapCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function mapCacheHas(key) { - return getMapData(this, key).has(key); - } - - /** - * Sets the map `key` to `value`. - * - * @private - * @name set - * @memberOf MapCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the map cache instance. - */ - function mapCacheSet(key, value) { - getMapData(this, key).set(key, value); - return this; - } - - // Add methods to `MapCache`. - MapCache.prototype.clear = mapCacheClear; - MapCache.prototype['delete'] = mapCacheDelete; - MapCache.prototype.get = mapCacheGet; - MapCache.prototype.has = mapCacheHas; - MapCache.prototype.set = mapCacheSet; - - /** - * Gets the index at which the `key` is found in `array` of key-value pairs. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } - } - return -1; - } - - /** - * The base implementation of `_.get` without support for default values. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @returns {*} Returns the resolved value. - */ - function baseGet(object, path) { - path = isKey(path, object) ? [path] : castPath(path); - - var index = 0, - length = path.length; - - while (object != null && index < length) { - object = object[toKey(path[index++])]; - } - return (index && index == length) ? object : undefined; - } - - /** - * The base implementation of `_.isNative` without bad shim checks. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. - */ - function baseIsNative(value) { - if (!isObject$1(value) || isMasked(value)) { - return false; - } - var pattern = (isFunction$1(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); - } - - /** - * The base implementation of `_.toString` which doesn't convert nullish - * values to empty strings. - * - * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. - */ - function baseToString(value) { - // Exit early for strings to avoid a performance hit in some environments. - if (typeof value == 'string') { - return value; - } - if (isSymbol(value)) { - return symbolToString ? symbolToString.call(value) : ''; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; - } - - /** - * Casts `value` to a path array if it's not one. - * - * @private - * @param {*} value The value to inspect. - * @returns {Array} Returns the cast property path array. - */ - function castPath(value) { - return isArray$2(value) ? value : stringToPath(value); - } - - /** - * Gets the data for `map`. - * - * @private - * @param {Object} map The map to query. - * @param {string} key The reference key. - * @returns {*} Returns the map data. - */ - function getMapData(map, key) { - var data = map.__data__; - return isKeyable(key) - ? data[typeof key == 'string' ? 'string' : 'hash'] - : data.map; - } - - /** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ - function getNative(object, key) { - var value = getValue(object, key); - return baseIsNative(value) ? value : undefined; - } - - /** - * Checks if `value` is a property name and not a property path. - * - * @private - * @param {*} value The value to check. - * @param {Object} [object] The object to query keys on. - * @returns {boolean} Returns `true` if `value` is a property name, else `false`. - */ - function isKey(value, object) { - if (isArray$2(value)) { - return false; - } - var type = typeof value; - if (type == 'number' || type == 'symbol' || type == 'boolean' || - value == null || isSymbol(value)) { - return true; - } - return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || - (object != null && value in Object(object)); - } - - /** - * Checks if `value` is suitable for use as unique object key. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. - */ - function isKeyable(value) { - var type = typeof value; - return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') - ? (value !== '__proto__') - : (value === null); - } - - /** - * Checks if `func` has its source masked. - * - * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` is masked, else `false`. - */ - function isMasked(func) { - return !!maskSrcKey && (maskSrcKey in func); - } - - /** - * Converts `string` to a property path array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the property path array. - */ - var stringToPath = memoize(function(string) { - string = toString$1(string); - - var result = []; - if (reLeadingDot.test(string)) { - result.push(''); - } - string.replace(rePropName, function(match, number, quote, string) { - result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); - }); - return result; - }); - - /** - * Converts `value` to a string key if it's not a string or symbol. - * - * @private - * @param {*} value The value to inspect. - * @returns {string|symbol} Returns the key. - */ - function toKey(value) { - if (typeof value == 'string' || isSymbol(value)) { - return value; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; - } - - /** - * Converts `func` to its source code. - * - * @private - * @param {Function} func The function to process. - * @returns {string} Returns the source code. - */ - function toSource(func) { - if (func != null) { - try { - return funcToString.call(func); - } catch (e) {} - try { - return (func + ''); - } catch (e) {} - } - return ''; - } - - /** - * Creates a function that memoizes the result of `func`. If `resolver` is - * provided, it determines the cache key for storing the result based on the - * arguments provided to the memoized function. By default, the first argument - * provided to the memoized function is used as the map cache key. The `func` - * is invoked with the `this` binding of the memoized function. - * - * **Note:** The cache is exposed as the `cache` property on the memoized - * function. Its creation may be customized by replacing the `_.memoize.Cache` - * constructor with one whose instances implement the - * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) - * method interface of `delete`, `get`, `has`, and `set`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to have its output memoized. - * @param {Function} [resolver] The function to resolve the cache key. - * @returns {Function} Returns the new memoized function. - * @example - * - * var object = { 'a': 1, 'b': 2 }; - * var other = { 'c': 3, 'd': 4 }; - * - * var values = _.memoize(_.values); - * values(object); - * // => [1, 2] - * - * values(other); - * // => [3, 4] - * - * object.a = 2; - * values(object); - * // => [1, 2] - * - * // Modify the result cache. - * values.cache.set(object, ['a', 'b']); - * values(object); - * // => ['a', 'b'] - * - * // Replace `_.memoize.Cache`. - * _.memoize.Cache = WeakMap; - */ - function memoize(func, resolver) { - if (typeof func != 'function' || (resolver && typeof resolver != 'function')) { - throw new TypeError(FUNC_ERROR_TEXT); - } - var memoized = function() { - var args = arguments, - key = resolver ? resolver.apply(this, args) : args[0], - cache = memoized.cache; - - if (cache.has(key)) { - return cache.get(key); - } - var result = func.apply(this, args); - memoized.cache = cache.set(key, result); - return result; - }; - memoized.cache = new (memoize.Cache || MapCache); - return memoized; - } - - // Assign cache to `_.memoize`. - memoize.Cache = MapCache; - - /** - * Performs a - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'a': 1 }; - * var other = { 'a': 1 }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ - function eq(value, other) { - return value === other || (value !== value && other !== other); - } - - /** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ - var isArray$2 = Array.isArray; - - /** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a function, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ - function isFunction$1(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8-9 which returns 'object' for typed array and other constructors. - var tag = isObject$1(value) ? objectToString$1.call(value) : ''; - return tag == funcTag || tag == genTag; - } - - /** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ - function isObject$1(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); - } - - /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ - function isObjectLike(value) { - return !!value && typeof value == 'object'; - } - - /** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ - function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && objectToString$1.call(value) == symbolTag); - } - - /** - * Converts `value` to a string. An empty string is returned for `null` - * and `undefined` values. The sign of `-0` is preserved. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {string} Returns the string. - * @example - * - * _.toString(null); - * // => '' - * - * _.toString(-0); - * // => '-0' - * - * _.toString([1, 2, 3]); - * // => '1,2,3' - */ - function toString$1(value) { - return value == null ? '' : baseToString(value); - } - - /** - * Gets the value at `path` of `object`. If the resolved value is - * `undefined`, the `defaultValue` is returned in its place. - * - * @static - * @memberOf _ - * @since 3.7.0 - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @param {*} [defaultValue] The value returned for `undefined` resolved values. - * @returns {*} Returns the resolved value. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; - * - * _.get(object, 'a[0].b.c'); - * // => 3 - * - * _.get(object, ['a', '0', 'b', 'c']); - * // => 3 - * - * _.get(object, 'a.b.c', 'default'); - * // => 'default' - */ - function get(object, path, defaultValue) { - var result = object == null ? undefined : baseGet(object, path); - return result === undefined ? defaultValue : result; - } - - var lodash_get = get; - - function getProp(obj, path, defaultValue) { - return obj[path] === undefined ? defaultValue : obj[path]; - } - - function setProp(obj, path, value) { - var pathArray = Array.isArray(path) ? path : path.split('.'); - - var _pathArray = _toArray(pathArray), - key = _pathArray[0], - restPath = _pathArray.slice(1); - - var newValue = pathArray.length > 1 ? setProp(obj[key] || {}, restPath, value) : value; - return Object.assign({}, obj, _defineProperty({}, key, newValue)); - } - - function unsetProp(obj, path) { - var pathArray = Array.isArray(path) ? path : path.split('.'); - - var _pathArray2 = _toArray(pathArray), - key = _pathArray2[0], - restPath = _pathArray2.slice(1); - - if (_typeof(obj[key]) !== 'object') { - // This will never be hit in the current code because unwind does the check before calling unsetProp - - /* istanbul ignore next */ - return obj; - } - - if (pathArray.length === 1) { - return Object.keys(obj).filter(function (prop) { - return prop !== key; - }).reduce(function (acc, prop) { - return Object.assign(acc, _defineProperty({}, prop, obj[prop])); - }, {}); - } - - return unsetProp(obj[key], restPath); - } - - function flattenReducer(acc, arr) { - try { - // This is faster but susceptible to `RangeError: Maximum call stack size exceeded` - acc.push.apply(acc, _toConsumableArray(arr)); - return acc; - } catch (err) { - // Fallback to a slower but safer option - return acc.concat(arr); - } - } - - function fastJoin(arr, separator) { - var isFirst = true; - return arr.reduce(function (acc, elem) { - if (elem === null || elem === undefined) { - elem = ''; - } - - if (isFirst) { - isFirst = false; - return "".concat(elem); - } - - return "".concat(acc).concat(separator).concat(elem); - }, ''); - } - - var utils = { - getProp: getProp, - setProp: setProp, - unsetProp: unsetProp, - fastJoin: fastJoin, - flattenReducer: flattenReducer - }; - - var getProp$1 = utils.getProp, - fastJoin$1 = utils.fastJoin, - flattenReducer$1 = utils.flattenReducer; - - var JSON2CSVBase = - /*#__PURE__*/ - function () { - function JSON2CSVBase(opts) { - _classCallCheck(this, JSON2CSVBase); - - this.opts = this.preprocessOpts(opts); - } - /** - * Check passing opts and set defaults. - * - * @param {Json2CsvOptions} opts Options object containing fields, - * delimiter, default value, quote mark, header, etc. - */ - - - _createClass(JSON2CSVBase, [{ - key: "preprocessOpts", - value: function preprocessOpts(opts) { - var processedOpts = Object.assign({}, opts); - processedOpts.transforms = !Array.isArray(processedOpts.transforms) ? processedOpts.transforms ? [processedOpts.transforms] : [] : processedOpts.transforms; - processedOpts.delimiter = processedOpts.delimiter || ','; - processedOpts.eol = processedOpts.eol || os.EOL; - processedOpts.quote = typeof processedOpts.quote === 'string' ? processedOpts.quote : '"'; - processedOpts.escapedQuote = typeof processedOpts.escapedQuote === 'string' ? processedOpts.escapedQuote : "".concat(processedOpts.quote).concat(processedOpts.quote); - processedOpts.header = processedOpts.header !== false; - processedOpts.includeEmptyRows = processedOpts.includeEmptyRows || false; - processedOpts.withBOM = processedOpts.withBOM || false; - return processedOpts; - } - /** - * Check and normalize the fields configuration. - * - * @param {(string|object)[]} fields Fields configuration provided by the user - * or inferred from the data - * @returns {object[]} preprocessed FieldsInfo array - */ - - }, { - key: "preprocessFieldsInfo", - value: function preprocessFieldsInfo(fields) { - var _this = this; - - return fields.map(function (fieldInfo) { - if (typeof fieldInfo === 'string') { - return { - label: fieldInfo, - value: fieldInfo.includes('.') || fieldInfo.includes('[') ? function (row) { - return lodash_get(row, fieldInfo, _this.opts.defaultValue); - } : function (row) { - return getProp$1(row, fieldInfo, _this.opts.defaultValue); - } - }; - } - - if (_typeof(fieldInfo) === 'object') { - var defaultValue = 'default' in fieldInfo ? fieldInfo.default : _this.opts.defaultValue; - - if (typeof fieldInfo.value === 'string') { - return { - label: fieldInfo.label || fieldInfo.value, - value: fieldInfo.value.includes('.') || fieldInfo.value.includes('[') ? function (row) { - return lodash_get(row, fieldInfo.value, defaultValue); - } : function (row) { - return getProp$1(row, fieldInfo.value, defaultValue); - } - }; - } - - if (typeof fieldInfo.value === 'function') { - var label = fieldInfo.label || fieldInfo.value.name || ''; - var field = { - label: label, - default: defaultValue - }; - return { - label: label, - value: function value(row) { - var value = fieldInfo.value(row, field); - return value === null || value === undefined ? defaultValue : value; - } - }; - } - } - - throw new Error('Invalid field info option. ' + JSON.stringify(fieldInfo)); - }); - } - /** - * Create the title row with all the provided fields as column headings - * - * @returns {String} titles as a string - */ - - }, { - key: "getHeader", - value: function getHeader() { - var _this2 = this; - - return fastJoin$1(this.opts.fields.map(function (fieldInfo) { - return _this2.processValue(fieldInfo.label); - }), this.opts.delimiter); - } - /** - * Preprocess each object according to the given transforms (unwind, flatten, etc.). - * @param {Object} row JSON object to be converted in a CSV row - */ - - }, { - key: "preprocessRow", - value: function preprocessRow(row) { - return this.opts.transforms.reduce(function (rows, transform) { - return rows.map(function (row) { - return transform(row); - }).reduce(flattenReducer$1, []); - }, [row]); - } - /** - * Create the content of a specific CSV row - * - * @param {Object} row JSON object to be converted in a CSV row - * @returns {String} CSV string (row) - */ - - }, { - key: "processRow", - value: function processRow(row) { - var _this3 = this; - - if (!row) { - return undefined; - } - - var processedRow = this.opts.fields.map(function (fieldInfo) { - return _this3.processCell(row, fieldInfo); - }); - - if (!this.opts.includeEmptyRows && processedRow.every(function (field) { - return field === undefined; - })) { - return undefined; - } - - return fastJoin$1(processedRow, this.opts.delimiter); - } - /** - * Create the content of a specfic CSV row cell - * - * @param {Object} row JSON object representing the CSV row that the cell belongs to - * @param {FieldInfo} fieldInfo Details of the field to process to be a CSV cell - * @returns {String} CSV string (cell) - */ - - }, { - key: "processCell", - value: function processCell(row, fieldInfo) { - return this.processValue(fieldInfo.value(row)); - } - /** - * Create the content of a specfic CSV row cell - * - * @param {Any} value Value to be included in a CSV cell - * @returns {String} Value stringified and processed - */ - - }, { - key: "processValue", - value: function processValue(value) { - if (value === null || value === undefined) { - return undefined; - } - - var valueType = _typeof(value); - - if (valueType !== 'boolean' && valueType !== 'number' && valueType !== 'string') { - value = JSON.stringify(value); - - if (value === undefined) { - return undefined; - } - - if (value[0] === '"') { - value = value.replace(/^"(.+)"$/, '$1'); - } - } - - if (typeof value === 'string') { - if (value.includes(this.opts.quote)) { - value = value.replace(new RegExp(this.opts.quote, 'g'), this.opts.escapedQuote); - } - - value = "".concat(this.opts.quote).concat(value).concat(this.opts.quote); - - if (this.opts.excelStrings) { - value = "\"=\"".concat(value, "\"\""); - } - } - - return value; - } - }]); - - return JSON2CSVBase; - }(); - - var JSON2CSVBase_1 = JSON2CSVBase; - - var fastJoin$2 = utils.fastJoin, - flattenReducer$2 = utils.flattenReducer; - - var JSON2CSVParser = - /*#__PURE__*/ - function (_JSON2CSVBase) { - _inherits(JSON2CSVParser, _JSON2CSVBase); - - function JSON2CSVParser(opts) { - var _this; - - _classCallCheck(this, JSON2CSVParser); - - _this = _possibleConstructorReturn(this, _getPrototypeOf(JSON2CSVParser).call(this, opts)); - - if (_this.opts.fields) { - _this.opts.fields = _this.preprocessFieldsInfo(_this.opts.fields); - } - - return _this; - } - /** - * Main function that converts json to csv. - * - * @param {Array|Object} data Array of JSON objects to be converted to CSV - * @returns {String} The CSV formated data as a string - */ - - - _createClass(JSON2CSVParser, [{ - key: "parse", - value: function parse(data) { - var processedData = this.preprocessData(data); - - if (!this.opts.fields) { - this.opts.fields = processedData.reduce(function (fields, item) { - Object.keys(item).forEach(function (field) { - if (!fields.includes(field)) { - fields.push(field); - } - }); - return fields; - }, []); - this.opts.fields = this.preprocessFieldsInfo(this.opts.fields); - } - - var header = this.opts.header ? this.getHeader() : ''; - var rows = this.processData(processedData); - var csv = (this.opts.withBOM ? "\uFEFF" : '') + header + (header && rows ? this.opts.eol : '') + rows; - return csv; - } - /** - * Preprocess the data according to the give opts (unwind, flatten, etc.) - and calculate the fields and field names if they are not provided. - * - * @param {Array|Object} data Array or object to be converted to CSV - */ - - }, { - key: "preprocessData", - value: function preprocessData(data) { - var _this2 = this; - - var processedData = Array.isArray(data) ? data : [data]; - - if (!this.opts.fields && (processedData.length === 0 || _typeof(processedData[0]) !== 'object')) { - throw new Error('Data should not be empty or the "fields" option should be included'); - } - - if (this.opts.transforms.length === 0) return processedData; - return processedData.map(function (row) { - return _this2.preprocessRow(row); - }).reduce(flattenReducer$2, []); - } - /** - * Create the content row by row below the header - * - * @param {Array} data Array of JSON objects to be converted to CSV - * @returns {String} CSV string (body) - */ - - }, { - key: "processData", - value: function processData(data) { - var _this3 = this; - - return fastJoin$2(data.map(function (row) { - return _this3.processRow(row); - }).filter(function (row) { - return row; - }), // Filter empty rows - this.opts.eol); - } - }]); - - return JSON2CSVParser; - }(JSON2CSVBase_1); - - var JSON2CSVParser_1 = JSON2CSVParser; - - /*global Buffer*/ - // Named constants with unique integer values - var C = {}; - // Tokens - var LEFT_BRACE = C.LEFT_BRACE = 0x1; - var RIGHT_BRACE = C.RIGHT_BRACE = 0x2; - var LEFT_BRACKET = C.LEFT_BRACKET = 0x3; - var RIGHT_BRACKET = C.RIGHT_BRACKET = 0x4; - var COLON = C.COLON = 0x5; - var COMMA = C.COMMA = 0x6; - var TRUE = C.TRUE = 0x7; - var FALSE = C.FALSE = 0x8; - var NULL = C.NULL = 0x9; - var STRING = C.STRING = 0xa; - var NUMBER = C.NUMBER = 0xb; - // Tokenizer States - var START = C.START = 0x11; - var STOP = C.STOP = 0x12; - var TRUE1 = C.TRUE1 = 0x21; - var TRUE2 = C.TRUE2 = 0x22; - var TRUE3 = C.TRUE3 = 0x23; - var FALSE1 = C.FALSE1 = 0x31; - var FALSE2 = C.FALSE2 = 0x32; - var FALSE3 = C.FALSE3 = 0x33; - var FALSE4 = C.FALSE4 = 0x34; - var NULL1 = C.NULL1 = 0x41; - var NULL2 = C.NULL2 = 0x42; - var NULL3 = C.NULL3 = 0x43; - var NUMBER1 = C.NUMBER1 = 0x51; - var NUMBER3 = C.NUMBER3 = 0x53; - var STRING1 = C.STRING1 = 0x61; - var STRING2 = C.STRING2 = 0x62; - var STRING3 = C.STRING3 = 0x63; - var STRING4 = C.STRING4 = 0x64; - var STRING5 = C.STRING5 = 0x65; - var STRING6 = C.STRING6 = 0x66; - // Parser States - var VALUE = C.VALUE = 0x71; - var KEY = C.KEY = 0x72; - // Parser Modes - var OBJECT = C.OBJECT = 0x81; - var ARRAY = C.ARRAY = 0x82; - // Character constants - var BACK_SLASH = "\\".charCodeAt(0); - var FORWARD_SLASH = "\/".charCodeAt(0); - var BACKSPACE = "\b".charCodeAt(0); - var FORM_FEED = "\f".charCodeAt(0); - var NEWLINE = "\n".charCodeAt(0); - var CARRIAGE_RETURN = "\r".charCodeAt(0); - var TAB = "\t".charCodeAt(0); - - var STRING_BUFFER_SIZE = 64 * 1024; - - function Parser() { - this.tState = START; - this.value = undefined; - - this.string = undefined; // string data - this.stringBuffer = Buffer.alloc ? Buffer.alloc(STRING_BUFFER_SIZE) : new Buffer(STRING_BUFFER_SIZE); - this.stringBufferOffset = 0; - this.unicode = undefined; // unicode escapes - this.highSurrogate = undefined; - - this.key = undefined; - this.mode = undefined; - this.stack = []; - this.state = VALUE; - this.bytes_remaining = 0; // number of bytes remaining in multi byte utf8 char to read after split boundary - this.bytes_in_sequence = 0; // bytes in multi byte utf8 char to read - this.temp_buffs = { "2": new Buffer(2), "3": new Buffer(3), "4": new Buffer(4) }; // for rebuilding chars split before boundary is reached - - // Stream offset - this.offset = -1; - } - - // Slow code to string converter (only used when throwing syntax errors) - Parser.toknam = function (code) { - var keys = Object.keys(C); - for (var i = 0, l = keys.length; i < l; i++) { - var key = keys[i]; - if (C[key] === code) { return key; } - } - return code && ("0x" + code.toString(16)); - }; - - var proto = Parser.prototype; - proto.onError = function (err) { throw err; }; - proto.charError = function (buffer, i) { - this.tState = STOP; - this.onError(new Error("Unexpected " + JSON.stringify(String.fromCharCode(buffer[i])) + " at position " + i + " in state " + Parser.toknam(this.tState))); - }; - proto.appendStringChar = function (char) { - if (this.stringBufferOffset >= STRING_BUFFER_SIZE) { - this.string += this.stringBuffer.toString('utf8'); - this.stringBufferOffset = 0; - } - - this.stringBuffer[this.stringBufferOffset++] = char; - }; - proto.appendStringBuf = function (buf, start, end) { - var size = buf.length; - if (typeof start === 'number') { - if (typeof end === 'number') { - if (end < 0) { - // adding a negative end decreeses the size - size = buf.length - start + end; - } else { - size = end - start; - } - } else { - size = buf.length - start; - } - } - - if (size < 0) { - size = 0; - } - - if (this.stringBufferOffset + size > STRING_BUFFER_SIZE) { - this.string += this.stringBuffer.toString('utf8', 0, this.stringBufferOffset); - this.stringBufferOffset = 0; - } - - buf.copy(this.stringBuffer, this.stringBufferOffset, start, end); - this.stringBufferOffset += size; - }; - proto.write = function (buffer) { - if (typeof buffer === "string") buffer = new Buffer(buffer); - var n; - for (var i = 0, l = buffer.length; i < l; i++) { - if (this.tState === START){ - n = buffer[i]; - this.offset++; - if(n === 0x7b){ this.onToken(LEFT_BRACE, "{"); // { - }else if(n === 0x7d){ this.onToken(RIGHT_BRACE, "}"); // } - }else if(n === 0x5b){ this.onToken(LEFT_BRACKET, "["); // [ - }else if(n === 0x5d){ this.onToken(RIGHT_BRACKET, "]"); // ] - }else if(n === 0x3a){ this.onToken(COLON, ":"); // : - }else if(n === 0x2c){ this.onToken(COMMA, ","); // , - }else if(n === 0x74){ this.tState = TRUE1; // t - }else if(n === 0x66){ this.tState = FALSE1; // f - }else if(n === 0x6e){ this.tState = NULL1; // n - }else if(n === 0x22){ // " - this.string = ""; - this.stringBufferOffset = 0; - this.tState = STRING1; - }else if(n === 0x2d){ this.string = "-"; this.tState = NUMBER1; // - - }else{ - if (n >= 0x30 && n < 0x40) { // 1-9 - this.string = String.fromCharCode(n); this.tState = NUMBER3; - } else if (n === 0x20 || n === 0x09 || n === 0x0a || n === 0x0d) ; else { - return this.charError(buffer, i); - } - } - }else if (this.tState === STRING1){ // After open quote - n = buffer[i]; // get current byte from buffer - // check for carry over of a multi byte char split between data chunks - // & fill temp buffer it with start of this data chunk up to the boundary limit set in the last iteration - if (this.bytes_remaining > 0) { - for (var j = 0; j < this.bytes_remaining; j++) { - this.temp_buffs[this.bytes_in_sequence][this.bytes_in_sequence - this.bytes_remaining + j] = buffer[j]; - } - - this.appendStringBuf(this.temp_buffs[this.bytes_in_sequence]); - this.bytes_in_sequence = this.bytes_remaining = 0; - i = i + j - 1; - } else if (this.bytes_remaining === 0 && n >= 128) { // else if no remainder bytes carried over, parse multi byte (>=128) chars one at a time - if (n <= 193 || n > 244) { - return this.onError(new Error("Invalid UTF-8 character at position " + i + " in state " + Parser.toknam(this.tState))); - } - if ((n >= 194) && (n <= 223)) this.bytes_in_sequence = 2; - if ((n >= 224) && (n <= 239)) this.bytes_in_sequence = 3; - if ((n >= 240) && (n <= 244)) this.bytes_in_sequence = 4; - if ((this.bytes_in_sequence + i) > buffer.length) { // if bytes needed to complete char fall outside buffer length, we have a boundary split - for (var k = 0; k <= (buffer.length - 1 - i); k++) { - this.temp_buffs[this.bytes_in_sequence][k] = buffer[i + k]; // fill temp buffer of correct size with bytes available in this chunk - } - this.bytes_remaining = (i + this.bytes_in_sequence) - buffer.length; - i = buffer.length - 1; - } else { - this.appendStringBuf(buffer, i, i + this.bytes_in_sequence); - i = i + this.bytes_in_sequence - 1; - } - } else if (n === 0x22) { - this.tState = START; - this.string += this.stringBuffer.toString('utf8', 0, this.stringBufferOffset); - this.stringBufferOffset = 0; - this.onToken(STRING, this.string); - this.offset += Buffer.byteLength(this.string, 'utf8') + 1; - this.string = undefined; - } - else if (n === 0x5c) { - this.tState = STRING2; - } - else if (n >= 0x20) { this.appendStringChar(n); } - else { - return this.charError(buffer, i); - } - }else if (this.tState === STRING2){ // After backslash - n = buffer[i]; - if(n === 0x22){ this.appendStringChar(n); this.tState = STRING1; - }else if(n === 0x5c){ this.appendStringChar(BACK_SLASH); this.tState = STRING1; - }else if(n === 0x2f){ this.appendStringChar(FORWARD_SLASH); this.tState = STRING1; - }else if(n === 0x62){ this.appendStringChar(BACKSPACE); this.tState = STRING1; - }else if(n === 0x66){ this.appendStringChar(FORM_FEED); this.tState = STRING1; - }else if(n === 0x6e){ this.appendStringChar(NEWLINE); this.tState = STRING1; - }else if(n === 0x72){ this.appendStringChar(CARRIAGE_RETURN); this.tState = STRING1; - }else if(n === 0x74){ this.appendStringChar(TAB); this.tState = STRING1; - }else if(n === 0x75){ this.unicode = ""; this.tState = STRING3; - }else{ - return this.charError(buffer, i); - } - }else if (this.tState === STRING3 || this.tState === STRING4 || this.tState === STRING5 || this.tState === STRING6){ // unicode hex codes - n = buffer[i]; - // 0-9 A-F a-f - if ((n >= 0x30 && n < 0x40) || (n > 0x40 && n <= 0x46) || (n > 0x60 && n <= 0x66)) { - this.unicode += String.fromCharCode(n); - if (this.tState++ === STRING6) { - var intVal = parseInt(this.unicode, 16); - this.unicode = undefined; - if (this.highSurrogate !== undefined && intVal >= 0xDC00 && intVal < (0xDFFF + 1)) { //<56320,57343> - lowSurrogate - this.appendStringBuf(new Buffer(String.fromCharCode(this.highSurrogate, intVal))); - this.highSurrogate = undefined; - } else if (this.highSurrogate === undefined && intVal >= 0xD800 && intVal < (0xDBFF + 1)) { //<55296,56319> - highSurrogate - this.highSurrogate = intVal; - } else { - if (this.highSurrogate !== undefined) { - this.appendStringBuf(new Buffer(String.fromCharCode(this.highSurrogate))); - this.highSurrogate = undefined; - } - this.appendStringBuf(new Buffer(String.fromCharCode(intVal))); - } - this.tState = STRING1; - } - } else { - return this.charError(buffer, i); - } - } else if (this.tState === NUMBER1 || this.tState === NUMBER3) { - n = buffer[i]; - - switch (n) { - case 0x30: // 0 - case 0x31: // 1 - case 0x32: // 2 - case 0x33: // 3 - case 0x34: // 4 - case 0x35: // 5 - case 0x36: // 6 - case 0x37: // 7 - case 0x38: // 8 - case 0x39: // 9 - case 0x2e: // . - case 0x65: // e - case 0x45: // E - case 0x2b: // + - case 0x2d: // - - this.string += String.fromCharCode(n); - this.tState = NUMBER3; - break; - default: - this.tState = START; - var result = Number(this.string); - - if (isNaN(result)){ - return this.charError(buffer, i); - } - - if ((this.string.match(/[0-9]+/) == this.string) && (result.toString() != this.string)) { - // Long string of digits which is an ID string and not valid and/or safe JavaScript integer Number - this.onToken(STRING, this.string); - } else { - this.onToken(NUMBER, result); - } - - this.offset += this.string.length - 1; - this.string = undefined; - i--; - break; - } - }else if (this.tState === TRUE1){ // r - if (buffer[i] === 0x72) { this.tState = TRUE2; } - else { return this.charError(buffer, i); } - }else if (this.tState === TRUE2){ // u - if (buffer[i] === 0x75) { this.tState = TRUE3; } - else { return this.charError(buffer, i); } - }else if (this.tState === TRUE3){ // e - if (buffer[i] === 0x65) { this.tState = START; this.onToken(TRUE, true); this.offset+= 3; } - else { return this.charError(buffer, i); } - }else if (this.tState === FALSE1){ // a - if (buffer[i] === 0x61) { this.tState = FALSE2; } - else { return this.charError(buffer, i); } - }else if (this.tState === FALSE2){ // l - if (buffer[i] === 0x6c) { this.tState = FALSE3; } - else { return this.charError(buffer, i); } - }else if (this.tState === FALSE3){ // s - if (buffer[i] === 0x73) { this.tState = FALSE4; } - else { return this.charError(buffer, i); } - }else if (this.tState === FALSE4){ // e - if (buffer[i] === 0x65) { this.tState = START; this.onToken(FALSE, false); this.offset+= 4; } - else { return this.charError(buffer, i); } - }else if (this.tState === NULL1){ // u - if (buffer[i] === 0x75) { this.tState = NULL2; } - else { return this.charError(buffer, i); } - }else if (this.tState === NULL2){ // l - if (buffer[i] === 0x6c) { this.tState = NULL3; } - else { return this.charError(buffer, i); } - }else if (this.tState === NULL3){ // l - if (buffer[i] === 0x6c) { this.tState = START; this.onToken(NULL, null); this.offset += 3; } - else { return this.charError(buffer, i); } - } - } - }; - proto.onToken = function (token, value) { - // Override this to get events - }; - - proto.parseError = function (token, value) { - this.tState = STOP; - this.onError(new Error("Unexpected " + Parser.toknam(token) + (value ? ("(" + JSON.stringify(value) + ")") : "") + " in state " + Parser.toknam(this.state))); - }; - proto.push = function () { - this.stack.push({value: this.value, key: this.key, mode: this.mode}); - }; - proto.pop = function () { - var value = this.value; - var parent = this.stack.pop(); - this.value = parent.value; - this.key = parent.key; - this.mode = parent.mode; - this.emit(value); - if (!this.mode) { this.state = VALUE; } - }; - proto.emit = function (value) { - if (this.mode) { this.state = COMMA; } - this.onValue(value); - }; - proto.onValue = function (value) { - // Override me - }; - proto.onToken = function (token, value) { - if(this.state === VALUE){ - if(token === STRING || token === NUMBER || token === TRUE || token === FALSE || token === NULL){ - if (this.value) { - this.value[this.key] = value; - } - this.emit(value); - }else if(token === LEFT_BRACE){ - this.push(); - if (this.value) { - this.value = this.value[this.key] = {}; - } else { - this.value = {}; - } - this.key = undefined; - this.state = KEY; - this.mode = OBJECT; - }else if(token === LEFT_BRACKET){ - this.push(); - if (this.value) { - this.value = this.value[this.key] = []; - } else { - this.value = []; - } - this.key = 0; - this.mode = ARRAY; - this.state = VALUE; - }else if(token === RIGHT_BRACE){ - if (this.mode === OBJECT) { - this.pop(); - } else { - return this.parseError(token, value); - } - }else if(token === RIGHT_BRACKET){ - if (this.mode === ARRAY) { - this.pop(); - } else { - return this.parseError(token, value); - } - }else{ - return this.parseError(token, value); - } - }else if(this.state === KEY){ - if (token === STRING) { - this.key = value; - this.state = COLON; - } else if (token === RIGHT_BRACE) { - this.pop(); - } else { - return this.parseError(token, value); - } - }else if(this.state === COLON){ - if (token === COLON) { this.state = VALUE; } - else { return this.parseError(token, value); } - }else if(this.state === COMMA){ - if (token === COMMA) { - if (this.mode === ARRAY) { this.key++; this.state = VALUE; } - else if (this.mode === OBJECT) { this.state = KEY; } - - } else if (token === RIGHT_BRACKET && this.mode === ARRAY || token === RIGHT_BRACE && this.mode === OBJECT) { - this.pop(); - } else { - return this.parseError(token, value); - } - }else{ - return this.parseError(token, value); - } - }; - - Parser.C = C; - - var jsonparse = Parser; - - var Transform$1 = Stream.Transform; - - var JSON2CSVTransform = - /*#__PURE__*/ - function (_Transform) { - _inherits(JSON2CSVTransform, _Transform); - - function JSON2CSVTransform(opts, transformOpts) { - var _this; - - _classCallCheck(this, JSON2CSVTransform); - - _this = _possibleConstructorReturn(this, _getPrototypeOf(JSON2CSVTransform).call(this, transformOpts)); // Inherit methods from JSON2CSVBase since extends doesn't - // allow multiple inheritance and manually preprocess opts - - Object.getOwnPropertyNames(JSON2CSVBase_1.prototype).forEach(function (key) { - return _this[key] = JSON2CSVBase_1.prototype[key]; - }); - _this.opts = _this.preprocessOpts(opts); - _this._data = ''; - _this._hasWritten = false; - - if (_this._readableState.objectMode) { - _this.initObjectModeParse(); - } else if (_this.opts.ndjson) { - _this.initNDJSONParse(); - } else { - _this.initJSONParser(); - } - - if (_this.opts.withBOM) { - _this.push("\uFEFF"); - } - - if (_this.opts.fields) { - _this.opts.fields = _this.preprocessFieldsInfo(_this.opts.fields); - - _this.pushHeader(); - } - - return _this; - } - /** - * Init the transform with a parser to process data in object mode. - * It receives JSON objects one by one and send them to `pushLine for processing. - */ - - - _createClass(JSON2CSVTransform, [{ - key: "initObjectModeParse", - value: function initObjectModeParse() { - var transform = this; - this.parser = { - write: function write(line) { - transform.pushLine(line); - }, - getPendingData: function getPendingData() { - return undefined; - } - }; - } - /** - * Init the transform with a parser to process NDJSON data. - * It maintains a buffer of received data, parses each line - * as JSON and send it to `pushLine for processing. - */ - - }, { - key: "initNDJSONParse", - value: function initNDJSONParse() { - var transform = this; - this.parser = { - _data: '', - write: function write(chunk) { - this._data += chunk.toString(); - - var lines = this._data.split('\n').map(function (line) { - return line.trim(); - }).filter(function (line) { - return line !== ''; - }); - - var pendingData = false; - lines.forEach(function (line, i) { - try { - transform.pushLine(JSON.parse(line)); - } catch (e) { - if (i === lines.length - 1) { - pendingData = true; - } else { - e.message = "Invalid JSON (".concat(line, ")"); - transform.emit('error', e); - } - } - }); - this._data = pendingData ? this._data.slice(this._data.lastIndexOf('\n')) : ''; - }, - getPendingData: function getPendingData() { - return this._data; - } - }; - } - /** - * Init the transform with a parser to process JSON data. - * It maintains a buffer of received data, parses each as JSON - * item if the data is an array or the data itself otherwise - * and send it to `pushLine` for processing. - */ - - }, { - key: "initJSONParser", - value: function initJSONParser() { - var transform = this; - this.parser = new jsonparse(); - - this.parser.onValue = function (value) { - if (this.stack.length !== this.depthToEmit) return; - transform.pushLine(value); - }; - - this.parser._onToken = this.parser.onToken; - - this.parser.onToken = function (token, value) { - transform.parser._onToken(token, value); - - if (this.stack.length === 0 && !transform.opts.fields && this.mode !== jsonparse.C.ARRAY && this.mode !== jsonparse.C.OBJECT) { - this.onError(new Error('Data should not be empty or the "fields" option should be included')); - } - - if (this.stack.length === 1) { - if (this.depthToEmit === undefined) { - // If Array emit its content, else emit itself - this.depthToEmit = this.mode === jsonparse.C.ARRAY ? 1 : 0; - } - - if (this.depthToEmit !== 0 && this.stack.length === 1) { - // No need to store the whole root array in memory - this.value = undefined; - } - } - }; - - this.parser.getPendingData = function () { - return this.value; - }; - - this.parser.onError = function (err) { - if (err.message.includes('Unexpected')) { - err.message = "Invalid JSON (".concat(err.message, ")"); - } - - transform.emit('error', err); - }; - } - /** - * Main function that send data to the parse to be processed. - * - * @param {Buffer} chunk Incoming data - * @param {String} encoding Encoding of the incoming data. Defaults to 'utf8' - * @param {Function} done Called when the proceesing of the supplied chunk is done - */ - - }, { - key: "_transform", - value: function _transform(chunk, encoding, done) { - this.parser.write(chunk); - done(); - } - }, { - key: "_flush", - value: function _flush(done) { - if (this.parser.getPendingData()) { - done(new Error('Invalid data received from stdin', this.parser.getPendingData())); - } - - done(); - } - /** - * Generate the csv header and pushes it downstream. - */ - - }, { - key: "pushHeader", - value: function pushHeader() { - if (this.opts.header) { - var header = this.getHeader(); - this.emit('header', header); - this.push(header); - this._hasWritten = true; - } - } - /** - * Transforms an incoming json data to csv and pushes it downstream. - * - * @param {Object} data JSON object to be converted in a CSV row - */ - - }, { - key: "pushLine", - value: function pushLine(data) { - var _this2 = this; - - var processedData = this.preprocessRow(data); - - if (!this._hasWritten) { - this.opts.fields = this.opts.fields || this.preprocessFieldsInfo(Object.keys(processedData[0])); - this.pushHeader(); - } - - processedData.forEach(function (row) { - var line = _this2.processRow(row, _this2.opts); - - if (line === undefined) return; - - _this2.emit('line', line); - - _this2.push(_this2._hasWritten ? _this2.opts.eol + line : line); - - _this2._hasWritten = true; - }); - } - }]); - - return JSON2CSVTransform; - }(Transform$1); - - var JSON2CSVTransform_1 = JSON2CSVTransform; - - var Transform$2 = Stream.Transform; - var fastJoin$3 = utils.fastJoin; - - var JSON2CSVAsyncParser = - /*#__PURE__*/ - function () { - function JSON2CSVAsyncParser(opts, transformOpts) { - _classCallCheck(this, JSON2CSVAsyncParser); - - this.input = new Transform$2(transformOpts); - - this.input._read = function () {}; - - this.transform = new JSON2CSVTransform_1(opts, transformOpts); - this.processor = this.input.pipe(this.transform); - } - - _createClass(JSON2CSVAsyncParser, [{ - key: "fromInput", - value: function fromInput(input) { - if (this._input) { - throw new Error('Async parser already has an input.'); - } - - this._input = input; - this.input = this._input.pipe(this.processor); - return this; - } - }, { - key: "throughTransform", - value: function throughTransform(transform) { - if (this._output) { - throw new Error('Can\'t add transforms once an output has been added.'); - } - - this.processor = this.processor.pipe(transform); - return this; - } - }, { - key: "toOutput", - value: function toOutput(output) { - if (this._output) { - throw new Error('Async parser already has an output.'); - } - - this._output = output; - this.processor = this.processor.pipe(output); - return this; - } - }, { - key: "promise", - value: function promise() { - var _this = this; - - var returnCSV = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; - return new Promise(function (resolve, reject) { - if (!returnCSV) { - _this.processor.on('finish', function () { - return resolve(); - }).on('error', function (err) { - return reject(err); - }); - - return; - } - - var csvBuffer = []; - - _this.processor.on('data', function (chunk) { - return csvBuffer.push(chunk.toString()); - }).on('finish', function () { - return resolve(fastJoin$3(csvBuffer, '')); - }).on('error', function (err) { - return reject(err); - }); - }); - } - }]); - - return JSON2CSVAsyncParser; - }(); - - var JSON2CSVAsyncParser_1 = JSON2CSVAsyncParser; - - /** - * Performs the flattening of a data row recursively - * - * @param {String} separator Separator to be used as the flattened field name - * @returns {Object => Object} Flattened object - */ - function flatten() { - var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, - _ref$objects = _ref.objects, - objects = _ref$objects === void 0 ? true : _ref$objects, - _ref$arrays = _ref.arrays, - arrays = _ref$arrays === void 0 ? false : _ref$arrays, - _ref$separator = _ref.separator, - separator = _ref$separator === void 0 ? '.' : _ref$separator; - - function step(obj, flatDataRow, currentPath) { - Object.keys(obj).forEach(function (key) { - var newPath = currentPath ? "".concat(currentPath).concat(separator).concat(key) : key; - var value = obj[key]; - - if (objects && _typeof(value) === 'object' && value !== null && !Array.isArray(value) && Object.prototype.toString.call(value.toJSON) !== '[object Function]' && Object.keys(value).length) { - step(value, flatDataRow, newPath); - return; - } - - if (arrays && Array.isArray(value)) { - step(value, flatDataRow, newPath); - return; - } - - flatDataRow[newPath] = value; - }); - return flatDataRow; - } - - return function (dataRow) { - return step(dataRow, {}); - }; - } - - var flatten_1 = flatten; - - var setProp$1 = utils.setProp, - unsetProp$1 = utils.unsetProp, - flattenReducer$3 = utils.flattenReducer; - - function getUnwindablePaths(obj, currentPath) { - return Object.keys(obj).reduce(function (unwindablePaths, key) { - var newPath = currentPath ? "".concat(currentPath, ".").concat(key) : key; - var value = obj[key]; - - if (_typeof(value) === 'object' && value !== null && !Array.isArray(value) && Object.prototype.toString.call(value.toJSON) !== '[object Function]' && Object.keys(value).length) { - unwindablePaths = unwindablePaths.concat(getUnwindablePaths(value, newPath)); - } else if (Array.isArray(value)) { - unwindablePaths.push(newPath); - unwindablePaths = unwindablePaths.concat(value.map(function (arrObj) { - return getUnwindablePaths(arrObj, newPath); - }).reduce(flattenReducer$3, []).filter(function (item, index, arr) { - return arr.indexOf(item) !== index; - })); - } - - return unwindablePaths; - }, []); - } - /** - * Performs the unwind recursively in specified sequence - * - * @param {String[]} unwindPaths The paths as strings to be used to deconstruct the array - * @returns {Object => Array} Array of objects containing all rows after unwind of chosen paths - */ - - - function unwind() { - var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, - _ref$paths = _ref.paths, - paths = _ref$paths === void 0 ? undefined : _ref$paths, - _ref$blankOut = _ref.blankOut, - blankOut = _ref$blankOut === void 0 ? false : _ref$blankOut; - - function unwindReducer(rows, unwindPath) { - return rows.map(function (row) { - var unwindArray = lodash_get(row, unwindPath); - - if (!Array.isArray(unwindArray)) { - return row; - } - - if (!unwindArray.length) { - return unsetProp$1(row, unwindPath); - } - - return unwindArray.map(function (unwindRow, index) { - var clonedRow = blankOut && index > 0 ? {} : row; - return setProp$1(clonedRow, unwindPath, unwindRow); - }); - }).reduce(flattenReducer$3, []); - } - - paths = Array.isArray(paths) ? paths : paths ? [paths] : undefined; - return function (dataRow) { - return (paths || getUnwindablePaths(dataRow)).reduce(unwindReducer, [dataRow]); - }; - } - - var unwind_1 = unwind; - - var Readable$1 = Stream.Readable; - var Parser$1 = JSON2CSVParser_1; - var AsyncParser = JSON2CSVAsyncParser_1; - var Transform$3 = JSON2CSVTransform_1; // Convenience method to keep the API similar to version 3.X - - var parse = function parse(data, opts) { - return new JSON2CSVParser_1(opts).parse(data); - }; - - var parseAsync = function parseAsync(data, opts, transformOpts) { - try { - if (!(data instanceof Readable$1)) { - transformOpts = Object.assign({}, transformOpts, { - objectMode: true - }); - } - - var asyncParser = new JSON2CSVAsyncParser_1(opts, transformOpts); - var promise = asyncParser.promise(); - - if (Array.isArray(data)) { - data.forEach(function (item) { - return asyncParser.input.push(item); - }); - asyncParser.input.push(null); - } else if (data instanceof Readable$1) { - asyncParser.fromInput(data); - } else { - asyncParser.input.push(data); - asyncParser.input.push(null); - } - - return promise; - } catch (err) { - return Promise.reject(err); - } - }; - - var transforms = { - flatten: flatten_1, - unwind: unwind_1 - }; - var json2csv = { - Parser: Parser$1, - AsyncParser: AsyncParser, - Transform: Transform$3, - parse: parse, - parseAsync: parseAsync, - transforms: transforms - }; - - exports.AsyncParser = AsyncParser; - exports.Parser = Parser$1; - exports.Transform = Transform$3; - exports.default = json2csv; - exports.parse = parse; - exports.parseAsync = parseAsync; - exports.transforms = transforms; - - Object.defineProperty(exports, '__esModule', { value: true }); - -})); diff --git a/node_modules/json2csv/lib/JSON2CSVAsyncParser.js b/node_modules/json2csv/lib/JSON2CSVAsyncParser.js deleted file mode 100644 index 6773b73..0000000 --- a/node_modules/json2csv/lib/JSON2CSVAsyncParser.js +++ /dev/null @@ -1,60 +0,0 @@ -'use strict'; - -const { Transform } = require('stream'); -const JSON2CSVTransform = require('./JSON2CSVTransform'); -const { fastJoin } = require('./utils'); - -class JSON2CSVAsyncParser { - constructor(opts, transformOpts) { - this.input = new Transform(transformOpts); - this.input._read = () => {}; - - this.transform = new JSON2CSVTransform(opts, transformOpts); - this.processor = this.input.pipe(this.transform); - } - - fromInput(input) { - if (this._input) { - throw new Error('Async parser already has an input.'); - } - this._input = input; - this.input = this._input.pipe(this.processor); - return this; - } - - throughTransform(transform) { - if (this._output) { - throw new Error('Can\'t add transforms once an output has been added.'); - } - this.processor = this.processor.pipe(transform); - return this; - } - - toOutput(output) { - if (this._output) { - throw new Error('Async parser already has an output.'); - } - this._output = output; - this.processor = this.processor.pipe(output); - return this; - } - - promise(returnCSV = true) { - return new Promise((resolve, reject) => { - if (!returnCSV) { - this.processor - .on('finish', () => resolve()) - .on('error', err => reject(err)); - return; - } - - let csvBuffer = []; - this.processor - .on('data', chunk => csvBuffer.push(chunk.toString())) - .on('finish', () => resolve(fastJoin(csvBuffer, ''))) - .on('error', err => reject(err)); - }); - } -} - -module.exports = JSON2CSVAsyncParser \ No newline at end of file diff --git a/node_modules/json2csv/lib/JSON2CSVBase.js b/node_modules/json2csv/lib/JSON2CSVBase.js deleted file mode 100644 index 708054e..0000000 --- a/node_modules/json2csv/lib/JSON2CSVBase.js +++ /dev/null @@ -1,186 +0,0 @@ -'use strict'; - -const os = require('os'); -const lodashGet = require('lodash.get'); -const { getProp, fastJoin, flattenReducer } = require('./utils'); - -class JSON2CSVBase { - constructor(opts) { - this.opts = this.preprocessOpts(opts); - } - - /** - * Check passing opts and set defaults. - * - * @param {Json2CsvOptions} opts Options object containing fields, - * delimiter, default value, quote mark, header, etc. - */ - preprocessOpts(opts) { - const processedOpts = Object.assign({}, opts); - processedOpts.transforms = !Array.isArray(processedOpts.transforms) - ? (processedOpts.transforms ? [processedOpts.transforms] : []) - : processedOpts.transforms - processedOpts.delimiter = processedOpts.delimiter || ','; - processedOpts.eol = processedOpts.eol || os.EOL; - processedOpts.quote = typeof processedOpts.quote === 'string' - ? processedOpts.quote - : '"'; - processedOpts.escapedQuote = typeof processedOpts.escapedQuote === 'string' - ? processedOpts.escapedQuote - : `${processedOpts.quote}${processedOpts.quote}`; - processedOpts.header = processedOpts.header !== false; - processedOpts.includeEmptyRows = processedOpts.includeEmptyRows || false; - processedOpts.withBOM = processedOpts.withBOM || false; - - return processedOpts; - } - - /** - * Check and normalize the fields configuration. - * - * @param {(string|object)[]} fields Fields configuration provided by the user - * or inferred from the data - * @returns {object[]} preprocessed FieldsInfo array - */ - preprocessFieldsInfo(fields) { - return fields.map((fieldInfo) => { - if (typeof fieldInfo === 'string') { - return { - label: fieldInfo, - value: (fieldInfo.includes('.') || fieldInfo.includes('[')) - ? row => lodashGet(row, fieldInfo, this.opts.defaultValue) - : row => getProp(row, fieldInfo, this.opts.defaultValue), - }; - } - - if (typeof fieldInfo === 'object') { - const defaultValue = 'default' in fieldInfo - ? fieldInfo.default - : this.opts.defaultValue; - - if (typeof fieldInfo.value === 'string') { - return { - label: fieldInfo.label || fieldInfo.value, - value: (fieldInfo.value.includes('.') || fieldInfo.value.includes('[')) - ? row => lodashGet(row, fieldInfo.value, defaultValue) - : row => getProp(row, fieldInfo.value, defaultValue), - }; - } - - if (typeof fieldInfo.value === 'function') { - const label = fieldInfo.label || fieldInfo.value.name || ''; - const field = { label, default: defaultValue }; - return { - label, - value(row) { - const value = fieldInfo.value(row, field); - return (value === null || value === undefined) - ? defaultValue - : value; - }, - } - } - } - - throw new Error('Invalid field info option. ' + JSON.stringify(fieldInfo)); - }); - } - - /** - * Create the title row with all the provided fields as column headings - * - * @returns {String} titles as a string - */ - getHeader() { - return fastJoin( - this.opts.fields.map(fieldInfo => this.processValue(fieldInfo.label)), - this.opts.delimiter - ); - } - - /** - * Preprocess each object according to the given transforms (unwind, flatten, etc.). - * @param {Object} row JSON object to be converted in a CSV row - */ - preprocessRow(row) { - return this.opts.transforms.reduce((rows, transform) => - rows.map(row => transform(row)).reduce(flattenReducer, []), - [row] - ); - } - - /** - * Create the content of a specific CSV row - * - * @param {Object} row JSON object to be converted in a CSV row - * @returns {String} CSV string (row) - */ - processRow(row) { - if (!row) { - return undefined; - } - - const processedRow = this.opts.fields.map(fieldInfo => this.processCell(row, fieldInfo)); - - if (!this.opts.includeEmptyRows && processedRow.every(field => field === undefined)) { - return undefined; - } - - return fastJoin( - processedRow, - this.opts.delimiter - ); - } - - /** - * Create the content of a specfic CSV row cell - * - * @param {Object} row JSON object representing the CSV row that the cell belongs to - * @param {FieldInfo} fieldInfo Details of the field to process to be a CSV cell - * @returns {String} CSV string (cell) - */ - processCell(row, fieldInfo) { - return this.processValue(fieldInfo.value(row)); - } - - /** - * Create the content of a specfic CSV row cell - * - * @param {Any} value Value to be included in a CSV cell - * @returns {String} Value stringified and processed - */ - processValue(value) { - if (value === null || value === undefined) { - return undefined; - } - - const valueType = typeof value; - if (valueType !== 'boolean' && valueType !== 'number' && valueType !== 'string') { - value = JSON.stringify(value); - - if (value === undefined) { - return undefined; - } - - if (value[0] === '"') { - value = value.replace(/^"(.+)"$/,'$1'); - } - } - - if (typeof value === 'string') { - if(value.includes(this.opts.quote)) { - value = value.replace(new RegExp(this.opts.quote, 'g'), this.opts.escapedQuote); - } - - value = `${this.opts.quote}${value}${this.opts.quote}`; - - if (this.opts.excelStrings) { - value = `"="${value}""`; - } - } - - return value; - } -} - -module.exports = JSON2CSVBase; diff --git a/node_modules/json2csv/lib/JSON2CSVParser.js b/node_modules/json2csv/lib/JSON2CSVParser.js deleted file mode 100644 index 9b3b0c0..0000000 --- a/node_modules/json2csv/lib/JSON2CSVParser.js +++ /dev/null @@ -1,81 +0,0 @@ -'use strict'; - -const JSON2CSVBase = require('./JSON2CSVBase'); -const { fastJoin, flattenReducer } = require('./utils'); - -class JSON2CSVParser extends JSON2CSVBase { - constructor(opts) { - super(opts); - if (this.opts.fields) { - this.opts.fields = this.preprocessFieldsInfo(this.opts.fields); - } - } - /** - * Main function that converts json to csv. - * - * @param {Array|Object} data Array of JSON objects to be converted to CSV - * @returns {String} The CSV formated data as a string - */ - parse(data) { - const processedData = this.preprocessData(data); - - if (!this.opts.fields) { - this.opts.fields = processedData - .reduce((fields, item) => { - Object.keys(item).forEach((field) => { - if (!fields.includes(field)) { - fields.push(field) - } - }); - - return fields - }, []); - - this.opts.fields = this.preprocessFieldsInfo(this.opts.fields); - } - - const header = this.opts.header ? this.getHeader() : ''; - const rows = this.processData(processedData); - const csv = (this.opts.withBOM ? '\ufeff' : '') - + header - + ((header && rows) ? this.opts.eol : '') - + rows; - - return csv; - } - - /** - * Preprocess the data according to the give opts (unwind, flatten, etc.) - and calculate the fields and field names if they are not provided. - * - * @param {Array|Object} data Array or object to be converted to CSV - */ - preprocessData(data) { - const processedData = Array.isArray(data) ? data : [data]; - - if (!this.opts.fields && (processedData.length === 0 || typeof processedData[0] !== 'object')) { - throw new Error('Data should not be empty or the "fields" option should be included'); - } - - if (this.opts.transforms.length === 0) return processedData; - - return processedData - .map(row => this.preprocessRow(row)) - .reduce(flattenReducer, []); - } - - /** - * Create the content row by row below the header - * - * @param {Array} data Array of JSON objects to be converted to CSV - * @returns {String} CSV string (body) - */ - processData(data) { - return fastJoin( - data.map(row => this.processRow(row)).filter(row => row), // Filter empty rows - this.opts.eol - ); - } -} - -module.exports = JSON2CSVParser; diff --git a/node_modules/json2csv/lib/JSON2CSVTransform.js b/node_modules/json2csv/lib/JSON2CSVTransform.js deleted file mode 100644 index f7a52f2..0000000 --- a/node_modules/json2csv/lib/JSON2CSVTransform.js +++ /dev/null @@ -1,203 +0,0 @@ -'use strict'; - -const { Transform } = require('stream'); -const Parser = require('jsonparse'); -const JSON2CSVBase = require('./JSON2CSVBase'); - -class JSON2CSVTransform extends Transform { - constructor(opts, transformOpts) { - super(transformOpts); - - // Inherit methods from JSON2CSVBase since extends doesn't - // allow multiple inheritance and manually preprocess opts - Object.getOwnPropertyNames(JSON2CSVBase.prototype) - .forEach(key => (this[key] = JSON2CSVBase.prototype[key])); - this.opts = this.preprocessOpts(opts); - - this._data = ''; - this._hasWritten = false; - - if (this._readableState.objectMode) { - this.initObjectModeParse(); - } else if (this.opts.ndjson) { - this.initNDJSONParse(); - } else { - this.initJSONParser(); - } - - if (this.opts.withBOM) { - this.push('\ufeff'); - } - - if (this.opts.fields) { - this.opts.fields = this.preprocessFieldsInfo(this.opts.fields); - this.pushHeader(); - } - } - - /** - * Init the transform with a parser to process data in object mode. - * It receives JSON objects one by one and send them to `pushLine for processing. - */ - initObjectModeParse() { - const transform = this; - - this.parser = { - write(line) { - transform.pushLine(line); - }, - getPendingData() { - return undefined; - } - }; - } - - /** - * Init the transform with a parser to process NDJSON data. - * It maintains a buffer of received data, parses each line - * as JSON and send it to `pushLine for processing. - */ - initNDJSONParse() { - const transform = this; - - this.parser = { - _data: '', - write(chunk) { - this._data += chunk.toString(); - const lines = this._data - .split('\n') - .map(line => line.trim()) - .filter(line => line !== ''); - - let pendingData = false; - lines - .forEach((line, i) => { - try { - transform.pushLine(JSON.parse(line)); - } catch(e) { - if (i === lines.length - 1) { - pendingData = true; - } else { - e.message = `Invalid JSON (${line})` - transform.emit('error', e); - } - } - }); - this._data = pendingData - ? this._data.slice(this._data.lastIndexOf('\n')) - : ''; - }, - getPendingData() { - return this._data; - } - }; - } - - /** - * Init the transform with a parser to process JSON data. - * It maintains a buffer of received data, parses each as JSON - * item if the data is an array or the data itself otherwise - * and send it to `pushLine` for processing. - */ - initJSONParser() { - const transform = this; - this.parser = new Parser(); - this.parser.onValue = function (value) { - if (this.stack.length !== this.depthToEmit) return; - transform.pushLine(value); - } - - this.parser._onToken = this.parser.onToken; - - this.parser.onToken = function (token, value) { - transform.parser._onToken(token, value); - - if (this.stack.length === 0 - && !transform.opts.fields - && this.mode !== Parser.C.ARRAY - && this.mode !== Parser.C.OBJECT) { - this.onError(new Error('Data should not be empty or the "fields" option should be included')); - } - - if (this.stack.length === 1) { - if(this.depthToEmit === undefined) { - // If Array emit its content, else emit itself - this.depthToEmit = (this.mode === Parser.C.ARRAY) ? 1 : 0; - } - - if (this.depthToEmit !== 0 && this.stack.length === 1) { - // No need to store the whole root array in memory - this.value = undefined; - } - } - } - - this.parser.getPendingData = function () { - return this.value; - } - - this.parser.onError = function (err) { - if(err.message.includes('Unexpected')) { - err.message = `Invalid JSON (${err.message})`; - } - transform.emit('error', err); - } - } - - /** - * Main function that send data to the parse to be processed. - * - * @param {Buffer} chunk Incoming data - * @param {String} encoding Encoding of the incoming data. Defaults to 'utf8' - * @param {Function} done Called when the proceesing of the supplied chunk is done - */ - _transform(chunk, encoding, done) { - this.parser.write(chunk); - done(); - } - - _flush(done) { - if (this.parser.getPendingData()) { - done(new Error('Invalid data received from stdin', this.parser.getPendingData())); - } - - done(); - } - - - /** - * Generate the csv header and pushes it downstream. - */ - pushHeader() { - if (this.opts.header) { - const header = this.getHeader(); - this.emit('header', header); - this.push(header); - this._hasWritten = true; - } - } - - /** - * Transforms an incoming json data to csv and pushes it downstream. - * - * @param {Object} data JSON object to be converted in a CSV row - */ - pushLine(data) { - const processedData = this.preprocessRow(data); - - if (!this._hasWritten) { - this.opts.fields = this.opts.fields || this.preprocessFieldsInfo(Object.keys(processedData[0])); - this.pushHeader(); - } - - processedData.forEach(row => { - const line = this.processRow(row, this.opts); - if (line === undefined) return; - this.emit('line', line); - this.push(this._hasWritten ? this.opts.eol + line : line); - this._hasWritten = true; - }); - } -} - -module.exports = JSON2CSVTransform; diff --git a/node_modules/json2csv/lib/json2csv.js b/node_modules/json2csv/lib/json2csv.js deleted file mode 100644 index 7fe5ba4..0000000 --- a/node_modules/json2csv/lib/json2csv.js +++ /dev/null @@ -1,44 +0,0 @@ -'use strict'; - -const { Readable } = require('stream'); -const JSON2CSVParser = require('./JSON2CSVParser'); -const JSON2CSVAsyncParser = require('./JSON2CSVAsyncParser'); -const JSON2CSVTransform = require('./JSON2CSVTransform'); -const flatten = require('./transforms/flatten'); -const unwind = require('./transforms/unwind'); - -module.exports.Parser = JSON2CSVParser; -module.exports.AsyncParser = JSON2CSVAsyncParser; -module.exports.Transform = JSON2CSVTransform; - -// Convenience method to keep the API similar to version 3.X -module.exports.parse = (data, opts) => new JSON2CSVParser(opts).parse(data); -module.exports.parseAsync = (data, opts, transformOpts) => { - try { - if (!(data instanceof Readable)) { - transformOpts = Object.assign({}, transformOpts, { objectMode: true }); - } - - const asyncParser = new JSON2CSVAsyncParser(opts, transformOpts); - const promise = asyncParser.promise(); - - if (Array.isArray(data)) { - data.forEach(item => asyncParser.input.push(item)); - asyncParser.input.push(null); - } else if (data instanceof Readable) { - asyncParser.fromInput(data); - } else { - asyncParser.input.push(data); - asyncParser.input.push(null); - } - - return promise; - } catch (err) { - return Promise.reject(err); - } -}; - -module.exports.transforms = { - flatten, - unwind, -}; \ No newline at end of file diff --git a/node_modules/json2csv/lib/transforms/flatten.js b/node_modules/json2csv/lib/transforms/flatten.js deleted file mode 100644 index a7dcf1b..0000000 --- a/node_modules/json2csv/lib/transforms/flatten.js +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Performs the flattening of a data row recursively - * - * @param {String} separator Separator to be used as the flattened field name - * @returns {Object => Object} Flattened object - */ -function flatten({ objects = true, arrays = false, separator = '.' } = {}) { - function step (obj, flatDataRow, currentPath) { - Object.keys(obj).forEach((key) => { - const newPath = currentPath ? `${currentPath}${separator}${key}` : key; - const value = obj[key]; - - if (objects - && typeof value === 'object' - && value !== null - && !Array.isArray(value) - && Object.prototype.toString.call(value.toJSON) !== '[object Function]' - && Object.keys(value).length) { - step(value, flatDataRow, newPath); - return; - } - - if (arrays && Array.isArray(value)) { - step(value, flatDataRow, newPath); - return; - } - - flatDataRow[newPath] = value; - }); - - return flatDataRow; - } - - return dataRow => step(dataRow, {}); -} - -module.exports = flatten; diff --git a/node_modules/json2csv/lib/transforms/unwind.js b/node_modules/json2csv/lib/transforms/unwind.js deleted file mode 100644 index 65b1803..0000000 --- a/node_modules/json2csv/lib/transforms/unwind.js +++ /dev/null @@ -1,63 +0,0 @@ - -const lodashGet = require('lodash.get'); -const { setProp, unsetProp, flattenReducer } = require('../utils'); - -function getUnwindablePaths(obj, currentPath) { - return Object.keys(obj).reduce((unwindablePaths, key) => { - const newPath = currentPath ? `${currentPath}.${key}` : key; - const value = obj[key]; - - if (typeof value === 'object' - && value !== null - && !Array.isArray(value) - && Object.prototype.toString.call(value.toJSON) !== '[object Function]' - && Object.keys(value).length) { - unwindablePaths = unwindablePaths.concat(getUnwindablePaths(value, newPath)); - } else if (Array.isArray(value)) { - unwindablePaths.push(newPath); - unwindablePaths = unwindablePaths.concat(value - .map(arrObj => getUnwindablePaths(arrObj, newPath)) - .reduce(flattenReducer, []) - .filter((item, index, arr) => arr.indexOf(item) !== index)); - } - - return unwindablePaths; - }, []); -} - -/** - * Performs the unwind recursively in specified sequence - * - * @param {String[]} unwindPaths The paths as strings to be used to deconstruct the array - * @returns {Object => Array} Array of objects containing all rows after unwind of chosen paths -*/ -function unwind({ paths = undefined, blankOut = false } = {}) { - function unwindReducer(rows, unwindPath) { - return rows - .map(row => { - const unwindArray = lodashGet(row, unwindPath); - - if (!Array.isArray(unwindArray)) { - return row; - } - - if (!unwindArray.length) { - return unsetProp(row, unwindPath); - } - - return unwindArray.map((unwindRow, index) => { - const clonedRow = (blankOut && index > 0) - ? {} - : row; - - return setProp(clonedRow, unwindPath, unwindRow); - }); - }) - .reduce(flattenReducer, []); - } - - paths = Array.isArray(paths) ? paths : (paths ? [paths] : undefined); - return dataRow => (paths || getUnwindablePaths(dataRow)).reduce(unwindReducer, [dataRow]); -} - -module.exports = unwind; \ No newline at end of file diff --git a/node_modules/json2csv/lib/utils.js b/node_modules/json2csv/lib/utils.js deleted file mode 100644 index aa7701c..0000000 --- a/node_modules/json2csv/lib/utils.js +++ /dev/null @@ -1,66 +0,0 @@ -'use strict'; - -function getProp(obj, path, defaultValue) { - return obj[path] === undefined ? defaultValue : obj[path]; -} - -function setProp(obj, path, value) { - const pathArray = Array.isArray(path) ? path : path.split('.'); - const [key, ...restPath] = pathArray; - const newValue = pathArray.length > 1 ? setProp(obj[key] || {}, restPath, value) : value; - return Object.assign({}, obj, { [key]: newValue }); -} - -function unsetProp(obj, path) { - const pathArray = Array.isArray(path) ? path : path.split('.'); - const [key, ...restPath] = pathArray; - - if (typeof obj[key] !== 'object') { - // This will never be hit in the current code because unwind does the check before calling unsetProp - /* istanbul ignore next */ - return obj; - } - - if (pathArray.length === 1) { - return Object.keys(obj) - .filter(prop => prop !== key) - .reduce((acc, prop) => Object.assign(acc, { [prop]: obj[prop] }), {}); - } - - return unsetProp(obj[key], restPath); -} - -function flattenReducer(acc, arr) { - try { - // This is faster but susceptible to `RangeError: Maximum call stack size exceeded` - acc.push(...arr); - return acc; - } catch (err) { - // Fallback to a slower but safer option - return acc.concat(arr); - } -} - -function fastJoin(arr, separator) { - let isFirst = true; - return arr.reduce((acc, elem) => { - if (elem === null || elem === undefined) { - elem = ''; - } - - if (isFirst) { - isFirst = false; - return `${elem}`; - } - - return `${acc}${separator}${elem}`; - }, ''); -} - -module.exports = { - getProp, - setProp, - unsetProp, - fastJoin, - flattenReducer -}; \ No newline at end of file diff --git a/node_modules/json2csv/package.json b/node_modules/json2csv/package.json deleted file mode 100644 index 287dfca..0000000 --- a/node_modules/json2csv/package.json +++ /dev/null @@ -1,103 +0,0 @@ -{ - "_args": [ - [ - "json2csv@5.0.5", - "/home/nuno/Documents/core/software/fresh/js/metaforecasts/metaforecasts-current" - ] - ], - "_from": "json2csv@5.0.5", - "_id": "json2csv@5.0.5", - "_inBundle": false, - "_integrity": "sha512-/UyvnfuUghRM+C/AiQ02X0LS+/AKfugcwaWo/gAz1pi203v29sUMrMSNEC088i+h0EG39eSsmeL9Z0iK+9MM0A==", - "_location": "/json2csv", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "json2csv@5.0.5", - "name": "json2csv", - "escapedName": "json2csv", - "rawSpec": "5.0.5", - "saveSpec": null, - "fetchSpec": "5.0.5" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/json2csv/-/json2csv-5.0.5.tgz", - "_spec": "5.0.5", - "_where": "/home/nuno/Documents/core/software/fresh/js/metaforecasts/metaforecasts-current", - "author": { - "name": "Mirco Zeiss", - "email": "mirco.zeiss@gmail.com" - }, - "bin": { - "json2csv": "bin/json2csv.js" - }, - "browser": "dist/json2csv.umd.js", - "bugs": { - "url": "https://github.com/zemirco/json2csv/issues" - }, - "dependencies": { - "commander": "^6.1.0", - "jsonparse": "^1.3.1", - "lodash.get": "^4.4.2" - }, - "description": "Convert JSON to CSV", - "devDependencies": { - "@babel/core": "^7.3.3", - "@babel/preset-env": "^7.3.1", - "coveralls": "^3.0.3", - "docpress": "^0.8.0", - "eslint": "^6.1.0", - "gh-pages": "^2.0.1", - "in-publish": "^2.0.0", - "nyc": "^14.1.1", - "rollup": "^1.11.0", - "rollup-plugin-babel": "^4.3.2", - "rollup-plugin-commonjs": "^10.0.2", - "rollup-plugin-node-builtins": "^2.1.2", - "rollup-plugin-node-globals": "^1.2.1", - "rollup-plugin-node-resolve": "^5.2.0", - "standard-version": "^8.0.1", - "tap-spec": "^5.0.0", - "tape": "^4.10.1" - }, - "engines": { - "node": ">= 10", - "npm": ">= 6.13.0" - }, - "homepage": "http://zemirco.github.io/json2csv", - "keywords": [ - "json", - "to", - "csv", - "export", - "convert", - "parse" - ], - "license": "MIT", - "main": "lib/json2csv.js", - "module": "dist/json2csv.esm.js", - "name": "json2csv", - "repository": { - "type": "git", - "url": "git+https://github.com/zemirco/json2csv.git" - }, - "scripts": { - "before:publish": "npm test && npm run build && npm run deploy:docs", - "build": "rollup -c", - "coveralls": "nyc report --reporter=text-lcov | coveralls", - "deploy:docs": "docpress b && gh-pages -d _docpress", - "dev": "rollup -c -w", - "lint": "eslint bin lib test", - "prepublish": "in-publish && npm run before:publish || not-in-publish", - "release": "standard-version", - "test": "node test | tap-spec", - "test-with-coverage": "nyc --reporter=text node test | tap-spec" - }, - "version": "5.0.5", - "volta": { - "node": "10.19.0" - } -} diff --git a/node_modules/json2csv/rollup.config.js b/node_modules/json2csv/rollup.config.js deleted file mode 100644 index 05670a1..0000000 --- a/node_modules/json2csv/rollup.config.js +++ /dev/null @@ -1,46 +0,0 @@ -import resolve from 'rollup-plugin-node-resolve'; -import commonjs from 'rollup-plugin-commonjs'; -import globals from 'rollup-plugin-node-globals'; -import builtins from 'rollup-plugin-node-builtins'; -import babel from 'rollup-plugin-babel'; -import pkg from './package.json'; - -export default [ - { - input: 'lib/json2csv.js', - output: { - file: pkg.browser, - format: 'umd', - name: 'json2csv' - }, - plugins: [ - resolve({ - browser: true - }), - commonjs(), - globals(), - builtins(), - babel({ - exclude: ['node_modules/**'], - babelrc: false, - presets: [['@babel/env', { modules: false }]], - }) - ] - }, - { - input: 'lib/json2csv.js', - output: [ - { file: pkg.module, format: 'es' } - ], - external: [ 'os', 'stream' ], - plugins: [ - resolve(), - commonjs(), - babel({ - exclude: ['node_modules/**'], - babelrc: false, - presets: [['@babel/env', { modules: false }]], - }) - ] - } -]; diff --git a/node_modules/jsonparse/.npmignore b/node_modules/jsonparse/.npmignore deleted file mode 100644 index b512c09..0000000 --- a/node_modules/jsonparse/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules \ No newline at end of file diff --git a/node_modules/jsonparse/LICENSE b/node_modules/jsonparse/LICENSE deleted file mode 100644 index 6dc24be..0000000 --- a/node_modules/jsonparse/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -The MIT License - -Copyright (c) 2012 Tim Caswell - -Permission is hereby granted, free of charge, -to any person obtaining a copy of this software and -associated documentation files (the "Software"), to -deal in the Software without restriction, including -without limitation the rights to use, copy, modify, -merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom -the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice -shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR -ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/jsonparse/README.markdown b/node_modules/jsonparse/README.markdown deleted file mode 100644 index 0f405d3..0000000 --- a/node_modules/jsonparse/README.markdown +++ /dev/null @@ -1,11 +0,0 @@ -This is a streaming JSON parser. For a simpler, sax-based version see this gist: https://gist.github.com/1821394 - -The MIT License (MIT) -Copyright (c) 2011-2012 Tim Caswell - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/node_modules/jsonparse/bench.js b/node_modules/jsonparse/bench.js deleted file mode 100644 index b36d92f..0000000 --- a/node_modules/jsonparse/bench.js +++ /dev/null @@ -1,26 +0,0 @@ -var fs = require('fs'), - Parser = require('./jsonparse'); - - -var json = fs.readFileSync("samplejson/basic.json"); - - -while (true) { - var start = Date.now(); - for (var i = 0; i < 1000; i++) { - JSON.parse(json); - } - var first = Date.now() - start; - - start = Date.now(); - var p = new Parser(); - for (var i = 0; i < 1000; i++) { - p.write(json); - } - var second = Date.now() - start; - - - console.log("JSON.parse took %s", first); - console.log("streaming parser took %s", second); - console.log("streaming is %s times slower", second / first); -} diff --git a/node_modules/jsonparse/examples/twitterfeed.js b/node_modules/jsonparse/examples/twitterfeed.js deleted file mode 100644 index 10210d4..0000000 --- a/node_modules/jsonparse/examples/twitterfeed.js +++ /dev/null @@ -1,30 +0,0 @@ -var Parser = require('../jsonparse'); -var Http = require('http'); -require('./colors'); -var p = new Parser(); -var cred = require('./credentials'); -var client = Http.createClient(80, "stream.twitter.com"); -var request = client.request("GET", "/1/statuses/sample.json", { - "Host": "stream.twitter.com", - "Authorization": (new Buffer(cred.username + ":" + cred.password)).toString("base64") -}); -request.on('response', function (response) { - console.log(response.statusCode); - console.dir(response.headers); - response.on('data', function (chunk) { - p.write(chunk); - }); - response.on('end', function () { - console.log("END"); - }); -}); -request.end(); -var text = "", name = ""; -p.onValue = function (value) { - if (this.stack.length === 1 && this.key === 'text') { text = value; } - if (this.stack.length === 2 && this.key === 'name' && this.stack[1].key === 'user') { name = value; } - if (this.stack.length === 0) { - console.log(text.blue + " - " + name.yellow); - text = name = ""; - } -}; diff --git a/node_modules/jsonparse/jsonparse.js b/node_modules/jsonparse/jsonparse.js deleted file mode 100644 index 3991060..0000000 --- a/node_modules/jsonparse/jsonparse.js +++ /dev/null @@ -1,413 +0,0 @@ -/*global Buffer*/ -// Named constants with unique integer values -var C = {}; -// Tokens -var LEFT_BRACE = C.LEFT_BRACE = 0x1; -var RIGHT_BRACE = C.RIGHT_BRACE = 0x2; -var LEFT_BRACKET = C.LEFT_BRACKET = 0x3; -var RIGHT_BRACKET = C.RIGHT_BRACKET = 0x4; -var COLON = C.COLON = 0x5; -var COMMA = C.COMMA = 0x6; -var TRUE = C.TRUE = 0x7; -var FALSE = C.FALSE = 0x8; -var NULL = C.NULL = 0x9; -var STRING = C.STRING = 0xa; -var NUMBER = C.NUMBER = 0xb; -// Tokenizer States -var START = C.START = 0x11; -var STOP = C.STOP = 0x12; -var TRUE1 = C.TRUE1 = 0x21; -var TRUE2 = C.TRUE2 = 0x22; -var TRUE3 = C.TRUE3 = 0x23; -var FALSE1 = C.FALSE1 = 0x31; -var FALSE2 = C.FALSE2 = 0x32; -var FALSE3 = C.FALSE3 = 0x33; -var FALSE4 = C.FALSE4 = 0x34; -var NULL1 = C.NULL1 = 0x41; -var NULL2 = C.NULL2 = 0x42; -var NULL3 = C.NULL3 = 0x43; -var NUMBER1 = C.NUMBER1 = 0x51; -var NUMBER3 = C.NUMBER3 = 0x53; -var STRING1 = C.STRING1 = 0x61; -var STRING2 = C.STRING2 = 0x62; -var STRING3 = C.STRING3 = 0x63; -var STRING4 = C.STRING4 = 0x64; -var STRING5 = C.STRING5 = 0x65; -var STRING6 = C.STRING6 = 0x66; -// Parser States -var VALUE = C.VALUE = 0x71; -var KEY = C.KEY = 0x72; -// Parser Modes -var OBJECT = C.OBJECT = 0x81; -var ARRAY = C.ARRAY = 0x82; -// Character constants -var BACK_SLASH = "\\".charCodeAt(0); -var FORWARD_SLASH = "\/".charCodeAt(0); -var BACKSPACE = "\b".charCodeAt(0); -var FORM_FEED = "\f".charCodeAt(0); -var NEWLINE = "\n".charCodeAt(0); -var CARRIAGE_RETURN = "\r".charCodeAt(0); -var TAB = "\t".charCodeAt(0); - -var STRING_BUFFER_SIZE = 64 * 1024; - -function Parser() { - this.tState = START; - this.value = undefined; - - this.string = undefined; // string data - this.stringBuffer = Buffer.alloc ? Buffer.alloc(STRING_BUFFER_SIZE) : new Buffer(STRING_BUFFER_SIZE); - this.stringBufferOffset = 0; - this.unicode = undefined; // unicode escapes - this.highSurrogate = undefined; - - this.key = undefined; - this.mode = undefined; - this.stack = []; - this.state = VALUE; - this.bytes_remaining = 0; // number of bytes remaining in multi byte utf8 char to read after split boundary - this.bytes_in_sequence = 0; // bytes in multi byte utf8 char to read - this.temp_buffs = { "2": new Buffer(2), "3": new Buffer(3), "4": new Buffer(4) }; // for rebuilding chars split before boundary is reached - - // Stream offset - this.offset = -1; -} - -// Slow code to string converter (only used when throwing syntax errors) -Parser.toknam = function (code) { - var keys = Object.keys(C); - for (var i = 0, l = keys.length; i < l; i++) { - var key = keys[i]; - if (C[key] === code) { return key; } - } - return code && ("0x" + code.toString(16)); -}; - -var proto = Parser.prototype; -proto.onError = function (err) { throw err; }; -proto.charError = function (buffer, i) { - this.tState = STOP; - this.onError(new Error("Unexpected " + JSON.stringify(String.fromCharCode(buffer[i])) + " at position " + i + " in state " + Parser.toknam(this.tState))); -}; -proto.appendStringChar = function (char) { - if (this.stringBufferOffset >= STRING_BUFFER_SIZE) { - this.string += this.stringBuffer.toString('utf8'); - this.stringBufferOffset = 0; - } - - this.stringBuffer[this.stringBufferOffset++] = char; -}; -proto.appendStringBuf = function (buf, start, end) { - var size = buf.length; - if (typeof start === 'number') { - if (typeof end === 'number') { - if (end < 0) { - // adding a negative end decreeses the size - size = buf.length - start + end; - } else { - size = end - start; - } - } else { - size = buf.length - start; - } - } - - if (size < 0) { - size = 0; - } - - if (this.stringBufferOffset + size > STRING_BUFFER_SIZE) { - this.string += this.stringBuffer.toString('utf8', 0, this.stringBufferOffset); - this.stringBufferOffset = 0; - } - - buf.copy(this.stringBuffer, this.stringBufferOffset, start, end); - this.stringBufferOffset += size; -}; -proto.write = function (buffer) { - if (typeof buffer === "string") buffer = new Buffer(buffer); - var n; - for (var i = 0, l = buffer.length; i < l; i++) { - if (this.tState === START){ - n = buffer[i]; - this.offset++; - if(n === 0x7b){ this.onToken(LEFT_BRACE, "{"); // { - }else if(n === 0x7d){ this.onToken(RIGHT_BRACE, "}"); // } - }else if(n === 0x5b){ this.onToken(LEFT_BRACKET, "["); // [ - }else if(n === 0x5d){ this.onToken(RIGHT_BRACKET, "]"); // ] - }else if(n === 0x3a){ this.onToken(COLON, ":"); // : - }else if(n === 0x2c){ this.onToken(COMMA, ","); // , - }else if(n === 0x74){ this.tState = TRUE1; // t - }else if(n === 0x66){ this.tState = FALSE1; // f - }else if(n === 0x6e){ this.tState = NULL1; // n - }else if(n === 0x22){ // " - this.string = ""; - this.stringBufferOffset = 0; - this.tState = STRING1; - }else if(n === 0x2d){ this.string = "-"; this.tState = NUMBER1; // - - }else{ - if (n >= 0x30 && n < 0x40) { // 1-9 - this.string = String.fromCharCode(n); this.tState = NUMBER3; - } else if (n === 0x20 || n === 0x09 || n === 0x0a || n === 0x0d) { - // whitespace - } else { - return this.charError(buffer, i); - } - } - }else if (this.tState === STRING1){ // After open quote - n = buffer[i]; // get current byte from buffer - // check for carry over of a multi byte char split between data chunks - // & fill temp buffer it with start of this data chunk up to the boundary limit set in the last iteration - if (this.bytes_remaining > 0) { - for (var j = 0; j < this.bytes_remaining; j++) { - this.temp_buffs[this.bytes_in_sequence][this.bytes_in_sequence - this.bytes_remaining + j] = buffer[j]; - } - - this.appendStringBuf(this.temp_buffs[this.bytes_in_sequence]); - this.bytes_in_sequence = this.bytes_remaining = 0; - i = i + j - 1; - } else if (this.bytes_remaining === 0 && n >= 128) { // else if no remainder bytes carried over, parse multi byte (>=128) chars one at a time - if (n <= 193 || n > 244) { - return this.onError(new Error("Invalid UTF-8 character at position " + i + " in state " + Parser.toknam(this.tState))); - } - if ((n >= 194) && (n <= 223)) this.bytes_in_sequence = 2; - if ((n >= 224) && (n <= 239)) this.bytes_in_sequence = 3; - if ((n >= 240) && (n <= 244)) this.bytes_in_sequence = 4; - if ((this.bytes_in_sequence + i) > buffer.length) { // if bytes needed to complete char fall outside buffer length, we have a boundary split - for (var k = 0; k <= (buffer.length - 1 - i); k++) { - this.temp_buffs[this.bytes_in_sequence][k] = buffer[i + k]; // fill temp buffer of correct size with bytes available in this chunk - } - this.bytes_remaining = (i + this.bytes_in_sequence) - buffer.length; - i = buffer.length - 1; - } else { - this.appendStringBuf(buffer, i, i + this.bytes_in_sequence); - i = i + this.bytes_in_sequence - 1; - } - } else if (n === 0x22) { - this.tState = START; - this.string += this.stringBuffer.toString('utf8', 0, this.stringBufferOffset); - this.stringBufferOffset = 0; - this.onToken(STRING, this.string); - this.offset += Buffer.byteLength(this.string, 'utf8') + 1; - this.string = undefined; - } - else if (n === 0x5c) { - this.tState = STRING2; - } - else if (n >= 0x20) { this.appendStringChar(n); } - else { - return this.charError(buffer, i); - } - }else if (this.tState === STRING2){ // After backslash - n = buffer[i]; - if(n === 0x22){ this.appendStringChar(n); this.tState = STRING1; - }else if(n === 0x5c){ this.appendStringChar(BACK_SLASH); this.tState = STRING1; - }else if(n === 0x2f){ this.appendStringChar(FORWARD_SLASH); this.tState = STRING1; - }else if(n === 0x62){ this.appendStringChar(BACKSPACE); this.tState = STRING1; - }else if(n === 0x66){ this.appendStringChar(FORM_FEED); this.tState = STRING1; - }else if(n === 0x6e){ this.appendStringChar(NEWLINE); this.tState = STRING1; - }else if(n === 0x72){ this.appendStringChar(CARRIAGE_RETURN); this.tState = STRING1; - }else if(n === 0x74){ this.appendStringChar(TAB); this.tState = STRING1; - }else if(n === 0x75){ this.unicode = ""; this.tState = STRING3; - }else{ - return this.charError(buffer, i); - } - }else if (this.tState === STRING3 || this.tState === STRING4 || this.tState === STRING5 || this.tState === STRING6){ // unicode hex codes - n = buffer[i]; - // 0-9 A-F a-f - if ((n >= 0x30 && n < 0x40) || (n > 0x40 && n <= 0x46) || (n > 0x60 && n <= 0x66)) { - this.unicode += String.fromCharCode(n); - if (this.tState++ === STRING6) { - var intVal = parseInt(this.unicode, 16); - this.unicode = undefined; - if (this.highSurrogate !== undefined && intVal >= 0xDC00 && intVal < (0xDFFF + 1)) { //<56320,57343> - lowSurrogate - this.appendStringBuf(new Buffer(String.fromCharCode(this.highSurrogate, intVal))); - this.highSurrogate = undefined; - } else if (this.highSurrogate === undefined && intVal >= 0xD800 && intVal < (0xDBFF + 1)) { //<55296,56319> - highSurrogate - this.highSurrogate = intVal; - } else { - if (this.highSurrogate !== undefined) { - this.appendStringBuf(new Buffer(String.fromCharCode(this.highSurrogate))); - this.highSurrogate = undefined; - } - this.appendStringBuf(new Buffer(String.fromCharCode(intVal))); - } - this.tState = STRING1; - } - } else { - return this.charError(buffer, i); - } - } else if (this.tState === NUMBER1 || this.tState === NUMBER3) { - n = buffer[i]; - - switch (n) { - case 0x30: // 0 - case 0x31: // 1 - case 0x32: // 2 - case 0x33: // 3 - case 0x34: // 4 - case 0x35: // 5 - case 0x36: // 6 - case 0x37: // 7 - case 0x38: // 8 - case 0x39: // 9 - case 0x2e: // . - case 0x65: // e - case 0x45: // E - case 0x2b: // + - case 0x2d: // - - this.string += String.fromCharCode(n); - this.tState = NUMBER3; - break; - default: - this.tState = START; - var result = Number(this.string); - - if (isNaN(result)){ - return this.charError(buffer, i); - } - - if ((this.string.match(/[0-9]+/) == this.string) && (result.toString() != this.string)) { - // Long string of digits which is an ID string and not valid and/or safe JavaScript integer Number - this.onToken(STRING, this.string); - } else { - this.onToken(NUMBER, result); - } - - this.offset += this.string.length - 1; - this.string = undefined; - i--; - break; - } - }else if (this.tState === TRUE1){ // r - if (buffer[i] === 0x72) { this.tState = TRUE2; } - else { return this.charError(buffer, i); } - }else if (this.tState === TRUE2){ // u - if (buffer[i] === 0x75) { this.tState = TRUE3; } - else { return this.charError(buffer, i); } - }else if (this.tState === TRUE3){ // e - if (buffer[i] === 0x65) { this.tState = START; this.onToken(TRUE, true); this.offset+= 3; } - else { return this.charError(buffer, i); } - }else if (this.tState === FALSE1){ // a - if (buffer[i] === 0x61) { this.tState = FALSE2; } - else { return this.charError(buffer, i); } - }else if (this.tState === FALSE2){ // l - if (buffer[i] === 0x6c) { this.tState = FALSE3; } - else { return this.charError(buffer, i); } - }else if (this.tState === FALSE3){ // s - if (buffer[i] === 0x73) { this.tState = FALSE4; } - else { return this.charError(buffer, i); } - }else if (this.tState === FALSE4){ // e - if (buffer[i] === 0x65) { this.tState = START; this.onToken(FALSE, false); this.offset+= 4; } - else { return this.charError(buffer, i); } - }else if (this.tState === NULL1){ // u - if (buffer[i] === 0x75) { this.tState = NULL2; } - else { return this.charError(buffer, i); } - }else if (this.tState === NULL2){ // l - if (buffer[i] === 0x6c) { this.tState = NULL3; } - else { return this.charError(buffer, i); } - }else if (this.tState === NULL3){ // l - if (buffer[i] === 0x6c) { this.tState = START; this.onToken(NULL, null); this.offset += 3; } - else { return this.charError(buffer, i); } - } - } -}; -proto.onToken = function (token, value) { - // Override this to get events -}; - -proto.parseError = function (token, value) { - this.tState = STOP; - this.onError(new Error("Unexpected " + Parser.toknam(token) + (value ? ("(" + JSON.stringify(value) + ")") : "") + " in state " + Parser.toknam(this.state))); -}; -proto.push = function () { - this.stack.push({value: this.value, key: this.key, mode: this.mode}); -}; -proto.pop = function () { - var value = this.value; - var parent = this.stack.pop(); - this.value = parent.value; - this.key = parent.key; - this.mode = parent.mode; - this.emit(value); - if (!this.mode) { this.state = VALUE; } -}; -proto.emit = function (value) { - if (this.mode) { this.state = COMMA; } - this.onValue(value); -}; -proto.onValue = function (value) { - // Override me -}; -proto.onToken = function (token, value) { - if(this.state === VALUE){ - if(token === STRING || token === NUMBER || token === TRUE || token === FALSE || token === NULL){ - if (this.value) { - this.value[this.key] = value; - } - this.emit(value); - }else if(token === LEFT_BRACE){ - this.push(); - if (this.value) { - this.value = this.value[this.key] = {}; - } else { - this.value = {}; - } - this.key = undefined; - this.state = KEY; - this.mode = OBJECT; - }else if(token === LEFT_BRACKET){ - this.push(); - if (this.value) { - this.value = this.value[this.key] = []; - } else { - this.value = []; - } - this.key = 0; - this.mode = ARRAY; - this.state = VALUE; - }else if(token === RIGHT_BRACE){ - if (this.mode === OBJECT) { - this.pop(); - } else { - return this.parseError(token, value); - } - }else if(token === RIGHT_BRACKET){ - if (this.mode === ARRAY) { - this.pop(); - } else { - return this.parseError(token, value); - } - }else{ - return this.parseError(token, value); - } - }else if(this.state === KEY){ - if (token === STRING) { - this.key = value; - this.state = COLON; - } else if (token === RIGHT_BRACE) { - this.pop(); - } else { - return this.parseError(token, value); - } - }else if(this.state === COLON){ - if (token === COLON) { this.state = VALUE; } - else { return this.parseError(token, value); } - }else if(this.state === COMMA){ - if (token === COMMA) { - if (this.mode === ARRAY) { this.key++; this.state = VALUE; } - else if (this.mode === OBJECT) { this.state = KEY; } - - } else if (token === RIGHT_BRACKET && this.mode === ARRAY || token === RIGHT_BRACE && this.mode === OBJECT) { - this.pop(); - } else { - return this.parseError(token, value); - } - }else{ - return this.parseError(token, value); - } -}; - -Parser.C = C; - -module.exports = Parser; diff --git a/node_modules/jsonparse/package.json b/node_modules/jsonparse/package.json deleted file mode 100644 index cd96f55..0000000 --- a/node_modules/jsonparse/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "_args": [ - [ - "jsonparse@1.3.1", - "/home/nuno/Documents/core/software/fresh/js/metaforecasts/metaforecasts-current" - ] - ], - "_from": "jsonparse@1.3.1", - "_id": "jsonparse@1.3.1", - "_inBundle": false, - "_integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", - "_location": "/jsonparse", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "jsonparse@1.3.1", - "name": "jsonparse", - "escapedName": "jsonparse", - "rawSpec": "1.3.1", - "saveSpec": null, - "fetchSpec": "1.3.1" - }, - "_requiredBy": [ - "/json2csv" - ], - "_resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", - "_spec": "1.3.1", - "_where": "/home/nuno/Documents/core/software/fresh/js/metaforecasts/metaforecasts-current", - "author": { - "name": "Tim Caswell", - "email": "tim@creationix.com" - }, - "bugs": { - "url": "http://github.com/creationix/jsonparse/issues" - }, - "description": "This is a pure-js JSON streaming parser for node.js", - "devDependencies": { - "tap": "~0.3.3", - "tape": "~0.1.1" - }, - "engines": [ - "node >= 0.2.0" - ], - "homepage": "https://github.com/creationix/jsonparse#readme", - "license": "MIT", - "main": "jsonparse.js", - "name": "jsonparse", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/creationix/jsonparse.git" - }, - "scripts": { - "test": "tap test/*.js" - }, - "tags": [ - "json", - "stream" - ], - "version": "1.3.1" -} diff --git a/node_modules/jsonparse/samplejson/basic.json b/node_modules/jsonparse/samplejson/basic.json deleted file mode 100644 index 950dff9..0000000 --- a/node_modules/jsonparse/samplejson/basic.json +++ /dev/null @@ -1,167 +0,0 @@ -[ - { - }, - { - "image": [ - {"shape": "rect", "fill": "#333", "stroke": "#999", "x": 0.5e+1, "y": 0.5, "z": 0.8e-0, "w": 0.5e5, "u": 2E10, "foo": 2E+1, "bar": 2E-0, "width": 47, "height": 47} - ], - "jumpable": 3, - "solid": { - "1": [2,4], - "2": [], - "3": [2,6], - "4": [], - "5": [2,8,1,3,7,9,4,6], - "6": [], - "7": [4,8], - "8": [], - "9": [6,8] - }, - "corners": {"1": true,"3": true,"7": true,"9": true} - }, - { - "image": [ - {"shape": "polygon", "fill": "#248", "stroke": "#48f", "points": [[0.5,47.5],[47.5,47.5],[47.5,0.5]]} - ], - "solid": { - "1": [2,4], - "2": [1], - "3": [2], - "4": [], - "5": [2,8,1,3,7,9,4,6], - "6": [], - "7": [4,8], - "8": [], - "9": [6,8] - }, - "corners": {"1": true,"3": true,"7": false,"9": true} - }, - { - "image": [ - {"shape": "polygon", "fill": "#248", "stroke": "#48f", "points": [[0.5,0.5],[47.5,47.5],[0.5,47.5]]} - ], - "solid": { - "1": [2], - "2": [3], - "3": [2,6], - "4": [], - "5": [2,8,1,3,7,9,4,6], - "6": [], - "7": [4,8], - "8": [], - "9": [6,8] - }, - "corners": {"1": true,"3": true,"7": true,"9": false} - }, - { - "image": [ - {"shape": "polygon", "fill": "#333", "stroke": "#999", "points": [[0.5,0.5],[47.5,47.5],[47.5,0.5]]} - ], - "jumpable": 3, - "solid": { - "1": [2,4], - "2": [], - "3": [2,6], - "4": [], - "5": [2,8,1,3,7,9,4,6], - "6": [3], - "7": [4,8], - "8": [7], - "9": [6,8] - }, - "corners": {"1": false,"3": true,"7": true,"9": true} - }, - { - "image": [ - {"shape": "polygon", "fill": "#333", "stroke": "#999", "points": [[0.5,0.5],[0.5,47.5],[47.5,0.5]]} - ], - "jumpable": 3, - "solid": { - "1": [2,4], - "2": [], - "3": [2,6], - "4": [1], - "5": [2,8,1,3,7,9,4,6], - "6": [], - "7": [4,8], - "8": [9], - "9": [6,8] - }, - "corners": {"1": true,"3": false,"7": true,"9": true} - }, - { - "image": [ - {"shape": "polygon", "fill": "#482", "stroke": "#8f4", "points": [[0.5,47.5],[0.5,23.5],[24.5,23.5],[24.5,0.5],[47.5,0.5],[47.5,47.5]]} - ], - "jumpable": 3, - "solid": { - "1": [2,4], - "2": [], - "3": [6,2], - "4": [], - "5": [2,8,1,3,7,9,4,6], - "6": [9], - "7": [4,8], - "8": [], - "9": [6,8] - }, - "corners": {"1": true,"3": true,"7": false,"9": true} - }, - { - "image": [ - {"shape": "polygon", "fill": "#482", "stroke": "#8f4", "points": [[0.5,0.5],[23.5,0.5],[23.5,24.5],[47.5,24.5],[47.5,47.5],[0.5,47.5]]} - ], - "jumpable": 3, - "solid": { - "1": [4,2], - "2": [], - "3": [2,6], - "4": [7], - "5": [2,8,1,3,7,9,4,6], - "6": [], - "7": [4,8], - "8": [], - "9": [6,8] - }, - "corners": {"1": true,"3": true,"7": true,"9": false} - }, - { - "image": [ - {"shape": "circle", "fill": "#ff0", "stroke": "#ff8", "cx": 24, "cy": 24, "r": 18} - ], - "item": true - }, - { - "image": [ - {"shape": "polygon", "fill": "#842", "stroke": "#f84", "points": [[4.5,0.5],[14.5,0.5],[14.5,17.5],[34,17.5],[33.5,0.5],[43.5,0.5],[43.5,47.5],[33.5,47.5],[33.5,30.5],[14.5,30.5],[14.5,47.5],[4.5,47.5]]} - ], - "jumpable": 3 - }, - { - "image": [ - {"shape": "polygon", "fill": "#333", "stroke": "#999", "points": [[0.5,0.5],[47.5,0.5],[24,47.5]]} - ], - "jumpable": 3, - "solid": { - "1": [2,4], - "2": [], - "3": [2,6], - "4": [1], - "5": [2,8,1,3,7,9,4,6], - "6": [3], - "7": [4,8], - "8": [], - "9": [6,8] - }, - "corners": {"1": false,"3": false,"7": true,"9": true} - }, - { - "image": [ - {"shape": "rect", "fill": "#114acb", "x": 0.5, "y": 0.5, "width": 47, "height": 47}, - {"shape": "polygon", "fill": "rgba(255,255,255,0.30)", "points": [[0.5,0.5],[47.5,0.5],[40,8],[8,8],[8,40],[0.5,47.5]]}, - {"shape": "polygon", "fill": "rgba(0,0,0,0.30)", "points": [[47.5,0.5],[48,48],[0.5,47.5],[8,40],[40,40],[40,8]]}, - {"shape": "polygon", "fill": "rgb(255,255,0)", "stroke": "rgba(255,255,0,0.5)", "points": [[24,9],[35,20],[26,29],[26,33],[22,33],[22,27],[29,20],[24,15],[16,23],[13,20]]}, - {"shape": "rect", "fill": "rgb(255,255,0)", "stroke": "rgba(255,255,0,0.5)", "x": 22, "y":35, "width": 4, "height": 4} - ] - } -] diff --git a/node_modules/jsonparse/samplejson/basic2.json b/node_modules/jsonparse/samplejson/basic2.json deleted file mode 100644 index 3a6919b..0000000 --- a/node_modules/jsonparse/samplejson/basic2.json +++ /dev/null @@ -1,180 +0,0 @@ -[ - { - }, - { - "image": [ - {"shape": "rect", "fill": "#333", "stroke": "#999", "x": 0.5, "y": 0.5, "width": 47, "height": 47} - ], - "jumpable": 3, - "solid": { - "1": [2,4], - "2": [], - "3": [2,6], - "4": [], - "5": [2,8,1,3,7,9,4,6], - "6": [], - "7": [4,8], - "8": [], - "9": [6,8] - }, - "corners": {"1": true,"3": true,"7": true,"9": true} - }, - { - "image": [ - {"shape": "polygon", "fill": "#248", "stroke": "#48f", "points": [[0.5,47.5],[47.5,47.5],[47.5,0.5]]} - ], - "solid": { - "1": [2,4], - "2": [1], - "3": [2], - "4": [], - "5": [2,8,1,3,7,9,4,6], - "6": [], - "7": [4,8], - "8": [], - "9": [6,8] - }, - "corners": {"1": true,"3": true,"7": false,"9": true} - }, - { - "image": [ - {"shape": "polygon", "fill": "#248", "stroke": "#48f", "points": [[0.5,0.5],[47.5,47.5],[0.5,47.5]]} - ], - "solid": { - "1": [2], - "2": [3], - "3": [2,6], - "4": [], - "5": [2,8,1,3,7,9,4,6], - "6": [], - "7": [4,8], - "8": [], - "9": [6,8] - }, - "corners": {"1": true,"3": true,"7": true,"9": false} - }, - { - "image": [ - {"shape": "polygon", "fill": "#333", "stroke": "#999", "points": [[0.5,0.5],[47.5,47.5],[47.5,0.5]]} - ], - "jumpable": 3, - "solid": { - "1": [2,4], - "2": [], - "3": [2,6], - "4": [], - "5": [2,8,1,3,7,9,4,6], - "6": [3], - "7": [4,8], - "8": [7], - "9": [6,8] - }, - "corners": {"1": false,"3": true,"7": true,"9": true} - }, - { - "image": [ - {"shape": "polygon", "fill": "#333", "stroke": "#999", "points": [[0.5,0.5],[0.5,47.5],[47.5,0.5]]} - ], - "jumpable": 3, - "solid": { - "1": [2,4], - "2": [], - "3": [2,6], - "4": [1], - "5": [2,8,1,3,7,9,4,6], - "6": [], - "7": [4,8], - "8": [9], - "9": [6,8] - }, - "corners": {"1": true,"3": false,"7": true,"9": true} - }, - { - "image": [ - {"shape": "polygon", "fill": "#482", "stroke": "#8f4", "points": [[0.5,47.5],[0.5,23.5],[24.5,23.5],[24.5,0.5],[47.5,0.5],[47.5,47.5]]} - ], - "jumpable": 3, - "solid": { - "1": [2,4], - "2": [], - "3": [6,2], - "4": [], - "5": [2,8,1,3,7,9,4,6], - "6": [9], - "7": [4,8], - "8": [], - "9": [6,8] - }, - "corners": {"1": true,"3": true,"7": false,"9": true} - }, - { - "image": [ - {"shape": "polygon", "fill": "#482", "stroke": "#8f4", "points": [[0.5,0.5],[23.5,0.5],[23.5,24.5],[47.5,24.5],[47.5,47.5],[0.5,47.5]]} - ], - "jumpable": 3, - "solid": { - "1": [4,2], - "2": [], - "3": [2,6], - "4": [7], - "5": [2,8,1,3,7,9,4,6], - "6": [], - "7": [4,8], - "8": [], - "9": [6,8] - }, - "corners": {"1": true,"3": true,"7": true,"9": false} - }, - { - "image": [ - {"shape": "circle", "fill": "#ff0", "stroke": "#ff8", "cx": 24, "cy": 24, "r": 18} - ], - "item": true - }, - { - "image": [ - {"shape": "polygon", "fill": "#842", "stroke": "#f84", "points": [[4.5,0.5],[14.5,0.5],[14.5,17.5],[34,17.5],[33.5,0.5],[43.5,0.5],[43.5,47.5],[33.5,47.5],[33.5,30.5],[14.5,30.5],[14.5,47.5],[4.5,47.5]]} - ], - "jumpable": 3 - }, - { - "image": [ - {"shape": "polygon", "fill": "#333", "stroke": "#999", "points": [[0.5,0.5],[47.5,0.5],[24,47.5]]} - ], - "jumpable": 3, - "solid": { - "1": [2,4], - "2": [], - "3": [2,6], - "4": [1], - "5": [2,8,1,3,7,9,4,6], - "6": [3], - "7": [4,8], - "8": [], - "9": [6,8] - }, - "corners": {"1": false,"3": false,"7": true,"9": true} - }, - { - "image": [ - {"shape": "rect", "fill": "#114acb", "x": 0.5, "y": 0.5, "width": 47, "height": 47}, - {"shape": "polygon", "fill": "rgba(255,255,255,0.30)", "points": [[0.5,0.5],[47.5,0.5],[40,8],[8,8],[8,40],[0.5,47.5]]}, - {"shape": "polygon", "fill": "rgba(0,0,0,0.30)", "points": [[47.5,0.5],[48,48],[0.5,47.5],[8,40],[40,40],[40,8]]}, - {"shape": "polygon", "fill": "rgb(255,255,0)", "stroke": "rgba(255,255,0,0.5)", "points": [[24,9],[35,20],[26,29],[26,33],[22,33],[22,27],[29,20],[24,15],[16,23],[13,20]]}, - {"shape": "rect", "fill": "rgb(255,255,0)", "stroke": "rgba(255,255,0,0.5)", "x": 22, "y":35, "width": 4, "height": 4} - ], - "item": true - }, - { - "image": [ - {"shape": "circle", "fill": "#80f", "stroke": "#88f", "cx": 24, "cy": 24, "r": 18} - ], - "item": true - }, - { - "image": [ - {"shape": "circle", "fill": "#4f4", "stroke": "#8f8", "cx": 24, "cy": 24, "r": 18} - ], - "item": true - } -] diff --git a/node_modules/jsonparse/test/big-token.js b/node_modules/jsonparse/test/big-token.js deleted file mode 100644 index 3604631..0000000 --- a/node_modules/jsonparse/test/big-token.js +++ /dev/null @@ -1,24 +0,0 @@ -var stream = require('stream'); -var JsonParse = require('../jsonparse'); -var test = require('tape'); - -test('can handle large tokens without running out of memory', function (t) { - var parser = new JsonParse(); - var chunkSize = 1024; - var chunks = 1024 * 200; // 200mb - var quote = Buffer.from ? Buffer.from('"') : new Buffer('"'); - t.plan(1); - - parser.onToken = function (type, value) { - t.equal(value.length, chunkSize * chunks, 'token should be size of input json'); - t.end(); - }; - - parser.write(quote); - for (var i = 0; i < chunks; ++i) { - var buf = Buffer.alloc ? Buffer.alloc(chunkSize) : new Buffer(chunkSize); - buf.fill('a'); - parser.write(buf); - } - parser.write(quote); -}); diff --git a/node_modules/jsonparse/test/boundary.js b/node_modules/jsonparse/test/boundary.js deleted file mode 100644 index 6671f5f..0000000 --- a/node_modules/jsonparse/test/boundary.js +++ /dev/null @@ -1,110 +0,0 @@ -var test = require('tape'); -var Parser = require('../'); - -test('2 byte utf8 \'De\' character: Đ´', function (t) { - t.plan(1); - - var p = new Parser(); - p.onValue = function (value) { - t.equal(value, 'Đ´'); - }; - - var de_buffer = new Buffer([0xd0, 0xb4]); - - p.write('"'); - p.write(de_buffer); - p.write('"'); - -}); - -test('3 byte utf8 \'Han\' character: 我', function (t) { - t.plan(1); - - var p = new Parser(); - p.onValue = function (value) { - t.equal(value, '我'); - }; - - var han_buffer = new Buffer([0xe6, 0x88, 0x91]); - p.write('"'); - p.write(han_buffer); - p.write('"'); -}); - -test('4 byte utf8 character (unicode scalar U+2070E): 𠜎', function (t) { - t.plan(1); - - var p = new Parser(); - p.onValue = function (value) { - t.equal(value, '𠜎'); - }; - - var Ux2070E_buffer = new Buffer([0xf0, 0xa0, 0x9c, 0x8e]); - p.write('"'); - p.write(Ux2070E_buffer); - p.write('"'); -}); - -test('3 byte utf8 \'Han\' character chunked inbetween 2nd and 3rd byte: 我', function (t) { - t.plan(1); - - var p = new Parser(); - p.onValue = function (value) { - t.equal(value, '我'); - }; - - var han_buffer_first = new Buffer([0xe6, 0x88]); - var han_buffer_second = new Buffer([0x91]); - p.write('"'); - p.write(han_buffer_first); - p.write(han_buffer_second); - p.write('"'); -}); - -test('4 byte utf8 character (unicode scalar U+2070E) chunked inbetween 2nd and 3rd byte: 𠜎', function (t) { - t.plan(1); - - var p = new Parser(); - p.onValue = function (value) { - t.equal(value, '𠜎'); - }; - - var Ux2070E_buffer_first = new Buffer([0xf0, 0xa0]); - var Ux2070E_buffer_second = new Buffer([0x9c, 0x8e]); - p.write('"'); - p.write(Ux2070E_buffer_first); - p.write(Ux2070E_buffer_second); - p.write('"'); -}); - -test('1-4 byte utf8 character string chunked inbetween random bytes: AĐļæ–‡đ œąB', function (t) { - t.plan(1); - -var p = new Parser(); - p.onValue = function (value) { - t.equal(value, 'AĐļæ–‡đ œąB'); - }; - - var eclectic_buffer = new Buffer([0x41, // A - 0xd0, 0xb6, // Đļ - 0xe6, 0x96, 0x87, // 文 - 0xf0, 0xa0, 0x9c, 0xb1, // 𠜱 - 0x42]); // B - - var rand_chunk = Math.floor(Math.random() * (eclectic_buffer.length)); - var first_buffer = eclectic_buffer.slice(0, rand_chunk); - var second_buffer = eclectic_buffer.slice(rand_chunk); - - //console.log('eclectic_buffer: ' + eclectic_buffer) - //console.log('sliced from 0 to ' + rand_chunk); - //console.log(first_buffer); - //console.log('then sliced from ' + rand_chunk + ' to the end'); - //console.log(second_buffer); - - console.log('chunked after offset ' + rand_chunk); - p.write('"'); - p.write(first_buffer); - p.write(second_buffer); - p.write('"'); - -}); \ No newline at end of file diff --git a/node_modules/jsonparse/test/offset.js b/node_modules/jsonparse/test/offset.js deleted file mode 100644 index 9a552ab..0000000 --- a/node_modules/jsonparse/test/offset.js +++ /dev/null @@ -1,67 +0,0 @@ -var test = require('tape'); -var Parser = require('../'); - -var input = '{\n "string": "value",\n "number": 3,\n "object"'; -var input2 = ': {\n "key": "vĐ´"\n },\n "array": [\n -1,\n 12\n ]\n '; -var input3 = '"null": null, "true": true, "false": false, "frac": 3.14 }'; - -var offsets = [ - [ 0, Parser.C.LEFT_BRACE ], - [ 4, Parser.C.STRING ], - [ 12, Parser.C.COLON ], - [ 14, Parser.C.STRING ], - [ 21, Parser.C.COMMA ], - [ 25, Parser.C.STRING ], - [ 33, Parser.C.COLON ], - [ 35, Parser.C.NUMBER ], - [ 36, Parser.C.COMMA ], - [ 40, Parser.C.STRING ], - [ 48, Parser.C.COLON ], - [ 50, Parser.C.LEFT_BRACE ], - [ 54, Parser.C.STRING ], - [ 59, Parser.C.COLON ], - [ 61, Parser.C.STRING ], - [ 69, Parser.C.RIGHT_BRACE ], - [ 70, Parser.C.COMMA ], - [ 74, Parser.C.STRING ], - [ 81, Parser.C.COLON ], - [ 83, Parser.C.LEFT_BRACKET ], - [ 87, Parser.C.NUMBER ], - [ 89, Parser.C.COMMA ], - [ 93, Parser.C.NUMBER ], - [ 98, Parser.C.RIGHT_BRACKET ], - [ 102, Parser.C.STRING ], - [ 108, Parser.C.COLON ], - [ 110, Parser.C.NULL ], - [ 114, Parser.C.COMMA ], - [ 116, Parser.C.STRING ], - [ 122, Parser.C.COLON ], - [ 124, Parser.C.TRUE ], - [ 128, Parser.C.COMMA ], - [ 130, Parser.C.STRING ], - [ 137, Parser.C.COLON ], - [ 139, Parser.C.FALSE ], - [ 144, Parser.C.COMMA ], - [ 146, Parser.C.STRING ], - [ 152, Parser.C.COLON ], - [ 154, Parser.C.NUMBER ], - [ 159, Parser.C.RIGHT_BRACE ] -]; - -test('offset', function(t) { - t.plan(offsets.length * 2 + 1); - - var p = new Parser(); - var i = 0; - p.onToken = function (token) { - t.equal(p.offset, offsets[i][0]); - t.equal(token, offsets[i][1]); - i++; - }; - - p.write(input); - p.write(input2); - p.write(input3); - - t.equal(i, offsets.length); -}); diff --git a/node_modules/jsonparse/test/primitives.js b/node_modules/jsonparse/test/primitives.js deleted file mode 100644 index 33cae16..0000000 --- a/node_modules/jsonparse/test/primitives.js +++ /dev/null @@ -1,57 +0,0 @@ -var test = require('tape'); -var Parser = require('../'); - -var expected = [ - [ [], '' ], - [ [], 'Hello' ], - [ [], 'This"is' ], - [ [], '\r\n\f\t\\/"' ], - [ [], 'ΛÎŦÎŧβδι' ], - [ [], '\\' ], - [ [], '/' ], - [ [], '"' ], - [ [ 0 ], 0 ], - [ [ 1 ], 1 ], - [ [ 2 ], -1 ], - [ [], [ 0, 1, -1 ] ], - [ [ 0 ], 1 ], - [ [ 1 ], 1.1 ], - [ [ 2 ], -1.1 ], - [ [ 3 ], -1 ], - [ [], [ 1, 1.1, -1.1, -1 ] ], - [ [ 0 ], -1 ], - [ [], [ -1 ] ], - [ [ 0 ], -0.1 ], - [ [], [ -0.1 ] ], - [ [ 0 ], 6.02e+23 ], - [ [], [ 6.02e+23 ] ], - [ [ 0 ], '7161093205057351174' ], - [ [], [ '7161093205057351174'] ] -]; - -test('primitives', function (t) { - t.plan(25); - - var p = new Parser(); - p.onValue = function (value) { - var keys = this.stack - .slice(1) - .map(function (item) { return item.key }) - .concat(this.key !== undefined ? this.key : []) - ; - t.deepEqual( - [ keys, value ], - expected.shift() - ); - }; - - p.write('"""Hello""This\\"is""\\r\\n\\f\\t\\\\\\/\\""'); - p.write('"\\u039b\\u03ac\\u03bc\\u03b2\\u03b4\\u03b1"'); - p.write('"\\\\"'); - p.write('"\\/"'); - p.write('"\\""'); - p.write('[0,1,-1]'); - p.write('[1.0,1.1,-1.1,-1.0][-1][-0.1]'); - p.write('[6.02e23]'); - p.write('[7161093205057351174]'); -}); diff --git a/node_modules/jsonparse/test/surrogate.js b/node_modules/jsonparse/test/surrogate.js deleted file mode 100644 index c048f37..0000000 --- a/node_modules/jsonparse/test/surrogate.js +++ /dev/null @@ -1,26 +0,0 @@ -var test = require('tape'); -var Parser = require('../'); - -test('parse surrogate pair', function (t) { - t.plan(1); - - var p = new Parser(); - p.onValue = function (value) { - t.equal(value, '😋'); - }; - - p.write('"\\uD83D\\uDE0B"'); -}); - -test('parse chunked surrogate pair', function (t) { - t.plan(1); - - var p = new Parser(); - p.onValue = function (value) { - t.equal(value, '😋'); - }; - - p.write('"\\uD83D'); - p.write('\\uDE0B"'); -}); - diff --git a/node_modules/jsonparse/test/unvalid.js b/node_modules/jsonparse/test/unvalid.js deleted file mode 100644 index 7715cc0..0000000 --- a/node_modules/jsonparse/test/unvalid.js +++ /dev/null @@ -1,15 +0,0 @@ -var test = require('tape'); -var Parser = require('../'); - -test('unvalid', function (t) { - var count = 0; - - var p = new Parser(); - p.onError = function (value) { - count++; - t.equal(1, count); - t.end(); - }; - - p.write('{"test": eer['); -}); diff --git a/node_modules/jsonparse/test/utf8.js b/node_modules/jsonparse/test/utf8.js deleted file mode 100644 index 6cb842f..0000000 --- a/node_modules/jsonparse/test/utf8.js +++ /dev/null @@ -1,38 +0,0 @@ -var test = require('tape'); -var Parser = require('../'); - -test('3 bytes of utf8', function (t) { - t.plan(1); - - var p = new Parser(); - p.onValue = function (value) { - t.equal(value, '├──'); - }; - - p.write('"├──"'); -}); - -test('utf8 snowman', function (t) { - t.plan(1); - - var p = new Parser(); - p.onValue = function (value) { - t.equal(value, '☃'); - }; - - p.write('"☃"'); -}); - -test('utf8 with regular ascii', function (t) { - t.plan(4); - - var p = new Parser(); - var expected = [ "snow: ☃!", "xyz", "ÂĄque!" ]; - expected.push(expected.slice()); - - p.onValue = function (value) { - t.deepEqual(value, expected.shift()); - }; - - p.write('["snow: ☃!","xyz","ÂĄque!"]'); -}); diff --git a/node_modules/lodash.get/LICENSE b/node_modules/lodash.get/LICENSE deleted file mode 100644 index e0c69d5..0000000 --- a/node_modules/lodash.get/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Copyright jQuery Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/node_modules/lodash.get/README.md b/node_modules/lodash.get/README.md deleted file mode 100644 index 9079614..0000000 --- a/node_modules/lodash.get/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash.get v4.4.2 - -The [lodash](https://lodash.com/) method `_.get` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.get -``` - -In Node.js: -```js -var get = require('lodash.get'); -``` - -See the [documentation](https://lodash.com/docs#get) or [package source](https://github.com/lodash/lodash/blob/4.4.2-npm-packages/lodash.get) for more details. diff --git a/node_modules/lodash.get/index.js b/node_modules/lodash.get/index.js deleted file mode 100644 index 0eaadec..0000000 --- a/node_modules/lodash.get/index.js +++ /dev/null @@ -1,931 +0,0 @@ -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** Used to stand-in for `undefined` hash values. */ -var HASH_UNDEFINED = '__lodash_hash_undefined__'; - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0; - -/** `Object#toString` result references. */ -var funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - symbolTag = '[object Symbol]'; - -/** Used to match property names within property paths. */ -var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, - reIsPlainProp = /^\w*$/, - reLeadingDot = /^\./, - rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; - -/** - * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). - */ -var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; - -/** Used to match backslashes in property paths. */ -var reEscapeChar = /\\(\\)?/g; - -/** Used to detect host constructors (Safari). */ -var reIsHostCtor = /^\[object .+?Constructor\]$/; - -/** Detect free variable `global` from Node.js. */ -var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; - -/** Detect free variable `self`. */ -var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - -/** Used as a reference to the global object. */ -var root = freeGlobal || freeSelf || Function('return this')(); - -/** - * Gets the value at `key` of `object`. - * - * @private - * @param {Object} [object] The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. - */ -function getValue(object, key) { - return object == null ? undefined : object[key]; -} - -/** - * Checks if `value` is a host object in IE < 9. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a host object, else `false`. - */ -function isHostObject(value) { - // Many host objects are `Object` objects that can coerce to strings - // despite having improperly defined `toString` methods. - var result = false; - if (value != null && typeof value.toString != 'function') { - try { - result = !!(value + ''); - } catch (e) {} - } - return result; -} - -/** Used for built-in method references. */ -var arrayProto = Array.prototype, - funcProto = Function.prototype, - objectProto = Object.prototype; - -/** Used to detect overreaching core-js shims. */ -var coreJsData = root['__core-js_shared__']; - -/** Used to detect methods masquerading as native. */ -var maskSrcKey = (function() { - var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); - return uid ? ('Symbol(src)_1.' + uid) : ''; -}()); - -/** Used to resolve the decompiled source of functions. */ -var funcToString = funcProto.toString; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** Used to detect if a method is native. */ -var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' -); - -/** Built-in value references. */ -var Symbol = root.Symbol, - splice = arrayProto.splice; - -/* Built-in method references that are verified to be native. */ -var Map = getNative(root, 'Map'), - nativeCreate = getNative(Object, 'create'); - -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolToString = symbolProto ? symbolProto.toString : undefined; - -/** - * Creates a hash object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function Hash(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} - -/** - * Removes all key-value entries from the hash. - * - * @private - * @name clear - * @memberOf Hash - */ -function hashClear() { - this.__data__ = nativeCreate ? nativeCreate(null) : {}; -} - -/** - * Removes `key` and its value from the hash. - * - * @private - * @name delete - * @memberOf Hash - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function hashDelete(key) { - return this.has(key) && delete this.__data__[key]; -} - -/** - * Gets the hash value for `key`. - * - * @private - * @name get - * @memberOf Hash - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function hashGet(key) { - var data = this.__data__; - if (nativeCreate) { - var result = data[key]; - return result === HASH_UNDEFINED ? undefined : result; - } - return hasOwnProperty.call(data, key) ? data[key] : undefined; -} - -/** - * Checks if a hash value for `key` exists. - * - * @private - * @name has - * @memberOf Hash - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function hashHas(key) { - var data = this.__data__; - return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); -} - -/** - * Sets the hash `key` to `value`. - * - * @private - * @name set - * @memberOf Hash - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the hash instance. - */ -function hashSet(key, value) { - var data = this.__data__; - data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; - return this; -} - -// Add methods to `Hash`. -Hash.prototype.clear = hashClear; -Hash.prototype['delete'] = hashDelete; -Hash.prototype.get = hashGet; -Hash.prototype.has = hashHas; -Hash.prototype.set = hashSet; - -/** - * Creates an list cache object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function ListCache(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} - -/** - * Removes all key-value entries from the list cache. - * - * @private - * @name clear - * @memberOf ListCache - */ -function listCacheClear() { - this.__data__ = []; -} - -/** - * Removes `key` and its value from the list cache. - * - * @private - * @name delete - * @memberOf ListCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function listCacheDelete(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - return false; - } - var lastIndex = data.length - 1; - if (index == lastIndex) { - data.pop(); - } else { - splice.call(data, index, 1); - } - return true; -} - -/** - * Gets the list cache value for `key`. - * - * @private - * @name get - * @memberOf ListCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function listCacheGet(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - return index < 0 ? undefined : data[index][1]; -} - -/** - * Checks if a list cache value for `key` exists. - * - * @private - * @name has - * @memberOf ListCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function listCacheHas(key) { - return assocIndexOf(this.__data__, key) > -1; -} - -/** - * Sets the list cache `key` to `value`. - * - * @private - * @name set - * @memberOf ListCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the list cache instance. - */ -function listCacheSet(key, value) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - data.push([key, value]); - } else { - data[index][1] = value; - } - return this; -} - -// Add methods to `ListCache`. -ListCache.prototype.clear = listCacheClear; -ListCache.prototype['delete'] = listCacheDelete; -ListCache.prototype.get = listCacheGet; -ListCache.prototype.has = listCacheHas; -ListCache.prototype.set = listCacheSet; - -/** - * Creates a map cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function MapCache(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} - -/** - * Removes all key-value entries from the map. - * - * @private - * @name clear - * @memberOf MapCache - */ -function mapCacheClear() { - this.__data__ = { - 'hash': new Hash, - 'map': new (Map || ListCache), - 'string': new Hash - }; -} - -/** - * Removes `key` and its value from the map. - * - * @private - * @name delete - * @memberOf MapCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function mapCacheDelete(key) { - return getMapData(this, key)['delete'](key); -} - -/** - * Gets the map value for `key`. - * - * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function mapCacheGet(key) { - return getMapData(this, key).get(key); -} - -/** - * Checks if a map value for `key` exists. - * - * @private - * @name has - * @memberOf MapCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function mapCacheHas(key) { - return getMapData(this, key).has(key); -} - -/** - * Sets the map `key` to `value`. - * - * @private - * @name set - * @memberOf MapCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the map cache instance. - */ -function mapCacheSet(key, value) { - getMapData(this, key).set(key, value); - return this; -} - -// Add methods to `MapCache`. -MapCache.prototype.clear = mapCacheClear; -MapCache.prototype['delete'] = mapCacheDelete; -MapCache.prototype.get = mapCacheGet; -MapCache.prototype.has = mapCacheHas; -MapCache.prototype.set = mapCacheSet; - -/** - * Gets the index at which the `key` is found in `array` of key-value pairs. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } - } - return -1; -} - -/** - * The base implementation of `_.get` without support for default values. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @returns {*} Returns the resolved value. - */ -function baseGet(object, path) { - path = isKey(path, object) ? [path] : castPath(path); - - var index = 0, - length = path.length; - - while (object != null && index < length) { - object = object[toKey(path[index++])]; - } - return (index && index == length) ? object : undefined; -} - -/** - * The base implementation of `_.isNative` without bad shim checks. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. - */ -function baseIsNative(value) { - if (!isObject(value) || isMasked(value)) { - return false; - } - var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); -} - -/** - * The base implementation of `_.toString` which doesn't convert nullish - * values to empty strings. - * - * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. - */ -function baseToString(value) { - // Exit early for strings to avoid a performance hit in some environments. - if (typeof value == 'string') { - return value; - } - if (isSymbol(value)) { - return symbolToString ? symbolToString.call(value) : ''; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; -} - -/** - * Casts `value` to a path array if it's not one. - * - * @private - * @param {*} value The value to inspect. - * @returns {Array} Returns the cast property path array. - */ -function castPath(value) { - return isArray(value) ? value : stringToPath(value); -} - -/** - * Gets the data for `map`. - * - * @private - * @param {Object} map The map to query. - * @param {string} key The reference key. - * @returns {*} Returns the map data. - */ -function getMapData(map, key) { - var data = map.__data__; - return isKeyable(key) - ? data[typeof key == 'string' ? 'string' : 'hash'] - : data.map; -} - -/** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ -function getNative(object, key) { - var value = getValue(object, key); - return baseIsNative(value) ? value : undefined; -} - -/** - * Checks if `value` is a property name and not a property path. - * - * @private - * @param {*} value The value to check. - * @param {Object} [object] The object to query keys on. - * @returns {boolean} Returns `true` if `value` is a property name, else `false`. - */ -function isKey(value, object) { - if (isArray(value)) { - return false; - } - var type = typeof value; - if (type == 'number' || type == 'symbol' || type == 'boolean' || - value == null || isSymbol(value)) { - return true; - } - return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || - (object != null && value in Object(object)); -} - -/** - * Checks if `value` is suitable for use as unique object key. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. - */ -function isKeyable(value) { - var type = typeof value; - return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') - ? (value !== '__proto__') - : (value === null); -} - -/** - * Checks if `func` has its source masked. - * - * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` is masked, else `false`. - */ -function isMasked(func) { - return !!maskSrcKey && (maskSrcKey in func); -} - -/** - * Converts `string` to a property path array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the property path array. - */ -var stringToPath = memoize(function(string) { - string = toString(string); - - var result = []; - if (reLeadingDot.test(string)) { - result.push(''); - } - string.replace(rePropName, function(match, number, quote, string) { - result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); - }); - return result; -}); - -/** - * Converts `value` to a string key if it's not a string or symbol. - * - * @private - * @param {*} value The value to inspect. - * @returns {string|symbol} Returns the key. - */ -function toKey(value) { - if (typeof value == 'string' || isSymbol(value)) { - return value; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; -} - -/** - * Converts `func` to its source code. - * - * @private - * @param {Function} func The function to process. - * @returns {string} Returns the source code. - */ -function toSource(func) { - if (func != null) { - try { - return funcToString.call(func); - } catch (e) {} - try { - return (func + ''); - } catch (e) {} - } - return ''; -} - -/** - * Creates a function that memoizes the result of `func`. If `resolver` is - * provided, it determines the cache key for storing the result based on the - * arguments provided to the memoized function. By default, the first argument - * provided to the memoized function is used as the map cache key. The `func` - * is invoked with the `this` binding of the memoized function. - * - * **Note:** The cache is exposed as the `cache` property on the memoized - * function. Its creation may be customized by replacing the `_.memoize.Cache` - * constructor with one whose instances implement the - * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) - * method interface of `delete`, `get`, `has`, and `set`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to have its output memoized. - * @param {Function} [resolver] The function to resolve the cache key. - * @returns {Function} Returns the new memoized function. - * @example - * - * var object = { 'a': 1, 'b': 2 }; - * var other = { 'c': 3, 'd': 4 }; - * - * var values = _.memoize(_.values); - * values(object); - * // => [1, 2] - * - * values(other); - * // => [3, 4] - * - * object.a = 2; - * values(object); - * // => [1, 2] - * - * // Modify the result cache. - * values.cache.set(object, ['a', 'b']); - * values(object); - * // => ['a', 'b'] - * - * // Replace `_.memoize.Cache`. - * _.memoize.Cache = WeakMap; - */ -function memoize(func, resolver) { - if (typeof func != 'function' || (resolver && typeof resolver != 'function')) { - throw new TypeError(FUNC_ERROR_TEXT); - } - var memoized = function() { - var args = arguments, - key = resolver ? resolver.apply(this, args) : args[0], - cache = memoized.cache; - - if (cache.has(key)) { - return cache.get(key); - } - var result = func.apply(this, args); - memoized.cache = cache.set(key, result); - return result; - }; - memoized.cache = new (memoize.Cache || MapCache); - return memoized; -} - -// Assign cache to `_.memoize`. -memoize.Cache = MapCache; - -/** - * Performs a - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'a': 1 }; - * var other = { 'a': 1 }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ -function eq(value, other) { - return value === other || (value !== value && other !== other); -} - -/** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ -var isArray = Array.isArray; - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a function, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8-9 which returns 'object' for typed array and other constructors. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; -} - -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && objectToString.call(value) == symbolTag); -} - -/** - * Converts `value` to a string. An empty string is returned for `null` - * and `undefined` values. The sign of `-0` is preserved. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {string} Returns the string. - * @example - * - * _.toString(null); - * // => '' - * - * _.toString(-0); - * // => '-0' - * - * _.toString([1, 2, 3]); - * // => '1,2,3' - */ -function toString(value) { - return value == null ? '' : baseToString(value); -} - -/** - * Gets the value at `path` of `object`. If the resolved value is - * `undefined`, the `defaultValue` is returned in its place. - * - * @static - * @memberOf _ - * @since 3.7.0 - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @param {*} [defaultValue] The value returned for `undefined` resolved values. - * @returns {*} Returns the resolved value. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; - * - * _.get(object, 'a[0].b.c'); - * // => 3 - * - * _.get(object, ['a', '0', 'b', 'c']); - * // => 3 - * - * _.get(object, 'a.b.c', 'default'); - * // => 'default' - */ -function get(object, path, defaultValue) { - var result = object == null ? undefined : baseGet(object, path); - return result === undefined ? defaultValue : result; -} - -module.exports = get; diff --git a/node_modules/lodash.get/package.json b/node_modules/lodash.get/package.json deleted file mode 100644 index db2a928..0000000 --- a/node_modules/lodash.get/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "_args": [ - [ - "lodash.get@4.4.2", - "/home/nuno/Documents/core/software/fresh/js/metaforecasts/metaforecasts-current" - ] - ], - "_from": "lodash.get@4.4.2", - "_id": "lodash.get@4.4.2", - "_inBundle": false, - "_integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", - "_location": "/lodash.get", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "lodash.get@4.4.2", - "name": "lodash.get", - "escapedName": "lodash.get", - "rawSpec": "4.4.2", - "saveSpec": null, - "fetchSpec": "4.4.2" - }, - "_requiredBy": [ - "/json2csv" - ], - "_resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", - "_spec": "4.4.2", - "_where": "/home/nuno/Documents/core/software/fresh/js/metaforecasts/metaforecasts-current", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine.bublitz@gmail.com", - "url": "https://github.com/phated" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "description": "The lodash method `_.get` exported as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "keywords": [ - "lodash-modularized", - "get" - ], - "license": "MIT", - "name": "lodash.get", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "4.4.2" -} diff --git a/node_modules/open/index.d.ts b/node_modules/open/index.d.ts deleted file mode 100644 index 4365e1f..0000000 --- a/node_modules/open/index.d.ts +++ /dev/null @@ -1,88 +0,0 @@ -/// -import {ChildProcess} from 'child_process'; - -declare namespace open { - interface Options { - /** - Wait for the opened app to exit before fulfilling the promise. If `false` it's fulfilled immediately when opening the app. - - Note that it waits for the app to exit, not just for the window to close. - - On Windows, you have to explicitly specify an app for it to be able to wait. - - @default false - */ - readonly wait?: boolean; - - /** - __macOS only__ - - Do not bring the app to the foreground. - - @default false - */ - readonly background?: boolean; - - /** - Specify the app to open the `target` with, or an array with the app and app arguments. - - The app name is platform dependent. Don't hard code it in reusable modules. For example, Chrome is `google chrome` on macOS, `google-chrome` on Linux and `chrome` on Windows. - - You may also pass in the app's full path. For example on WSL, this can be `/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe` for the Windows installation of Chrome. - */ - readonly app?: string | readonly string[]; - - /** - __deprecated__ - - This option will be removed in the next major release. - */ - readonly url?: boolean; - - /** - Allow the opened app to exit with nonzero exit code when the `wait` option is `true`. - - We do not recommend setting this option. The convention for success is exit code zero. - - @default false - */ - readonly allowNonzeroExitCode?: boolean; - } -} - -/** -Open stuff like URLs, files, executables. Cross-platform. - -Uses the command `open` on OS X, `start` on Windows and `xdg-open` on other platforms. - -There is a caveat for [double-quotes on Windows](https://github.com/sindresorhus/open#double-quotes-on-windows) where all double-quotes are stripped from the `target`. - -@param target - The thing you want to open. Can be a URL, file, or executable. Opens in the default app for the file type. For example, URLs open in your default browser. -@returns The [spawned child process](https://nodejs.org/api/child_process.html#child_process_class_childprocess). You would normally not need to use this for anything, but it can be useful if you'd like to attach custom event listeners or perform other operations directly on the spawned process. - -@example -``` -import open = require('open'); - -// Opens the image in the default image viewer -(async () => { - await open('unicorn.png', {wait: true}); - console.log('The image viewer app closed'); - - // Opens the url in the default browser - await open('https://sindresorhus.com'); - - // Specify the app to open in - await open('https://sindresorhus.com', {app: 'firefox'}); - - // Specify app arguments - await open('https://sindresorhus.com', {app: ['google chrome', '--incognito']}); -})(); -``` -*/ -declare function open( - target: string, - options?: open.Options -): Promise; - -export = open; diff --git a/node_modules/open/index.js b/node_modules/open/index.js deleted file mode 100644 index 9ee4a0c..0000000 --- a/node_modules/open/index.js +++ /dev/null @@ -1,172 +0,0 @@ -'use strict'; -const {promisify} = require('util'); -const path = require('path'); -const childProcess = require('child_process'); -const fs = require('fs'); -const isWsl = require('is-wsl'); -const isDocker = require('is-docker'); - -const pAccess = promisify(fs.access); -const pExecFile = promisify(childProcess.execFile); - -// Path to included `xdg-open`. -const localXdgOpenPath = path.join(__dirname, 'xdg-open'); - -// Convert a path from WSL format to Windows format: -// `/mnt/c/Program Files/Example/MyApp.exe` → `C:\Program Files\Example\MyApp.exe` -const wslToWindowsPath = async path => { - const {stdout} = await pExecFile('wslpath', ['-w', path]); - return stdout.trim(); -}; - -// Convert a path from Windows format to WSL format -const windowsToWslPath = async path => { - const {stdout} = await pExecFile('wslpath', [path]); - return stdout.trim(); -}; - -// Get an environment variable from Windows -const wslGetWindowsEnvVar = async envVar => { - const {stdout} = await pExecFile('wslvar', [envVar]); - return stdout.trim(); -}; - -module.exports = async (target, options) => { - if (typeof target !== 'string') { - throw new TypeError('Expected a `target`'); - } - - options = { - wait: false, - background: false, - allowNonzeroExitCode: false, - ...options - }; - - let command; - let {app} = options; - let appArguments = []; - const cliArguments = []; - const childProcessOptions = {}; - - if (Array.isArray(app)) { - appArguments = app.slice(1); - app = app[0]; - } - - if (process.platform === 'darwin') { - command = 'open'; - - if (options.wait) { - cliArguments.push('--wait-apps'); - } - - if (options.background) { - cliArguments.push('--background'); - } - - if (app) { - cliArguments.push('-a', app); - } - } else if (process.platform === 'win32' || (isWsl && !isDocker())) { - const windowsRoot = isWsl ? await wslGetWindowsEnvVar('systemroot') : process.env.SYSTEMROOT; - command = String.raw`${windowsRoot}\System32\WindowsPowerShell\v1.0\powershell${isWsl ? '.exe' : ''}`; - cliArguments.push( - '-NoProfile', - '-NonInteractive', - '–ExecutionPolicy', - 'Bypass', - '-EncodedCommand' - ); - - if (isWsl) { - command = await windowsToWslPath(command); - } else { - childProcessOptions.windowsVerbatimArguments = true; - } - - const encodedArguments = ['Start']; - - if (options.wait) { - encodedArguments.push('-Wait'); - } - - if (app) { - if (isWsl && app.startsWith('/')) { - const windowsPath = await wslToWindowsPath(app); - app = windowsPath; - } - - // Double quote with double quotes to ensure the inner quotes are passed through. - // Inner quotes are delimited for PowerShell interpretation with backticks. - encodedArguments.push(`"\`"${app}\`""`, '-ArgumentList'); - appArguments.unshift(target); - } else { - encodedArguments.push(`"\`"${target}\`""`); - } - - if (appArguments.length > 0) { - appArguments = appArguments.map(arg => `"\`"${arg}\`""`); - encodedArguments.push(appArguments.join(',')); - } - - // Using Base64-encoded command, accepted by PowerShell, to allow special characters. - target = Buffer.from(encodedArguments.join(' '), 'utf16le').toString('base64'); - } else { - if (app) { - command = app; - } else { - // When bundled by Webpack, there's no actual package file path and no local `xdg-open`. - const isBundled = !__dirname || __dirname === '/'; - - // Check if local `xdg-open` exists and is executable. - let exeLocalXdgOpen = false; - try { - await pAccess(localXdgOpenPath, fs.constants.X_OK); - exeLocalXdgOpen = true; - } catch (_) {} - - const useSystemXdgOpen = process.versions.electron || - process.platform === 'android' || isBundled || !exeLocalXdgOpen; - command = useSystemXdgOpen ? 'xdg-open' : localXdgOpenPath; - } - - if (appArguments.length > 0) { - cliArguments.push(...appArguments); - } - - if (!options.wait) { - // `xdg-open` will block the process unless stdio is ignored - // and it's detached from the parent even if it's unref'd. - childProcessOptions.stdio = 'ignore'; - childProcessOptions.detached = true; - } - } - - cliArguments.push(target); - - if (process.platform === 'darwin' && appArguments.length > 0) { - cliArguments.push('--args', ...appArguments); - } - - const subprocess = childProcess.spawn(command, cliArguments, childProcessOptions); - - if (options.wait) { - return new Promise((resolve, reject) => { - subprocess.once('error', reject); - - subprocess.once('close', exitCode => { - if (options.allowNonzeroExitCode && exitCode > 0) { - reject(new Error(`Exited with code ${exitCode}`)); - return; - } - - resolve(subprocess); - }); - }); - } - - subprocess.unref(); - - return subprocess; -}; diff --git a/node_modules/open/license b/node_modules/open/license deleted file mode 100644 index fa7ceba..0000000 --- a/node_modules/open/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (https://sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/open/package.json b/node_modules/open/package.json deleted file mode 100644 index b8125d7..0000000 --- a/node_modules/open/package.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "_args": [ - [ - "open@7.3.1", - "/home/nuno/Documents/core/software/fresh/js/metaforecasts/metaforecasts-current" - ] - ], - "_from": "open@7.3.1", - "_id": "open@7.3.1", - "_inBundle": false, - "_integrity": "sha512-f2wt9DCBKKjlFbjzGb8MOAW8LH8F0mrs1zc7KTjAJ9PZNQbfenzWbNP1VZJvw6ICMG9r14Ah6yfwPn7T7i646A==", - "_location": "/open", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "open@7.3.1", - "name": "open", - "escapedName": "open", - "rawSpec": "7.3.1", - "saveSpec": null, - "fetchSpec": "7.3.1" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/open/-/open-7.3.1.tgz", - "_spec": "7.3.1", - "_where": "/home/nuno/Documents/core/software/fresh/js/metaforecasts/metaforecasts-current", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "https://sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/open/issues" - }, - "dependencies": { - "is-docker": "^2.0.0", - "is-wsl": "^2.1.1" - }, - "description": "Open stuff like URLs, files, executables. Cross-platform.", - "devDependencies": { - "@types/node": "^12.7.5", - "ava": "^2.3.0", - "tsd": "^0.11.0", - "xo": "^0.25.3" - }, - "engines": { - "node": ">=8" - }, - "files": [ - "index.js", - "index.d.ts", - "xdg-open" - ], - "funding": "https://github.com/sponsors/sindresorhus", - "homepage": "https://github.com/sindresorhus/open#readme", - "keywords": [ - "app", - "open", - "opener", - "opens", - "launch", - "start", - "xdg-open", - "xdg", - "default", - "cmd", - "browser", - "editor", - "executable", - "exe", - "url", - "urls", - "arguments", - "args", - "spawn", - "exec", - "child", - "process", - "website", - "file" - ], - "license": "MIT", - "name": "open", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/open.git" - }, - "scripts": { - "test": "xo && tsd" - }, - "version": "7.3.1" -} diff --git a/node_modules/open/readme.md b/node_modules/open/readme.md deleted file mode 100644 index e593243..0000000 --- a/node_modules/open/readme.md +++ /dev/null @@ -1,154 +0,0 @@ -# open - -> Open stuff like URLs, files, executables. Cross-platform. - -This is meant to be used in command-line tools and scripts, not in the browser. - -If you need this for Electron, use [`shell.openItem()`](https://electronjs.org/docs/api/shell#shellopenitemfullpath) instead. - -Note: The original [`open` package](https://github.com/pwnall/node-open) was previously deprecated in favor of this package, and we got the name, so this package is now named `open` instead of `opn`. If you're upgrading from the original `open` package (`open@0.0.5` or lower), keep in mind that the API is different. - -#### Why? - -- Actively maintained. -- Supports app arguments. -- Safer as it uses `spawn` instead of `exec`. -- Fixes most of the open original `node-open` issues. -- Includes the latest [`xdg-open` script](https://cgit.freedesktop.org/xdg/xdg-utils/commit/?id=c55122295c2a480fa721a9614f0e2d42b2949c18) for Linux. -- Supports WSL paths to Windows apps under `/mnt/*`. - -## Install - -``` -$ npm install open -``` - -## Usage - -```js -const open = require('open'); - -(async () => { - // Opens the image in the default image viewer and waits for the opened app to quit. - await open('unicorn.png', {wait: true}); - console.log('The image viewer app quit'); - - // Opens the URL in the default browser. - await open('https://sindresorhus.com'); - - // Opens the URL in a specified browser. - await open('https://sindresorhus.com', {app: 'firefox'}); - - // Specify app arguments. - await open('https://sindresorhus.com', {app: ['google chrome', '--incognito']}); -})(); -``` - -## API - -It uses the command `open` on macOS, `start` on Windows and `xdg-open` on other platforms. - -### open(target, options?) - -Returns a promise for the [spawned child process](https://nodejs.org/api/child_process.html#child_process_class_childprocess). You would normally not need to use this for anything, but it can be useful if you'd like to attach custom event listeners or perform other operations directly on the spawned process. - -#### target - -Type: `string` - -The thing you want to open. Can be a URL, file, or executable. - -Opens in the default app for the file type. For example, URLs opens in your default browser. - -#### options - -Type: `object` - -##### wait - -Type: `boolean`\ -Default: `false` - -Wait for the opened app to exit before fulfilling the promise. If `false` it's fulfilled immediately when opening the app. - -Note that it waits for the app to exit, not just for the window to close. - -On Windows, you have to explicitly specify an app for it to be able to wait. - -##### background (macOS only) - -Type: `boolean`\ -Default: `false` - -Do not bring the app to the foreground. - -##### app - -Type: `string | string[]` - -Specify the app to open the `target` with, or an array with the app and app arguments. - -The app name is platform dependent. Don't hard code it in reusable modules. For example, Chrome is `google chrome` on macOS, `google-chrome` on Linux and `chrome` on Windows. - -You may also pass in the app's full path. For example on WSL, this can be `/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe` for the Windows installation of Chrome. - -##### url - -Type: `boolean`\ -Default: `false` - -Uses `URL` to encode the target before executing it.
-We do not recommend using it on targets that are not URLs. - -Especially useful when dealing with the [double-quotes on Windows](#double-quotes-on-windows) caveat. - -##### allowNonzeroExitCode - -Type: `boolean`\ -Default: `false` - -Allow the opened app to exit with nonzero exit code when the `wait` option is `true`. - -We do not recommend setting this option. The convention for success is exit code zero. - -## Caveats - -### Double-quotes on Windows - -TL;DR: All double-quotes are stripped from the `target` and do not get to your desired destination (on Windows!). - -Due to specific behaviors of Window's Command Prompt (`cmd.exe`) regarding ampersand (`&`) characters breaking commands and URLs, double-quotes are now a special case. - -The solution ([#146](https://github.com/sindresorhus/open/pull/146)) to this and other problems was to leverage the fact that `cmd.exe` interprets a double-quoted argument as a plain text argument just by quoting it (like Node.js already does). Unfortunately, `cmd.exe` can only do **one** of two things: handle them all **OR** not handle them at all. As per its own documentation: - ->*If /C or /K is specified, then the remainder of the command line after the switch is processed as a command line, where the following logic is used to process quote (") characters:* -> -> 1. *If all of the following conditions are met, then quote characters on the command line are preserved:* -> - *no /S switch* -> - *exactly two quote characters* -> - *no special characters between the two quote characters, where special is one of: &<>()@^|* -> - *there are one or more whitespace characters between the two quote characters* -> - *the string between the two quote characters is the name of an executable file.* -> -> 2. *Otherwise, old behavior is to see if the first character is a quote character and if so, strip the leading character and remove the last quote character on the command line, preserving any text after the last quote character.* - -The option that solved all of the problems was the second one, and for additional behavior consistency we're also now using the `/S` switch, so we **always** get the second option. The caveat is that this built-in double-quotes handling ends up stripping all of them from the command line and so far we weren't able to find an escaping method that works (if you do, please feel free to contribute!). - -To make this caveat somewhat less impactful (at least for URLs), check out the [url option](#url). Double-quotes will be "preserved" when using it with an URL. - -## Related - -- [open-cli](https://github.com/sindresorhus/open-cli) - CLI for this module -- [open-editor](https://github.com/sindresorhus/open-editor) - Open files in your editor at a specific line and column - ---- - -
- - Get professional support for this package with a Tidelift subscription - -
- - Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. -
-
diff --git a/node_modules/open/xdg-open b/node_modules/open/xdg-open deleted file mode 100755 index faaea7f..0000000 --- a/node_modules/open/xdg-open +++ /dev/null @@ -1,1066 +0,0 @@ -#!/bin/sh -#--------------------------------------------- -# xdg-open -# -# Utility script to open a URL in the registered default application. -# -# Refer to the usage() function below for usage. -# -# Copyright 2009-2010, Fathi Boudra -# Copyright 2009-2010, Rex Dieter -# Copyright 2006, Kevin Krammer -# Copyright 2006, Jeremy White -# -# LICENSE: -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR -# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -# OTHER DEALINGS IN THE SOFTWARE. -# -#--------------------------------------------- - -manualpage() -{ -cat << _MANUALPAGE -Name - - xdg-open -- opens a file or URL in the user's preferred - application - -Synopsis - - xdg-open { file | URL } - - xdg-open { --help | --manual | --version } - -Description - - xdg-open opens a file or URL in the user's preferred - application. If a URL is provided the URL will be opened in the - user's preferred web browser. If a file is provided the file - will be opened in the preferred application for files of that - type. xdg-open supports file, ftp, http and https URLs. - - xdg-open is for use inside a desktop session only. It is not - recommended to use xdg-open as root. - -Options - - --help - Show command synopsis. - - --manual - Show this manual page. - - --version - Show the xdg-utils version information. - -Exit Codes - - An exit code of 0 indicates success while a non-zero exit code - indicates failure. The following failure codes can be returned: - - 1 - Error in command line syntax. - - 2 - One of the files passed on the command line did not - exist. - - 3 - A required tool could not be found. - - 4 - The action failed. - -See Also - - xdg-mime(1), xdg-settings(1), MIME applications associations - specification - -Examples - -xdg-open 'http://www.freedesktop.org/' - - Opens the freedesktop.org website in the user's default - browser. - -xdg-open /tmp/foobar.png - - Opens the PNG image file /tmp/foobar.png in the user's default - image viewing application. -_MANUALPAGE -} - -usage() -{ -cat << _USAGE - xdg-open -- opens a file or URL in the user's preferred - application - -Synopsis - - xdg-open { file | URL } - - xdg-open { --help | --manual | --version } - -_USAGE -} - -#@xdg-utils-common@ - -#---------------------------------------------------------------------------- -# Common utility functions included in all XDG wrapper scripts -#---------------------------------------------------------------------------- - -DEBUG() -{ - [ -z "${XDG_UTILS_DEBUG_LEVEL}" ] && return 0; - [ ${XDG_UTILS_DEBUG_LEVEL} -lt $1 ] && return 0; - shift - echo "$@" >&2 -} - -# This handles backslashes but not quote marks. -first_word() -{ - read first rest - echo "$first" -} - -#------------------------------------------------------------- -# map a binary to a .desktop file -binary_to_desktop_file() -{ - search="${XDG_DATA_HOME:-$HOME/.local/share}:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" - binary="`which "$1"`" - binary="`readlink -f "$binary"`" - base="`basename "$binary"`" - IFS=: - for dir in $search; do - unset IFS - [ "$dir" ] || continue - [ -d "$dir/applications" ] || [ -d "$dir/applnk" ] || continue - for file in "$dir"/applications/*.desktop "$dir"/applications/*/*.desktop "$dir"/applnk/*.desktop "$dir"/applnk/*/*.desktop; do - [ -r "$file" ] || continue - # Check to make sure it's worth the processing. - grep -q "^Exec.*$base" "$file" || continue - # Make sure it's a visible desktop file (e.g. not "preferred-web-browser.desktop"). - grep -Eq "^(NoDisplay|Hidden)=true" "$file" && continue - command="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | first_word`" - command="`which "$command"`" - if [ x"`readlink -f "$command"`" = x"$binary" ]; then - # Fix any double slashes that got added path composition - echo "$file" | sed -e 's,//*,/,g' - return - fi - done - done -} - -#------------------------------------------------------------- -# map a .desktop file to a binary -desktop_file_to_binary() -{ - search="${XDG_DATA_HOME:-$HOME/.local/share}:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" - desktop="`basename "$1"`" - IFS=: - for dir in $search; do - unset IFS - [ "$dir" ] && [ -d "$dir/applications" ] || [ -d "$dir/applnk" ] || continue - # Check if desktop file contains - - if [ "${desktop#*-}" != "$desktop" ]; then - vendor=${desktop%-*} - app=${desktop#*-} - if [ -r $dir/applications/$vendor/$app ]; then - file_path=$dir/applications/$vendor/$app - elif [ -r $dir/applnk/$vendor/$app ]; then - file_path=$dir/applnk/$vendor/$app - fi - fi - if test -z "$file_path" ; then - for indir in "$dir"/applications/ "$dir"/applications/*/ "$dir"/applnk/ "$dir"/applnk/*/; do - file="$indir/$desktop" - if [ -r "$file" ]; then - file_path=$file - break - fi - done - fi - if [ -r "$file_path" ]; then - # Remove any arguments (%F, %f, %U, %u, etc.). - command="`grep -E "^Exec(\[[^]=]*])?=" "$file_path" | cut -d= -f 2- | first_word`" - command="`which "$command"`" - readlink -f "$command" - return - fi - done -} - -#------------------------------------------------------------- -# Exit script on successfully completing the desired operation - -exit_success() -{ - if [ $# -gt 0 ]; then - echo "$@" - echo - fi - - exit 0 -} - - -#----------------------------------------- -# Exit script on malformed arguments, not enough arguments -# or missing required option. -# prints usage information - -exit_failure_syntax() -{ - if [ $# -gt 0 ]; then - echo "xdg-open: $@" >&2 - echo "Try 'xdg-open --help' for more information." >&2 - else - usage - echo "Use 'man xdg-open' or 'xdg-open --manual' for additional info." - fi - - exit 1 -} - -#------------------------------------------------------------- -# Exit script on missing file specified on command line - -exit_failure_file_missing() -{ - if [ $# -gt 0 ]; then - echo "xdg-open: $@" >&2 - fi - - exit 2 -} - -#------------------------------------------------------------- -# Exit script on failure to locate necessary tool applications - -exit_failure_operation_impossible() -{ - if [ $# -gt 0 ]; then - echo "xdg-open: $@" >&2 - fi - - exit 3 -} - -#------------------------------------------------------------- -# Exit script on failure returned by a tool application - -exit_failure_operation_failed() -{ - if [ $# -gt 0 ]; then - echo "xdg-open: $@" >&2 - fi - - exit 4 -} - -#------------------------------------------------------------ -# Exit script on insufficient permission to read a specified file - -exit_failure_file_permission_read() -{ - if [ $# -gt 0 ]; then - echo "xdg-open: $@" >&2 - fi - - exit 5 -} - -#------------------------------------------------------------ -# Exit script on insufficient permission to write a specified file - -exit_failure_file_permission_write() -{ - if [ $# -gt 0 ]; then - echo "xdg-open: $@" >&2 - fi - - exit 6 -} - -check_input_file() -{ - if [ ! -e "$1" ]; then - exit_failure_file_missing "file '$1' does not exist" - fi - if [ ! -r "$1" ]; then - exit_failure_file_permission_read "no permission to read file '$1'" - fi -} - -check_vendor_prefix() -{ - file_label="$2" - [ -n "$file_label" ] || file_label="filename" - file=`basename "$1"` - case "$file" in - [[:alpha:]]*-*) - return - ;; - esac - - echo "xdg-open: $file_label '$file' does not have a proper vendor prefix" >&2 - echo 'A vendor prefix consists of alpha characters ([a-zA-Z]) and is terminated' >&2 - echo 'with a dash ("-"). An example '"$file_label"' is '"'example-$file'" >&2 - echo "Use --novendor to override or 'xdg-open --manual' for additional info." >&2 - exit 1 -} - -check_output_file() -{ - # if the file exists, check if it is writeable - # if it does not exists, check if we are allowed to write on the directory - if [ -e "$1" ]; then - if [ ! -w "$1" ]; then - exit_failure_file_permission_write "no permission to write to file '$1'" - fi - else - DIR=`dirname "$1"` - if [ ! -w "$DIR" ] || [ ! -x "$DIR" ]; then - exit_failure_file_permission_write "no permission to create file '$1'" - fi - fi -} - -#---------------------------------------- -# Checks for shared commands, e.g. --help - -check_common_commands() -{ - while [ $# -gt 0 ] ; do - parm="$1" - shift - - case "$parm" in - --help) - usage - echo "Use 'man xdg-open' or 'xdg-open --manual' for additional info." - exit_success - ;; - - --manual) - manualpage - exit_success - ;; - - --version) - echo "xdg-open 1.1.3" - exit_success - ;; - esac - done -} - -check_common_commands "$@" - -[ -z "${XDG_UTILS_DEBUG_LEVEL}" ] && unset XDG_UTILS_DEBUG_LEVEL; -if [ ${XDG_UTILS_DEBUG_LEVEL-0} -lt 1 ]; then - # Be silent - xdg_redirect_output=" > /dev/null 2> /dev/null" -else - # All output to stderr - xdg_redirect_output=" >&2" -fi - -#-------------------------------------- -# Checks for known desktop environments -# set variable DE to the desktop environments name, lowercase - -detectDE() -{ - # see https://bugs.freedesktop.org/show_bug.cgi?id=34164 - unset GREP_OPTIONS - - if [ -n "${XDG_CURRENT_DESKTOP}" ]; then - case "${XDG_CURRENT_DESKTOP}" in - # only recently added to menu-spec, pre-spec X- still in use - Cinnamon|X-Cinnamon) - DE=cinnamon; - ;; - ENLIGHTENMENT) - DE=enlightenment; - ;; - # GNOME, GNOME-Classic:GNOME, or GNOME-Flashback:GNOME - GNOME*) - DE=gnome; - ;; - KDE) - DE=kde; - ;; - # Deepin Desktop Environments - DEEPIN|Deepin|deepin) - DE=dde; - ;; - LXDE) - DE=lxde; - ;; - LXQt) - DE=lxqt; - ;; - MATE) - DE=mate; - ;; - XFCE) - DE=xfce - ;; - X-Generic) - DE=generic - ;; - esac - fi - - if [ x"$DE" = x"" ]; then - # classic fallbacks - if [ x"$KDE_FULL_SESSION" != x"" ]; then DE=kde; - elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome; - elif [ x"$MATE_DESKTOP_SESSION_ID" != x"" ]; then DE=mate; - elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/null 2>&1` ; then DE=gnome; - elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce; - elif xprop -root 2> /dev/null | grep -i '^xfce_desktop_window' >/dev/null 2>&1; then DE=xfce - elif echo $DESKTOP | grep -q '^Enlightenment'; then DE=enlightenment; - elif [ x"$LXQT_SESSION_CONFIG" != x"" ]; then DE=lxqt; - fi - fi - - if [ x"$DE" = x"" ]; then - # fallback to checking $DESKTOP_SESSION - case "$DESKTOP_SESSION" in - gnome) - DE=gnome; - ;; - LXDE|Lubuntu) - DE=lxde; - ;; - MATE) - DE=mate; - ;; - xfce|xfce4|'Xfce Session') - DE=xfce; - ;; - esac - fi - - if [ x"$DE" = x"" ]; then - # fallback to uname output for other platforms - case "$(uname 2>/dev/null)" in - CYGWIN*) - DE=cygwin; - ;; - Darwin) - DE=darwin; - ;; - esac - fi - - if [ x"$DE" = x"gnome" ]; then - # gnome-default-applications-properties is only available in GNOME 2.x - # but not in GNOME 3.x - which gnome-default-applications-properties > /dev/null 2>&1 || DE="gnome3" - fi - - if [ -f "$XDG_RUNTIME_DIR/flatpak-info" ]; then - DE="flatpak" - fi -} - -#---------------------------------------------------------------------------- -# kfmclient exec/openURL can give bogus exit value in KDE <= 3.5.4 -# It also always returns 1 in KDE 3.4 and earlier -# Simply return 0 in such case - -kfmclient_fix_exit_code() -{ - version=`LC_ALL=C.UTF-8 kde-config --version 2>/dev/null | grep '^KDE'` - major=`echo $version | sed 's/KDE.*: \([0-9]\).*/\1/'` - minor=`echo $version | sed 's/KDE.*: [0-9]*\.\([0-9]\).*/\1/'` - release=`echo $version | sed 's/KDE.*: [0-9]*\.[0-9]*\.\([0-9]\).*/\1/'` - test "$major" -gt 3 && return $1 - test "$minor" -gt 5 && return $1 - test "$release" -gt 4 && return $1 - return 0 -} - -#---------------------------------------------------------------------------- -# Returns true if there is a graphical display attached. - -has_display() -{ - if [ -n "$DISPLAY" ] || [ -n "$WAYLAND_DISPLAY" ]; then - return 0 - else - return 1 - fi -} - -# This handles backslashes but not quote marks. -last_word() -{ - read first rest - echo "$rest" -} - -# Get the value of a key in a desktop file's Desktop Entry group. -# Example: Use get_key foo.desktop Exec -# to get the values of the Exec= key for the Desktop Entry group. -get_key() -{ - local file="${1}" - local key="${2}" - local desktop_entry="" - - IFS_="${IFS}" - IFS="" - while read line - do - case "$line" in - "[Desktop Entry]") - desktop_entry="y" - ;; - # Reset match flag for other groups - "["*) - desktop_entry="" - ;; - "${key}="*) - # Only match Desktop Entry group - if [ -n "${desktop_entry}" ] - then - echo "${line}" | cut -d= -f 2- - fi - esac - done < "${file}" - IFS="${IFS_}" -} - -# Returns true if argument is a file:// URL or path -is_file_url_or_path() -{ - if echo "$1" | grep -q '^file://' \ - || ! echo "$1" | egrep -q '^[[:alpha:]+\.\-]+:'; then - return 0 - else - return 1 - fi -} - -# If argument is a file URL, convert it to a (percent-decoded) path. -# If not, leave it as it is. -file_url_to_path() -{ - local file="$1" - if echo "$file" | grep -q '^file:///'; then - file=${file#file://} - file=${file%%#*} - file=$(echo "$file" | sed -r 's/\?.*$//') - local printf=printf - if [ -x /usr/bin/printf ]; then - printf=/usr/bin/printf - fi - file=$($printf "$(echo "$file" | sed -e 's@%\([a-f0-9A-F]\{2\}\)@\\x\1@g')") - fi - echo "$file" -} - -open_cygwin() -{ - cygstart "$1" - - if [ $? -eq 0 ]; then - exit_success - else - exit_failure_operation_failed - fi -} - -open_darwin() -{ - open "$1" - - if [ $? -eq 0 ]; then - exit_success - else - exit_failure_operation_failed - fi -} - -open_kde() -{ - if [ -n "${KDE_SESSION_VERSION}" ]; then - case "${KDE_SESSION_VERSION}" in - 4) - kde-open "$1" - ;; - 5) - kde-open${KDE_SESSION_VERSION} "$1" - ;; - esac - else - kfmclient exec "$1" - kfmclient_fix_exit_code $? - fi - - if [ $? -eq 0 ]; then - exit_success - else - exit_failure_operation_failed - fi -} - -open_dde() -{ - if dde-open -version >/dev/null 2>&1; then - dde-open "$1" - else - open_generic "$1" - fi - - if [ $? -eq 0 ]; then - exit_success - else - exit_failure_operation_failed - fi -} - -open_gnome3() -{ - if gio help open 2>/dev/null 1>&2; then - gio open "$1" - elif gvfs-open --help 2>/dev/null 1>&2; then - gvfs-open "$1" - else - open_generic "$1" - fi - - if [ $? -eq 0 ]; then - exit_success - else - exit_failure_operation_failed - fi -} - -open_gnome() -{ - if gio help open 2>/dev/null 1>&2; then - gio open "$1" - elif gvfs-open --help 2>/dev/null 1>&2; then - gvfs-open "$1" - elif gnome-open --help 2>/dev/null 1>&2; then - gnome-open "$1" - else - open_generic "$1" - fi - - if [ $? -eq 0 ]; then - exit_success - else - exit_failure_operation_failed - fi -} - -open_mate() -{ - if gio help open 2>/dev/null 1>&2; then - gio open "$1" - elif gvfs-open --help 2>/dev/null 1>&2; then - gvfs-open "$1" - elif mate-open --help 2>/dev/null 1>&2; then - mate-open "$1" - else - open_generic "$1" - fi - - if [ $? -eq 0 ]; then - exit_success - else - exit_failure_operation_failed - fi -} - -open_xfce() -{ - if exo-open --help 2>/dev/null 1>&2; then - exo-open "$1" - elif gio help open 2>/dev/null 1>&2; then - gio open "$1" - elif gvfs-open --help 2>/dev/null 1>&2; then - gvfs-open "$1" - else - open_generic "$1" - fi - - if [ $? -eq 0 ]; then - exit_success - else - exit_failure_operation_failed - fi -} - -open_enlightenment() -{ - if enlightenment_open --help 2>/dev/null 1>&2; then - enlightenment_open "$1" - else - open_generic "$1" - fi - - if [ $? -eq 0 ]; then - exit_success - else - exit_failure_operation_failed - fi -} - -open_flatpak() -{ - gdbus call --session \ - --dest org.freedesktop.portal.Desktop \ - --object-path /org/freedesktop/portal/desktop \ - --method org.freedesktop.portal.OpenURI.OpenURI \ - "" "$1" {} - - if [ $? -eq 0 ]; then - exit_success - else - exit_failure_operation_failed - fi -} - -#----------------------------------------- -# Recursively search .desktop file - -search_desktop_file() -{ - local default="$1" - local dir="$2" - local target="$3" - - local file="" - # look for both vendor-app.desktop, vendor/app.desktop - if [ -r "$dir/$default" ]; then - file="$dir/$default" - elif [ -r "$dir/`echo $default | sed -e 's|-|/|'`" ]; then - file="$dir/`echo $default | sed -e 's|-|/|'`" - fi - - if [ -r "$file" ] ; then - command="$(get_key "${file}" "Exec" | first_word)" - command_exec=`which $command 2>/dev/null` - icon="$(get_key "${file}" "Icon")" - # FIXME: Actually LC_MESSAGES should be used as described in - # http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s04.html - localised_name="$(get_key "${file}" "Name")" - set -- $(get_key "${file}" "Exec" | last_word) - # We need to replace any occurrence of "%f", "%F" and - # the like by the target file. We examine each - # argument and append the modified argument to the - # end then shift. - local args=$# - local replaced=0 - while [ $args -gt 0 ]; do - case $1 in - %[c]) - replaced=1 - arg="${localised_name}" - shift - set -- "$@" "$arg" - ;; - %[fFuU]) - replaced=1 - arg="$target" - shift - set -- "$@" "$arg" - ;; - %[i]) - replaced=1 - shift - set -- "$@" "--icon" "$icon" - ;; - *) - arg="$1" - shift - set -- "$@" "$arg" - ;; - esac - args=$(( $args - 1 )) - done - [ $replaced -eq 1 ] || set -- "$@" "$target" - "$command_exec" "$@" - - if [ $? -eq 0 ]; then - exit_success - fi - fi - - for d in $dir/*/; do - [ -d "$d" ] && search_desktop_file "$default" "$d" "$target" - done -} - - -open_generic_xdg_mime() -{ - filetype="$2" - default=`xdg-mime query default "$filetype"` - if [ -n "$default" ] ; then - xdg_user_dir="$XDG_DATA_HOME" - [ -n "$xdg_user_dir" ] || xdg_user_dir="$HOME/.local/share" - - xdg_system_dirs="$XDG_DATA_DIRS" - [ -n "$xdg_system_dirs" ] || xdg_system_dirs=/usr/local/share/:/usr/share/ - -DEBUG 3 "$xdg_user_dir:$xdg_system_dirs" - for x in `echo "$xdg_user_dir:$xdg_system_dirs" | sed 's/:/ /g'`; do - search_desktop_file "$default" "$x/applications/" "$1" - done - fi -} - -open_generic_xdg_file_mime() -{ - filetype=`xdg-mime query filetype "$1" | sed "s/;.*//"` - open_generic_xdg_mime "$1" "$filetype" -} - -open_generic_xdg_x_scheme_handler() -{ - scheme="`echo $1 | sed -n 's/\(^[[:alnum:]+\.-]*\):.*$/\1/p'`" - if [ -n $scheme ]; then - filetype="x-scheme-handler/$scheme" - open_generic_xdg_mime "$1" "$filetype" - fi -} - -has_single_argument() -{ - test $# = 1 -} - -open_envvar() -{ - local oldifs="$IFS" - local browser browser_with_arg - - IFS=":" - for browser in $BROWSER; do - IFS="$oldifs" - - if [ -z "$browser" ]; then - continue - fi - - if echo "$browser" | grep -q %s; then - # Avoid argument injection. - # See https://bugs.freedesktop.org/show_bug.cgi?id=103807 - # URIs don't have IFS characters spaces anyway. - has_single_argument $1 && $(printf "$browser" "$1") - else - $browser "$1" - fi - - if [ $? -eq 0 ]; then - exit_success - fi - done -} - -open_generic() -{ - if is_file_url_or_path "$1"; then - local file="$(file_url_to_path "$1")" - - check_input_file "$file" - - if has_display; then - filetype=`xdg-mime query filetype "$file" | sed "s/;.*//"` - open_generic_xdg_mime "$file" "$filetype" - fi - - if which run-mailcap 2>/dev/null 1>&2; then - run-mailcap --action=view "$file" - if [ $? -eq 0 ]; then - exit_success - fi - fi - - if has_display && mimeopen -v 2>/dev/null 1>&2; then - mimeopen -L -n "$file" - if [ $? -eq 0 ]; then - exit_success - fi - fi - fi - - if has_display; then - open_generic_xdg_x_scheme_handler "$1" - fi - - if [ -n "$BROWSER" ]; then - open_envvar "$1" - fi - - # if BROWSER variable is not set, check some well known browsers instead - if [ x"$BROWSER" = x"" ]; then - BROWSER=www-browser:links2:elinks:links:lynx:w3m - if has_display; then - BROWSER=x-www-browser:firefox:iceweasel:seamonkey:mozilla:epiphany:konqueror:chromium:chromium-browser:google-chrome:$BROWSER - fi - fi - - open_envvar "$1" - - exit_failure_operation_impossible "no method available for opening '$1'" -} - -open_lxde() -{ - - # pcmanfm only knows how to handle file:// urls and filepaths, it seems. - if pcmanfm --help >/dev/null 2>&1 && is_file_url_or_path "$1"; then - local file="$(file_url_to_path "$1")" - - # handle relative paths - if ! echo "$file" | grep -q ^/; then - file="$(pwd)/$file" - fi - - pcmanfm "$file" - else - open_generic "$1" - fi - - if [ $? -eq 0 ]; then - exit_success - else - exit_failure_operation_failed - fi -} - -open_lxqt() -{ - open_generic "$1" -} - -[ x"$1" != x"" ] || exit_failure_syntax - -url= -while [ $# -gt 0 ] ; do - parm="$1" - shift - - case "$parm" in - -*) - exit_failure_syntax "unexpected option '$parm'" - ;; - - *) - if [ -n "$url" ] ; then - exit_failure_syntax "unexpected argument '$parm'" - fi - url="$parm" - ;; - esac -done - -if [ -z "${url}" ] ; then - exit_failure_syntax "file or URL argument missing" -fi - -detectDE - -if [ x"$DE" = x"" ]; then - DE=generic -fi - -DEBUG 2 "Selected DE $DE" - -# sanitize BROWSER (avoid caling ourselves in particular) -case "${BROWSER}" in - *:"xdg-open"|"xdg-open":*) - BROWSER=$(echo $BROWSER | sed -e 's|:xdg-open||g' -e 's|xdg-open:||g') - ;; - "xdg-open") - BROWSER= - ;; -esac - -case "$DE" in - kde) - open_kde "$url" - ;; - - dde) - open_dde "$url" - ;; - - gnome3|cinnamon) - open_gnome3 "$url" - ;; - - gnome) - open_gnome "$url" - ;; - - mate) - open_mate "$url" - ;; - - xfce) - open_xfce "$url" - ;; - - lxde) - open_lxde "$url" - ;; - - lxqt) - open_lxqt "$url" - ;; - - enlightenment) - open_enlightenment "$url" - ;; - - cygwin) - open_cygwin "$url" - ;; - - darwin) - open_darwin "$url" - ;; - - flatpak) - open_flatpak "$url" - ;; - - generic) - open_generic "$url" - ;; - - *) - exit_failure_operation_impossible "no method available for opening '$url'" - ;; -esac diff --git a/node_modules/papaparse/.eslintrc.js b/node_modules/papaparse/.eslintrc.js deleted file mode 100644 index c3ed7c5..0000000 --- a/node_modules/papaparse/.eslintrc.js +++ /dev/null @@ -1,279 +0,0 @@ -module.exports = { - "parserOptions": { - "ecmaVersion": 5 - }, - "env": { - "browser": true, - "worker": true, - "node": true - }, - "extends": "eslint:recommended", - "rules": { - "accessor-pairs": "error", - "array-bracket-newline": ["error", "consistent"], - "array-bracket-spacing": [ - "error", - "never" - ], - "array-callback-return": "error", - "array-element-newline": "off", - "arrow-body-style": "error", - "arrow-parens": "error", - "arrow-spacing": "error", - "block-scoped-var": "error", - "block-spacing": "error", - "brace-style": "off", - "callback-return": "error", - "camelcase": ["error", {"properties": "never"}], - "capitalized-comments": "off", - "class-methods-use-this": "error", - "comma-dangle": "off", - "comma-spacing": "off", - "comma-style": [ - "error", - "last" - ], - "complexity": "off", - "computed-property-spacing": [ - "error", - "never" - ], - "consistent-return": "off", - "consistent-this": "off", - "curly": "off", - "default-case": "error", - "dot-location": "error", - "dot-notation": "error", - "eol-last": "error", - "eqeqeq": "error", - "for-direction": "error", - "func-call-spacing": "error", - "func-name-matching": "error", - "func-names": [ - "error", - "never" - ], - "func-style": "off", - "function-paren-newline": "off", - "generator-star-spacing": "error", - "getter-return": "error", - "global-require": "off", - "guard-for-in": "off", - "handle-callback-err": "error", - "id-blacklist": "error", - "id-length": "off", - "id-match": "error", - "implicit-arrow-linebreak": "error", - "indent": [ - "error", - "tab" - ], - "indent-legacy": "off", - "init-declarations": "off", - "jsx-quotes": "error", - "key-spacing": "error", - "keyword-spacing": "off", - "line-comment-position": "off", - "linebreak-style": [ - "error", - "unix" - ], - "lines-around-comment": "off", - "lines-around-directive": "off", - "lines-between-class-members": "error", - "max-depth": "off", - "max-len": "off", - "max-lines": "off", - "max-nested-callbacks": "error", - "max-params": "off", - "max-statements": "off", - "max-statements-per-line": "off", - "multiline-comment-style": "off", - "multiline-ternary": [ - "error", - "always-multiline" - ], - "new-parens": "error", - "newline-after-var": "off", - "newline-before-return": "off", - "newline-per-chained-call": "off", - "no-alert": "error", - "no-array-constructor": "error", - "no-await-in-loop": "error", - "no-bitwise": "error", - "no-buffer-constructor": "error", - "no-caller": "error", - "no-catch-shadow": "off", - "no-cond-assign": [ - "error", - "except-parens" - ], - "no-confusing-arrow": "error", - "no-console": "off", - "no-continue": "off", - "no-div-regex": "error", - "no-duplicate-imports": "error", - "no-else-return": "off", - "no-empty": ["error", {"allowEmptyCatch": true}], - "no-empty-function": "off", - "no-eq-null": "error", - "no-eval": "error", - "no-extend-native": "error", - "no-extra-bind": "error", - "no-extra-label": "error", - "no-extra-parens": "off", - "no-floating-decimal": "error", - "no-implicit-globals": "error", - "no-implied-eval": "error", - "no-inline-comments": "off", - "no-inner-declarations": [ - "error", - "functions" - ], - "no-invalid-this": "off", - "no-iterator": "error", - "no-label-var": "error", - "no-labels": "error", - "no-lone-blocks": "error", - "no-lonely-if": "error", - "no-loop-func": "error", - "no-magic-numbers": "off", - "no-mixed-operators": "off", - "no-mixed-requires": "error", - "no-multi-assign": "error", - "no-multi-spaces": "off", - "no-multi-str": "error", - "no-multiple-empty-lines": "off", - "no-native-reassign": "error", - "no-negated-condition": "off", - "no-negated-in-lhs": "error", - "no-nested-ternary": "off", - "no-new": "error", - "no-new-func": "error", - "no-new-object": "error", - "no-new-require": "error", - "no-new-wrappers": "error", - "no-octal-escape": "error", - "no-param-reassign": "off", - "no-path-concat": "off", - "no-plusplus": "off", - "no-process-env": "error", - "no-process-exit": "error", - "no-proto": "error", - "no-prototype-builtins": "error", - "no-restricted-globals": "error", - "no-restricted-imports": "error", - "no-restricted-modules": "error", - "no-restricted-properties": "error", - "no-restricted-syntax": "error", - "no-return-assign": "error", - "no-return-await": "error", - "no-script-url": "error", - "no-self-compare": "error", - "no-sequences": "error", - "no-shadow": "off", - "no-shadow-restricted-names": "error", - "no-spaced-func": "error", - "no-sync": ["error", {"allowAtRootLevel": true}], - "no-tabs": "off", - "no-template-curly-in-string": "error", - "no-ternary": "off", - "no-throw-literal": "error", - "no-trailing-spaces": "error", - "no-undef-init": "error", - "no-undefined": "off", - "no-underscore-dangle": "off", - "no-unmodified-loop-condition": "off", - "no-unneeded-ternary": "error", - "no-unused-expressions": "off", - "no-unused-vars": ["error", {"args": "none"}], - "no-use-before-define": "off", - "no-useless-call": "error", - "no-useless-computed-key": "error", - "no-useless-concat": "error", - "no-useless-constructor": "error", - "no-useless-rename": "error", - "no-useless-return": "off", - "no-var": "off", - "no-void": "error", - "no-warning-comments": "error", - "no-whitespace-before-property": "error", - "no-with": "error", - "nonblock-statement-body-position": [ - "error", - "any" - ], - "object-curly-newline": ["error", {"consistent": true}], - "object-curly-spacing": "off", - "object-shorthand": "off", - "one-var": "off", - "one-var-declaration-per-line": "off", - "operator-assignment": [ - "error", - "always" - ], - "operator-linebreak": "off", - "padded-blocks": "off", - "padding-line-between-statements": "error", - "prefer-arrow-callback": "off", - "prefer-const": "error", - "prefer-destructuring": "off", - "prefer-numeric-literals": "error", - "prefer-promise-reject-errors": "error", - "prefer-reflect": "off", - "prefer-rest-params": "off", - "prefer-spread": "error", - "prefer-template": "off", - "quote-props": "off", - "quotes": "off", - "radix": [ - "error", - "as-needed" - ], - "require-await": "error", - "require-jsdoc": "off", - "rest-spread-spacing": "error", - "semi": "error", - "semi-spacing": "error", - "semi-style": [ - "error", - "last" - ], - "sort-imports": "error", - "sort-keys": "off", - "sort-vars": "off", - "space-before-blocks": "error", - "space-before-function-paren": [ - "error", - "never" - ], - "space-in-parens": [ - "error", - "never" - ], - "space-infix-ops": "error", - "space-unary-ops": [ - "error", - { - "nonwords": false, - "words": false - } - ], - "spaced-comment": "off", - "strict": "off", - "switch-colon-spacing": "error", - "symbol-description": "error", - "template-curly-spacing": "error", - "template-tag-spacing": "error", - "unicode-bom": [ - "error", - "never" - ], - "valid-jsdoc": "off", - "vars-on-top": "off", - "wrap-iife": "off", - "wrap-regex": "off", - "yield-star-spacing": "error", - "yoda": "off" - } -}; diff --git a/node_modules/papaparse/.travis.yml b/node_modules/papaparse/.travis.yml deleted file mode 100644 index f00e0fb..0000000 --- a/node_modules/papaparse/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: - - "8" - - "9" - - "10" - - "11" diff --git a/node_modules/papaparse/Gruntfile.js b/node_modules/papaparse/Gruntfile.js deleted file mode 100644 index 93b1256..0000000 --- a/node_modules/papaparse/Gruntfile.js +++ /dev/null @@ -1,27 +0,0 @@ -module.exports = function(grunt) { - grunt.initConfig({ - uglify: { - options: { - compress: { - global_defs: { - 'PAPA_BROWSER_CONTEXT': true - }, - dead_code: true - }, - output: { - comments: 'some', - }, - }, - min: { - files: { - 'papaparse.min.js': ['papaparse.js'] - }, - }, - }, - }); - - grunt.loadNpmTasks('grunt-contrib-uglify'); - - grunt.registerTask('build', ['uglify']); - grunt.registerTask('default', ['uglify']); -}; diff --git a/node_modules/papaparse/LICENSE b/node_modules/papaparse/LICENSE deleted file mode 100644 index 12f5b35..0000000 --- a/node_modules/papaparse/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Matthew Holt - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/papaparse/README.md b/node_modules/papaparse/README.md deleted file mode 100644 index 45313c3..0000000 --- a/node_modules/papaparse/README.md +++ /dev/null @@ -1,67 +0,0 @@ -Parse CSV with JavaScript -======================================== - -Papa Parse is the [fastest](http://jsperf.com/javascript-csv-parsers/4) in-browser CSV (or delimited text) parser for JavaScript. It is reliable and correct according to [RFC 4180](https://tools.ietf.org/html/rfc4180), and it comes with these features: - -- Easy to use -- Parse CSV files directly (local or over the network) -- Fast mode ([is really fast](http://jsperf.com/javascript-csv-parsers/3)) -- Stream large files (even via HTTP) -- Reverse parsing (converts JSON to CSV) -- Auto-detect delimiter -- Worker threads to keep your web page reactive -- Header row support -- Pause, resume, abort -- Can convert numbers and booleans to their types -- Optional jQuery integration to get files from `` elements -- One of the only parsers that correctly handles line-breaks and quotations - -Papa Parse has **no dependencies** - not even jQuery. - -Install -------- - -papaparse is available on [npm](https://www.npmjs.com/package/papaparse). It -can be installed with the following command: - - npm install papaparse - -If you don't want to use npm, [papaparse.min.js](https://unpkg.com/papaparse@latest/papaparse.min.js) can be downloaded to your project source. - - -Homepage & Demo ----------------- - -- [Homepage](http://papaparse.com) -- [Demo](http://papaparse.com/demo) - -To learn how to use Papa Parse: - -- [Documentation](http://papaparse.com/docs) - -The website is hosted on [Github Pages](https://pages.github.com/). Its content is also included in the docs folder of this repository. If you want to contribute on it just clone the master of this repository and open a pull request. - - -Papa Parse for Node --------------------- - -Papa Parse can parse a [Readable Stream](https://nodejs.org/api/stream.html#stream_readable_streams) instead of a [File](https://www.w3.org/TR/FileAPI/) when used in Node.js environments (in addition to plain strings). In this mode, `encoding` must, if specified, be a Node-supported character encoding. The `Papa.LocalChunkSize`, `Papa.RemoteChunkSize` , `download`, `withCredentials` and `worker` config options are unavailable. - -Papa Parse can also parse in a node streaming style which makes `.pipe` available. Simply pipe the [Readable Stream](https://nodejs.org/api/stream.html#stream_readable_streams) to the stream returned from `Papa.parse(Papa.NODE_STREAM_INPUT, options)`. The `Papa.LocalChunkSize`, `Papa.RemoteChunkSize` , `download`, `withCredentials`, `worker`, `step`, and `complete` config options are unavailable. To register a callback with the stream to process data, use the `data` event like so: `stream.on('data', callback)` and to signal the end of stream, use the 'end' event like so: `stream.on('end', callback)`. - -Get Started ------------ - -For usage instructions, see the [homepage](http://papaparse.com) and, for more detail, the [documentation](http://papaparse.com/docs). - -Tests ------ - -Papa Parse is under test. Download this repository, run `npm install`, then `npm test` to run the tests. - -Contributing ------------- - -To discuss a new feature or ask a question, open an issue. To fix a bug, submit a pull request to be credited with the [contributors](https://github.com/mholt/PapaParse/graphs/contributors)! Remember, a pull request, *with test*, is best. You may also discuss on Twitter with [#PapaParse](https://twitter.com/search?q=%23PapaParse&src=typd&f=realtime) or directly to me, [@mholt6](https://twitter.com/mholt6). - -If you contribute a patch, ensure the tests suite is running correctly. We run continuous integration on each pull request and will not accept a patch that breaks the tests. diff --git a/node_modules/papaparse/bower.json b/node_modules/papaparse/bower.json deleted file mode 100644 index 62e9ab5..0000000 --- a/node_modules/papaparse/bower.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "papaparse", - "main": "papaparse.js", - "homepage": "http://papaparse.com", - "authors": [ - "Matthew Holt" - ], - "description": "Fast and powerful CSV parser for the browser. Converts CSV->JSON and JSON->CSV. Supports web workers and streaming large files.", - "keywords": [ - "csv", - "parse", - "parsing", - "parser", - "delimited", - "text", - "data", - "auto-detect", - "comma", - "tab", - "pipe", - "file", - "filereader", - "stream", - "worker", - "workers", - "ajax", - "thread", - "threading", - "multi-threaded" - ], - "license": "MIT", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests", - "player" - ] -} diff --git a/node_modules/papaparse/package.json b/node_modules/papaparse/package.json deleted file mode 100644 index d6baff7..0000000 --- a/node_modules/papaparse/package.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "_args": [ - [ - "papaparse@5.3.0", - "/home/nuno/Documents/core/software/fresh/js/metaforecasts/metaforecasts-current" - ] - ], - "_from": "papaparse@5.3.0", - "_id": "papaparse@5.3.0", - "_inBundle": false, - "_integrity": "sha512-Lb7jN/4bTpiuGPrYy4tkKoUS8sTki8zacB5ke1p5zolhcSE4TlWgrlsxjrDTbG/dFVh07ck7X36hUf/b5V68pg==", - "_location": "/papaparse", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "papaparse@5.3.0", - "name": "papaparse", - "escapedName": "papaparse", - "rawSpec": "5.3.0", - "saveSpec": null, - "fetchSpec": "5.3.0" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/papaparse/-/papaparse-5.3.0.tgz", - "_spec": "5.3.0", - "_where": "/home/nuno/Documents/core/software/fresh/js/metaforecasts/metaforecasts-current", - "author": { - "name": "Matthew Holt", - "url": "https://twitter.com/mholt6" - }, - "browser": "papaparse.min.js", - "bugs": { - "url": "https://github.com/mholt/PapaParse/issues" - }, - "description": "Fast and powerful CSV parser for the browser that supports web workers and streaming large files. Converts CSV to JSON and JSON to CSV.", - "devDependencies": { - "chai": "^4.2.0", - "connect": "^3.3.3", - "eslint": "^4.19.1", - "grunt": "^1.0.2", - "grunt-contrib-uglify": "^3.3.0", - "mocha": "^5.2.0", - "mocha-headless-chrome": "^2.0.1", - "open": "7.0.0", - "serve-static": "^1.7.1" - }, - "homepage": "http://papaparse.com", - "keywords": [ - "csv", - "parser", - "parse", - "parsing", - "delimited", - "text", - "data", - "auto-detect", - "comma", - "tab", - "pipe", - "file", - "filereader", - "stream", - "worker", - "workers", - "thread", - "threading", - "multi-threaded", - "jquery-plugin" - ], - "license": "MIT", - "main": "papaparse.js", - "name": "papaparse", - "repository": { - "type": "git", - "url": "git+https://github.com/mholt/PapaParse.git" - }, - "scripts": { - "lint": "eslint --no-ignore papaparse.js Gruntfile.js .eslintrc.js 'tests/**/*.js'", - "test": "npm run lint && npm run test-node && npm run test-mocha-headless-chrome", - "test-browser": "node tests/test.js", - "test-mocha-headless-chrome": "node tests/test.js --mocha-headless-chrome", - "test-node": "mocha tests/node-tests.js tests/test-cases.js" - }, - "version": "5.3.0" -} diff --git a/node_modules/papaparse/papaparse.js b/node_modules/papaparse/papaparse.js deleted file mode 100755 index e1825d1..0000000 --- a/node_modules/papaparse/papaparse.js +++ /dev/null @@ -1,1934 +0,0 @@ -/* @license -Papa Parse -v5.3.0 -https://github.com/mholt/PapaParse -License: MIT -*/ - -(function(root, factory) -{ - /* globals define */ - if (typeof define === 'function' && define.amd) - { - // AMD. Register as an anonymous module. - define([], factory); - } - else if (typeof module === 'object' && typeof exports !== 'undefined') - { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(); - } - else - { - // Browser globals (root is window) - root.Papa = factory(); - } - // in strict mode we cannot access arguments.callee, so we need a named reference to - // stringify the factory method for the blob worker - // eslint-disable-next-line func-name -}(this, function moduleFactory() -{ - 'use strict'; - - var global = (function() { - // alternative method, similar to `Function('return this')()` - // but without using `eval` (which is disabled when - // using Content Security Policy). - - if (typeof self !== 'undefined') { return self; } - if (typeof window !== 'undefined') { return window; } - if (typeof global !== 'undefined') { return global; } - - // When running tests none of the above have been defined - return {}; - })(); - - - function getWorkerBlob() { - var URL = global.URL || global.webkitURL || null; - var code = moduleFactory.toString(); - return Papa.BLOB_URL || (Papa.BLOB_URL = URL.createObjectURL(new Blob(['(', code, ')();'], {type: 'text/javascript'}))); - } - - var IS_WORKER = !global.document && !!global.postMessage, - IS_PAPA_WORKER = IS_WORKER && /blob:/i.test((global.location || {}).protocol); - var workers = {}, workerIdCounter = 0; - - var Papa = {}; - - Papa.parse = CsvToJson; - Papa.unparse = JsonToCsv; - - Papa.RECORD_SEP = String.fromCharCode(30); - Papa.UNIT_SEP = String.fromCharCode(31); - Papa.BYTE_ORDER_MARK = '\ufeff'; - Papa.BAD_DELIMITERS = ['\r', '\n', '"', Papa.BYTE_ORDER_MARK]; - Papa.WORKERS_SUPPORTED = !IS_WORKER && !!global.Worker; - Papa.NODE_STREAM_INPUT = 1; - - // Configurable chunk sizes for local and remote files, respectively - Papa.LocalChunkSize = 1024 * 1024 * 10; // 10 MB - Papa.RemoteChunkSize = 1024 * 1024 * 5; // 5 MB - Papa.DefaultDelimiter = ','; // Used if not specified and detection fails - - // Exposed for testing and development only - Papa.Parser = Parser; - Papa.ParserHandle = ParserHandle; - Papa.NetworkStreamer = NetworkStreamer; - Papa.FileStreamer = FileStreamer; - Papa.StringStreamer = StringStreamer; - Papa.ReadableStreamStreamer = ReadableStreamStreamer; - if (typeof PAPA_BROWSER_CONTEXT === 'undefined') { - Papa.DuplexStreamStreamer = DuplexStreamStreamer; - } - - if (global.jQuery) - { - var $ = global.jQuery; - $.fn.parse = function(options) - { - var config = options.config || {}; - var queue = []; - - this.each(function(idx) - { - var supported = $(this).prop('tagName').toUpperCase() === 'INPUT' - && $(this).attr('type').toLowerCase() === 'file' - && global.FileReader; - - if (!supported || !this.files || this.files.length === 0) - return true; // continue to next input element - - for (var i = 0; i < this.files.length; i++) - { - queue.push({ - file: this.files[i], - inputElem: this, - instanceConfig: $.extend({}, config) - }); - } - }); - - parseNextFile(); // begin parsing - return this; // maintains chainability - - - function parseNextFile() - { - if (queue.length === 0) - { - if (isFunction(options.complete)) - options.complete(); - return; - } - - var f = queue[0]; - - if (isFunction(options.before)) - { - var returned = options.before(f.file, f.inputElem); - - if (typeof returned === 'object') - { - if (returned.action === 'abort') - { - error('AbortError', f.file, f.inputElem, returned.reason); - return; // Aborts all queued files immediately - } - else if (returned.action === 'skip') - { - fileComplete(); // parse the next file in the queue, if any - return; - } - else if (typeof returned.config === 'object') - f.instanceConfig = $.extend(f.instanceConfig, returned.config); - } - else if (returned === 'skip') - { - fileComplete(); // parse the next file in the queue, if any - return; - } - } - - // Wrap up the user's complete callback, if any, so that ours also gets executed - var userCompleteFunc = f.instanceConfig.complete; - f.instanceConfig.complete = function(results) - { - if (isFunction(userCompleteFunc)) - userCompleteFunc(results, f.file, f.inputElem); - fileComplete(); - }; - - Papa.parse(f.file, f.instanceConfig); - } - - function error(name, file, elem, reason) - { - if (isFunction(options.error)) - options.error({name: name}, file, elem, reason); - } - - function fileComplete() - { - queue.splice(0, 1); - parseNextFile(); - } - }; - } - - - if (IS_PAPA_WORKER) - { - global.onmessage = workerThreadReceivedMessage; - } - - - - - function CsvToJson(_input, _config) - { - _config = _config || {}; - var dynamicTyping = _config.dynamicTyping || false; - if (isFunction(dynamicTyping)) { - _config.dynamicTypingFunction = dynamicTyping; - // Will be filled on first row call - dynamicTyping = {}; - } - _config.dynamicTyping = dynamicTyping; - - _config.transform = isFunction(_config.transform) ? _config.transform : false; - - if (_config.worker && Papa.WORKERS_SUPPORTED) - { - var w = newWorker(); - - w.userStep = _config.step; - w.userChunk = _config.chunk; - w.userComplete = _config.complete; - w.userError = _config.error; - - _config.step = isFunction(_config.step); - _config.chunk = isFunction(_config.chunk); - _config.complete = isFunction(_config.complete); - _config.error = isFunction(_config.error); - delete _config.worker; // prevent infinite loop - - w.postMessage({ - input: _input, - config: _config, - workerId: w.id - }); - - return; - } - - var streamer = null; - if (_input === Papa.NODE_STREAM_INPUT && typeof PAPA_BROWSER_CONTEXT === 'undefined') - { - // create a node Duplex stream for use - // with .pipe - streamer = new DuplexStreamStreamer(_config); - return streamer.getStream(); - } - else if (typeof _input === 'string') - { - if (_config.download) - streamer = new NetworkStreamer(_config); - else - streamer = new StringStreamer(_config); - } - else if (_input.readable === true && isFunction(_input.read) && isFunction(_input.on)) - { - streamer = new ReadableStreamStreamer(_config); - } - else if ((global.File && _input instanceof File) || _input instanceof Object) // ...Safari. (see issue #106) - streamer = new FileStreamer(_config); - - return streamer.stream(_input); - } - - - - - - - function JsonToCsv(_input, _config) - { - // Default configuration - - /** whether to surround every datum with quotes */ - var _quotes = false; - - /** whether to write headers */ - var _writeHeader = true; - - /** delimiting character(s) */ - var _delimiter = ','; - - /** newline character(s) */ - var _newline = '\r\n'; - - /** quote character */ - var _quoteChar = '"'; - - /** escaped quote character, either "" or " */ - var _escapedQuote = _quoteChar + _quoteChar; - - /** whether to skip empty lines */ - var _skipEmptyLines = false; - - /** the columns (keys) we expect when we unparse objects */ - var _columns = null; - - /** whether to prevent outputting cells that can be parsed as formulae by spreadsheet software (Excel and LibreOffice) */ - var _escapeFormulae = false; - - unpackConfig(); - - var quoteCharRegex = new RegExp(escapeRegExp(_quoteChar), 'g'); - - if (typeof _input === 'string') - _input = JSON.parse(_input); - - if (Array.isArray(_input)) - { - if (!_input.length || Array.isArray(_input[0])) - return serialize(null, _input, _skipEmptyLines); - else if (typeof _input[0] === 'object') - return serialize(_columns || objectKeys(_input[0]), _input, _skipEmptyLines); - } - else if (typeof _input === 'object') - { - if (typeof _input.data === 'string') - _input.data = JSON.parse(_input.data); - - if (Array.isArray(_input.data)) - { - if (!_input.fields) - _input.fields = _input.meta && _input.meta.fields; - - if (!_input.fields) - _input.fields = Array.isArray(_input.data[0]) - ? _input.fields - : objectKeys(_input.data[0]); - - if (!(Array.isArray(_input.data[0])) && typeof _input.data[0] !== 'object') - _input.data = [_input.data]; // handles input like [1,2,3] or ['asdf'] - } - - return serialize(_input.fields || [], _input.data || [], _skipEmptyLines); - } - - // Default (any valid paths should return before this) - throw new Error('Unable to serialize unrecognized input'); - - - function unpackConfig() - { - if (typeof _config !== 'object') - return; - - if (typeof _config.delimiter === 'string' - && !Papa.BAD_DELIMITERS.filter(function(value) { return _config.delimiter.indexOf(value) !== -1; }).length) - { - _delimiter = _config.delimiter; - } - - if (typeof _config.quotes === 'boolean' - || typeof _config.quotes === 'function' - || Array.isArray(_config.quotes)) - _quotes = _config.quotes; - - if (typeof _config.skipEmptyLines === 'boolean' - || typeof _config.skipEmptyLines === 'string') - _skipEmptyLines = _config.skipEmptyLines; - - if (typeof _config.newline === 'string') - _newline = _config.newline; - - if (typeof _config.quoteChar === 'string') - _quoteChar = _config.quoteChar; - - if (typeof _config.header === 'boolean') - _writeHeader = _config.header; - - if (Array.isArray(_config.columns)) { - - if (_config.columns.length === 0) throw new Error('Option columns is empty'); - - _columns = _config.columns; - } - - if (_config.escapeChar !== undefined) { - _escapedQuote = _config.escapeChar + _quoteChar; - } - - if (typeof _config.escapeFormulae === 'boolean') - _escapeFormulae = _config.escapeFormulae; - } - - - /** Turns an object's keys into an array */ - function objectKeys(obj) - { - if (typeof obj !== 'object') - return []; - var keys = []; - for (var key in obj) - keys.push(key); - return keys; - } - - /** The double for loop that iterates the data and writes out a CSV string including header row */ - function serialize(fields, data, skipEmptyLines) - { - var csv = ''; - - if (typeof fields === 'string') - fields = JSON.parse(fields); - if (typeof data === 'string') - data = JSON.parse(data); - - var hasHeader = Array.isArray(fields) && fields.length > 0; - var dataKeyedByField = !(Array.isArray(data[0])); - - // If there a header row, write it first - if (hasHeader && _writeHeader) - { - for (var i = 0; i < fields.length; i++) - { - if (i > 0) - csv += _delimiter; - csv += safe(fields[i], i); - } - if (data.length > 0) - csv += _newline; - } - - // Then write out the data - for (var row = 0; row < data.length; row++) - { - var maxCol = hasHeader ? fields.length : data[row].length; - - var emptyLine = false; - var nullLine = hasHeader ? Object.keys(data[row]).length === 0 : data[row].length === 0; - if (skipEmptyLines && !hasHeader) - { - emptyLine = skipEmptyLines === 'greedy' ? data[row].join('').trim() === '' : data[row].length === 1 && data[row][0].length === 0; - } - if (skipEmptyLines === 'greedy' && hasHeader) { - var line = []; - for (var c = 0; c < maxCol; c++) { - var cx = dataKeyedByField ? fields[c] : c; - line.push(data[row][cx]); - } - emptyLine = line.join('').trim() === ''; - } - if (!emptyLine) - { - for (var col = 0; col < maxCol; col++) - { - if (col > 0 && !nullLine) - csv += _delimiter; - var colIdx = hasHeader && dataKeyedByField ? fields[col] : col; - csv += safe(data[row][colIdx], col); - } - if (row < data.length - 1 && (!skipEmptyLines || (maxCol > 0 && !nullLine))) - { - csv += _newline; - } - } - } - return csv; - } - - /** Encloses a value around quotes if needed (makes a value safe for CSV insertion) */ - function safe(str, col) - { - if (typeof str === 'undefined' || str === null) - return ''; - - if (str.constructor === Date) - return JSON.stringify(str).slice(1, 25); - - if (_escapeFormulae === true && typeof str === "string" && (str.match(/^[=+\-@].*$/) !== null)) { - str = "'" + str; - } - - var escapedQuoteStr = str.toString().replace(quoteCharRegex, _escapedQuote); - - var needsQuotes = (typeof _quotes === 'boolean' && _quotes) - || (typeof _quotes === 'function' && _quotes(str, col)) - || (Array.isArray(_quotes) && _quotes[col]) - || hasAny(escapedQuoteStr, Papa.BAD_DELIMITERS) - || escapedQuoteStr.indexOf(_delimiter) > -1 - || escapedQuoteStr.charAt(0) === ' ' - || escapedQuoteStr.charAt(escapedQuoteStr.length - 1) === ' '; - - return needsQuotes ? _quoteChar + escapedQuoteStr + _quoteChar : escapedQuoteStr; - } - - function hasAny(str, substrings) - { - for (var i = 0; i < substrings.length; i++) - if (str.indexOf(substrings[i]) > -1) - return true; - return false; - } - } - - /** ChunkStreamer is the base prototype for various streamer implementations. */ - function ChunkStreamer(config) - { - this._handle = null; - this._finished = false; - this._completed = false; - this._halted = false; - this._input = null; - this._baseIndex = 0; - this._partialLine = ''; - this._rowCount = 0; - this._start = 0; - this._nextChunk = null; - this.isFirstChunk = true; - this._completeResults = { - data: [], - errors: [], - meta: {} - }; - replaceConfig.call(this, config); - - this.parseChunk = function(chunk, isFakeChunk) - { - // First chunk pre-processing - if (this.isFirstChunk && isFunction(this._config.beforeFirstChunk)) - { - var modifiedChunk = this._config.beforeFirstChunk(chunk); - if (modifiedChunk !== undefined) - chunk = modifiedChunk; - } - this.isFirstChunk = false; - this._halted = false; - - // Rejoin the line we likely just split in two by chunking the file - var aggregate = this._partialLine + chunk; - this._partialLine = ''; - - var results = this._handle.parse(aggregate, this._baseIndex, !this._finished); - - if (this._handle.paused() || this._handle.aborted()) { - this._halted = true; - return; - } - - var lastIndex = results.meta.cursor; - - if (!this._finished) - { - this._partialLine = aggregate.substring(lastIndex - this._baseIndex); - this._baseIndex = lastIndex; - } - - if (results && results.data) - this._rowCount += results.data.length; - - var finishedIncludingPreview = this._finished || (this._config.preview && this._rowCount >= this._config.preview); - - if (IS_PAPA_WORKER) - { - global.postMessage({ - results: results, - workerId: Papa.WORKER_ID, - finished: finishedIncludingPreview - }); - } - else if (isFunction(this._config.chunk) && !isFakeChunk) - { - this._config.chunk(results, this._handle); - if (this._handle.paused() || this._handle.aborted()) { - this._halted = true; - return; - } - results = undefined; - this._completeResults = undefined; - } - - if (!this._config.step && !this._config.chunk) { - this._completeResults.data = this._completeResults.data.concat(results.data); - this._completeResults.errors = this._completeResults.errors.concat(results.errors); - this._completeResults.meta = results.meta; - } - - if (!this._completed && finishedIncludingPreview && isFunction(this._config.complete) && (!results || !results.meta.aborted)) { - this._config.complete(this._completeResults, this._input); - this._completed = true; - } - - if (!finishedIncludingPreview && (!results || !results.meta.paused)) - this._nextChunk(); - - return results; - }; - - this._sendError = function(error) - { - if (isFunction(this._config.error)) - this._config.error(error); - else if (IS_PAPA_WORKER && this._config.error) - { - global.postMessage({ - workerId: Papa.WORKER_ID, - error: error, - finished: false - }); - } - }; - - function replaceConfig(config) - { - // Deep-copy the config so we can edit it - var configCopy = copy(config); - configCopy.chunkSize = parseInt(configCopy.chunkSize); // parseInt VERY important so we don't concatenate strings! - if (!config.step && !config.chunk) - configCopy.chunkSize = null; // disable Range header if not streaming; bad values break IIS - see issue #196 - this._handle = new ParserHandle(configCopy); - this._handle.streamer = this; - this._config = configCopy; // persist the copy to the caller - } - } - - - function NetworkStreamer(config) - { - config = config || {}; - if (!config.chunkSize) - config.chunkSize = Papa.RemoteChunkSize; - ChunkStreamer.call(this, config); - - var xhr; - - if (IS_WORKER) - { - this._nextChunk = function() - { - this._readChunk(); - this._chunkLoaded(); - }; - } - else - { - this._nextChunk = function() - { - this._readChunk(); - }; - } - - this.stream = function(url) - { - this._input = url; - this._nextChunk(); // Starts streaming - }; - - this._readChunk = function() - { - if (this._finished) - { - this._chunkLoaded(); - return; - } - - xhr = new XMLHttpRequest(); - - if (this._config.withCredentials) - { - xhr.withCredentials = this._config.withCredentials; - } - - if (!IS_WORKER) - { - xhr.onload = bindFunction(this._chunkLoaded, this); - xhr.onerror = bindFunction(this._chunkError, this); - } - - xhr.open(this._config.downloadRequestBody ? 'POST' : 'GET', this._input, !IS_WORKER); - // Headers can only be set when once the request state is OPENED - if (this._config.downloadRequestHeaders) - { - var headers = this._config.downloadRequestHeaders; - - for (var headerName in headers) - { - xhr.setRequestHeader(headerName, headers[headerName]); - } - } - - if (this._config.chunkSize) - { - var end = this._start + this._config.chunkSize - 1; // minus one because byte range is inclusive - xhr.setRequestHeader('Range', 'bytes=' + this._start + '-' + end); - } - - try { - xhr.send(this._config.downloadRequestBody); - } - catch (err) { - this._chunkError(err.message); - } - - if (IS_WORKER && xhr.status === 0) - this._chunkError(); - }; - - this._chunkLoaded = function() - { - if (xhr.readyState !== 4) - return; - - if (xhr.status < 200 || xhr.status >= 400) - { - this._chunkError(); - return; - } - - // Use chunckSize as it may be a diference on reponse lentgh due to characters with more than 1 byte - this._start += this._config.chunkSize ? this._config.chunkSize : xhr.responseText.length; - this._finished = !this._config.chunkSize || this._start >= getFileSize(xhr); - this.parseChunk(xhr.responseText); - }; - - this._chunkError = function(errorMessage) - { - var errorText = xhr.statusText || errorMessage; - this._sendError(new Error(errorText)); - }; - - function getFileSize(xhr) - { - var contentRange = xhr.getResponseHeader('Content-Range'); - if (contentRange === null) { // no content range, then finish! - return -1; - } - return parseInt(contentRange.substring(contentRange.lastIndexOf('/') + 1)); - } - } - NetworkStreamer.prototype = Object.create(ChunkStreamer.prototype); - NetworkStreamer.prototype.constructor = NetworkStreamer; - - - function FileStreamer(config) - { - config = config || {}; - if (!config.chunkSize) - config.chunkSize = Papa.LocalChunkSize; - ChunkStreamer.call(this, config); - - var reader, slice; - - // FileReader is better than FileReaderSync (even in worker) - see http://stackoverflow.com/q/24708649/1048862 - // But Firefox is a pill, too - see issue #76: https://github.com/mholt/PapaParse/issues/76 - var usingAsyncReader = typeof FileReader !== 'undefined'; // Safari doesn't consider it a function - see issue #105 - - this.stream = function(file) - { - this._input = file; - slice = file.slice || file.webkitSlice || file.mozSlice; - - if (usingAsyncReader) - { - reader = new FileReader(); // Preferred method of reading files, even in workers - reader.onload = bindFunction(this._chunkLoaded, this); - reader.onerror = bindFunction(this._chunkError, this); - } - else - reader = new FileReaderSync(); // Hack for running in a web worker in Firefox - - this._nextChunk(); // Starts streaming - }; - - this._nextChunk = function() - { - if (!this._finished && (!this._config.preview || this._rowCount < this._config.preview)) - this._readChunk(); - }; - - this._readChunk = function() - { - var input = this._input; - if (this._config.chunkSize) - { - var end = Math.min(this._start + this._config.chunkSize, this._input.size); - input = slice.call(input, this._start, end); - } - var txt = reader.readAsText(input, this._config.encoding); - if (!usingAsyncReader) - this._chunkLoaded({ target: { result: txt } }); // mimic the async signature - }; - - this._chunkLoaded = function(event) - { - // Very important to increment start each time before handling results - this._start += this._config.chunkSize; - this._finished = !this._config.chunkSize || this._start >= this._input.size; - this.parseChunk(event.target.result); - }; - - this._chunkError = function() - { - this._sendError(reader.error); - }; - - } - FileStreamer.prototype = Object.create(ChunkStreamer.prototype); - FileStreamer.prototype.constructor = FileStreamer; - - - function StringStreamer(config) - { - config = config || {}; - ChunkStreamer.call(this, config); - - var remaining; - this.stream = function(s) - { - remaining = s; - return this._nextChunk(); - }; - this._nextChunk = function() - { - if (this._finished) return; - var size = this._config.chunkSize; - var chunk; - if(size) { - chunk = remaining.substring(0, size); - remaining = remaining.substring(size); - } else { - chunk = remaining; - remaining = ''; - } - this._finished = !remaining; - return this.parseChunk(chunk); - }; - } - StringStreamer.prototype = Object.create(StringStreamer.prototype); - StringStreamer.prototype.constructor = StringStreamer; - - - function ReadableStreamStreamer(config) - { - config = config || {}; - - ChunkStreamer.call(this, config); - - var queue = []; - var parseOnData = true; - var streamHasEnded = false; - - this.pause = function() - { - ChunkStreamer.prototype.pause.apply(this, arguments); - this._input.pause(); - }; - - this.resume = function() - { - ChunkStreamer.prototype.resume.apply(this, arguments); - this._input.resume(); - }; - - this.stream = function(stream) - { - this._input = stream; - - this._input.on('data', this._streamData); - this._input.on('end', this._streamEnd); - this._input.on('error', this._streamError); - }; - - this._checkIsFinished = function() - { - if (streamHasEnded && queue.length === 1) { - this._finished = true; - } - }; - - this._nextChunk = function() - { - this._checkIsFinished(); - if (queue.length) - { - this.parseChunk(queue.shift()); - } - else - { - parseOnData = true; - } - }; - - this._streamData = bindFunction(function(chunk) - { - try - { - queue.push(typeof chunk === 'string' ? chunk : chunk.toString(this._config.encoding)); - - if (parseOnData) - { - parseOnData = false; - this._checkIsFinished(); - this.parseChunk(queue.shift()); - } - } - catch (error) - { - this._streamError(error); - } - }, this); - - this._streamError = bindFunction(function(error) - { - this._streamCleanUp(); - this._sendError(error); - }, this); - - this._streamEnd = bindFunction(function() - { - this._streamCleanUp(); - streamHasEnded = true; - this._streamData(''); - }, this); - - this._streamCleanUp = bindFunction(function() - { - this._input.removeListener('data', this._streamData); - this._input.removeListener('end', this._streamEnd); - this._input.removeListener('error', this._streamError); - }, this); - } - ReadableStreamStreamer.prototype = Object.create(ChunkStreamer.prototype); - ReadableStreamStreamer.prototype.constructor = ReadableStreamStreamer; - - - function DuplexStreamStreamer(_config) { - var Duplex = require('stream').Duplex; - var config = copy(_config); - var parseOnWrite = true; - var writeStreamHasFinished = false; - var parseCallbackQueue = []; - var stream = null; - - this._onCsvData = function(results) - { - var data = results.data; - if (!stream.push(data) && !this._handle.paused()) { - // the writeable consumer buffer has filled up - // so we need to pause until more items - // can be processed - this._handle.pause(); - } - }; - - this._onCsvComplete = function() - { - // node will finish the read stream when - // null is pushed - stream.push(null); - }; - - config.step = bindFunction(this._onCsvData, this); - config.complete = bindFunction(this._onCsvComplete, this); - ChunkStreamer.call(this, config); - - this._nextChunk = function() - { - if (writeStreamHasFinished && parseCallbackQueue.length === 1) { - this._finished = true; - } - if (parseCallbackQueue.length) { - parseCallbackQueue.shift()(); - } else { - parseOnWrite = true; - } - }; - - this._addToParseQueue = function(chunk, callback) - { - // add to queue so that we can indicate - // completion via callback - // node will automatically pause the incoming stream - // when too many items have been added without their - // callback being invoked - parseCallbackQueue.push(bindFunction(function() { - this.parseChunk(typeof chunk === 'string' ? chunk : chunk.toString(config.encoding)); - if (isFunction(callback)) { - return callback(); - } - }, this)); - if (parseOnWrite) { - parseOnWrite = false; - this._nextChunk(); - } - }; - - this._onRead = function() - { - if (this._handle.paused()) { - // the writeable consumer can handle more data - // so resume the chunk parsing - this._handle.resume(); - } - }; - - this._onWrite = function(chunk, encoding, callback) - { - this._addToParseQueue(chunk, callback); - }; - - this._onWriteComplete = function() - { - writeStreamHasFinished = true; - // have to write empty string - // so parser knows its done - this._addToParseQueue(''); - }; - - this.getStream = function() - { - return stream; - }; - stream = new Duplex({ - readableObjectMode: true, - decodeStrings: false, - read: bindFunction(this._onRead, this), - write: bindFunction(this._onWrite, this) - }); - stream.once('finish', bindFunction(this._onWriteComplete, this)); - } - if (typeof PAPA_BROWSER_CONTEXT === 'undefined') { - DuplexStreamStreamer.prototype = Object.create(ChunkStreamer.prototype); - DuplexStreamStreamer.prototype.constructor = DuplexStreamStreamer; - } - - - // Use one ParserHandle per entire CSV file or string - function ParserHandle(_config) - { - // One goal is to minimize the use of regular expressions... - var MAX_FLOAT = Math.pow(2, 53); - var MIN_FLOAT = -MAX_FLOAT; - var FLOAT = /^\s*-?(\d+\.?|\.\d+|\d+\.\d+)(e[-+]?\d+)?\s*$/; - var ISO_DATE = /(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/; - var self = this; - var _stepCounter = 0; // Number of times step was called (number of rows parsed) - var _rowCounter = 0; // Number of rows that have been parsed so far - var _input; // The input being parsed - var _parser; // The core parser being used - var _paused = false; // Whether we are paused or not - var _aborted = false; // Whether the parser has aborted or not - var _delimiterError; // Temporary state between delimiter detection and processing results - var _fields = []; // Fields are from the header row of the input, if there is one - var _results = { // The last results returned from the parser - data: [], - errors: [], - meta: {} - }; - - if (isFunction(_config.step)) - { - var userStep = _config.step; - _config.step = function(results) - { - _results = results; - - if (needsHeaderRow()) - processResults(); - else // only call user's step function after header row - { - processResults(); - - // It's possbile that this line was empty and there's no row here after all - if (_results.data.length === 0) - return; - - _stepCounter += results.data.length; - if (_config.preview && _stepCounter > _config.preview) - _parser.abort(); - else { - _results.data = _results.data[0]; - userStep(_results, self); - } - } - }; - } - - /** - * Parses input. Most users won't need, and shouldn't mess with, the baseIndex - * and ignoreLastRow parameters. They are used by streamers (wrapper functions) - * when an input comes in multiple chunks, like from a file. - */ - this.parse = function(input, baseIndex, ignoreLastRow) - { - var quoteChar = _config.quoteChar || '"'; - if (!_config.newline) - _config.newline = guessLineEndings(input, quoteChar); - - _delimiterError = false; - if (!_config.delimiter) - { - var delimGuess = guessDelimiter(input, _config.newline, _config.skipEmptyLines, _config.comments, _config.delimitersToGuess); - if (delimGuess.successful) - _config.delimiter = delimGuess.bestDelimiter; - else - { - _delimiterError = true; // add error after parsing (otherwise it would be overwritten) - _config.delimiter = Papa.DefaultDelimiter; - } - _results.meta.delimiter = _config.delimiter; - } - else if(isFunction(_config.delimiter)) - { - _config.delimiter = _config.delimiter(input); - _results.meta.delimiter = _config.delimiter; - } - - var parserConfig = copy(_config); - if (_config.preview && _config.header) - parserConfig.preview++; // to compensate for header row - - _input = input; - _parser = new Parser(parserConfig); - _results = _parser.parse(_input, baseIndex, ignoreLastRow); - processResults(); - return _paused ? { meta: { paused: true } } : (_results || { meta: { paused: false } }); - }; - - this.paused = function() - { - return _paused; - }; - - this.pause = function() - { - _paused = true; - _parser.abort(); - - // If it is streaming via "chunking", the reader will start appending correctly already so no need to substring, - // otherwise we can get duplicate content within a row - _input = isFunction(_config.chunk) ? "" : _input.substring(_parser.getCharIndex()); - }; - - this.resume = function() - { - if(self.streamer._halted) { - _paused = false; - self.streamer.parseChunk(_input, true); - } else { - // Bugfix: #636 In case the processing hasn't halted yet - // wait for it to halt in order to resume - setTimeout(self.resume, 3); - } - }; - - this.aborted = function() - { - return _aborted; - }; - - this.abort = function() - { - _aborted = true; - _parser.abort(); - _results.meta.aborted = true; - if (isFunction(_config.complete)) - _config.complete(_results); - _input = ''; - }; - - function testEmptyLine(s) { - return _config.skipEmptyLines === 'greedy' ? s.join('').trim() === '' : s.length === 1 && s[0].length === 0; - } - - function testFloat(s) { - if (FLOAT.test(s)) { - var floatValue = parseFloat(s); - if (floatValue > MIN_FLOAT && floatValue < MAX_FLOAT) { - return true; - } - } - return false; - } - - function processResults() - { - if (_results && _delimiterError) - { - addError('Delimiter', 'UndetectableDelimiter', 'Unable to auto-detect delimiting character; defaulted to \'' + Papa.DefaultDelimiter + '\''); - _delimiterError = false; - } - - if (_config.skipEmptyLines) - { - for (var i = 0; i < _results.data.length; i++) - if (testEmptyLine(_results.data[i])) - _results.data.splice(i--, 1); - } - - if (needsHeaderRow()) - fillHeaderFields(); - - return applyHeaderAndDynamicTypingAndTransformation(); - } - - function needsHeaderRow() - { - return _config.header && _fields.length === 0; - } - - function fillHeaderFields() - { - if (!_results) - return; - - function addHeader(header, i) - { - if (isFunction(_config.transformHeader)) - header = _config.transformHeader(header, i); - - _fields.push(header); - } - - if (Array.isArray(_results.data[0])) - { - for (var i = 0; needsHeaderRow() && i < _results.data.length; i++) - _results.data[i].forEach(addHeader); - - _results.data.splice(0, 1); - } - // if _results.data[0] is not an array, we are in a step where _results.data is the row. - else - _results.data.forEach(addHeader); - } - - function shouldApplyDynamicTyping(field) { - // Cache function values to avoid calling it for each row - if (_config.dynamicTypingFunction && _config.dynamicTyping[field] === undefined) { - _config.dynamicTyping[field] = _config.dynamicTypingFunction(field); - } - return (_config.dynamicTyping[field] || _config.dynamicTyping) === true; - } - - function parseDynamic(field, value) - { - if (shouldApplyDynamicTyping(field)) - { - if (value === 'true' || value === 'TRUE') - return true; - else if (value === 'false' || value === 'FALSE') - return false; - else if (testFloat(value)) - return parseFloat(value); - else if (ISO_DATE.test(value)) - return new Date(value); - else - return (value === '' ? null : value); - } - return value; - } - - function applyHeaderAndDynamicTypingAndTransformation() - { - if (!_results || (!_config.header && !_config.dynamicTyping && !_config.transform)) - return _results; - - function processRow(rowSource, i) - { - var row = _config.header ? {} : []; - - var j; - for (j = 0; j < rowSource.length; j++) - { - var field = j; - var value = rowSource[j]; - - if (_config.header) - field = j >= _fields.length ? '__parsed_extra' : _fields[j]; - - if (_config.transform) - value = _config.transform(value,field); - - value = parseDynamic(field, value); - - if (field === '__parsed_extra') - { - row[field] = row[field] || []; - row[field].push(value); - } - else - row[field] = value; - } - - - if (_config.header) - { - if (j > _fields.length) - addError('FieldMismatch', 'TooManyFields', 'Too many fields: expected ' + _fields.length + ' fields but parsed ' + j, _rowCounter + i); - else if (j < _fields.length) - addError('FieldMismatch', 'TooFewFields', 'Too few fields: expected ' + _fields.length + ' fields but parsed ' + j, _rowCounter + i); - } - - return row; - } - - var incrementBy = 1; - if (!_results.data.length || Array.isArray(_results.data[0])) - { - _results.data = _results.data.map(processRow); - incrementBy = _results.data.length; - } - else - _results.data = processRow(_results.data, 0); - - - if (_config.header && _results.meta) - _results.meta.fields = _fields; - - _rowCounter += incrementBy; - return _results; - } - - function guessDelimiter(input, newline, skipEmptyLines, comments, delimitersToGuess) { - var bestDelim, bestDelta, fieldCountPrevRow, maxFieldCount; - - delimitersToGuess = delimitersToGuess || [',', '\t', '|', ';', Papa.RECORD_SEP, Papa.UNIT_SEP]; - - for (var i = 0; i < delimitersToGuess.length; i++) { - var delim = delimitersToGuess[i]; - var delta = 0, avgFieldCount = 0, emptyLinesCount = 0; - fieldCountPrevRow = undefined; - - var preview = new Parser({ - comments: comments, - delimiter: delim, - newline: newline, - preview: 10 - }).parse(input); - - for (var j = 0; j < preview.data.length; j++) { - if (skipEmptyLines && testEmptyLine(preview.data[j])) { - emptyLinesCount++; - continue; - } - var fieldCount = preview.data[j].length; - avgFieldCount += fieldCount; - - if (typeof fieldCountPrevRow === 'undefined') { - fieldCountPrevRow = fieldCount; - continue; - } - else if (fieldCount > 0) { - delta += Math.abs(fieldCount - fieldCountPrevRow); - fieldCountPrevRow = fieldCount; - } - } - - if (preview.data.length > 0) - avgFieldCount /= (preview.data.length - emptyLinesCount); - - if ((typeof bestDelta === 'undefined' || delta <= bestDelta) - && (typeof maxFieldCount === 'undefined' || avgFieldCount > maxFieldCount) && avgFieldCount > 1.99) { - bestDelta = delta; - bestDelim = delim; - maxFieldCount = avgFieldCount; - } - } - - _config.delimiter = bestDelim; - - return { - successful: !!bestDelim, - bestDelimiter: bestDelim - }; - } - - function guessLineEndings(input, quoteChar) - { - input = input.substring(0, 1024 * 1024); // max length 1 MB - // Replace all the text inside quotes - var re = new RegExp(escapeRegExp(quoteChar) + '([^]*?)' + escapeRegExp(quoteChar), 'gm'); - input = input.replace(re, ''); - - var r = input.split('\r'); - - var n = input.split('\n'); - - var nAppearsFirst = (n.length > 1 && n[0].length < r[0].length); - - if (r.length === 1 || nAppearsFirst) - return '\n'; - - var numWithN = 0; - for (var i = 0; i < r.length; i++) - { - if (r[i][0] === '\n') - numWithN++; - } - - return numWithN >= r.length / 2 ? '\r\n' : '\r'; - } - - function addError(type, code, msg, row) - { - var error = { - type: type, - code: code, - message: msg - }; - if(row !== undefined) { - error.row = row; - } - _results.errors.push(error); - } - } - - /** https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions */ - function escapeRegExp(string) - { - return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string - } - - /** The core parser implements speedy and correct CSV parsing */ - function Parser(config) - { - // Unpack the config object - config = config || {}; - var delim = config.delimiter; - var newline = config.newline; - var comments = config.comments; - var step = config.step; - var preview = config.preview; - var fastMode = config.fastMode; - var quoteChar; - /** Allows for no quoteChar by setting quoteChar to undefined in config */ - if (config.quoteChar === undefined) { - quoteChar = '"'; - } else { - quoteChar = config.quoteChar; - } - var escapeChar = quoteChar; - if (config.escapeChar !== undefined) { - escapeChar = config.escapeChar; - } - - // Delimiter must be valid - if (typeof delim !== 'string' - || Papa.BAD_DELIMITERS.indexOf(delim) > -1) - delim = ','; - - // Comment character must be valid - if (comments === delim) - throw new Error('Comment character same as delimiter'); - else if (comments === true) - comments = '#'; - else if (typeof comments !== 'string' - || Papa.BAD_DELIMITERS.indexOf(comments) > -1) - comments = false; - - // Newline must be valid: \r, \n, or \r\n - if (newline !== '\n' && newline !== '\r' && newline !== '\r\n') - newline = '\n'; - - // We're gonna need these at the Parser scope - var cursor = 0; - var aborted = false; - - this.parse = function(input, baseIndex, ignoreLastRow) - { - // For some reason, in Chrome, this speeds things up (!?) - if (typeof input !== 'string') - throw new Error('Input must be a string'); - - // We don't need to compute some of these every time parse() is called, - // but having them in a more local scope seems to perform better - var inputLen = input.length, - delimLen = delim.length, - newlineLen = newline.length, - commentsLen = comments.length; - var stepIsFunction = isFunction(step); - - // Establish starting state - cursor = 0; - var data = [], errors = [], row = [], lastCursor = 0; - - if (!input) - return returnable(); - - if (fastMode || (fastMode !== false && input.indexOf(quoteChar) === -1)) - { - var rows = input.split(newline); - for (var i = 0; i < rows.length; i++) - { - row = rows[i]; - cursor += row.length; - if (i !== rows.length - 1) - cursor += newline.length; - else if (ignoreLastRow) - return returnable(); - if (comments && row.substring(0, commentsLen) === comments) - continue; - if (stepIsFunction) - { - data = []; - pushRow(row.split(delim)); - doStep(); - if (aborted) - return returnable(); - } - else - pushRow(row.split(delim)); - if (preview && i >= preview) - { - data = data.slice(0, preview); - return returnable(true); - } - } - return returnable(); - } - - var nextDelim = input.indexOf(delim, cursor); - var nextNewline = input.indexOf(newline, cursor); - var quoteCharRegex = new RegExp(escapeRegExp(escapeChar) + escapeRegExp(quoteChar), 'g'); - var quoteSearch = input.indexOf(quoteChar, cursor); - - // Parser loop - for (;;) - { - // Field has opening quote - if (input[cursor] === quoteChar) - { - // Start our search for the closing quote where the cursor is - quoteSearch = cursor; - - // Skip the opening quote - cursor++; - - for (;;) - { - // Find closing quote - quoteSearch = input.indexOf(quoteChar, quoteSearch + 1); - - //No other quotes are found - no other delimiters - if (quoteSearch === -1) - { - if (!ignoreLastRow) { - // No closing quote... what a pity - errors.push({ - type: 'Quotes', - code: 'MissingQuotes', - message: 'Quoted field unterminated', - row: data.length, // row has yet to be inserted - index: cursor - }); - } - return finish(); - } - - // Closing quote at EOF - if (quoteSearch === inputLen - 1) - { - var value = input.substring(cursor, quoteSearch).replace(quoteCharRegex, quoteChar); - return finish(value); - } - - // If this quote is escaped, it's part of the data; skip it - // If the quote character is the escape character, then check if the next character is the escape character - if (quoteChar === escapeChar && input[quoteSearch + 1] === escapeChar) - { - quoteSearch++; - continue; - } - - // If the quote character is not the escape character, then check if the previous character was the escape character - if (quoteChar !== escapeChar && quoteSearch !== 0 && input[quoteSearch - 1] === escapeChar) - { - continue; - } - - if(nextDelim !== -1 && nextDelim < (quoteSearch + 1)) { - nextDelim = input.indexOf(delim, (quoteSearch + 1)); - } - if(nextNewline !== -1 && nextNewline < (quoteSearch + 1)) { - nextNewline = input.indexOf(newline, (quoteSearch + 1)); - } - // Check up to nextDelim or nextNewline, whichever is closest - var checkUpTo = nextNewline === -1 ? nextDelim : Math.min(nextDelim, nextNewline); - var spacesBetweenQuoteAndDelimiter = extraSpaces(checkUpTo); - - // Closing quote followed by delimiter or 'unnecessary spaces + delimiter' - if (input[quoteSearch + 1 + spacesBetweenQuoteAndDelimiter] === delim) - { - row.push(input.substring(cursor, quoteSearch).replace(quoteCharRegex, quoteChar)); - cursor = quoteSearch + 1 + spacesBetweenQuoteAndDelimiter + delimLen; - - // If char after following delimiter is not quoteChar, we find next quote char position - if (input[quoteSearch + 1 + spacesBetweenQuoteAndDelimiter + delimLen] !== quoteChar) - { - quoteSearch = input.indexOf(quoteChar, cursor); - } - nextDelim = input.indexOf(delim, cursor); - nextNewline = input.indexOf(newline, cursor); - break; - } - - var spacesBetweenQuoteAndNewLine = extraSpaces(nextNewline); - - // Closing quote followed by newline or 'unnecessary spaces + newLine' - if (input.substring(quoteSearch + 1 + spacesBetweenQuoteAndNewLine, quoteSearch + 1 + spacesBetweenQuoteAndNewLine + newlineLen) === newline) - { - row.push(input.substring(cursor, quoteSearch).replace(quoteCharRegex, quoteChar)); - saveRow(quoteSearch + 1 + spacesBetweenQuoteAndNewLine + newlineLen); - nextDelim = input.indexOf(delim, cursor); // because we may have skipped the nextDelim in the quoted field - quoteSearch = input.indexOf(quoteChar, cursor); // we search for first quote in next line - - if (stepIsFunction) - { - doStep(); - if (aborted) - return returnable(); - } - - if (preview && data.length >= preview) - return returnable(true); - - break; - } - - - // Checks for valid closing quotes are complete (escaped quotes or quote followed by EOF/delimiter/newline) -- assume these quotes are part of an invalid text string - errors.push({ - type: 'Quotes', - code: 'InvalidQuotes', - message: 'Trailing quote on quoted field is malformed', - row: data.length, // row has yet to be inserted - index: cursor - }); - - quoteSearch++; - continue; - - } - - continue; - } - - // Comment found at start of new line - if (comments && row.length === 0 && input.substring(cursor, cursor + commentsLen) === comments) - { - if (nextNewline === -1) // Comment ends at EOF - return returnable(); - cursor = nextNewline + newlineLen; - nextNewline = input.indexOf(newline, cursor); - nextDelim = input.indexOf(delim, cursor); - continue; - } - - // Next delimiter comes before next newline, so we've reached end of field - if (nextDelim !== -1 && (nextDelim < nextNewline || nextNewline === -1)) - { - // we check, if we have quotes, because delimiter char may be part of field enclosed in quotes - if (quoteSearch > nextDelim) { - // we have quotes, so we try to find the next delimiter not enclosed in quotes and also next starting quote char - var nextDelimObj = getNextUnquotedDelimiter(nextDelim, quoteSearch, nextNewline); - - // if we have next delimiter char which is not enclosed in quotes - if (nextDelimObj && typeof nextDelimObj.nextDelim !== 'undefined') { - nextDelim = nextDelimObj.nextDelim; - quoteSearch = nextDelimObj.quoteSearch; - row.push(input.substring(cursor, nextDelim)); - cursor = nextDelim + delimLen; - // we look for next delimiter char - nextDelim = input.indexOf(delim, cursor); - continue; - } - } else { - row.push(input.substring(cursor, nextDelim)); - cursor = nextDelim + delimLen; - nextDelim = input.indexOf(delim, cursor); - continue; - } - } - - // End of row - if (nextNewline !== -1) - { - row.push(input.substring(cursor, nextNewline)); - saveRow(nextNewline + newlineLen); - - if (stepIsFunction) - { - doStep(); - if (aborted) - return returnable(); - } - - if (preview && data.length >= preview) - return returnable(true); - - continue; - } - - break; - } - - - return finish(); - - - function pushRow(row) - { - data.push(row); - lastCursor = cursor; - } - - /** - * checks if there are extra spaces after closing quote and given index without any text - * if Yes, returns the number of spaces - */ - function extraSpaces(index) { - var spaceLength = 0; - if (index !== -1) { - var textBetweenClosingQuoteAndIndex = input.substring(quoteSearch + 1, index); - if (textBetweenClosingQuoteAndIndex && textBetweenClosingQuoteAndIndex.trim() === '') { - spaceLength = textBetweenClosingQuoteAndIndex.length; - } - } - return spaceLength; - } - - /** - * Appends the remaining input from cursor to the end into - * row, saves the row, calls step, and returns the results. - */ - function finish(value) - { - if (ignoreLastRow) - return returnable(); - if (typeof value === 'undefined') - value = input.substring(cursor); - row.push(value); - cursor = inputLen; // important in case parsing is paused - pushRow(row); - if (stepIsFunction) - doStep(); - return returnable(); - } - - /** - * Appends the current row to the results. It sets the cursor - * to newCursor and finds the nextNewline. The caller should - * take care to execute user's step function and check for - * preview and end parsing if necessary. - */ - function saveRow(newCursor) - { - cursor = newCursor; - pushRow(row); - row = []; - nextNewline = input.indexOf(newline, cursor); - } - - /** Returns an object with the results, errors, and meta. */ - function returnable(stopped) - { - return { - data: data, - errors: errors, - meta: { - delimiter: delim, - linebreak: newline, - aborted: aborted, - truncated: !!stopped, - cursor: lastCursor + (baseIndex || 0) - } - }; - } - - /** Executes the user's step function and resets data & errors. */ - function doStep() - { - step(returnable()); - data = []; - errors = []; - } - - /** Gets the delimiter character, which is not inside the quoted field */ - function getNextUnquotedDelimiter(nextDelim, quoteSearch, newLine) { - var result = { - nextDelim: undefined, - quoteSearch: undefined - }; - // get the next closing quote character - var nextQuoteSearch = input.indexOf(quoteChar, quoteSearch + 1); - - // if next delimiter is part of a field enclosed in quotes - if (nextDelim > quoteSearch && nextDelim < nextQuoteSearch && (nextQuoteSearch < newLine || newLine === -1)) { - // get the next delimiter character after this one - var nextNextDelim = input.indexOf(delim, nextQuoteSearch); - - // if there is no next delimiter, return default result - if (nextNextDelim === -1) { - return result; - } - // find the next opening quote char position - if (nextNextDelim > nextQuoteSearch) { - nextQuoteSearch = input.indexOf(quoteChar, nextQuoteSearch + 1); - } - // try to get the next delimiter position - result = getNextUnquotedDelimiter(nextNextDelim, nextQuoteSearch, newLine); - } else { - result = { - nextDelim: nextDelim, - quoteSearch: quoteSearch - }; - } - - return result; - } - }; - - /** Sets the abort flag */ - this.abort = function() - { - aborted = true; - }; - - /** Gets the cursor position */ - this.getCharIndex = function() - { - return cursor; - }; - } - - - function newWorker() - { - if (!Papa.WORKERS_SUPPORTED) - return false; - - var workerUrl = getWorkerBlob(); - var w = new global.Worker(workerUrl); - w.onmessage = mainThreadReceivedMessage; - w.id = workerIdCounter++; - workers[w.id] = w; - return w; - } - - /** Callback when main thread receives a message */ - function mainThreadReceivedMessage(e) - { - var msg = e.data; - var worker = workers[msg.workerId]; - var aborted = false; - - if (msg.error) - worker.userError(msg.error, msg.file); - else if (msg.results && msg.results.data) - { - var abort = function() { - aborted = true; - completeWorker(msg.workerId, { data: [], errors: [], meta: { aborted: true } }); - }; - - var handle = { - abort: abort, - pause: notImplemented, - resume: notImplemented - }; - - if (isFunction(worker.userStep)) - { - for (var i = 0; i < msg.results.data.length; i++) - { - worker.userStep({ - data: msg.results.data[i], - errors: msg.results.errors, - meta: msg.results.meta - }, handle); - if (aborted) - break; - } - delete msg.results; // free memory ASAP - } - else if (isFunction(worker.userChunk)) - { - worker.userChunk(msg.results, handle, msg.file); - delete msg.results; - } - } - - if (msg.finished && !aborted) - completeWorker(msg.workerId, msg.results); - } - - function completeWorker(workerId, results) { - var worker = workers[workerId]; - if (isFunction(worker.userComplete)) - worker.userComplete(results); - worker.terminate(); - delete workers[workerId]; - } - - function notImplemented() { - throw new Error('Not implemented.'); - } - - /** Callback when worker thread receives a message */ - function workerThreadReceivedMessage(e) - { - var msg = e.data; - - if (typeof Papa.WORKER_ID === 'undefined' && msg) - Papa.WORKER_ID = msg.workerId; - - if (typeof msg.input === 'string') - { - global.postMessage({ - workerId: Papa.WORKER_ID, - results: Papa.parse(msg.input, msg.config), - finished: true - }); - } - else if ((global.File && msg.input instanceof File) || msg.input instanceof Object) // thank you, Safari (see issue #106) - { - var results = Papa.parse(msg.input, msg.config); - if (results) - global.postMessage({ - workerId: Papa.WORKER_ID, - results: results, - finished: true - }); - } - } - - /** Makes a deep copy of an array or object (mostly) */ - function copy(obj) - { - if (typeof obj !== 'object' || obj === null) - return obj; - var cpy = Array.isArray(obj) ? [] : {}; - for (var key in obj) - cpy[key] = copy(obj[key]); - return cpy; - } - - function bindFunction(f, self) - { - return function() { f.apply(self, arguments); }; - } - - function isFunction(func) - { - return typeof func === 'function'; - } - - return Papa; -})); diff --git a/node_modules/papaparse/papaparse.min.js b/node_modules/papaparse/papaparse.min.js deleted file mode 100644 index a92afc1..0000000 --- a/node_modules/papaparse/papaparse.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/* @license -Papa Parse -v5.3.0 -https://github.com/mholt/PapaParse -License: MIT -*/ -!function(e,t){"function"==typeof define&&define.amd?define([],t):"object"==typeof module&&"undefined"!=typeof exports?module.exports=t():e.Papa=t()}(this,function s(){"use strict";var f="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==f?f:{};var n=!f.document&&!!f.postMessage,o=n&&/blob:/i.test((f.location||{}).protocol),a={},h=0,b={parse:function(e,t){var i=(t=t||{}).dynamicTyping||!1;U(i)&&(t.dynamicTypingFunction=i,i={});if(t.dynamicTyping=i,t.transform=!!U(t.transform)&&t.transform,t.worker&&b.WORKERS_SUPPORTED){var r=function(){if(!b.WORKERS_SUPPORTED)return!1;var e=(i=f.URL||f.webkitURL||null,r=s.toString(),b.BLOB_URL||(b.BLOB_URL=i.createObjectURL(new Blob(["(",r,")();"],{type:"text/javascript"})))),t=new f.Worker(e);var i,r;return t.onmessage=m,t.id=h++,a[t.id]=t}();return r.userStep=t.step,r.userChunk=t.chunk,r.userComplete=t.complete,r.userError=t.error,t.step=U(t.step),t.chunk=U(t.chunk),t.complete=U(t.complete),t.error=U(t.error),delete t.worker,void r.postMessage({input:e,config:t,workerId:r.id})}var n=null;b.NODE_STREAM_INPUT,"string"==typeof e?n=t.download?new l(t):new p(t):!0===e.readable&&U(e.read)&&U(e.on)?n=new g(t):(f.File&&e instanceof File||e instanceof Object)&&(n=new c(t));return n.stream(e)},unparse:function(e,t){var n=!1,m=!0,_=",",v="\r\n",s='"',a=s+s,i=!1,r=null,o=!1;!function(){if("object"!=typeof t)return;"string"!=typeof t.delimiter||b.BAD_DELIMITERS.filter(function(e){return-1!==t.delimiter.indexOf(e)}).length||(_=t.delimiter);("boolean"==typeof t.quotes||"function"==typeof t.quotes||Array.isArray(t.quotes))&&(n=t.quotes);"boolean"!=typeof t.skipEmptyLines&&"string"!=typeof t.skipEmptyLines||(i=t.skipEmptyLines);"string"==typeof t.newline&&(v=t.newline);"string"==typeof t.quoteChar&&(s=t.quoteChar);"boolean"==typeof t.header&&(m=t.header);if(Array.isArray(t.columns)){if(0===t.columns.length)throw new Error("Option columns is empty");r=t.columns}void 0!==t.escapeChar&&(a=t.escapeChar+s);"boolean"==typeof t.escapeFormulae&&(o=t.escapeFormulae)}();var h=new RegExp(q(s),"g");"string"==typeof e&&(e=JSON.parse(e));if(Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return f(null,e,i);if("object"==typeof e[0])return f(r||u(e[0]),e,i)}else if("object"==typeof e)return"string"==typeof e.data&&(e.data=JSON.parse(e.data)),Array.isArray(e.data)&&(e.fields||(e.fields=e.meta&&e.meta.fields),e.fields||(e.fields=Array.isArray(e.data[0])?e.fields:u(e.data[0])),Array.isArray(e.data[0])||"object"==typeof e.data[0]||(e.data=[e.data])),f(e.fields||[],e.data||[],i);throw new Error("Unable to serialize unrecognized input");function u(e){if("object"!=typeof e)return[];var t=[];for(var i in e)t.push(i);return t}function f(e,t,i){var r="";"string"==typeof e&&(e=JSON.parse(e)),"string"==typeof t&&(t=JSON.parse(t));var n=Array.isArray(e)&&0=this._config.preview;if(o)f.postMessage({results:n,workerId:b.WORKER_ID,finished:a});else if(U(this._config.chunk)&&!t){if(this._config.chunk(n,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);n=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(n.data),this._completeResults.errors=this._completeResults.errors.concat(n.errors),this._completeResults.meta=n.meta),this._completed||!a||!U(this._config.complete)||n&&n.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),a||n&&n.meta.paused||this._nextChunk(),n}this._halted=!0},this._sendError=function(e){U(this._config.error)?this._config.error(e):o&&this._config.error&&f.postMessage({workerId:b.WORKER_ID,error:e,finished:!1})}}function l(e){var r;(e=e||{}).chunkSize||(e.chunkSize=b.RemoteChunkSize),u.call(this,e),this._nextChunk=n?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(e){this._input=e,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(r=new XMLHttpRequest,this._config.withCredentials&&(r.withCredentials=this._config.withCredentials),n||(r.onload=y(this._chunkLoaded,this),r.onerror=y(this._chunkError,this)),r.open(this._config.downloadRequestBody?"POST":"GET",this._input,!n),this._config.downloadRequestHeaders){var e=this._config.downloadRequestHeaders;for(var t in e)r.setRequestHeader(t,e[t])}if(this._config.chunkSize){var i=this._start+this._config.chunkSize-1;r.setRequestHeader("Range","bytes="+this._start+"-"+i)}try{r.send(this._config.downloadRequestBody)}catch(e){this._chunkError(e.message)}n&&0===r.status&&this._chunkError()}},this._chunkLoaded=function(){4===r.readyState&&(r.status<200||400<=r.status?this._chunkError():(this._start+=this._config.chunkSize?this._config.chunkSize:r.responseText.length,this._finished=!this._config.chunkSize||this._start>=function(e){var t=e.getResponseHeader("Content-Range");if(null===t)return-1;return parseInt(t.substring(t.lastIndexOf("/")+1))}(r),this.parseChunk(r.responseText)))},this._chunkError=function(e){var t=r.statusText||e;this._sendError(new Error(t))}}function c(e){var r,n;(e=e||{}).chunkSize||(e.chunkSize=b.LocalChunkSize),u.call(this,e);var s="undefined"!=typeof FileReader;this.stream=function(e){this._input=e,n=e.slice||e.webkitSlice||e.mozSlice,s?((r=new FileReader).onload=y(this._chunkLoaded,this),r.onerror=y(this._chunkError,this)):r=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount=this._input.size,this.parseChunk(e.target.result)},this._chunkError=function(){this._sendError(r.error)}}function p(e){var i;u.call(this,e=e||{}),this.stream=function(e){return i=e,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var e,t=this._config.chunkSize;return t?(e=i.substring(0,t),i=i.substring(t)):(e=i,i=""),this._finished=!i,this.parseChunk(e)}}}function g(e){u.call(this,e=e||{});var t=[],i=!0,r=!1;this.pause=function(){u.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){u.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(e){this._input=e,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){r&&1===t.length&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),t.length?this.parseChunk(t.shift()):i=!0},this._streamData=y(function(e){try{t.push("string"==typeof e?e:e.toString(this._config.encoding)),i&&(i=!1,this._checkIsFinished(),this.parseChunk(t.shift()))}catch(e){this._streamError(e)}},this),this._streamError=y(function(e){this._streamCleanUp(),this._sendError(e)},this),this._streamEnd=y(function(){this._streamCleanUp(),r=!0,this._streamData("")},this),this._streamCleanUp=y(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function i(_){var a,o,h,r=Math.pow(2,53),n=-r,s=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)(e[-+]?\d+)?\s*$/,u=/(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/,t=this,i=0,f=0,d=!1,e=!1,l=[],c={data:[],errors:[],meta:{}};if(U(_.step)){var p=_.step;_.step=function(e){if(c=e,m())g();else{if(g(),0===c.data.length)return;i+=e.data.length,_.preview&&i>_.preview?o.abort():(c.data=c.data[0],p(c,t))}}}function v(e){return"greedy"===_.skipEmptyLines?""===e.join("").trim():1===e.length&&0===e[0].length}function g(){if(c&&h&&(k("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+b.DefaultDelimiter+"'"),h=!1),_.skipEmptyLines)for(var e=0;e=l.length?"__parsed_extra":l[i]),_.transform&&(s=_.transform(s,n)),s=y(n,s),"__parsed_extra"===n?(r[n]=r[n]||[],r[n].push(s)):r[n]=s}return _.header&&(i>l.length?k("FieldMismatch","TooManyFields","Too many fields: expected "+l.length+" fields but parsed "+i,f+t):i=r.length/2?"\r\n":"\r"}(e,r)),h=!1,_.delimiter)U(_.delimiter)&&(_.delimiter=_.delimiter(e),c.meta.delimiter=_.delimiter);else{var n=function(e,t,i,r,n){var s,a,o,h;n=n||[",","\t","|",";",b.RECORD_SEP,b.UNIT_SEP];for(var u=0;u=L)return R(!0)}else for(_=M,M++;;){if(-1===(_=a.indexOf(O,_+1)))return i||u.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:h.length,index:M}),E();if(_===r-1)return E(a.substring(M,_).replace(m,O));if(O!==z||a[_+1]!==z){if(O===z||0===_||a[_-1]!==z){-1!==p&&p<_+1&&(p=a.indexOf(D,_+1)),-1!==g&&g<_+1&&(g=a.indexOf(I,_+1));var y=w(-1===g?p:Math.min(p,g));if(a[_+1+y]===D){f.push(a.substring(M,_).replace(m,O)),a[M=_+1+y+e]!==O&&(_=a.indexOf(O,M)),p=a.indexOf(D,M),g=a.indexOf(I,M);break}var k=w(g);if(a.substring(_+1+k,_+1+k+n)===I){if(f.push(a.substring(M,_).replace(m,O)),C(_+1+k+n),p=a.indexOf(D,M),_=a.indexOf(O,M),o&&(S(),j))return R();if(L&&h.length>=L)return R(!0);break}u.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:h.length,index:M}),_++}}else _++}return E();function b(e){h.push(e),d=M}function w(e){var t=0;if(-1!==e){var i=a.substring(_+1,e);i&&""===i.trim()&&(t=i.length)}return t}function E(e){return i||(void 0===e&&(e=a.substring(M)),f.push(e),M=r,b(f),o&&S()),R()}function C(e){M=e,b(f),f=[],g=a.indexOf(I,M)}function R(e){return{data:h,errors:u,meta:{delimiter:D,linebreak:I,aborted:j,truncated:!!e,cursor:d+(t||0)}}}function S(){A(R()),h=[],u=[]}function x(e,t,i){var r={nextDelim:void 0,quoteSearch:void 0},n=a.indexOf(O,t+1);if(t - - - Papa Parse Player - - - - - - - -

Papa Parse Player

- -
- -
- - - - - - - - - - - - - - Line Endings: - - - - - - - - - - - - - - - -
- -
- - - -
- or -
- - - -

- - -   - - -

- - Open the Console in your browser's inspector tools to see results. -
- -
- - \ No newline at end of file diff --git a/node_modules/papaparse/player/player.js b/node_modules/papaparse/player/player.js deleted file mode 100644 index 8150de6..0000000 --- a/node_modules/papaparse/player/player.js +++ /dev/null @@ -1,180 +0,0 @@ -var stepped = 0, chunks = 0, rows = 0; -var start, end; -var parser; -var pauseChecked = false; -var printStepChecked = false; - -$(function() -{ - $('#submit-parse').click(function() - { - stepped = 0; - chunks = 0; - rows = 0; - - var txt = $('#input').val(); - var localChunkSize = $('#localChunkSize').val(); - var remoteChunkSize = $('#remoteChunkSize').val(); - var files = $('#files')[0].files; - var config = buildConfig(); - - // NOTE: Chunk size does not get reset if changed and then set back to empty/default value - if (localChunkSize) - Papa.LocalChunkSize = localChunkSize; - if (remoteChunkSize) - Papa.RemoteChunkSize = remoteChunkSize; - - pauseChecked = $('#step-pause').prop('checked'); - printStepChecked = $('#print-steps').prop('checked'); - - - if (files.length > 0) - { - if (!$('#stream').prop('checked') && !$('#chunk').prop('checked')) - { - for (var i = 0; i < files.length; i++) - { - if (files[i].size > 1024 * 1024 * 10) - { - alert("A file you've selected is larger than 10 MB; please choose to stream or chunk the input to prevent the browser from crashing."); - return; - } - } - } - - start = performance.now(); - - $('#files').parse({ - config: config, - before: function(file, inputElem) - { - console.log("Parsing file:", file); - }, - complete: function() - { - console.log("Done with all files."); - } - }); - } - else - { - start = performance.now(); - var results = Papa.parse(txt, config); - console.log("Synchronous parse results:", results); - } - }); - - $('#submit-unparse').click(function() - { - var input = $('#input').val(); - var delim = $('#delimiter').val(); - var header = $('#header').prop('checked'); - - var results = Papa.unparse(input, { - delimiter: delim, - header: header, - }); - - console.log("Unparse complete!"); - console.log("--------------------------------------"); - console.log(results); - console.log("--------------------------------------"); - }); - - $('#insert-tab').click(function() - { - $('#delimiter').val('\t'); - }); -}); - - - -function buildConfig() -{ - return { - delimiter: $('#delimiter').val(), - newline: getLineEnding(), - header: $('#header').prop('checked'), - dynamicTyping: $('#dynamicTyping').prop('checked'), - preview: parseInt($('#preview').val() || 0), - step: $('#stream').prop('checked') ? stepFn : undefined, - encoding: $('#encoding').val(), - worker: $('#worker').prop('checked'), - comments: $('#comments').val(), - complete: completeFn, - error: errorFn, - download: $('#download').prop('checked'), - fastMode: $('#fastmode').prop('checked'), - skipEmptyLines: $('#skipEmptyLines').prop('checked'), - chunk: $('#chunk').prop('checked') ? chunkFn : undefined, - beforeFirstChunk: undefined, - }; - - function getLineEnding() - { - if ($('#newline-n').is(':checked')) - return "\n"; - else if ($('#newline-r').is(':checked')) - return "\r"; - else if ($('#newline-rn').is(':checked')) - return "\r\n"; - else - return ""; - } -} - -function stepFn(results, parserHandle) -{ - stepped++; - rows += results.data.length; - - parser = parserHandle; - - if (pauseChecked) - { - console.log(results, results.data[0]); - parserHandle.pause(); - return; - } - - if (printStepChecked) - console.log(results, results.data[0]); -} - -function chunkFn(results, streamer, file) -{ - if (!results) - return; - chunks++; - rows += results.data.length; - - parser = streamer; - - if (printStepChecked) - console.log("Chunk data:", results.data.length, results); - - if (pauseChecked) - { - console.log("Pausing; " + results.data.length + " rows in chunk; file:", file); - streamer.pause(); - return; - } -} - -function errorFn(error, file) -{ - console.log("ERROR:", error, file); -} - -function completeFn() -{ - end = performance.now(); - if (!$('#stream').prop('checked') - && !$('#chunk').prop('checked') - && arguments[0] - && arguments[0].data) - rows = arguments[0].data.length; - - console.log("Finished input (async). Time:", end-start, arguments); - console.log("Rows:", rows, "Stepped:", stepped, "Chunks:", chunks); -} diff --git a/node_modules/papaparse/tests/.eslintrc.js b/node_modules/papaparse/tests/.eslintrc.js deleted file mode 100644 index 8c8fc0c..0000000 --- a/node_modules/papaparse/tests/.eslintrc.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = { - "extends": ["../.eslintrc.js"], - "env": { - "mocha": true - }, - "rules": { - - } -}; diff --git a/node_modules/papaparse/tests/long-sample.csv b/node_modules/papaparse/tests/long-sample.csv deleted file mode 100644 index 59f0994..0000000 --- a/node_modules/papaparse/tests/long-sample.csv +++ /dev/null @@ -1,8 +0,0 @@ -Grant,Dyer,Donec.elementum@orciluctuset.example,2013-11-23T02:30:31-08:00,2014-05-31T01:06:56-07:00,Magna Ut Associates,ljenkins -Cherokee,Shields,Nulla.Semper.Tellus@duinec.example,2014-11-22T16:43:51-08:00,2013-09-26T11:47:15-07:00,Pede Corporation,Donec.elementum@orciluctuset.example -Catherine,Parrish,lorem@feugiatnon.example,2015-02-11T12:01:10-08:00,2015-02-26T00:29:40-08:00,Phasellus Fermentum Convallis PC,Donec.elementum@orciluctuset.example -Destiny,Shannon,libero@Aenean.example,2015-07-14T09:38:11-07:00,2014-01-11T14:53:04-08:00,Pretium Et Inc.,Donec.elementum@orciluctuset.example -Callum,Underwood,Phasellus@Quisquetincidunt.example,2013-09-13T18:49:35-07:00,2014-12-04T23:04:19-08:00,Sed Turpis Nec LLP,ljenkins -Elliott,Wright,cursus@nibh.example,2015-04-20T14:35:19-07:00,2015-03-05T12:56:46-08:00,Dolor Associate,Phasellus@Quisquetincidunt.example -Galvin,Foley,nisi.Aenean.eget@atauctorullamcorper.example,2014-03-20T23:20:15-07:00,2014-06-11T15:00:23-07:00,Adipiscing Industrie,Phasellus@Quisquetincidunt.example -Talon,Salinas,posuere.vulputate.lacus@Donecsollicitudin.example,2015-01-31T09:19:02-08:00,2014-12-17T04:59:18-08:00,Aliquam Iaculis Incorporate,Phasellus@Quisquetincidunt.example \ No newline at end of file diff --git a/node_modules/papaparse/tests/node-tests.js b/node_modules/papaparse/tests/node-tests.js deleted file mode 100644 index 9c57a22..0000000 --- a/node_modules/papaparse/tests/node-tests.js +++ /dev/null @@ -1,290 +0,0 @@ -"use strict"; - -var Papa = require("../papaparse.js"); - -var fs = require('fs'); -var assert = require('assert'); -var longSampleRawCsv = fs.readFileSync(__dirname + '/long-sample.csv', 'utf8'); - -function assertLongSampleParsedCorrectly(parsedCsv) { - assert.equal(8, parsedCsv.data.length); - assert.deepEqual(parsedCsv.data[0], [ - 'Grant', - 'Dyer', - 'Donec.elementum@orciluctuset.example', - '2013-11-23T02:30:31-08:00', - '2014-05-31T01:06:56-07:00', - 'Magna Ut Associates', - 'ljenkins' - ]); - assert.deepEqual(parsedCsv.data[7], [ - 'Talon', - 'Salinas', - 'posuere.vulputate.lacus@Donecsollicitudin.example', - '2015-01-31T09:19:02-08:00', - '2014-12-17T04:59:18-08:00', - 'Aliquam Iaculis Incorporate', - 'Phasellus@Quisquetincidunt.example' - ]); - assert.deepEqual(parsedCsv.meta, { - "delimiter": ",", - "linebreak": "\n", - "aborted": false, - "truncated": false, - "cursor": 1209 - }); - assert.equal(parsedCsv.errors.length, 0); -} - -describe('PapaParse', function() { - it('synchronously parsed CSV should be correctly parsed', function() { - assertLongSampleParsedCorrectly(Papa.parse(longSampleRawCsv)); - }); - - it('Pause and resume works (Regression Test for Bug #636)', function(done) { - this.timeout(30000); - var mod200Rows = [ - ["Etiam a dolor vitae est vestibulum","84","DEF"], - ["Etiam a dolor vitae est vestibulum","84","DEF"], - ["Lorem ipsum dolor sit","42","ABC"], - ["Etiam a dolor vitae est vestibulum","84","DEF"], - ["Etiam a dolor vitae est vestibulum","84"], - ["Lorem ipsum dolor sit","42","ABC"], - ["Etiam a dolor vitae est vestibulum","84","DEF"], - ["Etiam a dolor vitae est vestibulum","84","DEF"], - ["Lorem ipsum dolor sit","42","ABC"], - ["Lorem ipsum dolor sit","42"] - ]; - var stepped = 0; - var dataRows = []; - Papa.parse(fs.createReadStream(__dirname + '/verylong-sample.csv'), { - step: function(results, parser) { - stepped++; - if (results) - { - parser.pause(); - parser.resume(); - if (results.data && stepped % 200 === 0) { - dataRows.push(results.data); - } - } - }, - complete: function() { - assert.strictEqual(2001, stepped); - assert.deepEqual(mod200Rows, dataRows); - done(); - } - }); - }); - - it('asynchronously parsed CSV should be correctly parsed', function(done) { - Papa.parse(longSampleRawCsv, { - complete: function(parsedCsv) { - assertLongSampleParsedCorrectly(parsedCsv); - done(); - }, - }); - }); - - it('asynchronously parsed streaming CSV should be correctly parsed', function(done) { - Papa.parse(fs.createReadStream(__dirname + '/long-sample.csv', 'utf8'), { - complete: function(parsedCsv) { - assertLongSampleParsedCorrectly(parsedCsv); - done(); - }, - }); - }); - - it('reports the correct row number on FieldMismatch errors', function(done) { - Papa.parse(fs.createReadStream(__dirname + '/verylong-sample.csv'), { - header: true, - fastMode: true, - complete: function(parsedCsv) { - assert.deepEqual(parsedCsv.errors, [ - { - "type": "FieldMismatch", - "code": "TooFewFields", - "message": "Too few fields: expected 3 fields but parsed 2", - "row": 498 - }, - { - "type": "FieldMismatch", - "code": "TooFewFields", - "message": "Too few fields: expected 3 fields but parsed 2", - "row": 998 - }, - { - "type": "FieldMismatch", - "code": "TooFewFields", - "message": "Too few fields: expected 3 fields but parsed 2", - "row": 1498 - }, - { - "type": "FieldMismatch", - "code": "TooFewFields", - "message": "Too few fields: expected 3 fields but parsed 2", - "row": 1998 - } - ]); - assert.strictEqual(2000, parsedCsv.data.length); - done(); - }, - }); - }); - - it('piped streaming CSV should be correctly parsed', function(done) { - var data = []; - var readStream = fs.createReadStream(__dirname + '/long-sample.csv', 'utf8'); - var csvStream = readStream.pipe(Papa.parse(Papa.NODE_STREAM_INPUT)); - csvStream.on('data', function(item) { - data.push(item); - }); - csvStream.on('end', function() { - assert.deepEqual(data[0], [ - 'Grant', - 'Dyer', - 'Donec.elementum@orciluctuset.example', - '2013-11-23T02:30:31-08:00', - '2014-05-31T01:06:56-07:00', - 'Magna Ut Associates', - 'ljenkins' - ]); - assert.deepEqual(data[7], [ - 'Talon', - 'Salinas', - 'posuere.vulputate.lacus@Donecsollicitudin.example', - '2015-01-31T09:19:02-08:00', - '2014-12-17T04:59:18-08:00', - 'Aliquam Iaculis Incorporate', - 'Phasellus@Quisquetincidunt.example' - ]); - done(); - }); - }); - - - it('piped streaming CSV should be correctly parsed when header is true', function(done) { - var data = []; - var readStream = fs.createReadStream(__dirname + '/sample-header.csv', 'utf8'); - var csvStream = readStream.pipe(Papa.parse(Papa.NODE_STREAM_INPUT, {header: true})); - csvStream.on('data', function(item) { - data.push(item); - }); - csvStream.on('end', function() { - assert.deepEqual(data[0], { title: 'test title 01', name: 'test name 01' }); - assert.deepEqual(data[1], { title: '', name: 'test name 02' }); - done(); - }); - }); - - it('should support pausing and resuming on same tick when streaming', function(done) { - var rows = []; - Papa.parse(fs.createReadStream(__dirname + '/long-sample.csv', 'utf8'), { - chunk: function(results, parser) { - rows = rows.concat(results.data); - parser.pause(); - parser.resume(); - }, - error: function(err) { - done(new Error(err)); - }, - complete: function() { - assert.deepEqual(rows[0], [ - 'Grant', - 'Dyer', - 'Donec.elementum@orciluctuset.example', - '2013-11-23T02:30:31-08:00', - '2014-05-31T01:06:56-07:00', - 'Magna Ut Associates', - 'ljenkins' - ]); - assert.deepEqual(rows[7], [ - 'Talon', - 'Salinas', - 'posuere.vulputate.lacus@Donecsollicitudin.example', - '2015-01-31T09:19:02-08:00', - '2014-12-17T04:59:18-08:00', - 'Aliquam Iaculis Incorporate', - 'Phasellus@Quisquetincidunt.example' - ]); - done(); - } - }); - }); - - it('should support pausing and resuming asynchronously when streaming', function(done) { - var rows = []; - Papa.parse(fs.createReadStream(__dirname + '/long-sample.csv', 'utf8'), { - chunk: function(results, parser) { - rows = rows.concat(results.data); - parser.pause(); - setTimeout(function() { - parser.resume(); - }, 200); - }, - error: function(err) { - done(new Error(err)); - }, - complete: function() { - assert.deepEqual(rows[0], [ - 'Grant', - 'Dyer', - 'Donec.elementum@orciluctuset.example', - '2013-11-23T02:30:31-08:00', - '2014-05-31T01:06:56-07:00', - 'Magna Ut Associates', - 'ljenkins' - ]); - assert.deepEqual(rows[7], [ - 'Talon', - 'Salinas', - 'posuere.vulputate.lacus@Donecsollicitudin.example', - '2015-01-31T09:19:02-08:00', - '2014-12-17T04:59:18-08:00', - 'Aliquam Iaculis Incorporate', - 'Phasellus@Quisquetincidunt.example' - ]); - done(); - } - }); - }); - - it('handles errors in beforeFirstChunk', function(done) { - var expectedError = new Error('test'); - Papa.parse(fs.createReadStream(__dirname + '/long-sample.csv', 'utf8'), { - beforeFirstChunk: function() { - throw expectedError; - }, - error: function(err) { - assert.deepEqual(err, expectedError); - done(); - } - }); - }); - - it('handles errors in chunk', function(done) { - var expectedError = new Error('test'); - Papa.parse(fs.createReadStream(__dirname + '/long-sample.csv', 'utf8'), { - chunk: function() { - throw expectedError; - }, - error: function(err) { - assert.deepEqual(err, expectedError); - done(); - } - }); - }); - - it('handles errors in step', function(done) { - var expectedError = new Error('test'); - Papa.parse(fs.createReadStream(__dirname + '/long-sample.csv', 'utf8'), { - step: function() { - throw expectedError; - }, - error: function(err) { - assert.deepEqual(err, expectedError); - done(); - } - }); - }); -}); diff --git a/node_modules/papaparse/tests/sample-header.csv b/node_modules/papaparse/tests/sample-header.csv deleted file mode 100644 index bc2472b..0000000 --- a/node_modules/papaparse/tests/sample-header.csv +++ /dev/null @@ -1,3 +0,0 @@ -title,name -test title 01,test name 01 -,test name 02 diff --git a/node_modules/papaparse/tests/sample.csv b/node_modules/papaparse/tests/sample.csv deleted file mode 100644 index 0930f8f..0000000 --- a/node_modules/papaparse/tests/sample.csv +++ /dev/null @@ -1,2 +0,0 @@ -A,B,C -X,Y,Z \ No newline at end of file diff --git a/node_modules/papaparse/tests/test-cases.js b/node_modules/papaparse/tests/test-cases.js deleted file mode 100644 index 8d15b29..0000000 --- a/node_modules/papaparse/tests/test-cases.js +++ /dev/null @@ -1,2569 +0,0 @@ -var chai; -var Papa; -if (typeof module !== 'undefined' && module.exports) { - chai = require('chai'); - Papa = require('../papaparse.js'); -} - -var assert = chai.assert; - -var BASE_PATH = (typeof document === 'undefined') ? './' : document.getElementById('test-cases').src.replace(/test-cases\.js$/, ''); -var RECORD_SEP = String.fromCharCode(30); -var UNIT_SEP = String.fromCharCode(31); -var FILES_ENABLED = false; -try { - new File([""], ""); // eslint-disable-line no-new - FILES_ENABLED = true; -} catch (e) {} // safari, ie - -var XHR_ENABLED = false; -try { - new XMLHttpRequest(); // eslint-disable-line no-new - XHR_ENABLED = true; -} catch (e) {} // safari, ie - -// Tests for the core parser using new Papa.Parser().parse() (CSV to JSON) -var CORE_PARSER_TESTS = [ - { - description: "One row", - input: 'A,b,c', - expected: { - data: [['A', 'b', 'c']], - errors: [] - } - }, - { - description: "Two rows", - input: 'A,b,c\nd,E,f', - expected: { - data: [['A', 'b', 'c'], ['d', 'E', 'f']], - errors: [] - } - }, - { - description: "Three rows", - input: 'A,b,c\nd,E,f\nG,h,i', - expected: { - data: [['A', 'b', 'c'], ['d', 'E', 'f'], ['G', 'h', 'i']], - errors: [] - } - }, - { - description: "Whitespace at edges of unquoted field", - input: 'a, b ,c', - notes: "Extra whitespace should graciously be preserved", - expected: { - data: [['a', ' b ', 'c']], - errors: [] - } - }, - { - description: "Quoted field", - input: 'A,"B",C', - expected: { - data: [['A', 'B', 'C']], - errors: [] - } - }, - { - description: "Quoted field with extra whitespace on edges", - input: 'A," B ",C', - expected: { - data: [['A', ' B ', 'C']], - errors: [] - } - }, - { - description: "Quoted field with delimiter", - input: 'A,"B,B",C', - expected: { - data: [['A', 'B,B', 'C']], - errors: [] - } - }, - { - description: "Quoted field with line break", - input: 'A,"B\nB",C', - expected: { - data: [['A', 'B\nB', 'C']], - errors: [] - } - }, - { - description: "Quoted fields with line breaks", - input: 'A,"B\nB","C\nC\nC"', - expected: { - data: [['A', 'B\nB', 'C\nC\nC']], - errors: [] - } - }, - { - description: "Quoted fields at end of row with delimiter and line break", - input: 'a,b,"c,c\nc"\nd,e,f', - expected: { - data: [['a', 'b', 'c,c\nc'], ['d', 'e', 'f']], - errors: [] - } - }, - { - description: "Quoted field with escaped quotes", - input: 'A,"B""B""B",C', - expected: { - data: [['A', 'B"B"B', 'C']], - errors: [] - } - }, - { - description: "Quoted field with escaped quotes at boundaries", - input: 'A,"""B""",C', - expected: { - data: [['A', '"B"', 'C']], - errors: [] - } - }, - { - description: "Unquoted field with quotes at end of field", - notes: "The quotes character is misplaced, but shouldn't generate an error or break the parser", - input: 'A,B",C', - expected: { - data: [['A', 'B"', 'C']], - errors: [] - } - }, - { - description: "Quoted field with quotes around delimiter", - input: 'A,""",""",C', - notes: "For a boundary to exist immediately before the quotes, we must not already be in quotes", - expected: { - data: [['A', '","', 'C']], - errors: [] - } - }, - { - description: "Quoted field with quotes on right side of delimiter", - input: 'A,",""",C', - notes: "Similar to the test above but with quotes only after the comma", - expected: { - data: [['A', ',"', 'C']], - errors: [] - } - }, - { - description: "Quoted field with quotes on left side of delimiter", - input: 'A,""",",C', - notes: "Similar to the test above but with quotes only before the comma", - expected: { - data: [['A', '",', 'C']], - errors: [] - } - }, - { - description: "Quoted field with 5 quotes in a row and a delimiter in there, too", - input: '"1","cnonce="""",nc=""""","2"', - notes: "Actual input reported in issue #121", - expected: { - data: [['1', 'cnonce="",nc=""', '2']], - errors: [] - } - }, - { - description: "Quoted field with whitespace around quotes", - input: 'A, "B" ,C', - notes: "The quotes must be immediately adjacent to the delimiter to indicate a quoted field", - expected: { - data: [['A', ' "B" ', 'C']], - errors: [] - } - }, - { - description: "Misplaced quotes in data, not as opening quotes", - input: 'A,B "B",C', - notes: "The input is technically malformed, but this syntax should not cause an error", - expected: { - data: [['A', 'B "B"', 'C']], - errors: [] - } - }, - { - description: "Quoted field has no closing quote", - input: 'a,"b,c\nd,e,f', - expected: { - data: [['a', 'b,c\nd,e,f']], - errors: [{ - "type": "Quotes", - "code": "MissingQuotes", - "message": "Quoted field unterminated", - "row": 0, - "index": 3 - }] - } - }, - { - description: "Quoted field has invalid trailing quote after delimiter with a valid closer", - input: '"a,"b,c"\nd,e,f', - notes: "The input is malformed, opening quotes identified, trailing quote is malformed. Trailing quote should be escaped or followed by valid new line or delimiter to be valid", - expected: { - data: [['a,"b,c'], ['d', 'e', 'f']], - errors: [{ - "type": "Quotes", - "code": "InvalidQuotes", - "message": "Trailing quote on quoted field is malformed", - "row": 0, - "index": 1 - }] - } - }, - { - description: "Quoted field has invalid trailing quote after delimiter", - input: 'a,"b,"c\nd,e,f', - notes: "The input is malformed, opening quotes identified, trailing quote is malformed. Trailing quote should be escaped or followed by valid new line or delimiter to be valid", - expected: { - data: [['a', 'b,"c\nd,e,f']], - errors: [{ - "type": "Quotes", - "code": "InvalidQuotes", - "message": "Trailing quote on quoted field is malformed", - "row": 0, - "index": 3 - }, - { - "type": "Quotes", - "code": "MissingQuotes", - "message": "Quoted field unterminated", - "row": 0, - "index": 3 - }] - } - }, - { - description: "Quoted field has invalid trailing quote before delimiter", - input: 'a,"b"c,d\ne,f,g', - notes: "The input is malformed, opening quotes identified, trailing quote is malformed. Trailing quote should be escaped or followed by valid new line or delimiter to be valid", - expected: { - data: [['a', 'b"c,d\ne,f,g']], - errors: [{ - "type": "Quotes", - "code": "InvalidQuotes", - "message": "Trailing quote on quoted field is malformed", - "row": 0, - "index": 3 - }, - { - "type": "Quotes", - "code": "MissingQuotes", - "message": "Quoted field unterminated", - "row": 0, - "index": 3 - }] - } - }, - { - description: "Quoted field has invalid trailing quote after new line", - input: 'a,"b,c\nd"e,f,g', - notes: "The input is malformed, opening quotes identified, trailing quote is malformed. Trailing quote should be escaped or followed by valid new line or delimiter to be valid", - expected: { - data: [['a', 'b,c\nd"e,f,g']], - errors: [{ - "type": "Quotes", - "code": "InvalidQuotes", - "message": "Trailing quote on quoted field is malformed", - "row": 0, - "index": 3 - }, - { - "type": "Quotes", - "code": "MissingQuotes", - "message": "Quoted field unterminated", - "row": 0, - "index": 3 - }] - } - }, - { - description: "Quoted field has valid trailing quote via delimiter", - input: 'a,"b",c\nd,e,f', - notes: "Trailing quote is valid due to trailing delimiter", - expected: { - data: [['a', 'b', 'c'], ['d', 'e', 'f']], - errors: [] - } - }, - { - description: "Quoted field has valid trailing quote via \\n", - input: 'a,b,"c"\nd,e,f', - notes: "Trailing quote is valid due to trailing new line delimiter", - expected: { - data: [['a', 'b', 'c'], ['d', 'e', 'f']], - errors: [] - } - }, - { - description: "Quoted field has valid trailing quote via EOF", - input: 'a,b,c\nd,e,"f"', - notes: "Trailing quote is valid due to EOF", - expected: { - data: [['a', 'b', 'c'], ['d', 'e', 'f']], - errors: [] - } - }, - { - description: "Quoted field contains delimiters and \\n with valid trailing quote", - input: 'a,"b,c\nd,e,f"', - notes: "Trailing quote is valid due to trailing delimiter", - expected: { - data: [['a', 'b,c\nd,e,f']], - errors: [] - } - }, - { - description: "Line starts with quoted field", - input: 'a,b,c\n"d",e,f', - expected: { - data: [['a', 'b', 'c'], ['d', 'e', 'f']], - errors: [] - } - }, - { - description: "Line starts with unquoted empty field", - input: ',b,c\n"d",e,f', - expected: { - data: [['', 'b', 'c'], ['d', 'e', 'f']], - errors: [] - } - }, - { - description: "Line ends with quoted field", - input: 'a,b,c\nd,e,f\n"g","h","i"\n"j","k","l"', - expected: { - data: [['a', 'b', 'c'], ['d', 'e', 'f'], ['g', 'h', 'i'], ['j', 'k', 'l']], - errors: [] - } - }, - { - description: "Line ends with quoted field, first field of next line is empty, \\n", - input: 'a,b,c\n,e,f\n,"h","i"\n,"k","l"', - config: { - newline: '\n', - }, - expected: { - data: [['a', 'b', 'c'], ['', 'e', 'f'], ['', 'h', 'i'], ['', 'k', 'l']], - errors: [] - } - }, - { - description: "Quoted field at end of row (but not at EOF) has quotes", - input: 'a,b,"c""c"""\nd,e,f', - expected: { - data: [['a', 'b', 'c"c"'], ['d', 'e', 'f']], - errors: [] - } - }, - { - description: "Empty quoted field at EOF is empty", - input: 'a,b,""\na,b,""', - expected: { - data: [['a', 'b', ''], ['a', 'b', '']], - errors: [] - } - }, - { - description: "Multiple consecutive empty fields", - input: 'a,b,,,c,d\n,,e,,,f', - expected: { - data: [['a', 'b', '', '', 'c', 'd'], ['', '', 'e', '', '', 'f']], - errors: [] - } - }, - { - description: "Empty input string", - input: '', - expected: { - data: [], - errors: [] - } - }, - { - description: "Input is just the delimiter (2 empty fields)", - input: ',', - expected: { - data: [['', '']], - errors: [] - } - }, - { - description: "Input is just empty fields", - input: ',,\n,,,', - expected: { - data: [['', '', ''], ['', '', '', '']], - errors: [] - } - }, - { - description: "Input is just a string (a single field)", - input: 'Abc def', - expected: { - data: [['Abc def']], - errors: [] - } - }, - { - description: "Commented line at beginning", - input: '# Comment!\na,b,c', - config: { comments: true }, - expected: { - data: [['a', 'b', 'c']], - errors: [] - } - }, - { - description: "Commented line in middle", - input: 'a,b,c\n# Comment\nd,e,f', - config: { comments: true }, - expected: { - data: [['a', 'b', 'c'], ['d', 'e', 'f']], - errors: [] - } - }, - { - description: "Commented line at end", - input: 'a,true,false\n# Comment', - config: { comments: true }, - expected: { - data: [['a', 'true', 'false']], - errors: [] - } - }, - { - description: "Two comment lines consecutively", - input: 'a,b,c\n#comment1\n#comment2\nd,e,f', - config: { comments: true }, - expected: { - data: [['a', 'b', 'c'], ['d', 'e', 'f']], - errors: [] - } - }, - { - description: "Two comment lines consecutively at end of file", - input: 'a,b,c\n#comment1\n#comment2', - config: { comments: true }, - expected: { - data: [['a', 'b', 'c']], - errors: [] - } - }, - { - description: "Three comment lines consecutively at beginning of file", - input: '#comment1\n#comment2\n#comment3\na,b,c', - config: { comments: true }, - expected: { - data: [['a', 'b', 'c']], - errors: [] - } - }, - { - description: "Entire file is comment lines", - input: '#comment1\n#comment2\n#comment3', - config: { comments: true }, - expected: { - data: [], - errors: [] - } - }, - { - description: "Comment with non-default character", - input: 'a,b,c\n!Comment goes here\nd,e,f', - config: { comments: '!' }, - expected: { - data: [['a', 'b', 'c'], ['d', 'e', 'f']], - errors: [] - } - }, - { - description: "Bad comments value specified", - notes: "Should silently disable comment parsing", - input: 'a,b,c\n5comment\nd,e,f', - config: { comments: 5 }, - expected: { - data: [['a', 'b', 'c'], ['5comment'], ['d', 'e', 'f']], - errors: [] - } - }, - { - description: "Multi-character comment string", - input: 'a,b,c\n=N(Comment)\nd,e,f', - config: { comments: "=N(" }, - expected: { - data: [['a', 'b', 'c'], ['d', 'e', 'f']], - errors: [] - } - }, - { - description: "Input with only a commented line", - input: '#commented line', - config: { comments: true, delimiter: ',' }, - expected: { - data: [], - errors: [] - } - }, - { - description: "Input with only a commented line and blank line after", - input: '#commented line\n', - config: { comments: true, delimiter: ',' }, - expected: { - data: [['']], - errors: [] - } - }, - { - description: "Input with only a commented line, without comments enabled", - input: '#commented line', - config: { delimiter: ',' }, - expected: { - data: [['#commented line']], - errors: [] - } - }, - { - description: "Input without comments with line starting with whitespace", - input: 'a\n b\nc', - config: { delimiter: ',' }, - notes: "\" \" == false, but \" \" !== false, so === comparison is required", - expected: { - data: [['a'], [' b'], ['c']], - errors: [] - } - }, - { - description: "Multiple rows, one column (no delimiter found)", - input: 'a\nb\nc\nd\ne', - expected: { - data: [['a'], ['b'], ['c'], ['d'], ['e']], - errors: [] - } - }, - { - description: "One column input with empty fields", - input: 'a\nb\n\n\nc\nd\ne\n', - expected: { - data: [['a'], ['b'], [''], [''], ['c'], ['d'], ['e'], ['']], - errors: [] - } - }, - { - description: "Fast mode, basic", - input: 'a,b,c\nd,e,f', - config: { fastMode: true }, - expected: { - data: [['a', 'b', 'c'], ['d', 'e', 'f']], - errors: [] - } - }, - { - description: "Fast mode with comments", - input: '// Commented line\na,b,c', - config: { fastMode: true, comments: "//" }, - expected: { - data: [['a', 'b', 'c']], - errors: [] - } - }, - { - description: "Fast mode with preview", - input: 'a,b,c\nd,e,f\nh,j,i\n', - config: { fastMode: true, preview: 2 }, - expected: { - data: [['a', 'b', 'c'], ['d', 'e', 'f']], - errors: [] - } - }, - { - description: "Fast mode with blank line at end", - input: 'a,b,c\n', - config: { fastMode: true }, - expected: { - data: [['a', 'b', 'c'], ['']], - errors: [] - } - } -]; - -describe('Core Parser Tests', function() { - function generateTest(test) { - (test.disabled ? it.skip : it)(test.description, function() { - var actual = new Papa.Parser(test.config).parse(test.input); - assert.deepEqual(actual.errors, test.expected.errors); - assert.deepEqual(actual.data, test.expected.data); - }); - } - - for (var i = 0; i < CORE_PARSER_TESTS.length; i++) { - generateTest(CORE_PARSER_TESTS[i]); - } -}); - - - -// Tests for Papa.parse() function -- high-level wrapped parser (CSV to JSON) -var PARSE_TESTS = [ - { - description: "Two rows, just \\r", - input: 'A,b,c\rd,E,f', - expected: { - data: [['A', 'b', 'c'], ['d', 'E', 'f']], - errors: [] - } - }, - { - description: "Two rows, \\r\\n", - input: 'A,b,c\r\nd,E,f', - expected: { - data: [['A', 'b', 'c'], ['d', 'E', 'f']], - errors: [] - } - }, - { - description: "Quoted field with \\r\\n", - input: 'A,"B\r\nB",C', - expected: { - data: [['A', 'B\r\nB', 'C']], - errors: [] - } - }, - { - description: "Quoted field with \\r", - input: 'A,"B\rB",C', - expected: { - data: [['A', 'B\rB', 'C']], - errors: [] - } - }, - { - description: "Quoted field with \\n", - input: 'A,"B\nB",C', - expected: { - data: [['A', 'B\nB', 'C']], - errors: [] - } - }, - { - description: "Quoted fields with spaces between closing quote and next delimiter", - input: 'A,"B" ,C,D\r\nE,F,"G" ,H', - expected: { - data: [['A', 'B', 'C','D'],['E', 'F', 'G','H']], - errors: [] - } - }, - { - description: "Quoted fields with spaces between closing quote and next new line", - input: 'A,B,C,"D" \r\nE,F,G,"H" \r\nQ,W,E,R', - expected: { - data: [['A', 'B', 'C','D'],['E', 'F', 'G','H'],['Q', 'W', 'E','R']], - errors: [] - } - }, - { - description: "Quoted fields with spaces after closing quote", - input: 'A,"B" ,C,"D" \r\nE,F,"G" ,"H" \r\nQ,W,"E" ,R', - expected: { - data: [['A', 'B', 'C','D'],['E', 'F', 'G','H'],['Q', 'W', 'E','R']], - errors: [] - } - }, - { - description: "Misplaced quotes in data twice, not as opening quotes", - input: 'A,B",C\nD,E",F', - expected: { - data: [['A', 'B"', 'C'], ['D', 'E"', 'F']], - errors: [] - } - }, - { - description: "Mixed slash n and slash r should choose first as precident", - input: 'a,b,c\nd,e,f\rg,h,i\n', - expected: { - data: [['a', 'b', 'c'], ['d', 'e', 'f\rg', 'h', 'i'], ['']], - errors: [] - } - }, - { - description: "Header row with one row of data", - input: 'A,B,C\r\na,b,c', - config: { header: true }, - expected: { - data: [{"A": "a", "B": "b", "C": "c"}], - errors: [] - } - }, - { - description: "Header row only", - input: 'A,B,C', - config: { header: true }, - expected: { - data: [], - errors: [] - } - }, - { - description: "Row with too few fields", - input: 'A,B,C\r\na,b', - config: { header: true }, - expected: { - data: [{"A": "a", "B": "b"}], - errors: [{ - "type": "FieldMismatch", - "code": "TooFewFields", - "message": "Too few fields: expected 3 fields but parsed 2", - "row": 0 - }] - } - }, - { - description: "Row with too many fields", - input: 'A,B,C\r\na,b,c,d,e\r\nf,g,h', - config: { header: true }, - expected: { - data: [{"A": "a", "B": "b", "C": "c", "__parsed_extra": ["d", "e"]}, {"A": "f", "B": "g", "C": "h"}], - errors: [{ - "type": "FieldMismatch", - "code": "TooManyFields", - "message": "Too many fields: expected 3 fields but parsed 5", - "row": 0 - }] - } - }, - { - description: "Row with enough fields but blank field in the begining", - input: 'A,B,C\r\n,b1,c1\r\na2,b2,c2', - expected: { - data: [["A", "B", "C"], ['', 'b1', 'c1'], ['a2', 'b2', 'c2']], - errors: [] - } - }, - { - description: "Row with enough fields but blank field in the begining using headers", - input: 'A,B,C\r\n,b1,c1\r\n,b2,c2', - config: { header: true }, - expected: { - data: [{"A": "", "B": "b1", "C": "c1"}, {"A": "", "B": "b2", "C": "c2"}], - errors: [] - } - }, - { - description: "Row with enough fields but blank field at end", - input: 'A,B,C\r\na,b,', - config: { header: true }, - expected: { - data: [{"A": "a", "B": "b", "C": ""}], - errors: [] - } - }, - { - description: "Header rows are transformed when transformHeader function is provided", - input: 'A,B,C\r\na,b,c', - config: { header: true, transformHeader: function(header) { return header.toLowerCase(); } }, - expected: { - data: [{"a": "a", "b": "b", "c": "c"}], - errors: [] - } - }, - { - description: "transformHeader accepts and optional index attribute", - input: 'A,B,C\r\na,b,c', - config: { header: true, transformHeader: function(header, i) { return i % 2 ? header.toLowerCase() : header; } }, - expected: { - data: [{"A": "a", "b": "b", "C": "c"}], - errors: [] - } - }, - { - description: "Line ends with quoted field, first field of next line is empty using headers", - input: 'a,b,"c"\r\nd,e,"f"\r\n,"h","i"\r\n,"k","l"', - config: { - header: true, - newline: '\r\n', - }, - expected: { - data: [ - {a: 'd', b: 'e', c: 'f'}, - {a: '', b: 'h', c: 'i'}, - {a: '', b: 'k', c: 'l'} - ], - errors: [] - } - }, - { - description: "Tab delimiter", - input: 'a\tb\tc\r\nd\te\tf', - config: { delimiter: "\t" }, - expected: { - data: [['a', 'b', 'c'], ['d', 'e', 'f']], - errors: [] - } - }, - { - description: "Pipe delimiter", - input: 'a|b|c\r\nd|e|f', - config: { delimiter: "|" }, - expected: { - data: [['a', 'b', 'c'], ['d', 'e', 'f']], - errors: [] - } - }, - { - description: "ASCII 30 delimiter", - input: 'a' + RECORD_SEP + 'b' + RECORD_SEP + 'c\r\nd' + RECORD_SEP + 'e' + RECORD_SEP + 'f', - config: { delimiter: RECORD_SEP }, - expected: { - data: [['a', 'b', 'c'], ['d', 'e', 'f']], - errors: [] - } - }, - { - description: "ASCII 31 delimiter", - input: 'a' + UNIT_SEP + 'b' + UNIT_SEP + 'c\r\nd' + UNIT_SEP + 'e' + UNIT_SEP + 'f', - config: { delimiter: UNIT_SEP }, - expected: { - data: [['a', 'b', 'c'], ['d', 'e', 'f']], - errors: [] - } - }, - { - description: "Bad delimiter (\\n)", - input: 'a,b,c', - config: { delimiter: "\n" }, - notes: "Should silently default to comma", - expected: { - data: [['a', 'b', 'c']], - errors: [] - } - }, - { - description: "Multi-character delimiter", - input: 'a, b, c', - config: { delimiter: ", " }, - expected: { - data: [['a', 'b', 'c']], - errors: [] - } - }, - { - description: "Callback delimiter", - input: 'a$ b$ c', - config: { delimiter: function(input) { return input[1] + ' '; } }, - expected: { - data: [['a', 'b', 'c']], - errors: [] - } - }, - { - description: "Dynamic typing converts numeric literals and maintains precision", - input: '1,2.2,1e3\r\n-4,-4.5,-4e-5\r\n-,5a,5-2\r\n16142028098527942586,9007199254740991,-9007199254740992', - config: { dynamicTyping: true }, - expected: { - data: [[1, 2.2, 1000], [-4, -4.5, -0.00004], ["-", "5a", "5-2"], ["16142028098527942586", 9007199254740991, "-9007199254740992"]], - errors: [] - } - }, - { - description: "Dynamic typing converts boolean literals", - input: 'true,false,T,F,TRUE,FALSE,True,False', - config: { dynamicTyping: true }, - expected: { - data: [[true, false, "T", "F", true, false, "True", "False"]], - errors: [] - } - }, - { - description: "Dynamic typing doesn't convert other types", - input: 'A,B,C\r\nundefined,null,[\r\nvar,float,if', - config: { dynamicTyping: true }, - expected: { - data: [["A", "B", "C"], ["undefined", "null", "["], ["var", "float", "if"]], - errors: [] - } - }, - { - description: "Dynamic typing applies to specific columns", - input: 'A,B,C\r\n1,2.2,1e3\r\n-4,-4.5,-4e-5', - config: { header: true, dynamicTyping: { A: true, C: true } }, - expected: { - data: [{"A": 1, "B": "2.2", "C": 1000}, {"A": -4, "B": "-4.5", "C": -0.00004}], - errors: [] - } - }, - { - description: "Dynamic typing applies to specific columns by index", - input: '1,2.2,1e3\r\n-4,-4.5,-4e-5\r\n-,5a,5-2', - config: { dynamicTyping: { 1: true } }, - expected: { - data: [["1", 2.2, "1e3"], ["-4", -4.5, "-4e-5"], ["-", "5a", "5-2"]], - errors: [] - } - }, - { - description: "Dynamic typing can be applied to `__parsed_extra`", - input: 'A,B,C\r\n1,2.2,1e3,5.5\r\n-4,-4.5,-4e-5', - config: { header: true, dynamicTyping: { A: true, C: true, __parsed_extra: true } }, - expected: { - data: [{"A": 1, "B": "2.2", "C": 1000, "__parsed_extra": [5.5]}, {"A": -4, "B": "-4.5", "C": -0.00004}], - errors: [{ - "type": "FieldMismatch", - "code": "TooManyFields", - "message": "Too many fields: expected 3 fields but parsed 4", - "row": 0 - }] - } - }, - { - description: "Dynamic typing by indices can be determined by function", - input: '001,002,003', - config: { dynamicTyping: function(field) { return (field % 2) === 0; } }, - expected: { - data: [[1, "002", 3]], - errors: [] - } - }, - { - description: "Dynamic typing by headers can be determined by function", - input: 'A_as_int,B,C_as_int\r\n001,002,003', - config: { header: true, dynamicTyping: function(field) { return /_as_int$/.test(field); } }, - expected: { - data: [{"A_as_int": 1, "B": "002", "C_as_int": 3}], - errors: [] - } - }, - { - description: "Dynamic typing converts empty values into NULL", - input: '1,2.2,1e3\r\n,NULL,\r\n-,5a,null', - config: { dynamicTyping: true }, - expected: { - data: [[1, 2.2, 1000], [null, "NULL", null], ["-", "5a", "null"]], - errors: [] - } - }, - { - description: "Custom transform function is applied to values", - input: 'A,B,C\r\nd,e,f', - config: { - transform: function(value) { - return value.toLowerCase(); - } - }, - expected: { - data: [["a","b","c"], ["d","e","f"]], - errors: [] - } - }, - { - description: "Custom transform accepts column number also", - input: 'A,B,C\r\nd,e,f', - config: { - transform: function(value, column) { - if (column % 2) { - value = value.toLowerCase(); - } - return value; - } - }, - expected: { - data: [["A","b","C"], ["d","e","f"]], - errors: [] - } - }, - { - description: "Custom transform accepts header name when using header", - input: 'A,B,C\r\nd,e,f', - config: { - header: true, - transform: function(value, name) { - if (name === 'B') { - value = value.toUpperCase(); - } - return value; - } - }, - expected: { - data: [{'A': "d", 'B': "E", 'C': "f"}], - errors: [] - } - }, - { - description: "Dynamic typing converts ISO date strings to Dates", - input: 'ISO date,long date\r\n2018-05-04T21:08:03.269Z,Fri May 04 2018 14:08:03 GMT-0700 (PDT)\r\n2018-05-08T15:20:22.642Z,Tue May 08 2018 08:20:22 GMT-0700 (PDT)', - config: { dynamicTyping: true }, - expected: { - data: [["ISO date", "long date"], [new Date("2018-05-04T21:08:03.269Z"), "Fri May 04 2018 14:08:03 GMT-0700 (PDT)"], [new Date("2018-05-08T15:20:22.642Z"), "Tue May 08 2018 08:20:22 GMT-0700 (PDT)"]], - errors: [] - } - }, - { - description: "Blank line at beginning", - input: '\r\na,b,c\r\nd,e,f', - config: { newline: '\r\n' }, - expected: { - data: [[''], ['a', 'b', 'c'], ['d', 'e', 'f']], - errors: [] - } - }, - { - description: "Blank line in middle", - input: 'a,b,c\r\n\r\nd,e,f', - config: { newline: '\r\n' }, - expected: { - data: [['a', 'b', 'c'], [''], ['d', 'e', 'f']], - errors: [] - } - }, - { - description: "Blank lines at end", - input: 'a,b,c\nd,e,f\n\n', - expected: { - data: [['a', 'b', 'c'], ['d', 'e', 'f'], [''], ['']], - errors: [] - } - }, - { - description: "Blank line in middle with whitespace", - input: 'a,b,c\r\n \r\nd,e,f', - expected: { - data: [['a', 'b', 'c'], [" "], ['d', 'e', 'f']], - errors: [] - } - }, - { - description: "First field of a line is empty", - input: 'a,b,c\r\n,e,f', - expected: { - data: [['a', 'b', 'c'], ['', 'e', 'f']], - errors: [] - } - }, - { - description: "Last field of a line is empty", - input: 'a,b,\r\nd,e,f', - expected: { - data: [['a', 'b', ''], ['d', 'e', 'f']], - errors: [] - } - }, - { - description: "Other fields are empty", - input: 'a,,c\r\n,,', - expected: { - data: [['a', '', 'c'], ['', '', '']], - errors: [] - } - }, - { - description: "Empty input string", - input: '', - expected: { - data: [], - errors: [{ - "type": "Delimiter", - "code": "UndetectableDelimiter", - "message": "Unable to auto-detect delimiting character; defaulted to ','" - }] - } - }, - { - description: "Input is just the delimiter (2 empty fields)", - input: ',', - expected: { - data: [['', '']], - errors: [] - } - }, - { - description: "Input is just a string (a single field)", - input: 'Abc def', - expected: { - data: [['Abc def']], - errors: [ - { - "type": "Delimiter", - "code": "UndetectableDelimiter", - "message": "Unable to auto-detect delimiting character; defaulted to ','" - } - ] - } - }, - { - description: "Preview 0 rows should default to parsing all", - input: 'a,b,c\r\nd,e,f\r\ng,h,i', - config: { preview: 0 }, - expected: { - data: [['a', 'b', 'c'], ['d', 'e', 'f'], ['g', 'h', 'i']], - errors: [] - } - }, - { - description: "Preview 1 row", - input: 'a,b,c\r\nd,e,f\r\ng,h,i', - config: { preview: 1 }, - expected: { - data: [['a', 'b', 'c']], - errors: [] - } - }, - { - description: "Preview 2 rows", - input: 'a,b,c\r\nd,e,f\r\ng,h,i', - config: { preview: 2 }, - expected: { - data: [['a', 'b', 'c'], ['d', 'e', 'f']], - errors: [] - } - }, - { - description: "Preview all (3) rows", - input: 'a,b,c\r\nd,e,f\r\ng,h,i', - config: { preview: 3 }, - expected: { - data: [['a', 'b', 'c'], ['d', 'e', 'f'], ['g', 'h', 'i']], - errors: [] - } - }, - { - description: "Preview more rows than input has", - input: 'a,b,c\r\nd,e,f\r\ng,h,i', - config: { preview: 4 }, - expected: { - data: [['a', 'b', 'c'], ['d', 'e', 'f'], ['g', 'h', 'i']], - errors: [] - } - }, - { - description: "Preview should count rows, not lines", - input: 'a,b,c\r\nd,e,"f\r\nf",g,h,i', - config: { preview: 2 }, - expected: { - data: [['a', 'b', 'c'], ['d', 'e', 'f\r\nf', 'g', 'h', 'i']], - errors: [] - } - }, - { - description: "Preview with header row", - notes: "Preview is defined to be number of rows of input not including header row", - input: 'a,b,c\r\nd,e,f\r\ng,h,i\r\nj,k,l', - config: { header: true, preview: 2 }, - expected: { - data: [{"a": "d", "b": "e", "c": "f"}, {"a": "g", "b": "h", "c": "i"}], - errors: [] - } - }, - { - description: "Empty lines", - input: '\na,b,c\n\nd,e,f\n\n', - config: { delimiter: ',' }, - expected: { - data: [[''], ['a', 'b', 'c'], [''], ['d', 'e', 'f'], [''], ['']], - errors: [] - } - }, - { - description: "Skip empty lines", - input: 'a,b,c\n\nd,e,f', - config: { skipEmptyLines: true }, - expected: { - data: [['a', 'b', 'c'], ['d', 'e', 'f']], - errors: [] - } - }, - { - description: "Skip empty lines, with newline at end of input", - input: 'a,b,c\r\n\r\nd,e,f\r\n', - config: { skipEmptyLines: true }, - expected: { - data: [['a', 'b', 'c'], ['d', 'e', 'f']], - errors: [] - } - }, - { - description: "Skip empty lines, with empty input", - input: '', - config: { skipEmptyLines: true }, - expected: { - data: [], - errors: [ - { - "type": "Delimiter", - "code": "UndetectableDelimiter", - "message": "Unable to auto-detect delimiting character; defaulted to ','" - } - ] - } - }, - { - description: "Skip empty lines, with first line only whitespace", - notes: "A line must be absolutely empty to be considered empty", - input: ' \na,b,c', - config: { skipEmptyLines: true, delimiter: ',' }, - expected: { - data: [[" "], ['a', 'b', 'c']], - errors: [] - } - }, - { - description: "Skip empty lines while detecting delimiter", - notes: "Parsing correctly newline-terminated short data with delimiter:auto and skipEmptyLines:true", - input: 'a,b\n1,2\n3,4\n', - config: { header: true, skipEmptyLines: true }, - expected: { - data: [{'a': '1', 'b': '2'}, {'a': '3', 'b': '4'}], - errors: [] - } - }, - { - description: "Lines with comments are not used when guessing the delimiter in an escaped file", - notes: "Guessing the delimiter should work even if there are many lines of comments at the start of the file", - input: '#1\n#2\n#3\n#4\n#5\n#6\n#7\n#8\n#9\n#10\none,"t,w,o",three\nfour,five,six', - config: { comments: '#' }, - expected: { - data: [['one','t,w,o','three'],['four','five','six']], - errors: [] - } - }, - { - description: "Lines with comments are not used when guessing the delimiter in a non-escaped file", - notes: "Guessing the delimiter should work even if there are many lines of comments at the start of the file", - input: '#1\n#2\n#3\n#4\n#5\n#6\n#7\n#8\n#9\n#10\n#11\none,two,three\nfour,five,six', - config: { comments: '#' }, - expected: { - data: [['one','two','three'],['four','five','six']], - errors: [] - } - }, - { - description: "Pipe delimiter is guessed correctly when mixed with comas", - notes: "Guessing the delimiter should work even if there are many lines of comments at the start of the file", - input: 'one|two,two|three\nfour|five,five|six', - config: {}, - expected: { - data: [['one','two,two','three'],['four','five,five','six']], - errors: [] - } - }, - { - description: "Pipe delimiter is guessed correctly choose avgFildCount max one", - notes: "Guessing the delimiter should work choose the min delta one and the max one", - config: {}, - input: 'a,b,c\na,b,c|d|e|f', - expected: { - data: [['a', 'b', 'c'], ['a','b','c|d|e|f']], - errors: [] - } - }, - { - description: "Pipe delimiter is guessed correctly when first field are enclosed in quotes and contain delimiter characters", - notes: "Guessing the delimiter should work if the first field is enclosed in quotes, but others are not", - input: '"Field1,1,1";Field2;"Field3";Field4;Field5;Field6', - config: {}, - expected: { - data: [['Field1,1,1','Field2','Field3', 'Field4', 'Field5', 'Field6']], - errors: [] - } - }, - { - description: "Pipe delimiter is guessed correctly when some fields are enclosed in quotes and contain delimiter characters and escaoped quotes", - notes: "Guessing the delimiter should work even if the first field is not enclosed in quotes, but others are", - input: 'Field1;Field2;"Field,3,""3,3";Field4;Field5;"Field6,6"', - config: {}, - expected: { - data: [['Field1','Field2','Field,3,"3,3', 'Field4', 'Field5', 'Field6,6']], - errors: [] - } - }, - { - description: "Single quote as quote character", - notes: "Must parse correctly when single quote is specified as a quote character", - input: "a,b,'c,d'", - config: { quoteChar: "'" }, - expected: { - data: [['a', 'b', 'c,d']], - errors: [] - } - }, - { - description: "Custom escape character in the middle", - notes: "Must parse correctly if the backslash sign (\\) is configured as a custom escape character", - input: 'a,b,"c\\"d\\"f"', - config: { escapeChar: '\\' }, - expected: { - data: [['a', 'b', 'c"d"f']], - errors: [] - } - }, - { - description: "Custom escape character at the end", - notes: "Must parse correctly if the backslash sign (\\) is configured as a custom escape character and the escaped quote character appears at the end of the column", - input: 'a,b,"c\\"d\\""', - config: { escapeChar: '\\' }, - expected: { - data: [['a', 'b', 'c"d"']], - errors: [] - } - }, - { - description: "Custom escape character not used for escaping", - notes: "Must parse correctly if the backslash sign (\\) is configured as a custom escape character and appears as regular character in the text", - input: 'a,b,"c\\d"', - config: { escapeChar: '\\' }, - expected: { - data: [['a', 'b', 'c\\d']], - errors: [] - } - }, - { - description: "Header row with preceding comment", - notes: "Must parse correctly headers if they are preceded by comments", - input: '#Comment\na,b\nc,d\n', - config: { header: true, comments: '#', skipEmptyLines: true, delimiter: ',' }, - expected: { - data: [{'a': 'c', 'b': 'd'}], - errors: [] - } - }, - { - description: "Carriage return in header inside quotes, with line feed endings", - input: '"a\r\na","b"\n"c","d"\n"e","f"\n"g","h"\n"i","j"', - config: {}, - expected: { - data: [['a\r\na', 'b'], ['c', 'd'], ['e', 'f'], ['g', 'h'], ['i', 'j']], - errors: [] - } - }, - { - description: "Line feed in header inside quotes, with carriage return + line feed endings", - input: '"a\na","b"\r\n"c","d"\r\n"e","f"\r\n"g","h"\r\n"i","j"', - config: {}, - expected: { - data: [['a\na', 'b'], ['c', 'd'], ['e', 'f'], ['g', 'h'], ['i', 'j']], - errors: [] - } - }, - { - description: "Using \\r\\n endings uses \\r\\n linebreak", - input: 'a,b\r\nc,d\r\ne,f\r\ng,h\r\ni,j', - config: {}, - expected: { - data: [['a', 'b'], ['c', 'd'], ['e', 'f'], ['g', 'h'], ['i', 'j']], - errors: [], - meta: { - linebreak: '\r\n', - delimiter: ',', - cursor: 23, - aborted: false, - truncated: false - } - } - }, - { - description: "Using \\n endings uses \\n linebreak", - input: 'a,b\nc,d\ne,f\ng,h\ni,j', - config: {}, - expected: { - data: [['a', 'b'], ['c', 'd'], ['e', 'f'], ['g', 'h'], ['i', 'j']], - errors: [], - meta: { - linebreak: '\n', - delimiter: ',', - cursor: 19, - aborted: false, - truncated: false - } - } - }, - { - description: "Using \\r\\n endings with \\r\\n in header field uses \\r\\n linebreak", - input: '"a\r\na",b\r\nc,d\r\ne,f\r\ng,h\r\ni,j', - config: {}, - expected: { - data: [['a\r\na', 'b'], ['c', 'd'], ['e', 'f'], ['g', 'h'], ['i', 'j']], - errors: [], - meta: { - linebreak: '\r\n', - delimiter: ',', - cursor: 28, - aborted: false, - truncated: false - } - } - }, - { - description: "Using \\r\\n endings with \\n in header field uses \\r\\n linebreak", - input: '"a\na",b\r\nc,d\r\ne,f\r\ng,h\r\ni,j', - config: {}, - expected: { - data: [['a\na', 'b'], ['c', 'd'], ['e', 'f'], ['g', 'h'], ['i', 'j']], - errors: [], - meta: { - linebreak: '\r\n', - delimiter: ',', - cursor: 27, - aborted: false, - truncated: false - } - } - }, - { - description: "Using \\r\\n endings with \\n in header field with skip empty lines uses \\r\\n linebreak", - input: '"a\na",b\r\nc,d\r\ne,f\r\ng,h\r\ni,j\r\n', - config: {skipEmptyLines: true}, - expected: { - data: [['a\na', 'b'], ['c', 'd'], ['e', 'f'], ['g', 'h'], ['i', 'j']], - errors: [], - meta: { - linebreak: '\r\n', - delimiter: ',', - cursor: 29, - aborted: false, - truncated: false - } - } - }, - { - description: "Using \\n endings with \\r\\n in header field uses \\n linebreak", - input: '"a\r\na",b\nc,d\ne,f\ng,h\ni,j', - config: {}, - expected: { - data: [['a\r\na', 'b'], ['c', 'd'], ['e', 'f'], ['g', 'h'], ['i', 'j']], - errors: [], - meta: { - linebreak: '\n', - delimiter: ',', - cursor: 24, - aborted: false, - truncated: false - } - } - }, - { - description: "Using reserved regex character . as quote character", - input: '.a\na.,b\r\nc,d\r\ne,f\r\ng,h\r\ni,j', - config: { quoteChar: '.' }, - expected: { - data: [['a\na', 'b'], ['c', 'd'], ['e', 'f'], ['g', 'h'], ['i', 'j']], - errors: [], - meta: { - linebreak: '\r\n', - delimiter: ',', - cursor: 27, - aborted: false, - truncated: false - } - } - }, - { - description: "Using reserved regex character | as quote character", - input: '|a\na|,b\r\nc,d\r\ne,f\r\ng,h\r\ni,j', - config: { quoteChar: '|' }, - expected: { - data: [['a\na', 'b'], ['c', 'd'], ['e', 'f'], ['g', 'h'], ['i', 'j']], - errors: [], - meta: { - linebreak: '\r\n', - delimiter: ',', - cursor: 27, - aborted: false, - truncated: false - } - } - }, - { - description: "Parsing with skipEmptyLines set to 'greedy'", - notes: "Must parse correctly without lines with no content", - input: 'a,b\n\n,\nc,d\n , \n""," "\n , \n,,,,\n', - config: { skipEmptyLines: 'greedy' }, - expected: { - data: [['a', 'b'], ['c', 'd']], - errors: [] - } - }, - { - description: "Parsing with skipEmptyLines set to 'greedy' with quotes and delimiters as content", - notes: "Must include lines with escaped delimiters and quotes", - input: 'a,b\n\n,\nc,d\n" , ",","\n""" """,""""""\n\n\n', - config: { skipEmptyLines: 'greedy' }, - expected: { - data: [['a', 'b'], ['c', 'd'], [' , ', ','], ['" "', '""']], - errors: [] - } - }, - { - description: "Quoted fields with spaces between closing quote and next delimiter and contains delimiter", - input: 'A,",B" ,C,D\nE,F,G,H', - expected: { - data: [['A', ',B', 'C', 'D'],['E', 'F', 'G', 'H']], - errors: [] - } - }, - { - description: "Quoted fields with spaces between closing quote and newline and contains newline", - input: 'a,b,"c\n" \nd,e,f', - expected: { - data: [['a', 'b', 'c\n'], ['d', 'e', 'f']], - errors: [] - } - } -]; - -describe('Parse Tests', function() { - function generateTest(test) { - (test.disabled ? it.skip : it)(test.description, function() { - var actual = Papa.parse(test.input, test.config); - // allows for testing the meta object if present in the test - if (test.expected.meta) { - assert.deepEqual(actual.meta, test.expected.meta); - } - assert.deepEqual(actual.errors, test.expected.errors); - assert.deepEqual(actual.data, test.expected.data); - }); - } - - for (var i = 0; i < PARSE_TESTS.length; i++) { - generateTest(PARSE_TESTS[i]); - } -}); - - - -// Tests for Papa.parse() that involve asynchronous operation -var PARSE_ASYNC_TESTS = [ - { - description: "Simple worker", - input: "A,B,C\nX,Y,Z", - config: { - worker: true, - }, - expected: { - data: [['A','B','C'],['X','Y','Z']], - errors: [] - } - }, - { - description: "Simple download", - input: BASE_PATH + "sample.csv", - config: { - download: true - }, - disabled: !XHR_ENABLED, - expected: { - data: [['A','B','C'],['X','Y','Z']], - errors: [] - } - }, - { - description: "Simple download + worker", - input: BASE_PATH + "sample.csv", - config: { - worker: true, - download: true - }, - disabled: !XHR_ENABLED, - expected: { - data: [['A','B','C'],['X','Y','Z']], - errors: [] - } - }, - { - description: "Simple file", - disabled: !FILES_ENABLED, - input: FILES_ENABLED ? new File(["A,B,C\nX,Y,Z"], "sample.csv") : false, - config: { - }, - expected: { - data: [['A','B','C'],['X','Y','Z']], - errors: [] - } - }, - { - description: "Simple file + worker", - disabled: !FILES_ENABLED, - input: FILES_ENABLED ? new File(["A,B,C\nX,Y,Z"], "sample.csv") : false, - config: { - worker: true, - }, - expected: { - data: [['A','B','C'],['X','Y','Z']], - errors: [] - } - } -]; - -describe('Parse Async Tests', function() { - function generateTest(test) { - (test.disabled ? it.skip : it)(test.description, function(done) { - var config = test.config; - - config.complete = function(actual) { - assert.deepEqual(actual.errors, test.expected.errors); - assert.deepEqual(actual.data, test.expected.data); - done(); - }; - - config.error = function(err) { - throw err; - }; - - Papa.parse(test.input, config); - }); - } - - for (var i = 0; i < PARSE_ASYNC_TESTS.length; i++) { - generateTest(PARSE_ASYNC_TESTS[i]); - } -}); - - - -// Tests for Papa.unparse() function (JSON to CSV) -var UNPARSE_TESTS = [ - { - description: "A simple row", - notes: "Comma should be default delimiter", - input: [['A', 'b', 'c']], - expected: 'A,b,c' - }, - { - description: "Two rows", - input: [['A', 'b', 'c'], ['d', 'E', 'f']], - expected: 'A,b,c\r\nd,E,f' - }, - { - description: "Data with quotes", - input: [['a', '"b"', 'c'], ['"d"', 'e', 'f']], - expected: 'a,"""b""",c\r\n"""d""",e,f' - }, - { - description: "Data with newlines", - input: [['a', 'b\nb', 'c'], ['d', 'e', 'f\r\nf']], - expected: 'a,"b\nb",c\r\nd,e,"f\r\nf"' - }, - { - description: "Array of objects (header row)", - input: [{ "Col1": "a", "Col2": "b", "Col3": "c" }, { "Col1": "d", "Col2": "e", "Col3": "f" }], - expected: 'Col1,Col2,Col3\r\na,b,c\r\nd,e,f' - }, - { - description: "With header row, missing a field in a row", - input: [{ "Col1": "a", "Col2": "b", "Col3": "c" }, { "Col1": "d", "Col3": "f" }], - expected: 'Col1,Col2,Col3\r\na,b,c\r\nd,,f' - }, - { - description: "With header row, with extra field in a row", - notes: "Extra field should be ignored; first object in array dictates header row", - input: [{ "Col1": "a", "Col2": "b", "Col3": "c" }, { "Col1": "d", "Col2": "e", "Extra": "g", "Col3": "f" }], - expected: 'Col1,Col2,Col3\r\na,b,c\r\nd,e,f' - }, - { - description: "Specifying column names and data separately", - input: { fields: ["Col1", "Col2", "Col3"], data: [["a", "b", "c"], ["d", "e", "f"]] }, - expected: 'Col1,Col2,Col3\r\na,b,c\r\nd,e,f' - }, - { - description: "Specifying column names only (no data)", - notes: "Papa should add a data property that is an empty array to prevent errors (no copy is made)", - input: { fields: ["Col1", "Col2", "Col3"] }, - expected: 'Col1,Col2,Col3' - }, - { - description: "Specifying data only (no field names), improperly", - notes: "A single array for a single row is wrong, but it can be compensated.
Papa should add empty fields property to prevent errors.", - input: { data: ["abc", "d", "ef"] }, - expected: 'abc,d,ef' - }, - { - description: "Specifying data only (no field names), properly", - notes: "An array of arrays, even if just a single row.
Papa should add empty fields property to prevent errors.", - input: { data: [["a", "b", "c"]] }, - expected: 'a,b,c' - }, - { - description: "Custom delimiter (semicolon)", - input: [['A', 'b', 'c'], ['d', 'e', 'f']], - config: { delimiter: ';' }, - expected: 'A;b;c\r\nd;e;f' - }, - { - description: "Custom delimiter (tab)", - input: [['Ab', 'cd', 'ef'], ['g', 'h', 'ij']], - config: { delimiter: '\t' }, - expected: 'Ab\tcd\tef\r\ng\th\tij' - }, - { - description: "Custom delimiter (ASCII 30)", - input: [['a', 'b', 'c'], ['d', 'e', 'f']], - config: { delimiter: RECORD_SEP }, - expected: 'a' + RECORD_SEP + 'b' + RECORD_SEP + 'c\r\nd' + RECORD_SEP + 'e' + RECORD_SEP + 'f' - }, - { - description: "Custom delimiter (Multi-character)", - input: [['A', 'b', 'c'], ['d', 'e', 'f']], - config: { delimiter: ', ' }, - expected: 'A, b, c\r\nd, e, f' - }, - { - description: "Bad delimiter (\\n)", - notes: "Should default to comma", - input: [['a', 'b', 'c'], ['d', 'e', 'f']], - config: { delimiter: '\n' }, - expected: 'a,b,c\r\nd,e,f' - }, - { - description: "Custom line ending (\\r)", - input: [['a', 'b', 'c'], ['d', 'e', 'f']], - config: { newline: '\r' }, - expected: 'a,b,c\rd,e,f' - }, - { - description: "Custom line ending (\\n)", - input: [['a', 'b', 'c'], ['d', 'e', 'f']], - config: { newline: '\n' }, - expected: 'a,b,c\nd,e,f' - }, - { - description: "Custom, but strange, line ending ($)", - input: [['a', 'b', 'c'], ['d', 'e', 'f']], - config: { newline: '$' }, - expected: 'a,b,c$d,e,f' - }, - { - description: "Force quotes around all fields", - input: [['a', 'b', 'c'], ['d', 'e', 'f']], - config: { quotes: true }, - expected: '"a","b","c"\r\n"d","e","f"' - }, - { - description: "Force quotes around all fields (with header row)", - input: [{ "Col1": "a", "Col2": "b", "Col3": "c" }, { "Col1": "d", "Col2": "e", "Col3": "f" }], - config: { quotes: true }, - expected: '"Col1","Col2","Col3"\r\n"a","b","c"\r\n"d","e","f"' - }, - { - description: "Force quotes around certain fields only", - input: [['a', 'b', 'c'], ['d', 'e', 'f']], - config: { quotes: [true, false, true] }, - expected: '"a",b,"c"\r\n"d",e,"f"' - }, - { - description: "Force quotes around certain fields only (with header row)", - input: [{ "Col1": "a", "Col2": "b", "Col3": "c" }, { "Col1": "d", "Col2": "e", "Col3": "f" }], - config: { quotes: [true, false, true] }, - expected: '"Col1",Col2,"Col3"\r\n"a",b,"c"\r\n"d",e,"f"' - }, - { - description: "Force quotes around string fields only", - input: [['a', 'b', 'c'], ['d', 10, true]], - config: { quotes: function(value) { return typeof value === 'string'; } }, - expected: '"a","b","c"\r\n"d",10,true' - }, - { - description: "Force quotes around string fields only (with header row)", - input: [{ "Col1": "a", "Col2": "b", "Col3": "c" }, { "Col1": "d", "Col2": 10, "Col3": true }], - config: { quotes: function(value) { return typeof value === 'string'; } }, - expected: '"Col1","Col2","Col3"\r\n"a","b","c"\r\n"d",10,true' - }, - { - description: "Empty input", - input: [], - expected: '' - }, - { - description: "Mismatched field counts in rows", - input: [['a', 'b', 'c'], ['d', 'e'], ['f']], - expected: 'a,b,c\r\nd,e\r\nf' - }, - { - description: "JSON null is treated as empty value", - input: [{ "Col1": "a", "Col2": null, "Col3": "c" }], - expected: 'Col1,Col2,Col3\r\na,,c' - }, - { - description: "Custom quote character (single quote)", - input: [['a,d','b','c']], - config: { quoteChar: "'"}, - expected: "'a,d',b,c" - }, - { - description: "Don't print header if header:false option specified", - input: [{"Col1": "a", "Col2": "b", "Col3": "c"}, {"Col1": "d", "Col2": "e", "Col3": "f"}], - config: {header: false}, - expected: 'a,b,c\r\nd,e,f' - }, - { - description: "Date objects are exported in its ISO representation", - input: [{date: new Date("2018-05-04T21:08:03.269Z"), "not a date": 16}, {date: new Date("Tue May 08 2018 08:20:22 GMT-0700 (PDT)"), "not a date": 32}], - expected: 'date,not a date\r\n2018-05-04T21:08:03.269Z,16\r\n2018-05-08T15:20:22.000Z,32' - }, - { - description: "Returns empty rows when empty rows are passed and skipEmptyLines is false", - input: [[null, ' '], [], ['1', '2']], - config: {skipEmptyLines: false}, - expected: '," "\r\n\r\n1,2' - }, - { - description: "Returns without empty rows when skipEmptyLines is true", - input: [[null, ' '], [], ['1', '2']], - config: {skipEmptyLines: true}, - expected: '," "\r\n1,2' - }, - { - description: "Returns without rows with no content when skipEmptyLines is 'greedy'", - input: [[null, ' '], [], ['1', '2']], - config: {skipEmptyLines: 'greedy'}, - expected: '1,2' - }, - { - description: "Returns empty rows when empty rows are passed and skipEmptyLines is false with headers", - input: [{a: null, b: ' '}, {}, {a: '1', b: '2'}], - config: {skipEmptyLines: false, header: true}, - expected: 'a,b\r\n," "\r\n\r\n1,2' - }, - { - description: "Returns without empty rows when skipEmptyLines is true with headers", - input: [{a: null, b: ' '}, {}, {a: '1', b: '2'}], - config: {skipEmptyLines: true, header: true}, - expected: 'a,b\r\n," "\r\n1,2' - }, - { - description: "Returns without rows with no content when skipEmptyLines is 'greedy' with headers", - input: [{a: null, b: ' '}, {}, {a: '1', b: '2'}], - config: {skipEmptyLines: 'greedy', header: true}, - expected: 'a,b\r\n1,2' - }, - { - description: "Column option used to manually specify keys", - notes: "Should not throw any error when attempting to serialize key not present in object. Columns are different than keys of the first object. When an object is missing a key then the serialized value should be an empty string.", - input: [{a: 1, b: '2'}, {}, {a: 3, d: 'd', c: 4,}], - config: {columns: ['a', 'b', 'c']}, - expected: 'a,b,c\r\n1,2,\r\n\r\n3,,4' - }, - { - description: "Use different escapeChar", - input: [{a: 'foo', b: '"quoted"'}], - config: {header: false, escapeChar: '\\'}, - expected: 'foo,"\\"quoted\\""' - }, - { - description: "test defeault escapeChar", - input: [{a: 'foo', b: '"quoted"'}], - config: {header: false}, - expected: 'foo,"""quoted"""' - }, - { - description: "Escape formulae", - input: [{ "Col1": "=danger", "Col2": "@danger", "Col3": "safe" }, { "Col1": "safe=safe", "Col2": "+danger", "Col3": "-danger, danger" }, { "Col1": "'+safe", "Col2": "'@safe", "Col3": "safe, safe" }], - config: { escapeFormulae: true }, - expected: 'Col1,Col2,Col3\r\n\'=danger,\'@danger,safe\r\nsafe=safe,\'+danger,"\'-danger, danger"\r\n\'+safe,\'@safe,"safe, safe"' - }, - { - description: "Don't escape formulae by default", - input: [{ "Col1": "=danger", "Col2": "@danger", "Col3": "safe" }, { "Col1": "safe=safe", "Col2": "+danger", "Col3": "-danger, danger" }, { "Col1": "'+safe", "Col2": "'@safe", "Col3": "safe, safe" }], - expected: 'Col1,Col2,Col3\r\n=danger,@danger,safe\r\nsafe=safe,+danger,"-danger, danger"\r\n\'+safe,\'@safe,"safe, safe"' - }, - { - description: "Escape formulae with forced quotes", - input: [{ "Col1": "=danger", "Col2": "@danger", "Col3": "safe" }, { "Col1": "safe=safe", "Col2": "+danger", "Col3": "-danger, danger" }, { "Col1": "'+safe", "Col2": "'@safe", "Col3": "safe, safe" }], - config: { escapeFormulae: true, quotes: true }, - expected: '"Col1","Col2","Col3"\r\n"\'=danger","\'@danger","safe"\r\n"safe=safe","\'+danger","\'-danger, danger"\r\n"\'+safe","\'@safe","safe, safe"' - }, - { - description: "Escape formulae with single-quote quoteChar and escapeChar", - input: [{ "Col1": "=danger", "Col2": "@danger", "Col3": "safe" }, { "Col1": "safe=safe", "Col2": "+danger", "Col3": "-danger, danger" }, { "Col1": "'+safe", "Col2": "'@safe", "Col3": "safe, safe" }], - config: { escapeFormulae: true, quoteChar: "'", escapeChar: "'" }, - expected: 'Col1,Col2,Col3\r\n\'\'=danger,\'\'@danger,safe\r\nsafe=safe,\'\'+danger,\'\'\'-danger, danger\'\r\n\'\'+safe,\'\'@safe,\'safe, safe\'' - }, - { - description: "Escape formulae with single-quote quoteChar and escapeChar and forced quotes", - input: [{ "Col1": "=danger", "Col2": "@danger", "Col3": "safe" }, { "Col1": "safe=safe", "Col2": "+danger", "Col3": "-danger, danger" }, { "Col1": "'+safe", "Col2": "'@safe", "Col3": "safe, safe" }], - config: { escapeFormulae: true, quotes: true, quoteChar: "'", escapeChar: "'" }, - expected: '\'Col1\',\'Col2\',\'Col3\'\r\n\'\'\'=danger\',\'\'\'@danger\',\'safe\'\r\n\'safe=safe\',\'\'\'+danger\',\'\'\'-danger, danger\'\r\n\'\'\'+safe\',\'\'\'@safe\',\'safe, safe\'' - }, -]; - -describe('Unparse Tests', function() { - function generateTest(test) { - (test.disabled ? it.skip : it)(test.description, function() { - var actual; - - try { - actual = Papa.unparse(test.input, test.config); - } catch (e) { - if (e instanceof Error) { - throw e; - } - actual = e; - } - - assert.strictEqual(actual, test.expected); - }); - } - - for (var i = 0; i < UNPARSE_TESTS.length; i++) { - generateTest(UNPARSE_TESTS[i]); - } -}); - - - -var CUSTOM_TESTS = [ - { - description: "Pause and resume works (Regression Test for Bug #636)", - disabled: !XHR_ENABLED, - timeout: 30000, - expected: [2001, [ - ["Etiam a dolor vitae est vestibulum","84","DEF"], - ["Etiam a dolor vitae est vestibulum","84","DEF"], - ["Lorem ipsum dolor sit","42","ABC"], - ["Etiam a dolor vitae est vestibulum","84","DEF"], - ["Etiam a dolor vitae est vestibulum","84"], - ["Lorem ipsum dolor sit","42","ABC"], - ["Etiam a dolor vitae est vestibulum","84","DEF"], - ["Etiam a dolor vitae est vestibulum","84","DEF"], - ["Lorem ipsum dolor sit","42","ABC"], - ["Lorem ipsum dolor sit","42"] - ], 0], - run: function(callback) { - var stepped = 0; - var dataRows = []; - var errorCount = 0; - var output = []; - Papa.parse(BASE_PATH + "verylong-sample.csv", { - download: true, - step: function(results, parser) { - stepped++; - if (results) - { - parser.pause(); - parser.resume(); - if (results.data && stepped % 200 === 0) { - dataRows.push(results.data); - } - } - }, - complete: function() { - output.push(stepped); - output.push(dataRows); - output.push(errorCount); - callback(output); - } - }); - } - }, - { - description: "Pause and resume works for chunks with NetworkStreamer", - disabled: !XHR_ENABLED, - timeout: 30000, - expected: ["Etiam a dolor vitae est vestibulum", "84", "DEF"], - run: function(callback) { - var chunkNum = 0; - Papa.parse(BASE_PATH + "verylong-sample.csv", { - download: true, - chunkSize: 1000, - chunk: function(results, parser) { - chunkNum++; - parser.pause(); - - if (chunkNum === 2) { - callback(results.data[0]); - return; - } - - parser.resume(); - }, - complete: function() { - callback(new Error("Should have found matched row before parsing whole file")); - } - }); - } - }, - { - description: "Pause and resume works for chunks with FileStreamer", - disabled: !XHR_ENABLED, - timeout: 30000, - expected: ["Etiam a dolor vitae est vestibulum", "84", "DEF"], - run: function(callback) { - var chunkNum = 0; - var xhr = new XMLHttpRequest(); - xhr.onload = function() { - Papa.parse(new File([xhr.responseText], './verylong-sample.csv'), { - chunkSize: 1000, - chunk: function(results, parser) { - chunkNum++; - parser.pause(); - - if (chunkNum === 2) { - callback(results.data[0]); - return; - } - - parser.resume(); - }, - complete: function() { - callback(new Error("Should have found matched row before parsing whole file")); - } - }); - }; - - xhr.open("GET", BASE_PATH + "verylong-sample.csv"); - try { - xhr.send(); - } catch (err) { - callback(err); - return; - } - } - }, - { - description: "Pause and resume works for chunks with StringStreamer", - disabled: !XHR_ENABLED, - timeout: 30000, - // Test also with string as byte size may be diferent - expected: ["Etiam a dolor vitae est vestibulum", "84", "DEF"], - run: function(callback) { - var chunkNum = 0; - var xhr = new XMLHttpRequest(); - xhr.onload = function() { - Papa.parse(xhr.responseText, { - chunkSize: 1000, - chunk: function(results, parser) { - chunkNum++; - parser.pause(); - - if (chunkNum === 2) { - callback(results.data[0]); - return; - } - - parser.resume(); - }, - complete: function() { - callback(new Error("Should have found matched row before parsing whole file")); - } - }); - }; - - xhr.open("GET", BASE_PATH + "verylong-sample.csv"); - try { - xhr.send(); - } catch (err) { - callback(err); - return; - } - } - }, - { - description: "Complete is called with all results if neither step nor chunk is defined", - expected: [['A', 'b', 'c'], ['d', 'E', 'f'], ['G', 'h', 'i']], - disabled: !FILES_ENABLED, - run: function(callback) { - Papa.parse(new File(['A,b,c\nd,E,f\nG,h,i'], 'sample.csv'), { - chunkSize: 3, - complete: function(response) { - callback(response.data); - } - }); - } - }, - { - description: "Step is called for each row", - expected: 2, - run: function(callback) { - var callCount = 0; - Papa.parse('A,b,c\nd,E,f', { - step: function() { - callCount++; - }, - complete: function() { - callback(callCount); - } - }); - } - }, - { - description: "Data is correctly parsed with steps", - expected: [['A', 'b', 'c'], ['d', 'E', 'f']], - run: function(callback) { - var data = []; - Papa.parse('A,b,c\nd,E,f', { - step: function(results) { - data.push(results.data); - }, - complete: function() { - callback(data); - } - }); - } - }, - { - description: "Data is correctly parsed with steps (headers)", - expected: [{One: 'A', Two: 'b', Three: 'c'}, {One: 'd', Two: 'E', Three: 'f'}], - run: function(callback) { - var data = []; - Papa.parse('One,Two,Three\nA,b,c\nd,E,f', { - header: true, - step: function(results) { - data.push(results.data); - }, - complete: function() { - callback(data); - } - }); - } - }, - { - description: "Data is correctly parsed with steps and worker (headers)", - expected: [{One: 'A', Two: 'b', Three: 'c'}, {One: 'd', Two: 'E', Three: 'f'}], - run: function(callback) { - var data = []; - Papa.parse('One,Two,Three\nA,b,c\nd,E,f', { - header: true, - worker: true, - step: function(results) { - data.push(results.data); - }, - complete: function() { - callback(data); - } - }); - } - }, - { - description: "Data is correctly parsed with steps and worker", - expected: [['A', 'b', 'c'], ['d', 'E', 'f']], - run: function(callback) { - var data = []; - Papa.parse('A,b,c\nd,E,f', { - worker: true, - step: function(results) { - data.push(results.data); - }, - complete: function() { - callback(data); - } - }); - } - }, - { - description: "Data is correctly parsed with steps when skipping empty lines", - expected: [['A', 'b', 'c'], ['d', 'E', 'f']], - run: function(callback) { - var data = []; - Papa.parse('A,b,c\n\nd,E,f', { - skipEmptyLines: true, - step: function(results) { - data.push(results.data); - }, - complete: function() { - callback(data); - } - }); - } - }, - { - description: "Step is called with the contents of the row", - expected: ['A', 'b', 'c'], - run: function(callback) { - Papa.parse('A,b,c', { - step: function(response) { - callback(response.data); - } - }); - } - }, - { - description: "Step is called with the last cursor position", - expected: [6, 12, 17], - run: function(callback) { - var updates = []; - Papa.parse('A,b,c\nd,E,f\nG,h,i', { - step: function(response) { - updates.push(response.meta.cursor); - }, - complete: function() { - callback(updates); - } - }); - } - }, - { - description: "Step exposes cursor for downloads", - expected: [129, 287, 452, 595, 727, 865, 1031, 1209], - disabled: !XHR_ENABLED, - run: function(callback) { - var updates = []; - Papa.parse(BASE_PATH + "long-sample.csv", { - download: true, - step: function(response) { - updates.push(response.meta.cursor); - }, - complete: function() { - callback(updates); - } - }); - } - }, - { - description: "Step exposes cursor for chunked downloads", - expected: [129, 287, 452, 595, 727, 865, 1031, 1209], - disabled: !XHR_ENABLED, - run: function(callback) { - var updates = []; - Papa.parse(BASE_PATH + "long-sample.csv", { - download: true, - chunkSize: 500, - step: function(response) { - updates.push(response.meta.cursor); - }, - complete: function() { - callback(updates); - } - }); - } - }, - { - description: "Step exposes cursor for workers", - expected: [452, 452, 452, 865, 865, 865, 1209, 1209], - disabled: !XHR_ENABLED, - run: function(callback) { - var updates = []; - Papa.parse(BASE_PATH + "long-sample.csv", { - download: true, - chunkSize: 500, - worker: true, - step: function(response) { - updates.push(response.meta.cursor); - }, - complete: function() { - callback(updates); - } - }); - } - }, - { - description: "Chunk is called for each chunk", - expected: [3, 3, 2], - disabled: !XHR_ENABLED, - run: function(callback) { - var updates = []; - Papa.parse(BASE_PATH + "long-sample.csv", { - download: true, - chunkSize: 500, - chunk: function(response) { - updates.push(response.data.length); - }, - complete: function() { - callback(updates); - } - }); - } - }, - { - description: "Chunk is called with cursor position", - expected: [452, 865, 1209], - disabled: !XHR_ENABLED, - run: function(callback) { - var updates = []; - Papa.parse(BASE_PATH + "long-sample.csv", { - download: true, - chunkSize: 500, - chunk: function(response) { - updates.push(response.meta.cursor); - }, - complete: function() { - callback(updates); - } - }); - } - }, - { - description: "Chunk functions can pause parsing", - expected: [ - [['A', 'b', 'c']] - ], - run: function(callback) { - var updates = []; - Papa.parse('A,b,c\nd,E,f\nG,h,i', { - chunkSize: 10, - chunk: function(response, handle) { - updates.push(response.data); - handle.pause(); - callback(updates); - }, - complete: function() { - callback(new Error('incorrect complete callback')); - } - }); - } - }, - { - description: "Chunk functions can resume parsing", - expected: [ - [['A', 'b', 'c']], - [['d', 'E', 'f'], ['G', 'h', 'i']] - ], - run: function(callback) { - var updates = []; - var handle = null; - var first = true; - Papa.parse('A,b,c\nd,E,f\nG,h,i', { - chunkSize: 10, - chunk: function(response, h) { - updates.push(response.data); - if (!first) return; - handle = h; - handle.pause(); - first = false; - }, - complete: function() { - callback(updates); - } - }); - setTimeout(function() { - handle.resume(); - }, 500); - } - }, - { - description: "Chunk functions can abort parsing", - expected: [ - [['A', 'b', 'c']] - ], - run: function(callback) { - var updates = []; - Papa.parse('A,b,c\nd,E,f\nG,h,i', { - chunkSize: 1, - chunk: function(response, handle) { - if (response.data.length) { - updates.push(response.data); - handle.abort(); - } - }, - complete: function(response) { - callback(updates); - } - }); - } - }, - { - description: "Step exposes indexes for files", - expected: [6, 12, 17], - disabled: !FILES_ENABLED, - run: function(callback) { - var updates = []; - Papa.parse(new File(['A,b,c\nd,E,f\nG,h,i'], 'sample.csv'), { - download: true, - step: function(response) { - updates.push(response.meta.cursor); - }, - complete: function() { - callback(updates); - } - }); - } - }, - { - description: "Step exposes indexes for chunked files", - expected: [6, 12, 17], - disabled: !FILES_ENABLED, - run: function(callback) { - var updates = []; - Papa.parse(new File(['A,b,c\nd,E,f\nG,h,i'], 'sample.csv'), { - chunkSize: 3, - step: function(response) { - updates.push(response.meta.cursor); - }, - complete: function() { - callback(updates); - } - }); - } - }, - { - description: "Quoted line breaks near chunk boundaries are handled", - expected: [['A', 'B', 'C'], ['X', 'Y\n1\n2\n3', 'Z']], - disabled: !FILES_ENABLED, - run: function(callback) { - var updates = []; - Papa.parse(new File(['A,B,C\nX,"Y\n1\n2\n3",Z'], 'sample.csv'), { - chunkSize: 3, - step: function(response) { - updates.push(response.data); - }, - complete: function() { - callback(updates); - } - }); - } - }, - { - description: "Step functions can abort parsing", - expected: [['A', 'b', 'c']], - run: function(callback) { - var updates = []; - Papa.parse('A,b,c\nd,E,f\nG,h,i', { - step: function(response, handle) { - updates.push(response.data); - handle.abort(); - callback(updates); - }, - chunkSize: 6 - }); - } - }, - { - description: "Complete is called after aborting", - expected: true, - run: function(callback) { - Papa.parse('A,b,c\nd,E,f\nG,h,i', { - step: function(response, handle) { - handle.abort(); - }, - chunkSize: 6, - complete: function(response) { - callback(response.meta.aborted); - } - }); - } - }, - { - description: "Step functions can pause parsing", - expected: [['A', 'b', 'c']], - run: function(callback) { - var updates = []; - Papa.parse('A,b,c\nd,E,f\nG,h,i', { - step: function(response, handle) { - updates.push(response.data); - handle.pause(); - callback(updates); - }, - complete: function() { - callback('incorrect complete callback'); - } - }); - } - }, - { - description: "Step functions can resume parsing", - expected: [['A', 'b', 'c'], ['d', 'E', 'f'], ['G', 'h', 'i']], - run: function(callback) { - var updates = []; - var handle = null; - var first = true; - Papa.parse('A,b,c\nd,E,f\nG,h,i', { - step: function(response, h) { - updates.push(response.data); - if (!first) return; - handle = h; - handle.pause(); - first = false; - }, - complete: function() { - callback(updates); - } - }); - setTimeout(function() { - handle.resume(); - }, 500); - } - }, - { - description: "Step functions can abort workers", - expected: 1, - disabled: !XHR_ENABLED, - run: function(callback) { - var updates = 0; - Papa.parse(BASE_PATH + "long-sample.csv", { - worker: true, - download: true, - chunkSize: 500, - step: function(response, handle) { - updates++; - handle.abort(); - }, - complete: function() { - callback(updates); - } - }); - } - }, - { - description: "beforeFirstChunk manipulates only first chunk", - expected: 7, - disabled: !XHR_ENABLED, - run: function(callback) { - var updates = 0; - Papa.parse(BASE_PATH + "long-sample.csv", { - download: true, - chunkSize: 500, - beforeFirstChunk: function(chunk) { - return chunk.replace(/.*?\n/, ''); - }, - step: function(response) { - updates++; - }, - complete: function() { - callback(updates); - } - }); - } - }, - { - description: "First chunk not modified if beforeFirstChunk returns nothing", - expected: 8, - disabled: !XHR_ENABLED, - run: function(callback) { - var updates = 0; - Papa.parse(BASE_PATH + "long-sample.csv", { - download: true, - chunkSize: 500, - beforeFirstChunk: function(chunk) { - }, - step: function(response) { - updates++; - }, - complete: function() { - callback(updates); - } - }); - } - }, - { - description: "Should correctly guess custom delimiter when passed delimiters to guess.", - expected: "~", - run: function(callback) { - var results = Papa.parse('"A"~"B"~"C"~"D"', { - delimitersToGuess: ['~', '@', '%'] - }); - callback(results.meta.delimiter); - } - }, - { - description: "Should still correctly guess default delimiters when delimiters to guess are not given.", - expected: ",", - run: function(callback) { - var results = Papa.parse('"A","B","C","D"'); - callback(results.meta.delimiter); - } - } -]; - -describe('Custom Tests', function() { - function generateTest(test) { - (test.disabled ? it.skip : it)(test.description, function(done) { - if(test.timeout) { - this.timeout(test.timeout); - } - test.run(function(actual) { - assert.deepEqual(actual, test.expected); - done(); - }); - }); - } - - for (var i = 0; i < CUSTOM_TESTS.length; i++) { - generateTest(CUSTOM_TESTS[i]); - } -}); diff --git a/node_modules/papaparse/tests/test.js b/node_modules/papaparse/tests/test.js deleted file mode 100644 index 2741831..0000000 --- a/node_modules/papaparse/tests/test.js +++ /dev/null @@ -1,20 +0,0 @@ -var connect = require('connect'); -var serveStatic = require('serve-static'); -var open = require('open'); -var path = require('path'); -var childProcess = require('child_process'); - -var server = connect().use(serveStatic(path.join(__dirname, '/..'))).listen(8071, function() { - if (process.argv.indexOf('--mocha-headless-chrome') !== -1) { - childProcess.spawn('node_modules/.bin/mocha-headless-chrome', ['-f', 'http://localhost:8071/tests/tests.html'], { - stdio: 'inherit' - }).on('exit', function(code) { - server.close(); - process.exit(code); // eslint-disable-line no-process-exit - }); - - } else { - open('http://localhost:8071/tests/tests.html'); - console.log('Serving tests...'); - } -}); diff --git a/node_modules/papaparse/tests/tests.html b/node_modules/papaparse/tests/tests.html deleted file mode 100644 index a3ce51e..0000000 --- a/node_modules/papaparse/tests/tests.html +++ /dev/null @@ -1,22 +0,0 @@ - - - Papa Parse Tests - - - - - - - - - - - -
- - - - diff --git a/node_modules/papaparse/tests/verylong-sample.csv b/node_modules/papaparse/tests/verylong-sample.csv deleted file mode 100644 index 14bc527..0000000 --- a/node_modules/papaparse/tests/verylong-sample.csv +++ /dev/null @@ -1,2001 +0,0 @@ -placeholder,meaning of life,TLD -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -"Lorem ipsum dolor sit",42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42 -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84 -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84 -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42,ABC -Lorem ipsum dolor sit,42,ABC -Etiam a dolor vitae est vestibulum,84,DEF -Lorem ipsum dolor sit,42 -Lorem ipsum dolor sit,42,ABC diff --git a/package-lock.json b/package-lock.json index 04f3203..1dc85d2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ "algoliasearch": "^4.10.3", "axios": "^0.21.1", "fs": "^0.0.1-security", + "google-spreadsheet": "^3.1.15", "https": "^1.0.0", "isomorphic-fetch": "^3.0.0", "json2csv": "^5.0.5", @@ -193,6 +194,28 @@ "@types/node": "*" } }, + "node_modules/abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "dependencies": { + "event-target-shim": "^5.0.0" + }, + "engines": { + "node": ">=6.5" + } + }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, "node_modules/algoliasearch": { "version": "4.10.3", "resolved": "https://registry.npmjs.org/algoliasearch/-/algoliasearch-4.10.3.tgz", @@ -214,12 +237,47 @@ "@algolia/transporter": "4.10.3" } }, + "node_modules/arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", + "engines": { + "node": ">=8" + } + }, "node_modules/axios": { - "version": "0.21.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", - "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", + "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", "dependencies": { - "follow-redirects": "^1.10.0" + "follow-redirects": "^1.14.0" + } + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/bignumber.js": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.1.tgz", + "integrity": "sha512-IdZR9mh6ahOBv/hYGiXyVuyCetmGJhtYkqLBpTStdhEGjegpPlUawydyaF3pbIOFynJTpllEs+NP+CS9jKFLjA==", + "engines": { + "node": "*" } }, "node_modules/bl": { @@ -244,6 +302,11 @@ "node": ">=0.6.19" } }, + "node_modules/buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" + }, "node_modules/cacheable-lookup": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-2.0.1.tgz", @@ -363,6 +426,22 @@ "url": "https://github.com/sponsors/fb55" } }, + "node_modules/debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, "node_modules/decompress-response": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-5.0.0.tgz", @@ -446,6 +525,14 @@ "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=" }, + "node_modules/ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, "node_modules/end-of-stream": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", @@ -462,12 +549,41 @@ "url": "https://github.com/fb55/entities?sponsor=1" } }, + "node_modules/event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", + "engines": { + "node": ">=6" + } + }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "node_modules/fast-text-encoding": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.3.tgz", + "integrity": "sha512-dtm4QZH9nZtcDt8qJiOH9fcQd1NAgi+K1O2DbE6GG1PPCK/BWfOH3idCTRQ4ImXRUOyopDEgDEnVEE7Y/2Wrig==" + }, "node_modules/follow-redirects": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.1.tgz", - "integrity": "sha512-SSG5xmZh1mkPGyKzjZP8zLjltIfpW32Y5QpdNJyjcfGxK3qo3NDDkZOZSFiGn1A6SclQxY9GzEwAHQ3dmYRWpg==", + "version": "1.14.4", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.4.tgz", + "integrity": "sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], "engines": { "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } } }, "node_modules/fs": { @@ -475,6 +591,33 @@ "resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz", "integrity": "sha1-invTcYa23d84E/I4WLV+yq9eQdQ=" }, + "node_modules/gaxios": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-4.3.2.tgz", + "integrity": "sha512-T+ap6GM6UZ0c4E6yb1y/hy2UB6hTrqhglp3XfmU9qbLCGRYhLVV5aRPpC4EmoG8N8zOnkYCgoBz+ScvGAARY6Q==", + "dependencies": { + "abort-controller": "^3.0.0", + "extend": "^3.0.2", + "https-proxy-agent": "^5.0.0", + "is-stream": "^2.0.0", + "node-fetch": "^2.6.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/gcp-metadata": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-4.3.1.tgz", + "integrity": "sha512-x850LS5N7V1F3UcV7PoupzGsyD6iVwTVvsh3tbXfkctZnBnjW5yu5z1/3k3SehF7TyoTIe78rJs02GMMy+LF+A==", + "dependencies": { + "gaxios": "^4.0.0", + "json-bigint": "^1.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/get-stream": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", @@ -486,6 +629,52 @@ "node": ">=8" } }, + "node_modules/google-auth-library": { + "version": "6.1.6", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-6.1.6.tgz", + "integrity": "sha512-Q+ZjUEvLQj/lrVHF/IQwRo6p3s8Nc44Zk/DALsN+ac3T4HY/g/3rrufkgtl+nZ1TW7DNAw5cTChdVp4apUXVgQ==", + "dependencies": { + "arrify": "^2.0.0", + "base64-js": "^1.3.0", + "ecdsa-sig-formatter": "^1.0.11", + "fast-text-encoding": "^1.0.0", + "gaxios": "^4.0.0", + "gcp-metadata": "^4.2.0", + "gtoken": "^5.0.4", + "jws": "^4.0.0", + "lru-cache": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/google-p12-pem": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-3.1.2.tgz", + "integrity": "sha512-tjf3IQIt7tWCDsa0ofDQ1qqSCNzahXDxdAGJDbruWqu3eCg5CKLYKN+hi0s6lfvzYZ1GDVr+oDF9OOWlDSdf0A==", + "dependencies": { + "node-forge": "^0.10.0" + }, + "bin": { + "gp12-pem": "build/src/bin/gp12-pem.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/google-spreadsheet": { + "version": "3.1.15", + "resolved": "https://registry.npmjs.org/google-spreadsheet/-/google-spreadsheet-3.1.15.tgz", + "integrity": "sha512-S5477f3Gf3Mz6AXgCw7dbaYnzu5aHou1AX4sDqrGboQWnAytkxqJGKQiXN+zzRTTcYzSTJCe0g7KqCPZO9xiOw==", + "dependencies": { + "axios": "^0.21.1", + "google-auth-library": "^6.1.3", + "lodash": "^4.17.20" + }, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/got": { "version": "10.7.0", "resolved": "https://registry.npmjs.org/got/-/got-10.7.0.tgz", @@ -511,6 +700,19 @@ "node": ">=10" } }, + "node_modules/gtoken": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-5.3.1.tgz", + "integrity": "sha512-yqOREjzLHcbzz1UrQoxhBtpk8KjrVhuqPE7od1K2uhyxG2BHjKZetlbLw/SPZak/QqTIQW+addS+EcjqQsZbwQ==", + "dependencies": { + "gaxios": "^4.0.0", + "google-p12-pem": "^3.0.3", + "jws": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/htmlparser2": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-6.1.0.tgz", @@ -539,6 +741,18 @@ "resolved": "https://registry.npmjs.org/https/-/https-1.0.0.tgz", "integrity": "sha1-PDfHrhqO65ZpBKKtHpdaGUt+06Q=" }, + "node_modules/https-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", + "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", @@ -555,6 +769,17 @@ "node": ">=8" } }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-wsl": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", @@ -580,6 +805,14 @@ "whatwg-fetch": "^3.4.1" } }, + "node_modules/json-bigint": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", + "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==", + "dependencies": { + "bignumber.js": "^9.0.0" + } + }, "node_modules/json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", @@ -610,6 +843,25 @@ "node >= 0.2.0" ] }, + "node_modules/jwa": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz", + "integrity": "sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==", + "dependencies": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jws": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz", + "integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==", + "dependencies": { + "jwa": "^2.0.0", + "safe-buffer": "^5.0.1" + } + }, "node_modules/keyv": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.0.3.tgz", @@ -618,6 +870,11 @@ "json-buffer": "3.0.1" } }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, "node_modules/lodash.get": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", @@ -631,6 +888,17 @@ "node": ">=8" } }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/memory-pager": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz", @@ -683,6 +951,11 @@ } } }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, "node_modules/node-fetch": { "version": "2.6.1", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", @@ -691,6 +964,14 @@ "node": "4.x || >=6.0.0" } }, + "node_modules/node-forge": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.10.0.tgz", + "integrity": "sha512-PPmu8eEeG9saEUvI97fm4OYxXVB6bFvyNTyiUOBichBpFG8A1Ljw3bY62+5oOjDEMHRnd0Y7HQ+x7uzxOzC6JA==", + "engines": { + "node": ">= 6.0.0" + } + }, "node_modules/normalize-url": { "version": "4.5.1", "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.1.tgz", @@ -700,9 +981,9 @@ } }, "node_modules/nth-check": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.0.0.tgz", - "integrity": "sha512-i4sc/Kj8htBrAiH1viZ0TgU8Y5XqCaV/FziYK6TBczxmeKm3AEFWqqF3195yKudrarqy7Zu80Ra5dobFjn9X/Q==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.0.1.tgz", + "integrity": "sha512-it1vE95zF6dTT9lBsYbxvqh0Soy4SPowchj0UBGj/V6cTPnXXtQOPUbhZ6CmGzAD/rW22LQK6E96pcdJXk4A4w==", "dependencies": { "boolbase": "^1.0.0" }, @@ -949,6 +1230,11 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" } }, "dependencies": { @@ -1117,6 +1403,22 @@ "@types/node": "*" } }, + "abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "requires": { + "event-target-shim": "^5.0.0" + } + }, + "agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "requires": { + "debug": "4" + } + }, "algoliasearch": { "version": "4.10.3", "resolved": "https://registry.npmjs.org/algoliasearch/-/algoliasearch-4.10.3.tgz", @@ -1138,14 +1440,29 @@ "@algolia/transporter": "4.10.3" } }, + "arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==" + }, "axios": { - "version": "0.21.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", - "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", + "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", "requires": { - "follow-redirects": "^1.10.0" + "follow-redirects": "^1.14.0" } }, + "base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" + }, + "bignumber.js": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.1.tgz", + "integrity": "sha512-IdZR9mh6ahOBv/hYGiXyVuyCetmGJhtYkqLBpTStdhEGjegpPlUawydyaF3pbIOFynJTpllEs+NP+CS9jKFLjA==" + }, "bl": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/bl/-/bl-2.2.1.tgz", @@ -1165,6 +1482,11 @@ "resolved": "https://registry.npmjs.org/bson/-/bson-1.1.6.tgz", "integrity": "sha512-EvVNVeGo4tHxwi8L6bPj3y3itEvStdwvvlojVxxbyYfoaxJ6keLgrTuKdyfEAszFK+H3olzBuafE0yoh0D1gdg==" }, + "buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" + }, "cacheable-lookup": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-2.0.1.tgz", @@ -1256,6 +1578,14 @@ "resolved": "https://registry.npmjs.org/css-what/-/css-what-5.0.1.tgz", "integrity": "sha512-FYDTSHb/7KXsWICVsxdmiExPjCfRC4qRFBdVwv7Ax9hMnvMmEjP9RfxTEZ3qPZGmADDn2vAKSo9UcN1jKVYscg==" }, + "debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "requires": { + "ms": "2.1.2" + } + }, "decompress-response": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-5.0.0.tgz", @@ -1312,6 +1642,14 @@ "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=" }, + "ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "requires": { + "safe-buffer": "^5.0.1" + } + }, "end-of-stream": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", @@ -1325,16 +1663,52 @@ "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz", "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==" }, + "event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==" + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "fast-text-encoding": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.3.tgz", + "integrity": "sha512-dtm4QZH9nZtcDt8qJiOH9fcQd1NAgi+K1O2DbE6GG1PPCK/BWfOH3idCTRQ4ImXRUOyopDEgDEnVEE7Y/2Wrig==" + }, "follow-redirects": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.1.tgz", - "integrity": "sha512-SSG5xmZh1mkPGyKzjZP8zLjltIfpW32Y5QpdNJyjcfGxK3qo3NDDkZOZSFiGn1A6SclQxY9GzEwAHQ3dmYRWpg==" + "version": "1.14.4", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.4.tgz", + "integrity": "sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g==" }, "fs": { "version": "0.0.1-security", "resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz", "integrity": "sha1-invTcYa23d84E/I4WLV+yq9eQdQ=" }, + "gaxios": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-4.3.2.tgz", + "integrity": "sha512-T+ap6GM6UZ0c4E6yb1y/hy2UB6hTrqhglp3XfmU9qbLCGRYhLVV5aRPpC4EmoG8N8zOnkYCgoBz+ScvGAARY6Q==", + "requires": { + "abort-controller": "^3.0.0", + "extend": "^3.0.2", + "https-proxy-agent": "^5.0.0", + "is-stream": "^2.0.0", + "node-fetch": "^2.6.1" + } + }, + "gcp-metadata": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-4.3.1.tgz", + "integrity": "sha512-x850LS5N7V1F3UcV7PoupzGsyD6iVwTVvsh3tbXfkctZnBnjW5yu5z1/3k3SehF7TyoTIe78rJs02GMMy+LF+A==", + "requires": { + "gaxios": "^4.0.0", + "json-bigint": "^1.0.0" + } + }, "get-stream": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", @@ -1343,6 +1717,40 @@ "pump": "^3.0.0" } }, + "google-auth-library": { + "version": "6.1.6", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-6.1.6.tgz", + "integrity": "sha512-Q+ZjUEvLQj/lrVHF/IQwRo6p3s8Nc44Zk/DALsN+ac3T4HY/g/3rrufkgtl+nZ1TW7DNAw5cTChdVp4apUXVgQ==", + "requires": { + "arrify": "^2.0.0", + "base64-js": "^1.3.0", + "ecdsa-sig-formatter": "^1.0.11", + "fast-text-encoding": "^1.0.0", + "gaxios": "^4.0.0", + "gcp-metadata": "^4.2.0", + "gtoken": "^5.0.4", + "jws": "^4.0.0", + "lru-cache": "^6.0.0" + } + }, + "google-p12-pem": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-3.1.2.tgz", + "integrity": "sha512-tjf3IQIt7tWCDsa0ofDQ1qqSCNzahXDxdAGJDbruWqu3eCg5CKLYKN+hi0s6lfvzYZ1GDVr+oDF9OOWlDSdf0A==", + "requires": { + "node-forge": "^0.10.0" + } + }, + "google-spreadsheet": { + "version": "3.1.15", + "resolved": "https://registry.npmjs.org/google-spreadsheet/-/google-spreadsheet-3.1.15.tgz", + "integrity": "sha512-S5477f3Gf3Mz6AXgCw7dbaYnzu5aHou1AX4sDqrGboQWnAytkxqJGKQiXN+zzRTTcYzSTJCe0g7KqCPZO9xiOw==", + "requires": { + "axios": "^0.21.1", + "google-auth-library": "^6.1.3", + "lodash": "^4.17.20" + } + }, "got": { "version": "10.7.0", "resolved": "https://registry.npmjs.org/got/-/got-10.7.0.tgz", @@ -1365,6 +1773,16 @@ "type-fest": "^0.10.0" } }, + "gtoken": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-5.3.1.tgz", + "integrity": "sha512-yqOREjzLHcbzz1UrQoxhBtpk8KjrVhuqPE7od1K2uhyxG2BHjKZetlbLw/SPZak/QqTIQW+addS+EcjqQsZbwQ==", + "requires": { + "gaxios": "^4.0.0", + "google-p12-pem": "^3.0.3", + "jws": "^4.0.0" + } + }, "htmlparser2": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-6.1.0.tgz", @@ -1386,6 +1804,15 @@ "resolved": "https://registry.npmjs.org/https/-/https-1.0.0.tgz", "integrity": "sha1-PDfHrhqO65ZpBKKtHpdaGUt+06Q=" }, + "https-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", + "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", + "requires": { + "agent-base": "6", + "debug": "4" + } + }, "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", @@ -1396,6 +1823,11 @@ "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.1.1.tgz", "integrity": "sha512-ZOoqiXfEwtGknTiuDEy8pN2CfE3TxMHprvNer1mXiqwkOT77Rw3YVrUQ52EqAOU3QAWDQ+bQdx7HJzrv7LS2Hw==" }, + "is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==" + }, "is-wsl": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", @@ -1418,6 +1850,14 @@ "whatwg-fetch": "^3.4.1" } }, + "json-bigint": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", + "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==", + "requires": { + "bignumber.js": "^9.0.0" + } + }, "json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", @@ -1438,6 +1878,25 @@ "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=" }, + "jwa": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz", + "integrity": "sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==", + "requires": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "jws": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz", + "integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==", + "requires": { + "jwa": "^2.0.0", + "safe-buffer": "^5.0.1" + } + }, "keyv": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.0.3.tgz", @@ -1446,6 +1905,11 @@ "json-buffer": "3.0.1" } }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, "lodash.get": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", @@ -1456,6 +1920,14 @@ "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==" }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "requires": { + "yallist": "^4.0.0" + } + }, "memory-pager": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz", @@ -1480,20 +1952,30 @@ "saslprep": "^1.0.0" } }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, "node-fetch": { "version": "2.6.1", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" }, + "node-forge": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.10.0.tgz", + "integrity": "sha512-PPmu8eEeG9saEUvI97fm4OYxXVB6bFvyNTyiUOBichBpFG8A1Ljw3bY62+5oOjDEMHRnd0Y7HQ+x7uzxOzC6JA==" + }, "normalize-url": { "version": "4.5.1", "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.1.tgz", "integrity": "sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA==" }, "nth-check": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.0.0.tgz", - "integrity": "sha512-i4sc/Kj8htBrAiH1viZ0TgU8Y5XqCaV/FziYK6TBczxmeKm3AEFWqqF3195yKudrarqy7Zu80Ra5dobFjn9X/Q==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.0.1.tgz", + "integrity": "sha512-it1vE95zF6dTT9lBsYbxvqh0Soy4SPowchj0UBGj/V6cTPnXXtQOPUbhZ6CmGzAD/rW22LQK6E96pcdJXk4A4w==", "requires": { "boolbase": "^1.0.0" } @@ -1694,6 +2176,11 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" } } } diff --git a/package.json b/package.json index f18d071..a44b55b 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "algoliasearch": "^4.10.3", "axios": "^0.21.1", "fs": "^0.0.1-security", + "google-spreadsheet": "^3.1.15", "https": "^1.0.0", "isomorphic-fetch": "^3.0.0", "json2csv": "^5.0.5", diff --git a/src/index.js b/src/index.js index 4ad8740..d8d3f85 100644 --- a/src/index.js +++ b/src/index.js @@ -21,6 +21,7 @@ import {polymarket} from "./platforms/polymarket-fetch.js" import {predictit} from "./platforms/predictit-fetch.js" import {rootclaim} from "./platforms/rootclaim-fetch.js" import {smarkets} from "./platforms/smarkets-fetch.js" +import {wildeford} from "./platforms/wildeford-fetch.js" import {williamhill} from "./platforms/williamhill-fetch.js" import {mergeEverything} from "./utils/mergeEverything.js" import {updateHistory} from "./utils/history/updateHistory.js" @@ -29,57 +30,57 @@ import {rebuildNetlifySiteWithNewData} from "./utils/rebuildNetliftySiteWithNewD import {doEverything, tryCatchTryAgain} from "./utils/doEverything.js" /* Support functions */ -let functions = [astralcodexten, betfair, coupcast, csetforetell, elicit, /* estimize, */ fantasyscotus, foretold, goodjudgment, goodjudgmentopen, hypermind, kalshi, ladbrokes, metaculus, omen, polymarket, predictit, rootclaim, smarkets, williamhill, mergeEverything, updateHistory, rebuildAlgoliaDatabase, rebuildNetlifySiteWithNewData, doEverything] +let functions = [astralcodexten, betfair, coupcast, csetforetell, elicit, /* estimize, */ fantasyscotus, foretold, goodjudgment, goodjudgmentopen, hypermind, kalshi, ladbrokes, metaculus, omen, polymarket, predictit, rootclaim, smarkets, wildeford, williamhill, mergeEverything, updateHistory, rebuildAlgoliaDatabase, rebuildNetlifySiteWithNewData, doEverything] let functionNames = functions.map(fun => fun.name) let whattodoMessage = functionNames - .slice(0,functionNames.length-5) - .map((functionName,i) => `[${i}]: Download predictions from ${functionName}`) - .join('\n') + - `\n[${functionNames.length-5}]: Merge jsons them into one big json (and push it to mongodb database)` + - `\n[${functionNames.length-4}]: Update history` + - `\n[${functionNames.length-3}]: Rebuild algolia database ("index")` + - `\n[${functionNames.length-2}]: Rebuild netlify site with new data` + - // `\n[${functionNames.length-1}]: Add to history` + - `\n[${functionNames.length-1}]: All of the above` + - `\nChoose one option, wisely: #` + .slice(0,functionNames.length-5) + .map((functionName,i) => `[${i}]: Download predictions from ${functionName}`) + .join('\n') + + `\n[${functionNames.length-5}]: Merge jsons them into one big json (and push it to mongodb database)` + + `\n[${functionNames.length-4}]: Update history` + + `\n[${functionNames.length-3}]: Rebuild algolia database ("index")` + + `\n[${functionNames.length-2}]: Rebuild netlify site with new data` + + // `\n[${functionNames.length-1}]: Add to history` + + `\n[${functionNames.length-1}]: All of the above` + + `\nChoose one option, wisely: #` /* BODY */ let commandLineUtility = async () => { - let whattodo = async (message,callback) => { - const rl = readline.createInterface({ - input: process.stdin, - output: process.stdout - }); - rl.question(message, async (answer) => { - rl.close(); - await callback(answer) - }); - } + let whattodo = async (message,callback) => { + const rl = readline.createInterface({ + input: process.stdin, + output: process.stdout + }); + rl.question(message, async (answer) => { + rl.close(); + await callback(answer) + }); + } - let executeoption = async (option) => { - option = Number(option) - //console.log(functionNames[option]) - if(option < 0){ - console.log(`Error, ${option} < 0 or ${option} < 0`) - }else if(option < functions.length){ - await tryCatchTryAgain(functions[option]) - } - } + let executeoption = async (option) => { + option = Number(option) + //console.log(functionNames[option]) + if(option < 0){ + console.log(`Error, ${option} < 0 or ${option} < 0`) + }else if(option < functions.length){ + await tryCatchTryAgain(functions[option]) + } + } - if(process.argv.length==3){ - const option = process.argv[2] // e.g., npm start 15 <- - const optionNum = Number(option) - if(!isNaN(optionNum)){ - await executeoption(optionNum) - }else if(option == "all"){ - await executeoption(functions.length-1) // 15 = execute all fetchers - }else{ - await whattodo(whattodoMessage, executeoption) - } - }else( - await whattodo(whattodoMessage, executeoption) - ) + if(process.argv.length==3){ + const option = process.argv[2] // e.g., npm start 15 <- + const optionNum = Number(option) + if(!isNaN(optionNum)){ + await executeoption(optionNum) + }else if(option == "all"){ + await executeoption(functions.length-1) // 15 = execute all fetchers + }else{ + await whattodo(whattodoMessage, executeoption) + } + }else( + await whattodo(whattodoMessage, executeoption) + ) } // console.log("1") diff --git a/src/platforms/csetforetell-fetch.js b/src/platforms/csetforetell-fetch.js index 21ad883..e43b3ad 100644 --- a/src/platforms/csetforetell-fetch.js +++ b/src/platforms/csetforetell-fetch.js @@ -1,50 +1,50 @@ /* Imports */ import axios from "axios" -import {getCookie, applyIfCookieExists} from "../utils/getCookies.js" -import {Tabletojson} from "tabletojson" +import { getCookie, applyIfCookieExists } from "../utils/getCookies.js" +import { Tabletojson } from "tabletojson" import toMarkdown from "../utils/toMarkdown.js" -import {calculateStars} from "../utils/stars.js" -import {upsert} from "../utils/mongo-wrapper.js" +import { calculateStars } from "../utils/stars.js" +import { upsert } from "../utils/mongo-wrapper.js" /* Definitions */ let htmlEndPoint = 'https://www.cset-foretell.com/questions?page=' String.prototype.replaceAll = function replaceAll(search, replace) { return this.split(search).join(replace); } -const DEBUG_MODE = "off" // "on" +const DEBUG_MODE = "on"// "off" /* Support functions */ -async function fetchPage(page, cookie){ +async function fetchPage(page, cookie) { console.log(`Page #${page}`) - if(page==1){ - cookie=cookie.split(";")[0] // Interesting that it otherwise doesn't work :( + if (page == 1) { + cookie = cookie.split(";")[0] // Interesting that it otherwise doesn't work :( } - let urlEndpoint = htmlEndPoint+page + let urlEndpoint = htmlEndPoint + page console.log(urlEndpoint) - let response = await axios({ + let response = await axios({ url: urlEndpoint, method: 'GET', - headers: ({ - 'Content-Type': 'text/html', - 'Cookie': cookie + headers: ({ + 'Content-Type': 'text/html', + 'Cookie': cookie }), }) - .then(res => res.data) + .then(res => res.data) // console.log(response) return response } -async function fetchStats(questionUrl, cookie){ - let response = await axios({ - url: questionUrl+"/stats", +async function fetchStats(questionUrl, cookie) { + let response = await axios({ + url: questionUrl + "/stats", method: 'GET', - headers: ({ - 'Content-Type': 'text/html', - 'Cookie': cookie, - 'Referer': questionUrl, + headers: ({ + 'Content-Type': 'text/html', + 'Cookie': cookie, + 'Referer': questionUrl, }), }) - .then(res => res.data) - - if(response.includes("Sign up or sign in to forecast")){ + .then(res => res.data) + + if (response.includes("Sign up or sign in to forecast")) { throw Error("Not logged in") } @@ -52,24 +52,24 @@ async function fetchStats(questionUrl, cookie){ let isbinary = response.includes("binary?":true") // console.log(`is binary? ${isbinary}`) let options = [] - if(isbinary){ + if (isbinary) { // Crowd percentage let htmlElements = response.split("\n") // console.log(htmlElements) let h3Element = htmlElements.filter(str => str.includes("

"))[0] let crowdpercentage = h3Element.split(">")[1].split("<")[0] - let probability = Number(crowdpercentage.replace("%", ""))/100 + let probability = Number(crowdpercentage.replace("%", "")) / 100 options.push(({ name: "Yes", probability: probability, type: "PROBABILITY" }), ({ name: "No", - probability: +(1-probability).toFixed(2), // avoids floating point shenanigans + probability: +(1 - probability).toFixed(2), // avoids floating point shenanigans type: "PROBABILITY" })) - }else{ - try{ + } else { + try { let optionsBody = response.split("tbody")[1] // Previously [1], then previously [3] but they added a new table. // console.log(optionsBody) let optionsHtmlElement = "" @@ -77,27 +77,27 @@ async function fetchStats(questionUrl, cookie){ let firstTable = tablesAsJson[0] options = firstTable.map(element => ({ name: element['0'], - probability: Number(element['1'].replace("%",""))/100, + probability: Number(element['1'].replace("%", "")) / 100, type: "PROBABILITY" })) - }catch(error){ + } catch (error) { let optionsBody = response.split("tbody")[3] // Catch if the error is related to table position let optionsHtmlElement = "" let tablesAsJson = Tabletojson.convert(optionsHtmlElement) let firstTable = tablesAsJson[0] - if(firstTable){ + if (firstTable) { options = firstTable.map(element => ({ name: element['0'], - probability: Number(element['1'].replace("%",""))/100, + probability: Number(element['1'].replace("%", "")) / 100, type: "PROBABILITY" })) - }else{ + } else { // New type of question, tricky to parse the options // Just leave options = [] for now. // https://www.cset-foretell.com/blog/rolling-question-formats - } + } } - + } // Description let descriptionraw = response.split(`", "") let descriptionprocessed3 = descriptionprocessed2.replace("To suggest a change or clarification to this question, please select Request Clarification from the green gear-shaped dropdown button to the right of the question.", ``) // console.log(descriptionprocessed3) - let descriptionprocessed4=descriptionprocessed3.replaceAll("\r\n\r\n", "\n") - let descriptionprocessed5= descriptionprocessed4.replaceAll("\n\n", "\n") - let descriptionprocessed6=descriptionprocessed5.replaceAll(""", `"`) - let descriptionprocessed7=descriptionprocessed6.replaceAll("'", "'") - let descriptionprocessed8=toMarkdown(descriptionprocessed7) + let descriptionprocessed4 = descriptionprocessed3.replaceAll("\r\n\r\n", "\n") + let descriptionprocessed5 = descriptionprocessed4.replaceAll("\n\n", "\n") + let descriptionprocessed6 = descriptionprocessed5.replaceAll(""", `"`) + let descriptionprocessed7 = descriptionprocessed6.replaceAll("'", "'") + let descriptionprocessed8 = toMarkdown(descriptionprocessed7) let description = descriptionprocessed8 // Number of forecasts @@ -121,34 +121,34 @@ async function fetchStats(questionUrl, cookie){ // Number of predictors let numforecasters = response.split("predictors_count":")[1].split(",")[0] // console.log(numpredictors) - + let result = { - "description": description, + "description": description, "options": options, "timestamp": new Date().toISOString(), "qualityindicators": { - "numforecasts":Number(numforecasts), - "numforecasters":Number(numforecasters), - "stars": calculateStars("CSET-foretell", {numforecasts}) + "numforecasts": Number(numforecasts), + "numforecasters": Number(numforecasters), + "stars": calculateStars("CSET-foretell", { numforecasts }) } } - + return result } -function isSignedIn(html){ - - let isSignedInBool = ! ( html.includes("You need to sign in or sign up before continuing") || html.includes("Sign up") ) - if(!isSignedInBool){ +function isSignedIn(html) { + + let isSignedInBool = !(html.includes("You need to sign in or sign up before continuing") || html.includes("Sign up")) + if (!isSignedInBool) { console.log("Error: Not signed in.") } console.log(`Signed in? ${isSignedInBool}`) return isSignedInBool } -function isEnd(html){ +function isEnd(html) { let isEndBool = html.includes("No questions match your filter") - if(isEndBool){ + if (isEndBool) { //console.log(html) } console.log(`IsEnd? ${isEndBool}`) @@ -161,18 +161,18 @@ function sleep(ms) { /* Body */ -async function csetforetell_inner(cookie){ - let i=1 +async function csetforetell_inner(cookie) { + let i = 1 let response = await fetchPage(i, cookie) let results = [] let init = Date.now() // console.log("Downloading... This might take a couple of minutes. Results will be shown.") - while(!isEnd(response) && isSignedIn(response)){ - - let htmlLines = response.split("\n") - let h4elements = htmlLines.filter(str => str.includes("
str.includes("
') let url = h4elementSplit[0].split('
', "") - await sleep(1000 + Math.random()*1000) // don't be as noticeable + await sleep(1000 + Math.random() * 1000) // don't be as noticeable - try{ + try { let moreinfo = await fetchStats(url, cookie) let question = ({ - "title": title, - "url": url, - "platform": "CSET-foretell", - ...moreinfo - }) - if(i % 30 == 0 && !(process.env.DEBUG_MODE == "on" || DEBUG_MODE == "on")){ - console.log(`Page #${i}` && !(process.env.DEBUG_MODE == "on" || DEBUG_MODE == "on")) - console.log(question) - } - results.push(question) - if(process.env.DEBUG_MODE == "on" || DEBUG_MODE == "on"){ - console.log(url) - console.log(question) - } + "title": title, + "url": url, + "platform": "CSET-foretell", + ...moreinfo + }) + if (i % 30 == 0 && !(process.env.DEBUG_MODE == "on" || DEBUG_MODE == "on")) { + console.log(`Page #${i}` && !(process.env.DEBUG_MODE == "on" || DEBUG_MODE == "on")) + console.log(question) + } + results.push(question) + if (process.env.DEBUG_MODE == "on" || DEBUG_MODE == "on") { + console.log(url) + console.log(question) + } - } catch(error){ + } catch (error) { console.log(error) console.log(`We encountered some error when fetching the URL: ${url}, so it won't appear on the final json`) } } - + i++ //i=Number(i)+1 console.log("Sleeping for ~5secs so as to not be as noticeable to the cset-foretell servers") - await sleep(5000 + Math.random()*1000) // don't be as noticeable - - try{ + await sleep(5000 + Math.random() * 1000) // don't be as noticeable + + try { response = await fetchPage(i, cookie) - }catch(error){ + } catch (error) { console.log(error) console.log(`The program encountered some error when fetching page #${i}, so it won't appear on the final json. It is possible that this page wasn't actually a prediction question pages`) } @@ -229,19 +229,19 @@ async function csetforetell_inner(cookie){ // let string = JSON.stringify(results,null, 2) // fs.writeFileSync('./data/csetforetell-questions.json', string); // console.log(results) - if(results.length > 0){ + if (results.length > 0) { await upsert(results, "csetforetell-questions") - }else{ + } else { console.log("Not updating results, as process was not signed in") } - + let end = Date.now() - let difference = end-init - console.log(`Took ${difference/1000} seconds, or ${difference/(1000*60)} minutes.`) + let difference = end - init + console.log(`Took ${difference / 1000} seconds, or ${difference / (1000 * 60)} minutes.`) } -export async function csetforetell(){ - let cookie = process.env.CSETFORETELL_COOKIE || getCookie("csetforetell") +export async function csetforetell() { + let cookie = process.env.CSETFORETELL_COOKIE || getCookie("csetforetell") await applyIfCookieExists(cookie, csetforetell_inner) } diff --git a/src/platforms/wildeford-fetch.js b/src/platforms/wildeford-fetch.js new file mode 100644 index 0000000..6347bda --- /dev/null +++ b/src/platforms/wildeford-fetch.js @@ -0,0 +1,120 @@ +/* Imports */ +import fs from 'fs' +// import axios from "axios" +import { GoogleSpreadsheet } from "google-spreadsheet" +import {getCookie, applyIfCookieExists} from "../utils/getCookies.js" +import toMarkdown from "../utils/toMarkdown.js" +import { calculateStars } from "../utils/stars.js" +import {upsert} from "../utils/mongo-wrapper.js" + +/* Definitions */ +const GOOGLE_API_KEY = process.env.GOOGLE_API_KEY || getCookie("google-api") // See: https://developers.google.com/sheets/api/guides/authorizing#APIKey +const SHEET_ID = "1xcgYF7Q0D95TPHLLSgwhWBHFrWZUGJn7yTyAhDR4vi0" // spreadsheet key is the long id in the sheets URL +const endpoint = `https://docs.google.com/spreadsheets/d/${SHEET_ID}/edit#gid=0` +// https://docs.google.com/spreadsheets/d/1xcgYF7Q0D95TPHLLSgwhWBHFrWZUGJn7yTyAhDR4vi0/edit#gid=0&range=C4 + +/* Support functions */ + +const formatRow = row => { + let colNames = ["Prediction Date", "Prediction", "Odds", "Actual", "Resolution Date", "Prediction Right?", "Brier Score", "Notes"] + let result = ({}) + row.forEach((col,i) => { + result[colNames[i]] = col + }) + return result +} + +async function fetchGoogleDoc(google_api_key){ + // https://gist.github.com/micalevisk/9bc831bd4b3e5a3f62b9810330129c59 + let results = [] + const doc = new GoogleSpreadsheet(SHEET_ID) + doc.useApiKey(google_api_key) + + await doc.loadInfo() // loads document properties and worksheets + console.log('>>', doc.title) + + const sheet = doc.sheetsByIndex[0] + const rows = await sheet.getRows({ offset:0, }) + + console.log('# ' + + rows[0]._sheet.headerValues.join(',') + ) + let isEnd = false; + for (let i in rows) { + let data = rows[i]._rawData + if(data.length == 0) isEnd = true; + if(!isEnd){ + let result = ({...formatRow(data), "url": endpoint + `&range=A${i}`}) + // console.log(result) + results.push(result) + + // console.log(rows[i]) + // console.log(rows[i]._rawData) + // console.log(rows[i]["Prediction"]) + } + // console.log(row._rawData.join(',')) + // console.log(row._rawData.join(',')) + } + // console.log(results) + return(results) +} + +async function processPredictions(predictions){ + let currentPredictions = predictions.filter(prediction => prediction["Actual"] == "Unknown" ) + let results = currentPredictions.map(prediction => { + let probability = Number(prediction["Odds"].replace("%", ""))/100 + let options = [ + { + "name": "Yes", + "probability": probability, + "type": "PROBABILITY" + }, + { + "name": "No", + "probability": 1 - probability, + "type": "PROBABILITY" + } + ] + let result = ({ + "title": prediction["Prediction"], + "url": prediction["url"], + "platform": "Peter Wildeford", + "description": prediction["Notes"] || "", + "options": options, + "timestamp": new Date(Date.parse(prediction["Prediction Date"] + "Z")).toISOString(), + "qualityindicators": { + "stars": calculateStars("Peter Wildeford"), + } + }) + return result + }) + results = results.map(result => ({...result, title: result.title.replace(" [update]", "")})).reverse() + + let uniqueTitles = [] + let uniqueResults = [] + results.forEach(result => { + if(!uniqueTitles.includes(result.title)) uniqueResults.push(result) + uniqueTitles.push(result.title) + }) + return(uniqueResults) + // console.log(results) + // console.log(results.map(result => result.options)) +} +// processPredictions() + +/* Body */ +export async function wildeford_inner(google_api_key) { + let predictions = await fetchGoogleDoc(google_api_key) + let results = await processPredictions(predictions) // somehow needed + // console.log(results) + // let string = JSON.stringify(results, null, 2) + // fs.writeFileSync('polyprediction-questions.json', string); + await upsert(results, "wildeford-questions") + console.log("Done") +} +//example() + +export async function wildeford(){ + await applyIfCookieExists(GOOGLE_API_KEY, wildeford_inner) +} + diff --git a/src/utils/.mergeEverything.js.swp b/src/utils/.mergeEverything.js.swp new file mode 100644 index 0000000000000000000000000000000000000000..a9f24bca6e37fb23d697b0e8619d6ebae15d2f10 GIT binary patch literal 12288 zcmeI2Kabr+5WqJnLIDYYeQdeit@an$eMb(<2d)}AurZXC^H2uY#I?dj;~})= zGL#)e)!NfC>DE1hzuT%Guxy6vi#`?18h8&G4&QD;?#~2ky-M`__WbX9A9T=c82N*jBO`Y!$V$}Ia0QI?a z5B9B$E-EvZu>}tjXNKji&6w@Up~8S&#C9v64iG44IG_qoGe5D!62`Mdr}`WW&`h$t z|EbJ3MNv%pT)IAa3DM(tF-|21P`+yK$;qIY_LGxwO+Lm|VO0mSV(GNav$@P>+ZiQ8 zCCgKgQx@2oO2vE`oF${Py*jwH2@tokRRL=zn|~;DER_sSTSOz%UxKQ0bn#IbnnoW{ z1S}>eF8EcthF$?1@^@C~;+rS`u9s8ev7yOj3WCS8y^}s<;|@k4w;9fMdu1wD!%+lF zbPgdlN_$#XZs=+HJFPJ>ng)+x4C!EWrD>2D#E^W9Qrjj|DcbD?r^2xOcN zI#bhnp`XDTowy!s-|FOS;at5O>IL;an`e_s8d=e)_P7V%X`5WElnJe-&qmdU-mM@- zp_@_-W(?`@G+Fe{9CymEAXU+Os5Rb#q ({name: document.name, roughSizeMBs: roughSizeOfObject(document)})); - console.log(documentNames) - }catch(error){ - console.log(error) - } - finally { - await client.close(); - } + await client.connect(); + console.log(`Connected correctly to server`); + const db = client.db(databaseName); + + // Use the collection "data" + const collection = db.collection(collectionName); + + // Search options + const query = ({}); + const options = ({}); + + // Insert a single document, wait for promise so we can read it back + // const p = await collection.insertOne(metaforecastDocument); + const documents = await collection.find().toArray() + let documentNames = documents.map(document => ({ name: document.name, roughSizeMBs: roughSizeOfObject(document) })); + console.log(documentNames) + } catch (error) { + console.log(error) + } + finally { + await client.close(); + } } //mongoGetAllElements() diff --git a/src/utils/pullSuperforecastsManually.sh b/src/utils/pullSuperforecastsManually.sh index e5a6199..b1fd881 100755 --- a/src/utils/pullSuperforecastsManually.sh +++ b/src/utils/pullSuperforecastsManually.sh @@ -1,4 +1,4 @@ #!/bin/bash -cd /home/nuno/Documents/core/software/fresh/js/metaforecasts/metaforecasts-mongo +cd /home/loki/Documents/core/software/fresh/js/metaforecasts/metaforecasts-mongo date > done.txt -/home/nuno/.nvm/versions/node/v16.4.2/bin/node ./src/utils/pullSuperforecastsManually.js >> done.txt +/home/loki/.nvm/versions/node/v16.8.0/bin/node ./src/utils/pullSuperforecastsManually.js >> done.txt diff --git a/src/utils/stars.js b/src/utils/stars.js index 447d08f..c5b8df9 100644 --- a/src/utils/stars.js +++ b/src/utils/stars.js @@ -1,296 +1,309 @@ export function getStarSymbols(numstars) { - let stars = "★★☆☆☆" - switch (numstars) { - case 0: - stars = "☆☆☆☆☆" - break; - case 1: - stars = "★☆☆☆☆" - break; - case 2: - stars = "★★☆☆☆" - break; - case 3: - stars = "★★★☆☆" - break; - case 4: - stars = "★★★★☆" - break; - case 5: - stars = "★★★★★" - break; - default: - stars = "★★☆☆☆" - } - return (stars) + let stars = "★★☆☆☆" + switch (numstars) { + case 0: + stars = "☆☆☆☆☆" + break; + case 1: + stars = "★☆☆☆☆" + break; + case 2: + stars = "★★☆☆☆" + break; + case 3: + stars = "★★★☆☆" + break; + case 4: + stars = "★★★★☆" + break; + case 5: + stars = "★★★★★" + break; + default: + stars = "★★☆☆☆" + } + return (stars) } let average = array => array.reduce((a, b) => a + b, 0) / (array.length) function calculateStarsAstralCodexTen(data) { - let nuno = data => 3 - let eli = (data) => null - let misha = (data) => null - let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) - let starsInteger = Math.round(starsDecimal) - return starsInteger + let nuno = data => 3 + let eli = (data) => null + let misha = (data) => null + let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) + let starsInteger = Math.round(starsDecimal) + return starsInteger } function calculateStarsBetfair(data) { - let nuno = data => data.volume > 10000 ? 4 : (data.volume > 1000 ? 3 : 2) - let eli = (data) => data.volume > 10000 ? null : null - let misha = (data) => null - let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) - // Substract 1 star if probability is above 90% or below 10% - if(data.option && - (data.option.probability < 0.1 || data.option.probability > 0.9) - ){ - starsDecimal = starsDecimal - 1 - } - - let starsInteger = Math.round(starsDecimal) - return starsInteger + let nuno = data => data.volume > 10000 ? 4 : (data.volume > 1000 ? 3 : 2) + let eli = (data) => data.volume > 10000 ? null : null + let misha = (data) => null + let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) + // Substract 1 star if probability is above 90% or below 10% + if(data.option && + (data.option.probability < 0.1 || data.option.probability > 0.9) + ){ + starsDecimal = starsDecimal - 1 + } + + let starsInteger = Math.round(starsDecimal) + return starsInteger } function calculateStarsCoupCast(data) { - let nuno = (data) => 3 - let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) - let starsInteger = Math.round(starsDecimal) - return starsInteger + let nuno = (data) => 3 + let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) + let starsInteger = Math.round(starsDecimal) + return starsInteger } function calculateStarsCSETForetell(data) { - let nuno = (data) => data.numforecasts > 100 ? 3 : 2 - let eli = (data) => 3 - let misha = (data) => 2 - let starsDecimal = average([nuno(data), eli(data), misha(data)]) - let starsInteger = Math.round(starsDecimal) - return starsInteger + let nuno = (data) => data.numforecasts > 100 ? 3 : 2 + let eli = (data) => 3 + let misha = (data) => 2 + let starsDecimal = average([nuno(data), eli(data), misha(data)]) + let starsInteger = Math.round(starsDecimal) + return starsInteger } function calculateStarsElicit(data) { - let nuno = data => 1 - let eli = (data) => null - let misha = (data) => null - let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) - let starsInteger = Math.round(starsDecimal) - return starsInteger + let nuno = data => 1 + let eli = (data) => null + let misha = (data) => null + let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) + let starsInteger = Math.round(starsDecimal) + return starsInteger } function calculateStarsEstimize(data) { - let nuno = data => 2 - let eli = (data) => null - let misha = (data) => null - let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) - let starsInteger = Math.round(starsDecimal) - return starsInteger + let nuno = data => 2 + let eli = (data) => null + let misha = (data) => null + let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) + let starsInteger = Math.round(starsDecimal) + return starsInteger } function calculateStarsForetold(data) { - let nuno = data => 2 - let eli = (data) => null - let misha = (data) => null - let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) - let starsInteger = Math.round(starsDecimal) - return starsInteger + let nuno = data => 2 + let eli = (data) => null + let misha = (data) => null + let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) + let starsInteger = Math.round(starsDecimal) + return starsInteger } function calculateStarsGiveWellOpenPhil(data) { - let nuno = data => 2 - let eli = (data) => null - let misha = (data) => null - let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) - let starsInteger = Math.round(starsDecimal) - return starsInteger + let nuno = data => 2 + let eli = (data) => null + let misha = (data) => null + let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) + let starsInteger = Math.round(starsDecimal) + return starsInteger } function calculateStarsGoodJudment(data) { - let nuno = data => 4 - let eli = (data) => 4 - let misha = (data) => 3.5 - let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) - let starsInteger = Math.round(starsDecimal) - return starsInteger + let nuno = data => 4 + let eli = (data) => 4 + let misha = (data) => 3.5 + let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) + let starsInteger = Math.round(starsDecimal) + return starsInteger } function calculateStarsGoodJudmentOpen(data) { - let nuno = data => data.numforecasts > 100 ? 3 : 2 - let eli = (data) => 3 - let misha = (data) => (data.minProbability > 0.1 || data.maxProbability < 0.9) ? 3.1 : 2.5 - let starsDecimal = average([nuno(data), eli(data), misha(data)]) - let starsInteger = Math.round(starsDecimal) - return starsInteger + let nuno = data => data.numforecasts > 100 ? 3 : 2 + let eli = (data) => 3 + let misha = (data) => (data.minProbability > 0.1 || data.maxProbability < 0.9) ? 3.1 : 2.5 + let starsDecimal = average([nuno(data), eli(data), misha(data)]) + let starsInteger = Math.round(starsDecimal) + return starsInteger } function calculateStarsHypermind(data) { - let nuno = data => 3 - let eli = (data) => null - let misha = (data) => null - let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) - let starsInteger = Math.round(starsDecimal) - return starsInteger + let nuno = data => 3 + let eli = (data) => null + let misha = (data) => null + let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) + let starsInteger = Math.round(starsDecimal) + return starsInteger } function calculateStarsKalshi(data) { - let nuno = data => data.interest > 500 && data.shares_volume > 10000 ? 4 : (data.shares_volume > 2000 ? 3 : 2) - // let eli = (data) => data.interest > 10000 ? 5 : 4 - // let misha = (data) => 4 - let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) - // Substract 1 star if probability is above 90% or below 10% - if(data.option && - (data.option.probability < 0.1 || data.option.probability > 0.9) - ){ - starsDecimal = starsDecimal - 1 - } - - let starsInteger = Math.round(starsDecimal) - return starsInteger + let nuno = data => data.interest > 500 && data.shares_volume > 10000 ? 4 : (data.shares_volume > 2000 ? 3 : 2) + // let eli = (data) => data.interest > 10000 ? 5 : 4 + // let misha = (data) => 4 + let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) + // Substract 1 star if probability is above 90% or below 10% + if(data.option && + (data.option.probability < 0.1 || data.option.probability > 0.9) + ){ + starsDecimal = starsDecimal - 1 + } + + let starsInteger = Math.round(starsDecimal) + return starsInteger } function calculateStarsLadbrokes(data) { - let nuno = data => 2 - let eli = (data) => null - let misha = (data) => null - let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) - let starsInteger = Math.round(starsDecimal) - return starsInteger + let nuno = data => 2 + let eli = (data) => null + let misha = (data) => null + let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) + let starsInteger = Math.round(starsDecimal) + return starsInteger } function calculateStarsMetaculus(data) { - let nuno = data => data.numforecasts > 300 ? 4 : (data.numforecasts > 100 ? 3 : 2) - let eli = (data) => 3 - let misha = (data) => 3 - let starsDecimal = average([nuno(data), eli(data), misha(data)]) - let starsInteger = Math.round(starsDecimal) - return starsInteger + let nuno = data => data.numforecasts > 300 ? 4 : (data.numforecasts > 100 ? 3 : 2) + let eli = (data) => 3 + let misha = (data) => 3 + let starsDecimal = average([nuno(data), eli(data), misha(data)]) + let starsInteger = Math.round(starsDecimal) + return starsInteger } function calculateStarsOmen(data) { - let nuno = data => 1 - let eli = (data) => null - let misha = (data) => null - let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) - let starsInteger = Math.round(starsDecimal) - return starsInteger + let nuno = data => 1 + let eli = (data) => null + let misha = (data) => null + let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) + let starsInteger = Math.round(starsDecimal) + return starsInteger } function calculateStarsPolymarket(data) { - let nuno = data => data.volume > 10000 ? 4 : (data.volume > 1000 ? 3 : 2) - // let eli = (data) => data.liquidity > 10000 ? 5 : 4 - // let misha = (data) => 4 - let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) - // Substract 1 star if probability is above 90% or below 10% - if(data.option && - (data.option.probability < 0.1 || data.option.probability > 0.9) - ){ - starsDecimal = starsDecimal - 1 - } - - let starsInteger = Math.round(starsDecimal) - return starsInteger + let nuno = data => data.volume > 10000 ? 4 : (data.volume > 1000 ? 3 : 2) + // let eli = (data) => data.liquidity > 10000 ? 5 : 4 + // let misha = (data) => 4 + let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) + // Substract 1 star if probability is above 90% or below 10% + if(data.option && + (data.option.probability < 0.1 || data.option.probability > 0.9) + ){ + starsDecimal = starsDecimal - 1 + } + + let starsInteger = Math.round(starsDecimal) + return starsInteger } function calculateStarsPredictIt(data) { - let nuno = data => 3 - let eli = (data) => 3.5 - let misha = (data) => 2.5 - let starsDecimal = average([nuno(data), eli(data), misha(data)]) - let starsInteger = Math.round(starsDecimal) - return starsInteger + let nuno = data => 3 + let eli = (data) => 3.5 + let misha = (data) => 2.5 + let starsDecimal = average([nuno(data), eli(data), misha(data)]) + let starsInteger = Math.round(starsDecimal) + return starsInteger } function calculateStarsRootclaim(data) { - let nuno = data => 4 - let eli = (data) => null - let misha = (data) => null - let starsDecimal = average([nuno(data)/*, eli(data), misha(data)*/]) - let starsInteger = Math.round(starsDecimal) - return starsInteger + let nuno = data => 4 + let eli = (data) => null + let misha = (data) => null + let starsDecimal = average([nuno(data)/*, eli(data), misha(data)*/]) + let starsInteger = Math.round(starsDecimal) + return starsInteger } function calculateStarsSmarkets(data) { - let nuno = data => 2 - let eli = (data) => null - let misha = (data) => null - let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) - let starsInteger = Math.round(starsDecimal) - return starsInteger + let nuno = data => 2 + let eli = (data) => null + let misha = (data) => null + let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) + let starsInteger = Math.round(starsDecimal) + return starsInteger +} + + +function calculateStarsWildeford(data) { + let nuno = data => 3 + let eli = (data) => null + let misha = (data) => null + let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) + let starsInteger = Math.round(starsDecimal) + return starsInteger } function calculateStarsWilliamHill(data) { - let nuno = data => 2 - let eli = (data) => null - let misha = (data) => null - let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) - let starsInteger = Math.round(starsDecimal) - return starsInteger + let nuno = data => 2 + let eli = (data) => null + let misha = (data) => null + let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) + let starsInteger = Math.round(starsDecimal) + return starsInteger } export function calculateStars(platform, data) { - let stars = 2; - switch (platform) { - case "AstralCodexTen": - stars = calculateStarsAstralCodexTen(data) - break; - case "Betfair": - stars = calculateStarsBetfair(data) - break; - case "CoupCast": - stars = calculateStarsCoupCast(data) - break; - case "CSET-foretell": - stars = calculateStarsCSETForetell(data) - break; - case "Elicit": - stars = calculateStarsElicit(data) - break; - case "Estimize": - stars = calculateStarsEstimize(data) - break; - case "Foretold": - stars = calculateStarsForetold(data) - break; - case "GiveWell/OpenPhilanthropy": - stars = calculateStarsGiveWellOpenPhil(data) - break; - case "Good Judgment": - stars = calculateStarsGoodJudment(data) - break; - case "Good Judgment Open": - stars = calculateStarsGoodJudmentOpen(data) - break; - case "Hypermind": - stars = calculateStarsHypermind(data) - break; - case "Kalshi": - stars = calculateStarsKalshi(data) - break; - case "Ladbrokes": - stars = calculateStarsLadbrokes(data) - break; - case "Metaculus": - stars = calculateStarsMetaculus(data) - break; - case "Omen": - stars = calculateStarsOmen(data) - break; - case "Polymarket": - stars = calculateStarsPolymarket(data) - break; - case "PredictIt": - stars = calculateStarsPredictIt(data) - break; - case "Rootclaim": - stars = calculateStarsRootclaim(data) - break; - case "Smarkets": - stars = calculateStarsSmarkets(data) - break; - case "WilliamHill": - calculateStarsWilliamHill(data) - break; - default: - stars = 2 - } - return stars + let stars = 2; + switch (platform) { + case "AstralCodexTen": + stars = calculateStarsAstralCodexTen(data) + break; + case "Betfair": + stars = calculateStarsBetfair(data) + break; + case "CoupCast": + stars = calculateStarsCoupCast(data) + break; + case "CSET-foretell": + stars = calculateStarsCSETForetell(data) + break; + case "Elicit": + stars = calculateStarsElicit(data) + break; + case "Estimize": + stars = calculateStarsEstimize(data) + break; + case "Foretold": + stars = calculateStarsForetold(data) + break; + case "GiveWell/OpenPhilanthropy": + stars = calculateStarsGiveWellOpenPhil(data) + break; + case "Good Judgment": + stars = calculateStarsGoodJudment(data) + break; + case "Good Judgment Open": + stars = calculateStarsGoodJudmentOpen(data) + break; + case "Hypermind": + stars = calculateStarsHypermind(data) + break; + case "Kalshi": + stars = calculateStarsKalshi(data) + break; + case "Ladbrokes": + stars = calculateStarsLadbrokes(data) + break; + case "Metaculus": + stars = calculateStarsMetaculus(data) + break; + case "Omen": + stars = calculateStarsOmen(data) + break; + case "Polymarket": + stars = calculateStarsPolymarket(data) + break; + case "PredictIt": + stars = calculateStarsPredictIt(data) + break; + case "Rootclaim": + stars = calculateStarsRootclaim(data) + break; + case "Smarkets": + stars = calculateStarsSmarkets(data) + break; + case "Peter Wildeford": + stars = calculateStarsWildeford(data) + break; + case "WilliamHill": + stars = calculateStarsWilliamHill(data) + break; + default: + stars = 2 + } + return stars }