From 399c7c286e302fba8c8553eccda53e2fa5baeeb3 Mon Sep 17 00:00:00 2001 From: leca Date: Fri, 27 Oct 2023 18:43:09 +0300 Subject: [PATCH] fixed gitignore --- .gitginore => .gitignore | 0 node_modules/.bin/ejs | 1 - node_modules/.bin/jake | 1 - node_modules/.bin/mime | 1 - node_modules/.package-lock.json | 1074 --- node_modules/accepts/HISTORY.md | 243 - node_modules/accepts/LICENSE | 23 - node_modules/accepts/README.md | 140 - node_modules/accepts/index.js | 238 - node_modules/accepts/package.json | 47 - node_modules/ansi-styles/index.d.ts | 345 - node_modules/ansi-styles/index.js | 163 - node_modules/ansi-styles/license | 9 - node_modules/ansi-styles/package.json | 56 - node_modules/ansi-styles/readme.md | 152 - node_modules/array-flatten/LICENSE | 21 - node_modules/array-flatten/README.md | 43 - node_modules/array-flatten/array-flatten.js | 64 - node_modules/array-flatten/package.json | 39 - node_modules/async/CHANGELOG.md | 348 - node_modules/async/LICENSE | 19 - node_modules/async/README.md | 59 - node_modules/async/all.js | 119 - node_modules/async/allLimit.js | 46 - node_modules/async/allSeries.js | 45 - node_modules/async/any.js | 122 - node_modules/async/anyLimit.js | 47 - node_modules/async/anySeries.js | 46 - node_modules/async/apply.js | 55 - node_modules/async/applyEach.js | 57 - node_modules/async/applyEachSeries.js | 37 - node_modules/async/asyncify.js | 118 - node_modules/async/auto.js | 333 - node_modules/async/autoInject.js | 182 - node_modules/async/bower.json | 17 - node_modules/async/cargo.js | 63 - node_modules/async/cargoQueue.js | 71 - node_modules/async/compose.js | 55 - node_modules/async/concat.js | 115 - node_modules/async/concatLimit.js | 60 - node_modules/async/concatSeries.js | 41 - node_modules/async/constant.js | 55 - node_modules/async/detect.js | 96 - node_modules/async/detectLimit.js | 48 - node_modules/async/detectSeries.js | 47 - node_modules/async/dir.js | 43 - node_modules/async/dist/async.js | 6059 ------------ node_modules/async/dist/async.min.js | 1 - node_modules/async/dist/async.mjs | 5947 ------------ node_modules/async/doDuring.js | 68 - node_modules/async/doUntil.js | 46 - node_modules/async/doWhilst.js | 68 - node_modules/async/during.js | 78 - node_modules/async/each.js | 129 - node_modules/async/eachLimit.js | 50 - node_modules/async/eachOf.js | 185 - node_modules/async/eachOfLimit.js | 47 - node_modules/async/eachOfSeries.js | 39 - node_modules/async/eachSeries.js | 44 - node_modules/async/ensureAsync.js | 67 - node_modules/async/every.js | 119 - node_modules/async/everyLimit.js | 46 - node_modules/async/everySeries.js | 45 - node_modules/async/filter.js | 93 - node_modules/async/filterLimit.js | 45 - node_modules/async/filterSeries.js | 43 - node_modules/async/find.js | 96 - node_modules/async/findLimit.js | 48 - node_modules/async/findSeries.js | 47 - node_modules/async/flatMap.js | 115 - node_modules/async/flatMapLimit.js | 60 - node_modules/async/flatMapSeries.js | 41 - node_modules/async/foldl.js | 153 - node_modules/async/foldr.js | 41 - node_modules/async/forEach.js | 129 - node_modules/async/forEachLimit.js | 50 - node_modules/async/forEachOf.js | 185 - node_modules/async/forEachOfLimit.js | 47 - node_modules/async/forEachOfSeries.js | 39 - node_modules/async/forEachSeries.js | 44 - node_modules/async/forever.js | 68 - node_modules/async/groupBy.js | 108 - node_modules/async/groupByLimit.js | 71 - node_modules/async/groupBySeries.js | 36 - node_modules/async/index.js | 588 -- node_modules/async/inject.js | 153 - .../async/internal/DoublyLinkedList.js | 92 - node_modules/async/internal/Heap.js | 120 - node_modules/async/internal/applyEach.js | 29 - .../async/internal/asyncEachOfLimit.js | 75 - node_modules/async/internal/awaitify.js | 27 - node_modules/async/internal/breakLoop.js | 10 - node_modules/async/internal/consoleFunc.js | 31 - node_modules/async/internal/createTester.js | 40 - node_modules/async/internal/eachOfLimit.js | 90 - node_modules/async/internal/filter.js | 55 - node_modules/async/internal/getIterator.js | 11 - node_modules/async/internal/initialParams.js | 14 - node_modules/async/internal/isArrayLike.js | 10 - node_modules/async/internal/iterator.js | 57 - node_modules/async/internal/map.js | 30 - node_modules/async/internal/once.js | 17 - node_modules/async/internal/onlyOnce.js | 15 - node_modules/async/internal/parallel.js | 34 - .../async/internal/promiseCallback.js | 23 - node_modules/async/internal/queue.js | 294 - node_modules/async/internal/range.js | 14 - node_modules/async/internal/reject.js | 26 - node_modules/async/internal/setImmediate.js | 34 - node_modules/async/internal/withoutIndex.js | 10 - node_modules/async/internal/wrapAsync.js | 34 - node_modules/async/log.js | 41 - node_modules/async/map.js | 142 - node_modules/async/mapLimit.js | 45 - node_modules/async/mapSeries.js | 44 - node_modules/async/mapValues.js | 152 - node_modules/async/mapValuesLimit.js | 61 - node_modules/async/mapValuesSeries.js | 37 - node_modules/async/memoize.js | 91 - node_modules/async/nextTick.js | 52 - node_modules/async/package.json | 75 - node_modules/async/parallel.js | 180 - node_modules/async/parallelLimit.js | 41 - node_modules/async/priorityQueue.js | 86 - node_modules/async/queue.js | 167 - node_modules/async/race.js | 67 - node_modules/async/reduce.js | 153 - node_modules/async/reduceRight.js | 41 - node_modules/async/reflect.js | 78 - node_modules/async/reflectAll.js | 93 - node_modules/async/reject.js | 87 - node_modules/async/rejectLimit.js | 45 - node_modules/async/rejectSeries.js | 43 - node_modules/async/retry.js | 159 - node_modules/async/retryable.js | 77 - node_modules/async/select.js | 93 - node_modules/async/selectLimit.js | 45 - node_modules/async/selectSeries.js | 43 - node_modules/async/seq.js | 79 - node_modules/async/series.js | 186 - node_modules/async/setImmediate.js | 45 - node_modules/async/some.js | 122 - node_modules/async/someLimit.js | 47 - node_modules/async/someSeries.js | 46 - node_modules/async/sortBy.js | 190 - node_modules/async/timeout.js | 89 - node_modules/async/times.js | 50 - node_modules/async/timesLimit.js | 43 - node_modules/async/timesSeries.js | 32 - node_modules/async/transform.js | 173 - node_modules/async/tryEach.js | 78 - node_modules/async/unmemoize.js | 25 - node_modules/async/until.js | 61 - node_modules/async/waterfall.js | 105 - node_modules/async/whilst.js | 78 - node_modules/async/wrapSync.js | 118 - .../balanced-match/.github/FUNDING.yml | 2 - node_modules/balanced-match/LICENSE.md | 21 - node_modules/balanced-match/README.md | 97 - node_modules/balanced-match/index.js | 62 - node_modules/balanced-match/package.json | 48 - node_modules/bcryptjs/.npmignore | 6 - node_modules/bcryptjs/.travis.yml | 18 - node_modules/bcryptjs/.vscode/settings.json | 3 - node_modules/bcryptjs/LICENSE | 50 - node_modules/bcryptjs/README.md | 251 - node_modules/bcryptjs/bin/bcrypt | 25 - node_modules/bcryptjs/bower.json | 22 - node_modules/bcryptjs/dist/README.md | 15 - node_modules/bcryptjs/dist/bcrypt.js | 1379 --- node_modules/bcryptjs/dist/bcrypt.min.js | 48 - node_modules/bcryptjs/dist/bcrypt.min.js.gz | Bin 9443 -> 0 bytes node_modules/bcryptjs/dist/bcrypt.min.map | 8 - node_modules/bcryptjs/externs/bcrypt.js | 91 - node_modules/bcryptjs/externs/minimal-env.js | 98 - node_modules/bcryptjs/index.js | 29 - node_modules/bcryptjs/package.json | 47 - node_modules/bcryptjs/scripts/build.js | 37 - node_modules/bcryptjs/src/bcrypt.js | 327 - node_modules/bcryptjs/src/bcrypt/impl.js | 669 -- .../bcryptjs/src/bcrypt/prng/README.md | 5 - .../bcryptjs/src/bcrypt/prng/accum.js | 133 - .../bcryptjs/src/bcrypt/prng/isaac.js | 140 - node_modules/bcryptjs/src/bcrypt/util.js | 33 - .../bcryptjs/src/bcrypt/util/base64.js | 115 - node_modules/bcryptjs/src/bower.json | 22 - node_modules/bcryptjs/src/wrap.js | 50 - node_modules/bcryptjs/tests/quickbrown.txt | 150 - node_modules/bcryptjs/tests/suite.js | 197 - node_modules/body-parser/HISTORY.md | 657 -- node_modules/body-parser/LICENSE | 23 - node_modules/body-parser/README.md | 464 - node_modules/body-parser/SECURITY.md | 25 - node_modules/body-parser/index.js | 156 - node_modules/body-parser/lib/read.js | 205 - node_modules/body-parser/lib/types/json.js | 236 - node_modules/body-parser/lib/types/raw.js | 101 - node_modules/body-parser/lib/types/text.js | 121 - .../body-parser/lib/types/urlencoded.js | 284 - node_modules/body-parser/package.json | 56 - node_modules/brace-expansion/LICENSE | 21 - node_modules/brace-expansion/README.md | 129 - node_modules/brace-expansion/index.js | 201 - node_modules/brace-expansion/package.json | 47 - node_modules/buffer-writer/.travis.yml | 7 - node_modules/buffer-writer/LICENSE | 19 - node_modules/buffer-writer/README.md | 48 - node_modules/buffer-writer/index.js | 129 - node_modules/buffer-writer/package.json | 26 - node_modules/buffer-writer/test/mocha.opts | 1 - .../buffer-writer/test/writer-tests.js | 218 - node_modules/bytes/History.md | 97 - node_modules/bytes/LICENSE | 23 - node_modules/bytes/Readme.md | 152 - node_modules/bytes/index.js | 170 - node_modules/bytes/package.json | 42 - node_modules/call-bind/.eslintignore | 1 - node_modules/call-bind/.eslintrc | 16 - node_modules/call-bind/.github/FUNDING.yml | 12 - node_modules/call-bind/.nycrc | 9 - node_modules/call-bind/CHANGELOG.md | 77 - node_modules/call-bind/LICENSE | 21 - node_modules/call-bind/README.md | 64 - node_modules/call-bind/callBound.js | 15 - node_modules/call-bind/index.js | 44 - node_modules/call-bind/package.json | 90 - node_modules/call-bind/test/callBound.js | 54 - node_modules/call-bind/test/index.js | 80 - node_modules/chalk/index.d.ts | 415 - node_modules/chalk/license | 9 - node_modules/chalk/package.json | 68 - node_modules/chalk/readme.md | 341 - node_modules/chalk/source/index.js | 229 - node_modules/chalk/source/templates.js | 134 - node_modules/chalk/source/util.js | 39 - node_modules/color-convert/CHANGELOG.md | 54 - node_modules/color-convert/LICENSE | 21 - node_modules/color-convert/README.md | 68 - node_modules/color-convert/conversions.js | 839 -- node_modules/color-convert/index.js | 81 - node_modules/color-convert/package.json | 48 - node_modules/color-convert/route.js | 97 - node_modules/color-name/LICENSE | 8 - node_modules/color-name/README.md | 11 - node_modules/color-name/index.js | 152 - node_modules/color-name/package.json | 28 - node_modules/concat-map/.travis.yml | 4 - node_modules/concat-map/LICENSE | 18 - node_modules/concat-map/README.markdown | 62 - node_modules/concat-map/example/map.js | 6 - node_modules/concat-map/index.js | 13 - node_modules/concat-map/package.json | 43 - node_modules/concat-map/test/map.js | 39 - node_modules/content-disposition/HISTORY.md | 60 - node_modules/content-disposition/LICENSE | 22 - node_modules/content-disposition/README.md | 142 - node_modules/content-disposition/index.js | 458 - node_modules/content-disposition/package.json | 44 - node_modules/content-type/HISTORY.md | 29 - node_modules/content-type/LICENSE | 22 - node_modules/content-type/README.md | 94 - node_modules/content-type/index.js | 225 - node_modules/content-type/package.json | 42 - node_modules/cookie-signature/.npmignore | 4 - node_modules/cookie-signature/History.md | 38 - node_modules/cookie-signature/Readme.md | 42 - node_modules/cookie-signature/index.js | 51 - node_modules/cookie-signature/package.json | 18 - node_modules/cookie/HISTORY.md | 142 - node_modules/cookie/LICENSE | 24 - node_modules/cookie/README.md | 302 - node_modules/cookie/SECURITY.md | 25 - node_modules/cookie/index.js | 270 - node_modules/cookie/package.json | 44 - node_modules/debug/.coveralls.yml | 1 - node_modules/debug/.eslintrc | 11 - node_modules/debug/.npmignore | 9 - node_modules/debug/.travis.yml | 14 - node_modules/debug/CHANGELOG.md | 362 - node_modules/debug/LICENSE | 19 - node_modules/debug/Makefile | 50 - node_modules/debug/README.md | 312 - node_modules/debug/component.json | 19 - node_modules/debug/karma.conf.js | 70 - node_modules/debug/node.js | 1 - node_modules/debug/package.json | 49 - node_modules/debug/src/browser.js | 185 - node_modules/debug/src/debug.js | 202 - node_modules/debug/src/index.js | 10 - node_modules/debug/src/inspector-log.js | 15 - node_modules/debug/src/node.js | 248 - node_modules/define-data-property/.eslintrc | 24 - .../define-data-property/.github/FUNDING.yml | 12 - node_modules/define-data-property/.nycrc | 13 - .../define-data-property/CHANGELOG.md | 41 - node_modules/define-data-property/LICENSE | 21 - node_modules/define-data-property/README.md | 67 - node_modules/define-data-property/index.d.ts | 3 - .../define-data-property/index.d.ts.map | 1 - node_modules/define-data-property/index.js | 68 - .../define-data-property/package.json | 113 - .../define-data-property/test/index.js | 392 - .../define-data-property/tsconfig.json | 59 - node_modules/depd/History.md | 103 - node_modules/depd/LICENSE | 22 - node_modules/depd/Readme.md | 280 - node_modules/depd/index.js | 538 -- node_modules/depd/lib/browser/index.js | 77 - node_modules/depd/package.json | 45 - node_modules/destroy/LICENSE | 23 - node_modules/destroy/README.md | 63 - node_modules/destroy/index.js | 209 - node_modules/destroy/package.json | 48 - node_modules/dotenv/CHANGELOG.md | 431 - node_modules/dotenv/LICENSE | 23 - node_modules/dotenv/README-es.md | 442 - node_modules/dotenv/README.md | 633 -- node_modules/dotenv/config.d.ts | 1 - node_modules/dotenv/config.js | 9 - node_modules/dotenv/lib/cli-options.js | 11 - node_modules/dotenv/lib/env-options.js | 24 - node_modules/dotenv/lib/main.d.ts | 156 - node_modules/dotenv/lib/main.js | 314 - node_modules/dotenv/package.json | 64 - node_modules/ee-first/LICENSE | 22 - node_modules/ee-first/README.md | 80 - node_modules/ee-first/index.js | 95 - node_modules/ee-first/package.json | 29 - node_modules/ejs/LICENSE | 202 - node_modules/ejs/README.md | 344 - node_modules/ejs/bin/cli.js | 211 - node_modules/ejs/ejs.js | 1736 ---- node_modules/ejs/ejs.min.js | 1 - node_modules/ejs/jakefile.js | 88 - node_modules/ejs/lib/ejs.js | 951 -- node_modules/ejs/lib/utils.js | 241 - node_modules/ejs/package.json | 42 - node_modules/ejs/usage.txt | 24 - node_modules/encodeurl/HISTORY.md | 14 - node_modules/encodeurl/LICENSE | 22 - node_modules/encodeurl/README.md | 128 - node_modules/encodeurl/index.js | 60 - node_modules/encodeurl/package.json | 40 - node_modules/escape-html/LICENSE | 24 - node_modules/escape-html/Readme.md | 43 - node_modules/escape-html/index.js | 78 - node_modules/escape-html/package.json | 24 - node_modules/etag/HISTORY.md | 83 - node_modules/etag/LICENSE | 22 - node_modules/etag/README.md | 159 - node_modules/etag/index.js | 131 - node_modules/etag/package.json | 47 - node_modules/express-session/HISTORY.md | 442 - node_modules/express-session/LICENSE | 24 - node_modules/express-session/README.md | 985 -- node_modules/express-session/index.js | 685 -- .../node_modules/cookie/HISTORY.md | 134 - .../node_modules/cookie/LICENSE | 24 - .../node_modules/cookie/README.md | 286 - .../node_modules/cookie/index.js | 202 - .../node_modules/cookie/package.json | 42 - node_modules/express-session/package.json | 47 - .../express-session/session/cookie.js | 150 - .../express-session/session/memory.js | 187 - .../express-session/session/session.js | 143 - node_modules/express-session/session/store.js | 102 - node_modules/express/History.md | 3588 ------- node_modules/express/LICENSE | 24 - node_modules/express/Readme.md | 166 - node_modules/express/index.js | 11 - node_modules/express/lib/application.js | 661 -- node_modules/express/lib/express.js | 116 - node_modules/express/lib/middleware/init.js | 43 - node_modules/express/lib/middleware/query.js | 47 - node_modules/express/lib/request.js | 525 - node_modules/express/lib/response.js | 1169 --- node_modules/express/lib/router/index.js | 673 -- node_modules/express/lib/router/layer.js | 181 - node_modules/express/lib/router/route.js | 225 - node_modules/express/lib/utils.js | 304 - node_modules/express/lib/view.js | 182 - node_modules/express/package.json | 99 - node_modules/filelist/README.md | 84 - node_modules/filelist/index.d.ts | 110 - node_modules/filelist/index.js | 495 - node_modules/filelist/jakefile.js | 15 - .../brace-expansion/.github/FUNDING.yml | 2 - .../node_modules/brace-expansion/LICENSE | 21 - .../node_modules/brace-expansion/README.md | 135 - .../node_modules/brace-expansion/index.js | 203 - .../node_modules/brace-expansion/package.json | 46 - .../filelist/node_modules/minimatch/LICENSE | 15 - .../filelist/node_modules/minimatch/README.md | 259 - .../node_modules/minimatch/lib/path.js | 4 - .../node_modules/minimatch/minimatch.js | 944 -- .../node_modules/minimatch/package.json | 35 - node_modules/filelist/package.json | 28 - node_modules/finalhandler/HISTORY.md | 195 - node_modules/finalhandler/LICENSE | 22 - node_modules/finalhandler/README.md | 147 - node_modules/finalhandler/SECURITY.md | 25 - node_modules/finalhandler/index.js | 336 - node_modules/finalhandler/package.json | 46 - node_modules/forwarded/HISTORY.md | 21 - node_modules/forwarded/LICENSE | 22 - node_modules/forwarded/README.md | 57 - node_modules/forwarded/index.js | 90 - node_modules/forwarded/package.json | 45 - node_modules/fresh/HISTORY.md | 70 - node_modules/fresh/LICENSE | 23 - node_modules/fresh/README.md | 119 - node_modules/fresh/index.js | 137 - node_modules/fresh/package.json | 46 - node_modules/function-bind/.eslintrc | 21 - .../function-bind/.github/FUNDING.yml | 12 - .../function-bind/.github/SECURITY.md | 3 - node_modules/function-bind/.nycrc | 13 - node_modules/function-bind/CHANGELOG.md | 136 - node_modules/function-bind/LICENSE | 20 - node_modules/function-bind/README.md | 46 - node_modules/function-bind/implementation.js | 84 - node_modules/function-bind/index.js | 5 - node_modules/function-bind/package.json | 87 - node_modules/function-bind/test/.eslintrc | 9 - node_modules/function-bind/test/index.js | 252 - node_modules/get-intrinsic/.eslintrc | 38 - .../get-intrinsic/.github/FUNDING.yml | 12 - node_modules/get-intrinsic/.nycrc | 9 - node_modules/get-intrinsic/CHANGELOG.md | 125 - node_modules/get-intrinsic/LICENSE | 21 - node_modules/get-intrinsic/README.md | 71 - node_modules/get-intrinsic/index.js | 351 - node_modules/get-intrinsic/package.json | 93 - .../get-intrinsic/test/GetIntrinsic.js | 274 - node_modules/gopd/.eslintrc | 16 - node_modules/gopd/.github/FUNDING.yml | 12 - node_modules/gopd/CHANGELOG.md | 25 - node_modules/gopd/LICENSE | 21 - node_modules/gopd/README.md | 40 - node_modules/gopd/index.js | 16 - node_modules/gopd/package.json | 71 - node_modules/gopd/test/index.js | 35 - node_modules/has-flag/index.d.ts | 39 - node_modules/has-flag/index.js | 8 - node_modules/has-flag/license | 9 - node_modules/has-flag/package.json | 46 - node_modules/has-flag/readme.md | 89 - .../has-property-descriptors/.eslintrc | 13 - .../.github/FUNDING.yml | 12 - node_modules/has-property-descriptors/.nycrc | 9 - .../has-property-descriptors/CHANGELOG.md | 27 - node_modules/has-property-descriptors/LICENSE | 21 - .../has-property-descriptors/README.md | 43 - .../has-property-descriptors/index.js | 33 - .../has-property-descriptors/package.json | 77 - .../has-property-descriptors/test/index.js | 57 - node_modules/has-proto/.eslintrc | 5 - node_modules/has-proto/.github/FUNDING.yml | 12 - node_modules/has-proto/CHANGELOG.md | 23 - node_modules/has-proto/LICENSE | 21 - node_modules/has-proto/README.md | 38 - node_modules/has-proto/index.js | 11 - node_modules/has-proto/package.json | 74 - node_modules/has-proto/test/index.js | 19 - node_modules/has-symbols/.eslintrc | 11 - node_modules/has-symbols/.github/FUNDING.yml | 12 - node_modules/has-symbols/.nycrc | 9 - node_modules/has-symbols/CHANGELOG.md | 75 - node_modules/has-symbols/LICENSE | 21 - node_modules/has-symbols/README.md | 46 - node_modules/has-symbols/index.js | 13 - node_modules/has-symbols/package.json | 101 - node_modules/has-symbols/shams.js | 42 - node_modules/has-symbols/test/index.js | 22 - .../has-symbols/test/shams/core-js.js | 28 - .../test/shams/get-own-property-symbols.js | 28 - node_modules/has-symbols/test/tests.js | 56 - node_modules/hasown/.eslintrc | 5 - node_modules/hasown/.github/FUNDING.yml | 12 - node_modules/hasown/.nycrc | 13 - node_modules/hasown/CHANGELOG.md | 20 - node_modules/hasown/LICENSE | 21 - node_modules/hasown/README.md | 40 - node_modules/hasown/index.d.ts | 3 - node_modules/hasown/index.d.ts.map | 1 - node_modules/hasown/index.js | 8 - node_modules/hasown/package.json | 91 - node_modules/hasown/tsconfig.json | 49 - node_modules/http-errors/HISTORY.md | 180 - node_modules/http-errors/LICENSE | 23 - node_modules/http-errors/README.md | 169 - node_modules/http-errors/index.js | 289 - node_modules/http-errors/package.json | 50 - node_modules/iconv-lite/Changelog.md | 162 - node_modules/iconv-lite/LICENSE | 21 - node_modules/iconv-lite/README.md | 156 - .../iconv-lite/encodings/dbcs-codec.js | 555 -- .../iconv-lite/encodings/dbcs-data.js | 176 - node_modules/iconv-lite/encodings/index.js | 22 - node_modules/iconv-lite/encodings/internal.js | 188 - .../iconv-lite/encodings/sbcs-codec.js | 72 - .../encodings/sbcs-data-generated.js | 451 - .../iconv-lite/encodings/sbcs-data.js | 174 - .../encodings/tables/big5-added.json | 122 - .../iconv-lite/encodings/tables/cp936.json | 264 - .../iconv-lite/encodings/tables/cp949.json | 273 - .../iconv-lite/encodings/tables/cp950.json | 177 - .../iconv-lite/encodings/tables/eucjp.json | 182 - .../encodings/tables/gb18030-ranges.json | 1 - .../encodings/tables/gbk-added.json | 55 - .../iconv-lite/encodings/tables/shiftjis.json | 125 - node_modules/iconv-lite/encodings/utf16.js | 177 - node_modules/iconv-lite/encodings/utf7.js | 290 - node_modules/iconv-lite/lib/bom-handling.js | 52 - node_modules/iconv-lite/lib/extend-node.js | 217 - node_modules/iconv-lite/lib/index.d.ts | 24 - node_modules/iconv-lite/lib/index.js | 153 - node_modules/iconv-lite/lib/streams.js | 121 - node_modules/iconv-lite/package.json | 46 - node_modules/inherits/LICENSE | 16 - node_modules/inherits/README.md | 42 - node_modules/inherits/inherits.js | 9 - node_modules/inherits/inherits_browser.js | 27 - node_modules/inherits/package.json | 29 - node_modules/ipaddr.js/LICENSE | 19 - node_modules/ipaddr.js/README.md | 233 - node_modules/ipaddr.js/ipaddr.min.js | 1 - node_modules/ipaddr.js/lib/ipaddr.js | 673 -- node_modules/ipaddr.js/lib/ipaddr.js.d.ts | 68 - node_modules/ipaddr.js/package.json | 35 - node_modules/jake/Makefile | 44 - node_modules/jake/README.md | 17 - node_modules/jake/bin/bash_completion.sh | 41 - node_modules/jake/bin/cli.js | 31 - node_modules/jake/jakefile.js | 112 - node_modules/jake/lib/api.js | 409 - node_modules/jake/lib/jake.js | 330 - node_modules/jake/lib/loader.js | 173 - node_modules/jake/lib/namespace.js | 115 - node_modules/jake/lib/package_task.js | 406 - node_modules/jake/lib/parseargs.js | 134 - node_modules/jake/lib/program.js | 282 - node_modules/jake/lib/publish_task.js | 290 - node_modules/jake/lib/rule.js | 311 - node_modules/jake/lib/task/directory_task.js | 30 - node_modules/jake/lib/task/file_task.js | 126 - node_modules/jake/lib/task/index.js | 9 - node_modules/jake/lib/task/task.js | 449 - node_modules/jake/lib/test_task.js | 270 - node_modules/jake/lib/utils/file.js | 286 - node_modules/jake/lib/utils/index.js | 297 - node_modules/jake/lib/utils/logger.js | 24 - node_modules/jake/package.json | 42 - .../jake/test/integration/concurrent.js | 45 - node_modules/jake/test/integration/file.js | 228 - .../jake/test/integration/file_task.js | 141 - node_modules/jake/test/integration/helpers.js | 80 - .../jake/test/integration/jakefile.js | 352 - .../integration/jakelib/concurrent.jake.js | 113 - .../test/integration/jakelib/publish.jake.js | 49 - .../jakelib/required_module.jake.js | 10 - .../test/integration/jakelib/rule.jake.js | 222 - .../jake/test/integration/list_tasks.js | 15 - .../jake/test/integration/publish_task.js | 27 - node_modules/jake/test/integration/rule.js | 217 - node_modules/jake/test/integration/selfdep.js | 42 - .../jake/test/integration/task_base.js | 167 - node_modules/jake/test/unit/jakefile.js | 36 - node_modules/jake/test/unit/namespace.js | 77 - node_modules/jake/test/unit/parseargs.js | 169 - node_modules/jake/usage.txt | 17 - node_modules/lru-cache/LICENSE | 15 - node_modules/lru-cache/README.md | 158 - node_modules/lru-cache/index.js | 468 - node_modules/lru-cache/package.json | 36 - node_modules/media-typer/HISTORY.md | 22 - node_modules/media-typer/LICENSE | 22 - node_modules/media-typer/README.md | 81 - node_modules/media-typer/index.js | 270 - node_modules/media-typer/package.json | 26 - node_modules/memorystore/.travis.yml | 10 - node_modules/memorystore/LICENSE | 21 - node_modules/memorystore/README.md | 71 - node_modules/memorystore/index.d.ts | 81 - node_modules/memorystore/index.js | 1 - node_modules/memorystore/lib/memorystore.js | 295 - .../memorystore/node_modules/debug/LICENSE | 20 - .../memorystore/node_modules/debug/README.md | 481 - .../node_modules/debug/package.json | 59 - .../node_modules/debug/src/browser.js | 269 - .../node_modules/debug/src/common.js | 274 - .../node_modules/debug/src/index.js | 10 - .../node_modules/debug/src/node.js | 263 - .../memorystore/node_modules/ms/index.js | 162 - .../memorystore/node_modules/ms/license.md | 21 - .../memorystore/node_modules/ms/package.json | 37 - .../memorystore/node_modules/ms/readme.md | 60 - node_modules/memorystore/package.json | 44 - node_modules/memorystore/test/store.js | 304 - node_modules/merge-descriptors/HISTORY.md | 21 - node_modules/merge-descriptors/LICENSE | 23 - node_modules/merge-descriptors/README.md | 48 - node_modules/merge-descriptors/index.js | 60 - node_modules/merge-descriptors/package.json | 32 - node_modules/methods/HISTORY.md | 29 - node_modules/methods/LICENSE | 24 - node_modules/methods/README.md | 51 - node_modules/methods/index.js | 69 - node_modules/methods/package.json | 36 - node_modules/mime-db/HISTORY.md | 507 - node_modules/mime-db/LICENSE | 23 - node_modules/mime-db/README.md | 100 - node_modules/mime-db/db.json | 8519 ----------------- node_modules/mime-db/index.js | 12 - node_modules/mime-db/package.json | 60 - node_modules/mime-types/HISTORY.md | 397 - node_modules/mime-types/LICENSE | 23 - node_modules/mime-types/README.md | 113 - node_modules/mime-types/index.js | 188 - node_modules/mime-types/package.json | 44 - node_modules/mime/.npmignore | 0 node_modules/mime/CHANGELOG.md | 164 - node_modules/mime/LICENSE | 21 - node_modules/mime/README.md | 90 - node_modules/mime/cli.js | 8 - node_modules/mime/mime.js | 108 - node_modules/mime/package.json | 44 - node_modules/mime/src/build.js | 53 - node_modules/mime/src/test.js | 60 - node_modules/mime/types.json | 1 - node_modules/minimatch/LICENSE | 15 - node_modules/minimatch/README.md | 230 - node_modules/minimatch/minimatch.js | 947 -- node_modules/minimatch/package.json | 33 - node_modules/ms/index.js | 152 - node_modules/ms/license.md | 21 - node_modules/ms/package.json | 37 - node_modules/ms/readme.md | 51 - node_modules/negotiator/HISTORY.md | 108 - node_modules/negotiator/LICENSE | 24 - node_modules/negotiator/README.md | 203 - node_modules/negotiator/index.js | 82 - node_modules/negotiator/lib/charset.js | 169 - node_modules/negotiator/lib/encoding.js | 184 - node_modules/negotiator/lib/language.js | 179 - node_modules/negotiator/lib/mediaType.js | 294 - node_modules/negotiator/package.json | 42 - node_modules/object-inspect/.eslintrc | 53 - .../object-inspect/.github/FUNDING.yml | 12 - node_modules/object-inspect/.nycrc | 13 - node_modules/object-inspect/CHANGELOG.md | 389 - node_modules/object-inspect/LICENSE | 21 - node_modules/object-inspect/example/all.js | 23 - .../object-inspect/example/circular.js | 6 - node_modules/object-inspect/example/fn.js | 5 - .../object-inspect/example/inspect.js | 10 - node_modules/object-inspect/index.js | 524 - .../object-inspect/package-support.json | 20 - node_modules/object-inspect/package.json | 99 - node_modules/object-inspect/readme.markdown | 86 - node_modules/object-inspect/test-core-js.js | 26 - node_modules/object-inspect/test/bigint.js | 58 - .../object-inspect/test/browser/dom.js | 15 - node_modules/object-inspect/test/circular.js | 16 - node_modules/object-inspect/test/deep.js | 12 - node_modules/object-inspect/test/element.js | 53 - node_modules/object-inspect/test/err.js | 48 - node_modules/object-inspect/test/fakes.js | 29 - node_modules/object-inspect/test/fn.js | 76 - node_modules/object-inspect/test/global.js | 17 - node_modules/object-inspect/test/has.js | 15 - node_modules/object-inspect/test/holes.js | 15 - .../object-inspect/test/indent-option.js | 271 - node_modules/object-inspect/test/inspect.js | 139 - node_modules/object-inspect/test/lowbyte.js | 12 - node_modules/object-inspect/test/number.js | 58 - .../object-inspect/test/quoteStyle.js | 17 - .../object-inspect/test/toStringTag.js | 40 - node_modules/object-inspect/test/undef.js | 12 - node_modules/object-inspect/test/values.js | 211 - node_modules/object-inspect/util.inspect.js | 1 - node_modules/on-finished/HISTORY.md | 98 - node_modules/on-finished/LICENSE | 23 - node_modules/on-finished/README.md | 162 - node_modules/on-finished/index.js | 234 - node_modules/on-finished/package.json | 39 - node_modules/on-headers/HISTORY.md | 21 - node_modules/on-headers/LICENSE | 22 - node_modules/on-headers/README.md | 81 - node_modules/on-headers/index.js | 132 - node_modules/on-headers/package.json | 42 - node_modules/packet-reader/.travis.yml | 8 - node_modules/packet-reader/README.md | 87 - node_modules/packet-reader/index.js | 65 - node_modules/packet-reader/package.json | 25 - node_modules/packet-reader/test/index.js | 148 - node_modules/parseurl/HISTORY.md | 58 - node_modules/parseurl/LICENSE | 24 - node_modules/parseurl/README.md | 133 - node_modules/parseurl/index.js | 158 - node_modules/parseurl/package.json | 40 - node_modules/path-to-regexp/History.md | 36 - node_modules/path-to-regexp/LICENSE | 21 - node_modules/path-to-regexp/Readme.md | 35 - node_modules/path-to-regexp/index.js | 129 - node_modules/path-to-regexp/package.json | 30 - node_modules/pg-cloudflare/LICENSE | 21 - node_modules/pg-cloudflare/README.md | 33 - node_modules/pg-cloudflare/dist/empty.d.ts | 2 - node_modules/pg-cloudflare/dist/empty.js | 4 - node_modules/pg-cloudflare/dist/empty.js.map | 1 - node_modules/pg-cloudflare/dist/index.d.ts | 31 - node_modules/pg-cloudflare/dist/index.js | 146 - node_modules/pg-cloudflare/dist/index.js.map | 1 - node_modules/pg-cloudflare/package.json | 32 - node_modules/pg-cloudflare/src/empty.ts | 3 - node_modules/pg-cloudflare/src/index.ts | 164 - node_modules/pg-cloudflare/src/types.d.ts | 25 - node_modules/pg-connection-string/LICENSE | 21 - node_modules/pg-connection-string/README.md | 77 - node_modules/pg-connection-string/index.d.ts | 15 - node_modules/pg-connection-string/index.js | 112 - .../pg-connection-string/package.json | 40 - node_modules/pg-int8/LICENSE | 13 - node_modules/pg-int8/README.md | 16 - node_modules/pg-int8/index.js | 100 - node_modules/pg-int8/package.json | 24 - node_modules/pg-pool/LICENSE | 21 - node_modules/pg-pool/README.md | 376 - node_modules/pg-pool/index.js | 467 - node_modules/pg-pool/package.json | 41 - .../pg-pool/test/bring-your-own-promise.js | 42 - .../pg-pool/test/connection-strings.js | 29 - .../pg-pool/test/connection-timeout.js | 229 - node_modules/pg-pool/test/ending.js | 40 - node_modules/pg-pool/test/error-handling.js | 260 - node_modules/pg-pool/test/events.js | 124 - .../pg-pool/test/idle-timeout-exit.js | 16 - node_modules/pg-pool/test/idle-timeout.js | 118 - node_modules/pg-pool/test/index.js | 226 - node_modules/pg-pool/test/lifetime-timeout.js | 48 - node_modules/pg-pool/test/logging.js | 20 - node_modules/pg-pool/test/max-uses.js | 98 - .../pg-pool/test/releasing-clients.js | 54 - node_modules/pg-pool/test/setup.js | 10 - node_modules/pg-pool/test/sizing.js | 58 - node_modules/pg-pool/test/submittable.js | 19 - node_modules/pg-pool/test/timeout.js | 0 node_modules/pg-pool/test/verify.js | 24 - node_modules/pg-protocol/LICENSE | 21 - node_modules/pg-protocol/README.md | 3 - node_modules/pg-protocol/dist/b.d.ts | 1 - node_modules/pg-protocol/dist/b.js | 25 - node_modules/pg-protocol/dist/b.js.map | 1 - .../pg-protocol/dist/buffer-reader.d.ts | 14 - .../pg-protocol/dist/buffer-reader.js | 50 - .../pg-protocol/dist/buffer-reader.js.map | 1 - .../pg-protocol/dist/buffer-writer.d.ts | 16 - .../pg-protocol/dist/buffer-writer.js | 81 - .../pg-protocol/dist/buffer-writer.js.map | 1 - .../pg-protocol/dist/inbound-parser.test.d.ts | 1 - .../pg-protocol/dist/inbound-parser.test.js | 511 - .../dist/inbound-parser.test.js.map | 1 - node_modules/pg-protocol/dist/index.d.ts | 6 - node_modules/pg-protocol/dist/index.js | 15 - node_modules/pg-protocol/dist/index.js.map | 1 - node_modules/pg-protocol/dist/messages.d.ts | 162 - node_modules/pg-protocol/dist/messages.js | 160 - node_modules/pg-protocol/dist/messages.js.map | 1 - .../dist/outbound-serializer.test.d.ts | 1 - .../dist/outbound-serializer.test.js | 248 - .../dist/outbound-serializer.test.js.map | 1 - node_modules/pg-protocol/dist/parser.d.ts | 38 - node_modules/pg-protocol/dist/parser.js | 308 - node_modules/pg-protocol/dist/parser.js.map | 1 - node_modules/pg-protocol/dist/serializer.d.ts | 43 - node_modules/pg-protocol/dist/serializer.js | 189 - .../pg-protocol/dist/serializer.js.map | 1 - node_modules/pg-protocol/package.json | 35 - node_modules/pg-protocol/src/b.ts | 28 - node_modules/pg-protocol/src/buffer-reader.ts | 53 - node_modules/pg-protocol/src/buffer-writer.ts | 85 - .../pg-protocol/src/inbound-parser.test.ts | 557 -- node_modules/pg-protocol/src/index.ts | 11 - node_modules/pg-protocol/src/messages.ts | 230 - .../src/outbound-serializer.test.ts | 272 - node_modules/pg-protocol/src/parser.ts | 389 - node_modules/pg-protocol/src/serializer.ts | 274 - .../pg-protocol/src/testing/buffer-list.ts | 75 - .../pg-protocol/src/testing/test-buffers.ts | 166 - .../pg-protocol/src/types/chunky.d.ts | 1 - node_modules/pg-types/.travis.yml | 7 - node_modules/pg-types/Makefile | 14 - node_modules/pg-types/README.md | 75 - node_modules/pg-types/index.d.ts | 137 - node_modules/pg-types/index.js | 47 - node_modules/pg-types/index.test-d.ts | 21 - node_modules/pg-types/lib/arrayParser.js | 11 - node_modules/pg-types/lib/binaryParsers.js | 257 - node_modules/pg-types/lib/builtins.js | 73 - node_modules/pg-types/lib/textParsers.js | 215 - node_modules/pg-types/package.json | 42 - node_modules/pg-types/test/index.js | 24 - node_modules/pg-types/test/types.js | 597 -- node_modules/pg/LICENSE | 21 - node_modules/pg/README.md | 89 - node_modules/pg/lib/client.js | 631 -- node_modules/pg/lib/connection-parameters.js | 167 - node_modules/pg/lib/connection.js | 223 - node_modules/pg/lib/crypto/sasl.js | 186 - node_modules/pg/lib/crypto/utils-legacy.js | 37 - node_modules/pg/lib/crypto/utils-webcrypto.js | 83 - node_modules/pg/lib/crypto/utils.js | 9 - node_modules/pg/lib/defaults.js | 84 - node_modules/pg/lib/index.js | 58 - node_modules/pg/lib/native/client.js | 307 - node_modules/pg/lib/native/index.js | 2 - node_modules/pg/lib/native/query.js | 165 - node_modules/pg/lib/query.js | 241 - node_modules/pg/lib/result.js | 107 - node_modules/pg/lib/stream.js | 28 - node_modules/pg/lib/type-overrides.js | 35 - node_modules/pg/lib/utils.js | 204 - node_modules/pg/package.json | 64 - node_modules/pgpass/README.md | 74 - node_modules/pgpass/lib/helper.js | 233 - node_modules/pgpass/lib/index.js | 23 - node_modules/pgpass/package.json | 41 - node_modules/postgres-array/index.d.ts | 4 - node_modules/postgres-array/index.js | 97 - node_modules/postgres-array/license | 21 - node_modules/postgres-array/package.json | 35 - node_modules/postgres-array/readme.md | 43 - node_modules/postgres-bytea/index.js | 31 - node_modules/postgres-bytea/license | 21 - node_modules/postgres-bytea/package.json | 34 - node_modules/postgres-bytea/readme.md | 34 - node_modules/postgres-date/index.js | 116 - node_modules/postgres-date/license | 21 - node_modules/postgres-date/package.json | 33 - node_modules/postgres-date/readme.md | 49 - node_modules/postgres-interval/index.d.ts | 20 - node_modules/postgres-interval/index.js | 125 - node_modules/postgres-interval/license | 21 - node_modules/postgres-interval/package.json | 36 - node_modules/postgres-interval/readme.md | 48 - node_modules/proxy-addr/HISTORY.md | 161 - node_modules/proxy-addr/LICENSE | 22 - node_modules/proxy-addr/README.md | 139 - node_modules/proxy-addr/index.js | 327 - node_modules/proxy-addr/package.json | 47 - node_modules/pseudomap/LICENSE | 15 - node_modules/pseudomap/README.md | 60 - node_modules/pseudomap/map.js | 9 - node_modules/pseudomap/package.json | 25 - node_modules/pseudomap/pseudomap.js | 113 - node_modules/pseudomap/test/basic.js | 86 - node_modules/qs/.editorconfig | 43 - node_modules/qs/.eslintrc | 38 - node_modules/qs/.github/FUNDING.yml | 12 - node_modules/qs/.nycrc | 13 - node_modules/qs/CHANGELOG.md | 546 -- node_modules/qs/LICENSE.md | 29 - node_modules/qs/README.md | 625 -- node_modules/qs/dist/qs.js | 2054 ---- node_modules/qs/lib/formats.js | 23 - node_modules/qs/lib/index.js | 11 - node_modules/qs/lib/parse.js | 263 - node_modules/qs/lib/stringify.js | 326 - node_modules/qs/lib/utils.js | 252 - node_modules/qs/package.json | 77 - node_modules/qs/test/parse.js | 855 -- node_modules/qs/test/stringify.js | 909 -- node_modules/qs/test/utils.js | 136 - node_modules/random-bytes/HISTORY.md | 4 - node_modules/random-bytes/LICENSE | 21 - node_modules/random-bytes/README.md | 77 - node_modules/random-bytes/index.js | 101 - node_modules/random-bytes/package.json | 36 - node_modules/range-parser/HISTORY.md | 56 - node_modules/range-parser/LICENSE | 23 - node_modules/range-parser/README.md | 84 - node_modules/range-parser/index.js | 162 - node_modules/range-parser/package.json | 44 - node_modules/raw-body/HISTORY.md | 303 - node_modules/raw-body/LICENSE | 22 - node_modules/raw-body/README.md | 223 - node_modules/raw-body/SECURITY.md | 24 - node_modules/raw-body/index.d.ts | 87 - node_modules/raw-body/index.js | 329 - node_modules/raw-body/package.json | 49 - node_modules/safe-buffer/LICENSE | 21 - node_modules/safe-buffer/README.md | 584 -- node_modules/safe-buffer/index.d.ts | 187 - node_modules/safe-buffer/index.js | 65 - node_modules/safe-buffer/package.json | 51 - node_modules/safer-buffer/LICENSE | 21 - node_modules/safer-buffer/Porting-Buffer.md | 268 - node_modules/safer-buffer/Readme.md | 156 - node_modules/safer-buffer/dangerous.js | 58 - node_modules/safer-buffer/package.json | 34 - node_modules/safer-buffer/safer.js | 77 - node_modules/safer-buffer/tests.js | 406 - node_modules/send/HISTORY.md | 521 - node_modules/send/LICENSE | 23 - node_modules/send/README.md | 327 - node_modules/send/SECURITY.md | 24 - node_modules/send/index.js | 1143 --- node_modules/send/node_modules/ms/index.js | 162 - node_modules/send/node_modules/ms/license.md | 21 - .../send/node_modules/ms/package.json | 38 - node_modules/send/node_modules/ms/readme.md | 59 - node_modules/send/package.json | 62 - node_modules/serve-static/HISTORY.md | 471 - node_modules/serve-static/LICENSE | 25 - node_modules/serve-static/README.md | 257 - node_modules/serve-static/index.js | 210 - node_modules/serve-static/package.json | 42 - node_modules/set-function-length/.eslintrc | 27 - .../set-function-length/.github/FUNDING.yml | 12 - node_modules/set-function-length/.nycrc | 13 - node_modules/set-function-length/CHANGELOG.md | 41 - node_modules/set-function-length/LICENSE | 21 - node_modules/set-function-length/README.md | 56 - node_modules/set-function-length/env.js | 19 - node_modules/set-function-length/index.js | 41 - node_modules/set-function-length/package.json | 84 - node_modules/setprototypeof/LICENSE | 13 - node_modules/setprototypeof/README.md | 31 - node_modules/setprototypeof/index.d.ts | 2 - node_modules/setprototypeof/index.js | 17 - node_modules/setprototypeof/package.json | 38 - node_modules/setprototypeof/test/index.js | 24 - node_modules/side-channel/.eslintignore | 1 - node_modules/side-channel/.eslintrc | 11 - node_modules/side-channel/.github/FUNDING.yml | 12 - node_modules/side-channel/.nycrc | 13 - node_modules/side-channel/CHANGELOG.md | 65 - node_modules/side-channel/LICENSE | 21 - node_modules/side-channel/README.md | 2 - node_modules/side-channel/index.js | 124 - node_modules/side-channel/package.json | 67 - node_modules/side-channel/test/index.js | 78 - node_modules/split2/LICENSE | 13 - node_modules/split2/README.md | 85 - node_modules/split2/bench.js | 27 - node_modules/split2/index.js | 141 - node_modules/split2/package.json | 39 - node_modules/split2/test.js | 409 - node_modules/statuses/HISTORY.md | 82 - node_modules/statuses/LICENSE | 23 - node_modules/statuses/README.md | 136 - node_modules/statuses/codes.json | 65 - node_modules/statuses/index.js | 146 - node_modules/statuses/package.json | 49 - node_modules/supports-color/browser.js | 5 - node_modules/supports-color/index.js | 135 - node_modules/supports-color/license | 9 - node_modules/supports-color/package.json | 53 - node_modules/supports-color/readme.md | 76 - node_modules/toidentifier/HISTORY.md | 9 - node_modules/toidentifier/LICENSE | 21 - node_modules/toidentifier/README.md | 61 - node_modules/toidentifier/index.js | 32 - node_modules/toidentifier/package.json | 38 - node_modules/type-is/HISTORY.md | 259 - node_modules/type-is/LICENSE | 23 - node_modules/type-is/README.md | 170 - node_modules/type-is/index.js | 266 - node_modules/type-is/package.json | 45 - node_modules/uid-safe/HISTORY.md | 61 - node_modules/uid-safe/LICENSE | 22 - node_modules/uid-safe/README.md | 77 - node_modules/uid-safe/index.js | 107 - node_modules/uid-safe/package.json | 46 - node_modules/unpipe/HISTORY.md | 4 - node_modules/unpipe/LICENSE | 22 - node_modules/unpipe/README.md | 43 - node_modules/unpipe/index.js | 69 - node_modules/unpipe/package.json | 27 - node_modules/utils-merge/.npmignore | 9 - node_modules/utils-merge/LICENSE | 20 - node_modules/utils-merge/README.md | 34 - node_modules/utils-merge/index.js | 23 - node_modules/utils-merge/package.json | 40 - node_modules/vary/HISTORY.md | 39 - node_modules/vary/LICENSE | 22 - node_modules/vary/README.md | 101 - node_modules/vary/index.js | 149 - node_modules/vary/package.json | 43 - node_modules/xtend/.jshintrc | 30 - node_modules/xtend/LICENSE | 20 - node_modules/xtend/README.md | 32 - node_modules/xtend/immutable.js | 19 - node_modules/xtend/mutable.js | 17 - node_modules/xtend/package.json | 55 - node_modules/xtend/test.js | 103 - node_modules/yallist/LICENSE | 15 - node_modules/yallist/README.md | 204 - node_modules/yallist/iterator.js | 7 - node_modules/yallist/package.json | 29 - node_modules/yallist/yallist.js | 370 - 1002 files changed, 133916 deletions(-) rename .gitginore => .gitignore (100%) delete mode 120000 node_modules/.bin/ejs delete mode 120000 node_modules/.bin/jake delete mode 120000 node_modules/.bin/mime delete mode 100644 node_modules/.package-lock.json delete mode 100644 node_modules/accepts/HISTORY.md delete mode 100644 node_modules/accepts/LICENSE delete mode 100644 node_modules/accepts/README.md delete mode 100644 node_modules/accepts/index.js delete mode 100644 node_modules/accepts/package.json delete mode 100644 node_modules/ansi-styles/index.d.ts delete mode 100644 node_modules/ansi-styles/index.js delete mode 100644 node_modules/ansi-styles/license delete mode 100644 node_modules/ansi-styles/package.json delete mode 100644 node_modules/ansi-styles/readme.md delete mode 100644 node_modules/array-flatten/LICENSE delete mode 100644 node_modules/array-flatten/README.md delete mode 100644 node_modules/array-flatten/array-flatten.js delete mode 100644 node_modules/array-flatten/package.json delete mode 100644 node_modules/async/CHANGELOG.md delete mode 100644 node_modules/async/LICENSE delete mode 100644 node_modules/async/README.md delete mode 100644 node_modules/async/all.js delete mode 100644 node_modules/async/allLimit.js delete mode 100644 node_modules/async/allSeries.js delete mode 100644 node_modules/async/any.js delete mode 100644 node_modules/async/anyLimit.js delete mode 100644 node_modules/async/anySeries.js delete mode 100644 node_modules/async/apply.js delete mode 100644 node_modules/async/applyEach.js delete mode 100644 node_modules/async/applyEachSeries.js delete mode 100644 node_modules/async/asyncify.js delete mode 100644 node_modules/async/auto.js delete mode 100644 node_modules/async/autoInject.js delete mode 100644 node_modules/async/bower.json delete mode 100644 node_modules/async/cargo.js delete mode 100644 node_modules/async/cargoQueue.js delete mode 100644 node_modules/async/compose.js delete mode 100644 node_modules/async/concat.js delete mode 100644 node_modules/async/concatLimit.js delete mode 100644 node_modules/async/concatSeries.js delete mode 100644 node_modules/async/constant.js delete mode 100644 node_modules/async/detect.js delete mode 100644 node_modules/async/detectLimit.js delete mode 100644 node_modules/async/detectSeries.js delete mode 100644 node_modules/async/dir.js delete mode 100644 node_modules/async/dist/async.js delete mode 100644 node_modules/async/dist/async.min.js delete mode 100644 node_modules/async/dist/async.mjs delete mode 100644 node_modules/async/doDuring.js delete mode 100644 node_modules/async/doUntil.js delete mode 100644 node_modules/async/doWhilst.js delete mode 100644 node_modules/async/during.js delete mode 100644 node_modules/async/each.js delete mode 100644 node_modules/async/eachLimit.js delete mode 100644 node_modules/async/eachOf.js delete mode 100644 node_modules/async/eachOfLimit.js delete mode 100644 node_modules/async/eachOfSeries.js delete mode 100644 node_modules/async/eachSeries.js delete mode 100644 node_modules/async/ensureAsync.js delete mode 100644 node_modules/async/every.js delete mode 100644 node_modules/async/everyLimit.js delete mode 100644 node_modules/async/everySeries.js delete mode 100644 node_modules/async/filter.js delete mode 100644 node_modules/async/filterLimit.js delete mode 100644 node_modules/async/filterSeries.js delete mode 100644 node_modules/async/find.js delete mode 100644 node_modules/async/findLimit.js delete mode 100644 node_modules/async/findSeries.js delete mode 100644 node_modules/async/flatMap.js delete mode 100644 node_modules/async/flatMapLimit.js delete mode 100644 node_modules/async/flatMapSeries.js delete mode 100644 node_modules/async/foldl.js delete mode 100644 node_modules/async/foldr.js delete mode 100644 node_modules/async/forEach.js delete mode 100644 node_modules/async/forEachLimit.js delete mode 100644 node_modules/async/forEachOf.js delete mode 100644 node_modules/async/forEachOfLimit.js delete mode 100644 node_modules/async/forEachOfSeries.js delete mode 100644 node_modules/async/forEachSeries.js delete mode 100644 node_modules/async/forever.js delete mode 100644 node_modules/async/groupBy.js delete mode 100644 node_modules/async/groupByLimit.js delete mode 100644 node_modules/async/groupBySeries.js delete mode 100644 node_modules/async/index.js delete mode 100644 node_modules/async/inject.js delete mode 100644 node_modules/async/internal/DoublyLinkedList.js delete mode 100644 node_modules/async/internal/Heap.js delete mode 100644 node_modules/async/internal/applyEach.js delete mode 100644 node_modules/async/internal/asyncEachOfLimit.js delete mode 100644 node_modules/async/internal/awaitify.js delete mode 100644 node_modules/async/internal/breakLoop.js delete mode 100644 node_modules/async/internal/consoleFunc.js delete mode 100644 node_modules/async/internal/createTester.js delete mode 100644 node_modules/async/internal/eachOfLimit.js delete mode 100644 node_modules/async/internal/filter.js delete mode 100644 node_modules/async/internal/getIterator.js delete mode 100644 node_modules/async/internal/initialParams.js delete mode 100644 node_modules/async/internal/isArrayLike.js delete mode 100644 node_modules/async/internal/iterator.js delete mode 100644 node_modules/async/internal/map.js delete mode 100644 node_modules/async/internal/once.js delete mode 100644 node_modules/async/internal/onlyOnce.js delete mode 100644 node_modules/async/internal/parallel.js delete mode 100644 node_modules/async/internal/promiseCallback.js delete mode 100644 node_modules/async/internal/queue.js delete mode 100644 node_modules/async/internal/range.js delete mode 100644 node_modules/async/internal/reject.js delete mode 100644 node_modules/async/internal/setImmediate.js delete mode 100644 node_modules/async/internal/withoutIndex.js delete mode 100644 node_modules/async/internal/wrapAsync.js delete mode 100644 node_modules/async/log.js delete mode 100644 node_modules/async/map.js delete mode 100644 node_modules/async/mapLimit.js delete mode 100644 node_modules/async/mapSeries.js delete mode 100644 node_modules/async/mapValues.js delete mode 100644 node_modules/async/mapValuesLimit.js delete mode 100644 node_modules/async/mapValuesSeries.js delete mode 100644 node_modules/async/memoize.js delete mode 100644 node_modules/async/nextTick.js delete mode 100644 node_modules/async/package.json delete mode 100644 node_modules/async/parallel.js delete mode 100644 node_modules/async/parallelLimit.js delete mode 100644 node_modules/async/priorityQueue.js delete mode 100644 node_modules/async/queue.js delete mode 100644 node_modules/async/race.js delete mode 100644 node_modules/async/reduce.js delete mode 100644 node_modules/async/reduceRight.js delete mode 100644 node_modules/async/reflect.js delete mode 100644 node_modules/async/reflectAll.js delete mode 100644 node_modules/async/reject.js delete mode 100644 node_modules/async/rejectLimit.js delete mode 100644 node_modules/async/rejectSeries.js delete mode 100644 node_modules/async/retry.js delete mode 100644 node_modules/async/retryable.js delete mode 100644 node_modules/async/select.js delete mode 100644 node_modules/async/selectLimit.js delete mode 100644 node_modules/async/selectSeries.js delete mode 100644 node_modules/async/seq.js delete mode 100644 node_modules/async/series.js delete mode 100644 node_modules/async/setImmediate.js delete mode 100644 node_modules/async/some.js delete mode 100644 node_modules/async/someLimit.js delete mode 100644 node_modules/async/someSeries.js delete mode 100644 node_modules/async/sortBy.js delete mode 100644 node_modules/async/timeout.js delete mode 100644 node_modules/async/times.js delete mode 100644 node_modules/async/timesLimit.js delete mode 100644 node_modules/async/timesSeries.js delete mode 100644 node_modules/async/transform.js delete mode 100644 node_modules/async/tryEach.js delete mode 100644 node_modules/async/unmemoize.js delete mode 100644 node_modules/async/until.js delete mode 100644 node_modules/async/waterfall.js delete mode 100644 node_modules/async/whilst.js delete mode 100644 node_modules/async/wrapSync.js delete mode 100644 node_modules/balanced-match/.github/FUNDING.yml delete mode 100644 node_modules/balanced-match/LICENSE.md delete mode 100644 node_modules/balanced-match/README.md delete mode 100644 node_modules/balanced-match/index.js delete mode 100644 node_modules/balanced-match/package.json delete mode 100644 node_modules/bcryptjs/.npmignore delete mode 100644 node_modules/bcryptjs/.travis.yml delete mode 100644 node_modules/bcryptjs/.vscode/settings.json delete mode 100644 node_modules/bcryptjs/LICENSE delete mode 100644 node_modules/bcryptjs/README.md delete mode 100644 node_modules/bcryptjs/bin/bcrypt delete mode 100644 node_modules/bcryptjs/bower.json delete mode 100644 node_modules/bcryptjs/dist/README.md delete mode 100644 node_modules/bcryptjs/dist/bcrypt.js delete mode 100644 node_modules/bcryptjs/dist/bcrypt.min.js delete mode 100644 node_modules/bcryptjs/dist/bcrypt.min.js.gz delete mode 100644 node_modules/bcryptjs/dist/bcrypt.min.map delete mode 100644 node_modules/bcryptjs/externs/bcrypt.js delete mode 100644 node_modules/bcryptjs/externs/minimal-env.js delete mode 100644 node_modules/bcryptjs/index.js delete mode 100644 node_modules/bcryptjs/package.json delete mode 100644 node_modules/bcryptjs/scripts/build.js delete mode 100644 node_modules/bcryptjs/src/bcrypt.js delete mode 100644 node_modules/bcryptjs/src/bcrypt/impl.js delete mode 100644 node_modules/bcryptjs/src/bcrypt/prng/README.md delete mode 100644 node_modules/bcryptjs/src/bcrypt/prng/accum.js delete mode 100644 node_modules/bcryptjs/src/bcrypt/prng/isaac.js delete mode 100644 node_modules/bcryptjs/src/bcrypt/util.js delete mode 100644 node_modules/bcryptjs/src/bcrypt/util/base64.js delete mode 100644 node_modules/bcryptjs/src/bower.json delete mode 100644 node_modules/bcryptjs/src/wrap.js delete mode 100644 node_modules/bcryptjs/tests/quickbrown.txt delete mode 100644 node_modules/bcryptjs/tests/suite.js delete mode 100644 node_modules/body-parser/HISTORY.md delete mode 100644 node_modules/body-parser/LICENSE delete mode 100644 node_modules/body-parser/README.md delete mode 100644 node_modules/body-parser/SECURITY.md delete mode 100644 node_modules/body-parser/index.js delete mode 100644 node_modules/body-parser/lib/read.js delete mode 100644 node_modules/body-parser/lib/types/json.js delete mode 100644 node_modules/body-parser/lib/types/raw.js delete mode 100644 node_modules/body-parser/lib/types/text.js delete mode 100644 node_modules/body-parser/lib/types/urlencoded.js delete mode 100644 node_modules/body-parser/package.json delete mode 100644 node_modules/brace-expansion/LICENSE delete mode 100644 node_modules/brace-expansion/README.md delete mode 100644 node_modules/brace-expansion/index.js delete mode 100644 node_modules/brace-expansion/package.json delete mode 100644 node_modules/buffer-writer/.travis.yml delete mode 100644 node_modules/buffer-writer/LICENSE delete mode 100644 node_modules/buffer-writer/README.md delete mode 100644 node_modules/buffer-writer/index.js delete mode 100644 node_modules/buffer-writer/package.json delete mode 100644 node_modules/buffer-writer/test/mocha.opts delete mode 100644 node_modules/buffer-writer/test/writer-tests.js delete mode 100644 node_modules/bytes/History.md delete mode 100644 node_modules/bytes/LICENSE delete mode 100644 node_modules/bytes/Readme.md delete mode 100644 node_modules/bytes/index.js delete mode 100644 node_modules/bytes/package.json delete mode 100644 node_modules/call-bind/.eslintignore delete mode 100644 node_modules/call-bind/.eslintrc delete mode 100644 node_modules/call-bind/.github/FUNDING.yml delete mode 100644 node_modules/call-bind/.nycrc delete mode 100644 node_modules/call-bind/CHANGELOG.md delete mode 100644 node_modules/call-bind/LICENSE delete mode 100644 node_modules/call-bind/README.md delete mode 100644 node_modules/call-bind/callBound.js delete mode 100644 node_modules/call-bind/index.js delete mode 100644 node_modules/call-bind/package.json delete mode 100644 node_modules/call-bind/test/callBound.js delete mode 100644 node_modules/call-bind/test/index.js delete mode 100644 node_modules/chalk/index.d.ts delete mode 100644 node_modules/chalk/license delete mode 100644 node_modules/chalk/package.json delete mode 100644 node_modules/chalk/readme.md delete mode 100644 node_modules/chalk/source/index.js delete mode 100644 node_modules/chalk/source/templates.js delete mode 100644 node_modules/chalk/source/util.js delete mode 100644 node_modules/color-convert/CHANGELOG.md delete mode 100644 node_modules/color-convert/LICENSE delete mode 100644 node_modules/color-convert/README.md delete mode 100644 node_modules/color-convert/conversions.js delete mode 100644 node_modules/color-convert/index.js delete mode 100644 node_modules/color-convert/package.json delete mode 100644 node_modules/color-convert/route.js delete mode 100644 node_modules/color-name/LICENSE delete mode 100644 node_modules/color-name/README.md delete mode 100644 node_modules/color-name/index.js delete mode 100644 node_modules/color-name/package.json delete mode 100644 node_modules/concat-map/.travis.yml delete mode 100644 node_modules/concat-map/LICENSE delete mode 100644 node_modules/concat-map/README.markdown delete mode 100644 node_modules/concat-map/example/map.js delete mode 100644 node_modules/concat-map/index.js delete mode 100644 node_modules/concat-map/package.json delete mode 100644 node_modules/concat-map/test/map.js delete mode 100644 node_modules/content-disposition/HISTORY.md delete mode 100644 node_modules/content-disposition/LICENSE delete mode 100644 node_modules/content-disposition/README.md delete mode 100644 node_modules/content-disposition/index.js delete mode 100644 node_modules/content-disposition/package.json delete mode 100644 node_modules/content-type/HISTORY.md delete mode 100644 node_modules/content-type/LICENSE delete mode 100644 node_modules/content-type/README.md delete mode 100644 node_modules/content-type/index.js delete mode 100644 node_modules/content-type/package.json delete mode 100644 node_modules/cookie-signature/.npmignore delete mode 100644 node_modules/cookie-signature/History.md delete mode 100644 node_modules/cookie-signature/Readme.md delete mode 100644 node_modules/cookie-signature/index.js delete mode 100644 node_modules/cookie-signature/package.json delete mode 100644 node_modules/cookie/HISTORY.md delete mode 100644 node_modules/cookie/LICENSE delete mode 100644 node_modules/cookie/README.md delete mode 100644 node_modules/cookie/SECURITY.md delete mode 100644 node_modules/cookie/index.js delete mode 100644 node_modules/cookie/package.json delete mode 100644 node_modules/debug/.coveralls.yml delete mode 100644 node_modules/debug/.eslintrc delete mode 100644 node_modules/debug/.npmignore delete mode 100644 node_modules/debug/.travis.yml delete mode 100644 node_modules/debug/CHANGELOG.md delete mode 100644 node_modules/debug/LICENSE delete mode 100644 node_modules/debug/Makefile delete mode 100644 node_modules/debug/README.md delete mode 100644 node_modules/debug/component.json delete mode 100644 node_modules/debug/karma.conf.js delete mode 100644 node_modules/debug/node.js delete mode 100644 node_modules/debug/package.json delete mode 100644 node_modules/debug/src/browser.js delete mode 100644 node_modules/debug/src/debug.js delete mode 100644 node_modules/debug/src/index.js delete mode 100644 node_modules/debug/src/inspector-log.js delete mode 100644 node_modules/debug/src/node.js delete mode 100644 node_modules/define-data-property/.eslintrc delete mode 100644 node_modules/define-data-property/.github/FUNDING.yml delete mode 100644 node_modules/define-data-property/.nycrc delete mode 100644 node_modules/define-data-property/CHANGELOG.md delete mode 100644 node_modules/define-data-property/LICENSE delete mode 100644 node_modules/define-data-property/README.md delete mode 100644 node_modules/define-data-property/index.d.ts delete mode 100644 node_modules/define-data-property/index.d.ts.map delete mode 100644 node_modules/define-data-property/index.js delete mode 100644 node_modules/define-data-property/package.json delete mode 100644 node_modules/define-data-property/test/index.js delete mode 100644 node_modules/define-data-property/tsconfig.json delete mode 100644 node_modules/depd/History.md delete mode 100644 node_modules/depd/LICENSE delete mode 100644 node_modules/depd/Readme.md delete mode 100644 node_modules/depd/index.js delete mode 100644 node_modules/depd/lib/browser/index.js delete mode 100644 node_modules/depd/package.json delete mode 100644 node_modules/destroy/LICENSE delete mode 100644 node_modules/destroy/README.md delete mode 100644 node_modules/destroy/index.js delete mode 100644 node_modules/destroy/package.json delete mode 100644 node_modules/dotenv/CHANGELOG.md delete mode 100644 node_modules/dotenv/LICENSE delete mode 100644 node_modules/dotenv/README-es.md delete mode 100644 node_modules/dotenv/README.md delete mode 100644 node_modules/dotenv/config.d.ts delete mode 100644 node_modules/dotenv/config.js delete mode 100644 node_modules/dotenv/lib/cli-options.js delete mode 100644 node_modules/dotenv/lib/env-options.js delete mode 100644 node_modules/dotenv/lib/main.d.ts delete mode 100644 node_modules/dotenv/lib/main.js delete mode 100644 node_modules/dotenv/package.json delete mode 100644 node_modules/ee-first/LICENSE delete mode 100644 node_modules/ee-first/README.md delete mode 100644 node_modules/ee-first/index.js delete mode 100644 node_modules/ee-first/package.json delete mode 100644 node_modules/ejs/LICENSE delete mode 100644 node_modules/ejs/README.md delete mode 100755 node_modules/ejs/bin/cli.js delete mode 100644 node_modules/ejs/ejs.js delete mode 100644 node_modules/ejs/ejs.min.js delete mode 100644 node_modules/ejs/jakefile.js delete mode 100755 node_modules/ejs/lib/ejs.js delete mode 100644 node_modules/ejs/lib/utils.js delete mode 100644 node_modules/ejs/package.json delete mode 100644 node_modules/ejs/usage.txt delete mode 100644 node_modules/encodeurl/HISTORY.md delete mode 100644 node_modules/encodeurl/LICENSE delete mode 100644 node_modules/encodeurl/README.md delete mode 100644 node_modules/encodeurl/index.js delete mode 100644 node_modules/encodeurl/package.json delete mode 100644 node_modules/escape-html/LICENSE delete mode 100644 node_modules/escape-html/Readme.md delete mode 100644 node_modules/escape-html/index.js delete mode 100644 node_modules/escape-html/package.json delete mode 100644 node_modules/etag/HISTORY.md delete mode 100644 node_modules/etag/LICENSE delete mode 100644 node_modules/etag/README.md delete mode 100644 node_modules/etag/index.js delete mode 100644 node_modules/etag/package.json delete mode 100644 node_modules/express-session/HISTORY.md delete mode 100644 node_modules/express-session/LICENSE delete mode 100644 node_modules/express-session/README.md delete mode 100644 node_modules/express-session/index.js delete mode 100644 node_modules/express-session/node_modules/cookie/HISTORY.md delete mode 100644 node_modules/express-session/node_modules/cookie/LICENSE delete mode 100644 node_modules/express-session/node_modules/cookie/README.md delete mode 100644 node_modules/express-session/node_modules/cookie/index.js delete mode 100644 node_modules/express-session/node_modules/cookie/package.json delete mode 100644 node_modules/express-session/package.json delete mode 100644 node_modules/express-session/session/cookie.js delete mode 100644 node_modules/express-session/session/memory.js delete mode 100644 node_modules/express-session/session/session.js delete mode 100644 node_modules/express-session/session/store.js delete mode 100644 node_modules/express/History.md delete mode 100644 node_modules/express/LICENSE delete mode 100644 node_modules/express/Readme.md delete mode 100644 node_modules/express/index.js delete mode 100644 node_modules/express/lib/application.js delete mode 100644 node_modules/express/lib/express.js delete mode 100644 node_modules/express/lib/middleware/init.js delete mode 100644 node_modules/express/lib/middleware/query.js delete mode 100644 node_modules/express/lib/request.js delete mode 100644 node_modules/express/lib/response.js delete mode 100644 node_modules/express/lib/router/index.js delete mode 100644 node_modules/express/lib/router/layer.js delete mode 100644 node_modules/express/lib/router/route.js delete mode 100644 node_modules/express/lib/utils.js delete mode 100644 node_modules/express/lib/view.js delete mode 100644 node_modules/express/package.json delete mode 100644 node_modules/filelist/README.md delete mode 100644 node_modules/filelist/index.d.ts delete mode 100644 node_modules/filelist/index.js delete mode 100644 node_modules/filelist/jakefile.js delete mode 100644 node_modules/filelist/node_modules/brace-expansion/.github/FUNDING.yml delete mode 100644 node_modules/filelist/node_modules/brace-expansion/LICENSE delete mode 100644 node_modules/filelist/node_modules/brace-expansion/README.md delete mode 100644 node_modules/filelist/node_modules/brace-expansion/index.js delete mode 100644 node_modules/filelist/node_modules/brace-expansion/package.json delete mode 100644 node_modules/filelist/node_modules/minimatch/LICENSE delete mode 100644 node_modules/filelist/node_modules/minimatch/README.md delete mode 100644 node_modules/filelist/node_modules/minimatch/lib/path.js delete mode 100644 node_modules/filelist/node_modules/minimatch/minimatch.js delete mode 100644 node_modules/filelist/node_modules/minimatch/package.json delete mode 100644 node_modules/filelist/package.json delete mode 100644 node_modules/finalhandler/HISTORY.md delete mode 100644 node_modules/finalhandler/LICENSE delete mode 100644 node_modules/finalhandler/README.md delete mode 100644 node_modules/finalhandler/SECURITY.md delete mode 100644 node_modules/finalhandler/index.js delete mode 100644 node_modules/finalhandler/package.json delete mode 100644 node_modules/forwarded/HISTORY.md delete mode 100644 node_modules/forwarded/LICENSE delete mode 100644 node_modules/forwarded/README.md delete mode 100644 node_modules/forwarded/index.js delete mode 100644 node_modules/forwarded/package.json delete mode 100644 node_modules/fresh/HISTORY.md delete mode 100644 node_modules/fresh/LICENSE delete mode 100644 node_modules/fresh/README.md delete mode 100644 node_modules/fresh/index.js delete mode 100644 node_modules/fresh/package.json delete mode 100644 node_modules/function-bind/.eslintrc delete mode 100644 node_modules/function-bind/.github/FUNDING.yml delete mode 100644 node_modules/function-bind/.github/SECURITY.md delete mode 100644 node_modules/function-bind/.nycrc delete mode 100644 node_modules/function-bind/CHANGELOG.md delete mode 100644 node_modules/function-bind/LICENSE delete mode 100644 node_modules/function-bind/README.md delete mode 100644 node_modules/function-bind/implementation.js delete mode 100644 node_modules/function-bind/index.js delete mode 100644 node_modules/function-bind/package.json delete mode 100644 node_modules/function-bind/test/.eslintrc delete mode 100644 node_modules/function-bind/test/index.js delete mode 100644 node_modules/get-intrinsic/.eslintrc delete mode 100644 node_modules/get-intrinsic/.github/FUNDING.yml delete mode 100644 node_modules/get-intrinsic/.nycrc delete mode 100644 node_modules/get-intrinsic/CHANGELOG.md delete mode 100644 node_modules/get-intrinsic/LICENSE delete mode 100644 node_modules/get-intrinsic/README.md delete mode 100644 node_modules/get-intrinsic/index.js delete mode 100644 node_modules/get-intrinsic/package.json delete mode 100644 node_modules/get-intrinsic/test/GetIntrinsic.js delete mode 100644 node_modules/gopd/.eslintrc delete mode 100644 node_modules/gopd/.github/FUNDING.yml delete mode 100644 node_modules/gopd/CHANGELOG.md delete mode 100644 node_modules/gopd/LICENSE delete mode 100644 node_modules/gopd/README.md delete mode 100644 node_modules/gopd/index.js delete mode 100644 node_modules/gopd/package.json delete mode 100644 node_modules/gopd/test/index.js delete mode 100644 node_modules/has-flag/index.d.ts delete mode 100644 node_modules/has-flag/index.js delete mode 100644 node_modules/has-flag/license delete mode 100644 node_modules/has-flag/package.json delete mode 100644 node_modules/has-flag/readme.md delete mode 100644 node_modules/has-property-descriptors/.eslintrc delete mode 100644 node_modules/has-property-descriptors/.github/FUNDING.yml delete mode 100644 node_modules/has-property-descriptors/.nycrc delete mode 100644 node_modules/has-property-descriptors/CHANGELOG.md delete mode 100644 node_modules/has-property-descriptors/LICENSE delete mode 100644 node_modules/has-property-descriptors/README.md delete mode 100644 node_modules/has-property-descriptors/index.js delete mode 100644 node_modules/has-property-descriptors/package.json delete mode 100644 node_modules/has-property-descriptors/test/index.js delete mode 100644 node_modules/has-proto/.eslintrc delete mode 100644 node_modules/has-proto/.github/FUNDING.yml delete mode 100644 node_modules/has-proto/CHANGELOG.md delete mode 100644 node_modules/has-proto/LICENSE delete mode 100644 node_modules/has-proto/README.md delete mode 100644 node_modules/has-proto/index.js delete mode 100644 node_modules/has-proto/package.json delete mode 100644 node_modules/has-proto/test/index.js delete mode 100644 node_modules/has-symbols/.eslintrc delete mode 100644 node_modules/has-symbols/.github/FUNDING.yml delete mode 100644 node_modules/has-symbols/.nycrc delete mode 100644 node_modules/has-symbols/CHANGELOG.md delete mode 100644 node_modules/has-symbols/LICENSE delete mode 100644 node_modules/has-symbols/README.md delete mode 100644 node_modules/has-symbols/index.js delete mode 100644 node_modules/has-symbols/package.json delete mode 100644 node_modules/has-symbols/shams.js delete mode 100644 node_modules/has-symbols/test/index.js delete mode 100644 node_modules/has-symbols/test/shams/core-js.js delete mode 100644 node_modules/has-symbols/test/shams/get-own-property-symbols.js delete mode 100644 node_modules/has-symbols/test/tests.js delete mode 100644 node_modules/hasown/.eslintrc delete mode 100644 node_modules/hasown/.github/FUNDING.yml delete mode 100644 node_modules/hasown/.nycrc delete mode 100644 node_modules/hasown/CHANGELOG.md delete mode 100644 node_modules/hasown/LICENSE delete mode 100644 node_modules/hasown/README.md delete mode 100644 node_modules/hasown/index.d.ts delete mode 100644 node_modules/hasown/index.d.ts.map delete mode 100644 node_modules/hasown/index.js delete mode 100644 node_modules/hasown/package.json delete mode 100644 node_modules/hasown/tsconfig.json delete mode 100644 node_modules/http-errors/HISTORY.md delete mode 100644 node_modules/http-errors/LICENSE delete mode 100644 node_modules/http-errors/README.md delete mode 100644 node_modules/http-errors/index.js delete mode 100644 node_modules/http-errors/package.json delete mode 100644 node_modules/iconv-lite/Changelog.md delete mode 100644 node_modules/iconv-lite/LICENSE delete mode 100644 node_modules/iconv-lite/README.md delete mode 100644 node_modules/iconv-lite/encodings/dbcs-codec.js delete mode 100644 node_modules/iconv-lite/encodings/dbcs-data.js delete mode 100644 node_modules/iconv-lite/encodings/index.js delete mode 100644 node_modules/iconv-lite/encodings/internal.js delete mode 100644 node_modules/iconv-lite/encodings/sbcs-codec.js delete mode 100644 node_modules/iconv-lite/encodings/sbcs-data-generated.js delete mode 100644 node_modules/iconv-lite/encodings/sbcs-data.js delete mode 100644 node_modules/iconv-lite/encodings/tables/big5-added.json delete mode 100644 node_modules/iconv-lite/encodings/tables/cp936.json delete mode 100644 node_modules/iconv-lite/encodings/tables/cp949.json delete mode 100644 node_modules/iconv-lite/encodings/tables/cp950.json delete mode 100644 node_modules/iconv-lite/encodings/tables/eucjp.json delete mode 100644 node_modules/iconv-lite/encodings/tables/gb18030-ranges.json delete mode 100644 node_modules/iconv-lite/encodings/tables/gbk-added.json delete mode 100644 node_modules/iconv-lite/encodings/tables/shiftjis.json delete mode 100644 node_modules/iconv-lite/encodings/utf16.js delete mode 100644 node_modules/iconv-lite/encodings/utf7.js delete mode 100644 node_modules/iconv-lite/lib/bom-handling.js delete mode 100644 node_modules/iconv-lite/lib/extend-node.js delete mode 100644 node_modules/iconv-lite/lib/index.d.ts delete mode 100644 node_modules/iconv-lite/lib/index.js delete mode 100644 node_modules/iconv-lite/lib/streams.js delete mode 100644 node_modules/iconv-lite/package.json delete mode 100644 node_modules/inherits/LICENSE delete mode 100644 node_modules/inherits/README.md delete mode 100644 node_modules/inherits/inherits.js delete mode 100644 node_modules/inherits/inherits_browser.js delete mode 100644 node_modules/inherits/package.json delete mode 100644 node_modules/ipaddr.js/LICENSE delete mode 100644 node_modules/ipaddr.js/README.md delete mode 100644 node_modules/ipaddr.js/ipaddr.min.js delete mode 100644 node_modules/ipaddr.js/lib/ipaddr.js delete mode 100644 node_modules/ipaddr.js/lib/ipaddr.js.d.ts delete mode 100644 node_modules/ipaddr.js/package.json delete mode 100644 node_modules/jake/Makefile delete mode 100644 node_modules/jake/README.md delete mode 100755 node_modules/jake/bin/bash_completion.sh delete mode 100755 node_modules/jake/bin/cli.js delete mode 100644 node_modules/jake/jakefile.js delete mode 100644 node_modules/jake/lib/api.js delete mode 100644 node_modules/jake/lib/jake.js delete mode 100644 node_modules/jake/lib/loader.js delete mode 100644 node_modules/jake/lib/namespace.js delete mode 100644 node_modules/jake/lib/package_task.js delete mode 100644 node_modules/jake/lib/parseargs.js delete mode 100644 node_modules/jake/lib/program.js delete mode 100644 node_modules/jake/lib/publish_task.js delete mode 100644 node_modules/jake/lib/rule.js delete mode 100644 node_modules/jake/lib/task/directory_task.js delete mode 100644 node_modules/jake/lib/task/file_task.js delete mode 100644 node_modules/jake/lib/task/index.js delete mode 100644 node_modules/jake/lib/task/task.js delete mode 100644 node_modules/jake/lib/test_task.js delete mode 100644 node_modules/jake/lib/utils/file.js delete mode 100644 node_modules/jake/lib/utils/index.js delete mode 100644 node_modules/jake/lib/utils/logger.js delete mode 100644 node_modules/jake/package.json delete mode 100644 node_modules/jake/test/integration/concurrent.js delete mode 100644 node_modules/jake/test/integration/file.js delete mode 100644 node_modules/jake/test/integration/file_task.js delete mode 100644 node_modules/jake/test/integration/helpers.js delete mode 100644 node_modules/jake/test/integration/jakefile.js delete mode 100644 node_modules/jake/test/integration/jakelib/concurrent.jake.js delete mode 100644 node_modules/jake/test/integration/jakelib/publish.jake.js delete mode 100644 node_modules/jake/test/integration/jakelib/required_module.jake.js delete mode 100644 node_modules/jake/test/integration/jakelib/rule.jake.js delete mode 100644 node_modules/jake/test/integration/list_tasks.js delete mode 100644 node_modules/jake/test/integration/publish_task.js delete mode 100644 node_modules/jake/test/integration/rule.js delete mode 100644 node_modules/jake/test/integration/selfdep.js delete mode 100644 node_modules/jake/test/integration/task_base.js delete mode 100644 node_modules/jake/test/unit/jakefile.js delete mode 100644 node_modules/jake/test/unit/namespace.js delete mode 100644 node_modules/jake/test/unit/parseargs.js delete mode 100644 node_modules/jake/usage.txt delete mode 100644 node_modules/lru-cache/LICENSE delete mode 100644 node_modules/lru-cache/README.md delete mode 100644 node_modules/lru-cache/index.js delete mode 100644 node_modules/lru-cache/package.json delete mode 100644 node_modules/media-typer/HISTORY.md delete mode 100644 node_modules/media-typer/LICENSE delete mode 100644 node_modules/media-typer/README.md delete mode 100644 node_modules/media-typer/index.js delete mode 100644 node_modules/media-typer/package.json delete mode 100644 node_modules/memorystore/.travis.yml delete mode 100644 node_modules/memorystore/LICENSE delete mode 100644 node_modules/memorystore/README.md delete mode 100644 node_modules/memorystore/index.d.ts delete mode 100644 node_modules/memorystore/index.js delete mode 100644 node_modules/memorystore/lib/memorystore.js delete mode 100644 node_modules/memorystore/node_modules/debug/LICENSE delete mode 100644 node_modules/memorystore/node_modules/debug/README.md delete mode 100644 node_modules/memorystore/node_modules/debug/package.json delete mode 100644 node_modules/memorystore/node_modules/debug/src/browser.js delete mode 100644 node_modules/memorystore/node_modules/debug/src/common.js delete mode 100644 node_modules/memorystore/node_modules/debug/src/index.js delete mode 100644 node_modules/memorystore/node_modules/debug/src/node.js delete mode 100644 node_modules/memorystore/node_modules/ms/index.js delete mode 100644 node_modules/memorystore/node_modules/ms/license.md delete mode 100644 node_modules/memorystore/node_modules/ms/package.json delete mode 100644 node_modules/memorystore/node_modules/ms/readme.md delete mode 100644 node_modules/memorystore/package.json delete mode 100644 node_modules/memorystore/test/store.js delete mode 100644 node_modules/merge-descriptors/HISTORY.md delete mode 100644 node_modules/merge-descriptors/LICENSE delete mode 100644 node_modules/merge-descriptors/README.md delete mode 100644 node_modules/merge-descriptors/index.js delete mode 100644 node_modules/merge-descriptors/package.json delete mode 100644 node_modules/methods/HISTORY.md delete mode 100644 node_modules/methods/LICENSE delete mode 100644 node_modules/methods/README.md delete mode 100644 node_modules/methods/index.js delete mode 100644 node_modules/methods/package.json delete mode 100644 node_modules/mime-db/HISTORY.md delete mode 100644 node_modules/mime-db/LICENSE delete mode 100644 node_modules/mime-db/README.md delete mode 100644 node_modules/mime-db/db.json delete mode 100644 node_modules/mime-db/index.js delete mode 100644 node_modules/mime-db/package.json delete mode 100644 node_modules/mime-types/HISTORY.md delete mode 100644 node_modules/mime-types/LICENSE delete mode 100644 node_modules/mime-types/README.md delete mode 100644 node_modules/mime-types/index.js delete mode 100644 node_modules/mime-types/package.json delete mode 100644 node_modules/mime/.npmignore delete mode 100644 node_modules/mime/CHANGELOG.md delete mode 100644 node_modules/mime/LICENSE delete mode 100644 node_modules/mime/README.md delete mode 100755 node_modules/mime/cli.js delete mode 100644 node_modules/mime/mime.js delete mode 100644 node_modules/mime/package.json delete mode 100755 node_modules/mime/src/build.js delete mode 100644 node_modules/mime/src/test.js delete mode 100644 node_modules/mime/types.json delete mode 100644 node_modules/minimatch/LICENSE delete mode 100644 node_modules/minimatch/README.md delete mode 100644 node_modules/minimatch/minimatch.js delete mode 100644 node_modules/minimatch/package.json delete mode 100644 node_modules/ms/index.js delete mode 100644 node_modules/ms/license.md delete mode 100644 node_modules/ms/package.json delete mode 100644 node_modules/ms/readme.md delete mode 100644 node_modules/negotiator/HISTORY.md delete mode 100644 node_modules/negotiator/LICENSE delete mode 100644 node_modules/negotiator/README.md delete mode 100644 node_modules/negotiator/index.js delete mode 100644 node_modules/negotiator/lib/charset.js delete mode 100644 node_modules/negotiator/lib/encoding.js delete mode 100644 node_modules/negotiator/lib/language.js delete mode 100644 node_modules/negotiator/lib/mediaType.js delete mode 100644 node_modules/negotiator/package.json delete mode 100644 node_modules/object-inspect/.eslintrc delete mode 100644 node_modules/object-inspect/.github/FUNDING.yml delete mode 100644 node_modules/object-inspect/.nycrc delete mode 100644 node_modules/object-inspect/CHANGELOG.md delete mode 100644 node_modules/object-inspect/LICENSE delete mode 100644 node_modules/object-inspect/example/all.js delete mode 100644 node_modules/object-inspect/example/circular.js delete mode 100644 node_modules/object-inspect/example/fn.js delete mode 100644 node_modules/object-inspect/example/inspect.js delete mode 100644 node_modules/object-inspect/index.js delete mode 100644 node_modules/object-inspect/package-support.json delete mode 100644 node_modules/object-inspect/package.json delete mode 100644 node_modules/object-inspect/readme.markdown delete mode 100644 node_modules/object-inspect/test-core-js.js delete mode 100644 node_modules/object-inspect/test/bigint.js delete mode 100644 node_modules/object-inspect/test/browser/dom.js delete mode 100644 node_modules/object-inspect/test/circular.js delete mode 100644 node_modules/object-inspect/test/deep.js delete mode 100644 node_modules/object-inspect/test/element.js delete mode 100644 node_modules/object-inspect/test/err.js delete mode 100644 node_modules/object-inspect/test/fakes.js delete mode 100644 node_modules/object-inspect/test/fn.js delete mode 100644 node_modules/object-inspect/test/global.js delete mode 100644 node_modules/object-inspect/test/has.js delete mode 100644 node_modules/object-inspect/test/holes.js delete mode 100644 node_modules/object-inspect/test/indent-option.js delete mode 100644 node_modules/object-inspect/test/inspect.js delete mode 100644 node_modules/object-inspect/test/lowbyte.js delete mode 100644 node_modules/object-inspect/test/number.js delete mode 100644 node_modules/object-inspect/test/quoteStyle.js delete mode 100644 node_modules/object-inspect/test/toStringTag.js delete mode 100644 node_modules/object-inspect/test/undef.js delete mode 100644 node_modules/object-inspect/test/values.js delete mode 100644 node_modules/object-inspect/util.inspect.js delete mode 100644 node_modules/on-finished/HISTORY.md delete mode 100644 node_modules/on-finished/LICENSE delete mode 100644 node_modules/on-finished/README.md delete mode 100644 node_modules/on-finished/index.js delete mode 100644 node_modules/on-finished/package.json delete mode 100644 node_modules/on-headers/HISTORY.md delete mode 100644 node_modules/on-headers/LICENSE delete mode 100644 node_modules/on-headers/README.md delete mode 100644 node_modules/on-headers/index.js delete mode 100644 node_modules/on-headers/package.json delete mode 100644 node_modules/packet-reader/.travis.yml delete mode 100644 node_modules/packet-reader/README.md delete mode 100644 node_modules/packet-reader/index.js delete mode 100644 node_modules/packet-reader/package.json delete mode 100644 node_modules/packet-reader/test/index.js delete mode 100644 node_modules/parseurl/HISTORY.md delete mode 100644 node_modules/parseurl/LICENSE delete mode 100644 node_modules/parseurl/README.md delete mode 100644 node_modules/parseurl/index.js delete mode 100644 node_modules/parseurl/package.json delete mode 100644 node_modules/path-to-regexp/History.md delete mode 100644 node_modules/path-to-regexp/LICENSE delete mode 100644 node_modules/path-to-regexp/Readme.md delete mode 100644 node_modules/path-to-regexp/index.js delete mode 100644 node_modules/path-to-regexp/package.json delete mode 100644 node_modules/pg-cloudflare/LICENSE delete mode 100644 node_modules/pg-cloudflare/README.md delete mode 100644 node_modules/pg-cloudflare/dist/empty.d.ts delete mode 100644 node_modules/pg-cloudflare/dist/empty.js delete mode 100644 node_modules/pg-cloudflare/dist/empty.js.map delete mode 100644 node_modules/pg-cloudflare/dist/index.d.ts delete mode 100644 node_modules/pg-cloudflare/dist/index.js delete mode 100644 node_modules/pg-cloudflare/dist/index.js.map delete mode 100644 node_modules/pg-cloudflare/package.json delete mode 100644 node_modules/pg-cloudflare/src/empty.ts delete mode 100644 node_modules/pg-cloudflare/src/index.ts delete mode 100644 node_modules/pg-cloudflare/src/types.d.ts delete mode 100644 node_modules/pg-connection-string/LICENSE delete mode 100644 node_modules/pg-connection-string/README.md delete mode 100644 node_modules/pg-connection-string/index.d.ts delete mode 100644 node_modules/pg-connection-string/index.js delete mode 100644 node_modules/pg-connection-string/package.json delete mode 100644 node_modules/pg-int8/LICENSE delete mode 100644 node_modules/pg-int8/README.md delete mode 100644 node_modules/pg-int8/index.js delete mode 100644 node_modules/pg-int8/package.json delete mode 100644 node_modules/pg-pool/LICENSE delete mode 100644 node_modules/pg-pool/README.md delete mode 100644 node_modules/pg-pool/index.js delete mode 100644 node_modules/pg-pool/package.json delete mode 100644 node_modules/pg-pool/test/bring-your-own-promise.js delete mode 100644 node_modules/pg-pool/test/connection-strings.js delete mode 100644 node_modules/pg-pool/test/connection-timeout.js delete mode 100644 node_modules/pg-pool/test/ending.js delete mode 100644 node_modules/pg-pool/test/error-handling.js delete mode 100644 node_modules/pg-pool/test/events.js delete mode 100644 node_modules/pg-pool/test/idle-timeout-exit.js delete mode 100644 node_modules/pg-pool/test/idle-timeout.js delete mode 100644 node_modules/pg-pool/test/index.js delete mode 100644 node_modules/pg-pool/test/lifetime-timeout.js delete mode 100644 node_modules/pg-pool/test/logging.js delete mode 100644 node_modules/pg-pool/test/max-uses.js delete mode 100644 node_modules/pg-pool/test/releasing-clients.js delete mode 100644 node_modules/pg-pool/test/setup.js delete mode 100644 node_modules/pg-pool/test/sizing.js delete mode 100644 node_modules/pg-pool/test/submittable.js delete mode 100644 node_modules/pg-pool/test/timeout.js delete mode 100644 node_modules/pg-pool/test/verify.js delete mode 100644 node_modules/pg-protocol/LICENSE delete mode 100644 node_modules/pg-protocol/README.md delete mode 100644 node_modules/pg-protocol/dist/b.d.ts delete mode 100644 node_modules/pg-protocol/dist/b.js delete mode 100644 node_modules/pg-protocol/dist/b.js.map delete mode 100644 node_modules/pg-protocol/dist/buffer-reader.d.ts delete mode 100644 node_modules/pg-protocol/dist/buffer-reader.js delete mode 100644 node_modules/pg-protocol/dist/buffer-reader.js.map delete mode 100644 node_modules/pg-protocol/dist/buffer-writer.d.ts delete mode 100644 node_modules/pg-protocol/dist/buffer-writer.js delete mode 100644 node_modules/pg-protocol/dist/buffer-writer.js.map delete mode 100644 node_modules/pg-protocol/dist/inbound-parser.test.d.ts delete mode 100644 node_modules/pg-protocol/dist/inbound-parser.test.js delete mode 100644 node_modules/pg-protocol/dist/inbound-parser.test.js.map delete mode 100644 node_modules/pg-protocol/dist/index.d.ts delete mode 100644 node_modules/pg-protocol/dist/index.js delete mode 100644 node_modules/pg-protocol/dist/index.js.map delete mode 100644 node_modules/pg-protocol/dist/messages.d.ts delete mode 100644 node_modules/pg-protocol/dist/messages.js delete mode 100644 node_modules/pg-protocol/dist/messages.js.map delete mode 100644 node_modules/pg-protocol/dist/outbound-serializer.test.d.ts delete mode 100644 node_modules/pg-protocol/dist/outbound-serializer.test.js delete mode 100644 node_modules/pg-protocol/dist/outbound-serializer.test.js.map delete mode 100644 node_modules/pg-protocol/dist/parser.d.ts delete mode 100644 node_modules/pg-protocol/dist/parser.js delete mode 100644 node_modules/pg-protocol/dist/parser.js.map delete mode 100644 node_modules/pg-protocol/dist/serializer.d.ts delete mode 100644 node_modules/pg-protocol/dist/serializer.js delete mode 100644 node_modules/pg-protocol/dist/serializer.js.map delete mode 100644 node_modules/pg-protocol/package.json delete mode 100644 node_modules/pg-protocol/src/b.ts delete mode 100644 node_modules/pg-protocol/src/buffer-reader.ts delete mode 100644 node_modules/pg-protocol/src/buffer-writer.ts delete mode 100644 node_modules/pg-protocol/src/inbound-parser.test.ts delete mode 100644 node_modules/pg-protocol/src/index.ts delete mode 100644 node_modules/pg-protocol/src/messages.ts delete mode 100644 node_modules/pg-protocol/src/outbound-serializer.test.ts delete mode 100644 node_modules/pg-protocol/src/parser.ts delete mode 100644 node_modules/pg-protocol/src/serializer.ts delete mode 100644 node_modules/pg-protocol/src/testing/buffer-list.ts delete mode 100644 node_modules/pg-protocol/src/testing/test-buffers.ts delete mode 100644 node_modules/pg-protocol/src/types/chunky.d.ts delete mode 100644 node_modules/pg-types/.travis.yml delete mode 100644 node_modules/pg-types/Makefile delete mode 100644 node_modules/pg-types/README.md delete mode 100644 node_modules/pg-types/index.d.ts delete mode 100644 node_modules/pg-types/index.js delete mode 100644 node_modules/pg-types/index.test-d.ts delete mode 100644 node_modules/pg-types/lib/arrayParser.js delete mode 100644 node_modules/pg-types/lib/binaryParsers.js delete mode 100644 node_modules/pg-types/lib/builtins.js delete mode 100644 node_modules/pg-types/lib/textParsers.js delete mode 100644 node_modules/pg-types/package.json delete mode 100644 node_modules/pg-types/test/index.js delete mode 100644 node_modules/pg-types/test/types.js delete mode 100644 node_modules/pg/LICENSE delete mode 100644 node_modules/pg/README.md delete mode 100644 node_modules/pg/lib/client.js delete mode 100644 node_modules/pg/lib/connection-parameters.js delete mode 100644 node_modules/pg/lib/connection.js delete mode 100644 node_modules/pg/lib/crypto/sasl.js delete mode 100644 node_modules/pg/lib/crypto/utils-legacy.js delete mode 100644 node_modules/pg/lib/crypto/utils-webcrypto.js delete mode 100644 node_modules/pg/lib/crypto/utils.js delete mode 100644 node_modules/pg/lib/defaults.js delete mode 100644 node_modules/pg/lib/index.js delete mode 100644 node_modules/pg/lib/native/client.js delete mode 100644 node_modules/pg/lib/native/index.js delete mode 100644 node_modules/pg/lib/native/query.js delete mode 100644 node_modules/pg/lib/query.js delete mode 100644 node_modules/pg/lib/result.js delete mode 100644 node_modules/pg/lib/stream.js delete mode 100644 node_modules/pg/lib/type-overrides.js delete mode 100644 node_modules/pg/lib/utils.js delete mode 100644 node_modules/pg/package.json delete mode 100644 node_modules/pgpass/README.md delete mode 100644 node_modules/pgpass/lib/helper.js delete mode 100644 node_modules/pgpass/lib/index.js delete mode 100644 node_modules/pgpass/package.json delete mode 100644 node_modules/postgres-array/index.d.ts delete mode 100644 node_modules/postgres-array/index.js delete mode 100644 node_modules/postgres-array/license delete mode 100644 node_modules/postgres-array/package.json delete mode 100644 node_modules/postgres-array/readme.md delete mode 100644 node_modules/postgres-bytea/index.js delete mode 100644 node_modules/postgres-bytea/license delete mode 100644 node_modules/postgres-bytea/package.json delete mode 100644 node_modules/postgres-bytea/readme.md delete mode 100644 node_modules/postgres-date/index.js delete mode 100644 node_modules/postgres-date/license delete mode 100644 node_modules/postgres-date/package.json delete mode 100644 node_modules/postgres-date/readme.md delete mode 100644 node_modules/postgres-interval/index.d.ts delete mode 100644 node_modules/postgres-interval/index.js delete mode 100644 node_modules/postgres-interval/license delete mode 100644 node_modules/postgres-interval/package.json delete mode 100644 node_modules/postgres-interval/readme.md delete mode 100644 node_modules/proxy-addr/HISTORY.md delete mode 100644 node_modules/proxy-addr/LICENSE delete mode 100644 node_modules/proxy-addr/README.md delete mode 100644 node_modules/proxy-addr/index.js delete mode 100644 node_modules/proxy-addr/package.json delete mode 100644 node_modules/pseudomap/LICENSE delete mode 100644 node_modules/pseudomap/README.md delete mode 100644 node_modules/pseudomap/map.js delete mode 100644 node_modules/pseudomap/package.json delete mode 100644 node_modules/pseudomap/pseudomap.js delete mode 100644 node_modules/pseudomap/test/basic.js delete mode 100644 node_modules/qs/.editorconfig delete mode 100644 node_modules/qs/.eslintrc delete mode 100644 node_modules/qs/.github/FUNDING.yml delete mode 100644 node_modules/qs/.nycrc delete mode 100644 node_modules/qs/CHANGELOG.md delete mode 100644 node_modules/qs/LICENSE.md delete mode 100644 node_modules/qs/README.md delete mode 100644 node_modules/qs/dist/qs.js delete mode 100644 node_modules/qs/lib/formats.js delete mode 100644 node_modules/qs/lib/index.js delete mode 100644 node_modules/qs/lib/parse.js delete mode 100644 node_modules/qs/lib/stringify.js delete mode 100644 node_modules/qs/lib/utils.js delete mode 100644 node_modules/qs/package.json delete mode 100644 node_modules/qs/test/parse.js delete mode 100644 node_modules/qs/test/stringify.js delete mode 100644 node_modules/qs/test/utils.js delete mode 100644 node_modules/random-bytes/HISTORY.md delete mode 100644 node_modules/random-bytes/LICENSE delete mode 100644 node_modules/random-bytes/README.md delete mode 100644 node_modules/random-bytes/index.js delete mode 100644 node_modules/random-bytes/package.json delete mode 100644 node_modules/range-parser/HISTORY.md delete mode 100644 node_modules/range-parser/LICENSE delete mode 100644 node_modules/range-parser/README.md delete mode 100644 node_modules/range-parser/index.js delete mode 100644 node_modules/range-parser/package.json delete mode 100644 node_modules/raw-body/HISTORY.md delete mode 100644 node_modules/raw-body/LICENSE delete mode 100644 node_modules/raw-body/README.md delete mode 100644 node_modules/raw-body/SECURITY.md delete mode 100644 node_modules/raw-body/index.d.ts delete mode 100644 node_modules/raw-body/index.js delete mode 100644 node_modules/raw-body/package.json delete mode 100644 node_modules/safe-buffer/LICENSE delete mode 100644 node_modules/safe-buffer/README.md delete mode 100644 node_modules/safe-buffer/index.d.ts delete mode 100644 node_modules/safe-buffer/index.js delete mode 100644 node_modules/safe-buffer/package.json delete mode 100644 node_modules/safer-buffer/LICENSE delete mode 100644 node_modules/safer-buffer/Porting-Buffer.md delete mode 100644 node_modules/safer-buffer/Readme.md delete mode 100644 node_modules/safer-buffer/dangerous.js delete mode 100644 node_modules/safer-buffer/package.json delete mode 100644 node_modules/safer-buffer/safer.js delete mode 100644 node_modules/safer-buffer/tests.js delete mode 100644 node_modules/send/HISTORY.md delete mode 100644 node_modules/send/LICENSE delete mode 100644 node_modules/send/README.md delete mode 100644 node_modules/send/SECURITY.md delete mode 100644 node_modules/send/index.js delete mode 100644 node_modules/send/node_modules/ms/index.js delete mode 100644 node_modules/send/node_modules/ms/license.md delete mode 100644 node_modules/send/node_modules/ms/package.json delete mode 100644 node_modules/send/node_modules/ms/readme.md delete mode 100644 node_modules/send/package.json delete mode 100644 node_modules/serve-static/HISTORY.md delete mode 100644 node_modules/serve-static/LICENSE delete mode 100644 node_modules/serve-static/README.md delete mode 100644 node_modules/serve-static/index.js delete mode 100644 node_modules/serve-static/package.json delete mode 100644 node_modules/set-function-length/.eslintrc delete mode 100644 node_modules/set-function-length/.github/FUNDING.yml delete mode 100644 node_modules/set-function-length/.nycrc delete mode 100644 node_modules/set-function-length/CHANGELOG.md delete mode 100644 node_modules/set-function-length/LICENSE delete mode 100644 node_modules/set-function-length/README.md delete mode 100644 node_modules/set-function-length/env.js delete mode 100644 node_modules/set-function-length/index.js delete mode 100644 node_modules/set-function-length/package.json delete mode 100644 node_modules/setprototypeof/LICENSE delete mode 100644 node_modules/setprototypeof/README.md delete mode 100644 node_modules/setprototypeof/index.d.ts delete mode 100644 node_modules/setprototypeof/index.js delete mode 100644 node_modules/setprototypeof/package.json delete mode 100644 node_modules/setprototypeof/test/index.js delete mode 100644 node_modules/side-channel/.eslintignore delete mode 100644 node_modules/side-channel/.eslintrc delete mode 100644 node_modules/side-channel/.github/FUNDING.yml delete mode 100644 node_modules/side-channel/.nycrc delete mode 100644 node_modules/side-channel/CHANGELOG.md delete mode 100644 node_modules/side-channel/LICENSE delete mode 100644 node_modules/side-channel/README.md delete mode 100644 node_modules/side-channel/index.js delete mode 100644 node_modules/side-channel/package.json delete mode 100644 node_modules/side-channel/test/index.js delete mode 100644 node_modules/split2/LICENSE delete mode 100644 node_modules/split2/README.md delete mode 100644 node_modules/split2/bench.js delete mode 100644 node_modules/split2/index.js delete mode 100644 node_modules/split2/package.json delete mode 100644 node_modules/split2/test.js delete mode 100644 node_modules/statuses/HISTORY.md delete mode 100644 node_modules/statuses/LICENSE delete mode 100644 node_modules/statuses/README.md delete mode 100644 node_modules/statuses/codes.json delete mode 100644 node_modules/statuses/index.js delete mode 100644 node_modules/statuses/package.json delete mode 100644 node_modules/supports-color/browser.js delete mode 100644 node_modules/supports-color/index.js delete mode 100644 node_modules/supports-color/license delete mode 100644 node_modules/supports-color/package.json delete mode 100644 node_modules/supports-color/readme.md delete mode 100644 node_modules/toidentifier/HISTORY.md delete mode 100644 node_modules/toidentifier/LICENSE delete mode 100644 node_modules/toidentifier/README.md delete mode 100644 node_modules/toidentifier/index.js delete mode 100644 node_modules/toidentifier/package.json delete mode 100644 node_modules/type-is/HISTORY.md delete mode 100644 node_modules/type-is/LICENSE delete mode 100644 node_modules/type-is/README.md delete mode 100644 node_modules/type-is/index.js delete mode 100644 node_modules/type-is/package.json delete mode 100644 node_modules/uid-safe/HISTORY.md delete mode 100644 node_modules/uid-safe/LICENSE delete mode 100644 node_modules/uid-safe/README.md delete mode 100644 node_modules/uid-safe/index.js delete mode 100644 node_modules/uid-safe/package.json delete mode 100644 node_modules/unpipe/HISTORY.md delete mode 100644 node_modules/unpipe/LICENSE delete mode 100644 node_modules/unpipe/README.md delete mode 100644 node_modules/unpipe/index.js delete mode 100644 node_modules/unpipe/package.json delete mode 100644 node_modules/utils-merge/.npmignore delete mode 100644 node_modules/utils-merge/LICENSE delete mode 100644 node_modules/utils-merge/README.md delete mode 100644 node_modules/utils-merge/index.js delete mode 100644 node_modules/utils-merge/package.json delete mode 100644 node_modules/vary/HISTORY.md delete mode 100644 node_modules/vary/LICENSE delete mode 100644 node_modules/vary/README.md delete mode 100644 node_modules/vary/index.js delete mode 100644 node_modules/vary/package.json delete mode 100644 node_modules/xtend/.jshintrc delete mode 100644 node_modules/xtend/LICENSE delete mode 100644 node_modules/xtend/README.md delete mode 100644 node_modules/xtend/immutable.js delete mode 100644 node_modules/xtend/mutable.js delete mode 100644 node_modules/xtend/package.json delete mode 100644 node_modules/xtend/test.js delete mode 100644 node_modules/yallist/LICENSE delete mode 100644 node_modules/yallist/README.md delete mode 100644 node_modules/yallist/iterator.js delete mode 100644 node_modules/yallist/package.json delete mode 100644 node_modules/yallist/yallist.js diff --git a/.gitginore b/.gitignore similarity index 100% rename from .gitginore rename to .gitignore diff --git a/node_modules/.bin/ejs b/node_modules/.bin/ejs deleted file mode 120000 index 88e80d0..0000000 --- a/node_modules/.bin/ejs +++ /dev/null @@ -1 +0,0 @@ -../ejs/bin/cli.js \ No newline at end of file diff --git a/node_modules/.bin/jake b/node_modules/.bin/jake deleted file mode 120000 index 3626745..0000000 --- a/node_modules/.bin/jake +++ /dev/null @@ -1 +0,0 @@ -../jake/bin/cli.js \ No newline at end of file diff --git a/node_modules/.bin/mime b/node_modules/.bin/mime deleted file mode 120000 index fbb7ee0..0000000 --- a/node_modules/.bin/mime +++ /dev/null @@ -1 +0,0 @@ -../mime/cli.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 0714e7e..0000000 --- a/node_modules/.package-lock.json +++ /dev/null @@ -1,1074 +0,0 @@ -{ - "name": "dach", - "version": "1.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "node_modules/accepts": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", - "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", - "dependencies": { - "mime-types": "~2.1.34", - "negotiator": "0.6.3" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" - }, - "node_modules/async": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", - "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==" - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" - }, - "node_modules/bcryptjs": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-2.4.3.tgz", - "integrity": "sha512-V/Hy/X9Vt7f3BbPJEi8BdVFMByHi+jNXrYkW3huaybV/kQ0KJg0Y6PkEMbn+zeT+i+SiKZ/HMqJGIIt4LZDqNQ==" - }, - "node_modules/body-parser": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", - "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", - "dependencies": { - "bytes": "3.1.2", - "content-type": "~1.0.4", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.11.0", - "raw-body": "2.5.1", - "type-is": "~1.6.18", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/buffer-writer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/buffer-writer/-/buffer-writer-2.0.0.tgz", - "integrity": "sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw==", - "engines": { - "node": ">=4" - } - }, - "node_modules/bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/call-bind": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.5.tgz", - "integrity": "sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==", - "dependencies": { - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.1", - "set-function-length": "^1.1.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" - }, - "node_modules/content-disposition": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", - "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", - "dependencies": { - "safe-buffer": "5.2.1" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/content-type": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", - "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", - "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie-signature": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" - }, - "node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/define-data-property": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.1.tgz", - "integrity": "sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==", - "dependencies": { - "get-intrinsic": "^1.2.1", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/destroy": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", - "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/dotenv": { - "version": "16.3.1", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", - "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/motdotla/dotenv?sponsor=1" - } - }, - "node_modules/ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" - }, - "node_modules/ejs": { - "version": "3.1.9", - "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.9.tgz", - "integrity": "sha512-rC+QVNMJWv+MtPgkt0y+0rVEIdbtxVADApW9JXrUVlzHetgcyczP/E7DJmWJ4fJCZF2cPcBk0laWO9ZHMG3DmQ==", - "dependencies": { - "jake": "^10.8.5" - }, - "bin": { - "ejs": "bin/cli.js" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" - }, - "node_modules/etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/express": { - "version": "4.18.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", - "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", - "dependencies": { - "accepts": "~1.3.8", - "array-flatten": "1.1.1", - "body-parser": "1.20.1", - "content-disposition": "0.5.4", - "content-type": "~1.0.4", - "cookie": "0.5.0", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "2.0.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "1.2.0", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", - "methods": "~1.1.2", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.7", - "qs": "6.11.0", - "range-parser": "~1.2.1", - "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "type-is": "~1.6.18", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - }, - "engines": { - "node": ">= 0.10.0" - } - }, - "node_modules/express-session": { - "version": "1.17.3", - "resolved": "https://registry.npmjs.org/express-session/-/express-session-1.17.3.tgz", - "integrity": "sha512-4+otWXlShYlG1Ma+2Jnn+xgKUZTMJ5QD3YvfilX3AcocOAbIkVylSWEklzALe/+Pu4qV6TYBj5GwOBFfdKqLBw==", - "dependencies": { - "cookie": "0.4.2", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "~2.0.0", - "on-headers": "~1.0.2", - "parseurl": "~1.3.3", - "safe-buffer": "5.2.1", - "uid-safe": "~2.1.5" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/express-session/node_modules/cookie": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", - "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/filelist": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", - "integrity": "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==", - "dependencies": { - "minimatch": "^5.0.1" - } - }, - "node_modules/filelist/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/filelist/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/finalhandler": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", - "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", - "dependencies": { - "debug": "2.6.9", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "statuses": "2.0.1", - "unpipe": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/forwarded": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-intrinsic": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.2.tgz", - "integrity": "sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA==", - "dependencies": { - "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dependencies": { - "get-intrinsic": "^1.1.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/has-property-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.1.tgz", - "integrity": "sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg==", - "dependencies": { - "get-intrinsic": "^1.2.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", - "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/hasown": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", - "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/http-errors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", - "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", - "dependencies": { - "depd": "2.0.0", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "toidentifier": "1.0.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "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/ipaddr.js": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/jake": { - "version": "10.8.7", - "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.7.tgz", - "integrity": "sha512-ZDi3aP+fG/LchyBzUM804VjddnwfSfsdeYkwt8NcbKRvo4rFkjhs456iLFn3k2ZUWvNe4i48WACDbza8fhq2+w==", - "dependencies": { - "async": "^3.2.3", - "chalk": "^4.0.2", - "filelist": "^1.0.4", - "minimatch": "^3.1.2" - }, - "bin": { - "jake": "bin/cli.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", - "dependencies": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, - "node_modules/media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/memorystore": { - "version": "1.6.7", - "resolved": "https://registry.npmjs.org/memorystore/-/memorystore-1.6.7.tgz", - "integrity": "sha512-OZnmNY/NDrKohPQ+hxp0muBcBKrzKNtHr55DbqSx9hLsYVNnomSAMRAtI7R64t3gf3ID7tHQA7mG4oL3Hu9hdw==", - "dependencies": { - "debug": "^4.3.0", - "lru-cache": "^4.0.3" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/memorystore/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/memorystore/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/merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" - }, - "node_modules/methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" - }, - "node_modules/negotiator": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/object-inspect": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", - "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/on-headers": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", - "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/packet-reader": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/packet-reader/-/packet-reader-1.0.0.tgz", - "integrity": "sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ==" - }, - "node_modules/parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" - }, - "node_modules/pg": { - "version": "8.11.3", - "resolved": "https://registry.npmjs.org/pg/-/pg-8.11.3.tgz", - "integrity": "sha512-+9iuvG8QfaaUrrph+kpF24cXkH1YOOUeArRNYIxq1viYHZagBxrTno7cecY1Fa44tJeZvaoG+Djpkc3JwehN5g==", - "dependencies": { - "buffer-writer": "2.0.0", - "packet-reader": "1.0.0", - "pg-connection-string": "^2.6.2", - "pg-pool": "^3.6.1", - "pg-protocol": "^1.6.0", - "pg-types": "^2.1.0", - "pgpass": "1.x" - }, - "engines": { - "node": ">= 8.0.0" - }, - "optionalDependencies": { - "pg-cloudflare": "^1.1.1" - }, - "peerDependencies": { - "pg-native": ">=3.0.1" - }, - "peerDependenciesMeta": { - "pg-native": { - "optional": true - } - } - }, - "node_modules/pg-cloudflare": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pg-cloudflare/-/pg-cloudflare-1.1.1.tgz", - "integrity": "sha512-xWPagP/4B6BgFO+EKz3JONXv3YDgvkbVrGw2mTo3D6tVDQRh1e7cqVGvyR3BE+eQgAvx1XhW/iEASj4/jCWl3Q==", - "optional": true - }, - "node_modules/pg-connection-string": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.6.2.tgz", - "integrity": "sha512-ch6OwaeaPYcova4kKZ15sbJ2hKb/VP48ZD2gE7i1J+L4MspCtBMAx8nMgz7bksc7IojCIIWuEhHibSMFH8m8oA==" - }, - "node_modules/pg-int8": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz", - "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==", - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/pg-pool": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.6.1.tgz", - "integrity": "sha512-jizsIzhkIitxCGfPRzJn1ZdcosIt3pz9Sh3V01fm1vZnbnCMgmGl5wvGGdNN2EL9Rmb0EcFoCkixH4Pu+sP9Og==", - "peerDependencies": { - "pg": ">=8.0" - } - }, - "node_modules/pg-protocol": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.6.0.tgz", - "integrity": "sha512-M+PDm637OY5WM307051+bsDia5Xej6d9IR4GwJse1qA1DIhiKlksvrneZOYQq42OM+spubpcNYEo2FcKQrDk+Q==" - }, - "node_modules/pg-types": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz", - "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==", - "dependencies": { - "pg-int8": "1.0.1", - "postgres-array": "~2.0.0", - "postgres-bytea": "~1.0.0", - "postgres-date": "~1.0.4", - "postgres-interval": "^1.1.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/pgpass": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz", - "integrity": "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==", - "dependencies": { - "split2": "^4.1.0" - } - }, - "node_modules/postgres-array": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz", - "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==", - "engines": { - "node": ">=4" - } - }, - "node_modules/postgres-bytea": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz", - "integrity": "sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/postgres-date": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz", - "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/postgres-interval": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz", - "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==", - "dependencies": { - "xtend": "^4.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/proxy-addr": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", - "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", - "dependencies": { - "forwarded": "0.2.0", - "ipaddr.js": "1.9.1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==" - }, - "node_modules/qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", - "dependencies": { - "side-channel": "^1.0.4" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/random-bytes": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/random-bytes/-/random-bytes-1.0.0.tgz", - "integrity": "sha512-iv7LhNVO047HzYR3InF6pUcUsPQiHTM1Qal51DcGSuZFBil1aBBWG5eHPNek7bvILMaYJ/8RU1e8w1AMdHmLQQ==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/raw-body": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", - "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", - "dependencies": { - "bytes": "3.1.2", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "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/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "node_modules/send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", - "dependencies": { - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "mime": "1.6.0", - "ms": "2.1.3", - "on-finished": "2.4.1", - "range-parser": "~1.2.1", - "statuses": "2.0.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/send/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" - }, - "node_modules/serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", - "dependencies": { - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.18.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/set-function-length": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.1.1.tgz", - "integrity": "sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ==", - "dependencies": { - "define-data-property": "^1.1.1", - "get-intrinsic": "^1.2.1", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/setprototypeof": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" - }, - "node_modules/side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", - "dependencies": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/split2": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", - "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", - "engines": { - "node": ">= 10.x" - } - }, - "node_modules/statuses": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", - "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/toidentifier": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", - "engines": { - "node": ">=0.6" - } - }, - "node_modules/type-is": { - "version": "1.6.18", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", - "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", - "dependencies": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/uid-safe": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-2.1.5.tgz", - "integrity": "sha512-KPHm4VL5dDXKz01UuEd88Df+KzynaohSL9fBh096KWAxSKZQDI2uBrVqtvRM4rwrIrRRKsdLNML/lnaaVSRioA==", - "dependencies": { - "random-bytes": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "engines": { - "node": ">=0.4" - } - }, - "node_modules/yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==" - } - } -} diff --git a/node_modules/accepts/HISTORY.md b/node_modules/accepts/HISTORY.md deleted file mode 100644 index cb5990c..0000000 --- a/node_modules/accepts/HISTORY.md +++ /dev/null @@ -1,243 +0,0 @@ -1.3.8 / 2022-02-02 -================== - - * deps: mime-types@~2.1.34 - - deps: mime-db@~1.51.0 - * deps: negotiator@0.6.3 - -1.3.7 / 2019-04-29 -================== - - * deps: negotiator@0.6.2 - - Fix sorting charset, encoding, and language with extra parameters - -1.3.6 / 2019-04-28 -================== - - * deps: mime-types@~2.1.24 - - deps: mime-db@~1.40.0 - -1.3.5 / 2018-02-28 -================== - - * deps: mime-types@~2.1.18 - - deps: mime-db@~1.33.0 - -1.3.4 / 2017-08-22 -================== - - * deps: mime-types@~2.1.16 - - deps: mime-db@~1.29.0 - -1.3.3 / 2016-05-02 -================== - - * deps: mime-types@~2.1.11 - - deps: mime-db@~1.23.0 - * deps: negotiator@0.6.1 - - perf: improve `Accept` parsing speed - - perf: improve `Accept-Charset` parsing speed - - perf: improve `Accept-Encoding` parsing speed - - perf: improve `Accept-Language` parsing speed - -1.3.2 / 2016-03-08 -================== - - * deps: mime-types@~2.1.10 - - Fix extension of `application/dash+xml` - - Update primary extension for `audio/mp4` - - deps: mime-db@~1.22.0 - -1.3.1 / 2016-01-19 -================== - - * deps: mime-types@~2.1.9 - - deps: mime-db@~1.21.0 - -1.3.0 / 2015-09-29 -================== - - * deps: mime-types@~2.1.7 - - deps: mime-db@~1.19.0 - * deps: negotiator@0.6.0 - - Fix including type extensions in parameters in `Accept` parsing - - Fix parsing `Accept` parameters with quoted equals - - Fix parsing `Accept` parameters with quoted semicolons - - Lazy-load modules from main entry point - - perf: delay type concatenation until needed - - perf: enable strict mode - - perf: hoist regular expressions - - perf: remove closures getting spec properties - - perf: remove a closure from media type parsing - - perf: remove property delete from media type parsing - -1.2.13 / 2015-09-06 -=================== - - * deps: mime-types@~2.1.6 - - deps: mime-db@~1.18.0 - -1.2.12 / 2015-07-30 -=================== - - * deps: mime-types@~2.1.4 - - deps: mime-db@~1.16.0 - -1.2.11 / 2015-07-16 -=================== - - * deps: mime-types@~2.1.3 - - deps: mime-db@~1.15.0 - -1.2.10 / 2015-07-01 -=================== - - * deps: mime-types@~2.1.2 - - deps: mime-db@~1.14.0 - -1.2.9 / 2015-06-08 -================== - - * deps: mime-types@~2.1.1 - - perf: fix deopt during mapping - -1.2.8 / 2015-06-07 -================== - - * deps: mime-types@~2.1.0 - - deps: mime-db@~1.13.0 - * perf: avoid argument reassignment & argument slice - * perf: avoid negotiator recursive construction - * perf: enable strict mode - * perf: remove unnecessary bitwise operator - -1.2.7 / 2015-05-10 -================== - - * deps: negotiator@0.5.3 - - Fix media type parameter matching to be case-insensitive - -1.2.6 / 2015-05-07 -================== - - * deps: mime-types@~2.0.11 - - deps: mime-db@~1.9.1 - * deps: negotiator@0.5.2 - - Fix comparing media types with quoted values - - Fix splitting media types with quoted commas - -1.2.5 / 2015-03-13 -================== - - * deps: mime-types@~2.0.10 - - deps: mime-db@~1.8.0 - -1.2.4 / 2015-02-14 -================== - - * Support Node.js 0.6 - * deps: mime-types@~2.0.9 - - deps: mime-db@~1.7.0 - * deps: negotiator@0.5.1 - - Fix preference sorting to be stable for long acceptable lists - -1.2.3 / 2015-01-31 -================== - - * deps: mime-types@~2.0.8 - - deps: mime-db@~1.6.0 - -1.2.2 / 2014-12-30 -================== - - * deps: mime-types@~2.0.7 - - deps: mime-db@~1.5.0 - -1.2.1 / 2014-12-30 -================== - - * deps: mime-types@~2.0.5 - - deps: mime-db@~1.3.1 - -1.2.0 / 2014-12-19 -================== - - * deps: negotiator@0.5.0 - - Fix list return order when large accepted list - - Fix missing identity encoding when q=0 exists - - Remove dynamic building of Negotiator class - -1.1.4 / 2014-12-10 -================== - - * deps: mime-types@~2.0.4 - - deps: mime-db@~1.3.0 - -1.1.3 / 2014-11-09 -================== - - * deps: mime-types@~2.0.3 - - deps: mime-db@~1.2.0 - -1.1.2 / 2014-10-14 -================== - - * deps: negotiator@0.4.9 - - Fix error when media type has invalid parameter - -1.1.1 / 2014-09-28 -================== - - * deps: mime-types@~2.0.2 - - deps: mime-db@~1.1.0 - * deps: negotiator@0.4.8 - - Fix all negotiations to be case-insensitive - - Stable sort preferences of same quality according to client order - -1.1.0 / 2014-09-02 -================== - - * update `mime-types` - -1.0.7 / 2014-07-04 -================== - - * Fix wrong type returned from `type` when match after unknown extension - -1.0.6 / 2014-06-24 -================== - - * deps: negotiator@0.4.7 - -1.0.5 / 2014-06-20 -================== - - * fix crash when unknown extension given - -1.0.4 / 2014-06-19 -================== - - * use `mime-types` - -1.0.3 / 2014-06-11 -================== - - * deps: negotiator@0.4.6 - - Order by specificity when quality is the same - -1.0.2 / 2014-05-29 -================== - - * Fix interpretation when header not in request - * deps: pin negotiator@0.4.5 - -1.0.1 / 2014-01-18 -================== - - * Identity encoding isn't always acceptable - * deps: negotiator@~0.4.0 - -1.0.0 / 2013-12-27 -================== - - * Genesis diff --git a/node_modules/accepts/LICENSE b/node_modules/accepts/LICENSE deleted file mode 100644 index 0616607..0000000 --- a/node_modules/accepts/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -(The MIT License) - -Copyright (c) 2014 Jonathan Ong -Copyright (c) 2015 Douglas Christopher Wilson - -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/accepts/README.md b/node_modules/accepts/README.md deleted file mode 100644 index 82680c5..0000000 --- a/node_modules/accepts/README.md +++ /dev/null @@ -1,140 +0,0 @@ -# accepts - -[![NPM Version][npm-version-image]][npm-url] -[![NPM Downloads][npm-downloads-image]][npm-url] -[![Node.js Version][node-version-image]][node-version-url] -[![Build Status][github-actions-ci-image]][github-actions-ci-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -Higher level content negotiation based on [negotiator](https://www.npmjs.com/package/negotiator). -Extracted from [koa](https://www.npmjs.com/package/koa) for general use. - -In addition to negotiator, it allows: - -- Allows types as an array or arguments list, ie `(['text/html', 'application/json'])` - as well as `('text/html', 'application/json')`. -- Allows type shorthands such as `json`. -- Returns `false` when no types match -- Treats non-existent headers as `*` - -## Installation - -This is a [Node.js](https://nodejs.org/en/) module available through the -[npm registry](https://www.npmjs.com/). Installation is done using the -[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): - -```sh -$ npm install accepts -``` - -## API - -```js -var accepts = require('accepts') -``` - -### accepts(req) - -Create a new `Accepts` object for the given `req`. - -#### .charset(charsets) - -Return the first accepted charset. If nothing in `charsets` is accepted, -then `false` is returned. - -#### .charsets() - -Return the charsets that the request accepts, in the order of the client's -preference (most preferred first). - -#### .encoding(encodings) - -Return the first accepted encoding. If nothing in `encodings` is accepted, -then `false` is returned. - -#### .encodings() - -Return the encodings that the request accepts, in the order of the client's -preference (most preferred first). - -#### .language(languages) - -Return the first accepted language. If nothing in `languages` is accepted, -then `false` is returned. - -#### .languages() - -Return the languages that the request accepts, in the order of the client's -preference (most preferred first). - -#### .type(types) - -Return the first accepted type (and it is returned as the same text as what -appears in the `types` array). If nothing in `types` is accepted, then `false` -is returned. - -The `types` array can contain full MIME types or file extensions. Any value -that is not a full MIME types is passed to `require('mime-types').lookup`. - -#### .types() - -Return the types that the request accepts, in the order of the client's -preference (most preferred first). - -## Examples - -### Simple type negotiation - -This simple example shows how to use `accepts` to return a different typed -respond body based on what the client wants to accept. The server lists it's -preferences in order and will get back the best match between the client and -server. - -```js -var accepts = require('accepts') -var http = require('http') - -function app (req, res) { - var accept = accepts(req) - - // the order of this list is significant; should be server preferred order - switch (accept.type(['json', 'html'])) { - case 'json': - res.setHeader('Content-Type', 'application/json') - res.write('{"hello":"world!"}') - break - case 'html': - res.setHeader('Content-Type', 'text/html') - res.write('hello, world!') - break - default: - // the fallback is text/plain, so no need to specify it above - res.setHeader('Content-Type', 'text/plain') - res.write('hello, world!') - break - } - - res.end() -} - -http.createServer(app).listen(3000) -``` - -You can test this out with the cURL program: -```sh -curl -I -H'Accept: text/html' http://localhost:3000/ -``` - -## License - -[MIT](LICENSE) - -[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/accepts/master -[coveralls-url]: https://coveralls.io/r/jshttp/accepts?branch=master -[github-actions-ci-image]: https://badgen.net/github/checks/jshttp/accepts/master?label=ci -[github-actions-ci-url]: https://github.com/jshttp/accepts/actions/workflows/ci.yml -[node-version-image]: https://badgen.net/npm/node/accepts -[node-version-url]: https://nodejs.org/en/download -[npm-downloads-image]: https://badgen.net/npm/dm/accepts -[npm-url]: https://npmjs.org/package/accepts -[npm-version-image]: https://badgen.net/npm/v/accepts diff --git a/node_modules/accepts/index.js b/node_modules/accepts/index.js deleted file mode 100644 index e9b2f63..0000000 --- a/node_modules/accepts/index.js +++ /dev/null @@ -1,238 +0,0 @@ -/*! - * accepts - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var Negotiator = require('negotiator') -var mime = require('mime-types') - -/** - * Module exports. - * @public - */ - -module.exports = Accepts - -/** - * Create a new Accepts object for the given req. - * - * @param {object} req - * @public - */ - -function Accepts (req) { - if (!(this instanceof Accepts)) { - return new Accepts(req) - } - - this.headers = req.headers - this.negotiator = new Negotiator(req) -} - -/** - * Check if the given `type(s)` is acceptable, returning - * the best match when true, otherwise `undefined`, in which - * case you should respond with 406 "Not Acceptable". - * - * The `type` value may be a single mime type string - * such as "application/json", the extension name - * such as "json" or an array `["json", "html", "text/plain"]`. When a list - * or array is given the _best_ match, if any is returned. - * - * Examples: - * - * // Accept: text/html - * this.types('html'); - * // => "html" - * - * // Accept: text/*, application/json - * this.types('html'); - * // => "html" - * this.types('text/html'); - * // => "text/html" - * this.types('json', 'text'); - * // => "json" - * this.types('application/json'); - * // => "application/json" - * - * // Accept: text/*, application/json - * this.types('image/png'); - * this.types('png'); - * // => undefined - * - * // Accept: text/*;q=.5, application/json - * this.types(['html', 'json']); - * this.types('html', 'json'); - * // => "json" - * - * @param {String|Array} types... - * @return {String|Array|Boolean} - * @public - */ - -Accepts.prototype.type = -Accepts.prototype.types = function (types_) { - var types = types_ - - // support flattened arguments - if (types && !Array.isArray(types)) { - types = new Array(arguments.length) - for (var i = 0; i < types.length; i++) { - types[i] = arguments[i] - } - } - - // no types, return all requested types - if (!types || types.length === 0) { - return this.negotiator.mediaTypes() - } - - // no accept header, return first given type - if (!this.headers.accept) { - return types[0] - } - - var mimes = types.map(extToMime) - var accepts = this.negotiator.mediaTypes(mimes.filter(validMime)) - var first = accepts[0] - - return first - ? types[mimes.indexOf(first)] - : false -} - -/** - * Return accepted encodings or best fit based on `encodings`. - * - * Given `Accept-Encoding: gzip, deflate` - * an array sorted by quality is returned: - * - * ['gzip', 'deflate'] - * - * @param {String|Array} encodings... - * @return {String|Array} - * @public - */ - -Accepts.prototype.encoding = -Accepts.prototype.encodings = function (encodings_) { - var encodings = encodings_ - - // support flattened arguments - if (encodings && !Array.isArray(encodings)) { - encodings = new Array(arguments.length) - for (var i = 0; i < encodings.length; i++) { - encodings[i] = arguments[i] - } - } - - // no encodings, return all requested encodings - if (!encodings || encodings.length === 0) { - return this.negotiator.encodings() - } - - return this.negotiator.encodings(encodings)[0] || false -} - -/** - * Return accepted charsets or best fit based on `charsets`. - * - * Given `Accept-Charset: utf-8, iso-8859-1;q=0.2, utf-7;q=0.5` - * an array sorted by quality is returned: - * - * ['utf-8', 'utf-7', 'iso-8859-1'] - * - * @param {String|Array} charsets... - * @return {String|Array} - * @public - */ - -Accepts.prototype.charset = -Accepts.prototype.charsets = function (charsets_) { - var charsets = charsets_ - - // support flattened arguments - if (charsets && !Array.isArray(charsets)) { - charsets = new Array(arguments.length) - for (var i = 0; i < charsets.length; i++) { - charsets[i] = arguments[i] - } - } - - // no charsets, return all requested charsets - if (!charsets || charsets.length === 0) { - return this.negotiator.charsets() - } - - return this.negotiator.charsets(charsets)[0] || false -} - -/** - * Return accepted languages or best fit based on `langs`. - * - * Given `Accept-Language: en;q=0.8, es, pt` - * an array sorted by quality is returned: - * - * ['es', 'pt', 'en'] - * - * @param {String|Array} langs... - * @return {Array|String} - * @public - */ - -Accepts.prototype.lang = -Accepts.prototype.langs = -Accepts.prototype.language = -Accepts.prototype.languages = function (languages_) { - var languages = languages_ - - // support flattened arguments - if (languages && !Array.isArray(languages)) { - languages = new Array(arguments.length) - for (var i = 0; i < languages.length; i++) { - languages[i] = arguments[i] - } - } - - // no languages, return all requested languages - if (!languages || languages.length === 0) { - return this.negotiator.languages() - } - - return this.negotiator.languages(languages)[0] || false -} - -/** - * Convert extnames to mime. - * - * @param {String} type - * @return {String} - * @private - */ - -function extToMime (type) { - return type.indexOf('/') === -1 - ? mime.lookup(type) - : type -} - -/** - * Check if mime is valid. - * - * @param {String} type - * @return {String} - * @private - */ - -function validMime (type) { - return typeof type === 'string' -} diff --git a/node_modules/accepts/package.json b/node_modules/accepts/package.json deleted file mode 100644 index 0f2d15d..0000000 --- a/node_modules/accepts/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "accepts", - "description": "Higher-level content negotiation", - "version": "1.3.8", - "contributors": [ - "Douglas Christopher Wilson ", - "Jonathan Ong (http://jongleberry.com)" - ], - "license": "MIT", - "repository": "jshttp/accepts", - "dependencies": { - "mime-types": "~2.1.34", - "negotiator": "0.6.3" - }, - "devDependencies": { - "deep-equal": "1.0.1", - "eslint": "7.32.0", - "eslint-config-standard": "14.1.1", - "eslint-plugin-import": "2.25.4", - "eslint-plugin-markdown": "2.2.1", - "eslint-plugin-node": "11.1.0", - "eslint-plugin-promise": "4.3.1", - "eslint-plugin-standard": "4.1.0", - "mocha": "9.2.0", - "nyc": "15.1.0" - }, - "files": [ - "LICENSE", - "HISTORY.md", - "index.js" - ], - "engines": { - "node": ">= 0.6" - }, - "scripts": { - "lint": "eslint .", - "test": "mocha --reporter spec --check-leaks --bail test/", - "test-ci": "nyc --reporter=lcov --reporter=text npm test", - "test-cov": "nyc --reporter=html --reporter=text npm test" - }, - "keywords": [ - "content", - "negotiation", - "accept", - "accepts" - ] -} diff --git a/node_modules/ansi-styles/index.d.ts b/node_modules/ansi-styles/index.d.ts deleted file mode 100644 index 44a907e..0000000 --- a/node_modules/ansi-styles/index.d.ts +++ /dev/null @@ -1,345 +0,0 @@ -declare type CSSColor = - | 'aliceblue' - | 'antiquewhite' - | 'aqua' - | 'aquamarine' - | 'azure' - | 'beige' - | 'bisque' - | 'black' - | 'blanchedalmond' - | 'blue' - | 'blueviolet' - | 'brown' - | 'burlywood' - | 'cadetblue' - | 'chartreuse' - | 'chocolate' - | 'coral' - | 'cornflowerblue' - | 'cornsilk' - | 'crimson' - | 'cyan' - | 'darkblue' - | 'darkcyan' - | 'darkgoldenrod' - | 'darkgray' - | 'darkgreen' - | 'darkgrey' - | 'darkkhaki' - | 'darkmagenta' - | 'darkolivegreen' - | 'darkorange' - | 'darkorchid' - | 'darkred' - | 'darksalmon' - | 'darkseagreen' - | 'darkslateblue' - | 'darkslategray' - | 'darkslategrey' - | 'darkturquoise' - | 'darkviolet' - | 'deeppink' - | 'deepskyblue' - | 'dimgray' - | 'dimgrey' - | 'dodgerblue' - | 'firebrick' - | 'floralwhite' - | 'forestgreen' - | 'fuchsia' - | 'gainsboro' - | 'ghostwhite' - | 'gold' - | 'goldenrod' - | 'gray' - | 'green' - | 'greenyellow' - | 'grey' - | 'honeydew' - | 'hotpink' - | 'indianred' - | 'indigo' - | 'ivory' - | 'khaki' - | 'lavender' - | 'lavenderblush' - | 'lawngreen' - | 'lemonchiffon' - | 'lightblue' - | 'lightcoral' - | 'lightcyan' - | 'lightgoldenrodyellow' - | 'lightgray' - | 'lightgreen' - | 'lightgrey' - | 'lightpink' - | 'lightsalmon' - | 'lightseagreen' - | 'lightskyblue' - | 'lightslategray' - | 'lightslategrey' - | 'lightsteelblue' - | 'lightyellow' - | 'lime' - | 'limegreen' - | 'linen' - | 'magenta' - | 'maroon' - | 'mediumaquamarine' - | 'mediumblue' - | 'mediumorchid' - | 'mediumpurple' - | 'mediumseagreen' - | 'mediumslateblue' - | 'mediumspringgreen' - | 'mediumturquoise' - | 'mediumvioletred' - | 'midnightblue' - | 'mintcream' - | 'mistyrose' - | 'moccasin' - | 'navajowhite' - | 'navy' - | 'oldlace' - | 'olive' - | 'olivedrab' - | 'orange' - | 'orangered' - | 'orchid' - | 'palegoldenrod' - | 'palegreen' - | 'paleturquoise' - | 'palevioletred' - | 'papayawhip' - | 'peachpuff' - | 'peru' - | 'pink' - | 'plum' - | 'powderblue' - | 'purple' - | 'rebeccapurple' - | 'red' - | 'rosybrown' - | 'royalblue' - | 'saddlebrown' - | 'salmon' - | 'sandybrown' - | 'seagreen' - | 'seashell' - | 'sienna' - | 'silver' - | 'skyblue' - | 'slateblue' - | 'slategray' - | 'slategrey' - | 'snow' - | 'springgreen' - | 'steelblue' - | 'tan' - | 'teal' - | 'thistle' - | 'tomato' - | 'turquoise' - | 'violet' - | 'wheat' - | 'white' - | 'whitesmoke' - | 'yellow' - | 'yellowgreen'; - -declare namespace ansiStyles { - interface ColorConvert { - /** - The RGB color space. - - @param red - (`0`-`255`) - @param green - (`0`-`255`) - @param blue - (`0`-`255`) - */ - rgb(red: number, green: number, blue: number): string; - - /** - The RGB HEX color space. - - @param hex - A hexadecimal string containing RGB data. - */ - hex(hex: string): string; - - /** - @param keyword - A CSS color name. - */ - keyword(keyword: CSSColor): string; - - /** - The HSL color space. - - @param hue - (`0`-`360`) - @param saturation - (`0`-`100`) - @param lightness - (`0`-`100`) - */ - hsl(hue: number, saturation: number, lightness: number): string; - - /** - The HSV color space. - - @param hue - (`0`-`360`) - @param saturation - (`0`-`100`) - @param value - (`0`-`100`) - */ - hsv(hue: number, saturation: number, value: number): string; - - /** - The HSV color space. - - @param hue - (`0`-`360`) - @param whiteness - (`0`-`100`) - @param blackness - (`0`-`100`) - */ - hwb(hue: number, whiteness: number, blackness: number): string; - - /** - Use a [4-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4-bit) to set text color. - */ - ansi(ansi: number): string; - - /** - Use an [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color. - */ - ansi256(ansi: number): string; - } - - interface CSPair { - /** - The ANSI terminal control sequence for starting this style. - */ - readonly open: string; - - /** - The ANSI terminal control sequence for ending this style. - */ - readonly close: string; - } - - interface ColorBase { - readonly ansi: ColorConvert; - readonly ansi256: ColorConvert; - readonly ansi16m: ColorConvert; - - /** - The ANSI terminal control sequence for ending this color. - */ - readonly close: string; - } - - interface Modifier { - /** - Resets the current color chain. - */ - readonly reset: CSPair; - - /** - Make text bold. - */ - readonly bold: CSPair; - - /** - Emitting only a small amount of light. - */ - readonly dim: CSPair; - - /** - Make text italic. (Not widely supported) - */ - readonly italic: CSPair; - - /** - Make text underline. (Not widely supported) - */ - readonly underline: CSPair; - - /** - Inverse background and foreground colors. - */ - readonly inverse: CSPair; - - /** - Prints the text, but makes it invisible. - */ - readonly hidden: CSPair; - - /** - Puts a horizontal line through the center of the text. (Not widely supported) - */ - readonly strikethrough: CSPair; - } - - interface ForegroundColor { - readonly black: CSPair; - readonly red: CSPair; - readonly green: CSPair; - readonly yellow: CSPair; - readonly blue: CSPair; - readonly cyan: CSPair; - readonly magenta: CSPair; - readonly white: CSPair; - - /** - Alias for `blackBright`. - */ - readonly gray: CSPair; - - /** - Alias for `blackBright`. - */ - readonly grey: CSPair; - - readonly blackBright: CSPair; - readonly redBright: CSPair; - readonly greenBright: CSPair; - readonly yellowBright: CSPair; - readonly blueBright: CSPair; - readonly cyanBright: CSPair; - readonly magentaBright: CSPair; - readonly whiteBright: CSPair; - } - - interface BackgroundColor { - readonly bgBlack: CSPair; - readonly bgRed: CSPair; - readonly bgGreen: CSPair; - readonly bgYellow: CSPair; - readonly bgBlue: CSPair; - readonly bgCyan: CSPair; - readonly bgMagenta: CSPair; - readonly bgWhite: CSPair; - - /** - Alias for `bgBlackBright`. - */ - readonly bgGray: CSPair; - - /** - Alias for `bgBlackBright`. - */ - readonly bgGrey: CSPair; - - readonly bgBlackBright: CSPair; - readonly bgRedBright: CSPair; - readonly bgGreenBright: CSPair; - readonly bgYellowBright: CSPair; - readonly bgBlueBright: CSPair; - readonly bgCyanBright: CSPair; - readonly bgMagentaBright: CSPair; - readonly bgWhiteBright: CSPair; - } -} - -declare const ansiStyles: { - readonly modifier: ansiStyles.Modifier; - readonly color: ansiStyles.ForegroundColor & ansiStyles.ColorBase; - readonly bgColor: ansiStyles.BackgroundColor & ansiStyles.ColorBase; - readonly codes: ReadonlyMap; -} & ansiStyles.BackgroundColor & ansiStyles.ForegroundColor & ansiStyles.Modifier; - -export = ansiStyles; diff --git a/node_modules/ansi-styles/index.js b/node_modules/ansi-styles/index.js deleted file mode 100644 index 5d82581..0000000 --- a/node_modules/ansi-styles/index.js +++ /dev/null @@ -1,163 +0,0 @@ -'use strict'; - -const wrapAnsi16 = (fn, offset) => (...args) => { - const code = fn(...args); - return `\u001B[${code + offset}m`; -}; - -const wrapAnsi256 = (fn, offset) => (...args) => { - const code = fn(...args); - return `\u001B[${38 + offset};5;${code}m`; -}; - -const wrapAnsi16m = (fn, offset) => (...args) => { - const rgb = fn(...args); - return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; -}; - -const ansi2ansi = n => n; -const rgb2rgb = (r, g, b) => [r, g, b]; - -const setLazyProperty = (object, property, get) => { - Object.defineProperty(object, property, { - get: () => { - const value = get(); - - Object.defineProperty(object, property, { - value, - enumerable: true, - configurable: true - }); - - return value; - }, - enumerable: true, - configurable: true - }); -}; - -/** @type {typeof import('color-convert')} */ -let colorConvert; -const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => { - if (colorConvert === undefined) { - colorConvert = require('color-convert'); - } - - const offset = isBackground ? 10 : 0; - const styles = {}; - - for (const [sourceSpace, suite] of Object.entries(colorConvert)) { - const name = sourceSpace === 'ansi16' ? 'ansi' : sourceSpace; - if (sourceSpace === targetSpace) { - styles[name] = wrap(identity, offset); - } else if (typeof suite === 'object') { - styles[name] = wrap(suite[targetSpace], offset); - } - } - - return styles; -}; - -function assembleStyles() { - const codes = new Map(); - const styles = { - modifier: { - reset: [0, 0], - // 21 isn't widely supported and 22 does the same thing - bold: [1, 22], - dim: [2, 22], - italic: [3, 23], - underline: [4, 24], - inverse: [7, 27], - hidden: [8, 28], - strikethrough: [9, 29] - }, - color: { - black: [30, 39], - red: [31, 39], - green: [32, 39], - yellow: [33, 39], - blue: [34, 39], - magenta: [35, 39], - cyan: [36, 39], - white: [37, 39], - - // Bright color - blackBright: [90, 39], - redBright: [91, 39], - greenBright: [92, 39], - yellowBright: [93, 39], - blueBright: [94, 39], - magentaBright: [95, 39], - cyanBright: [96, 39], - whiteBright: [97, 39] - }, - bgColor: { - bgBlack: [40, 49], - bgRed: [41, 49], - bgGreen: [42, 49], - bgYellow: [43, 49], - bgBlue: [44, 49], - bgMagenta: [45, 49], - bgCyan: [46, 49], - bgWhite: [47, 49], - - // Bright color - bgBlackBright: [100, 49], - bgRedBright: [101, 49], - bgGreenBright: [102, 49], - bgYellowBright: [103, 49], - bgBlueBright: [104, 49], - bgMagentaBright: [105, 49], - bgCyanBright: [106, 49], - bgWhiteBright: [107, 49] - } - }; - - // Alias bright black as gray (and grey) - styles.color.gray = styles.color.blackBright; - styles.bgColor.bgGray = styles.bgColor.bgBlackBright; - styles.color.grey = styles.color.blackBright; - styles.bgColor.bgGrey = styles.bgColor.bgBlackBright; - - for (const [groupName, group] of Object.entries(styles)) { - for (const [styleName, style] of Object.entries(group)) { - styles[styleName] = { - open: `\u001B[${style[0]}m`, - close: `\u001B[${style[1]}m` - }; - - group[styleName] = styles[styleName]; - - codes.set(style[0], style[1]); - } - - Object.defineProperty(styles, groupName, { - value: group, - enumerable: false - }); - } - - Object.defineProperty(styles, 'codes', { - value: codes, - enumerable: false - }); - - styles.color.close = '\u001B[39m'; - styles.bgColor.close = '\u001B[49m'; - - setLazyProperty(styles.color, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, false)); - setLazyProperty(styles.color, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, false)); - setLazyProperty(styles.color, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, false)); - setLazyProperty(styles.bgColor, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, true)); - setLazyProperty(styles.bgColor, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, true)); - setLazyProperty(styles.bgColor, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, true)); - - return styles; -} - -// Make the export immutable -Object.defineProperty(module, 'exports', { - enumerable: true, - get: assembleStyles -}); diff --git a/node_modules/ansi-styles/license b/node_modules/ansi-styles/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/ansi-styles/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/ansi-styles/package.json b/node_modules/ansi-styles/package.json deleted file mode 100644 index 7539328..0000000 --- a/node_modules/ansi-styles/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "name": "ansi-styles", - "version": "4.3.0", - "description": "ANSI escape codes for styling strings in the terminal", - "license": "MIT", - "repository": "chalk/ansi-styles", - "funding": "https://github.com/chalk/ansi-styles?sponsor=1", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd", - "screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "dependencies": { - "color-convert": "^2.0.1" - }, - "devDependencies": { - "@types/color-convert": "^1.9.0", - "ava": "^2.3.0", - "svg-term-cli": "^2.1.1", - "tsd": "^0.11.0", - "xo": "^0.25.3" - } -} diff --git a/node_modules/ansi-styles/readme.md b/node_modules/ansi-styles/readme.md deleted file mode 100644 index 24883de..0000000 --- a/node_modules/ansi-styles/readme.md +++ /dev/null @@ -1,152 +0,0 @@ -# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles) - -> [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal - -You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings. - - - -## Install - -``` -$ npm install ansi-styles -``` - -## Usage - -```js -const style = require('ansi-styles'); - -console.log(`${style.green.open}Hello world!${style.green.close}`); - - -// Color conversion between 16/256/truecolor -// NOTE: If conversion goes to 16 colors or 256 colors, the original color -// may be degraded to fit that color palette. This means terminals -// that do not support 16 million colors will best-match the -// original color. -console.log(style.bgColor.ansi.hsl(120, 80, 72) + 'Hello world!' + style.bgColor.close); -console.log(style.color.ansi256.rgb(199, 20, 250) + 'Hello world!' + style.color.close); -console.log(style.color.ansi16m.hex('#abcdef') + 'Hello world!' + style.color.close); -``` - -## API - -Each style has an `open` and `close` property. - -## Styles - -### Modifiers - -- `reset` -- `bold` -- `dim` -- `italic` *(Not widely supported)* -- `underline` -- `inverse` -- `hidden` -- `strikethrough` *(Not widely supported)* - -### Colors - -- `black` -- `red` -- `green` -- `yellow` -- `blue` -- `magenta` -- `cyan` -- `white` -- `blackBright` (alias: `gray`, `grey`) -- `redBright` -- `greenBright` -- `yellowBright` -- `blueBright` -- `magentaBright` -- `cyanBright` -- `whiteBright` - -### Background colors - -- `bgBlack` -- `bgRed` -- `bgGreen` -- `bgYellow` -- `bgBlue` -- `bgMagenta` -- `bgCyan` -- `bgWhite` -- `bgBlackBright` (alias: `bgGray`, `bgGrey`) -- `bgRedBright` -- `bgGreenBright` -- `bgYellowBright` -- `bgBlueBright` -- `bgMagentaBright` -- `bgCyanBright` -- `bgWhiteBright` - -## Advanced usage - -By default, you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module. - -- `style.modifier` -- `style.color` -- `style.bgColor` - -###### Example - -```js -console.log(style.color.green.open); -``` - -Raw escape codes (i.e. without the CSI escape prefix `\u001B[` and render mode postfix `m`) are available under `style.codes`, which returns a `Map` with the open codes as keys and close codes as values. - -###### Example - -```js -console.log(style.codes.get(36)); -//=> 39 -``` - -## [256 / 16 million (TrueColor) support](https://gist.github.com/XVilka/8346728) - -`ansi-styles` uses the [`color-convert`](https://github.com/Qix-/color-convert) package to allow for converting between various colors and ANSI escapes, with support for 256 and 16 million colors. - -The following color spaces from `color-convert` are supported: - -- `rgb` -- `hex` -- `keyword` -- `hsl` -- `hsv` -- `hwb` -- `ansi` -- `ansi256` - -To use these, call the associated conversion function with the intended output, for example: - -```js -style.color.ansi.rgb(100, 200, 15); // RGB to 16 color ansi foreground code -style.bgColor.ansi.rgb(100, 200, 15); // RGB to 16 color ansi background code - -style.color.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code -style.bgColor.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code - -style.color.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color foreground code -style.bgColor.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color background code -``` - -## Related - -- [ansi-escapes](https://github.com/sindresorhus/ansi-escapes) - ANSI escape codes for manipulating the terminal - -## Maintainers - -- [Sindre Sorhus](https://github.com/sindresorhus) -- [Josh Junon](https://github.com/qix-) - -## For enterprise - -Available as part of the Tidelift Subscription. - -The maintainers of `ansi-styles` 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-ansi-styles?utm_source=npm-ansi-styles&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/node_modules/array-flatten/LICENSE b/node_modules/array-flatten/LICENSE deleted file mode 100644 index 983fbe8..0000000 --- a/node_modules/array-flatten/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Blake Embrey (hello@blakeembrey.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/array-flatten/README.md b/node_modules/array-flatten/README.md deleted file mode 100644 index 91fa5b6..0000000 --- a/node_modules/array-flatten/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# Array Flatten - -[![NPM version][npm-image]][npm-url] -[![NPM downloads][downloads-image]][downloads-url] -[![Build status][travis-image]][travis-url] -[![Test coverage][coveralls-image]][coveralls-url] - -> Flatten an array of nested arrays into a single flat array. Accepts an optional depth. - -## Installation - -``` -npm install array-flatten --save -``` - -## Usage - -```javascript -var flatten = require('array-flatten') - -flatten([1, [2, [3, [4, [5], 6], 7], 8], 9]) -//=> [1, 2, 3, 4, 5, 6, 7, 8, 9] - -flatten([1, [2, [3, [4, [5], 6], 7], 8], 9], 2) -//=> [1, 2, 3, [4, [5], 6], 7, 8, 9] - -(function () { - flatten(arguments) //=> [1, 2, 3] -})(1, [2, 3]) -``` - -## License - -MIT - -[npm-image]: https://img.shields.io/npm/v/array-flatten.svg?style=flat -[npm-url]: https://npmjs.org/package/array-flatten -[downloads-image]: https://img.shields.io/npm/dm/array-flatten.svg?style=flat -[downloads-url]: https://npmjs.org/package/array-flatten -[travis-image]: https://img.shields.io/travis/blakeembrey/array-flatten.svg?style=flat -[travis-url]: https://travis-ci.org/blakeembrey/array-flatten -[coveralls-image]: https://img.shields.io/coveralls/blakeembrey/array-flatten.svg?style=flat -[coveralls-url]: https://coveralls.io/r/blakeembrey/array-flatten?branch=master diff --git a/node_modules/array-flatten/array-flatten.js b/node_modules/array-flatten/array-flatten.js deleted file mode 100644 index 089117b..0000000 --- a/node_modules/array-flatten/array-flatten.js +++ /dev/null @@ -1,64 +0,0 @@ -'use strict' - -/** - * Expose `arrayFlatten`. - */ -module.exports = arrayFlatten - -/** - * Recursive flatten function with depth. - * - * @param {Array} array - * @param {Array} result - * @param {Number} depth - * @return {Array} - */ -function flattenWithDepth (array, result, depth) { - for (var i = 0; i < array.length; i++) { - var value = array[i] - - if (depth > 0 && Array.isArray(value)) { - flattenWithDepth(value, result, depth - 1) - } else { - result.push(value) - } - } - - return result -} - -/** - * Recursive flatten function. Omitting depth is slightly faster. - * - * @param {Array} array - * @param {Array} result - * @return {Array} - */ -function flattenForever (array, result) { - for (var i = 0; i < array.length; i++) { - var value = array[i] - - if (Array.isArray(value)) { - flattenForever(value, result) - } else { - result.push(value) - } - } - - return result -} - -/** - * Flatten an array, with the ability to define a depth. - * - * @param {Array} array - * @param {Number} depth - * @return {Array} - */ -function arrayFlatten (array, depth) { - if (depth == null) { - return flattenForever(array, []) - } - - return flattenWithDepth(array, [], depth) -} diff --git a/node_modules/array-flatten/package.json b/node_modules/array-flatten/package.json deleted file mode 100644 index 1a24e2a..0000000 --- a/node_modules/array-flatten/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "array-flatten", - "version": "1.1.1", - "description": "Flatten an array of nested arrays into a single flat array", - "main": "array-flatten.js", - "files": [ - "array-flatten.js", - "LICENSE" - ], - "scripts": { - "test": "istanbul cover _mocha -- -R spec" - }, - "repository": { - "type": "git", - "url": "git://github.com/blakeembrey/array-flatten.git" - }, - "keywords": [ - "array", - "flatten", - "arguments", - "depth" - ], - "author": { - "name": "Blake Embrey", - "email": "hello@blakeembrey.com", - "url": "http://blakeembrey.me" - }, - "license": "MIT", - "bugs": { - "url": "https://github.com/blakeembrey/array-flatten/issues" - }, - "homepage": "https://github.com/blakeembrey/array-flatten", - "devDependencies": { - "istanbul": "^0.3.13", - "mocha": "^2.2.4", - "pre-commit": "^1.0.7", - "standard": "^3.7.3" - } -} diff --git a/node_modules/async/CHANGELOG.md b/node_modules/async/CHANGELOG.md deleted file mode 100644 index 8a9a1bf..0000000 --- a/node_modules/async/CHANGELOG.md +++ /dev/null @@ -1,348 +0,0 @@ -# v3.2.4 -- Fix a bug in `priorityQueue` where it didn't wait for the result. (#1725) -- Fix a bug where `unshiftAsync` was included in `priorityQueue`. (#1790) - -# v3.2.3 -- Fix bugs in comment parsing in `autoInject`. (#1767, #1780) - -# v3.2.2 -- Fix potential prototype pollution exploit - -# v3.2.1 -- Use `queueMicrotask` if available to the environment (#1761) -- Minor perf improvement in `priorityQueue` (#1727) -- More examples in documentation (#1726) -- Various doc fixes (#1708, #1712, #1717, #1740, #1739, #1749, #1756) -- Improved test coverage (#1754) - -# v3.2.0 -- Fix a bug in Safari related to overwriting `func.name` -- Remove built-in browserify configuration (#1653) -- Varios doc fixes (#1688, #1703, #1704) - -# v3.1.1 -- Allow redefining `name` property on wrapped functions. - -# v3.1.0 - -- Added `q.pushAsync` and `q.unshiftAsync`, analagous to `q.push` and `q.unshift`, except they always do not accept a callback, and reject if processing the task errors. (#1659) -- Promises returned from `q.push` and `q.unshift` when a callback is not passed now resolve even if an error ocurred. (#1659) -- Fixed a parsing bug in `autoInject` with complicated function bodies (#1663) -- Added ES6+ configuration for Browserify bundlers (#1653) -- Various doc fixes (#1664, #1658, #1665, #1652) - -# v3.0.1 - -## Bug fixes -- Fixed a regression where arrays passed to `queue` and `cargo` would be completely flattened. (#1645) -- Clarified Async's browser support (#1643) - - -# v3.0.0 - -The `async`/`await` release! - -There are a lot of new features and subtle breaking changes in this major version, but the biggest feature is that most Async methods return a Promise if you omit the callback, meaning you can `await` them from within an `async` function. - -```js -const results = await async.mapLimit(urls, 5, async url => { - const resp = await fetch(url) - return resp.body -}) -``` - -## Breaking Changes -- Most Async methods return a Promise when the final callback is omitted, making them `await`-able! (#1572) -- We are now making heavy use of ES2015 features, this means we have dropped out-of-the-box support for Node 4 and earlier, and many old versions of browsers. (#1541, #1553) -- In `queue`, `priorityQueue`, `cargo` and `cargoQueue`, the "event"-style methods, like `q.drain` and `q.saturated` are now methods that register a callback, rather than properties you assign a callback to. They are now of the form `q.drain(callback)`. If you do not pass a callback a Promise will be returned for the next occurrence of the event, making them `await`-able, e.g. `await q.drain()`. (#1586, #1641) -- Calling `callback(false)` will cancel an async method, preventing further iteration and callback calls. This is useful for preventing memory leaks when you break out of an async flow by calling an outer callback. (#1064, #1542) -- `during` and `doDuring` have been removed, and instead `whilst`, `doWhilst`, `until` and `doUntil` now have asynchronous `test` functions. (#850, #1557) -- `limits` of less than 1 now cause an error to be thrown in queues and collection methods. (#1249, #1552) -- `memoize` no longer memoizes errors (#1465, #1466) -- `applyEach`/`applyEachSeries` have a simpler interface, to make them more easily type-able. It always returns a function that takes in a single callback argument. If that callback is omitted, a promise is returned, making it awaitable. (#1228, #1640) - -## New Features -- Async generators are now supported in all the Collection methods. (#1560) -- Added `cargoQueue`, a queue with both `concurrency` and `payload` size parameters. (#1567) -- Queue objects returned from `queue` now have a `Symbol.iterator` method, meaning they can be iterated over to inspect the current list of items in the queue. (#1459, #1556) -- A ESM-flavored `async.mjs` is included in the `async` package. This is described in the `package.json` `"module"` field, meaning it should be automatically used by Webpack and other compatible bundlers. - -## Bug fixes -- Better handle arbitrary error objects in `asyncify` (#1568, #1569) - -## Other -- Removed Lodash as a dependency (#1283, #1528) -- Miscellaneous docs fixes (#1393, #1501, #1540, #1543, #1558, #1563, #1564, #1579, #1581) -- Miscellaneous test fixes (#1538) - -------- - -# v2.6.1 -- Updated lodash to prevent `npm audit` warnings. (#1532, #1533) -- Made `async-es` more optimized for webpack users (#1517) -- Fixed a stack overflow with large collections and a synchronous iterator (#1514) -- Various small fixes/chores (#1505, #1511, #1527, #1530) - -# v2.6.0 -- Added missing aliases for many methods. Previously, you could not (e.g.) `require('async/find')` or use `async.anyLimit`. (#1483) -- Improved `queue` performance. (#1448, #1454) -- Add missing sourcemap (#1452, #1453) -- Various doc updates (#1448, #1471, #1483) - -# v2.5.0 -- Added `concatLimit`, the `Limit` equivalent of [`concat`](https://caolan.github.io/async/docs.html#concat) ([#1426](https://github.com/caolan/async/issues/1426), [#1430](https://github.com/caolan/async/pull/1430)) -- `concat` improvements: it now preserves order, handles falsy values and the `iteratee` callback takes a variable number of arguments ([#1437](https://github.com/caolan/async/issues/1437), [#1436](https://github.com/caolan/async/pull/1436)) -- Fixed an issue in `queue` where there was a size discrepancy between `workersList().length` and `running()` ([#1428](https://github.com/caolan/async/issues/1428), [#1429](https://github.com/caolan/async/pull/1429)) -- Various doc fixes ([#1422](https://github.com/caolan/async/issues/1422), [#1424](https://github.com/caolan/async/pull/1424)) - -# v2.4.1 -- Fixed a bug preventing functions wrapped with `timeout()` from being re-used. ([#1418](https://github.com/caolan/async/issues/1418), [#1419](https://github.com/caolan/async/issues/1419)) - -# v2.4.0 -- Added `tryEach`, for running async functions in parallel, where you only expect one to succeed. ([#1365](https://github.com/caolan/async/issues/1365), [#687](https://github.com/caolan/async/issues/687)) -- Improved performance, most notably in `parallel` and `waterfall` ([#1395](https://github.com/caolan/async/issues/1395)) -- Added `queue.remove()`, for removing items in a `queue` ([#1397](https://github.com/caolan/async/issues/1397), [#1391](https://github.com/caolan/async/issues/1391)) -- Fixed using `eval`, preventing Async from running in pages with Content Security Policy ([#1404](https://github.com/caolan/async/issues/1404), [#1403](https://github.com/caolan/async/issues/1403)) -- Fixed errors thrown in an `asyncify`ed function's callback being caught by the underlying Promise ([#1408](https://github.com/caolan/async/issues/1408)) -- Fixed timing of `queue.empty()` ([#1367](https://github.com/caolan/async/issues/1367)) -- Various doc fixes ([#1314](https://github.com/caolan/async/issues/1314), [#1394](https://github.com/caolan/async/issues/1394), [#1412](https://github.com/caolan/async/issues/1412)) - -# v2.3.0 -- Added support for ES2017 `async` functions. Wherever you can pass a Node-style/CPS function that uses a callback, you can also pass an `async` function. Previously, you had to wrap `async` functions with `asyncify`. The caveat is that it will only work if `async` functions are supported natively in your environment, transpiled implementations can't be detected. ([#1386](https://github.com/caolan/async/issues/1386), [#1390](https://github.com/caolan/async/issues/1390)) -- Small doc fix ([#1392](https://github.com/caolan/async/issues/1392)) - -# v2.2.0 -- Added `groupBy`, and the `Series`/`Limit` equivalents, analogous to [`_.groupBy`](http://lodash.com/docs#groupBy) ([#1364](https://github.com/caolan/async/issues/1364)) -- Fixed `transform` bug when `callback` was not passed ([#1381](https://github.com/caolan/async/issues/1381)) -- Added note about `reflect` to `parallel` docs ([#1385](https://github.com/caolan/async/issues/1385)) - -# v2.1.5 -- Fix `auto` bug when function names collided with Array.prototype ([#1358](https://github.com/caolan/async/issues/1358)) -- Improve some error messages ([#1349](https://github.com/caolan/async/issues/1349)) -- Avoid stack overflow case in queue -- Fixed an issue in `some`, `every` and `find` where processing would continue after the result was determined. -- Cleanup implementations of `some`, `every` and `find` - -# v2.1.3 -- Make bundle size smaller -- Create optimized hotpath for `filter` in array case. - -# v2.1.2 -- Fixed a stackoverflow bug with `detect`, `some`, `every` on large inputs ([#1293](https://github.com/caolan/async/issues/1293)). - -# v2.1.0 - -- `retry` and `retryable` now support an optional `errorFilter` function that determines if the `task` should retry on the error ([#1256](https://github.com/caolan/async/issues/1256), [#1261](https://github.com/caolan/async/issues/1261)) -- Optimized array iteration in `race`, `cargo`, `queue`, and `priorityQueue` ([#1253](https://github.com/caolan/async/issues/1253)) -- Added alias documentation to doc site ([#1251](https://github.com/caolan/async/issues/1251), [#1254](https://github.com/caolan/async/issues/1254)) -- Added [BootStrap scrollspy](http://getbootstrap.com/javascript/#scrollspy) to docs to highlight in the sidebar the current method being viewed ([#1289](https://github.com/caolan/async/issues/1289), [#1300](https://github.com/caolan/async/issues/1300)) -- Various minor doc fixes ([#1263](https://github.com/caolan/async/issues/1263), [#1264](https://github.com/caolan/async/issues/1264), [#1271](https://github.com/caolan/async/issues/1271), [#1278](https://github.com/caolan/async/issues/1278), [#1280](https://github.com/caolan/async/issues/1280), [#1282](https://github.com/caolan/async/issues/1282), [#1302](https://github.com/caolan/async/issues/1302)) - -# v2.0.1 - -- Significantly optimized all iteration based collection methods such as `each`, `map`, `filter`, etc ([#1245](https://github.com/caolan/async/issues/1245), [#1246](https://github.com/caolan/async/issues/1246), [#1247](https://github.com/caolan/async/issues/1247)). - -# v2.0.0 - -Lots of changes here! - -First and foremost, we have a slick new [site for docs](https://caolan.github.io/async/). Special thanks to [**@hargasinski**](https://github.com/hargasinski) for his work converting our old docs to `jsdoc` format and implementing the new website. Also huge ups to [**@ivanseidel**](https://github.com/ivanseidel) for designing our new logo. It was a long process for both of these tasks, but I think these changes turned out extraordinary well. - -The biggest feature is modularization. You can now `require("async/series")` to only require the `series` function. Every Async library function is available this way. You still can `require("async")` to require the entire library, like you could do before. - -We also provide Async as a collection of ES2015 modules. You can now `import {each} from 'async-es'` or `import waterfall from 'async-es/waterfall'`. If you are using only a few Async functions, and are using a ES bundler such as Rollup, this can significantly lower your build size. - -Major thanks to [**@Kikobeats**](github.com/Kikobeats), [**@aearly**](github.com/aearly) and [**@megawac**](github.com/megawac) for doing the majority of the modularization work, as well as [**@jdalton**](github.com/jdalton) and [**@Rich-Harris**](github.com/Rich-Harris) for advisory work on the general modularization strategy. - -Another one of the general themes of the 2.0 release is standardization of what an "async" function is. We are now more strictly following the node-style continuation passing style. That is, an async function is a function that: - -1. Takes a variable number of arguments -2. The last argument is always a callback -3. The callback can accept any number of arguments -4. The first argument passed to the callback will be treated as an error result, if the argument is truthy -5. Any number of result arguments can be passed after the "error" argument -6. The callback is called once and exactly once, either on the same tick or later tick of the JavaScript event loop. - -There were several cases where Async accepted some functions that did not strictly have these properties, most notably `auto`, `every`, `some`, `filter`, `reject` and `detect`. - -Another theme is performance. We have eliminated internal deferrals in all cases where they make sense. For example, in `waterfall` and `auto`, there was a `setImmediate` between each task -- these deferrals have been removed. A `setImmediate` call can add up to 1ms of delay. This might not seem like a lot, but it can add up if you are using many Async functions in the course of processing a HTTP request, for example. Nearly all asynchronous functions that do I/O already have some sort of deferral built in, so the extra deferral is unnecessary. The trade-off of this change is removing our built-in stack-overflow defense. Many synchronous callback calls in series can quickly overflow the JS call stack. If you do have a function that is sometimes synchronous (calling its callback on the same tick), and are running into stack overflows, wrap it with `async.ensureAsync()`. - -Another big performance win has been re-implementing `queue`, `cargo`, and `priorityQueue` with [doubly linked lists](https://en.wikipedia.org/wiki/Doubly_linked_list) instead of arrays. This has lead to queues being an order of [magnitude faster on large sets of tasks](https://github.com/caolan/async/pull/1205). - -## New Features - -- Async is now modularized. Individual functions can be `require()`d from the main package. (`require('async/auto')`) ([#984](https://github.com/caolan/async/issues/984), [#996](https://github.com/caolan/async/issues/996)) -- Async is also available as a collection of ES2015 modules in the new `async-es` package. (`import {forEachSeries} from 'async-es'`) ([#984](https://github.com/caolan/async/issues/984), [#996](https://github.com/caolan/async/issues/996)) -- Added `race`, analogous to `Promise.race()`. It will run an array of async tasks in parallel and will call its callback with the result of the first task to respond. ([#568](https://github.com/caolan/async/issues/568), [#1038](https://github.com/caolan/async/issues/1038)) -- Collection methods now accept ES2015 iterators. Maps, Sets, and anything that implements the iterator spec can now be passed directly to `each`, `map`, `parallel`, etc.. ([#579](https://github.com/caolan/async/issues/579), [#839](https://github.com/caolan/async/issues/839), [#1074](https://github.com/caolan/async/issues/1074)) -- Added `mapValues`, for mapping over the properties of an object and returning an object with the same keys. ([#1157](https://github.com/caolan/async/issues/1157), [#1177](https://github.com/caolan/async/issues/1177)) -- Added `timeout`, a wrapper for an async function that will make the task time-out after the specified time. ([#1007](https://github.com/caolan/async/issues/1007), [#1027](https://github.com/caolan/async/issues/1027)) -- Added `reflect` and `reflectAll`, analagous to [`Promise.reflect()`](http://bluebirdjs.com/docs/api/reflect.html), a wrapper for async tasks that always succeeds, by gathering results and errors into an object. ([#942](https://github.com/caolan/async/issues/942), [#1012](https://github.com/caolan/async/issues/1012), [#1095](https://github.com/caolan/async/issues/1095)) -- `constant` supports dynamic arguments -- it will now always use its last argument as the callback. ([#1016](https://github.com/caolan/async/issues/1016), [#1052](https://github.com/caolan/async/issues/1052)) -- `setImmediate` and `nextTick` now support arguments to partially apply to the deferred function, like the node-native versions do. ([#940](https://github.com/caolan/async/issues/940), [#1053](https://github.com/caolan/async/issues/1053)) -- `auto` now supports resolving cyclic dependencies using [Kahn's algorithm](https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm) ([#1140](https://github.com/caolan/async/issues/1140)). -- Added `autoInject`, a relative of `auto` that automatically spreads a task's dependencies as arguments to the task function. ([#608](https://github.com/caolan/async/issues/608), [#1055](https://github.com/caolan/async/issues/1055), [#1099](https://github.com/caolan/async/issues/1099), [#1100](https://github.com/caolan/async/issues/1100)) -- You can now limit the concurrency of `auto` tasks. ([#635](https://github.com/caolan/async/issues/635), [#637](https://github.com/caolan/async/issues/637)) -- Added `retryable`, a relative of `retry` that wraps an async function, making it retry when called. ([#1058](https://github.com/caolan/async/issues/1058)) -- `retry` now supports specifying a function that determines the next time interval, useful for exponential backoff, logging and other retry strategies. ([#1161](https://github.com/caolan/async/issues/1161)) -- `retry` will now pass all of the arguments the task function was resolved with to the callback ([#1231](https://github.com/caolan/async/issues/1231)). -- Added `q.unsaturated` -- callback called when a `queue`'s number of running workers falls below a threshold. ([#868](https://github.com/caolan/async/issues/868), [#1030](https://github.com/caolan/async/issues/1030), [#1033](https://github.com/caolan/async/issues/1033), [#1034](https://github.com/caolan/async/issues/1034)) -- Added `q.error` -- a callback called whenever a `queue` task calls its callback with an error. ([#1170](https://github.com/caolan/async/issues/1170)) -- `applyEach` and `applyEachSeries` now pass results to the final callback. ([#1088](https://github.com/caolan/async/issues/1088)) - -## Breaking changes - -- Calling a callback more than once is considered an error, and an error will be thrown. This had an explicit breaking change in `waterfall`. If you were relying on this behavior, you should more accurately represent your control flow as an event emitter or stream. ([#814](https://github.com/caolan/async/issues/814), [#815](https://github.com/caolan/async/issues/815), [#1048](https://github.com/caolan/async/issues/1048), [#1050](https://github.com/caolan/async/issues/1050)) -- `auto` task functions now always take the callback as the last argument. If a task has dependencies, the `results` object will be passed as the first argument. To migrate old task functions, wrap them with [`_.flip`](https://lodash.com/docs#flip) ([#1036](https://github.com/caolan/async/issues/1036), [#1042](https://github.com/caolan/async/issues/1042)) -- Internal `setImmediate` calls have been refactored away. This may make existing flows vulnerable to stack overflows if you use many synchronous functions in series. Use `ensureAsync` to work around this. ([#696](https://github.com/caolan/async/issues/696), [#704](https://github.com/caolan/async/issues/704), [#1049](https://github.com/caolan/async/issues/1049), [#1050](https://github.com/caolan/async/issues/1050)) -- `map` used to return an object when iterating over an object. `map` now always returns an array, like in other libraries. The previous object behavior has been split out into `mapValues`. ([#1157](https://github.com/caolan/async/issues/1157), [#1177](https://github.com/caolan/async/issues/1177)) -- `filter`, `reject`, `some`, `every`, `detect` and their families like `{METHOD}Series` and `{METHOD}Limit` now expect an error as the first callback argument, rather than just a simple boolean. Pass `null` as the first argument, or use `fs.access` instead of `fs.exists`. ([#118](https://github.com/caolan/async/issues/118), [#774](https://github.com/caolan/async/issues/774), [#1028](https://github.com/caolan/async/issues/1028), [#1041](https://github.com/caolan/async/issues/1041)) -- `{METHOD}` and `{METHOD}Series` are now implemented in terms of `{METHOD}Limit`. This is a major internal simplification, and is not expected to cause many problems, but it does subtly affect how functions execute internally. ([#778](https://github.com/caolan/async/issues/778), [#847](https://github.com/caolan/async/issues/847)) -- `retry`'s callback is now optional. Previously, omitting the callback would partially apply the function, meaning it could be passed directly as a task to `series` or `auto`. The partially applied "control-flow" behavior has been separated out into `retryable`. ([#1054](https://github.com/caolan/async/issues/1054), [#1058](https://github.com/caolan/async/issues/1058)) -- The test function for `whilst`, `until`, and `during` used to be passed non-error args from the iteratee function's callback, but this led to weirdness where the first call of the test function would be passed no args. We have made it so the test function is never passed extra arguments, and only the `doWhilst`, `doUntil`, and `doDuring` functions pass iteratee callback arguments to the test function ([#1217](https://github.com/caolan/async/issues/1217), [#1224](https://github.com/caolan/async/issues/1224)) -- The `q.tasks` array has been renamed `q._tasks` and is now implemented as a doubly linked list (DLL). Any code that used to interact with this array will need to be updated to either use the provided helpers or support DLLs ([#1205](https://github.com/caolan/async/issues/1205)). -- The timing of the `q.saturated()` callback in a `queue` has been modified to better reflect when tasks pushed to the queue will start queueing. ([#724](https://github.com/caolan/async/issues/724), [#1078](https://github.com/caolan/async/issues/1078)) -- Removed `iterator` method in favour of [ES2015 iterator protocol](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators ) which natively supports arrays ([#1237](https://github.com/caolan/async/issues/1237)) -- Dropped support for Component, Jam, SPM, and Volo ([#1175](https://github.com/caolan/async/issues/1175), #[#176](https://github.com/caolan/async/issues/176)) - -## Bug Fixes - -- Improved handling of no dependency cases in `auto` & `autoInject` ([#1147](https://github.com/caolan/async/issues/1147)). -- Fixed a bug where the callback generated by `asyncify` with `Promises` could resolve twice ([#1197](https://github.com/caolan/async/issues/1197)). -- Fixed several documented optional callbacks not actually being optional ([#1223](https://github.com/caolan/async/issues/1223)). - -## Other - -- Added `someSeries` and `everySeries` for symmetry, as well as a complete set of `any`/`anyLimit`/`anySeries` and `all`/`/allLmit`/`allSeries` aliases. -- Added `find` as an alias for `detect. (as well as `findLimit` and `findSeries`). -- Various doc fixes ([#1005](https://github.com/caolan/async/issues/1005), [#1008](https://github.com/caolan/async/issues/1008), [#1010](https://github.com/caolan/async/issues/1010), [#1015](https://github.com/caolan/async/issues/1015), [#1021](https://github.com/caolan/async/issues/1021), [#1037](https://github.com/caolan/async/issues/1037), [#1039](https://github.com/caolan/async/issues/1039), [#1051](https://github.com/caolan/async/issues/1051), [#1102](https://github.com/caolan/async/issues/1102), [#1107](https://github.com/caolan/async/issues/1107), [#1121](https://github.com/caolan/async/issues/1121), [#1123](https://github.com/caolan/async/issues/1123), [#1129](https://github.com/caolan/async/issues/1129), [#1135](https://github.com/caolan/async/issues/1135), [#1138](https://github.com/caolan/async/issues/1138), [#1141](https://github.com/caolan/async/issues/1141), [#1153](https://github.com/caolan/async/issues/1153), [#1216](https://github.com/caolan/async/issues/1216), [#1217](https://github.com/caolan/async/issues/1217), [#1232](https://github.com/caolan/async/issues/1232), [#1233](https://github.com/caolan/async/issues/1233), [#1236](https://github.com/caolan/async/issues/1236), [#1238](https://github.com/caolan/async/issues/1238)) - -Thank you [**@aearly**](github.com/aearly) and [**@megawac**](github.com/megawac) for taking the lead on version 2 of async. - ------------------------------------------- - -# v1.5.2 -- Allow using `"constructor"` as an argument in `memoize` ([#998](https://github.com/caolan/async/issues/998)) -- Give a better error messsage when `auto` dependency checking fails ([#994](https://github.com/caolan/async/issues/994)) -- Various doc updates ([#936](https://github.com/caolan/async/issues/936), [#956](https://github.com/caolan/async/issues/956), [#979](https://github.com/caolan/async/issues/979), [#1002](https://github.com/caolan/async/issues/1002)) - -# v1.5.1 -- Fix issue with `pause` in `queue` with concurrency enabled ([#946](https://github.com/caolan/async/issues/946)) -- `while` and `until` now pass the final result to callback ([#963](https://github.com/caolan/async/issues/963)) -- `auto` will properly handle concurrency when there is no callback ([#966](https://github.com/caolan/async/issues/966)) -- `auto` will no. properly stop execution when an error occurs ([#988](https://github.com/caolan/async/issues/988), [#993](https://github.com/caolan/async/issues/993)) -- Various doc fixes ([#971](https://github.com/caolan/async/issues/971), [#980](https://github.com/caolan/async/issues/980)) - -# v1.5.0 - -- Added `transform`, analogous to [`_.transform`](http://lodash.com/docs#transform) ([#892](https://github.com/caolan/async/issues/892)) -- `map` now returns an object when an object is passed in, rather than array with non-numeric keys. `map` will begin always returning an array with numeric indexes in the next major release. ([#873](https://github.com/caolan/async/issues/873)) -- `auto` now accepts an optional `concurrency` argument to limit the number o. running tasks ([#637](https://github.com/caolan/async/issues/637)) -- Added `queue#workersList()`, to retrieve the lis. of currently running tasks. ([#891](https://github.com/caolan/async/issues/891)) -- Various code simplifications ([#896](https://github.com/caolan/async/issues/896), [#904](https://github.com/caolan/async/issues/904)) -- Various doc fixes :scroll: ([#890](https://github.com/caolan/async/issues/890), [#894](https://github.com/caolan/async/issues/894), [#903](https://github.com/caolan/async/issues/903), [#905](https://github.com/caolan/async/issues/905), [#912](https://github.com/caolan/async/issues/912)) - -# v1.4.2 - -- Ensure coverage files don't get published on npm ([#879](https://github.com/caolan/async/issues/879)) - -# v1.4.1 - -- Add in overlooked `detectLimit` method ([#866](https://github.com/caolan/async/issues/866)) -- Removed unnecessary files from npm releases ([#861](https://github.com/caolan/async/issues/861)) -- Removed usage of a reserved word to prevent :boom: in older environments ([#870](https://github.com/caolan/async/issues/870)) - -# v1.4.0 - -- `asyncify` now supports promises ([#840](https://github.com/caolan/async/issues/840)) -- Added `Limit` versions of `filter` and `reject` ([#836](https://github.com/caolan/async/issues/836)) -- Add `Limit` versions of `detect`, `some` and `every` ([#828](https://github.com/caolan/async/issues/828), [#829](https://github.com/caolan/async/issues/829)) -- `some`, `every` and `detect` now short circuit early ([#828](https://github.com/caolan/async/issues/828), [#829](https://github.com/caolan/async/issues/829)) -- Improve detection of the global object ([#804](https://github.com/caolan/async/issues/804)), enabling use in WebWorkers -- `whilst` now called with arguments from iterator ([#823](https://github.com/caolan/async/issues/823)) -- `during` now gets called with arguments from iterator ([#824](https://github.com/caolan/async/issues/824)) -- Code simplifications and optimizations aplenty ([diff](https://github.com/caolan/async/compare/v1.3.0...v1.4.0)) - - -# v1.3.0 - -New Features: -- Added `constant` -- Added `asyncify`/`wrapSync` for making sync functions work with callbacks. ([#671](https://github.com/caolan/async/issues/671), [#806](https://github.com/caolan/async/issues/806)) -- Added `during` and `doDuring`, which are like `whilst` with an async truth test. ([#800](https://github.com/caolan/async/issues/800)) -- `retry` now accepts an `interval` parameter to specify a delay between retries. ([#793](https://github.com/caolan/async/issues/793)) -- `async` should work better in Web Workers due to better `root` detection ([#804](https://github.com/caolan/async/issues/804)) -- Callbacks are now optional in `whilst`, `doWhilst`, `until`, and `doUntil` ([#642](https://github.com/caolan/async/issues/642)) -- Various internal updates ([#786](https://github.com/caolan/async/issues/786), [#801](https://github.com/caolan/async/issues/801), [#802](https://github.com/caolan/async/issues/802), [#803](https://github.com/caolan/async/issues/803)) -- Various doc fixes ([#790](https://github.com/caolan/async/issues/790), [#794](https://github.com/caolan/async/issues/794)) - -Bug Fixes: -- `cargo` now exposes the `payload` size, and `cargo.payload` can be changed on the fly after the `cargo` is created. ([#740](https://github.com/caolan/async/issues/740), [#744](https://github.com/caolan/async/issues/744), [#783](https://github.com/caolan/async/issues/783)) - - -# v1.2.1 - -Bug Fix: - -- Small regression with synchronous iterator behavior in `eachSeries` with a 1-element array. Before 1.1.0, `eachSeries`'s callback was called on the same tick, which this patch restores. In 2.0.0, it will be called on the next tick. ([#782](https://github.com/caolan/async/issues/782)) - - -# v1.2.0 - -New Features: - -- Added `timesLimit` ([#743](https://github.com/caolan/async/issues/743)) -- `concurrency` can be changed after initialization in `queue` by setting `q.concurrency`. The new concurrency will be reflected the next time a task is processed. ([#747](https://github.com/caolan/async/issues/747), [#772](https://github.com/caolan/async/issues/772)) - -Bug Fixes: - -- Fixed a regression in `each` and family with empty arrays that have additional properties. ([#775](https://github.com/caolan/async/issues/775), [#777](https://github.com/caolan/async/issues/777)) - - -# v1.1.1 - -Bug Fix: - -- Small regression with synchronous iterator behavior in `eachSeries` with a 1-element array. Before 1.1.0, `eachSeries`'s callback was called on the same tick, which this patch restores. In 2.0.0, it will be called on the next tick. ([#782](https://github.com/caolan/async/issues/782)) - - -# v1.1.0 - -New Features: - -- `cargo` now supports all of the same methods and event callbacks as `queue`. -- Added `ensureAsync` - A wrapper that ensures an async function calls its callback on a later tick. ([#769](https://github.com/caolan/async/issues/769)) -- Optimized `map`, `eachOf`, and `waterfall` families of functions -- Passing a `null` or `undefined` array to `map`, `each`, `parallel` and families will be treated as an empty array ([#667](https://github.com/caolan/async/issues/667)). -- The callback is now optional for the composed results of `compose` and `seq`. ([#618](https://github.com/caolan/async/issues/618)) -- Reduced file size by 4kb, (minified version by 1kb) -- Added code coverage through `nyc` and `coveralls` ([#768](https://github.com/caolan/async/issues/768)) - -Bug Fixes: - -- `forever` will no longer stack overflow with a synchronous iterator ([#622](https://github.com/caolan/async/issues/622)) -- `eachLimit` and other limit functions will stop iterating once an error occurs ([#754](https://github.com/caolan/async/issues/754)) -- Always pass `null` in callbacks when there is no error ([#439](https://github.com/caolan/async/issues/439)) -- Ensure proper conditions when calling `drain()` after pushing an empty data set to a queue ([#668](https://github.com/caolan/async/issues/668)) -- `each` and family will properly handle an empty array ([#578](https://github.com/caolan/async/issues/578)) -- `eachSeries` and family will finish if the underlying array is modified during execution ([#557](https://github.com/caolan/async/issues/557)) -- `queue` will throw if a non-function is passed to `q.push()` ([#593](https://github.com/caolan/async/issues/593)) -- Doc fixes ([#629](https://github.com/caolan/async/issues/629), [#766](https://github.com/caolan/async/issues/766)) - - -# v1.0.0 - -No known breaking changes, we are simply complying with semver from here on out. - -Changes: - -- Start using a changelog! -- Add `forEachOf` for iterating over Objects (or to iterate Arrays with indexes available) ([#168](https://github.com/caolan/async/issues/168) [#704](https://github.com/caolan/async/issues/704) [#321](https://github.com/caolan/async/issues/321)) -- Detect deadlocks in `auto` ([#663](https://github.com/caolan/async/issues/663)) -- Better support for require.js ([#527](https://github.com/caolan/async/issues/527)) -- Throw if queue created with concurrency `0` ([#714](https://github.com/caolan/async/issues/714)) -- Fix unneeded iteration in `queue.resume()` ([#758](https://github.com/caolan/async/issues/758)) -- Guard against timer mocking overriding `setImmediate` ([#609](https://github.com/caolan/async/issues/609) [#611](https://github.com/caolan/async/issues/611)) -- Miscellaneous doc fixes ([#542](https://github.com/caolan/async/issues/542) [#596](https://github.com/caolan/async/issues/596) [#615](https://github.com/caolan/async/issues/615) [#628](https://github.com/caolan/async/issues/628) [#631](https://github.com/caolan/async/issues/631) [#690](https://github.com/caolan/async/issues/690) [#729](https://github.com/caolan/async/issues/729)) -- Use single noop function internally ([#546](https://github.com/caolan/async/issues/546)) -- Optimize internal `_each`, `_map` and `_keys` functions. diff --git a/node_modules/async/LICENSE b/node_modules/async/LICENSE deleted file mode 100644 index b18aed6..0000000 --- a/node_modules/async/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2010-2018 Caolan McMahon - -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/async/README.md b/node_modules/async/README.md deleted file mode 100644 index 77f645e..0000000 --- a/node_modules/async/README.md +++ /dev/null @@ -1,59 +0,0 @@ -![Async Logo](https://raw.githubusercontent.com/caolan/async/master/logo/async-logo_readme.jpg) - -![Github Actions CI status](https://github.com/caolan/async/actions/workflows/ci.yml/badge.svg) -[![NPM version](https://img.shields.io/npm/v/async.svg)](https://www.npmjs.com/package/async) -[![Coverage Status](https://coveralls.io/repos/caolan/async/badge.svg?branch=master)](https://coveralls.io/r/caolan/async?branch=master) -[![Join the chat at https://gitter.im/caolan/async](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/caolan/async?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -[![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/async/badge?style=rounded)](https://www.jsdelivr.com/package/npm/async) - - - -Async is a utility module which provides straight-forward, powerful functions for working with [asynchronous JavaScript](http://caolan.github.io/async/v3/global.html). Although originally designed for use with [Node.js](https://nodejs.org/) and installable via `npm i async`, it can also be used directly in the browser. A ESM/MJS version is included in the main `async` package that should automatically be used with compatible bundlers such as Webpack and Rollup. - -A pure ESM version of Async is available as [`async-es`](https://www.npmjs.com/package/async-es). - -For Documentation, visit - -*For Async v1.5.x documentation, go [HERE](https://github.com/caolan/async/blob/v1.5.2/README.md)* - - -```javascript -// for use with Node-style callbacks... -var async = require("async"); - -var obj = {dev: "/dev.json", test: "/test.json", prod: "/prod.json"}; -var configs = {}; - -async.forEachOf(obj, (value, key, callback) => { - fs.readFile(__dirname + value, "utf8", (err, data) => { - if (err) return callback(err); - try { - configs[key] = JSON.parse(data); - } catch (e) { - return callback(e); - } - callback(); - }); -}, err => { - if (err) console.error(err.message); - // configs is now a map of JSON data - doSomethingWith(configs); -}); -``` - -```javascript -var async = require("async"); - -// ...or ES2017 async functions -async.mapLimit(urls, 5, async function(url) { - const response = await fetch(url) - return response.body -}, (err, results) => { - if (err) throw err - // results is now an array of the response bodies - console.log(results) -}) -``` diff --git a/node_modules/async/all.js b/node_modules/async/all.js deleted file mode 100644 index 148db68..0000000 --- a/node_modules/async/all.js +++ /dev/null @@ -1,119 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createTester = require('./internal/createTester.js'); - -var _createTester2 = _interopRequireDefault(_createTester); - -var _eachOf = require('./eachOf.js'); - -var _eachOf2 = _interopRequireDefault(_eachOf); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Returns `true` if every element in `coll` satisfies an async test. If any - * iteratee call returns `false`, the main `callback` is immediately called. - * - * @name every - * @static - * @memberOf module:Collections - * @method - * @alias all - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collection in parallel. - * The iteratee must complete with a boolean result value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result will be either `true` or `false` - * depending on the values of the async tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * // dir4 does not exist - * - * const fileList = ['dir1/file1.txt','dir2/file3.txt','dir3/file5.txt']; - * const withMissingFileList = ['file1.txt','file2.txt','file4.txt']; - * - * // asynchronous function that checks if a file exists - * function fileExists(file, callback) { - * fs.access(file, fs.constants.F_OK, (err) => { - * callback(null, !err); - * }); - * } - * - * // Using callbacks - * async.every(fileList, fileExists, function(err, result) { - * console.log(result); - * // true - * // result is true since every file exists - * }); - * - * async.every(withMissingFileList, fileExists, function(err, result) { - * console.log(result); - * // false - * // result is false since NOT every file exists - * }); - * - * // Using Promises - * async.every(fileList, fileExists) - * .then( result => { - * console.log(result); - * // true - * // result is true since every file exists - * }).catch( err => { - * console.log(err); - * }); - * - * async.every(withMissingFileList, fileExists) - * .then( result => { - * console.log(result); - * // false - * // result is false since NOT every file exists - * }).catch( err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.every(fileList, fileExists); - * console.log(result); - * // true - * // result is true since every file exists - * } - * catch (err) { - * console.log(err); - * } - * } - * - * async () => { - * try { - * let result = await async.every(withMissingFileList, fileExists); - * console.log(result); - * // false - * // result is false since NOT every file exists - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function every(coll, iteratee, callback) { - return (0, _createTester2.default)(bool => !bool, res => !res)(_eachOf2.default, coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(every, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/allLimit.js b/node_modules/async/allLimit.js deleted file mode 100644 index 25b2c08..0000000 --- a/node_modules/async/allLimit.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createTester = require('./internal/createTester.js'); - -var _createTester2 = _interopRequireDefault(_createTester); - -var _eachOfLimit = require('./internal/eachOfLimit.js'); - -var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time. - * - * @name everyLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.every]{@link module:Collections.every} - * @alias allLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collection in parallel. - * The iteratee must complete with a boolean result value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result will be either `true` or `false` - * depending on the values of the async tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - */ -function everyLimit(coll, limit, iteratee, callback) { - return (0, _createTester2.default)(bool => !bool, res => !res)((0, _eachOfLimit2.default)(limit), coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(everyLimit, 4); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/allSeries.js b/node_modules/async/allSeries.js deleted file mode 100644 index 147c3dc..0000000 --- a/node_modules/async/allSeries.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createTester = require('./internal/createTester.js'); - -var _createTester2 = _interopRequireDefault(_createTester); - -var _eachOfSeries = require('./eachOfSeries.js'); - -var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`every`]{@link module:Collections.every} but runs only a single async operation at a time. - * - * @name everySeries - * @static - * @memberOf module:Collections - * @method - * @see [async.every]{@link module:Collections.every} - * @alias allSeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collection in series. - * The iteratee must complete with a boolean result value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result will be either `true` or `false` - * depending on the values of the async tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - */ -function everySeries(coll, iteratee, callback) { - return (0, _createTester2.default)(bool => !bool, res => !res)(_eachOfSeries2.default, coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(everySeries, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/any.js b/node_modules/async/any.js deleted file mode 100644 index 2046cf6..0000000 --- a/node_modules/async/any.js +++ /dev/null @@ -1,122 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createTester = require('./internal/createTester.js'); - -var _createTester2 = _interopRequireDefault(_createTester); - -var _eachOf = require('./eachOf.js'); - -var _eachOf2 = _interopRequireDefault(_eachOf); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Returns `true` if at least one element in the `coll` satisfies an async test. - * If any iteratee call returns `true`, the main `callback` is immediately - * called. - * - * @name some - * @static - * @memberOf module:Collections - * @method - * @alias any - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collections in parallel. - * The iteratee should complete with a boolean `result` value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the iteratee functions have finished. - * Result will be either `true` or `false` depending on the values of the async - * tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * // dir4 does not exist - * - * // asynchronous function that checks if a file exists - * function fileExists(file, callback) { - * fs.access(file, fs.constants.F_OK, (err) => { - * callback(null, !err); - * }); - * } - * - * // Using callbacks - * async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists, - * function(err, result) { - * console.log(result); - * // true - * // result is true since some file in the list exists - * } - *); - * - * async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists, - * function(err, result) { - * console.log(result); - * // false - * // result is false since none of the files exists - * } - *); - * - * // Using Promises - * async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists) - * .then( result => { - * console.log(result); - * // true - * // result is true since some file in the list exists - * }).catch( err => { - * console.log(err); - * }); - * - * async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists) - * .then( result => { - * console.log(result); - * // false - * // result is false since none of the files exists - * }).catch( err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists); - * console.log(result); - * // true - * // result is true since some file in the list exists - * } - * catch (err) { - * console.log(err); - * } - * } - * - * async () => { - * try { - * let result = await async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists); - * console.log(result); - * // false - * // result is false since none of the files exists - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function some(coll, iteratee, callback) { - return (0, _createTester2.default)(Boolean, res => res)(_eachOf2.default, coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(some, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/anyLimit.js b/node_modules/async/anyLimit.js deleted file mode 100644 index c8a295a..0000000 --- a/node_modules/async/anyLimit.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createTester = require('./internal/createTester.js'); - -var _createTester2 = _interopRequireDefault(_createTester); - -var _eachOfLimit = require('./internal/eachOfLimit.js'); - -var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`some`]{@link module:Collections.some} but runs a maximum of `limit` async operations at a time. - * - * @name someLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.some]{@link module:Collections.some} - * @alias anyLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collections in parallel. - * The iteratee should complete with a boolean `result` value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the iteratee functions have finished. - * Result will be either `true` or `false` depending on the values of the async - * tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - */ -function someLimit(coll, limit, iteratee, callback) { - return (0, _createTester2.default)(Boolean, res => res)((0, _eachOfLimit2.default)(limit), coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(someLimit, 4); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/anySeries.js b/node_modules/async/anySeries.js deleted file mode 100644 index ee0654b..0000000 --- a/node_modules/async/anySeries.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createTester = require('./internal/createTester.js'); - -var _createTester2 = _interopRequireDefault(_createTester); - -var _eachOfSeries = require('./eachOfSeries.js'); - -var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`some`]{@link module:Collections.some} but runs only a single async operation at a time. - * - * @name someSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.some]{@link module:Collections.some} - * @alias anySeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collections in series. - * The iteratee should complete with a boolean `result` value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the iteratee functions have finished. - * Result will be either `true` or `false` depending on the values of the async - * tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - */ -function someSeries(coll, iteratee, callback) { - return (0, _createTester2.default)(Boolean, res => res)(_eachOfSeries2.default, coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(someSeries, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/apply.js b/node_modules/async/apply.js deleted file mode 100644 index 5246833..0000000 --- a/node_modules/async/apply.js +++ /dev/null @@ -1,55 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -exports.default = function (fn, ...args) { - return (...callArgs) => fn(...args, ...callArgs); -}; - -module.exports = exports["default"]; /** - * Creates a continuation function with some arguments already applied. - * - * Useful as a shorthand when combined with other control flow functions. Any - * arguments passed to the returned function are added to the arguments - * originally passed to apply. - * - * @name apply - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {Function} fn - The function you want to eventually apply all - * arguments to. Invokes with (arguments...). - * @param {...*} arguments... - Any number of arguments to automatically apply - * when the continuation is called. - * @returns {Function} the partially-applied function - * @example - * - * // using apply - * async.parallel([ - * async.apply(fs.writeFile, 'testfile1', 'test1'), - * async.apply(fs.writeFile, 'testfile2', 'test2') - * ]); - * - * - * // the same process without using apply - * async.parallel([ - * function(callback) { - * fs.writeFile('testfile1', 'test1', callback); - * }, - * function(callback) { - * fs.writeFile('testfile2', 'test2', callback); - * } - * ]); - * - * // It's possible to pass any number of additional arguments when calling the - * // continuation: - * - * node> var fn = async.apply(sys.puts, 'one'); - * node> fn('two', 'three'); - * one - * two - * three - */ \ No newline at end of file diff --git a/node_modules/async/applyEach.js b/node_modules/async/applyEach.js deleted file mode 100644 index b08c670..0000000 --- a/node_modules/async/applyEach.js +++ /dev/null @@ -1,57 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _applyEach = require('./internal/applyEach.js'); - -var _applyEach2 = _interopRequireDefault(_applyEach); - -var _map = require('./map.js'); - -var _map2 = _interopRequireDefault(_map); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Applies the provided arguments to each function in the array, calling - * `callback` after all functions have completed. If you only provide the first - * argument, `fns`, then it will return a function which lets you pass in the - * arguments as if it were a single function call. If more arguments are - * provided, `callback` is required while `args` is still optional. The results - * for each of the applied async functions are passed to the final callback - * as an array. - * - * @name applyEach - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array|Iterable|AsyncIterable|Object} fns - A collection of {@link AsyncFunction}s - * to all call with the same arguments - * @param {...*} [args] - any number of separate arguments to pass to the - * function. - * @param {Function} [callback] - the final argument should be the callback, - * called when all functions have completed processing. - * @returns {AsyncFunction} - Returns a function that takes no args other than - * an optional callback, that is the result of applying the `args` to each - * of the functions. - * @example - * - * const appliedFn = async.applyEach([enableSearch, updateSchema], 'bucket') - * - * appliedFn((err, results) => { - * // results[0] is the results for `enableSearch` - * // results[1] is the results for `updateSchema` - * }); - * - * // partial application example: - * async.each( - * buckets, - * async (bucket) => async.applyEach([enableSearch, updateSchema], bucket)(), - * callback - * ); - */ -exports.default = (0, _applyEach2.default)(_map2.default); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/applyEachSeries.js b/node_modules/async/applyEachSeries.js deleted file mode 100644 index 6a19ca3..0000000 --- a/node_modules/async/applyEachSeries.js +++ /dev/null @@ -1,37 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _applyEach = require('./internal/applyEach.js'); - -var _applyEach2 = _interopRequireDefault(_applyEach); - -var _mapSeries = require('./mapSeries.js'); - -var _mapSeries2 = _interopRequireDefault(_mapSeries); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`applyEach`]{@link module:ControlFlow.applyEach} but runs only a single async operation at a time. - * - * @name applyEachSeries - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.applyEach]{@link module:ControlFlow.applyEach} - * @category Control Flow - * @param {Array|Iterable|AsyncIterable|Object} fns - A collection of {@link AsyncFunction}s to all - * call with the same arguments - * @param {...*} [args] - any number of separate arguments to pass to the - * function. - * @param {Function} [callback] - the final argument should be the callback, - * called when all functions have completed processing. - * @returns {AsyncFunction} - A function, that when called, is the result of - * appling the `args` to the list of functions. It takes no args, other than - * a callback. - */ -exports.default = (0, _applyEach2.default)(_mapSeries2.default); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/asyncify.js b/node_modules/async/asyncify.js deleted file mode 100644 index 3c3bf88..0000000 --- a/node_modules/async/asyncify.js +++ /dev/null @@ -1,118 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = asyncify; - -var _initialParams = require('./internal/initialParams.js'); - -var _initialParams2 = _interopRequireDefault(_initialParams); - -var _setImmediate = require('./internal/setImmediate.js'); - -var _setImmediate2 = _interopRequireDefault(_setImmediate); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Take a sync function and make it async, passing its return value to a - * callback. This is useful for plugging sync functions into a waterfall, - * series, or other async functions. Any arguments passed to the generated - * function will be passed to the wrapped function (except for the final - * callback argument). Errors thrown will be passed to the callback. - * - * If the function passed to `asyncify` returns a Promise, that promises's - * resolved/rejected state will be used to call the callback, rather than simply - * the synchronous return value. - * - * This also means you can asyncify ES2017 `async` functions. - * - * @name asyncify - * @static - * @memberOf module:Utils - * @method - * @alias wrapSync - * @category Util - * @param {Function} func - The synchronous function, or Promise-returning - * function to convert to an {@link AsyncFunction}. - * @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be - * invoked with `(args..., callback)`. - * @example - * - * // passing a regular synchronous function - * async.waterfall([ - * async.apply(fs.readFile, filename, "utf8"), - * async.asyncify(JSON.parse), - * function (data, next) { - * // data is the result of parsing the text. - * // If there was a parsing error, it would have been caught. - * } - * ], callback); - * - * // passing a function returning a promise - * async.waterfall([ - * async.apply(fs.readFile, filename, "utf8"), - * async.asyncify(function (contents) { - * return db.model.create(contents); - * }), - * function (model, next) { - * // `model` is the instantiated model object. - * // If there was an error, this function would be skipped. - * } - * ], callback); - * - * // es2017 example, though `asyncify` is not needed if your JS environment - * // supports async functions out of the box - * var q = async.queue(async.asyncify(async function(file) { - * var intermediateStep = await processFile(file); - * return await somePromise(intermediateStep) - * })); - * - * q.push(files); - */ -function asyncify(func) { - if ((0, _wrapAsync.isAsync)(func)) { - return function (...args /*, callback*/) { - const callback = args.pop(); - const promise = func.apply(this, args); - return handlePromise(promise, callback); - }; - } - - return (0, _initialParams2.default)(function (args, callback) { - var result; - try { - result = func.apply(this, args); - } catch (e) { - return callback(e); - } - // if result is Promise object - if (result && typeof result.then === 'function') { - return handlePromise(result, callback); - } else { - callback(null, result); - } - }); -} - -function handlePromise(promise, callback) { - return promise.then(value => { - invokeCallback(callback, null, value); - }, err => { - invokeCallback(callback, err && err.message ? err : new Error(err)); - }); -} - -function invokeCallback(callback, error, value) { - try { - callback(error, value); - } catch (err) { - (0, _setImmediate2.default)(e => { - throw e; - }, err); - } -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/auto.js b/node_modules/async/auto.js deleted file mode 100644 index c4a85d4..0000000 --- a/node_modules/async/auto.js +++ /dev/null @@ -1,333 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = auto; - -var _once = require('./internal/once.js'); - -var _once2 = _interopRequireDefault(_once); - -var _onlyOnce = require('./internal/onlyOnce.js'); - -var _onlyOnce2 = _interopRequireDefault(_onlyOnce); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _promiseCallback = require('./internal/promiseCallback.js'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Determines the best order for running the {@link AsyncFunction}s in `tasks`, based on - * their requirements. Each function can optionally depend on other functions - * being completed first, and each function is run as soon as its requirements - * are satisfied. - * - * If any of the {@link AsyncFunction}s pass an error to their callback, the `auto` sequence - * will stop. Further tasks will not execute (so any other functions depending - * on it will not run), and the main `callback` is immediately called with the - * error. - * - * {@link AsyncFunction}s also receive an object containing the results of functions which - * have completed so far as the first argument, if they have dependencies. If a - * task function has no dependencies, it will only be passed a callback. - * - * @name auto - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Object} tasks - An object. Each of its properties is either a - * function or an array of requirements, with the {@link AsyncFunction} itself the last item - * in the array. The object's key of a property serves as the name of the task - * defined by that property, i.e. can be used when specifying requirements for - * other tasks. The function receives one or two arguments: - * * a `results` object, containing the results of the previously executed - * functions, only passed if the task has any dependencies, - * * a `callback(err, result)` function, which must be called when finished, - * passing an `error` (which can be `null`) and the result of the function's - * execution. - * @param {number} [concurrency=Infinity] - An optional `integer` for - * determining the maximum number of tasks that can be run in parallel. By - * default, as many as possible. - * @param {Function} [callback] - An optional callback which is called when all - * the tasks have been completed. It receives the `err` argument if any `tasks` - * pass an error to their callback. Results are always returned; however, if an - * error occurs, no further `tasks` will be performed, and the results object - * will only contain partial results. Invoked with (err, results). - * @returns {Promise} a promise, if a callback is not passed - * @example - * - * //Using Callbacks - * async.auto({ - * get_data: function(callback) { - * // async code to get some data - * callback(null, 'data', 'converted to array'); - * }, - * make_folder: function(callback) { - * // async code to create a directory to store a file in - * // this is run at the same time as getting the data - * callback(null, 'folder'); - * }, - * write_file: ['get_data', 'make_folder', function(results, callback) { - * // once there is some data and the directory exists, - * // write the data to a file in the directory - * callback(null, 'filename'); - * }], - * email_link: ['write_file', function(results, callback) { - * // once the file is written let's email a link to it... - * callback(null, {'file':results.write_file, 'email':'user@example.com'}); - * }] - * }, function(err, results) { - * if (err) { - * console.log('err = ', err); - * } - * console.log('results = ', results); - * // results = { - * // get_data: ['data', 'converted to array'] - * // make_folder; 'folder', - * // write_file: 'filename' - * // email_link: { file: 'filename', email: 'user@example.com' } - * // } - * }); - * - * //Using Promises - * async.auto({ - * get_data: function(callback) { - * console.log('in get_data'); - * // async code to get some data - * callback(null, 'data', 'converted to array'); - * }, - * make_folder: function(callback) { - * console.log('in make_folder'); - * // async code to create a directory to store a file in - * // this is run at the same time as getting the data - * callback(null, 'folder'); - * }, - * write_file: ['get_data', 'make_folder', function(results, callback) { - * // once there is some data and the directory exists, - * // write the data to a file in the directory - * callback(null, 'filename'); - * }], - * email_link: ['write_file', function(results, callback) { - * // once the file is written let's email a link to it... - * callback(null, {'file':results.write_file, 'email':'user@example.com'}); - * }] - * }).then(results => { - * console.log('results = ', results); - * // results = { - * // get_data: ['data', 'converted to array'] - * // make_folder; 'folder', - * // write_file: 'filename' - * // email_link: { file: 'filename', email: 'user@example.com' } - * // } - * }).catch(err => { - * console.log('err = ', err); - * }); - * - * //Using async/await - * async () => { - * try { - * let results = await async.auto({ - * get_data: function(callback) { - * // async code to get some data - * callback(null, 'data', 'converted to array'); - * }, - * make_folder: function(callback) { - * // async code to create a directory to store a file in - * // this is run at the same time as getting the data - * callback(null, 'folder'); - * }, - * write_file: ['get_data', 'make_folder', function(results, callback) { - * // once there is some data and the directory exists, - * // write the data to a file in the directory - * callback(null, 'filename'); - * }], - * email_link: ['write_file', function(results, callback) { - * // once the file is written let's email a link to it... - * callback(null, {'file':results.write_file, 'email':'user@example.com'}); - * }] - * }); - * console.log('results = ', results); - * // results = { - * // get_data: ['data', 'converted to array'] - * // make_folder; 'folder', - * // write_file: 'filename' - * // email_link: { file: 'filename', email: 'user@example.com' } - * // } - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function auto(tasks, concurrency, callback) { - if (typeof concurrency !== 'number') { - // concurrency is optional, shift the args. - callback = concurrency; - concurrency = null; - } - callback = (0, _once2.default)(callback || (0, _promiseCallback.promiseCallback)()); - var numTasks = Object.keys(tasks).length; - if (!numTasks) { - return callback(null); - } - if (!concurrency) { - concurrency = numTasks; - } - - var results = {}; - var runningTasks = 0; - var canceled = false; - var hasError = false; - - var listeners = Object.create(null); - - var readyTasks = []; - - // for cycle detection: - var readyToCheck = []; // tasks that have been identified as reachable - // without the possibility of returning to an ancestor task - var uncheckedDependencies = {}; - - Object.keys(tasks).forEach(key => { - var task = tasks[key]; - if (!Array.isArray(task)) { - // no dependencies - enqueueTask(key, [task]); - readyToCheck.push(key); - return; - } - - var dependencies = task.slice(0, task.length - 1); - var remainingDependencies = dependencies.length; - if (remainingDependencies === 0) { - enqueueTask(key, task); - readyToCheck.push(key); - return; - } - uncheckedDependencies[key] = remainingDependencies; - - dependencies.forEach(dependencyName => { - if (!tasks[dependencyName]) { - throw new Error('async.auto task `' + key + '` has a non-existent dependency `' + dependencyName + '` in ' + dependencies.join(', ')); - } - addListener(dependencyName, () => { - remainingDependencies--; - if (remainingDependencies === 0) { - enqueueTask(key, task); - } - }); - }); - }); - - checkForDeadlocks(); - processQueue(); - - function enqueueTask(key, task) { - readyTasks.push(() => runTask(key, task)); - } - - function processQueue() { - if (canceled) return; - if (readyTasks.length === 0 && runningTasks === 0) { - return callback(null, results); - } - while (readyTasks.length && runningTasks < concurrency) { - var run = readyTasks.shift(); - run(); - } - } - - function addListener(taskName, fn) { - var taskListeners = listeners[taskName]; - if (!taskListeners) { - taskListeners = listeners[taskName] = []; - } - - taskListeners.push(fn); - } - - function taskComplete(taskName) { - var taskListeners = listeners[taskName] || []; - taskListeners.forEach(fn => fn()); - processQueue(); - } - - function runTask(key, task) { - if (hasError) return; - - var taskCallback = (0, _onlyOnce2.default)((err, ...result) => { - runningTasks--; - if (err === false) { - canceled = true; - return; - } - if (result.length < 2) { - [result] = result; - } - if (err) { - var safeResults = {}; - Object.keys(results).forEach(rkey => { - safeResults[rkey] = results[rkey]; - }); - safeResults[key] = result; - hasError = true; - listeners = Object.create(null); - if (canceled) return; - callback(err, safeResults); - } else { - results[key] = result; - taskComplete(key); - } - }); - - runningTasks++; - var taskFn = (0, _wrapAsync2.default)(task[task.length - 1]); - if (task.length > 1) { - taskFn(results, taskCallback); - } else { - taskFn(taskCallback); - } - } - - function checkForDeadlocks() { - // Kahn's algorithm - // https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm - // http://connalle.blogspot.com/2013/10/topological-sortingkahn-algorithm.html - var currentTask; - var counter = 0; - while (readyToCheck.length) { - currentTask = readyToCheck.pop(); - counter++; - getDependents(currentTask).forEach(dependent => { - if (--uncheckedDependencies[dependent] === 0) { - readyToCheck.push(dependent); - } - }); - } - - if (counter !== numTasks) { - throw new Error('async.auto cannot execute tasks due to a recursive dependency'); - } - } - - function getDependents(taskName) { - var result = []; - Object.keys(tasks).forEach(key => { - const task = tasks[key]; - if (Array.isArray(task) && task.indexOf(taskName) >= 0) { - result.push(key); - } - }); - return result; - } - - return callback[_promiseCallback.PROMISE_SYMBOL]; -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/autoInject.js b/node_modules/async/autoInject.js deleted file mode 100644 index 393baad..0000000 --- a/node_modules/async/autoInject.js +++ /dev/null @@ -1,182 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = autoInject; - -var _auto = require('./auto.js'); - -var _auto2 = _interopRequireDefault(_auto); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var FN_ARGS = /^(?:async\s+)?(?:function)?\s*\w*\s*\(\s*([^)]+)\s*\)(?:\s*{)/; -var ARROW_FN_ARGS = /^(?:async\s+)?\(?\s*([^)=]+)\s*\)?(?:\s*=>)/; -var FN_ARG_SPLIT = /,/; -var FN_ARG = /(=.+)?(\s*)$/; - -function stripComments(string) { - let stripped = ''; - let index = 0; - let endBlockComment = string.indexOf('*/'); - while (index < string.length) { - if (string[index] === '/' && string[index + 1] === '/') { - // inline comment - let endIndex = string.indexOf('\n', index); - index = endIndex === -1 ? string.length : endIndex; - } else if (endBlockComment !== -1 && string[index] === '/' && string[index + 1] === '*') { - // block comment - let endIndex = string.indexOf('*/', index); - if (endIndex !== -1) { - index = endIndex + 2; - endBlockComment = string.indexOf('*/', index); - } else { - stripped += string[index]; - index++; - } - } else { - stripped += string[index]; - index++; - } - } - return stripped; -} - -function parseParams(func) { - const src = stripComments(func.toString()); - let match = src.match(FN_ARGS); - if (!match) { - match = src.match(ARROW_FN_ARGS); - } - if (!match) throw new Error('could not parse args in autoInject\nSource:\n' + src); - let [, args] = match; - return args.replace(/\s/g, '').split(FN_ARG_SPLIT).map(arg => arg.replace(FN_ARG, '').trim()); -} - -/** - * A dependency-injected version of the [async.auto]{@link module:ControlFlow.auto} function. Dependent - * tasks are specified as parameters to the function, after the usual callback - * parameter, with the parameter names matching the names of the tasks it - * depends on. This can provide even more readable task graphs which can be - * easier to maintain. - * - * If a final callback is specified, the task results are similarly injected, - * specified as named parameters after the initial error parameter. - * - * The autoInject function is purely syntactic sugar and its semantics are - * otherwise equivalent to [async.auto]{@link module:ControlFlow.auto}. - * - * @name autoInject - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.auto]{@link module:ControlFlow.auto} - * @category Control Flow - * @param {Object} tasks - An object, each of whose properties is an {@link AsyncFunction} of - * the form 'func([dependencies...], callback). The object's key of a property - * serves as the name of the task defined by that property, i.e. can be used - * when specifying requirements for other tasks. - * * The `callback` parameter is a `callback(err, result)` which must be called - * when finished, passing an `error` (which can be `null`) and the result of - * the function's execution. The remaining parameters name other tasks on - * which the task is dependent, and the results from those tasks are the - * arguments of those parameters. - * @param {Function} [callback] - An optional callback which is called when all - * the tasks have been completed. It receives the `err` argument if any `tasks` - * pass an error to their callback, and a `results` object with any completed - * task results, similar to `auto`. - * @returns {Promise} a promise, if no callback is passed - * @example - * - * // The example from `auto` can be rewritten as follows: - * async.autoInject({ - * get_data: function(callback) { - * // async code to get some data - * callback(null, 'data', 'converted to array'); - * }, - * make_folder: function(callback) { - * // async code to create a directory to store a file in - * // this is run at the same time as getting the data - * callback(null, 'folder'); - * }, - * write_file: function(get_data, make_folder, callback) { - * // once there is some data and the directory exists, - * // write the data to a file in the directory - * callback(null, 'filename'); - * }, - * email_link: function(write_file, callback) { - * // once the file is written let's email a link to it... - * // write_file contains the filename returned by write_file. - * callback(null, {'file':write_file, 'email':'user@example.com'}); - * } - * }, function(err, results) { - * console.log('err = ', err); - * console.log('email_link = ', results.email_link); - * }); - * - * // If you are using a JS minifier that mangles parameter names, `autoInject` - * // will not work with plain functions, since the parameter names will be - * // collapsed to a single letter identifier. To work around this, you can - * // explicitly specify the names of the parameters your task function needs - * // in an array, similar to Angular.js dependency injection. - * - * // This still has an advantage over plain `auto`, since the results a task - * // depends on are still spread into arguments. - * async.autoInject({ - * //... - * write_file: ['get_data', 'make_folder', function(get_data, make_folder, callback) { - * callback(null, 'filename'); - * }], - * email_link: ['write_file', function(write_file, callback) { - * callback(null, {'file':write_file, 'email':'user@example.com'}); - * }] - * //... - * }, function(err, results) { - * console.log('err = ', err); - * console.log('email_link = ', results.email_link); - * }); - */ -function autoInject(tasks, callback) { - var newTasks = {}; - - Object.keys(tasks).forEach(key => { - var taskFn = tasks[key]; - var params; - var fnIsAsync = (0, _wrapAsync.isAsync)(taskFn); - var hasNoDeps = !fnIsAsync && taskFn.length === 1 || fnIsAsync && taskFn.length === 0; - - if (Array.isArray(taskFn)) { - params = [...taskFn]; - taskFn = params.pop(); - - newTasks[key] = params.concat(params.length > 0 ? newTask : taskFn); - } else if (hasNoDeps) { - // no dependencies, use the function as-is - newTasks[key] = taskFn; - } else { - params = parseParams(taskFn); - if (taskFn.length === 0 && !fnIsAsync && params.length === 0) { - throw new Error("autoInject task functions require explicit parameters."); - } - - // remove callback param - if (!fnIsAsync) params.pop(); - - newTasks[key] = params.concat(newTask); - } - - function newTask(results, taskCb) { - var newArgs = params.map(name => results[name]); - newArgs.push(taskCb); - (0, _wrapAsync2.default)(taskFn)(...newArgs); - } - }); - - return (0, _auto2.default)(newTasks, callback); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/bower.json b/node_modules/async/bower.json deleted file mode 100644 index 390c650..0000000 --- a/node_modules/async/bower.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "async", - "main": "dist/async.js", - "ignore": [ - "bower_components", - "lib", - "test", - "node_modules", - "perf", - "support", - "**/.*", - "*.config.js", - "*.json", - "index.js", - "Makefile" - ] -} diff --git a/node_modules/async/cargo.js b/node_modules/async/cargo.js deleted file mode 100644 index aa385f8..0000000 --- a/node_modules/async/cargo.js +++ /dev/null @@ -1,63 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = cargo; - -var _queue = require('./internal/queue.js'); - -var _queue2 = _interopRequireDefault(_queue); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Creates a `cargo` object with the specified payload. Tasks added to the - * cargo will be processed altogether (up to the `payload` limit). If the - * `worker` is in progress, the task is queued until it becomes available. Once - * the `worker` has completed some tasks, each callback of those tasks is - * called. Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966) - * for how `cargo` and `queue` work. - * - * While [`queue`]{@link module:ControlFlow.queue} passes only one task to one of a group of workers - * at a time, cargo passes an array of tasks to a single worker, repeating - * when the worker is finished. - * - * @name cargo - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.queue]{@link module:ControlFlow.queue} - * @category Control Flow - * @param {AsyncFunction} worker - An asynchronous function for processing an array - * of queued tasks. Invoked with `(tasks, callback)`. - * @param {number} [payload=Infinity] - An optional `integer` for determining - * how many tasks should be processed per round; if omitted, the default is - * unlimited. - * @returns {module:ControlFlow.QueueObject} A cargo object to manage the tasks. Callbacks can - * attached as certain properties to listen for specific events during the - * lifecycle of the cargo and inner queue. - * @example - * - * // create a cargo object with payload 2 - * var cargo = async.cargo(function(tasks, callback) { - * for (var i=0; i { - * console.log(results); - * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] - * }).catch(err => { - * console.log(err); - * }); - * - * // Error Handling - * async.concat(withMissingDirectoryList, fs.readdir) - * .then(results => { - * console.log(results); - * }).catch(err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4 does not exist - * }); - * - * // Using async/await - * async () => { - * try { - * let results = await async.concat(directoryList, fs.readdir); - * console.log(results); - * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] - * } catch (err) { - * console.log(err); - * } - * } - * - * // Error Handling - * async () => { - * try { - * let results = await async.concat(withMissingDirectoryList, fs.readdir); - * console.log(results); - * } catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4 does not exist - * } - * } - * - */ -function concat(coll, iteratee, callback) { - return (0, _concatLimit2.default)(coll, Infinity, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(concat, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/concatLimit.js b/node_modules/async/concatLimit.js deleted file mode 100644 index 3d170f1..0000000 --- a/node_modules/async/concatLimit.js +++ /dev/null @@ -1,60 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _mapLimit = require('./mapLimit.js'); - -var _mapLimit2 = _interopRequireDefault(_mapLimit); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`concat`]{@link module:Collections.concat} but runs a maximum of `limit` async operations at a time. - * - * @name concatLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.concat]{@link module:Collections.concat} - * @category Collection - * @alias flatMapLimit - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`, - * which should use an array as its result. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished, or an error occurs. Results is an array - * containing the concatenated results of the `iteratee` function. Invoked with - * (err, results). - * @returns A Promise, if no callback is passed - */ -function concatLimit(coll, limit, iteratee, callback) { - var _iteratee = (0, _wrapAsync2.default)(iteratee); - return (0, _mapLimit2.default)(coll, limit, (val, iterCb) => { - _iteratee(val, (err, ...args) => { - if (err) return iterCb(err); - return iterCb(err, args); - }); - }, (err, mapResults) => { - var result = []; - for (var i = 0; i < mapResults.length; i++) { - if (mapResults[i]) { - result = result.concat(...mapResults[i]); - } - } - - return callback(err, result); - }); -} -exports.default = (0, _awaitify2.default)(concatLimit, 4); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/concatSeries.js b/node_modules/async/concatSeries.js deleted file mode 100644 index 84add3b..0000000 --- a/node_modules/async/concatSeries.js +++ /dev/null @@ -1,41 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _concatLimit = require('./concatLimit.js'); - -var _concatLimit2 = _interopRequireDefault(_concatLimit); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`concat`]{@link module:Collections.concat} but runs only a single async operation at a time. - * - * @name concatSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.concat]{@link module:Collections.concat} - * @category Collection - * @alias flatMapSeries - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`. - * The iteratee should complete with an array an array of results. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished, or an error occurs. Results is an array - * containing the concatenated results of the `iteratee` function. Invoked with - * (err, results). - * @returns A Promise, if no callback is passed - */ -function concatSeries(coll, iteratee, callback) { - return (0, _concatLimit2.default)(coll, 1, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(concatSeries, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/constant.js b/node_modules/async/constant.js deleted file mode 100644 index 0759653..0000000 --- a/node_modules/async/constant.js +++ /dev/null @@ -1,55 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -exports.default = function (...args) { - return function (...ignoredArgs /*, callback*/) { - var callback = ignoredArgs.pop(); - return callback(null, ...args); - }; -}; - -module.exports = exports["default"]; /** - * Returns a function that when called, calls-back with the values provided. - * Useful as the first function in a [`waterfall`]{@link module:ControlFlow.waterfall}, or for plugging values in to - * [`auto`]{@link module:ControlFlow.auto}. - * - * @name constant - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {...*} arguments... - Any number of arguments to automatically invoke - * callback with. - * @returns {AsyncFunction} Returns a function that when invoked, automatically - * invokes the callback with the previous given arguments. - * @example - * - * async.waterfall([ - * async.constant(42), - * function (value, next) { - * // value === 42 - * }, - * //... - * ], callback); - * - * async.waterfall([ - * async.constant(filename, "utf8"), - * fs.readFile, - * function (fileData, next) { - * //... - * } - * //... - * ], callback); - * - * async.auto({ - * hostname: async.constant("https://server.net/"), - * port: findFreePort, - * launchServer: ["hostname", "port", function (options, cb) { - * startServer(options, cb); - * }], - * //... - * }, callback); - */ \ No newline at end of file diff --git a/node_modules/async/detect.js b/node_modules/async/detect.js deleted file mode 100644 index 05b2e5c..0000000 --- a/node_modules/async/detect.js +++ /dev/null @@ -1,96 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createTester = require('./internal/createTester.js'); - -var _createTester2 = _interopRequireDefault(_createTester); - -var _eachOf = require('./eachOf.js'); - -var _eachOf2 = _interopRequireDefault(_eachOf); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Returns the first value in `coll` that passes an async truth test. The - * `iteratee` is applied in parallel, meaning the first iteratee to return - * `true` will fire the detect `callback` with that result. That means the - * result might not be the first item in the original `coll` (in terms of order) - * that passes the test. - - * If order within the original `coll` is important, then look at - * [`detectSeries`]{@link module:Collections.detectSeries}. - * - * @name detect - * @static - * @memberOf module:Collections - * @method - * @alias find - * @category Collections - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. - * The iteratee must complete with a boolean value as its result. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the `iteratee` functions have finished. - * Result will be the first item in the array that passes the truth test - * (iteratee) or the value `undefined` if none passed. Invoked with - * (err, result). - * @returns {Promise} a promise, if a callback is omitted - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * - * // asynchronous function that checks if a file exists - * function fileExists(file, callback) { - * fs.access(file, fs.constants.F_OK, (err) => { - * callback(null, !err); - * }); - * } - * - * async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists, - * function(err, result) { - * console.log(result); - * // dir1/file1.txt - * // result now equals the first file in the list that exists - * } - *); - * - * // Using Promises - * async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists) - * .then(result => { - * console.log(result); - * // dir1/file1.txt - * // result now equals the first file in the list that exists - * }).catch(err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists); - * console.log(result); - * // dir1/file1.txt - * // result now equals the file in the list that exists - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function detect(coll, iteratee, callback) { - return (0, _createTester2.default)(bool => bool, (res, item) => item)(_eachOf2.default, coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(detect, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/detectLimit.js b/node_modules/async/detectLimit.js deleted file mode 100644 index db6961e..0000000 --- a/node_modules/async/detectLimit.js +++ /dev/null @@ -1,48 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createTester = require('./internal/createTester.js'); - -var _createTester2 = _interopRequireDefault(_createTester); - -var _eachOfLimit = require('./internal/eachOfLimit.js'); - -var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`detect`]{@link module:Collections.detect} but runs a maximum of `limit` async operations at a - * time. - * - * @name detectLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.detect]{@link module:Collections.detect} - * @alias findLimit - * @category Collections - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. - * The iteratee must complete with a boolean value as its result. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the `iteratee` functions have finished. - * Result will be the first item in the array that passes the truth test - * (iteratee) or the value `undefined` if none passed. Invoked with - * (err, result). - * @returns {Promise} a promise, if a callback is omitted - */ -function detectLimit(coll, limit, iteratee, callback) { - return (0, _createTester2.default)(bool => bool, (res, item) => item)((0, _eachOfLimit2.default)(limit), coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(detectLimit, 4); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/detectSeries.js b/node_modules/async/detectSeries.js deleted file mode 100644 index b9131b4..0000000 --- a/node_modules/async/detectSeries.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createTester = require('./internal/createTester.js'); - -var _createTester2 = _interopRequireDefault(_createTester); - -var _eachOfLimit = require('./internal/eachOfLimit.js'); - -var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`detect`]{@link module:Collections.detect} but runs only a single async operation at a time. - * - * @name detectSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.detect]{@link module:Collections.detect} - * @alias findSeries - * @category Collections - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. - * The iteratee must complete with a boolean value as its result. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the `iteratee` functions have finished. - * Result will be the first item in the array that passes the truth test - * (iteratee) or the value `undefined` if none passed. Invoked with - * (err, result). - * @returns {Promise} a promise, if a callback is omitted - */ -function detectSeries(coll, iteratee, callback) { - return (0, _createTester2.default)(bool => bool, (res, item) => item)((0, _eachOfLimit2.default)(1), coll, iteratee, callback); -} - -exports.default = (0, _awaitify2.default)(detectSeries, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/dir.js b/node_modules/async/dir.js deleted file mode 100644 index 950d0a2..0000000 --- a/node_modules/async/dir.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _consoleFunc = require('./internal/consoleFunc.js'); - -var _consoleFunc2 = _interopRequireDefault(_consoleFunc); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Logs the result of an [`async` function]{@link AsyncFunction} to the - * `console` using `console.dir` to display the properties of the resulting object. - * Only works in Node.js or in browsers that support `console.dir` and - * `console.error` (such as FF and Chrome). - * If multiple arguments are returned from the async function, - * `console.dir` is called on each argument in order. - * - * @name dir - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} function - The function you want to eventually apply - * all arguments to. - * @param {...*} arguments... - Any number of arguments to apply to the function. - * @example - * - * // in a module - * var hello = function(name, callback) { - * setTimeout(function() { - * callback(null, {hello: name}); - * }, 1000); - * }; - * - * // in the node repl - * node> async.dir(hello, 'world'); - * {hello: 'world'} - */ -exports.default = (0, _consoleFunc2.default)('dir'); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/dist/async.js b/node_modules/async/dist/async.js deleted file mode 100644 index 8d5e782..0000000 --- a/node_modules/async/dist/async.js +++ /dev/null @@ -1,6059 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : - typeof define === 'function' && define.amd ? define(['exports'], factory) : - (factory((global.async = {}))); -}(this, (function (exports) { 'use strict'; - - /** - * Creates a continuation function with some arguments already applied. - * - * Useful as a shorthand when combined with other control flow functions. Any - * arguments passed to the returned function are added to the arguments - * originally passed to apply. - * - * @name apply - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {Function} fn - The function you want to eventually apply all - * arguments to. Invokes with (arguments...). - * @param {...*} arguments... - Any number of arguments to automatically apply - * when the continuation is called. - * @returns {Function} the partially-applied function - * @example - * - * // using apply - * async.parallel([ - * async.apply(fs.writeFile, 'testfile1', 'test1'), - * async.apply(fs.writeFile, 'testfile2', 'test2') - * ]); - * - * - * // the same process without using apply - * async.parallel([ - * function(callback) { - * fs.writeFile('testfile1', 'test1', callback); - * }, - * function(callback) { - * fs.writeFile('testfile2', 'test2', callback); - * } - * ]); - * - * // It's possible to pass any number of additional arguments when calling the - * // continuation: - * - * node> var fn = async.apply(sys.puts, 'one'); - * node> fn('two', 'three'); - * one - * two - * three - */ - function apply(fn, ...args) { - return (...callArgs) => fn(...args,...callArgs); - } - - function initialParams (fn) { - return function (...args/*, callback*/) { - var callback = args.pop(); - return fn.call(this, args, callback); - }; - } - - /* istanbul ignore file */ - - var hasQueueMicrotask = typeof queueMicrotask === 'function' && queueMicrotask; - var hasSetImmediate = typeof setImmediate === 'function' && setImmediate; - var hasNextTick = typeof process === 'object' && typeof process.nextTick === 'function'; - - function fallback(fn) { - setTimeout(fn, 0); - } - - function wrap(defer) { - return (fn, ...args) => defer(() => fn(...args)); - } - - var _defer; - - if (hasQueueMicrotask) { - _defer = queueMicrotask; - } else if (hasSetImmediate) { - _defer = setImmediate; - } else if (hasNextTick) { - _defer = process.nextTick; - } else { - _defer = fallback; - } - - var setImmediate$1 = wrap(_defer); - - /** - * Take a sync function and make it async, passing its return value to a - * callback. This is useful for plugging sync functions into a waterfall, - * series, or other async functions. Any arguments passed to the generated - * function will be passed to the wrapped function (except for the final - * callback argument). Errors thrown will be passed to the callback. - * - * If the function passed to `asyncify` returns a Promise, that promises's - * resolved/rejected state will be used to call the callback, rather than simply - * the synchronous return value. - * - * This also means you can asyncify ES2017 `async` functions. - * - * @name asyncify - * @static - * @memberOf module:Utils - * @method - * @alias wrapSync - * @category Util - * @param {Function} func - The synchronous function, or Promise-returning - * function to convert to an {@link AsyncFunction}. - * @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be - * invoked with `(args..., callback)`. - * @example - * - * // passing a regular synchronous function - * async.waterfall([ - * async.apply(fs.readFile, filename, "utf8"), - * async.asyncify(JSON.parse), - * function (data, next) { - * // data is the result of parsing the text. - * // If there was a parsing error, it would have been caught. - * } - * ], callback); - * - * // passing a function returning a promise - * async.waterfall([ - * async.apply(fs.readFile, filename, "utf8"), - * async.asyncify(function (contents) { - * return db.model.create(contents); - * }), - * function (model, next) { - * // `model` is the instantiated model object. - * // If there was an error, this function would be skipped. - * } - * ], callback); - * - * // es2017 example, though `asyncify` is not needed if your JS environment - * // supports async functions out of the box - * var q = async.queue(async.asyncify(async function(file) { - * var intermediateStep = await processFile(file); - * return await somePromise(intermediateStep) - * })); - * - * q.push(files); - */ - function asyncify(func) { - if (isAsync(func)) { - return function (...args/*, callback*/) { - const callback = args.pop(); - const promise = func.apply(this, args); - return handlePromise(promise, callback) - } - } - - return initialParams(function (args, callback) { - var result; - try { - result = func.apply(this, args); - } catch (e) { - return callback(e); - } - // if result is Promise object - if (result && typeof result.then === 'function') { - return handlePromise(result, callback) - } else { - callback(null, result); - } - }); - } - - function handlePromise(promise, callback) { - return promise.then(value => { - invokeCallback(callback, null, value); - }, err => { - invokeCallback(callback, err && err.message ? err : new Error(err)); - }); - } - - function invokeCallback(callback, error, value) { - try { - callback(error, value); - } catch (err) { - setImmediate$1(e => { throw e }, err); - } - } - - function isAsync(fn) { - return fn[Symbol.toStringTag] === 'AsyncFunction'; - } - - function isAsyncGenerator(fn) { - return fn[Symbol.toStringTag] === 'AsyncGenerator'; - } - - function isAsyncIterable(obj) { - return typeof obj[Symbol.asyncIterator] === 'function'; - } - - function wrapAsync(asyncFn) { - if (typeof asyncFn !== 'function') throw new Error('expected a function') - return isAsync(asyncFn) ? asyncify(asyncFn) : asyncFn; - } - - // conditionally promisify a function. - // only return a promise if a callback is omitted - function awaitify (asyncFn, arity = asyncFn.length) { - if (!arity) throw new Error('arity is undefined') - function awaitable (...args) { - if (typeof args[arity - 1] === 'function') { - return asyncFn.apply(this, args) - } - - return new Promise((resolve, reject) => { - args[arity - 1] = (err, ...cbArgs) => { - if (err) return reject(err) - resolve(cbArgs.length > 1 ? cbArgs : cbArgs[0]); - }; - asyncFn.apply(this, args); - }) - } - - return awaitable - } - - function applyEach (eachfn) { - return function applyEach(fns, ...callArgs) { - const go = awaitify(function (callback) { - var that = this; - return eachfn(fns, (fn, cb) => { - wrapAsync(fn).apply(that, callArgs.concat(cb)); - }, callback); - }); - return go; - }; - } - - function _asyncMap(eachfn, arr, iteratee, callback) { - arr = arr || []; - var results = []; - var counter = 0; - var _iteratee = wrapAsync(iteratee); - - return eachfn(arr, (value, _, iterCb) => { - var index = counter++; - _iteratee(value, (err, v) => { - results[index] = v; - iterCb(err); - }); - }, err => { - callback(err, results); - }); - } - - function isArrayLike(value) { - return value && - typeof value.length === 'number' && - value.length >= 0 && - value.length % 1 === 0; - } - - // A temporary value used to identify if the loop should be broken. - // See #1064, #1293 - const breakLoop = {}; - - function once(fn) { - function wrapper (...args) { - if (fn === null) return; - var callFn = fn; - fn = null; - callFn.apply(this, args); - } - Object.assign(wrapper, fn); - return wrapper - } - - function getIterator (coll) { - return coll[Symbol.iterator] && coll[Symbol.iterator](); - } - - function createArrayIterator(coll) { - var i = -1; - var len = coll.length; - return function next() { - return ++i < len ? {value: coll[i], key: i} : null; - } - } - - function createES2015Iterator(iterator) { - var i = -1; - return function next() { - var item = iterator.next(); - if (item.done) - return null; - i++; - return {value: item.value, key: i}; - } - } - - function createObjectIterator(obj) { - var okeys = obj ? Object.keys(obj) : []; - var i = -1; - var len = okeys.length; - return function next() { - var key = okeys[++i]; - if (key === '__proto__') { - return next(); - } - return i < len ? {value: obj[key], key} : null; - }; - } - - function createIterator(coll) { - if (isArrayLike(coll)) { - return createArrayIterator(coll); - } - - var iterator = getIterator(coll); - return iterator ? createES2015Iterator(iterator) : createObjectIterator(coll); - } - - function onlyOnce(fn) { - return function (...args) { - if (fn === null) throw new Error("Callback was already called."); - var callFn = fn; - fn = null; - callFn.apply(this, args); - }; - } - - // for async generators - function asyncEachOfLimit(generator, limit, iteratee, callback) { - let done = false; - let canceled = false; - let awaiting = false; - let running = 0; - let idx = 0; - - function replenish() { - //console.log('replenish') - if (running >= limit || awaiting || done) return - //console.log('replenish awaiting') - awaiting = true; - generator.next().then(({value, done: iterDone}) => { - //console.log('got value', value) - if (canceled || done) return - awaiting = false; - if (iterDone) { - done = true; - if (running <= 0) { - //console.log('done nextCb') - callback(null); - } - return; - } - running++; - iteratee(value, idx, iterateeCallback); - idx++; - replenish(); - }).catch(handleError); - } - - function iterateeCallback(err, result) { - //console.log('iterateeCallback') - running -= 1; - if (canceled) return - if (err) return handleError(err) - - if (err === false) { - done = true; - canceled = true; - return - } - - if (result === breakLoop || (done && running <= 0)) { - done = true; - //console.log('done iterCb') - return callback(null); - } - replenish(); - } - - function handleError(err) { - if (canceled) return - awaiting = false; - done = true; - callback(err); - } - - replenish(); - } - - var eachOfLimit = (limit) => { - return (obj, iteratee, callback) => { - callback = once(callback); - if (limit <= 0) { - throw new RangeError('concurrency limit cannot be less than 1') - } - if (!obj) { - return callback(null); - } - if (isAsyncGenerator(obj)) { - return asyncEachOfLimit(obj, limit, iteratee, callback) - } - if (isAsyncIterable(obj)) { - return asyncEachOfLimit(obj[Symbol.asyncIterator](), limit, iteratee, callback) - } - var nextElem = createIterator(obj); - var done = false; - var canceled = false; - var running = 0; - var looping = false; - - function iterateeCallback(err, value) { - if (canceled) return - running -= 1; - if (err) { - done = true; - callback(err); - } - else if (err === false) { - done = true; - canceled = true; - } - else if (value === breakLoop || (done && running <= 0)) { - done = true; - return callback(null); - } - else if (!looping) { - replenish(); - } - } - - function replenish () { - looping = true; - while (running < limit && !done) { - var elem = nextElem(); - if (elem === null) { - done = true; - if (running <= 0) { - callback(null); - } - return; - } - running += 1; - iteratee(elem.value, elem.key, onlyOnce(iterateeCallback)); - } - looping = false; - } - - replenish(); - }; - }; - - /** - * The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a - * time. - * - * @name eachOfLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.eachOf]{@link module:Collections.eachOf} - * @alias forEachOfLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each - * item in `coll`. The `key` is the item's key, or index in the case of an - * array. - * Invoked with (item, key, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - */ - function eachOfLimit$1(coll, limit, iteratee, callback) { - return eachOfLimit(limit)(coll, wrapAsync(iteratee), callback); - } - - var eachOfLimit$2 = awaitify(eachOfLimit$1, 4); - - // eachOf implementation optimized for array-likes - function eachOfArrayLike(coll, iteratee, callback) { - callback = once(callback); - var index = 0, - completed = 0, - {length} = coll, - canceled = false; - if (length === 0) { - callback(null); - } - - function iteratorCallback(err, value) { - if (err === false) { - canceled = true; - } - if (canceled === true) return - if (err) { - callback(err); - } else if ((++completed === length) || value === breakLoop) { - callback(null); - } - } - - for (; index < length; index++) { - iteratee(coll[index], index, onlyOnce(iteratorCallback)); - } - } - - // a generic version of eachOf which can handle array, object, and iterator cases. - function eachOfGeneric (coll, iteratee, callback) { - return eachOfLimit$2(coll, Infinity, iteratee, callback); - } - - /** - * Like [`each`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument - * to the iteratee. - * - * @name eachOf - * @static - * @memberOf module:Collections - * @method - * @alias forEachOf - * @category Collection - * @see [async.each]{@link module:Collections.each} - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each - * item in `coll`. - * The `key` is the item's key, or index in the case of an array. - * Invoked with (item, key, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - * @example - * - * // dev.json is a file containing a valid json object config for dev environment - * // dev.json is a file containing a valid json object config for test environment - * // prod.json is a file containing a valid json object config for prod environment - * // invalid.json is a file with a malformed json object - * - * let configs = {}; //global variable - * let validConfigFileMap = {dev: 'dev.json', test: 'test.json', prod: 'prod.json'}; - * let invalidConfigFileMap = {dev: 'dev.json', test: 'test.json', invalid: 'invalid.json'}; - * - * // asynchronous function that reads a json file and parses the contents as json object - * function parseFile(file, key, callback) { - * fs.readFile(file, "utf8", function(err, data) { - * if (err) return calback(err); - * try { - * configs[key] = JSON.parse(data); - * } catch (e) { - * return callback(e); - * } - * callback(); - * }); - * } - * - * // Using callbacks - * async.forEachOf(validConfigFileMap, parseFile, function (err) { - * if (err) { - * console.error(err); - * } else { - * console.log(configs); - * // configs is now a map of JSON data, e.g. - * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} - * } - * }); - * - * //Error handing - * async.forEachOf(invalidConfigFileMap, parseFile, function (err) { - * if (err) { - * console.error(err); - * // JSON parse error exception - * } else { - * console.log(configs); - * } - * }); - * - * // Using Promises - * async.forEachOf(validConfigFileMap, parseFile) - * .then( () => { - * console.log(configs); - * // configs is now a map of JSON data, e.g. - * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} - * }).catch( err => { - * console.error(err); - * }); - * - * //Error handing - * async.forEachOf(invalidConfigFileMap, parseFile) - * .then( () => { - * console.log(configs); - * }).catch( err => { - * console.error(err); - * // JSON parse error exception - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.forEachOf(validConfigFileMap, parseFile); - * console.log(configs); - * // configs is now a map of JSON data, e.g. - * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} - * } - * catch (err) { - * console.log(err); - * } - * } - * - * //Error handing - * async () => { - * try { - * let result = await async.forEachOf(invalidConfigFileMap, parseFile); - * console.log(configs); - * } - * catch (err) { - * console.log(err); - * // JSON parse error exception - * } - * } - * - */ - function eachOf(coll, iteratee, callback) { - var eachOfImplementation = isArrayLike(coll) ? eachOfArrayLike : eachOfGeneric; - return eachOfImplementation(coll, wrapAsync(iteratee), callback); - } - - var eachOf$1 = awaitify(eachOf, 3); - - /** - * Produces a new collection of values by mapping each value in `coll` through - * the `iteratee` function. The `iteratee` is called with an item from `coll` - * and a callback for when it has finished processing. Each of these callbacks - * takes 2 arguments: an `error`, and the transformed item from `coll`. If - * `iteratee` passes an error to its callback, the main `callback` (for the - * `map` function) is immediately called with the error. - * - * Note, that since this function applies the `iteratee` to each item in - * parallel, there is no guarantee that the `iteratee` functions will complete - * in order. However, the results array will be in the same order as the - * original `coll`. - * - * If `map` is passed an Object, the results will be an Array. The results - * will roughly be in the order of the original Objects' keys (but this can - * vary across JavaScript engines). - * - * @name map - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with the transformed item. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Results is an Array of the - * transformed items from the `coll`. Invoked with (err, results). - * @returns {Promise} a promise, if no callback is passed - * @example - * - * // file1.txt is a file that is 1000 bytes in size - * // file2.txt is a file that is 2000 bytes in size - * // file3.txt is a file that is 3000 bytes in size - * // file4.txt does not exist - * - * const fileList = ['file1.txt','file2.txt','file3.txt']; - * const withMissingFileList = ['file1.txt','file2.txt','file4.txt']; - * - * // asynchronous function that returns the file size in bytes - * function getFileSizeInBytes(file, callback) { - * fs.stat(file, function(err, stat) { - * if (err) { - * return callback(err); - * } - * callback(null, stat.size); - * }); - * } - * - * // Using callbacks - * async.map(fileList, getFileSizeInBytes, function(err, results) { - * if (err) { - * console.log(err); - * } else { - * console.log(results); - * // results is now an array of the file size in bytes for each file, e.g. - * // [ 1000, 2000, 3000] - * } - * }); - * - * // Error Handling - * async.map(withMissingFileList, getFileSizeInBytes, function(err, results) { - * if (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } else { - * console.log(results); - * } - * }); - * - * // Using Promises - * async.map(fileList, getFileSizeInBytes) - * .then( results => { - * console.log(results); - * // results is now an array of the file size in bytes for each file, e.g. - * // [ 1000, 2000, 3000] - * }).catch( err => { - * console.log(err); - * }); - * - * // Error Handling - * async.map(withMissingFileList, getFileSizeInBytes) - * .then( results => { - * console.log(results); - * }).catch( err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * }); - * - * // Using async/await - * async () => { - * try { - * let results = await async.map(fileList, getFileSizeInBytes); - * console.log(results); - * // results is now an array of the file size in bytes for each file, e.g. - * // [ 1000, 2000, 3000] - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // Error Handling - * async () => { - * try { - * let results = await async.map(withMissingFileList, getFileSizeInBytes); - * console.log(results); - * } - * catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } - * } - * - */ - function map (coll, iteratee, callback) { - return _asyncMap(eachOf$1, coll, iteratee, callback) - } - var map$1 = awaitify(map, 3); - - /** - * Applies the provided arguments to each function in the array, calling - * `callback` after all functions have completed. If you only provide the first - * argument, `fns`, then it will return a function which lets you pass in the - * arguments as if it were a single function call. If more arguments are - * provided, `callback` is required while `args` is still optional. The results - * for each of the applied async functions are passed to the final callback - * as an array. - * - * @name applyEach - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array|Iterable|AsyncIterable|Object} fns - A collection of {@link AsyncFunction}s - * to all call with the same arguments - * @param {...*} [args] - any number of separate arguments to pass to the - * function. - * @param {Function} [callback] - the final argument should be the callback, - * called when all functions have completed processing. - * @returns {AsyncFunction} - Returns a function that takes no args other than - * an optional callback, that is the result of applying the `args` to each - * of the functions. - * @example - * - * const appliedFn = async.applyEach([enableSearch, updateSchema], 'bucket') - * - * appliedFn((err, results) => { - * // results[0] is the results for `enableSearch` - * // results[1] is the results for `updateSchema` - * }); - * - * // partial application example: - * async.each( - * buckets, - * async (bucket) => async.applyEach([enableSearch, updateSchema], bucket)(), - * callback - * ); - */ - var applyEach$1 = applyEach(map$1); - - /** - * The same as [`eachOf`]{@link module:Collections.eachOf} but runs only a single async operation at a time. - * - * @name eachOfSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.eachOf]{@link module:Collections.eachOf} - * @alias forEachOfSeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * Invoked with (item, key, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - */ - function eachOfSeries(coll, iteratee, callback) { - return eachOfLimit$2(coll, 1, iteratee, callback) - } - var eachOfSeries$1 = awaitify(eachOfSeries, 3); - - /** - * The same as [`map`]{@link module:Collections.map} but runs only a single async operation at a time. - * - * @name mapSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.map]{@link module:Collections.map} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with the transformed item. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Results is an array of the - * transformed items from the `coll`. Invoked with (err, results). - * @returns {Promise} a promise, if no callback is passed - */ - function mapSeries (coll, iteratee, callback) { - return _asyncMap(eachOfSeries$1, coll, iteratee, callback) - } - var mapSeries$1 = awaitify(mapSeries, 3); - - /** - * The same as [`applyEach`]{@link module:ControlFlow.applyEach} but runs only a single async operation at a time. - * - * @name applyEachSeries - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.applyEach]{@link module:ControlFlow.applyEach} - * @category Control Flow - * @param {Array|Iterable|AsyncIterable|Object} fns - A collection of {@link AsyncFunction}s to all - * call with the same arguments - * @param {...*} [args] - any number of separate arguments to pass to the - * function. - * @param {Function} [callback] - the final argument should be the callback, - * called when all functions have completed processing. - * @returns {AsyncFunction} - A function, that when called, is the result of - * appling the `args` to the list of functions. It takes no args, other than - * a callback. - */ - var applyEachSeries = applyEach(mapSeries$1); - - const PROMISE_SYMBOL = Symbol('promiseCallback'); - - function promiseCallback () { - let resolve, reject; - function callback (err, ...args) { - if (err) return reject(err) - resolve(args.length > 1 ? args : args[0]); - } - - callback[PROMISE_SYMBOL] = new Promise((res, rej) => { - resolve = res, - reject = rej; - }); - - return callback - } - - /** - * Determines the best order for running the {@link AsyncFunction}s in `tasks`, based on - * their requirements. Each function can optionally depend on other functions - * being completed first, and each function is run as soon as its requirements - * are satisfied. - * - * If any of the {@link AsyncFunction}s pass an error to their callback, the `auto` sequence - * will stop. Further tasks will not execute (so any other functions depending - * on it will not run), and the main `callback` is immediately called with the - * error. - * - * {@link AsyncFunction}s also receive an object containing the results of functions which - * have completed so far as the first argument, if they have dependencies. If a - * task function has no dependencies, it will only be passed a callback. - * - * @name auto - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Object} tasks - An object. Each of its properties is either a - * function or an array of requirements, with the {@link AsyncFunction} itself the last item - * in the array. The object's key of a property serves as the name of the task - * defined by that property, i.e. can be used when specifying requirements for - * other tasks. The function receives one or two arguments: - * * a `results` object, containing the results of the previously executed - * functions, only passed if the task has any dependencies, - * * a `callback(err, result)` function, which must be called when finished, - * passing an `error` (which can be `null`) and the result of the function's - * execution. - * @param {number} [concurrency=Infinity] - An optional `integer` for - * determining the maximum number of tasks that can be run in parallel. By - * default, as many as possible. - * @param {Function} [callback] - An optional callback which is called when all - * the tasks have been completed. It receives the `err` argument if any `tasks` - * pass an error to their callback. Results are always returned; however, if an - * error occurs, no further `tasks` will be performed, and the results object - * will only contain partial results. Invoked with (err, results). - * @returns {Promise} a promise, if a callback is not passed - * @example - * - * //Using Callbacks - * async.auto({ - * get_data: function(callback) { - * // async code to get some data - * callback(null, 'data', 'converted to array'); - * }, - * make_folder: function(callback) { - * // async code to create a directory to store a file in - * // this is run at the same time as getting the data - * callback(null, 'folder'); - * }, - * write_file: ['get_data', 'make_folder', function(results, callback) { - * // once there is some data and the directory exists, - * // write the data to a file in the directory - * callback(null, 'filename'); - * }], - * email_link: ['write_file', function(results, callback) { - * // once the file is written let's email a link to it... - * callback(null, {'file':results.write_file, 'email':'user@example.com'}); - * }] - * }, function(err, results) { - * if (err) { - * console.log('err = ', err); - * } - * console.log('results = ', results); - * // results = { - * // get_data: ['data', 'converted to array'] - * // make_folder; 'folder', - * // write_file: 'filename' - * // email_link: { file: 'filename', email: 'user@example.com' } - * // } - * }); - * - * //Using Promises - * async.auto({ - * get_data: function(callback) { - * console.log('in get_data'); - * // async code to get some data - * callback(null, 'data', 'converted to array'); - * }, - * make_folder: function(callback) { - * console.log('in make_folder'); - * // async code to create a directory to store a file in - * // this is run at the same time as getting the data - * callback(null, 'folder'); - * }, - * write_file: ['get_data', 'make_folder', function(results, callback) { - * // once there is some data and the directory exists, - * // write the data to a file in the directory - * callback(null, 'filename'); - * }], - * email_link: ['write_file', function(results, callback) { - * // once the file is written let's email a link to it... - * callback(null, {'file':results.write_file, 'email':'user@example.com'}); - * }] - * }).then(results => { - * console.log('results = ', results); - * // results = { - * // get_data: ['data', 'converted to array'] - * // make_folder; 'folder', - * // write_file: 'filename' - * // email_link: { file: 'filename', email: 'user@example.com' } - * // } - * }).catch(err => { - * console.log('err = ', err); - * }); - * - * //Using async/await - * async () => { - * try { - * let results = await async.auto({ - * get_data: function(callback) { - * // async code to get some data - * callback(null, 'data', 'converted to array'); - * }, - * make_folder: function(callback) { - * // async code to create a directory to store a file in - * // this is run at the same time as getting the data - * callback(null, 'folder'); - * }, - * write_file: ['get_data', 'make_folder', function(results, callback) { - * // once there is some data and the directory exists, - * // write the data to a file in the directory - * callback(null, 'filename'); - * }], - * email_link: ['write_file', function(results, callback) { - * // once the file is written let's email a link to it... - * callback(null, {'file':results.write_file, 'email':'user@example.com'}); - * }] - * }); - * console.log('results = ', results); - * // results = { - * // get_data: ['data', 'converted to array'] - * // make_folder; 'folder', - * // write_file: 'filename' - * // email_link: { file: 'filename', email: 'user@example.com' } - * // } - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ - function auto(tasks, concurrency, callback) { - if (typeof concurrency !== 'number') { - // concurrency is optional, shift the args. - callback = concurrency; - concurrency = null; - } - callback = once(callback || promiseCallback()); - var numTasks = Object.keys(tasks).length; - if (!numTasks) { - return callback(null); - } - if (!concurrency) { - concurrency = numTasks; - } - - var results = {}; - var runningTasks = 0; - var canceled = false; - var hasError = false; - - var listeners = Object.create(null); - - var readyTasks = []; - - // for cycle detection: - var readyToCheck = []; // tasks that have been identified as reachable - // without the possibility of returning to an ancestor task - var uncheckedDependencies = {}; - - Object.keys(tasks).forEach(key => { - var task = tasks[key]; - if (!Array.isArray(task)) { - // no dependencies - enqueueTask(key, [task]); - readyToCheck.push(key); - return; - } - - var dependencies = task.slice(0, task.length - 1); - var remainingDependencies = dependencies.length; - if (remainingDependencies === 0) { - enqueueTask(key, task); - readyToCheck.push(key); - return; - } - uncheckedDependencies[key] = remainingDependencies; - - dependencies.forEach(dependencyName => { - if (!tasks[dependencyName]) { - throw new Error('async.auto task `' + key + - '` has a non-existent dependency `' + - dependencyName + '` in ' + - dependencies.join(', ')); - } - addListener(dependencyName, () => { - remainingDependencies--; - if (remainingDependencies === 0) { - enqueueTask(key, task); - } - }); - }); - }); - - checkForDeadlocks(); - processQueue(); - - function enqueueTask(key, task) { - readyTasks.push(() => runTask(key, task)); - } - - function processQueue() { - if (canceled) return - if (readyTasks.length === 0 && runningTasks === 0) { - return callback(null, results); - } - while(readyTasks.length && runningTasks < concurrency) { - var run = readyTasks.shift(); - run(); - } - - } - - function addListener(taskName, fn) { - var taskListeners = listeners[taskName]; - if (!taskListeners) { - taskListeners = listeners[taskName] = []; - } - - taskListeners.push(fn); - } - - function taskComplete(taskName) { - var taskListeners = listeners[taskName] || []; - taskListeners.forEach(fn => fn()); - processQueue(); - } - - - function runTask(key, task) { - if (hasError) return; - - var taskCallback = onlyOnce((err, ...result) => { - runningTasks--; - if (err === false) { - canceled = true; - return - } - if (result.length < 2) { - [result] = result; - } - if (err) { - var safeResults = {}; - Object.keys(results).forEach(rkey => { - safeResults[rkey] = results[rkey]; - }); - safeResults[key] = result; - hasError = true; - listeners = Object.create(null); - if (canceled) return - callback(err, safeResults); - } else { - results[key] = result; - taskComplete(key); - } - }); - - runningTasks++; - var taskFn = wrapAsync(task[task.length - 1]); - if (task.length > 1) { - taskFn(results, taskCallback); - } else { - taskFn(taskCallback); - } - } - - function checkForDeadlocks() { - // Kahn's algorithm - // https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm - // http://connalle.blogspot.com/2013/10/topological-sortingkahn-algorithm.html - var currentTask; - var counter = 0; - while (readyToCheck.length) { - currentTask = readyToCheck.pop(); - counter++; - getDependents(currentTask).forEach(dependent => { - if (--uncheckedDependencies[dependent] === 0) { - readyToCheck.push(dependent); - } - }); - } - - if (counter !== numTasks) { - throw new Error( - 'async.auto cannot execute tasks due to a recursive dependency' - ); - } - } - - function getDependents(taskName) { - var result = []; - Object.keys(tasks).forEach(key => { - const task = tasks[key]; - if (Array.isArray(task) && task.indexOf(taskName) >= 0) { - result.push(key); - } - }); - return result; - } - - return callback[PROMISE_SYMBOL] - } - - var FN_ARGS = /^(?:async\s+)?(?:function)?\s*\w*\s*\(\s*([^)]+)\s*\)(?:\s*{)/; - var ARROW_FN_ARGS = /^(?:async\s+)?\(?\s*([^)=]+)\s*\)?(?:\s*=>)/; - var FN_ARG_SPLIT = /,/; - var FN_ARG = /(=.+)?(\s*)$/; - - function stripComments(string) { - let stripped = ''; - let index = 0; - let endBlockComment = string.indexOf('*/'); - while (index < string.length) { - if (string[index] === '/' && string[index+1] === '/') { - // inline comment - let endIndex = string.indexOf('\n', index); - index = (endIndex === -1) ? string.length : endIndex; - } else if ((endBlockComment !== -1) && (string[index] === '/') && (string[index+1] === '*')) { - // block comment - let endIndex = string.indexOf('*/', index); - if (endIndex !== -1) { - index = endIndex + 2; - endBlockComment = string.indexOf('*/', index); - } else { - stripped += string[index]; - index++; - } - } else { - stripped += string[index]; - index++; - } - } - return stripped; - } - - function parseParams(func) { - const src = stripComments(func.toString()); - let match = src.match(FN_ARGS); - if (!match) { - match = src.match(ARROW_FN_ARGS); - } - if (!match) throw new Error('could not parse args in autoInject\nSource:\n' + src) - let [, args] = match; - return args - .replace(/\s/g, '') - .split(FN_ARG_SPLIT) - .map((arg) => arg.replace(FN_ARG, '').trim()); - } - - /** - * A dependency-injected version of the [async.auto]{@link module:ControlFlow.auto} function. Dependent - * tasks are specified as parameters to the function, after the usual callback - * parameter, with the parameter names matching the names of the tasks it - * depends on. This can provide even more readable task graphs which can be - * easier to maintain. - * - * If a final callback is specified, the task results are similarly injected, - * specified as named parameters after the initial error parameter. - * - * The autoInject function is purely syntactic sugar and its semantics are - * otherwise equivalent to [async.auto]{@link module:ControlFlow.auto}. - * - * @name autoInject - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.auto]{@link module:ControlFlow.auto} - * @category Control Flow - * @param {Object} tasks - An object, each of whose properties is an {@link AsyncFunction} of - * the form 'func([dependencies...], callback). The object's key of a property - * serves as the name of the task defined by that property, i.e. can be used - * when specifying requirements for other tasks. - * * The `callback` parameter is a `callback(err, result)` which must be called - * when finished, passing an `error` (which can be `null`) and the result of - * the function's execution. The remaining parameters name other tasks on - * which the task is dependent, and the results from those tasks are the - * arguments of those parameters. - * @param {Function} [callback] - An optional callback which is called when all - * the tasks have been completed. It receives the `err` argument if any `tasks` - * pass an error to their callback, and a `results` object with any completed - * task results, similar to `auto`. - * @returns {Promise} a promise, if no callback is passed - * @example - * - * // The example from `auto` can be rewritten as follows: - * async.autoInject({ - * get_data: function(callback) { - * // async code to get some data - * callback(null, 'data', 'converted to array'); - * }, - * make_folder: function(callback) { - * // async code to create a directory to store a file in - * // this is run at the same time as getting the data - * callback(null, 'folder'); - * }, - * write_file: function(get_data, make_folder, callback) { - * // once there is some data and the directory exists, - * // write the data to a file in the directory - * callback(null, 'filename'); - * }, - * email_link: function(write_file, callback) { - * // once the file is written let's email a link to it... - * // write_file contains the filename returned by write_file. - * callback(null, {'file':write_file, 'email':'user@example.com'}); - * } - * }, function(err, results) { - * console.log('err = ', err); - * console.log('email_link = ', results.email_link); - * }); - * - * // If you are using a JS minifier that mangles parameter names, `autoInject` - * // will not work with plain functions, since the parameter names will be - * // collapsed to a single letter identifier. To work around this, you can - * // explicitly specify the names of the parameters your task function needs - * // in an array, similar to Angular.js dependency injection. - * - * // This still has an advantage over plain `auto`, since the results a task - * // depends on are still spread into arguments. - * async.autoInject({ - * //... - * write_file: ['get_data', 'make_folder', function(get_data, make_folder, callback) { - * callback(null, 'filename'); - * }], - * email_link: ['write_file', function(write_file, callback) { - * callback(null, {'file':write_file, 'email':'user@example.com'}); - * }] - * //... - * }, function(err, results) { - * console.log('err = ', err); - * console.log('email_link = ', results.email_link); - * }); - */ - function autoInject(tasks, callback) { - var newTasks = {}; - - Object.keys(tasks).forEach(key => { - var taskFn = tasks[key]; - var params; - var fnIsAsync = isAsync(taskFn); - var hasNoDeps = - (!fnIsAsync && taskFn.length === 1) || - (fnIsAsync && taskFn.length === 0); - - if (Array.isArray(taskFn)) { - params = [...taskFn]; - taskFn = params.pop(); - - newTasks[key] = params.concat(params.length > 0 ? newTask : taskFn); - } else if (hasNoDeps) { - // no dependencies, use the function as-is - newTasks[key] = taskFn; - } else { - params = parseParams(taskFn); - if ((taskFn.length === 0 && !fnIsAsync) && params.length === 0) { - throw new Error("autoInject task functions require explicit parameters."); - } - - // remove callback param - if (!fnIsAsync) params.pop(); - - newTasks[key] = params.concat(newTask); - } - - function newTask(results, taskCb) { - var newArgs = params.map(name => results[name]); - newArgs.push(taskCb); - wrapAsync(taskFn)(...newArgs); - } - }); - - return auto(newTasks, callback); - } - - // Simple doubly linked list (https://en.wikipedia.org/wiki/Doubly_linked_list) implementation - // used for queues. This implementation assumes that the node provided by the user can be modified - // to adjust the next and last properties. We implement only the minimal functionality - // for queue support. - class DLL { - constructor() { - this.head = this.tail = null; - this.length = 0; - } - - removeLink(node) { - if (node.prev) node.prev.next = node.next; - else this.head = node.next; - if (node.next) node.next.prev = node.prev; - else this.tail = node.prev; - - node.prev = node.next = null; - this.length -= 1; - return node; - } - - empty () { - while(this.head) this.shift(); - return this; - } - - insertAfter(node, newNode) { - newNode.prev = node; - newNode.next = node.next; - if (node.next) node.next.prev = newNode; - else this.tail = newNode; - node.next = newNode; - this.length += 1; - } - - insertBefore(node, newNode) { - newNode.prev = node.prev; - newNode.next = node; - if (node.prev) node.prev.next = newNode; - else this.head = newNode; - node.prev = newNode; - this.length += 1; - } - - unshift(node) { - if (this.head) this.insertBefore(this.head, node); - else setInitial(this, node); - } - - push(node) { - if (this.tail) this.insertAfter(this.tail, node); - else setInitial(this, node); - } - - shift() { - return this.head && this.removeLink(this.head); - } - - pop() { - return this.tail && this.removeLink(this.tail); - } - - toArray() { - return [...this] - } - - *[Symbol.iterator] () { - var cur = this.head; - while (cur) { - yield cur.data; - cur = cur.next; - } - } - - remove (testFn) { - var curr = this.head; - while(curr) { - var {next} = curr; - if (testFn(curr)) { - this.removeLink(curr); - } - curr = next; - } - return this; - } - } - - function setInitial(dll, node) { - dll.length = 1; - dll.head = dll.tail = node; - } - - function queue(worker, concurrency, payload) { - if (concurrency == null) { - concurrency = 1; - } - else if(concurrency === 0) { - throw new RangeError('Concurrency must not be zero'); - } - - var _worker = wrapAsync(worker); - var numRunning = 0; - var workersList = []; - const events = { - error: [], - drain: [], - saturated: [], - unsaturated: [], - empty: [] - }; - - function on (event, handler) { - events[event].push(handler); - } - - function once (event, handler) { - const handleAndRemove = (...args) => { - off(event, handleAndRemove); - handler(...args); - }; - events[event].push(handleAndRemove); - } - - function off (event, handler) { - if (!event) return Object.keys(events).forEach(ev => events[ev] = []) - if (!handler) return events[event] = [] - events[event] = events[event].filter(ev => ev !== handler); - } - - function trigger (event, ...args) { - events[event].forEach(handler => handler(...args)); - } - - var processingScheduled = false; - function _insert(data, insertAtFront, rejectOnError, callback) { - if (callback != null && typeof callback !== 'function') { - throw new Error('task callback must be a function'); - } - q.started = true; - - var res, rej; - function promiseCallback (err, ...args) { - // we don't care about the error, let the global error handler - // deal with it - if (err) return rejectOnError ? rej(err) : res() - if (args.length <= 1) return res(args[0]) - res(args); - } - - var item = q._createTaskItem( - data, - rejectOnError ? promiseCallback : - (callback || promiseCallback) - ); - - if (insertAtFront) { - q._tasks.unshift(item); - } else { - q._tasks.push(item); - } - - if (!processingScheduled) { - processingScheduled = true; - setImmediate$1(() => { - processingScheduled = false; - q.process(); - }); - } - - if (rejectOnError || !callback) { - return new Promise((resolve, reject) => { - res = resolve; - rej = reject; - }) - } - } - - function _createCB(tasks) { - return function (err, ...args) { - numRunning -= 1; - - for (var i = 0, l = tasks.length; i < l; i++) { - var task = tasks[i]; - - var index = workersList.indexOf(task); - if (index === 0) { - workersList.shift(); - } else if (index > 0) { - workersList.splice(index, 1); - } - - task.callback(err, ...args); - - if (err != null) { - trigger('error', err, task.data); - } - } - - if (numRunning <= (q.concurrency - q.buffer) ) { - trigger('unsaturated'); - } - - if (q.idle()) { - trigger('drain'); - } - q.process(); - }; - } - - function _maybeDrain(data) { - if (data.length === 0 && q.idle()) { - // call drain immediately if there are no tasks - setImmediate$1(() => trigger('drain')); - return true - } - return false - } - - const eventMethod = (name) => (handler) => { - if (!handler) { - return new Promise((resolve, reject) => { - once(name, (err, data) => { - if (err) return reject(err) - resolve(data); - }); - }) - } - off(name); - on(name, handler); - - }; - - var isProcessing = false; - var q = { - _tasks: new DLL(), - _createTaskItem (data, callback) { - return { - data, - callback - }; - }, - *[Symbol.iterator] () { - yield* q._tasks[Symbol.iterator](); - }, - concurrency, - payload, - buffer: concurrency / 4, - started: false, - paused: false, - push (data, callback) { - if (Array.isArray(data)) { - if (_maybeDrain(data)) return - return data.map(datum => _insert(datum, false, false, callback)) - } - return _insert(data, false, false, callback); - }, - pushAsync (data, callback) { - if (Array.isArray(data)) { - if (_maybeDrain(data)) return - return data.map(datum => _insert(datum, false, true, callback)) - } - return _insert(data, false, true, callback); - }, - kill () { - off(); - q._tasks.empty(); - }, - unshift (data, callback) { - if (Array.isArray(data)) { - if (_maybeDrain(data)) return - return data.map(datum => _insert(datum, true, false, callback)) - } - return _insert(data, true, false, callback); - }, - unshiftAsync (data, callback) { - if (Array.isArray(data)) { - if (_maybeDrain(data)) return - return data.map(datum => _insert(datum, true, true, callback)) - } - return _insert(data, true, true, callback); - }, - remove (testFn) { - q._tasks.remove(testFn); - }, - process () { - // Avoid trying to start too many processing operations. This can occur - // when callbacks resolve synchronously (#1267). - if (isProcessing) { - return; - } - isProcessing = true; - while(!q.paused && numRunning < q.concurrency && q._tasks.length){ - var tasks = [], data = []; - var l = q._tasks.length; - if (q.payload) l = Math.min(l, q.payload); - for (var i = 0; i < l; i++) { - var node = q._tasks.shift(); - tasks.push(node); - workersList.push(node); - data.push(node.data); - } - - numRunning += 1; - - if (q._tasks.length === 0) { - trigger('empty'); - } - - if (numRunning === q.concurrency) { - trigger('saturated'); - } - - var cb = onlyOnce(_createCB(tasks)); - _worker(data, cb); - } - isProcessing = false; - }, - length () { - return q._tasks.length; - }, - running () { - return numRunning; - }, - workersList () { - return workersList; - }, - idle() { - return q._tasks.length + numRunning === 0; - }, - pause () { - q.paused = true; - }, - resume () { - if (q.paused === false) { return; } - q.paused = false; - setImmediate$1(q.process); - } - }; - // define these as fixed properties, so people get useful errors when updating - Object.defineProperties(q, { - saturated: { - writable: false, - value: eventMethod('saturated') - }, - unsaturated: { - writable: false, - value: eventMethod('unsaturated') - }, - empty: { - writable: false, - value: eventMethod('empty') - }, - drain: { - writable: false, - value: eventMethod('drain') - }, - error: { - writable: false, - value: eventMethod('error') - }, - }); - return q; - } - - /** - * Creates a `cargo` object with the specified payload. Tasks added to the - * cargo will be processed altogether (up to the `payload` limit). If the - * `worker` is in progress, the task is queued until it becomes available. Once - * the `worker` has completed some tasks, each callback of those tasks is - * called. Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966) - * for how `cargo` and `queue` work. - * - * While [`queue`]{@link module:ControlFlow.queue} passes only one task to one of a group of workers - * at a time, cargo passes an array of tasks to a single worker, repeating - * when the worker is finished. - * - * @name cargo - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.queue]{@link module:ControlFlow.queue} - * @category Control Flow - * @param {AsyncFunction} worker - An asynchronous function for processing an array - * of queued tasks. Invoked with `(tasks, callback)`. - * @param {number} [payload=Infinity] - An optional `integer` for determining - * how many tasks should be processed per round; if omitted, the default is - * unlimited. - * @returns {module:ControlFlow.QueueObject} A cargo object to manage the tasks. Callbacks can - * attached as certain properties to listen for specific events during the - * lifecycle of the cargo and inner queue. - * @example - * - * // create a cargo object with payload 2 - * var cargo = async.cargo(function(tasks, callback) { - * for (var i=0; i { - * console.log(result); - * // 6000 - * // which is the sum of the file sizes of the three files - * }).catch( err => { - * console.log(err); - * }); - * - * // Error Handling - * async.reduce(withMissingFileList, 0, getFileSizeInBytes) - * .then( result => { - * console.log(result); - * }).catch( err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.reduce(fileList, 0, getFileSizeInBytes); - * console.log(result); - * // 6000 - * // which is the sum of the file sizes of the three files - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // Error Handling - * async () => { - * try { - * let result = await async.reduce(withMissingFileList, 0, getFileSizeInBytes); - * console.log(result); - * } - * catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } - * } - * - */ - function reduce(coll, memo, iteratee, callback) { - callback = once(callback); - var _iteratee = wrapAsync(iteratee); - return eachOfSeries$1(coll, (x, i, iterCb) => { - _iteratee(memo, x, (err, v) => { - memo = v; - iterCb(err); - }); - }, err => callback(err, memo)); - } - var reduce$1 = awaitify(reduce, 4); - - /** - * Version of the compose function that is more natural to read. Each function - * consumes the return value of the previous function. It is the equivalent of - * [compose]{@link module:ControlFlow.compose} with the arguments reversed. - * - * Each function is executed with the `this` binding of the composed function. - * - * @name seq - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.compose]{@link module:ControlFlow.compose} - * @category Control Flow - * @param {...AsyncFunction} functions - the asynchronous functions to compose - * @returns {Function} a function that composes the `functions` in order - * @example - * - * // Requires lodash (or underscore), express3 and dresende's orm2. - * // Part of an app, that fetches cats of the logged user. - * // This example uses `seq` function to avoid overnesting and error - * // handling clutter. - * app.get('/cats', function(request, response) { - * var User = request.models.User; - * async.seq( - * User.get.bind(User), // 'User.get' has signature (id, callback(err, data)) - * function(user, fn) { - * user.getCats(fn); // 'getCats' has signature (callback(err, data)) - * } - * )(req.session.user_id, function (err, cats) { - * if (err) { - * console.error(err); - * response.json({ status: 'error', message: err.message }); - * } else { - * response.json({ status: 'ok', message: 'Cats found', data: cats }); - * } - * }); - * }); - */ - function seq(...functions) { - var _functions = functions.map(wrapAsync); - return function (...args) { - var that = this; - - var cb = args[args.length - 1]; - if (typeof cb == 'function') { - args.pop(); - } else { - cb = promiseCallback(); - } - - reduce$1(_functions, args, (newargs, fn, iterCb) => { - fn.apply(that, newargs.concat((err, ...nextargs) => { - iterCb(err, nextargs); - })); - }, - (err, results) => cb(err, ...results)); - - return cb[PROMISE_SYMBOL] - }; - } - - /** - * Creates a function which is a composition of the passed asynchronous - * functions. Each function consumes the return value of the function that - * follows. Composing functions `f()`, `g()`, and `h()` would produce the result - * of `f(g(h()))`, only this version uses callbacks to obtain the return values. - * - * If the last argument to the composed function is not a function, a promise - * is returned when you call it. - * - * Each function is executed with the `this` binding of the composed function. - * - * @name compose - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {...AsyncFunction} functions - the asynchronous functions to compose - * @returns {Function} an asynchronous function that is the composed - * asynchronous `functions` - * @example - * - * function add1(n, callback) { - * setTimeout(function () { - * callback(null, n + 1); - * }, 10); - * } - * - * function mul3(n, callback) { - * setTimeout(function () { - * callback(null, n * 3); - * }, 10); - * } - * - * var add1mul3 = async.compose(mul3, add1); - * add1mul3(4, function (err, result) { - * // result now equals 15 - * }); - */ - function compose(...args) { - return seq(...args.reverse()); - } - - /** - * The same as [`map`]{@link module:Collections.map} but runs a maximum of `limit` async operations at a time. - * - * @name mapLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.map]{@link module:Collections.map} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with the transformed item. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Results is an array of the - * transformed items from the `coll`. Invoked with (err, results). - * @returns {Promise} a promise, if no callback is passed - */ - function mapLimit (coll, limit, iteratee, callback) { - return _asyncMap(eachOfLimit(limit), coll, iteratee, callback) - } - var mapLimit$1 = awaitify(mapLimit, 4); - - /** - * The same as [`concat`]{@link module:Collections.concat} but runs a maximum of `limit` async operations at a time. - * - * @name concatLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.concat]{@link module:Collections.concat} - * @category Collection - * @alias flatMapLimit - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`, - * which should use an array as its result. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished, or an error occurs. Results is an array - * containing the concatenated results of the `iteratee` function. Invoked with - * (err, results). - * @returns A Promise, if no callback is passed - */ - function concatLimit(coll, limit, iteratee, callback) { - var _iteratee = wrapAsync(iteratee); - return mapLimit$1(coll, limit, (val, iterCb) => { - _iteratee(val, (err, ...args) => { - if (err) return iterCb(err); - return iterCb(err, args); - }); - }, (err, mapResults) => { - var result = []; - for (var i = 0; i < mapResults.length; i++) { - if (mapResults[i]) { - result = result.concat(...mapResults[i]); - } - } - - return callback(err, result); - }); - } - var concatLimit$1 = awaitify(concatLimit, 4); - - /** - * Applies `iteratee` to each item in `coll`, concatenating the results. Returns - * the concatenated list. The `iteratee`s are called in parallel, and the - * results are concatenated as they return. The results array will be returned in - * the original order of `coll` passed to the `iteratee` function. - * - * @name concat - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @alias flatMap - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`, - * which should use an array as its result. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished, or an error occurs. Results is an array - * containing the concatenated results of the `iteratee` function. Invoked with - * (err, results). - * @returns A Promise, if no callback is passed - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * // dir4 does not exist - * - * let directoryList = ['dir1','dir2','dir3']; - * let withMissingDirectoryList = ['dir1','dir2','dir3', 'dir4']; - * - * // Using callbacks - * async.concat(directoryList, fs.readdir, function(err, results) { - * if (err) { - * console.log(err); - * } else { - * console.log(results); - * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] - * } - * }); - * - * // Error Handling - * async.concat(withMissingDirectoryList, fs.readdir, function(err, results) { - * if (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4 does not exist - * } else { - * console.log(results); - * } - * }); - * - * // Using Promises - * async.concat(directoryList, fs.readdir) - * .then(results => { - * console.log(results); - * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] - * }).catch(err => { - * console.log(err); - * }); - * - * // Error Handling - * async.concat(withMissingDirectoryList, fs.readdir) - * .then(results => { - * console.log(results); - * }).catch(err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4 does not exist - * }); - * - * // Using async/await - * async () => { - * try { - * let results = await async.concat(directoryList, fs.readdir); - * console.log(results); - * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] - * } catch (err) { - * console.log(err); - * } - * } - * - * // Error Handling - * async () => { - * try { - * let results = await async.concat(withMissingDirectoryList, fs.readdir); - * console.log(results); - * } catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4 does not exist - * } - * } - * - */ - function concat(coll, iteratee, callback) { - return concatLimit$1(coll, Infinity, iteratee, callback) - } - var concat$1 = awaitify(concat, 3); - - /** - * The same as [`concat`]{@link module:Collections.concat} but runs only a single async operation at a time. - * - * @name concatSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.concat]{@link module:Collections.concat} - * @category Collection - * @alias flatMapSeries - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`. - * The iteratee should complete with an array an array of results. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished, or an error occurs. Results is an array - * containing the concatenated results of the `iteratee` function. Invoked with - * (err, results). - * @returns A Promise, if no callback is passed - */ - function concatSeries(coll, iteratee, callback) { - return concatLimit$1(coll, 1, iteratee, callback) - } - var concatSeries$1 = awaitify(concatSeries, 3); - - /** - * Returns a function that when called, calls-back with the values provided. - * Useful as the first function in a [`waterfall`]{@link module:ControlFlow.waterfall}, or for plugging values in to - * [`auto`]{@link module:ControlFlow.auto}. - * - * @name constant - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {...*} arguments... - Any number of arguments to automatically invoke - * callback with. - * @returns {AsyncFunction} Returns a function that when invoked, automatically - * invokes the callback with the previous given arguments. - * @example - * - * async.waterfall([ - * async.constant(42), - * function (value, next) { - * // value === 42 - * }, - * //... - * ], callback); - * - * async.waterfall([ - * async.constant(filename, "utf8"), - * fs.readFile, - * function (fileData, next) { - * //... - * } - * //... - * ], callback); - * - * async.auto({ - * hostname: async.constant("https://server.net/"), - * port: findFreePort, - * launchServer: ["hostname", "port", function (options, cb) { - * startServer(options, cb); - * }], - * //... - * }, callback); - */ - function constant(...args) { - return function (...ignoredArgs/*, callback*/) { - var callback = ignoredArgs.pop(); - return callback(null, ...args); - }; - } - - function _createTester(check, getResult) { - return (eachfn, arr, _iteratee, cb) => { - var testPassed = false; - var testResult; - const iteratee = wrapAsync(_iteratee); - eachfn(arr, (value, _, callback) => { - iteratee(value, (err, result) => { - if (err || err === false) return callback(err); - - if (check(result) && !testResult) { - testPassed = true; - testResult = getResult(true, value); - return callback(null, breakLoop); - } - callback(); - }); - }, err => { - if (err) return cb(err); - cb(null, testPassed ? testResult : getResult(false)); - }); - }; - } - - /** - * Returns the first value in `coll` that passes an async truth test. The - * `iteratee` is applied in parallel, meaning the first iteratee to return - * `true` will fire the detect `callback` with that result. That means the - * result might not be the first item in the original `coll` (in terms of order) - * that passes the test. - - * If order within the original `coll` is important, then look at - * [`detectSeries`]{@link module:Collections.detectSeries}. - * - * @name detect - * @static - * @memberOf module:Collections - * @method - * @alias find - * @category Collections - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. - * The iteratee must complete with a boolean value as its result. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the `iteratee` functions have finished. - * Result will be the first item in the array that passes the truth test - * (iteratee) or the value `undefined` if none passed. Invoked with - * (err, result). - * @returns {Promise} a promise, if a callback is omitted - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * - * // asynchronous function that checks if a file exists - * function fileExists(file, callback) { - * fs.access(file, fs.constants.F_OK, (err) => { - * callback(null, !err); - * }); - * } - * - * async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists, - * function(err, result) { - * console.log(result); - * // dir1/file1.txt - * // result now equals the first file in the list that exists - * } - *); - * - * // Using Promises - * async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists) - * .then(result => { - * console.log(result); - * // dir1/file1.txt - * // result now equals the first file in the list that exists - * }).catch(err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists); - * console.log(result); - * // dir1/file1.txt - * // result now equals the file in the list that exists - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ - function detect(coll, iteratee, callback) { - return _createTester(bool => bool, (res, item) => item)(eachOf$1, coll, iteratee, callback) - } - var detect$1 = awaitify(detect, 3); - - /** - * The same as [`detect`]{@link module:Collections.detect} but runs a maximum of `limit` async operations at a - * time. - * - * @name detectLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.detect]{@link module:Collections.detect} - * @alias findLimit - * @category Collections - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. - * The iteratee must complete with a boolean value as its result. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the `iteratee` functions have finished. - * Result will be the first item in the array that passes the truth test - * (iteratee) or the value `undefined` if none passed. Invoked with - * (err, result). - * @returns {Promise} a promise, if a callback is omitted - */ - function detectLimit(coll, limit, iteratee, callback) { - return _createTester(bool => bool, (res, item) => item)(eachOfLimit(limit), coll, iteratee, callback) - } - var detectLimit$1 = awaitify(detectLimit, 4); - - /** - * The same as [`detect`]{@link module:Collections.detect} but runs only a single async operation at a time. - * - * @name detectSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.detect]{@link module:Collections.detect} - * @alias findSeries - * @category Collections - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. - * The iteratee must complete with a boolean value as its result. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the `iteratee` functions have finished. - * Result will be the first item in the array that passes the truth test - * (iteratee) or the value `undefined` if none passed. Invoked with - * (err, result). - * @returns {Promise} a promise, if a callback is omitted - */ - function detectSeries(coll, iteratee, callback) { - return _createTester(bool => bool, (res, item) => item)(eachOfLimit(1), coll, iteratee, callback) - } - - var detectSeries$1 = awaitify(detectSeries, 3); - - function consoleFunc(name) { - return (fn, ...args) => wrapAsync(fn)(...args, (err, ...resultArgs) => { - /* istanbul ignore else */ - if (typeof console === 'object') { - /* istanbul ignore else */ - if (err) { - /* istanbul ignore else */ - if (console.error) { - console.error(err); - } - } else if (console[name]) { /* istanbul ignore else */ - resultArgs.forEach(x => console[name](x)); - } - } - }) - } - - /** - * Logs the result of an [`async` function]{@link AsyncFunction} to the - * `console` using `console.dir` to display the properties of the resulting object. - * Only works in Node.js or in browsers that support `console.dir` and - * `console.error` (such as FF and Chrome). - * If multiple arguments are returned from the async function, - * `console.dir` is called on each argument in order. - * - * @name dir - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} function - The function you want to eventually apply - * all arguments to. - * @param {...*} arguments... - Any number of arguments to apply to the function. - * @example - * - * // in a module - * var hello = function(name, callback) { - * setTimeout(function() { - * callback(null, {hello: name}); - * }, 1000); - * }; - * - * // in the node repl - * node> async.dir(hello, 'world'); - * {hello: 'world'} - */ - var dir = consoleFunc('dir'); - - /** - * The post-check version of [`whilst`]{@link module:ControlFlow.whilst}. To reflect the difference in - * the order of operations, the arguments `test` and `iteratee` are switched. - * - * `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript. - * - * @name doWhilst - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.whilst]{@link module:ControlFlow.whilst} - * @category Control Flow - * @param {AsyncFunction} iteratee - A function which is called each time `test` - * passes. Invoked with (callback). - * @param {AsyncFunction} test - asynchronous truth test to perform after each - * execution of `iteratee`. Invoked with (...args, callback), where `...args` are the - * non-error args from the previous callback of `iteratee`. - * @param {Function} [callback] - A callback which is called after the test - * function has failed and repeated execution of `iteratee` has stopped. - * `callback` will be passed an error and any arguments passed to the final - * `iteratee`'s callback. Invoked with (err, [results]); - * @returns {Promise} a promise, if no callback is passed - */ - function doWhilst(iteratee, test, callback) { - callback = onlyOnce(callback); - var _fn = wrapAsync(iteratee); - var _test = wrapAsync(test); - var results; - - function next(err, ...args) { - if (err) return callback(err); - if (err === false) return; - results = args; - _test(...args, check); - } - - function check(err, truth) { - if (err) return callback(err); - if (err === false) return; - if (!truth) return callback(null, ...results); - _fn(next); - } - - return check(null, true); - } - - var doWhilst$1 = awaitify(doWhilst, 3); - - /** - * Like ['doWhilst']{@link module:ControlFlow.doWhilst}, except the `test` is inverted. Note the - * argument ordering differs from `until`. - * - * @name doUntil - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.doWhilst]{@link module:ControlFlow.doWhilst} - * @category Control Flow - * @param {AsyncFunction} iteratee - An async function which is called each time - * `test` fails. Invoked with (callback). - * @param {AsyncFunction} test - asynchronous truth test to perform after each - * execution of `iteratee`. Invoked with (...args, callback), where `...args` are the - * non-error args from the previous callback of `iteratee` - * @param {Function} [callback] - A callback which is called after the test - * function has passed and repeated execution of `iteratee` has stopped. `callback` - * will be passed an error and any arguments passed to the final `iteratee`'s - * callback. Invoked with (err, [results]); - * @returns {Promise} a promise, if no callback is passed - */ - function doUntil(iteratee, test, callback) { - const _test = wrapAsync(test); - return doWhilst$1(iteratee, (...args) => { - const cb = args.pop(); - _test(...args, (err, truth) => cb (err, !truth)); - }, callback); - } - - function _withoutIndex(iteratee) { - return (value, index, callback) => iteratee(value, callback); - } - - /** - * Applies the function `iteratee` to each item in `coll`, in parallel. - * The `iteratee` is called with an item from the list, and a callback for when - * it has finished. If the `iteratee` passes an error to its `callback`, the - * main `callback` (for the `each` function) is immediately called with the - * error. - * - * Note, that since this function applies `iteratee` to each item in parallel, - * there is no guarantee that the iteratee functions will complete in order. - * - * @name each - * @static - * @memberOf module:Collections - * @method - * @alias forEach - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to - * each item in `coll`. Invoked with (item, callback). - * The array index is not passed to the iteratee. - * If you need the index, use `eachOf`. - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * // dir4 does not exist - * - * const fileList = [ 'dir1/file2.txt', 'dir2/file3.txt', 'dir/file5.txt']; - * const withMissingFileList = ['dir1/file1.txt', 'dir4/file2.txt']; - * - * // asynchronous function that deletes a file - * const deleteFile = function(file, callback) { - * fs.unlink(file, callback); - * }; - * - * // Using callbacks - * async.each(fileList, deleteFile, function(err) { - * if( err ) { - * console.log(err); - * } else { - * console.log('All files have been deleted successfully'); - * } - * }); - * - * // Error Handling - * async.each(withMissingFileList, deleteFile, function(err){ - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4/file2.txt does not exist - * // dir1/file1.txt could have been deleted - * }); - * - * // Using Promises - * async.each(fileList, deleteFile) - * .then( () => { - * console.log('All files have been deleted successfully'); - * }).catch( err => { - * console.log(err); - * }); - * - * // Error Handling - * async.each(fileList, deleteFile) - * .then( () => { - * console.log('All files have been deleted successfully'); - * }).catch( err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4/file2.txt does not exist - * // dir1/file1.txt could have been deleted - * }); - * - * // Using async/await - * async () => { - * try { - * await async.each(files, deleteFile); - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // Error Handling - * async () => { - * try { - * await async.each(withMissingFileList, deleteFile); - * } - * catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4/file2.txt does not exist - * // dir1/file1.txt could have been deleted - * } - * } - * - */ - function eachLimit(coll, iteratee, callback) { - return eachOf$1(coll, _withoutIndex(wrapAsync(iteratee)), callback); - } - - var each = awaitify(eachLimit, 3); - - /** - * The same as [`each`]{@link module:Collections.each} but runs a maximum of `limit` async operations at a time. - * - * @name eachLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.each]{@link module:Collections.each} - * @alias forEachLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The array index is not passed to the iteratee. - * If you need the index, use `eachOfLimit`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - */ - function eachLimit$1(coll, limit, iteratee, callback) { - return eachOfLimit(limit)(coll, _withoutIndex(wrapAsync(iteratee)), callback); - } - var eachLimit$2 = awaitify(eachLimit$1, 4); - - /** - * The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time. - * - * Note, that unlike [`each`]{@link module:Collections.each}, this function applies iteratee to each item - * in series and therefore the iteratee functions will complete in order. - - * @name eachSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.each]{@link module:Collections.each} - * @alias forEachSeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each - * item in `coll`. - * The array index is not passed to the iteratee. - * If you need the index, use `eachOfSeries`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - */ - function eachSeries(coll, iteratee, callback) { - return eachLimit$2(coll, 1, iteratee, callback) - } - var eachSeries$1 = awaitify(eachSeries, 3); - - /** - * Wrap an async function and ensure it calls its callback on a later tick of - * the event loop. If the function already calls its callback on a next tick, - * no extra deferral is added. This is useful for preventing stack overflows - * (`RangeError: Maximum call stack size exceeded`) and generally keeping - * [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony) - * contained. ES2017 `async` functions are returned as-is -- they are immune - * to Zalgo's corrupting influences, as they always resolve on a later tick. - * - * @name ensureAsync - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} fn - an async function, one that expects a node-style - * callback as its last argument. - * @returns {AsyncFunction} Returns a wrapped function with the exact same call - * signature as the function passed in. - * @example - * - * function sometimesAsync(arg, callback) { - * if (cache[arg]) { - * return callback(null, cache[arg]); // this would be synchronous!! - * } else { - * doSomeIO(arg, callback); // this IO would be asynchronous - * } - * } - * - * // this has a risk of stack overflows if many results are cached in a row - * async.mapSeries(args, sometimesAsync, done); - * - * // this will defer sometimesAsync's callback if necessary, - * // preventing stack overflows - * async.mapSeries(args, async.ensureAsync(sometimesAsync), done); - */ - function ensureAsync(fn) { - if (isAsync(fn)) return fn; - return function (...args/*, callback*/) { - var callback = args.pop(); - var sync = true; - args.push((...innerArgs) => { - if (sync) { - setImmediate$1(() => callback(...innerArgs)); - } else { - callback(...innerArgs); - } - }); - fn.apply(this, args); - sync = false; - }; - } - - /** - * Returns `true` if every element in `coll` satisfies an async test. If any - * iteratee call returns `false`, the main `callback` is immediately called. - * - * @name every - * @static - * @memberOf module:Collections - * @method - * @alias all - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collection in parallel. - * The iteratee must complete with a boolean result value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result will be either `true` or `false` - * depending on the values of the async tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * // dir4 does not exist - * - * const fileList = ['dir1/file1.txt','dir2/file3.txt','dir3/file5.txt']; - * const withMissingFileList = ['file1.txt','file2.txt','file4.txt']; - * - * // asynchronous function that checks if a file exists - * function fileExists(file, callback) { - * fs.access(file, fs.constants.F_OK, (err) => { - * callback(null, !err); - * }); - * } - * - * // Using callbacks - * async.every(fileList, fileExists, function(err, result) { - * console.log(result); - * // true - * // result is true since every file exists - * }); - * - * async.every(withMissingFileList, fileExists, function(err, result) { - * console.log(result); - * // false - * // result is false since NOT every file exists - * }); - * - * // Using Promises - * async.every(fileList, fileExists) - * .then( result => { - * console.log(result); - * // true - * // result is true since every file exists - * }).catch( err => { - * console.log(err); - * }); - * - * async.every(withMissingFileList, fileExists) - * .then( result => { - * console.log(result); - * // false - * // result is false since NOT every file exists - * }).catch( err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.every(fileList, fileExists); - * console.log(result); - * // true - * // result is true since every file exists - * } - * catch (err) { - * console.log(err); - * } - * } - * - * async () => { - * try { - * let result = await async.every(withMissingFileList, fileExists); - * console.log(result); - * // false - * // result is false since NOT every file exists - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ - function every(coll, iteratee, callback) { - return _createTester(bool => !bool, res => !res)(eachOf$1, coll, iteratee, callback) - } - var every$1 = awaitify(every, 3); - - /** - * The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time. - * - * @name everyLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.every]{@link module:Collections.every} - * @alias allLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collection in parallel. - * The iteratee must complete with a boolean result value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result will be either `true` or `false` - * depending on the values of the async tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - */ - function everyLimit(coll, limit, iteratee, callback) { - return _createTester(bool => !bool, res => !res)(eachOfLimit(limit), coll, iteratee, callback) - } - var everyLimit$1 = awaitify(everyLimit, 4); - - /** - * The same as [`every`]{@link module:Collections.every} but runs only a single async operation at a time. - * - * @name everySeries - * @static - * @memberOf module:Collections - * @method - * @see [async.every]{@link module:Collections.every} - * @alias allSeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collection in series. - * The iteratee must complete with a boolean result value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result will be either `true` or `false` - * depending on the values of the async tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - */ - function everySeries(coll, iteratee, callback) { - return _createTester(bool => !bool, res => !res)(eachOfSeries$1, coll, iteratee, callback) - } - var everySeries$1 = awaitify(everySeries, 3); - - function filterArray(eachfn, arr, iteratee, callback) { - var truthValues = new Array(arr.length); - eachfn(arr, (x, index, iterCb) => { - iteratee(x, (err, v) => { - truthValues[index] = !!v; - iterCb(err); - }); - }, err => { - if (err) return callback(err); - var results = []; - for (var i = 0; i < arr.length; i++) { - if (truthValues[i]) results.push(arr[i]); - } - callback(null, results); - }); - } - - function filterGeneric(eachfn, coll, iteratee, callback) { - var results = []; - eachfn(coll, (x, index, iterCb) => { - iteratee(x, (err, v) => { - if (err) return iterCb(err); - if (v) { - results.push({index, value: x}); - } - iterCb(err); - }); - }, err => { - if (err) return callback(err); - callback(null, results - .sort((a, b) => a.index - b.index) - .map(v => v.value)); - }); - } - - function _filter(eachfn, coll, iteratee, callback) { - var filter = isArrayLike(coll) ? filterArray : filterGeneric; - return filter(eachfn, coll, wrapAsync(iteratee), callback); - } - - /** - * Returns a new array of all the values in `coll` which pass an async truth - * test. This operation is performed in parallel, but the results array will be - * in the same order as the original. - * - * @name filter - * @static - * @memberOf module:Collections - * @method - * @alias select - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {Function} iteratee - A truth test to apply to each item in `coll`. - * The `iteratee` is passed a `callback(err, truthValue)`, which must be called - * with a boolean argument once it has completed. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @returns {Promise} a promise, if no callback provided - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * - * const files = ['dir1/file1.txt','dir2/file3.txt','dir3/file6.txt']; - * - * // asynchronous function that checks if a file exists - * function fileExists(file, callback) { - * fs.access(file, fs.constants.F_OK, (err) => { - * callback(null, !err); - * }); - * } - * - * // Using callbacks - * async.filter(files, fileExists, function(err, results) { - * if(err) { - * console.log(err); - * } else { - * console.log(results); - * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] - * // results is now an array of the existing files - * } - * }); - * - * // Using Promises - * async.filter(files, fileExists) - * .then(results => { - * console.log(results); - * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] - * // results is now an array of the existing files - * }).catch(err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let results = await async.filter(files, fileExists); - * console.log(results); - * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] - * // results is now an array of the existing files - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ - function filter (coll, iteratee, callback) { - return _filter(eachOf$1, coll, iteratee, callback) - } - var filter$1 = awaitify(filter, 3); - - /** - * The same as [`filter`]{@link module:Collections.filter} but runs a maximum of `limit` async operations at a - * time. - * - * @name filterLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.filter]{@link module:Collections.filter} - * @alias selectLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {Function} iteratee - A truth test to apply to each item in `coll`. - * The `iteratee` is passed a `callback(err, truthValue)`, which must be called - * with a boolean argument once it has completed. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @returns {Promise} a promise, if no callback provided - */ - function filterLimit (coll, limit, iteratee, callback) { - return _filter(eachOfLimit(limit), coll, iteratee, callback) - } - var filterLimit$1 = awaitify(filterLimit, 4); - - /** - * The same as [`filter`]{@link module:Collections.filter} but runs only a single async operation at a time. - * - * @name filterSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.filter]{@link module:Collections.filter} - * @alias selectSeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {Function} iteratee - A truth test to apply to each item in `coll`. - * The `iteratee` is passed a `callback(err, truthValue)`, which must be called - * with a boolean argument once it has completed. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results) - * @returns {Promise} a promise, if no callback provided - */ - function filterSeries (coll, iteratee, callback) { - return _filter(eachOfSeries$1, coll, iteratee, callback) - } - var filterSeries$1 = awaitify(filterSeries, 3); - - /** - * Calls the asynchronous function `fn` with a callback parameter that allows it - * to call itself again, in series, indefinitely. - - * If an error is passed to the callback then `errback` is called with the - * error, and execution stops, otherwise it will never be called. - * - * @name forever - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {AsyncFunction} fn - an async function to call repeatedly. - * Invoked with (next). - * @param {Function} [errback] - when `fn` passes an error to it's callback, - * this function will be called, and execution stops. Invoked with (err). - * @returns {Promise} a promise that rejects if an error occurs and an errback - * is not passed - * @example - * - * async.forever( - * function(next) { - * // next is suitable for passing to things that need a callback(err [, whatever]); - * // it will result in this function being called again. - * }, - * function(err) { - * // if next is called with a value in its first parameter, it will appear - * // in here as 'err', and execution will stop. - * } - * ); - */ - function forever(fn, errback) { - var done = onlyOnce(errback); - var task = wrapAsync(ensureAsync(fn)); - - function next(err) { - if (err) return done(err); - if (err === false) return; - task(next); - } - return next(); - } - var forever$1 = awaitify(forever, 2); - - /** - * The same as [`groupBy`]{@link module:Collections.groupBy} but runs a maximum of `limit` async operations at a time. - * - * @name groupByLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.groupBy]{@link module:Collections.groupBy} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with a `key` to group the value under. - * Invoked with (value, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Result is an `Object` whoses - * properties are arrays of values which returned the corresponding key. - * @returns {Promise} a promise, if no callback is passed - */ - function groupByLimit(coll, limit, iteratee, callback) { - var _iteratee = wrapAsync(iteratee); - return mapLimit$1(coll, limit, (val, iterCb) => { - _iteratee(val, (err, key) => { - if (err) return iterCb(err); - return iterCb(err, {key, val}); - }); - }, (err, mapResults) => { - var result = {}; - // from MDN, handle object having an `hasOwnProperty` prop - var {hasOwnProperty} = Object.prototype; - - for (var i = 0; i < mapResults.length; i++) { - if (mapResults[i]) { - var {key} = mapResults[i]; - var {val} = mapResults[i]; - - if (hasOwnProperty.call(result, key)) { - result[key].push(val); - } else { - result[key] = [val]; - } - } - } - - return callback(err, result); - }); - } - - var groupByLimit$1 = awaitify(groupByLimit, 4); - - /** - * Returns a new object, where each value corresponds to an array of items, from - * `coll`, that returned the corresponding key. That is, the keys of the object - * correspond to the values passed to the `iteratee` callback. - * - * Note: Since this function applies the `iteratee` to each item in parallel, - * there is no guarantee that the `iteratee` functions will complete in order. - * However, the values for each key in the `result` will be in the same order as - * the original `coll`. For Objects, the values will roughly be in the order of - * the original Objects' keys (but this can vary across JavaScript engines). - * - * @name groupBy - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with a `key` to group the value under. - * Invoked with (value, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Result is an `Object` whoses - * properties are arrays of values which returned the corresponding key. - * @returns {Promise} a promise, if no callback is passed - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * // dir4 does not exist - * - * const files = ['dir1/file1.txt','dir2','dir4'] - * - * // asynchronous function that detects file type as none, file, or directory - * function detectFile(file, callback) { - * fs.stat(file, function(err, stat) { - * if (err) { - * return callback(null, 'none'); - * } - * callback(null, stat.isDirectory() ? 'directory' : 'file'); - * }); - * } - * - * //Using callbacks - * async.groupBy(files, detectFile, function(err, result) { - * if(err) { - * console.log(err); - * } else { - * console.log(result); - * // { - * // file: [ 'dir1/file1.txt' ], - * // none: [ 'dir4' ], - * // directory: [ 'dir2'] - * // } - * // result is object containing the files grouped by type - * } - * }); - * - * // Using Promises - * async.groupBy(files, detectFile) - * .then( result => { - * console.log(result); - * // { - * // file: [ 'dir1/file1.txt' ], - * // none: [ 'dir4' ], - * // directory: [ 'dir2'] - * // } - * // result is object containing the files grouped by type - * }).catch( err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.groupBy(files, detectFile); - * console.log(result); - * // { - * // file: [ 'dir1/file1.txt' ], - * // none: [ 'dir4' ], - * // directory: [ 'dir2'] - * // } - * // result is object containing the files grouped by type - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ - function groupBy (coll, iteratee, callback) { - return groupByLimit$1(coll, Infinity, iteratee, callback) - } - - /** - * The same as [`groupBy`]{@link module:Collections.groupBy} but runs only a single async operation at a time. - * - * @name groupBySeries - * @static - * @memberOf module:Collections - * @method - * @see [async.groupBy]{@link module:Collections.groupBy} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with a `key` to group the value under. - * Invoked with (value, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Result is an `Object` whose - * properties are arrays of values which returned the corresponding key. - * @returns {Promise} a promise, if no callback is passed - */ - function groupBySeries (coll, iteratee, callback) { - return groupByLimit$1(coll, 1, iteratee, callback) - } - - /** - * Logs the result of an `async` function to the `console`. Only works in - * Node.js or in browsers that support `console.log` and `console.error` (such - * as FF and Chrome). If multiple arguments are returned from the async - * function, `console.log` is called on each argument in order. - * - * @name log - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} function - The function you want to eventually apply - * all arguments to. - * @param {...*} arguments... - Any number of arguments to apply to the function. - * @example - * - * // in a module - * var hello = function(name, callback) { - * setTimeout(function() { - * callback(null, 'hello ' + name); - * }, 1000); - * }; - * - * // in the node repl - * node> async.log(hello, 'world'); - * 'hello world' - */ - var log = consoleFunc('log'); - - /** - * The same as [`mapValues`]{@link module:Collections.mapValues} but runs a maximum of `limit` async operations at a - * time. - * - * @name mapValuesLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.mapValues]{@link module:Collections.mapValues} - * @category Collection - * @param {Object} obj - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - A function to apply to each value and key - * in `coll`. - * The iteratee should complete with the transformed value as its result. - * Invoked with (value, key, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. `result` is a new object consisting - * of each key from `obj`, with each transformed value on the right-hand side. - * Invoked with (err, result). - * @returns {Promise} a promise, if no callback is passed - */ - function mapValuesLimit(obj, limit, iteratee, callback) { - callback = once(callback); - var newObj = {}; - var _iteratee = wrapAsync(iteratee); - return eachOfLimit(limit)(obj, (val, key, next) => { - _iteratee(val, key, (err, result) => { - if (err) return next(err); - newObj[key] = result; - next(err); - }); - }, err => callback(err, newObj)); - } - - var mapValuesLimit$1 = awaitify(mapValuesLimit, 4); - - /** - * A relative of [`map`]{@link module:Collections.map}, designed for use with objects. - * - * Produces a new Object by mapping each value of `obj` through the `iteratee` - * function. The `iteratee` is called each `value` and `key` from `obj` and a - * callback for when it has finished processing. Each of these callbacks takes - * two arguments: an `error`, and the transformed item from `obj`. If `iteratee` - * passes an error to its callback, the main `callback` (for the `mapValues` - * function) is immediately called with the error. - * - * Note, the order of the keys in the result is not guaranteed. The keys will - * be roughly in the order they complete, (but this is very engine-specific) - * - * @name mapValues - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Object} obj - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each value and key - * in `coll`. - * The iteratee should complete with the transformed value as its result. - * Invoked with (value, key, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. `result` is a new object consisting - * of each key from `obj`, with each transformed value on the right-hand side. - * Invoked with (err, result). - * @returns {Promise} a promise, if no callback is passed - * @example - * - * // file1.txt is a file that is 1000 bytes in size - * // file2.txt is a file that is 2000 bytes in size - * // file3.txt is a file that is 3000 bytes in size - * // file4.txt does not exist - * - * const fileMap = { - * f1: 'file1.txt', - * f2: 'file2.txt', - * f3: 'file3.txt' - * }; - * - * const withMissingFileMap = { - * f1: 'file1.txt', - * f2: 'file2.txt', - * f3: 'file4.txt' - * }; - * - * // asynchronous function that returns the file size in bytes - * function getFileSizeInBytes(file, key, callback) { - * fs.stat(file, function(err, stat) { - * if (err) { - * return callback(err); - * } - * callback(null, stat.size); - * }); - * } - * - * // Using callbacks - * async.mapValues(fileMap, getFileSizeInBytes, function(err, result) { - * if (err) { - * console.log(err); - * } else { - * console.log(result); - * // result is now a map of file size in bytes for each file, e.g. - * // { - * // f1: 1000, - * // f2: 2000, - * // f3: 3000 - * // } - * } - * }); - * - * // Error handling - * async.mapValues(withMissingFileMap, getFileSizeInBytes, function(err, result) { - * if (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } else { - * console.log(result); - * } - * }); - * - * // Using Promises - * async.mapValues(fileMap, getFileSizeInBytes) - * .then( result => { - * console.log(result); - * // result is now a map of file size in bytes for each file, e.g. - * // { - * // f1: 1000, - * // f2: 2000, - * // f3: 3000 - * // } - * }).catch (err => { - * console.log(err); - * }); - * - * // Error Handling - * async.mapValues(withMissingFileMap, getFileSizeInBytes) - * .then( result => { - * console.log(result); - * }).catch (err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.mapValues(fileMap, getFileSizeInBytes); - * console.log(result); - * // result is now a map of file size in bytes for each file, e.g. - * // { - * // f1: 1000, - * // f2: 2000, - * // f3: 3000 - * // } - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // Error Handling - * async () => { - * try { - * let result = await async.mapValues(withMissingFileMap, getFileSizeInBytes); - * console.log(result); - * } - * catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } - * } - * - */ - function mapValues(obj, iteratee, callback) { - return mapValuesLimit$1(obj, Infinity, iteratee, callback) - } - - /** - * The same as [`mapValues`]{@link module:Collections.mapValues} but runs only a single async operation at a time. - * - * @name mapValuesSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.mapValues]{@link module:Collections.mapValues} - * @category Collection - * @param {Object} obj - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each value and key - * in `coll`. - * The iteratee should complete with the transformed value as its result. - * Invoked with (value, key, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. `result` is a new object consisting - * of each key from `obj`, with each transformed value on the right-hand side. - * Invoked with (err, result). - * @returns {Promise} a promise, if no callback is passed - */ - function mapValuesSeries(obj, iteratee, callback) { - return mapValuesLimit$1(obj, 1, iteratee, callback) - } - - /** - * Caches the results of an async function. When creating a hash to store - * function results against, the callback is omitted from the hash and an - * optional hash function can be used. - * - * **Note: if the async function errs, the result will not be cached and - * subsequent calls will call the wrapped function.** - * - * If no hash function is specified, the first argument is used as a hash key, - * which may work reasonably if it is a string or a data type that converts to a - * distinct string. Note that objects and arrays will not behave reasonably. - * Neither will cases where the other arguments are significant. In such cases, - * specify your own hash function. - * - * The cache of results is exposed as the `memo` property of the function - * returned by `memoize`. - * - * @name memoize - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} fn - The async function to proxy and cache results from. - * @param {Function} hasher - An optional function for generating a custom hash - * for storing results. It has all the arguments applied to it apart from the - * callback, and must be synchronous. - * @returns {AsyncFunction} a memoized version of `fn` - * @example - * - * var slow_fn = function(name, callback) { - * // do something - * callback(null, result); - * }; - * var fn = async.memoize(slow_fn); - * - * // fn can now be used as if it were slow_fn - * fn('some name', function() { - * // callback - * }); - */ - function memoize(fn, hasher = v => v) { - var memo = Object.create(null); - var queues = Object.create(null); - var _fn = wrapAsync(fn); - var memoized = initialParams((args, callback) => { - var key = hasher(...args); - if (key in memo) { - setImmediate$1(() => callback(null, ...memo[key])); - } else if (key in queues) { - queues[key].push(callback); - } else { - queues[key] = [callback]; - _fn(...args, (err, ...resultArgs) => { - // #1465 don't memoize if an error occurred - if (!err) { - memo[key] = resultArgs; - } - var q = queues[key]; - delete queues[key]; - for (var i = 0, l = q.length; i < l; i++) { - q[i](err, ...resultArgs); - } - }); - } - }); - memoized.memo = memo; - memoized.unmemoized = fn; - return memoized; - } - - /* istanbul ignore file */ - - /** - * Calls `callback` on a later loop around the event loop. In Node.js this just - * calls `process.nextTick`. In the browser it will use `setImmediate` if - * available, otherwise `setTimeout(callback, 0)`, which means other higher - * priority events may precede the execution of `callback`. - * - * This is used internally for browser-compatibility purposes. - * - * @name nextTick - * @static - * @memberOf module:Utils - * @method - * @see [async.setImmediate]{@link module:Utils.setImmediate} - * @category Util - * @param {Function} callback - The function to call on a later loop around - * the event loop. Invoked with (args...). - * @param {...*} args... - any number of additional arguments to pass to the - * callback on the next tick. - * @example - * - * var call_order = []; - * async.nextTick(function() { - * call_order.push('two'); - * // call_order now equals ['one','two'] - * }); - * call_order.push('one'); - * - * async.setImmediate(function (a, b, c) { - * // a, b, and c equal 1, 2, and 3 - * }, 1, 2, 3); - */ - var _defer$1; - - if (hasNextTick) { - _defer$1 = process.nextTick; - } else if (hasSetImmediate) { - _defer$1 = setImmediate; - } else { - _defer$1 = fallback; - } - - var nextTick = wrap(_defer$1); - - var parallel = awaitify((eachfn, tasks, callback) => { - var results = isArrayLike(tasks) ? [] : {}; - - eachfn(tasks, (task, key, taskCb) => { - wrapAsync(task)((err, ...result) => { - if (result.length < 2) { - [result] = result; - } - results[key] = result; - taskCb(err); - }); - }, err => callback(err, results)); - }, 3); - - /** - * Run the `tasks` collection of functions in parallel, without waiting until - * the previous function has completed. If any of the functions pass an error to - * its callback, the main `callback` is immediately called with the value of the - * error. Once the `tasks` have completed, the results are passed to the final - * `callback` as an array. - * - * **Note:** `parallel` is about kicking-off I/O tasks in parallel, not about - * parallel execution of code. If your tasks do not use any timers or perform - * any I/O, they will actually be executed in series. Any synchronous setup - * sections for each task will happen one after the other. JavaScript remains - * single-threaded. - * - * **Hint:** Use [`reflect`]{@link module:Utils.reflect} to continue the - * execution of other tasks when a task fails. - * - * It is also possible to use an object instead of an array. Each property will - * be run as a function and the results will be passed to the final `callback` - * as an object instead of an array. This can be a more readable way of handling - * results from {@link async.parallel}. - * - * @name parallel - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection of - * [async functions]{@link AsyncFunction} to run. - * Each async function can complete with any number of optional `result` values. - * @param {Function} [callback] - An optional callback to run once all the - * functions have completed successfully. This function gets a results array - * (or object) containing all the result arguments passed to the task callbacks. - * Invoked with (err, results). - * @returns {Promise} a promise, if a callback is not passed - * - * @example - * - * //Using Callbacks - * async.parallel([ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ], function(err, results) { - * console.log(results); - * // results is equal to ['one','two'] even though - * // the second function had a shorter timeout. - * }); - * - * // an example using an object instead of an array - * async.parallel({ - * one: function(callback) { - * setTimeout(function() { - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * callback(null, 2); - * }, 100); - * } - * }, function(err, results) { - * console.log(results); - * // results is equal to: { one: 1, two: 2 } - * }); - * - * //Using Promises - * async.parallel([ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ]).then(results => { - * console.log(results); - * // results is equal to ['one','two'] even though - * // the second function had a shorter timeout. - * }).catch(err => { - * console.log(err); - * }); - * - * // an example using an object instead of an array - * async.parallel({ - * one: function(callback) { - * setTimeout(function() { - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * callback(null, 2); - * }, 100); - * } - * }).then(results => { - * console.log(results); - * // results is equal to: { one: 1, two: 2 } - * }).catch(err => { - * console.log(err); - * }); - * - * //Using async/await - * async () => { - * try { - * let results = await async.parallel([ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ]); - * console.log(results); - * // results is equal to ['one','two'] even though - * // the second function had a shorter timeout. - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // an example using an object instead of an array - * async () => { - * try { - * let results = await async.parallel({ - * one: function(callback) { - * setTimeout(function() { - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * callback(null, 2); - * }, 100); - * } - * }); - * console.log(results); - * // results is equal to: { one: 1, two: 2 } - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ - function parallel$1(tasks, callback) { - return parallel(eachOf$1, tasks, callback); - } - - /** - * The same as [`parallel`]{@link module:ControlFlow.parallel} but runs a maximum of `limit` async operations at a - * time. - * - * @name parallelLimit - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.parallel]{@link module:ControlFlow.parallel} - * @category Control Flow - * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection of - * [async functions]{@link AsyncFunction} to run. - * Each async function can complete with any number of optional `result` values. - * @param {number} limit - The maximum number of async operations at a time. - * @param {Function} [callback] - An optional callback to run once all the - * functions have completed successfully. This function gets a results array - * (or object) containing all the result arguments passed to the task callbacks. - * Invoked with (err, results). - * @returns {Promise} a promise, if a callback is not passed - */ - function parallelLimit(tasks, limit, callback) { - return parallel(eachOfLimit(limit), tasks, callback); - } - - /** - * A queue of tasks for the worker function to complete. - * @typedef {Iterable} QueueObject - * @memberOf module:ControlFlow - * @property {Function} length - a function returning the number of items - * waiting to be processed. Invoke with `queue.length()`. - * @property {boolean} started - a boolean indicating whether or not any - * items have been pushed and processed by the queue. - * @property {Function} running - a function returning the number of items - * currently being processed. Invoke with `queue.running()`. - * @property {Function} workersList - a function returning the array of items - * currently being processed. Invoke with `queue.workersList()`. - * @property {Function} idle - a function returning false if there are items - * waiting or being processed, or true if not. Invoke with `queue.idle()`. - * @property {number} concurrency - an integer for determining how many `worker` - * functions should be run in parallel. This property can be changed after a - * `queue` is created to alter the concurrency on-the-fly. - * @property {number} payload - an integer that specifies how many items are - * passed to the worker function at a time. only applies if this is a - * [cargo]{@link module:ControlFlow.cargo} object - * @property {AsyncFunction} push - add a new task to the `queue`. Calls `callback` - * once the `worker` has finished processing the task. Instead of a single task, - * a `tasks` array can be submitted. The respective callback is used for every - * task in the list. Invoke with `queue.push(task, [callback])`, - * @property {AsyncFunction} unshift - add a new task to the front of the `queue`. - * Invoke with `queue.unshift(task, [callback])`. - * @property {AsyncFunction} pushAsync - the same as `q.push`, except this returns - * a promise that rejects if an error occurs. - * @property {AsyncFunction} unshiftAsync - the same as `q.unshift`, except this returns - * a promise that rejects if an error occurs. - * @property {Function} remove - remove items from the queue that match a test - * function. The test function will be passed an object with a `data` property, - * and a `priority` property, if this is a - * [priorityQueue]{@link module:ControlFlow.priorityQueue} object. - * Invoked with `queue.remove(testFn)`, where `testFn` is of the form - * `function ({data, priority}) {}` and returns a Boolean. - * @property {Function} saturated - a function that sets a callback that is - * called when the number of running workers hits the `concurrency` limit, and - * further tasks will be queued. If the callback is omitted, `q.saturated()` - * returns a promise for the next occurrence. - * @property {Function} unsaturated - a function that sets a callback that is - * called when the number of running workers is less than the `concurrency` & - * `buffer` limits, and further tasks will not be queued. If the callback is - * omitted, `q.unsaturated()` returns a promise for the next occurrence. - * @property {number} buffer - A minimum threshold buffer in order to say that - * the `queue` is `unsaturated`. - * @property {Function} empty - a function that sets a callback that is called - * when the last item from the `queue` is given to a `worker`. If the callback - * is omitted, `q.empty()` returns a promise for the next occurrence. - * @property {Function} drain - a function that sets a callback that is called - * when the last item from the `queue` has returned from the `worker`. If the - * callback is omitted, `q.drain()` returns a promise for the next occurrence. - * @property {Function} error - a function that sets a callback that is called - * when a task errors. Has the signature `function(error, task)`. If the - * callback is omitted, `error()` returns a promise that rejects on the next - * error. - * @property {boolean} paused - a boolean for determining whether the queue is - * in a paused state. - * @property {Function} pause - a function that pauses the processing of tasks - * until `resume()` is called. Invoke with `queue.pause()`. - * @property {Function} resume - a function that resumes the processing of - * queued tasks when the queue is paused. Invoke with `queue.resume()`. - * @property {Function} kill - a function that removes the `drain` callback and - * empties remaining tasks from the queue forcing it to go idle. No more tasks - * should be pushed to the queue after calling this function. Invoke with `queue.kill()`. - * - * @example - * const q = async.queue(worker, 2) - * q.push(item1) - * q.push(item2) - * q.push(item3) - * // queues are iterable, spread into an array to inspect - * const items = [...q] // [item1, item2, item3] - * // or use for of - * for (let item of q) { - * console.log(item) - * } - * - * q.drain(() => { - * console.log('all done') - * }) - * // or - * await q.drain() - */ - - /** - * Creates a `queue` object with the specified `concurrency`. Tasks added to the - * `queue` are processed in parallel (up to the `concurrency` limit). If all - * `worker`s are in progress, the task is queued until one becomes available. - * Once a `worker` completes a `task`, that `task`'s callback is called. - * - * @name queue - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {AsyncFunction} worker - An async function for processing a queued task. - * If you want to handle errors from an individual task, pass a callback to - * `q.push()`. Invoked with (task, callback). - * @param {number} [concurrency=1] - An `integer` for determining how many - * `worker` functions should be run in parallel. If omitted, the concurrency - * defaults to `1`. If the concurrency is `0`, an error is thrown. - * @returns {module:ControlFlow.QueueObject} A queue object to manage the tasks. Callbacks can be - * attached as certain properties to listen for specific events during the - * lifecycle of the queue. - * @example - * - * // create a queue object with concurrency 2 - * var q = async.queue(function(task, callback) { - * console.log('hello ' + task.name); - * callback(); - * }, 2); - * - * // assign a callback - * q.drain(function() { - * console.log('all items have been processed'); - * }); - * // or await the end - * await q.drain() - * - * // assign an error callback - * q.error(function(err, task) { - * console.error('task experienced an error'); - * }); - * - * // add some items to the queue - * q.push({name: 'foo'}, function(err) { - * console.log('finished processing foo'); - * }); - * // callback is optional - * q.push({name: 'bar'}); - * - * // add some items to the queue (batch-wise) - * q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function(err) { - * console.log('finished processing item'); - * }); - * - * // add some items to the front of the queue - * q.unshift({name: 'bar'}, function (err) { - * console.log('finished processing bar'); - * }); - */ - function queue$1 (worker, concurrency) { - var _worker = wrapAsync(worker); - return queue((items, cb) => { - _worker(items[0], cb); - }, concurrency, 1); - } - - // Binary min-heap implementation used for priority queue. - // Implementation is stable, i.e. push time is considered for equal priorities - class Heap { - constructor() { - this.heap = []; - this.pushCount = Number.MIN_SAFE_INTEGER; - } - - get length() { - return this.heap.length; - } - - empty () { - this.heap = []; - return this; - } - - percUp(index) { - let p; - - while (index > 0 && smaller(this.heap[index], this.heap[p=parent(index)])) { - let t = this.heap[index]; - this.heap[index] = this.heap[p]; - this.heap[p] = t; - - index = p; - } - } - - percDown(index) { - let l; - - while ((l=leftChi(index)) < this.heap.length) { - if (l+1 < this.heap.length && smaller(this.heap[l+1], this.heap[l])) { - l = l+1; - } - - if (smaller(this.heap[index], this.heap[l])) { - break; - } - - let t = this.heap[index]; - this.heap[index] = this.heap[l]; - this.heap[l] = t; - - index = l; - } - } - - push(node) { - node.pushCount = ++this.pushCount; - this.heap.push(node); - this.percUp(this.heap.length-1); - } - - unshift(node) { - return this.heap.push(node); - } - - shift() { - let [top] = this.heap; - - this.heap[0] = this.heap[this.heap.length-1]; - this.heap.pop(); - this.percDown(0); - - return top; - } - - toArray() { - return [...this]; - } - - *[Symbol.iterator] () { - for (let i = 0; i < this.heap.length; i++) { - yield this.heap[i].data; - } - } - - remove (testFn) { - let j = 0; - for (let i = 0; i < this.heap.length; i++) { - if (!testFn(this.heap[i])) { - this.heap[j] = this.heap[i]; - j++; - } - } - - this.heap.splice(j); - - for (let i = parent(this.heap.length-1); i >= 0; i--) { - this.percDown(i); - } - - return this; - } - } - - function leftChi(i) { - return (i<<1)+1; - } - - function parent(i) { - return ((i+1)>>1)-1; - } - - function smaller(x, y) { - if (x.priority !== y.priority) { - return x.priority < y.priority; - } - else { - return x.pushCount < y.pushCount; - } - } - - /** - * The same as [async.queue]{@link module:ControlFlow.queue} only tasks are assigned a priority and - * completed in ascending priority order. - * - * @name priorityQueue - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.queue]{@link module:ControlFlow.queue} - * @category Control Flow - * @param {AsyncFunction} worker - An async function for processing a queued task. - * If you want to handle errors from an individual task, pass a callback to - * `q.push()`. - * Invoked with (task, callback). - * @param {number} concurrency - An `integer` for determining how many `worker` - * functions should be run in parallel. If omitted, the concurrency defaults to - * `1`. If the concurrency is `0`, an error is thrown. - * @returns {module:ControlFlow.QueueObject} A priorityQueue object to manage the tasks. There are three - * differences between `queue` and `priorityQueue` objects: - * * `push(task, priority, [callback])` - `priority` should be a number. If an - * array of `tasks` is given, all tasks will be assigned the same priority. - * * `pushAsync(task, priority, [callback])` - the same as `priorityQueue.push`, - * except this returns a promise that rejects if an error occurs. - * * The `unshift` and `unshiftAsync` methods were removed. - */ - function priorityQueue(worker, concurrency) { - // Start with a normal queue - var q = queue$1(worker, concurrency); - - var { - push, - pushAsync - } = q; - - q._tasks = new Heap(); - q._createTaskItem = ({data, priority}, callback) => { - return { - data, - priority, - callback - }; - }; - - function createDataItems(tasks, priority) { - if (!Array.isArray(tasks)) { - return {data: tasks, priority}; - } - return tasks.map(data => { return {data, priority}; }); - } - - // Override push to accept second parameter representing priority - q.push = function(data, priority = 0, callback) { - return push(createDataItems(data, priority), callback); - }; - - q.pushAsync = function(data, priority = 0, callback) { - return pushAsync(createDataItems(data, priority), callback); - }; - - // Remove unshift functions - delete q.unshift; - delete q.unshiftAsync; - - return q; - } - - /** - * Runs the `tasks` array of functions in parallel, without waiting until the - * previous function has completed. Once any of the `tasks` complete or pass an - * error to its callback, the main `callback` is immediately called. It's - * equivalent to `Promise.race()`. - * - * @name race - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array} tasks - An array containing [async functions]{@link AsyncFunction} - * to run. Each function can complete with an optional `result` value. - * @param {Function} callback - A callback to run once any of the functions have - * completed. This function gets an error or result from the first function that - * completed. Invoked with (err, result). - * @returns {Promise} a promise, if a callback is omitted - * @example - * - * async.race([ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ], - * // main callback - * function(err, result) { - * // the result will be equal to 'two' as it finishes earlier - * }); - */ - function race(tasks, callback) { - callback = once(callback); - if (!Array.isArray(tasks)) return callback(new TypeError('First argument to race must be an array of functions')); - if (!tasks.length) return callback(); - for (var i = 0, l = tasks.length; i < l; i++) { - wrapAsync(tasks[i])(callback); - } - } - - var race$1 = awaitify(race, 2); - - /** - * Same as [`reduce`]{@link module:Collections.reduce}, only operates on `array` in reverse order. - * - * @name reduceRight - * @static - * @memberOf module:Collections - * @method - * @see [async.reduce]{@link module:Collections.reduce} - * @alias foldr - * @category Collection - * @param {Array} array - A collection to iterate over. - * @param {*} memo - The initial state of the reduction. - * @param {AsyncFunction} iteratee - A function applied to each item in the - * array to produce the next step in the reduction. - * The `iteratee` should complete with the next state of the reduction. - * If the iteratee completes with an error, the reduction is stopped and the - * main `callback` is immediately called with the error. - * Invoked with (memo, item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result is the reduced value. Invoked with - * (err, result). - * @returns {Promise} a promise, if no callback is passed - */ - function reduceRight (array, memo, iteratee, callback) { - var reversed = [...array].reverse(); - return reduce$1(reversed, memo, iteratee, callback); - } - - /** - * Wraps the async function in another function that always completes with a - * result object, even when it errors. - * - * The result object has either the property `error` or `value`. - * - * @name reflect - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} fn - The async function you want to wrap - * @returns {Function} - A function that always passes null to it's callback as - * the error. The second argument to the callback will be an `object` with - * either an `error` or a `value` property. - * @example - * - * async.parallel([ - * async.reflect(function(callback) { - * // do some stuff ... - * callback(null, 'one'); - * }), - * async.reflect(function(callback) { - * // do some more stuff but error ... - * callback('bad stuff happened'); - * }), - * async.reflect(function(callback) { - * // do some more stuff ... - * callback(null, 'two'); - * }) - * ], - * // optional callback - * function(err, results) { - * // values - * // results[0].value = 'one' - * // results[1].error = 'bad stuff happened' - * // results[2].value = 'two' - * }); - */ - function reflect(fn) { - var _fn = wrapAsync(fn); - return initialParams(function reflectOn(args, reflectCallback) { - args.push((error, ...cbArgs) => { - let retVal = {}; - if (error) { - retVal.error = error; - } - if (cbArgs.length > 0){ - var value = cbArgs; - if (cbArgs.length <= 1) { - [value] = cbArgs; - } - retVal.value = value; - } - reflectCallback(null, retVal); - }); - - return _fn.apply(this, args); - }); - } - - /** - * A helper function that wraps an array or an object of functions with `reflect`. - * - * @name reflectAll - * @static - * @memberOf module:Utils - * @method - * @see [async.reflect]{@link module:Utils.reflect} - * @category Util - * @param {Array|Object|Iterable} tasks - The collection of - * [async functions]{@link AsyncFunction} to wrap in `async.reflect`. - * @returns {Array} Returns an array of async functions, each wrapped in - * `async.reflect` - * @example - * - * let tasks = [ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * // do some more stuff but error ... - * callback(new Error('bad stuff happened')); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ]; - * - * async.parallel(async.reflectAll(tasks), - * // optional callback - * function(err, results) { - * // values - * // results[0].value = 'one' - * // results[1].error = Error('bad stuff happened') - * // results[2].value = 'two' - * }); - * - * // an example using an object instead of an array - * let tasks = { - * one: function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * two: function(callback) { - * callback('two'); - * }, - * three: function(callback) { - * setTimeout(function() { - * callback(null, 'three'); - * }, 100); - * } - * }; - * - * async.parallel(async.reflectAll(tasks), - * // optional callback - * function(err, results) { - * // values - * // results.one.value = 'one' - * // results.two.error = 'two' - * // results.three.value = 'three' - * }); - */ - function reflectAll(tasks) { - var results; - if (Array.isArray(tasks)) { - results = tasks.map(reflect); - } else { - results = {}; - Object.keys(tasks).forEach(key => { - results[key] = reflect.call(this, tasks[key]); - }); - } - return results; - } - - function reject(eachfn, arr, _iteratee, callback) { - const iteratee = wrapAsync(_iteratee); - return _filter(eachfn, arr, (value, cb) => { - iteratee(value, (err, v) => { - cb(err, !v); - }); - }, callback); - } - - /** - * The opposite of [`filter`]{@link module:Collections.filter}. Removes values that pass an `async` truth test. - * - * @name reject - * @static - * @memberOf module:Collections - * @method - * @see [async.filter]{@link module:Collections.filter} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {Function} iteratee - An async truth test to apply to each item in - * `coll`. - * The should complete with a boolean value as its `result`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @returns {Promise} a promise, if no callback is passed - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * - * const fileList = ['dir1/file1.txt','dir2/file3.txt','dir3/file6.txt']; - * - * // asynchronous function that checks if a file exists - * function fileExists(file, callback) { - * fs.access(file, fs.constants.F_OK, (err) => { - * callback(null, !err); - * }); - * } - * - * // Using callbacks - * async.reject(fileList, fileExists, function(err, results) { - * // [ 'dir3/file6.txt' ] - * // results now equals an array of the non-existing files - * }); - * - * // Using Promises - * async.reject(fileList, fileExists) - * .then( results => { - * console.log(results); - * // [ 'dir3/file6.txt' ] - * // results now equals an array of the non-existing files - * }).catch( err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let results = await async.reject(fileList, fileExists); - * console.log(results); - * // [ 'dir3/file6.txt' ] - * // results now equals an array of the non-existing files - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ - function reject$1 (coll, iteratee, callback) { - return reject(eachOf$1, coll, iteratee, callback) - } - var reject$2 = awaitify(reject$1, 3); - - /** - * The same as [`reject`]{@link module:Collections.reject} but runs a maximum of `limit` async operations at a - * time. - * - * @name rejectLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.reject]{@link module:Collections.reject} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {Function} iteratee - An async truth test to apply to each item in - * `coll`. - * The should complete with a boolean value as its `result`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @returns {Promise} a promise, if no callback is passed - */ - function rejectLimit (coll, limit, iteratee, callback) { - return reject(eachOfLimit(limit), coll, iteratee, callback) - } - var rejectLimit$1 = awaitify(rejectLimit, 4); - - /** - * The same as [`reject`]{@link module:Collections.reject} but runs only a single async operation at a time. - * - * @name rejectSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.reject]{@link module:Collections.reject} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {Function} iteratee - An async truth test to apply to each item in - * `coll`. - * The should complete with a boolean value as its `result`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @returns {Promise} a promise, if no callback is passed - */ - function rejectSeries (coll, iteratee, callback) { - return reject(eachOfSeries$1, coll, iteratee, callback) - } - var rejectSeries$1 = awaitify(rejectSeries, 3); - - function constant$1(value) { - return function () { - return value; - } - } - - /** - * Attempts to get a successful response from `task` no more than `times` times - * before returning an error. If the task is successful, the `callback` will be - * passed the result of the successful task. If all attempts fail, the callback - * will be passed the error and result (if any) of the final attempt. - * - * @name retry - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @see [async.retryable]{@link module:ControlFlow.retryable} - * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - Can be either an - * object with `times` and `interval` or a number. - * * `times` - The number of attempts to make before giving up. The default - * is `5`. - * * `interval` - The time to wait between retries, in milliseconds. The - * default is `0`. The interval may also be specified as a function of the - * retry count (see example). - * * `errorFilter` - An optional synchronous function that is invoked on - * erroneous result. If it returns `true` the retry attempts will continue; - * if the function returns `false` the retry flow is aborted with the current - * attempt's error and result being returned to the final callback. - * Invoked with (err). - * * If `opts` is a number, the number specifies the number of times to retry, - * with the default interval of `0`. - * @param {AsyncFunction} task - An async function to retry. - * Invoked with (callback). - * @param {Function} [callback] - An optional callback which is called when the - * task has succeeded, or after the final failed attempt. It receives the `err` - * and `result` arguments of the last attempt at completing the `task`. Invoked - * with (err, results). - * @returns {Promise} a promise if no callback provided - * - * @example - * - * // The `retry` function can be used as a stand-alone control flow by passing - * // a callback, as shown below: - * - * // try calling apiMethod 3 times - * async.retry(3, apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // try calling apiMethod 3 times, waiting 200 ms between each retry - * async.retry({times: 3, interval: 200}, apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // try calling apiMethod 10 times with exponential backoff - * // (i.e. intervals of 100, 200, 400, 800, 1600, ... milliseconds) - * async.retry({ - * times: 10, - * interval: function(retryCount) { - * return 50 * Math.pow(2, retryCount); - * } - * }, apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // try calling apiMethod the default 5 times no delay between each retry - * async.retry(apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // try calling apiMethod only when error condition satisfies, all other - * // errors will abort the retry control flow and return to final callback - * async.retry({ - * errorFilter: function(err) { - * return err.message === 'Temporary error'; // only retry on a specific error - * } - * }, apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // to retry individual methods that are not as reliable within other - * // control flow functions, use the `retryable` wrapper: - * async.auto({ - * users: api.getUsers.bind(api), - * payments: async.retryable(3, api.getPayments.bind(api)) - * }, function(err, results) { - * // do something with the results - * }); - * - */ - const DEFAULT_TIMES = 5; - const DEFAULT_INTERVAL = 0; - - function retry(opts, task, callback) { - var options = { - times: DEFAULT_TIMES, - intervalFunc: constant$1(DEFAULT_INTERVAL) - }; - - if (arguments.length < 3 && typeof opts === 'function') { - callback = task || promiseCallback(); - task = opts; - } else { - parseTimes(options, opts); - callback = callback || promiseCallback(); - } - - if (typeof task !== 'function') { - throw new Error("Invalid arguments for async.retry"); - } - - var _task = wrapAsync(task); - - var attempt = 1; - function retryAttempt() { - _task((err, ...args) => { - if (err === false) return - if (err && attempt++ < options.times && - (typeof options.errorFilter != 'function' || - options.errorFilter(err))) { - setTimeout(retryAttempt, options.intervalFunc(attempt - 1)); - } else { - callback(err, ...args); - } - }); - } - - retryAttempt(); - return callback[PROMISE_SYMBOL] - } - - function parseTimes(acc, t) { - if (typeof t === 'object') { - acc.times = +t.times || DEFAULT_TIMES; - - acc.intervalFunc = typeof t.interval === 'function' ? - t.interval : - constant$1(+t.interval || DEFAULT_INTERVAL); - - acc.errorFilter = t.errorFilter; - } else if (typeof t === 'number' || typeof t === 'string') { - acc.times = +t || DEFAULT_TIMES; - } else { - throw new Error("Invalid arguments for async.retry"); - } - } - - /** - * A close relative of [`retry`]{@link module:ControlFlow.retry}. This method - * wraps a task and makes it retryable, rather than immediately calling it - * with retries. - * - * @name retryable - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.retry]{@link module:ControlFlow.retry} - * @category Control Flow - * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - optional - * options, exactly the same as from `retry`, except for a `opts.arity` that - * is the arity of the `task` function, defaulting to `task.length` - * @param {AsyncFunction} task - the asynchronous function to wrap. - * This function will be passed any arguments passed to the returned wrapper. - * Invoked with (...args, callback). - * @returns {AsyncFunction} The wrapped function, which when invoked, will - * retry on an error, based on the parameters specified in `opts`. - * This function will accept the same parameters as `task`. - * @example - * - * async.auto({ - * dep1: async.retryable(3, getFromFlakyService), - * process: ["dep1", async.retryable(3, function (results, cb) { - * maybeProcessData(results.dep1, cb); - * })] - * }, callback); - */ - function retryable (opts, task) { - if (!task) { - task = opts; - opts = null; - } - let arity = (opts && opts.arity) || task.length; - if (isAsync(task)) { - arity += 1; - } - var _task = wrapAsync(task); - return initialParams((args, callback) => { - if (args.length < arity - 1 || callback == null) { - args.push(callback); - callback = promiseCallback(); - } - function taskFn(cb) { - _task(...args, cb); - } - - if (opts) retry(opts, taskFn, callback); - else retry(taskFn, callback); - - return callback[PROMISE_SYMBOL] - }); - } - - /** - * Run the functions in the `tasks` collection in series, each one running once - * the previous function has completed. If any functions in the series pass an - * error to its callback, no more functions are run, and `callback` is - * immediately called with the value of the error. Otherwise, `callback` - * receives an array of results when `tasks` have completed. - * - * It is also possible to use an object instead of an array. Each property will - * be run as a function, and the results will be passed to the final `callback` - * as an object instead of an array. This can be a more readable way of handling - * results from {@link async.series}. - * - * **Note** that while many implementations preserve the order of object - * properties, the [ECMAScript Language Specification](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6) - * explicitly states that - * - * > The mechanics and order of enumerating the properties is not specified. - * - * So if you rely on the order in which your series of functions are executed, - * and want this to work on all platforms, consider using an array. - * - * @name series - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection containing - * [async functions]{@link AsyncFunction} to run in series. - * Each function can complete with any number of optional `result` values. - * @param {Function} [callback] - An optional callback to run once all the - * functions have completed. This function gets a results array (or object) - * containing all the result arguments passed to the `task` callbacks. Invoked - * with (err, result). - * @return {Promise} a promise, if no callback is passed - * @example - * - * //Using Callbacks - * async.series([ - * function(callback) { - * setTimeout(function() { - * // do some async task - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * // then do another async task - * callback(null, 'two'); - * }, 100); - * } - * ], function(err, results) { - * console.log(results); - * // results is equal to ['one','two'] - * }); - * - * // an example using objects instead of arrays - * async.series({ - * one: function(callback) { - * setTimeout(function() { - * // do some async task - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * // then do another async task - * callback(null, 2); - * }, 100); - * } - * }, function(err, results) { - * console.log(results); - * // results is equal to: { one: 1, two: 2 } - * }); - * - * //Using Promises - * async.series([ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ]).then(results => { - * console.log(results); - * // results is equal to ['one','two'] - * }).catch(err => { - * console.log(err); - * }); - * - * // an example using an object instead of an array - * async.series({ - * one: function(callback) { - * setTimeout(function() { - * // do some async task - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * // then do another async task - * callback(null, 2); - * }, 100); - * } - * }).then(results => { - * console.log(results); - * // results is equal to: { one: 1, two: 2 } - * }).catch(err => { - * console.log(err); - * }); - * - * //Using async/await - * async () => { - * try { - * let results = await async.series([ - * function(callback) { - * setTimeout(function() { - * // do some async task - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * // then do another async task - * callback(null, 'two'); - * }, 100); - * } - * ]); - * console.log(results); - * // results is equal to ['one','two'] - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // an example using an object instead of an array - * async () => { - * try { - * let results = await async.parallel({ - * one: function(callback) { - * setTimeout(function() { - * // do some async task - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * // then do another async task - * callback(null, 2); - * }, 100); - * } - * }); - * console.log(results); - * // results is equal to: { one: 1, two: 2 } - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ - function series(tasks, callback) { - return parallel(eachOfSeries$1, tasks, callback); - } - - /** - * Returns `true` if at least one element in the `coll` satisfies an async test. - * If any iteratee call returns `true`, the main `callback` is immediately - * called. - * - * @name some - * @static - * @memberOf module:Collections - * @method - * @alias any - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collections in parallel. - * The iteratee should complete with a boolean `result` value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the iteratee functions have finished. - * Result will be either `true` or `false` depending on the values of the async - * tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * // dir4 does not exist - * - * // asynchronous function that checks if a file exists - * function fileExists(file, callback) { - * fs.access(file, fs.constants.F_OK, (err) => { - * callback(null, !err); - * }); - * } - * - * // Using callbacks - * async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists, - * function(err, result) { - * console.log(result); - * // true - * // result is true since some file in the list exists - * } - *); - * - * async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists, - * function(err, result) { - * console.log(result); - * // false - * // result is false since none of the files exists - * } - *); - * - * // Using Promises - * async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists) - * .then( result => { - * console.log(result); - * // true - * // result is true since some file in the list exists - * }).catch( err => { - * console.log(err); - * }); - * - * async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists) - * .then( result => { - * console.log(result); - * // false - * // result is false since none of the files exists - * }).catch( err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists); - * console.log(result); - * // true - * // result is true since some file in the list exists - * } - * catch (err) { - * console.log(err); - * } - * } - * - * async () => { - * try { - * let result = await async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists); - * console.log(result); - * // false - * // result is false since none of the files exists - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ - function some(coll, iteratee, callback) { - return _createTester(Boolean, res => res)(eachOf$1, coll, iteratee, callback) - } - var some$1 = awaitify(some, 3); - - /** - * The same as [`some`]{@link module:Collections.some} but runs a maximum of `limit` async operations at a time. - * - * @name someLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.some]{@link module:Collections.some} - * @alias anyLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collections in parallel. - * The iteratee should complete with a boolean `result` value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the iteratee functions have finished. - * Result will be either `true` or `false` depending on the values of the async - * tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - */ - function someLimit(coll, limit, iteratee, callback) { - return _createTester(Boolean, res => res)(eachOfLimit(limit), coll, iteratee, callback) - } - var someLimit$1 = awaitify(someLimit, 4); - - /** - * The same as [`some`]{@link module:Collections.some} but runs only a single async operation at a time. - * - * @name someSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.some]{@link module:Collections.some} - * @alias anySeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collections in series. - * The iteratee should complete with a boolean `result` value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the iteratee functions have finished. - * Result will be either `true` or `false` depending on the values of the async - * tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - */ - function someSeries(coll, iteratee, callback) { - return _createTester(Boolean, res => res)(eachOfSeries$1, coll, iteratee, callback) - } - var someSeries$1 = awaitify(someSeries, 3); - - /** - * Sorts a list by the results of running each `coll` value through an async - * `iteratee`. - * - * @name sortBy - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with a value to use as the sort criteria as - * its `result`. - * Invoked with (item, callback). - * @param {Function} callback - A callback which is called after all the - * `iteratee` functions have finished, or an error occurs. Results is the items - * from the original `coll` sorted by the values returned by the `iteratee` - * calls. Invoked with (err, results). - * @returns {Promise} a promise, if no callback passed - * @example - * - * // bigfile.txt is a file that is 251100 bytes in size - * // mediumfile.txt is a file that is 11000 bytes in size - * // smallfile.txt is a file that is 121 bytes in size - * - * // asynchronous function that returns the file size in bytes - * function getFileSizeInBytes(file, callback) { - * fs.stat(file, function(err, stat) { - * if (err) { - * return callback(err); - * } - * callback(null, stat.size); - * }); - * } - * - * // Using callbacks - * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], getFileSizeInBytes, - * function(err, results) { - * if (err) { - * console.log(err); - * } else { - * console.log(results); - * // results is now the original array of files sorted by - * // file size (ascending by default), e.g. - * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] - * } - * } - * ); - * - * // By modifying the callback parameter the - * // sorting order can be influenced: - * - * // ascending order - * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], function(file, callback) { - * getFileSizeInBytes(file, function(getFileSizeErr, fileSize) { - * if (getFileSizeErr) return callback(getFileSizeErr); - * callback(null, fileSize); - * }); - * }, function(err, results) { - * if (err) { - * console.log(err); - * } else { - * console.log(results); - * // results is now the original array of files sorted by - * // file size (ascending by default), e.g. - * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] - * } - * } - * ); - * - * // descending order - * async.sortBy(['bigfile.txt','mediumfile.txt','smallfile.txt'], function(file, callback) { - * getFileSizeInBytes(file, function(getFileSizeErr, fileSize) { - * if (getFileSizeErr) { - * return callback(getFileSizeErr); - * } - * callback(null, fileSize * -1); - * }); - * }, function(err, results) { - * if (err) { - * console.log(err); - * } else { - * console.log(results); - * // results is now the original array of files sorted by - * // file size (ascending by default), e.g. - * // [ 'bigfile.txt', 'mediumfile.txt', 'smallfile.txt'] - * } - * } - * ); - * - * // Error handling - * async.sortBy(['mediumfile.txt','smallfile.txt','missingfile.txt'], getFileSizeInBytes, - * function(err, results) { - * if (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } else { - * console.log(results); - * } - * } - * ); - * - * // Using Promises - * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], getFileSizeInBytes) - * .then( results => { - * console.log(results); - * // results is now the original array of files sorted by - * // file size (ascending by default), e.g. - * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] - * }).catch( err => { - * console.log(err); - * }); - * - * // Error handling - * async.sortBy(['mediumfile.txt','smallfile.txt','missingfile.txt'], getFileSizeInBytes) - * .then( results => { - * console.log(results); - * }).catch( err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * }); - * - * // Using async/await - * (async () => { - * try { - * let results = await async.sortBy(['bigfile.txt','mediumfile.txt','smallfile.txt'], getFileSizeInBytes); - * console.log(results); - * // results is now the original array of files sorted by - * // file size (ascending by default), e.g. - * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] - * } - * catch (err) { - * console.log(err); - * } - * })(); - * - * // Error handling - * async () => { - * try { - * let results = await async.sortBy(['missingfile.txt','mediumfile.txt','smallfile.txt'], getFileSizeInBytes); - * console.log(results); - * } - * catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } - * } - * - */ - function sortBy (coll, iteratee, callback) { - var _iteratee = wrapAsync(iteratee); - return map$1(coll, (x, iterCb) => { - _iteratee(x, (err, criteria) => { - if (err) return iterCb(err); - iterCb(err, {value: x, criteria}); - }); - }, (err, results) => { - if (err) return callback(err); - callback(null, results.sort(comparator).map(v => v.value)); - }); - - function comparator(left, right) { - var a = left.criteria, b = right.criteria; - return a < b ? -1 : a > b ? 1 : 0; - } - } - var sortBy$1 = awaitify(sortBy, 3); - - /** - * Sets a time limit on an asynchronous function. If the function does not call - * its callback within the specified milliseconds, it will be called with a - * timeout error. The code property for the error object will be `'ETIMEDOUT'`. - * - * @name timeout - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} asyncFn - The async function to limit in time. - * @param {number} milliseconds - The specified time limit. - * @param {*} [info] - Any variable you want attached (`string`, `object`, etc) - * to timeout Error for more information.. - * @returns {AsyncFunction} Returns a wrapped function that can be used with any - * of the control flow functions. - * Invoke this function with the same parameters as you would `asyncFunc`. - * @example - * - * function myFunction(foo, callback) { - * doAsyncTask(foo, function(err, data) { - * // handle errors - * if (err) return callback(err); - * - * // do some stuff ... - * - * // return processed data - * return callback(null, data); - * }); - * } - * - * var wrapped = async.timeout(myFunction, 1000); - * - * // call `wrapped` as you would `myFunction` - * wrapped({ bar: 'bar' }, function(err, data) { - * // if `myFunction` takes < 1000 ms to execute, `err` - * // and `data` will have their expected values - * - * // else `err` will be an Error with the code 'ETIMEDOUT' - * }); - */ - function timeout(asyncFn, milliseconds, info) { - var fn = wrapAsync(asyncFn); - - return initialParams((args, callback) => { - var timedOut = false; - var timer; - - function timeoutCallback() { - var name = asyncFn.name || 'anonymous'; - var error = new Error('Callback function "' + name + '" timed out.'); - error.code = 'ETIMEDOUT'; - if (info) { - error.info = info; - } - timedOut = true; - callback(error); - } - - args.push((...cbArgs) => { - if (!timedOut) { - callback(...cbArgs); - clearTimeout(timer); - } - }); - - // setup timer and call original function - timer = setTimeout(timeoutCallback, milliseconds); - fn(...args); - }); - } - - function range(size) { - var result = Array(size); - while (size--) { - result[size] = size; - } - return result; - } - - /** - * The same as [times]{@link module:ControlFlow.times} but runs a maximum of `limit` async operations at a - * time. - * - * @name timesLimit - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.times]{@link module:ControlFlow.times} - * @category Control Flow - * @param {number} count - The number of times to run the function. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - The async function to call `n` times. - * Invoked with the iteration index and a callback: (n, next). - * @param {Function} callback - see [async.map]{@link module:Collections.map}. - * @returns {Promise} a promise, if no callback is provided - */ - function timesLimit(count, limit, iteratee, callback) { - var _iteratee = wrapAsync(iteratee); - return mapLimit$1(range(count), limit, _iteratee, callback); - } - - /** - * Calls the `iteratee` function `n` times, and accumulates results in the same - * manner you would use with [map]{@link module:Collections.map}. - * - * @name times - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.map]{@link module:Collections.map} - * @category Control Flow - * @param {number} n - The number of times to run the function. - * @param {AsyncFunction} iteratee - The async function to call `n` times. - * Invoked with the iteration index and a callback: (n, next). - * @param {Function} callback - see {@link module:Collections.map}. - * @returns {Promise} a promise, if no callback is provided - * @example - * - * // Pretend this is some complicated async factory - * var createUser = function(id, callback) { - * callback(null, { - * id: 'user' + id - * }); - * }; - * - * // generate 5 users - * async.times(5, function(n, next) { - * createUser(n, function(err, user) { - * next(err, user); - * }); - * }, function(err, users) { - * // we should now have 5 users - * }); - */ - function times (n, iteratee, callback) { - return timesLimit(n, Infinity, iteratee, callback) - } - - /** - * The same as [times]{@link module:ControlFlow.times} but runs only a single async operation at a time. - * - * @name timesSeries - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.times]{@link module:ControlFlow.times} - * @category Control Flow - * @param {number} n - The number of times to run the function. - * @param {AsyncFunction} iteratee - The async function to call `n` times. - * Invoked with the iteration index and a callback: (n, next). - * @param {Function} callback - see {@link module:Collections.map}. - * @returns {Promise} a promise, if no callback is provided - */ - function timesSeries (n, iteratee, callback) { - return timesLimit(n, 1, iteratee, callback) - } - - /** - * A relative of `reduce`. Takes an Object or Array, and iterates over each - * element in parallel, each step potentially mutating an `accumulator` value. - * The type of the accumulator defaults to the type of collection passed in. - * - * @name transform - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {*} [accumulator] - The initial state of the transform. If omitted, - * it will default to an empty Object or Array, depending on the type of `coll` - * @param {AsyncFunction} iteratee - A function applied to each item in the - * collection that potentially modifies the accumulator. - * Invoked with (accumulator, item, key, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result is the transformed accumulator. - * Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - * @example - * - * // file1.txt is a file that is 1000 bytes in size - * // file2.txt is a file that is 2000 bytes in size - * // file3.txt is a file that is 3000 bytes in size - * - * // helper function that returns human-readable size format from bytes - * function formatBytes(bytes, decimals = 2) { - * // implementation not included for brevity - * return humanReadbleFilesize; - * } - * - * const fileList = ['file1.txt','file2.txt','file3.txt']; - * - * // asynchronous function that returns the file size, transformed to human-readable format - * // e.g. 1024 bytes = 1KB, 1234 bytes = 1.21 KB, 1048576 bytes = 1MB, etc. - * function transformFileSize(acc, value, key, callback) { - * fs.stat(value, function(err, stat) { - * if (err) { - * return callback(err); - * } - * acc[key] = formatBytes(stat.size); - * callback(null); - * }); - * } - * - * // Using callbacks - * async.transform(fileList, transformFileSize, function(err, result) { - * if(err) { - * console.log(err); - * } else { - * console.log(result); - * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ] - * } - * }); - * - * // Using Promises - * async.transform(fileList, transformFileSize) - * .then(result => { - * console.log(result); - * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ] - * }).catch(err => { - * console.log(err); - * }); - * - * // Using async/await - * (async () => { - * try { - * let result = await async.transform(fileList, transformFileSize); - * console.log(result); - * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ] - * } - * catch (err) { - * console.log(err); - * } - * })(); - * - * @example - * - * // file1.txt is a file that is 1000 bytes in size - * // file2.txt is a file that is 2000 bytes in size - * // file3.txt is a file that is 3000 bytes in size - * - * // helper function that returns human-readable size format from bytes - * function formatBytes(bytes, decimals = 2) { - * // implementation not included for brevity - * return humanReadbleFilesize; - * } - * - * const fileMap = { f1: 'file1.txt', f2: 'file2.txt', f3: 'file3.txt' }; - * - * // asynchronous function that returns the file size, transformed to human-readable format - * // e.g. 1024 bytes = 1KB, 1234 bytes = 1.21 KB, 1048576 bytes = 1MB, etc. - * function transformFileSize(acc, value, key, callback) { - * fs.stat(value, function(err, stat) { - * if (err) { - * return callback(err); - * } - * acc[key] = formatBytes(stat.size); - * callback(null); - * }); - * } - * - * // Using callbacks - * async.transform(fileMap, transformFileSize, function(err, result) { - * if(err) { - * console.log(err); - * } else { - * console.log(result); - * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' } - * } - * }); - * - * // Using Promises - * async.transform(fileMap, transformFileSize) - * .then(result => { - * console.log(result); - * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' } - * }).catch(err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.transform(fileMap, transformFileSize); - * console.log(result); - * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' } - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ - function transform (coll, accumulator, iteratee, callback) { - if (arguments.length <= 3 && typeof accumulator === 'function') { - callback = iteratee; - iteratee = accumulator; - accumulator = Array.isArray(coll) ? [] : {}; - } - callback = once(callback || promiseCallback()); - var _iteratee = wrapAsync(iteratee); - - eachOf$1(coll, (v, k, cb) => { - _iteratee(accumulator, v, k, cb); - }, err => callback(err, accumulator)); - return callback[PROMISE_SYMBOL] - } - - /** - * It runs each task in series but stops whenever any of the functions were - * successful. If one of the tasks were successful, the `callback` will be - * passed the result of the successful task. If all tasks fail, the callback - * will be passed the error and result (if any) of the final attempt. - * - * @name tryEach - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection containing functions to - * run, each function is passed a `callback(err, result)` it must call on - * completion with an error `err` (which can be `null`) and an optional `result` - * value. - * @param {Function} [callback] - An optional callback which is called when one - * of the tasks has succeeded, or all have failed. It receives the `err` and - * `result` arguments of the last attempt at completing the `task`. Invoked with - * (err, results). - * @returns {Promise} a promise, if no callback is passed - * @example - * async.tryEach([ - * function getDataFromFirstWebsite(callback) { - * // Try getting the data from the first website - * callback(err, data); - * }, - * function getDataFromSecondWebsite(callback) { - * // First website failed, - * // Try getting the data from the backup website - * callback(err, data); - * } - * ], - * // optional callback - * function(err, results) { - * Now do something with the data. - * }); - * - */ - function tryEach(tasks, callback) { - var error = null; - var result; - return eachSeries$1(tasks, (task, taskCb) => { - wrapAsync(task)((err, ...args) => { - if (err === false) return taskCb(err); - - if (args.length < 2) { - [result] = args; - } else { - result = args; - } - error = err; - taskCb(err ? null : {}); - }); - }, () => callback(error, result)); - } - - var tryEach$1 = awaitify(tryEach); - - /** - * Undoes a [memoize]{@link module:Utils.memoize}d function, reverting it to the original, - * unmemoized form. Handy for testing. - * - * @name unmemoize - * @static - * @memberOf module:Utils - * @method - * @see [async.memoize]{@link module:Utils.memoize} - * @category Util - * @param {AsyncFunction} fn - the memoized function - * @returns {AsyncFunction} a function that calls the original unmemoized function - */ - function unmemoize(fn) { - return (...args) => { - return (fn.unmemoized || fn)(...args); - }; - } - - /** - * Repeatedly call `iteratee`, while `test` returns `true`. Calls `callback` when - * stopped, or an error occurs. - * - * @name whilst - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {AsyncFunction} test - asynchronous truth test to perform before each - * execution of `iteratee`. Invoked with (). - * @param {AsyncFunction} iteratee - An async function which is called each time - * `test` passes. Invoked with (callback). - * @param {Function} [callback] - A callback which is called after the test - * function has failed and repeated execution of `iteratee` has stopped. `callback` - * will be passed an error and any arguments passed to the final `iteratee`'s - * callback. Invoked with (err, [results]); - * @returns {Promise} a promise, if no callback is passed - * @example - * - * var count = 0; - * async.whilst( - * function test(cb) { cb(null, count < 5); }, - * function iter(callback) { - * count++; - * setTimeout(function() { - * callback(null, count); - * }, 1000); - * }, - * function (err, n) { - * // 5 seconds have passed, n = 5 - * } - * ); - */ - function whilst(test, iteratee, callback) { - callback = onlyOnce(callback); - var _fn = wrapAsync(iteratee); - var _test = wrapAsync(test); - var results = []; - - function next(err, ...rest) { - if (err) return callback(err); - results = rest; - if (err === false) return; - _test(check); - } - - function check(err, truth) { - if (err) return callback(err); - if (err === false) return; - if (!truth) return callback(null, ...results); - _fn(next); - } - - return _test(check); - } - var whilst$1 = awaitify(whilst, 3); - - /** - * Repeatedly call `iteratee` until `test` returns `true`. Calls `callback` when - * stopped, or an error occurs. `callback` will be passed an error and any - * arguments passed to the final `iteratee`'s callback. - * - * The inverse of [whilst]{@link module:ControlFlow.whilst}. - * - * @name until - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.whilst]{@link module:ControlFlow.whilst} - * @category Control Flow - * @param {AsyncFunction} test - asynchronous truth test to perform before each - * execution of `iteratee`. Invoked with (callback). - * @param {AsyncFunction} iteratee - An async function which is called each time - * `test` fails. Invoked with (callback). - * @param {Function} [callback] - A callback which is called after the test - * function has passed and repeated execution of `iteratee` has stopped. `callback` - * will be passed an error and any arguments passed to the final `iteratee`'s - * callback. Invoked with (err, [results]); - * @returns {Promise} a promise, if a callback is not passed - * - * @example - * const results = [] - * let finished = false - * async.until(function test(cb) { - * cb(null, finished) - * }, function iter(next) { - * fetchPage(url, (err, body) => { - * if (err) return next(err) - * results = results.concat(body.objects) - * finished = !!body.next - * next(err) - * }) - * }, function done (err) { - * // all pages have been fetched - * }) - */ - function until(test, iteratee, callback) { - const _test = wrapAsync(test); - return whilst$1((cb) => _test((err, truth) => cb (err, !truth)), iteratee, callback); - } - - /** - * Runs the `tasks` array of functions in series, each passing their results to - * the next in the array. However, if any of the `tasks` pass an error to their - * own callback, the next function is not executed, and the main `callback` is - * immediately called with the error. - * - * @name waterfall - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array} tasks - An array of [async functions]{@link AsyncFunction} - * to run. - * Each function should complete with any number of `result` values. - * The `result` values will be passed as arguments, in order, to the next task. - * @param {Function} [callback] - An optional callback to run once all the - * functions have completed. This will be passed the results of the last task's - * callback. Invoked with (err, [results]). - * @returns {Promise} a promise, if a callback is omitted - * @example - * - * async.waterfall([ - * function(callback) { - * callback(null, 'one', 'two'); - * }, - * function(arg1, arg2, callback) { - * // arg1 now equals 'one' and arg2 now equals 'two' - * callback(null, 'three'); - * }, - * function(arg1, callback) { - * // arg1 now equals 'three' - * callback(null, 'done'); - * } - * ], function (err, result) { - * // result now equals 'done' - * }); - * - * // Or, with named functions: - * async.waterfall([ - * myFirstFunction, - * mySecondFunction, - * myLastFunction, - * ], function (err, result) { - * // result now equals 'done' - * }); - * function myFirstFunction(callback) { - * callback(null, 'one', 'two'); - * } - * function mySecondFunction(arg1, arg2, callback) { - * // arg1 now equals 'one' and arg2 now equals 'two' - * callback(null, 'three'); - * } - * function myLastFunction(arg1, callback) { - * // arg1 now equals 'three' - * callback(null, 'done'); - * } - */ - function waterfall (tasks, callback) { - callback = once(callback); - if (!Array.isArray(tasks)) return callback(new Error('First argument to waterfall must be an array of functions')); - if (!tasks.length) return callback(); - var taskIndex = 0; - - function nextTask(args) { - var task = wrapAsync(tasks[taskIndex++]); - task(...args, onlyOnce(next)); - } - - function next(err, ...args) { - if (err === false) return - if (err || taskIndex === tasks.length) { - return callback(err, ...args); - } - nextTask(args); - } - - nextTask([]); - } - - var waterfall$1 = awaitify(waterfall); - - /** - * An "async function" in the context of Async is an asynchronous function with - * a variable number of parameters, with the final parameter being a callback. - * (`function (arg1, arg2, ..., callback) {}`) - * The final callback is of the form `callback(err, results...)`, which must be - * called once the function is completed. The callback should be called with a - * Error as its first argument to signal that an error occurred. - * Otherwise, if no error occurred, it should be called with `null` as the first - * argument, and any additional `result` arguments that may apply, to signal - * successful completion. - * The callback must be called exactly once, ideally on a later tick of the - * JavaScript event loop. - * - * This type of function is also referred to as a "Node-style async function", - * or a "continuation passing-style function" (CPS). Most of the methods of this - * library are themselves CPS/Node-style async functions, or functions that - * return CPS/Node-style async functions. - * - * Wherever we accept a Node-style async function, we also directly accept an - * [ES2017 `async` function]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function}. - * In this case, the `async` function will not be passed a final callback - * argument, and any thrown error will be used as the `err` argument of the - * implicit callback, and the return value will be used as the `result` value. - * (i.e. a `rejected` of the returned Promise becomes the `err` callback - * argument, and a `resolved` value becomes the `result`.) - * - * Note, due to JavaScript limitations, we can only detect native `async` - * functions and not transpilied implementations. - * Your environment must have `async`/`await` support for this to work. - * (e.g. Node > v7.6, or a recent version of a modern browser). - * If you are using `async` functions through a transpiler (e.g. Babel), you - * must still wrap the function with [asyncify]{@link module:Utils.asyncify}, - * because the `async function` will be compiled to an ordinary function that - * returns a promise. - * - * @typedef {Function} AsyncFunction - * @static - */ - - var index = { - apply, - applyEach: applyEach$1, - applyEachSeries, - asyncify, - auto, - autoInject, - cargo, - cargoQueue: cargo$1, - compose, - concat: concat$1, - concatLimit: concatLimit$1, - concatSeries: concatSeries$1, - constant, - detect: detect$1, - detectLimit: detectLimit$1, - detectSeries: detectSeries$1, - dir, - doUntil, - doWhilst: doWhilst$1, - each, - eachLimit: eachLimit$2, - eachOf: eachOf$1, - eachOfLimit: eachOfLimit$2, - eachOfSeries: eachOfSeries$1, - eachSeries: eachSeries$1, - ensureAsync, - every: every$1, - everyLimit: everyLimit$1, - everySeries: everySeries$1, - filter: filter$1, - filterLimit: filterLimit$1, - filterSeries: filterSeries$1, - forever: forever$1, - groupBy, - groupByLimit: groupByLimit$1, - groupBySeries, - log, - map: map$1, - mapLimit: mapLimit$1, - mapSeries: mapSeries$1, - mapValues, - mapValuesLimit: mapValuesLimit$1, - mapValuesSeries, - memoize, - nextTick, - parallel: parallel$1, - parallelLimit, - priorityQueue, - queue: queue$1, - race: race$1, - reduce: reduce$1, - reduceRight, - reflect, - reflectAll, - reject: reject$2, - rejectLimit: rejectLimit$1, - rejectSeries: rejectSeries$1, - retry, - retryable, - seq, - series, - setImmediate: setImmediate$1, - some: some$1, - someLimit: someLimit$1, - someSeries: someSeries$1, - sortBy: sortBy$1, - timeout, - times, - timesLimit, - timesSeries, - transform, - tryEach: tryEach$1, - unmemoize, - until, - waterfall: waterfall$1, - whilst: whilst$1, - - // aliases - all: every$1, - allLimit: everyLimit$1, - allSeries: everySeries$1, - any: some$1, - anyLimit: someLimit$1, - anySeries: someSeries$1, - find: detect$1, - findLimit: detectLimit$1, - findSeries: detectSeries$1, - flatMap: concat$1, - flatMapLimit: concatLimit$1, - flatMapSeries: concatSeries$1, - forEach: each, - forEachSeries: eachSeries$1, - forEachLimit: eachLimit$2, - forEachOf: eachOf$1, - forEachOfSeries: eachOfSeries$1, - forEachOfLimit: eachOfLimit$2, - inject: reduce$1, - foldl: reduce$1, - foldr: reduceRight, - select: filter$1, - selectLimit: filterLimit$1, - selectSeries: filterSeries$1, - wrapSync: asyncify, - during: whilst$1, - doDuring: doWhilst$1 - }; - - exports.default = index; - exports.apply = apply; - exports.applyEach = applyEach$1; - exports.applyEachSeries = applyEachSeries; - exports.asyncify = asyncify; - exports.auto = auto; - exports.autoInject = autoInject; - exports.cargo = cargo; - exports.cargoQueue = cargo$1; - exports.compose = compose; - exports.concat = concat$1; - exports.concatLimit = concatLimit$1; - exports.concatSeries = concatSeries$1; - exports.constant = constant; - exports.detect = detect$1; - exports.detectLimit = detectLimit$1; - exports.detectSeries = detectSeries$1; - exports.dir = dir; - exports.doUntil = doUntil; - exports.doWhilst = doWhilst$1; - exports.each = each; - exports.eachLimit = eachLimit$2; - exports.eachOf = eachOf$1; - exports.eachOfLimit = eachOfLimit$2; - exports.eachOfSeries = eachOfSeries$1; - exports.eachSeries = eachSeries$1; - exports.ensureAsync = ensureAsync; - exports.every = every$1; - exports.everyLimit = everyLimit$1; - exports.everySeries = everySeries$1; - exports.filter = filter$1; - exports.filterLimit = filterLimit$1; - exports.filterSeries = filterSeries$1; - exports.forever = forever$1; - exports.groupBy = groupBy; - exports.groupByLimit = groupByLimit$1; - exports.groupBySeries = groupBySeries; - exports.log = log; - exports.map = map$1; - exports.mapLimit = mapLimit$1; - exports.mapSeries = mapSeries$1; - exports.mapValues = mapValues; - exports.mapValuesLimit = mapValuesLimit$1; - exports.mapValuesSeries = mapValuesSeries; - exports.memoize = memoize; - exports.nextTick = nextTick; - exports.parallel = parallel$1; - exports.parallelLimit = parallelLimit; - exports.priorityQueue = priorityQueue; - exports.queue = queue$1; - exports.race = race$1; - exports.reduce = reduce$1; - exports.reduceRight = reduceRight; - exports.reflect = reflect; - exports.reflectAll = reflectAll; - exports.reject = reject$2; - exports.rejectLimit = rejectLimit$1; - exports.rejectSeries = rejectSeries$1; - exports.retry = retry; - exports.retryable = retryable; - exports.seq = seq; - exports.series = series; - exports.setImmediate = setImmediate$1; - exports.some = some$1; - exports.someLimit = someLimit$1; - exports.someSeries = someSeries$1; - exports.sortBy = sortBy$1; - exports.timeout = timeout; - exports.times = times; - exports.timesLimit = timesLimit; - exports.timesSeries = timesSeries; - exports.transform = transform; - exports.tryEach = tryEach$1; - exports.unmemoize = unmemoize; - exports.until = until; - exports.waterfall = waterfall$1; - exports.whilst = whilst$1; - exports.all = every$1; - exports.allLimit = everyLimit$1; - exports.allSeries = everySeries$1; - exports.any = some$1; - exports.anyLimit = someLimit$1; - exports.anySeries = someSeries$1; - exports.find = detect$1; - exports.findLimit = detectLimit$1; - exports.findSeries = detectSeries$1; - exports.flatMap = concat$1; - exports.flatMapLimit = concatLimit$1; - exports.flatMapSeries = concatSeries$1; - exports.forEach = each; - exports.forEachSeries = eachSeries$1; - exports.forEachLimit = eachLimit$2; - exports.forEachOf = eachOf$1; - exports.forEachOfSeries = eachOfSeries$1; - exports.forEachOfLimit = eachOfLimit$2; - exports.inject = reduce$1; - exports.foldl = reduce$1; - exports.foldr = reduceRight; - exports.select = filter$1; - exports.selectLimit = filterLimit$1; - exports.selectSeries = filterSeries$1; - exports.wrapSync = asyncify; - exports.during = whilst$1; - exports.doDuring = doWhilst$1; - - Object.defineProperty(exports, '__esModule', { value: true }); - -}))); diff --git a/node_modules/async/dist/async.min.js b/node_modules/async/dist/async.min.js deleted file mode 100644 index a12963b..0000000 --- a/node_modules/async/dist/async.min.js +++ /dev/null @@ -1 +0,0 @@ -(function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.async={})})(this,function(e){'use strict';function t(e,...t){return(...n)=>e(...t,...n)}function n(e){return function(...t){var n=t.pop();return e.call(this,t,n)}}function a(e){setTimeout(e,0)}function i(e){return(t,...n)=>e(()=>t(...n))}function r(e){return u(e)?function(...t){const n=t.pop(),a=e.apply(this,t);return s(a,n)}:n(function(t,n){var a;try{a=e.apply(this,t)}catch(t){return n(t)}return a&&"function"==typeof a.then?s(a,n):void n(null,a)})}function s(e,t){return e.then(e=>{l(t,null,e)},e=>{l(t,e&&e.message?e:new Error(e))})}function l(e,t,n){try{e(t,n)}catch(e){_e(t=>{throw t},e)}}function u(e){return"AsyncFunction"===e[Symbol.toStringTag]}function d(e){return"AsyncGenerator"===e[Symbol.toStringTag]}function p(e){return"function"==typeof e[Symbol.asyncIterator]}function c(e){if("function"!=typeof e)throw new Error("expected a function");return u(e)?r(e):e}function o(e,t=e.length){if(!t)throw new Error("arity is undefined");return function(...n){return"function"==typeof n[t-1]?e.apply(this,n):new Promise((a,i)=>{n[t-1]=(e,...t)=>e?i(e):void a(1{c(e).apply(i,n.concat(t))},a)});return a}}function f(e,t,n,a){t=t||[];var i=[],r=0,s=c(n);return e(t,(e,t,n)=>{var a=r++;s(e,(e,t)=>{i[a]=t,n(e)})},e=>{a(e,i)})}function y(e){return e&&"number"==typeof e.length&&0<=e.length&&0==e.length%1}function m(e){function t(...t){if(null!==e){var n=e;e=null,n.apply(this,t)}}return Object.assign(t,e),t}function g(e){return e[Symbol.iterator]&&e[Symbol.iterator]()}function k(e){var t=-1,n=e.length;return function(){return++t=t||d||l||(d=!0,e.next().then(({value:e,done:t})=>{if(!(u||l))return d=!1,t?(l=!0,void(0>=p&&a(null))):void(p++,n(e,c,r),c++,i())}).catch(s))}function r(e,t){return p-=1,u?void 0:e?s(e):!1===e?(l=!0,void(u=!0)):t===be||l&&0>=p?(l=!0,a(null)):void i()}function s(e){u||(d=!1,l=!0,a(e))}let l=!1,u=!1,d=!1,p=0,c=0;i()}function O(e,t,n){function a(e,t){!1===e&&(l=!0);!0===l||(e?n(e):(++r===s||t===be)&&n(null))}n=m(n);var i=0,r=0,{length:s}=e,l=!1;for(0===s&&n(null);i{t=e,n=a}),e}function A(e,t,n){function a(e,t){g.push(()=>l(e,t))}function i(){if(!h){if(0===g.length&&0===o)return n(null,p);for(;g.length&&oe()),i()}function l(e,t){if(!f){var a=L((t,...a)=>{if(o--,!1===t)return void(h=!0);if(2>a.length&&([a]=a),t){var i={};if(Object.keys(p).forEach(e=>{i[e]=p[e]}),i[e]=a,f=!0,y=Object.create(null),h)return;n(t,i)}else p[e]=a,s(e)});o++;var i=c(t[t.length-1]);1{const i=e[a];Array.isArray(i)&&0<=i.indexOf(t)&&n.push(a)}),n}"number"!=typeof t&&(n=t,t=null),n=m(n||b());var d=Object.keys(e).length;if(!d)return n(null);t||(t=d);var p={},o=0,h=!1,f=!1,y=Object.create(null),g=[],k=[],v={};return Object.keys(e).forEach(t=>{var n=e[t];if(!Array.isArray(n))return a(t,[n]),void k.push(t);var i=n.slice(0,n.length-1),s=i.length;return 0===s?(a(t,n),void k.push(t)):void(v[t]=s,i.forEach(l=>{if(!e[l])throw new Error("async.auto task `"+t+"` has a non-existent dependency `"+l+"` in "+i.join(", "));r(l,()=>{s--,0===s&&a(t,n)})}))}),function(){for(var e,t=0;k.length;)e=k.pop(),t++,u(e).forEach(e=>{0==--v[e]&&k.push(e)});if(t!==d)throw new Error("async.auto cannot execute tasks due to a recursive dependency")}(),i(),n[Ce]}function I(e){let t="",n=0,a=e.indexOf("*/");for(;ne.replace(Ne,"").trim())}function j(e,t){var n={};return Object.keys(e).forEach(t=>{function a(e,t){var n=i.map(t=>e[t]);n.push(t),c(r)(...n)}var i,r=e[t],s=u(r),l=!s&&1===r.length||s&&0===r.length;if(Array.isArray(r))i=[...r],r=i.pop(),n[t]=i.concat(0{r(e,n),t(...a)};f[e].push(n)}function r(e,t){return e?t?void(f[e]=f[e].filter(e=>e!==t)):f[e]=[]:Object.keys(f).forEach(e=>f[e]=[])}function s(e,...t){f[e].forEach(e=>e(...t))}function l(e,t,n,a){function i(e,...t){return e?n?s(e):r():1>=t.length?r(t[0]):void r(t)}if(null!=a&&"function"!=typeof a)throw new Error("task callback must be a function");k.started=!0;var r,s,l=k._createTaskItem(e,n?i:a||i);if(t?k._tasks.unshift(l):k._tasks.push(l),y||(y=!0,_e(()=>{y=!1,k.process()})),n||!a)return new Promise((e,t)=>{r=e,s=t})}function u(e){return function(t,...n){o-=1;for(var a=0,r=e.length;as("drain")),!0)}if(null==t)t=1;else if(0===t)throw new RangeError("Concurrency must not be zero");var p=c(e),o=0,h=[];const f={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};var y=!1;const m=e=>t=>t?void(r(e),a(e,t)):new Promise((t,n)=>{i(e,(e,a)=>e?n(e):void t(a))});var g=!1,k={_tasks:new Ve,_createTaskItem(e,t){return{data:e,callback:t}},*[Symbol.iterator](){yield*k._tasks[Symbol.iterator]()},concurrency:t,payload:n,buffer:t/4,started:!1,paused:!1,push(e,t){return Array.isArray(e)?d(e)?void 0:e.map(e=>l(e,!1,!1,t)):l(e,!1,!1,t)},pushAsync(e,t){return Array.isArray(e)?d(e)?void 0:e.map(e=>l(e,!1,!0,t)):l(e,!1,!0,t)},kill(){r(),k._tasks.empty()},unshift(e,t){return Array.isArray(e)?d(e)?void 0:e.map(e=>l(e,!0,!1,t)):l(e,!0,!1,t)},unshiftAsync(e,t){return Array.isArray(e)?d(e)?void 0:e.map(e=>l(e,!0,!0,t)):l(e,!0,!0,t)},remove(e){k._tasks.remove(e)},process(){var e=Math.min;if(!g){for(g=!0;!k.paused&&o{t.apply(n,e.concat((e,...t)=>{a(e,t)}))},(e,t)=>a(e,...t)),a[Ce]}}function P(...e){return C(...e.reverse())}function R(...e){return function(...t){var n=t.pop();return n(null,...e)}}function z(e,t){return(n,a,i,r)=>{var s,l=!1;const u=c(i);n(a,(n,a,i)=>{u(n,(a,r)=>a||!1===a?i(a):e(r)&&!s?(l=!0,s=t(!0,n),i(null,be)):void i())},e=>e?r(e):void r(null,l?s:t(!1)))}}function N(e){return(t,...n)=>c(t)(...n,(t,...n)=>{"object"==typeof console&&(t?console.error&&console.error(t):console[e]&&n.forEach(t=>console[e](t)))})}function V(e,t,n){const a=c(t);return Xe(e,(...e)=>{const t=e.pop();a(...e,(e,n)=>t(e,!n))},n)}function Y(e){return(t,n,a)=>e(t,a)}function q(e){return u(e)?e:function(...t){var n=t.pop(),a=!0;t.push((...e)=>{a?_e(()=>n(...e)):n(...e)}),e.apply(this,t),a=!1}}function D(e,t,n,a){var r=Array(t.length);e(t,(e,t,a)=>{n(e,(e,n)=>{r[t]=!!n,a(e)})},e=>{if(e)return a(e);for(var n=[],s=0;s{n(e,(n,r)=>n?a(n):void(r&&i.push({index:t,value:e}),a(n)))},e=>e?a(e):void a(null,i.sort((e,t)=>e.index-t.index).map(e=>e.value)))}function U(e,t,n,a){var i=y(t)?D:Q;return i(e,t,c(n),a)}function G(e,t,n){return ut(e,1/0,t,n)}function W(e,t,n){return ut(e,1,t,n)}function H(e,t,n){return pt(e,1/0,t,n)}function J(e,t,n){return pt(e,1,t,n)}function K(e,t=e=>e){var a=Object.create(null),r=Object.create(null),s=c(e),l=n((e,n)=>{var u=t(...e);u in a?_e(()=>n(null,...a[u])):u in r?r[u].push(n):(r[u]=[n],s(...e,(e,...t)=>{e||(a[u]=t);var n=r[u];delete r[u];for(var s=0,d=n.length;s{n(e[0],t)},t,1)}function ee(e){return(e<<1)+1}function te(e){return(e+1>>1)-1}function ne(e,t){return e.priority===t.priority?e.pushCount({data:e,priority:t})):{data:e,priority:t}}var a=$(e,t),{push:i,pushAsync:r}=a;return a._tasks=new ht,a._createTaskItem=({data:e,priority:t},n)=>({data:e,priority:t,callback:n}),a.push=function(e,t=0,a){return i(n(e,t),a)},a.pushAsync=function(e,t=0,a){return r(n(e,t),a)},delete a.unshift,delete a.unshiftAsync,a}function ie(e,t,n,a){var i=[...e].reverse();return qe(i,t,n,a)}function re(e){var t=c(e);return n(function(e,n){return e.push((e,...t)=>{let a={};if(e&&(a.error=e),0=t.length&&([i]=t),a.value=i}n(null,a)}),t.apply(this,e)})}function se(e){var t;return Array.isArray(e)?t=e.map(re):(t={},Object.keys(e).forEach(n=>{t[n]=re.call(this,e[n])})),t}function le(e,t,n,a){const i=c(n);return U(e,t,(e,t)=>{i(e,(e,n)=>{t(e,!n)})},a)}function ue(e){return function(){return e}}function de(e,t,n){function a(){r((e,...t)=>{!1===e||(e&&s++arguments.length&&"function"==typeof e?(n=t||b(),t=e):(pe(i,e),n=n||b()),"function"!=typeof t)throw new Error("Invalid arguments for async.retry");var r=c(t),s=1;return a(),n[Ce]}function pe(e,n){if("object"==typeof n)e.times=+n.times||kt,e.intervalFunc="function"==typeof n.interval?n.interval:ue(+n.interval||vt),e.errorFilter=n.errorFilter;else if("number"==typeof n||"string"==typeof n)e.times=+n||kt;else throw new Error("Invalid arguments for async.retry")}function ce(e,t){t||(t=e,e=null);let a=e&&e.arity||t.length;u(t)&&(a+=1);var i=c(t);return n((t,n)=>{function r(e){i(...t,e)}return(t.length{var s,l=!1;n.push((...e)=>{l||(r(...e),clearTimeout(s))}),s=setTimeout(function(){var t=e.name||"anonymous",n=new Error("Callback function \""+t+"\" timed out.");n.code="ETIMEDOUT",a&&(n.info=a),l=!0,r(n)},t),i(...n)})}function fe(e){for(var t=Array(e);e--;)t[e]=e;return t}function ye(e,t,n,a){var i=c(n);return De(fe(e),t,i,a)}function me(e,t,n){return ye(e,1/0,t,n)}function ge(e,t,n){return ye(e,1,t,n)}function ke(e,t,n,a){3>=arguments.length&&"function"==typeof t&&(a=n,n=t,t=Array.isArray(e)?[]:{}),a=m(a||b());var i=c(n);return Me(e,(e,n,a)=>{i(t,e,n,a)},e=>a(e,t)),a[Ce]}function ve(e){return(...t)=>(e.unmemoized||e)(...t)}function Se(e,t,n){const a=c(e);return _t(e=>a((t,n)=>e(t,!n)),t,n)}var xe,Le="function"==typeof queueMicrotask&&queueMicrotask,Ee="function"==typeof setImmediate&&setImmediate,Oe="object"==typeof process&&"function"==typeof process.nextTick;xe=Le?queueMicrotask:Ee?setImmediate:Oe?process.nextTick:a;var _e=i(xe);const be={};var Ae=e=>(t,n,a)=>{function i(e,t){if(!u)if(c-=1,e)l=!0,a(e);else if(!1===e)l=!0,u=!0;else{if(t===be||l&&0>=c)return l=!0,a(null);o||r()}}function r(){for(o=!0;c=c&&a(null));c+=1,n(t.value,t.key,L(i))}o=!1}if(a=m(a),0>=e)throw new RangeError("concurrency limit cannot be less than 1");if(!t)return a(null);if(d(t))return E(t,e,n,a);if(p(t))return E(t[Symbol.asyncIterator](),e,n,a);var s=x(t),l=!1,u=!1,c=0,o=!1;r()},Ie=o(function(e,t,n,a){return Ae(t)(e,c(n),a)},4),Me=o(function(e,t,n){var a=y(e)?O:_;return a(e,c(t),n)},3),je=o(function(e,t,n){return f(Me,e,t,n)},3),we=h(je),Be=o(function(e,t,n){return Ie(e,1,t,n)},3),Te=o(function(e,t,n){return f(Be,e,t,n)},3),Fe=h(Te);const Ce=Symbol("promiseCallback");var Pe=/^(?:async\s+)?(?:function)?\s*\w*\s*\(\s*([^)]+)\s*\)(?:\s*{)/,Re=/^(?:async\s+)?\(?\s*([^)=]+)\s*\)?(?:\s*=>)/,ze=/,/,Ne=/(=.+)?(\s*)$/;class Ve{constructor(){this.head=this.tail=null,this.length=0}removeLink(e){return e.prev?e.prev.next=e.next:this.head=e.next,e.next?e.next.prev=e.prev:this.tail=e.prev,e.prev=e.next=null,this.length-=1,e}empty(){for(;this.head;)this.shift();return this}insertAfter(e,t){t.prev=e,t.next=e.next,e.next?e.next.prev=t:this.tail=t,e.next=t,this.length+=1}insertBefore(e,t){t.prev=e.prev,t.next=e,e.prev?e.prev.next=t:this.head=t,e.prev=t,this.length+=1}unshift(e){this.head?this.insertBefore(this.head,e):w(this,e)}push(e){this.tail?this.insertAfter(this.tail,e):w(this,e)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){for(var e=this.head;e;)yield e.data,e=e.next}remove(e){for(var t=this.head;t;){var{next:n}=t;e(t)&&this.removeLink(t),t=n}return this}}var Ye,qe=o(function(e,t,n,a){a=m(a);var r=c(n);return Be(e,(e,n,a)=>{r(t,e,(e,n)=>{t=n,a(e)})},e=>a(e,t))},4),De=o(function(e,t,n,a){return f(Ae(t),e,n,a)},4),Qe=o(function(e,t,n,a){var i=c(n);return De(e,t,(e,t)=>{i(e,(e,...n)=>e?t(e):t(e,n))},(e,t)=>{for(var n=[],r=0;re,(e,t)=>t)(Me,e,t,n)},3),He=o(function(e,t,n,a){return z(e=>e,(e,t)=>t)(Ae(t),e,n,a)},4),Je=o(function(e,t,n){return z(e=>e,(e,t)=>t)(Ae(1),e,t,n)},3),Ke=N("dir"),Xe=o(function(e,t,n){function a(e,...t){return e?n(e):void(!1===e||(r=t,l(...t,i)))}function i(e,t){return e?n(e):!1===e?void 0:t?void s(a):n(null,...r)}n=L(n);var r,s=c(e),l=c(t);return i(null,!0)},3),Ze=o(function(e,t,n){return Me(e,Y(c(t)),n)},3),$e=o(function(e,t,n,a){return Ae(t)(e,Y(c(n)),a)},4),et=o(function(e,t,n){return $e(e,1,t,n)},3),tt=o(function(e,t,n){return z(e=>!e,e=>!e)(Me,e,t,n)},3),nt=o(function(e,t,n,a){return z(e=>!e,e=>!e)(Ae(t),e,n,a)},4),at=o(function(e,t,n){return z(e=>!e,e=>!e)(Be,e,t,n)},3),it=o(function(e,t,n){return U(Me,e,t,n)},3),rt=o(function(e,t,n,a){return U(Ae(t),e,n,a)},4),st=o(function(e,t,n){return U(Be,e,t,n)},3),lt=o(function(e,t){function n(e){return e?a(e):void(!1===e||i(n))}var a=L(t),i=c(q(e));return n()},2),ut=o(function(e,t,n,a){var i=c(n);return De(e,t,(e,t)=>{i(e,(n,a)=>n?t(n):t(n,{key:a,val:e}))},(e,t)=>{for(var n={},{hasOwnProperty:r}=Object.prototype,s=0;s{r(e,t,(e,a)=>e?n(e):void(i[t]=a,n(e)))},e=>a(e,i))},4);Ye=Oe?process.nextTick:Ee?setImmediate:a;var ct=i(Ye),ot=o((e,t,n)=>{var a=y(t)?[]:{};e(t,(e,t,n)=>{c(e)((e,...i)=>{2>i.length&&([i]=i),a[t]=i,n(e)})},e=>n(e,a))},3);class ht{constructor(){this.heap=[],this.pushCount=Number.MIN_SAFE_INTEGER}get length(){return this.heap.length}empty(){return this.heap=[],this}percUp(e){for(let n;0e)(Me,e,t,n)},3),xt=o(function(e,t,n,a){return z(Boolean,e=>e)(Ae(t),e,n,a)},4),Lt=o(function(e,t,n){return z(Boolean,e=>e)(Be,e,t,n)},3),Et=o(function(e,t,n){function a(e,t){var n=e.criteria,a=t.criteria;return na?1:0}var i=c(t);return je(e,(e,t)=>{i(e,(n,a)=>n?t(n):void t(n,{value:e,criteria:a}))},(e,t)=>e?n(e):void n(null,t.sort(a).map(e=>e.value)))},3),Ot=o(function(e,t){var n,a=null;return et(e,(e,t)=>{c(e)((e,...i)=>!1===e?t(e):void(2>i.length?[n]=i:n=i,a=e,t(e?null:{})))},()=>t(a,n))}),_t=o(function(e,t,n){function a(e,...t){if(e)return n(e);l=t;!1===e||s(i)}function i(e,t){return e?n(e):!1===e?void 0:t?void r(a):n(null,...l)}n=L(n);var r=c(t),s=c(e),l=[];return s(i)},3),bt=o(function(e,t){function n(t){var n=c(e[i++]);n(...t,L(a))}function a(a,...r){return!1===a?void 0:a||i===e.length?t(a,...r):void n(r)}if(t=m(t),!Array.isArray(e))return t(new Error("First argument to waterfall must be an array of functions"));if(!e.length)return t();var i=0;n([])});e.default={apply:t,applyEach:we,applyEachSeries:Fe,asyncify:r,auto:A,autoInject:j,cargo:T,cargoQueue:F,compose:P,concat:Ue,concatLimit:Qe,concatSeries:Ge,constant:R,detect:We,detectLimit:He,detectSeries:Je,dir:Ke,doUntil:V,doWhilst:Xe,each:Ze,eachLimit:$e,eachOf:Me,eachOfLimit:Ie,eachOfSeries:Be,eachSeries:et,ensureAsync:q,every:tt,everyLimit:nt,everySeries:at,filter:it,filterLimit:rt,filterSeries:st,forever:lt,groupBy:G,groupByLimit:ut,groupBySeries:W,log:dt,map:je,mapLimit:De,mapSeries:Te,mapValues:H,mapValuesLimit:pt,mapValuesSeries:J,memoize:K,nextTick:ct,parallel:X,parallelLimit:Z,priorityQueue:ae,queue:$,race:ft,reduce:qe,reduceRight:ie,reflect:re,reflectAll:se,reject:yt,rejectLimit:mt,rejectSeries:gt,retry:de,retryable:ce,seq:C,series:oe,setImmediate:_e,some:St,someLimit:xt,someSeries:Lt,sortBy:Et,timeout:he,times:me,timesLimit:ye,timesSeries:ge,transform:ke,tryEach:Ot,unmemoize:ve,until:Se,waterfall:bt,whilst:_t,all:tt,allLimit:nt,allSeries:at,any:St,anyLimit:xt,anySeries:Lt,find:We,findLimit:He,findSeries:Je,flatMap:Ue,flatMapLimit:Qe,flatMapSeries:Ge,forEach:Ze,forEachSeries:et,forEachLimit:$e,forEachOf:Me,forEachOfSeries:Be,forEachOfLimit:Ie,inject:qe,foldl:qe,foldr:ie,select:it,selectLimit:rt,selectSeries:st,wrapSync:r,during:_t,doDuring:Xe},e.apply=t,e.applyEach=we,e.applyEachSeries=Fe,e.asyncify=r,e.auto=A,e.autoInject=j,e.cargo=T,e.cargoQueue=F,e.compose=P,e.concat=Ue,e.concatLimit=Qe,e.concatSeries=Ge,e.constant=R,e.detect=We,e.detectLimit=He,e.detectSeries=Je,e.dir=Ke,e.doUntil=V,e.doWhilst=Xe,e.each=Ze,e.eachLimit=$e,e.eachOf=Me,e.eachOfLimit=Ie,e.eachOfSeries=Be,e.eachSeries=et,e.ensureAsync=q,e.every=tt,e.everyLimit=nt,e.everySeries=at,e.filter=it,e.filterLimit=rt,e.filterSeries=st,e.forever=lt,e.groupBy=G,e.groupByLimit=ut,e.groupBySeries=W,e.log=dt,e.map=je,e.mapLimit=De,e.mapSeries=Te,e.mapValues=H,e.mapValuesLimit=pt,e.mapValuesSeries=J,e.memoize=K,e.nextTick=ct,e.parallel=X,e.parallelLimit=Z,e.priorityQueue=ae,e.queue=$,e.race=ft,e.reduce=qe,e.reduceRight=ie,e.reflect=re,e.reflectAll=se,e.reject=yt,e.rejectLimit=mt,e.rejectSeries=gt,e.retry=de,e.retryable=ce,e.seq=C,e.series=oe,e.setImmediate=_e,e.some=St,e.someLimit=xt,e.someSeries=Lt,e.sortBy=Et,e.timeout=he,e.times=me,e.timesLimit=ye,e.timesSeries=ge,e.transform=ke,e.tryEach=Ot,e.unmemoize=ve,e.until=Se,e.waterfall=bt,e.whilst=_t,e.all=tt,e.allLimit=nt,e.allSeries=at,e.any=St,e.anyLimit=xt,e.anySeries=Lt,e.find=We,e.findLimit=He,e.findSeries=Je,e.flatMap=Ue,e.flatMapLimit=Qe,e.flatMapSeries=Ge,e.forEach=Ze,e.forEachSeries=et,e.forEachLimit=$e,e.forEachOf=Me,e.forEachOfSeries=Be,e.forEachOfLimit=Ie,e.inject=qe,e.foldl=qe,e.foldr=ie,e.select=it,e.selectLimit=rt,e.selectSeries=st,e.wrapSync=r,e.during=_t,e.doDuring=Xe,Object.defineProperty(e,"__esModule",{value:!0})}); \ No newline at end of file diff --git a/node_modules/async/dist/async.mjs b/node_modules/async/dist/async.mjs deleted file mode 100644 index d0cd59d..0000000 --- a/node_modules/async/dist/async.mjs +++ /dev/null @@ -1,5947 +0,0 @@ -/** - * Creates a continuation function with some arguments already applied. - * - * Useful as a shorthand when combined with other control flow functions. Any - * arguments passed to the returned function are added to the arguments - * originally passed to apply. - * - * @name apply - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {Function} fn - The function you want to eventually apply all - * arguments to. Invokes with (arguments...). - * @param {...*} arguments... - Any number of arguments to automatically apply - * when the continuation is called. - * @returns {Function} the partially-applied function - * @example - * - * // using apply - * async.parallel([ - * async.apply(fs.writeFile, 'testfile1', 'test1'), - * async.apply(fs.writeFile, 'testfile2', 'test2') - * ]); - * - * - * // the same process without using apply - * async.parallel([ - * function(callback) { - * fs.writeFile('testfile1', 'test1', callback); - * }, - * function(callback) { - * fs.writeFile('testfile2', 'test2', callback); - * } - * ]); - * - * // It's possible to pass any number of additional arguments when calling the - * // continuation: - * - * node> var fn = async.apply(sys.puts, 'one'); - * node> fn('two', 'three'); - * one - * two - * three - */ -function apply(fn, ...args) { - return (...callArgs) => fn(...args,...callArgs); -} - -function initialParams (fn) { - return function (...args/*, callback*/) { - var callback = args.pop(); - return fn.call(this, args, callback); - }; -} - -/* istanbul ignore file */ - -var hasQueueMicrotask = typeof queueMicrotask === 'function' && queueMicrotask; -var hasSetImmediate = typeof setImmediate === 'function' && setImmediate; -var hasNextTick = typeof process === 'object' && typeof process.nextTick === 'function'; - -function fallback(fn) { - setTimeout(fn, 0); -} - -function wrap(defer) { - return (fn, ...args) => defer(() => fn(...args)); -} - -var _defer; - -if (hasQueueMicrotask) { - _defer = queueMicrotask; -} else if (hasSetImmediate) { - _defer = setImmediate; -} else if (hasNextTick) { - _defer = process.nextTick; -} else { - _defer = fallback; -} - -var setImmediate$1 = wrap(_defer); - -/** - * Take a sync function and make it async, passing its return value to a - * callback. This is useful for plugging sync functions into a waterfall, - * series, or other async functions. Any arguments passed to the generated - * function will be passed to the wrapped function (except for the final - * callback argument). Errors thrown will be passed to the callback. - * - * If the function passed to `asyncify` returns a Promise, that promises's - * resolved/rejected state will be used to call the callback, rather than simply - * the synchronous return value. - * - * This also means you can asyncify ES2017 `async` functions. - * - * @name asyncify - * @static - * @memberOf module:Utils - * @method - * @alias wrapSync - * @category Util - * @param {Function} func - The synchronous function, or Promise-returning - * function to convert to an {@link AsyncFunction}. - * @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be - * invoked with `(args..., callback)`. - * @example - * - * // passing a regular synchronous function - * async.waterfall([ - * async.apply(fs.readFile, filename, "utf8"), - * async.asyncify(JSON.parse), - * function (data, next) { - * // data is the result of parsing the text. - * // If there was a parsing error, it would have been caught. - * } - * ], callback); - * - * // passing a function returning a promise - * async.waterfall([ - * async.apply(fs.readFile, filename, "utf8"), - * async.asyncify(function (contents) { - * return db.model.create(contents); - * }), - * function (model, next) { - * // `model` is the instantiated model object. - * // If there was an error, this function would be skipped. - * } - * ], callback); - * - * // es2017 example, though `asyncify` is not needed if your JS environment - * // supports async functions out of the box - * var q = async.queue(async.asyncify(async function(file) { - * var intermediateStep = await processFile(file); - * return await somePromise(intermediateStep) - * })); - * - * q.push(files); - */ -function asyncify(func) { - if (isAsync(func)) { - return function (...args/*, callback*/) { - const callback = args.pop(); - const promise = func.apply(this, args); - return handlePromise(promise, callback) - } - } - - return initialParams(function (args, callback) { - var result; - try { - result = func.apply(this, args); - } catch (e) { - return callback(e); - } - // if result is Promise object - if (result && typeof result.then === 'function') { - return handlePromise(result, callback) - } else { - callback(null, result); - } - }); -} - -function handlePromise(promise, callback) { - return promise.then(value => { - invokeCallback(callback, null, value); - }, err => { - invokeCallback(callback, err && err.message ? err : new Error(err)); - }); -} - -function invokeCallback(callback, error, value) { - try { - callback(error, value); - } catch (err) { - setImmediate$1(e => { throw e }, err); - } -} - -function isAsync(fn) { - return fn[Symbol.toStringTag] === 'AsyncFunction'; -} - -function isAsyncGenerator(fn) { - return fn[Symbol.toStringTag] === 'AsyncGenerator'; -} - -function isAsyncIterable(obj) { - return typeof obj[Symbol.asyncIterator] === 'function'; -} - -function wrapAsync(asyncFn) { - if (typeof asyncFn !== 'function') throw new Error('expected a function') - return isAsync(asyncFn) ? asyncify(asyncFn) : asyncFn; -} - -// conditionally promisify a function. -// only return a promise if a callback is omitted -function awaitify (asyncFn, arity = asyncFn.length) { - if (!arity) throw new Error('arity is undefined') - function awaitable (...args) { - if (typeof args[arity - 1] === 'function') { - return asyncFn.apply(this, args) - } - - return new Promise((resolve, reject) => { - args[arity - 1] = (err, ...cbArgs) => { - if (err) return reject(err) - resolve(cbArgs.length > 1 ? cbArgs : cbArgs[0]); - }; - asyncFn.apply(this, args); - }) - } - - return awaitable -} - -function applyEach (eachfn) { - return function applyEach(fns, ...callArgs) { - const go = awaitify(function (callback) { - var that = this; - return eachfn(fns, (fn, cb) => { - wrapAsync(fn).apply(that, callArgs.concat(cb)); - }, callback); - }); - return go; - }; -} - -function _asyncMap(eachfn, arr, iteratee, callback) { - arr = arr || []; - var results = []; - var counter = 0; - var _iteratee = wrapAsync(iteratee); - - return eachfn(arr, (value, _, iterCb) => { - var index = counter++; - _iteratee(value, (err, v) => { - results[index] = v; - iterCb(err); - }); - }, err => { - callback(err, results); - }); -} - -function isArrayLike(value) { - return value && - typeof value.length === 'number' && - value.length >= 0 && - value.length % 1 === 0; -} - -// A temporary value used to identify if the loop should be broken. -// See #1064, #1293 -const breakLoop = {}; - -function once(fn) { - function wrapper (...args) { - if (fn === null) return; - var callFn = fn; - fn = null; - callFn.apply(this, args); - } - Object.assign(wrapper, fn); - return wrapper -} - -function getIterator (coll) { - return coll[Symbol.iterator] && coll[Symbol.iterator](); -} - -function createArrayIterator(coll) { - var i = -1; - var len = coll.length; - return function next() { - return ++i < len ? {value: coll[i], key: i} : null; - } -} - -function createES2015Iterator(iterator) { - var i = -1; - return function next() { - var item = iterator.next(); - if (item.done) - return null; - i++; - return {value: item.value, key: i}; - } -} - -function createObjectIterator(obj) { - var okeys = obj ? Object.keys(obj) : []; - var i = -1; - var len = okeys.length; - return function next() { - var key = okeys[++i]; - if (key === '__proto__') { - return next(); - } - return i < len ? {value: obj[key], key} : null; - }; -} - -function createIterator(coll) { - if (isArrayLike(coll)) { - return createArrayIterator(coll); - } - - var iterator = getIterator(coll); - return iterator ? createES2015Iterator(iterator) : createObjectIterator(coll); -} - -function onlyOnce(fn) { - return function (...args) { - if (fn === null) throw new Error("Callback was already called."); - var callFn = fn; - fn = null; - callFn.apply(this, args); - }; -} - -// for async generators -function asyncEachOfLimit(generator, limit, iteratee, callback) { - let done = false; - let canceled = false; - let awaiting = false; - let running = 0; - let idx = 0; - - function replenish() { - //console.log('replenish') - if (running >= limit || awaiting || done) return - //console.log('replenish awaiting') - awaiting = true; - generator.next().then(({value, done: iterDone}) => { - //console.log('got value', value) - if (canceled || done) return - awaiting = false; - if (iterDone) { - done = true; - if (running <= 0) { - //console.log('done nextCb') - callback(null); - } - return; - } - running++; - iteratee(value, idx, iterateeCallback); - idx++; - replenish(); - }).catch(handleError); - } - - function iterateeCallback(err, result) { - //console.log('iterateeCallback') - running -= 1; - if (canceled) return - if (err) return handleError(err) - - if (err === false) { - done = true; - canceled = true; - return - } - - if (result === breakLoop || (done && running <= 0)) { - done = true; - //console.log('done iterCb') - return callback(null); - } - replenish(); - } - - function handleError(err) { - if (canceled) return - awaiting = false; - done = true; - callback(err); - } - - replenish(); -} - -var eachOfLimit = (limit) => { - return (obj, iteratee, callback) => { - callback = once(callback); - if (limit <= 0) { - throw new RangeError('concurrency limit cannot be less than 1') - } - if (!obj) { - return callback(null); - } - if (isAsyncGenerator(obj)) { - return asyncEachOfLimit(obj, limit, iteratee, callback) - } - if (isAsyncIterable(obj)) { - return asyncEachOfLimit(obj[Symbol.asyncIterator](), limit, iteratee, callback) - } - var nextElem = createIterator(obj); - var done = false; - var canceled = false; - var running = 0; - var looping = false; - - function iterateeCallback(err, value) { - if (canceled) return - running -= 1; - if (err) { - done = true; - callback(err); - } - else if (err === false) { - done = true; - canceled = true; - } - else if (value === breakLoop || (done && running <= 0)) { - done = true; - return callback(null); - } - else if (!looping) { - replenish(); - } - } - - function replenish () { - looping = true; - while (running < limit && !done) { - var elem = nextElem(); - if (elem === null) { - done = true; - if (running <= 0) { - callback(null); - } - return; - } - running += 1; - iteratee(elem.value, elem.key, onlyOnce(iterateeCallback)); - } - looping = false; - } - - replenish(); - }; -}; - -/** - * The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a - * time. - * - * @name eachOfLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.eachOf]{@link module:Collections.eachOf} - * @alias forEachOfLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each - * item in `coll`. The `key` is the item's key, or index in the case of an - * array. - * Invoked with (item, key, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - */ -function eachOfLimit$1(coll, limit, iteratee, callback) { - return eachOfLimit(limit)(coll, wrapAsync(iteratee), callback); -} - -var eachOfLimit$2 = awaitify(eachOfLimit$1, 4); - -// eachOf implementation optimized for array-likes -function eachOfArrayLike(coll, iteratee, callback) { - callback = once(callback); - var index = 0, - completed = 0, - {length} = coll, - canceled = false; - if (length === 0) { - callback(null); - } - - function iteratorCallback(err, value) { - if (err === false) { - canceled = true; - } - if (canceled === true) return - if (err) { - callback(err); - } else if ((++completed === length) || value === breakLoop) { - callback(null); - } - } - - for (; index < length; index++) { - iteratee(coll[index], index, onlyOnce(iteratorCallback)); - } -} - -// a generic version of eachOf which can handle array, object, and iterator cases. -function eachOfGeneric (coll, iteratee, callback) { - return eachOfLimit$2(coll, Infinity, iteratee, callback); -} - -/** - * Like [`each`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument - * to the iteratee. - * - * @name eachOf - * @static - * @memberOf module:Collections - * @method - * @alias forEachOf - * @category Collection - * @see [async.each]{@link module:Collections.each} - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each - * item in `coll`. - * The `key` is the item's key, or index in the case of an array. - * Invoked with (item, key, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - * @example - * - * // dev.json is a file containing a valid json object config for dev environment - * // dev.json is a file containing a valid json object config for test environment - * // prod.json is a file containing a valid json object config for prod environment - * // invalid.json is a file with a malformed json object - * - * let configs = {}; //global variable - * let validConfigFileMap = {dev: 'dev.json', test: 'test.json', prod: 'prod.json'}; - * let invalidConfigFileMap = {dev: 'dev.json', test: 'test.json', invalid: 'invalid.json'}; - * - * // asynchronous function that reads a json file and parses the contents as json object - * function parseFile(file, key, callback) { - * fs.readFile(file, "utf8", function(err, data) { - * if (err) return calback(err); - * try { - * configs[key] = JSON.parse(data); - * } catch (e) { - * return callback(e); - * } - * callback(); - * }); - * } - * - * // Using callbacks - * async.forEachOf(validConfigFileMap, parseFile, function (err) { - * if (err) { - * console.error(err); - * } else { - * console.log(configs); - * // configs is now a map of JSON data, e.g. - * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} - * } - * }); - * - * //Error handing - * async.forEachOf(invalidConfigFileMap, parseFile, function (err) { - * if (err) { - * console.error(err); - * // JSON parse error exception - * } else { - * console.log(configs); - * } - * }); - * - * // Using Promises - * async.forEachOf(validConfigFileMap, parseFile) - * .then( () => { - * console.log(configs); - * // configs is now a map of JSON data, e.g. - * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} - * }).catch( err => { - * console.error(err); - * }); - * - * //Error handing - * async.forEachOf(invalidConfigFileMap, parseFile) - * .then( () => { - * console.log(configs); - * }).catch( err => { - * console.error(err); - * // JSON parse error exception - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.forEachOf(validConfigFileMap, parseFile); - * console.log(configs); - * // configs is now a map of JSON data, e.g. - * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} - * } - * catch (err) { - * console.log(err); - * } - * } - * - * //Error handing - * async () => { - * try { - * let result = await async.forEachOf(invalidConfigFileMap, parseFile); - * console.log(configs); - * } - * catch (err) { - * console.log(err); - * // JSON parse error exception - * } - * } - * - */ -function eachOf(coll, iteratee, callback) { - var eachOfImplementation = isArrayLike(coll) ? eachOfArrayLike : eachOfGeneric; - return eachOfImplementation(coll, wrapAsync(iteratee), callback); -} - -var eachOf$1 = awaitify(eachOf, 3); - -/** - * Produces a new collection of values by mapping each value in `coll` through - * the `iteratee` function. The `iteratee` is called with an item from `coll` - * and a callback for when it has finished processing. Each of these callbacks - * takes 2 arguments: an `error`, and the transformed item from `coll`. If - * `iteratee` passes an error to its callback, the main `callback` (for the - * `map` function) is immediately called with the error. - * - * Note, that since this function applies the `iteratee` to each item in - * parallel, there is no guarantee that the `iteratee` functions will complete - * in order. However, the results array will be in the same order as the - * original `coll`. - * - * If `map` is passed an Object, the results will be an Array. The results - * will roughly be in the order of the original Objects' keys (but this can - * vary across JavaScript engines). - * - * @name map - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with the transformed item. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Results is an Array of the - * transformed items from the `coll`. Invoked with (err, results). - * @returns {Promise} a promise, if no callback is passed - * @example - * - * // file1.txt is a file that is 1000 bytes in size - * // file2.txt is a file that is 2000 bytes in size - * // file3.txt is a file that is 3000 bytes in size - * // file4.txt does not exist - * - * const fileList = ['file1.txt','file2.txt','file3.txt']; - * const withMissingFileList = ['file1.txt','file2.txt','file4.txt']; - * - * // asynchronous function that returns the file size in bytes - * function getFileSizeInBytes(file, callback) { - * fs.stat(file, function(err, stat) { - * if (err) { - * return callback(err); - * } - * callback(null, stat.size); - * }); - * } - * - * // Using callbacks - * async.map(fileList, getFileSizeInBytes, function(err, results) { - * if (err) { - * console.log(err); - * } else { - * console.log(results); - * // results is now an array of the file size in bytes for each file, e.g. - * // [ 1000, 2000, 3000] - * } - * }); - * - * // Error Handling - * async.map(withMissingFileList, getFileSizeInBytes, function(err, results) { - * if (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } else { - * console.log(results); - * } - * }); - * - * // Using Promises - * async.map(fileList, getFileSizeInBytes) - * .then( results => { - * console.log(results); - * // results is now an array of the file size in bytes for each file, e.g. - * // [ 1000, 2000, 3000] - * }).catch( err => { - * console.log(err); - * }); - * - * // Error Handling - * async.map(withMissingFileList, getFileSizeInBytes) - * .then( results => { - * console.log(results); - * }).catch( err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * }); - * - * // Using async/await - * async () => { - * try { - * let results = await async.map(fileList, getFileSizeInBytes); - * console.log(results); - * // results is now an array of the file size in bytes for each file, e.g. - * // [ 1000, 2000, 3000] - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // Error Handling - * async () => { - * try { - * let results = await async.map(withMissingFileList, getFileSizeInBytes); - * console.log(results); - * } - * catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } - * } - * - */ -function map (coll, iteratee, callback) { - return _asyncMap(eachOf$1, coll, iteratee, callback) -} -var map$1 = awaitify(map, 3); - -/** - * Applies the provided arguments to each function in the array, calling - * `callback` after all functions have completed. If you only provide the first - * argument, `fns`, then it will return a function which lets you pass in the - * arguments as if it were a single function call. If more arguments are - * provided, `callback` is required while `args` is still optional. The results - * for each of the applied async functions are passed to the final callback - * as an array. - * - * @name applyEach - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array|Iterable|AsyncIterable|Object} fns - A collection of {@link AsyncFunction}s - * to all call with the same arguments - * @param {...*} [args] - any number of separate arguments to pass to the - * function. - * @param {Function} [callback] - the final argument should be the callback, - * called when all functions have completed processing. - * @returns {AsyncFunction} - Returns a function that takes no args other than - * an optional callback, that is the result of applying the `args` to each - * of the functions. - * @example - * - * const appliedFn = async.applyEach([enableSearch, updateSchema], 'bucket') - * - * appliedFn((err, results) => { - * // results[0] is the results for `enableSearch` - * // results[1] is the results for `updateSchema` - * }); - * - * // partial application example: - * async.each( - * buckets, - * async (bucket) => async.applyEach([enableSearch, updateSchema], bucket)(), - * callback - * ); - */ -var applyEach$1 = applyEach(map$1); - -/** - * The same as [`eachOf`]{@link module:Collections.eachOf} but runs only a single async operation at a time. - * - * @name eachOfSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.eachOf]{@link module:Collections.eachOf} - * @alias forEachOfSeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * Invoked with (item, key, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - */ -function eachOfSeries(coll, iteratee, callback) { - return eachOfLimit$2(coll, 1, iteratee, callback) -} -var eachOfSeries$1 = awaitify(eachOfSeries, 3); - -/** - * The same as [`map`]{@link module:Collections.map} but runs only a single async operation at a time. - * - * @name mapSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.map]{@link module:Collections.map} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with the transformed item. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Results is an array of the - * transformed items from the `coll`. Invoked with (err, results). - * @returns {Promise} a promise, if no callback is passed - */ -function mapSeries (coll, iteratee, callback) { - return _asyncMap(eachOfSeries$1, coll, iteratee, callback) -} -var mapSeries$1 = awaitify(mapSeries, 3); - -/** - * The same as [`applyEach`]{@link module:ControlFlow.applyEach} but runs only a single async operation at a time. - * - * @name applyEachSeries - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.applyEach]{@link module:ControlFlow.applyEach} - * @category Control Flow - * @param {Array|Iterable|AsyncIterable|Object} fns - A collection of {@link AsyncFunction}s to all - * call with the same arguments - * @param {...*} [args] - any number of separate arguments to pass to the - * function. - * @param {Function} [callback] - the final argument should be the callback, - * called when all functions have completed processing. - * @returns {AsyncFunction} - A function, that when called, is the result of - * appling the `args` to the list of functions. It takes no args, other than - * a callback. - */ -var applyEachSeries = applyEach(mapSeries$1); - -const PROMISE_SYMBOL = Symbol('promiseCallback'); - -function promiseCallback () { - let resolve, reject; - function callback (err, ...args) { - if (err) return reject(err) - resolve(args.length > 1 ? args : args[0]); - } - - callback[PROMISE_SYMBOL] = new Promise((res, rej) => { - resolve = res, - reject = rej; - }); - - return callback -} - -/** - * Determines the best order for running the {@link AsyncFunction}s in `tasks`, based on - * their requirements. Each function can optionally depend on other functions - * being completed first, and each function is run as soon as its requirements - * are satisfied. - * - * If any of the {@link AsyncFunction}s pass an error to their callback, the `auto` sequence - * will stop. Further tasks will not execute (so any other functions depending - * on it will not run), and the main `callback` is immediately called with the - * error. - * - * {@link AsyncFunction}s also receive an object containing the results of functions which - * have completed so far as the first argument, if they have dependencies. If a - * task function has no dependencies, it will only be passed a callback. - * - * @name auto - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Object} tasks - An object. Each of its properties is either a - * function or an array of requirements, with the {@link AsyncFunction} itself the last item - * in the array. The object's key of a property serves as the name of the task - * defined by that property, i.e. can be used when specifying requirements for - * other tasks. The function receives one or two arguments: - * * a `results` object, containing the results of the previously executed - * functions, only passed if the task has any dependencies, - * * a `callback(err, result)` function, which must be called when finished, - * passing an `error` (which can be `null`) and the result of the function's - * execution. - * @param {number} [concurrency=Infinity] - An optional `integer` for - * determining the maximum number of tasks that can be run in parallel. By - * default, as many as possible. - * @param {Function} [callback] - An optional callback which is called when all - * the tasks have been completed. It receives the `err` argument if any `tasks` - * pass an error to their callback. Results are always returned; however, if an - * error occurs, no further `tasks` will be performed, and the results object - * will only contain partial results. Invoked with (err, results). - * @returns {Promise} a promise, if a callback is not passed - * @example - * - * //Using Callbacks - * async.auto({ - * get_data: function(callback) { - * // async code to get some data - * callback(null, 'data', 'converted to array'); - * }, - * make_folder: function(callback) { - * // async code to create a directory to store a file in - * // this is run at the same time as getting the data - * callback(null, 'folder'); - * }, - * write_file: ['get_data', 'make_folder', function(results, callback) { - * // once there is some data and the directory exists, - * // write the data to a file in the directory - * callback(null, 'filename'); - * }], - * email_link: ['write_file', function(results, callback) { - * // once the file is written let's email a link to it... - * callback(null, {'file':results.write_file, 'email':'user@example.com'}); - * }] - * }, function(err, results) { - * if (err) { - * console.log('err = ', err); - * } - * console.log('results = ', results); - * // results = { - * // get_data: ['data', 'converted to array'] - * // make_folder; 'folder', - * // write_file: 'filename' - * // email_link: { file: 'filename', email: 'user@example.com' } - * // } - * }); - * - * //Using Promises - * async.auto({ - * get_data: function(callback) { - * console.log('in get_data'); - * // async code to get some data - * callback(null, 'data', 'converted to array'); - * }, - * make_folder: function(callback) { - * console.log('in make_folder'); - * // async code to create a directory to store a file in - * // this is run at the same time as getting the data - * callback(null, 'folder'); - * }, - * write_file: ['get_data', 'make_folder', function(results, callback) { - * // once there is some data and the directory exists, - * // write the data to a file in the directory - * callback(null, 'filename'); - * }], - * email_link: ['write_file', function(results, callback) { - * // once the file is written let's email a link to it... - * callback(null, {'file':results.write_file, 'email':'user@example.com'}); - * }] - * }).then(results => { - * console.log('results = ', results); - * // results = { - * // get_data: ['data', 'converted to array'] - * // make_folder; 'folder', - * // write_file: 'filename' - * // email_link: { file: 'filename', email: 'user@example.com' } - * // } - * }).catch(err => { - * console.log('err = ', err); - * }); - * - * //Using async/await - * async () => { - * try { - * let results = await async.auto({ - * get_data: function(callback) { - * // async code to get some data - * callback(null, 'data', 'converted to array'); - * }, - * make_folder: function(callback) { - * // async code to create a directory to store a file in - * // this is run at the same time as getting the data - * callback(null, 'folder'); - * }, - * write_file: ['get_data', 'make_folder', function(results, callback) { - * // once there is some data and the directory exists, - * // write the data to a file in the directory - * callback(null, 'filename'); - * }], - * email_link: ['write_file', function(results, callback) { - * // once the file is written let's email a link to it... - * callback(null, {'file':results.write_file, 'email':'user@example.com'}); - * }] - * }); - * console.log('results = ', results); - * // results = { - * // get_data: ['data', 'converted to array'] - * // make_folder; 'folder', - * // write_file: 'filename' - * // email_link: { file: 'filename', email: 'user@example.com' } - * // } - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function auto(tasks, concurrency, callback) { - if (typeof concurrency !== 'number') { - // concurrency is optional, shift the args. - callback = concurrency; - concurrency = null; - } - callback = once(callback || promiseCallback()); - var numTasks = Object.keys(tasks).length; - if (!numTasks) { - return callback(null); - } - if (!concurrency) { - concurrency = numTasks; - } - - var results = {}; - var runningTasks = 0; - var canceled = false; - var hasError = false; - - var listeners = Object.create(null); - - var readyTasks = []; - - // for cycle detection: - var readyToCheck = []; // tasks that have been identified as reachable - // without the possibility of returning to an ancestor task - var uncheckedDependencies = {}; - - Object.keys(tasks).forEach(key => { - var task = tasks[key]; - if (!Array.isArray(task)) { - // no dependencies - enqueueTask(key, [task]); - readyToCheck.push(key); - return; - } - - var dependencies = task.slice(0, task.length - 1); - var remainingDependencies = dependencies.length; - if (remainingDependencies === 0) { - enqueueTask(key, task); - readyToCheck.push(key); - return; - } - uncheckedDependencies[key] = remainingDependencies; - - dependencies.forEach(dependencyName => { - if (!tasks[dependencyName]) { - throw new Error('async.auto task `' + key + - '` has a non-existent dependency `' + - dependencyName + '` in ' + - dependencies.join(', ')); - } - addListener(dependencyName, () => { - remainingDependencies--; - if (remainingDependencies === 0) { - enqueueTask(key, task); - } - }); - }); - }); - - checkForDeadlocks(); - processQueue(); - - function enqueueTask(key, task) { - readyTasks.push(() => runTask(key, task)); - } - - function processQueue() { - if (canceled) return - if (readyTasks.length === 0 && runningTasks === 0) { - return callback(null, results); - } - while(readyTasks.length && runningTasks < concurrency) { - var run = readyTasks.shift(); - run(); - } - - } - - function addListener(taskName, fn) { - var taskListeners = listeners[taskName]; - if (!taskListeners) { - taskListeners = listeners[taskName] = []; - } - - taskListeners.push(fn); - } - - function taskComplete(taskName) { - var taskListeners = listeners[taskName] || []; - taskListeners.forEach(fn => fn()); - processQueue(); - } - - - function runTask(key, task) { - if (hasError) return; - - var taskCallback = onlyOnce((err, ...result) => { - runningTasks--; - if (err === false) { - canceled = true; - return - } - if (result.length < 2) { - [result] = result; - } - if (err) { - var safeResults = {}; - Object.keys(results).forEach(rkey => { - safeResults[rkey] = results[rkey]; - }); - safeResults[key] = result; - hasError = true; - listeners = Object.create(null); - if (canceled) return - callback(err, safeResults); - } else { - results[key] = result; - taskComplete(key); - } - }); - - runningTasks++; - var taskFn = wrapAsync(task[task.length - 1]); - if (task.length > 1) { - taskFn(results, taskCallback); - } else { - taskFn(taskCallback); - } - } - - function checkForDeadlocks() { - // Kahn's algorithm - // https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm - // http://connalle.blogspot.com/2013/10/topological-sortingkahn-algorithm.html - var currentTask; - var counter = 0; - while (readyToCheck.length) { - currentTask = readyToCheck.pop(); - counter++; - getDependents(currentTask).forEach(dependent => { - if (--uncheckedDependencies[dependent] === 0) { - readyToCheck.push(dependent); - } - }); - } - - if (counter !== numTasks) { - throw new Error( - 'async.auto cannot execute tasks due to a recursive dependency' - ); - } - } - - function getDependents(taskName) { - var result = []; - Object.keys(tasks).forEach(key => { - const task = tasks[key]; - if (Array.isArray(task) && task.indexOf(taskName) >= 0) { - result.push(key); - } - }); - return result; - } - - return callback[PROMISE_SYMBOL] -} - -var FN_ARGS = /^(?:async\s+)?(?:function)?\s*\w*\s*\(\s*([^)]+)\s*\)(?:\s*{)/; -var ARROW_FN_ARGS = /^(?:async\s+)?\(?\s*([^)=]+)\s*\)?(?:\s*=>)/; -var FN_ARG_SPLIT = /,/; -var FN_ARG = /(=.+)?(\s*)$/; - -function stripComments(string) { - let stripped = ''; - let index = 0; - let endBlockComment = string.indexOf('*/'); - while (index < string.length) { - if (string[index] === '/' && string[index+1] === '/') { - // inline comment - let endIndex = string.indexOf('\n', index); - index = (endIndex === -1) ? string.length : endIndex; - } else if ((endBlockComment !== -1) && (string[index] === '/') && (string[index+1] === '*')) { - // block comment - let endIndex = string.indexOf('*/', index); - if (endIndex !== -1) { - index = endIndex + 2; - endBlockComment = string.indexOf('*/', index); - } else { - stripped += string[index]; - index++; - } - } else { - stripped += string[index]; - index++; - } - } - return stripped; -} - -function parseParams(func) { - const src = stripComments(func.toString()); - let match = src.match(FN_ARGS); - if (!match) { - match = src.match(ARROW_FN_ARGS); - } - if (!match) throw new Error('could not parse args in autoInject\nSource:\n' + src) - let [, args] = match; - return args - .replace(/\s/g, '') - .split(FN_ARG_SPLIT) - .map((arg) => arg.replace(FN_ARG, '').trim()); -} - -/** - * A dependency-injected version of the [async.auto]{@link module:ControlFlow.auto} function. Dependent - * tasks are specified as parameters to the function, after the usual callback - * parameter, with the parameter names matching the names of the tasks it - * depends on. This can provide even more readable task graphs which can be - * easier to maintain. - * - * If a final callback is specified, the task results are similarly injected, - * specified as named parameters after the initial error parameter. - * - * The autoInject function is purely syntactic sugar and its semantics are - * otherwise equivalent to [async.auto]{@link module:ControlFlow.auto}. - * - * @name autoInject - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.auto]{@link module:ControlFlow.auto} - * @category Control Flow - * @param {Object} tasks - An object, each of whose properties is an {@link AsyncFunction} of - * the form 'func([dependencies...], callback). The object's key of a property - * serves as the name of the task defined by that property, i.e. can be used - * when specifying requirements for other tasks. - * * The `callback` parameter is a `callback(err, result)` which must be called - * when finished, passing an `error` (which can be `null`) and the result of - * the function's execution. The remaining parameters name other tasks on - * which the task is dependent, and the results from those tasks are the - * arguments of those parameters. - * @param {Function} [callback] - An optional callback which is called when all - * the tasks have been completed. It receives the `err` argument if any `tasks` - * pass an error to their callback, and a `results` object with any completed - * task results, similar to `auto`. - * @returns {Promise} a promise, if no callback is passed - * @example - * - * // The example from `auto` can be rewritten as follows: - * async.autoInject({ - * get_data: function(callback) { - * // async code to get some data - * callback(null, 'data', 'converted to array'); - * }, - * make_folder: function(callback) { - * // async code to create a directory to store a file in - * // this is run at the same time as getting the data - * callback(null, 'folder'); - * }, - * write_file: function(get_data, make_folder, callback) { - * // once there is some data and the directory exists, - * // write the data to a file in the directory - * callback(null, 'filename'); - * }, - * email_link: function(write_file, callback) { - * // once the file is written let's email a link to it... - * // write_file contains the filename returned by write_file. - * callback(null, {'file':write_file, 'email':'user@example.com'}); - * } - * }, function(err, results) { - * console.log('err = ', err); - * console.log('email_link = ', results.email_link); - * }); - * - * // If you are using a JS minifier that mangles parameter names, `autoInject` - * // will not work with plain functions, since the parameter names will be - * // collapsed to a single letter identifier. To work around this, you can - * // explicitly specify the names of the parameters your task function needs - * // in an array, similar to Angular.js dependency injection. - * - * // This still has an advantage over plain `auto`, since the results a task - * // depends on are still spread into arguments. - * async.autoInject({ - * //... - * write_file: ['get_data', 'make_folder', function(get_data, make_folder, callback) { - * callback(null, 'filename'); - * }], - * email_link: ['write_file', function(write_file, callback) { - * callback(null, {'file':write_file, 'email':'user@example.com'}); - * }] - * //... - * }, function(err, results) { - * console.log('err = ', err); - * console.log('email_link = ', results.email_link); - * }); - */ -function autoInject(tasks, callback) { - var newTasks = {}; - - Object.keys(tasks).forEach(key => { - var taskFn = tasks[key]; - var params; - var fnIsAsync = isAsync(taskFn); - var hasNoDeps = - (!fnIsAsync && taskFn.length === 1) || - (fnIsAsync && taskFn.length === 0); - - if (Array.isArray(taskFn)) { - params = [...taskFn]; - taskFn = params.pop(); - - newTasks[key] = params.concat(params.length > 0 ? newTask : taskFn); - } else if (hasNoDeps) { - // no dependencies, use the function as-is - newTasks[key] = taskFn; - } else { - params = parseParams(taskFn); - if ((taskFn.length === 0 && !fnIsAsync) && params.length === 0) { - throw new Error("autoInject task functions require explicit parameters."); - } - - // remove callback param - if (!fnIsAsync) params.pop(); - - newTasks[key] = params.concat(newTask); - } - - function newTask(results, taskCb) { - var newArgs = params.map(name => results[name]); - newArgs.push(taskCb); - wrapAsync(taskFn)(...newArgs); - } - }); - - return auto(newTasks, callback); -} - -// Simple doubly linked list (https://en.wikipedia.org/wiki/Doubly_linked_list) implementation -// used for queues. This implementation assumes that the node provided by the user can be modified -// to adjust the next and last properties. We implement only the minimal functionality -// for queue support. -class DLL { - constructor() { - this.head = this.tail = null; - this.length = 0; - } - - removeLink(node) { - if (node.prev) node.prev.next = node.next; - else this.head = node.next; - if (node.next) node.next.prev = node.prev; - else this.tail = node.prev; - - node.prev = node.next = null; - this.length -= 1; - return node; - } - - empty () { - while(this.head) this.shift(); - return this; - } - - insertAfter(node, newNode) { - newNode.prev = node; - newNode.next = node.next; - if (node.next) node.next.prev = newNode; - else this.tail = newNode; - node.next = newNode; - this.length += 1; - } - - insertBefore(node, newNode) { - newNode.prev = node.prev; - newNode.next = node; - if (node.prev) node.prev.next = newNode; - else this.head = newNode; - node.prev = newNode; - this.length += 1; - } - - unshift(node) { - if (this.head) this.insertBefore(this.head, node); - else setInitial(this, node); - } - - push(node) { - if (this.tail) this.insertAfter(this.tail, node); - else setInitial(this, node); - } - - shift() { - return this.head && this.removeLink(this.head); - } - - pop() { - return this.tail && this.removeLink(this.tail); - } - - toArray() { - return [...this] - } - - *[Symbol.iterator] () { - var cur = this.head; - while (cur) { - yield cur.data; - cur = cur.next; - } - } - - remove (testFn) { - var curr = this.head; - while(curr) { - var {next} = curr; - if (testFn(curr)) { - this.removeLink(curr); - } - curr = next; - } - return this; - } -} - -function setInitial(dll, node) { - dll.length = 1; - dll.head = dll.tail = node; -} - -function queue(worker, concurrency, payload) { - if (concurrency == null) { - concurrency = 1; - } - else if(concurrency === 0) { - throw new RangeError('Concurrency must not be zero'); - } - - var _worker = wrapAsync(worker); - var numRunning = 0; - var workersList = []; - const events = { - error: [], - drain: [], - saturated: [], - unsaturated: [], - empty: [] - }; - - function on (event, handler) { - events[event].push(handler); - } - - function once (event, handler) { - const handleAndRemove = (...args) => { - off(event, handleAndRemove); - handler(...args); - }; - events[event].push(handleAndRemove); - } - - function off (event, handler) { - if (!event) return Object.keys(events).forEach(ev => events[ev] = []) - if (!handler) return events[event] = [] - events[event] = events[event].filter(ev => ev !== handler); - } - - function trigger (event, ...args) { - events[event].forEach(handler => handler(...args)); - } - - var processingScheduled = false; - function _insert(data, insertAtFront, rejectOnError, callback) { - if (callback != null && typeof callback !== 'function') { - throw new Error('task callback must be a function'); - } - q.started = true; - - var res, rej; - function promiseCallback (err, ...args) { - // we don't care about the error, let the global error handler - // deal with it - if (err) return rejectOnError ? rej(err) : res() - if (args.length <= 1) return res(args[0]) - res(args); - } - - var item = q._createTaskItem( - data, - rejectOnError ? promiseCallback : - (callback || promiseCallback) - ); - - if (insertAtFront) { - q._tasks.unshift(item); - } else { - q._tasks.push(item); - } - - if (!processingScheduled) { - processingScheduled = true; - setImmediate$1(() => { - processingScheduled = false; - q.process(); - }); - } - - if (rejectOnError || !callback) { - return new Promise((resolve, reject) => { - res = resolve; - rej = reject; - }) - } - } - - function _createCB(tasks) { - return function (err, ...args) { - numRunning -= 1; - - for (var i = 0, l = tasks.length; i < l; i++) { - var task = tasks[i]; - - var index = workersList.indexOf(task); - if (index === 0) { - workersList.shift(); - } else if (index > 0) { - workersList.splice(index, 1); - } - - task.callback(err, ...args); - - if (err != null) { - trigger('error', err, task.data); - } - } - - if (numRunning <= (q.concurrency - q.buffer) ) { - trigger('unsaturated'); - } - - if (q.idle()) { - trigger('drain'); - } - q.process(); - }; - } - - function _maybeDrain(data) { - if (data.length === 0 && q.idle()) { - // call drain immediately if there are no tasks - setImmediate$1(() => trigger('drain')); - return true - } - return false - } - - const eventMethod = (name) => (handler) => { - if (!handler) { - return new Promise((resolve, reject) => { - once(name, (err, data) => { - if (err) return reject(err) - resolve(data); - }); - }) - } - off(name); - on(name, handler); - - }; - - var isProcessing = false; - var q = { - _tasks: new DLL(), - _createTaskItem (data, callback) { - return { - data, - callback - }; - }, - *[Symbol.iterator] () { - yield* q._tasks[Symbol.iterator](); - }, - concurrency, - payload, - buffer: concurrency / 4, - started: false, - paused: false, - push (data, callback) { - if (Array.isArray(data)) { - if (_maybeDrain(data)) return - return data.map(datum => _insert(datum, false, false, callback)) - } - return _insert(data, false, false, callback); - }, - pushAsync (data, callback) { - if (Array.isArray(data)) { - if (_maybeDrain(data)) return - return data.map(datum => _insert(datum, false, true, callback)) - } - return _insert(data, false, true, callback); - }, - kill () { - off(); - q._tasks.empty(); - }, - unshift (data, callback) { - if (Array.isArray(data)) { - if (_maybeDrain(data)) return - return data.map(datum => _insert(datum, true, false, callback)) - } - return _insert(data, true, false, callback); - }, - unshiftAsync (data, callback) { - if (Array.isArray(data)) { - if (_maybeDrain(data)) return - return data.map(datum => _insert(datum, true, true, callback)) - } - return _insert(data, true, true, callback); - }, - remove (testFn) { - q._tasks.remove(testFn); - }, - process () { - // Avoid trying to start too many processing operations. This can occur - // when callbacks resolve synchronously (#1267). - if (isProcessing) { - return; - } - isProcessing = true; - while(!q.paused && numRunning < q.concurrency && q._tasks.length){ - var tasks = [], data = []; - var l = q._tasks.length; - if (q.payload) l = Math.min(l, q.payload); - for (var i = 0; i < l; i++) { - var node = q._tasks.shift(); - tasks.push(node); - workersList.push(node); - data.push(node.data); - } - - numRunning += 1; - - if (q._tasks.length === 0) { - trigger('empty'); - } - - if (numRunning === q.concurrency) { - trigger('saturated'); - } - - var cb = onlyOnce(_createCB(tasks)); - _worker(data, cb); - } - isProcessing = false; - }, - length () { - return q._tasks.length; - }, - running () { - return numRunning; - }, - workersList () { - return workersList; - }, - idle() { - return q._tasks.length + numRunning === 0; - }, - pause () { - q.paused = true; - }, - resume () { - if (q.paused === false) { return; } - q.paused = false; - setImmediate$1(q.process); - } - }; - // define these as fixed properties, so people get useful errors when updating - Object.defineProperties(q, { - saturated: { - writable: false, - value: eventMethod('saturated') - }, - unsaturated: { - writable: false, - value: eventMethod('unsaturated') - }, - empty: { - writable: false, - value: eventMethod('empty') - }, - drain: { - writable: false, - value: eventMethod('drain') - }, - error: { - writable: false, - value: eventMethod('error') - }, - }); - return q; -} - -/** - * Creates a `cargo` object with the specified payload. Tasks added to the - * cargo will be processed altogether (up to the `payload` limit). If the - * `worker` is in progress, the task is queued until it becomes available. Once - * the `worker` has completed some tasks, each callback of those tasks is - * called. Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966) - * for how `cargo` and `queue` work. - * - * While [`queue`]{@link module:ControlFlow.queue} passes only one task to one of a group of workers - * at a time, cargo passes an array of tasks to a single worker, repeating - * when the worker is finished. - * - * @name cargo - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.queue]{@link module:ControlFlow.queue} - * @category Control Flow - * @param {AsyncFunction} worker - An asynchronous function for processing an array - * of queued tasks. Invoked with `(tasks, callback)`. - * @param {number} [payload=Infinity] - An optional `integer` for determining - * how many tasks should be processed per round; if omitted, the default is - * unlimited. - * @returns {module:ControlFlow.QueueObject} A cargo object to manage the tasks. Callbacks can - * attached as certain properties to listen for specific events during the - * lifecycle of the cargo and inner queue. - * @example - * - * // create a cargo object with payload 2 - * var cargo = async.cargo(function(tasks, callback) { - * for (var i=0; i { - * console.log(result); - * // 6000 - * // which is the sum of the file sizes of the three files - * }).catch( err => { - * console.log(err); - * }); - * - * // Error Handling - * async.reduce(withMissingFileList, 0, getFileSizeInBytes) - * .then( result => { - * console.log(result); - * }).catch( err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.reduce(fileList, 0, getFileSizeInBytes); - * console.log(result); - * // 6000 - * // which is the sum of the file sizes of the three files - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // Error Handling - * async () => { - * try { - * let result = await async.reduce(withMissingFileList, 0, getFileSizeInBytes); - * console.log(result); - * } - * catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } - * } - * - */ -function reduce(coll, memo, iteratee, callback) { - callback = once(callback); - var _iteratee = wrapAsync(iteratee); - return eachOfSeries$1(coll, (x, i, iterCb) => { - _iteratee(memo, x, (err, v) => { - memo = v; - iterCb(err); - }); - }, err => callback(err, memo)); -} -var reduce$1 = awaitify(reduce, 4); - -/** - * Version of the compose function that is more natural to read. Each function - * consumes the return value of the previous function. It is the equivalent of - * [compose]{@link module:ControlFlow.compose} with the arguments reversed. - * - * Each function is executed with the `this` binding of the composed function. - * - * @name seq - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.compose]{@link module:ControlFlow.compose} - * @category Control Flow - * @param {...AsyncFunction} functions - the asynchronous functions to compose - * @returns {Function} a function that composes the `functions` in order - * @example - * - * // Requires lodash (or underscore), express3 and dresende's orm2. - * // Part of an app, that fetches cats of the logged user. - * // This example uses `seq` function to avoid overnesting and error - * // handling clutter. - * app.get('/cats', function(request, response) { - * var User = request.models.User; - * async.seq( - * User.get.bind(User), // 'User.get' has signature (id, callback(err, data)) - * function(user, fn) { - * user.getCats(fn); // 'getCats' has signature (callback(err, data)) - * } - * )(req.session.user_id, function (err, cats) { - * if (err) { - * console.error(err); - * response.json({ status: 'error', message: err.message }); - * } else { - * response.json({ status: 'ok', message: 'Cats found', data: cats }); - * } - * }); - * }); - */ -function seq(...functions) { - var _functions = functions.map(wrapAsync); - return function (...args) { - var that = this; - - var cb = args[args.length - 1]; - if (typeof cb == 'function') { - args.pop(); - } else { - cb = promiseCallback(); - } - - reduce$1(_functions, args, (newargs, fn, iterCb) => { - fn.apply(that, newargs.concat((err, ...nextargs) => { - iterCb(err, nextargs); - })); - }, - (err, results) => cb(err, ...results)); - - return cb[PROMISE_SYMBOL] - }; -} - -/** - * Creates a function which is a composition of the passed asynchronous - * functions. Each function consumes the return value of the function that - * follows. Composing functions `f()`, `g()`, and `h()` would produce the result - * of `f(g(h()))`, only this version uses callbacks to obtain the return values. - * - * If the last argument to the composed function is not a function, a promise - * is returned when you call it. - * - * Each function is executed with the `this` binding of the composed function. - * - * @name compose - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {...AsyncFunction} functions - the asynchronous functions to compose - * @returns {Function} an asynchronous function that is the composed - * asynchronous `functions` - * @example - * - * function add1(n, callback) { - * setTimeout(function () { - * callback(null, n + 1); - * }, 10); - * } - * - * function mul3(n, callback) { - * setTimeout(function () { - * callback(null, n * 3); - * }, 10); - * } - * - * var add1mul3 = async.compose(mul3, add1); - * add1mul3(4, function (err, result) { - * // result now equals 15 - * }); - */ -function compose(...args) { - return seq(...args.reverse()); -} - -/** - * The same as [`map`]{@link module:Collections.map} but runs a maximum of `limit` async operations at a time. - * - * @name mapLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.map]{@link module:Collections.map} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with the transformed item. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Results is an array of the - * transformed items from the `coll`. Invoked with (err, results). - * @returns {Promise} a promise, if no callback is passed - */ -function mapLimit (coll, limit, iteratee, callback) { - return _asyncMap(eachOfLimit(limit), coll, iteratee, callback) -} -var mapLimit$1 = awaitify(mapLimit, 4); - -/** - * The same as [`concat`]{@link module:Collections.concat} but runs a maximum of `limit` async operations at a time. - * - * @name concatLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.concat]{@link module:Collections.concat} - * @category Collection - * @alias flatMapLimit - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`, - * which should use an array as its result. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished, or an error occurs. Results is an array - * containing the concatenated results of the `iteratee` function. Invoked with - * (err, results). - * @returns A Promise, if no callback is passed - */ -function concatLimit(coll, limit, iteratee, callback) { - var _iteratee = wrapAsync(iteratee); - return mapLimit$1(coll, limit, (val, iterCb) => { - _iteratee(val, (err, ...args) => { - if (err) return iterCb(err); - return iterCb(err, args); - }); - }, (err, mapResults) => { - var result = []; - for (var i = 0; i < mapResults.length; i++) { - if (mapResults[i]) { - result = result.concat(...mapResults[i]); - } - } - - return callback(err, result); - }); -} -var concatLimit$1 = awaitify(concatLimit, 4); - -/** - * Applies `iteratee` to each item in `coll`, concatenating the results. Returns - * the concatenated list. The `iteratee`s are called in parallel, and the - * results are concatenated as they return. The results array will be returned in - * the original order of `coll` passed to the `iteratee` function. - * - * @name concat - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @alias flatMap - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`, - * which should use an array as its result. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished, or an error occurs. Results is an array - * containing the concatenated results of the `iteratee` function. Invoked with - * (err, results). - * @returns A Promise, if no callback is passed - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * // dir4 does not exist - * - * let directoryList = ['dir1','dir2','dir3']; - * let withMissingDirectoryList = ['dir1','dir2','dir3', 'dir4']; - * - * // Using callbacks - * async.concat(directoryList, fs.readdir, function(err, results) { - * if (err) { - * console.log(err); - * } else { - * console.log(results); - * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] - * } - * }); - * - * // Error Handling - * async.concat(withMissingDirectoryList, fs.readdir, function(err, results) { - * if (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4 does not exist - * } else { - * console.log(results); - * } - * }); - * - * // Using Promises - * async.concat(directoryList, fs.readdir) - * .then(results => { - * console.log(results); - * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] - * }).catch(err => { - * console.log(err); - * }); - * - * // Error Handling - * async.concat(withMissingDirectoryList, fs.readdir) - * .then(results => { - * console.log(results); - * }).catch(err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4 does not exist - * }); - * - * // Using async/await - * async () => { - * try { - * let results = await async.concat(directoryList, fs.readdir); - * console.log(results); - * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] - * } catch (err) { - * console.log(err); - * } - * } - * - * // Error Handling - * async () => { - * try { - * let results = await async.concat(withMissingDirectoryList, fs.readdir); - * console.log(results); - * } catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4 does not exist - * } - * } - * - */ -function concat(coll, iteratee, callback) { - return concatLimit$1(coll, Infinity, iteratee, callback) -} -var concat$1 = awaitify(concat, 3); - -/** - * The same as [`concat`]{@link module:Collections.concat} but runs only a single async operation at a time. - * - * @name concatSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.concat]{@link module:Collections.concat} - * @category Collection - * @alias flatMapSeries - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`. - * The iteratee should complete with an array an array of results. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished, or an error occurs. Results is an array - * containing the concatenated results of the `iteratee` function. Invoked with - * (err, results). - * @returns A Promise, if no callback is passed - */ -function concatSeries(coll, iteratee, callback) { - return concatLimit$1(coll, 1, iteratee, callback) -} -var concatSeries$1 = awaitify(concatSeries, 3); - -/** - * Returns a function that when called, calls-back with the values provided. - * Useful as the first function in a [`waterfall`]{@link module:ControlFlow.waterfall}, or for plugging values in to - * [`auto`]{@link module:ControlFlow.auto}. - * - * @name constant - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {...*} arguments... - Any number of arguments to automatically invoke - * callback with. - * @returns {AsyncFunction} Returns a function that when invoked, automatically - * invokes the callback with the previous given arguments. - * @example - * - * async.waterfall([ - * async.constant(42), - * function (value, next) { - * // value === 42 - * }, - * //... - * ], callback); - * - * async.waterfall([ - * async.constant(filename, "utf8"), - * fs.readFile, - * function (fileData, next) { - * //... - * } - * //... - * ], callback); - * - * async.auto({ - * hostname: async.constant("https://server.net/"), - * port: findFreePort, - * launchServer: ["hostname", "port", function (options, cb) { - * startServer(options, cb); - * }], - * //... - * }, callback); - */ -function constant(...args) { - return function (...ignoredArgs/*, callback*/) { - var callback = ignoredArgs.pop(); - return callback(null, ...args); - }; -} - -function _createTester(check, getResult) { - return (eachfn, arr, _iteratee, cb) => { - var testPassed = false; - var testResult; - const iteratee = wrapAsync(_iteratee); - eachfn(arr, (value, _, callback) => { - iteratee(value, (err, result) => { - if (err || err === false) return callback(err); - - if (check(result) && !testResult) { - testPassed = true; - testResult = getResult(true, value); - return callback(null, breakLoop); - } - callback(); - }); - }, err => { - if (err) return cb(err); - cb(null, testPassed ? testResult : getResult(false)); - }); - }; -} - -/** - * Returns the first value in `coll` that passes an async truth test. The - * `iteratee` is applied in parallel, meaning the first iteratee to return - * `true` will fire the detect `callback` with that result. That means the - * result might not be the first item in the original `coll` (in terms of order) - * that passes the test. - - * If order within the original `coll` is important, then look at - * [`detectSeries`]{@link module:Collections.detectSeries}. - * - * @name detect - * @static - * @memberOf module:Collections - * @method - * @alias find - * @category Collections - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. - * The iteratee must complete with a boolean value as its result. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the `iteratee` functions have finished. - * Result will be the first item in the array that passes the truth test - * (iteratee) or the value `undefined` if none passed. Invoked with - * (err, result). - * @returns {Promise} a promise, if a callback is omitted - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * - * // asynchronous function that checks if a file exists - * function fileExists(file, callback) { - * fs.access(file, fs.constants.F_OK, (err) => { - * callback(null, !err); - * }); - * } - * - * async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists, - * function(err, result) { - * console.log(result); - * // dir1/file1.txt - * // result now equals the first file in the list that exists - * } - *); - * - * // Using Promises - * async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists) - * .then(result => { - * console.log(result); - * // dir1/file1.txt - * // result now equals the first file in the list that exists - * }).catch(err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists); - * console.log(result); - * // dir1/file1.txt - * // result now equals the file in the list that exists - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function detect(coll, iteratee, callback) { - return _createTester(bool => bool, (res, item) => item)(eachOf$1, coll, iteratee, callback) -} -var detect$1 = awaitify(detect, 3); - -/** - * The same as [`detect`]{@link module:Collections.detect} but runs a maximum of `limit` async operations at a - * time. - * - * @name detectLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.detect]{@link module:Collections.detect} - * @alias findLimit - * @category Collections - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. - * The iteratee must complete with a boolean value as its result. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the `iteratee` functions have finished. - * Result will be the first item in the array that passes the truth test - * (iteratee) or the value `undefined` if none passed. Invoked with - * (err, result). - * @returns {Promise} a promise, if a callback is omitted - */ -function detectLimit(coll, limit, iteratee, callback) { - return _createTester(bool => bool, (res, item) => item)(eachOfLimit(limit), coll, iteratee, callback) -} -var detectLimit$1 = awaitify(detectLimit, 4); - -/** - * The same as [`detect`]{@link module:Collections.detect} but runs only a single async operation at a time. - * - * @name detectSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.detect]{@link module:Collections.detect} - * @alias findSeries - * @category Collections - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. - * The iteratee must complete with a boolean value as its result. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the `iteratee` functions have finished. - * Result will be the first item in the array that passes the truth test - * (iteratee) or the value `undefined` if none passed. Invoked with - * (err, result). - * @returns {Promise} a promise, if a callback is omitted - */ -function detectSeries(coll, iteratee, callback) { - return _createTester(bool => bool, (res, item) => item)(eachOfLimit(1), coll, iteratee, callback) -} - -var detectSeries$1 = awaitify(detectSeries, 3); - -function consoleFunc(name) { - return (fn, ...args) => wrapAsync(fn)(...args, (err, ...resultArgs) => { - /* istanbul ignore else */ - if (typeof console === 'object') { - /* istanbul ignore else */ - if (err) { - /* istanbul ignore else */ - if (console.error) { - console.error(err); - } - } else if (console[name]) { /* istanbul ignore else */ - resultArgs.forEach(x => console[name](x)); - } - } - }) -} - -/** - * Logs the result of an [`async` function]{@link AsyncFunction} to the - * `console` using `console.dir` to display the properties of the resulting object. - * Only works in Node.js or in browsers that support `console.dir` and - * `console.error` (such as FF and Chrome). - * If multiple arguments are returned from the async function, - * `console.dir` is called on each argument in order. - * - * @name dir - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} function - The function you want to eventually apply - * all arguments to. - * @param {...*} arguments... - Any number of arguments to apply to the function. - * @example - * - * // in a module - * var hello = function(name, callback) { - * setTimeout(function() { - * callback(null, {hello: name}); - * }, 1000); - * }; - * - * // in the node repl - * node> async.dir(hello, 'world'); - * {hello: 'world'} - */ -var dir = consoleFunc('dir'); - -/** - * The post-check version of [`whilst`]{@link module:ControlFlow.whilst}. To reflect the difference in - * the order of operations, the arguments `test` and `iteratee` are switched. - * - * `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript. - * - * @name doWhilst - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.whilst]{@link module:ControlFlow.whilst} - * @category Control Flow - * @param {AsyncFunction} iteratee - A function which is called each time `test` - * passes. Invoked with (callback). - * @param {AsyncFunction} test - asynchronous truth test to perform after each - * execution of `iteratee`. Invoked with (...args, callback), where `...args` are the - * non-error args from the previous callback of `iteratee`. - * @param {Function} [callback] - A callback which is called after the test - * function has failed and repeated execution of `iteratee` has stopped. - * `callback` will be passed an error and any arguments passed to the final - * `iteratee`'s callback. Invoked with (err, [results]); - * @returns {Promise} a promise, if no callback is passed - */ -function doWhilst(iteratee, test, callback) { - callback = onlyOnce(callback); - var _fn = wrapAsync(iteratee); - var _test = wrapAsync(test); - var results; - - function next(err, ...args) { - if (err) return callback(err); - if (err === false) return; - results = args; - _test(...args, check); - } - - function check(err, truth) { - if (err) return callback(err); - if (err === false) return; - if (!truth) return callback(null, ...results); - _fn(next); - } - - return check(null, true); -} - -var doWhilst$1 = awaitify(doWhilst, 3); - -/** - * Like ['doWhilst']{@link module:ControlFlow.doWhilst}, except the `test` is inverted. Note the - * argument ordering differs from `until`. - * - * @name doUntil - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.doWhilst]{@link module:ControlFlow.doWhilst} - * @category Control Flow - * @param {AsyncFunction} iteratee - An async function which is called each time - * `test` fails. Invoked with (callback). - * @param {AsyncFunction} test - asynchronous truth test to perform after each - * execution of `iteratee`. Invoked with (...args, callback), where `...args` are the - * non-error args from the previous callback of `iteratee` - * @param {Function} [callback] - A callback which is called after the test - * function has passed and repeated execution of `iteratee` has stopped. `callback` - * will be passed an error and any arguments passed to the final `iteratee`'s - * callback. Invoked with (err, [results]); - * @returns {Promise} a promise, if no callback is passed - */ -function doUntil(iteratee, test, callback) { - const _test = wrapAsync(test); - return doWhilst$1(iteratee, (...args) => { - const cb = args.pop(); - _test(...args, (err, truth) => cb (err, !truth)); - }, callback); -} - -function _withoutIndex(iteratee) { - return (value, index, callback) => iteratee(value, callback); -} - -/** - * Applies the function `iteratee` to each item in `coll`, in parallel. - * The `iteratee` is called with an item from the list, and a callback for when - * it has finished. If the `iteratee` passes an error to its `callback`, the - * main `callback` (for the `each` function) is immediately called with the - * error. - * - * Note, that since this function applies `iteratee` to each item in parallel, - * there is no guarantee that the iteratee functions will complete in order. - * - * @name each - * @static - * @memberOf module:Collections - * @method - * @alias forEach - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to - * each item in `coll`. Invoked with (item, callback). - * The array index is not passed to the iteratee. - * If you need the index, use `eachOf`. - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * // dir4 does not exist - * - * const fileList = [ 'dir1/file2.txt', 'dir2/file3.txt', 'dir/file5.txt']; - * const withMissingFileList = ['dir1/file1.txt', 'dir4/file2.txt']; - * - * // asynchronous function that deletes a file - * const deleteFile = function(file, callback) { - * fs.unlink(file, callback); - * }; - * - * // Using callbacks - * async.each(fileList, deleteFile, function(err) { - * if( err ) { - * console.log(err); - * } else { - * console.log('All files have been deleted successfully'); - * } - * }); - * - * // Error Handling - * async.each(withMissingFileList, deleteFile, function(err){ - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4/file2.txt does not exist - * // dir1/file1.txt could have been deleted - * }); - * - * // Using Promises - * async.each(fileList, deleteFile) - * .then( () => { - * console.log('All files have been deleted successfully'); - * }).catch( err => { - * console.log(err); - * }); - * - * // Error Handling - * async.each(fileList, deleteFile) - * .then( () => { - * console.log('All files have been deleted successfully'); - * }).catch( err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4/file2.txt does not exist - * // dir1/file1.txt could have been deleted - * }); - * - * // Using async/await - * async () => { - * try { - * await async.each(files, deleteFile); - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // Error Handling - * async () => { - * try { - * await async.each(withMissingFileList, deleteFile); - * } - * catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4/file2.txt does not exist - * // dir1/file1.txt could have been deleted - * } - * } - * - */ -function eachLimit(coll, iteratee, callback) { - return eachOf$1(coll, _withoutIndex(wrapAsync(iteratee)), callback); -} - -var each = awaitify(eachLimit, 3); - -/** - * The same as [`each`]{@link module:Collections.each} but runs a maximum of `limit` async operations at a time. - * - * @name eachLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.each]{@link module:Collections.each} - * @alias forEachLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The array index is not passed to the iteratee. - * If you need the index, use `eachOfLimit`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - */ -function eachLimit$1(coll, limit, iteratee, callback) { - return eachOfLimit(limit)(coll, _withoutIndex(wrapAsync(iteratee)), callback); -} -var eachLimit$2 = awaitify(eachLimit$1, 4); - -/** - * The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time. - * - * Note, that unlike [`each`]{@link module:Collections.each}, this function applies iteratee to each item - * in series and therefore the iteratee functions will complete in order. - - * @name eachSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.each]{@link module:Collections.each} - * @alias forEachSeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each - * item in `coll`. - * The array index is not passed to the iteratee. - * If you need the index, use `eachOfSeries`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - */ -function eachSeries(coll, iteratee, callback) { - return eachLimit$2(coll, 1, iteratee, callback) -} -var eachSeries$1 = awaitify(eachSeries, 3); - -/** - * Wrap an async function and ensure it calls its callback on a later tick of - * the event loop. If the function already calls its callback on a next tick, - * no extra deferral is added. This is useful for preventing stack overflows - * (`RangeError: Maximum call stack size exceeded`) and generally keeping - * [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony) - * contained. ES2017 `async` functions are returned as-is -- they are immune - * to Zalgo's corrupting influences, as they always resolve on a later tick. - * - * @name ensureAsync - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} fn - an async function, one that expects a node-style - * callback as its last argument. - * @returns {AsyncFunction} Returns a wrapped function with the exact same call - * signature as the function passed in. - * @example - * - * function sometimesAsync(arg, callback) { - * if (cache[arg]) { - * return callback(null, cache[arg]); // this would be synchronous!! - * } else { - * doSomeIO(arg, callback); // this IO would be asynchronous - * } - * } - * - * // this has a risk of stack overflows if many results are cached in a row - * async.mapSeries(args, sometimesAsync, done); - * - * // this will defer sometimesAsync's callback if necessary, - * // preventing stack overflows - * async.mapSeries(args, async.ensureAsync(sometimesAsync), done); - */ -function ensureAsync(fn) { - if (isAsync(fn)) return fn; - return function (...args/*, callback*/) { - var callback = args.pop(); - var sync = true; - args.push((...innerArgs) => { - if (sync) { - setImmediate$1(() => callback(...innerArgs)); - } else { - callback(...innerArgs); - } - }); - fn.apply(this, args); - sync = false; - }; -} - -/** - * Returns `true` if every element in `coll` satisfies an async test. If any - * iteratee call returns `false`, the main `callback` is immediately called. - * - * @name every - * @static - * @memberOf module:Collections - * @method - * @alias all - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collection in parallel. - * The iteratee must complete with a boolean result value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result will be either `true` or `false` - * depending on the values of the async tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * // dir4 does not exist - * - * const fileList = ['dir1/file1.txt','dir2/file3.txt','dir3/file5.txt']; - * const withMissingFileList = ['file1.txt','file2.txt','file4.txt']; - * - * // asynchronous function that checks if a file exists - * function fileExists(file, callback) { - * fs.access(file, fs.constants.F_OK, (err) => { - * callback(null, !err); - * }); - * } - * - * // Using callbacks - * async.every(fileList, fileExists, function(err, result) { - * console.log(result); - * // true - * // result is true since every file exists - * }); - * - * async.every(withMissingFileList, fileExists, function(err, result) { - * console.log(result); - * // false - * // result is false since NOT every file exists - * }); - * - * // Using Promises - * async.every(fileList, fileExists) - * .then( result => { - * console.log(result); - * // true - * // result is true since every file exists - * }).catch( err => { - * console.log(err); - * }); - * - * async.every(withMissingFileList, fileExists) - * .then( result => { - * console.log(result); - * // false - * // result is false since NOT every file exists - * }).catch( err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.every(fileList, fileExists); - * console.log(result); - * // true - * // result is true since every file exists - * } - * catch (err) { - * console.log(err); - * } - * } - * - * async () => { - * try { - * let result = await async.every(withMissingFileList, fileExists); - * console.log(result); - * // false - * // result is false since NOT every file exists - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function every(coll, iteratee, callback) { - return _createTester(bool => !bool, res => !res)(eachOf$1, coll, iteratee, callback) -} -var every$1 = awaitify(every, 3); - -/** - * The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time. - * - * @name everyLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.every]{@link module:Collections.every} - * @alias allLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collection in parallel. - * The iteratee must complete with a boolean result value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result will be either `true` or `false` - * depending on the values of the async tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - */ -function everyLimit(coll, limit, iteratee, callback) { - return _createTester(bool => !bool, res => !res)(eachOfLimit(limit), coll, iteratee, callback) -} -var everyLimit$1 = awaitify(everyLimit, 4); - -/** - * The same as [`every`]{@link module:Collections.every} but runs only a single async operation at a time. - * - * @name everySeries - * @static - * @memberOf module:Collections - * @method - * @see [async.every]{@link module:Collections.every} - * @alias allSeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collection in series. - * The iteratee must complete with a boolean result value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result will be either `true` or `false` - * depending on the values of the async tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - */ -function everySeries(coll, iteratee, callback) { - return _createTester(bool => !bool, res => !res)(eachOfSeries$1, coll, iteratee, callback) -} -var everySeries$1 = awaitify(everySeries, 3); - -function filterArray(eachfn, arr, iteratee, callback) { - var truthValues = new Array(arr.length); - eachfn(arr, (x, index, iterCb) => { - iteratee(x, (err, v) => { - truthValues[index] = !!v; - iterCb(err); - }); - }, err => { - if (err) return callback(err); - var results = []; - for (var i = 0; i < arr.length; i++) { - if (truthValues[i]) results.push(arr[i]); - } - callback(null, results); - }); -} - -function filterGeneric(eachfn, coll, iteratee, callback) { - var results = []; - eachfn(coll, (x, index, iterCb) => { - iteratee(x, (err, v) => { - if (err) return iterCb(err); - if (v) { - results.push({index, value: x}); - } - iterCb(err); - }); - }, err => { - if (err) return callback(err); - callback(null, results - .sort((a, b) => a.index - b.index) - .map(v => v.value)); - }); -} - -function _filter(eachfn, coll, iteratee, callback) { - var filter = isArrayLike(coll) ? filterArray : filterGeneric; - return filter(eachfn, coll, wrapAsync(iteratee), callback); -} - -/** - * Returns a new array of all the values in `coll` which pass an async truth - * test. This operation is performed in parallel, but the results array will be - * in the same order as the original. - * - * @name filter - * @static - * @memberOf module:Collections - * @method - * @alias select - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {Function} iteratee - A truth test to apply to each item in `coll`. - * The `iteratee` is passed a `callback(err, truthValue)`, which must be called - * with a boolean argument once it has completed. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @returns {Promise} a promise, if no callback provided - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * - * const files = ['dir1/file1.txt','dir2/file3.txt','dir3/file6.txt']; - * - * // asynchronous function that checks if a file exists - * function fileExists(file, callback) { - * fs.access(file, fs.constants.F_OK, (err) => { - * callback(null, !err); - * }); - * } - * - * // Using callbacks - * async.filter(files, fileExists, function(err, results) { - * if(err) { - * console.log(err); - * } else { - * console.log(results); - * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] - * // results is now an array of the existing files - * } - * }); - * - * // Using Promises - * async.filter(files, fileExists) - * .then(results => { - * console.log(results); - * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] - * // results is now an array of the existing files - * }).catch(err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let results = await async.filter(files, fileExists); - * console.log(results); - * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] - * // results is now an array of the existing files - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function filter (coll, iteratee, callback) { - return _filter(eachOf$1, coll, iteratee, callback) -} -var filter$1 = awaitify(filter, 3); - -/** - * The same as [`filter`]{@link module:Collections.filter} but runs a maximum of `limit` async operations at a - * time. - * - * @name filterLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.filter]{@link module:Collections.filter} - * @alias selectLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {Function} iteratee - A truth test to apply to each item in `coll`. - * The `iteratee` is passed a `callback(err, truthValue)`, which must be called - * with a boolean argument once it has completed. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @returns {Promise} a promise, if no callback provided - */ -function filterLimit (coll, limit, iteratee, callback) { - return _filter(eachOfLimit(limit), coll, iteratee, callback) -} -var filterLimit$1 = awaitify(filterLimit, 4); - -/** - * The same as [`filter`]{@link module:Collections.filter} but runs only a single async operation at a time. - * - * @name filterSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.filter]{@link module:Collections.filter} - * @alias selectSeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {Function} iteratee - A truth test to apply to each item in `coll`. - * The `iteratee` is passed a `callback(err, truthValue)`, which must be called - * with a boolean argument once it has completed. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results) - * @returns {Promise} a promise, if no callback provided - */ -function filterSeries (coll, iteratee, callback) { - return _filter(eachOfSeries$1, coll, iteratee, callback) -} -var filterSeries$1 = awaitify(filterSeries, 3); - -/** - * Calls the asynchronous function `fn` with a callback parameter that allows it - * to call itself again, in series, indefinitely. - - * If an error is passed to the callback then `errback` is called with the - * error, and execution stops, otherwise it will never be called. - * - * @name forever - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {AsyncFunction} fn - an async function to call repeatedly. - * Invoked with (next). - * @param {Function} [errback] - when `fn` passes an error to it's callback, - * this function will be called, and execution stops. Invoked with (err). - * @returns {Promise} a promise that rejects if an error occurs and an errback - * is not passed - * @example - * - * async.forever( - * function(next) { - * // next is suitable for passing to things that need a callback(err [, whatever]); - * // it will result in this function being called again. - * }, - * function(err) { - * // if next is called with a value in its first parameter, it will appear - * // in here as 'err', and execution will stop. - * } - * ); - */ -function forever(fn, errback) { - var done = onlyOnce(errback); - var task = wrapAsync(ensureAsync(fn)); - - function next(err) { - if (err) return done(err); - if (err === false) return; - task(next); - } - return next(); -} -var forever$1 = awaitify(forever, 2); - -/** - * The same as [`groupBy`]{@link module:Collections.groupBy} but runs a maximum of `limit` async operations at a time. - * - * @name groupByLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.groupBy]{@link module:Collections.groupBy} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with a `key` to group the value under. - * Invoked with (value, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Result is an `Object` whoses - * properties are arrays of values which returned the corresponding key. - * @returns {Promise} a promise, if no callback is passed - */ -function groupByLimit(coll, limit, iteratee, callback) { - var _iteratee = wrapAsync(iteratee); - return mapLimit$1(coll, limit, (val, iterCb) => { - _iteratee(val, (err, key) => { - if (err) return iterCb(err); - return iterCb(err, {key, val}); - }); - }, (err, mapResults) => { - var result = {}; - // from MDN, handle object having an `hasOwnProperty` prop - var {hasOwnProperty} = Object.prototype; - - for (var i = 0; i < mapResults.length; i++) { - if (mapResults[i]) { - var {key} = mapResults[i]; - var {val} = mapResults[i]; - - if (hasOwnProperty.call(result, key)) { - result[key].push(val); - } else { - result[key] = [val]; - } - } - } - - return callback(err, result); - }); -} - -var groupByLimit$1 = awaitify(groupByLimit, 4); - -/** - * Returns a new object, where each value corresponds to an array of items, from - * `coll`, that returned the corresponding key. That is, the keys of the object - * correspond to the values passed to the `iteratee` callback. - * - * Note: Since this function applies the `iteratee` to each item in parallel, - * there is no guarantee that the `iteratee` functions will complete in order. - * However, the values for each key in the `result` will be in the same order as - * the original `coll`. For Objects, the values will roughly be in the order of - * the original Objects' keys (but this can vary across JavaScript engines). - * - * @name groupBy - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with a `key` to group the value under. - * Invoked with (value, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Result is an `Object` whoses - * properties are arrays of values which returned the corresponding key. - * @returns {Promise} a promise, if no callback is passed - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * // dir4 does not exist - * - * const files = ['dir1/file1.txt','dir2','dir4'] - * - * // asynchronous function that detects file type as none, file, or directory - * function detectFile(file, callback) { - * fs.stat(file, function(err, stat) { - * if (err) { - * return callback(null, 'none'); - * } - * callback(null, stat.isDirectory() ? 'directory' : 'file'); - * }); - * } - * - * //Using callbacks - * async.groupBy(files, detectFile, function(err, result) { - * if(err) { - * console.log(err); - * } else { - * console.log(result); - * // { - * // file: [ 'dir1/file1.txt' ], - * // none: [ 'dir4' ], - * // directory: [ 'dir2'] - * // } - * // result is object containing the files grouped by type - * } - * }); - * - * // Using Promises - * async.groupBy(files, detectFile) - * .then( result => { - * console.log(result); - * // { - * // file: [ 'dir1/file1.txt' ], - * // none: [ 'dir4' ], - * // directory: [ 'dir2'] - * // } - * // result is object containing the files grouped by type - * }).catch( err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.groupBy(files, detectFile); - * console.log(result); - * // { - * // file: [ 'dir1/file1.txt' ], - * // none: [ 'dir4' ], - * // directory: [ 'dir2'] - * // } - * // result is object containing the files grouped by type - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function groupBy (coll, iteratee, callback) { - return groupByLimit$1(coll, Infinity, iteratee, callback) -} - -/** - * The same as [`groupBy`]{@link module:Collections.groupBy} but runs only a single async operation at a time. - * - * @name groupBySeries - * @static - * @memberOf module:Collections - * @method - * @see [async.groupBy]{@link module:Collections.groupBy} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with a `key` to group the value under. - * Invoked with (value, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Result is an `Object` whose - * properties are arrays of values which returned the corresponding key. - * @returns {Promise} a promise, if no callback is passed - */ -function groupBySeries (coll, iteratee, callback) { - return groupByLimit$1(coll, 1, iteratee, callback) -} - -/** - * Logs the result of an `async` function to the `console`. Only works in - * Node.js or in browsers that support `console.log` and `console.error` (such - * as FF and Chrome). If multiple arguments are returned from the async - * function, `console.log` is called on each argument in order. - * - * @name log - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} function - The function you want to eventually apply - * all arguments to. - * @param {...*} arguments... - Any number of arguments to apply to the function. - * @example - * - * // in a module - * var hello = function(name, callback) { - * setTimeout(function() { - * callback(null, 'hello ' + name); - * }, 1000); - * }; - * - * // in the node repl - * node> async.log(hello, 'world'); - * 'hello world' - */ -var log = consoleFunc('log'); - -/** - * The same as [`mapValues`]{@link module:Collections.mapValues} but runs a maximum of `limit` async operations at a - * time. - * - * @name mapValuesLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.mapValues]{@link module:Collections.mapValues} - * @category Collection - * @param {Object} obj - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - A function to apply to each value and key - * in `coll`. - * The iteratee should complete with the transformed value as its result. - * Invoked with (value, key, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. `result` is a new object consisting - * of each key from `obj`, with each transformed value on the right-hand side. - * Invoked with (err, result). - * @returns {Promise} a promise, if no callback is passed - */ -function mapValuesLimit(obj, limit, iteratee, callback) { - callback = once(callback); - var newObj = {}; - var _iteratee = wrapAsync(iteratee); - return eachOfLimit(limit)(obj, (val, key, next) => { - _iteratee(val, key, (err, result) => { - if (err) return next(err); - newObj[key] = result; - next(err); - }); - }, err => callback(err, newObj)); -} - -var mapValuesLimit$1 = awaitify(mapValuesLimit, 4); - -/** - * A relative of [`map`]{@link module:Collections.map}, designed for use with objects. - * - * Produces a new Object by mapping each value of `obj` through the `iteratee` - * function. The `iteratee` is called each `value` and `key` from `obj` and a - * callback for when it has finished processing. Each of these callbacks takes - * two arguments: an `error`, and the transformed item from `obj`. If `iteratee` - * passes an error to its callback, the main `callback` (for the `mapValues` - * function) is immediately called with the error. - * - * Note, the order of the keys in the result is not guaranteed. The keys will - * be roughly in the order they complete, (but this is very engine-specific) - * - * @name mapValues - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Object} obj - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each value and key - * in `coll`. - * The iteratee should complete with the transformed value as its result. - * Invoked with (value, key, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. `result` is a new object consisting - * of each key from `obj`, with each transformed value on the right-hand side. - * Invoked with (err, result). - * @returns {Promise} a promise, if no callback is passed - * @example - * - * // file1.txt is a file that is 1000 bytes in size - * // file2.txt is a file that is 2000 bytes in size - * // file3.txt is a file that is 3000 bytes in size - * // file4.txt does not exist - * - * const fileMap = { - * f1: 'file1.txt', - * f2: 'file2.txt', - * f3: 'file3.txt' - * }; - * - * const withMissingFileMap = { - * f1: 'file1.txt', - * f2: 'file2.txt', - * f3: 'file4.txt' - * }; - * - * // asynchronous function that returns the file size in bytes - * function getFileSizeInBytes(file, key, callback) { - * fs.stat(file, function(err, stat) { - * if (err) { - * return callback(err); - * } - * callback(null, stat.size); - * }); - * } - * - * // Using callbacks - * async.mapValues(fileMap, getFileSizeInBytes, function(err, result) { - * if (err) { - * console.log(err); - * } else { - * console.log(result); - * // result is now a map of file size in bytes for each file, e.g. - * // { - * // f1: 1000, - * // f2: 2000, - * // f3: 3000 - * // } - * } - * }); - * - * // Error handling - * async.mapValues(withMissingFileMap, getFileSizeInBytes, function(err, result) { - * if (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } else { - * console.log(result); - * } - * }); - * - * // Using Promises - * async.mapValues(fileMap, getFileSizeInBytes) - * .then( result => { - * console.log(result); - * // result is now a map of file size in bytes for each file, e.g. - * // { - * // f1: 1000, - * // f2: 2000, - * // f3: 3000 - * // } - * }).catch (err => { - * console.log(err); - * }); - * - * // Error Handling - * async.mapValues(withMissingFileMap, getFileSizeInBytes) - * .then( result => { - * console.log(result); - * }).catch (err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.mapValues(fileMap, getFileSizeInBytes); - * console.log(result); - * // result is now a map of file size in bytes for each file, e.g. - * // { - * // f1: 1000, - * // f2: 2000, - * // f3: 3000 - * // } - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // Error Handling - * async () => { - * try { - * let result = await async.mapValues(withMissingFileMap, getFileSizeInBytes); - * console.log(result); - * } - * catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } - * } - * - */ -function mapValues(obj, iteratee, callback) { - return mapValuesLimit$1(obj, Infinity, iteratee, callback) -} - -/** - * The same as [`mapValues`]{@link module:Collections.mapValues} but runs only a single async operation at a time. - * - * @name mapValuesSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.mapValues]{@link module:Collections.mapValues} - * @category Collection - * @param {Object} obj - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each value and key - * in `coll`. - * The iteratee should complete with the transformed value as its result. - * Invoked with (value, key, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. `result` is a new object consisting - * of each key from `obj`, with each transformed value on the right-hand side. - * Invoked with (err, result). - * @returns {Promise} a promise, if no callback is passed - */ -function mapValuesSeries(obj, iteratee, callback) { - return mapValuesLimit$1(obj, 1, iteratee, callback) -} - -/** - * Caches the results of an async function. When creating a hash to store - * function results against, the callback is omitted from the hash and an - * optional hash function can be used. - * - * **Note: if the async function errs, the result will not be cached and - * subsequent calls will call the wrapped function.** - * - * If no hash function is specified, the first argument is used as a hash key, - * which may work reasonably if it is a string or a data type that converts to a - * distinct string. Note that objects and arrays will not behave reasonably. - * Neither will cases where the other arguments are significant. In such cases, - * specify your own hash function. - * - * The cache of results is exposed as the `memo` property of the function - * returned by `memoize`. - * - * @name memoize - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} fn - The async function to proxy and cache results from. - * @param {Function} hasher - An optional function for generating a custom hash - * for storing results. It has all the arguments applied to it apart from the - * callback, and must be synchronous. - * @returns {AsyncFunction} a memoized version of `fn` - * @example - * - * var slow_fn = function(name, callback) { - * // do something - * callback(null, result); - * }; - * var fn = async.memoize(slow_fn); - * - * // fn can now be used as if it were slow_fn - * fn('some name', function() { - * // callback - * }); - */ -function memoize(fn, hasher = v => v) { - var memo = Object.create(null); - var queues = Object.create(null); - var _fn = wrapAsync(fn); - var memoized = initialParams((args, callback) => { - var key = hasher(...args); - if (key in memo) { - setImmediate$1(() => callback(null, ...memo[key])); - } else if (key in queues) { - queues[key].push(callback); - } else { - queues[key] = [callback]; - _fn(...args, (err, ...resultArgs) => { - // #1465 don't memoize if an error occurred - if (!err) { - memo[key] = resultArgs; - } - var q = queues[key]; - delete queues[key]; - for (var i = 0, l = q.length; i < l; i++) { - q[i](err, ...resultArgs); - } - }); - } - }); - memoized.memo = memo; - memoized.unmemoized = fn; - return memoized; -} - -/* istanbul ignore file */ - -/** - * Calls `callback` on a later loop around the event loop. In Node.js this just - * calls `process.nextTick`. In the browser it will use `setImmediate` if - * available, otherwise `setTimeout(callback, 0)`, which means other higher - * priority events may precede the execution of `callback`. - * - * This is used internally for browser-compatibility purposes. - * - * @name nextTick - * @static - * @memberOf module:Utils - * @method - * @see [async.setImmediate]{@link module:Utils.setImmediate} - * @category Util - * @param {Function} callback - The function to call on a later loop around - * the event loop. Invoked with (args...). - * @param {...*} args... - any number of additional arguments to pass to the - * callback on the next tick. - * @example - * - * var call_order = []; - * async.nextTick(function() { - * call_order.push('two'); - * // call_order now equals ['one','two'] - * }); - * call_order.push('one'); - * - * async.setImmediate(function (a, b, c) { - * // a, b, and c equal 1, 2, and 3 - * }, 1, 2, 3); - */ -var _defer$1; - -if (hasNextTick) { - _defer$1 = process.nextTick; -} else if (hasSetImmediate) { - _defer$1 = setImmediate; -} else { - _defer$1 = fallback; -} - -var nextTick = wrap(_defer$1); - -var parallel = awaitify((eachfn, tasks, callback) => { - var results = isArrayLike(tasks) ? [] : {}; - - eachfn(tasks, (task, key, taskCb) => { - wrapAsync(task)((err, ...result) => { - if (result.length < 2) { - [result] = result; - } - results[key] = result; - taskCb(err); - }); - }, err => callback(err, results)); -}, 3); - -/** - * Run the `tasks` collection of functions in parallel, without waiting until - * the previous function has completed. If any of the functions pass an error to - * its callback, the main `callback` is immediately called with the value of the - * error. Once the `tasks` have completed, the results are passed to the final - * `callback` as an array. - * - * **Note:** `parallel` is about kicking-off I/O tasks in parallel, not about - * parallel execution of code. If your tasks do not use any timers or perform - * any I/O, they will actually be executed in series. Any synchronous setup - * sections for each task will happen one after the other. JavaScript remains - * single-threaded. - * - * **Hint:** Use [`reflect`]{@link module:Utils.reflect} to continue the - * execution of other tasks when a task fails. - * - * It is also possible to use an object instead of an array. Each property will - * be run as a function and the results will be passed to the final `callback` - * as an object instead of an array. This can be a more readable way of handling - * results from {@link async.parallel}. - * - * @name parallel - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection of - * [async functions]{@link AsyncFunction} to run. - * Each async function can complete with any number of optional `result` values. - * @param {Function} [callback] - An optional callback to run once all the - * functions have completed successfully. This function gets a results array - * (or object) containing all the result arguments passed to the task callbacks. - * Invoked with (err, results). - * @returns {Promise} a promise, if a callback is not passed - * - * @example - * - * //Using Callbacks - * async.parallel([ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ], function(err, results) { - * console.log(results); - * // results is equal to ['one','two'] even though - * // the second function had a shorter timeout. - * }); - * - * // an example using an object instead of an array - * async.parallel({ - * one: function(callback) { - * setTimeout(function() { - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * callback(null, 2); - * }, 100); - * } - * }, function(err, results) { - * console.log(results); - * // results is equal to: { one: 1, two: 2 } - * }); - * - * //Using Promises - * async.parallel([ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ]).then(results => { - * console.log(results); - * // results is equal to ['one','two'] even though - * // the second function had a shorter timeout. - * }).catch(err => { - * console.log(err); - * }); - * - * // an example using an object instead of an array - * async.parallel({ - * one: function(callback) { - * setTimeout(function() { - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * callback(null, 2); - * }, 100); - * } - * }).then(results => { - * console.log(results); - * // results is equal to: { one: 1, two: 2 } - * }).catch(err => { - * console.log(err); - * }); - * - * //Using async/await - * async () => { - * try { - * let results = await async.parallel([ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ]); - * console.log(results); - * // results is equal to ['one','two'] even though - * // the second function had a shorter timeout. - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // an example using an object instead of an array - * async () => { - * try { - * let results = await async.parallel({ - * one: function(callback) { - * setTimeout(function() { - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * callback(null, 2); - * }, 100); - * } - * }); - * console.log(results); - * // results is equal to: { one: 1, two: 2 } - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function parallel$1(tasks, callback) { - return parallel(eachOf$1, tasks, callback); -} - -/** - * The same as [`parallel`]{@link module:ControlFlow.parallel} but runs a maximum of `limit` async operations at a - * time. - * - * @name parallelLimit - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.parallel]{@link module:ControlFlow.parallel} - * @category Control Flow - * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection of - * [async functions]{@link AsyncFunction} to run. - * Each async function can complete with any number of optional `result` values. - * @param {number} limit - The maximum number of async operations at a time. - * @param {Function} [callback] - An optional callback to run once all the - * functions have completed successfully. This function gets a results array - * (or object) containing all the result arguments passed to the task callbacks. - * Invoked with (err, results). - * @returns {Promise} a promise, if a callback is not passed - */ -function parallelLimit(tasks, limit, callback) { - return parallel(eachOfLimit(limit), tasks, callback); -} - -/** - * A queue of tasks for the worker function to complete. - * @typedef {Iterable} QueueObject - * @memberOf module:ControlFlow - * @property {Function} length - a function returning the number of items - * waiting to be processed. Invoke with `queue.length()`. - * @property {boolean} started - a boolean indicating whether or not any - * items have been pushed and processed by the queue. - * @property {Function} running - a function returning the number of items - * currently being processed. Invoke with `queue.running()`. - * @property {Function} workersList - a function returning the array of items - * currently being processed. Invoke with `queue.workersList()`. - * @property {Function} idle - a function returning false if there are items - * waiting or being processed, or true if not. Invoke with `queue.idle()`. - * @property {number} concurrency - an integer for determining how many `worker` - * functions should be run in parallel. This property can be changed after a - * `queue` is created to alter the concurrency on-the-fly. - * @property {number} payload - an integer that specifies how many items are - * passed to the worker function at a time. only applies if this is a - * [cargo]{@link module:ControlFlow.cargo} object - * @property {AsyncFunction} push - add a new task to the `queue`. Calls `callback` - * once the `worker` has finished processing the task. Instead of a single task, - * a `tasks` array can be submitted. The respective callback is used for every - * task in the list. Invoke with `queue.push(task, [callback])`, - * @property {AsyncFunction} unshift - add a new task to the front of the `queue`. - * Invoke with `queue.unshift(task, [callback])`. - * @property {AsyncFunction} pushAsync - the same as `q.push`, except this returns - * a promise that rejects if an error occurs. - * @property {AsyncFunction} unshiftAsync - the same as `q.unshift`, except this returns - * a promise that rejects if an error occurs. - * @property {Function} remove - remove items from the queue that match a test - * function. The test function will be passed an object with a `data` property, - * and a `priority` property, if this is a - * [priorityQueue]{@link module:ControlFlow.priorityQueue} object. - * Invoked with `queue.remove(testFn)`, where `testFn` is of the form - * `function ({data, priority}) {}` and returns a Boolean. - * @property {Function} saturated - a function that sets a callback that is - * called when the number of running workers hits the `concurrency` limit, and - * further tasks will be queued. If the callback is omitted, `q.saturated()` - * returns a promise for the next occurrence. - * @property {Function} unsaturated - a function that sets a callback that is - * called when the number of running workers is less than the `concurrency` & - * `buffer` limits, and further tasks will not be queued. If the callback is - * omitted, `q.unsaturated()` returns a promise for the next occurrence. - * @property {number} buffer - A minimum threshold buffer in order to say that - * the `queue` is `unsaturated`. - * @property {Function} empty - a function that sets a callback that is called - * when the last item from the `queue` is given to a `worker`. If the callback - * is omitted, `q.empty()` returns a promise for the next occurrence. - * @property {Function} drain - a function that sets a callback that is called - * when the last item from the `queue` has returned from the `worker`. If the - * callback is omitted, `q.drain()` returns a promise for the next occurrence. - * @property {Function} error - a function that sets a callback that is called - * when a task errors. Has the signature `function(error, task)`. If the - * callback is omitted, `error()` returns a promise that rejects on the next - * error. - * @property {boolean} paused - a boolean for determining whether the queue is - * in a paused state. - * @property {Function} pause - a function that pauses the processing of tasks - * until `resume()` is called. Invoke with `queue.pause()`. - * @property {Function} resume - a function that resumes the processing of - * queued tasks when the queue is paused. Invoke with `queue.resume()`. - * @property {Function} kill - a function that removes the `drain` callback and - * empties remaining tasks from the queue forcing it to go idle. No more tasks - * should be pushed to the queue after calling this function. Invoke with `queue.kill()`. - * - * @example - * const q = async.queue(worker, 2) - * q.push(item1) - * q.push(item2) - * q.push(item3) - * // queues are iterable, spread into an array to inspect - * const items = [...q] // [item1, item2, item3] - * // or use for of - * for (let item of q) { - * console.log(item) - * } - * - * q.drain(() => { - * console.log('all done') - * }) - * // or - * await q.drain() - */ - -/** - * Creates a `queue` object with the specified `concurrency`. Tasks added to the - * `queue` are processed in parallel (up to the `concurrency` limit). If all - * `worker`s are in progress, the task is queued until one becomes available. - * Once a `worker` completes a `task`, that `task`'s callback is called. - * - * @name queue - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {AsyncFunction} worker - An async function for processing a queued task. - * If you want to handle errors from an individual task, pass a callback to - * `q.push()`. Invoked with (task, callback). - * @param {number} [concurrency=1] - An `integer` for determining how many - * `worker` functions should be run in parallel. If omitted, the concurrency - * defaults to `1`. If the concurrency is `0`, an error is thrown. - * @returns {module:ControlFlow.QueueObject} A queue object to manage the tasks. Callbacks can be - * attached as certain properties to listen for specific events during the - * lifecycle of the queue. - * @example - * - * // create a queue object with concurrency 2 - * var q = async.queue(function(task, callback) { - * console.log('hello ' + task.name); - * callback(); - * }, 2); - * - * // assign a callback - * q.drain(function() { - * console.log('all items have been processed'); - * }); - * // or await the end - * await q.drain() - * - * // assign an error callback - * q.error(function(err, task) { - * console.error('task experienced an error'); - * }); - * - * // add some items to the queue - * q.push({name: 'foo'}, function(err) { - * console.log('finished processing foo'); - * }); - * // callback is optional - * q.push({name: 'bar'}); - * - * // add some items to the queue (batch-wise) - * q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function(err) { - * console.log('finished processing item'); - * }); - * - * // add some items to the front of the queue - * q.unshift({name: 'bar'}, function (err) { - * console.log('finished processing bar'); - * }); - */ -function queue$1 (worker, concurrency) { - var _worker = wrapAsync(worker); - return queue((items, cb) => { - _worker(items[0], cb); - }, concurrency, 1); -} - -// Binary min-heap implementation used for priority queue. -// Implementation is stable, i.e. push time is considered for equal priorities -class Heap { - constructor() { - this.heap = []; - this.pushCount = Number.MIN_SAFE_INTEGER; - } - - get length() { - return this.heap.length; - } - - empty () { - this.heap = []; - return this; - } - - percUp(index) { - let p; - - while (index > 0 && smaller(this.heap[index], this.heap[p=parent(index)])) { - let t = this.heap[index]; - this.heap[index] = this.heap[p]; - this.heap[p] = t; - - index = p; - } - } - - percDown(index) { - let l; - - while ((l=leftChi(index)) < this.heap.length) { - if (l+1 < this.heap.length && smaller(this.heap[l+1], this.heap[l])) { - l = l+1; - } - - if (smaller(this.heap[index], this.heap[l])) { - break; - } - - let t = this.heap[index]; - this.heap[index] = this.heap[l]; - this.heap[l] = t; - - index = l; - } - } - - push(node) { - node.pushCount = ++this.pushCount; - this.heap.push(node); - this.percUp(this.heap.length-1); - } - - unshift(node) { - return this.heap.push(node); - } - - shift() { - let [top] = this.heap; - - this.heap[0] = this.heap[this.heap.length-1]; - this.heap.pop(); - this.percDown(0); - - return top; - } - - toArray() { - return [...this]; - } - - *[Symbol.iterator] () { - for (let i = 0; i < this.heap.length; i++) { - yield this.heap[i].data; - } - } - - remove (testFn) { - let j = 0; - for (let i = 0; i < this.heap.length; i++) { - if (!testFn(this.heap[i])) { - this.heap[j] = this.heap[i]; - j++; - } - } - - this.heap.splice(j); - - for (let i = parent(this.heap.length-1); i >= 0; i--) { - this.percDown(i); - } - - return this; - } -} - -function leftChi(i) { - return (i<<1)+1; -} - -function parent(i) { - return ((i+1)>>1)-1; -} - -function smaller(x, y) { - if (x.priority !== y.priority) { - return x.priority < y.priority; - } - else { - return x.pushCount < y.pushCount; - } -} - -/** - * The same as [async.queue]{@link module:ControlFlow.queue} only tasks are assigned a priority and - * completed in ascending priority order. - * - * @name priorityQueue - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.queue]{@link module:ControlFlow.queue} - * @category Control Flow - * @param {AsyncFunction} worker - An async function for processing a queued task. - * If you want to handle errors from an individual task, pass a callback to - * `q.push()`. - * Invoked with (task, callback). - * @param {number} concurrency - An `integer` for determining how many `worker` - * functions should be run in parallel. If omitted, the concurrency defaults to - * `1`. If the concurrency is `0`, an error is thrown. - * @returns {module:ControlFlow.QueueObject} A priorityQueue object to manage the tasks. There are three - * differences between `queue` and `priorityQueue` objects: - * * `push(task, priority, [callback])` - `priority` should be a number. If an - * array of `tasks` is given, all tasks will be assigned the same priority. - * * `pushAsync(task, priority, [callback])` - the same as `priorityQueue.push`, - * except this returns a promise that rejects if an error occurs. - * * The `unshift` and `unshiftAsync` methods were removed. - */ -function priorityQueue(worker, concurrency) { - // Start with a normal queue - var q = queue$1(worker, concurrency); - - var { - push, - pushAsync - } = q; - - q._tasks = new Heap(); - q._createTaskItem = ({data, priority}, callback) => { - return { - data, - priority, - callback - }; - }; - - function createDataItems(tasks, priority) { - if (!Array.isArray(tasks)) { - return {data: tasks, priority}; - } - return tasks.map(data => { return {data, priority}; }); - } - - // Override push to accept second parameter representing priority - q.push = function(data, priority = 0, callback) { - return push(createDataItems(data, priority), callback); - }; - - q.pushAsync = function(data, priority = 0, callback) { - return pushAsync(createDataItems(data, priority), callback); - }; - - // Remove unshift functions - delete q.unshift; - delete q.unshiftAsync; - - return q; -} - -/** - * Runs the `tasks` array of functions in parallel, without waiting until the - * previous function has completed. Once any of the `tasks` complete or pass an - * error to its callback, the main `callback` is immediately called. It's - * equivalent to `Promise.race()`. - * - * @name race - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array} tasks - An array containing [async functions]{@link AsyncFunction} - * to run. Each function can complete with an optional `result` value. - * @param {Function} callback - A callback to run once any of the functions have - * completed. This function gets an error or result from the first function that - * completed. Invoked with (err, result). - * @returns {Promise} a promise, if a callback is omitted - * @example - * - * async.race([ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ], - * // main callback - * function(err, result) { - * // the result will be equal to 'two' as it finishes earlier - * }); - */ -function race(tasks, callback) { - callback = once(callback); - if (!Array.isArray(tasks)) return callback(new TypeError('First argument to race must be an array of functions')); - if (!tasks.length) return callback(); - for (var i = 0, l = tasks.length; i < l; i++) { - wrapAsync(tasks[i])(callback); - } -} - -var race$1 = awaitify(race, 2); - -/** - * Same as [`reduce`]{@link module:Collections.reduce}, only operates on `array` in reverse order. - * - * @name reduceRight - * @static - * @memberOf module:Collections - * @method - * @see [async.reduce]{@link module:Collections.reduce} - * @alias foldr - * @category Collection - * @param {Array} array - A collection to iterate over. - * @param {*} memo - The initial state of the reduction. - * @param {AsyncFunction} iteratee - A function applied to each item in the - * array to produce the next step in the reduction. - * The `iteratee` should complete with the next state of the reduction. - * If the iteratee completes with an error, the reduction is stopped and the - * main `callback` is immediately called with the error. - * Invoked with (memo, item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result is the reduced value. Invoked with - * (err, result). - * @returns {Promise} a promise, if no callback is passed - */ -function reduceRight (array, memo, iteratee, callback) { - var reversed = [...array].reverse(); - return reduce$1(reversed, memo, iteratee, callback); -} - -/** - * Wraps the async function in another function that always completes with a - * result object, even when it errors. - * - * The result object has either the property `error` or `value`. - * - * @name reflect - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} fn - The async function you want to wrap - * @returns {Function} - A function that always passes null to it's callback as - * the error. The second argument to the callback will be an `object` with - * either an `error` or a `value` property. - * @example - * - * async.parallel([ - * async.reflect(function(callback) { - * // do some stuff ... - * callback(null, 'one'); - * }), - * async.reflect(function(callback) { - * // do some more stuff but error ... - * callback('bad stuff happened'); - * }), - * async.reflect(function(callback) { - * // do some more stuff ... - * callback(null, 'two'); - * }) - * ], - * // optional callback - * function(err, results) { - * // values - * // results[0].value = 'one' - * // results[1].error = 'bad stuff happened' - * // results[2].value = 'two' - * }); - */ -function reflect(fn) { - var _fn = wrapAsync(fn); - return initialParams(function reflectOn(args, reflectCallback) { - args.push((error, ...cbArgs) => { - let retVal = {}; - if (error) { - retVal.error = error; - } - if (cbArgs.length > 0){ - var value = cbArgs; - if (cbArgs.length <= 1) { - [value] = cbArgs; - } - retVal.value = value; - } - reflectCallback(null, retVal); - }); - - return _fn.apply(this, args); - }); -} - -/** - * A helper function that wraps an array or an object of functions with `reflect`. - * - * @name reflectAll - * @static - * @memberOf module:Utils - * @method - * @see [async.reflect]{@link module:Utils.reflect} - * @category Util - * @param {Array|Object|Iterable} tasks - The collection of - * [async functions]{@link AsyncFunction} to wrap in `async.reflect`. - * @returns {Array} Returns an array of async functions, each wrapped in - * `async.reflect` - * @example - * - * let tasks = [ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * // do some more stuff but error ... - * callback(new Error('bad stuff happened')); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ]; - * - * async.parallel(async.reflectAll(tasks), - * // optional callback - * function(err, results) { - * // values - * // results[0].value = 'one' - * // results[1].error = Error('bad stuff happened') - * // results[2].value = 'two' - * }); - * - * // an example using an object instead of an array - * let tasks = { - * one: function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * two: function(callback) { - * callback('two'); - * }, - * three: function(callback) { - * setTimeout(function() { - * callback(null, 'three'); - * }, 100); - * } - * }; - * - * async.parallel(async.reflectAll(tasks), - * // optional callback - * function(err, results) { - * // values - * // results.one.value = 'one' - * // results.two.error = 'two' - * // results.three.value = 'three' - * }); - */ -function reflectAll(tasks) { - var results; - if (Array.isArray(tasks)) { - results = tasks.map(reflect); - } else { - results = {}; - Object.keys(tasks).forEach(key => { - results[key] = reflect.call(this, tasks[key]); - }); - } - return results; -} - -function reject(eachfn, arr, _iteratee, callback) { - const iteratee = wrapAsync(_iteratee); - return _filter(eachfn, arr, (value, cb) => { - iteratee(value, (err, v) => { - cb(err, !v); - }); - }, callback); -} - -/** - * The opposite of [`filter`]{@link module:Collections.filter}. Removes values that pass an `async` truth test. - * - * @name reject - * @static - * @memberOf module:Collections - * @method - * @see [async.filter]{@link module:Collections.filter} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {Function} iteratee - An async truth test to apply to each item in - * `coll`. - * The should complete with a boolean value as its `result`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @returns {Promise} a promise, if no callback is passed - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * - * const fileList = ['dir1/file1.txt','dir2/file3.txt','dir3/file6.txt']; - * - * // asynchronous function that checks if a file exists - * function fileExists(file, callback) { - * fs.access(file, fs.constants.F_OK, (err) => { - * callback(null, !err); - * }); - * } - * - * // Using callbacks - * async.reject(fileList, fileExists, function(err, results) { - * // [ 'dir3/file6.txt' ] - * // results now equals an array of the non-existing files - * }); - * - * // Using Promises - * async.reject(fileList, fileExists) - * .then( results => { - * console.log(results); - * // [ 'dir3/file6.txt' ] - * // results now equals an array of the non-existing files - * }).catch( err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let results = await async.reject(fileList, fileExists); - * console.log(results); - * // [ 'dir3/file6.txt' ] - * // results now equals an array of the non-existing files - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function reject$1 (coll, iteratee, callback) { - return reject(eachOf$1, coll, iteratee, callback) -} -var reject$2 = awaitify(reject$1, 3); - -/** - * The same as [`reject`]{@link module:Collections.reject} but runs a maximum of `limit` async operations at a - * time. - * - * @name rejectLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.reject]{@link module:Collections.reject} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {Function} iteratee - An async truth test to apply to each item in - * `coll`. - * The should complete with a boolean value as its `result`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @returns {Promise} a promise, if no callback is passed - */ -function rejectLimit (coll, limit, iteratee, callback) { - return reject(eachOfLimit(limit), coll, iteratee, callback) -} -var rejectLimit$1 = awaitify(rejectLimit, 4); - -/** - * The same as [`reject`]{@link module:Collections.reject} but runs only a single async operation at a time. - * - * @name rejectSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.reject]{@link module:Collections.reject} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {Function} iteratee - An async truth test to apply to each item in - * `coll`. - * The should complete with a boolean value as its `result`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @returns {Promise} a promise, if no callback is passed - */ -function rejectSeries (coll, iteratee, callback) { - return reject(eachOfSeries$1, coll, iteratee, callback) -} -var rejectSeries$1 = awaitify(rejectSeries, 3); - -function constant$1(value) { - return function () { - return value; - } -} - -/** - * Attempts to get a successful response from `task` no more than `times` times - * before returning an error. If the task is successful, the `callback` will be - * passed the result of the successful task. If all attempts fail, the callback - * will be passed the error and result (if any) of the final attempt. - * - * @name retry - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @see [async.retryable]{@link module:ControlFlow.retryable} - * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - Can be either an - * object with `times` and `interval` or a number. - * * `times` - The number of attempts to make before giving up. The default - * is `5`. - * * `interval` - The time to wait between retries, in milliseconds. The - * default is `0`. The interval may also be specified as a function of the - * retry count (see example). - * * `errorFilter` - An optional synchronous function that is invoked on - * erroneous result. If it returns `true` the retry attempts will continue; - * if the function returns `false` the retry flow is aborted with the current - * attempt's error and result being returned to the final callback. - * Invoked with (err). - * * If `opts` is a number, the number specifies the number of times to retry, - * with the default interval of `0`. - * @param {AsyncFunction} task - An async function to retry. - * Invoked with (callback). - * @param {Function} [callback] - An optional callback which is called when the - * task has succeeded, or after the final failed attempt. It receives the `err` - * and `result` arguments of the last attempt at completing the `task`. Invoked - * with (err, results). - * @returns {Promise} a promise if no callback provided - * - * @example - * - * // The `retry` function can be used as a stand-alone control flow by passing - * // a callback, as shown below: - * - * // try calling apiMethod 3 times - * async.retry(3, apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // try calling apiMethod 3 times, waiting 200 ms between each retry - * async.retry({times: 3, interval: 200}, apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // try calling apiMethod 10 times with exponential backoff - * // (i.e. intervals of 100, 200, 400, 800, 1600, ... milliseconds) - * async.retry({ - * times: 10, - * interval: function(retryCount) { - * return 50 * Math.pow(2, retryCount); - * } - * }, apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // try calling apiMethod the default 5 times no delay between each retry - * async.retry(apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // try calling apiMethod only when error condition satisfies, all other - * // errors will abort the retry control flow and return to final callback - * async.retry({ - * errorFilter: function(err) { - * return err.message === 'Temporary error'; // only retry on a specific error - * } - * }, apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // to retry individual methods that are not as reliable within other - * // control flow functions, use the `retryable` wrapper: - * async.auto({ - * users: api.getUsers.bind(api), - * payments: async.retryable(3, api.getPayments.bind(api)) - * }, function(err, results) { - * // do something with the results - * }); - * - */ -const DEFAULT_TIMES = 5; -const DEFAULT_INTERVAL = 0; - -function retry(opts, task, callback) { - var options = { - times: DEFAULT_TIMES, - intervalFunc: constant$1(DEFAULT_INTERVAL) - }; - - if (arguments.length < 3 && typeof opts === 'function') { - callback = task || promiseCallback(); - task = opts; - } else { - parseTimes(options, opts); - callback = callback || promiseCallback(); - } - - if (typeof task !== 'function') { - throw new Error("Invalid arguments for async.retry"); - } - - var _task = wrapAsync(task); - - var attempt = 1; - function retryAttempt() { - _task((err, ...args) => { - if (err === false) return - if (err && attempt++ < options.times && - (typeof options.errorFilter != 'function' || - options.errorFilter(err))) { - setTimeout(retryAttempt, options.intervalFunc(attempt - 1)); - } else { - callback(err, ...args); - } - }); - } - - retryAttempt(); - return callback[PROMISE_SYMBOL] -} - -function parseTimes(acc, t) { - if (typeof t === 'object') { - acc.times = +t.times || DEFAULT_TIMES; - - acc.intervalFunc = typeof t.interval === 'function' ? - t.interval : - constant$1(+t.interval || DEFAULT_INTERVAL); - - acc.errorFilter = t.errorFilter; - } else if (typeof t === 'number' || typeof t === 'string') { - acc.times = +t || DEFAULT_TIMES; - } else { - throw new Error("Invalid arguments for async.retry"); - } -} - -/** - * A close relative of [`retry`]{@link module:ControlFlow.retry}. This method - * wraps a task and makes it retryable, rather than immediately calling it - * with retries. - * - * @name retryable - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.retry]{@link module:ControlFlow.retry} - * @category Control Flow - * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - optional - * options, exactly the same as from `retry`, except for a `opts.arity` that - * is the arity of the `task` function, defaulting to `task.length` - * @param {AsyncFunction} task - the asynchronous function to wrap. - * This function will be passed any arguments passed to the returned wrapper. - * Invoked with (...args, callback). - * @returns {AsyncFunction} The wrapped function, which when invoked, will - * retry on an error, based on the parameters specified in `opts`. - * This function will accept the same parameters as `task`. - * @example - * - * async.auto({ - * dep1: async.retryable(3, getFromFlakyService), - * process: ["dep1", async.retryable(3, function (results, cb) { - * maybeProcessData(results.dep1, cb); - * })] - * }, callback); - */ -function retryable (opts, task) { - if (!task) { - task = opts; - opts = null; - } - let arity = (opts && opts.arity) || task.length; - if (isAsync(task)) { - arity += 1; - } - var _task = wrapAsync(task); - return initialParams((args, callback) => { - if (args.length < arity - 1 || callback == null) { - args.push(callback); - callback = promiseCallback(); - } - function taskFn(cb) { - _task(...args, cb); - } - - if (opts) retry(opts, taskFn, callback); - else retry(taskFn, callback); - - return callback[PROMISE_SYMBOL] - }); -} - -/** - * Run the functions in the `tasks` collection in series, each one running once - * the previous function has completed. If any functions in the series pass an - * error to its callback, no more functions are run, and `callback` is - * immediately called with the value of the error. Otherwise, `callback` - * receives an array of results when `tasks` have completed. - * - * It is also possible to use an object instead of an array. Each property will - * be run as a function, and the results will be passed to the final `callback` - * as an object instead of an array. This can be a more readable way of handling - * results from {@link async.series}. - * - * **Note** that while many implementations preserve the order of object - * properties, the [ECMAScript Language Specification](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6) - * explicitly states that - * - * > The mechanics and order of enumerating the properties is not specified. - * - * So if you rely on the order in which your series of functions are executed, - * and want this to work on all platforms, consider using an array. - * - * @name series - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection containing - * [async functions]{@link AsyncFunction} to run in series. - * Each function can complete with any number of optional `result` values. - * @param {Function} [callback] - An optional callback to run once all the - * functions have completed. This function gets a results array (or object) - * containing all the result arguments passed to the `task` callbacks. Invoked - * with (err, result). - * @return {Promise} a promise, if no callback is passed - * @example - * - * //Using Callbacks - * async.series([ - * function(callback) { - * setTimeout(function() { - * // do some async task - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * // then do another async task - * callback(null, 'two'); - * }, 100); - * } - * ], function(err, results) { - * console.log(results); - * // results is equal to ['one','two'] - * }); - * - * // an example using objects instead of arrays - * async.series({ - * one: function(callback) { - * setTimeout(function() { - * // do some async task - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * // then do another async task - * callback(null, 2); - * }, 100); - * } - * }, function(err, results) { - * console.log(results); - * // results is equal to: { one: 1, two: 2 } - * }); - * - * //Using Promises - * async.series([ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ]).then(results => { - * console.log(results); - * // results is equal to ['one','two'] - * }).catch(err => { - * console.log(err); - * }); - * - * // an example using an object instead of an array - * async.series({ - * one: function(callback) { - * setTimeout(function() { - * // do some async task - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * // then do another async task - * callback(null, 2); - * }, 100); - * } - * }).then(results => { - * console.log(results); - * // results is equal to: { one: 1, two: 2 } - * }).catch(err => { - * console.log(err); - * }); - * - * //Using async/await - * async () => { - * try { - * let results = await async.series([ - * function(callback) { - * setTimeout(function() { - * // do some async task - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * // then do another async task - * callback(null, 'two'); - * }, 100); - * } - * ]); - * console.log(results); - * // results is equal to ['one','two'] - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // an example using an object instead of an array - * async () => { - * try { - * let results = await async.parallel({ - * one: function(callback) { - * setTimeout(function() { - * // do some async task - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * // then do another async task - * callback(null, 2); - * }, 100); - * } - * }); - * console.log(results); - * // results is equal to: { one: 1, two: 2 } - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function series(tasks, callback) { - return parallel(eachOfSeries$1, tasks, callback); -} - -/** - * Returns `true` if at least one element in the `coll` satisfies an async test. - * If any iteratee call returns `true`, the main `callback` is immediately - * called. - * - * @name some - * @static - * @memberOf module:Collections - * @method - * @alias any - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collections in parallel. - * The iteratee should complete with a boolean `result` value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the iteratee functions have finished. - * Result will be either `true` or `false` depending on the values of the async - * tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * // dir4 does not exist - * - * // asynchronous function that checks if a file exists - * function fileExists(file, callback) { - * fs.access(file, fs.constants.F_OK, (err) => { - * callback(null, !err); - * }); - * } - * - * // Using callbacks - * async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists, - * function(err, result) { - * console.log(result); - * // true - * // result is true since some file in the list exists - * } - *); - * - * async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists, - * function(err, result) { - * console.log(result); - * // false - * // result is false since none of the files exists - * } - *); - * - * // Using Promises - * async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists) - * .then( result => { - * console.log(result); - * // true - * // result is true since some file in the list exists - * }).catch( err => { - * console.log(err); - * }); - * - * async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists) - * .then( result => { - * console.log(result); - * // false - * // result is false since none of the files exists - * }).catch( err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists); - * console.log(result); - * // true - * // result is true since some file in the list exists - * } - * catch (err) { - * console.log(err); - * } - * } - * - * async () => { - * try { - * let result = await async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists); - * console.log(result); - * // false - * // result is false since none of the files exists - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function some(coll, iteratee, callback) { - return _createTester(Boolean, res => res)(eachOf$1, coll, iteratee, callback) -} -var some$1 = awaitify(some, 3); - -/** - * The same as [`some`]{@link module:Collections.some} but runs a maximum of `limit` async operations at a time. - * - * @name someLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.some]{@link module:Collections.some} - * @alias anyLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collections in parallel. - * The iteratee should complete with a boolean `result` value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the iteratee functions have finished. - * Result will be either `true` or `false` depending on the values of the async - * tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - */ -function someLimit(coll, limit, iteratee, callback) { - return _createTester(Boolean, res => res)(eachOfLimit(limit), coll, iteratee, callback) -} -var someLimit$1 = awaitify(someLimit, 4); - -/** - * The same as [`some`]{@link module:Collections.some} but runs only a single async operation at a time. - * - * @name someSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.some]{@link module:Collections.some} - * @alias anySeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collections in series. - * The iteratee should complete with a boolean `result` value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the iteratee functions have finished. - * Result will be either `true` or `false` depending on the values of the async - * tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - */ -function someSeries(coll, iteratee, callback) { - return _createTester(Boolean, res => res)(eachOfSeries$1, coll, iteratee, callback) -} -var someSeries$1 = awaitify(someSeries, 3); - -/** - * Sorts a list by the results of running each `coll` value through an async - * `iteratee`. - * - * @name sortBy - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with a value to use as the sort criteria as - * its `result`. - * Invoked with (item, callback). - * @param {Function} callback - A callback which is called after all the - * `iteratee` functions have finished, or an error occurs. Results is the items - * from the original `coll` sorted by the values returned by the `iteratee` - * calls. Invoked with (err, results). - * @returns {Promise} a promise, if no callback passed - * @example - * - * // bigfile.txt is a file that is 251100 bytes in size - * // mediumfile.txt is a file that is 11000 bytes in size - * // smallfile.txt is a file that is 121 bytes in size - * - * // asynchronous function that returns the file size in bytes - * function getFileSizeInBytes(file, callback) { - * fs.stat(file, function(err, stat) { - * if (err) { - * return callback(err); - * } - * callback(null, stat.size); - * }); - * } - * - * // Using callbacks - * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], getFileSizeInBytes, - * function(err, results) { - * if (err) { - * console.log(err); - * } else { - * console.log(results); - * // results is now the original array of files sorted by - * // file size (ascending by default), e.g. - * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] - * } - * } - * ); - * - * // By modifying the callback parameter the - * // sorting order can be influenced: - * - * // ascending order - * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], function(file, callback) { - * getFileSizeInBytes(file, function(getFileSizeErr, fileSize) { - * if (getFileSizeErr) return callback(getFileSizeErr); - * callback(null, fileSize); - * }); - * }, function(err, results) { - * if (err) { - * console.log(err); - * } else { - * console.log(results); - * // results is now the original array of files sorted by - * // file size (ascending by default), e.g. - * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] - * } - * } - * ); - * - * // descending order - * async.sortBy(['bigfile.txt','mediumfile.txt','smallfile.txt'], function(file, callback) { - * getFileSizeInBytes(file, function(getFileSizeErr, fileSize) { - * if (getFileSizeErr) { - * return callback(getFileSizeErr); - * } - * callback(null, fileSize * -1); - * }); - * }, function(err, results) { - * if (err) { - * console.log(err); - * } else { - * console.log(results); - * // results is now the original array of files sorted by - * // file size (ascending by default), e.g. - * // [ 'bigfile.txt', 'mediumfile.txt', 'smallfile.txt'] - * } - * } - * ); - * - * // Error handling - * async.sortBy(['mediumfile.txt','smallfile.txt','missingfile.txt'], getFileSizeInBytes, - * function(err, results) { - * if (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } else { - * console.log(results); - * } - * } - * ); - * - * // Using Promises - * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], getFileSizeInBytes) - * .then( results => { - * console.log(results); - * // results is now the original array of files sorted by - * // file size (ascending by default), e.g. - * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] - * }).catch( err => { - * console.log(err); - * }); - * - * // Error handling - * async.sortBy(['mediumfile.txt','smallfile.txt','missingfile.txt'], getFileSizeInBytes) - * .then( results => { - * console.log(results); - * }).catch( err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * }); - * - * // Using async/await - * (async () => { - * try { - * let results = await async.sortBy(['bigfile.txt','mediumfile.txt','smallfile.txt'], getFileSizeInBytes); - * console.log(results); - * // results is now the original array of files sorted by - * // file size (ascending by default), e.g. - * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] - * } - * catch (err) { - * console.log(err); - * } - * })(); - * - * // Error handling - * async () => { - * try { - * let results = await async.sortBy(['missingfile.txt','mediumfile.txt','smallfile.txt'], getFileSizeInBytes); - * console.log(results); - * } - * catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } - * } - * - */ -function sortBy (coll, iteratee, callback) { - var _iteratee = wrapAsync(iteratee); - return map$1(coll, (x, iterCb) => { - _iteratee(x, (err, criteria) => { - if (err) return iterCb(err); - iterCb(err, {value: x, criteria}); - }); - }, (err, results) => { - if (err) return callback(err); - callback(null, results.sort(comparator).map(v => v.value)); - }); - - function comparator(left, right) { - var a = left.criteria, b = right.criteria; - return a < b ? -1 : a > b ? 1 : 0; - } -} -var sortBy$1 = awaitify(sortBy, 3); - -/** - * Sets a time limit on an asynchronous function. If the function does not call - * its callback within the specified milliseconds, it will be called with a - * timeout error. The code property for the error object will be `'ETIMEDOUT'`. - * - * @name timeout - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} asyncFn - The async function to limit in time. - * @param {number} milliseconds - The specified time limit. - * @param {*} [info] - Any variable you want attached (`string`, `object`, etc) - * to timeout Error for more information.. - * @returns {AsyncFunction} Returns a wrapped function that can be used with any - * of the control flow functions. - * Invoke this function with the same parameters as you would `asyncFunc`. - * @example - * - * function myFunction(foo, callback) { - * doAsyncTask(foo, function(err, data) { - * // handle errors - * if (err) return callback(err); - * - * // do some stuff ... - * - * // return processed data - * return callback(null, data); - * }); - * } - * - * var wrapped = async.timeout(myFunction, 1000); - * - * // call `wrapped` as you would `myFunction` - * wrapped({ bar: 'bar' }, function(err, data) { - * // if `myFunction` takes < 1000 ms to execute, `err` - * // and `data` will have their expected values - * - * // else `err` will be an Error with the code 'ETIMEDOUT' - * }); - */ -function timeout(asyncFn, milliseconds, info) { - var fn = wrapAsync(asyncFn); - - return initialParams((args, callback) => { - var timedOut = false; - var timer; - - function timeoutCallback() { - var name = asyncFn.name || 'anonymous'; - var error = new Error('Callback function "' + name + '" timed out.'); - error.code = 'ETIMEDOUT'; - if (info) { - error.info = info; - } - timedOut = true; - callback(error); - } - - args.push((...cbArgs) => { - if (!timedOut) { - callback(...cbArgs); - clearTimeout(timer); - } - }); - - // setup timer and call original function - timer = setTimeout(timeoutCallback, milliseconds); - fn(...args); - }); -} - -function range(size) { - var result = Array(size); - while (size--) { - result[size] = size; - } - return result; -} - -/** - * The same as [times]{@link module:ControlFlow.times} but runs a maximum of `limit` async operations at a - * time. - * - * @name timesLimit - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.times]{@link module:ControlFlow.times} - * @category Control Flow - * @param {number} count - The number of times to run the function. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - The async function to call `n` times. - * Invoked with the iteration index and a callback: (n, next). - * @param {Function} callback - see [async.map]{@link module:Collections.map}. - * @returns {Promise} a promise, if no callback is provided - */ -function timesLimit(count, limit, iteratee, callback) { - var _iteratee = wrapAsync(iteratee); - return mapLimit$1(range(count), limit, _iteratee, callback); -} - -/** - * Calls the `iteratee` function `n` times, and accumulates results in the same - * manner you would use with [map]{@link module:Collections.map}. - * - * @name times - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.map]{@link module:Collections.map} - * @category Control Flow - * @param {number} n - The number of times to run the function. - * @param {AsyncFunction} iteratee - The async function to call `n` times. - * Invoked with the iteration index and a callback: (n, next). - * @param {Function} callback - see {@link module:Collections.map}. - * @returns {Promise} a promise, if no callback is provided - * @example - * - * // Pretend this is some complicated async factory - * var createUser = function(id, callback) { - * callback(null, { - * id: 'user' + id - * }); - * }; - * - * // generate 5 users - * async.times(5, function(n, next) { - * createUser(n, function(err, user) { - * next(err, user); - * }); - * }, function(err, users) { - * // we should now have 5 users - * }); - */ -function times (n, iteratee, callback) { - return timesLimit(n, Infinity, iteratee, callback) -} - -/** - * The same as [times]{@link module:ControlFlow.times} but runs only a single async operation at a time. - * - * @name timesSeries - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.times]{@link module:ControlFlow.times} - * @category Control Flow - * @param {number} n - The number of times to run the function. - * @param {AsyncFunction} iteratee - The async function to call `n` times. - * Invoked with the iteration index and a callback: (n, next). - * @param {Function} callback - see {@link module:Collections.map}. - * @returns {Promise} a promise, if no callback is provided - */ -function timesSeries (n, iteratee, callback) { - return timesLimit(n, 1, iteratee, callback) -} - -/** - * A relative of `reduce`. Takes an Object or Array, and iterates over each - * element in parallel, each step potentially mutating an `accumulator` value. - * The type of the accumulator defaults to the type of collection passed in. - * - * @name transform - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {*} [accumulator] - The initial state of the transform. If omitted, - * it will default to an empty Object or Array, depending on the type of `coll` - * @param {AsyncFunction} iteratee - A function applied to each item in the - * collection that potentially modifies the accumulator. - * Invoked with (accumulator, item, key, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result is the transformed accumulator. - * Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - * @example - * - * // file1.txt is a file that is 1000 bytes in size - * // file2.txt is a file that is 2000 bytes in size - * // file3.txt is a file that is 3000 bytes in size - * - * // helper function that returns human-readable size format from bytes - * function formatBytes(bytes, decimals = 2) { - * // implementation not included for brevity - * return humanReadbleFilesize; - * } - * - * const fileList = ['file1.txt','file2.txt','file3.txt']; - * - * // asynchronous function that returns the file size, transformed to human-readable format - * // e.g. 1024 bytes = 1KB, 1234 bytes = 1.21 KB, 1048576 bytes = 1MB, etc. - * function transformFileSize(acc, value, key, callback) { - * fs.stat(value, function(err, stat) { - * if (err) { - * return callback(err); - * } - * acc[key] = formatBytes(stat.size); - * callback(null); - * }); - * } - * - * // Using callbacks - * async.transform(fileList, transformFileSize, function(err, result) { - * if(err) { - * console.log(err); - * } else { - * console.log(result); - * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ] - * } - * }); - * - * // Using Promises - * async.transform(fileList, transformFileSize) - * .then(result => { - * console.log(result); - * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ] - * }).catch(err => { - * console.log(err); - * }); - * - * // Using async/await - * (async () => { - * try { - * let result = await async.transform(fileList, transformFileSize); - * console.log(result); - * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ] - * } - * catch (err) { - * console.log(err); - * } - * })(); - * - * @example - * - * // file1.txt is a file that is 1000 bytes in size - * // file2.txt is a file that is 2000 bytes in size - * // file3.txt is a file that is 3000 bytes in size - * - * // helper function that returns human-readable size format from bytes - * function formatBytes(bytes, decimals = 2) { - * // implementation not included for brevity - * return humanReadbleFilesize; - * } - * - * const fileMap = { f1: 'file1.txt', f2: 'file2.txt', f3: 'file3.txt' }; - * - * // asynchronous function that returns the file size, transformed to human-readable format - * // e.g. 1024 bytes = 1KB, 1234 bytes = 1.21 KB, 1048576 bytes = 1MB, etc. - * function transformFileSize(acc, value, key, callback) { - * fs.stat(value, function(err, stat) { - * if (err) { - * return callback(err); - * } - * acc[key] = formatBytes(stat.size); - * callback(null); - * }); - * } - * - * // Using callbacks - * async.transform(fileMap, transformFileSize, function(err, result) { - * if(err) { - * console.log(err); - * } else { - * console.log(result); - * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' } - * } - * }); - * - * // Using Promises - * async.transform(fileMap, transformFileSize) - * .then(result => { - * console.log(result); - * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' } - * }).catch(err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.transform(fileMap, transformFileSize); - * console.log(result); - * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' } - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function transform (coll, accumulator, iteratee, callback) { - if (arguments.length <= 3 && typeof accumulator === 'function') { - callback = iteratee; - iteratee = accumulator; - accumulator = Array.isArray(coll) ? [] : {}; - } - callback = once(callback || promiseCallback()); - var _iteratee = wrapAsync(iteratee); - - eachOf$1(coll, (v, k, cb) => { - _iteratee(accumulator, v, k, cb); - }, err => callback(err, accumulator)); - return callback[PROMISE_SYMBOL] -} - -/** - * It runs each task in series but stops whenever any of the functions were - * successful. If one of the tasks were successful, the `callback` will be - * passed the result of the successful task. If all tasks fail, the callback - * will be passed the error and result (if any) of the final attempt. - * - * @name tryEach - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection containing functions to - * run, each function is passed a `callback(err, result)` it must call on - * completion with an error `err` (which can be `null`) and an optional `result` - * value. - * @param {Function} [callback] - An optional callback which is called when one - * of the tasks has succeeded, or all have failed. It receives the `err` and - * `result` arguments of the last attempt at completing the `task`. Invoked with - * (err, results). - * @returns {Promise} a promise, if no callback is passed - * @example - * async.tryEach([ - * function getDataFromFirstWebsite(callback) { - * // Try getting the data from the first website - * callback(err, data); - * }, - * function getDataFromSecondWebsite(callback) { - * // First website failed, - * // Try getting the data from the backup website - * callback(err, data); - * } - * ], - * // optional callback - * function(err, results) { - * Now do something with the data. - * }); - * - */ -function tryEach(tasks, callback) { - var error = null; - var result; - return eachSeries$1(tasks, (task, taskCb) => { - wrapAsync(task)((err, ...args) => { - if (err === false) return taskCb(err); - - if (args.length < 2) { - [result] = args; - } else { - result = args; - } - error = err; - taskCb(err ? null : {}); - }); - }, () => callback(error, result)); -} - -var tryEach$1 = awaitify(tryEach); - -/** - * Undoes a [memoize]{@link module:Utils.memoize}d function, reverting it to the original, - * unmemoized form. Handy for testing. - * - * @name unmemoize - * @static - * @memberOf module:Utils - * @method - * @see [async.memoize]{@link module:Utils.memoize} - * @category Util - * @param {AsyncFunction} fn - the memoized function - * @returns {AsyncFunction} a function that calls the original unmemoized function - */ -function unmemoize(fn) { - return (...args) => { - return (fn.unmemoized || fn)(...args); - }; -} - -/** - * Repeatedly call `iteratee`, while `test` returns `true`. Calls `callback` when - * stopped, or an error occurs. - * - * @name whilst - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {AsyncFunction} test - asynchronous truth test to perform before each - * execution of `iteratee`. Invoked with (). - * @param {AsyncFunction} iteratee - An async function which is called each time - * `test` passes. Invoked with (callback). - * @param {Function} [callback] - A callback which is called after the test - * function has failed and repeated execution of `iteratee` has stopped. `callback` - * will be passed an error and any arguments passed to the final `iteratee`'s - * callback. Invoked with (err, [results]); - * @returns {Promise} a promise, if no callback is passed - * @example - * - * var count = 0; - * async.whilst( - * function test(cb) { cb(null, count < 5); }, - * function iter(callback) { - * count++; - * setTimeout(function() { - * callback(null, count); - * }, 1000); - * }, - * function (err, n) { - * // 5 seconds have passed, n = 5 - * } - * ); - */ -function whilst(test, iteratee, callback) { - callback = onlyOnce(callback); - var _fn = wrapAsync(iteratee); - var _test = wrapAsync(test); - var results = []; - - function next(err, ...rest) { - if (err) return callback(err); - results = rest; - if (err === false) return; - _test(check); - } - - function check(err, truth) { - if (err) return callback(err); - if (err === false) return; - if (!truth) return callback(null, ...results); - _fn(next); - } - - return _test(check); -} -var whilst$1 = awaitify(whilst, 3); - -/** - * Repeatedly call `iteratee` until `test` returns `true`. Calls `callback` when - * stopped, or an error occurs. `callback` will be passed an error and any - * arguments passed to the final `iteratee`'s callback. - * - * The inverse of [whilst]{@link module:ControlFlow.whilst}. - * - * @name until - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.whilst]{@link module:ControlFlow.whilst} - * @category Control Flow - * @param {AsyncFunction} test - asynchronous truth test to perform before each - * execution of `iteratee`. Invoked with (callback). - * @param {AsyncFunction} iteratee - An async function which is called each time - * `test` fails. Invoked with (callback). - * @param {Function} [callback] - A callback which is called after the test - * function has passed and repeated execution of `iteratee` has stopped. `callback` - * will be passed an error and any arguments passed to the final `iteratee`'s - * callback. Invoked with (err, [results]); - * @returns {Promise} a promise, if a callback is not passed - * - * @example - * const results = [] - * let finished = false - * async.until(function test(cb) { - * cb(null, finished) - * }, function iter(next) { - * fetchPage(url, (err, body) => { - * if (err) return next(err) - * results = results.concat(body.objects) - * finished = !!body.next - * next(err) - * }) - * }, function done (err) { - * // all pages have been fetched - * }) - */ -function until(test, iteratee, callback) { - const _test = wrapAsync(test); - return whilst$1((cb) => _test((err, truth) => cb (err, !truth)), iteratee, callback); -} - -/** - * Runs the `tasks` array of functions in series, each passing their results to - * the next in the array. However, if any of the `tasks` pass an error to their - * own callback, the next function is not executed, and the main `callback` is - * immediately called with the error. - * - * @name waterfall - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array} tasks - An array of [async functions]{@link AsyncFunction} - * to run. - * Each function should complete with any number of `result` values. - * The `result` values will be passed as arguments, in order, to the next task. - * @param {Function} [callback] - An optional callback to run once all the - * functions have completed. This will be passed the results of the last task's - * callback. Invoked with (err, [results]). - * @returns {Promise} a promise, if a callback is omitted - * @example - * - * async.waterfall([ - * function(callback) { - * callback(null, 'one', 'two'); - * }, - * function(arg1, arg2, callback) { - * // arg1 now equals 'one' and arg2 now equals 'two' - * callback(null, 'three'); - * }, - * function(arg1, callback) { - * // arg1 now equals 'three' - * callback(null, 'done'); - * } - * ], function (err, result) { - * // result now equals 'done' - * }); - * - * // Or, with named functions: - * async.waterfall([ - * myFirstFunction, - * mySecondFunction, - * myLastFunction, - * ], function (err, result) { - * // result now equals 'done' - * }); - * function myFirstFunction(callback) { - * callback(null, 'one', 'two'); - * } - * function mySecondFunction(arg1, arg2, callback) { - * // arg1 now equals 'one' and arg2 now equals 'two' - * callback(null, 'three'); - * } - * function myLastFunction(arg1, callback) { - * // arg1 now equals 'three' - * callback(null, 'done'); - * } - */ -function waterfall (tasks, callback) { - callback = once(callback); - if (!Array.isArray(tasks)) return callback(new Error('First argument to waterfall must be an array of functions')); - if (!tasks.length) return callback(); - var taskIndex = 0; - - function nextTask(args) { - var task = wrapAsync(tasks[taskIndex++]); - task(...args, onlyOnce(next)); - } - - function next(err, ...args) { - if (err === false) return - if (err || taskIndex === tasks.length) { - return callback(err, ...args); - } - nextTask(args); - } - - nextTask([]); -} - -var waterfall$1 = awaitify(waterfall); - -/** - * An "async function" in the context of Async is an asynchronous function with - * a variable number of parameters, with the final parameter being a callback. - * (`function (arg1, arg2, ..., callback) {}`) - * The final callback is of the form `callback(err, results...)`, which must be - * called once the function is completed. The callback should be called with a - * Error as its first argument to signal that an error occurred. - * Otherwise, if no error occurred, it should be called with `null` as the first - * argument, and any additional `result` arguments that may apply, to signal - * successful completion. - * The callback must be called exactly once, ideally on a later tick of the - * JavaScript event loop. - * - * This type of function is also referred to as a "Node-style async function", - * or a "continuation passing-style function" (CPS). Most of the methods of this - * library are themselves CPS/Node-style async functions, or functions that - * return CPS/Node-style async functions. - * - * Wherever we accept a Node-style async function, we also directly accept an - * [ES2017 `async` function]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function}. - * In this case, the `async` function will not be passed a final callback - * argument, and any thrown error will be used as the `err` argument of the - * implicit callback, and the return value will be used as the `result` value. - * (i.e. a `rejected` of the returned Promise becomes the `err` callback - * argument, and a `resolved` value becomes the `result`.) - * - * Note, due to JavaScript limitations, we can only detect native `async` - * functions and not transpilied implementations. - * Your environment must have `async`/`await` support for this to work. - * (e.g. Node > v7.6, or a recent version of a modern browser). - * If you are using `async` functions through a transpiler (e.g. Babel), you - * must still wrap the function with [asyncify]{@link module:Utils.asyncify}, - * because the `async function` will be compiled to an ordinary function that - * returns a promise. - * - * @typedef {Function} AsyncFunction - * @static - */ - -var index = { - apply, - applyEach: applyEach$1, - applyEachSeries, - asyncify, - auto, - autoInject, - cargo, - cargoQueue: cargo$1, - compose, - concat: concat$1, - concatLimit: concatLimit$1, - concatSeries: concatSeries$1, - constant, - detect: detect$1, - detectLimit: detectLimit$1, - detectSeries: detectSeries$1, - dir, - doUntil, - doWhilst: doWhilst$1, - each, - eachLimit: eachLimit$2, - eachOf: eachOf$1, - eachOfLimit: eachOfLimit$2, - eachOfSeries: eachOfSeries$1, - eachSeries: eachSeries$1, - ensureAsync, - every: every$1, - everyLimit: everyLimit$1, - everySeries: everySeries$1, - filter: filter$1, - filterLimit: filterLimit$1, - filterSeries: filterSeries$1, - forever: forever$1, - groupBy, - groupByLimit: groupByLimit$1, - groupBySeries, - log, - map: map$1, - mapLimit: mapLimit$1, - mapSeries: mapSeries$1, - mapValues, - mapValuesLimit: mapValuesLimit$1, - mapValuesSeries, - memoize, - nextTick, - parallel: parallel$1, - parallelLimit, - priorityQueue, - queue: queue$1, - race: race$1, - reduce: reduce$1, - reduceRight, - reflect, - reflectAll, - reject: reject$2, - rejectLimit: rejectLimit$1, - rejectSeries: rejectSeries$1, - retry, - retryable, - seq, - series, - setImmediate: setImmediate$1, - some: some$1, - someLimit: someLimit$1, - someSeries: someSeries$1, - sortBy: sortBy$1, - timeout, - times, - timesLimit, - timesSeries, - transform, - tryEach: tryEach$1, - unmemoize, - until, - waterfall: waterfall$1, - whilst: whilst$1, - - // aliases - all: every$1, - allLimit: everyLimit$1, - allSeries: everySeries$1, - any: some$1, - anyLimit: someLimit$1, - anySeries: someSeries$1, - find: detect$1, - findLimit: detectLimit$1, - findSeries: detectSeries$1, - flatMap: concat$1, - flatMapLimit: concatLimit$1, - flatMapSeries: concatSeries$1, - forEach: each, - forEachSeries: eachSeries$1, - forEachLimit: eachLimit$2, - forEachOf: eachOf$1, - forEachOfSeries: eachOfSeries$1, - forEachOfLimit: eachOfLimit$2, - inject: reduce$1, - foldl: reduce$1, - foldr: reduceRight, - select: filter$1, - selectLimit: filterLimit$1, - selectSeries: filterSeries$1, - wrapSync: asyncify, - during: whilst$1, - doDuring: doWhilst$1 -}; - -export default index; -export { apply, applyEach$1 as applyEach, applyEachSeries, asyncify, auto, autoInject, cargo, cargo$1 as cargoQueue, compose, concat$1 as concat, concatLimit$1 as concatLimit, concatSeries$1 as concatSeries, constant, detect$1 as detect, detectLimit$1 as detectLimit, detectSeries$1 as detectSeries, dir, doUntil, doWhilst$1 as doWhilst, each, eachLimit$2 as eachLimit, eachOf$1 as eachOf, eachOfLimit$2 as eachOfLimit, eachOfSeries$1 as eachOfSeries, eachSeries$1 as eachSeries, ensureAsync, every$1 as every, everyLimit$1 as everyLimit, everySeries$1 as everySeries, filter$1 as filter, filterLimit$1 as filterLimit, filterSeries$1 as filterSeries, forever$1 as forever, groupBy, groupByLimit$1 as groupByLimit, groupBySeries, log, map$1 as map, mapLimit$1 as mapLimit, mapSeries$1 as mapSeries, mapValues, mapValuesLimit$1 as mapValuesLimit, mapValuesSeries, memoize, nextTick, parallel$1 as parallel, parallelLimit, priorityQueue, queue$1 as queue, race$1 as race, reduce$1 as reduce, reduceRight, reflect, reflectAll, reject$2 as reject, rejectLimit$1 as rejectLimit, rejectSeries$1 as rejectSeries, retry, retryable, seq, series, setImmediate$1 as setImmediate, some$1 as some, someLimit$1 as someLimit, someSeries$1 as someSeries, sortBy$1 as sortBy, timeout, times, timesLimit, timesSeries, transform, tryEach$1 as tryEach, unmemoize, until, waterfall$1 as waterfall, whilst$1 as whilst, every$1 as all, everyLimit$1 as allLimit, everySeries$1 as allSeries, some$1 as any, someLimit$1 as anyLimit, someSeries$1 as anySeries, detect$1 as find, detectLimit$1 as findLimit, detectSeries$1 as findSeries, concat$1 as flatMap, concatLimit$1 as flatMapLimit, concatSeries$1 as flatMapSeries, each as forEach, eachSeries$1 as forEachSeries, eachLimit$2 as forEachLimit, eachOf$1 as forEachOf, eachOfSeries$1 as forEachOfSeries, eachOfLimit$2 as forEachOfLimit, reduce$1 as inject, reduce$1 as foldl, reduceRight as foldr, filter$1 as select, filterLimit$1 as selectLimit, filterSeries$1 as selectSeries, asyncify as wrapSync, whilst$1 as during, doWhilst$1 as doDuring }; diff --git a/node_modules/async/doDuring.js b/node_modules/async/doDuring.js deleted file mode 100644 index 4c98e9e..0000000 --- a/node_modules/async/doDuring.js +++ /dev/null @@ -1,68 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _onlyOnce = require('./internal/onlyOnce.js'); - -var _onlyOnce2 = _interopRequireDefault(_onlyOnce); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The post-check version of [`whilst`]{@link module:ControlFlow.whilst}. To reflect the difference in - * the order of operations, the arguments `test` and `iteratee` are switched. - * - * `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript. - * - * @name doWhilst - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.whilst]{@link module:ControlFlow.whilst} - * @category Control Flow - * @param {AsyncFunction} iteratee - A function which is called each time `test` - * passes. Invoked with (callback). - * @param {AsyncFunction} test - asynchronous truth test to perform after each - * execution of `iteratee`. Invoked with (...args, callback), where `...args` are the - * non-error args from the previous callback of `iteratee`. - * @param {Function} [callback] - A callback which is called after the test - * function has failed and repeated execution of `iteratee` has stopped. - * `callback` will be passed an error and any arguments passed to the final - * `iteratee`'s callback. Invoked with (err, [results]); - * @returns {Promise} a promise, if no callback is passed - */ -function doWhilst(iteratee, test, callback) { - callback = (0, _onlyOnce2.default)(callback); - var _fn = (0, _wrapAsync2.default)(iteratee); - var _test = (0, _wrapAsync2.default)(test); - var results; - - function next(err, ...args) { - if (err) return callback(err); - if (err === false) return; - results = args; - _test(...args, check); - } - - function check(err, truth) { - if (err) return callback(err); - if (err === false) return; - if (!truth) return callback(null, ...results); - _fn(next); - } - - return check(null, true); -} - -exports.default = (0, _awaitify2.default)(doWhilst, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/doUntil.js b/node_modules/async/doUntil.js deleted file mode 100644 index 8aa0935..0000000 --- a/node_modules/async/doUntil.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = doUntil; - -var _doWhilst = require('./doWhilst.js'); - -var _doWhilst2 = _interopRequireDefault(_doWhilst); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Like ['doWhilst']{@link module:ControlFlow.doWhilst}, except the `test` is inverted. Note the - * argument ordering differs from `until`. - * - * @name doUntil - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.doWhilst]{@link module:ControlFlow.doWhilst} - * @category Control Flow - * @param {AsyncFunction} iteratee - An async function which is called each time - * `test` fails. Invoked with (callback). - * @param {AsyncFunction} test - asynchronous truth test to perform after each - * execution of `iteratee`. Invoked with (...args, callback), where `...args` are the - * non-error args from the previous callback of `iteratee` - * @param {Function} [callback] - A callback which is called after the test - * function has passed and repeated execution of `iteratee` has stopped. `callback` - * will be passed an error and any arguments passed to the final `iteratee`'s - * callback. Invoked with (err, [results]); - * @returns {Promise} a promise, if no callback is passed - */ -function doUntil(iteratee, test, callback) { - const _test = (0, _wrapAsync2.default)(test); - return (0, _doWhilst2.default)(iteratee, (...args) => { - const cb = args.pop(); - _test(...args, (err, truth) => cb(err, !truth)); - }, callback); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/doWhilst.js b/node_modules/async/doWhilst.js deleted file mode 100644 index 4c98e9e..0000000 --- a/node_modules/async/doWhilst.js +++ /dev/null @@ -1,68 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _onlyOnce = require('./internal/onlyOnce.js'); - -var _onlyOnce2 = _interopRequireDefault(_onlyOnce); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The post-check version of [`whilst`]{@link module:ControlFlow.whilst}. To reflect the difference in - * the order of operations, the arguments `test` and `iteratee` are switched. - * - * `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript. - * - * @name doWhilst - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.whilst]{@link module:ControlFlow.whilst} - * @category Control Flow - * @param {AsyncFunction} iteratee - A function which is called each time `test` - * passes. Invoked with (callback). - * @param {AsyncFunction} test - asynchronous truth test to perform after each - * execution of `iteratee`. Invoked with (...args, callback), where `...args` are the - * non-error args from the previous callback of `iteratee`. - * @param {Function} [callback] - A callback which is called after the test - * function has failed and repeated execution of `iteratee` has stopped. - * `callback` will be passed an error and any arguments passed to the final - * `iteratee`'s callback. Invoked with (err, [results]); - * @returns {Promise} a promise, if no callback is passed - */ -function doWhilst(iteratee, test, callback) { - callback = (0, _onlyOnce2.default)(callback); - var _fn = (0, _wrapAsync2.default)(iteratee); - var _test = (0, _wrapAsync2.default)(test); - var results; - - function next(err, ...args) { - if (err) return callback(err); - if (err === false) return; - results = args; - _test(...args, check); - } - - function check(err, truth) { - if (err) return callback(err); - if (err === false) return; - if (!truth) return callback(null, ...results); - _fn(next); - } - - return check(null, true); -} - -exports.default = (0, _awaitify2.default)(doWhilst, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/during.js b/node_modules/async/during.js deleted file mode 100644 index 32a4776..0000000 --- a/node_modules/async/during.js +++ /dev/null @@ -1,78 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _onlyOnce = require('./internal/onlyOnce.js'); - -var _onlyOnce2 = _interopRequireDefault(_onlyOnce); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Repeatedly call `iteratee`, while `test` returns `true`. Calls `callback` when - * stopped, or an error occurs. - * - * @name whilst - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {AsyncFunction} test - asynchronous truth test to perform before each - * execution of `iteratee`. Invoked with (). - * @param {AsyncFunction} iteratee - An async function which is called each time - * `test` passes. Invoked with (callback). - * @param {Function} [callback] - A callback which is called after the test - * function has failed and repeated execution of `iteratee` has stopped. `callback` - * will be passed an error and any arguments passed to the final `iteratee`'s - * callback. Invoked with (err, [results]); - * @returns {Promise} a promise, if no callback is passed - * @example - * - * var count = 0; - * async.whilst( - * function test(cb) { cb(null, count < 5); }, - * function iter(callback) { - * count++; - * setTimeout(function() { - * callback(null, count); - * }, 1000); - * }, - * function (err, n) { - * // 5 seconds have passed, n = 5 - * } - * ); - */ -function whilst(test, iteratee, callback) { - callback = (0, _onlyOnce2.default)(callback); - var _fn = (0, _wrapAsync2.default)(iteratee); - var _test = (0, _wrapAsync2.default)(test); - var results = []; - - function next(err, ...rest) { - if (err) return callback(err); - results = rest; - if (err === false) return; - _test(check); - } - - function check(err, truth) { - if (err) return callback(err); - if (err === false) return; - if (!truth) return callback(null, ...results); - _fn(next); - } - - return _test(check); -} -exports.default = (0, _awaitify2.default)(whilst, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/each.js b/node_modules/async/each.js deleted file mode 100644 index 405d495..0000000 --- a/node_modules/async/each.js +++ /dev/null @@ -1,129 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _eachOf = require('./eachOf.js'); - -var _eachOf2 = _interopRequireDefault(_eachOf); - -var _withoutIndex = require('./internal/withoutIndex.js'); - -var _withoutIndex2 = _interopRequireDefault(_withoutIndex); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Applies the function `iteratee` to each item in `coll`, in parallel. - * The `iteratee` is called with an item from the list, and a callback for when - * it has finished. If the `iteratee` passes an error to its `callback`, the - * main `callback` (for the `each` function) is immediately called with the - * error. - * - * Note, that since this function applies `iteratee` to each item in parallel, - * there is no guarantee that the iteratee functions will complete in order. - * - * @name each - * @static - * @memberOf module:Collections - * @method - * @alias forEach - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to - * each item in `coll`. Invoked with (item, callback). - * The array index is not passed to the iteratee. - * If you need the index, use `eachOf`. - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * // dir4 does not exist - * - * const fileList = [ 'dir1/file2.txt', 'dir2/file3.txt', 'dir/file5.txt']; - * const withMissingFileList = ['dir1/file1.txt', 'dir4/file2.txt']; - * - * // asynchronous function that deletes a file - * const deleteFile = function(file, callback) { - * fs.unlink(file, callback); - * }; - * - * // Using callbacks - * async.each(fileList, deleteFile, function(err) { - * if( err ) { - * console.log(err); - * } else { - * console.log('All files have been deleted successfully'); - * } - * }); - * - * // Error Handling - * async.each(withMissingFileList, deleteFile, function(err){ - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4/file2.txt does not exist - * // dir1/file1.txt could have been deleted - * }); - * - * // Using Promises - * async.each(fileList, deleteFile) - * .then( () => { - * console.log('All files have been deleted successfully'); - * }).catch( err => { - * console.log(err); - * }); - * - * // Error Handling - * async.each(fileList, deleteFile) - * .then( () => { - * console.log('All files have been deleted successfully'); - * }).catch( err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4/file2.txt does not exist - * // dir1/file1.txt could have been deleted - * }); - * - * // Using async/await - * async () => { - * try { - * await async.each(files, deleteFile); - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // Error Handling - * async () => { - * try { - * await async.each(withMissingFileList, deleteFile); - * } - * catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4/file2.txt does not exist - * // dir1/file1.txt could have been deleted - * } - * } - * - */ -function eachLimit(coll, iteratee, callback) { - return (0, _eachOf2.default)(coll, (0, _withoutIndex2.default)((0, _wrapAsync2.default)(iteratee)), callback); -} - -exports.default = (0, _awaitify2.default)(eachLimit, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/eachLimit.js b/node_modules/async/eachLimit.js deleted file mode 100644 index 5f3d009..0000000 --- a/node_modules/async/eachLimit.js +++ /dev/null @@ -1,50 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _eachOfLimit = require('./internal/eachOfLimit.js'); - -var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); - -var _withoutIndex = require('./internal/withoutIndex.js'); - -var _withoutIndex2 = _interopRequireDefault(_withoutIndex); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`each`]{@link module:Collections.each} but runs a maximum of `limit` async operations at a time. - * - * @name eachLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.each]{@link module:Collections.each} - * @alias forEachLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The array index is not passed to the iteratee. - * If you need the index, use `eachOfLimit`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - */ -function eachLimit(coll, limit, iteratee, callback) { - return (0, _eachOfLimit2.default)(limit)(coll, (0, _withoutIndex2.default)((0, _wrapAsync2.default)(iteratee)), callback); -} -exports.default = (0, _awaitify2.default)(eachLimit, 4); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/eachOf.js b/node_modules/async/eachOf.js deleted file mode 100644 index c22614f..0000000 --- a/node_modules/async/eachOf.js +++ /dev/null @@ -1,185 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _isArrayLike = require('./internal/isArrayLike.js'); - -var _isArrayLike2 = _interopRequireDefault(_isArrayLike); - -var _breakLoop = require('./internal/breakLoop.js'); - -var _breakLoop2 = _interopRequireDefault(_breakLoop); - -var _eachOfLimit = require('./eachOfLimit.js'); - -var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); - -var _once = require('./internal/once.js'); - -var _once2 = _interopRequireDefault(_once); - -var _onlyOnce = require('./internal/onlyOnce.js'); - -var _onlyOnce2 = _interopRequireDefault(_onlyOnce); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// eachOf implementation optimized for array-likes -function eachOfArrayLike(coll, iteratee, callback) { - callback = (0, _once2.default)(callback); - var index = 0, - completed = 0, - { length } = coll, - canceled = false; - if (length === 0) { - callback(null); - } - - function iteratorCallback(err, value) { - if (err === false) { - canceled = true; - } - if (canceled === true) return; - if (err) { - callback(err); - } else if (++completed === length || value === _breakLoop2.default) { - callback(null); - } - } - - for (; index < length; index++) { - iteratee(coll[index], index, (0, _onlyOnce2.default)(iteratorCallback)); - } -} - -// a generic version of eachOf which can handle array, object, and iterator cases. -function eachOfGeneric(coll, iteratee, callback) { - return (0, _eachOfLimit2.default)(coll, Infinity, iteratee, callback); -} - -/** - * Like [`each`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument - * to the iteratee. - * - * @name eachOf - * @static - * @memberOf module:Collections - * @method - * @alias forEachOf - * @category Collection - * @see [async.each]{@link module:Collections.each} - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each - * item in `coll`. - * The `key` is the item's key, or index in the case of an array. - * Invoked with (item, key, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - * @example - * - * // dev.json is a file containing a valid json object config for dev environment - * // dev.json is a file containing a valid json object config for test environment - * // prod.json is a file containing a valid json object config for prod environment - * // invalid.json is a file with a malformed json object - * - * let configs = {}; //global variable - * let validConfigFileMap = {dev: 'dev.json', test: 'test.json', prod: 'prod.json'}; - * let invalidConfigFileMap = {dev: 'dev.json', test: 'test.json', invalid: 'invalid.json'}; - * - * // asynchronous function that reads a json file and parses the contents as json object - * function parseFile(file, key, callback) { - * fs.readFile(file, "utf8", function(err, data) { - * if (err) return calback(err); - * try { - * configs[key] = JSON.parse(data); - * } catch (e) { - * return callback(e); - * } - * callback(); - * }); - * } - * - * // Using callbacks - * async.forEachOf(validConfigFileMap, parseFile, function (err) { - * if (err) { - * console.error(err); - * } else { - * console.log(configs); - * // configs is now a map of JSON data, e.g. - * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} - * } - * }); - * - * //Error handing - * async.forEachOf(invalidConfigFileMap, parseFile, function (err) { - * if (err) { - * console.error(err); - * // JSON parse error exception - * } else { - * console.log(configs); - * } - * }); - * - * // Using Promises - * async.forEachOf(validConfigFileMap, parseFile) - * .then( () => { - * console.log(configs); - * // configs is now a map of JSON data, e.g. - * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} - * }).catch( err => { - * console.error(err); - * }); - * - * //Error handing - * async.forEachOf(invalidConfigFileMap, parseFile) - * .then( () => { - * console.log(configs); - * }).catch( err => { - * console.error(err); - * // JSON parse error exception - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.forEachOf(validConfigFileMap, parseFile); - * console.log(configs); - * // configs is now a map of JSON data, e.g. - * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} - * } - * catch (err) { - * console.log(err); - * } - * } - * - * //Error handing - * async () => { - * try { - * let result = await async.forEachOf(invalidConfigFileMap, parseFile); - * console.log(configs); - * } - * catch (err) { - * console.log(err); - * // JSON parse error exception - * } - * } - * - */ -function eachOf(coll, iteratee, callback) { - var eachOfImplementation = (0, _isArrayLike2.default)(coll) ? eachOfArrayLike : eachOfGeneric; - return eachOfImplementation(coll, (0, _wrapAsync2.default)(iteratee), callback); -} - -exports.default = (0, _awaitify2.default)(eachOf, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/eachOfLimit.js b/node_modules/async/eachOfLimit.js deleted file mode 100644 index e9fc4db..0000000 --- a/node_modules/async/eachOfLimit.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _eachOfLimit2 = require('./internal/eachOfLimit.js'); - -var _eachOfLimit3 = _interopRequireDefault(_eachOfLimit2); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a - * time. - * - * @name eachOfLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.eachOf]{@link module:Collections.eachOf} - * @alias forEachOfLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each - * item in `coll`. The `key` is the item's key, or index in the case of an - * array. - * Invoked with (item, key, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - */ -function eachOfLimit(coll, limit, iteratee, callback) { - return (0, _eachOfLimit3.default)(limit)(coll, (0, _wrapAsync2.default)(iteratee), callback); -} - -exports.default = (0, _awaitify2.default)(eachOfLimit, 4); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/eachOfSeries.js b/node_modules/async/eachOfSeries.js deleted file mode 100644 index cfb0f33..0000000 --- a/node_modules/async/eachOfSeries.js +++ /dev/null @@ -1,39 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _eachOfLimit = require('./eachOfLimit.js'); - -var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`eachOf`]{@link module:Collections.eachOf} but runs only a single async operation at a time. - * - * @name eachOfSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.eachOf]{@link module:Collections.eachOf} - * @alias forEachOfSeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * Invoked with (item, key, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - */ -function eachOfSeries(coll, iteratee, callback) { - return (0, _eachOfLimit2.default)(coll, 1, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(eachOfSeries, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/eachSeries.js b/node_modules/async/eachSeries.js deleted file mode 100644 index d674d0c..0000000 --- a/node_modules/async/eachSeries.js +++ /dev/null @@ -1,44 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _eachLimit = require('./eachLimit.js'); - -var _eachLimit2 = _interopRequireDefault(_eachLimit); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time. - * - * Note, that unlike [`each`]{@link module:Collections.each}, this function applies iteratee to each item - * in series and therefore the iteratee functions will complete in order. - - * @name eachSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.each]{@link module:Collections.each} - * @alias forEachSeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each - * item in `coll`. - * The array index is not passed to the iteratee. - * If you need the index, use `eachOfSeries`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - */ -function eachSeries(coll, iteratee, callback) { - return (0, _eachLimit2.default)(coll, 1, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(eachSeries, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/ensureAsync.js b/node_modules/async/ensureAsync.js deleted file mode 100644 index ad8beb5..0000000 --- a/node_modules/async/ensureAsync.js +++ /dev/null @@ -1,67 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = ensureAsync; - -var _setImmediate = require('./internal/setImmediate.js'); - -var _setImmediate2 = _interopRequireDefault(_setImmediate); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Wrap an async function and ensure it calls its callback on a later tick of - * the event loop. If the function already calls its callback on a next tick, - * no extra deferral is added. This is useful for preventing stack overflows - * (`RangeError: Maximum call stack size exceeded`) and generally keeping - * [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony) - * contained. ES2017 `async` functions are returned as-is -- they are immune - * to Zalgo's corrupting influences, as they always resolve on a later tick. - * - * @name ensureAsync - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} fn - an async function, one that expects a node-style - * callback as its last argument. - * @returns {AsyncFunction} Returns a wrapped function with the exact same call - * signature as the function passed in. - * @example - * - * function sometimesAsync(arg, callback) { - * if (cache[arg]) { - * return callback(null, cache[arg]); // this would be synchronous!! - * } else { - * doSomeIO(arg, callback); // this IO would be asynchronous - * } - * } - * - * // this has a risk of stack overflows if many results are cached in a row - * async.mapSeries(args, sometimesAsync, done); - * - * // this will defer sometimesAsync's callback if necessary, - * // preventing stack overflows - * async.mapSeries(args, async.ensureAsync(sometimesAsync), done); - */ -function ensureAsync(fn) { - if ((0, _wrapAsync.isAsync)(fn)) return fn; - return function (...args /*, callback*/) { - var callback = args.pop(); - var sync = true; - args.push((...innerArgs) => { - if (sync) { - (0, _setImmediate2.default)(() => callback(...innerArgs)); - } else { - callback(...innerArgs); - } - }); - fn.apply(this, args); - sync = false; - }; -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/every.js b/node_modules/async/every.js deleted file mode 100644 index 148db68..0000000 --- a/node_modules/async/every.js +++ /dev/null @@ -1,119 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createTester = require('./internal/createTester.js'); - -var _createTester2 = _interopRequireDefault(_createTester); - -var _eachOf = require('./eachOf.js'); - -var _eachOf2 = _interopRequireDefault(_eachOf); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Returns `true` if every element in `coll` satisfies an async test. If any - * iteratee call returns `false`, the main `callback` is immediately called. - * - * @name every - * @static - * @memberOf module:Collections - * @method - * @alias all - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collection in parallel. - * The iteratee must complete with a boolean result value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result will be either `true` or `false` - * depending on the values of the async tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * // dir4 does not exist - * - * const fileList = ['dir1/file1.txt','dir2/file3.txt','dir3/file5.txt']; - * const withMissingFileList = ['file1.txt','file2.txt','file4.txt']; - * - * // asynchronous function that checks if a file exists - * function fileExists(file, callback) { - * fs.access(file, fs.constants.F_OK, (err) => { - * callback(null, !err); - * }); - * } - * - * // Using callbacks - * async.every(fileList, fileExists, function(err, result) { - * console.log(result); - * // true - * // result is true since every file exists - * }); - * - * async.every(withMissingFileList, fileExists, function(err, result) { - * console.log(result); - * // false - * // result is false since NOT every file exists - * }); - * - * // Using Promises - * async.every(fileList, fileExists) - * .then( result => { - * console.log(result); - * // true - * // result is true since every file exists - * }).catch( err => { - * console.log(err); - * }); - * - * async.every(withMissingFileList, fileExists) - * .then( result => { - * console.log(result); - * // false - * // result is false since NOT every file exists - * }).catch( err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.every(fileList, fileExists); - * console.log(result); - * // true - * // result is true since every file exists - * } - * catch (err) { - * console.log(err); - * } - * } - * - * async () => { - * try { - * let result = await async.every(withMissingFileList, fileExists); - * console.log(result); - * // false - * // result is false since NOT every file exists - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function every(coll, iteratee, callback) { - return (0, _createTester2.default)(bool => !bool, res => !res)(_eachOf2.default, coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(every, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/everyLimit.js b/node_modules/async/everyLimit.js deleted file mode 100644 index 25b2c08..0000000 --- a/node_modules/async/everyLimit.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createTester = require('./internal/createTester.js'); - -var _createTester2 = _interopRequireDefault(_createTester); - -var _eachOfLimit = require('./internal/eachOfLimit.js'); - -var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time. - * - * @name everyLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.every]{@link module:Collections.every} - * @alias allLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collection in parallel. - * The iteratee must complete with a boolean result value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result will be either `true` or `false` - * depending on the values of the async tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - */ -function everyLimit(coll, limit, iteratee, callback) { - return (0, _createTester2.default)(bool => !bool, res => !res)((0, _eachOfLimit2.default)(limit), coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(everyLimit, 4); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/everySeries.js b/node_modules/async/everySeries.js deleted file mode 100644 index 147c3dc..0000000 --- a/node_modules/async/everySeries.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createTester = require('./internal/createTester.js'); - -var _createTester2 = _interopRequireDefault(_createTester); - -var _eachOfSeries = require('./eachOfSeries.js'); - -var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`every`]{@link module:Collections.every} but runs only a single async operation at a time. - * - * @name everySeries - * @static - * @memberOf module:Collections - * @method - * @see [async.every]{@link module:Collections.every} - * @alias allSeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collection in series. - * The iteratee must complete with a boolean result value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result will be either `true` or `false` - * depending on the values of the async tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - */ -function everySeries(coll, iteratee, callback) { - return (0, _createTester2.default)(bool => !bool, res => !res)(_eachOfSeries2.default, coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(everySeries, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/filter.js b/node_modules/async/filter.js deleted file mode 100644 index 303dc1f..0000000 --- a/node_modules/async/filter.js +++ /dev/null @@ -1,93 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _filter2 = require('./internal/filter.js'); - -var _filter3 = _interopRequireDefault(_filter2); - -var _eachOf = require('./eachOf.js'); - -var _eachOf2 = _interopRequireDefault(_eachOf); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Returns a new array of all the values in `coll` which pass an async truth - * test. This operation is performed in parallel, but the results array will be - * in the same order as the original. - * - * @name filter - * @static - * @memberOf module:Collections - * @method - * @alias select - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {Function} iteratee - A truth test to apply to each item in `coll`. - * The `iteratee` is passed a `callback(err, truthValue)`, which must be called - * with a boolean argument once it has completed. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @returns {Promise} a promise, if no callback provided - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * - * const files = ['dir1/file1.txt','dir2/file3.txt','dir3/file6.txt']; - * - * // asynchronous function that checks if a file exists - * function fileExists(file, callback) { - * fs.access(file, fs.constants.F_OK, (err) => { - * callback(null, !err); - * }); - * } - * - * // Using callbacks - * async.filter(files, fileExists, function(err, results) { - * if(err) { - * console.log(err); - * } else { - * console.log(results); - * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] - * // results is now an array of the existing files - * } - * }); - * - * // Using Promises - * async.filter(files, fileExists) - * .then(results => { - * console.log(results); - * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] - * // results is now an array of the existing files - * }).catch(err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let results = await async.filter(files, fileExists); - * console.log(results); - * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] - * // results is now an array of the existing files - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function filter(coll, iteratee, callback) { - return (0, _filter3.default)(_eachOf2.default, coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(filter, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/filterLimit.js b/node_modules/async/filterLimit.js deleted file mode 100644 index 89e55f5..0000000 --- a/node_modules/async/filterLimit.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _filter2 = require('./internal/filter.js'); - -var _filter3 = _interopRequireDefault(_filter2); - -var _eachOfLimit = require('./internal/eachOfLimit.js'); - -var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`filter`]{@link module:Collections.filter} but runs a maximum of `limit` async operations at a - * time. - * - * @name filterLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.filter]{@link module:Collections.filter} - * @alias selectLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {Function} iteratee - A truth test to apply to each item in `coll`. - * The `iteratee` is passed a `callback(err, truthValue)`, which must be called - * with a boolean argument once it has completed. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @returns {Promise} a promise, if no callback provided - */ -function filterLimit(coll, limit, iteratee, callback) { - return (0, _filter3.default)((0, _eachOfLimit2.default)(limit), coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(filterLimit, 4); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/filterSeries.js b/node_modules/async/filterSeries.js deleted file mode 100644 index a045e52..0000000 --- a/node_modules/async/filterSeries.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _filter2 = require('./internal/filter.js'); - -var _filter3 = _interopRequireDefault(_filter2); - -var _eachOfSeries = require('./eachOfSeries.js'); - -var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`filter`]{@link module:Collections.filter} but runs only a single async operation at a time. - * - * @name filterSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.filter]{@link module:Collections.filter} - * @alias selectSeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {Function} iteratee - A truth test to apply to each item in `coll`. - * The `iteratee` is passed a `callback(err, truthValue)`, which must be called - * with a boolean argument once it has completed. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results) - * @returns {Promise} a promise, if no callback provided - */ -function filterSeries(coll, iteratee, callback) { - return (0, _filter3.default)(_eachOfSeries2.default, coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(filterSeries, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/find.js b/node_modules/async/find.js deleted file mode 100644 index 05b2e5c..0000000 --- a/node_modules/async/find.js +++ /dev/null @@ -1,96 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createTester = require('./internal/createTester.js'); - -var _createTester2 = _interopRequireDefault(_createTester); - -var _eachOf = require('./eachOf.js'); - -var _eachOf2 = _interopRequireDefault(_eachOf); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Returns the first value in `coll` that passes an async truth test. The - * `iteratee` is applied in parallel, meaning the first iteratee to return - * `true` will fire the detect `callback` with that result. That means the - * result might not be the first item in the original `coll` (in terms of order) - * that passes the test. - - * If order within the original `coll` is important, then look at - * [`detectSeries`]{@link module:Collections.detectSeries}. - * - * @name detect - * @static - * @memberOf module:Collections - * @method - * @alias find - * @category Collections - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. - * The iteratee must complete with a boolean value as its result. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the `iteratee` functions have finished. - * Result will be the first item in the array that passes the truth test - * (iteratee) or the value `undefined` if none passed. Invoked with - * (err, result). - * @returns {Promise} a promise, if a callback is omitted - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * - * // asynchronous function that checks if a file exists - * function fileExists(file, callback) { - * fs.access(file, fs.constants.F_OK, (err) => { - * callback(null, !err); - * }); - * } - * - * async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists, - * function(err, result) { - * console.log(result); - * // dir1/file1.txt - * // result now equals the first file in the list that exists - * } - *); - * - * // Using Promises - * async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists) - * .then(result => { - * console.log(result); - * // dir1/file1.txt - * // result now equals the first file in the list that exists - * }).catch(err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists); - * console.log(result); - * // dir1/file1.txt - * // result now equals the file in the list that exists - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function detect(coll, iteratee, callback) { - return (0, _createTester2.default)(bool => bool, (res, item) => item)(_eachOf2.default, coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(detect, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/findLimit.js b/node_modules/async/findLimit.js deleted file mode 100644 index db6961e..0000000 --- a/node_modules/async/findLimit.js +++ /dev/null @@ -1,48 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createTester = require('./internal/createTester.js'); - -var _createTester2 = _interopRequireDefault(_createTester); - -var _eachOfLimit = require('./internal/eachOfLimit.js'); - -var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`detect`]{@link module:Collections.detect} but runs a maximum of `limit` async operations at a - * time. - * - * @name detectLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.detect]{@link module:Collections.detect} - * @alias findLimit - * @category Collections - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. - * The iteratee must complete with a boolean value as its result. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the `iteratee` functions have finished. - * Result will be the first item in the array that passes the truth test - * (iteratee) or the value `undefined` if none passed. Invoked with - * (err, result). - * @returns {Promise} a promise, if a callback is omitted - */ -function detectLimit(coll, limit, iteratee, callback) { - return (0, _createTester2.default)(bool => bool, (res, item) => item)((0, _eachOfLimit2.default)(limit), coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(detectLimit, 4); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/findSeries.js b/node_modules/async/findSeries.js deleted file mode 100644 index b9131b4..0000000 --- a/node_modules/async/findSeries.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createTester = require('./internal/createTester.js'); - -var _createTester2 = _interopRequireDefault(_createTester); - -var _eachOfLimit = require('./internal/eachOfLimit.js'); - -var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`detect`]{@link module:Collections.detect} but runs only a single async operation at a time. - * - * @name detectSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.detect]{@link module:Collections.detect} - * @alias findSeries - * @category Collections - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. - * The iteratee must complete with a boolean value as its result. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the `iteratee` functions have finished. - * Result will be the first item in the array that passes the truth test - * (iteratee) or the value `undefined` if none passed. Invoked with - * (err, result). - * @returns {Promise} a promise, if a callback is omitted - */ -function detectSeries(coll, iteratee, callback) { - return (0, _createTester2.default)(bool => bool, (res, item) => item)((0, _eachOfLimit2.default)(1), coll, iteratee, callback); -} - -exports.default = (0, _awaitify2.default)(detectSeries, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/flatMap.js b/node_modules/async/flatMap.js deleted file mode 100644 index 8eed1ac..0000000 --- a/node_modules/async/flatMap.js +++ /dev/null @@ -1,115 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _concatLimit = require('./concatLimit.js'); - -var _concatLimit2 = _interopRequireDefault(_concatLimit); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Applies `iteratee` to each item in `coll`, concatenating the results. Returns - * the concatenated list. The `iteratee`s are called in parallel, and the - * results are concatenated as they return. The results array will be returned in - * the original order of `coll` passed to the `iteratee` function. - * - * @name concat - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @alias flatMap - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`, - * which should use an array as its result. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished, or an error occurs. Results is an array - * containing the concatenated results of the `iteratee` function. Invoked with - * (err, results). - * @returns A Promise, if no callback is passed - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * // dir4 does not exist - * - * let directoryList = ['dir1','dir2','dir3']; - * let withMissingDirectoryList = ['dir1','dir2','dir3', 'dir4']; - * - * // Using callbacks - * async.concat(directoryList, fs.readdir, function(err, results) { - * if (err) { - * console.log(err); - * } else { - * console.log(results); - * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] - * } - * }); - * - * // Error Handling - * async.concat(withMissingDirectoryList, fs.readdir, function(err, results) { - * if (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4 does not exist - * } else { - * console.log(results); - * } - * }); - * - * // Using Promises - * async.concat(directoryList, fs.readdir) - * .then(results => { - * console.log(results); - * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] - * }).catch(err => { - * console.log(err); - * }); - * - * // Error Handling - * async.concat(withMissingDirectoryList, fs.readdir) - * .then(results => { - * console.log(results); - * }).catch(err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4 does not exist - * }); - * - * // Using async/await - * async () => { - * try { - * let results = await async.concat(directoryList, fs.readdir); - * console.log(results); - * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] - * } catch (err) { - * console.log(err); - * } - * } - * - * // Error Handling - * async () => { - * try { - * let results = await async.concat(withMissingDirectoryList, fs.readdir); - * console.log(results); - * } catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4 does not exist - * } - * } - * - */ -function concat(coll, iteratee, callback) { - return (0, _concatLimit2.default)(coll, Infinity, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(concat, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/flatMapLimit.js b/node_modules/async/flatMapLimit.js deleted file mode 100644 index 3d170f1..0000000 --- a/node_modules/async/flatMapLimit.js +++ /dev/null @@ -1,60 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _mapLimit = require('./mapLimit.js'); - -var _mapLimit2 = _interopRequireDefault(_mapLimit); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`concat`]{@link module:Collections.concat} but runs a maximum of `limit` async operations at a time. - * - * @name concatLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.concat]{@link module:Collections.concat} - * @category Collection - * @alias flatMapLimit - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`, - * which should use an array as its result. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished, or an error occurs. Results is an array - * containing the concatenated results of the `iteratee` function. Invoked with - * (err, results). - * @returns A Promise, if no callback is passed - */ -function concatLimit(coll, limit, iteratee, callback) { - var _iteratee = (0, _wrapAsync2.default)(iteratee); - return (0, _mapLimit2.default)(coll, limit, (val, iterCb) => { - _iteratee(val, (err, ...args) => { - if (err) return iterCb(err); - return iterCb(err, args); - }); - }, (err, mapResults) => { - var result = []; - for (var i = 0; i < mapResults.length; i++) { - if (mapResults[i]) { - result = result.concat(...mapResults[i]); - } - } - - return callback(err, result); - }); -} -exports.default = (0, _awaitify2.default)(concatLimit, 4); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/flatMapSeries.js b/node_modules/async/flatMapSeries.js deleted file mode 100644 index 84add3b..0000000 --- a/node_modules/async/flatMapSeries.js +++ /dev/null @@ -1,41 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _concatLimit = require('./concatLimit.js'); - -var _concatLimit2 = _interopRequireDefault(_concatLimit); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`concat`]{@link module:Collections.concat} but runs only a single async operation at a time. - * - * @name concatSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.concat]{@link module:Collections.concat} - * @category Collection - * @alias flatMapSeries - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`. - * The iteratee should complete with an array an array of results. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished, or an error occurs. Results is an array - * containing the concatenated results of the `iteratee` function. Invoked with - * (err, results). - * @returns A Promise, if no callback is passed - */ -function concatSeries(coll, iteratee, callback) { - return (0, _concatLimit2.default)(coll, 1, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(concatSeries, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/foldl.js b/node_modules/async/foldl.js deleted file mode 100644 index 56e2db8..0000000 --- a/node_modules/async/foldl.js +++ /dev/null @@ -1,153 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _eachOfSeries = require('./eachOfSeries.js'); - -var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); - -var _once = require('./internal/once.js'); - -var _once2 = _interopRequireDefault(_once); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Reduces `coll` into a single value using an async `iteratee` to return each - * successive step. `memo` is the initial state of the reduction. This function - * only operates in series. - * - * For performance reasons, it may make sense to split a call to this function - * into a parallel map, and then use the normal `Array.prototype.reduce` on the - * results. This function is for situations where each step in the reduction - * needs to be async; if you can get the data before reducing it, then it's - * probably a good idea to do so. - * - * @name reduce - * @static - * @memberOf module:Collections - * @method - * @alias inject - * @alias foldl - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {*} memo - The initial state of the reduction. - * @param {AsyncFunction} iteratee - A function applied to each item in the - * array to produce the next step in the reduction. - * The `iteratee` should complete with the next state of the reduction. - * If the iteratee completes with an error, the reduction is stopped and the - * main `callback` is immediately called with the error. - * Invoked with (memo, item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result is the reduced value. Invoked with - * (err, result). - * @returns {Promise} a promise, if no callback is passed - * @example - * - * // file1.txt is a file that is 1000 bytes in size - * // file2.txt is a file that is 2000 bytes in size - * // file3.txt is a file that is 3000 bytes in size - * // file4.txt does not exist - * - * const fileList = ['file1.txt','file2.txt','file3.txt']; - * const withMissingFileList = ['file1.txt','file2.txt','file3.txt', 'file4.txt']; - * - * // asynchronous function that computes the file size in bytes - * // file size is added to the memoized value, then returned - * function getFileSizeInBytes(memo, file, callback) { - * fs.stat(file, function(err, stat) { - * if (err) { - * return callback(err); - * } - * callback(null, memo + stat.size); - * }); - * } - * - * // Using callbacks - * async.reduce(fileList, 0, getFileSizeInBytes, function(err, result) { - * if (err) { - * console.log(err); - * } else { - * console.log(result); - * // 6000 - * // which is the sum of the file sizes of the three files - * } - * }); - * - * // Error Handling - * async.reduce(withMissingFileList, 0, getFileSizeInBytes, function(err, result) { - * if (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } else { - * console.log(result); - * } - * }); - * - * // Using Promises - * async.reduce(fileList, 0, getFileSizeInBytes) - * .then( result => { - * console.log(result); - * // 6000 - * // which is the sum of the file sizes of the three files - * }).catch( err => { - * console.log(err); - * }); - * - * // Error Handling - * async.reduce(withMissingFileList, 0, getFileSizeInBytes) - * .then( result => { - * console.log(result); - * }).catch( err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.reduce(fileList, 0, getFileSizeInBytes); - * console.log(result); - * // 6000 - * // which is the sum of the file sizes of the three files - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // Error Handling - * async () => { - * try { - * let result = await async.reduce(withMissingFileList, 0, getFileSizeInBytes); - * console.log(result); - * } - * catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } - * } - * - */ -function reduce(coll, memo, iteratee, callback) { - callback = (0, _once2.default)(callback); - var _iteratee = (0, _wrapAsync2.default)(iteratee); - return (0, _eachOfSeries2.default)(coll, (x, i, iterCb) => { - _iteratee(memo, x, (err, v) => { - memo = v; - iterCb(err); - }); - }, err => callback(err, memo)); -} -exports.default = (0, _awaitify2.default)(reduce, 4); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/foldr.js b/node_modules/async/foldr.js deleted file mode 100644 index bee5391..0000000 --- a/node_modules/async/foldr.js +++ /dev/null @@ -1,41 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = reduceRight; - -var _reduce = require('./reduce.js'); - -var _reduce2 = _interopRequireDefault(_reduce); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Same as [`reduce`]{@link module:Collections.reduce}, only operates on `array` in reverse order. - * - * @name reduceRight - * @static - * @memberOf module:Collections - * @method - * @see [async.reduce]{@link module:Collections.reduce} - * @alias foldr - * @category Collection - * @param {Array} array - A collection to iterate over. - * @param {*} memo - The initial state of the reduction. - * @param {AsyncFunction} iteratee - A function applied to each item in the - * array to produce the next step in the reduction. - * The `iteratee` should complete with the next state of the reduction. - * If the iteratee completes with an error, the reduction is stopped and the - * main `callback` is immediately called with the error. - * Invoked with (memo, item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result is the reduced value. Invoked with - * (err, result). - * @returns {Promise} a promise, if no callback is passed - */ -function reduceRight(array, memo, iteratee, callback) { - var reversed = [...array].reverse(); - return (0, _reduce2.default)(reversed, memo, iteratee, callback); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/forEach.js b/node_modules/async/forEach.js deleted file mode 100644 index 405d495..0000000 --- a/node_modules/async/forEach.js +++ /dev/null @@ -1,129 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _eachOf = require('./eachOf.js'); - -var _eachOf2 = _interopRequireDefault(_eachOf); - -var _withoutIndex = require('./internal/withoutIndex.js'); - -var _withoutIndex2 = _interopRequireDefault(_withoutIndex); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Applies the function `iteratee` to each item in `coll`, in parallel. - * The `iteratee` is called with an item from the list, and a callback for when - * it has finished. If the `iteratee` passes an error to its `callback`, the - * main `callback` (for the `each` function) is immediately called with the - * error. - * - * Note, that since this function applies `iteratee` to each item in parallel, - * there is no guarantee that the iteratee functions will complete in order. - * - * @name each - * @static - * @memberOf module:Collections - * @method - * @alias forEach - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to - * each item in `coll`. Invoked with (item, callback). - * The array index is not passed to the iteratee. - * If you need the index, use `eachOf`. - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * // dir4 does not exist - * - * const fileList = [ 'dir1/file2.txt', 'dir2/file3.txt', 'dir/file5.txt']; - * const withMissingFileList = ['dir1/file1.txt', 'dir4/file2.txt']; - * - * // asynchronous function that deletes a file - * const deleteFile = function(file, callback) { - * fs.unlink(file, callback); - * }; - * - * // Using callbacks - * async.each(fileList, deleteFile, function(err) { - * if( err ) { - * console.log(err); - * } else { - * console.log('All files have been deleted successfully'); - * } - * }); - * - * // Error Handling - * async.each(withMissingFileList, deleteFile, function(err){ - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4/file2.txt does not exist - * // dir1/file1.txt could have been deleted - * }); - * - * // Using Promises - * async.each(fileList, deleteFile) - * .then( () => { - * console.log('All files have been deleted successfully'); - * }).catch( err => { - * console.log(err); - * }); - * - * // Error Handling - * async.each(fileList, deleteFile) - * .then( () => { - * console.log('All files have been deleted successfully'); - * }).catch( err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4/file2.txt does not exist - * // dir1/file1.txt could have been deleted - * }); - * - * // Using async/await - * async () => { - * try { - * await async.each(files, deleteFile); - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // Error Handling - * async () => { - * try { - * await async.each(withMissingFileList, deleteFile); - * } - * catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4/file2.txt does not exist - * // dir1/file1.txt could have been deleted - * } - * } - * - */ -function eachLimit(coll, iteratee, callback) { - return (0, _eachOf2.default)(coll, (0, _withoutIndex2.default)((0, _wrapAsync2.default)(iteratee)), callback); -} - -exports.default = (0, _awaitify2.default)(eachLimit, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/forEachLimit.js b/node_modules/async/forEachLimit.js deleted file mode 100644 index 5f3d009..0000000 --- a/node_modules/async/forEachLimit.js +++ /dev/null @@ -1,50 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _eachOfLimit = require('./internal/eachOfLimit.js'); - -var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); - -var _withoutIndex = require('./internal/withoutIndex.js'); - -var _withoutIndex2 = _interopRequireDefault(_withoutIndex); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`each`]{@link module:Collections.each} but runs a maximum of `limit` async operations at a time. - * - * @name eachLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.each]{@link module:Collections.each} - * @alias forEachLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The array index is not passed to the iteratee. - * If you need the index, use `eachOfLimit`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - */ -function eachLimit(coll, limit, iteratee, callback) { - return (0, _eachOfLimit2.default)(limit)(coll, (0, _withoutIndex2.default)((0, _wrapAsync2.default)(iteratee)), callback); -} -exports.default = (0, _awaitify2.default)(eachLimit, 4); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/forEachOf.js b/node_modules/async/forEachOf.js deleted file mode 100644 index c22614f..0000000 --- a/node_modules/async/forEachOf.js +++ /dev/null @@ -1,185 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _isArrayLike = require('./internal/isArrayLike.js'); - -var _isArrayLike2 = _interopRequireDefault(_isArrayLike); - -var _breakLoop = require('./internal/breakLoop.js'); - -var _breakLoop2 = _interopRequireDefault(_breakLoop); - -var _eachOfLimit = require('./eachOfLimit.js'); - -var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); - -var _once = require('./internal/once.js'); - -var _once2 = _interopRequireDefault(_once); - -var _onlyOnce = require('./internal/onlyOnce.js'); - -var _onlyOnce2 = _interopRequireDefault(_onlyOnce); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// eachOf implementation optimized for array-likes -function eachOfArrayLike(coll, iteratee, callback) { - callback = (0, _once2.default)(callback); - var index = 0, - completed = 0, - { length } = coll, - canceled = false; - if (length === 0) { - callback(null); - } - - function iteratorCallback(err, value) { - if (err === false) { - canceled = true; - } - if (canceled === true) return; - if (err) { - callback(err); - } else if (++completed === length || value === _breakLoop2.default) { - callback(null); - } - } - - for (; index < length; index++) { - iteratee(coll[index], index, (0, _onlyOnce2.default)(iteratorCallback)); - } -} - -// a generic version of eachOf which can handle array, object, and iterator cases. -function eachOfGeneric(coll, iteratee, callback) { - return (0, _eachOfLimit2.default)(coll, Infinity, iteratee, callback); -} - -/** - * Like [`each`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument - * to the iteratee. - * - * @name eachOf - * @static - * @memberOf module:Collections - * @method - * @alias forEachOf - * @category Collection - * @see [async.each]{@link module:Collections.each} - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each - * item in `coll`. - * The `key` is the item's key, or index in the case of an array. - * Invoked with (item, key, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - * @example - * - * // dev.json is a file containing a valid json object config for dev environment - * // dev.json is a file containing a valid json object config for test environment - * // prod.json is a file containing a valid json object config for prod environment - * // invalid.json is a file with a malformed json object - * - * let configs = {}; //global variable - * let validConfigFileMap = {dev: 'dev.json', test: 'test.json', prod: 'prod.json'}; - * let invalidConfigFileMap = {dev: 'dev.json', test: 'test.json', invalid: 'invalid.json'}; - * - * // asynchronous function that reads a json file and parses the contents as json object - * function parseFile(file, key, callback) { - * fs.readFile(file, "utf8", function(err, data) { - * if (err) return calback(err); - * try { - * configs[key] = JSON.parse(data); - * } catch (e) { - * return callback(e); - * } - * callback(); - * }); - * } - * - * // Using callbacks - * async.forEachOf(validConfigFileMap, parseFile, function (err) { - * if (err) { - * console.error(err); - * } else { - * console.log(configs); - * // configs is now a map of JSON data, e.g. - * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} - * } - * }); - * - * //Error handing - * async.forEachOf(invalidConfigFileMap, parseFile, function (err) { - * if (err) { - * console.error(err); - * // JSON parse error exception - * } else { - * console.log(configs); - * } - * }); - * - * // Using Promises - * async.forEachOf(validConfigFileMap, parseFile) - * .then( () => { - * console.log(configs); - * // configs is now a map of JSON data, e.g. - * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} - * }).catch( err => { - * console.error(err); - * }); - * - * //Error handing - * async.forEachOf(invalidConfigFileMap, parseFile) - * .then( () => { - * console.log(configs); - * }).catch( err => { - * console.error(err); - * // JSON parse error exception - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.forEachOf(validConfigFileMap, parseFile); - * console.log(configs); - * // configs is now a map of JSON data, e.g. - * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} - * } - * catch (err) { - * console.log(err); - * } - * } - * - * //Error handing - * async () => { - * try { - * let result = await async.forEachOf(invalidConfigFileMap, parseFile); - * console.log(configs); - * } - * catch (err) { - * console.log(err); - * // JSON parse error exception - * } - * } - * - */ -function eachOf(coll, iteratee, callback) { - var eachOfImplementation = (0, _isArrayLike2.default)(coll) ? eachOfArrayLike : eachOfGeneric; - return eachOfImplementation(coll, (0, _wrapAsync2.default)(iteratee), callback); -} - -exports.default = (0, _awaitify2.default)(eachOf, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/forEachOfLimit.js b/node_modules/async/forEachOfLimit.js deleted file mode 100644 index e9fc4db..0000000 --- a/node_modules/async/forEachOfLimit.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _eachOfLimit2 = require('./internal/eachOfLimit.js'); - -var _eachOfLimit3 = _interopRequireDefault(_eachOfLimit2); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a - * time. - * - * @name eachOfLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.eachOf]{@link module:Collections.eachOf} - * @alias forEachOfLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each - * item in `coll`. The `key` is the item's key, or index in the case of an - * array. - * Invoked with (item, key, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - */ -function eachOfLimit(coll, limit, iteratee, callback) { - return (0, _eachOfLimit3.default)(limit)(coll, (0, _wrapAsync2.default)(iteratee), callback); -} - -exports.default = (0, _awaitify2.default)(eachOfLimit, 4); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/forEachOfSeries.js b/node_modules/async/forEachOfSeries.js deleted file mode 100644 index cfb0f33..0000000 --- a/node_modules/async/forEachOfSeries.js +++ /dev/null @@ -1,39 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _eachOfLimit = require('./eachOfLimit.js'); - -var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`eachOf`]{@link module:Collections.eachOf} but runs only a single async operation at a time. - * - * @name eachOfSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.eachOf]{@link module:Collections.eachOf} - * @alias forEachOfSeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * Invoked with (item, key, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - */ -function eachOfSeries(coll, iteratee, callback) { - return (0, _eachOfLimit2.default)(coll, 1, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(eachOfSeries, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/forEachSeries.js b/node_modules/async/forEachSeries.js deleted file mode 100644 index d674d0c..0000000 --- a/node_modules/async/forEachSeries.js +++ /dev/null @@ -1,44 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _eachLimit = require('./eachLimit.js'); - -var _eachLimit2 = _interopRequireDefault(_eachLimit); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time. - * - * Note, that unlike [`each`]{@link module:Collections.each}, this function applies iteratee to each item - * in series and therefore the iteratee functions will complete in order. - - * @name eachSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.each]{@link module:Collections.each} - * @alias forEachSeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each - * item in `coll`. - * The array index is not passed to the iteratee. - * If you need the index, use `eachOfSeries`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - */ -function eachSeries(coll, iteratee, callback) { - return (0, _eachLimit2.default)(coll, 1, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(eachSeries, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/forever.js b/node_modules/async/forever.js deleted file mode 100644 index 2c8d5b8..0000000 --- a/node_modules/async/forever.js +++ /dev/null @@ -1,68 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _onlyOnce = require('./internal/onlyOnce.js'); - -var _onlyOnce2 = _interopRequireDefault(_onlyOnce); - -var _ensureAsync = require('./ensureAsync.js'); - -var _ensureAsync2 = _interopRequireDefault(_ensureAsync); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Calls the asynchronous function `fn` with a callback parameter that allows it - * to call itself again, in series, indefinitely. - - * If an error is passed to the callback then `errback` is called with the - * error, and execution stops, otherwise it will never be called. - * - * @name forever - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {AsyncFunction} fn - an async function to call repeatedly. - * Invoked with (next). - * @param {Function} [errback] - when `fn` passes an error to it's callback, - * this function will be called, and execution stops. Invoked with (err). - * @returns {Promise} a promise that rejects if an error occurs and an errback - * is not passed - * @example - * - * async.forever( - * function(next) { - * // next is suitable for passing to things that need a callback(err [, whatever]); - * // it will result in this function being called again. - * }, - * function(err) { - * // if next is called with a value in its first parameter, it will appear - * // in here as 'err', and execution will stop. - * } - * ); - */ -function forever(fn, errback) { - var done = (0, _onlyOnce2.default)(errback); - var task = (0, _wrapAsync2.default)((0, _ensureAsync2.default)(fn)); - - function next(err) { - if (err) return done(err); - if (err === false) return; - task(next); - } - return next(); -} -exports.default = (0, _awaitify2.default)(forever, 2); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/groupBy.js b/node_modules/async/groupBy.js deleted file mode 100644 index 6bb52aa..0000000 --- a/node_modules/async/groupBy.js +++ /dev/null @@ -1,108 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = groupBy; - -var _groupByLimit = require('./groupByLimit.js'); - -var _groupByLimit2 = _interopRequireDefault(_groupByLimit); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Returns a new object, where each value corresponds to an array of items, from - * `coll`, that returned the corresponding key. That is, the keys of the object - * correspond to the values passed to the `iteratee` callback. - * - * Note: Since this function applies the `iteratee` to each item in parallel, - * there is no guarantee that the `iteratee` functions will complete in order. - * However, the values for each key in the `result` will be in the same order as - * the original `coll`. For Objects, the values will roughly be in the order of - * the original Objects' keys (but this can vary across JavaScript engines). - * - * @name groupBy - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with a `key` to group the value under. - * Invoked with (value, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Result is an `Object` whoses - * properties are arrays of values which returned the corresponding key. - * @returns {Promise} a promise, if no callback is passed - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * // dir4 does not exist - * - * const files = ['dir1/file1.txt','dir2','dir4'] - * - * // asynchronous function that detects file type as none, file, or directory - * function detectFile(file, callback) { - * fs.stat(file, function(err, stat) { - * if (err) { - * return callback(null, 'none'); - * } - * callback(null, stat.isDirectory() ? 'directory' : 'file'); - * }); - * } - * - * //Using callbacks - * async.groupBy(files, detectFile, function(err, result) { - * if(err) { - * console.log(err); - * } else { - * console.log(result); - * // { - * // file: [ 'dir1/file1.txt' ], - * // none: [ 'dir4' ], - * // directory: [ 'dir2'] - * // } - * // result is object containing the files grouped by type - * } - * }); - * - * // Using Promises - * async.groupBy(files, detectFile) - * .then( result => { - * console.log(result); - * // { - * // file: [ 'dir1/file1.txt' ], - * // none: [ 'dir4' ], - * // directory: [ 'dir2'] - * // } - * // result is object containing the files grouped by type - * }).catch( err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.groupBy(files, detectFile); - * console.log(result); - * // { - * // file: [ 'dir1/file1.txt' ], - * // none: [ 'dir4' ], - * // directory: [ 'dir2'] - * // } - * // result is object containing the files grouped by type - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function groupBy(coll, iteratee, callback) { - return (0, _groupByLimit2.default)(coll, Infinity, iteratee, callback); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/groupByLimit.js b/node_modules/async/groupByLimit.js deleted file mode 100644 index 5766d6e..0000000 --- a/node_modules/async/groupByLimit.js +++ /dev/null @@ -1,71 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _mapLimit = require('./mapLimit.js'); - -var _mapLimit2 = _interopRequireDefault(_mapLimit); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`groupBy`]{@link module:Collections.groupBy} but runs a maximum of `limit` async operations at a time. - * - * @name groupByLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.groupBy]{@link module:Collections.groupBy} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with a `key` to group the value under. - * Invoked with (value, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Result is an `Object` whoses - * properties are arrays of values which returned the corresponding key. - * @returns {Promise} a promise, if no callback is passed - */ -function groupByLimit(coll, limit, iteratee, callback) { - var _iteratee = (0, _wrapAsync2.default)(iteratee); - return (0, _mapLimit2.default)(coll, limit, (val, iterCb) => { - _iteratee(val, (err, key) => { - if (err) return iterCb(err); - return iterCb(err, { key, val }); - }); - }, (err, mapResults) => { - var result = {}; - // from MDN, handle object having an `hasOwnProperty` prop - var { hasOwnProperty } = Object.prototype; - - for (var i = 0; i < mapResults.length; i++) { - if (mapResults[i]) { - var { key } = mapResults[i]; - var { val } = mapResults[i]; - - if (hasOwnProperty.call(result, key)) { - result[key].push(val); - } else { - result[key] = [val]; - } - } - } - - return callback(err, result); - }); -} - -exports.default = (0, _awaitify2.default)(groupByLimit, 4); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/groupBySeries.js b/node_modules/async/groupBySeries.js deleted file mode 100644 index 6056743..0000000 --- a/node_modules/async/groupBySeries.js +++ /dev/null @@ -1,36 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = groupBySeries; - -var _groupByLimit = require('./groupByLimit.js'); - -var _groupByLimit2 = _interopRequireDefault(_groupByLimit); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`groupBy`]{@link module:Collections.groupBy} but runs only a single async operation at a time. - * - * @name groupBySeries - * @static - * @memberOf module:Collections - * @method - * @see [async.groupBy]{@link module:Collections.groupBy} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with a `key` to group the value under. - * Invoked with (value, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Result is an `Object` whose - * properties are arrays of values which returned the corresponding key. - * @returns {Promise} a promise, if no callback is passed - */ -function groupBySeries(coll, iteratee, callback) { - return (0, _groupByLimit2.default)(coll, 1, iteratee, callback); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/index.js b/node_modules/async/index.js deleted file mode 100644 index ce647d5..0000000 --- a/node_modules/async/index.js +++ /dev/null @@ -1,588 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.doDuring = exports.during = exports.wrapSync = undefined; -exports.selectSeries = exports.selectLimit = exports.select = exports.foldr = exports.foldl = exports.inject = exports.forEachOfLimit = exports.forEachOfSeries = exports.forEachOf = exports.forEachLimit = exports.forEachSeries = exports.forEach = exports.flatMapSeries = exports.flatMapLimit = exports.flatMap = exports.findSeries = exports.findLimit = exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.doWhilst = exports.doUntil = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargoQueue = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined; - -var _apply = require('./apply'); - -var _apply2 = _interopRequireDefault(_apply); - -var _applyEach = require('./applyEach'); - -var _applyEach2 = _interopRequireDefault(_applyEach); - -var _applyEachSeries = require('./applyEachSeries'); - -var _applyEachSeries2 = _interopRequireDefault(_applyEachSeries); - -var _asyncify = require('./asyncify'); - -var _asyncify2 = _interopRequireDefault(_asyncify); - -var _auto = require('./auto'); - -var _auto2 = _interopRequireDefault(_auto); - -var _autoInject = require('./autoInject'); - -var _autoInject2 = _interopRequireDefault(_autoInject); - -var _cargo = require('./cargo'); - -var _cargo2 = _interopRequireDefault(_cargo); - -var _cargoQueue = require('./cargoQueue'); - -var _cargoQueue2 = _interopRequireDefault(_cargoQueue); - -var _compose = require('./compose'); - -var _compose2 = _interopRequireDefault(_compose); - -var _concat = require('./concat'); - -var _concat2 = _interopRequireDefault(_concat); - -var _concatLimit = require('./concatLimit'); - -var _concatLimit2 = _interopRequireDefault(_concatLimit); - -var _concatSeries = require('./concatSeries'); - -var _concatSeries2 = _interopRequireDefault(_concatSeries); - -var _constant = require('./constant'); - -var _constant2 = _interopRequireDefault(_constant); - -var _detect = require('./detect'); - -var _detect2 = _interopRequireDefault(_detect); - -var _detectLimit = require('./detectLimit'); - -var _detectLimit2 = _interopRequireDefault(_detectLimit); - -var _detectSeries = require('./detectSeries'); - -var _detectSeries2 = _interopRequireDefault(_detectSeries); - -var _dir = require('./dir'); - -var _dir2 = _interopRequireDefault(_dir); - -var _doUntil = require('./doUntil'); - -var _doUntil2 = _interopRequireDefault(_doUntil); - -var _doWhilst = require('./doWhilst'); - -var _doWhilst2 = _interopRequireDefault(_doWhilst); - -var _each = require('./each'); - -var _each2 = _interopRequireDefault(_each); - -var _eachLimit = require('./eachLimit'); - -var _eachLimit2 = _interopRequireDefault(_eachLimit); - -var _eachOf = require('./eachOf'); - -var _eachOf2 = _interopRequireDefault(_eachOf); - -var _eachOfLimit = require('./eachOfLimit'); - -var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); - -var _eachOfSeries = require('./eachOfSeries'); - -var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); - -var _eachSeries = require('./eachSeries'); - -var _eachSeries2 = _interopRequireDefault(_eachSeries); - -var _ensureAsync = require('./ensureAsync'); - -var _ensureAsync2 = _interopRequireDefault(_ensureAsync); - -var _every = require('./every'); - -var _every2 = _interopRequireDefault(_every); - -var _everyLimit = require('./everyLimit'); - -var _everyLimit2 = _interopRequireDefault(_everyLimit); - -var _everySeries = require('./everySeries'); - -var _everySeries2 = _interopRequireDefault(_everySeries); - -var _filter = require('./filter'); - -var _filter2 = _interopRequireDefault(_filter); - -var _filterLimit = require('./filterLimit'); - -var _filterLimit2 = _interopRequireDefault(_filterLimit); - -var _filterSeries = require('./filterSeries'); - -var _filterSeries2 = _interopRequireDefault(_filterSeries); - -var _forever = require('./forever'); - -var _forever2 = _interopRequireDefault(_forever); - -var _groupBy = require('./groupBy'); - -var _groupBy2 = _interopRequireDefault(_groupBy); - -var _groupByLimit = require('./groupByLimit'); - -var _groupByLimit2 = _interopRequireDefault(_groupByLimit); - -var _groupBySeries = require('./groupBySeries'); - -var _groupBySeries2 = _interopRequireDefault(_groupBySeries); - -var _log = require('./log'); - -var _log2 = _interopRequireDefault(_log); - -var _map = require('./map'); - -var _map2 = _interopRequireDefault(_map); - -var _mapLimit = require('./mapLimit'); - -var _mapLimit2 = _interopRequireDefault(_mapLimit); - -var _mapSeries = require('./mapSeries'); - -var _mapSeries2 = _interopRequireDefault(_mapSeries); - -var _mapValues = require('./mapValues'); - -var _mapValues2 = _interopRequireDefault(_mapValues); - -var _mapValuesLimit = require('./mapValuesLimit'); - -var _mapValuesLimit2 = _interopRequireDefault(_mapValuesLimit); - -var _mapValuesSeries = require('./mapValuesSeries'); - -var _mapValuesSeries2 = _interopRequireDefault(_mapValuesSeries); - -var _memoize = require('./memoize'); - -var _memoize2 = _interopRequireDefault(_memoize); - -var _nextTick = require('./nextTick'); - -var _nextTick2 = _interopRequireDefault(_nextTick); - -var _parallel = require('./parallel'); - -var _parallel2 = _interopRequireDefault(_parallel); - -var _parallelLimit = require('./parallelLimit'); - -var _parallelLimit2 = _interopRequireDefault(_parallelLimit); - -var _priorityQueue = require('./priorityQueue'); - -var _priorityQueue2 = _interopRequireDefault(_priorityQueue); - -var _queue = require('./queue'); - -var _queue2 = _interopRequireDefault(_queue); - -var _race = require('./race'); - -var _race2 = _interopRequireDefault(_race); - -var _reduce = require('./reduce'); - -var _reduce2 = _interopRequireDefault(_reduce); - -var _reduceRight = require('./reduceRight'); - -var _reduceRight2 = _interopRequireDefault(_reduceRight); - -var _reflect = require('./reflect'); - -var _reflect2 = _interopRequireDefault(_reflect); - -var _reflectAll = require('./reflectAll'); - -var _reflectAll2 = _interopRequireDefault(_reflectAll); - -var _reject = require('./reject'); - -var _reject2 = _interopRequireDefault(_reject); - -var _rejectLimit = require('./rejectLimit'); - -var _rejectLimit2 = _interopRequireDefault(_rejectLimit); - -var _rejectSeries = require('./rejectSeries'); - -var _rejectSeries2 = _interopRequireDefault(_rejectSeries); - -var _retry = require('./retry'); - -var _retry2 = _interopRequireDefault(_retry); - -var _retryable = require('./retryable'); - -var _retryable2 = _interopRequireDefault(_retryable); - -var _seq = require('./seq'); - -var _seq2 = _interopRequireDefault(_seq); - -var _series = require('./series'); - -var _series2 = _interopRequireDefault(_series); - -var _setImmediate = require('./setImmediate'); - -var _setImmediate2 = _interopRequireDefault(_setImmediate); - -var _some = require('./some'); - -var _some2 = _interopRequireDefault(_some); - -var _someLimit = require('./someLimit'); - -var _someLimit2 = _interopRequireDefault(_someLimit); - -var _someSeries = require('./someSeries'); - -var _someSeries2 = _interopRequireDefault(_someSeries); - -var _sortBy = require('./sortBy'); - -var _sortBy2 = _interopRequireDefault(_sortBy); - -var _timeout = require('./timeout'); - -var _timeout2 = _interopRequireDefault(_timeout); - -var _times = require('./times'); - -var _times2 = _interopRequireDefault(_times); - -var _timesLimit = require('./timesLimit'); - -var _timesLimit2 = _interopRequireDefault(_timesLimit); - -var _timesSeries = require('./timesSeries'); - -var _timesSeries2 = _interopRequireDefault(_timesSeries); - -var _transform = require('./transform'); - -var _transform2 = _interopRequireDefault(_transform); - -var _tryEach = require('./tryEach'); - -var _tryEach2 = _interopRequireDefault(_tryEach); - -var _unmemoize = require('./unmemoize'); - -var _unmemoize2 = _interopRequireDefault(_unmemoize); - -var _until = require('./until'); - -var _until2 = _interopRequireDefault(_until); - -var _waterfall = require('./waterfall'); - -var _waterfall2 = _interopRequireDefault(_waterfall); - -var _whilst = require('./whilst'); - -var _whilst2 = _interopRequireDefault(_whilst); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * An "async function" in the context of Async is an asynchronous function with - * a variable number of parameters, with the final parameter being a callback. - * (`function (arg1, arg2, ..., callback) {}`) - * The final callback is of the form `callback(err, results...)`, which must be - * called once the function is completed. The callback should be called with a - * Error as its first argument to signal that an error occurred. - * Otherwise, if no error occurred, it should be called with `null` as the first - * argument, and any additional `result` arguments that may apply, to signal - * successful completion. - * The callback must be called exactly once, ideally on a later tick of the - * JavaScript event loop. - * - * This type of function is also referred to as a "Node-style async function", - * or a "continuation passing-style function" (CPS). Most of the methods of this - * library are themselves CPS/Node-style async functions, or functions that - * return CPS/Node-style async functions. - * - * Wherever we accept a Node-style async function, we also directly accept an - * [ES2017 `async` function]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function}. - * In this case, the `async` function will not be passed a final callback - * argument, and any thrown error will be used as the `err` argument of the - * implicit callback, and the return value will be used as the `result` value. - * (i.e. a `rejected` of the returned Promise becomes the `err` callback - * argument, and a `resolved` value becomes the `result`.) - * - * Note, due to JavaScript limitations, we can only detect native `async` - * functions and not transpilied implementations. - * Your environment must have `async`/`await` support for this to work. - * (e.g. Node > v7.6, or a recent version of a modern browser). - * If you are using `async` functions through a transpiler (e.g. Babel), you - * must still wrap the function with [asyncify]{@link module:Utils.asyncify}, - * because the `async function` will be compiled to an ordinary function that - * returns a promise. - * - * @typedef {Function} AsyncFunction - * @static - */ - -/** - * Async is a utility module which provides straight-forward, powerful functions - * for working with asynchronous JavaScript. Although originally designed for - * use with [Node.js](http://nodejs.org) and installable via - * `npm install --save async`, it can also be used directly in the browser. - * @module async - * @see AsyncFunction - */ - -/** - * A collection of `async` functions for manipulating collections, such as - * arrays and objects. - * @module Collections - */ - -/** - * A collection of `async` functions for controlling the flow through a script. - * @module ControlFlow - */ - -/** - * A collection of `async` utility functions. - * @module Utils - */ - -exports.default = { - apply: _apply2.default, - applyEach: _applyEach2.default, - applyEachSeries: _applyEachSeries2.default, - asyncify: _asyncify2.default, - auto: _auto2.default, - autoInject: _autoInject2.default, - cargo: _cargo2.default, - cargoQueue: _cargoQueue2.default, - compose: _compose2.default, - concat: _concat2.default, - concatLimit: _concatLimit2.default, - concatSeries: _concatSeries2.default, - constant: _constant2.default, - detect: _detect2.default, - detectLimit: _detectLimit2.default, - detectSeries: _detectSeries2.default, - dir: _dir2.default, - doUntil: _doUntil2.default, - doWhilst: _doWhilst2.default, - each: _each2.default, - eachLimit: _eachLimit2.default, - eachOf: _eachOf2.default, - eachOfLimit: _eachOfLimit2.default, - eachOfSeries: _eachOfSeries2.default, - eachSeries: _eachSeries2.default, - ensureAsync: _ensureAsync2.default, - every: _every2.default, - everyLimit: _everyLimit2.default, - everySeries: _everySeries2.default, - filter: _filter2.default, - filterLimit: _filterLimit2.default, - filterSeries: _filterSeries2.default, - forever: _forever2.default, - groupBy: _groupBy2.default, - groupByLimit: _groupByLimit2.default, - groupBySeries: _groupBySeries2.default, - log: _log2.default, - map: _map2.default, - mapLimit: _mapLimit2.default, - mapSeries: _mapSeries2.default, - mapValues: _mapValues2.default, - mapValuesLimit: _mapValuesLimit2.default, - mapValuesSeries: _mapValuesSeries2.default, - memoize: _memoize2.default, - nextTick: _nextTick2.default, - parallel: _parallel2.default, - parallelLimit: _parallelLimit2.default, - priorityQueue: _priorityQueue2.default, - queue: _queue2.default, - race: _race2.default, - reduce: _reduce2.default, - reduceRight: _reduceRight2.default, - reflect: _reflect2.default, - reflectAll: _reflectAll2.default, - reject: _reject2.default, - rejectLimit: _rejectLimit2.default, - rejectSeries: _rejectSeries2.default, - retry: _retry2.default, - retryable: _retryable2.default, - seq: _seq2.default, - series: _series2.default, - setImmediate: _setImmediate2.default, - some: _some2.default, - someLimit: _someLimit2.default, - someSeries: _someSeries2.default, - sortBy: _sortBy2.default, - timeout: _timeout2.default, - times: _times2.default, - timesLimit: _timesLimit2.default, - timesSeries: _timesSeries2.default, - transform: _transform2.default, - tryEach: _tryEach2.default, - unmemoize: _unmemoize2.default, - until: _until2.default, - waterfall: _waterfall2.default, - whilst: _whilst2.default, - - // aliases - all: _every2.default, - allLimit: _everyLimit2.default, - allSeries: _everySeries2.default, - any: _some2.default, - anyLimit: _someLimit2.default, - anySeries: _someSeries2.default, - find: _detect2.default, - findLimit: _detectLimit2.default, - findSeries: _detectSeries2.default, - flatMap: _concat2.default, - flatMapLimit: _concatLimit2.default, - flatMapSeries: _concatSeries2.default, - forEach: _each2.default, - forEachSeries: _eachSeries2.default, - forEachLimit: _eachLimit2.default, - forEachOf: _eachOf2.default, - forEachOfSeries: _eachOfSeries2.default, - forEachOfLimit: _eachOfLimit2.default, - inject: _reduce2.default, - foldl: _reduce2.default, - foldr: _reduceRight2.default, - select: _filter2.default, - selectLimit: _filterLimit2.default, - selectSeries: _filterSeries2.default, - wrapSync: _asyncify2.default, - during: _whilst2.default, - doDuring: _doWhilst2.default -}; -exports.apply = _apply2.default; -exports.applyEach = _applyEach2.default; -exports.applyEachSeries = _applyEachSeries2.default; -exports.asyncify = _asyncify2.default; -exports.auto = _auto2.default; -exports.autoInject = _autoInject2.default; -exports.cargo = _cargo2.default; -exports.cargoQueue = _cargoQueue2.default; -exports.compose = _compose2.default; -exports.concat = _concat2.default; -exports.concatLimit = _concatLimit2.default; -exports.concatSeries = _concatSeries2.default; -exports.constant = _constant2.default; -exports.detect = _detect2.default; -exports.detectLimit = _detectLimit2.default; -exports.detectSeries = _detectSeries2.default; -exports.dir = _dir2.default; -exports.doUntil = _doUntil2.default; -exports.doWhilst = _doWhilst2.default; -exports.each = _each2.default; -exports.eachLimit = _eachLimit2.default; -exports.eachOf = _eachOf2.default; -exports.eachOfLimit = _eachOfLimit2.default; -exports.eachOfSeries = _eachOfSeries2.default; -exports.eachSeries = _eachSeries2.default; -exports.ensureAsync = _ensureAsync2.default; -exports.every = _every2.default; -exports.everyLimit = _everyLimit2.default; -exports.everySeries = _everySeries2.default; -exports.filter = _filter2.default; -exports.filterLimit = _filterLimit2.default; -exports.filterSeries = _filterSeries2.default; -exports.forever = _forever2.default; -exports.groupBy = _groupBy2.default; -exports.groupByLimit = _groupByLimit2.default; -exports.groupBySeries = _groupBySeries2.default; -exports.log = _log2.default; -exports.map = _map2.default; -exports.mapLimit = _mapLimit2.default; -exports.mapSeries = _mapSeries2.default; -exports.mapValues = _mapValues2.default; -exports.mapValuesLimit = _mapValuesLimit2.default; -exports.mapValuesSeries = _mapValuesSeries2.default; -exports.memoize = _memoize2.default; -exports.nextTick = _nextTick2.default; -exports.parallel = _parallel2.default; -exports.parallelLimit = _parallelLimit2.default; -exports.priorityQueue = _priorityQueue2.default; -exports.queue = _queue2.default; -exports.race = _race2.default; -exports.reduce = _reduce2.default; -exports.reduceRight = _reduceRight2.default; -exports.reflect = _reflect2.default; -exports.reflectAll = _reflectAll2.default; -exports.reject = _reject2.default; -exports.rejectLimit = _rejectLimit2.default; -exports.rejectSeries = _rejectSeries2.default; -exports.retry = _retry2.default; -exports.retryable = _retryable2.default; -exports.seq = _seq2.default; -exports.series = _series2.default; -exports.setImmediate = _setImmediate2.default; -exports.some = _some2.default; -exports.someLimit = _someLimit2.default; -exports.someSeries = _someSeries2.default; -exports.sortBy = _sortBy2.default; -exports.timeout = _timeout2.default; -exports.times = _times2.default; -exports.timesLimit = _timesLimit2.default; -exports.timesSeries = _timesSeries2.default; -exports.transform = _transform2.default; -exports.tryEach = _tryEach2.default; -exports.unmemoize = _unmemoize2.default; -exports.until = _until2.default; -exports.waterfall = _waterfall2.default; -exports.whilst = _whilst2.default; -exports.all = _every2.default; -exports.allLimit = _everyLimit2.default; -exports.allSeries = _everySeries2.default; -exports.any = _some2.default; -exports.anyLimit = _someLimit2.default; -exports.anySeries = _someSeries2.default; -exports.find = _detect2.default; -exports.findLimit = _detectLimit2.default; -exports.findSeries = _detectSeries2.default; -exports.flatMap = _concat2.default; -exports.flatMapLimit = _concatLimit2.default; -exports.flatMapSeries = _concatSeries2.default; -exports.forEach = _each2.default; -exports.forEachSeries = _eachSeries2.default; -exports.forEachLimit = _eachLimit2.default; -exports.forEachOf = _eachOf2.default; -exports.forEachOfSeries = _eachOfSeries2.default; -exports.forEachOfLimit = _eachOfLimit2.default; -exports.inject = _reduce2.default; -exports.foldl = _reduce2.default; -exports.foldr = _reduceRight2.default; -exports.select = _filter2.default; -exports.selectLimit = _filterLimit2.default; -exports.selectSeries = _filterSeries2.default; -exports.wrapSync = _asyncify2.default; -exports.during = _whilst2.default; -exports.doDuring = _doWhilst2.default; \ No newline at end of file diff --git a/node_modules/async/inject.js b/node_modules/async/inject.js deleted file mode 100644 index 56e2db8..0000000 --- a/node_modules/async/inject.js +++ /dev/null @@ -1,153 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _eachOfSeries = require('./eachOfSeries.js'); - -var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); - -var _once = require('./internal/once.js'); - -var _once2 = _interopRequireDefault(_once); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Reduces `coll` into a single value using an async `iteratee` to return each - * successive step. `memo` is the initial state of the reduction. This function - * only operates in series. - * - * For performance reasons, it may make sense to split a call to this function - * into a parallel map, and then use the normal `Array.prototype.reduce` on the - * results. This function is for situations where each step in the reduction - * needs to be async; if you can get the data before reducing it, then it's - * probably a good idea to do so. - * - * @name reduce - * @static - * @memberOf module:Collections - * @method - * @alias inject - * @alias foldl - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {*} memo - The initial state of the reduction. - * @param {AsyncFunction} iteratee - A function applied to each item in the - * array to produce the next step in the reduction. - * The `iteratee` should complete with the next state of the reduction. - * If the iteratee completes with an error, the reduction is stopped and the - * main `callback` is immediately called with the error. - * Invoked with (memo, item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result is the reduced value. Invoked with - * (err, result). - * @returns {Promise} a promise, if no callback is passed - * @example - * - * // file1.txt is a file that is 1000 bytes in size - * // file2.txt is a file that is 2000 bytes in size - * // file3.txt is a file that is 3000 bytes in size - * // file4.txt does not exist - * - * const fileList = ['file1.txt','file2.txt','file3.txt']; - * const withMissingFileList = ['file1.txt','file2.txt','file3.txt', 'file4.txt']; - * - * // asynchronous function that computes the file size in bytes - * // file size is added to the memoized value, then returned - * function getFileSizeInBytes(memo, file, callback) { - * fs.stat(file, function(err, stat) { - * if (err) { - * return callback(err); - * } - * callback(null, memo + stat.size); - * }); - * } - * - * // Using callbacks - * async.reduce(fileList, 0, getFileSizeInBytes, function(err, result) { - * if (err) { - * console.log(err); - * } else { - * console.log(result); - * // 6000 - * // which is the sum of the file sizes of the three files - * } - * }); - * - * // Error Handling - * async.reduce(withMissingFileList, 0, getFileSizeInBytes, function(err, result) { - * if (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } else { - * console.log(result); - * } - * }); - * - * // Using Promises - * async.reduce(fileList, 0, getFileSizeInBytes) - * .then( result => { - * console.log(result); - * // 6000 - * // which is the sum of the file sizes of the three files - * }).catch( err => { - * console.log(err); - * }); - * - * // Error Handling - * async.reduce(withMissingFileList, 0, getFileSizeInBytes) - * .then( result => { - * console.log(result); - * }).catch( err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.reduce(fileList, 0, getFileSizeInBytes); - * console.log(result); - * // 6000 - * // which is the sum of the file sizes of the three files - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // Error Handling - * async () => { - * try { - * let result = await async.reduce(withMissingFileList, 0, getFileSizeInBytes); - * console.log(result); - * } - * catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } - * } - * - */ -function reduce(coll, memo, iteratee, callback) { - callback = (0, _once2.default)(callback); - var _iteratee = (0, _wrapAsync2.default)(iteratee); - return (0, _eachOfSeries2.default)(coll, (x, i, iterCb) => { - _iteratee(memo, x, (err, v) => { - memo = v; - iterCb(err); - }); - }, err => callback(err, memo)); -} -exports.default = (0, _awaitify2.default)(reduce, 4); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/internal/DoublyLinkedList.js b/node_modules/async/internal/DoublyLinkedList.js deleted file mode 100644 index cd11c3b..0000000 --- a/node_modules/async/internal/DoublyLinkedList.js +++ /dev/null @@ -1,92 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -// Simple doubly linked list (https://en.wikipedia.org/wiki/Doubly_linked_list) implementation -// used for queues. This implementation assumes that the node provided by the user can be modified -// to adjust the next and last properties. We implement only the minimal functionality -// for queue support. -class DLL { - constructor() { - this.head = this.tail = null; - this.length = 0; - } - - removeLink(node) { - if (node.prev) node.prev.next = node.next;else this.head = node.next; - if (node.next) node.next.prev = node.prev;else this.tail = node.prev; - - node.prev = node.next = null; - this.length -= 1; - return node; - } - - empty() { - while (this.head) this.shift(); - return this; - } - - insertAfter(node, newNode) { - newNode.prev = node; - newNode.next = node.next; - if (node.next) node.next.prev = newNode;else this.tail = newNode; - node.next = newNode; - this.length += 1; - } - - insertBefore(node, newNode) { - newNode.prev = node.prev; - newNode.next = node; - if (node.prev) node.prev.next = newNode;else this.head = newNode; - node.prev = newNode; - this.length += 1; - } - - unshift(node) { - if (this.head) this.insertBefore(this.head, node);else setInitial(this, node); - } - - push(node) { - if (this.tail) this.insertAfter(this.tail, node);else setInitial(this, node); - } - - shift() { - return this.head && this.removeLink(this.head); - } - - pop() { - return this.tail && this.removeLink(this.tail); - } - - toArray() { - return [...this]; - } - - *[Symbol.iterator]() { - var cur = this.head; - while (cur) { - yield cur.data; - cur = cur.next; - } - } - - remove(testFn) { - var curr = this.head; - while (curr) { - var { next } = curr; - if (testFn(curr)) { - this.removeLink(curr); - } - curr = next; - } - return this; - } -} - -exports.default = DLL; -function setInitial(dll, node) { - dll.length = 1; - dll.head = dll.tail = node; -} -module.exports = exports["default"]; \ No newline at end of file diff --git a/node_modules/async/internal/Heap.js b/node_modules/async/internal/Heap.js deleted file mode 100644 index 80762fe..0000000 --- a/node_modules/async/internal/Heap.js +++ /dev/null @@ -1,120 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -// Binary min-heap implementation used for priority queue. -// Implementation is stable, i.e. push time is considered for equal priorities -class Heap { - constructor() { - this.heap = []; - this.pushCount = Number.MIN_SAFE_INTEGER; - } - - get length() { - return this.heap.length; - } - - empty() { - this.heap = []; - return this; - } - - percUp(index) { - let p; - - while (index > 0 && smaller(this.heap[index], this.heap[p = parent(index)])) { - let t = this.heap[index]; - this.heap[index] = this.heap[p]; - this.heap[p] = t; - - index = p; - } - } - - percDown(index) { - let l; - - while ((l = leftChi(index)) < this.heap.length) { - if (l + 1 < this.heap.length && smaller(this.heap[l + 1], this.heap[l])) { - l = l + 1; - } - - if (smaller(this.heap[index], this.heap[l])) { - break; - } - - let t = this.heap[index]; - this.heap[index] = this.heap[l]; - this.heap[l] = t; - - index = l; - } - } - - push(node) { - node.pushCount = ++this.pushCount; - this.heap.push(node); - this.percUp(this.heap.length - 1); - } - - unshift(node) { - return this.heap.push(node); - } - - shift() { - let [top] = this.heap; - - this.heap[0] = this.heap[this.heap.length - 1]; - this.heap.pop(); - this.percDown(0); - - return top; - } - - toArray() { - return [...this]; - } - - *[Symbol.iterator]() { - for (let i = 0; i < this.heap.length; i++) { - yield this.heap[i].data; - } - } - - remove(testFn) { - let j = 0; - for (let i = 0; i < this.heap.length; i++) { - if (!testFn(this.heap[i])) { - this.heap[j] = this.heap[i]; - j++; - } - } - - this.heap.splice(j); - - for (let i = parent(this.heap.length - 1); i >= 0; i--) { - this.percDown(i); - } - - return this; - } -} - -exports.default = Heap; -function leftChi(i) { - return (i << 1) + 1; -} - -function parent(i) { - return (i + 1 >> 1) - 1; -} - -function smaller(x, y) { - if (x.priority !== y.priority) { - return x.priority < y.priority; - } else { - return x.pushCount < y.pushCount; - } -} -module.exports = exports["default"]; \ No newline at end of file diff --git a/node_modules/async/internal/applyEach.js b/node_modules/async/internal/applyEach.js deleted file mode 100644 index a3f4ef1..0000000 --- a/node_modules/async/internal/applyEach.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -exports.default = function (eachfn) { - return function applyEach(fns, ...callArgs) { - const go = (0, _awaitify2.default)(function (callback) { - var that = this; - return eachfn(fns, (fn, cb) => { - (0, _wrapAsync2.default)(fn).apply(that, callArgs.concat(cb)); - }, callback); - }); - return go; - }; -}; - -var _wrapAsync = require('./wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/internal/asyncEachOfLimit.js b/node_modules/async/internal/asyncEachOfLimit.js deleted file mode 100644 index bba74c7..0000000 --- a/node_modules/async/internal/asyncEachOfLimit.js +++ /dev/null @@ -1,75 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = asyncEachOfLimit; - -var _breakLoop = require('./breakLoop.js'); - -var _breakLoop2 = _interopRequireDefault(_breakLoop); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// for async generators -function asyncEachOfLimit(generator, limit, iteratee, callback) { - let done = false; - let canceled = false; - let awaiting = false; - let running = 0; - let idx = 0; - - function replenish() { - //console.log('replenish') - if (running >= limit || awaiting || done) return; - //console.log('replenish awaiting') - awaiting = true; - generator.next().then(({ value, done: iterDone }) => { - //console.log('got value', value) - if (canceled || done) return; - awaiting = false; - if (iterDone) { - done = true; - if (running <= 0) { - //console.log('done nextCb') - callback(null); - } - return; - } - running++; - iteratee(value, idx, iterateeCallback); - idx++; - replenish(); - }).catch(handleError); - } - - function iterateeCallback(err, result) { - //console.log('iterateeCallback') - running -= 1; - if (canceled) return; - if (err) return handleError(err); - - if (err === false) { - done = true; - canceled = true; - return; - } - - if (result === _breakLoop2.default || done && running <= 0) { - done = true; - //console.log('done iterCb') - return callback(null); - } - replenish(); - } - - function handleError(err) { - if (canceled) return; - awaiting = false; - done = true; - callback(err); - } - - replenish(); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/internal/awaitify.js b/node_modules/async/internal/awaitify.js deleted file mode 100644 index 7b36f1a..0000000 --- a/node_modules/async/internal/awaitify.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = awaitify; -// conditionally promisify a function. -// only return a promise if a callback is omitted -function awaitify(asyncFn, arity = asyncFn.length) { - if (!arity) throw new Error('arity is undefined'); - function awaitable(...args) { - if (typeof args[arity - 1] === 'function') { - return asyncFn.apply(this, args); - } - - return new Promise((resolve, reject) => { - args[arity - 1] = (err, ...cbArgs) => { - if (err) return reject(err); - resolve(cbArgs.length > 1 ? cbArgs : cbArgs[0]); - }; - asyncFn.apply(this, args); - }); - } - - return awaitable; -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/internal/breakLoop.js b/node_modules/async/internal/breakLoop.js deleted file mode 100644 index 8245e55..0000000 --- a/node_modules/async/internal/breakLoop.js +++ /dev/null @@ -1,10 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -// A temporary value used to identify if the loop should be broken. -// See #1064, #1293 -const breakLoop = {}; -exports.default = breakLoop; -module.exports = exports["default"]; \ No newline at end of file diff --git a/node_modules/async/internal/consoleFunc.js b/node_modules/async/internal/consoleFunc.js deleted file mode 100644 index 70347a5..0000000 --- a/node_modules/async/internal/consoleFunc.js +++ /dev/null @@ -1,31 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = consoleFunc; - -var _wrapAsync = require('./wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function consoleFunc(name) { - return (fn, ...args) => (0, _wrapAsync2.default)(fn)(...args, (err, ...resultArgs) => { - /* istanbul ignore else */ - if (typeof console === 'object') { - /* istanbul ignore else */ - if (err) { - /* istanbul ignore else */ - if (console.error) { - console.error(err); - } - } else if (console[name]) { - /* istanbul ignore else */ - resultArgs.forEach(x => console[name](x)); - } - } - }); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/internal/createTester.js b/node_modules/async/internal/createTester.js deleted file mode 100644 index 7b2d734..0000000 --- a/node_modules/async/internal/createTester.js +++ /dev/null @@ -1,40 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = _createTester; - -var _breakLoop = require('./breakLoop.js'); - -var _breakLoop2 = _interopRequireDefault(_breakLoop); - -var _wrapAsync = require('./wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _createTester(check, getResult) { - return (eachfn, arr, _iteratee, cb) => { - var testPassed = false; - var testResult; - const iteratee = (0, _wrapAsync2.default)(_iteratee); - eachfn(arr, (value, _, callback) => { - iteratee(value, (err, result) => { - if (err || err === false) return callback(err); - - if (check(result) && !testResult) { - testPassed = true; - testResult = getResult(true, value); - return callback(null, _breakLoop2.default); - } - callback(); - }); - }, err => { - if (err) return cb(err); - cb(null, testPassed ? testResult : getResult(false)); - }); - }; -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/internal/eachOfLimit.js b/node_modules/async/internal/eachOfLimit.js deleted file mode 100644 index fc26b20..0000000 --- a/node_modules/async/internal/eachOfLimit.js +++ /dev/null @@ -1,90 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _once = require('./once.js'); - -var _once2 = _interopRequireDefault(_once); - -var _iterator = require('./iterator.js'); - -var _iterator2 = _interopRequireDefault(_iterator); - -var _onlyOnce = require('./onlyOnce.js'); - -var _onlyOnce2 = _interopRequireDefault(_onlyOnce); - -var _wrapAsync = require('./wrapAsync.js'); - -var _asyncEachOfLimit = require('./asyncEachOfLimit.js'); - -var _asyncEachOfLimit2 = _interopRequireDefault(_asyncEachOfLimit); - -var _breakLoop = require('./breakLoop.js'); - -var _breakLoop2 = _interopRequireDefault(_breakLoop); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = limit => { - return (obj, iteratee, callback) => { - callback = (0, _once2.default)(callback); - if (limit <= 0) { - throw new RangeError('concurrency limit cannot be less than 1'); - } - if (!obj) { - return callback(null); - } - if ((0, _wrapAsync.isAsyncGenerator)(obj)) { - return (0, _asyncEachOfLimit2.default)(obj, limit, iteratee, callback); - } - if ((0, _wrapAsync.isAsyncIterable)(obj)) { - return (0, _asyncEachOfLimit2.default)(obj[Symbol.asyncIterator](), limit, iteratee, callback); - } - var nextElem = (0, _iterator2.default)(obj); - var done = false; - var canceled = false; - var running = 0; - var looping = false; - - function iterateeCallback(err, value) { - if (canceled) return; - running -= 1; - if (err) { - done = true; - callback(err); - } else if (err === false) { - done = true; - canceled = true; - } else if (value === _breakLoop2.default || done && running <= 0) { - done = true; - return callback(null); - } else if (!looping) { - replenish(); - } - } - - function replenish() { - looping = true; - while (running < limit && !done) { - var elem = nextElem(); - if (elem === null) { - done = true; - if (running <= 0) { - callback(null); - } - return; - } - running += 1; - iteratee(elem.value, elem.key, (0, _onlyOnce2.default)(iterateeCallback)); - } - looping = false; - } - - replenish(); - }; -}; - -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/internal/filter.js b/node_modules/async/internal/filter.js deleted file mode 100644 index aef2b9d..0000000 --- a/node_modules/async/internal/filter.js +++ /dev/null @@ -1,55 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = _filter; - -var _isArrayLike = require('./isArrayLike.js'); - -var _isArrayLike2 = _interopRequireDefault(_isArrayLike); - -var _wrapAsync = require('./wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function filterArray(eachfn, arr, iteratee, callback) { - var truthValues = new Array(arr.length); - eachfn(arr, (x, index, iterCb) => { - iteratee(x, (err, v) => { - truthValues[index] = !!v; - iterCb(err); - }); - }, err => { - if (err) return callback(err); - var results = []; - for (var i = 0; i < arr.length; i++) { - if (truthValues[i]) results.push(arr[i]); - } - callback(null, results); - }); -} - -function filterGeneric(eachfn, coll, iteratee, callback) { - var results = []; - eachfn(coll, (x, index, iterCb) => { - iteratee(x, (err, v) => { - if (err) return iterCb(err); - if (v) { - results.push({ index, value: x }); - } - iterCb(err); - }); - }, err => { - if (err) return callback(err); - callback(null, results.sort((a, b) => a.index - b.index).map(v => v.value)); - }); -} - -function _filter(eachfn, coll, iteratee, callback) { - var filter = (0, _isArrayLike2.default)(coll) ? filterArray : filterGeneric; - return filter(eachfn, coll, (0, _wrapAsync2.default)(iteratee), callback); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/internal/getIterator.js b/node_modules/async/internal/getIterator.js deleted file mode 100644 index 830a545..0000000 --- a/node_modules/async/internal/getIterator.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -exports.default = function (coll) { - return coll[Symbol.iterator] && coll[Symbol.iterator](); -}; - -module.exports = exports["default"]; \ No newline at end of file diff --git a/node_modules/async/internal/initialParams.js b/node_modules/async/internal/initialParams.js deleted file mode 100644 index 245378c..0000000 --- a/node_modules/async/internal/initialParams.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -exports.default = function (fn) { - return function (...args /*, callback*/) { - var callback = args.pop(); - return fn.call(this, args, callback); - }; -}; - -module.exports = exports["default"]; \ No newline at end of file diff --git a/node_modules/async/internal/isArrayLike.js b/node_modules/async/internal/isArrayLike.js deleted file mode 100644 index ce07670..0000000 --- a/node_modules/async/internal/isArrayLike.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isArrayLike; -function isArrayLike(value) { - return value && typeof value.length === 'number' && value.length >= 0 && value.length % 1 === 0; -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/internal/iterator.js b/node_modules/async/internal/iterator.js deleted file mode 100644 index 90b0223..0000000 --- a/node_modules/async/internal/iterator.js +++ /dev/null @@ -1,57 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = createIterator; - -var _isArrayLike = require('./isArrayLike.js'); - -var _isArrayLike2 = _interopRequireDefault(_isArrayLike); - -var _getIterator = require('./getIterator.js'); - -var _getIterator2 = _interopRequireDefault(_getIterator); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function createArrayIterator(coll) { - var i = -1; - var len = coll.length; - return function next() { - return ++i < len ? { value: coll[i], key: i } : null; - }; -} - -function createES2015Iterator(iterator) { - var i = -1; - return function next() { - var item = iterator.next(); - if (item.done) return null; - i++; - return { value: item.value, key: i }; - }; -} - -function createObjectIterator(obj) { - var okeys = obj ? Object.keys(obj) : []; - var i = -1; - var len = okeys.length; - return function next() { - var key = okeys[++i]; - if (key === '__proto__') { - return next(); - } - return i < len ? { value: obj[key], key } : null; - }; -} - -function createIterator(coll) { - if ((0, _isArrayLike2.default)(coll)) { - return createArrayIterator(coll); - } - - var iterator = (0, _getIterator2.default)(coll); - return iterator ? createES2015Iterator(iterator) : createObjectIterator(coll); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/internal/map.js b/node_modules/async/internal/map.js deleted file mode 100644 index af3fd09..0000000 --- a/node_modules/async/internal/map.js +++ /dev/null @@ -1,30 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = _asyncMap; - -var _wrapAsync = require('./wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _asyncMap(eachfn, arr, iteratee, callback) { - arr = arr || []; - var results = []; - var counter = 0; - var _iteratee = (0, _wrapAsync2.default)(iteratee); - - return eachfn(arr, (value, _, iterCb) => { - var index = counter++; - _iteratee(value, (err, v) => { - results[index] = v; - iterCb(err); - }); - }, err => { - callback(err, results); - }); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/internal/once.js b/node_modules/async/internal/once.js deleted file mode 100644 index 49f3727..0000000 --- a/node_modules/async/internal/once.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = once; -function once(fn) { - function wrapper(...args) { - if (fn === null) return; - var callFn = fn; - fn = null; - callFn.apply(this, args); - } - Object.assign(wrapper, fn); - return wrapper; -} -module.exports = exports["default"]; \ No newline at end of file diff --git a/node_modules/async/internal/onlyOnce.js b/node_modules/async/internal/onlyOnce.js deleted file mode 100644 index 6ad721b..0000000 --- a/node_modules/async/internal/onlyOnce.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = onlyOnce; -function onlyOnce(fn) { - return function (...args) { - if (fn === null) throw new Error("Callback was already called."); - var callFn = fn; - fn = null; - callFn.apply(this, args); - }; -} -module.exports = exports["default"]; \ No newline at end of file diff --git a/node_modules/async/internal/parallel.js b/node_modules/async/internal/parallel.js deleted file mode 100644 index 75741bb..0000000 --- a/node_modules/async/internal/parallel.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _isArrayLike = require('./isArrayLike.js'); - -var _isArrayLike2 = _interopRequireDefault(_isArrayLike); - -var _wrapAsync = require('./wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = (0, _awaitify2.default)((eachfn, tasks, callback) => { - var results = (0, _isArrayLike2.default)(tasks) ? [] : {}; - - eachfn(tasks, (task, key, taskCb) => { - (0, _wrapAsync2.default)(task)((err, ...result) => { - if (result.length < 2) { - [result] = result; - } - results[key] = result; - taskCb(err); - }); - }, err => callback(err, results)); -}, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/internal/promiseCallback.js b/node_modules/async/internal/promiseCallback.js deleted file mode 100644 index 17a8301..0000000 --- a/node_modules/async/internal/promiseCallback.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -const PROMISE_SYMBOL = Symbol('promiseCallback'); - -function promiseCallback() { - let resolve, reject; - function callback(err, ...args) { - if (err) return reject(err); - resolve(args.length > 1 ? args : args[0]); - } - - callback[PROMISE_SYMBOL] = new Promise((res, rej) => { - resolve = res, reject = rej; - }); - - return callback; -} - -exports.promiseCallback = promiseCallback; -exports.PROMISE_SYMBOL = PROMISE_SYMBOL; \ No newline at end of file diff --git a/node_modules/async/internal/queue.js b/node_modules/async/internal/queue.js deleted file mode 100644 index cbc590d..0000000 --- a/node_modules/async/internal/queue.js +++ /dev/null @@ -1,294 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = queue; - -var _onlyOnce = require('./onlyOnce.js'); - -var _onlyOnce2 = _interopRequireDefault(_onlyOnce); - -var _setImmediate = require('./setImmediate.js'); - -var _setImmediate2 = _interopRequireDefault(_setImmediate); - -var _DoublyLinkedList = require('./DoublyLinkedList.js'); - -var _DoublyLinkedList2 = _interopRequireDefault(_DoublyLinkedList); - -var _wrapAsync = require('./wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function queue(worker, concurrency, payload) { - if (concurrency == null) { - concurrency = 1; - } else if (concurrency === 0) { - throw new RangeError('Concurrency must not be zero'); - } - - var _worker = (0, _wrapAsync2.default)(worker); - var numRunning = 0; - var workersList = []; - const events = { - error: [], - drain: [], - saturated: [], - unsaturated: [], - empty: [] - }; - - function on(event, handler) { - events[event].push(handler); - } - - function once(event, handler) { - const handleAndRemove = (...args) => { - off(event, handleAndRemove); - handler(...args); - }; - events[event].push(handleAndRemove); - } - - function off(event, handler) { - if (!event) return Object.keys(events).forEach(ev => events[ev] = []); - if (!handler) return events[event] = []; - events[event] = events[event].filter(ev => ev !== handler); - } - - function trigger(event, ...args) { - events[event].forEach(handler => handler(...args)); - } - - var processingScheduled = false; - function _insert(data, insertAtFront, rejectOnError, callback) { - if (callback != null && typeof callback !== 'function') { - throw new Error('task callback must be a function'); - } - q.started = true; - - var res, rej; - function promiseCallback(err, ...args) { - // we don't care about the error, let the global error handler - // deal with it - if (err) return rejectOnError ? rej(err) : res(); - if (args.length <= 1) return res(args[0]); - res(args); - } - - var item = q._createTaskItem(data, rejectOnError ? promiseCallback : callback || promiseCallback); - - if (insertAtFront) { - q._tasks.unshift(item); - } else { - q._tasks.push(item); - } - - if (!processingScheduled) { - processingScheduled = true; - (0, _setImmediate2.default)(() => { - processingScheduled = false; - q.process(); - }); - } - - if (rejectOnError || !callback) { - return new Promise((resolve, reject) => { - res = resolve; - rej = reject; - }); - } - } - - function _createCB(tasks) { - return function (err, ...args) { - numRunning -= 1; - - for (var i = 0, l = tasks.length; i < l; i++) { - var task = tasks[i]; - - var index = workersList.indexOf(task); - if (index === 0) { - workersList.shift(); - } else if (index > 0) { - workersList.splice(index, 1); - } - - task.callback(err, ...args); - - if (err != null) { - trigger('error', err, task.data); - } - } - - if (numRunning <= q.concurrency - q.buffer) { - trigger('unsaturated'); - } - - if (q.idle()) { - trigger('drain'); - } - q.process(); - }; - } - - function _maybeDrain(data) { - if (data.length === 0 && q.idle()) { - // call drain immediately if there are no tasks - (0, _setImmediate2.default)(() => trigger('drain')); - return true; - } - return false; - } - - const eventMethod = name => handler => { - if (!handler) { - return new Promise((resolve, reject) => { - once(name, (err, data) => { - if (err) return reject(err); - resolve(data); - }); - }); - } - off(name); - on(name, handler); - }; - - var isProcessing = false; - var q = { - _tasks: new _DoublyLinkedList2.default(), - _createTaskItem(data, callback) { - return { - data, - callback - }; - }, - *[Symbol.iterator]() { - yield* q._tasks[Symbol.iterator](); - }, - concurrency, - payload, - buffer: concurrency / 4, - started: false, - paused: false, - push(data, callback) { - if (Array.isArray(data)) { - if (_maybeDrain(data)) return; - return data.map(datum => _insert(datum, false, false, callback)); - } - return _insert(data, false, false, callback); - }, - pushAsync(data, callback) { - if (Array.isArray(data)) { - if (_maybeDrain(data)) return; - return data.map(datum => _insert(datum, false, true, callback)); - } - return _insert(data, false, true, callback); - }, - kill() { - off(); - q._tasks.empty(); - }, - unshift(data, callback) { - if (Array.isArray(data)) { - if (_maybeDrain(data)) return; - return data.map(datum => _insert(datum, true, false, callback)); - } - return _insert(data, true, false, callback); - }, - unshiftAsync(data, callback) { - if (Array.isArray(data)) { - if (_maybeDrain(data)) return; - return data.map(datum => _insert(datum, true, true, callback)); - } - return _insert(data, true, true, callback); - }, - remove(testFn) { - q._tasks.remove(testFn); - }, - process() { - // Avoid trying to start too many processing operations. This can occur - // when callbacks resolve synchronously (#1267). - if (isProcessing) { - return; - } - isProcessing = true; - while (!q.paused && numRunning < q.concurrency && q._tasks.length) { - var tasks = [], - data = []; - var l = q._tasks.length; - if (q.payload) l = Math.min(l, q.payload); - for (var i = 0; i < l; i++) { - var node = q._tasks.shift(); - tasks.push(node); - workersList.push(node); - data.push(node.data); - } - - numRunning += 1; - - if (q._tasks.length === 0) { - trigger('empty'); - } - - if (numRunning === q.concurrency) { - trigger('saturated'); - } - - var cb = (0, _onlyOnce2.default)(_createCB(tasks)); - _worker(data, cb); - } - isProcessing = false; - }, - length() { - return q._tasks.length; - }, - running() { - return numRunning; - }, - workersList() { - return workersList; - }, - idle() { - return q._tasks.length + numRunning === 0; - }, - pause() { - q.paused = true; - }, - resume() { - if (q.paused === false) { - return; - } - q.paused = false; - (0, _setImmediate2.default)(q.process); - } - }; - // define these as fixed properties, so people get useful errors when updating - Object.defineProperties(q, { - saturated: { - writable: false, - value: eventMethod('saturated') - }, - unsaturated: { - writable: false, - value: eventMethod('unsaturated') - }, - empty: { - writable: false, - value: eventMethod('empty') - }, - drain: { - writable: false, - value: eventMethod('drain') - }, - error: { - writable: false, - value: eventMethod('error') - } - }); - return q; -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/internal/range.js b/node_modules/async/internal/range.js deleted file mode 100644 index 6680e64..0000000 --- a/node_modules/async/internal/range.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = range; -function range(size) { - var result = Array(size); - while (size--) { - result[size] = size; - } - return result; -} -module.exports = exports["default"]; \ No newline at end of file diff --git a/node_modules/async/internal/reject.js b/node_modules/async/internal/reject.js deleted file mode 100644 index 7388ef4..0000000 --- a/node_modules/async/internal/reject.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = reject; - -var _filter = require('./filter.js'); - -var _filter2 = _interopRequireDefault(_filter); - -var _wrapAsync = require('./wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function reject(eachfn, arr, _iteratee, callback) { - const iteratee = (0, _wrapAsync2.default)(_iteratee); - return (0, _filter2.default)(eachfn, arr, (value, cb) => { - iteratee(value, (err, v) => { - cb(err, !v); - }); - }, callback); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/internal/setImmediate.js b/node_modules/async/internal/setImmediate.js deleted file mode 100644 index 513efd1..0000000 --- a/node_modules/async/internal/setImmediate.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.fallback = fallback; -exports.wrap = wrap; -/* istanbul ignore file */ - -var hasQueueMicrotask = exports.hasQueueMicrotask = typeof queueMicrotask === 'function' && queueMicrotask; -var hasSetImmediate = exports.hasSetImmediate = typeof setImmediate === 'function' && setImmediate; -var hasNextTick = exports.hasNextTick = typeof process === 'object' && typeof process.nextTick === 'function'; - -function fallback(fn) { - setTimeout(fn, 0); -} - -function wrap(defer) { - return (fn, ...args) => defer(() => fn(...args)); -} - -var _defer; - -if (hasQueueMicrotask) { - _defer = queueMicrotask; -} else if (hasSetImmediate) { - _defer = setImmediate; -} else if (hasNextTick) { - _defer = process.nextTick; -} else { - _defer = fallback; -} - -exports.default = wrap(_defer); \ No newline at end of file diff --git a/node_modules/async/internal/withoutIndex.js b/node_modules/async/internal/withoutIndex.js deleted file mode 100644 index ec45fa3..0000000 --- a/node_modules/async/internal/withoutIndex.js +++ /dev/null @@ -1,10 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = _withoutIndex; -function _withoutIndex(iteratee) { - return (value, index, callback) => iteratee(value, callback); -} -module.exports = exports["default"]; \ No newline at end of file diff --git a/node_modules/async/internal/wrapAsync.js b/node_modules/async/internal/wrapAsync.js deleted file mode 100644 index ad4d619..0000000 --- a/node_modules/async/internal/wrapAsync.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isAsyncIterable = exports.isAsyncGenerator = exports.isAsync = undefined; - -var _asyncify = require('../asyncify.js'); - -var _asyncify2 = _interopRequireDefault(_asyncify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function isAsync(fn) { - return fn[Symbol.toStringTag] === 'AsyncFunction'; -} - -function isAsyncGenerator(fn) { - return fn[Symbol.toStringTag] === 'AsyncGenerator'; -} - -function isAsyncIterable(obj) { - return typeof obj[Symbol.asyncIterator] === 'function'; -} - -function wrapAsync(asyncFn) { - if (typeof asyncFn !== 'function') throw new Error('expected a function'); - return isAsync(asyncFn) ? (0, _asyncify2.default)(asyncFn) : asyncFn; -} - -exports.default = wrapAsync; -exports.isAsync = isAsync; -exports.isAsyncGenerator = isAsyncGenerator; -exports.isAsyncIterable = isAsyncIterable; \ No newline at end of file diff --git a/node_modules/async/log.js b/node_modules/async/log.js deleted file mode 100644 index 8fc1ed5..0000000 --- a/node_modules/async/log.js +++ /dev/null @@ -1,41 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _consoleFunc = require('./internal/consoleFunc.js'); - -var _consoleFunc2 = _interopRequireDefault(_consoleFunc); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Logs the result of an `async` function to the `console`. Only works in - * Node.js or in browsers that support `console.log` and `console.error` (such - * as FF and Chrome). If multiple arguments are returned from the async - * function, `console.log` is called on each argument in order. - * - * @name log - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} function - The function you want to eventually apply - * all arguments to. - * @param {...*} arguments... - Any number of arguments to apply to the function. - * @example - * - * // in a module - * var hello = function(name, callback) { - * setTimeout(function() { - * callback(null, 'hello ' + name); - * }, 1000); - * }; - * - * // in the node repl - * node> async.log(hello, 'world'); - * 'hello world' - */ -exports.default = (0, _consoleFunc2.default)('log'); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/map.js b/node_modules/async/map.js deleted file mode 100644 index ec4135d..0000000 --- a/node_modules/async/map.js +++ /dev/null @@ -1,142 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _map2 = require('./internal/map.js'); - -var _map3 = _interopRequireDefault(_map2); - -var _eachOf = require('./eachOf.js'); - -var _eachOf2 = _interopRequireDefault(_eachOf); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Produces a new collection of values by mapping each value in `coll` through - * the `iteratee` function. The `iteratee` is called with an item from `coll` - * and a callback for when it has finished processing. Each of these callbacks - * takes 2 arguments: an `error`, and the transformed item from `coll`. If - * `iteratee` passes an error to its callback, the main `callback` (for the - * `map` function) is immediately called with the error. - * - * Note, that since this function applies the `iteratee` to each item in - * parallel, there is no guarantee that the `iteratee` functions will complete - * in order. However, the results array will be in the same order as the - * original `coll`. - * - * If `map` is passed an Object, the results will be an Array. The results - * will roughly be in the order of the original Objects' keys (but this can - * vary across JavaScript engines). - * - * @name map - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with the transformed item. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Results is an Array of the - * transformed items from the `coll`. Invoked with (err, results). - * @returns {Promise} a promise, if no callback is passed - * @example - * - * // file1.txt is a file that is 1000 bytes in size - * // file2.txt is a file that is 2000 bytes in size - * // file3.txt is a file that is 3000 bytes in size - * // file4.txt does not exist - * - * const fileList = ['file1.txt','file2.txt','file3.txt']; - * const withMissingFileList = ['file1.txt','file2.txt','file4.txt']; - * - * // asynchronous function that returns the file size in bytes - * function getFileSizeInBytes(file, callback) { - * fs.stat(file, function(err, stat) { - * if (err) { - * return callback(err); - * } - * callback(null, stat.size); - * }); - * } - * - * // Using callbacks - * async.map(fileList, getFileSizeInBytes, function(err, results) { - * if (err) { - * console.log(err); - * } else { - * console.log(results); - * // results is now an array of the file size in bytes for each file, e.g. - * // [ 1000, 2000, 3000] - * } - * }); - * - * // Error Handling - * async.map(withMissingFileList, getFileSizeInBytes, function(err, results) { - * if (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } else { - * console.log(results); - * } - * }); - * - * // Using Promises - * async.map(fileList, getFileSizeInBytes) - * .then( results => { - * console.log(results); - * // results is now an array of the file size in bytes for each file, e.g. - * // [ 1000, 2000, 3000] - * }).catch( err => { - * console.log(err); - * }); - * - * // Error Handling - * async.map(withMissingFileList, getFileSizeInBytes) - * .then( results => { - * console.log(results); - * }).catch( err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * }); - * - * // Using async/await - * async () => { - * try { - * let results = await async.map(fileList, getFileSizeInBytes); - * console.log(results); - * // results is now an array of the file size in bytes for each file, e.g. - * // [ 1000, 2000, 3000] - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // Error Handling - * async () => { - * try { - * let results = await async.map(withMissingFileList, getFileSizeInBytes); - * console.log(results); - * } - * catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } - * } - * - */ -function map(coll, iteratee, callback) { - return (0, _map3.default)(_eachOf2.default, coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(map, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/mapLimit.js b/node_modules/async/mapLimit.js deleted file mode 100644 index b5e461c..0000000 --- a/node_modules/async/mapLimit.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _map2 = require('./internal/map.js'); - -var _map3 = _interopRequireDefault(_map2); - -var _eachOfLimit = require('./internal/eachOfLimit.js'); - -var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`map`]{@link module:Collections.map} but runs a maximum of `limit` async operations at a time. - * - * @name mapLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.map]{@link module:Collections.map} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with the transformed item. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Results is an array of the - * transformed items from the `coll`. Invoked with (err, results). - * @returns {Promise} a promise, if no callback is passed - */ -function mapLimit(coll, limit, iteratee, callback) { - return (0, _map3.default)((0, _eachOfLimit2.default)(limit), coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(mapLimit, 4); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/mapSeries.js b/node_modules/async/mapSeries.js deleted file mode 100644 index 91f36bf..0000000 --- a/node_modules/async/mapSeries.js +++ /dev/null @@ -1,44 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _map2 = require('./internal/map.js'); - -var _map3 = _interopRequireDefault(_map2); - -var _eachOfSeries = require('./eachOfSeries.js'); - -var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`map`]{@link module:Collections.map} but runs only a single async operation at a time. - * - * @name mapSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.map]{@link module:Collections.map} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with the transformed item. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Results is an array of the - * transformed items from the `coll`. Invoked with (err, results). - * @returns {Promise} a promise, if no callback is passed - */ -function mapSeries(coll, iteratee, callback) { - return (0, _map3.default)(_eachOfSeries2.default, coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(mapSeries, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/mapValues.js b/node_modules/async/mapValues.js deleted file mode 100644 index 00da926..0000000 --- a/node_modules/async/mapValues.js +++ /dev/null @@ -1,152 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = mapValues; - -var _mapValuesLimit = require('./mapValuesLimit.js'); - -var _mapValuesLimit2 = _interopRequireDefault(_mapValuesLimit); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * A relative of [`map`]{@link module:Collections.map}, designed for use with objects. - * - * Produces a new Object by mapping each value of `obj` through the `iteratee` - * function. The `iteratee` is called each `value` and `key` from `obj` and a - * callback for when it has finished processing. Each of these callbacks takes - * two arguments: an `error`, and the transformed item from `obj`. If `iteratee` - * passes an error to its callback, the main `callback` (for the `mapValues` - * function) is immediately called with the error. - * - * Note, the order of the keys in the result is not guaranteed. The keys will - * be roughly in the order they complete, (but this is very engine-specific) - * - * @name mapValues - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Object} obj - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each value and key - * in `coll`. - * The iteratee should complete with the transformed value as its result. - * Invoked with (value, key, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. `result` is a new object consisting - * of each key from `obj`, with each transformed value on the right-hand side. - * Invoked with (err, result). - * @returns {Promise} a promise, if no callback is passed - * @example - * - * // file1.txt is a file that is 1000 bytes in size - * // file2.txt is a file that is 2000 bytes in size - * // file3.txt is a file that is 3000 bytes in size - * // file4.txt does not exist - * - * const fileMap = { - * f1: 'file1.txt', - * f2: 'file2.txt', - * f3: 'file3.txt' - * }; - * - * const withMissingFileMap = { - * f1: 'file1.txt', - * f2: 'file2.txt', - * f3: 'file4.txt' - * }; - * - * // asynchronous function that returns the file size in bytes - * function getFileSizeInBytes(file, key, callback) { - * fs.stat(file, function(err, stat) { - * if (err) { - * return callback(err); - * } - * callback(null, stat.size); - * }); - * } - * - * // Using callbacks - * async.mapValues(fileMap, getFileSizeInBytes, function(err, result) { - * if (err) { - * console.log(err); - * } else { - * console.log(result); - * // result is now a map of file size in bytes for each file, e.g. - * // { - * // f1: 1000, - * // f2: 2000, - * // f3: 3000 - * // } - * } - * }); - * - * // Error handling - * async.mapValues(withMissingFileMap, getFileSizeInBytes, function(err, result) { - * if (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } else { - * console.log(result); - * } - * }); - * - * // Using Promises - * async.mapValues(fileMap, getFileSizeInBytes) - * .then( result => { - * console.log(result); - * // result is now a map of file size in bytes for each file, e.g. - * // { - * // f1: 1000, - * // f2: 2000, - * // f3: 3000 - * // } - * }).catch (err => { - * console.log(err); - * }); - * - * // Error Handling - * async.mapValues(withMissingFileMap, getFileSizeInBytes) - * .then( result => { - * console.log(result); - * }).catch (err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.mapValues(fileMap, getFileSizeInBytes); - * console.log(result); - * // result is now a map of file size in bytes for each file, e.g. - * // { - * // f1: 1000, - * // f2: 2000, - * // f3: 3000 - * // } - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // Error Handling - * async () => { - * try { - * let result = await async.mapValues(withMissingFileMap, getFileSizeInBytes); - * console.log(result); - * } - * catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } - * } - * - */ -function mapValues(obj, iteratee, callback) { - return (0, _mapValuesLimit2.default)(obj, Infinity, iteratee, callback); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/mapValuesLimit.js b/node_modules/async/mapValuesLimit.js deleted file mode 100644 index 93066ee..0000000 --- a/node_modules/async/mapValuesLimit.js +++ /dev/null @@ -1,61 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _eachOfLimit = require('./internal/eachOfLimit.js'); - -var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -var _once = require('./internal/once.js'); - -var _once2 = _interopRequireDefault(_once); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`mapValues`]{@link module:Collections.mapValues} but runs a maximum of `limit` async operations at a - * time. - * - * @name mapValuesLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.mapValues]{@link module:Collections.mapValues} - * @category Collection - * @param {Object} obj - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - A function to apply to each value and key - * in `coll`. - * The iteratee should complete with the transformed value as its result. - * Invoked with (value, key, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. `result` is a new object consisting - * of each key from `obj`, with each transformed value on the right-hand side. - * Invoked with (err, result). - * @returns {Promise} a promise, if no callback is passed - */ -function mapValuesLimit(obj, limit, iteratee, callback) { - callback = (0, _once2.default)(callback); - var newObj = {}; - var _iteratee = (0, _wrapAsync2.default)(iteratee); - return (0, _eachOfLimit2.default)(limit)(obj, (val, key, next) => { - _iteratee(val, key, (err, result) => { - if (err) return next(err); - newObj[key] = result; - next(err); - }); - }, err => callback(err, newObj)); -} - -exports.default = (0, _awaitify2.default)(mapValuesLimit, 4); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/mapValuesSeries.js b/node_modules/async/mapValuesSeries.js deleted file mode 100644 index 560058a..0000000 --- a/node_modules/async/mapValuesSeries.js +++ /dev/null @@ -1,37 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = mapValuesSeries; - -var _mapValuesLimit = require('./mapValuesLimit.js'); - -var _mapValuesLimit2 = _interopRequireDefault(_mapValuesLimit); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`mapValues`]{@link module:Collections.mapValues} but runs only a single async operation at a time. - * - * @name mapValuesSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.mapValues]{@link module:Collections.mapValues} - * @category Collection - * @param {Object} obj - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each value and key - * in `coll`. - * The iteratee should complete with the transformed value as its result. - * Invoked with (value, key, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. `result` is a new object consisting - * of each key from `obj`, with each transformed value on the right-hand side. - * Invoked with (err, result). - * @returns {Promise} a promise, if no callback is passed - */ -function mapValuesSeries(obj, iteratee, callback) { - return (0, _mapValuesLimit2.default)(obj, 1, iteratee, callback); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/memoize.js b/node_modules/async/memoize.js deleted file mode 100644 index 6003e41..0000000 --- a/node_modules/async/memoize.js +++ /dev/null @@ -1,91 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = memoize; - -var _setImmediate = require('./internal/setImmediate.js'); - -var _setImmediate2 = _interopRequireDefault(_setImmediate); - -var _initialParams = require('./internal/initialParams.js'); - -var _initialParams2 = _interopRequireDefault(_initialParams); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Caches the results of an async function. When creating a hash to store - * function results against, the callback is omitted from the hash and an - * optional hash function can be used. - * - * **Note: if the async function errs, the result will not be cached and - * subsequent calls will call the wrapped function.** - * - * If no hash function is specified, the first argument is used as a hash key, - * which may work reasonably if it is a string or a data type that converts to a - * distinct string. Note that objects and arrays will not behave reasonably. - * Neither will cases where the other arguments are significant. In such cases, - * specify your own hash function. - * - * The cache of results is exposed as the `memo` property of the function - * returned by `memoize`. - * - * @name memoize - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} fn - The async function to proxy and cache results from. - * @param {Function} hasher - An optional function for generating a custom hash - * for storing results. It has all the arguments applied to it apart from the - * callback, and must be synchronous. - * @returns {AsyncFunction} a memoized version of `fn` - * @example - * - * var slow_fn = function(name, callback) { - * // do something - * callback(null, result); - * }; - * var fn = async.memoize(slow_fn); - * - * // fn can now be used as if it were slow_fn - * fn('some name', function() { - * // callback - * }); - */ -function memoize(fn, hasher = v => v) { - var memo = Object.create(null); - var queues = Object.create(null); - var _fn = (0, _wrapAsync2.default)(fn); - var memoized = (0, _initialParams2.default)((args, callback) => { - var key = hasher(...args); - if (key in memo) { - (0, _setImmediate2.default)(() => callback(null, ...memo[key])); - } else if (key in queues) { - queues[key].push(callback); - } else { - queues[key] = [callback]; - _fn(...args, (err, ...resultArgs) => { - // #1465 don't memoize if an error occurred - if (!err) { - memo[key] = resultArgs; - } - var q = queues[key]; - delete queues[key]; - for (var i = 0, l = q.length; i < l; i++) { - q[i](err, ...resultArgs); - } - }); - } - }); - memoized.memo = memo; - memoized.unmemoized = fn; - return memoized; -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/nextTick.js b/node_modules/async/nextTick.js deleted file mode 100644 index e6d321b..0000000 --- a/node_modules/async/nextTick.js +++ /dev/null @@ -1,52 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _setImmediate = require('./internal/setImmediate.js'); - -/** - * Calls `callback` on a later loop around the event loop. In Node.js this just - * calls `process.nextTick`. In the browser it will use `setImmediate` if - * available, otherwise `setTimeout(callback, 0)`, which means other higher - * priority events may precede the execution of `callback`. - * - * This is used internally for browser-compatibility purposes. - * - * @name nextTick - * @static - * @memberOf module:Utils - * @method - * @see [async.setImmediate]{@link module:Utils.setImmediate} - * @category Util - * @param {Function} callback - The function to call on a later loop around - * the event loop. Invoked with (args...). - * @param {...*} args... - any number of additional arguments to pass to the - * callback on the next tick. - * @example - * - * var call_order = []; - * async.nextTick(function() { - * call_order.push('two'); - * // call_order now equals ['one','two'] - * }); - * call_order.push('one'); - * - * async.setImmediate(function (a, b, c) { - * // a, b, and c equal 1, 2, and 3 - * }, 1, 2, 3); - */ -var _defer; /* istanbul ignore file */ - - -if (_setImmediate.hasNextTick) { - _defer = process.nextTick; -} else if (_setImmediate.hasSetImmediate) { - _defer = setImmediate; -} else { - _defer = _setImmediate.fallback; -} - -exports.default = (0, _setImmediate.wrap)(_defer); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/package.json b/node_modules/async/package.json deleted file mode 100644 index 9c464bc..0000000 --- a/node_modules/async/package.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "name": "async", - "description": "Higher-order functions and common patterns for asynchronous code", - "version": "3.2.4", - "main": "dist/async.js", - "author": "Caolan McMahon", - "homepage": "https://caolan.github.io/async/", - "repository": { - "type": "git", - "url": "https://github.com/caolan/async.git" - }, - "bugs": { - "url": "https://github.com/caolan/async/issues" - }, - "keywords": [ - "async", - "callback", - "module", - "utility" - ], - "devDependencies": { - "@babel/eslint-parser": "^7.16.5", - "babel-core": "^6.26.3", - "babel-minify": "^0.5.0", - "babel-plugin-add-module-exports": "^1.0.4", - "babel-plugin-istanbul": "^6.1.1", - "babel-plugin-syntax-async-generators": "^6.13.0", - "babel-plugin-transform-es2015-modules-commonjs": "^6.26.2", - "babel-preset-es2015": "^6.3.13", - "babel-preset-es2017": "^6.22.0", - "babel-register": "^6.26.0", - "babelify": "^10.0.0", - "benchmark": "^2.1.1", - "bluebird": "^3.4.6", - "browserify": "^17.0.0", - "chai": "^4.2.0", - "cheerio": "^0.22.0", - "es6-promise": "^4.2.8", - "eslint": "^8.6.0", - "eslint-plugin-prefer-arrow": "^1.2.3", - "fs-extra": "^10.0.0", - "jsdoc": "^3.6.2", - "karma": "^6.3.12", - "karma-browserify": "^8.1.0", - "karma-firefox-launcher": "^2.1.2", - "karma-mocha": "^2.0.1", - "karma-mocha-reporter": "^2.2.0", - "karma-safari-launcher": "^1.0.0", - "mocha": "^6.1.4", - "native-promise-only": "^0.8.0-a", - "nyc": "^15.1.0", - "rollup": "^2.66.1", - "rollup-plugin-node-resolve": "^5.2.0", - "rollup-plugin-npm": "^2.0.0", - "rsvp": "^4.8.5", - "semver": "^7.3.5", - "yargs": "^17.3.1" - }, - "scripts": { - "coverage": "nyc npm run mocha-node-test -- --grep @nycinvalid --invert", - "jsdoc": "jsdoc -c ./support/jsdoc/jsdoc.json && node support/jsdoc/jsdoc-fix-html.js", - "lint": "eslint --fix .", - "mocha-browser-test": "karma start", - "mocha-node-test": "mocha", - "mocha-test": "npm run mocha-node-test && npm run mocha-browser-test", - "test": "npm run lint && npm run mocha-node-test" - }, - "license": "MIT", - "nyc": { - "exclude": [ - "test" - ] - }, - "module": "dist/async.mjs" -} \ No newline at end of file diff --git a/node_modules/async/parallel.js b/node_modules/async/parallel.js deleted file mode 100644 index 76bc624..0000000 --- a/node_modules/async/parallel.js +++ /dev/null @@ -1,180 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = parallel; - -var _eachOf = require('./eachOf.js'); - -var _eachOf2 = _interopRequireDefault(_eachOf); - -var _parallel2 = require('./internal/parallel.js'); - -var _parallel3 = _interopRequireDefault(_parallel2); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Run the `tasks` collection of functions in parallel, without waiting until - * the previous function has completed. If any of the functions pass an error to - * its callback, the main `callback` is immediately called with the value of the - * error. Once the `tasks` have completed, the results are passed to the final - * `callback` as an array. - * - * **Note:** `parallel` is about kicking-off I/O tasks in parallel, not about - * parallel execution of code. If your tasks do not use any timers or perform - * any I/O, they will actually be executed in series. Any synchronous setup - * sections for each task will happen one after the other. JavaScript remains - * single-threaded. - * - * **Hint:** Use [`reflect`]{@link module:Utils.reflect} to continue the - * execution of other tasks when a task fails. - * - * It is also possible to use an object instead of an array. Each property will - * be run as a function and the results will be passed to the final `callback` - * as an object instead of an array. This can be a more readable way of handling - * results from {@link async.parallel}. - * - * @name parallel - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection of - * [async functions]{@link AsyncFunction} to run. - * Each async function can complete with any number of optional `result` values. - * @param {Function} [callback] - An optional callback to run once all the - * functions have completed successfully. This function gets a results array - * (or object) containing all the result arguments passed to the task callbacks. - * Invoked with (err, results). - * @returns {Promise} a promise, if a callback is not passed - * - * @example - * - * //Using Callbacks - * async.parallel([ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ], function(err, results) { - * console.log(results); - * // results is equal to ['one','two'] even though - * // the second function had a shorter timeout. - * }); - * - * // an example using an object instead of an array - * async.parallel({ - * one: function(callback) { - * setTimeout(function() { - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * callback(null, 2); - * }, 100); - * } - * }, function(err, results) { - * console.log(results); - * // results is equal to: { one: 1, two: 2 } - * }); - * - * //Using Promises - * async.parallel([ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ]).then(results => { - * console.log(results); - * // results is equal to ['one','two'] even though - * // the second function had a shorter timeout. - * }).catch(err => { - * console.log(err); - * }); - * - * // an example using an object instead of an array - * async.parallel({ - * one: function(callback) { - * setTimeout(function() { - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * callback(null, 2); - * }, 100); - * } - * }).then(results => { - * console.log(results); - * // results is equal to: { one: 1, two: 2 } - * }).catch(err => { - * console.log(err); - * }); - * - * //Using async/await - * async () => { - * try { - * let results = await async.parallel([ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ]); - * console.log(results); - * // results is equal to ['one','two'] even though - * // the second function had a shorter timeout. - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // an example using an object instead of an array - * async () => { - * try { - * let results = await async.parallel({ - * one: function(callback) { - * setTimeout(function() { - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * callback(null, 2); - * }, 100); - * } - * }); - * console.log(results); - * // results is equal to: { one: 1, two: 2 } - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function parallel(tasks, callback) { - return (0, _parallel3.default)(_eachOf2.default, tasks, callback); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/parallelLimit.js b/node_modules/async/parallelLimit.js deleted file mode 100644 index dbe0bb8..0000000 --- a/node_modules/async/parallelLimit.js +++ /dev/null @@ -1,41 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = parallelLimit; - -var _eachOfLimit = require('./internal/eachOfLimit.js'); - -var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); - -var _parallel = require('./internal/parallel.js'); - -var _parallel2 = _interopRequireDefault(_parallel); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`parallel`]{@link module:ControlFlow.parallel} but runs a maximum of `limit` async operations at a - * time. - * - * @name parallelLimit - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.parallel]{@link module:ControlFlow.parallel} - * @category Control Flow - * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection of - * [async functions]{@link AsyncFunction} to run. - * Each async function can complete with any number of optional `result` values. - * @param {number} limit - The maximum number of async operations at a time. - * @param {Function} [callback] - An optional callback to run once all the - * functions have completed successfully. This function gets a results array - * (or object) containing all the result arguments passed to the task callbacks. - * Invoked with (err, results). - * @returns {Promise} a promise, if a callback is not passed - */ -function parallelLimit(tasks, limit, callback) { - return (0, _parallel2.default)((0, _eachOfLimit2.default)(limit), tasks, callback); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/priorityQueue.js b/node_modules/async/priorityQueue.js deleted file mode 100644 index 6006f66..0000000 --- a/node_modules/async/priorityQueue.js +++ /dev/null @@ -1,86 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -exports.default = function (worker, concurrency) { - // Start with a normal queue - var q = (0, _queue2.default)(worker, concurrency); - - var { - push, - pushAsync - } = q; - - q._tasks = new _Heap2.default(); - q._createTaskItem = ({ data, priority }, callback) => { - return { - data, - priority, - callback - }; - }; - - function createDataItems(tasks, priority) { - if (!Array.isArray(tasks)) { - return { data: tasks, priority }; - } - return tasks.map(data => { - return { data, priority }; - }); - } - - // Override push to accept second parameter representing priority - q.push = function (data, priority = 0, callback) { - return push(createDataItems(data, priority), callback); - }; - - q.pushAsync = function (data, priority = 0, callback) { - return pushAsync(createDataItems(data, priority), callback); - }; - - // Remove unshift functions - delete q.unshift; - delete q.unshiftAsync; - - return q; -}; - -var _queue = require('./queue.js'); - -var _queue2 = _interopRequireDefault(_queue); - -var _Heap = require('./internal/Heap.js'); - -var _Heap2 = _interopRequireDefault(_Heap); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -module.exports = exports['default']; - -/** - * The same as [async.queue]{@link module:ControlFlow.queue} only tasks are assigned a priority and - * completed in ascending priority order. - * - * @name priorityQueue - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.queue]{@link module:ControlFlow.queue} - * @category Control Flow - * @param {AsyncFunction} worker - An async function for processing a queued task. - * If you want to handle errors from an individual task, pass a callback to - * `q.push()`. - * Invoked with (task, callback). - * @param {number} concurrency - An `integer` for determining how many `worker` - * functions should be run in parallel. If omitted, the concurrency defaults to - * `1`. If the concurrency is `0`, an error is thrown. - * @returns {module:ControlFlow.QueueObject} A priorityQueue object to manage the tasks. There are three - * differences between `queue` and `priorityQueue` objects: - * * `push(task, priority, [callback])` - `priority` should be a number. If an - * array of `tasks` is given, all tasks will be assigned the same priority. - * * `pushAsync(task, priority, [callback])` - the same as `priorityQueue.push`, - * except this returns a promise that rejects if an error occurs. - * * The `unshift` and `unshiftAsync` methods were removed. - */ \ No newline at end of file diff --git a/node_modules/async/queue.js b/node_modules/async/queue.js deleted file mode 100644 index c69becb..0000000 --- a/node_modules/async/queue.js +++ /dev/null @@ -1,167 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -exports.default = function (worker, concurrency) { - var _worker = (0, _wrapAsync2.default)(worker); - return (0, _queue2.default)((items, cb) => { - _worker(items[0], cb); - }, concurrency, 1); -}; - -var _queue = require('./internal/queue.js'); - -var _queue2 = _interopRequireDefault(_queue); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -module.exports = exports['default']; - -/** - * A queue of tasks for the worker function to complete. - * @typedef {Iterable} QueueObject - * @memberOf module:ControlFlow - * @property {Function} length - a function returning the number of items - * waiting to be processed. Invoke with `queue.length()`. - * @property {boolean} started - a boolean indicating whether or not any - * items have been pushed and processed by the queue. - * @property {Function} running - a function returning the number of items - * currently being processed. Invoke with `queue.running()`. - * @property {Function} workersList - a function returning the array of items - * currently being processed. Invoke with `queue.workersList()`. - * @property {Function} idle - a function returning false if there are items - * waiting or being processed, or true if not. Invoke with `queue.idle()`. - * @property {number} concurrency - an integer for determining how many `worker` - * functions should be run in parallel. This property can be changed after a - * `queue` is created to alter the concurrency on-the-fly. - * @property {number} payload - an integer that specifies how many items are - * passed to the worker function at a time. only applies if this is a - * [cargo]{@link module:ControlFlow.cargo} object - * @property {AsyncFunction} push - add a new task to the `queue`. Calls `callback` - * once the `worker` has finished processing the task. Instead of a single task, - * a `tasks` array can be submitted. The respective callback is used for every - * task in the list. Invoke with `queue.push(task, [callback])`, - * @property {AsyncFunction} unshift - add a new task to the front of the `queue`. - * Invoke with `queue.unshift(task, [callback])`. - * @property {AsyncFunction} pushAsync - the same as `q.push`, except this returns - * a promise that rejects if an error occurs. - * @property {AsyncFunction} unshiftAsync - the same as `q.unshift`, except this returns - * a promise that rejects if an error occurs. - * @property {Function} remove - remove items from the queue that match a test - * function. The test function will be passed an object with a `data` property, - * and a `priority` property, if this is a - * [priorityQueue]{@link module:ControlFlow.priorityQueue} object. - * Invoked with `queue.remove(testFn)`, where `testFn` is of the form - * `function ({data, priority}) {}` and returns a Boolean. - * @property {Function} saturated - a function that sets a callback that is - * called when the number of running workers hits the `concurrency` limit, and - * further tasks will be queued. If the callback is omitted, `q.saturated()` - * returns a promise for the next occurrence. - * @property {Function} unsaturated - a function that sets a callback that is - * called when the number of running workers is less than the `concurrency` & - * `buffer` limits, and further tasks will not be queued. If the callback is - * omitted, `q.unsaturated()` returns a promise for the next occurrence. - * @property {number} buffer - A minimum threshold buffer in order to say that - * the `queue` is `unsaturated`. - * @property {Function} empty - a function that sets a callback that is called - * when the last item from the `queue` is given to a `worker`. If the callback - * is omitted, `q.empty()` returns a promise for the next occurrence. - * @property {Function} drain - a function that sets a callback that is called - * when the last item from the `queue` has returned from the `worker`. If the - * callback is omitted, `q.drain()` returns a promise for the next occurrence. - * @property {Function} error - a function that sets a callback that is called - * when a task errors. Has the signature `function(error, task)`. If the - * callback is omitted, `error()` returns a promise that rejects on the next - * error. - * @property {boolean} paused - a boolean for determining whether the queue is - * in a paused state. - * @property {Function} pause - a function that pauses the processing of tasks - * until `resume()` is called. Invoke with `queue.pause()`. - * @property {Function} resume - a function that resumes the processing of - * queued tasks when the queue is paused. Invoke with `queue.resume()`. - * @property {Function} kill - a function that removes the `drain` callback and - * empties remaining tasks from the queue forcing it to go idle. No more tasks - * should be pushed to the queue after calling this function. Invoke with `queue.kill()`. - * - * @example - * const q = async.queue(worker, 2) - * q.push(item1) - * q.push(item2) - * q.push(item3) - * // queues are iterable, spread into an array to inspect - * const items = [...q] // [item1, item2, item3] - * // or use for of - * for (let item of q) { - * console.log(item) - * } - * - * q.drain(() => { - * console.log('all done') - * }) - * // or - * await q.drain() - */ - -/** - * Creates a `queue` object with the specified `concurrency`. Tasks added to the - * `queue` are processed in parallel (up to the `concurrency` limit). If all - * `worker`s are in progress, the task is queued until one becomes available. - * Once a `worker` completes a `task`, that `task`'s callback is called. - * - * @name queue - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {AsyncFunction} worker - An async function for processing a queued task. - * If you want to handle errors from an individual task, pass a callback to - * `q.push()`. Invoked with (task, callback). - * @param {number} [concurrency=1] - An `integer` for determining how many - * `worker` functions should be run in parallel. If omitted, the concurrency - * defaults to `1`. If the concurrency is `0`, an error is thrown. - * @returns {module:ControlFlow.QueueObject} A queue object to manage the tasks. Callbacks can be - * attached as certain properties to listen for specific events during the - * lifecycle of the queue. - * @example - * - * // create a queue object with concurrency 2 - * var q = async.queue(function(task, callback) { - * console.log('hello ' + task.name); - * callback(); - * }, 2); - * - * // assign a callback - * q.drain(function() { - * console.log('all items have been processed'); - * }); - * // or await the end - * await q.drain() - * - * // assign an error callback - * q.error(function(err, task) { - * console.error('task experienced an error'); - * }); - * - * // add some items to the queue - * q.push({name: 'foo'}, function(err) { - * console.log('finished processing foo'); - * }); - * // callback is optional - * q.push({name: 'bar'}); - * - * // add some items to the queue (batch-wise) - * q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function(err) { - * console.log('finished processing item'); - * }); - * - * // add some items to the front of the queue - * q.unshift({name: 'bar'}, function (err) { - * console.log('finished processing bar'); - * }); - */ \ No newline at end of file diff --git a/node_modules/async/race.js b/node_modules/async/race.js deleted file mode 100644 index 9595d88..0000000 --- a/node_modules/async/race.js +++ /dev/null @@ -1,67 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _once = require('./internal/once.js'); - -var _once2 = _interopRequireDefault(_once); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Runs the `tasks` array of functions in parallel, without waiting until the - * previous function has completed. Once any of the `tasks` complete or pass an - * error to its callback, the main `callback` is immediately called. It's - * equivalent to `Promise.race()`. - * - * @name race - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array} tasks - An array containing [async functions]{@link AsyncFunction} - * to run. Each function can complete with an optional `result` value. - * @param {Function} callback - A callback to run once any of the functions have - * completed. This function gets an error or result from the first function that - * completed. Invoked with (err, result). - * @returns {Promise} a promise, if a callback is omitted - * @example - * - * async.race([ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ], - * // main callback - * function(err, result) { - * // the result will be equal to 'two' as it finishes earlier - * }); - */ -function race(tasks, callback) { - callback = (0, _once2.default)(callback); - if (!Array.isArray(tasks)) return callback(new TypeError('First argument to race must be an array of functions')); - if (!tasks.length) return callback(); - for (var i = 0, l = tasks.length; i < l; i++) { - (0, _wrapAsync2.default)(tasks[i])(callback); - } -} - -exports.default = (0, _awaitify2.default)(race, 2); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/reduce.js b/node_modules/async/reduce.js deleted file mode 100644 index 56e2db8..0000000 --- a/node_modules/async/reduce.js +++ /dev/null @@ -1,153 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _eachOfSeries = require('./eachOfSeries.js'); - -var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); - -var _once = require('./internal/once.js'); - -var _once2 = _interopRequireDefault(_once); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Reduces `coll` into a single value using an async `iteratee` to return each - * successive step. `memo` is the initial state of the reduction. This function - * only operates in series. - * - * For performance reasons, it may make sense to split a call to this function - * into a parallel map, and then use the normal `Array.prototype.reduce` on the - * results. This function is for situations where each step in the reduction - * needs to be async; if you can get the data before reducing it, then it's - * probably a good idea to do so. - * - * @name reduce - * @static - * @memberOf module:Collections - * @method - * @alias inject - * @alias foldl - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {*} memo - The initial state of the reduction. - * @param {AsyncFunction} iteratee - A function applied to each item in the - * array to produce the next step in the reduction. - * The `iteratee` should complete with the next state of the reduction. - * If the iteratee completes with an error, the reduction is stopped and the - * main `callback` is immediately called with the error. - * Invoked with (memo, item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result is the reduced value. Invoked with - * (err, result). - * @returns {Promise} a promise, if no callback is passed - * @example - * - * // file1.txt is a file that is 1000 bytes in size - * // file2.txt is a file that is 2000 bytes in size - * // file3.txt is a file that is 3000 bytes in size - * // file4.txt does not exist - * - * const fileList = ['file1.txt','file2.txt','file3.txt']; - * const withMissingFileList = ['file1.txt','file2.txt','file3.txt', 'file4.txt']; - * - * // asynchronous function that computes the file size in bytes - * // file size is added to the memoized value, then returned - * function getFileSizeInBytes(memo, file, callback) { - * fs.stat(file, function(err, stat) { - * if (err) { - * return callback(err); - * } - * callback(null, memo + stat.size); - * }); - * } - * - * // Using callbacks - * async.reduce(fileList, 0, getFileSizeInBytes, function(err, result) { - * if (err) { - * console.log(err); - * } else { - * console.log(result); - * // 6000 - * // which is the sum of the file sizes of the three files - * } - * }); - * - * // Error Handling - * async.reduce(withMissingFileList, 0, getFileSizeInBytes, function(err, result) { - * if (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } else { - * console.log(result); - * } - * }); - * - * // Using Promises - * async.reduce(fileList, 0, getFileSizeInBytes) - * .then( result => { - * console.log(result); - * // 6000 - * // which is the sum of the file sizes of the three files - * }).catch( err => { - * console.log(err); - * }); - * - * // Error Handling - * async.reduce(withMissingFileList, 0, getFileSizeInBytes) - * .then( result => { - * console.log(result); - * }).catch( err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.reduce(fileList, 0, getFileSizeInBytes); - * console.log(result); - * // 6000 - * // which is the sum of the file sizes of the three files - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // Error Handling - * async () => { - * try { - * let result = await async.reduce(withMissingFileList, 0, getFileSizeInBytes); - * console.log(result); - * } - * catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } - * } - * - */ -function reduce(coll, memo, iteratee, callback) { - callback = (0, _once2.default)(callback); - var _iteratee = (0, _wrapAsync2.default)(iteratee); - return (0, _eachOfSeries2.default)(coll, (x, i, iterCb) => { - _iteratee(memo, x, (err, v) => { - memo = v; - iterCb(err); - }); - }, err => callback(err, memo)); -} -exports.default = (0, _awaitify2.default)(reduce, 4); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/reduceRight.js b/node_modules/async/reduceRight.js deleted file mode 100644 index bee5391..0000000 --- a/node_modules/async/reduceRight.js +++ /dev/null @@ -1,41 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = reduceRight; - -var _reduce = require('./reduce.js'); - -var _reduce2 = _interopRequireDefault(_reduce); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Same as [`reduce`]{@link module:Collections.reduce}, only operates on `array` in reverse order. - * - * @name reduceRight - * @static - * @memberOf module:Collections - * @method - * @see [async.reduce]{@link module:Collections.reduce} - * @alias foldr - * @category Collection - * @param {Array} array - A collection to iterate over. - * @param {*} memo - The initial state of the reduction. - * @param {AsyncFunction} iteratee - A function applied to each item in the - * array to produce the next step in the reduction. - * The `iteratee` should complete with the next state of the reduction. - * If the iteratee completes with an error, the reduction is stopped and the - * main `callback` is immediately called with the error. - * Invoked with (memo, item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result is the reduced value. Invoked with - * (err, result). - * @returns {Promise} a promise, if no callback is passed - */ -function reduceRight(array, memo, iteratee, callback) { - var reversed = [...array].reverse(); - return (0, _reduce2.default)(reversed, memo, iteratee, callback); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/reflect.js b/node_modules/async/reflect.js deleted file mode 100644 index 297ed79..0000000 --- a/node_modules/async/reflect.js +++ /dev/null @@ -1,78 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = reflect; - -var _initialParams = require('./internal/initialParams.js'); - -var _initialParams2 = _interopRequireDefault(_initialParams); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Wraps the async function in another function that always completes with a - * result object, even when it errors. - * - * The result object has either the property `error` or `value`. - * - * @name reflect - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} fn - The async function you want to wrap - * @returns {Function} - A function that always passes null to it's callback as - * the error. The second argument to the callback will be an `object` with - * either an `error` or a `value` property. - * @example - * - * async.parallel([ - * async.reflect(function(callback) { - * // do some stuff ... - * callback(null, 'one'); - * }), - * async.reflect(function(callback) { - * // do some more stuff but error ... - * callback('bad stuff happened'); - * }), - * async.reflect(function(callback) { - * // do some more stuff ... - * callback(null, 'two'); - * }) - * ], - * // optional callback - * function(err, results) { - * // values - * // results[0].value = 'one' - * // results[1].error = 'bad stuff happened' - * // results[2].value = 'two' - * }); - */ -function reflect(fn) { - var _fn = (0, _wrapAsync2.default)(fn); - return (0, _initialParams2.default)(function reflectOn(args, reflectCallback) { - args.push((error, ...cbArgs) => { - let retVal = {}; - if (error) { - retVal.error = error; - } - if (cbArgs.length > 0) { - var value = cbArgs; - if (cbArgs.length <= 1) { - [value] = cbArgs; - } - retVal.value = value; - } - reflectCallback(null, retVal); - }); - - return _fn.apply(this, args); - }); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/reflectAll.js b/node_modules/async/reflectAll.js deleted file mode 100644 index a862ff0..0000000 --- a/node_modules/async/reflectAll.js +++ /dev/null @@ -1,93 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = reflectAll; - -var _reflect = require('./reflect.js'); - -var _reflect2 = _interopRequireDefault(_reflect); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * A helper function that wraps an array or an object of functions with `reflect`. - * - * @name reflectAll - * @static - * @memberOf module:Utils - * @method - * @see [async.reflect]{@link module:Utils.reflect} - * @category Util - * @param {Array|Object|Iterable} tasks - The collection of - * [async functions]{@link AsyncFunction} to wrap in `async.reflect`. - * @returns {Array} Returns an array of async functions, each wrapped in - * `async.reflect` - * @example - * - * let tasks = [ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * // do some more stuff but error ... - * callback(new Error('bad stuff happened')); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ]; - * - * async.parallel(async.reflectAll(tasks), - * // optional callback - * function(err, results) { - * // values - * // results[0].value = 'one' - * // results[1].error = Error('bad stuff happened') - * // results[2].value = 'two' - * }); - * - * // an example using an object instead of an array - * let tasks = { - * one: function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * two: function(callback) { - * callback('two'); - * }, - * three: function(callback) { - * setTimeout(function() { - * callback(null, 'three'); - * }, 100); - * } - * }; - * - * async.parallel(async.reflectAll(tasks), - * // optional callback - * function(err, results) { - * // values - * // results.one.value = 'one' - * // results.two.error = 'two' - * // results.three.value = 'three' - * }); - */ -function reflectAll(tasks) { - var results; - if (Array.isArray(tasks)) { - results = tasks.map(_reflect2.default); - } else { - results = {}; - Object.keys(tasks).forEach(key => { - results[key] = _reflect2.default.call(this, tasks[key]); - }); - } - return results; -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/reject.js b/node_modules/async/reject.js deleted file mode 100644 index cabd96e..0000000 --- a/node_modules/async/reject.js +++ /dev/null @@ -1,87 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _reject2 = require('./internal/reject.js'); - -var _reject3 = _interopRequireDefault(_reject2); - -var _eachOf = require('./eachOf.js'); - -var _eachOf2 = _interopRequireDefault(_eachOf); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The opposite of [`filter`]{@link module:Collections.filter}. Removes values that pass an `async` truth test. - * - * @name reject - * @static - * @memberOf module:Collections - * @method - * @see [async.filter]{@link module:Collections.filter} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {Function} iteratee - An async truth test to apply to each item in - * `coll`. - * The should complete with a boolean value as its `result`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @returns {Promise} a promise, if no callback is passed - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * - * const fileList = ['dir1/file1.txt','dir2/file3.txt','dir3/file6.txt']; - * - * // asynchronous function that checks if a file exists - * function fileExists(file, callback) { - * fs.access(file, fs.constants.F_OK, (err) => { - * callback(null, !err); - * }); - * } - * - * // Using callbacks - * async.reject(fileList, fileExists, function(err, results) { - * // [ 'dir3/file6.txt' ] - * // results now equals an array of the non-existing files - * }); - * - * // Using Promises - * async.reject(fileList, fileExists) - * .then( results => { - * console.log(results); - * // [ 'dir3/file6.txt' ] - * // results now equals an array of the non-existing files - * }).catch( err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let results = await async.reject(fileList, fileExists); - * console.log(results); - * // [ 'dir3/file6.txt' ] - * // results now equals an array of the non-existing files - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function reject(coll, iteratee, callback) { - return (0, _reject3.default)(_eachOf2.default, coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(reject, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/rejectLimit.js b/node_modules/async/rejectLimit.js deleted file mode 100644 index 1a89925..0000000 --- a/node_modules/async/rejectLimit.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _reject2 = require('./internal/reject.js'); - -var _reject3 = _interopRequireDefault(_reject2); - -var _eachOfLimit = require('./internal/eachOfLimit.js'); - -var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`reject`]{@link module:Collections.reject} but runs a maximum of `limit` async operations at a - * time. - * - * @name rejectLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.reject]{@link module:Collections.reject} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {Function} iteratee - An async truth test to apply to each item in - * `coll`. - * The should complete with a boolean value as its `result`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @returns {Promise} a promise, if no callback is passed - */ -function rejectLimit(coll, limit, iteratee, callback) { - return (0, _reject3.default)((0, _eachOfLimit2.default)(limit), coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(rejectLimit, 4); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/rejectSeries.js b/node_modules/async/rejectSeries.js deleted file mode 100644 index 6e1a1c5..0000000 --- a/node_modules/async/rejectSeries.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _reject2 = require('./internal/reject.js'); - -var _reject3 = _interopRequireDefault(_reject2); - -var _eachOfSeries = require('./eachOfSeries.js'); - -var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`reject`]{@link module:Collections.reject} but runs only a single async operation at a time. - * - * @name rejectSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.reject]{@link module:Collections.reject} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {Function} iteratee - An async truth test to apply to each item in - * `coll`. - * The should complete with a boolean value as its `result`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @returns {Promise} a promise, if no callback is passed - */ -function rejectSeries(coll, iteratee, callback) { - return (0, _reject3.default)(_eachOfSeries2.default, coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(rejectSeries, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/retry.js b/node_modules/async/retry.js deleted file mode 100644 index dba3030..0000000 --- a/node_modules/async/retry.js +++ /dev/null @@ -1,159 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = retry; - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _promiseCallback = require('./internal/promiseCallback.js'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function constant(value) { - return function () { - return value; - }; -} - -/** - * Attempts to get a successful response from `task` no more than `times` times - * before returning an error. If the task is successful, the `callback` will be - * passed the result of the successful task. If all attempts fail, the callback - * will be passed the error and result (if any) of the final attempt. - * - * @name retry - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @see [async.retryable]{@link module:ControlFlow.retryable} - * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - Can be either an - * object with `times` and `interval` or a number. - * * `times` - The number of attempts to make before giving up. The default - * is `5`. - * * `interval` - The time to wait between retries, in milliseconds. The - * default is `0`. The interval may also be specified as a function of the - * retry count (see example). - * * `errorFilter` - An optional synchronous function that is invoked on - * erroneous result. If it returns `true` the retry attempts will continue; - * if the function returns `false` the retry flow is aborted with the current - * attempt's error and result being returned to the final callback. - * Invoked with (err). - * * If `opts` is a number, the number specifies the number of times to retry, - * with the default interval of `0`. - * @param {AsyncFunction} task - An async function to retry. - * Invoked with (callback). - * @param {Function} [callback] - An optional callback which is called when the - * task has succeeded, or after the final failed attempt. It receives the `err` - * and `result` arguments of the last attempt at completing the `task`. Invoked - * with (err, results). - * @returns {Promise} a promise if no callback provided - * - * @example - * - * // The `retry` function can be used as a stand-alone control flow by passing - * // a callback, as shown below: - * - * // try calling apiMethod 3 times - * async.retry(3, apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // try calling apiMethod 3 times, waiting 200 ms between each retry - * async.retry({times: 3, interval: 200}, apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // try calling apiMethod 10 times with exponential backoff - * // (i.e. intervals of 100, 200, 400, 800, 1600, ... milliseconds) - * async.retry({ - * times: 10, - * interval: function(retryCount) { - * return 50 * Math.pow(2, retryCount); - * } - * }, apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // try calling apiMethod the default 5 times no delay between each retry - * async.retry(apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // try calling apiMethod only when error condition satisfies, all other - * // errors will abort the retry control flow and return to final callback - * async.retry({ - * errorFilter: function(err) { - * return err.message === 'Temporary error'; // only retry on a specific error - * } - * }, apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // to retry individual methods that are not as reliable within other - * // control flow functions, use the `retryable` wrapper: - * async.auto({ - * users: api.getUsers.bind(api), - * payments: async.retryable(3, api.getPayments.bind(api)) - * }, function(err, results) { - * // do something with the results - * }); - * - */ -const DEFAULT_TIMES = 5; -const DEFAULT_INTERVAL = 0; - -function retry(opts, task, callback) { - var options = { - times: DEFAULT_TIMES, - intervalFunc: constant(DEFAULT_INTERVAL) - }; - - if (arguments.length < 3 && typeof opts === 'function') { - callback = task || (0, _promiseCallback.promiseCallback)(); - task = opts; - } else { - parseTimes(options, opts); - callback = callback || (0, _promiseCallback.promiseCallback)(); - } - - if (typeof task !== 'function') { - throw new Error("Invalid arguments for async.retry"); - } - - var _task = (0, _wrapAsync2.default)(task); - - var attempt = 1; - function retryAttempt() { - _task((err, ...args) => { - if (err === false) return; - if (err && attempt++ < options.times && (typeof options.errorFilter != 'function' || options.errorFilter(err))) { - setTimeout(retryAttempt, options.intervalFunc(attempt - 1)); - } else { - callback(err, ...args); - } - }); - } - - retryAttempt(); - return callback[_promiseCallback.PROMISE_SYMBOL]; -} - -function parseTimes(acc, t) { - if (typeof t === 'object') { - acc.times = +t.times || DEFAULT_TIMES; - - acc.intervalFunc = typeof t.interval === 'function' ? t.interval : constant(+t.interval || DEFAULT_INTERVAL); - - acc.errorFilter = t.errorFilter; - } else if (typeof t === 'number' || typeof t === 'string') { - acc.times = +t || DEFAULT_TIMES; - } else { - throw new Error("Invalid arguments for async.retry"); - } -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/retryable.js b/node_modules/async/retryable.js deleted file mode 100644 index 1b1147c..0000000 --- a/node_modules/async/retryable.js +++ /dev/null @@ -1,77 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = retryable; - -var _retry = require('./retry.js'); - -var _retry2 = _interopRequireDefault(_retry); - -var _initialParams = require('./internal/initialParams.js'); - -var _initialParams2 = _interopRequireDefault(_initialParams); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _promiseCallback = require('./internal/promiseCallback.js'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * A close relative of [`retry`]{@link module:ControlFlow.retry}. This method - * wraps a task and makes it retryable, rather than immediately calling it - * with retries. - * - * @name retryable - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.retry]{@link module:ControlFlow.retry} - * @category Control Flow - * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - optional - * options, exactly the same as from `retry`, except for a `opts.arity` that - * is the arity of the `task` function, defaulting to `task.length` - * @param {AsyncFunction} task - the asynchronous function to wrap. - * This function will be passed any arguments passed to the returned wrapper. - * Invoked with (...args, callback). - * @returns {AsyncFunction} The wrapped function, which when invoked, will - * retry on an error, based on the parameters specified in `opts`. - * This function will accept the same parameters as `task`. - * @example - * - * async.auto({ - * dep1: async.retryable(3, getFromFlakyService), - * process: ["dep1", async.retryable(3, function (results, cb) { - * maybeProcessData(results.dep1, cb); - * })] - * }, callback); - */ -function retryable(opts, task) { - if (!task) { - task = opts; - opts = null; - } - let arity = opts && opts.arity || task.length; - if ((0, _wrapAsync.isAsync)(task)) { - arity += 1; - } - var _task = (0, _wrapAsync2.default)(task); - return (0, _initialParams2.default)((args, callback) => { - if (args.length < arity - 1 || callback == null) { - args.push(callback); - callback = (0, _promiseCallback.promiseCallback)(); - } - function taskFn(cb) { - _task(...args, cb); - } - - if (opts) (0, _retry2.default)(opts, taskFn, callback);else (0, _retry2.default)(taskFn, callback); - - return callback[_promiseCallback.PROMISE_SYMBOL]; - }); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/select.js b/node_modules/async/select.js deleted file mode 100644 index 303dc1f..0000000 --- a/node_modules/async/select.js +++ /dev/null @@ -1,93 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _filter2 = require('./internal/filter.js'); - -var _filter3 = _interopRequireDefault(_filter2); - -var _eachOf = require('./eachOf.js'); - -var _eachOf2 = _interopRequireDefault(_eachOf); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Returns a new array of all the values in `coll` which pass an async truth - * test. This operation is performed in parallel, but the results array will be - * in the same order as the original. - * - * @name filter - * @static - * @memberOf module:Collections - * @method - * @alias select - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {Function} iteratee - A truth test to apply to each item in `coll`. - * The `iteratee` is passed a `callback(err, truthValue)`, which must be called - * with a boolean argument once it has completed. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @returns {Promise} a promise, if no callback provided - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * - * const files = ['dir1/file1.txt','dir2/file3.txt','dir3/file6.txt']; - * - * // asynchronous function that checks if a file exists - * function fileExists(file, callback) { - * fs.access(file, fs.constants.F_OK, (err) => { - * callback(null, !err); - * }); - * } - * - * // Using callbacks - * async.filter(files, fileExists, function(err, results) { - * if(err) { - * console.log(err); - * } else { - * console.log(results); - * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] - * // results is now an array of the existing files - * } - * }); - * - * // Using Promises - * async.filter(files, fileExists) - * .then(results => { - * console.log(results); - * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] - * // results is now an array of the existing files - * }).catch(err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let results = await async.filter(files, fileExists); - * console.log(results); - * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] - * // results is now an array of the existing files - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function filter(coll, iteratee, callback) { - return (0, _filter3.default)(_eachOf2.default, coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(filter, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/selectLimit.js b/node_modules/async/selectLimit.js deleted file mode 100644 index 89e55f5..0000000 --- a/node_modules/async/selectLimit.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _filter2 = require('./internal/filter.js'); - -var _filter3 = _interopRequireDefault(_filter2); - -var _eachOfLimit = require('./internal/eachOfLimit.js'); - -var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`filter`]{@link module:Collections.filter} but runs a maximum of `limit` async operations at a - * time. - * - * @name filterLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.filter]{@link module:Collections.filter} - * @alias selectLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {Function} iteratee - A truth test to apply to each item in `coll`. - * The `iteratee` is passed a `callback(err, truthValue)`, which must be called - * with a boolean argument once it has completed. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @returns {Promise} a promise, if no callback provided - */ -function filterLimit(coll, limit, iteratee, callback) { - return (0, _filter3.default)((0, _eachOfLimit2.default)(limit), coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(filterLimit, 4); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/selectSeries.js b/node_modules/async/selectSeries.js deleted file mode 100644 index a045e52..0000000 --- a/node_modules/async/selectSeries.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _filter2 = require('./internal/filter.js'); - -var _filter3 = _interopRequireDefault(_filter2); - -var _eachOfSeries = require('./eachOfSeries.js'); - -var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`filter`]{@link module:Collections.filter} but runs only a single async operation at a time. - * - * @name filterSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.filter]{@link module:Collections.filter} - * @alias selectSeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {Function} iteratee - A truth test to apply to each item in `coll`. - * The `iteratee` is passed a `callback(err, truthValue)`, which must be called - * with a boolean argument once it has completed. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results) - * @returns {Promise} a promise, if no callback provided - */ -function filterSeries(coll, iteratee, callback) { - return (0, _filter3.default)(_eachOfSeries2.default, coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(filterSeries, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/seq.js b/node_modules/async/seq.js deleted file mode 100644 index 28c825f..0000000 --- a/node_modules/async/seq.js +++ /dev/null @@ -1,79 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = seq; - -var _reduce = require('./reduce.js'); - -var _reduce2 = _interopRequireDefault(_reduce); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _promiseCallback = require('./internal/promiseCallback.js'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Version of the compose function that is more natural to read. Each function - * consumes the return value of the previous function. It is the equivalent of - * [compose]{@link module:ControlFlow.compose} with the arguments reversed. - * - * Each function is executed with the `this` binding of the composed function. - * - * @name seq - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.compose]{@link module:ControlFlow.compose} - * @category Control Flow - * @param {...AsyncFunction} functions - the asynchronous functions to compose - * @returns {Function} a function that composes the `functions` in order - * @example - * - * // Requires lodash (or underscore), express3 and dresende's orm2. - * // Part of an app, that fetches cats of the logged user. - * // This example uses `seq` function to avoid overnesting and error - * // handling clutter. - * app.get('/cats', function(request, response) { - * var User = request.models.User; - * async.seq( - * User.get.bind(User), // 'User.get' has signature (id, callback(err, data)) - * function(user, fn) { - * user.getCats(fn); // 'getCats' has signature (callback(err, data)) - * } - * )(req.session.user_id, function (err, cats) { - * if (err) { - * console.error(err); - * response.json({ status: 'error', message: err.message }); - * } else { - * response.json({ status: 'ok', message: 'Cats found', data: cats }); - * } - * }); - * }); - */ -function seq(...functions) { - var _functions = functions.map(_wrapAsync2.default); - return function (...args) { - var that = this; - - var cb = args[args.length - 1]; - if (typeof cb == 'function') { - args.pop(); - } else { - cb = (0, _promiseCallback.promiseCallback)(); - } - - (0, _reduce2.default)(_functions, args, (newargs, fn, iterCb) => { - fn.apply(that, newargs.concat((err, ...nextargs) => { - iterCb(err, nextargs); - })); - }, (err, results) => cb(err, ...results)); - - return cb[_promiseCallback.PROMISE_SYMBOL]; - }; -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/series.js b/node_modules/async/series.js deleted file mode 100644 index 56e78f9..0000000 --- a/node_modules/async/series.js +++ /dev/null @@ -1,186 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = series; - -var _parallel2 = require('./internal/parallel.js'); - -var _parallel3 = _interopRequireDefault(_parallel2); - -var _eachOfSeries = require('./eachOfSeries.js'); - -var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Run the functions in the `tasks` collection in series, each one running once - * the previous function has completed. If any functions in the series pass an - * error to its callback, no more functions are run, and `callback` is - * immediately called with the value of the error. Otherwise, `callback` - * receives an array of results when `tasks` have completed. - * - * It is also possible to use an object instead of an array. Each property will - * be run as a function, and the results will be passed to the final `callback` - * as an object instead of an array. This can be a more readable way of handling - * results from {@link async.series}. - * - * **Note** that while many implementations preserve the order of object - * properties, the [ECMAScript Language Specification](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6) - * explicitly states that - * - * > The mechanics and order of enumerating the properties is not specified. - * - * So if you rely on the order in which your series of functions are executed, - * and want this to work on all platforms, consider using an array. - * - * @name series - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection containing - * [async functions]{@link AsyncFunction} to run in series. - * Each function can complete with any number of optional `result` values. - * @param {Function} [callback] - An optional callback to run once all the - * functions have completed. This function gets a results array (or object) - * containing all the result arguments passed to the `task` callbacks. Invoked - * with (err, result). - * @return {Promise} a promise, if no callback is passed - * @example - * - * //Using Callbacks - * async.series([ - * function(callback) { - * setTimeout(function() { - * // do some async task - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * // then do another async task - * callback(null, 'two'); - * }, 100); - * } - * ], function(err, results) { - * console.log(results); - * // results is equal to ['one','two'] - * }); - * - * // an example using objects instead of arrays - * async.series({ - * one: function(callback) { - * setTimeout(function() { - * // do some async task - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * // then do another async task - * callback(null, 2); - * }, 100); - * } - * }, function(err, results) { - * console.log(results); - * // results is equal to: { one: 1, two: 2 } - * }); - * - * //Using Promises - * async.series([ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ]).then(results => { - * console.log(results); - * // results is equal to ['one','two'] - * }).catch(err => { - * console.log(err); - * }); - * - * // an example using an object instead of an array - * async.series({ - * one: function(callback) { - * setTimeout(function() { - * // do some async task - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * // then do another async task - * callback(null, 2); - * }, 100); - * } - * }).then(results => { - * console.log(results); - * // results is equal to: { one: 1, two: 2 } - * }).catch(err => { - * console.log(err); - * }); - * - * //Using async/await - * async () => { - * try { - * let results = await async.series([ - * function(callback) { - * setTimeout(function() { - * // do some async task - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * // then do another async task - * callback(null, 'two'); - * }, 100); - * } - * ]); - * console.log(results); - * // results is equal to ['one','two'] - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // an example using an object instead of an array - * async () => { - * try { - * let results = await async.parallel({ - * one: function(callback) { - * setTimeout(function() { - * // do some async task - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * // then do another async task - * callback(null, 2); - * }, 100); - * } - * }); - * console.log(results); - * // results is equal to: { one: 1, two: 2 } - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function series(tasks, callback) { - return (0, _parallel3.default)(_eachOfSeries2.default, tasks, callback); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/setImmediate.js b/node_modules/async/setImmediate.js deleted file mode 100644 index c712ec3..0000000 --- a/node_modules/async/setImmediate.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _setImmediate = require('./internal/setImmediate.js'); - -var _setImmediate2 = _interopRequireDefault(_setImmediate); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Calls `callback` on a later loop around the event loop. In Node.js this just - * calls `setImmediate`. In the browser it will use `setImmediate` if - * available, otherwise `setTimeout(callback, 0)`, which means other higher - * priority events may precede the execution of `callback`. - * - * This is used internally for browser-compatibility purposes. - * - * @name setImmediate - * @static - * @memberOf module:Utils - * @method - * @see [async.nextTick]{@link module:Utils.nextTick} - * @category Util - * @param {Function} callback - The function to call on a later loop around - * the event loop. Invoked with (args...). - * @param {...*} args... - any number of additional arguments to pass to the - * callback on the next tick. - * @example - * - * var call_order = []; - * async.nextTick(function() { - * call_order.push('two'); - * // call_order now equals ['one','two'] - * }); - * call_order.push('one'); - * - * async.setImmediate(function (a, b, c) { - * // a, b, and c equal 1, 2, and 3 - * }, 1, 2, 3); - */ -exports.default = _setImmediate2.default; -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/some.js b/node_modules/async/some.js deleted file mode 100644 index 2046cf6..0000000 --- a/node_modules/async/some.js +++ /dev/null @@ -1,122 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createTester = require('./internal/createTester.js'); - -var _createTester2 = _interopRequireDefault(_createTester); - -var _eachOf = require('./eachOf.js'); - -var _eachOf2 = _interopRequireDefault(_eachOf); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Returns `true` if at least one element in the `coll` satisfies an async test. - * If any iteratee call returns `true`, the main `callback` is immediately - * called. - * - * @name some - * @static - * @memberOf module:Collections - * @method - * @alias any - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collections in parallel. - * The iteratee should complete with a boolean `result` value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the iteratee functions have finished. - * Result will be either `true` or `false` depending on the values of the async - * tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * // dir4 does not exist - * - * // asynchronous function that checks if a file exists - * function fileExists(file, callback) { - * fs.access(file, fs.constants.F_OK, (err) => { - * callback(null, !err); - * }); - * } - * - * // Using callbacks - * async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists, - * function(err, result) { - * console.log(result); - * // true - * // result is true since some file in the list exists - * } - *); - * - * async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists, - * function(err, result) { - * console.log(result); - * // false - * // result is false since none of the files exists - * } - *); - * - * // Using Promises - * async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists) - * .then( result => { - * console.log(result); - * // true - * // result is true since some file in the list exists - * }).catch( err => { - * console.log(err); - * }); - * - * async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists) - * .then( result => { - * console.log(result); - * // false - * // result is false since none of the files exists - * }).catch( err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists); - * console.log(result); - * // true - * // result is true since some file in the list exists - * } - * catch (err) { - * console.log(err); - * } - * } - * - * async () => { - * try { - * let result = await async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists); - * console.log(result); - * // false - * // result is false since none of the files exists - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function some(coll, iteratee, callback) { - return (0, _createTester2.default)(Boolean, res => res)(_eachOf2.default, coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(some, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/someLimit.js b/node_modules/async/someLimit.js deleted file mode 100644 index c8a295a..0000000 --- a/node_modules/async/someLimit.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createTester = require('./internal/createTester.js'); - -var _createTester2 = _interopRequireDefault(_createTester); - -var _eachOfLimit = require('./internal/eachOfLimit.js'); - -var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`some`]{@link module:Collections.some} but runs a maximum of `limit` async operations at a time. - * - * @name someLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.some]{@link module:Collections.some} - * @alias anyLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collections in parallel. - * The iteratee should complete with a boolean `result` value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the iteratee functions have finished. - * Result will be either `true` or `false` depending on the values of the async - * tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - */ -function someLimit(coll, limit, iteratee, callback) { - return (0, _createTester2.default)(Boolean, res => res)((0, _eachOfLimit2.default)(limit), coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(someLimit, 4); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/someSeries.js b/node_modules/async/someSeries.js deleted file mode 100644 index ee0654b..0000000 --- a/node_modules/async/someSeries.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createTester = require('./internal/createTester.js'); - -var _createTester2 = _interopRequireDefault(_createTester); - -var _eachOfSeries = require('./eachOfSeries.js'); - -var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`some`]{@link module:Collections.some} but runs only a single async operation at a time. - * - * @name someSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.some]{@link module:Collections.some} - * @alias anySeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collections in series. - * The iteratee should complete with a boolean `result` value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the iteratee functions have finished. - * Result will be either `true` or `false` depending on the values of the async - * tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - */ -function someSeries(coll, iteratee, callback) { - return (0, _createTester2.default)(Boolean, res => res)(_eachOfSeries2.default, coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(someSeries, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/sortBy.js b/node_modules/async/sortBy.js deleted file mode 100644 index d17fb6a..0000000 --- a/node_modules/async/sortBy.js +++ /dev/null @@ -1,190 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _map = require('./map.js'); - -var _map2 = _interopRequireDefault(_map); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Sorts a list by the results of running each `coll` value through an async - * `iteratee`. - * - * @name sortBy - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with a value to use as the sort criteria as - * its `result`. - * Invoked with (item, callback). - * @param {Function} callback - A callback which is called after all the - * `iteratee` functions have finished, or an error occurs. Results is the items - * from the original `coll` sorted by the values returned by the `iteratee` - * calls. Invoked with (err, results). - * @returns {Promise} a promise, if no callback passed - * @example - * - * // bigfile.txt is a file that is 251100 bytes in size - * // mediumfile.txt is a file that is 11000 bytes in size - * // smallfile.txt is a file that is 121 bytes in size - * - * // asynchronous function that returns the file size in bytes - * function getFileSizeInBytes(file, callback) { - * fs.stat(file, function(err, stat) { - * if (err) { - * return callback(err); - * } - * callback(null, stat.size); - * }); - * } - * - * // Using callbacks - * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], getFileSizeInBytes, - * function(err, results) { - * if (err) { - * console.log(err); - * } else { - * console.log(results); - * // results is now the original array of files sorted by - * // file size (ascending by default), e.g. - * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] - * } - * } - * ); - * - * // By modifying the callback parameter the - * // sorting order can be influenced: - * - * // ascending order - * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], function(file, callback) { - * getFileSizeInBytes(file, function(getFileSizeErr, fileSize) { - * if (getFileSizeErr) return callback(getFileSizeErr); - * callback(null, fileSize); - * }); - * }, function(err, results) { - * if (err) { - * console.log(err); - * } else { - * console.log(results); - * // results is now the original array of files sorted by - * // file size (ascending by default), e.g. - * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] - * } - * } - * ); - * - * // descending order - * async.sortBy(['bigfile.txt','mediumfile.txt','smallfile.txt'], function(file, callback) { - * getFileSizeInBytes(file, function(getFileSizeErr, fileSize) { - * if (getFileSizeErr) { - * return callback(getFileSizeErr); - * } - * callback(null, fileSize * -1); - * }); - * }, function(err, results) { - * if (err) { - * console.log(err); - * } else { - * console.log(results); - * // results is now the original array of files sorted by - * // file size (ascending by default), e.g. - * // [ 'bigfile.txt', 'mediumfile.txt', 'smallfile.txt'] - * } - * } - * ); - * - * // Error handling - * async.sortBy(['mediumfile.txt','smallfile.txt','missingfile.txt'], getFileSizeInBytes, - * function(err, results) { - * if (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } else { - * console.log(results); - * } - * } - * ); - * - * // Using Promises - * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], getFileSizeInBytes) - * .then( results => { - * console.log(results); - * // results is now the original array of files sorted by - * // file size (ascending by default), e.g. - * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] - * }).catch( err => { - * console.log(err); - * }); - * - * // Error handling - * async.sortBy(['mediumfile.txt','smallfile.txt','missingfile.txt'], getFileSizeInBytes) - * .then( results => { - * console.log(results); - * }).catch( err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * }); - * - * // Using async/await - * (async () => { - * try { - * let results = await async.sortBy(['bigfile.txt','mediumfile.txt','smallfile.txt'], getFileSizeInBytes); - * console.log(results); - * // results is now the original array of files sorted by - * // file size (ascending by default), e.g. - * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] - * } - * catch (err) { - * console.log(err); - * } - * })(); - * - * // Error handling - * async () => { - * try { - * let results = await async.sortBy(['missingfile.txt','mediumfile.txt','smallfile.txt'], getFileSizeInBytes); - * console.log(results); - * } - * catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } - * } - * - */ -function sortBy(coll, iteratee, callback) { - var _iteratee = (0, _wrapAsync2.default)(iteratee); - return (0, _map2.default)(coll, (x, iterCb) => { - _iteratee(x, (err, criteria) => { - if (err) return iterCb(err); - iterCb(err, { value: x, criteria }); - }); - }, (err, results) => { - if (err) return callback(err); - callback(null, results.sort(comparator).map(v => v.value)); - }); - - function comparator(left, right) { - var a = left.criteria, - b = right.criteria; - return a < b ? -1 : a > b ? 1 : 0; - } -} -exports.default = (0, _awaitify2.default)(sortBy, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/timeout.js b/node_modules/async/timeout.js deleted file mode 100644 index dd58eb3..0000000 --- a/node_modules/async/timeout.js +++ /dev/null @@ -1,89 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = timeout; - -var _initialParams = require('./internal/initialParams.js'); - -var _initialParams2 = _interopRequireDefault(_initialParams); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Sets a time limit on an asynchronous function. If the function does not call - * its callback within the specified milliseconds, it will be called with a - * timeout error. The code property for the error object will be `'ETIMEDOUT'`. - * - * @name timeout - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} asyncFn - The async function to limit in time. - * @param {number} milliseconds - The specified time limit. - * @param {*} [info] - Any variable you want attached (`string`, `object`, etc) - * to timeout Error for more information.. - * @returns {AsyncFunction} Returns a wrapped function that can be used with any - * of the control flow functions. - * Invoke this function with the same parameters as you would `asyncFunc`. - * @example - * - * function myFunction(foo, callback) { - * doAsyncTask(foo, function(err, data) { - * // handle errors - * if (err) return callback(err); - * - * // do some stuff ... - * - * // return processed data - * return callback(null, data); - * }); - * } - * - * var wrapped = async.timeout(myFunction, 1000); - * - * // call `wrapped` as you would `myFunction` - * wrapped({ bar: 'bar' }, function(err, data) { - * // if `myFunction` takes < 1000 ms to execute, `err` - * // and `data` will have their expected values - * - * // else `err` will be an Error with the code 'ETIMEDOUT' - * }); - */ -function timeout(asyncFn, milliseconds, info) { - var fn = (0, _wrapAsync2.default)(asyncFn); - - return (0, _initialParams2.default)((args, callback) => { - var timedOut = false; - var timer; - - function timeoutCallback() { - var name = asyncFn.name || 'anonymous'; - var error = new Error('Callback function "' + name + '" timed out.'); - error.code = 'ETIMEDOUT'; - if (info) { - error.info = info; - } - timedOut = true; - callback(error); - } - - args.push((...cbArgs) => { - if (!timedOut) { - callback(...cbArgs); - clearTimeout(timer); - } - }); - - // setup timer and call original function - timer = setTimeout(timeoutCallback, milliseconds); - fn(...args); - }); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/times.js b/node_modules/async/times.js deleted file mode 100644 index 4484c73..0000000 --- a/node_modules/async/times.js +++ /dev/null @@ -1,50 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = times; - -var _timesLimit = require('./timesLimit.js'); - -var _timesLimit2 = _interopRequireDefault(_timesLimit); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Calls the `iteratee` function `n` times, and accumulates results in the same - * manner you would use with [map]{@link module:Collections.map}. - * - * @name times - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.map]{@link module:Collections.map} - * @category Control Flow - * @param {number} n - The number of times to run the function. - * @param {AsyncFunction} iteratee - The async function to call `n` times. - * Invoked with the iteration index and a callback: (n, next). - * @param {Function} callback - see {@link module:Collections.map}. - * @returns {Promise} a promise, if no callback is provided - * @example - * - * // Pretend this is some complicated async factory - * var createUser = function(id, callback) { - * callback(null, { - * id: 'user' + id - * }); - * }; - * - * // generate 5 users - * async.times(5, function(n, next) { - * createUser(n, function(err, user) { - * next(err, user); - * }); - * }, function(err, users) { - * // we should now have 5 users - * }); - */ -function times(n, iteratee, callback) { - return (0, _timesLimit2.default)(n, Infinity, iteratee, callback); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/timesLimit.js b/node_modules/async/timesLimit.js deleted file mode 100644 index 9fb0ba3..0000000 --- a/node_modules/async/timesLimit.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = timesLimit; - -var _mapLimit = require('./mapLimit.js'); - -var _mapLimit2 = _interopRequireDefault(_mapLimit); - -var _range = require('./internal/range.js'); - -var _range2 = _interopRequireDefault(_range); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [times]{@link module:ControlFlow.times} but runs a maximum of `limit` async operations at a - * time. - * - * @name timesLimit - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.times]{@link module:ControlFlow.times} - * @category Control Flow - * @param {number} count - The number of times to run the function. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - The async function to call `n` times. - * Invoked with the iteration index and a callback: (n, next). - * @param {Function} callback - see [async.map]{@link module:Collections.map}. - * @returns {Promise} a promise, if no callback is provided - */ -function timesLimit(count, limit, iteratee, callback) { - var _iteratee = (0, _wrapAsync2.default)(iteratee); - return (0, _mapLimit2.default)((0, _range2.default)(count), limit, _iteratee, callback); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/timesSeries.js b/node_modules/async/timesSeries.js deleted file mode 100644 index a10f0cb..0000000 --- a/node_modules/async/timesSeries.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = timesSeries; - -var _timesLimit = require('./timesLimit.js'); - -var _timesLimit2 = _interopRequireDefault(_timesLimit); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [times]{@link module:ControlFlow.times} but runs only a single async operation at a time. - * - * @name timesSeries - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.times]{@link module:ControlFlow.times} - * @category Control Flow - * @param {number} n - The number of times to run the function. - * @param {AsyncFunction} iteratee - The async function to call `n` times. - * Invoked with the iteration index and a callback: (n, next). - * @param {Function} callback - see {@link module:Collections.map}. - * @returns {Promise} a promise, if no callback is provided - */ -function timesSeries(n, iteratee, callback) { - return (0, _timesLimit2.default)(n, 1, iteratee, callback); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/transform.js b/node_modules/async/transform.js deleted file mode 100644 index 75b754e..0000000 --- a/node_modules/async/transform.js +++ /dev/null @@ -1,173 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = transform; - -var _eachOf = require('./eachOf.js'); - -var _eachOf2 = _interopRequireDefault(_eachOf); - -var _once = require('./internal/once.js'); - -var _once2 = _interopRequireDefault(_once); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _promiseCallback = require('./internal/promiseCallback.js'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * A relative of `reduce`. Takes an Object or Array, and iterates over each - * element in parallel, each step potentially mutating an `accumulator` value. - * The type of the accumulator defaults to the type of collection passed in. - * - * @name transform - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {*} [accumulator] - The initial state of the transform. If omitted, - * it will default to an empty Object or Array, depending on the type of `coll` - * @param {AsyncFunction} iteratee - A function applied to each item in the - * collection that potentially modifies the accumulator. - * Invoked with (accumulator, item, key, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result is the transformed accumulator. - * Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - * @example - * - * // file1.txt is a file that is 1000 bytes in size - * // file2.txt is a file that is 2000 bytes in size - * // file3.txt is a file that is 3000 bytes in size - * - * // helper function that returns human-readable size format from bytes - * function formatBytes(bytes, decimals = 2) { - * // implementation not included for brevity - * return humanReadbleFilesize; - * } - * - * const fileList = ['file1.txt','file2.txt','file3.txt']; - * - * // asynchronous function that returns the file size, transformed to human-readable format - * // e.g. 1024 bytes = 1KB, 1234 bytes = 1.21 KB, 1048576 bytes = 1MB, etc. - * function transformFileSize(acc, value, key, callback) { - * fs.stat(value, function(err, stat) { - * if (err) { - * return callback(err); - * } - * acc[key] = formatBytes(stat.size); - * callback(null); - * }); - * } - * - * // Using callbacks - * async.transform(fileList, transformFileSize, function(err, result) { - * if(err) { - * console.log(err); - * } else { - * console.log(result); - * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ] - * } - * }); - * - * // Using Promises - * async.transform(fileList, transformFileSize) - * .then(result => { - * console.log(result); - * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ] - * }).catch(err => { - * console.log(err); - * }); - * - * // Using async/await - * (async () => { - * try { - * let result = await async.transform(fileList, transformFileSize); - * console.log(result); - * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ] - * } - * catch (err) { - * console.log(err); - * } - * })(); - * - * @example - * - * // file1.txt is a file that is 1000 bytes in size - * // file2.txt is a file that is 2000 bytes in size - * // file3.txt is a file that is 3000 bytes in size - * - * // helper function that returns human-readable size format from bytes - * function formatBytes(bytes, decimals = 2) { - * // implementation not included for brevity - * return humanReadbleFilesize; - * } - * - * const fileMap = { f1: 'file1.txt', f2: 'file2.txt', f3: 'file3.txt' }; - * - * // asynchronous function that returns the file size, transformed to human-readable format - * // e.g. 1024 bytes = 1KB, 1234 bytes = 1.21 KB, 1048576 bytes = 1MB, etc. - * function transformFileSize(acc, value, key, callback) { - * fs.stat(value, function(err, stat) { - * if (err) { - * return callback(err); - * } - * acc[key] = formatBytes(stat.size); - * callback(null); - * }); - * } - * - * // Using callbacks - * async.transform(fileMap, transformFileSize, function(err, result) { - * if(err) { - * console.log(err); - * } else { - * console.log(result); - * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' } - * } - * }); - * - * // Using Promises - * async.transform(fileMap, transformFileSize) - * .then(result => { - * console.log(result); - * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' } - * }).catch(err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.transform(fileMap, transformFileSize); - * console.log(result); - * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' } - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function transform(coll, accumulator, iteratee, callback) { - if (arguments.length <= 3 && typeof accumulator === 'function') { - callback = iteratee; - iteratee = accumulator; - accumulator = Array.isArray(coll) ? [] : {}; - } - callback = (0, _once2.default)(callback || (0, _promiseCallback.promiseCallback)()); - var _iteratee = (0, _wrapAsync2.default)(iteratee); - - (0, _eachOf2.default)(coll, (v, k, cb) => { - _iteratee(accumulator, v, k, cb); - }, err => callback(err, accumulator)); - return callback[_promiseCallback.PROMISE_SYMBOL]; -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/tryEach.js b/node_modules/async/tryEach.js deleted file mode 100644 index 82fe8ec..0000000 --- a/node_modules/async/tryEach.js +++ /dev/null @@ -1,78 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _eachSeries = require('./eachSeries.js'); - -var _eachSeries2 = _interopRequireDefault(_eachSeries); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * It runs each task in series but stops whenever any of the functions were - * successful. If one of the tasks were successful, the `callback` will be - * passed the result of the successful task. If all tasks fail, the callback - * will be passed the error and result (if any) of the final attempt. - * - * @name tryEach - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection containing functions to - * run, each function is passed a `callback(err, result)` it must call on - * completion with an error `err` (which can be `null`) and an optional `result` - * value. - * @param {Function} [callback] - An optional callback which is called when one - * of the tasks has succeeded, or all have failed. It receives the `err` and - * `result` arguments of the last attempt at completing the `task`. Invoked with - * (err, results). - * @returns {Promise} a promise, if no callback is passed - * @example - * async.tryEach([ - * function getDataFromFirstWebsite(callback) { - * // Try getting the data from the first website - * callback(err, data); - * }, - * function getDataFromSecondWebsite(callback) { - * // First website failed, - * // Try getting the data from the backup website - * callback(err, data); - * } - * ], - * // optional callback - * function(err, results) { - * Now do something with the data. - * }); - * - */ -function tryEach(tasks, callback) { - var error = null; - var result; - return (0, _eachSeries2.default)(tasks, (task, taskCb) => { - (0, _wrapAsync2.default)(task)((err, ...args) => { - if (err === false) return taskCb(err); - - if (args.length < 2) { - [result] = args; - } else { - result = args; - } - error = err; - taskCb(err ? null : {}); - }); - }, () => callback(error, result)); -} - -exports.default = (0, _awaitify2.default)(tryEach); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/unmemoize.js b/node_modules/async/unmemoize.js deleted file mode 100644 index 47a92b4..0000000 --- a/node_modules/async/unmemoize.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = unmemoize; -/** - * Undoes a [memoize]{@link module:Utils.memoize}d function, reverting it to the original, - * unmemoized form. Handy for testing. - * - * @name unmemoize - * @static - * @memberOf module:Utils - * @method - * @see [async.memoize]{@link module:Utils.memoize} - * @category Util - * @param {AsyncFunction} fn - the memoized function - * @returns {AsyncFunction} a function that calls the original unmemoized function - */ -function unmemoize(fn) { - return (...args) => { - return (fn.unmemoized || fn)(...args); - }; -} -module.exports = exports["default"]; \ No newline at end of file diff --git a/node_modules/async/until.js b/node_modules/async/until.js deleted file mode 100644 index 3c71e51..0000000 --- a/node_modules/async/until.js +++ /dev/null @@ -1,61 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = until; - -var _whilst = require('./whilst.js'); - -var _whilst2 = _interopRequireDefault(_whilst); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Repeatedly call `iteratee` until `test` returns `true`. Calls `callback` when - * stopped, or an error occurs. `callback` will be passed an error and any - * arguments passed to the final `iteratee`'s callback. - * - * The inverse of [whilst]{@link module:ControlFlow.whilst}. - * - * @name until - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.whilst]{@link module:ControlFlow.whilst} - * @category Control Flow - * @param {AsyncFunction} test - asynchronous truth test to perform before each - * execution of `iteratee`. Invoked with (callback). - * @param {AsyncFunction} iteratee - An async function which is called each time - * `test` fails. Invoked with (callback). - * @param {Function} [callback] - A callback which is called after the test - * function has passed and repeated execution of `iteratee` has stopped. `callback` - * will be passed an error and any arguments passed to the final `iteratee`'s - * callback. Invoked with (err, [results]); - * @returns {Promise} a promise, if a callback is not passed - * - * @example - * const results = [] - * let finished = false - * async.until(function test(cb) { - * cb(null, finished) - * }, function iter(next) { - * fetchPage(url, (err, body) => { - * if (err) return next(err) - * results = results.concat(body.objects) - * finished = !!body.next - * next(err) - * }) - * }, function done (err) { - * // all pages have been fetched - * }) - */ -function until(test, iteratee, callback) { - const _test = (0, _wrapAsync2.default)(test); - return (0, _whilst2.default)(cb => _test((err, truth) => cb(err, !truth)), iteratee, callback); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/waterfall.js b/node_modules/async/waterfall.js deleted file mode 100644 index fcd0dc1..0000000 --- a/node_modules/async/waterfall.js +++ /dev/null @@ -1,105 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _once = require('./internal/once.js'); - -var _once2 = _interopRequireDefault(_once); - -var _onlyOnce = require('./internal/onlyOnce.js'); - -var _onlyOnce2 = _interopRequireDefault(_onlyOnce); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Runs the `tasks` array of functions in series, each passing their results to - * the next in the array. However, if any of the `tasks` pass an error to their - * own callback, the next function is not executed, and the main `callback` is - * immediately called with the error. - * - * @name waterfall - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array} tasks - An array of [async functions]{@link AsyncFunction} - * to run. - * Each function should complete with any number of `result` values. - * The `result` values will be passed as arguments, in order, to the next task. - * @param {Function} [callback] - An optional callback to run once all the - * functions have completed. This will be passed the results of the last task's - * callback. Invoked with (err, [results]). - * @returns {Promise} a promise, if a callback is omitted - * @example - * - * async.waterfall([ - * function(callback) { - * callback(null, 'one', 'two'); - * }, - * function(arg1, arg2, callback) { - * // arg1 now equals 'one' and arg2 now equals 'two' - * callback(null, 'three'); - * }, - * function(arg1, callback) { - * // arg1 now equals 'three' - * callback(null, 'done'); - * } - * ], function (err, result) { - * // result now equals 'done' - * }); - * - * // Or, with named functions: - * async.waterfall([ - * myFirstFunction, - * mySecondFunction, - * myLastFunction, - * ], function (err, result) { - * // result now equals 'done' - * }); - * function myFirstFunction(callback) { - * callback(null, 'one', 'two'); - * } - * function mySecondFunction(arg1, arg2, callback) { - * // arg1 now equals 'one' and arg2 now equals 'two' - * callback(null, 'three'); - * } - * function myLastFunction(arg1, callback) { - * // arg1 now equals 'three' - * callback(null, 'done'); - * } - */ -function waterfall(tasks, callback) { - callback = (0, _once2.default)(callback); - if (!Array.isArray(tasks)) return callback(new Error('First argument to waterfall must be an array of functions')); - if (!tasks.length) return callback(); - var taskIndex = 0; - - function nextTask(args) { - var task = (0, _wrapAsync2.default)(tasks[taskIndex++]); - task(...args, (0, _onlyOnce2.default)(next)); - } - - function next(err, ...args) { - if (err === false) return; - if (err || taskIndex === tasks.length) { - return callback(err, ...args); - } - nextTask(args); - } - - nextTask([]); -} - -exports.default = (0, _awaitify2.default)(waterfall); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/whilst.js b/node_modules/async/whilst.js deleted file mode 100644 index 32a4776..0000000 --- a/node_modules/async/whilst.js +++ /dev/null @@ -1,78 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _onlyOnce = require('./internal/onlyOnce.js'); - -var _onlyOnce2 = _interopRequireDefault(_onlyOnce); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Repeatedly call `iteratee`, while `test` returns `true`. Calls `callback` when - * stopped, or an error occurs. - * - * @name whilst - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {AsyncFunction} test - asynchronous truth test to perform before each - * execution of `iteratee`. Invoked with (). - * @param {AsyncFunction} iteratee - An async function which is called each time - * `test` passes. Invoked with (callback). - * @param {Function} [callback] - A callback which is called after the test - * function has failed and repeated execution of `iteratee` has stopped. `callback` - * will be passed an error and any arguments passed to the final `iteratee`'s - * callback. Invoked with (err, [results]); - * @returns {Promise} a promise, if no callback is passed - * @example - * - * var count = 0; - * async.whilst( - * function test(cb) { cb(null, count < 5); }, - * function iter(callback) { - * count++; - * setTimeout(function() { - * callback(null, count); - * }, 1000); - * }, - * function (err, n) { - * // 5 seconds have passed, n = 5 - * } - * ); - */ -function whilst(test, iteratee, callback) { - callback = (0, _onlyOnce2.default)(callback); - var _fn = (0, _wrapAsync2.default)(iteratee); - var _test = (0, _wrapAsync2.default)(test); - var results = []; - - function next(err, ...rest) { - if (err) return callback(err); - results = rest; - if (err === false) return; - _test(check); - } - - function check(err, truth) { - if (err) return callback(err); - if (err === false) return; - if (!truth) return callback(null, ...results); - _fn(next); - } - - return _test(check); -} -exports.default = (0, _awaitify2.default)(whilst, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/wrapSync.js b/node_modules/async/wrapSync.js deleted file mode 100644 index 3c3bf88..0000000 --- a/node_modules/async/wrapSync.js +++ /dev/null @@ -1,118 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = asyncify; - -var _initialParams = require('./internal/initialParams.js'); - -var _initialParams2 = _interopRequireDefault(_initialParams); - -var _setImmediate = require('./internal/setImmediate.js'); - -var _setImmediate2 = _interopRequireDefault(_setImmediate); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Take a sync function and make it async, passing its return value to a - * callback. This is useful for plugging sync functions into a waterfall, - * series, or other async functions. Any arguments passed to the generated - * function will be passed to the wrapped function (except for the final - * callback argument). Errors thrown will be passed to the callback. - * - * If the function passed to `asyncify` returns a Promise, that promises's - * resolved/rejected state will be used to call the callback, rather than simply - * the synchronous return value. - * - * This also means you can asyncify ES2017 `async` functions. - * - * @name asyncify - * @static - * @memberOf module:Utils - * @method - * @alias wrapSync - * @category Util - * @param {Function} func - The synchronous function, or Promise-returning - * function to convert to an {@link AsyncFunction}. - * @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be - * invoked with `(args..., callback)`. - * @example - * - * // passing a regular synchronous function - * async.waterfall([ - * async.apply(fs.readFile, filename, "utf8"), - * async.asyncify(JSON.parse), - * function (data, next) { - * // data is the result of parsing the text. - * // If there was a parsing error, it would have been caught. - * } - * ], callback); - * - * // passing a function returning a promise - * async.waterfall([ - * async.apply(fs.readFile, filename, "utf8"), - * async.asyncify(function (contents) { - * return db.model.create(contents); - * }), - * function (model, next) { - * // `model` is the instantiated model object. - * // If there was an error, this function would be skipped. - * } - * ], callback); - * - * // es2017 example, though `asyncify` is not needed if your JS environment - * // supports async functions out of the box - * var q = async.queue(async.asyncify(async function(file) { - * var intermediateStep = await processFile(file); - * return await somePromise(intermediateStep) - * })); - * - * q.push(files); - */ -function asyncify(func) { - if ((0, _wrapAsync.isAsync)(func)) { - return function (...args /*, callback*/) { - const callback = args.pop(); - const promise = func.apply(this, args); - return handlePromise(promise, callback); - }; - } - - return (0, _initialParams2.default)(function (args, callback) { - var result; - try { - result = func.apply(this, args); - } catch (e) { - return callback(e); - } - // if result is Promise object - if (result && typeof result.then === 'function') { - return handlePromise(result, callback); - } else { - callback(null, result); - } - }); -} - -function handlePromise(promise, callback) { - return promise.then(value => { - invokeCallback(callback, null, value); - }, err => { - invokeCallback(callback, err && err.message ? err : new Error(err)); - }); -} - -function invokeCallback(callback, error, value) { - try { - callback(error, value); - } catch (err) { - (0, _setImmediate2.default)(e => { - throw e; - }, err); - } -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/balanced-match/.github/FUNDING.yml b/node_modules/balanced-match/.github/FUNDING.yml deleted file mode 100644 index cea8b16..0000000 --- a/node_modules/balanced-match/.github/FUNDING.yml +++ /dev/null @@ -1,2 +0,0 @@ -tidelift: "npm/balanced-match" -patreon: juliangruber diff --git a/node_modules/balanced-match/LICENSE.md b/node_modules/balanced-match/LICENSE.md deleted file mode 100644 index 2cdc8e4..0000000 --- a/node_modules/balanced-match/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.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/balanced-match/README.md b/node_modules/balanced-match/README.md deleted file mode 100644 index d2a48b6..0000000 --- a/node_modules/balanced-match/README.md +++ /dev/null @@ -1,97 +0,0 @@ -# balanced-match - -Match balanced string pairs, like `{` and `}` or `` and ``. Supports regular expressions as well! - -[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match) -[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match) - -[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match) - -## Example - -Get the first matching pair of braces: - -```js -var balanced = require('balanced-match'); - -console.log(balanced('{', '}', 'pre{in{nested}}post')); -console.log(balanced('{', '}', 'pre{first}between{second}post')); -console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post')); -``` - -The matches are: - -```bash -$ node example.js -{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' } -{ start: 3, - end: 9, - pre: 'pre', - body: 'first', - post: 'between{second}post' } -{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' } -``` - -## API - -### var m = balanced(a, b, str) - -For the first non-nested matching pair of `a` and `b` in `str`, return an -object with those keys: - -* **start** the index of the first match of `a` -* **end** the index of the matching `b` -* **pre** the preamble, `a` and `b` not included -* **body** the match, `a` and `b` not included -* **post** the postscript, `a` and `b` not included - -If there's no match, `undefined` will be returned. - -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`. - -### var r = balanced.range(a, b, str) - -For the first non-nested matching pair of `a` and `b` in `str`, return an -array with indexes: `[ , ]`. - -If there's no match, `undefined` will be returned. - -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`. - -## Installation - -With [npm](https://npmjs.org) do: - -```bash -npm install balanced-match -``` - -## Security contact information - -To report a security vulnerability, please use the -[Tidelift security contact](https://tidelift.com/security). -Tidelift will coordinate the fix and disclosure. - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.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/balanced-match/index.js b/node_modules/balanced-match/index.js deleted file mode 100644 index c67a646..0000000 --- a/node_modules/balanced-match/index.js +++ /dev/null @@ -1,62 +0,0 @@ -'use strict'; -module.exports = balanced; -function balanced(a, b, str) { - if (a instanceof RegExp) a = maybeMatch(a, str); - if (b instanceof RegExp) b = maybeMatch(b, str); - - var r = range(a, b, str); - - return r && { - start: r[0], - end: r[1], - pre: str.slice(0, r[0]), - body: str.slice(r[0] + a.length, r[1]), - post: str.slice(r[1] + b.length) - }; -} - -function maybeMatch(reg, str) { - var m = str.match(reg); - return m ? m[0] : null; -} - -balanced.range = range; -function range(a, b, str) { - var begs, beg, left, right, result; - var ai = str.indexOf(a); - var bi = str.indexOf(b, ai + 1); - var i = ai; - - if (ai >= 0 && bi > 0) { - if(a===b) { - return [ai, bi]; - } - begs = []; - left = str.length; - - while (i >= 0 && !result) { - if (i == ai) { - begs.push(i); - ai = str.indexOf(a, i + 1); - } else if (begs.length == 1) { - result = [ begs.pop(), bi ]; - } else { - beg = begs.pop(); - if (beg < left) { - left = beg; - right = bi; - } - - bi = str.indexOf(b, i + 1); - } - - i = ai < bi && ai >= 0 ? ai : bi; - } - - if (begs.length) { - result = [ left, right ]; - } - } - - return result; -} diff --git a/node_modules/balanced-match/package.json b/node_modules/balanced-match/package.json deleted file mode 100644 index ce6073e..0000000 --- a/node_modules/balanced-match/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "balanced-match", - "description": "Match balanced character pairs, like \"{\" and \"}\"", - "version": "1.0.2", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/balanced-match.git" - }, - "homepage": "https://github.com/juliangruber/balanced-match", - "main": "index.js", - "scripts": { - "test": "tape test/test.js", - "bench": "matcha test/bench.js" - }, - "devDependencies": { - "matcha": "^0.7.0", - "tape": "^4.6.0" - }, - "keywords": [ - "match", - "regexp", - "test", - "balanced", - "parse" - ], - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "license": "MIT", - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/8..latest", - "firefox/20..latest", - "firefox/nightly", - "chrome/25..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - } -} diff --git a/node_modules/bcryptjs/.npmignore b/node_modules/bcryptjs/.npmignore deleted file mode 100644 index 5625aa3..0000000 --- a/node_modules/bcryptjs/.npmignore +++ /dev/null @@ -1,6 +0,0 @@ -node_modules/ -npm-debug.log -debug.log -doco/ -tests/bench.js -*.png diff --git a/node_modules/bcryptjs/.travis.yml b/node_modules/bcryptjs/.travis.yml deleted file mode 100644 index 7a02062..0000000 --- a/node_modules/bcryptjs/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -language: node_js - -node_js: - - 0.10 - - 0.12 - - 4 - - 6 - -before_script: npm -g install testjs - -env: - - CXX=g++-4.8 -addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-4.8 diff --git a/node_modules/bcryptjs/.vscode/settings.json b/node_modules/bcryptjs/.vscode/settings.json deleted file mode 100644 index df0ff16..0000000 --- a/node_modules/bcryptjs/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "vsicons.presets.angular": false -} \ No newline at end of file diff --git a/node_modules/bcryptjs/LICENSE b/node_modules/bcryptjs/LICENSE deleted file mode 100644 index 066ddb5..0000000 --- a/node_modules/bcryptjs/LICENSE +++ /dev/null @@ -1,50 +0,0 @@ -bcrypt.js ---------- -Copyright (c) 2012 Nevins Bartolomeo -Copyright (c) 2012 Shane Girish -Copyright (c) 2014 Daniel Wirtz - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -isaac.js --------- -Copyright (c) 2012 Yves-Marie K. Rinquin - -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/bcryptjs/README.md b/node_modules/bcryptjs/README.md deleted file mode 100644 index 4891b16..0000000 --- a/node_modules/bcryptjs/README.md +++ /dev/null @@ -1,251 +0,0 @@ -bcrypt.js -========= -Optimized bcrypt in JavaScript with zero dependencies. Compatible to the C++ [bcrypt](https://npmjs.org/package/bcrypt) -binding on node.js and also working in the browser. - -build static donate ❤ - - -Security considerations ------------------------ -Besides incorporating a salt to protect against rainbow table attacks, bcrypt is an adaptive function: over time, the -iteration count can be increased to make it slower, so it remains resistant to brute-force search attacks even with -increasing computation power. ([see](http://en.wikipedia.org/wiki/Bcrypt)) - -While bcrypt.js is compatible to the C++ bcrypt binding, it is written in pure JavaScript and thus slower ([about 30%](https://github.com/dcodeIO/bcrypt.js/wiki/Benchmark)), effectively reducing the number of iterations that can be -processed in an equal time span. - -The maximum input length is 72 bytes (note that UTF8 encoded characters use up to 4 bytes) and the length of generated -hashes is 60 characters. - -Usage ------ -The library is compatible with CommonJS and AMD loaders and is exposed globally as `dcodeIO.bcrypt` if neither is -available. - -### node.js - -On node.js, the inbuilt [crypto module](http://nodejs.org/api/crypto.html)'s randomBytes interface is used to obtain -secure random numbers. - -`npm install bcryptjs` - -```js -var bcrypt = require('bcryptjs'); -... -``` - -### Browser - -In the browser, bcrypt.js relies on [Web Crypto API](http://www.w3.org/TR/WebCryptoAPI)'s getRandomValues -interface to obtain secure random numbers. If no cryptographically secure source of randomness is available, you may -specify one through [bcrypt.setRandomFallback](https://github.com/dcodeIO/bcrypt.js#setrandomfallbackrandom). - -```js -var bcrypt = dcodeIO.bcrypt; -... -``` - -or - -```js -require.config({ - paths: { "bcrypt": "/path/to/bcrypt.js" } -}); -require(["bcrypt"], function(bcrypt) { - ... -}); -``` - -Usage - Sync ------------- -To hash a password: - -```javascript -var bcrypt = require('bcryptjs'); -var salt = bcrypt.genSaltSync(10); -var hash = bcrypt.hashSync("B4c0/\/", salt); -// Store hash in your password DB. -``` - -To check a password: - -```javascript -// Load hash from your password DB. -bcrypt.compareSync("B4c0/\/", hash); // true -bcrypt.compareSync("not_bacon", hash); // false -``` - -Auto-gen a salt and hash: - -```javascript -var hash = bcrypt.hashSync('bacon', 8); -``` - -Usage - Async -------------- -To hash a password: - -```javascript -var bcrypt = require('bcryptjs'); -bcrypt.genSalt(10, function(err, salt) { - bcrypt.hash("B4c0/\/", salt, function(err, hash) { - // Store hash in your password DB. - }); -}); -``` - -To check a password: - -```javascript -// Load hash from your password DB. -bcrypt.compare("B4c0/\/", hash, function(err, res) { - // res === true -}); -bcrypt.compare("not_bacon", hash, function(err, res) { - // res === false -}); - -// As of bcryptjs 2.4.0, compare returns a promise if callback is omitted: -bcrypt.compare("B4c0/\/", hash).then((res) => { - // res === true -}); -``` - -Auto-gen a salt and hash: - -```javascript -bcrypt.hash('bacon', 8, function(err, hash) { -}); -``` - -**Note:** Under the hood, asynchronisation splits a crypto operation into small chunks. After the completion of a chunk, the execution of the next chunk is placed on the back of [JS event loop queue](https://developer.mozilla.org/en/docs/Web/JavaScript/EventLoop), thus efficiently sharing the computational resources with the other operations in the queue. - -API ---- -### setRandomFallback(random) - -Sets the pseudo random number generator to use as a fallback if neither node's `crypto` module nor the Web Crypto -API is available. Please note: It is highly important that the PRNG used is cryptographically secure and that it is -seeded properly! - -| Parameter | Type | Description -|-----------------|-----------------|--------------- -| random | *function(number):!Array.<number>* | Function taking the number of bytes to generate as its sole argument, returning the corresponding array of cryptographically secure random byte values. -| **@see** | | http://nodejs.org/api/crypto.html -| **@see** | | http://www.w3.org/TR/WebCryptoAPI/ - -**Hint:** You might use [isaac.js](https://github.com/rubycon/isaac.js) as a CSPRNG but you still have to make sure to -seed it properly. - -### genSaltSync(rounds=, seed_length=) - -Synchronously generates a salt. - -| Parameter | Type | Description -|-----------------|-----------------|--------------- -| rounds | *number* | Number of rounds to use, defaults to 10 if omitted -| seed_length | *number* | Not supported. -| **@returns** | *string* | Resulting salt -| **@throws** | *Error* | If a random fallback is required but not set - -### genSalt(rounds=, seed_length=, callback) - -Asynchronously generates a salt. - -| Parameter | Type | Description -|-----------------|-----------------|--------------- -| rounds | *number | function(Error, string=)* | Number of rounds to use, defaults to 10 if omitted -| seed_length | *number | function(Error, string=)* | Not supported. -| callback | *function(Error, string=)* | Callback receiving the error, if any, and the resulting salt -| **@returns** | *Promise* | If `callback` has been omitted -| **@throws** | *Error* | If `callback` is present but not a function - -### hashSync(s, salt=) - -Synchronously generates a hash for the given string. - -| Parameter | Type | Description -|-----------------|-----------------|--------------- -| s | *string* | String to hash -| salt | *number | string* | Salt length to generate or salt to use, default to 10 -| **@returns** | *string* | Resulting hash - -### hash(s, salt, callback, progressCallback=) - -Asynchronously generates a hash for the given string. - -| Parameter | Type | Description -|-----------------|-----------------|--------------- -| s | *string* | String to hash -| salt | *number | string* | Salt length to generate or salt to use -| callback | *function(Error, string=)* | Callback receiving the error, if any, and the resulting hash -| progressCallback | *function(number)* | Callback successively called with the percentage of rounds completed (0.0 - 1.0), maximally once per `MAX_EXECUTION_TIME = 100` ms. -| **@returns** | *Promise* | If `callback` has been omitted -| **@throws** | *Error* | If `callback` is present but not a function - -### compareSync(s, hash) - -Synchronously tests a string against a hash. - -| Parameter | Type | Description -|-----------------|-----------------|--------------- -| s | *string* | String to compare -| hash | *string* | Hash to test against -| **@returns** | *boolean* | true if matching, otherwise false -| **@throws** | *Error* | If an argument is illegal - -### compare(s, hash, callback, progressCallback=) - -Asynchronously compares the given data against the given hash. - -| Parameter | Type | Description -|-----------------|-----------------|--------------- -| s | *string* | Data to compare -| hash | *string* | Data to be compared to -| callback | *function(Error, boolean)* | Callback receiving the error, if any, otherwise the result -| progressCallback | *function(number)* | Callback successively called with the percentage of rounds completed (0.0 - 1.0), maximally once per `MAX_EXECUTION_TIME = 100` ms. -| **@returns** | *Promise* | If `callback` has been omitted -| **@throws** | *Error* | If `callback` is present but not a function - -### getRounds(hash) - -Gets the number of rounds used to encrypt the specified hash. - -| Parameter | Type | Description -|-----------------|-----------------|--------------- -| hash | *string* | Hash to extract the used number of rounds from -| **@returns** | *number* | Number of rounds used -| **@throws** | *Error* | If `hash` is not a string - -### getSalt(hash) - -Gets the salt portion from a hash. Does not validate the hash. - -| Parameter | Type | Description -|-----------------|-----------------|--------------- -| hash | *string* | Hash to extract the salt from -| **@returns** | *string* | Extracted salt part -| **@throws** | *Error* | If `hash` is not a string or otherwise invalid - - -Command line ------------- -`Usage: bcrypt [salt]` - -If the input has spaces inside, simply surround it with quotes. - -Downloads ---------- -* [Distributions](https://github.com/dcodeIO/bcrypt.js/tree/master/dist) -* [ZIP-Archive](https://github.com/dcodeIO/bcrypt.js/archive/master.zip) -* [Tarball](https://github.com/dcodeIO/bcrypt.js/tarball/master) - -Credits -------- -Based on work started by Shane Girish at [bcrypt-nodejs](https://github.com/shaneGirish/bcrypt-nodejs) (MIT-licensed), -which is itself based on [javascript-bcrypt](http://code.google.com/p/javascript-bcrypt/) (New BSD-licensed). - -License -------- -New-BSD / MIT ([see](https://github.com/dcodeIO/bcrypt.js/blob/master/LICENSE)) diff --git a/node_modules/bcryptjs/bin/bcrypt b/node_modules/bcryptjs/bin/bcrypt deleted file mode 100644 index ddde604..0000000 --- a/node_modules/bcryptjs/bin/bcrypt +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env node - -var path = require("path"), - bcrypt = require(path.join(__dirname, '..', 'index.js')), - pkg = require(path.join(__dirname, '..', 'package.json')); - -if (process.argv.length < 3) { - process.stderr.write([ // No dependencies, so we do it from hand. - "", - " |_ _ _ _ |_", - " |_)(_| \\/|_)|_ v"+pkg['version']+" (c) "+pkg['author'], - " / | " - ].join('\n')+'\n\n'+" Usage: "+path.basename(process.argv[1])+" [rounds|salt]\n"); - process.exit(1); -} else { - var salt; - if (process.argv.length > 3) { - salt = process.argv[3]; - var rounds = parseInt(salt, 10); - if (rounds == salt) - salt = bcrypt.genSaltSync(rounds); - } else - salt = bcrypt.genSaltSync(); - process.stdout.write(bcrypt.hashSync(process.argv[2], salt)+"\n"); -} diff --git a/node_modules/bcryptjs/bower.json b/node_modules/bcryptjs/bower.json deleted file mode 100644 index 746391a..0000000 --- a/node_modules/bcryptjs/bower.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "bcryptjs", - "description": "Optimized bcrypt in plain JavaScript with zero dependencies.", - "version": "2.4.3", - "main": "dist/bcrypt.min.js", - "license": "New-BSD", - "homepage": "http://dcode.io/", - "repository": { - "type": "git", - "url": "git://github.com/dcodeIO/bcrypt.js.git" - }, - "keywords": ["bcrypt", "password", "auth", "authentication", "encryption", "crypt", "crypto"], - "dependencies": {}, - "devDependencies": {}, - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ] -} diff --git a/node_modules/bcryptjs/dist/README.md b/node_modules/bcryptjs/dist/README.md deleted file mode 100644 index 37a5164..0000000 --- a/node_modules/bcryptjs/dist/README.md +++ /dev/null @@ -1,15 +0,0 @@ -Distributions -============= -bcrypt.js is available as the following distributions: - -* **[bcrypt.js](https://github.com/dcodeIO/bcrypt.js/blob/master/dist/bcrypt.js)** - contains the commented source code. - -* **[bcrypt.min.js](https://github.com/dcodeIO/bcrypt.js/blob/master/dist/bcrypt.min.js)** - has been compiled with Closure Compiler using advanced optimizations. - -* **[bcrypt.min.map](https://github.com/dcodeIO/bcrypt.js/blob/master/dist/bcrypt.min.map)** - contains the source map generated by Closure Compiler. - -* **[bcrypt.min.js.gz](https://github.com/dcodeIO/bcrypt.js/blob/master/dist/bcrypt.min.js.gz)** - has also been gzipped using `-9`. diff --git a/node_modules/bcryptjs/dist/bcrypt.js b/node_modules/bcryptjs/dist/bcrypt.js deleted file mode 100644 index 1b0a648..0000000 --- a/node_modules/bcryptjs/dist/bcrypt.js +++ /dev/null @@ -1,1379 +0,0 @@ -/* - Copyright (c) 2012 Nevins Bartolomeo - Copyright (c) 2012 Shane Girish - Copyright (c) 2014 Daniel Wirtz - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @license bcrypt.js (c) 2013 Daniel Wirtz - * Released under the Apache License, Version 2.0 - * see: https://github.com/dcodeIO/bcrypt.js for details - */ -(function(global, factory) { - - /* AMD */ if (typeof define === 'function' && define["amd"]) - define([], factory); - /* CommonJS */ else if (typeof require === 'function' && typeof module === "object" && module && module["exports"]) - module["exports"] = factory(); - /* Global */ else - (global["dcodeIO"] = global["dcodeIO"] || {})["bcrypt"] = factory(); - -}(this, function() { - "use strict"; - - /** - * bcrypt namespace. - * @type {Object.} - */ - var bcrypt = {}; - - /** - * The random implementation to use as a fallback. - * @type {?function(number):!Array.} - * @inner - */ - var randomFallback = null; - - /** - * Generates cryptographically secure random bytes. - * @function - * @param {number} len Bytes length - * @returns {!Array.} Random bytes - * @throws {Error} If no random implementation is available - * @inner - */ - function random(len) { - /* node */ if (typeof module !== 'undefined' && module && module['exports']) - try { - return require("crypto")['randomBytes'](len); - } catch (e) {} - /* WCA */ try { - var a; (self['crypto']||self['msCrypto'])['getRandomValues'](a = new Uint32Array(len)); - return Array.prototype.slice.call(a); - } catch (e) {} - /* fallback */ if (!randomFallback) - throw Error("Neither WebCryptoAPI nor a crypto module is available. Use bcrypt.setRandomFallback to set an alternative"); - return randomFallback(len); - } - - // Test if any secure randomness source is available - var randomAvailable = false; - try { - random(1); - randomAvailable = true; - } catch (e) {} - - // Default fallback, if any - randomFallback = null; - /** - * Sets the pseudo random number generator to use as a fallback if neither node's `crypto` module nor the Web Crypto - * API is available. Please note: It is highly important that the PRNG used is cryptographically secure and that it - * is seeded properly! - * @param {?function(number):!Array.} random Function taking the number of bytes to generate as its - * sole argument, returning the corresponding array of cryptographically secure random byte values. - * @see http://nodejs.org/api/crypto.html - * @see http://www.w3.org/TR/WebCryptoAPI/ - */ - bcrypt.setRandomFallback = function(random) { - randomFallback = random; - }; - - /** - * Synchronously generates a salt. - * @param {number=} rounds Number of rounds to use, defaults to 10 if omitted - * @param {number=} seed_length Not supported. - * @returns {string} Resulting salt - * @throws {Error} If a random fallback is required but not set - * @expose - */ - bcrypt.genSaltSync = function(rounds, seed_length) { - rounds = rounds || GENSALT_DEFAULT_LOG2_ROUNDS; - if (typeof rounds !== 'number') - throw Error("Illegal arguments: "+(typeof rounds)+", "+(typeof seed_length)); - if (rounds < 4) - rounds = 4; - else if (rounds > 31) - rounds = 31; - var salt = []; - salt.push("$2a$"); - if (rounds < 10) - salt.push("0"); - salt.push(rounds.toString()); - salt.push('$'); - salt.push(base64_encode(random(BCRYPT_SALT_LEN), BCRYPT_SALT_LEN)); // May throw - return salt.join(''); - }; - - /** - * Asynchronously generates a salt. - * @param {(number|function(Error, string=))=} rounds Number of rounds to use, defaults to 10 if omitted - * @param {(number|function(Error, string=))=} seed_length Not supported. - * @param {function(Error, string=)=} callback Callback receiving the error, if any, and the resulting salt - * @returns {!Promise} If `callback` has been omitted - * @throws {Error} If `callback` is present but not a function - * @expose - */ - bcrypt.genSalt = function(rounds, seed_length, callback) { - if (typeof seed_length === 'function') - callback = seed_length, - seed_length = undefined; // Not supported. - if (typeof rounds === 'function') - callback = rounds, - rounds = undefined; - if (typeof rounds === 'undefined') - rounds = GENSALT_DEFAULT_LOG2_ROUNDS; - else if (typeof rounds !== 'number') - throw Error("illegal arguments: "+(typeof rounds)); - - function _async(callback) { - nextTick(function() { // Pretty thin, but salting is fast enough - try { - callback(null, bcrypt.genSaltSync(rounds)); - } catch (err) { - callback(err); - } - }); - } - - if (callback) { - if (typeof callback !== 'function') - throw Error("Illegal callback: "+typeof(callback)); - _async(callback); - } else - return new Promise(function(resolve, reject) { - _async(function(err, res) { - if (err) { - reject(err); - return; - } - resolve(res); - }); - }); - }; - - /** - * Synchronously generates a hash for the given string. - * @param {string} s String to hash - * @param {(number|string)=} salt Salt length to generate or salt to use, default to 10 - * @returns {string} Resulting hash - * @expose - */ - bcrypt.hashSync = function(s, salt) { - if (typeof salt === 'undefined') - salt = GENSALT_DEFAULT_LOG2_ROUNDS; - if (typeof salt === 'number') - salt = bcrypt.genSaltSync(salt); - if (typeof s !== 'string' || typeof salt !== 'string') - throw Error("Illegal arguments: "+(typeof s)+', '+(typeof salt)); - return _hash(s, salt); - }; - - /** - * Asynchronously generates a hash for the given string. - * @param {string} s String to hash - * @param {number|string} salt Salt length to generate or salt to use - * @param {function(Error, string=)=} callback Callback receiving the error, if any, and the resulting hash - * @param {function(number)=} progressCallback Callback successively called with the percentage of rounds completed - * (0.0 - 1.0), maximally once per `MAX_EXECUTION_TIME = 100` ms. - * @returns {!Promise} If `callback` has been omitted - * @throws {Error} If `callback` is present but not a function - * @expose - */ - bcrypt.hash = function(s, salt, callback, progressCallback) { - - function _async(callback) { - if (typeof s === 'string' && typeof salt === 'number') - bcrypt.genSalt(salt, function(err, salt) { - _hash(s, salt, callback, progressCallback); - }); - else if (typeof s === 'string' && typeof salt === 'string') - _hash(s, salt, callback, progressCallback); - else - nextTick(callback.bind(this, Error("Illegal arguments: "+(typeof s)+', '+(typeof salt)))); - } - - if (callback) { - if (typeof callback !== 'function') - throw Error("Illegal callback: "+typeof(callback)); - _async(callback); - } else - return new Promise(function(resolve, reject) { - _async(function(err, res) { - if (err) { - reject(err); - return; - } - resolve(res); - }); - }); - }; - - /** - * Compares two strings of the same length in constant time. - * @param {string} known Must be of the correct length - * @param {string} unknown Must be the same length as `known` - * @returns {boolean} - * @inner - */ - function safeStringCompare(known, unknown) { - var right = 0, - wrong = 0; - for (var i=0, k=known.length; i} UTF8 bytes - * @inner - */ - function stringToBytes(str) { - var out = [], - i = 0; - utfx.encodeUTF16toUTF8(function() { - if (i >= str.length) return null; - return str.charCodeAt(i++); - }, function(b) { - out.push(b); - }); - return out; - } - - // A base64 implementation for the bcrypt algorithm. This is partly non-standard. - - /** - * bcrypt's own non-standard base64 dictionary. - * @type {!Array.} - * @const - * @inner - **/ - var BASE64_CODE = "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(''); - - /** - * @type {!Array.} - * @const - * @inner - **/ - var BASE64_INDEX = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, - 1, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, -1, -1, -1, -1, -1, -1, - -1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, -1, -1, -1, -1, -1, -1, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, -1, -1, -1, -1, -1]; - - /** - * @type {!function(...number):string} - * @inner - */ - var stringFromCharCode = String.fromCharCode; - - /** - * Encodes a byte array to base64 with up to len bytes of input. - * @param {!Array.} b Byte array - * @param {number} len Maximum input length - * @returns {string} - * @inner - */ - function base64_encode(b, len) { - var off = 0, - rs = [], - c1, c2; - if (len <= 0 || len > b.length) - throw Error("Illegal len: "+len); - while (off < len) { - c1 = b[off++] & 0xff; - rs.push(BASE64_CODE[(c1 >> 2) & 0x3f]); - c1 = (c1 & 0x03) << 4; - if (off >= len) { - rs.push(BASE64_CODE[c1 & 0x3f]); - break; - } - c2 = b[off++] & 0xff; - c1 |= (c2 >> 4) & 0x0f; - rs.push(BASE64_CODE[c1 & 0x3f]); - c1 = (c2 & 0x0f) << 2; - if (off >= len) { - rs.push(BASE64_CODE[c1 & 0x3f]); - break; - } - c2 = b[off++] & 0xff; - c1 |= (c2 >> 6) & 0x03; - rs.push(BASE64_CODE[c1 & 0x3f]); - rs.push(BASE64_CODE[c2 & 0x3f]); - } - return rs.join(''); - } - - /** - * Decodes a base64 encoded string to up to len bytes of output. - * @param {string} s String to decode - * @param {number} len Maximum output length - * @returns {!Array.} - * @inner - */ - function base64_decode(s, len) { - var off = 0, - slen = s.length, - olen = 0, - rs = [], - c1, c2, c3, c4, o, code; - if (len <= 0) - throw Error("Illegal len: "+len); - while (off < slen - 1 && olen < len) { - code = s.charCodeAt(off++); - c1 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1; - code = s.charCodeAt(off++); - c2 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1; - if (c1 == -1 || c2 == -1) - break; - o = (c1 << 2) >>> 0; - o |= (c2 & 0x30) >> 4; - rs.push(stringFromCharCode(o)); - if (++olen >= len || off >= slen) - break; - code = s.charCodeAt(off++); - c3 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1; - if (c3 == -1) - break; - o = ((c2 & 0x0f) << 4) >>> 0; - o |= (c3 & 0x3c) >> 2; - rs.push(stringFromCharCode(o)); - if (++olen >= len || off >= slen) - break; - code = s.charCodeAt(off++); - c4 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1; - o = ((c3 & 0x03) << 6) >>> 0; - o |= c4; - rs.push(stringFromCharCode(o)); - ++olen; - } - var res = []; - for (off = 0; off - * Released under the Apache License, Version 2.0 - * see: https://github.com/dcodeIO/utfx for details - */ - var utfx = function() { - "use strict"; - - /** - * utfx namespace. - * @inner - * @type {!Object.} - */ - var utfx = {}; - - /** - * Maximum valid code point. - * @type {number} - * @const - */ - utfx.MAX_CODEPOINT = 0x10FFFF; - - /** - * Encodes UTF8 code points to UTF8 bytes. - * @param {(!function():number|null) | number} src Code points source, either as a function returning the next code point - * respectively `null` if there are no more code points left or a single numeric code point. - * @param {!function(number)} dst Bytes destination as a function successively called with the next byte - */ - utfx.encodeUTF8 = function(src, dst) { - var cp = null; - if (typeof src === 'number') - cp = src, - src = function() { return null; }; - while (cp !== null || (cp = src()) !== null) { - if (cp < 0x80) - dst(cp&0x7F); - else if (cp < 0x800) - dst(((cp>>6)&0x1F)|0xC0), - dst((cp&0x3F)|0x80); - else if (cp < 0x10000) - dst(((cp>>12)&0x0F)|0xE0), - dst(((cp>>6)&0x3F)|0x80), - dst((cp&0x3F)|0x80); - else - dst(((cp>>18)&0x07)|0xF0), - dst(((cp>>12)&0x3F)|0x80), - dst(((cp>>6)&0x3F)|0x80), - dst((cp&0x3F)|0x80); - cp = null; - } - }; - - /** - * Decodes UTF8 bytes to UTF8 code points. - * @param {!function():number|null} src Bytes source as a function returning the next byte respectively `null` if there - * are no more bytes left. - * @param {!function(number)} dst Code points destination as a function successively called with each decoded code point. - * @throws {RangeError} If a starting byte is invalid in UTF8 - * @throws {Error} If the last sequence is truncated. Has an array property `bytes` holding the - * remaining bytes. - */ - utfx.decodeUTF8 = function(src, dst) { - var a, b, c, d, fail = function(b) { - b = b.slice(0, b.indexOf(null)); - var err = Error(b.toString()); - err.name = "TruncatedError"; - err['bytes'] = b; - throw err; - }; - while ((a = src()) !== null) { - if ((a&0x80) === 0) - dst(a); - else if ((a&0xE0) === 0xC0) - ((b = src()) === null) && fail([a, b]), - dst(((a&0x1F)<<6) | (b&0x3F)); - else if ((a&0xF0) === 0xE0) - ((b=src()) === null || (c=src()) === null) && fail([a, b, c]), - dst(((a&0x0F)<<12) | ((b&0x3F)<<6) | (c&0x3F)); - else if ((a&0xF8) === 0xF0) - ((b=src()) === null || (c=src()) === null || (d=src()) === null) && fail([a, b, c ,d]), - dst(((a&0x07)<<18) | ((b&0x3F)<<12) | ((c&0x3F)<<6) | (d&0x3F)); - else throw RangeError("Illegal starting byte: "+a); - } - }; - - /** - * Converts UTF16 characters to UTF8 code points. - * @param {!function():number|null} src Characters source as a function returning the next char code respectively - * `null` if there are no more characters left. - * @param {!function(number)} dst Code points destination as a function successively called with each converted code - * point. - */ - utfx.UTF16toUTF8 = function(src, dst) { - var c1, c2 = null; - while (true) { - if ((c1 = c2 !== null ? c2 : src()) === null) - break; - if (c1 >= 0xD800 && c1 <= 0xDFFF) { - if ((c2 = src()) !== null) { - if (c2 >= 0xDC00 && c2 <= 0xDFFF) { - dst((c1-0xD800)*0x400+c2-0xDC00+0x10000); - c2 = null; continue; - } - } - } - dst(c1); - } - if (c2 !== null) dst(c2); - }; - - /** - * Converts UTF8 code points to UTF16 characters. - * @param {(!function():number|null) | number} src Code points source, either as a function returning the next code point - * respectively `null` if there are no more code points left or a single numeric code point. - * @param {!function(number)} dst Characters destination as a function successively called with each converted char code. - * @throws {RangeError} If a code point is out of range - */ - utfx.UTF8toUTF16 = function(src, dst) { - var cp = null; - if (typeof src === 'number') - cp = src, src = function() { return null; }; - while (cp !== null || (cp = src()) !== null) { - if (cp <= 0xFFFF) - dst(cp); - else - cp -= 0x10000, - dst((cp>>10)+0xD800), - dst((cp%0x400)+0xDC00); - cp = null; - } - }; - - /** - * Converts and encodes UTF16 characters to UTF8 bytes. - * @param {!function():number|null} src Characters source as a function returning the next char code respectively `null` - * if there are no more characters left. - * @param {!function(number)} dst Bytes destination as a function successively called with the next byte. - */ - utfx.encodeUTF16toUTF8 = function(src, dst) { - utfx.UTF16toUTF8(src, function(cp) { - utfx.encodeUTF8(cp, dst); - }); - }; - - /** - * Decodes and converts UTF8 bytes to UTF16 characters. - * @param {!function():number|null} src Bytes source as a function returning the next byte respectively `null` if there - * are no more bytes left. - * @param {!function(number)} dst Characters destination as a function successively called with each converted char code. - * @throws {RangeError} If a starting byte is invalid in UTF8 - * @throws {Error} If the last sequence is truncated. Has an array property `bytes` holding the remaining bytes. - */ - utfx.decodeUTF8toUTF16 = function(src, dst) { - utfx.decodeUTF8(src, function(cp) { - utfx.UTF8toUTF16(cp, dst); - }); - }; - - /** - * Calculates the byte length of an UTF8 code point. - * @param {number} cp UTF8 code point - * @returns {number} Byte length - */ - utfx.calculateCodePoint = function(cp) { - return (cp < 0x80) ? 1 : (cp < 0x800) ? 2 : (cp < 0x10000) ? 3 : 4; - }; - - /** - * Calculates the number of UTF8 bytes required to store UTF8 code points. - * @param {(!function():number|null)} src Code points source as a function returning the next code point respectively - * `null` if there are no more code points left. - * @returns {number} The number of UTF8 bytes required - */ - utfx.calculateUTF8 = function(src) { - var cp, l=0; - while ((cp = src()) !== null) - l += utfx.calculateCodePoint(cp); - return l; - }; - - /** - * Calculates the number of UTF8 code points respectively UTF8 bytes required to store UTF16 char codes. - * @param {(!function():number|null)} src Characters source as a function returning the next char code respectively - * `null` if there are no more characters left. - * @returns {!Array.} The number of UTF8 code points at index 0 and the number of UTF8 bytes required at index 1. - */ - utfx.calculateUTF16asUTF8 = function(src) { - var n=0, l=0; - utfx.UTF16toUTF8(src, function(cp) { - ++n; l += utfx.calculateCodePoint(cp); - }); - return [n,l]; - }; - - return utfx; - }(); - - Date.now = Date.now || function() { return +new Date; }; - - /** - * @type {number} - * @const - * @inner - */ - var BCRYPT_SALT_LEN = 16; - - /** - * @type {number} - * @const - * @inner - */ - var GENSALT_DEFAULT_LOG2_ROUNDS = 10; - - /** - * @type {number} - * @const - * @inner - */ - var BLOWFISH_NUM_ROUNDS = 16; - - /** - * @type {number} - * @const - * @inner - */ - var MAX_EXECUTION_TIME = 100; - - /** - * @type {Array.} - * @const - * @inner - */ - var P_ORIG = [ - 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, - 0x299f31d0, 0x082efa98, 0xec4e6c89, 0x452821e6, 0x38d01377, - 0xbe5466cf, 0x34e90c6c, 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, - 0xb5470917, 0x9216d5d9, 0x8979fb1b - ]; - - /** - * @type {Array.} - * @const - * @inner - */ - var S_ORIG = [ - 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, - 0x6a267e96, 0xba7c9045, 0xf12c7f99, 0x24a19947, 0xb3916cf7, - 0x0801f2e2, 0x858efc16, 0x636920d8, 0x71574e69, 0xa458fea3, - 0xf4933d7e, 0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee, - 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013, 0xc5d1b023, - 0x286085f0, 0xca417918, 0xb8db38ef, 0x8e79dcb0, 0x603a180e, - 0x6c9e0e8b, 0xb01e8a3e, 0xd71577c1, 0xbd314b27, 0x78af2fda, - 0x55605c60, 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, - 0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce, 0xa15486af, - 0x7c72e993, 0xb3ee1411, 0x636fbc2a, 0x2ba9c55d, 0x741831f6, - 0xce5c3e16, 0x9b87931e, 0xafd6ba33, 0x6c24cf5c, 0x7a325381, - 0x28958677, 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193, - 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, 0xef845d5d, - 0xe98575b1, 0xdc262302, 0xeb651b88, 0x23893e81, 0xd396acc5, - 0x0f6d6ff3, 0x83f44239, 0x2e0b4482, 0xa4842004, 0x69c8f04a, - 0x9e1f9b5e, 0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0, - 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3, 0x6eef0b6c, - 0x137a3be4, 0xba3bf050, 0x7efb2a98, 0xa1f1651d, 0x39af0176, - 0x66ca593e, 0x82430e88, 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, - 0x3b8b5ebe, 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, - 0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d, 0x37d0d724, - 0xd00a1248, 0xdb0fead3, 0x49f1c09b, 0x075372c9, 0x80991b7b, - 0x25d479d8, 0xf6e8def7, 0xe3fe501a, 0xb6794c3b, 0x976ce0bd, - 0x04c006ba, 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463, - 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, 0x6dfc511f, - 0x9b30952c, 0xcc814544, 0xaf5ebd09, 0xbee3d004, 0xde334afd, - 0x660f2807, 0x192e4bb3, 0xc0cba857, 0x45c8740f, 0xd20b5f39, - 0xb9d3fbdb, 0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279, - 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8, 0x3c7516df, - 0xfd616b15, 0x2f501ec8, 0xad0552ab, 0x323db5fa, 0xfd238760, - 0x53317b48, 0x3e00df82, 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, - 0xdf1769db, 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, - 0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0, 0x10fa3d98, - 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b, 0x9a53e479, 0xb6f84565, - 0xd28e49bc, 0x4bfb9790, 0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, - 0xcee4c6e8, 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4, - 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, 0xd08ed1d0, - 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7, 0x8ff6e2fb, 0xf2122b64, - 0x8888b812, 0x900df01c, 0x4fad5ea0, 0x688fc31c, 0xd1cff191, - 0xb3a8c1ad, 0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1, - 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299, 0xb4a84fe0, - 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, 0x165fa266, 0x80957705, - 0x93cc7314, 0x211a1477, 0xe6ad2065, 0x77b5fa86, 0xc75442f5, - 0xfb9d35cf, 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, - 0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af, 0x2464369b, - 0xf009b91e, 0x5563911d, 0x59dfa6aa, 0x78c14389, 0xd95a537f, - 0x207d5ba2, 0x02e5b9c5, 0x83260376, 0x6295cfa9, 0x11c81968, - 0x4e734a41, 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915, - 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, 0x08ba6fb5, - 0x571be91f, 0xf296ec6b, 0x2a0dd915, 0xb6636521, 0xe7b9f9b6, - 0xff34052e, 0xc5855664, 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, - 0x6e85076a, 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, - 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266, 0xecaa8c71, - 0x699a17ff, 0x5664526c, 0xc2b19ee1, 0x193602a5, 0x75094c29, - 0xa0591340, 0xe4183a3e, 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, - 0x99f73fd6, 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1, - 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e, 0x09686b3f, - 0x3ebaefc9, 0x3c971814, 0x6b6a70a1, 0x687f3584, 0x52a0e286, - 0xb79c5305, 0xaa500737, 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, - 0x5716f2b8, 0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff, - 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd, 0xd19113f9, - 0x7ca92ff6, 0x94324773, 0x22f54701, 0x3ae5e581, 0x37c2dadc, - 0xc8b57634, 0x9af3dda7, 0xa9446146, 0x0fd0030e, 0xecc8c73e, - 0xa4751e41, 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331, - 0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf, 0x2cb81290, - 0x24977c79, 0x5679b072, 0xbcaf89af, 0xde9a771f, 0xd9930810, - 0xb38bae12, 0xdccf3f2e, 0x5512721f, 0x2e6b7124, 0x501adde6, - 0x9f84cd87, 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c, - 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2, 0xef1c1847, - 0x3215d908, 0xdd433b37, 0x24c2ba16, 0x12a14d43, 0x2a65c451, - 0x50940002, 0x133ae4dd, 0x71dff89e, 0x10314e55, 0x81ac77d6, - 0x5f11199b, 0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509, - 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e, 0x86e34570, - 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3, 0x771fe71c, 0x4e3d06fa, - 0x2965dcb9, 0x99e71d0f, 0x803e89d6, 0x5266c825, 0x2e4cc978, - 0x9c10b36a, 0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, - 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960, 0x5223a708, - 0xf71312b6, 0xebadfe6e, 0xeac31f66, 0xe3bc4595, 0xa67bc883, - 0xb17f37d1, 0x018cff28, 0xc332ddef, 0xbe6c5aa5, 0x65582185, - 0x68ab9802, 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84, - 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, 0x13cca830, - 0xeb61bd96, 0x0334fe1e, 0xaa0363cf, 0xb5735c90, 0x4c70a239, - 0xd59e9e0b, 0xcbaade14, 0xeecc86bc, 0x60622ca7, 0x9cab5cab, - 0xb2f3846e, 0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50, - 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7, 0x9b540b19, - 0x875fa099, 0x95f7997e, 0x623d7da8, 0xf837889a, 0x97e32d77, - 0x11ed935f, 0x16681281, 0x0e358829, 0xc7e61fd6, 0x96dedfa1, - 0x7858ba99, 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696, - 0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128, 0x58ebf2ef, - 0x34c6ffea, 0xfe28ed61, 0xee7c3c73, 0x5d4a14d9, 0xe864b7e3, - 0x42105d14, 0x203e13e0, 0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, - 0xfacb4fd0, 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105, - 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250, 0xcf62a1f2, - 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3, 0x7f1524c3, 0x69cb7492, - 0x47848a0b, 0x5692b285, 0x095bbf00, 0xad19489d, 0x1462b174, - 0x23820e00, 0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061, - 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, 0x7cde3759, - 0xcbee7460, 0x4085f2a7, 0xce77326e, 0xa6078084, 0x19f8509e, - 0xe8efd855, 0x61d99735, 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, - 0x800bcadc, 0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9, - 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340, 0xc5c43465, - 0x713e38d8, 0x3d28f89e, 0xf16dff20, 0x153e21e7, 0x8fb03d4a, - 0xe6e39f2b, 0xdb83adf7, 0xe93d5a68, 0x948140f7, 0xf64c261c, - 0x94692934, 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068, - 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af, 0x1e39f62e, - 0x97244546, 0x14214f74, 0xbf8b8840, 0x4d95fc1d, 0x96b591af, - 0x70f4ddd3, 0x66a02f45, 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, - 0x31cb8504, 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a, - 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb, 0x68dc1462, - 0xd7486900, 0x680ec0a4, 0x27a18dee, 0x4f3ffea2, 0xe887ad8c, - 0xb58ce006, 0x7af4d6b6, 0xaace1e7c, 0xd3375fec, 0xce78a399, - 0x406b2a42, 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b, - 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, 0x3a6efa74, - 0xdd5b4332, 0x6841e7f7, 0xca7820fb, 0xfb0af54e, 0xd8feb397, - 0x454056ac, 0xba489527, 0x55533a3a, 0x20838d87, 0xfe6ba9b7, - 0xd096954b, 0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33, - 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c, 0xfdf8e802, - 0x04272f70, 0x80bb155c, 0x05282ce3, 0x95c11548, 0xe4c66d22, - 0x48c1133f, 0xc70f86dc, 0x07f9c9ee, 0x41041f0f, 0x404779a4, - 0x5d886e17, 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564, - 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b, 0x0e12b4c2, - 0x02e1329e, 0xaf664fd1, 0xcad18115, 0x6b2395e0, 0x333e92e1, - 0x3b240b62, 0xeebeb922, 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, - 0x2da2f728, 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0, - 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e, 0x0a476341, - 0x992eff74, 0x3a6f6eab, 0xf4f8fd37, 0xa812dc60, 0xa1ebddf8, - 0x991be14c, 0xdb6e6b0d, 0xc67b5510, 0x6d672c37, 0x2765d43b, - 0xdcd0e804, 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b, - 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3, 0xbb132f88, - 0x515bad24, 0x7b9479bf, 0x763bd6eb, 0x37392eb3, 0xcc115979, - 0x8026e297, 0xf42e312d, 0x6842ada7, 0xc66a2b3b, 0x12754ccc, - 0x782ef11c, 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350, - 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9, 0x44421659, - 0x0a121386, 0xd90cec6e, 0xd5abea2a, 0x64af674e, 0xda86a85f, - 0xbebfe988, 0x64e4c3fe, 0x9dbc8057, 0xf0f7c086, 0x60787bf8, - 0x6003604d, 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc, - 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f, 0x77a057be, - 0xbde8ae24, 0x55464299, 0xbf582e61, 0x4e58f48f, 0xf2ddfda2, - 0xf474ef38, 0x8789bdc2, 0x5366f9c3, 0xc8b38e74, 0xb475f255, - 0x46fcd9b9, 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2, - 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c, 0xb90bace1, - 0xbb8205d0, 0x11a86248, 0x7574a99e, 0xb77f19b6, 0xe0a9dc09, - 0x662d09a1, 0xc4324633, 0xe85a1f02, 0x09f0be8c, 0x4a99a025, - 0x1d6efe10, 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169, - 0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52, 0x50115e01, - 0xa70683fa, 0xa002b5c4, 0x0de6d027, 0x9af88c27, 0x773f8641, - 0xc3604c06, 0x61a806b5, 0xf0177a28, 0xc0f586e0, 0x006058aa, - 0x30dc7d62, 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634, - 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76, 0x6f05e409, - 0x4b7c0188, 0x39720a3d, 0x7c927c24, 0x86e3725f, 0x724d9db9, - 0x1ac15bb4, 0xd39eb8fc, 0xed545578, 0x08fca5b5, 0xd83d7cd3, - 0x4dad0fc4, 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c, - 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837, 0xd79a3234, - 0x92638212, 0x670efa8e, 0x406000e0, 0x3a39ce37, 0xd3faf5cf, - 0xabc27737, 0x5ac52d1b, 0x5cb0679e, 0x4fa33742, 0xd3822740, - 0x99bc9bbe, 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b, - 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, 0x5748ab2f, - 0xbc946e79, 0xc6a376d2, 0x6549c2c8, 0x530ff8ee, 0x468dde7d, - 0xd5730a1d, 0x4cd04dc6, 0x2939bbdb, 0xa9ba4650, 0xac9526e8, - 0xbe5ee304, 0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22, - 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4, 0x83c061ba, - 0x9be96a4d, 0x8fe51550, 0xba645bd6, 0x2826a2f9, 0xa73a3ae1, - 0x4ba99586, 0xef5562e9, 0xc72fefd3, 0xf752f7da, 0x3f046f69, - 0x77fa0a59, 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, - 0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51, 0x96d5ac3a, - 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28, 0x1f9f25cf, 0xadf2b89b, - 0x5ad6b472, 0x5a88f54c, 0xe029ac71, 0xe019a5e6, 0x47b0acfd, - 0xed93fa9b, 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28, - 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, 0x15056dd4, - 0x88f46dba, 0x03a16125, 0x0564f0bd, 0xc3eb9e15, 0x3c9057a2, - 0x97271aec, 0xa93a072a, 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, - 0x26dcf319, 0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb, - 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f, 0x4de81751, - 0x3830dc8e, 0x379d5862, 0x9320f991, 0xea7a90c2, 0xfb3e7bce, - 0x5121ce64, 0x774fbe32, 0xa8b6e37e, 0xc3293d46, 0x48de5369, - 0x6413e680, 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166, - 0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae, 0x5bbef7dd, - 0x1b588d40, 0xccd2017f, 0x6bb4e3bb, 0xdda26a7e, 0x3a59ff45, - 0x3e350a44, 0xbcb4cdd5, 0x72eacea8, 0xfa6484bb, 0x8d6612ae, - 0xbf3c6f47, 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370, - 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, 0x4040cb08, - 0x4eb4e2cc, 0x34d2466a, 0x0115af84, 0xe1b00428, 0x95983a1d, - 0x06b89fb4, 0xce6ea048, 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, - 0x277227f8, 0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd, - 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9, 0xe01cc87e, - 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, 0x1a908749, 0xd44fbd9a, - 0xd0dadecb, 0xd50ada38, 0x0339c32a, 0xc6913667, 0x8df9317c, - 0xe0b12b4f, 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, - 0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525, 0xfae59361, - 0xceb69ceb, 0xc2a86459, 0x12baa8d1, 0xb6c1075e, 0xe3056a0c, - 0x10d25065, 0xcb03a442, 0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, - 0x3278e964, 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e, - 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, 0xdf359f8d, - 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d, 0xe54cda54, 0x1edad891, - 0xce6279cf, 0xcd3e7e6f, 0x1618b166, 0xfd2c1d05, 0x848fd2c5, - 0xf6fb2299, 0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02, - 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc, 0xde966292, - 0x81b949d0, 0x4c50901b, 0x71c65614, 0xe6c6c7bd, 0x327a140a, - 0x45e1d006, 0xc3f27b9a, 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, - 0x35bdd2f6, 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, - 0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0, 0xba38209c, - 0xf746ce76, 0x77afa1c5, 0x20756060, 0x85cbfe4e, 0x8ae88dd8, - 0x7aaaf9b0, 0x4cf9aa7e, 0x1948c25c, 0x02fb8a8c, 0x01c36ae4, - 0xd6ebe1f9, 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f, - 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6 - ]; - - /** - * @type {Array.} - * @const - * @inner - */ - var C_ORIG = [ - 0x4f727068, 0x65616e42, 0x65686f6c, 0x64657253, 0x63727944, - 0x6f756274 - ]; - - /** - * @param {Array.} lr - * @param {number} off - * @param {Array.} P - * @param {Array.} S - * @returns {Array.} - * @inner - */ - function _encipher(lr, off, P, S) { // This is our bottleneck: 1714/1905 ticks / 90% - see profile.txt - var n, - l = lr[off], - r = lr[off + 1]; - - l ^= P[0]; - - /* - for (var i=0, k=BLOWFISH_NUM_ROUNDS-2; i<=k;) - // Feistel substitution on left word - n = S[l >>> 24], - n += S[0x100 | ((l >> 16) & 0xff)], - n ^= S[0x200 | ((l >> 8) & 0xff)], - n += S[0x300 | (l & 0xff)], - r ^= n ^ P[++i], - // Feistel substitution on right word - n = S[r >>> 24], - n += S[0x100 | ((r >> 16) & 0xff)], - n ^= S[0x200 | ((r >> 8) & 0xff)], - n += S[0x300 | (r & 0xff)], - l ^= n ^ P[++i]; - */ - - //The following is an unrolled version of the above loop. - //Iteration 0 - n = S[l >>> 24]; - n += S[0x100 | ((l >> 16) & 0xff)]; - n ^= S[0x200 | ((l >> 8) & 0xff)]; - n += S[0x300 | (l & 0xff)]; - r ^= n ^ P[1]; - n = S[r >>> 24]; - n += S[0x100 | ((r >> 16) & 0xff)]; - n ^= S[0x200 | ((r >> 8) & 0xff)]; - n += S[0x300 | (r & 0xff)]; - l ^= n ^ P[2]; - //Iteration 1 - n = S[l >>> 24]; - n += S[0x100 | ((l >> 16) & 0xff)]; - n ^= S[0x200 | ((l >> 8) & 0xff)]; - n += S[0x300 | (l & 0xff)]; - r ^= n ^ P[3]; - n = S[r >>> 24]; - n += S[0x100 | ((r >> 16) & 0xff)]; - n ^= S[0x200 | ((r >> 8) & 0xff)]; - n += S[0x300 | (r & 0xff)]; - l ^= n ^ P[4]; - //Iteration 2 - n = S[l >>> 24]; - n += S[0x100 | ((l >> 16) & 0xff)]; - n ^= S[0x200 | ((l >> 8) & 0xff)]; - n += S[0x300 | (l & 0xff)]; - r ^= n ^ P[5]; - n = S[r >>> 24]; - n += S[0x100 | ((r >> 16) & 0xff)]; - n ^= S[0x200 | ((r >> 8) & 0xff)]; - n += S[0x300 | (r & 0xff)]; - l ^= n ^ P[6]; - //Iteration 3 - n = S[l >>> 24]; - n += S[0x100 | ((l >> 16) & 0xff)]; - n ^= S[0x200 | ((l >> 8) & 0xff)]; - n += S[0x300 | (l & 0xff)]; - r ^= n ^ P[7]; - n = S[r >>> 24]; - n += S[0x100 | ((r >> 16) & 0xff)]; - n ^= S[0x200 | ((r >> 8) & 0xff)]; - n += S[0x300 | (r & 0xff)]; - l ^= n ^ P[8]; - //Iteration 4 - n = S[l >>> 24]; - n += S[0x100 | ((l >> 16) & 0xff)]; - n ^= S[0x200 | ((l >> 8) & 0xff)]; - n += S[0x300 | (l & 0xff)]; - r ^= n ^ P[9]; - n = S[r >>> 24]; - n += S[0x100 | ((r >> 16) & 0xff)]; - n ^= S[0x200 | ((r >> 8) & 0xff)]; - n += S[0x300 | (r & 0xff)]; - l ^= n ^ P[10]; - //Iteration 5 - n = S[l >>> 24]; - n += S[0x100 | ((l >> 16) & 0xff)]; - n ^= S[0x200 | ((l >> 8) & 0xff)]; - n += S[0x300 | (l & 0xff)]; - r ^= n ^ P[11]; - n = S[r >>> 24]; - n += S[0x100 | ((r >> 16) & 0xff)]; - n ^= S[0x200 | ((r >> 8) & 0xff)]; - n += S[0x300 | (r & 0xff)]; - l ^= n ^ P[12]; - //Iteration 6 - n = S[l >>> 24]; - n += S[0x100 | ((l >> 16) & 0xff)]; - n ^= S[0x200 | ((l >> 8) & 0xff)]; - n += S[0x300 | (l & 0xff)]; - r ^= n ^ P[13]; - n = S[r >>> 24]; - n += S[0x100 | ((r >> 16) & 0xff)]; - n ^= S[0x200 | ((r >> 8) & 0xff)]; - n += S[0x300 | (r & 0xff)]; - l ^= n ^ P[14]; - //Iteration 7 - n = S[l >>> 24]; - n += S[0x100 | ((l >> 16) & 0xff)]; - n ^= S[0x200 | ((l >> 8) & 0xff)]; - n += S[0x300 | (l & 0xff)]; - r ^= n ^ P[15]; - n = S[r >>> 24]; - n += S[0x100 | ((r >> 16) & 0xff)]; - n ^= S[0x200 | ((r >> 8) & 0xff)]; - n += S[0x300 | (r & 0xff)]; - l ^= n ^ P[16]; - - lr[off] = r ^ P[BLOWFISH_NUM_ROUNDS + 1]; - lr[off + 1] = l; - return lr; - } - - /** - * @param {Array.} data - * @param {number} offp - * @returns {{key: number, offp: number}} - * @inner - */ - function _streamtoword(data, offp) { - for (var i = 0, word = 0; i < 4; ++i) - word = (word << 8) | (data[offp] & 0xff), - offp = (offp + 1) % data.length; - return { key: word, offp: offp }; - } - - /** - * @param {Array.} key - * @param {Array.} P - * @param {Array.} S - * @inner - */ - function _key(key, P, S) { - var offset = 0, - lr = [0, 0], - plen = P.length, - slen = S.length, - sw; - for (var i = 0; i < plen; i++) - sw = _streamtoword(key, offset), - offset = sw.offp, - P[i] = P[i] ^ sw.key; - for (i = 0; i < plen; i += 2) - lr = _encipher(lr, 0, P, S), - P[i] = lr[0], - P[i + 1] = lr[1]; - for (i = 0; i < slen; i += 2) - lr = _encipher(lr, 0, P, S), - S[i] = lr[0], - S[i + 1] = lr[1]; - } - - /** - * Expensive key schedule Blowfish. - * @param {Array.} data - * @param {Array.} key - * @param {Array.} P - * @param {Array.} S - * @inner - */ - function _ekskey(data, key, P, S) { - var offp = 0, - lr = [0, 0], - plen = P.length, - slen = S.length, - sw; - for (var i = 0; i < plen; i++) - sw = _streamtoword(key, offp), - offp = sw.offp, - P[i] = P[i] ^ sw.key; - offp = 0; - for (i = 0; i < plen; i += 2) - sw = _streamtoword(data, offp), - offp = sw.offp, - lr[0] ^= sw.key, - sw = _streamtoword(data, offp), - offp = sw.offp, - lr[1] ^= sw.key, - lr = _encipher(lr, 0, P, S), - P[i] = lr[0], - P[i + 1] = lr[1]; - for (i = 0; i < slen; i += 2) - sw = _streamtoword(data, offp), - offp = sw.offp, - lr[0] ^= sw.key, - sw = _streamtoword(data, offp), - offp = sw.offp, - lr[1] ^= sw.key, - lr = _encipher(lr, 0, P, S), - S[i] = lr[0], - S[i + 1] = lr[1]; - } - - /** - * Internaly crypts a string. - * @param {Array.} b Bytes to crypt - * @param {Array.} salt Salt bytes to use - * @param {number} rounds Number of rounds - * @param {function(Error, Array.=)=} callback Callback receiving the error, if any, and the resulting bytes. If - * omitted, the operation will be performed synchronously. - * @param {function(number)=} progressCallback Callback called with the current progress - * @returns {!Array.|undefined} Resulting bytes if callback has been omitted, otherwise `undefined` - * @inner - */ - function _crypt(b, salt, rounds, callback, progressCallback) { - var cdata = C_ORIG.slice(), - clen = cdata.length, - err; - - // Validate - if (rounds < 4 || rounds > 31) { - err = Error("Illegal number of rounds (4-31): "+rounds); - if (callback) { - nextTick(callback.bind(this, err)); - return; - } else - throw err; - } - if (salt.length !== BCRYPT_SALT_LEN) { - err =Error("Illegal salt length: "+salt.length+" != "+BCRYPT_SALT_LEN); - if (callback) { - nextTick(callback.bind(this, err)); - return; - } else - throw err; - } - rounds = (1 << rounds) >>> 0; - - var P, S, i = 0, j; - - //Use typed arrays when available - huge speedup! - if (Int32Array) { - P = new Int32Array(P_ORIG); - S = new Int32Array(S_ORIG); - } else { - P = P_ORIG.slice(); - S = S_ORIG.slice(); - } - - _ekskey(salt, b, P, S); - - /** - * Calcualtes the next round. - * @returns {Array.|undefined} Resulting array if callback has been omitted, otherwise `undefined` - * @inner - */ - function next() { - if (progressCallback) - progressCallback(i / rounds); - if (i < rounds) { - var start = Date.now(); - for (; i < rounds;) { - i = i + 1; - _key(b, P, S); - _key(salt, P, S); - if (Date.now() - start > MAX_EXECUTION_TIME) - break; - } - } else { - for (i = 0; i < 64; i++) - for (j = 0; j < (clen >> 1); j++) - _encipher(cdata, j << 1, P, S); - var ret = []; - for (i = 0; i < clen; i++) - ret.push(((cdata[i] >> 24) & 0xff) >>> 0), - ret.push(((cdata[i] >> 16) & 0xff) >>> 0), - ret.push(((cdata[i] >> 8) & 0xff) >>> 0), - ret.push((cdata[i] & 0xff) >>> 0); - if (callback) { - callback(null, ret); - return; - } else - return ret; - } - if (callback) - nextTick(next); - } - - // Async - if (typeof callback !== 'undefined') { - next(); - - // Sync - } else { - var res; - while (true) - if (typeof(res = next()) !== 'undefined') - return res || []; - } - } - - /** - * Internally hashes a string. - * @param {string} s String to hash - * @param {?string} salt Salt to use, actually never null - * @param {function(Error, string=)=} callback Callback receiving the error, if any, and the resulting hash. If omitted, - * hashing is perormed synchronously. - * @param {function(number)=} progressCallback Callback called with the current progress - * @returns {string|undefined} Resulting hash if callback has been omitted, otherwise `undefined` - * @inner - */ - function _hash(s, salt, callback, progressCallback) { - var err; - if (typeof s !== 'string' || typeof salt !== 'string') { - err = Error("Invalid string / salt: Not a string"); - if (callback) { - nextTick(callback.bind(this, err)); - return; - } - else - throw err; - } - - // Validate the salt - var minor, offset; - if (salt.charAt(0) !== '$' || salt.charAt(1) !== '2') { - err = Error("Invalid salt version: "+salt.substring(0,2)); - if (callback) { - nextTick(callback.bind(this, err)); - return; - } - else - throw err; - } - if (salt.charAt(2) === '$') - minor = String.fromCharCode(0), - offset = 3; - else { - minor = salt.charAt(2); - if ((minor !== 'a' && minor !== 'b' && minor !== 'y') || salt.charAt(3) !== '$') { - err = Error("Invalid salt revision: "+salt.substring(2,4)); - if (callback) { - nextTick(callback.bind(this, err)); - return; - } else - throw err; - } - offset = 4; - } - - // Extract number of rounds - if (salt.charAt(offset + 2) > '$') { - err = Error("Missing salt rounds"); - if (callback) { - nextTick(callback.bind(this, err)); - return; - } else - throw err; - } - var r1 = parseInt(salt.substring(offset, offset + 1), 10) * 10, - r2 = parseInt(salt.substring(offset + 1, offset + 2), 10), - rounds = r1 + r2, - real_salt = salt.substring(offset + 3, offset + 25); - s += minor >= 'a' ? "\x00" : ""; - - var passwordb = stringToBytes(s), - saltb = base64_decode(real_salt, BCRYPT_SALT_LEN); - - /** - * Finishes hashing. - * @param {Array.} bytes Byte array - * @returns {string} - * @inner - */ - function finish(bytes) { - var res = []; - res.push("$2"); - if (minor >= 'a') - res.push(minor); - res.push("$"); - if (rounds < 10) - res.push("0"); - res.push(rounds.toString()); - res.push("$"); - res.push(base64_encode(saltb, saltb.length)); - res.push(base64_encode(bytes, C_ORIG.length * 4 - 1)); - return res.join(''); - } - - // Sync - if (typeof callback == 'undefined') - return finish(_crypt(passwordb, saltb, rounds)); - - // Async - else { - _crypt(passwordb, saltb, rounds, function(err, bytes) { - if (err) - callback(err, null); - else - callback(null, finish(bytes)); - }, progressCallback); - } - } - - /** - * Encodes a byte array to base64 with up to len bytes of input, using the custom bcrypt alphabet. - * @function - * @param {!Array.} b Byte array - * @param {number} len Maximum input length - * @returns {string} - * @expose - */ - bcrypt.encodeBase64 = base64_encode; - - /** - * Decodes a base64 encoded string to up to len bytes of output, using the custom bcrypt alphabet. - * @function - * @param {string} s String to decode - * @param {number} len Maximum output length - * @returns {!Array.} - * @expose - */ - bcrypt.decodeBase64 = base64_decode; - - return bcrypt; -})); diff --git a/node_modules/bcryptjs/dist/bcrypt.min.js b/node_modules/bcryptjs/dist/bcrypt.min.js deleted file mode 100644 index 0fd2f1e..0000000 --- a/node_modules/bcryptjs/dist/bcrypt.min.js +++ /dev/null @@ -1,48 +0,0 @@ -/* - bcrypt.js (c) 2013 Daniel Wirtz - Released under the Apache License, Version 2.0 - see: https://github.com/dcodeIO/bcrypt.js for details -*/ -(function(u,r){"function"===typeof define&&define.amd?define([],r):"function"===typeof require&&"object"===typeof module&&module&&module.exports?module.exports=r():(u.dcodeIO=u.dcodeIO||{}).bcrypt=r()})(this,function(){function u(e){if("undefined"!==typeof module&&module&&module.exports)try{return require("crypto").randomBytes(e)}catch(d){}try{var c;(self.crypto||self.msCrypto).getRandomValues(c=new Uint32Array(e));return Array.prototype.slice.call(c)}catch(b){}if(!w)throw Error("Neither WebCryptoAPI nor a crypto module is available. Use bcrypt.setRandomFallback to set an alternative"); -return w(e)}function r(e,d){for(var c=0,b=0,a=0,f=e.length;ac?!1:0===b}function H(e){var d=[],c=0;I.encodeUTF16toUTF8(function(){return c>=e.length?null:e.charCodeAt(c++)},function(b){d.push(b)});return d}function x(e,d){var c=0,b=[],a,f;if(0>=d||d>e.length)throw Error("Illegal len: "+d);for(;c>2&63]);a=(a&3)<<4;if(c>=d){b.push(s[a&63]);break}f=e[c++]&255;a|=f>>4&15;b.push(s[a&63]);a=(f&15)<<2;if(c>=d){b.push(s[a& -63]);break}f=e[c++]&255;a|=f>>6&3;b.push(s[a&63]);b.push(s[f&63])}return b.join("")}function B(e,d){var c=0,b=e.length,a=0,f=[],g,m,h;if(0>=d)throw Error("Illegal len: "+d);for(;c>>0;h|=(m&48)>>4;f.push(z(h));if(++a>=d||c>=b)break;h=e.charCodeAt(c++);g=h>>0;h|=(g&60)>>2;f.push(z(h));if(++a>=d||c>=b)break;h=e.charCodeAt(c++);m=h>>0;h|=m;f.push(z(h));++a}b=[];for(c=0;c>>24];a+=b[256|f>>16&255];a^=b[512|f>>8&255];a+=b[768|f&255];g=g^a^c[1];a=b[g>>>24];a+=b[256|g>>16&255];a^=b[512|g>>8&255];a+=b[768|g&255];f=f^a^c[2];a=b[f>>>24];a+=b[256|f>>16&255];a^=b[512|f>>8&255];a+=b[768|f&255];g=g^a^c[3];a=b[g>>>24];a+=b[256|g>>16&255];a^=b[512|g>>8&255];a+=b[768|g&255];f=f^a^c[4];a=b[f>>>24];a+=b[256|f>>16&255];a^=b[512| -f>>8&255];a+=b[768|f&255];g=g^a^c[5];a=b[g>>>24];a+=b[256|g>>16&255];a^=b[512|g>>8&255];a+=b[768|g&255];f=f^a^c[6];a=b[f>>>24];a+=b[256|f>>16&255];a^=b[512|f>>8&255];a+=b[768|f&255];g=g^a^c[7];a=b[g>>>24];a+=b[256|g>>16&255];a^=b[512|g>>8&255];a+=b[768|g&255];f=f^a^c[8];a=b[f>>>24];a+=b[256|f>>16&255];a^=b[512|f>>8&255];a+=b[768|f&255];g=g^a^c[9];a=b[g>>>24];a+=b[256|g>>16&255];a^=b[512|g>>8&255];a+=b[768|g&255];f=f^a^c[10];a=b[f>>>24];a+=b[256|f>>16&255];a^=b[512|f>>8&255];a+=b[768|f&255];g=g^a^ -c[11];a=b[g>>>24];a+=b[256|g>>16&255];a^=b[512|g>>8&255];a+=b[768|g&255];f=f^a^c[12];a=b[f>>>24];a+=b[256|f>>16&255];a^=b[512|f>>8&255];a+=b[768|f&255];g=g^a^c[13];a=b[g>>>24];a+=b[256|g>>16&255];a^=b[512|g>>8&255];a+=b[768|g&255];f=f^a^c[14];a=b[f>>>24];a+=b[256|f>>16&255];a^=b[512|f>>8&255];a+=b[768|f&255];g=g^a^c[15];a=b[g>>>24];a+=b[256|g>>16&255];a^=b[512|g>>8&255];a+=b[768|g&255];f=f^a^c[16];e[d]=g^c[17];e[d+1]=f;return e}function t(e,d){for(var c=0,b=0;4>c;++c)b=b<<8|e[d]&255,d=(d+1)%e.length; -return{key:b,offp:d}}function C(e,d,c){for(var b=0,a=[0,0],f=d.length,g=c.length,m,h=0;hn;n++)for(y=0;y>1;y++)v(g,y<<1,l,k);h=[];for(n=0;n>24&255)>>>0),h.push((g[n]>>16&255)>>>0),h.push((g[n]>>8&255)>>>0),h.push((g[n]&255)>>>0);if(b){b(null,h);return}return h}b&&p(f)}var g=E.slice(),m=g.length,h;if(4>c||31>>0;var l,k,n=0,y;Int32Array?(l=new Int32Array(F),k=new Int32Array(G)):(l=F.slice(),k=G.slice());J(d,e,l,k);if("undefined"!==typeof b)f();else for(;;)if("undefined"!==typeof(h=f()))return h||[]}function A(e,d,c,b){function a(a){var b=[];b.push("$2");"a"<=f&&b.push(f);b.push("$");10>l&&b.push("0");b.push(l.toString());b.push("$");b.push(x(k,k.length));b.push(x(a,4* -E.length-1));return b.join("")}if("string"!==typeof e||"string"!==typeof d){b=Error("Invalid string / salt: Not a string");if(c){p(c.bind(this,b));return}throw b;}var f,g;if("$"!==d.charAt(0)||"2"!==d.charAt(1)){b=Error("Invalid salt version: "+d.substring(0,2));if(c){p(c.bind(this,b));return}throw b;}if("$"===d.charAt(2))f=String.fromCharCode(0),g=3;else{f=d.charAt(2);if("a"!==f&&"b"!==f&&"y"!==f||"$"!==d.charAt(3)){b=Error("Invalid salt revision: "+d.substring(2,4));if(c){p(c.bind(this,b));return}throw b; -}g=4}if("$"e?e=4:31e&&c.push("0");c.push(e.toString());c.push("$");c.push(x(u(16),16));return c.join("")};k.genSalt=function(e,d,c){function b(a){p(function(){try{a(null,k.genSaltSync(e))}catch(b){a(b)}})}"function"===typeof d&&(c=d,d=void 0);"function"===typeof e&&(c=e,e=void 0);if("undefined"===typeof e)e=10;else if("number"!==typeof e)throw Error("illegal arguments: "+typeof e);if(c){if("function"!==typeof c)throw Error("Illegal callback: "+ -typeof c);b(c)}else return new Promise(function(a,c){b(function(b,d){b?c(b):a(d)})})};k.hashSync=function(e,d){"undefined"===typeof d&&(d=10);"number"===typeof d&&(d=k.genSaltSync(d));if("string"!==typeof e||"string"!==typeof d)throw Error("Illegal arguments: "+typeof e+", "+typeof d);return A(e,d)};k.hash=function(e,d,c,b){function a(a){"string"===typeof e&&"number"===typeof d?k.genSalt(d,function(c,d){A(e,d,a,b)}):"string"===typeof e&&"string"===typeof d?A(e,d,a,b):p(a.bind(this,Error("Illegal arguments: "+ -typeof e+", "+typeof d)))}if(c){if("function"!==typeof c)throw Error("Illegal callback: "+typeof c);a(c)}else return new Promise(function(b,c){a(function(a,d){a?c(a):b(d)})})};k.compareSync=function(e,d){if("string"!==typeof e||"string"!==typeof d)throw Error("Illegal arguments: "+typeof e+", "+typeof d);return 60!==d.length?!1:r(k.hashSync(e,d.substr(0,d.length-31)),d)};k.compare=function(e,d,c,b){function a(a){"string"!==typeof e||"string"!==typeof d?p(a.bind(this,Error("Illegal arguments: "+typeof e+ -", "+typeof d))):60!==d.length?p(a.bind(this,null,!1)):k.hash(e,d.substr(0,29),function(b,c){b?a(b):a(null,r(c,d))},b)}if(c){if("function"!==typeof c)throw Error("Illegal callback: "+typeof c);a(c)}else return new Promise(function(b,c){a(function(a,d){a?c(a):b(d)})})};k.getRounds=function(e){if("string"!==typeof e)throw Error("Illegal arguments: "+typeof e);return parseInt(e.split("$")[2],10)};k.getSalt=function(e){if("string"!==typeof e)throw Error("Illegal arguments: "+typeof e);if(60!==e.length)throw Error("Illegal hash length: "+ -e.length+" != 60");return e.substring(0,29)};var p="undefined"!==typeof process&&process&&"function"===typeof process.nextTick?"function"===typeof setImmediate?setImmediate:process.nextTick:setTimeout,s="./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),q=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,54,55,56,57,58,59,60,61,62,63,-1,-1,-1,-1,-1,-1,-1,2,3,4,5,6,7,8,9,10,11,12, -13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,-1,-1,-1,-1,-1,-1,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,-1,-1,-1,-1,-1],z=String.fromCharCode,I=function(){var e={MAX_CODEPOINT:1114111,encodeUTF8:function(d,c){var b=null;"number"===typeof d&&(b=d,d=function(){return null});for(;null!==b||null!==(b=d());)128>b?c(b&127):(2048>b?c(b>>6&31|192):(65536>b?c(b>>12&15|224):(c(b>>18&7|240),c(b>>12&63|128)),c(b>>6&63|128)),c(b&63|128)),b=null},decodeUTF8:function(d,c){for(var b, -a,f,e,k=function(a){a=a.slice(0,a.indexOf(null));var b=Error(a.toString());b.name="TruncatedError";b.bytes=a;throw b;};null!==(b=d());)if(0===(b&128))c(b);else if(192===(b&224))null===(a=d())&&k([b,a]),c((b&31)<<6|a&63);else if(224===(b&240))null!==(a=d())&&null!==(f=d())||k([b,a,f]),c((b&15)<<12|(a&63)<<6|f&63);else if(240===(b&248))null!==(a=d())&&null!==(f=d())&&null!==(e=d())||k([b,a,f,e]),c((b&7)<<18|(a&63)<<12|(f&63)<<6|e&63);else throw RangeError("Illegal starting byte: "+b);},UTF16toUTF8:function(d, -c){for(var b,a=null;null!==(b=null!==a?a:d());)55296<=b&&57343>=b&&null!==(a=d())&&56320<=a&&57343>=a?(c(1024*(b-55296)+a-56320+65536),a=null):c(b);null!==a&&c(a)},UTF8toUTF16:function(d,c){var b=null;"number"===typeof d&&(b=d,d=function(){return null});for(;null!==b||null!==(b=d());)65535>=b?c(b):(b-=65536,c((b>>10)+55296),c(b%1024+56320)),b=null},encodeUTF16toUTF8:function(d,c){e.UTF16toUTF8(d,function(b){e.encodeUTF8(b,c)})},decodeUTF8toUTF16:function(d,c){e.decodeUTF8(d,function(b){e.UTF8toUTF16(b, -c)})},calculateCodePoint:function(d){return 128>d?1:2048>d?2:65536>d?3:4},calculateUTF8:function(d){for(var c,b=0;null!==(c=d());)b+=e.calculateCodePoint(c);return b},calculateUTF16asUTF8:function(d){var c=0,b=0;e.UTF16toUTF8(d,function(a){++c;b+=e.calculateCodePoint(a)});return[c,b]}};return e}();Date.now=Date.now||function(){return+new Date};var F=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069, -3041331479,2450970073,2306472731],G=[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828, -289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486, -1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557, -442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592, -3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370, -48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946,1266315497,3048417604,3681880366,3289982499,290971E4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509, -1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880, -613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303, -2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385, -1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030, -4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055,3913112168, -2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499, -499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905, -3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651, -309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610, -1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037, -2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504,976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200, -2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241, -3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891, -3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409E3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588, -3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493, -1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462],E=[1332899944,1700884034,1701343084,1684370003,1668446532, -1869963892];k.encodeBase64=x;k.decodeBase64=B;return k}); diff --git a/node_modules/bcryptjs/dist/bcrypt.min.js.gz b/node_modules/bcryptjs/dist/bcrypt.min.js.gz deleted file mode 100644 index 6bde4bde53a58f73d813ca1143452f52f3dfd122..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9443 zcmV<9BpllxiwFp$mYG-r17c%xd2nUYI6Y0T4{INMwb1~UqSP9^8jI)t_=l% zB&2a1J8`n!UvC!5Xny7%J6c)FR~B;9m5 ze_=(w{pQ8qg3)r-9A=w%I$JkBdC_o2H;Z%wInE7Rx%aK|wiQLu=I%OMj<9+(U1aTc z{%<#)56|;U=i(B3dZ+fRvR`keD{N{llV7rQQ+qXE4sT|7bNFvJ`*6KnZPw?9x6#UR zd(KU_@FS|Ow%hxi+s)mgMLXBoOr~pAx#QlKm(3d|bML1kr$u0r;ltLmN1EeqR(JQS zY;&_(ls-8vt903NyQ_FHT+Tne+hl8~*ro9%oj61Hen-1*<5e^5JL_yV>gGGPTYEEK zzp}S(cbsj$vm$Pon?#hX3~!bqkg9oyKrj~uU;Y0FE>u?f;+>*C+D3`+Uskj+Mz?=@%4tQa6miROsx#?Pd$&&kyh32(ww@pTMaxrjVANRVJM;Zf3LIfjw!b zr61LVW*_05{V-&MgH?ydNcyS{fDw#01IN1XUsG~8~7XQj5osJ)%dvT;0X;$5%V z>I~gJ!Pid*!@heTN7)4|xok_%>nFJZ>x=m8Oty`>bo+7S#BJpc2AUMXBbcyXmaj=x zS$wq{)g{H-Xmoa_+oCSCk~qS1h?FNqHvX|p(^d~eR`(-&zbn8?y1y)^3#Zkp5$Mxn z6idts4gu6Lo3lv?>m#8|o{M%nwunxm2Vw4yqsidck_x|GOfGxRMgP>o`Kg64<++HW z@peo9%w3BOwvPef+1VNIPqvXWZ|lGXFJ*jc# zNrCg9)VAPBZ3~~&Hu03%(15(B%?I(c2_c>~BZPih>z+0x1agAvAEe{Pw>PMQ(Woq) z*}imcPEKNdeU_p&r*0A@gF&z*X{3VE2_66_%?!XWUuWqpVNxkf_6ql4epZ4BW&7jV2$Oe=Da={CNbLl&7^H3q_9Xf&-eldy z^1b8s@uJ;+<}5mqU_`VTyK-?c%r6AzgZ<*?6Swd7v)MYcfm^^~qt6!o1tLNZ?(pDl zFh{=i@9^l>8MC{=Kv+>2V~Podwk?1Y?V98hiZi}gTvFOnez-K|xa{y%p1~(y1s{2{ ze@p;?Y>7iB4>l>MpK>;y?2>l-+8Mb!LT4Pk&d-643;vBO{*e%5^meNRu*7J4GzTwk z<_XS&bWmU7P`qwB`neJ=&BkeI!L^fglj&lZpQ{^_Y7pDyqxGauM@?a#MO9Xx(6q+s zu$jNLlXtPQ(`r78n!>bBYdfVZjl^J(+Od*cN1PaKGHHb#-b~!1#``36Y_}Q#_*W#_}?X0_5e!p2w7i03S zzNNVS;9Rk*GJ>_IG1H$kUKcN(i`pQ*KcA7`Yb(44Pqy7Yd`O4IiX4mEcs3n2^F_@U zmLaE*|E@NQoF}jTp%>F_OMbgb^FtX#J`6to&GD4-c?J9z22@C+r}S-sa!a za+a=dlH3l5GwD9wmfVJ@rVzVFQI3Civ|7$z6=xe5hwh<@3RPck9f`?m1iO`#7kBmo z4juZaKI+gayPcl$NHYC+j~csiqzktOmC|uX*42JBU9TySxmsIM{$Tv(k>HulfA)2p}^As0U!`)t**YemIy6z4T>~dxI zJN7=JH+}kCcmrw{U-ACp-tUSxR}a6uMU|q=y?-BNJ1iP!i|>K`_jil5_L}U-B4nfB z)}y@Y*Aw;hSCV)&zL{r>&6=3gDA#sc47XJ_V`9wCvq<;QVzPGI$s#n6em+v7a-~(} zii_%mMQN=%71!B8bxLd1DJ|;|kTEWWr7A$_z5wl=KXBYmpk+->sHR@mKlBmcaUPWe z@aTK%{!?m9pY(R_?&L>txSU2q%*VG&Bpmwosa2U>m9eZ^bgEI zomXz5992S7!YLmaVk#nT@3g!J4~OUbUA=23u9f3|Ch=X{_5USy?a38Cid+eiE3T6b zP{bft?Dmoxxzgnv9U?oyuYW5o46n_^^t;5$*%P1aDS8uTi*glB-)_OB!iz`K>GvEu ze|*d<#~Q~m?;SdIDAE?vXYinx`+4Z23|)2@%H%xG>w?|5veeEy<9{l%=$AS>*Bo@; z)2#Xf1ga=g4K`VKeLb6QYzw@Qmo(E9`j2|tlW2zs8`ppQ0~Cd{c7|(Y2ZuOA-MswH zbT~MNu$?A?>*(Y$>UyoLerge>q_^{VHk{)8e_p@o z9dGa9?YrqbTi$HgI%;)ay!`alXRqIU{>9rb|MJ(bzW(OhzkT=pyB~i1>F@vjKXH=6 z=<#Iw%hhbYSYH3ST5oP{-+#FKjSH!?XZ#>+mGNr1?APexxnTbx|Ie9Vo@SoMJi|Pn zc>(i6W;io~8Oe+~y-hO3u!|Yyvw(%*9}|KJ$r?g2p_%Y7i80|b5ik)li6~=}WKuDy zne>=6O!}t;2jBx!oGHN+v?!)DQyx=>DW9o;sgP;Tv|t(s6d0kI_Lw$I`%DK+hs@*5 zgHMuq$F^Ux-%cH|*xRT!^AQoV=>DshfB(N%-+cD^+i%`}{jMj3(D;v4KMM!FYKt8r z^P{+(#ZM0*i5&tT{)kLlcE#_EbPd`k+ih`0yJ+5Zg$&N@l++f|cYBWHx_DrJF%?@8 zN<226r%d@=$hPpdQfj=&9|UcGD>Y6(<$I&Hkn9!@%)$NsCiiQ{hS^7)ufE~3M$ASG z=bXKxG5rP|7oSZyi@WFs*@tgNwx$;cs`7vsAAN#Y#Pcj_y<0&RQgmn+weUQlzodxb zeswhLALB*8?nZRqwl2_kS^n4!swE zeT4vE>6WTX0p#mN-I=v*S;5n|QUMV>`i4g&kP#SnW?E>TGBn&>_w{cl!= z2Y-K(?f)}jV^9EG+}B+Bm`n`jF@;+o z5^~{bUtnYbVn7D~V!9Aq$&lQ~HjHk8N0Ut`Md*2&hMJJ;Fz|IiGfg11QXX&y-Y{GP zKpb-up;dqpM*;I708-X(SPFL-;RNxh1h5<8 zMTl@>rjk;IzK>A|HUmSU14I?AP|oOU=DhD#u#J{&ACVq=mLybD#>l1 z_!|V0(gVqF%~Kkl!9W?RFfSMY4Fo|FV=d683?ev<5P%EYz*^t;DWJ$OO?KI#9fk%- zSen*_31JGR@Q_w=;#>nJXivdLn+zUNPSBKZv?fq}Dlj_4V^CZQ?gbhmC``z!kYcNR z14ao*qa+2^MuRef`$P^RFcRDIKtJ+VVM$1(i-pJ$@Qy-bLR2U?4OO5$AV;!=iues1 zsGg7~Si`7fp;~|*h_dEX^*lPWAlX9|AVw5$pcLZd10n{3aIDFHXObVspDW9B%_lc+$5Dt&QZnu5NQ^M#3vvSpkkvC zQyL=ip%!sL=ry_vh!NV*;m{{2Ur}0Prw0q!%U9mKcMS!A7ddloOBygK>HXJtP@K1%l#)YzEv^b~unk zUBd!ReTxbzNW?vO+kgawgcIOk9SSNMBSe7H@DXvajSEdsQ-eX7Ra6{sWJlVdhH^UO zBa8;rr!t4lfprvt1S`-p?Y9FDTtHjpL`L)+FQg9uU<&dQWsMQyf>^<9KSgk$0rnzP z7*EI=Xa#4e5C@bwm=>rRp`Bsekn{}!SHLu&wnN_M3KS3Nin;>gjdb&Bn+Ka}rsEfepot8Ze}wEQ4zR6)A_2LtB>s4sr$fdeEt8uCVNf)tC_AC(1n7iA%H& zm}oGW09;@lSfo)Fkf%fz8dosBQeC3q$b|Gg2-${0!@Phhjgbr@kw`Eb6^@hBKBX@*!;lB0O9Bik!{8;7N>e5qLxs(Hh;mIG7Ez_n zK?5=}6(t0kAec%R8ue?yE{PLRMr9le{=a5B*RkX{qA=|Dn+Ui@?F$4s1o#vJ4H>d% z%8{dY*Z;*G0unInVOM2kMw~5@X_sw!;IQad%iT~VQlSNchR4(`CS5sY zLuT88N|GO#$EIuP)eU8ZXFGYHQm5bZ108o5_0sdx)OGakWYE(}0^s`AchGUr^u_N9 z{MxS8syZG&uG%Y4iYX>fzPy^cx3-}@EpT~p2vHYbY^fiDikd(0`?-<5etl6rfYf4W zh8R)zclpR3j!a46 zjhH68K=CZo6%WNt24ORbzb@0Mp^+s9Ai(cKP}N9OQaT~%*76C`=}sk+&}^lbN|@rcjgBc4a7H@idAuJl z+(69bwv(Q&;&_SoK8}IiKBHsOlYwpPWe0oB+w)1~NV^xOEI`L7?e%k?G(?sB`GM1c z{XJ?d8tu5DZv46dfX}?#C$^SkYR2HULnQ4D0Q(mzGi>cJwz_$vXl{JeDzZAboyv&>Z}`*LW?}$ z8vCuBM!(!@j9l&nPwjsatQB`1S1F#UoQH4+vF_g*|1 z1M?Z`5UdN~b~@tL(X$d>A8wcY;M*N)fc=h{-%|!4`ix=^Fv9Mg`!tlu#4%c5E(c`>L-3{o%aFS0%Xn(tsKmh_$KEN0UdB3G9WH zhOXN&SwRg4fh7NyF5X4f!S11XlD}{b%=ROji!9)`GY2(3D2i%`EPuqWxNs}b3IwmCS+#!XeAv~>T z)_2^)*Z`Q_7e(JgM#n1Xc|lg%{3I4WHB%Lmfo9>3rUZE2#Yc~V!cf@dS z=(}=pJJa98PTQTbSBj%5>|XMZc|U_@tYE1HgMiYazf&-P9uQ3XVMw?oFqH-@l2?xmrmKusC?nhtHznz zP^-FqMI@A{u#R5rZN{YeM)Bj#Jqs3nc=Z^i4;&^_@4xh3ug};Kc`KeyY+Z7y3|fbS z24bGhwwkP{g_G4H9|FZ3A(ni&%oC071kxqUlfQ~LX@RkA7Zg9hd8fjwzvCzaPd|8C z51{I7B5^9O7pHHpQ2^)IpGy8CWfWP8X(GNYO@&I^(N2fM!1yO$vW;n?()!+8a(qZs zqTN@^eE@qf^<_m4d(_G*PO7RdKpwjGCdRLiihVkh4-JXdof13QD*`cEo{|738LCsx z669XaNx&Ca-jh8E*l6(TG!CrCP!_(uR56>W)}qm~KOP5zH~1vvd7DwxT{{--?!uQMCs9 z4&fX-cTz)>4^x?!jr+WW%gLeq47p@yZ^q^{Q)pcmXdeGBV~WgWw<-S}s7seb)#o(A zJ*5*kPTcb7rBn7(&AyWNc#H+UCuvGIFxo#4=Riy823;BE# zM9lZJ^+`u7!#3W~Kwh(Mb2JNNedGhSpla?YhR9|QWD%dClm+Rmh8U58(y*7kY;wWt z<(w{Z^c11d(Q&+QV)B-IBFKpd-_U5%#LKiGF~VxqM@eOCp>Os{ufhYLvddyF03bUS zK)&xcDojiZgMP?2{u+k%;guD}NtM<@+0-gz8?`c8h)cP?1C^cHBEdT8js^XO3bLC{ z>~mLbL+g{kBDYHlUK3OX;=xPincTTp@>rJL>R8>g*j%*$wGf4%&!`Ut*^3M)Ni*qp z0!5peWL4{_lc`KIveOvnrSZo~Wll{-zT*5Gzv{O-^62Xt2tLwF7^Oah>ymiKce5fN zTiI?q7s5&#*p4c|4CO^LDd9kAl7KK=e~Jn>!4l1#x!)&a#JTB;P##OX9P(yJ!qWF! z;5eQ>*%_!%7x#&>#FR!Gu>d$ST4YiCZWFIRL#};BTMgk7ZZpAajW09uPMC1m<4xQ- zqozxl{OpT3f3qPSou@blQKMjrY7FE~=B9sX~;J_wZI#~m<&gj}8 zVVyj(&%CEng@;l-`tSefyi z=O_z){kS%%Q(bGvuStqi-WCx0jzOw%~Ppd@625V&)I(gY=}0Kdiy5>iI1LVPMQ*^Xb31PGqql>xdCwT z^|pbE9p$Gd`twZMDzWs*Jtpe*32}tTFhF@VSVLfTMK70*|qQgl?T|O1K`QCoXgIWnv1m zVyDvP27UK2bNyI%pJ{v$(s$Grp9!1U-chfz+s|A$3Fdt4+(6jx?}Ta_;M)Xl0+mGU zmun{dr+Y+2>Q7$A>znMiv+F)^nLWMd`))qGj{%3vm`9ZsxtcFwf{v%&&jWv;gykD% z-3s|(Ef?WebaG8J!m}KR{+$>_zGWhZmkD@xNglU3e1wF{4FRc{Nl?%=k~Qo%b?vdr zUj!B(zLVXvw)ZoxZCea{&c~Q(x<(g3Cw*st~Y+d8ZNXGeM%1z?~dp)Quh1IXOYl0r?mM9AH=>rpIz( z7J#x&EPI*7OUnhQ>+p%MaUDrK(y@S!kNJ=)7dgljovay}{M3-NeZ&>ZOlni}7rFY= zYai+?eI=9CqjS?BS(Vm%CdD7zn>$W9HCkTu6jKaHx|Fi9B$|Kmtaq6ysGA3`w{@Vd zDa}P4^Zv!iLwL}E9?N9+xxPS7CiXD-qkZNp<0#N*AbQM2uf;$%L>ot(jb=hVk@iZD zB8^@!b!(ouyuWjLA;7av>a>n9^4G)vmyC-donX7?ByO;TkwEUf|bnc5vxC z%arkx=$PBd8>rk&)C>kMuurGWtvV6@H3R87pG}jb9^VPAZcga995DkeEzPUDZDwvW zj-)>rMjZZIfz-V1?So%=#RsV^OTu^^4w9PHq35j1Si_CGuv^rB0%kbF1y7D`e8~X3vChpL1bz8^u-;wE0TeE^qnVan%J(kbS@@(>p)*pXp1;SizqjP-J1 zFa?qKzt{OUYYgP^j%EoF_~#kC9n;2#DZNV)2<0JEwc|eF40*B}7XW0>A~uDF^RcIB z(y~wC66>{@l+`-)YgJ8scNnX-GO=-g&2S8zOAIOv%jzW7Nml#8P5oT>Xp{D=L?aA5 zZTyG(b+M1^yj|Or54ls2{yOx^>iW}#LL{rQs`nd0-gBL1Puh!_f*P0qge76eBm+il z_xa2Sz1I2O?F0SQmWtZhmVO6`Hr0t;)i0Sf@H3H<(;ya&KijM^PH`zw0!*3zqIp3fu3A&M(&^ zjv3{wo4Dc}2COnxF#nl(4Xx$o!r>0}J6C4m_h{2N;7~v4dhUT4oUOJJWzW@*b?$h6 zIO$qaj(t88G3-W?&o4){ee*%lt%PE(!2oID>+udn?WVxmz-^HL;Q7YS{d6Mp>lG+u z`w@JvytY3+zyIT(#c5oLk#;~LQCo3fe@APE`R!q&8fUgrMwgWvwTlKkiY{`U8u{{vlS@4kXm006b6Uv>Zh diff --git a/node_modules/bcryptjs/dist/bcrypt.min.map b/node_modules/bcryptjs/dist/bcrypt.min.map deleted file mode 100644 index 35d0f83..0000000 --- a/node_modules/bcryptjs/dist/bcrypt.min.map +++ /dev/null @@ -1,8 +0,0 @@ -{ -"version":3, -"file":"", -"lineCount":48, -"mappings":"A;;;;;AAiCC,SAAQ,CAACA,CAAD,CAASC,CAAT,CAAkB,CAES,UAAtB,GAAI,MAAOC,OAAX,EAAoCA,MAAA,IAApC,CACNA,MAAA,CAAO,EAAP,CAAWD,CAAX,CADM,CAEiC,UAAvB,GAAI,MAAOE,QAAX,EAAuD,QAAvD,GAAqC,MAAOC,OAA5C,EAAmEA,MAAnE,EAA6EA,MAAA,QAA7E,CAChBA,MAAA,QADgB,CACIH,CAAA,EADJ,CAGhB,CAACD,CAAA,QAAD,CAAqBA,CAAA,QAArB,EAA0C,EAA1C,QAHgB,CAG0CC,CAAA,EAPvC,CAA1B,CAAA,CASC,IATD,CASO,QAAQ,EAAG,CAwBfI,QAASA,EAAM,CAACC,CAAD,CAAM,CACN,GAAsB,WAAtB,GAAI,MAAOF,OAAX,EAAqCA,MAArC,EAA+CA,MAAA,QAA/C,CACP,GAAI,CACA,MAAOD,QAAA,CAAQ,QAAR,CAAA,YAAA,CAAiCG,CAAjC,CADP,CAEF,MAAOC,CAAP,CAAU,EACN,GAAI,CACV,IAAIC,CAAG,EAACC,IAAA,OAAD,EAAiBA,IAAA,SAAjB,iBAAA,CAAsDD,CAAtD,CAA0D,IAAIE,WAAJ,CAAgBJ,CAAhB,CAA1D,CACP,OAAOK,MAAAC,UAAAC,MAAAC,KAAA,CAA2BN,CAA3B,CAFG,CAGZ,MAAOD,CAAP,CAAU,EACG,GAAKQ,CAAAA,CAAL,CACX,KAAMC,MAAA,CAAM,2GAAN,CAAN;AACJ,MAAOD,EAAA,CAAeT,CAAf,CAXU,CA6KrBW,QAASA,EAAiB,CAACC,CAAD,CAAQC,CAAR,CAAiB,CAGvC,IAHuC,IACnCC,EAAQ,CAD2B,CAEnCC,EAAQ,CAF2B,CAG9BC,EAAE,CAH4B,CAGzBC,EAAEL,CAAAM,OAAhB,CAA8BF,CAA9B,CAAgCC,CAAhC,CAAmC,EAAED,CAArC,CACQJ,CAAAO,WAAA,CAAiBH,CAAjB,CAAJ,GAA4BH,CAAAM,WAAA,CAAmBH,CAAnB,CAA5B,CACI,EAAEF,CADN,CAGI,EAAEC,CAGV,OAAY,EAAZ,CAAID,CAAJ,CACW,CAAA,CADX,CAEiB,CAFjB,GAEOC,CAZgC,CAyH3CK,QAASA,EAAa,CAACC,CAAD,CAAM,CAAA,IACpBC,EAAM,EADc,CAEpBN,EAAI,CACRO,EAAAC,kBAAA,CAAuB,QAAQ,EAAG,CAC9B,MAAIR,EAAJ,EAASK,CAAAH,OAAT,CAA4B,IAA5B,CACOG,CAAAF,WAAA,CAAeH,CAAA,EAAf,CAFuB,CAAlC,CAGG,QAAQ,CAACS,CAAD,CAAI,CACXH,CAAAI,KAAA,CAASD,CAAT,CADW,CAHf,CAMA,OAAOH,EATiB,CAiD5BK,QAASA,EAAa,CAACF,CAAD,CAAIzB,CAAJ,CAAS,CAAA,IACvB4B,EAAM,CADiB,CAEvBC,EAAK,EAFkB,CAGvBC,CAHuB,CAGnBC,CACR,IAAW,CAAX,EAAI/B,CAAJ,EAAgBA,CAAhB,CAAsByB,CAAAP,OAAtB,CACI,KAAMR,MAAA,CAAM,eAAN,CAAsBV,CAAtB,CAAN,CACJ,IAAA,CAAO4B,CAAP,CAAa5B,CAAb,CAAA,CAAkB,CACd8B,CAAA,CAAKL,CAAA,CAAEG,CAAA,EAAF,CAAL,CAAgB,GAChBC,EAAAH,KAAA,CAAQM,CAAA,CAAaF,CAAb,EAAmB,CAAnB,CAAwB,EAAxB,CAAR,CACAA,EAAA,EAAMA,CAAN,CAAW,CAAX,GAAoB,CACpB,IAAIF,CAAJ,EAAW5B,CAAX,CAAgB,CACZ6B,CAAAH,KAAA,CAAQM,CAAA,CAAYF,CAAZ,CAAiB,EAAjB,CAAR,CACA,MAFY,CAIhBC,CAAA,CAAKN,CAAA,CAAEG,CAAA,EAAF,CAAL,CAAgB,GAChBE,EAAA,EAAOC,CAAP,EAAa,CAAb,CAAkB,EAClBF,EAAAH,KAAA,CAAQM,CAAA,CAAYF,CAAZ,CAAiB,EAAjB,CAAR,CACAA,EAAA,EAAMC,CAAN,CAAW,EAAX,GAAoB,CACpB,IAAIH,CAAJ,EAAW5B,CAAX,CAAgB,CACZ6B,CAAAH,KAAA,CAAQM,CAAA,CAAYF,CAAZ;AAAiB,EAAjB,CAAR,CACA,MAFY,CAIhBC,CAAA,CAAKN,CAAA,CAAEG,CAAA,EAAF,CAAL,CAAgB,GAChBE,EAAA,EAAOC,CAAP,EAAa,CAAb,CAAkB,CAClBF,EAAAH,KAAA,CAAQM,CAAA,CAAYF,CAAZ,CAAiB,EAAjB,CAAR,CACAD,EAAAH,KAAA,CAAQM,CAAA,CAAYD,CAAZ,CAAiB,EAAjB,CAAR,CAnBc,CAqBlB,MAAOF,EAAAI,KAAA,CAAQ,EAAR,CA3BoB,CAqC/BC,QAASA,EAAa,CAACC,CAAD,CAAInC,CAAJ,CAAS,CAAA,IACvB4B,EAAM,CADiB,CAEvBQ,EAAOD,CAAAjB,OAFgB,CAGvBmB,EAAO,CAHgB,CAIvBR,EAAK,EAJkB,CAKvBC,CALuB,CAKnBC,CALmB,CAKPO,CACpB,IAAW,CAAX,EAAItC,CAAJ,CACI,KAAMU,MAAA,CAAM,eAAN,CAAsBV,CAAtB,CAAN,CACJ,IAAA,CAAO4B,CAAP,CAAaQ,CAAb,CAAoB,CAApB,EAAyBC,CAAzB,CAAgCrC,CAAhC,CAAA,CAAqC,CACjCuC,CAAA,CAAOJ,CAAAhB,WAAA,CAAaS,CAAA,EAAb,CACPE,EAAA,CAAKS,CAAA,CAAOC,CAAAtB,OAAP,CAA6BsB,CAAA,CAAaD,CAAb,CAA7B,CAAmD,EACxDA,EAAA,CAAOJ,CAAAhB,WAAA,CAAaS,CAAA,EAAb,CACPG,EAAA,CAAKQ,CAAA,CAAOC,CAAAtB,OAAP,CAA6BsB,CAAA,CAAaD,CAAb,CAA7B,CAAmD,EACxD,IAAW,EAAX,EAAIT,CAAJ,EAAuB,EAAvB,EAAgBC,CAAhB,CACI,KACJO,EAAA,CAAKR,CAAL,EAAW,CAAX,GAAkB,CAClBQ,EAAA,GAAMP,CAAN,CAAW,EAAX,GAAoB,CACpBF,EAAAH,KAAA,CAAQe,CAAA,CAAmBH,CAAnB,CAAR,CACA,IAAI,EAAED,CAAN,EAAcrC,CAAd,EAAqB4B,CAArB,EAA4BQ,CAA5B,CACI,KACJG,EAAA,CAAOJ,CAAAhB,WAAA,CAAaS,CAAA,EAAb,CACPc,EAAA,CAAKH,CAAA,CAAOC,CAAAtB,OAAP,CAA6BsB,CAAA,CAAaD,CAAb,CAA7B,CAAmD,EACxD,IAAW,EAAX,EAAIG,CAAJ,CACI,KACJJ,EAAA,EAAMP,CAAN,CAAW,EAAX,GAAoB,CAApB,GAA2B,CAC3BO,EAAA,GAAMI,CAAN,CAAW,EAAX,GAAoB,CACpBb,EAAAH,KAAA,CAAQe,CAAA,CAAmBH,CAAnB,CAAR,CACA,IAAI,EAAED,CAAN,EAAcrC,CAAd,EAAqB4B,CAArB,EAA4BQ,CAA5B,CACI,KACJG,EAAA,CAAOJ,CAAAhB,WAAA,CAAaS,CAAA,EAAb,CACPe,EAAA,CAAKJ,CAAA,CAAOC,CAAAtB,OAAP;AAA6BsB,CAAA,CAAaD,CAAb,CAA7B,CAAmD,EACxDD,EAAA,EAAMI,CAAN,CAAW,CAAX,GAAoB,CAApB,GAA2B,CAC3BJ,EAAA,EAAKK,CACLd,EAAAH,KAAA,CAAQe,CAAA,CAAmBH,CAAnB,CAAR,CACA,GAAED,CA1B+B,CA4BjCO,CAAAA,CAAM,EACV,KAAKhB,CAAL,CAAW,CAAX,CAAcA,CAAd,CAAkBS,CAAlB,CAAwBT,CAAA,EAAxB,CACIgB,CAAAlB,KAAA,CAASG,CAAA,CAAGD,CAAH,CAAAT,WAAA,CAAmB,CAAnB,CAAT,CACJ,OAAOyB,EAvCoB,CAggB/BC,QAASA,EAAS,CAACC,CAAD,CAAKlB,CAAL,CAAUmB,CAAV,CAAaC,CAAb,CAAgB,CAAA,IAC1BC,CAD0B,CAE1BC,EAAIJ,CAAA,CAAGlB,CAAH,CAFsB,CAG1BuB,EAAIL,CAAA,CAAGlB,CAAH,CAAS,CAAT,CAHsB,CAK9BsB,EAAAA,CAAAA,CAAKH,CAAA,CAAE,CAAF,CAoBLE,EAAA,CAAKD,CAAA,CAAEE,CAAF,GAAQ,EAAR,CACLD,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAYE,CAAZ,EAAiB,EAAjB,CAAuB,GAAvB,CACLD,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAYE,CAAZ,EAAiB,CAAjB,CAAsB,GAAtB,CACLD,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAWE,CAAX,CAAe,GAAf,CACLC,EAAA,CAAAA,CAAA,CAAKF,CAAL,CAASF,CAAA,CAAE,CAAF,CACTE,EAAA,CAAKD,CAAA,CAAEG,CAAF,GAAQ,EAAR,CACLF,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAYG,CAAZ,EAAiB,EAAjB,CAAuB,GAAvB,CACLF,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAYG,CAAZ,EAAiB,CAAjB,CAAsB,GAAtB,CACLF,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAWG,CAAX,CAAe,GAAf,CACLD,EAAA,CAAAA,CAAA,CAAKD,CAAL,CAASF,CAAA,CAAE,CAAF,CAETE,EAAA,CAAKD,CAAA,CAAEE,CAAF,GAAQ,EAAR,CACLD,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAYE,CAAZ,EAAiB,EAAjB,CAAuB,GAAvB,CACLD,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAYE,CAAZ,EAAiB,CAAjB,CAAsB,GAAtB,CACLD,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAWE,CAAX,CAAe,GAAf,CACLC,EAAA,CAAAA,CAAA,CAAKF,CAAL,CAASF,CAAA,CAAE,CAAF,CACTE,EAAA,CAAKD,CAAA,CAAEG,CAAF,GAAQ,EAAR,CACLF,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAYG,CAAZ,EAAiB,EAAjB,CAAuB,GAAvB,CACLF,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAYG,CAAZ,EAAiB,CAAjB,CAAsB,GAAtB,CACLF,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAWG,CAAX,CAAe,GAAf,CACLD,EAAA,CAAAA,CAAA,CAAKD,CAAL,CAASF,CAAA,CAAE,CAAF,CAETE,EAAA,CAAKD,CAAA,CAAEE,CAAF,GAAQ,EAAR,CACLD,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAYE,CAAZ,EAAiB,EAAjB,CAAuB,GAAvB,CACLD,EAAA,EAAKD,CAAA,CAAE,GAAF;AAAYE,CAAZ,EAAiB,CAAjB,CAAsB,GAAtB,CACLD,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAWE,CAAX,CAAe,GAAf,CACLC,EAAA,CAAAA,CAAA,CAAKF,CAAL,CAASF,CAAA,CAAE,CAAF,CACTE,EAAA,CAAKD,CAAA,CAAEG,CAAF,GAAQ,EAAR,CACLF,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAYG,CAAZ,EAAiB,EAAjB,CAAuB,GAAvB,CACLF,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAYG,CAAZ,EAAiB,CAAjB,CAAsB,GAAtB,CACLF,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAWG,CAAX,CAAe,GAAf,CACLD,EAAA,CAAAA,CAAA,CAAKD,CAAL,CAASF,CAAA,CAAE,CAAF,CAETE,EAAA,CAAKD,CAAA,CAAEE,CAAF,GAAQ,EAAR,CACLD,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAYE,CAAZ,EAAiB,EAAjB,CAAuB,GAAvB,CACLD,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAYE,CAAZ,EAAiB,CAAjB,CAAsB,GAAtB,CACLD,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAWE,CAAX,CAAe,GAAf,CACLC,EAAA,CAAAA,CAAA,CAAKF,CAAL,CAASF,CAAA,CAAE,CAAF,CACTE,EAAA,CAAKD,CAAA,CAAEG,CAAF,GAAQ,EAAR,CACLF,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAYG,CAAZ,EAAiB,EAAjB,CAAuB,GAAvB,CACLF,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAYG,CAAZ,EAAiB,CAAjB,CAAsB,GAAtB,CACLF,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAWG,CAAX,CAAe,GAAf,CACLD,EAAA,CAAAA,CAAA,CAAKD,CAAL,CAASF,CAAA,CAAE,CAAF,CAETE,EAAA,CAAKD,CAAA,CAAEE,CAAF,GAAQ,EAAR,CACLD,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAYE,CAAZ,EAAiB,EAAjB,CAAuB,GAAvB,CACLD,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAYE,CAAZ,EAAiB,CAAjB,CAAsB,GAAtB,CACLD,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAWE,CAAX,CAAe,GAAf,CACLC,EAAA,CAAAA,CAAA,CAAKF,CAAL,CAASF,CAAA,CAAE,CAAF,CACTE,EAAA,CAAKD,CAAA,CAAEG,CAAF,GAAQ,EAAR,CACLF,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAYG,CAAZ,EAAiB,EAAjB,CAAuB,GAAvB,CACLF,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAYG,CAAZ,EAAiB,CAAjB,CAAsB,GAAtB,CACLF,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAWG,CAAX,CAAe,GAAf,CACLD,EAAA,CAAAA,CAAA,CAAKD,CAAL,CAASF,CAAA,CAAE,EAAF,CAETE,EAAA,CAAKD,CAAA,CAAEE,CAAF,GAAQ,EAAR,CACLD,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAYE,CAAZ,EAAiB,EAAjB,CAAuB,GAAvB,CACLD,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAYE,CAAZ,EAAiB,CAAjB,CAAsB,GAAtB,CACLD,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAWE,CAAX,CAAe,GAAf,CACLC,EAAA,CAAAA,CAAA,CAAKF,CAAL;AAASF,CAAA,CAAE,EAAF,CACTE,EAAA,CAAKD,CAAA,CAAEG,CAAF,GAAQ,EAAR,CACLF,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAYG,CAAZ,EAAiB,EAAjB,CAAuB,GAAvB,CACLF,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAYG,CAAZ,EAAiB,CAAjB,CAAsB,GAAtB,CACLF,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAWG,CAAX,CAAe,GAAf,CACLD,EAAA,CAAAA,CAAA,CAAKD,CAAL,CAASF,CAAA,CAAE,EAAF,CAETE,EAAA,CAAKD,CAAA,CAAEE,CAAF,GAAQ,EAAR,CACLD,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAYE,CAAZ,EAAiB,EAAjB,CAAuB,GAAvB,CACLD,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAYE,CAAZ,EAAiB,CAAjB,CAAsB,GAAtB,CACLD,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAWE,CAAX,CAAe,GAAf,CACLC,EAAA,CAAAA,CAAA,CAAKF,CAAL,CAASF,CAAA,CAAE,EAAF,CACTE,EAAA,CAAKD,CAAA,CAAEG,CAAF,GAAQ,EAAR,CACLF,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAYG,CAAZ,EAAiB,EAAjB,CAAuB,GAAvB,CACLF,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAYG,CAAZ,EAAiB,CAAjB,CAAsB,GAAtB,CACLF,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAWG,CAAX,CAAe,GAAf,CACLD,EAAA,CAAAA,CAAA,CAAKD,CAAL,CAASF,CAAA,CAAE,EAAF,CAETE,EAAA,CAAKD,CAAA,CAAEE,CAAF,GAAQ,EAAR,CACLD,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAYE,CAAZ,EAAiB,EAAjB,CAAuB,GAAvB,CACLD,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAYE,CAAZ,EAAiB,CAAjB,CAAsB,GAAtB,CACLD,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAWE,CAAX,CAAe,GAAf,CACLC,EAAA,CAAAA,CAAA,CAAKF,CAAL,CAASF,CAAA,CAAE,EAAF,CACTE,EAAA,CAAKD,CAAA,CAAEG,CAAF,GAAQ,EAAR,CACLF,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAYG,CAAZ,EAAiB,EAAjB,CAAuB,GAAvB,CACLF,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAYG,CAAZ,EAAiB,CAAjB,CAAsB,GAAtB,CACLF,EAAA,EAAKD,CAAA,CAAE,GAAF,CAAWG,CAAX,CAAe,GAAf,CACLD,EAAA,CAAAA,CAAA,CAAKD,CAAL,CAASF,CAAA,CAAE,EAAF,CAETD,EAAA,CAAGlB,CAAH,CAAA,CAAUuB,CAAV,CAAcJ,CAAA,CAAE,EAAF,CACdD,EAAA,CAAGlB,CAAH,CAAS,CAAT,CAAA,CAAcsB,CACd,OAAOJ,EAnHuB,CA4HlCM,QAASA,EAAa,CAACC,CAAD,CAAOC,CAAP,CAAa,CAC/B,IAD+B,IACtBtC,EAAI,CADkB,CACfuC,EAAO,CAAvB,CAA8B,CAA9B,CAA0BvC,CAA1B,CAAiC,EAAEA,CAAnC,CACIuC,CACA,CADQA,CACR,EADgB,CAChB,CADsBF,CAAA,CAAKC,CAAL,CACtB,CADmC,GACnC,CAAAA,CAAA,EAAQA,CAAR,CAAe,CAAf,EAAoBD,CAAAnC,OACxB;MAAO,CAAEsC,IAAKD,CAAP,CAAaD,KAAMA,CAAnB,CAJwB,CAanCG,QAASA,EAAI,CAACD,CAAD,CAAMT,CAAN,CAASC,CAAT,CAAY,CAMrB,IANqB,IACjBU,EAAS,CADQ,CAEjBZ,EAAK,CAAC,CAAD,CAAI,CAAJ,CAFY,CAGjBa,EAAOZ,CAAA7B,OAHU,CAIjBkB,EAAOY,CAAA9B,OAJU,CAKjB0C,CALiB,CAMZ5C,EAAI,CAAb,CAAgBA,CAAhB,CAAoB2C,CAApB,CAA0B3C,CAAA,EAA1B,CACI4C,CAEA,CAFKR,CAAA,CAAcI,CAAd,CAAmBE,CAAnB,CAEL,CADAA,CACA,CADSE,CAAAN,KACT,CAAAP,CAAA,CAAE/B,CAAF,CAAA,EAAc4C,CAAAJ,IAClB,KAAKxC,CAAL,CAAS,CAAT,CAAYA,CAAZ,CAAgB2C,CAAhB,CAAsB3C,CAAtB,EAA2B,CAA3B,CACI8B,CAEA,CAFKD,CAAA,CAAUC,CAAV,CAAc,CAAd,CAAiBC,CAAjB,CAAoBC,CAApB,CAEL,CADAD,CAAA,CAAE/B,CAAF,CACA,CADO8B,CAAA,CAAG,CAAH,CACP,CAAAC,CAAA,CAAE/B,CAAF,CAAM,CAAN,CAAA,CAAW8B,CAAA,CAAG,CAAH,CACf,KAAK9B,CAAL,CAAS,CAAT,CAAYA,CAAZ,CAAgBoB,CAAhB,CAAsBpB,CAAtB,EAA2B,CAA3B,CACI8B,CAEA,CAFKD,CAAA,CAAUC,CAAV,CAAc,CAAd,CAAiBC,CAAjB,CAAoBC,CAApB,CAEL,CADAA,CAAA,CAAEhC,CAAF,CACA,CADO8B,CAAA,CAAG,CAAH,CACP,CAAAE,CAAA,CAAEhC,CAAF,CAAM,CAAN,CAAA,CAAW8B,CAAA,CAAG,CAAH,CAjBM,CA4BzBe,QAASA,EAAO,CAACR,CAAD,CAAOG,CAAP,CAAYT,CAAZ,CAAeC,CAAf,CAAkB,CAM9B,IAN8B,IAC1BM,EAAO,CADmB,CAE1BR,EAAK,CAAC,CAAD,CAAI,CAAJ,CAFqB,CAG1Ba,EAAOZ,CAAA7B,OAHmB,CAI1BkB,EAAOY,CAAA9B,OAJmB,CAK1B0C,CAL0B,CAMrB5C,EAAI,CAAb,CAAgBA,CAAhB,CAAoB2C,CAApB,CAA0B3C,CAAA,EAA1B,CACI4C,CAEA,CAFKR,CAAA,CAAcI,CAAd,CAAmBF,CAAnB,CAEL,CADAA,CACA,CADOM,CAAAN,KACP,CAAAP,CAAA,CAAE/B,CAAF,CAAA,EAAc4C,CAAAJ,IAElB,KAAKxC,CAAL,CADAsC,CACA,CADO,CACP,CAAYtC,CAAZ,CAAgB2C,CAAhB,CAAsB3C,CAAtB,EAA2B,CAA3B,CACI4C,CAQA,CARKR,CAAA,CAAcC,CAAd,CAAoBC,CAApB,CAQL,CAPAA,CAOA,CAPOM,CAAAN,KAOP,CANAR,CAAA,CAAG,CAAH,CAMA,EANSc,CAAAJ,IAMT,CALAI,CAKA,CALKR,CAAA,CAAcC,CAAd,CAAoBC,CAApB,CAKL,CAJAA,CAIA,CAJOM,CAAAN,KAIP,CAHAR,CAAA,CAAG,CAAH,CAGA,EAHSc,CAAAJ,IAGT,CAFAV,CAEA,CAFKD,CAAA,CAAUC,CAAV,CAAc,CAAd,CAAiBC,CAAjB,CAAoBC,CAApB,CAEL,CADAD,CAAA,CAAE/B,CAAF,CACA,CADO8B,CAAA,CAAG,CAAH,CACP,CAAAC,CAAA,CAAE/B,CAAF,CAAM,CAAN,CAAA,CAAW8B,CAAA,CAAG,CAAH,CACf,KAAK9B,CAAL,CAAS,CAAT,CAAYA,CAAZ,CAAgBoB,CAAhB,CAAsBpB,CAAtB,EAA2B,CAA3B,CACI4C,CAQA,CARKR,CAAA,CAAcC,CAAd,CAAoBC,CAApB,CAQL,CAPAA,CAOA,CAPOM,CAAAN,KAOP,CANAR,CAAA,CAAG,CAAH,CAMA,EANSc,CAAAJ,IAMT,CALAI,CAKA,CALKR,CAAA,CAAcC,CAAd;AAAoBC,CAApB,CAKL,CAJAA,CAIA,CAJOM,CAAAN,KAIP,CAHAR,CAAA,CAAG,CAAH,CAGA,EAHSc,CAAAJ,IAGT,CAFAV,CAEA,CAFKD,CAAA,CAAUC,CAAV,CAAc,CAAd,CAAiBC,CAAjB,CAAoBC,CAApB,CAEL,CADAA,CAAA,CAAEhC,CAAF,CACA,CADO8B,CAAA,CAAG,CAAH,CACP,CAAAE,CAAA,CAAEhC,CAAF,CAAM,CAAN,CAAA,CAAW8B,CAAA,CAAG,CAAH,CA9Be,CA4ClCgB,QAASA,EAAM,CAACrC,CAAD,CAAIsC,CAAJ,CAAUC,CAAV,CAAkBC,CAAlB,CAA4BC,CAA5B,CAA8C,CA0CzDC,QAASA,EAAI,EAAG,CACRD,CAAJ,EACIA,CAAA,CAAiBlD,CAAjB,CAAqBgD,CAArB,CACJ,IAAIhD,CAAJ,CAAQgD,CAAR,CAEI,IADA,IAAII,EAAQC,IAAAC,IAAA,EACZ,CAAOtD,CAAP,CAAWgD,CAAX,EAIQ,EAHJhD,CAGI,EAHI,CAGJ,CAFJyC,CAAA,CAAKhC,CAAL,CAAQsB,CAAR,CAAWC,CAAX,CAEI,CADJS,CAAA,CAAKM,CAAL,CAAWhB,CAAX,CAAcC,CAAd,CACI,CAzfKuB,GAyfL,CAAAF,IAAAC,IAAA,EAAA,CAAaF,CAAb,CAJR,CAAA,EAFJ,IASO,CACH,IAAKpD,CAAL,CAAS,CAAT,CAAgB,EAAhB,CAAYA,CAAZ,CAAoBA,CAAA,EAApB,CACI,IAAKwD,CAAL,CAAS,CAAT,CAAYA,CAAZ,CAAiBC,CAAjB,EAAyB,CAAzB,CAA6BD,CAAA,EAA7B,CACI3B,CAAA,CAAU6B,CAAV,CAAiBF,CAAjB,EAAsB,CAAtB,CAAyBzB,CAAzB,CAA4BC,CAA5B,CACJ2B,EAAAA,CAAM,EACV,KAAK3D,CAAL,CAAS,CAAT,CAAYA,CAAZ,CAAgByD,CAAhB,CAAsBzD,CAAA,EAAtB,CACI2D,CAAAjD,KAAA,EAAWgD,CAAA,CAAM1D,CAAN,CAAX,EAAuB,EAAvB,CAA6B,GAA7B,IAAuC,CAAvC,CAGA,CAFA2D,CAAAjD,KAAA,EAAWgD,CAAA,CAAM1D,CAAN,CAAX,EAAuB,EAAvB,CAA6B,GAA7B,IAAuC,CAAvC,CAEA,CADA2D,CAAAjD,KAAA,EAAWgD,CAAA,CAAM1D,CAAN,CAAX,EAAuB,CAAvB,CAA4B,GAA5B,IAAsC,CAAtC,CACA,CAAA2D,CAAAjD,KAAA,EAAUgD,CAAA,CAAM1D,CAAN,CAAV,CAAqB,GAArB,IAA+B,CAA/B,CACJ,IAAIiD,CAAJ,CAAc,CACVA,CAAA,CAAS,IAAT,CAAeU,CAAf,CACA,OAFU,CAIV,MAAOA,EAdR,CAgBHV,CAAJ,EACIW,CAAA,CAAST,CAAT,CA7BQ,CA1CyC,IACrDO,EAAQG,CAAAtE,MAAA,EAD6C,CAErDkE,EAAOC,CAAAxD,OAF8C,CAGrD4D,CAGJ,IAAa,CAAb,CAAId,CAAJ,EAA2B,EAA3B,CAAkBA,CAAlB,CAA+B,CAC3Bc,CAAA,CAAMpE,KAAA,CAAM,mCAAN,CAA0CsD,CAA1C,CACN,IAAIC,CAAJ,CAAc,CACVW,CAAA,CAASX,CAAAc,KAAA,CAAc,IAAd;AAAoBD,CAApB,CAAT,CACA,OAFU,CAIV,KAAMA,EAAN,CANuB,CAQ/B,GAzekBE,EAyelB,GAAIjB,CAAA7C,OAAJ,CAAqC,CACjC4D,CAAA,CAAKpE,KAAA,CAAM,uBAAN,CAA8BqD,CAAA7C,OAA9B,CA1eS8D,QA0eT,CACL,IAAIf,CAAJ,CAAc,CACVW,CAAA,CAASX,CAAAc,KAAA,CAAc,IAAd,CAAoBD,CAApB,CAAT,CACA,OAFU,CAIV,KAAMA,EAAN,CAN6B,CAQrCd,CAAA,CAAU,CAAV,EAAeA,CAAf,GAA2B,CAtB8B,KAwBrDjB,CAxBqD,CAwBlDC,CAxBkD,CAwB/ChC,EAAI,CAxB2C,CAwBxCwD,CAGbS,WAAJ,EACIlC,CACA,CADI,IAAIkC,UAAJ,CAAeC,CAAf,CACJ,CAAAlC,CAAA,CAAI,IAAIiC,UAAJ,CAAeE,CAAf,CAFR,GAIIpC,CACA,CADImC,CAAA3E,MAAA,EACJ,CAAAyC,CAAA,CAAImC,CAAA5E,MAAA,EALR,CAQAsD,EAAA,CAAQE,CAAR,CAActC,CAAd,CAAiBsB,CAAjB,CAAoBC,CAApB,CAwCA,IAAwB,WAAxB,GAAI,MAAOiB,EAAX,CACIE,CAAA,EADJ,KAMI,KAAA,CAAA,CAAA,CACI,GAA6B,WAA7B,GAAI,OAAOvB,CAAP,CAAauB,CAAA,EAAb,CAAJ,CACI,MAAOvB,EAAP,EAAc,EAnF+B,CAiG7DwC,QAASA,EAAK,CAACjD,CAAD,CAAI4B,CAAJ,CAAUE,CAAV,CAAoBC,CAApB,CAAsC,CA+DhDmB,QAASA,EAAM,CAACC,CAAD,CAAQ,CACnB,IAAI1C,EAAM,EACVA,EAAAlB,KAAA,CAAS,IAAT,CACa,IAAb,EAAI6D,CAAJ,EACI3C,CAAAlB,KAAA,CAAS6D,CAAT,CACJ3C,EAAAlB,KAAA,CAAS,GAAT,CACa,GAAb,CAAIsC,CAAJ,EACIpB,CAAAlB,KAAA,CAAS,GAAT,CACJkB,EAAAlB,KAAA,CAASsC,CAAAwB,SAAA,EAAT,CACA5C,EAAAlB,KAAA,CAAS,GAAT,CACAkB,EAAAlB,KAAA,CAASC,CAAA,CAAc8D,CAAd,CAAqBA,CAAAvE,OAArB,CAAT,CACA0B,EAAAlB,KAAA,CAASC,CAAA,CAAc2D,CAAd,CAAqC,CAArC;AAAqBT,CAAA3D,OAArB,CAAyC,CAAzC,CAAT,CACA,OAAO0B,EAAAX,KAAA,CAAS,EAAT,CAZY,CA7DvB,GAAiB,QAAjB,GAAI,MAAOE,EAAX,EAA6C,QAA7C,GAA6B,MAAO4B,EAApC,CAAuD,CACnDe,CAAA,CAAMpE,KAAA,CAAM,qCAAN,CACN,IAAIuD,CAAJ,CAAc,CACVW,CAAA,CAASX,CAAAc,KAAA,CAAc,IAAd,CAAoBD,CAApB,CAAT,CACA,OAFU,CAKV,KAAMA,EAAN,CAP+C,CAFP,IAa5CS,CAb4C,CAarC7B,CACX,IAAuB,GAAvB,GAAIK,CAAA2B,OAAA,CAAY,CAAZ,CAAJ,EAAiD,GAAjD,GAA8B3B,CAAA2B,OAAA,CAAY,CAAZ,CAA9B,CAAsD,CAClDZ,CAAA,CAAMpE,KAAA,CAAM,wBAAN,CAA+BqD,CAAA4B,UAAA,CAAe,CAAf,CAAiB,CAAjB,CAA/B,CACN,IAAI1B,CAAJ,CAAc,CACVW,CAAA,CAASX,CAAAc,KAAA,CAAc,IAAd,CAAoBD,CAApB,CAAT,CACA,OAFU,CAKV,KAAMA,EAAN,CAP8C,CAStD,GAAuB,GAAvB,GAAIf,CAAA2B,OAAA,CAAY,CAAZ,CAAJ,CACIH,CACA,CADQK,MAAAC,aAAA,CAAoB,CAApB,CACR,CAAAnC,CAAA,CAAS,CAFb,KAGK,CACD6B,CAAA,CAAQxB,CAAA2B,OAAA,CAAY,CAAZ,CACR,IAAe,GAAf,GAAKH,CAAL,EAAgC,GAAhC,GAAsBA,CAAtB,EAAiD,GAAjD,GAAuCA,CAAvC,EAA4E,GAA5E,GAAyDxB,CAAA2B,OAAA,CAAY,CAAZ,CAAzD,CAAiF,CAC7EZ,CAAA,CAAMpE,KAAA,CAAM,yBAAN,CAAgCqD,CAAA4B,UAAA,CAAe,CAAf,CAAiB,CAAjB,CAAhC,CACN,IAAI1B,CAAJ,CAAc,CACVW,CAAA,CAASX,CAAAc,KAAA,CAAc,IAAd,CAAoBD,CAApB,CAAT,CACA,OAFU,CAIV,KAAMA,EAAN;AANyE,CAQjFpB,CAAA,CAAS,CAVR,CAcL,GAA8B,GAA9B,CAAIK,CAAA2B,OAAA,CAAYhC,CAAZ,CAAqB,CAArB,CAAJ,CAAmC,CAC/BoB,CAAA,CAAMpE,KAAA,CAAM,qBAAN,CACN,IAAIuD,CAAJ,CAAc,CACVW,CAAA,CAASX,CAAAc,KAAA,CAAc,IAAd,CAAoBD,CAApB,CAAT,CACA,OAFU,CAIV,KAAMA,EAAN,CAN2B,CAxCa,IAgD5CgB,EAAwD,EAAxDA,CAAKC,QAAA,CAAShC,CAAA4B,UAAA,CAAejC,CAAf,CAAuBA,CAAvB,CAAgC,CAAhC,CAAT,CAA6C,EAA7C,CAhDuC,CAiD5CsC,EAAKD,QAAA,CAAShC,CAAA4B,UAAA,CAAejC,CAAf,CAAwB,CAAxB,CAA2BA,CAA3B,CAAoC,CAApC,CAAT,CAAiD,EAAjD,CAjDuC,CAkD5CM,EAAS8B,CAAT9B,CAAcgC,CACdC,EAAAA,CAAYlC,CAAA4B,UAAA,CAAejC,CAAf,CAAwB,CAAxB,CAA2BA,CAA3B,CAAoC,EAApC,CAGZwC,EAAAA,CAAY9E,CAAA,CAFhBe,CAEgB,EAFF,GAAT,EAAAoD,CAAA,CAAe,MAAf,CAAwB,EAEb,EAAhB,KACIE,EAAQvD,CAAA,CAAc+D,CAAd,CAnnBMjB,EAmnBN,CAwBZ,IAAuB,WAAvB,EAAI,MAAOf,EAAX,CACI,MAAOoB,EAAA,CAAOvB,CAAA,CAAOoC,CAAP,CAAkBT,CAAlB,CAAyBzB,CAAzB,CAAP,CAIPF,EAAA,CAAOoC,CAAP,CAAkBT,CAAlB,CAAyBzB,CAAzB,CAAiC,QAAQ,CAACc,CAAD,CAAMQ,CAAN,CAAa,CAC9CR,CAAJ,CACIb,CAAA,CAASa,CAAT,CAAc,IAAd,CADJ,CAGIb,CAAA,CAAS,IAAT,CAAeoB,CAAA,CAAOC,CAAP,CAAf,CAJ8C,CAAtD,CAKGpB,CALH,CApF4C,CA/rCpD,IAAIiC,EAAS,EAAb,CAOI1F,EAAiB,IA0BrB,IAAI,CACAV,CAAA,CAAO,CAAP,CADA,CAGF,MAAOE,CAAP,CAAU,EAGZQ,CAAA,CAAiB,IAUjB0F,EAAAC,kBAAA,CAA2BC,QAAQ,CAACtG,CAAD,CAAS,CACxCU,CAAA,CAAiBV,CADuB,CAY5CoG,EAAAG,YAAA,CAAqBC,QAAQ,CAACvC,CAAD,CAASwC,CAAT,CAAsB,CAC/CxC,CAAA,CAASA,CAAT,EA4kB8ByC,EA3kB9B,IAAsB,QAAtB,GAAI,MAAOzC,EAAX,CACI,KAAMtD,MAAA,CAAM,qBAAN;AAA6B,MAAOsD,EAApC,CAA4C,IAA5C,CAAkD,MAAOwC,EAAzD,CAAN,CACS,CAAb,CAAIxC,CAAJ,CACIA,CADJ,CACa,CADb,CAEkB,EAFlB,CAESA,CAFT,GAGIA,CAHJ,CAGa,EAHb,CAIA,KAAID,EAAO,EACXA,EAAArC,KAAA,CAAU,MAAV,CACa,GAAb,CAAIsC,CAAJ,EACID,CAAArC,KAAA,CAAU,GAAV,CACJqC,EAAArC,KAAA,CAAUsC,CAAAwB,SAAA,EAAV,CACAzB,EAAArC,KAAA,CAAU,GAAV,CACAqC,EAAArC,KAAA,CAAUC,CAAA,CAAc5B,CAAA,CAwjBNiF,EAxjBM,CAAd,CAwjBQA,EAxjBR,CAAV,CACA,OAAOjB,EAAA9B,KAAA,CAAU,EAAV,CAfwC,CA2BnDkE,EAAAO,QAAA,CAAiBC,QAAQ,CAAC3C,CAAD,CAASwC,CAAT,CAAsBvC,CAAtB,CAAgC,CAYrD2C,QAASA,EAAM,CAAC3C,CAAD,CAAW,CACtBW,CAAA,CAAS,QAAQ,EAAG,CAChB,GAAI,CACAX,CAAA,CAAS,IAAT,CAAekC,CAAAG,YAAA,CAAmBtC,CAAnB,CAAf,CADA,CAEF,MAAOc,CAAP,CAAY,CACVb,CAAA,CAASa,CAAT,CADU,CAHE,CAApB,CADsB,CAXC,UAA3B,GAAI,MAAO0B,EAAX,GACIvC,CACA,CADWuC,CACX,CAAAA,CAAA,CAAcK,IAAAA,EAFlB,CAGsB,WAAtB,GAAI,MAAO7C,EAAX,GACIC,CACA,CADWD,CACX,CAAAA,CAAA,CAAS6C,IAAAA,EAFb,CAGA,IAAsB,WAAtB,GAAI,MAAO7C,EAAX,CACIA,CAAA,CA0iB0ByC,EA3iB9B,KAEK,IAAsB,QAAtB,GAAI,MAAOzC,EAAX,CACD,KAAMtD,MAAA,CAAM,qBAAN,CAA6B,MAAOsD,EAApC,CAAN,CAYJ,GAAIC,CAAJ,CAAc,CACV,GAAwB,UAAxB,GAAI,MAAOA,EAAX,CACI,KAAMvD,MAAA,CAAM,oBAAN;AAA2B,MAAOuD,EAAlC,CAAN,CACJ2C,CAAA,CAAO3C,CAAP,CAHU,CAAd,IAKI,OAAO,KAAI6C,OAAJ,CAAY,QAAQ,CAACC,CAAD,CAAUC,CAAV,CAAkB,CACzCJ,CAAA,CAAO,QAAQ,CAAC9B,CAAD,CAAMlC,CAAN,CAAW,CAClBkC,CAAJ,CACIkC,CAAA,CAAOlC,CAAP,CADJ,CAIAiC,CAAA,CAAQnE,CAAR,CALsB,CAA1B,CADyC,CAAtC,CA3B0C,CA6CzDuD,EAAAc,SAAA,CAAkBC,QAAQ,CAAC/E,CAAD,CAAI4B,CAAJ,CAAU,CACZ,WAApB,GAAI,MAAOA,EAAX,GACIA,CADJ,CAogB8B0C,EApgB9B,CAEoB,SAApB,GAAI,MAAO1C,EAAX,GACIA,CADJ,CACWoC,CAAAG,YAAA,CAAmBvC,CAAnB,CADX,CAEA,IAAiB,QAAjB,GAAI,MAAO5B,EAAX,EAA6C,QAA7C,GAA6B,MAAO4B,EAApC,CACI,KAAMrD,MAAA,CAAM,qBAAN,CAA6B,MAAOyB,EAApC,CAAuC,IAAvC,CAA6C,MAAO4B,EAApD,CAAN,CACJ,MAAOqB,EAAA,CAAMjD,CAAN,CAAS4B,CAAT,CAPyB,CAqBpCoC,EAAAgB,KAAA,CAAcC,QAAQ,CAACjF,CAAD,CAAI4B,CAAJ,CAAUE,CAAV,CAAoBC,CAApB,CAAsC,CAExD0C,QAASA,EAAM,CAAC3C,CAAD,CAAW,CACL,QAAjB,GAAI,MAAO9B,EAAX,EAA6C,QAA7C,GAA6B,MAAO4B,EAApC,CACIoC,CAAAO,QAAA,CAAe3C,CAAf,CAAqB,QAAQ,CAACe,CAAD,CAAMf,CAAN,CAAY,CACrCqB,CAAA,CAAMjD,CAAN,CAAS4B,CAAT,CAAeE,CAAf,CAAyBC,CAAzB,CADqC,CAAzC,CADJ,CAIsB,QAAjB,GAAI,MAAO/B,EAAX,EAA6C,QAA7C,GAA6B,MAAO4B,EAApC,CACDqB,CAAA,CAAMjD,CAAN,CAAS4B,CAAT,CAAeE,CAAf,CAAyBC,CAAzB,CADC,CAGDU,CAAA,CAASX,CAAAc,KAAA,CAAc,IAAd,CAAoBrE,KAAA,CAAM,qBAAN;AAA6B,MAAOyB,EAApC,CAAuC,IAAvC,CAA6C,MAAO4B,EAApD,CAApB,CAAT,CARkB,CAW1B,GAAIE,CAAJ,CAAc,CACV,GAAwB,UAAxB,GAAI,MAAOA,EAAX,CACI,KAAMvD,MAAA,CAAM,oBAAN,CAA2B,MAAOuD,EAAlC,CAAN,CACJ2C,CAAA,CAAO3C,CAAP,CAHU,CAAd,IAKI,OAAO,KAAI6C,OAAJ,CAAY,QAAQ,CAACC,CAAD,CAAUC,CAAV,CAAkB,CACzCJ,CAAA,CAAO,QAAQ,CAAC9B,CAAD,CAAMlC,CAAN,CAAW,CAClBkC,CAAJ,CACIkC,CAAA,CAAOlC,CAAP,CADJ,CAIAiC,CAAA,CAAQnE,CAAR,CALsB,CAA1B,CADyC,CAAtC,CAlB6C,CA2D5DuD,EAAAkB,YAAA,CAAqBC,QAAQ,CAACnF,CAAD,CAAIgF,CAAJ,CAAU,CACnC,GAAiB,QAAjB,GAAI,MAAOhF,EAAX,EAA6C,QAA7C,GAA6B,MAAOgF,EAApC,CACI,KAAMzG,MAAA,CAAM,qBAAN,CAA6B,MAAOyB,EAApC,CAAuC,IAAvC,CAA6C,MAAOgF,EAApD,CAAN,CACJ,MAAoB,GAApB,GAAIA,CAAAjG,OAAJ,CACW,CAAA,CADX,CAEOP,CAAA,CAAkBwF,CAAAc,SAAA,CAAgB9E,CAAhB,CAAmBgF,CAAAI,OAAA,CAAY,CAAZ,CAAeJ,CAAAjG,OAAf,CAA2B,EAA3B,CAAnB,CAAlB,CAAsEiG,CAAtE,CAL4B,CAmBvChB,EAAAqB,QAAA,CAAiBC,QAAQ,CAACtF,CAAD,CAAIgF,CAAJ,CAAUlD,CAAV,CAAoBC,CAApB,CAAsC,CAE3D0C,QAASA,EAAM,CAAC3C,CAAD,CAAW,CACL,QAAjB,GAAI,MAAO9B,EAAX,EAA6C,QAA7C,GAA6B,MAAOgF,EAApC,CACIvC,CAAA,CAASX,CAAAc,KAAA,CAAc,IAAd,CAAoBrE,KAAA,CAAM,qBAAN,CAA6B,MAAOyB,EAApC;AAAuC,IAAvC,CAA6C,MAAOgF,EAApD,CAApB,CAAT,CADJ,CAIoB,EAApB,GAAIA,CAAAjG,OAAJ,CACI0D,CAAA,CAASX,CAAAc,KAAA,CAAc,IAAd,CAAoB,IAApB,CAA0B,CAAA,CAA1B,CAAT,CADJ,CAIAoB,CAAAgB,KAAA,CAAYhF,CAAZ,CAAegF,CAAAI,OAAA,CAAY,CAAZ,CAAe,EAAf,CAAf,CAAmC,QAAQ,CAACzC,CAAD,CAAM4C,CAAN,CAAY,CAC/C5C,CAAJ,CACIb,CAAA,CAASa,CAAT,CADJ,CAGIb,CAAA,CAAS,IAAT,CAAetD,CAAA,CAAkB+G,CAAlB,CAAwBP,CAAxB,CAAf,CAJ+C,CAAvD,CAKGjD,CALH,CATsB,CAiB1B,GAAID,CAAJ,CAAc,CACV,GAAwB,UAAxB,GAAI,MAAOA,EAAX,CACI,KAAMvD,MAAA,CAAM,oBAAN,CAA2B,MAAOuD,EAAlC,CAAN,CACJ2C,CAAA,CAAO3C,CAAP,CAHU,CAAd,IAKI,OAAO,KAAI6C,OAAJ,CAAY,QAAQ,CAACC,CAAD,CAAUC,CAAV,CAAkB,CACzCJ,CAAA,CAAO,QAAQ,CAAC9B,CAAD,CAAMlC,CAAN,CAAW,CAClBkC,CAAJ,CACIkC,CAAA,CAAOlC,CAAP,CADJ,CAIAiC,CAAA,CAAQnE,CAAR,CALsB,CAA1B,CADyC,CAAtC,CAxBgD,CA0C/DuD,EAAAwB,UAAA,CAAmBC,QAAQ,CAACT,CAAD,CAAO,CAC9B,GAAoB,QAApB,GAAI,MAAOA,EAAX,CACI,KAAMzG,MAAA,CAAM,qBAAN,CAA6B,MAAOyG,EAApC,CAAN,CACJ,MAAOpB,SAAA,CAASoB,CAAAU,MAAA,CAAW,GAAX,CAAA,CAAgB,CAAhB,CAAT,CAA6B,EAA7B,CAHuB,CAalC1B,EAAA2B,QAAA,CAAiBC,QAAQ,CAACZ,CAAD,CAAO,CAC5B,GAAoB,QAApB,GAAI,MAAOA,EAAX,CACI,KAAMzG,MAAA,CAAM,qBAAN,CAA6B,MAAOyG,EAApC,CAAN,CACJ,GAAoB,EAApB,GAAIA,CAAAjG,OAAJ,CACI,KAAMR,MAAA,CAAM,uBAAN;AAA8ByG,CAAAjG,OAA9B,CAA0C,QAA1C,CAAN,CACJ,MAAOiG,EAAAxB,UAAA,CAAe,CAAf,CAAkB,EAAlB,CALqB,CAchC,KAAIf,EAA8B,WAAnB,GAAA,MAAOoD,QAAP,EAAkCA,OAAlC,EAAyE,UAAzE,GAA6C,MAAOA,QAAApD,SAApD,CACgB,UAAxB,GAAA,MAAOqD,aAAP,CAAqCA,YAArC,CAAoDD,OAAApD,SAD5C,CAETsD,UAFN,CA8BIlG,EAAc,kEAAA,MAAA,CAAA,EAAA,CA9BlB,CAqCIQ,EAAe,CAAE,EAAF,CAAM,EAAN,CAAU,EAAV,CAAc,EAAd,CAAkB,EAAlB,CAAsB,EAAtB,CAA0B,EAA1B,CAA8B,EAA9B,CAAkC,EAAlC,CAAsC,EAAtC,CAA0C,EAA1C,CAA8C,EAA9C,CAAkD,EAAlD,CACd,EADc,CACV,EADU,CACN,EADM,CACF,EADE,CACE,EADF,CACM,EADN,CACU,EADV,CACc,EADd,CACkB,EADlB,CACsB,EADtB,CAC0B,EAD1B,CAC8B,EAD9B,CACkC,EADlC,CACsC,EADtC,CAC0C,EAD1C,CAC8C,EAD9C,CACkD,EADlD,CAEd,EAFc,CAEV,EAFU,CAEN,EAFM,CAEF,EAFE,CAEE,EAFF,CAEM,EAFN,CAEU,EAFV,CAEc,EAFd,CAEkB,EAFlB,CAEsB,EAFtB,CAE0B,EAF1B,CAE8B,EAF9B,CAEkC,EAFlC,CAEsC,EAFtC,CAE0C,EAF1C,CAE8C,EAF9C,CAEiD,CAFjD,CAGf,CAHe,CAGZ,EAHY,CAGR,EAHQ,CAGJ,EAHI,CAGA,EAHA,CAGI,EAHJ,CAGQ,EAHR,CAGY,EAHZ,CAGgB,EAHhB,CAGoB,EAHpB,CAGwB,EAHxB,CAG6B,EAH7B,CAGiC,EAHjC,CAGqC,EAHrC,CAGyC,EAHzC,CAG6C,EAH7C,CAGiD,EAHjD,CAId,EAJc,CAIX,CAJW,CAIR,CAJQ,CAIL,CAJK,CAIF,CAJE,CAIC,CAJD,CAII,CAJJ,CAIO,CAJP,CAIU,CAJV,CAIa,EAJb,CAIiB,EAJjB,CAIqB,EAJrB;AAIyB,EAJzB,CAI6B,EAJ7B,CAIiC,EAJjC,CAIqC,EAJrC,CAIyC,EAJzC,CAI6C,EAJ7C,CAIiD,EAJjD,CAKf,EALe,CAKX,EALW,CAKP,EALO,CAKH,EALG,CAKC,EALD,CAKK,EALL,CAKS,EALT,CAKa,EALb,CAKkB,EALlB,CAKsB,EALtB,CAK0B,EAL1B,CAK8B,EAL9B,CAKkC,EALlC,CAKsC,EALtC,CAKyC,EALzC,CAK6C,EAL7C,CAKiD,EALjD,CAMf,EANe,CAMX,EANW,CAMP,EANO,CAMH,EANG,CAMC,EAND,CAMK,EANL,CAMS,EANT,CAMa,EANb,CAMiB,EANjB,CAMqB,EANrB,CAMyB,EANzB,CAM6B,EAN7B,CAMiC,EANjC,CAMqC,EANrC,CAMyC,EANzC,CAM6C,EAN7C,CAMiD,EANjD,CAOf,EAPe,CAOX,EAPW,CAOP,EAPO,CAOH,EAPG,CAOC,EAPD,CAOK,EAPL,CAOU,EAPV,CAOc,EAPd,CAOkB,EAPlB,CAOsB,EAPtB,CAO0B,EAP1B,CArCnB,CAkDIC,EAAqBmD,MAAAC,aAlDzB,CA+IItE,EAAO,QAAQ,EAAG,CAQlB,IAAIA,EAAO,CAON,cAAgB,OAPV,CAeN,WAAa4G,QAAQ,CAACC,CAAD,CAAMC,CAAN,CAAW,CACjC,IAAIC,EAAK,IACU,SAAnB,GAAI,MAAOF,EAAX,GACIE,CACA,CADKF,CACL,CAAAA,CAAA,CAAMA,QAAQ,EAAG,CAAE,MAAO,KAAT,CAFrB,CAGA,KAAA,CAAc,IAAd,GAAOE,CAAP,EAAuC,IAAvC,IAAuBA,CAAvB,CAA4BF,CAAA,EAA5B,EAAA,CACa,GAAT,CAAIE,CAAJ,CACID,CAAA,CAAIC,CAAJ,CAAO,GAAP,CADJ,EAEc,IAAT,CAAIA,CAAJ,CACDD,CAAA,CAAMC,CAAN,EAAU,CAAV,CAAa,EAAb,CAAmB,GAAnB,CADC,EAGS,KAAT,CAAIA,CAAJ,CACDD,CAAA,CAAMC,CAAN,EAAU,EAAV,CAAc,EAAd,CAAoB,GAApB,CADC,EAKDD,CAAA,CAAMC,CAAN,EAAU,EAAV,CAAc,CAAd,CAAoB,GAApB,CACA,CAAAD,CAAA,CAAMC,CAAN,EAAU,EAAV,CAAc,EAAd,CAAoB,GAApB,CANC,CAED,CAAAD,CAAA,CAAMC,CAAN,EAAU,CAAV,CAAa,EAAb,CAAmB,GAAnB,CALC,CAED,CAAAD,CAAA,CAAKC,CAAL,CAAQ,EAAR,CAAc,GAAd,CAJJ,CAcA,CAAAA,CAAA,CAAK,IApBwB,CAf1B,CAgDN,WAAaC,QAAQ,CAACH,CAAD,CAAMC,CAAN,CAAW,CAQjC,IARiC,IAC7BnI,CAD6B;AAC1BuB,CAD0B,CACvB+G,CADuB,CACpBC,CADoB,CACjBC,EAAOA,QAAQ,CAACjH,CAAD,CAAI,CAC/BA,CAAA,CAAIA,CAAAlB,MAAA,CAAQ,CAAR,CAAWkB,CAAAkH,QAAA,CAAU,IAAV,CAAX,CACJ,KAAI7D,EAAMpE,KAAA,CAAMe,CAAA+D,SAAA,EAAN,CACVV,EAAA8D,KAAA,CAAW,gBACX9D,EAAA,MAAA,CAAerD,CACf,MAAMqD,EAAN,CAL+B,CAOnC,CAAuB,IAAvB,IAAQ5E,CAAR,CAAYkI,CAAA,EAAZ,EAAA,CACI,GAAiB,CAAjB,IAAKlI,CAAL,CAAO,GAAP,EACImI,CAAA,CAAInI,CAAJ,CADJ,KAEK,IAAiB,GAAjB,IAAKA,CAAL,CAAO,GAAP,EACgB,IACjB,IADEuB,CACF,CADM2G,CAAA,EACN,GAD0BM,CAAA,CAAK,CAACxI,CAAD,CAAIuB,CAAJ,CAAL,CAC1B,CAAA4G,CAAA,EAAMnI,CAAN,CAAQ,EAAR,GAAe,CAAf,CAAqBuB,CAArB,CAAuB,EAAvB,CAFC,KAGA,IAAiB,GAAjB,IAAKvB,CAAL,CAAO,GAAP,EACc,IACf,IADEuB,CACF,CADI2G,CAAA,EACJ,GADqC,IACrC,IADwBI,CACxB,CAD0BJ,CAAA,EAC1B,GAD8CM,CAAA,CAAK,CAACxI,CAAD,CAAIuB,CAAJ,CAAO+G,CAAP,CAAL,CAC9C,CAAAH,CAAA,EAAMnI,CAAN,CAAQ,EAAR,GAAe,EAAf,EAAuBuB,CAAvB,CAAyB,EAAzB,GAAgC,CAAhC,CAAsC+G,CAAtC,CAAwC,EAAxC,CAFC,KAGA,IAAiB,GAAjB,IAAKtI,CAAL,CAAO,GAAP,EACc,IACf,IADEuB,CACF,CADI2G,CAAA,EACJ,GADqC,IACrC,IADwBI,CACxB,CAD0BJ,CAAA,EAC1B,GAD2D,IAC3D,IAD8CK,CAC9C,CADgDL,CAAA,EAChD,GADoEM,CAAA,CAAK,CAACxI,CAAD,CAAIuB,CAAJ,CAAO+G,CAAP,CAAUC,CAAV,CAAL,CACpE,CAAAJ,CAAA,EAAMnI,CAAN,CAAQ,CAAR,GAAe,EAAf,EAAuBuB,CAAvB,CAAyB,EAAzB,GAAgC,EAAhC,EAAwC+G,CAAxC,CAA0C,EAA1C,GAAiD,CAAjD,CAAuDC,CAAvD,CAAyD,EAAzD,CAFC,KAGA,MAAMI,WAAA,CAAW,yBAAX,CAAqC3I,CAArC,CAAN,CApBwB,CAhD1B,CA+EN,YAAc4I,QAAQ,CAACV,CAAD;AAAMC,CAAN,CAAW,CAElC,IAFkC,IAC9BvG,CAD8B,CAC1BC,EAAK,IACb,CAC4C,IAD5C,IACSD,CADT,CACqB,IAAP,GAAAC,CAAA,CAAcA,CAAd,CAAmBqG,CAAA,EADjC,EAAA,CAGc,KAAV,EAAItG,CAAJ,EAA0B,KAA1B,EAAoBA,CAApB,EACyB,IADzB,IACSC,CADT,CACcqG,CAAA,EADd,GAEkB,KAFlB,EAEYrG,CAFZ,EAEkC,KAFlC,EAE4BA,CAF5B,EAGYsG,CAAA,CAAgB,IAAhB,EAAKvG,CAAL,CAAQ,KAAR,EAAsBC,CAAtB,CAAyB,KAAzB,CAAgC,KAAhC,CACA,CAAAA,CAAA,CAAK,IAJjB,EAQAsG,CAAA,CAAIvG,CAAJ,CAEO,KAAX,GAAIC,CAAJ,EAAiBsG,CAAA,CAAItG,CAAJ,CAfiB,CA/E3B,CAwGN,YAAcgH,QAAQ,CAACX,CAAD,CAAMC,CAAN,CAAW,CAClC,IAAIC,EAAK,IACU,SAAnB,GAAI,MAAOF,EAAX,GACIE,CAAU,CAALF,CAAK,CAAAA,CAAA,CAAMA,QAAQ,EAAG,CAAE,MAAO,KAAT,CAD/B,CAEA,KAAA,CAAc,IAAd,GAAOE,CAAP,EAAuC,IAAvC,IAAuBA,CAAvB,CAA4BF,CAAA,EAA5B,EAAA,CACc,KAAV,EAAIE,CAAJ,CACID,CAAA,CAAIC,CAAJ,CADJ,EAGIA,CAEA,EAFM,KAEN,CADAD,CAAA,EAAKC,CAAL,EAAS,EAAT,EAAa,KAAb,CACA,CAAAD,CAAA,CAAKC,CAAL,CAAQ,IAAR,CAAe,KAAf,CALJ,CAMA,CAAAA,CAAA,CAAK,IAXyB,CAxG3B,CA6HN,kBAAoBU,QAAQ,CAACZ,CAAD,CAAMC,CAAN,CAAW,CACxC9G,CAAA0H,YAAA,CAAiBb,CAAjB,CAAsB,QAAQ,CAACE,CAAD,CAAK,CAC/B/G,CAAA2H,WAAA,CAAgBZ,CAAhB,CAAoBD,CAApB,CAD+B,CAAnC,CADwC,CA7HjC,CA2IN,kBAAoBc,QAAQ,CAACf,CAAD,CAAMC,CAAN,CAAW,CACxC9G,CAAA6H,WAAA,CAAgBhB,CAAhB,CAAqB,QAAQ,CAACE,CAAD,CAAK,CAC9B/G,CAAA8H,YAAA,CAAiBf,CAAjB;AAAqBD,CAArB,CAD8B,CAAlC,CADwC,CA3IjC,CAsJN,mBAAqBiB,QAAQ,CAAChB,CAAD,CAAK,CACnC,MAAa,IAAN,CAACA,CAAD,CAAc,CAAd,CAAwB,IAAN,CAACA,CAAD,CAAe,CAAf,CAAyB,KAAN,CAACA,CAAD,CAAiB,CAAjB,CAAqB,CAD9B,CAtJ5B,CAgKN,cAAgBiB,QAAQ,CAACnB,CAAD,CAAM,CAE/B,IAF+B,IAC3BE,CAD2B,CACvBpF,EAAE,CACV,CAAwB,IAAxB,IAAQoF,CAAR,CAAaF,CAAA,EAAb,EAAA,CACIlF,CAAA,EAAK3B,CAAAiI,mBAAA,CAAwBlB,CAAxB,CACT,OAAOpF,EAJwB,CAhKxB,CA6KN,qBAAuBuG,QAAQ,CAACrB,CAAD,CAAM,CAAA,IAClCnF,EAAE,CADgC,CAC7BC,EAAE,CACX3B,EAAA0H,YAAA,CAAiBb,CAAjB,CAAsB,QAAQ,CAACE,CAAD,CAAK,CAC/B,EAAErF,CAAGC,EAAA,EAAK3B,CAAAiI,mBAAA,CAAwBlB,CAAxB,CADqB,CAAnC,CAGA,OAAO,CAACrF,CAAD,CAAGC,CAAH,CAL+B,CA7K/B,CAqLX,OAAO3B,EA7LW,CAAX,EAgMX8C,KAAAC,IAAA,CAAWD,IAAAC,IAAX,EAAuB,QAAQ,EAAG,CAAE,MAAO,CAAC,IAAID,IAAd,CAmClC,KAAIa,EAAS,CACT,SADS,CACG,UADH,CACe,SADf,CAC2B,QAD3B,CACuC,UADvC,CAET,SAFS,CAEG,SAFH,CAEe,UAFf,CAE2B,UAF3B,CAEuC,SAFvC,CAGT,UAHS,CAGG,SAHH,CAGe,UAHf,CAG2B,UAH3B,CAGuC,UAHvC;AAIT,UAJS,CAIG,UAJH,CAIe,UAJf,CAAb,CAYIC,EAAS,CACT,UADS,CACG,UADH,CACe,SADf,CAC2B,UAD3B,CACuC,UADvC,CAET,UAFS,CAEG,UAFH,CAEe,UAFf,CAE2B,SAF3B,CAEuC,UAFvC,CAGT,SAHS,CAGG,UAHH,CAGe,UAHf,CAG2B,UAH3B,CAGuC,UAHvC,CAIT,UAJS,CAIG,SAJH,CAIe,UAJf,CAI2B,UAJ3B,CAIuC,UAJvC,CAKT,UALS,CAKG,UALH,CAKe,UALf,CAK2B,SAL3B,CAKuC,UALvC,CAMT,SANS,CAMG,UANH,CAMe,UANf,CAM2B,UAN3B,CAMuC,UANvC,CAOT,UAPS,CAOG,UAPH,CAOe,UAPf,CAO2B,UAP3B,CAOuC,UAPvC,CAQT,UARS,CAQG,UARH,CAQe,UARf,CAQ2B,UAR3B,CAQuC,UARvC,CAST,UATS,CASG,SATH,CASe,UATf;AAS2B,SAT3B,CASuC,UATvC,CAUT,UAVS,CAUG,UAVH,CAUe,UAVf,CAU2B,SAV3B,CAUuC,UAVvC,CAWT,UAXS,CAWG,UAXH,CAWe,UAXf,CAW2B,UAX3B,CAWuC,UAXvC,CAYT,SAZS,CAYG,SAZH,CAYe,UAZf,CAY2B,UAZ3B,CAYuC,UAZvC,CAaT,UAbS,CAaG,UAbH,CAae,UAbf,CAa2B,UAb3B,CAauC,UAbvC,CAcT,UAdS,CAcG,UAdH,CAce,UAdf,CAc2B,SAd3B,CAcuC,UAdvC,CAeT,SAfS,CAeG,UAfH,CAee,SAff,CAe2B,UAf3B,CAeuC,UAfvC,CAgBT,UAhBS,CAgBG,SAhBH,CAgBe,UAhBf,CAgB2B,UAhB3B,CAgBuC,UAhBvC,CAiBT,UAjBS,CAiBG,UAjBH,CAiBe,UAjBf,CAiB2B,UAjB3B,CAiBuC,UAjBvC,CAkBT,SAlBS,CAkBG,UAlBH,CAkBe,UAlBf,CAkB2B,UAlB3B,CAkBuC,SAlBvC;AAmBT,UAnBS,CAmBG,UAnBH,CAmBe,UAnBf,CAmB2B,UAnB3B,CAmBuC,UAnBvC,CAoBT,SApBS,CAoBG,UApBH,CAoBe,UApBf,CAoB2B,UApB3B,CAoBuC,UApBvC,CAqBT,UArBS,CAqBG,SArBH,CAqBe,SArBf,CAqB2B,UArB3B,CAqBuC,SArBvC,CAsBT,UAtBS,CAsBG,UAtBH,CAsBe,UAtBf,CAsB2B,SAtB3B,CAsBuC,UAtBvC,CAuBT,SAvBS,CAuBG,UAvBH,CAuBe,UAvBf,CAuB2B,UAvB3B,CAuBuC,UAvBvC,CAwBT,QAxBS,CAwBG,UAxBH,CAwBe,UAxBf,CAwB2B,UAxB3B,CAwBuC,SAxBvC,CAyBT,UAzBS,CAyBG,UAzBH,CAyBe,SAzBf,CAyB2B,SAzB3B,CAyBuC,UAzBvC,CA0BT,UA1BS,CA0BG,UA1BH,CA0Be,UA1Bf,CA0B2B,UA1B3B,CA0BuC,UA1BvC,CA2BT,UA3BS,CA2BG,SA3BH,CA2Be,UA3Bf,CA2B2B,UA3B3B,CA2BuC,UA3BvC,CA4BT,UA5BS,CA4BG,UA5BH;AA4Be,SA5Bf,CA4B2B,UA5B3B,CA4BuC,UA5BvC,CA6BT,UA7BS,CA6BG,UA7BH,CA6Be,UA7Bf,CA6B2B,UA7B3B,CA6BuC,UA7BvC,CA8BT,UA9BS,CA8BG,SA9BH,CA8Be,UA9Bf,CA8B2B,SA9B3B,CA8BuC,UA9BvC,CA+BT,UA/BS,CA+BG,UA/BH,CA+Be,UA/Bf,CA+B2B,UA/B3B,CA+BuC,SA/BvC,CAgCT,UAhCS,CAgCG,UAhCH,CAgCe,SAhCf,CAgC2B,UAhC3B,CAgCuC,UAhCvC,CAiCT,UAjCS,CAiCG,UAjCH,CAiCe,UAjCf,CAiC2B,UAjC3B,CAiCuC,SAjCvC,CAkCT,UAlCS,CAkCG,UAlCH,CAkCe,SAlCf,CAkC2B,UAlC3B,CAkCuC,UAlCvC,CAmCT,UAnCS,CAmCG,UAnCH,CAmCe,UAnCf,CAmC2B,UAnC3B,CAmCuC,UAnCvC,CAoCT,UApCS,CAoCG,UApCH,CAoCe,SApCf,CAoC2B,UApC3B,CAoCuC,SApCvC,CAqCT,UArCS,CAqCG,UArCH,CAqCe,UArCf,CAqC2B,UArC3B;AAqCuC,UArCvC,CAsCT,UAtCS,CAsCG,UAtCH,CAsCe,UAtCf,CAsC2B,UAtC3B,CAsCuC,UAtCvC,CAuCT,UAvCS,CAuCG,UAvCH,CAuCe,UAvCf,CAuC2B,UAvC3B,CAuCuC,UAvCvC,CAwCT,UAxCS,CAwCG,SAxCH,CAwCe,UAxCf,CAwC2B,UAxC3B,CAwCuC,UAxCvC,CAyCT,UAzCS,CAyCG,UAzCH,CAyCe,SAzCf,CAyC2B,UAzC3B,CAyCuC,UAzCvC,CA0CT,UA1CS,CA0CG,UA1CH,CA0Ce,UA1Cf,CA0C2B,SA1C3B,CA0CuC,UA1CvC,CA2CT,UA3CS,CA2CG,SA3CH,CA2Ce,UA3Cf,CA2C2B,UA3C3B,CA2CuC,UA3CvC,CA4CT,UA5CS,CA4CG,UA5CH,CA4Ce,UA5Cf,CA4C2B,UA5C3B,CA4CuC,UA5CvC,CA6CT,OA7CS,CA6CG,SA7CH,CA6Ce,SA7Cf,CA6C2B,UA7C3B,CA6CuC,SA7CvC,CA8CT,UA9CS,CA8CG,UA9CH,CA8Ce,UA9Cf,CA8C2B,UA9C3B,CA8CuC,UA9CvC,CA+CT,SA/CS;AA+CG,QA/CH,CA+Ce,UA/Cf,CA+C2B,UA/C3B,CA+CuC,SA/CvC,CAgDT,UAhDS,CAgDG,UAhDH,CAgDe,UAhDf,CAgD2B,SAhD3B,CAgDuC,UAhDvC,CAiDT,UAjDS,CAiDG,UAjDH,CAiDe,SAjDf,CAiD2B,UAjD3B,CAiDuC,SAjDvC,CAkDT,UAlDS,CAkDG,UAlDH,CAkDe,SAlDf,CAkD2B,UAlD3B,CAkDuC,UAlDvC,CAmDT,UAnDS,CAmDG,UAnDH,CAmDe,UAnDf,CAmD2B,UAnD3B,CAmDuC,SAnDvC,CAoDT,UApDS,CAoDG,UApDH,CAoDe,UApDf,CAoD2B,UApD3B,CAoDuC,UApDvC,CAqDT,QArDS,CAqDG,UArDH,CAqDe,UArDf,CAqD2B,UArD3B,CAqDuC,UArDvC,CAsDT,UAtDS,CAsDG,UAtDH,CAsDe,UAtDf,CAsD2B,SAtD3B,CAsDuC,UAtDvC,CAuDT,UAvDS,CAuDG,UAvDH,CAuDe,UAvDf,CAuD2B,UAvD3B,CAuDuC,UAvDvC,CAwDT,UAxDS,CAwDG,UAxDH,CAwDe,UAxDf;AAwD2B,UAxD3B,CAwDuC,UAxDvC,CAyDT,UAzDS,CAyDG,UAzDH,CAyDe,UAzDf,CAyD2B,QAzD3B,CAyDuC,SAzDvC,CA0DT,UA1DS,CA0DG,UA1DH,CA0De,UA1Df,CA0D2B,UA1D3B,CA0DuC,UA1DvC,CA2DT,UA3DS,CA2DG,UA3DH,CA2De,UA3Df,CA2D2B,UA3D3B,CA2DuC,UA3DvC,CA4DT,UA5DS,CA4DG,UA5DH,CA4De,UA5Df,CA4D2B,UA5D3B,CA4DuC,QA5DvC,CA6DT,UA7DS,CA6DG,UA7DH,CA6De,SA7Df,CA6D2B,UA7D3B,CA6DuC,UA7DvC,CA8DT,UA9DS,CA8DG,UA9DH,CA8De,SA9Df,CA8D2B,SA9D3B,CA8DuC,SA9DvC,CA+DT,UA/DS,CA+DG,UA/DH,CA+De,UA/Df,CA+D2B,SA/D3B,CA+DuC,UA/DvC,CAgET,UAhES,CAgEG,UAhEH,CAgEe,UAhEf,CAgE2B,SAhE3B,CAgEuC,SAhEvC,CAiET,UAjES,CAiEG,UAjEH,CAiEe,UAjEf,CAiE2B,UAjE3B,CAiEuC,SAjEvC;AAkET,SAlES,CAkEG,UAlEH,CAkEe,UAlEf,CAkE2B,UAlE3B,CAkEuC,UAlEvC,CAmET,UAnES,CAmEG,UAnEH,CAmEe,UAnEf,CAmE2B,SAnE3B,CAmEuC,UAnEvC,CAoET,UApES,CAoEG,UApEH,CAoEe,UApEf,CAoE2B,UApE3B,CAoEuC,UApEvC,CAqET,UArES,CAqEG,UArEH,CAqEe,UArEf,CAqE2B,UArE3B,CAqEuC,UArEvC,CAsET,SAtES,CAsEG,UAtEH,CAsEe,SAtEf,CAsE2B,SAtE3B,CAsEuC,SAtEvC,CAuET,UAvES,CAuEG,SAvEH,CAuEe,UAvEf,CAuE2B,SAvE3B,CAuEuC,UAvEvC,CAwET,UAxES,CAwEG,QAxEH,CAwEe,UAxEf,CAwE2B,UAxE3B,CAwEuC,UAxEvC,CAyET,UAzES,CAyEG,UAzEH,CAyEe,UAzEf,CAyE2B,SAzE3B,CAyEuC,UAzEvC,CA0ET,UA1ES,CA0EG,UA1EH,CA0Ee,UA1Ef,CA0E2B,UA1E3B,CA0EuC,UA1EvC,CA2ET,SA3ES,CA2EG,UA3EH;AA2Ee,UA3Ef,CA2E2B,UA3E3B,CA2EuC,SA3EvC,CA4ET,UA5ES,CA4EG,UA5EH,CA4Ee,UA5Ef,CA4E2B,UA5E3B,CA4EuC,SA5EvC,CA6ET,UA7ES,CA6EG,SA7EH,CA6Ee,SA7Ef,CA6E2B,SA7E3B,CA6EuC,UA7EvC,CA8ET,UA9ES,CA8EG,UA9EH,CA8Ee,UA9Ef,CA8E2B,UA9E3B,CA8EuC,UA9EvC,CA+ET,UA/ES,CA+EG,QA/EH,CA+Ee,UA/Ef,CA+E2B,UA/E3B,CA+EuC,UA/EvC,CAgFT,UAhFS,CAgFG,UAhFH,CAgFe,UAhFf,CAgF2B,SAhF3B,CAgFuC,UAhFvC,CAiFT,SAjFS,CAiFG,SAjFH,CAiFe,UAjFf,CAiF2B,UAjF3B,CAiFuC,SAjFvC,CAkFT,UAlFS,CAkFG,QAlFH,CAkFe,UAlFf,CAkF2B,UAlF3B,CAkFuC,UAlFvC,CAmFT,UAnFS,CAmFG,UAnFH,CAmFe,UAnFf,CAmF2B,UAnF3B,CAmFuC,UAnFvC,CAoFT,UApFS,CAoFG,UApFH,CAoFe,SApFf,CAoF2B,UApF3B;AAoFuC,UApFvC,CAqFT,UArFS,CAqFG,UArFH,CAqFe,SArFf,CAqF2B,UArF3B,CAqFuC,UArFvC,CAsFT,UAtFS,CAsFG,UAtFH,CAsFe,UAtFf,CAsF2B,UAtF3B,CAsFuC,UAtFvC,CAuFT,SAvFS,CAuFG,SAvFH,CAuFe,SAvFf,CAuF2B,UAvF3B,CAuFuC,UAvFvC,CAwFT,UAxFS,CAwFG,UAxFH,CAwFe,SAxFf,CAwF2B,UAxF3B,CAwFuC,SAxFvC,CAyFT,UAzFS,CAyFG,UAzFH,CAyFe,UAzFf,CAyF2B,UAzF3B,CAyFuC,UAzFvC,CA0FT,SA1FS,CA0FG,UA1FH,CA0Fe,UA1Ff,CA0F2B,UA1F3B,CA0FuC,UA1FvC,CA2FT,UA3FS,CA2FG,SA3FH,CA2Fe,UA3Ff,CA2F2B,UA3F3B,CA2FuC,UA3FvC,CA4FT,UA5FS,CA4FG,UA5FH,CA4Fe,UA5Ff,CA4F2B,UA5F3B,CA4FuC,UA5FvC,CA6FT,UA7FS,CA6FG,UA7FH,CA6Fe,UA7Ff,CA6F2B,UA7F3B,CA6FuC,UA7FvC,CA8FT,UA9FS;AA8FG,UA9FH,CA8Fe,UA9Ff,CA8F2B,UA9F3B,CA8FuC,UA9FvC,CA+FT,UA/FS,CA+FG,UA/FH,CA+Fe,SA/Ff,CA+F2B,UA/F3B,CA+FuC,SA/FvC,CAgGT,SAhGS,CAgGG,UAhGH,CAgGe,SAhGf,CAgG2B,SAhG3B,CAgGuC,SAhGvC,CAiGT,SAjGS,CAiGG,UAjGH,CAiGe,UAjGf,CAiG2B,UAjG3B,CAiGuC,UAjGvC,CAkGT,UAlGS,CAkGG,UAlGH,CAkGe,UAlGf,CAkG2B,UAlG3B,CAkGuC,SAlGvC,CAmGT,UAnGS,CAmGG,UAnGH,CAmGe,UAnGf,CAmG2B,UAnG3B,CAmGuC,UAnGvC,CAoGT,UApGS,CAoGG,UApGH,CAoGe,UApGf,CAoG2B,UApG3B,CAoGuC,SApGvC,CAqGT,UArGS,CAqGG,SArGH,CAqGe,UArGf,CAqG2B,UArG3B,CAqGuC,UArGvC,CAsGT,UAtGS,CAsGG,UAtGH,CAsGe,UAtGf,CAsG2B,SAtG3B,CAsGuC,UAtGvC,CAuGT,UAvGS,CAuGG,UAvGH,CAuGe,UAvGf;AAuG2B,UAvG3B,CAuGuC,UAvGvC,CAwGT,UAxGS,CAwGG,UAxGH,CAwGe,UAxGf,CAwG2B,UAxG3B,CAwGuC,UAxGvC,CAyGT,UAzGS,CAyGG,SAzGH,CAyGe,UAzGf,CAyG2B,UAzG3B,CAyGuC,SAzGvC,CA0GT,UA1GS,CA0GG,SA1GH,CA0Ge,UA1Gf,CA0G2B,UA1G3B,CA0GuC,UA1GvC,CA2GT,UA3GS,CA2GG,UA3GH,CA2Ge,UA3Gf,CA2G2B,QA3G3B,CA2GuC,UA3GvC,CA4GT,SA5GS,CA4GG,UA5GH,CA4Ge,UA5Gf,CA4G2B,UA5G3B,CA4GuC,UA5GvC,CA6GT,SA7GS,CA6GG,UA7GH,CA6Ge,SA7Gf,CA6G2B,UA7G3B,CA6GuC,UA7GvC,CA8GT,UA9GS,CA8GG,UA9GH,CA8Ge,SA9Gf,CA8G2B,UA9G3B,CA8GuC,UA9GvC,CA+GT,UA/GS,CA+GG,UA/GH,CA+Ge,UA/Gf,CA+G2B,UA/G3B,CA+GuC,UA/GvC,CAgHT,UAhHS,CAgHG,SAhHH,CAgHe,UAhHf,CAgH2B,UAhH3B,CAgHuC,SAhHvC;AAiHT,SAjHS,CAiHG,UAjHH,CAiHe,SAjHf,CAiH2B,UAjH3B,CAiHuC,SAjHvC,CAkHT,UAlHS,CAkHG,UAlHH,CAkHe,UAlHf,CAkH2B,UAlH3B,CAkHuC,UAlHvC,CAmHT,UAnHS,CAmHG,UAnHH,CAmHe,UAnHf,CAmH2B,SAnH3B,CAmHuC,UAnHvC,CAoHT,UApHS,CAoHG,UApHH,CAoHe,UApHf,CAoH2B,UApH3B,CAoHuC,UApHvC,CAqHT,UArHS,CAqHG,UArHH,CAqHe,UArHf,CAqH2B,UArH3B,CAqHuC,UArHvC,CAsHT,QAtHS,CAsHG,UAtHH,CAsHe,QAtHf,CAsH2B,UAtH3B,CAsHuC,UAtHvC,CAuHT,UAvHS,CAuHG,UAvHH,CAuHe,SAvHf,CAuH2B,UAvH3B,CAuHuC,UAvHvC,CAwHT,UAxHS,CAwHG,SAxHH,CAwHe,UAxHf,CAwH2B,UAxH3B,CAwHuC,UAxHvC,CAyHT,SAzHS,CAyHG,UAzHH,CAyHe,UAzHf,CAyH2B,SAzH3B,CAyHuC,SAzHvC,CA0HT,QA1HS,CA0HG,UA1HH;AA0He,UA1Hf,CA0H2B,UA1H3B,CA0HuC,SA1HvC,CA2HT,SA3HS,CA2HG,UA3HH,CA2He,UA3Hf,CA2H2B,UA3H3B,CA2HuC,UA3HvC,CA4HT,SA5HS,CA4HG,UA5HH,CA4He,UA5Hf,CA4H2B,UA5H3B,CA4HuC,UA5HvC,CA6HT,UA7HS,CA6HG,UA7HH,CA6He,UA7Hf,CA6H2B,UA7H3B,CA6HuC,SA7HvC,CA8HT,UA9HS,CA8HG,SA9HH,CA8He,UA9Hf,CA8H2B,UA9H3B,CA8HuC,UA9HvC,CA+HT,UA/HS,CA+HG,UA/HH,CA+He,UA/Hf,CA+H2B,UA/H3B,CA+HuC,SA/HvC,CAgIT,UAhIS,CAgIG,UAhIH,CAgIe,UAhIf,CAgI2B,UAhI3B,CAgIuC,UAhIvC,CAiIT,UAjIS,CAiIG,UAjIH,CAiIe,UAjIf,CAiI2B,UAjI3B,CAiIuC,UAjIvC,CAkIT,UAlIS,CAkIG,UAlIH,CAkIe,UAlIf,CAkI2B,SAlI3B,CAkIuC,UAlIvC,CAmIT,UAnIS,CAmIG,UAnIH,CAmIe,UAnIf,CAmI2B,UAnI3B;AAmIuC,SAnIvC,CAoIT,UApIS,CAoIG,UApIH,CAoIe,UApIf,CAoI2B,SApI3B,CAoIuC,UApIvC,CAqIT,SArIS,CAqIG,SArIH,CAqIe,UArIf,CAqI2B,UArI3B,CAqIuC,UArIvC,CAsIT,SAtIS,CAsIG,UAtIH,CAsIe,UAtIf,CAsI2B,UAtI3B,CAsIuC,UAtIvC,CAuIT,UAvIS,CAuIG,UAvIH,CAuIe,UAvIf,CAuI2B,UAvI3B,CAuIuC,UAvIvC,CAwIT,UAxIS,CAwIG,UAxIH,CAwIe,UAxIf,CAwI2B,UAxI3B,CAwIuC,UAxIvC,CAyIT,UAzIS,CAyIG,UAzIH,CAyIe,UAzIf,CAyI2B,UAzI3B,CAyIuC,UAzIvC,CA0IT,UA1IS,CA0IG,UA1IH,CA0Ie,UA1If,CA0I2B,UA1I3B,CA0IuC,UA1IvC,CA2IT,UA3IS,CA2IG,UA3IH,CA2Ie,UA3If,CA2I2B,UA3I3B,CA2IuC,UA3IvC,CA4IT,UA5IS,CA4IG,UA5IH,CA4Ie,UA5If,CA4I2B,UA5I3B,CA4IuC,UA5IvC;AA6IT,UA7IS,CA6IG,SA7IH,CA6Ie,UA7If,CA6I2B,UA7I3B,CA6IuC,UA7IvC,CA8IT,UA9IS,CA8IG,SA9IH,CA8Ie,UA9If,CA8I2B,UA9I3B,CA8IuC,UA9IvC,CA+IT,UA/IS,CA+IG,UA/IH,CA+Ie,UA/If,CA+I2B,SA/I3B,CA+IuC,UA/IvC,CAgJT,SAhJS,CAgJG,SAhJH,CAgJe,SAhJf,CAgJ2B,UAhJ3B,CAgJuC,SAhJvC,CAiJT,UAjJS,CAiJG,UAjJH,CAiJe,UAjJf,CAiJ2B,UAjJ3B,CAiJuC,UAjJvC,CAkJT,UAlJS,CAkJG,UAlJH,CAkJe,SAlJf,CAkJ2B,UAlJ3B,CAkJuC,UAlJvC,CAmJT,UAnJS,CAmJG,UAnJH,CAmJe,UAnJf,CAmJ2B,UAnJ3B,CAmJuC,OAnJvC,CAoJT,SApJS,CAoJG,SApJH,CAoJe,SApJf,CAoJ2B,UApJ3B,CAoJuC,UApJvC,CAqJT,UArJS,CAqJG,UArJH,CAqJe,UArJf,CAqJ2B,UArJ3B,CAqJuC,UArJvC,CAsJT,UAtJS,CAsJG,SAtJH;AAsJe,UAtJf,CAsJ2B,UAtJ3B,CAsJuC,UAtJvC,CAuJT,SAvJS,CAuJG,UAvJH,CAuJe,UAvJf,CAuJ2B,SAvJ3B,CAuJuC,UAvJvC,CAwJT,UAxJS,CAwJG,SAxJH,CAwJe,UAxJf,CAwJ2B,UAxJ3B,CAwJuC,UAxJvC,CAyJT,UAzJS,CAyJG,UAzJH,CAyJe,SAzJf,CAyJ2B,UAzJ3B,CAyJuC,UAzJvC,CA0JT,UA1JS,CA0JG,UA1JH,CA0Je,UA1Jf,CA0J2B,SA1J3B,CA0JuC,UA1JvC,CA2JT,UA3JS,CA2JG,UA3JH,CA2Je,UA3Jf,CA2J2B,UA3J3B,CA2JuC,UA3JvC,CA4JT,UA5JS,CA4JG,UA5JH,CA4Je,UA5Jf,CA4J2B,UA5J3B,CA4JuC,UA5JvC,CA6JT,UA7JS,CA6JG,SA7JH,CA6Je,UA7Jf,CA6J2B,UA7J3B,CA6JuC,UA7JvC,CA8JT,UA9JS,CA8JG,UA9JH,CA8Je,UA9Jf,CA8J2B,UA9J3B,CA8JuC,UA9JvC,CA+JT,UA/JS,CA+JG,UA/JH,CA+Je,SA/Jf,CA+J2B,UA/J3B;AA+JuC,UA/JvC,CAgKT,UAhKS,CAgKG,UAhKH,CAgKe,UAhKf,CAgK2B,UAhK3B,CAgKuC,UAhKvC,CAiKT,UAjKS,CAiKG,UAjKH,CAiKe,UAjKf,CAiK2B,UAjK3B,CAiKuC,UAjKvC,CAkKT,UAlKS,CAkKG,UAlKH,CAkKe,UAlKf,CAkK2B,SAlK3B,CAkKuC,UAlKvC,CAmKT,UAnKS,CAmKG,UAnKH,CAmKe,UAnKf,CAmK2B,UAnK3B,CAmKuC,UAnKvC,CAoKT,UApKS,CAoKG,UApKH,CAoKe,UApKf,CAoK2B,UApK3B,CAoKuC,SApKvC,CAqKT,UArKS,CAqKG,UArKH,CAqKe,SArKf,CAqK2B,QArK3B,CAqKuC,UArKvC,CAsKT,QAtKS,CAsKG,UAtKH,CAsKe,UAtKf,CAsK2B,SAtK3B,CAsKuC,UAtKvC,CAuKT,UAvKS,CAuKG,UAvKH,CAuKe,UAvKf,CAuK2B,UAvK3B,CAuKuC,UAvKvC,CAwKT,UAxKS,CAwKG,UAxKH,CAwKe,SAxKf,CAwK2B,UAxK3B,CAwKuC,UAxKvC,CAyKT,UAzKS;AAyKG,UAzKH,CAyKe,UAzKf,CAyK2B,UAzK3B,CAyKuC,SAzKvC,CA0KT,UA1KS,CA0KG,QA1KH,CA0Ke,QA1Kf,CA0K2B,UA1K3B,CA0KuC,UA1KvC,CA2KT,UA3KS,CA2KG,UA3KH,CA2Ke,SA3Kf,CA2K2B,SA3K3B,CA2KuC,UA3KvC,CA4KT,SA5KS,CA4KG,UA5KH,CA4Ke,UA5Kf,CA4K2B,QA5K3B,CA4KuC,UA5KvC,CA6KT,SA7KS,CA6KG,UA7KH,CA6Ke,UA7Kf,CA6K2B,UA7K3B,CA6KuC,UA7KvC,CA8KT,SA9KS,CA8KG,SA9KH,CA8Ke,UA9Kf,CA8K2B,UA9K3B,CA8KuC,UA9KvC,CA+KT,UA/KS,CA+KG,UA/KH,CA+Ke,UA/Kf,CA+K2B,UA/K3B,CA+KuC,UA/KvC,CAgLT,UAhLS,CAgLG,UAhLH,CAgLe,UAhLf,CAgL2B,UAhL3B,CAgLuC,SAhLvC,CAiLT,UAjLS,CAiLG,UAjLH,CAiLe,UAjLf,CAiL2B,SAjL3B,CAiLuC,UAjLvC,CAkLT,SAlLS,CAkLG,UAlLH,CAkLe,UAlLf;AAkL2B,UAlL3B,CAkLuC,SAlLvC,CAmLT,UAnLS,CAmLG,UAnLH,CAmLe,UAnLf,CAmL2B,UAnL3B,CAmLuC,UAnLvC,CAoLT,UApLS,CAoLG,UApLH,CAoLe,UApLf,CAoL2B,UApL3B,CAoLuC,UApLvC,CAqLT,UArLS,CAqLG,UArLH,CAqLe,UArLf,CAqL2B,UArL3B,CAqLuC,UArLvC,CAsLT,UAtLS,CAsLG,SAtLH,CAsLe,QAtLf,CAsL2B,SAtL3B,CAsLuC,UAtLvC,CAuLT,SAvLS,CAuLG,UAvLH,CAuLe,UAvLf,CAuL2B,SAvL3B,CAuLuC,QAvLvC,CAwLT,SAxLS,CAwLG,UAxLH,CAwLe,UAxLf,CAwL2B,UAxL3B,CAwLuC,SAxLvC,CAyLT,UAzLS,CAyLG,UAzLH,CAyLe,SAzLf,CAyL2B,UAzL3B,CAyLuC,UAzLvC,CA0LT,UA1LS,CA0LG,UA1LH,CA0Le,UA1Lf,CA0L2B,SA1L3B,CA0LuC,UA1LvC,CA2LT,UA3LS,CA2LG,UA3LH,CA2Le,QA3Lf,CA2L2B,UA3L3B,CA2LuC,UA3LvC;AA4LT,UA5LS,CA4LG,UA5LH,CA4Le,UA5Lf,CA4L2B,UA5L3B,CA4LuC,SA5LvC,CA6LT,UA7LS,CA6LG,SA7LH,CA6Le,SA7Lf,CA6L2B,UA7L3B,CA6LuC,UA7LvC,CA8LT,UA9LS,CA8LG,UA9LH,CA8Le,SA9Lf,CA8L2B,UA9L3B,CA8LuC,UA9LvC,CA+LT,SA/LS,CA+LG,UA/LH,CA+Le,UA/Lf,CA+L2B,SA/L3B,CA+LuC,UA/LvC,CAgMT,SAhMS,CAgMG,UAhMH,CAgMe,UAhMf,CAgM2B,UAhM3B,CAgMuC,UAhMvC,CAiMT,SAjMS,CAiMG,UAjMH,CAiMe,UAjMf,CAiM2B,UAjM3B,CAiMuC,UAjMvC,CAkMT,UAlMS,CAkMG,UAlMH,CAkMe,SAlMf,CAkM2B,UAlM3B,CAkMuC,SAlMvC,CAmMT,UAnMS,CAmMG,UAnMH,CAmMe,SAnMf,CAmM2B,UAnM3B,CAmMuC,UAnMvC,CAoMT,UApMS,CAoMG,UApMH,CAoMe,UApMf,CAoM2B,UApM3B,CAoMuC,UApMvC,CAqMT,UArMS,CAqMG,UArMH;AAqMe,UArMf,CAqM2B,UArM3B,CAqMuC,UArMvC,CAsMT,UAtMS,CAsMG,UAtMH,CAsMe,UAtMf,CAsM2B,UAtM3B,CAsMuC,SAtMvC,CAuMT,UAvMS,CAuMG,UAvMH,CAuMe,UAvMf,CAuM2B,UAvM3B,CAuMuC,UAvMvC,CAwMT,SAxMS,CAwMG,UAxMH,CAwMe,UAxMf,CAwM2B,UAxM3B,CAwMuC,UAxMvC,CAyMT,UAzMS,CAyMG,SAzMH,CAyMe,SAzMf,CAyM2B,SAzM3B,CAyMuC,UAzMvC,CA0MT,UA1MS,CA0MG,UA1MH,CA0Me,SA1Mf,CA0M2B,UA1M3B,CA0MuC,UA1MvC,CA2MT,UA3MS,CA2MG,UA3MH,CA2Me,SA3Mf,CA2M2B,QA3M3B,CA2MuC,QA3MvC,CA4MT,UA5MS,CA4MG,UA5MH,CA4Me,UA5Mf,CA4M2B,UA5M3B,CA4MuC,UA5MvC,CA6MT,UA7MS,CA6MG,UA7MH,CA6Me,UA7Mf,CA6M2B,SA7M3B,CAZb,CAiOIN,EAAS,CACT,UADS,CACG,UADH,CACe,UADf,CAC2B,UAD3B,CACuC,UADvC;AAET,UAFS,CAoabsB,EAAAuD,aAAA,CAAsB/H,CAUtBwE,EAAAwD,aAAA,CAAsBzH,CAEtB,OAAOiE,EAvzCQ,CATlB;", -"sources":["dist/bcrypt.js"], -"names":["global","factory","define","require","module","random","len","e","a","self","Uint32Array","Array","prototype","slice","call","randomFallback","Error","safeStringCompare","known","unknown","right","wrong","i","k","length","charCodeAt","stringToBytes","str","out","utfx","encodeUTF16toUTF8","b","push","base64_encode","off","rs","c1","c2","BASE64_CODE","join","base64_decode","s","slen","olen","o","code","BASE64_INDEX","stringFromCharCode","c3","c4","res","_encipher","lr","P","S","n","l","r","_streamtoword","data","offp","word","key","_key","offset","plen","sw","_ekskey","_crypt","salt","rounds","callback","progressCallback","next","start","Date","now","MAX_EXECUTION_TIME","j","clen","cdata","ret","nextTick","C_ORIG","err","bind","BCRYPT_SALT_LEN","Int32Array","P_ORIG","S_ORIG","_hash","finish","bytes","minor","toString","saltb","charAt","substring","String","fromCharCode","r1","parseInt","r2","real_salt","passwordb","bcrypt","setRandomFallback","bcrypt.setRandomFallback","genSaltSync","bcrypt.genSaltSync","seed_length","GENSALT_DEFAULT_LOG2_ROUNDS","genSalt","bcrypt.genSalt","_async","undefined","Promise","resolve","reject","hashSync","bcrypt.hashSync","hash","bcrypt.hash","compareSync","bcrypt.compareSync","substr","compare","bcrypt.compare","comp","getRounds","bcrypt.getRounds","split","getSalt","bcrypt.getSalt","process","setImmediate","setTimeout","utfx.encodeUTF8","src","dst","cp","utfx.decodeUTF8","c","d","fail","indexOf","name","RangeError","utfx.UTF16toUTF8","utfx.UTF8toUTF16","utfx.encodeUTF16toUTF8","UTF16toUTF8","encodeUTF8","utfx.decodeUTF8toUTF16","decodeUTF8","UTF8toUTF16","utfx.calculateCodePoint","utfx.calculateUTF8","calculateCodePoint","utfx.calculateUTF16asUTF8","encodeBase64","decodeBase64"] -} diff --git a/node_modules/bcryptjs/externs/bcrypt.js b/node_modules/bcryptjs/externs/bcrypt.js deleted file mode 100644 index aa9327c..0000000 --- a/node_modules/bcryptjs/externs/bcrypt.js +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright 2012 The Closure Compiler Authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @fileoverview Definitions for bcrypt.js 2. - * @externs - * @author Daniel Wirtz - */ - -/** - * @type {Object.} - */ -var bcrypt = {}; - -/** - * @param {?function(number):!Array.} random - */ -bcrypt.setRandomFallback = function(random) {}; - -/** - * @param {number=} rounds - * @param {number=} seed_length - * @returns {string} - */ -bcrypt.genSaltSync = function(rounds, seed_length) {}; - -/** - * @param {(number|function(Error, ?string))=} rounds - * @param {(number|function(Error, ?string))=} seed_length - * @param {function(Error, string=)=} callback - */ -bcrypt.genSalt = function(rounds, seed_length, callback) {}; - -/** - * @param {string} s - * @param {(number|string)=} salt - * @returns {?string} - */ -bcrypt.hashSync = function(s, salt) {}; - -/** - * @param {string} s - * @param {number|string} salt - * @param {function(Error, string=)} callback - * @expose - */ -bcrypt.hash = function(s, salt, callback) {}; - -/** - * @param {string} s - * @param {string} hash - * @returns {boolean} - * @throws {Error} - */ -bcrypt.compareSync = function(s, hash) {}; - -/** - * @param {string} s - * @param {string} hash - * @param {function(Error, boolean)} callback - * @throws {Error} - */ -bcrypt.compare = function(s, hash, callback) {}; - -/** - * @param {string} hash - * @returns {number} - * @throws {Error} - */ -bcrypt.getRounds = function(hash) {}; - -/** - * @param {string} hash - * @returns {string} - * @throws {Error} - * @expose - */ -bcrypt.getSalt = function(hash) {}; diff --git a/node_modules/bcryptjs/externs/minimal-env.js b/node_modules/bcryptjs/externs/minimal-env.js deleted file mode 100644 index a5c37f1..0000000 --- a/node_modules/bcryptjs/externs/minimal-env.js +++ /dev/null @@ -1,98 +0,0 @@ -/** - * @fileoverview Minimal environment for bcrypt.js. - * @externs - */ - -/** - * @param {string} moduleName - * returns {*} - */ -function require(moduleName) {} - -/** - * @constructor - * @private - */ -var Module = function() {}; - -/** - * @type {*} - */ -Module.prototype.exports; - -/** - * @type {Module} - */ -var module; - -/** - * @type {string} - */ -var __dirname; - -/** - * @type {Object.} - */ -var process = {}; - -/** - * @param {function()} func - */ -process.nextTick = function(func) {}; - -/** - * @param {string} s - * @constructor - * @extends Array - */ -var Buffer = function(s) {}; - -/** - BEGIN_NODE_INCLUDE - var crypto = require('crypto'); - END_NODE_INCLUDE - */ - -/** - * @type {Object.} - */ -var crypto = {}; - -/** - * @param {number} n - * @returns {Array.} - */ -crypto.randomBytes = function(n) {}; - -/** - * @type {Object.} - */ -window.crypto = {}; - -/** - * @param {Uint8Array|Int8Array|Uint16Array|Int16Array|Uint32Array|Int32Array} array - */ -window.crypto.getRandomValues = function(array) {}; - -/** - * @param {string} name - * @param {function(...[*]):*} constructor - */ -var define = function(name, constructor) {}; - -/** - * @type {boolean} - */ -define.amd; - -/** - * @param {...*} var_args - * @returns {string} - */ -String.fromCodePoint = function(var_args) {}; - -/** - * @param {number} offset - * @returns {number} - */ -String.prototype.codePointAt = function(offset) {}; diff --git a/node_modules/bcryptjs/index.js b/node_modules/bcryptjs/index.js deleted file mode 100644 index baa1e78..0000000 --- a/node_modules/bcryptjs/index.js +++ /dev/null @@ -1,29 +0,0 @@ -/* - Copyright (c) 2012 Nevins Bartolomeo - Copyright (c) 2012 Shane Girish - Copyright (c) 2013 Daniel Wirtz - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -module.exports = require("./dist/bcrypt.js"); diff --git a/node_modules/bcryptjs/package.json b/node_modules/bcryptjs/package.json deleted file mode 100644 index 97be5df..0000000 --- a/node_modules/bcryptjs/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "bcryptjs", - "description": "Optimized bcrypt in plain JavaScript with zero dependencies. Compatible to 'bcrypt'.", - "version": "2.4.3", - "author": "Daniel Wirtz ", - "contributors": [ - "Shane Girish (https://github.com/shaneGirish)", - "Alex Murray <> (https://github.com/alexmurray)", - "Nicolas Pelletier <> (https://github.com/NicolasPelletier)", - "Josh Rogers <> (https://github.com/geekymole)", - "Noah Isaacson (https://github.com/nisaacson)" - ], - "repository": { - "type": "url", - "url": "https://github.com/dcodeIO/bcrypt.js.git" - }, - "bugs": { - "url": "https://github.com/dcodeIO/bcrypt.js/issues" - }, - "keywords": [ - "bcrypt", - "password", - "auth", - "authentication", - "encryption", - "crypt", - "crypto" - ], - "main": "index.js", - "browser": "dist/bcrypt.js", - "dependencies": {}, - "devDependencies": { - "testjs": "~1", - "closurecompiler": "~1", - "metascript": "~0.18", - "bcrypt": "latest", - "utfx": "~1" - }, - "license": "MIT", - "scripts": { - "test": "node node_modules/testjs/bin/testjs", - "build": "node scripts/build.js", - "compile": "node node_modules/closurecompiler/bin/ccjs dist/bcrypt.js --compilation_level=SIMPLE_OPTIMIZATIONS --create_source_map=dist/bcrypt.min.map > dist/bcrypt.min.js", - "compress": "gzip -c -9 dist/bcrypt.min.js > dist/bcrypt.min.js.gz", - "make": "npm run build && npm run compile && npm run compress && npm test" - } -} diff --git a/node_modules/bcryptjs/scripts/build.js b/node_modules/bcryptjs/scripts/build.js deleted file mode 100644 index b90ebd3..0000000 --- a/node_modules/bcryptjs/scripts/build.js +++ /dev/null @@ -1,37 +0,0 @@ -var MetaScript = require("metascript"), - path = require("path"), - fs = require("fs"); - -var rootDir = path.join(__dirname, ".."), - srcDir = path.join(rootDir, "src"), - distDir = path.join(rootDir, "dist"), - pkg = require(path.join(rootDir, "package.json")), - filename; - -var scope = { - VERSION: pkg.version, - ISAAC: false -}; - -// Make standard build -console.log("Building bcrypt.js with scope", JSON.stringify(scope, null, 2)); -fs.writeFileSync( - path.join(distDir, "bcrypt.js"), - MetaScript.transform(fs.readFileSync(filename = path.join(srcDir, "wrap.js")), filename, scope, srcDir) -); - -// Make isaac build - see: https://github.com/dcodeIO/bcrypt.js/issues/16 -/* scope.ISAAC = true; -console.log("Building bcrypt-isaac.js with scope", JSON.stringify(scope, null, 2)); -fs.writeFileSync( - path.join(distDir, "bcrypt-isaac.js"), - MetaScript.transform(fs.readFileSync(filename = path.join(srcDir, "bcrypt.js")), filename, scope, srcDir) -); */ - -// Update bower.json -scope = { VERSION: pkg.version }; -console.log("Updating bower.json with scope", JSON.stringify(scope, null, 2)); -fs.writeFileSync( - path.join(rootDir, "bower.json"), - MetaScript.transform(fs.readFileSync(filename = path.join(srcDir, "bower.json")), filename, scope, srcDir) -); diff --git a/node_modules/bcryptjs/src/bcrypt.js b/node_modules/bcryptjs/src/bcrypt.js deleted file mode 100644 index 77403cd..0000000 --- a/node_modules/bcryptjs/src/bcrypt.js +++ /dev/null @@ -1,327 +0,0 @@ -/** - * bcrypt namespace. - * @type {Object.} - */ -var bcrypt = {}; - -/** - * The random implementation to use as a fallback. - * @type {?function(number):!Array.} - * @inner - */ -var randomFallback = null; - -/** - * Generates cryptographically secure random bytes. - * @function - * @param {number} len Bytes length - * @returns {!Array.} Random bytes - * @throws {Error} If no random implementation is available - * @inner - */ -function random(len) { - /* node */ if (typeof module !== 'undefined' && module && module['exports']) - try { - return require("crypto")['randomBytes'](len); - } catch (e) {} - /* WCA */ try { - var a; (self['crypto']||self['msCrypto'])['getRandomValues'](a = new Uint32Array(len)); - return Array.prototype.slice.call(a); - } catch (e) {} - /* fallback */ if (!randomFallback) - throw Error("Neither WebCryptoAPI nor a crypto module is available. Use bcrypt.setRandomFallback to set an alternative"); - return randomFallback(len); -} - -// Test if any secure randomness source is available -var randomAvailable = false; -try { - random(1); - randomAvailable = true; -} catch (e) {} - -// Default fallback, if any -randomFallback = /*? if (ISAAC) { */function(len) { - for (var a=[], i=0; i} random Function taking the number of bytes to generate as its - * sole argument, returning the corresponding array of cryptographically secure random byte values. - * @see http://nodejs.org/api/crypto.html - * @see http://www.w3.org/TR/WebCryptoAPI/ - */ -bcrypt.setRandomFallback = function(random) { - randomFallback = random; -}; - -/** - * Synchronously generates a salt. - * @param {number=} rounds Number of rounds to use, defaults to 10 if omitted - * @param {number=} seed_length Not supported. - * @returns {string} Resulting salt - * @throws {Error} If a random fallback is required but not set - * @expose - */ -bcrypt.genSaltSync = function(rounds, seed_length) { - rounds = rounds || GENSALT_DEFAULT_LOG2_ROUNDS; - if (typeof rounds !== 'number') - throw Error("Illegal arguments: "+(typeof rounds)+", "+(typeof seed_length)); - if (rounds < 4) - rounds = 4; - else if (rounds > 31) - rounds = 31; - var salt = []; - salt.push("$2a$"); - if (rounds < 10) - salt.push("0"); - salt.push(rounds.toString()); - salt.push('$'); - salt.push(base64_encode(random(BCRYPT_SALT_LEN), BCRYPT_SALT_LEN)); // May throw - return salt.join(''); -}; - -/** - * Asynchronously generates a salt. - * @param {(number|function(Error, string=))=} rounds Number of rounds to use, defaults to 10 if omitted - * @param {(number|function(Error, string=))=} seed_length Not supported. - * @param {function(Error, string=)=} callback Callback receiving the error, if any, and the resulting salt - * @returns {!Promise} If `callback` has been omitted - * @throws {Error} If `callback` is present but not a function - * @expose - */ -bcrypt.genSalt = function(rounds, seed_length, callback) { - if (typeof seed_length === 'function') - callback = seed_length, - seed_length = undefined; // Not supported. - if (typeof rounds === 'function') - callback = rounds, - rounds = undefined; - if (typeof rounds === 'undefined') - rounds = GENSALT_DEFAULT_LOG2_ROUNDS; - else if (typeof rounds !== 'number') - throw Error("illegal arguments: "+(typeof rounds)); - - function _async(callback) { - nextTick(function() { // Pretty thin, but salting is fast enough - try { - callback(null, bcrypt.genSaltSync(rounds)); - } catch (err) { - callback(err); - } - }); - } - - if (callback) { - if (typeof callback !== 'function') - throw Error("Illegal callback: "+typeof(callback)); - _async(callback); - } else - return new Promise(function(resolve, reject) { - _async(function(err, res) { - if (err) { - reject(err); - return; - } - resolve(res); - }); - }); -}; - -/** - * Synchronously generates a hash for the given string. - * @param {string} s String to hash - * @param {(number|string)=} salt Salt length to generate or salt to use, default to 10 - * @returns {string} Resulting hash - * @expose - */ -bcrypt.hashSync = function(s, salt) { - if (typeof salt === 'undefined') - salt = GENSALT_DEFAULT_LOG2_ROUNDS; - if (typeof salt === 'number') - salt = bcrypt.genSaltSync(salt); - if (typeof s !== 'string' || typeof salt !== 'string') - throw Error("Illegal arguments: "+(typeof s)+', '+(typeof salt)); - return _hash(s, salt); -}; - -/** - * Asynchronously generates a hash for the given string. - * @param {string} s String to hash - * @param {number|string} salt Salt length to generate or salt to use - * @param {function(Error, string=)=} callback Callback receiving the error, if any, and the resulting hash - * @param {function(number)=} progressCallback Callback successively called with the percentage of rounds completed - * (0.0 - 1.0), maximally once per `MAX_EXECUTION_TIME = 100` ms. - * @returns {!Promise} If `callback` has been omitted - * @throws {Error} If `callback` is present but not a function - * @expose - */ -bcrypt.hash = function(s, salt, callback, progressCallback) { - - function _async(callback) { - if (typeof s === 'string' && typeof salt === 'number') - bcrypt.genSalt(salt, function(err, salt) { - _hash(s, salt, callback, progressCallback); - }); - else if (typeof s === 'string' && typeof salt === 'string') - _hash(s, salt, callback, progressCallback); - else - nextTick(callback.bind(this, Error("Illegal arguments: "+(typeof s)+', '+(typeof salt)))); - } - - if (callback) { - if (typeof callback !== 'function') - throw Error("Illegal callback: "+typeof(callback)); - _async(callback); - } else - return new Promise(function(resolve, reject) { - _async(function(err, res) { - if (err) { - reject(err); - return; - } - resolve(res); - }); - }); -}; - -/** - * Compares two strings of the same length in constant time. - * @param {string} known Must be of the correct length - * @param {string} unknown Must be the same length as `known` - * @returns {boolean} - * @inner - */ -function safeStringCompare(known, unknown) { - var right = 0, - wrong = 0; - for (var i=0, k=known.length; i} b Byte array - * @param {number} len Maximum input length - * @returns {string} - * @expose - */ -bcrypt.encodeBase64 = base64_encode; - -/** - * Decodes a base64 encoded string to up to len bytes of output, using the custom bcrypt alphabet. - * @function - * @param {string} s String to decode - * @param {number} len Maximum output length - * @returns {!Array.} - * @expose - */ -bcrypt.decodeBase64 = base64_decode; diff --git a/node_modules/bcryptjs/src/bcrypt/impl.js b/node_modules/bcryptjs/src/bcrypt/impl.js deleted file mode 100644 index 480bfd6..0000000 --- a/node_modules/bcryptjs/src/bcrypt/impl.js +++ /dev/null @@ -1,669 +0,0 @@ -/** - * @type {number} - * @const - * @inner - */ -var BCRYPT_SALT_LEN = 16; - -/** - * @type {number} - * @const - * @inner - */ -var GENSALT_DEFAULT_LOG2_ROUNDS = 10; - -/** - * @type {number} - * @const - * @inner - */ -var BLOWFISH_NUM_ROUNDS = 16; - -/** - * @type {number} - * @const - * @inner - */ -var MAX_EXECUTION_TIME = 100; - -/** - * @type {Array.} - * @const - * @inner - */ -var P_ORIG = [ - 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, - 0x299f31d0, 0x082efa98, 0xec4e6c89, 0x452821e6, 0x38d01377, - 0xbe5466cf, 0x34e90c6c, 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, - 0xb5470917, 0x9216d5d9, 0x8979fb1b -]; - -/** - * @type {Array.} - * @const - * @inner - */ -var S_ORIG = [ - 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, - 0x6a267e96, 0xba7c9045, 0xf12c7f99, 0x24a19947, 0xb3916cf7, - 0x0801f2e2, 0x858efc16, 0x636920d8, 0x71574e69, 0xa458fea3, - 0xf4933d7e, 0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee, - 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013, 0xc5d1b023, - 0x286085f0, 0xca417918, 0xb8db38ef, 0x8e79dcb0, 0x603a180e, - 0x6c9e0e8b, 0xb01e8a3e, 0xd71577c1, 0xbd314b27, 0x78af2fda, - 0x55605c60, 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, - 0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce, 0xa15486af, - 0x7c72e993, 0xb3ee1411, 0x636fbc2a, 0x2ba9c55d, 0x741831f6, - 0xce5c3e16, 0x9b87931e, 0xafd6ba33, 0x6c24cf5c, 0x7a325381, - 0x28958677, 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193, - 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, 0xef845d5d, - 0xe98575b1, 0xdc262302, 0xeb651b88, 0x23893e81, 0xd396acc5, - 0x0f6d6ff3, 0x83f44239, 0x2e0b4482, 0xa4842004, 0x69c8f04a, - 0x9e1f9b5e, 0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0, - 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3, 0x6eef0b6c, - 0x137a3be4, 0xba3bf050, 0x7efb2a98, 0xa1f1651d, 0x39af0176, - 0x66ca593e, 0x82430e88, 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, - 0x3b8b5ebe, 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, - 0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d, 0x37d0d724, - 0xd00a1248, 0xdb0fead3, 0x49f1c09b, 0x075372c9, 0x80991b7b, - 0x25d479d8, 0xf6e8def7, 0xe3fe501a, 0xb6794c3b, 0x976ce0bd, - 0x04c006ba, 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463, - 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, 0x6dfc511f, - 0x9b30952c, 0xcc814544, 0xaf5ebd09, 0xbee3d004, 0xde334afd, - 0x660f2807, 0x192e4bb3, 0xc0cba857, 0x45c8740f, 0xd20b5f39, - 0xb9d3fbdb, 0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279, - 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8, 0x3c7516df, - 0xfd616b15, 0x2f501ec8, 0xad0552ab, 0x323db5fa, 0xfd238760, - 0x53317b48, 0x3e00df82, 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, - 0xdf1769db, 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, - 0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0, 0x10fa3d98, - 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b, 0x9a53e479, 0xb6f84565, - 0xd28e49bc, 0x4bfb9790, 0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, - 0xcee4c6e8, 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4, - 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, 0xd08ed1d0, - 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7, 0x8ff6e2fb, 0xf2122b64, - 0x8888b812, 0x900df01c, 0x4fad5ea0, 0x688fc31c, 0xd1cff191, - 0xb3a8c1ad, 0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1, - 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299, 0xb4a84fe0, - 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, 0x165fa266, 0x80957705, - 0x93cc7314, 0x211a1477, 0xe6ad2065, 0x77b5fa86, 0xc75442f5, - 0xfb9d35cf, 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, - 0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af, 0x2464369b, - 0xf009b91e, 0x5563911d, 0x59dfa6aa, 0x78c14389, 0xd95a537f, - 0x207d5ba2, 0x02e5b9c5, 0x83260376, 0x6295cfa9, 0x11c81968, - 0x4e734a41, 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915, - 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, 0x08ba6fb5, - 0x571be91f, 0xf296ec6b, 0x2a0dd915, 0xb6636521, 0xe7b9f9b6, - 0xff34052e, 0xc5855664, 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, - 0x6e85076a, 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, - 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266, 0xecaa8c71, - 0x699a17ff, 0x5664526c, 0xc2b19ee1, 0x193602a5, 0x75094c29, - 0xa0591340, 0xe4183a3e, 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, - 0x99f73fd6, 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1, - 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e, 0x09686b3f, - 0x3ebaefc9, 0x3c971814, 0x6b6a70a1, 0x687f3584, 0x52a0e286, - 0xb79c5305, 0xaa500737, 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, - 0x5716f2b8, 0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff, - 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd, 0xd19113f9, - 0x7ca92ff6, 0x94324773, 0x22f54701, 0x3ae5e581, 0x37c2dadc, - 0xc8b57634, 0x9af3dda7, 0xa9446146, 0x0fd0030e, 0xecc8c73e, - 0xa4751e41, 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331, - 0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf, 0x2cb81290, - 0x24977c79, 0x5679b072, 0xbcaf89af, 0xde9a771f, 0xd9930810, - 0xb38bae12, 0xdccf3f2e, 0x5512721f, 0x2e6b7124, 0x501adde6, - 0x9f84cd87, 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c, - 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2, 0xef1c1847, - 0x3215d908, 0xdd433b37, 0x24c2ba16, 0x12a14d43, 0x2a65c451, - 0x50940002, 0x133ae4dd, 0x71dff89e, 0x10314e55, 0x81ac77d6, - 0x5f11199b, 0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509, - 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e, 0x86e34570, - 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3, 0x771fe71c, 0x4e3d06fa, - 0x2965dcb9, 0x99e71d0f, 0x803e89d6, 0x5266c825, 0x2e4cc978, - 0x9c10b36a, 0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, - 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960, 0x5223a708, - 0xf71312b6, 0xebadfe6e, 0xeac31f66, 0xe3bc4595, 0xa67bc883, - 0xb17f37d1, 0x018cff28, 0xc332ddef, 0xbe6c5aa5, 0x65582185, - 0x68ab9802, 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84, - 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, 0x13cca830, - 0xeb61bd96, 0x0334fe1e, 0xaa0363cf, 0xb5735c90, 0x4c70a239, - 0xd59e9e0b, 0xcbaade14, 0xeecc86bc, 0x60622ca7, 0x9cab5cab, - 0xb2f3846e, 0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50, - 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7, 0x9b540b19, - 0x875fa099, 0x95f7997e, 0x623d7da8, 0xf837889a, 0x97e32d77, - 0x11ed935f, 0x16681281, 0x0e358829, 0xc7e61fd6, 0x96dedfa1, - 0x7858ba99, 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696, - 0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128, 0x58ebf2ef, - 0x34c6ffea, 0xfe28ed61, 0xee7c3c73, 0x5d4a14d9, 0xe864b7e3, - 0x42105d14, 0x203e13e0, 0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, - 0xfacb4fd0, 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105, - 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250, 0xcf62a1f2, - 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3, 0x7f1524c3, 0x69cb7492, - 0x47848a0b, 0x5692b285, 0x095bbf00, 0xad19489d, 0x1462b174, - 0x23820e00, 0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061, - 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, 0x7cde3759, - 0xcbee7460, 0x4085f2a7, 0xce77326e, 0xa6078084, 0x19f8509e, - 0xe8efd855, 0x61d99735, 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, - 0x800bcadc, 0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9, - 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340, 0xc5c43465, - 0x713e38d8, 0x3d28f89e, 0xf16dff20, 0x153e21e7, 0x8fb03d4a, - 0xe6e39f2b, 0xdb83adf7, 0xe93d5a68, 0x948140f7, 0xf64c261c, - 0x94692934, 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068, - 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af, 0x1e39f62e, - 0x97244546, 0x14214f74, 0xbf8b8840, 0x4d95fc1d, 0x96b591af, - 0x70f4ddd3, 0x66a02f45, 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, - 0x31cb8504, 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a, - 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb, 0x68dc1462, - 0xd7486900, 0x680ec0a4, 0x27a18dee, 0x4f3ffea2, 0xe887ad8c, - 0xb58ce006, 0x7af4d6b6, 0xaace1e7c, 0xd3375fec, 0xce78a399, - 0x406b2a42, 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b, - 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, 0x3a6efa74, - 0xdd5b4332, 0x6841e7f7, 0xca7820fb, 0xfb0af54e, 0xd8feb397, - 0x454056ac, 0xba489527, 0x55533a3a, 0x20838d87, 0xfe6ba9b7, - 0xd096954b, 0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33, - 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c, 0xfdf8e802, - 0x04272f70, 0x80bb155c, 0x05282ce3, 0x95c11548, 0xe4c66d22, - 0x48c1133f, 0xc70f86dc, 0x07f9c9ee, 0x41041f0f, 0x404779a4, - 0x5d886e17, 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564, - 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b, 0x0e12b4c2, - 0x02e1329e, 0xaf664fd1, 0xcad18115, 0x6b2395e0, 0x333e92e1, - 0x3b240b62, 0xeebeb922, 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, - 0x2da2f728, 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0, - 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e, 0x0a476341, - 0x992eff74, 0x3a6f6eab, 0xf4f8fd37, 0xa812dc60, 0xa1ebddf8, - 0x991be14c, 0xdb6e6b0d, 0xc67b5510, 0x6d672c37, 0x2765d43b, - 0xdcd0e804, 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b, - 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3, 0xbb132f88, - 0x515bad24, 0x7b9479bf, 0x763bd6eb, 0x37392eb3, 0xcc115979, - 0x8026e297, 0xf42e312d, 0x6842ada7, 0xc66a2b3b, 0x12754ccc, - 0x782ef11c, 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350, - 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9, 0x44421659, - 0x0a121386, 0xd90cec6e, 0xd5abea2a, 0x64af674e, 0xda86a85f, - 0xbebfe988, 0x64e4c3fe, 0x9dbc8057, 0xf0f7c086, 0x60787bf8, - 0x6003604d, 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc, - 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f, 0x77a057be, - 0xbde8ae24, 0x55464299, 0xbf582e61, 0x4e58f48f, 0xf2ddfda2, - 0xf474ef38, 0x8789bdc2, 0x5366f9c3, 0xc8b38e74, 0xb475f255, - 0x46fcd9b9, 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2, - 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c, 0xb90bace1, - 0xbb8205d0, 0x11a86248, 0x7574a99e, 0xb77f19b6, 0xe0a9dc09, - 0x662d09a1, 0xc4324633, 0xe85a1f02, 0x09f0be8c, 0x4a99a025, - 0x1d6efe10, 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169, - 0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52, 0x50115e01, - 0xa70683fa, 0xa002b5c4, 0x0de6d027, 0x9af88c27, 0x773f8641, - 0xc3604c06, 0x61a806b5, 0xf0177a28, 0xc0f586e0, 0x006058aa, - 0x30dc7d62, 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634, - 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76, 0x6f05e409, - 0x4b7c0188, 0x39720a3d, 0x7c927c24, 0x86e3725f, 0x724d9db9, - 0x1ac15bb4, 0xd39eb8fc, 0xed545578, 0x08fca5b5, 0xd83d7cd3, - 0x4dad0fc4, 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c, - 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837, 0xd79a3234, - 0x92638212, 0x670efa8e, 0x406000e0, 0x3a39ce37, 0xd3faf5cf, - 0xabc27737, 0x5ac52d1b, 0x5cb0679e, 0x4fa33742, 0xd3822740, - 0x99bc9bbe, 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b, - 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, 0x5748ab2f, - 0xbc946e79, 0xc6a376d2, 0x6549c2c8, 0x530ff8ee, 0x468dde7d, - 0xd5730a1d, 0x4cd04dc6, 0x2939bbdb, 0xa9ba4650, 0xac9526e8, - 0xbe5ee304, 0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22, - 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4, 0x83c061ba, - 0x9be96a4d, 0x8fe51550, 0xba645bd6, 0x2826a2f9, 0xa73a3ae1, - 0x4ba99586, 0xef5562e9, 0xc72fefd3, 0xf752f7da, 0x3f046f69, - 0x77fa0a59, 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, - 0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51, 0x96d5ac3a, - 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28, 0x1f9f25cf, 0xadf2b89b, - 0x5ad6b472, 0x5a88f54c, 0xe029ac71, 0xe019a5e6, 0x47b0acfd, - 0xed93fa9b, 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28, - 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, 0x15056dd4, - 0x88f46dba, 0x03a16125, 0x0564f0bd, 0xc3eb9e15, 0x3c9057a2, - 0x97271aec, 0xa93a072a, 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, - 0x26dcf319, 0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb, - 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f, 0x4de81751, - 0x3830dc8e, 0x379d5862, 0x9320f991, 0xea7a90c2, 0xfb3e7bce, - 0x5121ce64, 0x774fbe32, 0xa8b6e37e, 0xc3293d46, 0x48de5369, - 0x6413e680, 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166, - 0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae, 0x5bbef7dd, - 0x1b588d40, 0xccd2017f, 0x6bb4e3bb, 0xdda26a7e, 0x3a59ff45, - 0x3e350a44, 0xbcb4cdd5, 0x72eacea8, 0xfa6484bb, 0x8d6612ae, - 0xbf3c6f47, 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370, - 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, 0x4040cb08, - 0x4eb4e2cc, 0x34d2466a, 0x0115af84, 0xe1b00428, 0x95983a1d, - 0x06b89fb4, 0xce6ea048, 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, - 0x277227f8, 0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd, - 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9, 0xe01cc87e, - 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, 0x1a908749, 0xd44fbd9a, - 0xd0dadecb, 0xd50ada38, 0x0339c32a, 0xc6913667, 0x8df9317c, - 0xe0b12b4f, 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, - 0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525, 0xfae59361, - 0xceb69ceb, 0xc2a86459, 0x12baa8d1, 0xb6c1075e, 0xe3056a0c, - 0x10d25065, 0xcb03a442, 0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, - 0x3278e964, 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e, - 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, 0xdf359f8d, - 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d, 0xe54cda54, 0x1edad891, - 0xce6279cf, 0xcd3e7e6f, 0x1618b166, 0xfd2c1d05, 0x848fd2c5, - 0xf6fb2299, 0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02, - 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc, 0xde966292, - 0x81b949d0, 0x4c50901b, 0x71c65614, 0xe6c6c7bd, 0x327a140a, - 0x45e1d006, 0xc3f27b9a, 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, - 0x35bdd2f6, 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, - 0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0, 0xba38209c, - 0xf746ce76, 0x77afa1c5, 0x20756060, 0x85cbfe4e, 0x8ae88dd8, - 0x7aaaf9b0, 0x4cf9aa7e, 0x1948c25c, 0x02fb8a8c, 0x01c36ae4, - 0xd6ebe1f9, 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f, - 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6 -]; - -/** - * @type {Array.} - * @const - * @inner - */ -var C_ORIG = [ - 0x4f727068, 0x65616e42, 0x65686f6c, 0x64657253, 0x63727944, - 0x6f756274 -]; - -/** - * @param {Array.} lr - * @param {number} off - * @param {Array.} P - * @param {Array.} S - * @returns {Array.} - * @inner - */ -function _encipher(lr, off, P, S) { // This is our bottleneck: 1714/1905 ticks / 90% - see profile.txt - var n, - l = lr[off], - r = lr[off + 1]; - - l ^= P[0]; - - /* - for (var i=0, k=BLOWFISH_NUM_ROUNDS-2; i<=k;) - // Feistel substitution on left word - n = S[l >>> 24], - n += S[0x100 | ((l >> 16) & 0xff)], - n ^= S[0x200 | ((l >> 8) & 0xff)], - n += S[0x300 | (l & 0xff)], - r ^= n ^ P[++i], - // Feistel substitution on right word - n = S[r >>> 24], - n += S[0x100 | ((r >> 16) & 0xff)], - n ^= S[0x200 | ((r >> 8) & 0xff)], - n += S[0x300 | (r & 0xff)], - l ^= n ^ P[++i]; - */ - - //The following is an unrolled version of the above loop. - //Iteration 0 - n = S[l >>> 24]; - n += S[0x100 | ((l >> 16) & 0xff)]; - n ^= S[0x200 | ((l >> 8) & 0xff)]; - n += S[0x300 | (l & 0xff)]; - r ^= n ^ P[1]; - n = S[r >>> 24]; - n += S[0x100 | ((r >> 16) & 0xff)]; - n ^= S[0x200 | ((r >> 8) & 0xff)]; - n += S[0x300 | (r & 0xff)]; - l ^= n ^ P[2]; - //Iteration 1 - n = S[l >>> 24]; - n += S[0x100 | ((l >> 16) & 0xff)]; - n ^= S[0x200 | ((l >> 8) & 0xff)]; - n += S[0x300 | (l & 0xff)]; - r ^= n ^ P[3]; - n = S[r >>> 24]; - n += S[0x100 | ((r >> 16) & 0xff)]; - n ^= S[0x200 | ((r >> 8) & 0xff)]; - n += S[0x300 | (r & 0xff)]; - l ^= n ^ P[4]; - //Iteration 2 - n = S[l >>> 24]; - n += S[0x100 | ((l >> 16) & 0xff)]; - n ^= S[0x200 | ((l >> 8) & 0xff)]; - n += S[0x300 | (l & 0xff)]; - r ^= n ^ P[5]; - n = S[r >>> 24]; - n += S[0x100 | ((r >> 16) & 0xff)]; - n ^= S[0x200 | ((r >> 8) & 0xff)]; - n += S[0x300 | (r & 0xff)]; - l ^= n ^ P[6]; - //Iteration 3 - n = S[l >>> 24]; - n += S[0x100 | ((l >> 16) & 0xff)]; - n ^= S[0x200 | ((l >> 8) & 0xff)]; - n += S[0x300 | (l & 0xff)]; - r ^= n ^ P[7]; - n = S[r >>> 24]; - n += S[0x100 | ((r >> 16) & 0xff)]; - n ^= S[0x200 | ((r >> 8) & 0xff)]; - n += S[0x300 | (r & 0xff)]; - l ^= n ^ P[8]; - //Iteration 4 - n = S[l >>> 24]; - n += S[0x100 | ((l >> 16) & 0xff)]; - n ^= S[0x200 | ((l >> 8) & 0xff)]; - n += S[0x300 | (l & 0xff)]; - r ^= n ^ P[9]; - n = S[r >>> 24]; - n += S[0x100 | ((r >> 16) & 0xff)]; - n ^= S[0x200 | ((r >> 8) & 0xff)]; - n += S[0x300 | (r & 0xff)]; - l ^= n ^ P[10]; - //Iteration 5 - n = S[l >>> 24]; - n += S[0x100 | ((l >> 16) & 0xff)]; - n ^= S[0x200 | ((l >> 8) & 0xff)]; - n += S[0x300 | (l & 0xff)]; - r ^= n ^ P[11]; - n = S[r >>> 24]; - n += S[0x100 | ((r >> 16) & 0xff)]; - n ^= S[0x200 | ((r >> 8) & 0xff)]; - n += S[0x300 | (r & 0xff)]; - l ^= n ^ P[12]; - //Iteration 6 - n = S[l >>> 24]; - n += S[0x100 | ((l >> 16) & 0xff)]; - n ^= S[0x200 | ((l >> 8) & 0xff)]; - n += S[0x300 | (l & 0xff)]; - r ^= n ^ P[13]; - n = S[r >>> 24]; - n += S[0x100 | ((r >> 16) & 0xff)]; - n ^= S[0x200 | ((r >> 8) & 0xff)]; - n += S[0x300 | (r & 0xff)]; - l ^= n ^ P[14]; - //Iteration 7 - n = S[l >>> 24]; - n += S[0x100 | ((l >> 16) & 0xff)]; - n ^= S[0x200 | ((l >> 8) & 0xff)]; - n += S[0x300 | (l & 0xff)]; - r ^= n ^ P[15]; - n = S[r >>> 24]; - n += S[0x100 | ((r >> 16) & 0xff)]; - n ^= S[0x200 | ((r >> 8) & 0xff)]; - n += S[0x300 | (r & 0xff)]; - l ^= n ^ P[16]; - - lr[off] = r ^ P[BLOWFISH_NUM_ROUNDS + 1]; - lr[off + 1] = l; - return lr; -} - -/** - * @param {Array.} data - * @param {number} offp - * @returns {{key: number, offp: number}} - * @inner - */ -function _streamtoword(data, offp) { - for (var i = 0, word = 0; i < 4; ++i) - word = (word << 8) | (data[offp] & 0xff), - offp = (offp + 1) % data.length; - return { key: word, offp: offp }; -} - -/** - * @param {Array.} key - * @param {Array.} P - * @param {Array.} S - * @inner - */ -function _key(key, P, S) { - var offset = 0, - lr = [0, 0], - plen = P.length, - slen = S.length, - sw; - for (var i = 0; i < plen; i++) - sw = _streamtoword(key, offset), - offset = sw.offp, - P[i] = P[i] ^ sw.key; - for (i = 0; i < plen; i += 2) - lr = _encipher(lr, 0, P, S), - P[i] = lr[0], - P[i + 1] = lr[1]; - for (i = 0; i < slen; i += 2) - lr = _encipher(lr, 0, P, S), - S[i] = lr[0], - S[i + 1] = lr[1]; -} - -/** - * Expensive key schedule Blowfish. - * @param {Array.} data - * @param {Array.} key - * @param {Array.} P - * @param {Array.} S - * @inner - */ -function _ekskey(data, key, P, S) { - var offp = 0, - lr = [0, 0], - plen = P.length, - slen = S.length, - sw; - for (var i = 0; i < plen; i++) - sw = _streamtoword(key, offp), - offp = sw.offp, - P[i] = P[i] ^ sw.key; - offp = 0; - for (i = 0; i < plen; i += 2) - sw = _streamtoword(data, offp), - offp = sw.offp, - lr[0] ^= sw.key, - sw = _streamtoword(data, offp), - offp = sw.offp, - lr[1] ^= sw.key, - lr = _encipher(lr, 0, P, S), - P[i] = lr[0], - P[i + 1] = lr[1]; - for (i = 0; i < slen; i += 2) - sw = _streamtoword(data, offp), - offp = sw.offp, - lr[0] ^= sw.key, - sw = _streamtoword(data, offp), - offp = sw.offp, - lr[1] ^= sw.key, - lr = _encipher(lr, 0, P, S), - S[i] = lr[0], - S[i + 1] = lr[1]; -} - -/** - * Internaly crypts a string. - * @param {Array.} b Bytes to crypt - * @param {Array.} salt Salt bytes to use - * @param {number} rounds Number of rounds - * @param {function(Error, Array.=)=} callback Callback receiving the error, if any, and the resulting bytes. If - * omitted, the operation will be performed synchronously. - * @param {function(number)=} progressCallback Callback called with the current progress - * @returns {!Array.|undefined} Resulting bytes if callback has been omitted, otherwise `undefined` - * @inner - */ -function _crypt(b, salt, rounds, callback, progressCallback) { - var cdata = C_ORIG.slice(), - clen = cdata.length, - err; - - // Validate - if (rounds < 4 || rounds > 31) { - err = Error("Illegal number of rounds (4-31): "+rounds); - if (callback) { - nextTick(callback.bind(this, err)); - return; - } else - throw err; - } - if (salt.length !== BCRYPT_SALT_LEN) { - err =Error("Illegal salt length: "+salt.length+" != "+BCRYPT_SALT_LEN); - if (callback) { - nextTick(callback.bind(this, err)); - return; - } else - throw err; - } - rounds = (1 << rounds) >>> 0; - - var P, S, i = 0, j; - - //Use typed arrays when available - huge speedup! - if (Int32Array) { - P = new Int32Array(P_ORIG); - S = new Int32Array(S_ORIG); - } else { - P = P_ORIG.slice(); - S = S_ORIG.slice(); - } - - _ekskey(salt, b, P, S); - - /** - * Calcualtes the next round. - * @returns {Array.|undefined} Resulting array if callback has been omitted, otherwise `undefined` - * @inner - */ - function next() { - if (progressCallback) - progressCallback(i / rounds); - if (i < rounds) { - var start = Date.now(); - for (; i < rounds;) { - i = i + 1; - _key(b, P, S); - _key(salt, P, S); - if (Date.now() - start > MAX_EXECUTION_TIME) - break; - } - } else { - for (i = 0; i < 64; i++) - for (j = 0; j < (clen >> 1); j++) - _encipher(cdata, j << 1, P, S); - var ret = []; - for (i = 0; i < clen; i++) - ret.push(((cdata[i] >> 24) & 0xff) >>> 0), - ret.push(((cdata[i] >> 16) & 0xff) >>> 0), - ret.push(((cdata[i] >> 8) & 0xff) >>> 0), - ret.push((cdata[i] & 0xff) >>> 0); - if (callback) { - callback(null, ret); - return; - } else - return ret; - } - if (callback) - nextTick(next); - } - - // Async - if (typeof callback !== 'undefined') { - next(); - - // Sync - } else { - var res; - while (true) - if (typeof(res = next()) !== 'undefined') - return res || []; - } -} - -/** - * Internally hashes a string. - * @param {string} s String to hash - * @param {?string} salt Salt to use, actually never null - * @param {function(Error, string=)=} callback Callback receiving the error, if any, and the resulting hash. If omitted, - * hashing is perormed synchronously. - * @param {function(number)=} progressCallback Callback called with the current progress - * @returns {string|undefined} Resulting hash if callback has been omitted, otherwise `undefined` - * @inner - */ -function _hash(s, salt, callback, progressCallback) { - var err; - if (typeof s !== 'string' || typeof salt !== 'string') { - err = Error("Invalid string / salt: Not a string"); - if (callback) { - nextTick(callback.bind(this, err)); - return; - } - else - throw err; - } - - // Validate the salt - var minor, offset; - if (salt.charAt(0) !== '$' || salt.charAt(1) !== '2') { - err = Error("Invalid salt version: "+salt.substring(0,2)); - if (callback) { - nextTick(callback.bind(this, err)); - return; - } - else - throw err; - } - if (salt.charAt(2) === '$') - minor = String.fromCharCode(0), - offset = 3; - else { - minor = salt.charAt(2); - if ((minor !== 'a' && minor !== 'b' && minor !== 'y') || salt.charAt(3) !== '$') { - err = Error("Invalid salt revision: "+salt.substring(2,4)); - if (callback) { - nextTick(callback.bind(this, err)); - return; - } else - throw err; - } - offset = 4; - } - - // Extract number of rounds - if (salt.charAt(offset + 2) > '$') { - err = Error("Missing salt rounds"); - if (callback) { - nextTick(callback.bind(this, err)); - return; - } else - throw err; - } - var r1 = parseInt(salt.substring(offset, offset + 1), 10) * 10, - r2 = parseInt(salt.substring(offset + 1, offset + 2), 10), - rounds = r1 + r2, - real_salt = salt.substring(offset + 3, offset + 25); - s += minor >= 'a' ? "\x00" : ""; - - var passwordb = stringToBytes(s), - saltb = base64_decode(real_salt, BCRYPT_SALT_LEN); - - /** - * Finishes hashing. - * @param {Array.} bytes Byte array - * @returns {string} - * @inner - */ - function finish(bytes) { - var res = []; - res.push("$2"); - if (minor >= 'a') - res.push(minor); - res.push("$"); - if (rounds < 10) - res.push("0"); - res.push(rounds.toString()); - res.push("$"); - res.push(base64_encode(saltb, saltb.length)); - res.push(base64_encode(bytes, C_ORIG.length * 4 - 1)); - return res.join(''); - } - - // Sync - if (typeof callback == 'undefined') - return finish(_crypt(passwordb, saltb, rounds)); - - // Async - else { - _crypt(passwordb, saltb, rounds, function(err, bytes) { - if (err) - callback(err, null); - else - callback(null, finish(bytes)); - }, progressCallback); - } -} diff --git a/node_modules/bcryptjs/src/bcrypt/prng/README.md b/node_modules/bcryptjs/src/bcrypt/prng/README.md deleted file mode 100644 index e6c2c68..0000000 --- a/node_modules/bcryptjs/src/bcrypt/prng/README.md +++ /dev/null @@ -1,5 +0,0 @@ -Because of [reasonable security doubts](https://github.com/dcodeIO/bcrypt.js/issues/16), these files, which used to be -a part of bcrypt-isaac.js, are no longer used but are kept here for reference only. - -What is required instead is a proper way to collect entropy sources (using an intermediate stream cipher) which is then -used to seed the CSPRNG. Pick one and use `bcrypt.setRandomFallback` instead. diff --git a/node_modules/bcryptjs/src/bcrypt/prng/accum.js b/node_modules/bcryptjs/src/bcrypt/prng/accum.js deleted file mode 100644 index 025d5c8..0000000 --- a/node_modules/bcryptjs/src/bcrypt/prng/accum.js +++ /dev/null @@ -1,133 +0,0 @@ -/* basic entropy accumulator */ -var accum = (function() { - - var pool, // randomness pool - time, // start timestamp - last; // last step timestamp - - /* initialize with default pool */ - function init() { - pool = []; - time = new Date().getTime(); - last = time; - // use Math.random - pool.push((Math.random() * 0xffffffff)|0); - // use current time - pool.push(time|0); - } - - /* perform one step */ - function step() { - if (!to) - return; - if (pool.length >= 255) { // stop at 255 values (1 more is added on fetch) - stop(); - return; - } - var now = new Date().getTime(); - // use actual time difference - pool.push(now-last); - // always compute, occasionally use Math.random - var rnd = (Math.random() * 0xffffffff)|0; - if (now % 2) - pool[pool.length-1] += rnd; - last = now; - to = setTimeout(step, 100+Math.random()*512); // use hypothetical time difference - } - - var to = null; - - /* starts accumulating */ - function start() { - if (to) return; - to = setTimeout(step, 100+Math.random()*512); - if (console.log) - console.log("bcrypt-isaac: collecting entropy..."); - // install collectors - if (typeof window !== 'undefined' && window && window.addEventListener) - window.addEventListener("load", loadCollector, false), - window.addEventListener("mousemove", mouseCollector, false), - window.addEventListener("touchmove", touchCollector, false); - else if (typeof document !== 'undefined' && document && document.attachEvent) - document.attachEvent("onload", loadCollector), - document.attachEvent("onmousemove", mouseCollector); - } - - /* stops accumulating */ - function stop() { - if (!to) return; - clearTimeout(to); to = null; - // uninstall collectors - if (typeof window !== 'undefined' && window && window.removeEventListener) - window.removeEventListener("load", loadCollector, false), - window.removeEventListener("mousemove", mouseCollector, false), - window.removeEventListener("touchmove", touchCollector, false); - else if (typeof document !== 'undefined' && document && document.detachEvent) - document.detachEvent("onload", loadCollector), - document.detachEvent("onmousemove", mouseCollector); - } - - /* fetches the randomness pool */ - function fetch() { - // add overall time difference - pool.push((new Date().getTime()-time)|0); - var res = pool; - init(); - if (console.log) - console.log("bcrypt-isaac: using "+res.length+"/256 samples of entropy"); - // console.log(res); - return res; - } - - /* adds the current time to the top of the pool */ - function addTime() { - pool[pool.length-1] += new Date().getTime() - time; - } - - /* page load collector */ - function loadCollector() { - if (!to || pool.length >= 255) - return; - pool.push(0); - addTime(); - } - - /* mouse events collector */ - function mouseCollector(ev) { - if (!to || pool.length >= 255) - return; - try { - var x = ev.x || ev.clientX || ev.offsetX || 0, - y = ev.y || ev.clientY || ev.offsetY || 0; - if (x != 0 || y != 0) - pool[pool.length-1] += ((x-mouseCollector.last[0]) ^ (y-mouseCollector.last[1])), - addTime(), - mouseCollector.last = [x,y]; - } catch (e) {} - } - mouseCollector.last = [0,0]; - - /* touch events collector */ - function touchCollector(ev) { - if (!to || pool.length >= 255) - return; - try { - var touch = ev.touches[0] || ev.changedTouches[0]; - var x = touch.pageX || touch.clientX || 0, - y = touch.pageY || touch.clientY || 0; - if (x != 0 || y != 0) - pool[pool.length-1] += (x-touchCollector.last[0]) ^ (y-touchCollector.last[1]), - addTime(), - touchCollector.last = [x,y]; - } catch (e) {} - } - touchCollector.last = [0,0]; - - init(); - return { - "start": start, - "stop": stop, - "fetch": fetch - } - -})(); diff --git a/node_modules/bcryptjs/src/bcrypt/prng/isaac.js b/node_modules/bcryptjs/src/bcrypt/prng/isaac.js deleted file mode 100644 index e4ce30f..0000000 --- a/node_modules/bcryptjs/src/bcrypt/prng/isaac.js +++ /dev/null @@ -1,140 +0,0 @@ -/* - isaac.js Copyright (c) 2012 Yves-Marie K. Rinquin - - 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. - */ - -/* isaac module pattern */ -var isaac = (function(){ - - /* internal states */ - var m = Array(256), // internal memory - acc = 0, // accumulator - brs = 0, // last result - cnt = 0, // counter - r = Array(256), // result array - gnt = 0, // generation counter - isd = false; // initially seeded - - - /* 32-bit integer safe adder */ - function add(x, y) { - var lsb = (x & 0xffff) + (y & 0xffff), - msb = (x >>> 16) + (y >>> 16) + (lsb >>> 16); - return (msb << 16) | (lsb & 0xffff); - } - - /* initialisation */ - function reset() { - acc = brs = cnt = 0; - for (var i = 0; i < 256; ++i) - m[i] = r[i] = 0; - gnt = 0; - } - - /* seeding function */ - function seed(s) { - var a, b, c, d, e, f, g, h, i; - - /* seeding the seeds of love */ - a = b = c = d = e = f = g = h = 0x9e3779b9; /* the golden ratio */ - - if (s && typeof(s) === 'number') - s = [s]; - - if (s instanceof Array) { - reset(); - for (i = 0; i < s.length; ++i) - r[i & 0xff] += typeof(s[i]) === 'number' ? s[i] : 0; - } - - /* private: seed mixer */ - function seed_mix() { - a ^= b << 11; d = add(d, a); b = add(b, c); - b ^= c >>> 2; e = add(e, b); c = add(c, d); - c ^= d << 8; f = add(f, c); d = add(d, e); - d ^= e >>> 16; g = add(g, d); e = add(e, f); - e ^= f << 10; h = add(h, e); f = add(f, g); - f ^= g >>> 4; a = add(a, f); g = add(g, h); - g ^= h << 8; b = add(b, g); h = add(h, a); - h ^= a >>> 9; c = add(c, h); a = add(a, b); - } - - for (i = 0; i < 4; i++) /* scramble it */ - seed_mix(); - - for (i = 0; i < 256; i += 8) { - if (s) /* use all the information in the seed */ - a = add(a, r[i + 0]), b = add(b, r[i + 1]), - c = add(c, r[i + 2]), d = add(d, r[i + 3]), - e = add(e, r[i + 4]), f = add(f, r[i + 5]), - g = add(g, r[i + 6]), h = add(h, r[i + 7]); - seed_mix(); - /* fill in m[] with messy stuff */ - m[i + 0] = a; m[i + 1] = b; m[i + 2] = c; m[i + 3] = d; - m[i + 4] = e; m[i + 5] = f; m[i + 6] = g; m[i + 7] = h; - } - if (s) - /* do a second pass to make all of the seed affect all of m[] */ - for (i = 0; i < 256; i += 8) - a = add(a, m[i + 0]), b = add(b, m[i + 1]), - c = add(c, m[i + 2]), d = add(d, m[i + 3]), - e = add(e, m[i + 4]), f = add(f, m[i + 5]), - g = add(g, m[i + 6]), h = add(h, m[i + 7]), - seed_mix(), - /* fill in m[] with messy stuff (again) */ - m[i + 0] = a, m[i + 1] = b, m[i + 2] = c, m[i + 3] = d, - m[i + 4] = e, m[i + 5] = f, m[i + 6] = g, m[i + 7] = h; - prng(); /* fill in the first set of results */ - gnt = 256; /* prepare to use the first set of results */; - } - - /* isaac generator, n = number of run */ - function prng(n) { - var i, x, y; - n = n && typeof(n) === 'number' ? Math.abs(Math.floor(n)) : 1; - while (n--) { - cnt = add(cnt, 1); - brs = add(brs, cnt); - for(i = 0; i < 256; i++) { - switch(i & 3) { - case 0: acc ^= acc << 13; break; - case 1: acc ^= acc >>> 6; break; - case 2: acc ^= acc << 2; break; - case 3: acc ^= acc >>> 16; break; - } - acc = add(m[(i + 128) & 0xff], acc); x = m[i]; - m[i] = y = add(m[(x >>> 2) & 0xff], add(acc, brs)); - r[i] = brs = add(m[(y >>> 10) & 0xff], x); - } - } - } - - /* return a random number between */ - return function() { - if (!isd) // seed from accumulator - isd = true, - accum.stop(), - seed(accum.fetch()); - if (!gnt--) - prng(), gnt = 255; - return r[gnt]; - }; -})(); diff --git a/node_modules/bcryptjs/src/bcrypt/util.js b/node_modules/bcryptjs/src/bcrypt/util.js deleted file mode 100644 index 52fe555..0000000 --- a/node_modules/bcryptjs/src/bcrypt/util.js +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Continues with the callback on the next tick. - * @function - * @param {function(...[*])} callback Callback to execute - * @inner - */ -var nextTick = typeof process !== 'undefined' && process && typeof process.nextTick === 'function' - ? (typeof setImmediate === 'function' ? setImmediate : process.nextTick) - : setTimeout; - -/** - * Converts a JavaScript string to UTF8 bytes. - * @param {string} str String - * @returns {!Array.} UTF8 bytes - * @inner - */ -function stringToBytes(str) { - var out = [], - i = 0; - utfx.encodeUTF16toUTF8(function() { - if (i >= str.length) return null; - return str.charCodeAt(i++); - }, function(b) { - out.push(b); - }); - return out; -} - -//? include("util/base64.js"); - -//? include("../../node_modules/utfx/dist/utfx-embeddable.js"); - -Date.now = Date.now || function() { return +new Date; }; diff --git a/node_modules/bcryptjs/src/bcrypt/util/base64.js b/node_modules/bcryptjs/src/bcrypt/util/base64.js deleted file mode 100644 index 389068f..0000000 --- a/node_modules/bcryptjs/src/bcrypt/util/base64.js +++ /dev/null @@ -1,115 +0,0 @@ -// A base64 implementation for the bcrypt algorithm. This is partly non-standard. - -/** - * bcrypt's own non-standard base64 dictionary. - * @type {!Array.} - * @const - * @inner - **/ -var BASE64_CODE = "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(''); - -/** - * @type {!Array.} - * @const - * @inner - **/ -var BASE64_INDEX = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, - 1, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, -1, -1, -1, -1, -1, -1, - -1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, -1, -1, -1, -1, -1, -1, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, -1, -1, -1, -1, -1]; - -/** - * @type {!function(...number):string} - * @inner - */ -var stringFromCharCode = String.fromCharCode; - -/** - * Encodes a byte array to base64 with up to len bytes of input. - * @param {!Array.} b Byte array - * @param {number} len Maximum input length - * @returns {string} - * @inner - */ -function base64_encode(b, len) { - var off = 0, - rs = [], - c1, c2; - if (len <= 0 || len > b.length) - throw Error("Illegal len: "+len); - while (off < len) { - c1 = b[off++] & 0xff; - rs.push(BASE64_CODE[(c1 >> 2) & 0x3f]); - c1 = (c1 & 0x03) << 4; - if (off >= len) { - rs.push(BASE64_CODE[c1 & 0x3f]); - break; - } - c2 = b[off++] & 0xff; - c1 |= (c2 >> 4) & 0x0f; - rs.push(BASE64_CODE[c1 & 0x3f]); - c1 = (c2 & 0x0f) << 2; - if (off >= len) { - rs.push(BASE64_CODE[c1 & 0x3f]); - break; - } - c2 = b[off++] & 0xff; - c1 |= (c2 >> 6) & 0x03; - rs.push(BASE64_CODE[c1 & 0x3f]); - rs.push(BASE64_CODE[c2 & 0x3f]); - } - return rs.join(''); -} - -/** - * Decodes a base64 encoded string to up to len bytes of output. - * @param {string} s String to decode - * @param {number} len Maximum output length - * @returns {!Array.} - * @inner - */ -function base64_decode(s, len) { - var off = 0, - slen = s.length, - olen = 0, - rs = [], - c1, c2, c3, c4, o, code; - if (len <= 0) - throw Error("Illegal len: "+len); - while (off < slen - 1 && olen < len) { - code = s.charCodeAt(off++); - c1 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1; - code = s.charCodeAt(off++); - c2 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1; - if (c1 == -1 || c2 == -1) - break; - o = (c1 << 2) >>> 0; - o |= (c2 & 0x30) >> 4; - rs.push(stringFromCharCode(o)); - if (++olen >= len || off >= slen) - break; - code = s.charCodeAt(off++); - c3 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1; - if (c3 == -1) - break; - o = ((c2 & 0x0f) << 4) >>> 0; - o |= (c3 & 0x3c) >> 2; - rs.push(stringFromCharCode(o)); - if (++olen >= len || off >= slen) - break; - code = s.charCodeAt(off++); - c4 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1; - o = ((c3 & 0x03) << 6) >>> 0; - o |= c4; - rs.push(stringFromCharCode(o)); - ++olen; - } - var res = []; - for (off = 0; off - Copyright (c) 2012 Shane Girish - Copyright (c) 2014 Daniel Wirtz - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @license bcrypt.js (c) 2013 Daniel Wirtz - * Released under the Apache License, Version 2.0 - * see: https://github.com/dcodeIO/bcrypt.js for details - */ -(function(global, factory) { - - /* AMD */ if (typeof define === 'function' && define["amd"]) - define([], factory); - /* CommonJS */ else if (typeof require === 'function' && typeof module === "object" && module && module["exports"]) - module["exports"] = factory(); - /* Global */ else - (global["dcodeIO"] = global["dcodeIO"] || {})["bcrypt"] = factory(); - -}(this, function() { - "use strict"; - - //? include("bcrypt.js"); - - return bcrypt; -})); diff --git a/node_modules/bcryptjs/tests/quickbrown.txt b/node_modules/bcryptjs/tests/quickbrown.txt deleted file mode 100644 index 81e850f..0000000 --- a/node_modules/bcryptjs/tests/quickbrown.txt +++ /dev/null @@ -1,150 +0,0 @@ -Sentences that contain all letters commonly used in a language --------------------------------------------------------------- - -Markus Kuhn -- 2012-04-11 - -This is an example of a plain-text file encoded in UTF-8. - - -Danish (da) ---------- - - Quizdeltagerne spiste jordbær med fløde, mens cirkusklovnen - Wolther spillede på xylofon. - (= Quiz contestants were eating strawbery with cream while Wolther - the circus clown played on xylophone.) - -German (de) ------------ - - Falsches Üben von Xylophonmusik quält jeden größeren Zwerg - (= Wrongful practicing of xylophone music tortures every larger dwarf) - - Zwölf Boxkämpfer jagten Eva quer über den Sylter Deich - (= Twelve boxing fighters hunted Eva across the dike of Sylt) - - Heizölrückstoßabdämpfung - (= fuel oil recoil absorber) - (jqvwxy missing, but all non-ASCII letters in one word) - -Greek (el) ----------- - - Γαζέες καὶ μυρτιὲς δὲν θὰ βρῶ πιὰ στὸ χρυσαφὶ ξέφωτο - (= No more shall I see acacias or myrtles in the golden clearing) - - Ξεσκεπάζω τὴν ψυχοφθόρα βδελυγμία - (= I uncover the soul-destroying abhorrence) - -English (en) ------------- - - The quick brown fox jumps over the lazy dog - -Spanish (es) ------------- - - El pingüino Wenceslao hizo kilómetros bajo exhaustiva lluvia y - frío, añoraba a su querido cachorro. - (Contains every letter and every accent, but not every combination - of vowel + acute.) - -French (fr) ------------ - - Portez ce vieux whisky au juge blond qui fume sur son île intérieure, à - côté de l'alcôve ovoïde, où les bûches se consument dans l'âtre, ce - qui lui permet de penser à la cænogenèse de l'être dont il est question - dans la cause ambiguë entendue à Moÿ, dans un capharnaüm qui, - pense-t-il, diminue çà et là la qualité de son œuvre. - - l'île exiguë - Où l'obèse jury mûr - Fête l'haï volapük, - Âne ex aéquo au whist, - Ôtez ce vœu déçu. - - Le cœur déçu mais l'âme plutôt naïve, Louÿs rêva de crapaüter en - canoë au delà des îles, près du mälström où brûlent les novæ. - -Irish Gaelic (ga) ------------------ - - D'fhuascail Íosa, Úrmhac na hÓighe Beannaithe, pór Éava agus Ádhaimh - -Hungarian (hu) --------------- - - Árvíztűrő tükörfúrógép - (= flood-proof mirror-drilling machine, only all non-ASCII letters) - -Icelandic (is) --------------- - - Kæmi ný öxi hér ykist þjófum nú bæði víl og ádrepa - - Sævör grét áðan því úlpan var ónýt - (some ASCII letters missing) - -Japanese (jp) -------------- - - Hiragana: (Iroha) - - いろはにほへとちりぬるを - わかよたれそつねならむ - うゐのおくやまけふこえて - あさきゆめみしゑひもせす - - Katakana: - - イロハニホヘト チリヌルヲ ワカヨタレソ ツネナラム - ウヰノオクヤマ ケフコエテ アサキユメミシ ヱヒモセスン - -Hebrew (iw) ------------ - - ? דג סקרן שט בים מאוכזב ולפתע מצא לו חברה איך הקליטה - -Polish (pl) ------------ - - Pchnąć w tę łódź jeża lub ośm skrzyń fig - (= To push a hedgehog or eight bins of figs in this boat) - -Russian (ru) ------------- - - В чащах юга жил бы цитрус? Да, но фальшивый экземпляр! - (= Would a citrus live in the bushes of south? Yes, but only a fake one!) - - Съешь же ещё этих мягких французских булок да выпей чаю - (= Eat some more of these fresh French loafs and have some tea) - -Thai (th) ---------- - - [--------------------------|------------------------] - ๏ เป็นมนุษย์สุดประเสริฐเลิศคุณค่า กว่าบรรดาฝูงสัตว์เดรัจฉาน - จงฝ่าฟันพัฒนาวิชาการ อย่าล้างผลาญฤๅเข่นฆ่าบีฑาใคร - ไม่ถือโทษโกรธแช่งซัดฮึดฮัดด่า หัดอภัยเหมือนกีฬาอัชฌาสัย - ปฏิบัติประพฤติกฎกำหนดใจ พูดจาให้จ๊ะๆ จ๋าๆ น่าฟังเอย ฯ - - [The copyright for the Thai example is owned by The Computer - Association of Thailand under the Royal Patronage of His Majesty the - King.] - -Turkish (tr) ------------- - - Pijamalı hasta, yağız şoföre çabucak güvendi. - (=Patient with pajamas, trusted swarthy driver quickly) - - -Special thanks to the people from all over the world who contributed -these sentences since 1999. - -A much larger collection of such pangrams is now available at - - http://en.wikipedia.org/wiki/List_of_pangrams - diff --git a/node_modules/bcryptjs/tests/suite.js b/node_modules/bcryptjs/tests/suite.js deleted file mode 100644 index bd3d217..0000000 --- a/node_modules/bcryptjs/tests/suite.js +++ /dev/null @@ -1,197 +0,0 @@ -var path = require("path"), - fs = require("fs"), - binding = require("bcrypt"), - bcrypt = require(path.join(__dirname, '..', 'index.js'))/*, - isaac = eval( - fs.readFileSync(path.join(__dirname, "..", "src", "bcrypt", "prng", "accum.js"))+ - fs.readFileSync(path.join(__dirname, "..", "src", "bcrypt", "prng", "isaac.js"))+ - " accum.start();"+ - " isaac" - )*/; - -module.exports = { - - "encodeBase64": function(test) { - var str = bcrypt.encodeBase64([0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10], 16); - test.strictEqual(str, "..CA.uOD/eaGAOmJB.yMBu"); - test.done(); - }, - - "decodeBase64": function(test) { - var bytes = bcrypt.decodeBase64("..CA.uOD/eaGAOmJB.yMBv.", 16); - test.deepEqual(bytes, [0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F]); - test.done(); - }, - - "genSaltSync": function(test) { - var salt = bcrypt.genSaltSync(10); - test.ok(salt); - test.ok(typeof salt == 'string'); - test.ok(salt.length > 0); - test.done(); - }, - - "genSalt": function(test) { - bcrypt.genSalt(10, function(err, salt) { - test.ok(salt); - test.ok(typeof salt == 'string'); - test.ok(salt.length > 0); - test.done(); - }); - }, - - "hashSync": function(test) { - test.doesNotThrow(function() { - bcrypt.hashSync("hello", 10); - }); - test.notEqual(bcrypt.hashSync("hello", 10), bcrypt.hashSync("hello", 10)); - test.done(); - }, - - "hash": function(test) { - bcrypt.hash("hello", 10, function(err, hash) { - test.notOk(err); - test.ok(hash); - test.done(); - }); - }, - - "compareSync": function(test) { - var salt1 = bcrypt.genSaltSync(), - hash1 = bcrypt.hashSync("hello", salt1); // $2a$ - var salt2 = bcrypt.genSaltSync().replace(/\$2a\$/, "$2y$"), - hash2 = bcrypt.hashSync("world", salt2); - var salt3 = bcrypt.genSaltSync().replace(/\$2a\$/, "$2b$"), - hash3 = bcrypt.hashSync("hello world", salt3); - - test.strictEqual(hash1.substring(0,4), "$2a$"); - test.ok(bcrypt.compareSync("hello", hash1)); - test.notOk(bcrypt.compareSync("hello", hash2)); - test.notOk(bcrypt.compareSync("hello", hash3)); - - test.strictEqual(hash2.substring(0,4), "$2y$"); - test.ok(bcrypt.compareSync("world", hash2)); - test.notOk(bcrypt.compareSync("world", hash1)); - test.notOk(bcrypt.compareSync("world", hash3)); - - test.strictEqual(hash3.substring(0,4), "$2b$"); - test.ok(bcrypt.compareSync("hello world", hash3)); - test.notOk(bcrypt.compareSync("hello world", hash1)); - test.notOk(bcrypt.compareSync("hello world", hash2)); - - test.done(); - }, - - "compare": function(test) { - var salt1 = bcrypt.genSaltSync(), - hash1 = bcrypt.hashSync("hello", salt1); // $2a$ - var salt2 = bcrypt.genSaltSync(); - salt2 = salt2.substring(0,2)+'y'+salt2.substring(3); // $2y$ - var hash2 = bcrypt.hashSync("world", salt2); - bcrypt.compare("hello", hash1, function(err, same) { - test.notOk(err); - test.ok(same); - bcrypt.compare("hello", hash2, function(err, same) { - test.notOk(err); - test.notOk(same); - bcrypt.compare("world", hash2, function(err, same) { - test.notOk(err); - test.ok(same); - bcrypt.compare("world", hash1, function(err, same) { - test.notOk(err); - test.notOk(same); - test.done(); - }); - }); - }); - }); - }, - - "getSalt": function(test) { - var hash1 = bcrypt.hashSync("hello", bcrypt.genSaltSync()); - var salt = bcrypt.getSalt(hash1); - var hash2 = bcrypt.hashSync("hello", salt); - test.equal(hash1, hash2); - test.done(); - }, - - "getRounds": function(test) { - var hash1 = bcrypt.hashSync("hello", bcrypt.genSaltSync()); - test.equal(bcrypt.getRounds(hash1), 10); - test.done(); - }, - - "progress": function(test) { - bcrypt.genSalt(12, function(err, salt) { - test.ok(!err); - var progress = []; - bcrypt.hash("hello world", salt, function(err, hash) { - test.ok(!err); - test.ok(typeof hash === 'string'); - test.ok(progress.length >= 2); - test.strictEqual(progress[0], 0); - test.strictEqual(progress[progress.length-1], 1); - test.done(); - }, function(n) { - progress.push(n); - }); - }); - }, - - "promise": function(test) { - bcrypt.genSalt(10) - .then(function(salt) { - bcrypt.hash("hello", salt) - .then(function(hash) { - test.ok(hash); - bcrypt.compare("hello", hash) - .then(function(result) { - test.ok(result); - bcrypt.genSalt(/* no args */) - .then(function(salt) { - test.ok(salt); - test.done(); - }, function(err) { - test.fail(err, null, "promise rejected"); - }); - }, function(err) { - test.fail(err, null, "promise rejected"); - }); - }, function(err) { - test.fail(err, null, 'promise rejected'); - }); - }, function(err) { - test.fail(err, null, "promise rejected"); - }); - }, - - "compat": { - "quickbrown": function(test) { - var pass = fs.readFileSync(path.join(__dirname, "quickbrown.txt"))+"", - salt = bcrypt.genSaltSync(), - hash1 = binding.hashSync(pass, salt), - hash2 = bcrypt.hashSync(pass, salt); - test.equal(hash1, hash2); - test.done(); - }, - - "roundsOOB": function(test) { - var salt1 = bcrypt.genSaltSync(0), // $10$ like not set - salt2 = binding.genSaltSync(0); - test.strictEqual(salt1.substring(0, 7), "$2a$10$"); - test.strictEqual(salt2.substring(0, 7), "$2a$10$"); - - salt1 = bcrypt.genSaltSync(3); // $04$ is lower cap - salt2 = bcrypt.genSaltSync(3); - test.strictEqual(salt1.substring(0, 7), "$2a$04$"); - test.strictEqual(salt2.substring(0, 7), "$2a$04$"); - - salt1 = bcrypt.genSaltSync(32); // $31$ is upper cap - salt2 = bcrypt.genSaltSync(32); - test.strictEqual(salt1.substring(0, 7), "$2a$31$"); - test.strictEqual(salt2.substring(0, 7), "$2a$31$"); - - test.done(); - } - } -}; diff --git a/node_modules/body-parser/HISTORY.md b/node_modules/body-parser/HISTORY.md deleted file mode 100644 index fb212b3..0000000 --- a/node_modules/body-parser/HISTORY.md +++ /dev/null @@ -1,657 +0,0 @@ -1.20.1 / 2022-10-06 -=================== - - * deps: qs@6.11.0 - * perf: remove unnecessary object clone - -1.20.0 / 2022-04-02 -=================== - - * Fix error message for json parse whitespace in `strict` - * Fix internal error when inflated body exceeds limit - * Prevent loss of async hooks context - * Prevent hanging when request already read - * deps: depd@2.0.0 - - Replace internal `eval` usage with `Function` constructor - - Use instance methods on `process` to check for listeners - * deps: http-errors@2.0.0 - - deps: depd@2.0.0 - - deps: statuses@2.0.1 - * deps: on-finished@2.4.1 - * deps: qs@6.10.3 - * deps: raw-body@2.5.1 - - deps: http-errors@2.0.0 - -1.19.2 / 2022-02-15 -=================== - - * deps: bytes@3.1.2 - * deps: qs@6.9.7 - * Fix handling of `__proto__` keys - * deps: raw-body@2.4.3 - - deps: bytes@3.1.2 - -1.19.1 / 2021-12-10 -=================== - - * deps: bytes@3.1.1 - * deps: http-errors@1.8.1 - - deps: inherits@2.0.4 - - deps: toidentifier@1.0.1 - - deps: setprototypeof@1.2.0 - * deps: qs@6.9.6 - * deps: raw-body@2.4.2 - - deps: bytes@3.1.1 - - deps: http-errors@1.8.1 - * deps: safe-buffer@5.2.1 - * deps: type-is@~1.6.18 - -1.19.0 / 2019-04-25 -=================== - - * deps: bytes@3.1.0 - - Add petabyte (`pb`) support - * deps: http-errors@1.7.2 - - Set constructor name when possible - - deps: setprototypeof@1.1.1 - - deps: statuses@'>= 1.5.0 < 2' - * deps: iconv-lite@0.4.24 - - Added encoding MIK - * deps: qs@6.7.0 - - Fix parsing array brackets after index - * deps: raw-body@2.4.0 - - deps: bytes@3.1.0 - - deps: http-errors@1.7.2 - - deps: iconv-lite@0.4.24 - * deps: type-is@~1.6.17 - - deps: mime-types@~2.1.24 - - perf: prevent internal `throw` on invalid type - -1.18.3 / 2018-05-14 -=================== - - * Fix stack trace for strict json parse error - * deps: depd@~1.1.2 - - perf: remove argument reassignment - * deps: http-errors@~1.6.3 - - deps: depd@~1.1.2 - - deps: setprototypeof@1.1.0 - - deps: statuses@'>= 1.3.1 < 2' - * deps: iconv-lite@0.4.23 - - Fix loading encoding with year appended - - Fix deprecation warnings on Node.js 10+ - * deps: qs@6.5.2 - * deps: raw-body@2.3.3 - - deps: http-errors@1.6.3 - - deps: iconv-lite@0.4.23 - * deps: type-is@~1.6.16 - - deps: mime-types@~2.1.18 - -1.18.2 / 2017-09-22 -=================== - - * deps: debug@2.6.9 - * perf: remove argument reassignment - -1.18.1 / 2017-09-12 -=================== - - * deps: content-type@~1.0.4 - - perf: remove argument reassignment - - perf: skip parameter parsing when no parameters - * deps: iconv-lite@0.4.19 - - Fix ISO-8859-1 regression - - Update Windows-1255 - * deps: qs@6.5.1 - - Fix parsing & compacting very deep objects - * deps: raw-body@2.3.2 - - deps: iconv-lite@0.4.19 - -1.18.0 / 2017-09-08 -=================== - - * Fix JSON strict violation error to match native parse error - * Include the `body` property on verify errors - * Include the `type` property on all generated errors - * Use `http-errors` to set status code on errors - * deps: bytes@3.0.0 - * deps: debug@2.6.8 - * deps: depd@~1.1.1 - - Remove unnecessary `Buffer` loading - * deps: http-errors@~1.6.2 - - deps: depd@1.1.1 - * deps: iconv-lite@0.4.18 - - Add support for React Native - - Add a warning if not loaded as utf-8 - - Fix CESU-8 decoding in Node.js 8 - - Improve speed of ISO-8859-1 encoding - * deps: qs@6.5.0 - * deps: raw-body@2.3.1 - - Use `http-errors` for standard emitted errors - - deps: bytes@3.0.0 - - deps: iconv-lite@0.4.18 - - perf: skip buffer decoding on overage chunk - * perf: prevent internal `throw` when missing charset - -1.17.2 / 2017-05-17 -=================== - - * deps: debug@2.6.7 - - Fix `DEBUG_MAX_ARRAY_LENGTH` - - deps: ms@2.0.0 - * deps: type-is@~1.6.15 - - deps: mime-types@~2.1.15 - -1.17.1 / 2017-03-06 -=================== - - * deps: qs@6.4.0 - - Fix regression parsing keys starting with `[` - -1.17.0 / 2017-03-01 -=================== - - * deps: http-errors@~1.6.1 - - Make `message` property enumerable for `HttpError`s - - deps: setprototypeof@1.0.3 - * deps: qs@6.3.1 - - Fix compacting nested arrays - -1.16.1 / 2017-02-10 -=================== - - * deps: debug@2.6.1 - - Fix deprecation messages in WebStorm and other editors - - Undeprecate `DEBUG_FD` set to `1` or `2` - -1.16.0 / 2017-01-17 -=================== - - * deps: debug@2.6.0 - - Allow colors in workers - - Deprecated `DEBUG_FD` environment variable - - Fix error when running under React Native - - Use same color for same namespace - - deps: ms@0.7.2 - * deps: http-errors@~1.5.1 - - deps: inherits@2.0.3 - - deps: setprototypeof@1.0.2 - - deps: statuses@'>= 1.3.1 < 2' - * deps: iconv-lite@0.4.15 - - Added encoding MS-31J - - Added encoding MS-932 - - Added encoding MS-936 - - Added encoding MS-949 - - Added encoding MS-950 - - Fix GBK/GB18030 handling of Euro character - * deps: qs@6.2.1 - - Fix array parsing from skipping empty values - * deps: raw-body@~2.2.0 - - deps: iconv-lite@0.4.15 - * deps: type-is@~1.6.14 - - deps: mime-types@~2.1.13 - -1.15.2 / 2016-06-19 -=================== - - * deps: bytes@2.4.0 - * deps: content-type@~1.0.2 - - perf: enable strict mode - * deps: http-errors@~1.5.0 - - Use `setprototypeof` module to replace `__proto__` setting - - deps: statuses@'>= 1.3.0 < 2' - - perf: enable strict mode - * deps: qs@6.2.0 - * deps: raw-body@~2.1.7 - - deps: bytes@2.4.0 - - perf: remove double-cleanup on happy path - * deps: type-is@~1.6.13 - - deps: mime-types@~2.1.11 - -1.15.1 / 2016-05-05 -=================== - - * deps: bytes@2.3.0 - - Drop partial bytes on all parsed units - - Fix parsing byte string that looks like hex - * deps: raw-body@~2.1.6 - - deps: bytes@2.3.0 - * deps: type-is@~1.6.12 - - deps: mime-types@~2.1.10 - -1.15.0 / 2016-02-10 -=================== - - * deps: http-errors@~1.4.0 - - Add `HttpError` export, for `err instanceof createError.HttpError` - - deps: inherits@2.0.1 - - deps: statuses@'>= 1.2.1 < 2' - * deps: qs@6.1.0 - * deps: type-is@~1.6.11 - - deps: mime-types@~2.1.9 - -1.14.2 / 2015-12-16 -=================== - - * deps: bytes@2.2.0 - * deps: iconv-lite@0.4.13 - * deps: qs@5.2.0 - * deps: raw-body@~2.1.5 - - deps: bytes@2.2.0 - - deps: iconv-lite@0.4.13 - * deps: type-is@~1.6.10 - - deps: mime-types@~2.1.8 - -1.14.1 / 2015-09-27 -=================== - - * Fix issue where invalid charset results in 400 when `verify` used - * deps: iconv-lite@0.4.12 - - Fix CESU-8 decoding in Node.js 4.x - * deps: raw-body@~2.1.4 - - Fix masking critical errors from `iconv-lite` - - deps: iconv-lite@0.4.12 - * deps: type-is@~1.6.9 - - deps: mime-types@~2.1.7 - -1.14.0 / 2015-09-16 -=================== - - * Fix JSON strict parse error to match syntax errors - * Provide static `require` analysis in `urlencoded` parser - * deps: depd@~1.1.0 - - Support web browser loading - * deps: qs@5.1.0 - * deps: raw-body@~2.1.3 - - Fix sync callback when attaching data listener causes sync read - * deps: type-is@~1.6.8 - - Fix type error when given invalid type to match against - - deps: mime-types@~2.1.6 - -1.13.3 / 2015-07-31 -=================== - - * deps: type-is@~1.6.6 - - deps: mime-types@~2.1.4 - -1.13.2 / 2015-07-05 -=================== - - * deps: iconv-lite@0.4.11 - * deps: qs@4.0.0 - - Fix dropping parameters like `hasOwnProperty` - - Fix user-visible incompatibilities from 3.1.0 - - Fix various parsing edge cases - * deps: raw-body@~2.1.2 - - Fix error stack traces to skip `makeError` - - deps: iconv-lite@0.4.11 - * deps: type-is@~1.6.4 - - deps: mime-types@~2.1.2 - - perf: enable strict mode - - perf: remove argument reassignment - -1.13.1 / 2015-06-16 -=================== - - * deps: qs@2.4.2 - - Downgraded from 3.1.0 because of user-visible incompatibilities - -1.13.0 / 2015-06-14 -=================== - - * Add `statusCode` property on `Error`s, in addition to `status` - * Change `type` default to `application/json` for JSON parser - * Change `type` default to `application/x-www-form-urlencoded` for urlencoded parser - * Provide static `require` analysis - * Use the `http-errors` module to generate errors - * deps: bytes@2.1.0 - - Slight optimizations - * deps: iconv-lite@0.4.10 - - The encoding UTF-16 without BOM now defaults to UTF-16LE when detection fails - - Leading BOM is now removed when decoding - * deps: on-finished@~2.3.0 - - Add defined behavior for HTTP `CONNECT` requests - - Add defined behavior for HTTP `Upgrade` requests - - deps: ee-first@1.1.1 - * deps: qs@3.1.0 - - Fix dropping parameters like `hasOwnProperty` - - Fix various parsing edge cases - - Parsed object now has `null` prototype - * deps: raw-body@~2.1.1 - - Use `unpipe` module for unpiping requests - - deps: iconv-lite@0.4.10 - * deps: type-is@~1.6.3 - - deps: mime-types@~2.1.1 - - perf: reduce try block size - - perf: remove bitwise operations - * perf: enable strict mode - * perf: remove argument reassignment - * perf: remove delete call - -1.12.4 / 2015-05-10 -=================== - - * deps: debug@~2.2.0 - * deps: qs@2.4.2 - - Fix allowing parameters like `constructor` - * deps: on-finished@~2.2.1 - * deps: raw-body@~2.0.1 - - Fix a false-positive when unpiping in Node.js 0.8 - - deps: bytes@2.0.1 - * deps: type-is@~1.6.2 - - deps: mime-types@~2.0.11 - -1.12.3 / 2015-04-15 -=================== - - * Slight efficiency improvement when not debugging - * deps: depd@~1.0.1 - * deps: iconv-lite@0.4.8 - - Add encoding alias UNICODE-1-1-UTF-7 - * deps: raw-body@1.3.4 - - Fix hanging callback if request aborts during read - - deps: iconv-lite@0.4.8 - -1.12.2 / 2015-03-16 -=================== - - * deps: qs@2.4.1 - - Fix error when parameter `hasOwnProperty` is present - -1.12.1 / 2015-03-15 -=================== - - * deps: debug@~2.1.3 - - Fix high intensity foreground color for bold - - deps: ms@0.7.0 - * deps: type-is@~1.6.1 - - deps: mime-types@~2.0.10 - -1.12.0 / 2015-02-13 -=================== - - * add `debug` messages - * accept a function for the `type` option - * use `content-type` to parse `Content-Type` headers - * deps: iconv-lite@0.4.7 - - Gracefully support enumerables on `Object.prototype` - * deps: raw-body@1.3.3 - - deps: iconv-lite@0.4.7 - * deps: type-is@~1.6.0 - - fix argument reassignment - - fix false-positives in `hasBody` `Transfer-Encoding` check - - support wildcard for both type and subtype (`*/*`) - - deps: mime-types@~2.0.9 - -1.11.0 / 2015-01-30 -=================== - - * make internal `extended: true` depth limit infinity - * deps: type-is@~1.5.6 - - deps: mime-types@~2.0.8 - -1.10.2 / 2015-01-20 -=================== - - * deps: iconv-lite@0.4.6 - - Fix rare aliases of single-byte encodings - * deps: raw-body@1.3.2 - - deps: iconv-lite@0.4.6 - -1.10.1 / 2015-01-01 -=================== - - * deps: on-finished@~2.2.0 - * deps: type-is@~1.5.5 - - deps: mime-types@~2.0.7 - -1.10.0 / 2014-12-02 -=================== - - * make internal `extended: true` array limit dynamic - -1.9.3 / 2014-11-21 -================== - - * deps: iconv-lite@0.4.5 - - Fix Windows-31J and X-SJIS encoding support - * deps: qs@2.3.3 - - Fix `arrayLimit` behavior - * deps: raw-body@1.3.1 - - deps: iconv-lite@0.4.5 - * deps: type-is@~1.5.3 - - deps: mime-types@~2.0.3 - -1.9.2 / 2014-10-27 -================== - - * deps: qs@2.3.2 - - Fix parsing of mixed objects and values - -1.9.1 / 2014-10-22 -================== - - * deps: on-finished@~2.1.1 - - Fix handling of pipelined requests - * deps: qs@2.3.0 - - Fix parsing of mixed implicit and explicit arrays - * deps: type-is@~1.5.2 - - deps: mime-types@~2.0.2 - -1.9.0 / 2014-09-24 -================== - - * include the charset in "unsupported charset" error message - * include the encoding in "unsupported content encoding" error message - * deps: depd@~1.0.0 - -1.8.4 / 2014-09-23 -================== - - * fix content encoding to be case-insensitive - -1.8.3 / 2014-09-19 -================== - - * deps: qs@2.2.4 - - Fix issue with object keys starting with numbers truncated - -1.8.2 / 2014-09-15 -================== - - * deps: depd@0.4.5 - -1.8.1 / 2014-09-07 -================== - - * deps: media-typer@0.3.0 - * deps: type-is@~1.5.1 - -1.8.0 / 2014-09-05 -================== - - * make empty-body-handling consistent between chunked requests - - empty `json` produces `{}` - - empty `raw` produces `new Buffer(0)` - - empty `text` produces `''` - - empty `urlencoded` produces `{}` - * deps: qs@2.2.3 - - Fix issue where first empty value in array is discarded - * deps: type-is@~1.5.0 - - fix `hasbody` to be true for `content-length: 0` - -1.7.0 / 2014-09-01 -================== - - * add `parameterLimit` option to `urlencoded` parser - * change `urlencoded` extended array limit to 100 - * respond with 413 when over `parameterLimit` in `urlencoded` - -1.6.7 / 2014-08-29 -================== - - * deps: qs@2.2.2 - - Remove unnecessary cloning - -1.6.6 / 2014-08-27 -================== - - * deps: qs@2.2.0 - - Array parsing fix - - Performance improvements - -1.6.5 / 2014-08-16 -================== - - * deps: on-finished@2.1.0 - -1.6.4 / 2014-08-14 -================== - - * deps: qs@1.2.2 - -1.6.3 / 2014-08-10 -================== - - * deps: qs@1.2.1 - -1.6.2 / 2014-08-07 -================== - - * deps: qs@1.2.0 - - Fix parsing array of objects - -1.6.1 / 2014-08-06 -================== - - * deps: qs@1.1.0 - - Accept urlencoded square brackets - - Accept empty values in implicit array notation - -1.6.0 / 2014-08-05 -================== - - * deps: qs@1.0.2 - - Complete rewrite - - Limits array length to 20 - - Limits object depth to 5 - - Limits parameters to 1,000 - -1.5.2 / 2014-07-27 -================== - - * deps: depd@0.4.4 - - Work-around v8 generating empty stack traces - -1.5.1 / 2014-07-26 -================== - - * deps: depd@0.4.3 - - Fix exception when global `Error.stackTraceLimit` is too low - -1.5.0 / 2014-07-20 -================== - - * deps: depd@0.4.2 - - Add `TRACE_DEPRECATION` environment variable - - Remove non-standard grey color from color output - - Support `--no-deprecation` argument - - Support `--trace-deprecation` argument - * deps: iconv-lite@0.4.4 - - Added encoding UTF-7 - * deps: raw-body@1.3.0 - - deps: iconv-lite@0.4.4 - - Added encoding UTF-7 - - Fix `Cannot switch to old mode now` error on Node.js 0.10+ - * deps: type-is@~1.3.2 - -1.4.3 / 2014-06-19 -================== - - * deps: type-is@1.3.1 - - fix global variable leak - -1.4.2 / 2014-06-19 -================== - - * deps: type-is@1.3.0 - - improve type parsing - -1.4.1 / 2014-06-19 -================== - - * fix urlencoded extended deprecation message - -1.4.0 / 2014-06-19 -================== - - * add `text` parser - * add `raw` parser - * check accepted charset in content-type (accepts utf-8) - * check accepted encoding in content-encoding (accepts identity) - * deprecate `bodyParser()` middleware; use `.json()` and `.urlencoded()` as needed - * deprecate `urlencoded()` without provided `extended` option - * lazy-load urlencoded parsers - * parsers split into files for reduced mem usage - * support gzip and deflate bodies - - set `inflate: false` to turn off - * deps: raw-body@1.2.2 - - Support all encodings from `iconv-lite` - -1.3.1 / 2014-06-11 -================== - - * deps: type-is@1.2.1 - - Switch dependency from mime to mime-types@1.0.0 - -1.3.0 / 2014-05-31 -================== - - * add `extended` option to urlencoded parser - -1.2.2 / 2014-05-27 -================== - - * deps: raw-body@1.1.6 - - assert stream encoding on node.js 0.8 - - assert stream encoding on node.js < 0.10.6 - - deps: bytes@1 - -1.2.1 / 2014-05-26 -================== - - * invoke `next(err)` after request fully read - - prevents hung responses and socket hang ups - -1.2.0 / 2014-05-11 -================== - - * add `verify` option - * deps: type-is@1.2.0 - - support suffix matching - -1.1.2 / 2014-05-11 -================== - - * improve json parser speed - -1.1.1 / 2014-05-11 -================== - - * fix repeated limit parsing with every request - -1.1.0 / 2014-05-10 -================== - - * add `type` option - * deps: pin for safety and consistency - -1.0.2 / 2014-04-14 -================== - - * use `type-is` module - -1.0.1 / 2014-03-20 -================== - - * lower default limits to 100kb diff --git a/node_modules/body-parser/LICENSE b/node_modules/body-parser/LICENSE deleted file mode 100644 index 386b7b6..0000000 --- a/node_modules/body-parser/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -(The MIT License) - -Copyright (c) 2014 Jonathan Ong -Copyright (c) 2014-2015 Douglas Christopher Wilson - -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/body-parser/README.md b/node_modules/body-parser/README.md deleted file mode 100644 index c507cbb..0000000 --- a/node_modules/body-parser/README.md +++ /dev/null @@ -1,464 +0,0 @@ -# body-parser - -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Build Status][github-actions-ci-image]][github-actions-ci-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -Node.js body parsing middleware. - -Parse incoming request bodies in a middleware before your handlers, available -under the `req.body` property. - -**Note** As `req.body`'s shape is based on user-controlled input, all -properties and values in this object are untrusted and should be validated -before trusting. For example, `req.body.foo.toString()` may fail in multiple -ways, for example the `foo` property may not be there or may not be a string, -and `toString` may not be a function and instead a string or other user input. - -[Learn about the anatomy of an HTTP transaction in Node.js](https://nodejs.org/en/docs/guides/anatomy-of-an-http-transaction/). - -_This does not handle multipart bodies_, due to their complex and typically -large nature. For multipart bodies, you may be interested in the following -modules: - - * [busboy](https://www.npmjs.org/package/busboy#readme) and - [connect-busboy](https://www.npmjs.org/package/connect-busboy#readme) - * [multiparty](https://www.npmjs.org/package/multiparty#readme) and - [connect-multiparty](https://www.npmjs.org/package/connect-multiparty#readme) - * [formidable](https://www.npmjs.org/package/formidable#readme) - * [multer](https://www.npmjs.org/package/multer#readme) - -This module provides the following parsers: - - * [JSON body parser](#bodyparserjsonoptions) - * [Raw body parser](#bodyparserrawoptions) - * [Text body parser](#bodyparsertextoptions) - * [URL-encoded form body parser](#bodyparserurlencodedoptions) - -Other body parsers you might be interested in: - -- [body](https://www.npmjs.org/package/body#readme) -- [co-body](https://www.npmjs.org/package/co-body#readme) - -## Installation - -```sh -$ npm install body-parser -``` - -## API - -```js -var bodyParser = require('body-parser') -``` - -The `bodyParser` object exposes various factories to create middlewares. All -middlewares will populate the `req.body` property with the parsed body when -the `Content-Type` request header matches the `type` option, or an empty -object (`{}`) if there was no body to parse, the `Content-Type` was not matched, -or an error occurred. - -The various errors returned by this module are described in the -[errors section](#errors). - -### bodyParser.json([options]) - -Returns middleware that only parses `json` and only looks at requests where -the `Content-Type` header matches the `type` option. This parser accepts any -Unicode encoding of the body and supports automatic inflation of `gzip` and -`deflate` encodings. - -A new `body` object containing the parsed data is populated on the `request` -object after the middleware (i.e. `req.body`). - -#### Options - -The `json` function takes an optional `options` object that may contain any of -the following keys: - -##### inflate - -When set to `true`, then deflated (compressed) bodies will be inflated; when -`false`, deflated bodies are rejected. Defaults to `true`. - -##### limit - -Controls the maximum request body size. If this is a number, then the value -specifies the number of bytes; if it is a string, the value is passed to the -[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults -to `'100kb'`. - -##### reviver - -The `reviver` option is passed directly to `JSON.parse` as the second -argument. You can find more information on this argument -[in the MDN documentation about JSON.parse](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Example.3A_Using_the_reviver_parameter). - -##### strict - -When set to `true`, will only accept arrays and objects; when `false` will -accept anything `JSON.parse` accepts. Defaults to `true`. - -##### type - -The `type` option is used to determine what media type the middleware will -parse. This option can be a string, array of strings, or a function. If not a -function, `type` option is passed directly to the -[type-is](https://www.npmjs.org/package/type-is#readme) library and this can -be an extension name (like `json`), a mime type (like `application/json`), or -a mime type with a wildcard (like `*/*` or `*/json`). If a function, the `type` -option is called as `fn(req)` and the request is parsed if it returns a truthy -value. Defaults to `application/json`. - -##### verify - -The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`, -where `buf` is a `Buffer` of the raw request body and `encoding` is the -encoding of the request. The parsing can be aborted by throwing an error. - -### bodyParser.raw([options]) - -Returns middleware that parses all bodies as a `Buffer` and only looks at -requests where the `Content-Type` header matches the `type` option. This -parser supports automatic inflation of `gzip` and `deflate` encodings. - -A new `body` object containing the parsed data is populated on the `request` -object after the middleware (i.e. `req.body`). This will be a `Buffer` object -of the body. - -#### Options - -The `raw` function takes an optional `options` object that may contain any of -the following keys: - -##### inflate - -When set to `true`, then deflated (compressed) bodies will be inflated; when -`false`, deflated bodies are rejected. Defaults to `true`. - -##### limit - -Controls the maximum request body size. If this is a number, then the value -specifies the number of bytes; if it is a string, the value is passed to the -[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults -to `'100kb'`. - -##### type - -The `type` option is used to determine what media type the middleware will -parse. This option can be a string, array of strings, or a function. -If not a function, `type` option is passed directly to the -[type-is](https://www.npmjs.org/package/type-is#readme) library and this -can be an extension name (like `bin`), a mime type (like -`application/octet-stream`), or a mime type with a wildcard (like `*/*` or -`application/*`). If a function, the `type` option is called as `fn(req)` -and the request is parsed if it returns a truthy value. Defaults to -`application/octet-stream`. - -##### verify - -The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`, -where `buf` is a `Buffer` of the raw request body and `encoding` is the -encoding of the request. The parsing can be aborted by throwing an error. - -### bodyParser.text([options]) - -Returns middleware that parses all bodies as a string and only looks at -requests where the `Content-Type` header matches the `type` option. This -parser supports automatic inflation of `gzip` and `deflate` encodings. - -A new `body` string containing the parsed data is populated on the `request` -object after the middleware (i.e. `req.body`). This will be a string of the -body. - -#### Options - -The `text` function takes an optional `options` object that may contain any of -the following keys: - -##### defaultCharset - -Specify the default character set for the text content if the charset is not -specified in the `Content-Type` header of the request. Defaults to `utf-8`. - -##### inflate - -When set to `true`, then deflated (compressed) bodies will be inflated; when -`false`, deflated bodies are rejected. Defaults to `true`. - -##### limit - -Controls the maximum request body size. If this is a number, then the value -specifies the number of bytes; if it is a string, the value is passed to the -[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults -to `'100kb'`. - -##### type - -The `type` option is used to determine what media type the middleware will -parse. This option can be a string, array of strings, or a function. If not -a function, `type` option is passed directly to the -[type-is](https://www.npmjs.org/package/type-is#readme) library and this can -be an extension name (like `txt`), a mime type (like `text/plain`), or a mime -type with a wildcard (like `*/*` or `text/*`). If a function, the `type` -option is called as `fn(req)` and the request is parsed if it returns a -truthy value. Defaults to `text/plain`. - -##### verify - -The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`, -where `buf` is a `Buffer` of the raw request body and `encoding` is the -encoding of the request. The parsing can be aborted by throwing an error. - -### bodyParser.urlencoded([options]) - -Returns middleware that only parses `urlencoded` bodies and only looks at -requests where the `Content-Type` header matches the `type` option. This -parser accepts only UTF-8 encoding of the body and supports automatic -inflation of `gzip` and `deflate` encodings. - -A new `body` object containing the parsed data is populated on the `request` -object after the middleware (i.e. `req.body`). This object will contain -key-value pairs, where the value can be a string or array (when `extended` is -`false`), or any type (when `extended` is `true`). - -#### Options - -The `urlencoded` function takes an optional `options` object that may contain -any of the following keys: - -##### extended - -The `extended` option allows to choose between parsing the URL-encoded data -with the `querystring` library (when `false`) or the `qs` library (when -`true`). The "extended" syntax allows for rich objects and arrays to be -encoded into the URL-encoded format, allowing for a JSON-like experience -with URL-encoded. For more information, please -[see the qs library](https://www.npmjs.org/package/qs#readme). - -Defaults to `true`, but using the default has been deprecated. Please -research into the difference between `qs` and `querystring` and choose the -appropriate setting. - -##### inflate - -When set to `true`, then deflated (compressed) bodies will be inflated; when -`false`, deflated bodies are rejected. Defaults to `true`. - -##### limit - -Controls the maximum request body size. If this is a number, then the value -specifies the number of bytes; if it is a string, the value is passed to the -[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults -to `'100kb'`. - -##### parameterLimit - -The `parameterLimit` option controls the maximum number of parameters that -are allowed in the URL-encoded data. If a request contains more parameters -than this value, a 413 will be returned to the client. Defaults to `1000`. - -##### type - -The `type` option is used to determine what media type the middleware will -parse. This option can be a string, array of strings, or a function. If not -a function, `type` option is passed directly to the -[type-is](https://www.npmjs.org/package/type-is#readme) library and this can -be an extension name (like `urlencoded`), a mime type (like -`application/x-www-form-urlencoded`), or a mime type with a wildcard (like -`*/x-www-form-urlencoded`). If a function, the `type` option is called as -`fn(req)` and the request is parsed if it returns a truthy value. Defaults -to `application/x-www-form-urlencoded`. - -##### verify - -The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`, -where `buf` is a `Buffer` of the raw request body and `encoding` is the -encoding of the request. The parsing can be aborted by throwing an error. - -## Errors - -The middlewares provided by this module create errors using the -[`http-errors` module](https://www.npmjs.com/package/http-errors). The errors -will typically have a `status`/`statusCode` property that contains the suggested -HTTP response code, an `expose` property to determine if the `message` property -should be displayed to the client, a `type` property to determine the type of -error without matching against the `message`, and a `body` property containing -the read body, if available. - -The following are the common errors created, though any error can come through -for various reasons. - -### content encoding unsupported - -This error will occur when the request had a `Content-Encoding` header that -contained an encoding but the "inflation" option was set to `false`. The -`status` property is set to `415`, the `type` property is set to -`'encoding.unsupported'`, and the `charset` property will be set to the -encoding that is unsupported. - -### entity parse failed - -This error will occur when the request contained an entity that could not be -parsed by the middleware. The `status` property is set to `400`, the `type` -property is set to `'entity.parse.failed'`, and the `body` property is set to -the entity value that failed parsing. - -### entity verify failed - -This error will occur when the request contained an entity that could not be -failed verification by the defined `verify` option. The `status` property is -set to `403`, the `type` property is set to `'entity.verify.failed'`, and the -`body` property is set to the entity value that failed verification. - -### request aborted - -This error will occur when the request is aborted by the client before reading -the body has finished. The `received` property will be set to the number of -bytes received before the request was aborted and the `expected` property is -set to the number of expected bytes. The `status` property is set to `400` -and `type` property is set to `'request.aborted'`. - -### request entity too large - -This error will occur when the request body's size is larger than the "limit" -option. The `limit` property will be set to the byte limit and the `length` -property will be set to the request body's length. The `status` property is -set to `413` and the `type` property is set to `'entity.too.large'`. - -### request size did not match content length - -This error will occur when the request's length did not match the length from -the `Content-Length` header. This typically occurs when the request is malformed, -typically when the `Content-Length` header was calculated based on characters -instead of bytes. The `status` property is set to `400` and the `type` property -is set to `'request.size.invalid'`. - -### stream encoding should not be set - -This error will occur when something called the `req.setEncoding` method prior -to this middleware. This module operates directly on bytes only and you cannot -call `req.setEncoding` when using this module. The `status` property is set to -`500` and the `type` property is set to `'stream.encoding.set'`. - -### stream is not readable - -This error will occur when the request is no longer readable when this middleware -attempts to read it. This typically means something other than a middleware from -this module read the request body already and the middleware was also configured to -read the same request. The `status` property is set to `500` and the `type` -property is set to `'stream.not.readable'`. - -### too many parameters - -This error will occur when the content of the request exceeds the configured -`parameterLimit` for the `urlencoded` parser. The `status` property is set to -`413` and the `type` property is set to `'parameters.too.many'`. - -### unsupported charset "BOGUS" - -This error will occur when the request had a charset parameter in the -`Content-Type` header, but the `iconv-lite` module does not support it OR the -parser does not support it. The charset is contained in the message as well -as in the `charset` property. The `status` property is set to `415`, the -`type` property is set to `'charset.unsupported'`, and the `charset` property -is set to the charset that is unsupported. - -### unsupported content encoding "bogus" - -This error will occur when the request had a `Content-Encoding` header that -contained an unsupported encoding. The encoding is contained in the message -as well as in the `encoding` property. The `status` property is set to `415`, -the `type` property is set to `'encoding.unsupported'`, and the `encoding` -property is set to the encoding that is unsupported. - -## Examples - -### Express/Connect top-level generic - -This example demonstrates adding a generic JSON and URL-encoded parser as a -top-level middleware, which will parse the bodies of all incoming requests. -This is the simplest setup. - -```js -var express = require('express') -var bodyParser = require('body-parser') - -var app = express() - -// parse application/x-www-form-urlencoded -app.use(bodyParser.urlencoded({ extended: false })) - -// parse application/json -app.use(bodyParser.json()) - -app.use(function (req, res) { - res.setHeader('Content-Type', 'text/plain') - res.write('you posted:\n') - res.end(JSON.stringify(req.body, null, 2)) -}) -``` - -### Express route-specific - -This example demonstrates adding body parsers specifically to the routes that -need them. In general, this is the most recommended way to use body-parser with -Express. - -```js -var express = require('express') -var bodyParser = require('body-parser') - -var app = express() - -// create application/json parser -var jsonParser = bodyParser.json() - -// create application/x-www-form-urlencoded parser -var urlencodedParser = bodyParser.urlencoded({ extended: false }) - -// POST /login gets urlencoded bodies -app.post('/login', urlencodedParser, function (req, res) { - res.send('welcome, ' + req.body.username) -}) - -// POST /api/users gets JSON bodies -app.post('/api/users', jsonParser, function (req, res) { - // create user in req.body -}) -``` - -### Change accepted type for parsers - -All the parsers accept a `type` option which allows you to change the -`Content-Type` that the middleware will parse. - -```js -var express = require('express') -var bodyParser = require('body-parser') - -var app = express() - -// parse various different custom JSON types as JSON -app.use(bodyParser.json({ type: 'application/*+json' })) - -// parse some custom thing into a Buffer -app.use(bodyParser.raw({ type: 'application/vnd.custom-type' })) - -// parse an HTML body into a string -app.use(bodyParser.text({ type: 'text/html' })) -``` - -## License - -[MIT](LICENSE) - -[npm-image]: https://img.shields.io/npm/v/body-parser.svg -[npm-url]: https://npmjs.org/package/body-parser -[coveralls-image]: https://img.shields.io/coveralls/expressjs/body-parser/master.svg -[coveralls-url]: https://coveralls.io/r/expressjs/body-parser?branch=master -[downloads-image]: https://img.shields.io/npm/dm/body-parser.svg -[downloads-url]: https://npmjs.org/package/body-parser -[github-actions-ci-image]: https://img.shields.io/github/workflow/status/expressjs/body-parser/ci/master?label=ci -[github-actions-ci-url]: https://github.com/expressjs/body-parser/actions/workflows/ci.yml diff --git a/node_modules/body-parser/SECURITY.md b/node_modules/body-parser/SECURITY.md deleted file mode 100644 index 9694d42..0000000 --- a/node_modules/body-parser/SECURITY.md +++ /dev/null @@ -1,25 +0,0 @@ -# Security Policies and Procedures - -## Reporting a Bug - -The Express team and community take all security bugs seriously. Thank you -for improving the security of Express. We appreciate your efforts and -responsible disclosure and will make every effort to acknowledge your -contributions. - -Report security bugs by emailing the current owner(s) of `body-parser`. This -information can be found in the npm registry using the command -`npm owner ls body-parser`. -If unsure or unable to get the information from the above, open an issue -in the [project issue tracker](https://github.com/expressjs/body-parser/issues) -asking for the current contact information. - -To ensure the timely response to your report, please ensure that the entirety -of the report is contained within the email body and not solely behind a web -link or an attachment. - -At least one owner will acknowledge your email within 48 hours, and will send a -more detailed response within 48 hours indicating the next steps in handling -your report. After the initial reply to your report, the owners will -endeavor to keep you informed of the progress towards a fix and full -announcement, and may ask for additional information or guidance. diff --git a/node_modules/body-parser/index.js b/node_modules/body-parser/index.js deleted file mode 100644 index bb24d73..0000000 --- a/node_modules/body-parser/index.js +++ /dev/null @@ -1,156 +0,0 @@ -/*! - * body-parser - * Copyright(c) 2014-2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var deprecate = require('depd')('body-parser') - -/** - * Cache of loaded parsers. - * @private - */ - -var parsers = Object.create(null) - -/** - * @typedef Parsers - * @type {function} - * @property {function} json - * @property {function} raw - * @property {function} text - * @property {function} urlencoded - */ - -/** - * Module exports. - * @type {Parsers} - */ - -exports = module.exports = deprecate.function(bodyParser, - 'bodyParser: use individual json/urlencoded middlewares') - -/** - * JSON parser. - * @public - */ - -Object.defineProperty(exports, 'json', { - configurable: true, - enumerable: true, - get: createParserGetter('json') -}) - -/** - * Raw parser. - * @public - */ - -Object.defineProperty(exports, 'raw', { - configurable: true, - enumerable: true, - get: createParserGetter('raw') -}) - -/** - * Text parser. - * @public - */ - -Object.defineProperty(exports, 'text', { - configurable: true, - enumerable: true, - get: createParserGetter('text') -}) - -/** - * URL-encoded parser. - * @public - */ - -Object.defineProperty(exports, 'urlencoded', { - configurable: true, - enumerable: true, - get: createParserGetter('urlencoded') -}) - -/** - * Create a middleware to parse json and urlencoded bodies. - * - * @param {object} [options] - * @return {function} - * @deprecated - * @public - */ - -function bodyParser (options) { - // use default type for parsers - var opts = Object.create(options || null, { - type: { - configurable: true, - enumerable: true, - value: undefined, - writable: true - } - }) - - var _urlencoded = exports.urlencoded(opts) - var _json = exports.json(opts) - - return function bodyParser (req, res, next) { - _json(req, res, function (err) { - if (err) return next(err) - _urlencoded(req, res, next) - }) - } -} - -/** - * Create a getter for loading a parser. - * @private - */ - -function createParserGetter (name) { - return function get () { - return loadParser(name) - } -} - -/** - * Load a parser module. - * @private - */ - -function loadParser (parserName) { - var parser = parsers[parserName] - - if (parser !== undefined) { - return parser - } - - // this uses a switch for static require analysis - switch (parserName) { - case 'json': - parser = require('./lib/types/json') - break - case 'raw': - parser = require('./lib/types/raw') - break - case 'text': - parser = require('./lib/types/text') - break - case 'urlencoded': - parser = require('./lib/types/urlencoded') - break - } - - // store to prevent invoking require() - return (parsers[parserName] = parser) -} diff --git a/node_modules/body-parser/lib/read.js b/node_modules/body-parser/lib/read.js deleted file mode 100644 index fce6283..0000000 --- a/node_modules/body-parser/lib/read.js +++ /dev/null @@ -1,205 +0,0 @@ -/*! - * body-parser - * Copyright(c) 2014-2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var createError = require('http-errors') -var destroy = require('destroy') -var getBody = require('raw-body') -var iconv = require('iconv-lite') -var onFinished = require('on-finished') -var unpipe = require('unpipe') -var zlib = require('zlib') - -/** - * Module exports. - */ - -module.exports = read - -/** - * Read a request into a buffer and parse. - * - * @param {object} req - * @param {object} res - * @param {function} next - * @param {function} parse - * @param {function} debug - * @param {object} options - * @private - */ - -function read (req, res, next, parse, debug, options) { - var length - var opts = options - var stream - - // flag as parsed - req._body = true - - // read options - var encoding = opts.encoding !== null - ? opts.encoding - : null - var verify = opts.verify - - try { - // get the content stream - stream = contentstream(req, debug, opts.inflate) - length = stream.length - stream.length = undefined - } catch (err) { - return next(err) - } - - // set raw-body options - opts.length = length - opts.encoding = verify - ? null - : encoding - - // assert charset is supported - if (opts.encoding === null && encoding !== null && !iconv.encodingExists(encoding)) { - return next(createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', { - charset: encoding.toLowerCase(), - type: 'charset.unsupported' - })) - } - - // read body - debug('read body') - getBody(stream, opts, function (error, body) { - if (error) { - var _error - - if (error.type === 'encoding.unsupported') { - // echo back charset - _error = createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', { - charset: encoding.toLowerCase(), - type: 'charset.unsupported' - }) - } else { - // set status code on error - _error = createError(400, error) - } - - // unpipe from stream and destroy - if (stream !== req) { - unpipe(req) - destroy(stream, true) - } - - // read off entire request - dump(req, function onfinished () { - next(createError(400, _error)) - }) - return - } - - // verify - if (verify) { - try { - debug('verify body') - verify(req, res, body, encoding) - } catch (err) { - next(createError(403, err, { - body: body, - type: err.type || 'entity.verify.failed' - })) - return - } - } - - // parse - var str = body - try { - debug('parse body') - str = typeof body !== 'string' && encoding !== null - ? iconv.decode(body, encoding) - : body - req.body = parse(str) - } catch (err) { - next(createError(400, err, { - body: str, - type: err.type || 'entity.parse.failed' - })) - return - } - - next() - }) -} - -/** - * Get the content stream of the request. - * - * @param {object} req - * @param {function} debug - * @param {boolean} [inflate=true] - * @return {object} - * @api private - */ - -function contentstream (req, debug, inflate) { - var encoding = (req.headers['content-encoding'] || 'identity').toLowerCase() - var length = req.headers['content-length'] - var stream - - debug('content-encoding "%s"', encoding) - - if (inflate === false && encoding !== 'identity') { - throw createError(415, 'content encoding unsupported', { - encoding: encoding, - type: 'encoding.unsupported' - }) - } - - switch (encoding) { - case 'deflate': - stream = zlib.createInflate() - debug('inflate body') - req.pipe(stream) - break - case 'gzip': - stream = zlib.createGunzip() - debug('gunzip body') - req.pipe(stream) - break - case 'identity': - stream = req - stream.length = length - break - default: - throw createError(415, 'unsupported content encoding "' + encoding + '"', { - encoding: encoding, - type: 'encoding.unsupported' - }) - } - - return stream -} - -/** - * Dump the contents of a request. - * - * @param {object} req - * @param {function} callback - * @api private - */ - -function dump (req, callback) { - if (onFinished.isFinished(req)) { - callback(null) - } else { - onFinished(req, callback) - req.resume() - } -} diff --git a/node_modules/body-parser/lib/types/json.js b/node_modules/body-parser/lib/types/json.js deleted file mode 100644 index c2745be..0000000 --- a/node_modules/body-parser/lib/types/json.js +++ /dev/null @@ -1,236 +0,0 @@ -/*! - * body-parser - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2014-2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var bytes = require('bytes') -var contentType = require('content-type') -var createError = require('http-errors') -var debug = require('debug')('body-parser:json') -var read = require('../read') -var typeis = require('type-is') - -/** - * Module exports. - */ - -module.exports = json - -/** - * RegExp to match the first non-space in a string. - * - * Allowed whitespace is defined in RFC 7159: - * - * ws = *( - * %x20 / ; Space - * %x09 / ; Horizontal tab - * %x0A / ; Line feed or New line - * %x0D ) ; Carriage return - */ - -var FIRST_CHAR_REGEXP = /^[\x20\x09\x0a\x0d]*([^\x20\x09\x0a\x0d])/ // eslint-disable-line no-control-regex - -/** - * Create a middleware to parse JSON bodies. - * - * @param {object} [options] - * @return {function} - * @public - */ - -function json (options) { - var opts = options || {} - - var limit = typeof opts.limit !== 'number' - ? bytes.parse(opts.limit || '100kb') - : opts.limit - var inflate = opts.inflate !== false - var reviver = opts.reviver - var strict = opts.strict !== false - var type = opts.type || 'application/json' - var verify = opts.verify || false - - if (verify !== false && typeof verify !== 'function') { - throw new TypeError('option verify must be function') - } - - // create the appropriate type checking function - var shouldParse = typeof type !== 'function' - ? typeChecker(type) - : type - - function parse (body) { - if (body.length === 0) { - // special-case empty json body, as it's a common client-side mistake - // TODO: maybe make this configurable or part of "strict" option - return {} - } - - if (strict) { - var first = firstchar(body) - - if (first !== '{' && first !== '[') { - debug('strict violation') - throw createStrictSyntaxError(body, first) - } - } - - try { - debug('parse json') - return JSON.parse(body, reviver) - } catch (e) { - throw normalizeJsonSyntaxError(e, { - message: e.message, - stack: e.stack - }) - } - } - - return function jsonParser (req, res, next) { - if (req._body) { - debug('body already parsed') - next() - return - } - - req.body = req.body || {} - - // skip requests without bodies - if (!typeis.hasBody(req)) { - debug('skip empty body') - next() - return - } - - debug('content-type %j', req.headers['content-type']) - - // determine if request should be parsed - if (!shouldParse(req)) { - debug('skip parsing') - next() - return - } - - // assert charset per RFC 7159 sec 8.1 - var charset = getCharset(req) || 'utf-8' - if (charset.slice(0, 4) !== 'utf-') { - debug('invalid charset') - next(createError(415, 'unsupported charset "' + charset.toUpperCase() + '"', { - charset: charset, - type: 'charset.unsupported' - })) - return - } - - // read - read(req, res, next, parse, debug, { - encoding: charset, - inflate: inflate, - limit: limit, - verify: verify - }) - } -} - -/** - * Create strict violation syntax error matching native error. - * - * @param {string} str - * @param {string} char - * @return {Error} - * @private - */ - -function createStrictSyntaxError (str, char) { - var index = str.indexOf(char) - var partial = index !== -1 - ? str.substring(0, index) + '#' - : '' - - try { - JSON.parse(partial); /* istanbul ignore next */ throw new SyntaxError('strict violation') - } catch (e) { - return normalizeJsonSyntaxError(e, { - message: e.message.replace('#', char), - stack: e.stack - }) - } -} - -/** - * Get the first non-whitespace character in a string. - * - * @param {string} str - * @return {function} - * @private - */ - -function firstchar (str) { - var match = FIRST_CHAR_REGEXP.exec(str) - - return match - ? match[1] - : undefined -} - -/** - * Get the charset of a request. - * - * @param {object} req - * @api private - */ - -function getCharset (req) { - try { - return (contentType.parse(req).parameters.charset || '').toLowerCase() - } catch (e) { - return undefined - } -} - -/** - * Normalize a SyntaxError for JSON.parse. - * - * @param {SyntaxError} error - * @param {object} obj - * @return {SyntaxError} - */ - -function normalizeJsonSyntaxError (error, obj) { - var keys = Object.getOwnPropertyNames(error) - - for (var i = 0; i < keys.length; i++) { - var key = keys[i] - if (key !== 'stack' && key !== 'message') { - delete error[key] - } - } - - // replace stack before message for Node.js 0.10 and below - error.stack = obj.stack.replace(error.message, obj.message) - error.message = obj.message - - return error -} - -/** - * Get the simple type checker. - * - * @param {string} type - * @return {function} - */ - -function typeChecker (type) { - return function checkType (req) { - return Boolean(typeis(req, type)) - } -} diff --git a/node_modules/body-parser/lib/types/raw.js b/node_modules/body-parser/lib/types/raw.js deleted file mode 100644 index f5d1b67..0000000 --- a/node_modules/body-parser/lib/types/raw.js +++ /dev/null @@ -1,101 +0,0 @@ -/*! - * body-parser - * Copyright(c) 2014-2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - */ - -var bytes = require('bytes') -var debug = require('debug')('body-parser:raw') -var read = require('../read') -var typeis = require('type-is') - -/** - * Module exports. - */ - -module.exports = raw - -/** - * Create a middleware to parse raw bodies. - * - * @param {object} [options] - * @return {function} - * @api public - */ - -function raw (options) { - var opts = options || {} - - var inflate = opts.inflate !== false - var limit = typeof opts.limit !== 'number' - ? bytes.parse(opts.limit || '100kb') - : opts.limit - var type = opts.type || 'application/octet-stream' - var verify = opts.verify || false - - if (verify !== false && typeof verify !== 'function') { - throw new TypeError('option verify must be function') - } - - // create the appropriate type checking function - var shouldParse = typeof type !== 'function' - ? typeChecker(type) - : type - - function parse (buf) { - return buf - } - - return function rawParser (req, res, next) { - if (req._body) { - debug('body already parsed') - next() - return - } - - req.body = req.body || {} - - // skip requests without bodies - if (!typeis.hasBody(req)) { - debug('skip empty body') - next() - return - } - - debug('content-type %j', req.headers['content-type']) - - // determine if request should be parsed - if (!shouldParse(req)) { - debug('skip parsing') - next() - return - } - - // read - read(req, res, next, parse, debug, { - encoding: null, - inflate: inflate, - limit: limit, - verify: verify - }) - } -} - -/** - * Get the simple type checker. - * - * @param {string} type - * @return {function} - */ - -function typeChecker (type) { - return function checkType (req) { - return Boolean(typeis(req, type)) - } -} diff --git a/node_modules/body-parser/lib/types/text.js b/node_modules/body-parser/lib/types/text.js deleted file mode 100644 index 083a009..0000000 --- a/node_modules/body-parser/lib/types/text.js +++ /dev/null @@ -1,121 +0,0 @@ -/*! - * body-parser - * Copyright(c) 2014-2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - */ - -var bytes = require('bytes') -var contentType = require('content-type') -var debug = require('debug')('body-parser:text') -var read = require('../read') -var typeis = require('type-is') - -/** - * Module exports. - */ - -module.exports = text - -/** - * Create a middleware to parse text bodies. - * - * @param {object} [options] - * @return {function} - * @api public - */ - -function text (options) { - var opts = options || {} - - var defaultCharset = opts.defaultCharset || 'utf-8' - var inflate = opts.inflate !== false - var limit = typeof opts.limit !== 'number' - ? bytes.parse(opts.limit || '100kb') - : opts.limit - var type = opts.type || 'text/plain' - var verify = opts.verify || false - - if (verify !== false && typeof verify !== 'function') { - throw new TypeError('option verify must be function') - } - - // create the appropriate type checking function - var shouldParse = typeof type !== 'function' - ? typeChecker(type) - : type - - function parse (buf) { - return buf - } - - return function textParser (req, res, next) { - if (req._body) { - debug('body already parsed') - next() - return - } - - req.body = req.body || {} - - // skip requests without bodies - if (!typeis.hasBody(req)) { - debug('skip empty body') - next() - return - } - - debug('content-type %j', req.headers['content-type']) - - // determine if request should be parsed - if (!shouldParse(req)) { - debug('skip parsing') - next() - return - } - - // get charset - var charset = getCharset(req) || defaultCharset - - // read - read(req, res, next, parse, debug, { - encoding: charset, - inflate: inflate, - limit: limit, - verify: verify - }) - } -} - -/** - * Get the charset of a request. - * - * @param {object} req - * @api private - */ - -function getCharset (req) { - try { - return (contentType.parse(req).parameters.charset || '').toLowerCase() - } catch (e) { - return undefined - } -} - -/** - * Get the simple type checker. - * - * @param {string} type - * @return {function} - */ - -function typeChecker (type) { - return function checkType (req) { - return Boolean(typeis(req, type)) - } -} diff --git a/node_modules/body-parser/lib/types/urlencoded.js b/node_modules/body-parser/lib/types/urlencoded.js deleted file mode 100644 index b2ca8f1..0000000 --- a/node_modules/body-parser/lib/types/urlencoded.js +++ /dev/null @@ -1,284 +0,0 @@ -/*! - * body-parser - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2014-2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var bytes = require('bytes') -var contentType = require('content-type') -var createError = require('http-errors') -var debug = require('debug')('body-parser:urlencoded') -var deprecate = require('depd')('body-parser') -var read = require('../read') -var typeis = require('type-is') - -/** - * Module exports. - */ - -module.exports = urlencoded - -/** - * Cache of parser modules. - */ - -var parsers = Object.create(null) - -/** - * Create a middleware to parse urlencoded bodies. - * - * @param {object} [options] - * @return {function} - * @public - */ - -function urlencoded (options) { - var opts = options || {} - - // notice because option default will flip in next major - if (opts.extended === undefined) { - deprecate('undefined extended: provide extended option') - } - - var extended = opts.extended !== false - var inflate = opts.inflate !== false - var limit = typeof opts.limit !== 'number' - ? bytes.parse(opts.limit || '100kb') - : opts.limit - var type = opts.type || 'application/x-www-form-urlencoded' - var verify = opts.verify || false - - if (verify !== false && typeof verify !== 'function') { - throw new TypeError('option verify must be function') - } - - // create the appropriate query parser - var queryparse = extended - ? extendedparser(opts) - : simpleparser(opts) - - // create the appropriate type checking function - var shouldParse = typeof type !== 'function' - ? typeChecker(type) - : type - - function parse (body) { - return body.length - ? queryparse(body) - : {} - } - - return function urlencodedParser (req, res, next) { - if (req._body) { - debug('body already parsed') - next() - return - } - - req.body = req.body || {} - - // skip requests without bodies - if (!typeis.hasBody(req)) { - debug('skip empty body') - next() - return - } - - debug('content-type %j', req.headers['content-type']) - - // determine if request should be parsed - if (!shouldParse(req)) { - debug('skip parsing') - next() - return - } - - // assert charset - var charset = getCharset(req) || 'utf-8' - if (charset !== 'utf-8') { - debug('invalid charset') - next(createError(415, 'unsupported charset "' + charset.toUpperCase() + '"', { - charset: charset, - type: 'charset.unsupported' - })) - return - } - - // read - read(req, res, next, parse, debug, { - debug: debug, - encoding: charset, - inflate: inflate, - limit: limit, - verify: verify - }) - } -} - -/** - * Get the extended query parser. - * - * @param {object} options - */ - -function extendedparser (options) { - var parameterLimit = options.parameterLimit !== undefined - ? options.parameterLimit - : 1000 - var parse = parser('qs') - - if (isNaN(parameterLimit) || parameterLimit < 1) { - throw new TypeError('option parameterLimit must be a positive number') - } - - if (isFinite(parameterLimit)) { - parameterLimit = parameterLimit | 0 - } - - return function queryparse (body) { - var paramCount = parameterCount(body, parameterLimit) - - if (paramCount === undefined) { - debug('too many parameters') - throw createError(413, 'too many parameters', { - type: 'parameters.too.many' - }) - } - - var arrayLimit = Math.max(100, paramCount) - - debug('parse extended urlencoding') - return parse(body, { - allowPrototypes: true, - arrayLimit: arrayLimit, - depth: Infinity, - parameterLimit: parameterLimit - }) - } -} - -/** - * Get the charset of a request. - * - * @param {object} req - * @api private - */ - -function getCharset (req) { - try { - return (contentType.parse(req).parameters.charset || '').toLowerCase() - } catch (e) { - return undefined - } -} - -/** - * Count the number of parameters, stopping once limit reached - * - * @param {string} body - * @param {number} limit - * @api private - */ - -function parameterCount (body, limit) { - var count = 0 - var index = 0 - - while ((index = body.indexOf('&', index)) !== -1) { - count++ - index++ - - if (count === limit) { - return undefined - } - } - - return count -} - -/** - * Get parser for module name dynamically. - * - * @param {string} name - * @return {function} - * @api private - */ - -function parser (name) { - var mod = parsers[name] - - if (mod !== undefined) { - return mod.parse - } - - // this uses a switch for static require analysis - switch (name) { - case 'qs': - mod = require('qs') - break - case 'querystring': - mod = require('querystring') - break - } - - // store to prevent invoking require() - parsers[name] = mod - - return mod.parse -} - -/** - * Get the simple query parser. - * - * @param {object} options - */ - -function simpleparser (options) { - var parameterLimit = options.parameterLimit !== undefined - ? options.parameterLimit - : 1000 - var parse = parser('querystring') - - if (isNaN(parameterLimit) || parameterLimit < 1) { - throw new TypeError('option parameterLimit must be a positive number') - } - - if (isFinite(parameterLimit)) { - parameterLimit = parameterLimit | 0 - } - - return function queryparse (body) { - var paramCount = parameterCount(body, parameterLimit) - - if (paramCount === undefined) { - debug('too many parameters') - throw createError(413, 'too many parameters', { - type: 'parameters.too.many' - }) - } - - debug('parse urlencoding') - return parse(body, undefined, undefined, { maxKeys: parameterLimit }) - } -} - -/** - * Get the simple type checker. - * - * @param {string} type - * @return {function} - */ - -function typeChecker (type) { - return function checkType (req) { - return Boolean(typeis(req, type)) - } -} diff --git a/node_modules/body-parser/package.json b/node_modules/body-parser/package.json deleted file mode 100644 index 9cd2ccb..0000000 --- a/node_modules/body-parser/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "name": "body-parser", - "description": "Node.js body parsing middleware", - "version": "1.20.1", - "contributors": [ - "Douglas Christopher Wilson ", - "Jonathan Ong (http://jongleberry.com)" - ], - "license": "MIT", - "repository": "expressjs/body-parser", - "dependencies": { - "bytes": "3.1.2", - "content-type": "~1.0.4", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.11.0", - "raw-body": "2.5.1", - "type-is": "~1.6.18", - "unpipe": "1.0.0" - }, - "devDependencies": { - "eslint": "8.24.0", - "eslint-config-standard": "14.1.1", - "eslint-plugin-import": "2.26.0", - "eslint-plugin-markdown": "3.0.0", - "eslint-plugin-node": "11.1.0", - "eslint-plugin-promise": "6.0.1", - "eslint-plugin-standard": "4.1.0", - "methods": "1.1.2", - "mocha": "10.0.0", - "nyc": "15.1.0", - "safe-buffer": "5.2.1", - "supertest": "6.3.0" - }, - "files": [ - "lib/", - "LICENSE", - "HISTORY.md", - "SECURITY.md", - "index.js" - ], - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - }, - "scripts": { - "lint": "eslint .", - "test": "mocha --require test/support/env --reporter spec --check-leaks --bail test/", - "test-ci": "nyc --reporter=lcov --reporter=text npm test", - "test-cov": "nyc --reporter=html --reporter=text npm test" - } -} diff --git a/node_modules/brace-expansion/LICENSE b/node_modules/brace-expansion/LICENSE deleted file mode 100644 index de32266..0000000 --- a/node_modules/brace-expansion/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2013 Julian Gruber - -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/brace-expansion/README.md b/node_modules/brace-expansion/README.md deleted file mode 100644 index 6b4e0e1..0000000 --- a/node_modules/brace-expansion/README.md +++ /dev/null @@ -1,129 +0,0 @@ -# brace-expansion - -[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), -as known from sh/bash, in JavaScript. - -[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) -[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion) -[![Greenkeeper badge](https://badges.greenkeeper.io/juliangruber/brace-expansion.svg)](https://greenkeeper.io/) - -[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion) - -## Example - -```js -var expand = require('brace-expansion'); - -expand('file-{a,b,c}.jpg') -// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] - -expand('-v{,,}') -// => ['-v', '-v', '-v'] - -expand('file{0..2}.jpg') -// => ['file0.jpg', 'file1.jpg', 'file2.jpg'] - -expand('file-{a..c}.jpg') -// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] - -expand('file{2..0}.jpg') -// => ['file2.jpg', 'file1.jpg', 'file0.jpg'] - -expand('file{0..4..2}.jpg') -// => ['file0.jpg', 'file2.jpg', 'file4.jpg'] - -expand('file-{a..e..2}.jpg') -// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] - -expand('file{00..10..5}.jpg') -// => ['file00.jpg', 'file05.jpg', 'file10.jpg'] - -expand('{{A..C},{a..c}}') -// => ['A', 'B', 'C', 'a', 'b', 'c'] - -expand('ppp{,config,oe{,conf}}') -// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] -``` - -## API - -```js -var expand = require('brace-expansion'); -``` - -### var expanded = expand(str) - -Return an array of all possible and valid expansions of `str`. If none are -found, `[str]` is returned. - -Valid expansions are: - -```js -/^(.*,)+(.+)?$/ -// {a,b,...} -``` - -A comma separated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. - -```js -/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ -// {x..y[..incr]} -``` - -A numeric sequence from `x` to `y` inclusive, with optional increment. -If `x` or `y` start with a leading `0`, all the numbers will be padded -to have equal length. Negative numbers and backwards iteration work too. - -```js -/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ -// {x..y[..incr]} -``` - -An alphabetic sequence from `x` to `y` inclusive, with optional increment. -`x` and `y` must be exactly one character, and if given, `incr` must be a -number. - -For compatibility reasons, the string `${` is not eligible for brace expansion. - -## Installation - -With [npm](https://npmjs.org) do: - -```bash -npm install brace-expansion -``` - -## Contributors - -- [Julian Gruber](https://github.com/juliangruber) -- [Isaac Z. Schlueter](https://github.com/isaacs) - -## Sponsors - -This module is proudly supported by my [Sponsors](https://github.com/juliangruber/sponsors)! - -Do you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my [Patreon](https://www.patreon.com/juliangruber). Not sure how much of my modules you're using? Try [feross/thanks](https://github.com/feross/thanks)! - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.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/brace-expansion/index.js b/node_modules/brace-expansion/index.js deleted file mode 100644 index 0478be8..0000000 --- a/node_modules/brace-expansion/index.js +++ /dev/null @@ -1,201 +0,0 @@ -var concatMap = require('concat-map'); -var balanced = require('balanced-match'); - -module.exports = expandTop; - -var escSlash = '\0SLASH'+Math.random()+'\0'; -var escOpen = '\0OPEN'+Math.random()+'\0'; -var escClose = '\0CLOSE'+Math.random()+'\0'; -var escComma = '\0COMMA'+Math.random()+'\0'; -var escPeriod = '\0PERIOD'+Math.random()+'\0'; - -function numeric(str) { - return parseInt(str, 10) == str - ? parseInt(str, 10) - : str.charCodeAt(0); -} - -function escapeBraces(str) { - return str.split('\\\\').join(escSlash) - .split('\\{').join(escOpen) - .split('\\}').join(escClose) - .split('\\,').join(escComma) - .split('\\.').join(escPeriod); -} - -function unescapeBraces(str) { - return str.split(escSlash).join('\\') - .split(escOpen).join('{') - .split(escClose).join('}') - .split(escComma).join(',') - .split(escPeriod).join('.'); -} - - -// Basically just str.split(","), but handling cases -// where we have nested braced sections, which should be -// treated as individual members, like {a,{b,c},d} -function parseCommaParts(str) { - if (!str) - return ['']; - - var parts = []; - var m = balanced('{', '}', str); - - if (!m) - return str.split(','); - - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(','); - - p[p.length-1] += '{' + body + '}'; - var postParts = parseCommaParts(post); - if (post.length) { - p[p.length-1] += postParts.shift(); - p.push.apply(p, postParts); - } - - parts.push.apply(parts, p); - - return parts; -} - -function expandTop(str) { - if (!str) - return []; - - // I don't know why Bash 4.3 does this, but it does. - // Anything starting with {} will have the first two bytes preserved - // but *only* at the top level, so {},a}b will not expand to anything, - // but a{},b}c will be expanded to [a}c,abc]. - // One could argue that this is a bug in Bash, but since the goal of - // this module is to match Bash's rules, we escape a leading {} - if (str.substr(0, 2) === '{}') { - str = '\\{\\}' + str.substr(2); - } - - return expand(escapeBraces(str), true).map(unescapeBraces); -} - -function identity(e) { - return e; -} - -function embrace(str) { - return '{' + str + '}'; -} -function isPadded(el) { - return /^-?0\d/.test(el); -} - -function lte(i, y) { - return i <= y; -} -function gte(i, y) { - return i >= y; -} - -function expand(str, isTop) { - var expansions = []; - - var m = balanced('{', '}', str); - if (!m || /\$$/.test(m.pre)) return [str]; - - var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); - var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); - var isSequence = isNumericSequence || isAlphaSequence; - var isOptions = m.body.indexOf(',') >= 0; - if (!isSequence && !isOptions) { - // {a},b} - if (m.post.match(/,.*\}/)) { - str = m.pre + '{' + m.body + escClose + m.post; - return expand(str); - } - return [str]; - } - - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - // x{{a,b}}y ==> x{a}y x{b}y - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - var post = m.post.length - ? expand(m.post, false) - : ['']; - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } - } - - // at this point, n is the parts, and we know it's not a comma set - // with a single entry. - - // no need to expand pre, since it is guaranteed to be free of brace-sets - var pre = m.pre; - var post = m.post.length - ? expand(m.post, false) - : ['']; - - var N; - - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length) - var incr = n.length == 3 - ? Math.abs(numeric(n[2])) - : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte; - } - var pad = n.some(isPadded); - - N = []; - - for (var i = x; test(i, y); i += incr) { - var c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === '\\') - c = ''; - } else { - c = String(i); - if (pad) { - var need = width - c.length; - if (need > 0) { - var z = new Array(need + 1).join('0'); - if (i < 0) - c = '-' + z + c.slice(1); - else - c = z + c; - } - } - } - N.push(c); - } - } else { - N = concatMap(n, function(el) { return expand(el, false) }); - } - - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); - } - } - - return expansions; -} - diff --git a/node_modules/brace-expansion/package.json b/node_modules/brace-expansion/package.json deleted file mode 100644 index a18faa8..0000000 --- a/node_modules/brace-expansion/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "brace-expansion", - "description": "Brace expansion as known from sh/bash", - "version": "1.1.11", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/brace-expansion.git" - }, - "homepage": "https://github.com/juliangruber/brace-expansion", - "main": "index.js", - "scripts": { - "test": "tape test/*.js", - "gentest": "bash test/generate.sh", - "bench": "matcha test/perf/bench.js" - }, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - }, - "devDependencies": { - "matcha": "^0.7.0", - "tape": "^4.6.0" - }, - "keywords": [], - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "license": "MIT", - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/8..latest", - "firefox/20..latest", - "firefox/nightly", - "chrome/25..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - } -} diff --git a/node_modules/buffer-writer/.travis.yml b/node_modules/buffer-writer/.travis.yml deleted file mode 100644 index 8e59bb3..0000000 --- a/node_modules/buffer-writer/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: node_js -node_js: - - 4 - - 6 - - 8 - - 10 - - 11 diff --git a/node_modules/buffer-writer/LICENSE b/node_modules/buffer-writer/LICENSE deleted file mode 100644 index 72dc60d..0000000 --- a/node_modules/buffer-writer/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -The MIT License (MIT) - -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/buffer-writer/README.md b/node_modules/buffer-writer/README.md deleted file mode 100644 index 81eccc0..0000000 --- a/node_modules/buffer-writer/README.md +++ /dev/null @@ -1,48 +0,0 @@ -# buffer-writer - -[![Build Status](https://secure.travis-ci.org/brianc/node-buffer-writer.png?branch=master)](http://travis-ci.org/brianc/node-buffer-writer) - -Fast & efficient buffer writer used to keep memory usage low by internally recycling a single large buffer. - -Used as the binary protocol writer in [node-postgres](https://github.com/brianc/node-postgres) - -Since postgres requires big endian encoding, this only writes big endian numbers for now, but can & probably will easily be extended to write little endian as well. - -I'll admit this has a few postgres specific things I might need to take out in the future, such as `addHeader` - -## api - -`var writer = new (require('buffer-writer')());` - -### writer.addInt32(num) - -Writes a 4-byte big endian binary encoded number to the end of the buffer. - -### writer.addInt16(num) - -Writes a 2-byte big endian binary encoded number to the end of the buffer. - -### writer.addCString(string) - -Writes a string to the buffer `utf8` encoded and adds a null character (`\0`) at the end. - -### var buffer = writer.addHeader(char) - -Writes the 5 byte PostgreSQL required header to the beginning of the buffer. (1 byte for character, 1 BE Int32 for length of the buffer) - -### var buffer = writer.join() - -Collects all data in the writer and joins it into a single, new buffer. - -### var buffer = writer.flush(char) - -Writes the 5 byte postgres required message header, collects all data in the writer and joins it into a single, new buffer, and then resets the writer. - -## thoughts - -This is kind of node-postgres specific. If you're interested in using this for a more general purpose thing, lemme know. -I would love to work with you on getting this more reusable for your needs. - -## license - -MIT diff --git a/node_modules/buffer-writer/index.js b/node_modules/buffer-writer/index.js deleted file mode 100644 index f3c119e..0000000 --- a/node_modules/buffer-writer/index.js +++ /dev/null @@ -1,129 +0,0 @@ -//binary data writer tuned for creating -//postgres message packets as effeciently as possible by reusing the -//same buffer to avoid memcpy and limit memory allocations -var Writer = module.exports = function (size) { - this.size = size || 1024; - this.buffer = Buffer.alloc(this.size + 5); - this.offset = 5; - this.headerPosition = 0; -}; - -//resizes internal buffer if not enough size left -Writer.prototype._ensure = function (size) { - var remaining = this.buffer.length - this.offset; - if (remaining < size) { - var oldBuffer = this.buffer; - // exponential growth factor of around ~ 1.5 - // https://stackoverflow.com/questions/2269063/buffer-growth-strategy - var newSize = oldBuffer.length + (oldBuffer.length >> 1) + size; - this.buffer = Buffer.alloc(newSize); - oldBuffer.copy(this.buffer); - } -}; - -Writer.prototype.addInt32 = function (num) { - this._ensure(4); - this.buffer[this.offset++] = (num >>> 24 & 0xFF); - this.buffer[this.offset++] = (num >>> 16 & 0xFF); - this.buffer[this.offset++] = (num >>> 8 & 0xFF); - this.buffer[this.offset++] = (num >>> 0 & 0xFF); - return this; -}; - -Writer.prototype.addInt16 = function (num) { - this._ensure(2); - this.buffer[this.offset++] = (num >>> 8 & 0xFF); - this.buffer[this.offset++] = (num >>> 0 & 0xFF); - return this; -}; - -//for versions of node requiring 'length' as 3rd argument to buffer.write -var writeString = function (buffer, string, offset, len) { - buffer.write(string, offset, len); -}; - -//overwrite function for older versions of node -if (Buffer.prototype.write.length === 3) { - writeString = function (buffer, string, offset, len) { - buffer.write(string, offset); - }; -} - -Writer.prototype.addCString = function (string) { - //just write a 0 for empty or null strings - if (!string) { - this._ensure(1); - } else { - var len = Buffer.byteLength(string); - this._ensure(len + 1); //+1 for null terminator - writeString(this.buffer, string, this.offset, len); - this.offset += len; - } - - this.buffer[this.offset++] = 0; // null terminator - return this; -}; - -Writer.prototype.addChar = function (c) { - this._ensure(1); - writeString(this.buffer, c, this.offset, 1); - this.offset++; - return this; -}; - -Writer.prototype.addString = function (string) { - string = string || ""; - var len = Buffer.byteLength(string); - this._ensure(len); - this.buffer.write(string, this.offset); - this.offset += len; - return this; -}; - -Writer.prototype.getByteLength = function () { - return this.offset - 5; -}; - -Writer.prototype.add = function (otherBuffer) { - this._ensure(otherBuffer.length); - otherBuffer.copy(this.buffer, this.offset); - this.offset += otherBuffer.length; - return this; -}; - -Writer.prototype.clear = function () { - this.offset = 5; - this.headerPosition = 0; - this.lastEnd = 0; -}; - -//appends a header block to all the written data since the last -//subsequent header or to the beginning if there is only one data block -Writer.prototype.addHeader = function (code, last) { - var origOffset = this.offset; - this.offset = this.headerPosition; - this.buffer[this.offset++] = code; - //length is everything in this packet minus the code - this.addInt32(origOffset - (this.headerPosition + 1)); - //set next header position - this.headerPosition = origOffset; - //make space for next header - this.offset = origOffset; - if (!last) { - this._ensure(5); - this.offset += 5; - } -}; - -Writer.prototype.join = function (code) { - if (code) { - this.addHeader(code, true); - } - return this.buffer.slice(code ? 0 : 5, this.offset); -}; - -Writer.prototype.flush = function (code) { - var result = this.join(code); - this.clear(); - return result; -}; diff --git a/node_modules/buffer-writer/package.json b/node_modules/buffer-writer/package.json deleted file mode 100644 index 84c3c52..0000000 --- a/node_modules/buffer-writer/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "buffer-writer", - "version": "2.0.0", - "description": "a fast, efficient buffer writer", - "main": "index.js", - "scripts": { - "test": "mocha --throw-deprecation" - }, - "repository": { - "type": "git", - "url": "git://github.com/brianc/node-buffer-writer.git" - }, - "keywords": [ - "buffer", - "writer", - "builder" - ], - "author": "Brian M. Carlson", - "license": "MIT", - "devDependencies": { - "mocha": "5.2.0" - }, - "engines": { - "node": ">=4" - } -} diff --git a/node_modules/buffer-writer/test/mocha.opts b/node_modules/buffer-writer/test/mocha.opts deleted file mode 100644 index 5efaf24..0000000 --- a/node_modules/buffer-writer/test/mocha.opts +++ /dev/null @@ -1 +0,0 @@ ---ui tdd diff --git a/node_modules/buffer-writer/test/writer-tests.js b/node_modules/buffer-writer/test/writer-tests.js deleted file mode 100644 index ded91c8..0000000 --- a/node_modules/buffer-writer/test/writer-tests.js +++ /dev/null @@ -1,218 +0,0 @@ -var Writer = require(__dirname + "/../"); - -var assert = require('assert'); -var util = require('util'); - -assert.equalBuffers = function (actual, expected) { - var spit = function (actual, expected) { - console.log(""); - console.log("actual " + util.inspect(actual)); - console.log("expect " + util.inspect(expected)); - console.log(""); - }; - if (actual.length != expected.length) { - spit(actual, expected); - assert.strictEqual(actual.length, expected.length); - } - for (var i = 0; i < actual.length; i++) { - if (actual[i] != expected[i]) { - spit(actual, expected); - } - assert.strictEqual(actual[i], expected[i]); - } -}; - -suite('adding int32', function () { - var testAddingInt32 = function (int, expectedBuffer) { - test('writes ' + int, function () { - var subject = new Writer(); - var result = subject.addInt32(int).join(); - assert.equalBuffers(result, expectedBuffer); - }); - }; - - testAddingInt32(0, [0, 0, 0, 0]); - testAddingInt32(1, [0, 0, 0, 1]); - testAddingInt32(256, [0, 0, 1, 0]); - test('writes largest int32', function () { - //todo need to find largest int32 when I have internet access - return false; - }); - - test('writing multiple int32s', function () { - var subject = new Writer(); - var result = subject.addInt32(1).addInt32(10).addInt32(0).join(); - assert.equalBuffers(result, [0, 0, 0, 1, 0, 0, 0, 0x0a, 0, 0, 0, 0]); - }); - - suite('having to resize the buffer', function () { - test('after resize correct result returned', function () { - var subject = new Writer(10); - subject.addInt32(1).addInt32(1).addInt32(1); - assert.equalBuffers(subject.join(), [0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1]); - }); - }); -}); - -suite('int16', function () { - test('writes 0', function () { - var subject = new Writer(); - var result = subject.addInt16(0).join(); - assert.equalBuffers(result, [0, 0]); - }); - - test('writes 400', function () { - var subject = new Writer(); - var result = subject.addInt16(400).join(); - assert.equalBuffers(result, [1, 0x90]); - }); - - test('writes many', function () { - var subject = new Writer(); - var result = subject.addInt16(0).addInt16(1).addInt16(2).join(); - assert.equalBuffers(result, [0, 0, 0, 1, 0, 2]); - }); - - test('resizes if internal buffer fills up', function () { - var subject = new Writer(3); - var result = subject.addInt16(2).addInt16(3).join(); - assert.equalBuffers(result, [0, 2, 0, 3]); - }); - -}); - -suite('cString', function () { - test('writes empty cstring', function () { - var subject = new Writer(); - var result = subject.addCString().join(); - assert.equalBuffers(result, [0]); - }); - - test('writes two empty cstrings', function () { - var subject = new Writer(); - var result = subject.addCString("").addCString("").join(); - assert.equalBuffers(result, [0, 0]); - }); - - - test('writes non-empty cstring', function () { - var subject = new Writer(); - var result = subject.addCString("!!!").join(); - assert.equalBuffers(result, [33, 33, 33, 0]); - }); - - test('resizes if reached end', function () { - var subject = new Writer(3); - var result = subject.addCString("!!!").join(); - assert.equalBuffers(result, [33, 33, 33, 0]); - }); - - test('writes multiple cstrings', function () { - var subject = new Writer(); - var result = subject.addCString("!").addCString("!").join(); - assert.equalBuffers(result, [33, 0, 33, 0]); - }); - -}); - -test('writes char', function () { - var subject = new Writer(2); - var result = subject.addChar('a').addChar('b').addChar('c').join(); - assert.equalBuffers(result, [0x61, 0x62, 0x63]); -}); - -test('gets correct byte length', function () { - var subject = new Writer(5); - assert.strictEqual(subject.getByteLength(), 0); - subject.addInt32(0); - assert.strictEqual(subject.getByteLength(), 4); - subject.addCString("!"); - assert.strictEqual(subject.getByteLength(), 6); -}); - -test('can add arbitrary buffer to the end', function () { - var subject = new Writer(4); - subject.addCString("!!!") - var result = subject.add(Buffer.from("@@@")).join(); - assert.equalBuffers(result, [33, 33, 33, 0, 0x40, 0x40, 0x40]); -}); - -suite('can write normal string', function () { - var subject = new Writer(4); - var result = subject.addString("!").join(); - assert.equalBuffers(result, [33]); - test('can write cString too', function () { - var result = subject.addCString("!").join(); - assert.equalBuffers(result, [33, 33, 0]); - }); - test('can resize', function () { - var result = subject.addString("!!").join(); - assert.equalBuffers(result, [33, 33, 0, 33, 33]); - }); -}); - - -suite('clearing', function () { - var subject = new Writer(); - subject.addCString("@!!#!#"); - subject.addInt32(10401); - test('clears', function () { - subject.clear(); - assert.equalBuffers(subject.join(), []); - }); - test('writing more', function () { - var joinedResult = subject.addCString("!").addInt32(9).addInt16(2).join(); - assert.equalBuffers(joinedResult, [33, 0, 0, 0, 0, 9, 0, 2]); - }); - test('returns result', function () { - var flushedResult = subject.flush(); - assert.equalBuffers(flushedResult, [33, 0, 0, 0, 0, 9, 0, 2]) - }); - test('clears the writer', function () { - assert.equalBuffers(subject.join(), []) - assert.equalBuffers(subject.flush(), []) - }); -}); - -test("resizing to much larger", function () { - var subject = new Writer(2); - var string = "!!!!!!!!"; - var result = subject.addCString(string).flush(); - assert.equalBuffers(result, [33, 33, 33, 33, 33, 33, 33, 33, 0]); -}); - -suite("flush", function () { - test('added as a hex code to a full writer', function () { - var subject = new Writer(2); - var result = subject.addCString("!").flush(0x50); - assert.equalBuffers(result, [0x50, 0, 0, 0, 6, 33, 0]); - }); - - test('added as a hex code to a non-full writer', function () { - var subject = new Writer(10).addCString("!"); - var joinedResult = subject.join(0x50); - var result = subject.flush(0x50); - assert.equalBuffers(result, [0x50, 0, 0, 0, 6, 33, 0]); - }); - - test('added as a hex code to a buffer which requires resizing', function () { - var result = new Writer(2).addCString("!!!!!!!!").flush(0x50); - assert.equalBuffers(result, [0x50, 0, 0, 0, 0x0D, 33, 33, 33, 33, 33, 33, 33, 33, 0]); - }); -}); - -suite("header", function () { - test('adding two packets with headers', function () { - var subject = new Writer(10).addCString("!"); - subject.addHeader(0x50); - subject.addCString("!!"); - subject.addHeader(0x40); - subject.addCString("!"); - var result = subject.flush(0x10); - assert.equalBuffers(result, [0x50, 0, 0, 0, 6, 33, 0, 0x40, 0, 0, 0, 7, 33, 33, 0, 0x10, 0, 0, 0, 6, 33, 0]); - }); -}); - - - - diff --git a/node_modules/bytes/History.md b/node_modules/bytes/History.md deleted file mode 100644 index d60ce0e..0000000 --- a/node_modules/bytes/History.md +++ /dev/null @@ -1,97 +0,0 @@ -3.1.2 / 2022-01-27 -================== - - * Fix return value for un-parsable strings - -3.1.1 / 2021-11-15 -================== - - * Fix "thousandsSeparator" incorrecting formatting fractional part - -3.1.0 / 2019-01-22 -================== - - * Add petabyte (`pb`) support - -3.0.0 / 2017-08-31 -================== - - * Change "kB" to "KB" in format output - * Remove support for Node.js 0.6 - * Remove support for ComponentJS - -2.5.0 / 2017-03-24 -================== - - * Add option "unit" - -2.4.0 / 2016-06-01 -================== - - * Add option "unitSeparator" - -2.3.0 / 2016-02-15 -================== - - * Drop partial bytes on all parsed units - * Fix non-finite numbers to `.format` to return `null` - * Fix parsing byte string that looks like hex - * perf: hoist regular expressions - -2.2.0 / 2015-11-13 -================== - - * add option "decimalPlaces" - * add option "fixedDecimals" - -2.1.0 / 2015-05-21 -================== - - * add `.format` export - * add `.parse` export - -2.0.2 / 2015-05-20 -================== - - * remove map recreation - * remove unnecessary object construction - -2.0.1 / 2015-05-07 -================== - - * fix browserify require - * remove node.extend dependency - -2.0.0 / 2015-04-12 -================== - - * add option "case" - * add option "thousandsSeparator" - * return "null" on invalid parse input - * support proper round-trip: bytes(bytes(num)) === num - * units no longer case sensitive when parsing - -1.0.0 / 2014-05-05 -================== - - * add negative support. fixes #6 - -0.3.0 / 2014-03-19 -================== - - * added terabyte support - -0.2.1 / 2013-04-01 -================== - - * add .component - -0.2.0 / 2012-10-28 -================== - - * bytes(200).should.eql('200b') - -0.1.0 / 2012-07-04 -================== - - * add bytes to string conversion [yields] diff --git a/node_modules/bytes/LICENSE b/node_modules/bytes/LICENSE deleted file mode 100644 index 63e95a9..0000000 --- a/node_modules/bytes/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -(The MIT License) - -Copyright (c) 2012-2014 TJ Holowaychuk -Copyright (c) 2015 Jed Watson - -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/bytes/Readme.md b/node_modules/bytes/Readme.md deleted file mode 100644 index 5790e23..0000000 --- a/node_modules/bytes/Readme.md +++ /dev/null @@ -1,152 +0,0 @@ -# Bytes utility - -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Build Status][ci-image]][ci-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -Utility to parse a string bytes (ex: `1TB`) to bytes (`1099511627776`) and vice-versa. - -## Installation - -This is a [Node.js](https://nodejs.org/en/) module available through the -[npm registry](https://www.npmjs.com/). Installation is done using the -[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): - -```bash -$ npm install bytes -``` - -## Usage - -```js -var bytes = require('bytes'); -``` - -#### bytes(number|string value, [options]): number|string|null - -Default export function. Delegates to either `bytes.format` or `bytes.parse` based on the type of `value`. - -**Arguments** - -| Name | Type | Description | -|---------|----------|--------------------| -| value | `number`|`string` | Number value to format or string value to parse | -| options | `Object` | Conversion options for `format` | - -**Returns** - -| Name | Type | Description | -|---------|------------------|-------------------------------------------------| -| results | `string`|`number`|`null` | Return null upon error. Numeric value in bytes, or string value otherwise. | - -**Example** - -```js -bytes(1024); -// output: '1KB' - -bytes('1KB'); -// output: 1024 -``` - -#### bytes.format(number value, [options]): string|null - -Format the given value in bytes into a string. If the value is negative, it is kept as such. If it is a float, it is - rounded. - -**Arguments** - -| Name | Type | Description | -|---------|----------|--------------------| -| value | `number` | Value in bytes | -| options | `Object` | Conversion options | - -**Options** - -| Property | Type | Description | -|-------------------|--------|-----------------------------------------------------------------------------------------| -| decimalPlaces | `number`|`null` | Maximum number of decimal places to include in output. Default value to `2`. | -| fixedDecimals | `boolean`|`null` | Whether to always display the maximum number of decimal places. Default value to `false` | -| thousandsSeparator | `string`|`null` | Example of values: `' '`, `','` and `'.'`... Default value to `''`. | -| unit | `string`|`null` | The unit in which the result will be returned (B/KB/MB/GB/TB). Default value to `''` (which means auto detect). | -| unitSeparator | `string`|`null` | Separator to use between number and unit. Default value to `''`. | - -**Returns** - -| Name | Type | Description | -|---------|------------------|-------------------------------------------------| -| results | `string`|`null` | Return null upon error. String value otherwise. | - -**Example** - -```js -bytes.format(1024); -// output: '1KB' - -bytes.format(1000); -// output: '1000B' - -bytes.format(1000, {thousandsSeparator: ' '}); -// output: '1 000B' - -bytes.format(1024 * 1.7, {decimalPlaces: 0}); -// output: '2KB' - -bytes.format(1024, {unitSeparator: ' '}); -// output: '1 KB' -``` - -#### bytes.parse(string|number value): number|null - -Parse the string value into an integer in bytes. If no unit is given, or `value` -is a number, it is assumed the value is in bytes. - -Supported units and abbreviations are as follows and are case-insensitive: - - * `b` for bytes - * `kb` for kilobytes - * `mb` for megabytes - * `gb` for gigabytes - * `tb` for terabytes - * `pb` for petabytes - -The units are in powers of two, not ten. This means 1kb = 1024b according to this parser. - -**Arguments** - -| Name | Type | Description | -|---------------|--------|--------------------| -| value | `string`|`number` | String to parse, or number in bytes. | - -**Returns** - -| Name | Type | Description | -|---------|-------------|-------------------------| -| results | `number`|`null` | Return null upon error. Value in bytes otherwise. | - -**Example** - -```js -bytes.parse('1KB'); -// output: 1024 - -bytes.parse('1024'); -// output: 1024 - -bytes.parse(1024); -// output: 1024 -``` - -## License - -[MIT](LICENSE) - -[ci-image]: https://badgen.net/github/checks/visionmedia/bytes.js/master?label=ci -[ci-url]: https://github.com/visionmedia/bytes.js/actions?query=workflow%3Aci -[coveralls-image]: https://badgen.net/coveralls/c/github/visionmedia/bytes.js/master -[coveralls-url]: https://coveralls.io/r/visionmedia/bytes.js?branch=master -[downloads-image]: https://badgen.net/npm/dm/bytes -[downloads-url]: https://npmjs.org/package/bytes -[npm-image]: https://badgen.net/npm/v/bytes -[npm-url]: https://npmjs.org/package/bytes diff --git a/node_modules/bytes/index.js b/node_modules/bytes/index.js deleted file mode 100644 index 6f2d0f8..0000000 --- a/node_modules/bytes/index.js +++ /dev/null @@ -1,170 +0,0 @@ -/*! - * bytes - * Copyright(c) 2012-2014 TJ Holowaychuk - * Copyright(c) 2015 Jed Watson - * MIT Licensed - */ - -'use strict'; - -/** - * Module exports. - * @public - */ - -module.exports = bytes; -module.exports.format = format; -module.exports.parse = parse; - -/** - * Module variables. - * @private - */ - -var formatThousandsRegExp = /\B(?=(\d{3})+(?!\d))/g; - -var formatDecimalsRegExp = /(?:\.0*|(\.[^0]+)0+)$/; - -var map = { - b: 1, - kb: 1 << 10, - mb: 1 << 20, - gb: 1 << 30, - tb: Math.pow(1024, 4), - pb: Math.pow(1024, 5), -}; - -var parseRegExp = /^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i; - -/** - * Convert the given value in bytes into a string or parse to string to an integer in bytes. - * - * @param {string|number} value - * @param {{ - * case: [string], - * decimalPlaces: [number] - * fixedDecimals: [boolean] - * thousandsSeparator: [string] - * unitSeparator: [string] - * }} [options] bytes options. - * - * @returns {string|number|null} - */ - -function bytes(value, options) { - if (typeof value === 'string') { - return parse(value); - } - - if (typeof value === 'number') { - return format(value, options); - } - - return null; -} - -/** - * Format the given value in bytes into a string. - * - * If the value is negative, it is kept as such. If it is a float, - * it is rounded. - * - * @param {number} value - * @param {object} [options] - * @param {number} [options.decimalPlaces=2] - * @param {number} [options.fixedDecimals=false] - * @param {string} [options.thousandsSeparator=] - * @param {string} [options.unit=] - * @param {string} [options.unitSeparator=] - * - * @returns {string|null} - * @public - */ - -function format(value, options) { - if (!Number.isFinite(value)) { - return null; - } - - var mag = Math.abs(value); - var thousandsSeparator = (options && options.thousandsSeparator) || ''; - var unitSeparator = (options && options.unitSeparator) || ''; - var decimalPlaces = (options && options.decimalPlaces !== undefined) ? options.decimalPlaces : 2; - var fixedDecimals = Boolean(options && options.fixedDecimals); - var unit = (options && options.unit) || ''; - - if (!unit || !map[unit.toLowerCase()]) { - if (mag >= map.pb) { - unit = 'PB'; - } else if (mag >= map.tb) { - unit = 'TB'; - } else if (mag >= map.gb) { - unit = 'GB'; - } else if (mag >= map.mb) { - unit = 'MB'; - } else if (mag >= map.kb) { - unit = 'KB'; - } else { - unit = 'B'; - } - } - - var val = value / map[unit.toLowerCase()]; - var str = val.toFixed(decimalPlaces); - - if (!fixedDecimals) { - str = str.replace(formatDecimalsRegExp, '$1'); - } - - if (thousandsSeparator) { - str = str.split('.').map(function (s, i) { - return i === 0 - ? s.replace(formatThousandsRegExp, thousandsSeparator) - : s - }).join('.'); - } - - return str + unitSeparator + unit; -} - -/** - * Parse the string value into an integer in bytes. - * - * If no unit is given, it is assumed the value is in bytes. - * - * @param {number|string} val - * - * @returns {number|null} - * @public - */ - -function parse(val) { - if (typeof val === 'number' && !isNaN(val)) { - return val; - } - - if (typeof val !== 'string') { - return null; - } - - // Test if the string passed is valid - var results = parseRegExp.exec(val); - var floatValue; - var unit = 'b'; - - if (!results) { - // Nothing could be extracted from the given string - floatValue = parseInt(val, 10); - unit = 'b' - } else { - // Retrieve the value and the unit - floatValue = parseFloat(results[1]); - unit = results[4].toLowerCase(); - } - - if (isNaN(floatValue)) { - return null; - } - - return Math.floor(map[unit] * floatValue); -} diff --git a/node_modules/bytes/package.json b/node_modules/bytes/package.json deleted file mode 100644 index f2b6a8b..0000000 --- a/node_modules/bytes/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "bytes", - "description": "Utility to parse a string bytes to bytes and vice-versa", - "version": "3.1.2", - "author": "TJ Holowaychuk (http://tjholowaychuk.com)", - "contributors": [ - "Jed Watson ", - "Théo FIDRY " - ], - "license": "MIT", - "keywords": [ - "byte", - "bytes", - "utility", - "parse", - "parser", - "convert", - "converter" - ], - "repository": "visionmedia/bytes.js", - "devDependencies": { - "eslint": "7.32.0", - "eslint-plugin-markdown": "2.2.1", - "mocha": "9.2.0", - "nyc": "15.1.0" - }, - "files": [ - "History.md", - "LICENSE", - "Readme.md", - "index.js" - ], - "engines": { - "node": ">= 0.8" - }, - "scripts": { - "lint": "eslint .", - "test": "mocha --check-leaks --reporter spec", - "test-ci": "nyc --reporter=lcov --reporter=text npm test", - "test-cov": "nyc --reporter=html --reporter=text npm test" - } -} diff --git a/node_modules/call-bind/.eslintignore b/node_modules/call-bind/.eslintignore deleted file mode 100644 index 404abb2..0000000 --- a/node_modules/call-bind/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -coverage/ diff --git a/node_modules/call-bind/.eslintrc b/node_modules/call-bind/.eslintrc deleted file mode 100644 index dfa9a6c..0000000 --- a/node_modules/call-bind/.eslintrc +++ /dev/null @@ -1,16 +0,0 @@ -{ - "root": true, - - "extends": "@ljharb", - - "rules": { - "func-name-matching": 0, - "id-length": 0, - "new-cap": [2, { - "capIsNewExceptions": [ - "GetIntrinsic", - ], - }], - "no-magic-numbers": 0, - }, -} diff --git a/node_modules/call-bind/.github/FUNDING.yml b/node_modules/call-bind/.github/FUNDING.yml deleted file mode 100644 index c70c2ec..0000000 --- a/node_modules/call-bind/.github/FUNDING.yml +++ /dev/null @@ -1,12 +0,0 @@ -# These are supported funding model platforms - -github: [ljharb] -patreon: # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: npm/call-bind -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/call-bind/.nycrc b/node_modules/call-bind/.nycrc deleted file mode 100644 index bdd626c..0000000 --- a/node_modules/call-bind/.nycrc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "all": true, - "check-coverage": false, - "reporter": ["text-summary", "text", "html", "json"], - "exclude": [ - "coverage", - "test" - ] -} diff --git a/node_modules/call-bind/CHANGELOG.md b/node_modules/call-bind/CHANGELOG.md deleted file mode 100644 index 717bcc3..0000000 --- a/node_modules/call-bind/CHANGELOG.md +++ /dev/null @@ -1,77 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [v1.0.5](https://github.com/ljharb/call-bind/compare/v1.0.4...v1.0.5) - 2023-10-19 - -### Commits - -- [Fix] throw an error on non-functions as early as possible [`f262408`](https://github.com/ljharb/call-bind/commit/f262408f822c840fbc268080f3ad7c429611066d) -- [Deps] update `set-function-length` [`3fff271`](https://github.com/ljharb/call-bind/commit/3fff27145a1e3a76a5b74f1d7c3c43d0fa3b9871) - -## [v1.0.4](https://github.com/ljharb/call-bind/compare/v1.0.3...v1.0.4) - 2023-10-19 - -## [v1.0.3](https://github.com/ljharb/call-bind/compare/v1.0.2...v1.0.3) - 2023-10-19 - -### Commits - -- [actions] reuse common workflows [`a994df6`](https://github.com/ljharb/call-bind/commit/a994df69f401f4bf735a4ccd77029b85d1549453) -- [meta] use `npmignore` to autogenerate an npmignore file [`eef3ef2`](https://github.com/ljharb/call-bind/commit/eef3ef21e1f002790837fedb8af2679c761fbdf5) -- [readme] flesh out content [`1845ccf`](https://github.com/ljharb/call-bind/commit/1845ccfd9976a607884cfc7157c93192cc16cf22) -- [actions] use `node/install` instead of `node/run`; use `codecov` action [`5b47d53`](https://github.com/ljharb/call-bind/commit/5b47d53d2fd74af5ea0a44f1d51e503cd42f7a90) -- [Refactor] use `set-function-length` [`a0e165c`](https://github.com/ljharb/call-bind/commit/a0e165c5dc61db781cbc919b586b1c2b8da0b150) -- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`9c50103`](https://github.com/ljharb/call-bind/commit/9c50103f44137279a817317cf6cc421a658f85b4) -- [meta] simplify "exports" [`019c6d0`](https://github.com/ljharb/call-bind/commit/019c6d06b0e1246ceed8e579f57e44441cbbf6d9) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `safe-publish-latest`, `tape` [`23bd718`](https://github.com/ljharb/call-bind/commit/23bd718a288d3b03042062b4ef5153b3cea83f11) -- [actions] update codecov uploader [`62552d7`](https://github.com/ljharb/call-bind/commit/62552d79cc79e05825e99aaba134ae5b37f33da5) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`ec81665`](https://github.com/ljharb/call-bind/commit/ec81665b300f87eabff597afdc8b8092adfa7afd) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `tape` [`35d67fc`](https://github.com/ljharb/call-bind/commit/35d67fcea883e686650f736f61da5ddca2592de8) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`0266d8d`](https://github.com/ljharb/call-bind/commit/0266d8d2a45086a922db366d0c2932fa463662ff) -- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`43a5b28`](https://github.com/ljharb/call-bind/commit/43a5b28a444e710e1bbf92adb8afb5cf7523a223) -- [Deps] update `define-data-property`, `function-bind`, `get-intrinsic` [`780eb36`](https://github.com/ljharb/call-bind/commit/780eb36552514f8cc99c70821ce698697c2726a5) -- [Dev Deps] update `aud`, `tape` [`90d50ad`](https://github.com/ljharb/call-bind/commit/90d50ad03b061e0268b3380b0065fcaec183dc05) -- [meta] use `prepublishOnly` script for npm 7+ [`44c5433`](https://github.com/ljharb/call-bind/commit/44c5433b7980e02b4870007046407cf6fc543329) -- [Deps] update `get-intrinsic` [`86bfbfc`](https://github.com/ljharb/call-bind/commit/86bfbfcf34afdc6eabc93ce3d408548d0e27d958) -- [Deps] update `get-intrinsic` [`5c53354`](https://github.com/ljharb/call-bind/commit/5c5335489be0294c18cd7a8bb6e08226ee019ff5) -- [actions] update checkout action [`4c393a8`](https://github.com/ljharb/call-bind/commit/4c393a8173b3c8e5b30d5b3297b3b94d48bf87f3) -- [Deps] update `get-intrinsic` [`4e70bde`](https://github.com/ljharb/call-bind/commit/4e70bdec0626acb11616d66250fc14565e716e91) -- [Deps] update `get-intrinsic` [`55ae803`](https://github.com/ljharb/call-bind/commit/55ae803a920bd93c369cd798c20de31f91e9fc60) - -## [v1.0.2](https://github.com/ljharb/call-bind/compare/v1.0.1...v1.0.2) - 2021-01-11 - -### Commits - -- [Fix] properly include the receiver in the bound length [`dbae7bc`](https://github.com/ljharb/call-bind/commit/dbae7bc676c079a0d33c0a43e9ef92cb7b01345d) - -## [v1.0.1](https://github.com/ljharb/call-bind/compare/v1.0.0...v1.0.1) - 2021-01-08 - -### Commits - -- [Tests] migrate tests to Github Actions [`b6db284`](https://github.com/ljharb/call-bind/commit/b6db284c36f8ccd195b88a6764fe84b7223a0da1) -- [meta] do not publish github action workflow files [`ec7fe46`](https://github.com/ljharb/call-bind/commit/ec7fe46e60cfa4764ee943d2755f5e5a366e578e) -- [Fix] preserve original function’s length when possible [`adbceaa`](https://github.com/ljharb/call-bind/commit/adbceaa3cac4b41ea78bb19d7ccdbaaf7e0bdadb) -- [Tests] gather coverage data on every job [`d69e23c`](https://github.com/ljharb/call-bind/commit/d69e23cc65f101ba1d4c19bb07fa8eb0ec624be8) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`2fd3586`](https://github.com/ljharb/call-bind/commit/2fd3586c5d47b335364c14293114c6b625ae1f71) -- [Deps] update `get-intrinsic` [`f23e931`](https://github.com/ljharb/call-bind/commit/f23e9318cc271c2add8bb38cfded85ee7baf8eee) -- [Deps] update `get-intrinsic` [`72d9f44`](https://github.com/ljharb/call-bind/commit/72d9f44e184465ba8dd3fb48260bbcff234985f2) -- [meta] fix FUNDING.yml [`e723573`](https://github.com/ljharb/call-bind/commit/e723573438c5a68dcec31fb5d96ea6b7e4a93be8) -- [eslint] ignore coverage output [`15e76d2`](https://github.com/ljharb/call-bind/commit/15e76d28a5f43e504696401e5b31ebb78ee1b532) -- [meta] add Automatic Rebase and Require Allow Edits workflows [`8fa4dab`](https://github.com/ljharb/call-bind/commit/8fa4dabb23ba3dd7bb92c9571c1241c08b56e4b6) - -## v1.0.0 - 2020-10-30 - -### Commits - -- Initial commit [`306cf98`](https://github.com/ljharb/call-bind/commit/306cf98c7ec9e7ef66b653ec152277ac1381eb50) -- Tests [`e10d0bb`](https://github.com/ljharb/call-bind/commit/e10d0bbdadc7a10ecedc9a1c035112d3e368b8df) -- Implementation [`43852ed`](https://github.com/ljharb/call-bind/commit/43852eda0f187327b7fad2423ca972149a52bd65) -- npm init [`408f860`](https://github.com/ljharb/call-bind/commit/408f860b773a2f610805fd3613d0d71bac1b6249) -- [meta] add Automatic Rebase and Require Allow Edits workflows [`fb349b2`](https://github.com/ljharb/call-bind/commit/fb349b2e48defbec8b5ec8a8395cc8f69f220b13) -- [meta] add `auto-changelog` [`c4001fc`](https://github.com/ljharb/call-bind/commit/c4001fc43031799ef908211c98d3b0fb2b60fde4) -- [meta] add "funding"; create `FUNDING.yml` [`d4d6d29`](https://github.com/ljharb/call-bind/commit/d4d6d2974a14bc2e98830468eda7fe6d6a776717) -- [Tests] add `npm run lint` [`dedfb98`](https://github.com/ljharb/call-bind/commit/dedfb98bd0ecefb08ddb9a94061bd10cde4332af) -- Only apps should have lockfiles [`54ac776`](https://github.com/ljharb/call-bind/commit/54ac77653db45a7361dc153d2f478e743f110650) -- [meta] add `safe-publish-latest` [`9ea8e43`](https://github.com/ljharb/call-bind/commit/9ea8e435b950ce9b705559cd651039f9bf40140f) diff --git a/node_modules/call-bind/LICENSE b/node_modules/call-bind/LICENSE deleted file mode 100644 index 48f05d0..0000000 --- a/node_modules/call-bind/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 Jordan Harband - -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/call-bind/README.md b/node_modules/call-bind/README.md deleted file mode 100644 index 48e9047..0000000 --- a/node_modules/call-bind/README.md +++ /dev/null @@ -1,64 +0,0 @@ -# call-bind [![Version Badge][npm-version-svg]][package-url] - -[![github actions][actions-image]][actions-url] -[![coverage][codecov-image]][codecov-url] -[![dependency status][deps-svg]][deps-url] -[![dev dependency status][dev-deps-svg]][dev-deps-url] -[![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] - -[![npm badge][npm-badge-png]][package-url] - -Robustly `.call.bind()` a function. - -## Getting started - -```sh -npm install --save call-bind -``` - -## Usage/Examples - -```js -const assert = require('assert'); -const callBind = require('call-bind'); -const callBound = require('call-bind/callBound'); - -function f(a, b) { - assert.equal(this, 1); - assert.equal(a, 2); - assert.equal(b, 3); - assert.equal(arguments.length, 2); -} - -const fBound = callBind(f); - -const slice = callBound('Array.prototype.slice'); - -delete Function.prototype.call; -delete Function.prototype.bind; - -fBound(1, 2, 3); - -assert.deepEqual(slice([1, 2, 3, 4], 1, -1), [2, 3]); -``` - -## Tests - -Clone the repo, `npm install`, and run `npm test` - -[package-url]: https://npmjs.org/package/call-bind -[npm-version-svg]: https://versionbadg.es/ljharb/call-bind.svg -[deps-svg]: https://david-dm.org/ljharb/call-bind.svg -[deps-url]: https://david-dm.org/ljharb/call-bind -[dev-deps-svg]: https://david-dm.org/ljharb/call-bind/dev-status.svg -[dev-deps-url]: https://david-dm.org/ljharb/call-bind#info=devDependencies -[npm-badge-png]: https://nodei.co/npm/call-bind.png?downloads=true&stars=true -[license-image]: https://img.shields.io/npm/l/call-bind.svg -[license-url]: LICENSE -[downloads-image]: https://img.shields.io/npm/dm/call-bind.svg -[downloads-url]: https://npm-stat.com/charts.html?package=call-bind -[codecov-image]: https://codecov.io/gh/ljharb/call-bind/branch/main/graphs/badge.svg -[codecov-url]: https://app.codecov.io/gh/ljharb/call-bind/ -[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/call-bind -[actions-url]: https://github.com/ljharb/call-bind/actions diff --git a/node_modules/call-bind/callBound.js b/node_modules/call-bind/callBound.js deleted file mode 100644 index 8374adf..0000000 --- a/node_modules/call-bind/callBound.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - -var GetIntrinsic = require('get-intrinsic'); - -var callBind = require('./'); - -var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf')); - -module.exports = function callBoundIntrinsic(name, allowMissing) { - var intrinsic = GetIntrinsic(name, !!allowMissing); - if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { - return callBind(intrinsic); - } - return intrinsic; -}; diff --git a/node_modules/call-bind/index.js b/node_modules/call-bind/index.js deleted file mode 100644 index 184ee2b..0000000 --- a/node_modules/call-bind/index.js +++ /dev/null @@ -1,44 +0,0 @@ -'use strict'; - -var bind = require('function-bind'); -var GetIntrinsic = require('get-intrinsic'); -var setFunctionLength = require('set-function-length'); - -var $TypeError = GetIntrinsic('%TypeError%'); -var $apply = GetIntrinsic('%Function.prototype.apply%'); -var $call = GetIntrinsic('%Function.prototype.call%'); -var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply); - -var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); -var $max = GetIntrinsic('%Math.max%'); - -if ($defineProperty) { - try { - $defineProperty({}, 'a', { value: 1 }); - } catch (e) { - // IE 8 has a broken defineProperty - $defineProperty = null; - } -} - -module.exports = function callBind(originalFunction) { - if (typeof originalFunction !== 'function') { - throw new $TypeError('a function is required'); - } - var func = $reflectApply(bind, $call, arguments); - return setFunctionLength( - func, - 1 + $max(0, originalFunction.length - (arguments.length - 1)), - true - ); -}; - -var applyBind = function applyBind() { - return $reflectApply(bind, $apply, arguments); -}; - -if ($defineProperty) { - $defineProperty(module.exports, 'apply', { value: applyBind }); -} else { - module.exports.apply = applyBind; -} diff --git a/node_modules/call-bind/package.json b/node_modules/call-bind/package.json deleted file mode 100644 index f946e1a..0000000 --- a/node_modules/call-bind/package.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "name": "call-bind", - "version": "1.0.5", - "description": "Robustly `.call.bind()` a function", - "main": "index.js", - "exports": { - ".": "./index.js", - "./callBound": "./callBound.js", - "./package.json": "./package.json" - }, - "scripts": { - "prepack": "npmignore --auto --commentLines=auto", - "prepublish": "not-in-publish || npm run prepublishOnly", - "prepublishOnly": "safe-publish-latest", - "lint": "eslint --ext=.js,.mjs .", - "postlint": "evalmd README.md", - "pretest": "npm run lint", - "tests-only": "nyc tape 'test/**/*.js'", - "test": "npm run tests-only", - "posttest": "aud --production", - "version": "auto-changelog && git add CHANGELOG.md", - "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/ljharb/call-bind.git" - }, - "keywords": [ - "javascript", - "ecmascript", - "es", - "js", - "callbind", - "callbound", - "call", - "bind", - "bound", - "call-bind", - "call-bound", - "function", - "es-abstract" - ], - "author": "Jordan Harband ", - "funding": { - "url": "https://github.com/sponsors/ljharb" - }, - "license": "MIT", - "bugs": { - "url": "https://github.com/ljharb/call-bind/issues" - }, - "homepage": "https://github.com/ljharb/call-bind#readme", - "devDependencies": { - "@ljharb/eslint-config": "^21.1.0", - "aud": "^2.0.3", - "auto-changelog": "^2.4.0", - "es-value-fixtures": "^1.4.2", - "eslint": "=8.8.0", - "evalmd": "^0.0.19", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-strict-mode": "^1.0.1", - "in-publish": "^2.0.1", - "npmignore": "^0.3.0", - "nyc": "^10.3.2", - "object-inspect": "^1.13.1", - "safe-publish-latest": "^2.0.0", - "tape": "^5.7.1" - }, - "dependencies": { - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.1", - "set-function-length": "^1.1.1" - }, - "testling": { - "files": "test/index.js" - }, - "auto-changelog": { - "output": "CHANGELOG.md", - "template": "keepachangelog", - "unreleased": false, - "commitLimit": false, - "backfillLimit": false, - "hideCredit": true - }, - "publishConfig": { - "ignore": [ - ".github/workflows" - ] - } -} diff --git a/node_modules/call-bind/test/callBound.js b/node_modules/call-bind/test/callBound.js deleted file mode 100644 index c32319d..0000000 --- a/node_modules/call-bind/test/callBound.js +++ /dev/null @@ -1,54 +0,0 @@ -'use strict'; - -var test = require('tape'); - -var callBound = require('../callBound'); - -test('callBound', function (t) { - // static primitive - t.equal(callBound('Array.length'), Array.length, 'Array.length yields itself'); - t.equal(callBound('%Array.length%'), Array.length, '%Array.length% yields itself'); - - // static non-function object - t.equal(callBound('Array.prototype'), Array.prototype, 'Array.prototype yields itself'); - t.equal(callBound('%Array.prototype%'), Array.prototype, '%Array.prototype% yields itself'); - t.equal(callBound('Array.constructor'), Array.constructor, 'Array.constructor yields itself'); - t.equal(callBound('%Array.constructor%'), Array.constructor, '%Array.constructor% yields itself'); - - // static function - t.equal(callBound('Date.parse'), Date.parse, 'Date.parse yields itself'); - t.equal(callBound('%Date.parse%'), Date.parse, '%Date.parse% yields itself'); - - // prototype primitive - t.equal(callBound('Error.prototype.message'), Error.prototype.message, 'Error.prototype.message yields itself'); - t.equal(callBound('%Error.prototype.message%'), Error.prototype.message, '%Error.prototype.message% yields itself'); - - // prototype function - t.notEqual(callBound('Object.prototype.toString'), Object.prototype.toString, 'Object.prototype.toString does not yield itself'); - t.notEqual(callBound('%Object.prototype.toString%'), Object.prototype.toString, '%Object.prototype.toString% does not yield itself'); - t.equal(callBound('Object.prototype.toString')(true), Object.prototype.toString.call(true), 'call-bound Object.prototype.toString calls into the original'); - t.equal(callBound('%Object.prototype.toString%')(true), Object.prototype.toString.call(true), 'call-bound %Object.prototype.toString% calls into the original'); - - t['throws']( - function () { callBound('does not exist'); }, - SyntaxError, - 'nonexistent intrinsic throws' - ); - t['throws']( - function () { callBound('does not exist', true); }, - SyntaxError, - 'allowMissing arg still throws for unknown intrinsic' - ); - - t.test('real but absent intrinsic', { skip: typeof WeakRef !== 'undefined' }, function (st) { - st['throws']( - function () { callBound('WeakRef'); }, - TypeError, - 'real but absent intrinsic throws' - ); - st.equal(callBound('WeakRef', true), undefined, 'allowMissing arg avoids exception'); - st.end(); - }); - - t.end(); -}); diff --git a/node_modules/call-bind/test/index.js b/node_modules/call-bind/test/index.js deleted file mode 100644 index 1fd4668..0000000 --- a/node_modules/call-bind/test/index.js +++ /dev/null @@ -1,80 +0,0 @@ -'use strict'; - -var callBind = require('../'); -var bind = require('function-bind'); -var gOPD = require('gopd'); -var hasStrictMode = require('has-strict-mode')(); -var forEach = require('for-each'); -var inspect = require('object-inspect'); -var v = require('es-value-fixtures'); - -var test = require('tape'); - -/* - * older engines have length nonconfigurable - * in io.js v3, it is configurable except on bound functions, hence the .bind() - */ -var functionsHaveConfigurableLengths = !!( - gOPD - && Object.getOwnPropertyDescriptor - && Object.getOwnPropertyDescriptor(bind.call(function () {}), 'length').configurable -); - -test('callBind', function (t) { - forEach(v.nonFunctions, function (nonFunction) { - t['throws']( - function () { callBind(nonFunction); }, - TypeError, - inspect(nonFunction) + ' is not a function' - ); - }); - - var sentinel = { sentinel: true }; - var func = function (a, b) { - // eslint-disable-next-line no-invalid-this - return [!hasStrictMode && this === global ? undefined : this, a, b]; - }; - t.equal(func.length, 2, 'original function length is 2'); - t.deepEqual(func(), [undefined, undefined, undefined], 'unbound func with too few args'); - t.deepEqual(func(1, 2), [undefined, 1, 2], 'unbound func with right args'); - t.deepEqual(func(1, 2, 3), [undefined, 1, 2], 'unbound func with too many args'); - - var bound = callBind(func); - t.equal(bound.length, func.length + 1, 'function length is preserved', { skip: !functionsHaveConfigurableLengths }); - t.deepEqual(bound(), [undefined, undefined, undefined], 'bound func with too few args'); - t.deepEqual(bound(1, 2), [hasStrictMode ? 1 : Object(1), 2, undefined], 'bound func with right args'); - t.deepEqual(bound(1, 2, 3), [hasStrictMode ? 1 : Object(1), 2, 3], 'bound func with too many args'); - - var boundR = callBind(func, sentinel); - t.equal(boundR.length, func.length, 'function length is preserved', { skip: !functionsHaveConfigurableLengths }); - t.deepEqual(boundR(), [sentinel, undefined, undefined], 'bound func with receiver, with too few args'); - t.deepEqual(boundR(1, 2), [sentinel, 1, 2], 'bound func with receiver, with right args'); - t.deepEqual(boundR(1, 2, 3), [sentinel, 1, 2], 'bound func with receiver, with too many args'); - - var boundArg = callBind(func, sentinel, 1); - t.equal(boundArg.length, func.length - 1, 'function length is preserved', { skip: !functionsHaveConfigurableLengths }); - t.deepEqual(boundArg(), [sentinel, 1, undefined], 'bound func with receiver and arg, with too few args'); - t.deepEqual(boundArg(2), [sentinel, 1, 2], 'bound func with receiver and arg, with right arg'); - t.deepEqual(boundArg(2, 3), [sentinel, 1, 2], 'bound func with receiver and arg, with too many args'); - - t.test('callBind.apply', function (st) { - var aBound = callBind.apply(func); - st.deepEqual(aBound(sentinel), [sentinel, undefined, undefined], 'apply-bound func with no args'); - st.deepEqual(aBound(sentinel, [1], 4), [sentinel, 1, undefined], 'apply-bound func with too few args'); - st.deepEqual(aBound(sentinel, [1, 2], 4), [sentinel, 1, 2], 'apply-bound func with right args'); - - var aBoundArg = callBind.apply(func); - st.deepEqual(aBoundArg(sentinel, [1, 2, 3], 4), [sentinel, 1, 2], 'apply-bound func with too many args'); - st.deepEqual(aBoundArg(sentinel, [1, 2], 4), [sentinel, 1, 2], 'apply-bound func with right args'); - st.deepEqual(aBoundArg(sentinel, [1], 4), [sentinel, 1, undefined], 'apply-bound func with too few args'); - - var aBoundR = callBind.apply(func, sentinel); - st.deepEqual(aBoundR([1, 2, 3], 4), [sentinel, 1, 2], 'apply-bound func with receiver and too many args'); - st.deepEqual(aBoundR([1, 2], 4), [sentinel, 1, 2], 'apply-bound func with receiver and right args'); - st.deepEqual(aBoundR([1], 4), [sentinel, 1, undefined], 'apply-bound func with receiver and too few args'); - - st.end(); - }); - - t.end(); -}); diff --git a/node_modules/chalk/index.d.ts b/node_modules/chalk/index.d.ts deleted file mode 100644 index 9cd88f3..0000000 --- a/node_modules/chalk/index.d.ts +++ /dev/null @@ -1,415 +0,0 @@ -/** -Basic foreground colors. - -[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support) -*/ -declare type ForegroundColor = - | 'black' - | 'red' - | 'green' - | 'yellow' - | 'blue' - | 'magenta' - | 'cyan' - | 'white' - | 'gray' - | 'grey' - | 'blackBright' - | 'redBright' - | 'greenBright' - | 'yellowBright' - | 'blueBright' - | 'magentaBright' - | 'cyanBright' - | 'whiteBright'; - -/** -Basic background colors. - -[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support) -*/ -declare type BackgroundColor = - | 'bgBlack' - | 'bgRed' - | 'bgGreen' - | 'bgYellow' - | 'bgBlue' - | 'bgMagenta' - | 'bgCyan' - | 'bgWhite' - | 'bgGray' - | 'bgGrey' - | 'bgBlackBright' - | 'bgRedBright' - | 'bgGreenBright' - | 'bgYellowBright' - | 'bgBlueBright' - | 'bgMagentaBright' - | 'bgCyanBright' - | 'bgWhiteBright'; - -/** -Basic colors. - -[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support) -*/ -declare type Color = ForegroundColor | BackgroundColor; - -declare type Modifiers = - | 'reset' - | 'bold' - | 'dim' - | 'italic' - | 'underline' - | 'inverse' - | 'hidden' - | 'strikethrough' - | 'visible'; - -declare namespace chalk { - /** - Levels: - - `0` - All colors disabled. - - `1` - Basic 16 colors support. - - `2` - ANSI 256 colors support. - - `3` - Truecolor 16 million colors support. - */ - type Level = 0 | 1 | 2 | 3; - - interface Options { - /** - Specify the color support for Chalk. - - By default, color support is automatically detected based on the environment. - - Levels: - - `0` - All colors disabled. - - `1` - Basic 16 colors support. - - `2` - ANSI 256 colors support. - - `3` - Truecolor 16 million colors support. - */ - level?: Level; - } - - /** - Return a new Chalk instance. - */ - type Instance = new (options?: Options) => Chalk; - - /** - Detect whether the terminal supports color. - */ - interface ColorSupport { - /** - The color level used by Chalk. - */ - level: Level; - - /** - Return whether Chalk supports basic 16 colors. - */ - hasBasic: boolean; - - /** - Return whether Chalk supports ANSI 256 colors. - */ - has256: boolean; - - /** - Return whether Chalk supports Truecolor 16 million colors. - */ - has16m: boolean; - } - - interface ChalkFunction { - /** - Use a template string. - - @remarks Template literals are unsupported for nested calls (see [issue #341](https://github.com/chalk/chalk/issues/341)) - - @example - ``` - import chalk = require('chalk'); - - log(chalk` - CPU: {red ${cpu.totalPercent}%} - RAM: {green ${ram.used / ram.total * 100}%} - DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%} - `); - ``` - - @example - ``` - import chalk = require('chalk'); - - log(chalk.red.bgBlack`2 + 3 = {bold ${2 + 3}}`) - ``` - */ - (text: TemplateStringsArray, ...placeholders: unknown[]): string; - - (...text: unknown[]): string; - } - - interface Chalk extends ChalkFunction { - /** - Return a new Chalk instance. - */ - Instance: Instance; - - /** - The color support for Chalk. - - By default, color support is automatically detected based on the environment. - - Levels: - - `0` - All colors disabled. - - `1` - Basic 16 colors support. - - `2` - ANSI 256 colors support. - - `3` - Truecolor 16 million colors support. - */ - level: Level; - - /** - Use HEX value to set text color. - - @param color - Hexadecimal value representing the desired color. - - @example - ``` - import chalk = require('chalk'); - - chalk.hex('#DEADED'); - ``` - */ - hex(color: string): Chalk; - - /** - Use keyword color value to set text color. - - @param color - Keyword value representing the desired color. - - @example - ``` - import chalk = require('chalk'); - - chalk.keyword('orange'); - ``` - */ - keyword(color: string): Chalk; - - /** - Use RGB values to set text color. - */ - rgb(red: number, green: number, blue: number): Chalk; - - /** - Use HSL values to set text color. - */ - hsl(hue: number, saturation: number, lightness: number): Chalk; - - /** - Use HSV values to set text color. - */ - hsv(hue: number, saturation: number, value: number): Chalk; - - /** - Use HWB values to set text color. - */ - hwb(hue: number, whiteness: number, blackness: number): Chalk; - - /** - Use a [Select/Set Graphic Rendition](https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters) (SGR) [color code number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) to set text color. - - 30 <= code && code < 38 || 90 <= code && code < 98 - For example, 31 for red, 91 for redBright. - */ - ansi(code: number): Chalk; - - /** - Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color. - */ - ansi256(index: number): Chalk; - - /** - Use HEX value to set background color. - - @param color - Hexadecimal value representing the desired color. - - @example - ``` - import chalk = require('chalk'); - - chalk.bgHex('#DEADED'); - ``` - */ - bgHex(color: string): Chalk; - - /** - Use keyword color value to set background color. - - @param color - Keyword value representing the desired color. - - @example - ``` - import chalk = require('chalk'); - - chalk.bgKeyword('orange'); - ``` - */ - bgKeyword(color: string): Chalk; - - /** - Use RGB values to set background color. - */ - bgRgb(red: number, green: number, blue: number): Chalk; - - /** - Use HSL values to set background color. - */ - bgHsl(hue: number, saturation: number, lightness: number): Chalk; - - /** - Use HSV values to set background color. - */ - bgHsv(hue: number, saturation: number, value: number): Chalk; - - /** - Use HWB values to set background color. - */ - bgHwb(hue: number, whiteness: number, blackness: number): Chalk; - - /** - Use a [Select/Set Graphic Rendition](https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters) (SGR) [color code number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) to set background color. - - 30 <= code && code < 38 || 90 <= code && code < 98 - For example, 31 for red, 91 for redBright. - Use the foreground code, not the background code (for example, not 41, nor 101). - */ - bgAnsi(code: number): Chalk; - - /** - Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set background color. - */ - bgAnsi256(index: number): Chalk; - - /** - Modifier: Resets the current color chain. - */ - readonly reset: Chalk; - - /** - Modifier: Make text bold. - */ - readonly bold: Chalk; - - /** - Modifier: Emitting only a small amount of light. - */ - readonly dim: Chalk; - - /** - Modifier: Make text italic. (Not widely supported) - */ - readonly italic: Chalk; - - /** - Modifier: Make text underline. (Not widely supported) - */ - readonly underline: Chalk; - - /** - Modifier: Inverse background and foreground colors. - */ - readonly inverse: Chalk; - - /** - Modifier: Prints the text, but makes it invisible. - */ - readonly hidden: Chalk; - - /** - Modifier: Puts a horizontal line through the center of the text. (Not widely supported) - */ - readonly strikethrough: Chalk; - - /** - Modifier: Prints the text only when Chalk has a color support level > 0. - Can be useful for things that are purely cosmetic. - */ - readonly visible: Chalk; - - readonly black: Chalk; - readonly red: Chalk; - readonly green: Chalk; - readonly yellow: Chalk; - readonly blue: Chalk; - readonly magenta: Chalk; - readonly cyan: Chalk; - readonly white: Chalk; - - /* - Alias for `blackBright`. - */ - readonly gray: Chalk; - - /* - Alias for `blackBright`. - */ - readonly grey: Chalk; - - readonly blackBright: Chalk; - readonly redBright: Chalk; - readonly greenBright: Chalk; - readonly yellowBright: Chalk; - readonly blueBright: Chalk; - readonly magentaBright: Chalk; - readonly cyanBright: Chalk; - readonly whiteBright: Chalk; - - readonly bgBlack: Chalk; - readonly bgRed: Chalk; - readonly bgGreen: Chalk; - readonly bgYellow: Chalk; - readonly bgBlue: Chalk; - readonly bgMagenta: Chalk; - readonly bgCyan: Chalk; - readonly bgWhite: Chalk; - - /* - Alias for `bgBlackBright`. - */ - readonly bgGray: Chalk; - - /* - Alias for `bgBlackBright`. - */ - readonly bgGrey: Chalk; - - readonly bgBlackBright: Chalk; - readonly bgRedBright: Chalk; - readonly bgGreenBright: Chalk; - readonly bgYellowBright: Chalk; - readonly bgBlueBright: Chalk; - readonly bgMagentaBright: Chalk; - readonly bgCyanBright: Chalk; - readonly bgWhiteBright: Chalk; - } -} - -/** -Main Chalk object that allows to chain styles together. -Call the last one as a method with a string argument. -Order doesn't matter, and later styles take precedent in case of a conflict. -This simply means that `chalk.red.yellow.green` is equivalent to `chalk.green`. -*/ -declare const chalk: chalk.Chalk & chalk.ChalkFunction & { - supportsColor: chalk.ColorSupport | false; - Level: chalk.Level; - Color: Color; - ForegroundColor: ForegroundColor; - BackgroundColor: BackgroundColor; - Modifiers: Modifiers; - stderr: chalk.Chalk & {supportsColor: chalk.ColorSupport | false}; -}; - -export = chalk; diff --git a/node_modules/chalk/license b/node_modules/chalk/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/chalk/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/chalk/package.json b/node_modules/chalk/package.json deleted file mode 100644 index 47c23f2..0000000 --- a/node_modules/chalk/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "name": "chalk", - "version": "4.1.2", - "description": "Terminal string styling done right", - "license": "MIT", - "repository": "chalk/chalk", - "funding": "https://github.com/chalk/chalk?sponsor=1", - "main": "source", - "engines": { - "node": ">=10" - }, - "scripts": { - "test": "xo && nyc ava && tsd", - "bench": "matcha benchmark.js" - }, - "files": [ - "source", - "index.d.ts" - ], - "keywords": [ - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "str", - "ansi", - "style", - "styles", - "tty", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "devDependencies": { - "ava": "^2.4.0", - "coveralls": "^3.0.7", - "execa": "^4.0.0", - "import-fresh": "^3.1.0", - "matcha": "^0.7.0", - "nyc": "^15.0.0", - "resolve-from": "^5.0.0", - "tsd": "^0.7.4", - "xo": "^0.28.2" - }, - "xo": { - "rules": { - "unicorn/prefer-string-slice": "off", - "unicorn/prefer-includes": "off", - "@typescript-eslint/member-ordering": "off", - "no-redeclare": "off", - "unicorn/string-content": "off", - "unicorn/better-regex": "off" - } - } -} diff --git a/node_modules/chalk/readme.md b/node_modules/chalk/readme.md deleted file mode 100644 index a055d21..0000000 --- a/node_modules/chalk/readme.md +++ /dev/null @@ -1,341 +0,0 @@ -

-
-
- Chalk -
-
-
-

- -> Terminal string styling done right - -[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) [![Coverage Status](https://coveralls.io/repos/github/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/github/chalk/chalk?branch=master) [![npm dependents](https://badgen.net/npm/dependents/chalk)](https://www.npmjs.com/package/chalk?activeTab=dependents) [![Downloads](https://badgen.net/npm/dt/chalk)](https://www.npmjs.com/package/chalk) [![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo) ![TypeScript-ready](https://img.shields.io/npm/types/chalk.svg) [![run on repl.it](https://repl.it/badge/github/chalk/chalk)](https://repl.it/github/chalk/chalk) - - - -
- ---- - - - ---- - -
- -## Highlights - -- Expressive API -- Highly performant -- Ability to nest styles -- [256/Truecolor color support](#256-and-truecolor-color-support) -- Auto-detects color support -- Doesn't extend `String.prototype` -- Clean and focused -- Actively maintained -- [Used by ~50,000 packages](https://www.npmjs.com/browse/depended/chalk) as of January 1, 2020 - -## Install - -```console -$ npm install chalk -``` - -## Usage - -```js -const chalk = require('chalk'); - -console.log(chalk.blue('Hello world!')); -``` - -Chalk comes with an easy to use composable API where you just chain and nest the styles you want. - -```js -const chalk = require('chalk'); -const log = console.log; - -// Combine styled and normal strings -log(chalk.blue('Hello') + ' World' + chalk.red('!')); - -// Compose multiple styles using the chainable API -log(chalk.blue.bgRed.bold('Hello world!')); - -// Pass in multiple arguments -log(chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz')); - -// Nest styles -log(chalk.red('Hello', chalk.underline.bgBlue('world') + '!')); - -// Nest styles of the same type even (color, underline, background) -log(chalk.green( - 'I am a green line ' + - chalk.blue.underline.bold('with a blue substring') + - ' that becomes green again!' -)); - -// ES2015 template literal -log(` -CPU: ${chalk.red('90%')} -RAM: ${chalk.green('40%')} -DISK: ${chalk.yellow('70%')} -`); - -// ES2015 tagged template literal -log(chalk` -CPU: {red ${cpu.totalPercent}%} -RAM: {green ${ram.used / ram.total * 100}%} -DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%} -`); - -// Use RGB colors in terminal emulators that support it. -log(chalk.keyword('orange')('Yay for orange colored text!')); -log(chalk.rgb(123, 45, 67).underline('Underlined reddish color')); -log(chalk.hex('#DEADED').bold('Bold gray!')); -``` - -Easily define your own themes: - -```js -const chalk = require('chalk'); - -const error = chalk.bold.red; -const warning = chalk.keyword('orange'); - -console.log(error('Error!')); -console.log(warning('Warning!')); -``` - -Take advantage of console.log [string substitution](https://nodejs.org/docs/latest/api/console.html#console_console_log_data_args): - -```js -const name = 'Sindre'; -console.log(chalk.green('Hello %s'), name); -//=> 'Hello Sindre' -``` - -## API - -### chalk.`