From 5b0d68d66f87569bc18f5f115b3cdd38b74e7a37 Mon Sep 17 00:00:00 2001 From: TheCoreDev Date: Thu, 23 Nov 2023 16:13:50 +0100 Subject: [PATCH] Revert "Changements dans les modules (nouvelle version Express, mysql, ..)" This reverts commit bdab79550619efd83b2be47db3c5cb16a4b09af1. --- .gitignore | 2 - app.js | 17 +- node_modules/.package-lock.json | 687 +-- .../@eonasdan/tempus-dominus/README.md | 31 - .../dist/css/tempus-dominus.css | 700 --- .../dist/css/tempus-dominus.css.map | 1 - .../dist/css/tempus-dominus.min.css | 1 - .../tempus-dominus/dist/js/jQuery-provider.js | 154 - .../dist/js/jQuery-provider.min.js | 6 - .../dist/js/tempus-dominus.esm.js | 4673 ---------------- .../dist/js/tempus-dominus.esm.js.map | 1 - .../dist/js/tempus-dominus.esm.min.js | 6 - .../tempus-dominus/dist/js/tempus-dominus.js | 4691 ----------------- .../dist/js/tempus-dominus.js.map | 1 - .../dist/js/tempus-dominus.min.js | 6 - .../tempus-dominus/dist/locales/ar-SA.js | 47 - .../tempus-dominus/dist/locales/ar.js | 47 - .../tempus-dominus/dist/locales/ca.js | 47 - .../tempus-dominus/dist/locales/cs.js | 47 - .../tempus-dominus/dist/locales/de.js | 47 - .../tempus-dominus/dist/locales/es.js | 47 - .../tempus-dominus/dist/locales/fi.js | 47 - .../tempus-dominus/dist/locales/fr.js | 50 - .../tempus-dominus/dist/locales/hy.js | 47 - .../tempus-dominus/dist/locales/it.js | 47 - .../tempus-dominus/dist/locales/nl.js | 47 - .../tempus-dominus/dist/locales/pl.js | 47 - .../tempus-dominus/dist/locales/ro.js | 47 - .../tempus-dominus/dist/locales/ru.js | 47 - .../tempus-dominus/dist/locales/sl.js | 47 - .../tempus-dominus/dist/locales/tr.js | 47 - .../tempus-dominus/dist/plugins/bi-one.js | 22 - .../dist/plugins/customDateFormat.js | 8 - .../dist/plugins/examples/custom-paint-job.js | 17 - .../dist/plugins/examples/sample.js | 30 - .../tempus-dominus/dist/plugins/fa-five.js | 22 - .../dist/plugins/moment-parse.js | 20 - .../@eonasdan/tempus-dominus/package.json | 115 - .../tempus-dominus/src/js/actions.ts | 379 -- .../@eonasdan/tempus-dominus/src/js/dates.ts | 284 - .../tempus-dominus/src/js/datetime.ts | 1039 ---- .../src/js/display/calendar/date-display.ts | 338 -- .../src/js/display/calendar/decade-display.ts | 130 - .../src/js/display/calendar/month-display.ts | 105 - .../src/js/display/calendar/year-display.ts | 112 - .../tempus-dominus/src/js/display/collapse.ts | 134 - .../tempus-dominus/src/js/display/index.ts | 849 --- .../src/js/display/time/hour-display.ts | 68 - .../src/js/display/time/minute-display.ts | 74 - .../src/js/display/time/second-display.ts | 66 - .../src/js/display/time/time-display.ts | 322 -- .../tempus-dominus/src/js/locales/ar-SA.ts | 45 - .../tempus-dominus/src/js/locales/ar.ts | 45 - .../tempus-dominus/src/js/locales/ca.ts | 45 - .../tempus-dominus/src/js/locales/cs.ts | 45 - .../tempus-dominus/src/js/locales/de.ts | 45 - .../tempus-dominus/src/js/locales/es.ts | 45 - .../tempus-dominus/src/js/locales/fi.ts | 45 - .../tempus-dominus/src/js/locales/fr.ts | 48 - .../tempus-dominus/src/js/locales/hy.ts | 45 - .../tempus-dominus/src/js/locales/it.ts | 45 - .../tempus-dominus/src/js/locales/nl.ts | 45 - .../tempus-dominus/src/js/locales/pl.ts | 45 - .../tempus-dominus/src/js/locales/ro.ts | 45 - .../tempus-dominus/src/js/locales/ru.ts | 45 - .../tempus-dominus/src/js/locales/sl.ts | 45 - .../tempus-dominus/src/js/locales/tr.ts | 45 - .../src/js/plugins/bi-one/index.ts | 21 - .../src/js/plugins/customDateFormat/index.ts | 5 - .../js/plugins/examples/custom-paint-job.ts | 17 - .../src/js/plugins/examples/sample.ts | 28 - .../src/js/plugins/fa-five/index.ts | 21 - .../src/js/plugins/moment-parse/index.ts | 20 - .../tempus-dominus/src/js/tempus-dominus.ts | 677 --- .../src/js/utilities/action-types.ts | 29 - .../src/js/utilities/calendar-modes.ts | 37 - .../utilities/default-format-localization.ts | 22 - .../src/js/utilities/default-options.ts | 110 - .../tempus-dominus/src/js/utilities/errors.ts | 184 - .../src/js/utilities/event-emitter.ts | 45 - .../src/js/utilities/event-types.ts | 43 - .../src/js/utilities/namespace.ts | 294 -- .../src/js/utilities/optionConverter.ts | 387 -- .../src/js/utilities/optionProcessor.ts | 184 - .../src/js/utilities/options.ts | 112 - .../src/js/utilities/optionsStore.ts | 47 - .../src/js/utilities/service-locator.ts | 19 - .../src/js/utilities/typeChecker.ts | 108 - .../src/js/utilities/view-mode.ts | 9 - .../tempus-dominus/src/js/validation.ts | 223 - .../tempus-dominus/src/scss/_variables.scss | 35 - .../src/scss/tempus-dominus.scss | 485 -- .../tempus-dominus/types/actions.d.ts | 37 - .../@eonasdan/tempus-dominus/types/dates.d.ts | 79 - .../tempus-dominus/types/datetime.d.ts | 257 - .../types/display/calendar/date-display.d.ts | 30 - .../display/calendar/decade-display.d.ts | 22 - .../types/display/calendar/month-display.d.ts | 20 - .../types/display/calendar/year-display.d.ts | 22 - .../types/display/collapse.d.ts | 36 - .../tempus-dominus/types/display/index.d.ts | 148 - .../types/display/time/hour-display.d.ts | 19 - .../types/display/time/minute-display.d.ts | 19 - .../types/display/time/second-display.d.ts | 19 - .../types/display/time/time-display.d.ts | 26 - .../tempus-dominus/types/locales/ar-SA.d.ts | 46 - .../tempus-dominus/types/locales/ar.d.ts | 46 - .../tempus-dominus/types/locales/ca.d.ts | 46 - .../tempus-dominus/types/locales/cs.d.ts | 46 - .../tempus-dominus/types/locales/de.d.ts | 46 - .../tempus-dominus/types/locales/es.d.ts | 46 - .../tempus-dominus/types/locales/fi.d.ts | 46 - .../tempus-dominus/types/locales/fr.d.ts | 46 - .../tempus-dominus/types/locales/hy.d.ts | 46 - .../tempus-dominus/types/locales/it.d.ts | 46 - .../tempus-dominus/types/locales/nl.d.ts | 46 - .../tempus-dominus/types/locales/pl.d.ts | 46 - .../tempus-dominus/types/locales/ro.d.ts | 46 - .../tempus-dominus/types/locales/ru.d.ts | 46 - .../tempus-dominus/types/locales/sl.d.ts | 46 - .../tempus-dominus/types/locales/tr.d.ts | 46 - .../tempus-dominus/types/plugins/bi-one.d.ts | 14 - .../types/plugins/customDateFormat.d.ts | 2 - .../tempus-dominus/types/plugins/fa-five.d.ts | 14 - .../types/plugins/moment-parse.d.ts | 2 - .../tempus-dominus/types/tempus-dominus.d.ts | 212 - .../types/utilities/action-types.d.ts | 28 - .../types/utilities/calendar-modes.d.ts | 9 - .../default-format-localization.d.ts | 15 - .../types/utilities/default-options.d.ts | 46 - .../types/utilities/errors.d.ts | 84 - .../types/utilities/event-emitter.d.ts | 23 - .../types/utilities/event-types.d.ts | 37 - .../types/utilities/namespace.d.ts | 222 - .../types/utilities/optionConverter.d.ts | 67 - .../types/utilities/optionProcessor.d.ts | 11 - .../types/utilities/options.d.ts | 116 - .../types/utilities/optionsStore.d.ts | 23 - .../types/utilities/service-locator.d.ts | 8 - .../types/utilities/typeChecker.d.ts | 33 - .../types/utilities/view-mode.d.ts | 8 - .../tempus-dominus/types/validation.d.ts | 47 - node_modules/accepts/HISTORY.md | 73 + node_modules/accepts/README.md | 39 +- node_modules/accepts/index.js | 29 +- node_modules/accepts/package.json | 23 +- node_modules/array-flatten/array-flatten.js | 15 +- node_modules/array-flatten/package.json | 2 +- node_modules/bignumber.js/CHANGELOG.md | 266 + .../depd/LICENSE => bignumber.js/LICENCE} | 45 +- node_modules/bignumber.js/README.md | 268 + node_modules/bignumber.js/bignumber.d.ts | 1829 +++++++ node_modules/bignumber.js/bignumber.js | 2902 ++++++++++ node_modules/bignumber.js/bignumber.min.js | 1 + .../bignumber.js/bignumber.min.js.map | 1 + node_modules/bignumber.js/bignumber.mjs | 2888 ++++++++++ node_modules/bignumber.js/doc/API.html | 2237 ++++++++ node_modules/bignumber.js/package.json | 40 + node_modules/body-parser/HISTORY.md | 8 - node_modules/body-parser/README.md | 21 +- node_modules/body-parser/lib/types/json.js | 19 +- node_modules/body-parser/package.json | 16 +- node_modules/content-disposition/HISTORY.md | 20 + node_modules/content-disposition/LICENSE | 2 +- node_modules/content-disposition/README.md | 23 +- node_modules/content-disposition/index.js | 119 +- node_modules/content-disposition/package.json | 26 +- node_modules/cookie/HISTORY.md | 142 + node_modules/cookie/LICENSE | 47 +- node_modules/cookie/README.md | 366 +- node_modules/cookie/SECURITY.md | 25 + node_modules/cookie/index.js | 386 +- node_modules/cookie/package.json | 73 +- .../statuses => core-util-is}/LICENSE | 19 +- node_modules/core-util-is/README.md | 3 + node_modules/core-util-is/lib/util.js | 107 + node_modules/core-util-is/package.json | 38 + node_modules/denque/CHANGELOG.md | 29 - node_modules/denque/LICENSE | 201 - node_modules/denque/README.md | 77 - node_modules/denque/index.d.ts | 47 - node_modules/denque/index.js | 481 -- node_modules/denque/package.json | 58 - node_modules/encodeurl/HISTORY.md | 14 + .../node_modules/depd => encodeurl}/LICENSE | 2 +- node_modules/encodeurl/README.md | 128 + node_modules/encodeurl/index.js | 60 + node_modules/encodeurl/package.json | 40 + node_modules/escape-html/LICENSE | 2 + node_modules/escape-html/Readme.md | 32 +- node_modules/escape-html/index.js | 65 +- node_modules/escape-html/package.json | 13 +- node_modules/etag/HISTORY.md | 12 + node_modules/etag/LICENSE | 2 +- node_modules/etag/README.md | 102 +- node_modules/etag/index.js | 27 +- node_modules/etag/package.json | 21 +- node_modules/express/History.md | 634 ++- node_modules/express/Readme.md | 114 +- node_modules/express/lib/application.js | 142 +- node_modules/express/lib/express.js | 34 +- node_modules/express/lib/middleware/init.js | 43 + node_modules/express/lib/middleware/query.js | 47 + node_modules/express/lib/request.js | 176 +- node_modules/express/lib/response.js | 356 +- 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 | 102 +- node_modules/express/lib/view.js | 38 +- .../express/node_modules/debug/.jshintrc | 3 - .../express/node_modules/debug/.npmignore | 6 - .../express/node_modules/debug/History.md | 195 - .../express/node_modules/debug/Makefile | 36 - .../express/node_modules/debug/Readme.md | 188 - .../express/node_modules/debug/bower.json | 28 - .../express/node_modules/debug/browser.js | 168 - .../express/node_modules/debug/component.json | 19 - .../express/node_modules/debug/debug.js | 197 - .../express/node_modules/debug/node.js | 209 - .../express/node_modules/debug/package.json | 34 - .../express/node_modules/depd/History.md | 75 - .../express/node_modules/depd/Readme.md | 274 - .../express/node_modules/depd/index.js | 529 -- .../depd/lib/compat/buffer-concat.js | 33 - .../depd/lib/compat/callsite-tostring.js | 101 - .../node_modules/depd/lib/compat/index.js | 69 - .../express/node_modules/depd/package.json | 34 - .../express/node_modules/ms/.npmignore | 5 - .../express/node_modules/ms/History.md | 66 - node_modules/express/node_modules/ms/LICENSE | 20 - .../express/node_modules/ms/README.md | 35 - node_modules/express/node_modules/ms/index.js | 125 - .../express/node_modules/ms/package.json | 20 - .../node_modules/on-finished/HISTORY.md | 88 - .../express/node_modules/on-finished/LICENSE | 23 - .../node_modules/on-finished/README.md | 154 - .../express/node_modules/on-finished/index.js | 196 - .../node_modules/on-finished/package.json | 31 - .../node_modules/path-is-absolute/index.js | 20 - .../node_modules/path-is-absolute/license | 21 - .../path-is-absolute/package.json | 40 - .../node_modules/path-is-absolute/readme.md | 51 - .../express/node_modules/qs/.eslintignore | 1 - .../express/node_modules/qs/.npmignore | 19 - .../express/node_modules/qs/.travis.yml | 6 - .../express/node_modules/qs/CHANGELOG.md | 88 - .../express/node_modules/qs/CONTRIBUTING.md | 1 - node_modules/express/node_modules/qs/LICENSE | 28 - .../express/node_modules/qs/README.md | 317 -- .../express/node_modules/qs/bower.json | 22 - .../express/node_modules/qs/lib/index.js | 15 - .../express/node_modules/qs/lib/parse.js | 186 - .../express/node_modules/qs/lib/stringify.js | 121 - .../express/node_modules/qs/lib/utils.js | 190 - .../express/node_modules/qs/package.json | 27 - .../express/node_modules/qs/test/parse.js | 478 -- .../express/node_modules/qs/test/stringify.js | 259 - .../express/node_modules/qs/test/utils.js | 28 - node_modules/express/package.json | 100 +- node_modules/finalhandler/HISTORY.md | 105 + node_modules/finalhandler/LICENSE | 2 +- node_modules/finalhandler/README.md | 28 +- node_modules/finalhandler/SECURITY.md | 25 + node_modules/finalhandler/index.js | 255 +- .../finalhandler/node_modules/debug/.jshintrc | 3 - .../node_modules/debug/.npmignore | 6 - .../node_modules/debug/History.md | 195 - .../finalhandler/node_modules/debug/Makefile | 36 - .../finalhandler/node_modules/debug/Readme.md | 188 - .../node_modules/debug/bower.json | 28 - .../node_modules/debug/browser.js | 168 - .../node_modules/debug/component.json | 19 - .../finalhandler/node_modules/debug/debug.js | 197 - .../finalhandler/node_modules/debug/node.js | 209 - .../node_modules/debug/package.json | 34 - .../finalhandler/node_modules/ms/.npmignore | 5 - .../finalhandler/node_modules/ms/History.md | 66 - .../finalhandler/node_modules/ms/LICENSE | 20 - .../finalhandler/node_modules/ms/README.md | 35 - .../finalhandler/node_modules/ms/index.js | 125 - .../finalhandler/node_modules/ms/package.json | 20 - .../node_modules/on-finished/HISTORY.md | 88 - .../node_modules/on-finished/LICENSE | 23 - .../node_modules/on-finished/README.md | 154 - .../node_modules/on-finished/index.js | 196 - .../node_modules/on-finished/package.json | 31 - node_modules/finalhandler/package.json | 33 +- node_modules/forwarded/HISTORY.md | 5 + node_modules/forwarded/README.md | 6 +- node_modules/forwarded/index.js | 16 +- node_modules/forwarded/package.json | 24 +- node_modules/fresh/HISTORY.md | 32 + node_modules/fresh/LICENSE | 1 + node_modules/fresh/README.md | 85 +- node_modules/fresh/index.js | 152 +- node_modules/fresh/package.json | 15 +- node_modules/generate-function/README.md | 89 - node_modules/generate-function/example.js | 27 - node_modules/generate-function/index.js | 181 - node_modules/generate-function/package.json | 32 - node_modules/generate-function/test.js | 49 - node_modules/ipaddr.js/.travis.yml | 10 - node_modules/ipaddr.js/Cakefile | 18 - node_modules/ipaddr.js/LICENSE | 4 +- node_modules/ipaddr.js/README.md | 80 +- node_modules/ipaddr.js/bower.json | 29 - node_modules/ipaddr.js/ipaddr.min.js | 2 +- node_modules/ipaddr.js/lib/ipaddr.js | 464 +- node_modules/ipaddr.js/lib/ipaddr.js.d.ts | 68 + node_modules/ipaddr.js/package.json | 28 +- node_modules/ipaddr.js/src/ipaddr.coffee | 396 -- .../ipaddr.js/test/ipaddr.test.coffee | 282 - node_modules/is-property/.npmignore | 17 - node_modules/is-property/README.md | 28 - node_modules/is-property/is-property.js | 5 - node_modules/is-property/package.json | 36 - .../{ipaddr.js => isarray}/.npmignore | 1 - .../.travis.yml | 1 + node_modules/isarray/Makefile | 6 + node_modules/isarray/README.md | 60 + node_modules/isarray/component.json | 19 + node_modules/isarray/index.js | 5 + node_modules/isarray/package.json | 45 + node_modules/isarray/test.js | 20 + node_modules/long/LICENSE | 202 - node_modules/long/README.md | 280 - node_modules/long/index.d.ts | 457 -- node_modules/long/index.js | 1467 ------ node_modules/long/package.json | 50 - node_modules/long/umd/index.d.ts | 2 - node_modules/long/umd/index.js | 1432 ----- node_modules/long/umd/package.json | 3 - node_modules/merge-descriptors/HISTORY.md | 21 + node_modules/merge-descriptors/LICENSE | 1 + node_modules/merge-descriptors/README.md | 14 + node_modules/merge-descriptors/index.js | 3 + node_modules/merge-descriptors/package.json | 24 +- node_modules/mime/CHANGELOG.md | 164 + node_modules/mime/LICENSE | 2 + node_modules/mime/build/build.js | 11 - node_modules/mime/mime.js | 10 +- node_modules/mime/package.json | 24 +- node_modules/mime/src/build.js | 53 + node_modules/mime/{build => src}/test.js | 11 +- node_modules/mime/types.json | 2 +- node_modules/mysql/Changes.md | 569 ++ node_modules/{mysql2 => mysql}/License | 2 +- node_modules/mysql/Readme.md | 1548 ++++++ node_modules/mysql/index.js | 161 + node_modules/mysql/lib/Connection.js | 529 ++ node_modules/mysql/lib/ConnectionConfig.js | 209 + node_modules/mysql/lib/Pool.js | 294 ++ node_modules/mysql/lib/PoolCluster.js | 288 + node_modules/mysql/lib/PoolConfig.js | 32 + node_modules/mysql/lib/PoolConnection.js | 65 + node_modules/mysql/lib/PoolNamespace.js | 136 + node_modules/mysql/lib/PoolSelector.js | 31 + node_modules/mysql/lib/protocol/Auth.js | 168 + node_modules/mysql/lib/protocol/BufferList.js | 25 + .../mysql/lib/protocol/PacketHeader.js | 5 + .../mysql/lib/protocol/PacketWriter.js | 211 + node_modules/mysql/lib/protocol/Parser.js | 491 ++ node_modules/mysql/lib/protocol/Protocol.js | 463 ++ node_modules/mysql/lib/protocol/ResultSet.js | 7 + node_modules/mysql/lib/protocol/SqlString.js | 1 + node_modules/mysql/lib/protocol/Timer.js | 33 + .../mysql/lib/protocol/constants/charsets.js | 262 + .../mysql/lib/protocol/constants/client.js | 26 + .../mysql/lib/protocol/constants/errors.js | 2476 +++++++++ .../lib/protocol/constants/field_flags.js | 18 + .../lib/protocol}/constants/server_status.js | 19 +- .../lib/protocol/constants/ssl_profiles.js | 1480 ++++++ .../mysql/lib/protocol/constants/types.js | 72 + .../packets/AuthSwitchRequestPacket.js | 20 + .../packets/AuthSwitchResponsePacket.js | 14 + .../packets/ClientAuthenticationPacket.js | 54 + .../protocol/packets/ComChangeUserPacket.js | 26 + .../lib/protocol/packets/ComPingPacket.js | 12 + .../lib/protocol/packets/ComQueryPacket.js | 15 + .../lib/protocol/packets/ComQuitPacket.js | 12 + .../protocol/packets/ComStatisticsPacket.js | 12 + .../mysql/lib/protocol/packets/EmptyPacket.js | 9 + .../mysql/lib/protocol/packets/EofPacket.js | 25 + .../mysql/lib/protocol/packets/ErrorPacket.js | 35 + .../mysql/lib/protocol/packets/Field.js | 26 + .../mysql/lib/protocol/packets/FieldPacket.js | 93 + .../packets/HandshakeInitializationPacket.js | 103 + .../protocol/packets/LocalDataFilePacket.js | 15 + .../packets/LocalInfileRequestPacket.js | 21 + .../mysql/lib/protocol/packets/OkPacket.js | 44 + .../lib/protocol/packets/OldPasswordPacket.js | 14 + .../protocol/packets/ResultSetHeaderPacket.js | 14 + .../lib/protocol/packets/RowDataPacket.js | 130 + .../lib/protocol/packets/SSLRequestPacket.js | 27 + .../lib/protocol/packets/StatisticsPacket.js | 20 + .../protocol/packets/UseOldPasswordPacket.js | 14 + .../mysql/lib/protocol/packets/index.js | 23 + .../lib/protocol/sequences/ChangeUser.js | 67 + .../mysql/lib/protocol/sequences/Handshake.js | 126 + .../mysql/lib/protocol/sequences/Ping.js | 19 + .../mysql/lib/protocol/sequences/Query.js | 228 + .../mysql/lib/protocol/sequences/Quit.js | 40 + .../mysql/lib/protocol/sequences/Sequence.js | 125 + .../lib/protocol/sequences/Statistics.js | 30 + .../mysql/lib/protocol/sequences/index.js | 7 + .../node_modules/safe-buffer}/LICENSE | 3 +- .../mysql/node_modules/safe-buffer/README.md | 584 ++ .../mysql/node_modules/safe-buffer/index.d.ts | 187 + .../mysql/node_modules/safe-buffer/index.js | 62 + .../node_modules/safe-buffer/package.json | 37 + node_modules/mysql/package.json | 46 + node_modules/mysql2/README.md | 293 - node_modules/mysql2/index.d.ts | 1 - node_modules/mysql2/index.js | 83 - node_modules/mysql2/lib/auth_41.js | 95 - .../lib/auth_plugins/caching_sha2_password.js | 103 - .../lib/auth_plugins/caching_sha2_password.md | 18 - node_modules/mysql2/lib/auth_plugins/index.js | 8 - .../lib/auth_plugins/mysql_clear_password.js | 17 - .../lib/auth_plugins/mysql_native_password.js | 32 - .../lib/auth_plugins/sha256_password.js | 60 - .../mysql2/lib/commands/auth_switch.js | 108 - .../mysql2/lib/commands/binlog_dump.js | 109 - .../mysql2/lib/commands/change_user.js | 66 - .../mysql2/lib/commands/client_handshake.js | 239 - .../mysql2/lib/commands/close_statement.js | 18 - node_modules/mysql2/lib/commands/command.js | 55 - node_modules/mysql2/lib/commands/execute.js | 107 - node_modules/mysql2/lib/commands/index.js | 27 - node_modules/mysql2/lib/commands/ping.js | 36 - node_modules/mysql2/lib/commands/prepare.js | 143 - node_modules/mysql2/lib/commands/query.js | 321 -- node_modules/mysql2/lib/commands/quit.js | 29 - .../mysql2/lib/commands/register_slave.js | 27 - .../mysql2/lib/commands/server_handshake.js | 197 - .../mysql2/lib/compressed_protocol.js | 127 - node_modules/mysql2/lib/connection.js | 945 ---- node_modules/mysql2/lib/connection_config.js | 282 - .../mysql2/lib/constants/charset_encodings.js | 316 -- node_modules/mysql2/lib/constants/charsets.js | 317 -- node_modules/mysql2/lib/constants/client.js | 39 - node_modules/mysql2/lib/constants/commands.js | 36 - node_modules/mysql2/lib/constants/cursor.js | 8 - .../mysql2/lib/constants/encoding_charset.js | 49 - node_modules/mysql2/lib/constants/errors.js | 3968 -------------- .../mysql2/lib/constants/field_flags.js | 20 - .../mysql2/lib/constants/session_track.js | 11 - .../mysql2/lib/constants/ssl_profiles.js | 1383 ----- node_modules/mysql2/lib/constants/types.js | 64 - node_modules/mysql2/lib/helpers.js | 65 - node_modules/mysql2/lib/packet_parser.js | 195 - .../mysql2/lib/packets/auth_next_factor.js | 35 - .../mysql2/lib/packets/auth_switch_request.js | 38 - .../packets/auth_switch_request_more_data.js | 33 - .../lib/packets/auth_switch_response.js | 30 - node_modules/mysql2/lib/packets/binary_row.js | 95 - .../mysql2/lib/packets/binlog_dump.js | 33 - .../lib/packets/binlog_query_statusvars.js | 115 - .../mysql2/lib/packets/change_user.js | 97 - .../mysql2/lib/packets/close_statement.js | 21 - .../mysql2/lib/packets/column_definition.js | 290 - node_modules/mysql2/lib/packets/execute.js | 212 - node_modules/mysql2/lib/packets/handshake.js | 112 - .../mysql2/lib/packets/handshake_response.js | 145 - node_modules/mysql2/lib/packets/index.js | 152 - node_modules/mysql2/lib/packets/packet.js | 919 ---- .../mysql2/lib/packets/prepare_statement.js | 27 - .../lib/packets/prepared_statement_header.js | 16 - node_modules/mysql2/lib/packets/query.js | 27 - .../mysql2/lib/packets/register_slave.js | 46 - .../mysql2/lib/packets/resultset_header.js | 119 - .../mysql2/lib/packets/ssl_request.js | 25 - node_modules/mysql2/lib/packets/text_row.js | 47 - .../mysql2/lib/parsers/binary_parser.js | 186 - .../mysql2/lib/parsers/parser_cache.js | 53 - node_modules/mysql2/lib/parsers/string.js | 29 - .../mysql2/lib/parsers/text_parser.js | 209 - node_modules/mysql2/lib/pool.js | 236 - node_modules/mysql2/lib/pool_cluster.js | 283 - node_modules/mysql2/lib/pool_config.js | 30 - node_modules/mysql2/lib/pool_connection.js | 69 - node_modules/mysql2/lib/results_stream.js | 38 - node_modules/mysql2/lib/server.js | 37 - .../iconv-lite/.github/dependabot.yml | 11 - .../iconv-lite/.idea/codeStyles/Project.xml | 47 - .../.idea/codeStyles/codeStyleConfig.xml | 5 - .../iconv-lite/.idea/iconv-lite.iml | 12 - .../inspectionProfiles/Project_Default.xml | 6 - .../node_modules/iconv-lite/.idea/modules.xml | 8 - .../node_modules/iconv-lite/.idea/vcs.xml | 6 - .../node_modules/iconv-lite/Changelog.md | 212 - .../mysql2/node_modules/iconv-lite/LICENSE | 21 - .../mysql2/node_modules/iconv-lite/README.md | 130 - .../iconv-lite/encodings/dbcs-codec.js | 597 --- .../iconv-lite/encodings/dbcs-data.js | 188 - .../iconv-lite/encodings/index.js | 23 - .../iconv-lite/encodings/internal.js | 198 - .../iconv-lite/encodings/sbcs-codec.js | 72 - .../encodings/sbcs-data-generated.js | 451 -- .../iconv-lite/encodings/sbcs-data.js | 179 - .../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 | 56 - .../iconv-lite/encodings/tables/shiftjis.json | 125 - .../iconv-lite/encodings/utf16.js | 197 - .../iconv-lite/encodings/utf32.js | 319 -- .../node_modules/iconv-lite/encodings/utf7.js | 290 - .../iconv-lite/lib/bom-handling.js | 52 - .../node_modules/iconv-lite/lib/index.d.ts | 41 - .../node_modules/iconv-lite/lib/index.js | 180 - .../node_modules/iconv-lite/lib/streams.js | 109 - .../node_modules/iconv-lite/package.json | 44 - .../mysql2/node_modules/lru-cache/LICENSE | 15 - .../mysql2/node_modules/lru-cache/README.md | 1180 ----- .../lru-cache/dist/cjs/index-cjs.d.ts | 7 - .../lru-cache/dist/cjs/index-cjs.d.ts.map | 1 - .../lru-cache/dist/cjs/index-cjs.js | 7 - .../lru-cache/dist/cjs/index-cjs.js.map | 1 - .../lru-cache/dist/cjs/index.d.ts | 807 --- .../lru-cache/dist/cjs/index.d.ts.map | 1 - .../node_modules/lru-cache/dist/cjs/index.js | 1334 ----- .../lru-cache/dist/cjs/index.js.map | 1 - .../lru-cache/dist/cjs/index.min.js | 2 - .../lru-cache/dist/cjs/index.min.js.map | 7 - .../lru-cache/dist/cjs/package.json | 3 - .../lru-cache/dist/mjs/index.d.ts | 807 --- .../lru-cache/dist/mjs/index.d.ts.map | 1 - .../node_modules/lru-cache/dist/mjs/index.js | 1330 ----- .../lru-cache/dist/mjs/index.js.map | 1 - .../lru-cache/dist/mjs/index.min.js | 2 - .../lru-cache/dist/mjs/index.min.js.map | 7 - .../lru-cache/dist/mjs/package.json | 3 - .../node_modules/lru-cache/package.json | 110 - node_modules/mysql2/package.json | 90 - node_modules/mysql2/promise.d.ts | 131 - node_modules/mysql2/promise.js | 584 -- node_modules/mysql2/typings/mysql/LICENSE.txt | 15 - node_modules/mysql2/typings/mysql/index.d.ts | 94 - node_modules/mysql2/typings/mysql/info.txt | 1 - .../mysql2/typings/mysql/lib/Auth.d.ts | 30 - .../mysql2/typings/mysql/lib/Connection.d.ts | 408 -- .../mysql2/typings/mysql/lib/Pool.d.ts | 69 - .../mysql2/typings/mysql/lib/PoolCluster.d.ts | 86 - .../typings/mysql/lib/PoolConnection.d.ts | 10 - .../mysql2/typings/mysql/lib/Server.d.ts | 11 - .../lib/constants/CharsetToEncoding.d.ts | 8 - .../typings/mysql/lib/constants/Charsets.d.ts | 326 -- .../typings/mysql/lib/constants/Types.d.ts | 68 - .../typings/mysql/lib/constants/index.d.ts | 5 - .../mysql/lib/parsers/ParserCache.d.ts | 4 - .../typings/mysql/lib/parsers/index.d.ts | 3 - .../mysql/lib/protocol/packets/Field.d.ts | 15 - .../lib/protocol/packets/FieldPacket.d.ts | 27 - .../mysql/lib/protocol/packets/OkPacket.d.ts | 23 - .../lib/protocol/packets/ProcedurePacket.d.ts | 13 - .../lib/protocol/packets/ResultSetHeader.d.ts | 18 - .../lib/protocol/packets/RowDataPacket.d.ts | 9 - .../mysql/lib/protocol/packets/index.d.ts | 19 - .../packets/params/ErrorPacketParams.d.ts | 6 - .../packets/params/OkPacketParams.d.ts | 9 - .../protocol/sequences/ExecutableBase.d.ts | 82 - .../mysql/lib/protocol/sequences/Prepare.d.ts | 65 - .../mysql/lib/protocol/sequences/Query.d.ts | 151 - .../lib/protocol/sequences/QueryableBase.d.ts | 82 - .../lib/protocol/sequences/Sequence.d.ts | 5 - .../sequences/promise/ExecutableBase.d.ts | 65 - .../sequences/promise/QueryableBase.d.ts | 65 - node_modules/named-placeholders/README.md | 29 - node_modules/named-placeholders/index.js | 179 - .../node_modules/lru-cache/LICENSE | 15 - .../node_modules/lru-cache/README.md | 1117 ---- .../node_modules/lru-cache/index.d.ts | 869 --- .../node_modules/lru-cache/index.js | 1227 ----- .../node_modules/lru-cache/index.mjs | 1227 ----- .../node_modules/lru-cache/package.json | 96 - node_modules/named-placeholders/package.json | 32 - node_modules/negotiator/HISTORY.md | 32 + node_modules/negotiator/README.md | 10 +- node_modules/negotiator/index.js | 30 +- node_modules/negotiator/lib/charset.js | 83 +- node_modules/negotiator/lib/encoding.js | 82 +- node_modules/negotiator/lib/language.js | 95 +- node_modules/negotiator/lib/mediaType.js | 171 +- node_modules/negotiator/package.json | 13 +- node_modules/path-to-regexp/History.md | 10 + node_modules/path-to-regexp/Readme.md | 2 +- node_modules/path-to-regexp/index.js | 14 +- node_modules/path-to-regexp/package.json | 2 +- node_modules/process-nextick-args/index.js | 45 + .../license.md} | 8 +- .../process-nextick-args/package.json | 25 + node_modules/process-nextick-args/readme.md | 18 + node_modules/proxy-addr/HISTORY.md | 81 + node_modules/proxy-addr/LICENSE | 2 +- node_modules/proxy-addr/README.md | 38 +- node_modules/proxy-addr/index.js | 320 +- node_modules/proxy-addr/package.json | 27 +- node_modules/range-parser/HISTORY.md | 20 +- node_modules/range-parser/LICENSE | 3 +- node_modules/range-parser/README.md | 57 +- node_modules/range-parser/index.js | 147 +- node_modules/range-parser/package.json | 24 +- node_modules/raw-body/HISTORY.md | 5 - node_modules/raw-body/README.md | 2 +- node_modules/raw-body/index.js | 7 - node_modules/raw-body/package.json | 14 +- node_modules/readable-stream/.travis.yml | 34 + node_modules/readable-stream/CONTRIBUTING.md | 38 + node_modules/readable-stream/GOVERNANCE.md | 136 + node_modules/readable-stream/LICENSE | 47 + node_modules/readable-stream/README.md | 58 + .../doc/wg-meetings/2015-01-30.md | 60 + .../readable-stream/duplex-browser.js | 1 + node_modules/readable-stream/duplex.js | 1 + .../readable-stream/lib/_stream_duplex.js | 131 + .../lib/_stream_passthrough.js | 47 + .../readable-stream/lib/_stream_readable.js | 1019 ++++ .../readable-stream/lib/_stream_transform.js | 214 + .../readable-stream/lib/_stream_writable.js | 687 +++ .../lib/internal/streams/BufferList.js | 79 + .../lib/internal/streams/destroy.js | 74 + .../lib/internal/streams/stream-browser.js | 1 + .../lib/internal/streams/stream.js | 1 + .../node_modules/safe-buffer}/LICENSE | 4 +- .../node_modules/safe-buffer/README.md | 584 ++ .../node_modules/safe-buffer/index.d.ts | 187 + .../node_modules/safe-buffer/index.js | 62 + .../node_modules/safe-buffer/package.json | 37 + node_modules/readable-stream/package.json | 52 + node_modules/readable-stream/passthrough.js | 1 + .../readable-stream/readable-browser.js | 7 + node_modules/readable-stream/readable.js | 19 + node_modules/readable-stream/transform.js | 1 + .../readable-stream/writable-browser.js | 1 + node_modules/readable-stream/writable.js | 8 + node_modules/router/HISTORY.md | 82 - node_modules/router/LICENSE | 23 - node_modules/router/README.md | 311 -- node_modules/router/index.js | 735 --- node_modules/router/lib/layer.js | 175 - node_modules/router/lib/route.js | 221 - .../router/node_modules/array-flatten/LICENSE | 21 - .../node_modules/array-flatten/README.md | 50 - .../array-flatten/array-flatten.d.ts | 16 - .../array-flatten/array-flatten.js | 108 - .../node_modules/array-flatten/package.json | 47 - .../router/node_modules/debug/.jshintrc | 3 - .../router/node_modules/debug/.npmignore | 6 - .../router/node_modules/debug/History.md | 195 - .../router/node_modules/debug/Makefile | 36 - .../router/node_modules/debug/Readme.md | 188 - .../router/node_modules/debug/bower.json | 28 - .../router/node_modules/debug/browser.js | 168 - .../router/node_modules/debug/component.json | 19 - .../router/node_modules/debug/debug.js | 197 - .../router/node_modules/debug/node.js | 209 - .../router/node_modules/debug/package.json | 34 - .../router/node_modules/ms/.npmignore | 5 - .../router/node_modules/ms/History.md | 66 - node_modules/router/node_modules/ms/LICENSE | 20 - node_modules/router/node_modules/ms/README.md | 35 - node_modules/router/node_modules/ms/index.js | 125 - .../router/node_modules/ms/package.json | 20 - .../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/setprototypeof/LICENSE | 13 - .../node_modules/setprototypeof/README.md | 21 - .../node_modules/setprototypeof/index.js | 13 - .../node_modules/setprototypeof/package.json | 24 - node_modules/router/package.json | 39 - .../http-errors => safe-buffer}/LICENSE | 3 +- 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/send/HISTORY.md | 226 + node_modules/send/LICENSE | 2 +- node_modules/send/README.md | 226 +- node_modules/send/SECURITY.md | 24 + node_modules/send/index.js | 845 ++- .../send/node_modules/debug/.jshintrc | 3 - .../send/node_modules/debug/.npmignore | 6 - .../send/node_modules/debug/History.md | 195 - node_modules/send/node_modules/debug/Makefile | 36 - .../send/node_modules/debug/Readme.md | 188 - .../send/node_modules/debug/bower.json | 28 - .../send/node_modules/debug/browser.js | 168 - .../send/node_modules/debug/component.json | 19 - node_modules/send/node_modules/debug/debug.js | 197 - node_modules/send/node_modules/debug/node.js | 209 - .../send/node_modules/debug/package.json | 34 - .../send/node_modules/depd/History.md | 75 - node_modules/send/node_modules/depd/Readme.md | 274 - node_modules/send/node_modules/depd/index.js | 529 -- .../depd/lib/compat/buffer-concat.js | 33 - .../depd/lib/compat/callsite-tostring.js | 101 - .../node_modules/depd/lib/compat/index.js | 69 - .../send/node_modules/depd/package.json | 34 - .../send/node_modules/destroy/README.md | 38 - .../send/node_modules/destroy/index.js | 36 - .../send/node_modules/destroy/package.json | 36 - .../send/node_modules/http-errors/HISTORY.md | 76 - .../send/node_modules/http-errors/README.md | 63 - .../send/node_modules/http-errors/index.js | 120 - .../node_modules/http-errors/package.json | 38 - node_modules/send/node_modules/ms/.npmignore | 5 - node_modules/send/node_modules/ms/History.md | 66 - node_modules/send/node_modules/ms/LICENSE | 20 - node_modules/send/node_modules/ms/index.js | 87 +- .../node_modules/ms/license.md} | 2 +- .../send/node_modules/ms/package.json | 44 +- node_modules/send/node_modules/ms/readme.md | 42 +- .../send/node_modules/on-finished/HISTORY.md | 88 - .../send/node_modules/on-finished/LICENSE | 23 - .../send/node_modules/on-finished/README.md | 154 - .../send/node_modules/on-finished/index.js | 196 - .../node_modules/on-finished/package.json | 31 - .../send/node_modules/statuses/README.md | 114 - .../send/node_modules/statuses/codes.json | 64 - .../send/node_modules/statuses/index.js | 60 - .../send/node_modules/statuses/package.json | 36 - node_modules/send/package.json | 52 +- node_modules/seq-queue/.jshintrc | 19 - node_modules/seq-queue/.npmignore | 3 - node_modules/seq-queue/AUTHORS | 1 - node_modules/seq-queue/LICENSE | 22 - node_modules/seq-queue/Makefile | 9 - node_modules/seq-queue/README.md | 75 - node_modules/seq-queue/index.js | 1 - node_modules/seq-queue/lib/.npmignore | 0 node_modules/seq-queue/lib/seq-queue.js | 199 - node_modules/seq-queue/package.json | 17 - node_modules/seq-queue/test/seq-queue-test.js | 307 -- node_modules/serve-static/HISTORY.md | 162 + node_modules/serve-static/LICENSE | 2 +- node_modules/serve-static/README.md | 85 +- node_modules/serve-static/index.js | 41 +- .../serve-static/node_modules/debug/.jshintrc | 3 - .../node_modules/debug/.npmignore | 6 - .../node_modules/debug/History.md | 195 - .../serve-static/node_modules/debug/Makefile | 36 - .../serve-static/node_modules/debug/Readme.md | 188 - .../node_modules/debug/bower.json | 28 - .../node_modules/debug/browser.js | 168 - .../node_modules/debug/component.json | 19 - .../serve-static/node_modules/debug/debug.js | 197 - .../serve-static/node_modules/debug/node.js | 209 - .../node_modules/debug/package.json | 34 - .../serve-static/node_modules/depd/History.md | 96 - .../serve-static/node_modules/depd/LICENSE | 22 - .../serve-static/node_modules/depd/Readme.md | 280 - .../serve-static/node_modules/depd/index.js | 522 -- .../node_modules/depd/lib/browser/index.js | 77 - .../depd/lib/compat/callsite-tostring.js | 103 - .../depd/lib/compat/event-listener-count.js | 22 - .../node_modules/depd/lib/compat/index.js | 79 - .../node_modules/depd/package.json | 41 - .../serve-static/node_modules/destroy/LICENSE | 22 - .../node_modules/destroy/README.md | 60 - .../node_modules/destroy/index.js | 75 - .../node_modules/destroy/package.json | 37 - .../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/http-errors/HISTORY.md | 76 - .../node_modules/http-errors/LICENSE | 22 - .../node_modules/http-errors/README.md | 63 - .../node_modules/http-errors/index.js | 120 - .../node_modules/http-errors/package.json | 38 - .../serve-static/node_modules/ms/.npmignore | 5 - .../serve-static/node_modules/ms/History.md | 66 - .../serve-static/node_modules/ms/LICENSE | 20 - .../serve-static/node_modules/ms/README.md | 35 - .../serve-static/node_modules/ms/index.js | 125 - .../serve-static/node_modules/ms/package.json | 20 - .../node_modules/on-finished/HISTORY.md | 88 - .../node_modules/on-finished/LICENSE | 23 - .../node_modules/on-finished/README.md | 154 - .../node_modules/on-finished/index.js | 196 - .../node_modules/on-finished/package.json | 31 - .../serve-static/node_modules/send/HISTORY.md | 315 -- .../serve-static/node_modules/send/LICENSE | 23 - .../serve-static/node_modules/send/README.md | 234 - .../serve-static/node_modules/send/index.js | 829 --- .../node_modules/send/package.json | 50 - .../node_modules/statuses/LICENSE | 22 - .../node_modules/statuses/README.md | 114 - .../node_modules/statuses/codes.json | 64 - .../node_modules/statuses/index.js | 60 - .../node_modules/statuses/package.json | 36 - node_modules/serve-static/package.json | 32 +- node_modules/sqlstring/HISTORY.md | 10 - node_modules/sqlstring/README.md | 7 +- node_modules/sqlstring/lib/SqlString.js | 4 +- node_modules/sqlstring/package.json | 12 +- node_modules/utils-merge/.npmignore | 9 + node_modules/utils-merge/.travis.yml | 6 - node_modules/utils-merge/LICENSE | 4 +- node_modules/utils-merge/README.md | 26 +- node_modules/utils-merge/package.json | 25 +- node_modules/vary/HISTORY.md | 16 + node_modules/vary/LICENSE | 2 +- node_modules/vary/README.md | 14 +- node_modules/vary/index.js | 94 +- node_modules/vary/package.json | 19 +- package-lock.json | 1306 ++--- package.json | 8 +- public/{session.js => scripts-session.js} | 5 +- views/create-session.hbs | 12 +- 818 files changed, 35968 insertions(+), 82263 deletions(-) delete mode 100644 node_modules/@eonasdan/tempus-dominus/README.md delete mode 100644 node_modules/@eonasdan/tempus-dominus/dist/css/tempus-dominus.css delete mode 100644 node_modules/@eonasdan/tempus-dominus/dist/css/tempus-dominus.css.map delete mode 100644 node_modules/@eonasdan/tempus-dominus/dist/css/tempus-dominus.min.css delete mode 100644 node_modules/@eonasdan/tempus-dominus/dist/js/jQuery-provider.js delete mode 100644 node_modules/@eonasdan/tempus-dominus/dist/js/jQuery-provider.min.js delete mode 100644 node_modules/@eonasdan/tempus-dominus/dist/js/tempus-dominus.esm.js delete mode 100644 node_modules/@eonasdan/tempus-dominus/dist/js/tempus-dominus.esm.js.map delete mode 100644 node_modules/@eonasdan/tempus-dominus/dist/js/tempus-dominus.esm.min.js delete mode 100644 node_modules/@eonasdan/tempus-dominus/dist/js/tempus-dominus.js delete mode 100644 node_modules/@eonasdan/tempus-dominus/dist/js/tempus-dominus.js.map delete mode 100644 node_modules/@eonasdan/tempus-dominus/dist/js/tempus-dominus.min.js delete mode 100644 node_modules/@eonasdan/tempus-dominus/dist/locales/ar-SA.js delete mode 100644 node_modules/@eonasdan/tempus-dominus/dist/locales/ar.js delete mode 100644 node_modules/@eonasdan/tempus-dominus/dist/locales/ca.js delete mode 100644 node_modules/@eonasdan/tempus-dominus/dist/locales/cs.js delete mode 100644 node_modules/@eonasdan/tempus-dominus/dist/locales/de.js delete mode 100644 node_modules/@eonasdan/tempus-dominus/dist/locales/es.js delete mode 100644 node_modules/@eonasdan/tempus-dominus/dist/locales/fi.js delete mode 100644 node_modules/@eonasdan/tempus-dominus/dist/locales/fr.js delete mode 100644 node_modules/@eonasdan/tempus-dominus/dist/locales/hy.js delete mode 100644 node_modules/@eonasdan/tempus-dominus/dist/locales/it.js delete mode 100644 node_modules/@eonasdan/tempus-dominus/dist/locales/nl.js delete mode 100644 node_modules/@eonasdan/tempus-dominus/dist/locales/pl.js delete mode 100644 node_modules/@eonasdan/tempus-dominus/dist/locales/ro.js delete mode 100644 node_modules/@eonasdan/tempus-dominus/dist/locales/ru.js delete mode 100644 node_modules/@eonasdan/tempus-dominus/dist/locales/sl.js delete mode 100644 node_modules/@eonasdan/tempus-dominus/dist/locales/tr.js delete mode 100644 node_modules/@eonasdan/tempus-dominus/dist/plugins/bi-one.js delete mode 100644 node_modules/@eonasdan/tempus-dominus/dist/plugins/customDateFormat.js delete mode 100644 node_modules/@eonasdan/tempus-dominus/dist/plugins/examples/custom-paint-job.js delete mode 100644 node_modules/@eonasdan/tempus-dominus/dist/plugins/examples/sample.js delete mode 100644 node_modules/@eonasdan/tempus-dominus/dist/plugins/fa-five.js delete mode 100644 node_modules/@eonasdan/tempus-dominus/dist/plugins/moment-parse.js delete mode 100644 node_modules/@eonasdan/tempus-dominus/package.json delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/actions.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/dates.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/datetime.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/display/calendar/date-display.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/display/calendar/decade-display.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/display/calendar/month-display.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/display/calendar/year-display.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/display/collapse.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/display/index.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/display/time/hour-display.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/display/time/minute-display.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/display/time/second-display.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/display/time/time-display.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/locales/ar-SA.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/locales/ar.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/locales/ca.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/locales/cs.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/locales/de.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/locales/es.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/locales/fi.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/locales/fr.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/locales/hy.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/locales/it.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/locales/nl.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/locales/pl.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/locales/ro.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/locales/ru.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/locales/sl.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/locales/tr.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/plugins/bi-one/index.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/plugins/customDateFormat/index.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/plugins/examples/custom-paint-job.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/plugins/examples/sample.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/plugins/fa-five/index.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/plugins/moment-parse/index.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/tempus-dominus.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/utilities/action-types.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/utilities/calendar-modes.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/utilities/default-format-localization.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/utilities/default-options.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/utilities/errors.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/utilities/event-emitter.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/utilities/event-types.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/utilities/namespace.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/utilities/optionConverter.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/utilities/optionProcessor.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/utilities/options.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/utilities/optionsStore.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/utilities/service-locator.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/utilities/typeChecker.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/utilities/view-mode.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/js/validation.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/scss/_variables.scss delete mode 100644 node_modules/@eonasdan/tempus-dominus/src/scss/tempus-dominus.scss delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/actions.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/dates.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/datetime.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/display/calendar/date-display.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/display/calendar/decade-display.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/display/calendar/month-display.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/display/calendar/year-display.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/display/collapse.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/display/index.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/display/time/hour-display.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/display/time/minute-display.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/display/time/second-display.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/display/time/time-display.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/locales/ar-SA.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/locales/ar.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/locales/ca.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/locales/cs.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/locales/de.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/locales/es.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/locales/fi.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/locales/fr.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/locales/hy.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/locales/it.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/locales/nl.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/locales/pl.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/locales/ro.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/locales/ru.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/locales/sl.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/locales/tr.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/plugins/bi-one.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/plugins/customDateFormat.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/plugins/fa-five.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/plugins/moment-parse.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/tempus-dominus.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/utilities/action-types.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/utilities/calendar-modes.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/utilities/default-format-localization.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/utilities/default-options.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/utilities/errors.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/utilities/event-emitter.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/utilities/event-types.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/utilities/namespace.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/utilities/optionConverter.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/utilities/optionProcessor.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/utilities/options.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/utilities/optionsStore.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/utilities/service-locator.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/utilities/typeChecker.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/utilities/view-mode.d.ts delete mode 100644 node_modules/@eonasdan/tempus-dominus/types/validation.d.ts create mode 100644 node_modules/bignumber.js/CHANGELOG.md rename node_modules/{express/node_modules/depd/LICENSE => bignumber.js/LICENCE} (92%) create mode 100644 node_modules/bignumber.js/README.md create mode 100644 node_modules/bignumber.js/bignumber.d.ts create mode 100644 node_modules/bignumber.js/bignumber.js create mode 100644 node_modules/bignumber.js/bignumber.min.js create mode 100644 node_modules/bignumber.js/bignumber.min.js.map create mode 100644 node_modules/bignumber.js/bignumber.mjs create mode 100644 node_modules/bignumber.js/doc/API.html create mode 100644 node_modules/bignumber.js/package.json create mode 100644 node_modules/cookie/HISTORY.md create mode 100644 node_modules/cookie/SECURITY.md rename node_modules/{send/node_modules/statuses => core-util-is}/LICENSE (62%) create mode 100644 node_modules/core-util-is/README.md create mode 100644 node_modules/core-util-is/lib/util.js create mode 100644 node_modules/core-util-is/package.json delete mode 100644 node_modules/denque/CHANGELOG.md delete mode 100644 node_modules/denque/LICENSE delete mode 100644 node_modules/denque/README.md delete mode 100644 node_modules/denque/index.d.ts delete mode 100644 node_modules/denque/index.js delete mode 100644 node_modules/denque/package.json create mode 100644 node_modules/encodeurl/HISTORY.md rename node_modules/{send/node_modules/depd => encodeurl}/LICENSE (95%) create mode 100644 node_modules/encodeurl/README.md create mode 100644 node_modules/encodeurl/index.js create mode 100644 node_modules/encodeurl/package.json create mode 100644 node_modules/express/lib/middleware/init.js create mode 100644 node_modules/express/lib/middleware/query.js create mode 100644 node_modules/express/lib/router/index.js create mode 100644 node_modules/express/lib/router/layer.js create mode 100644 node_modules/express/lib/router/route.js delete mode 100644 node_modules/express/node_modules/debug/.jshintrc delete mode 100644 node_modules/express/node_modules/debug/.npmignore delete mode 100644 node_modules/express/node_modules/debug/History.md delete mode 100644 node_modules/express/node_modules/debug/Makefile delete mode 100644 node_modules/express/node_modules/debug/Readme.md delete mode 100644 node_modules/express/node_modules/debug/bower.json delete mode 100644 node_modules/express/node_modules/debug/browser.js delete mode 100644 node_modules/express/node_modules/debug/component.json delete mode 100644 node_modules/express/node_modules/debug/debug.js delete mode 100644 node_modules/express/node_modules/debug/node.js delete mode 100644 node_modules/express/node_modules/debug/package.json delete mode 100644 node_modules/express/node_modules/depd/History.md delete mode 100644 node_modules/express/node_modules/depd/Readme.md delete mode 100644 node_modules/express/node_modules/depd/index.js delete mode 100644 node_modules/express/node_modules/depd/lib/compat/buffer-concat.js delete mode 100644 node_modules/express/node_modules/depd/lib/compat/callsite-tostring.js delete mode 100644 node_modules/express/node_modules/depd/lib/compat/index.js delete mode 100644 node_modules/express/node_modules/depd/package.json delete mode 100644 node_modules/express/node_modules/ms/.npmignore delete mode 100644 node_modules/express/node_modules/ms/History.md delete mode 100644 node_modules/express/node_modules/ms/LICENSE delete mode 100644 node_modules/express/node_modules/ms/README.md delete mode 100644 node_modules/express/node_modules/ms/index.js delete mode 100644 node_modules/express/node_modules/ms/package.json delete mode 100644 node_modules/express/node_modules/on-finished/HISTORY.md delete mode 100644 node_modules/express/node_modules/on-finished/LICENSE delete mode 100644 node_modules/express/node_modules/on-finished/README.md delete mode 100644 node_modules/express/node_modules/on-finished/index.js delete mode 100644 node_modules/express/node_modules/on-finished/package.json delete mode 100644 node_modules/express/node_modules/path-is-absolute/index.js delete mode 100644 node_modules/express/node_modules/path-is-absolute/license delete mode 100644 node_modules/express/node_modules/path-is-absolute/package.json delete mode 100644 node_modules/express/node_modules/path-is-absolute/readme.md delete mode 100644 node_modules/express/node_modules/qs/.eslintignore delete mode 100644 node_modules/express/node_modules/qs/.npmignore delete mode 100644 node_modules/express/node_modules/qs/.travis.yml delete mode 100644 node_modules/express/node_modules/qs/CHANGELOG.md delete mode 100644 node_modules/express/node_modules/qs/CONTRIBUTING.md delete mode 100644 node_modules/express/node_modules/qs/LICENSE delete mode 100644 node_modules/express/node_modules/qs/README.md delete mode 100644 node_modules/express/node_modules/qs/bower.json delete mode 100644 node_modules/express/node_modules/qs/lib/index.js delete mode 100644 node_modules/express/node_modules/qs/lib/parse.js delete mode 100644 node_modules/express/node_modules/qs/lib/stringify.js delete mode 100644 node_modules/express/node_modules/qs/lib/utils.js delete mode 100644 node_modules/express/node_modules/qs/package.json delete mode 100644 node_modules/express/node_modules/qs/test/parse.js delete mode 100644 node_modules/express/node_modules/qs/test/stringify.js delete mode 100644 node_modules/express/node_modules/qs/test/utils.js create mode 100644 node_modules/finalhandler/SECURITY.md delete mode 100644 node_modules/finalhandler/node_modules/debug/.jshintrc delete mode 100644 node_modules/finalhandler/node_modules/debug/.npmignore delete mode 100644 node_modules/finalhandler/node_modules/debug/History.md delete mode 100644 node_modules/finalhandler/node_modules/debug/Makefile delete mode 100644 node_modules/finalhandler/node_modules/debug/Readme.md delete mode 100644 node_modules/finalhandler/node_modules/debug/bower.json delete mode 100644 node_modules/finalhandler/node_modules/debug/browser.js delete mode 100644 node_modules/finalhandler/node_modules/debug/component.json delete mode 100644 node_modules/finalhandler/node_modules/debug/debug.js delete mode 100644 node_modules/finalhandler/node_modules/debug/node.js delete mode 100644 node_modules/finalhandler/node_modules/debug/package.json delete mode 100644 node_modules/finalhandler/node_modules/ms/.npmignore delete mode 100644 node_modules/finalhandler/node_modules/ms/History.md delete mode 100644 node_modules/finalhandler/node_modules/ms/LICENSE delete mode 100644 node_modules/finalhandler/node_modules/ms/README.md delete mode 100644 node_modules/finalhandler/node_modules/ms/index.js delete mode 100644 node_modules/finalhandler/node_modules/ms/package.json delete mode 100644 node_modules/finalhandler/node_modules/on-finished/HISTORY.md delete mode 100644 node_modules/finalhandler/node_modules/on-finished/LICENSE delete mode 100644 node_modules/finalhandler/node_modules/on-finished/README.md delete mode 100644 node_modules/finalhandler/node_modules/on-finished/index.js delete mode 100644 node_modules/finalhandler/node_modules/on-finished/package.json delete mode 100644 node_modules/generate-function/README.md delete mode 100644 node_modules/generate-function/example.js delete mode 100644 node_modules/generate-function/index.js delete mode 100644 node_modules/generate-function/package.json delete mode 100644 node_modules/generate-function/test.js delete mode 100644 node_modules/ipaddr.js/.travis.yml delete mode 100644 node_modules/ipaddr.js/Cakefile delete mode 100644 node_modules/ipaddr.js/bower.json create mode 100644 node_modules/ipaddr.js/lib/ipaddr.js.d.ts delete mode 100644 node_modules/ipaddr.js/src/ipaddr.coffee delete mode 100644 node_modules/ipaddr.js/test/ipaddr.test.coffee delete mode 100644 node_modules/is-property/.npmignore delete mode 100644 node_modules/is-property/README.md delete mode 100644 node_modules/is-property/is-property.js delete mode 100644 node_modules/is-property/package.json rename node_modules/{ipaddr.js => isarray}/.npmignore (68%) rename node_modules/{generate-function => isarray}/.travis.yml (79%) create mode 100644 node_modules/isarray/Makefile create mode 100644 node_modules/isarray/README.md create mode 100644 node_modules/isarray/component.json create mode 100644 node_modules/isarray/index.js create mode 100644 node_modules/isarray/package.json create mode 100644 node_modules/isarray/test.js delete mode 100644 node_modules/long/LICENSE delete mode 100644 node_modules/long/README.md delete mode 100644 node_modules/long/index.d.ts delete mode 100644 node_modules/long/index.js delete mode 100644 node_modules/long/package.json delete mode 100644 node_modules/long/umd/index.d.ts delete mode 100644 node_modules/long/umd/index.js delete mode 100644 node_modules/long/umd/package.json create mode 100644 node_modules/merge-descriptors/HISTORY.md create mode 100644 node_modules/mime/CHANGELOG.md delete mode 100644 node_modules/mime/build/build.js create mode 100755 node_modules/mime/src/build.js rename node_modules/mime/{build => src}/test.js (83%) create mode 100644 node_modules/mysql/Changes.md rename node_modules/{mysql2 => mysql}/License (92%) create mode 100644 node_modules/mysql/Readme.md create mode 100644 node_modules/mysql/index.js create mode 100644 node_modules/mysql/lib/Connection.js create mode 100644 node_modules/mysql/lib/ConnectionConfig.js create mode 100644 node_modules/mysql/lib/Pool.js create mode 100644 node_modules/mysql/lib/PoolCluster.js create mode 100644 node_modules/mysql/lib/PoolConfig.js create mode 100644 node_modules/mysql/lib/PoolConnection.js create mode 100644 node_modules/mysql/lib/PoolNamespace.js create mode 100644 node_modules/mysql/lib/PoolSelector.js create mode 100644 node_modules/mysql/lib/protocol/Auth.js create mode 100644 node_modules/mysql/lib/protocol/BufferList.js create mode 100644 node_modules/mysql/lib/protocol/PacketHeader.js create mode 100644 node_modules/mysql/lib/protocol/PacketWriter.js create mode 100644 node_modules/mysql/lib/protocol/Parser.js create mode 100644 node_modules/mysql/lib/protocol/Protocol.js create mode 100644 node_modules/mysql/lib/protocol/ResultSet.js create mode 100644 node_modules/mysql/lib/protocol/SqlString.js create mode 100644 node_modules/mysql/lib/protocol/Timer.js create mode 100644 node_modules/mysql/lib/protocol/constants/charsets.js create mode 100644 node_modules/mysql/lib/protocol/constants/client.js create mode 100644 node_modules/mysql/lib/protocol/constants/errors.js create mode 100644 node_modules/mysql/lib/protocol/constants/field_flags.js rename node_modules/{mysql2/lib => mysql/lib/protocol}/constants/server_status.js (66%) create mode 100644 node_modules/mysql/lib/protocol/constants/ssl_profiles.js create mode 100644 node_modules/mysql/lib/protocol/constants/types.js create mode 100644 node_modules/mysql/lib/protocol/packets/AuthSwitchRequestPacket.js create mode 100644 node_modules/mysql/lib/protocol/packets/AuthSwitchResponsePacket.js create mode 100644 node_modules/mysql/lib/protocol/packets/ClientAuthenticationPacket.js create mode 100644 node_modules/mysql/lib/protocol/packets/ComChangeUserPacket.js create mode 100644 node_modules/mysql/lib/protocol/packets/ComPingPacket.js create mode 100644 node_modules/mysql/lib/protocol/packets/ComQueryPacket.js create mode 100644 node_modules/mysql/lib/protocol/packets/ComQuitPacket.js create mode 100644 node_modules/mysql/lib/protocol/packets/ComStatisticsPacket.js create mode 100644 node_modules/mysql/lib/protocol/packets/EmptyPacket.js create mode 100644 node_modules/mysql/lib/protocol/packets/EofPacket.js create mode 100644 node_modules/mysql/lib/protocol/packets/ErrorPacket.js create mode 100644 node_modules/mysql/lib/protocol/packets/Field.js create mode 100644 node_modules/mysql/lib/protocol/packets/FieldPacket.js create mode 100644 node_modules/mysql/lib/protocol/packets/HandshakeInitializationPacket.js create mode 100644 node_modules/mysql/lib/protocol/packets/LocalDataFilePacket.js create mode 100644 node_modules/mysql/lib/protocol/packets/LocalInfileRequestPacket.js create mode 100644 node_modules/mysql/lib/protocol/packets/OkPacket.js create mode 100644 node_modules/mysql/lib/protocol/packets/OldPasswordPacket.js create mode 100644 node_modules/mysql/lib/protocol/packets/ResultSetHeaderPacket.js create mode 100644 node_modules/mysql/lib/protocol/packets/RowDataPacket.js create mode 100644 node_modules/mysql/lib/protocol/packets/SSLRequestPacket.js create mode 100644 node_modules/mysql/lib/protocol/packets/StatisticsPacket.js create mode 100644 node_modules/mysql/lib/protocol/packets/UseOldPasswordPacket.js create mode 100644 node_modules/mysql/lib/protocol/packets/index.js create mode 100644 node_modules/mysql/lib/protocol/sequences/ChangeUser.js create mode 100644 node_modules/mysql/lib/protocol/sequences/Handshake.js create mode 100644 node_modules/mysql/lib/protocol/sequences/Ping.js create mode 100644 node_modules/mysql/lib/protocol/sequences/Query.js create mode 100644 node_modules/mysql/lib/protocol/sequences/Quit.js create mode 100644 node_modules/mysql/lib/protocol/sequences/Sequence.js create mode 100644 node_modules/mysql/lib/protocol/sequences/Statistics.js create mode 100644 node_modules/mysql/lib/protocol/sequences/index.js rename node_modules/{is-property => mysql/node_modules/safe-buffer}/LICENSE (96%) create mode 100644 node_modules/mysql/node_modules/safe-buffer/README.md create mode 100644 node_modules/mysql/node_modules/safe-buffer/index.d.ts create mode 100644 node_modules/mysql/node_modules/safe-buffer/index.js create mode 100644 node_modules/mysql/node_modules/safe-buffer/package.json create mode 100644 node_modules/mysql/package.json delete mode 100644 node_modules/mysql2/README.md delete mode 100644 node_modules/mysql2/index.d.ts delete mode 100644 node_modules/mysql2/index.js delete mode 100644 node_modules/mysql2/lib/auth_41.js delete mode 100644 node_modules/mysql2/lib/auth_plugins/caching_sha2_password.js delete mode 100644 node_modules/mysql2/lib/auth_plugins/caching_sha2_password.md delete mode 100644 node_modules/mysql2/lib/auth_plugins/index.js delete mode 100644 node_modules/mysql2/lib/auth_plugins/mysql_clear_password.js delete mode 100644 node_modules/mysql2/lib/auth_plugins/mysql_native_password.js delete mode 100644 node_modules/mysql2/lib/auth_plugins/sha256_password.js delete mode 100644 node_modules/mysql2/lib/commands/auth_switch.js delete mode 100644 node_modules/mysql2/lib/commands/binlog_dump.js delete mode 100644 node_modules/mysql2/lib/commands/change_user.js delete mode 100644 node_modules/mysql2/lib/commands/client_handshake.js delete mode 100644 node_modules/mysql2/lib/commands/close_statement.js delete mode 100644 node_modules/mysql2/lib/commands/command.js delete mode 100644 node_modules/mysql2/lib/commands/execute.js delete mode 100644 node_modules/mysql2/lib/commands/index.js delete mode 100644 node_modules/mysql2/lib/commands/ping.js delete mode 100644 node_modules/mysql2/lib/commands/prepare.js delete mode 100644 node_modules/mysql2/lib/commands/query.js delete mode 100644 node_modules/mysql2/lib/commands/quit.js delete mode 100644 node_modules/mysql2/lib/commands/register_slave.js delete mode 100644 node_modules/mysql2/lib/commands/server_handshake.js delete mode 100644 node_modules/mysql2/lib/compressed_protocol.js delete mode 100644 node_modules/mysql2/lib/connection.js delete mode 100644 node_modules/mysql2/lib/connection_config.js delete mode 100644 node_modules/mysql2/lib/constants/charset_encodings.js delete mode 100644 node_modules/mysql2/lib/constants/charsets.js delete mode 100644 node_modules/mysql2/lib/constants/client.js delete mode 100644 node_modules/mysql2/lib/constants/commands.js delete mode 100644 node_modules/mysql2/lib/constants/cursor.js delete mode 100644 node_modules/mysql2/lib/constants/encoding_charset.js delete mode 100644 node_modules/mysql2/lib/constants/errors.js delete mode 100644 node_modules/mysql2/lib/constants/field_flags.js delete mode 100644 node_modules/mysql2/lib/constants/session_track.js delete mode 100644 node_modules/mysql2/lib/constants/ssl_profiles.js delete mode 100644 node_modules/mysql2/lib/constants/types.js delete mode 100644 node_modules/mysql2/lib/helpers.js delete mode 100644 node_modules/mysql2/lib/packet_parser.js delete mode 100644 node_modules/mysql2/lib/packets/auth_next_factor.js delete mode 100644 node_modules/mysql2/lib/packets/auth_switch_request.js delete mode 100644 node_modules/mysql2/lib/packets/auth_switch_request_more_data.js delete mode 100644 node_modules/mysql2/lib/packets/auth_switch_response.js delete mode 100644 node_modules/mysql2/lib/packets/binary_row.js delete mode 100644 node_modules/mysql2/lib/packets/binlog_dump.js delete mode 100644 node_modules/mysql2/lib/packets/binlog_query_statusvars.js delete mode 100644 node_modules/mysql2/lib/packets/change_user.js delete mode 100644 node_modules/mysql2/lib/packets/close_statement.js delete mode 100644 node_modules/mysql2/lib/packets/column_definition.js delete mode 100644 node_modules/mysql2/lib/packets/execute.js delete mode 100644 node_modules/mysql2/lib/packets/handshake.js delete mode 100644 node_modules/mysql2/lib/packets/handshake_response.js delete mode 100644 node_modules/mysql2/lib/packets/index.js delete mode 100644 node_modules/mysql2/lib/packets/packet.js delete mode 100644 node_modules/mysql2/lib/packets/prepare_statement.js delete mode 100644 node_modules/mysql2/lib/packets/prepared_statement_header.js delete mode 100644 node_modules/mysql2/lib/packets/query.js delete mode 100644 node_modules/mysql2/lib/packets/register_slave.js delete mode 100644 node_modules/mysql2/lib/packets/resultset_header.js delete mode 100644 node_modules/mysql2/lib/packets/ssl_request.js delete mode 100644 node_modules/mysql2/lib/packets/text_row.js delete mode 100644 node_modules/mysql2/lib/parsers/binary_parser.js delete mode 100644 node_modules/mysql2/lib/parsers/parser_cache.js delete mode 100644 node_modules/mysql2/lib/parsers/string.js delete mode 100644 node_modules/mysql2/lib/parsers/text_parser.js delete mode 100644 node_modules/mysql2/lib/pool.js delete mode 100644 node_modules/mysql2/lib/pool_cluster.js delete mode 100644 node_modules/mysql2/lib/pool_config.js delete mode 100644 node_modules/mysql2/lib/pool_connection.js delete mode 100644 node_modules/mysql2/lib/results_stream.js delete mode 100644 node_modules/mysql2/lib/server.js delete mode 100644 node_modules/mysql2/node_modules/iconv-lite/.github/dependabot.yml delete mode 100644 node_modules/mysql2/node_modules/iconv-lite/.idea/codeStyles/Project.xml delete mode 100644 node_modules/mysql2/node_modules/iconv-lite/.idea/codeStyles/codeStyleConfig.xml delete mode 100644 node_modules/mysql2/node_modules/iconv-lite/.idea/iconv-lite.iml delete mode 100644 node_modules/mysql2/node_modules/iconv-lite/.idea/inspectionProfiles/Project_Default.xml delete mode 100644 node_modules/mysql2/node_modules/iconv-lite/.idea/modules.xml delete mode 100644 node_modules/mysql2/node_modules/iconv-lite/.idea/vcs.xml delete mode 100644 node_modules/mysql2/node_modules/iconv-lite/Changelog.md delete mode 100644 node_modules/mysql2/node_modules/iconv-lite/LICENSE delete mode 100644 node_modules/mysql2/node_modules/iconv-lite/README.md delete mode 100644 node_modules/mysql2/node_modules/iconv-lite/encodings/dbcs-codec.js delete mode 100644 node_modules/mysql2/node_modules/iconv-lite/encodings/dbcs-data.js delete mode 100644 node_modules/mysql2/node_modules/iconv-lite/encodings/index.js delete mode 100644 node_modules/mysql2/node_modules/iconv-lite/encodings/internal.js delete mode 100644 node_modules/mysql2/node_modules/iconv-lite/encodings/sbcs-codec.js delete mode 100644 node_modules/mysql2/node_modules/iconv-lite/encodings/sbcs-data-generated.js delete mode 100644 node_modules/mysql2/node_modules/iconv-lite/encodings/sbcs-data.js delete mode 100644 node_modules/mysql2/node_modules/iconv-lite/encodings/tables/big5-added.json delete mode 100644 node_modules/mysql2/node_modules/iconv-lite/encodings/tables/cp936.json delete mode 100644 node_modules/mysql2/node_modules/iconv-lite/encodings/tables/cp949.json delete mode 100644 node_modules/mysql2/node_modules/iconv-lite/encodings/tables/cp950.json delete mode 100644 node_modules/mysql2/node_modules/iconv-lite/encodings/tables/eucjp.json delete mode 100644 node_modules/mysql2/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json delete mode 100644 node_modules/mysql2/node_modules/iconv-lite/encodings/tables/gbk-added.json delete mode 100644 node_modules/mysql2/node_modules/iconv-lite/encodings/tables/shiftjis.json delete mode 100644 node_modules/mysql2/node_modules/iconv-lite/encodings/utf16.js delete mode 100644 node_modules/mysql2/node_modules/iconv-lite/encodings/utf32.js delete mode 100644 node_modules/mysql2/node_modules/iconv-lite/encodings/utf7.js delete mode 100644 node_modules/mysql2/node_modules/iconv-lite/lib/bom-handling.js delete mode 100644 node_modules/mysql2/node_modules/iconv-lite/lib/index.d.ts delete mode 100644 node_modules/mysql2/node_modules/iconv-lite/lib/index.js delete mode 100644 node_modules/mysql2/node_modules/iconv-lite/lib/streams.js delete mode 100644 node_modules/mysql2/node_modules/iconv-lite/package.json delete mode 100644 node_modules/mysql2/node_modules/lru-cache/LICENSE delete mode 100644 node_modules/mysql2/node_modules/lru-cache/README.md delete mode 100644 node_modules/mysql2/node_modules/lru-cache/dist/cjs/index-cjs.d.ts delete mode 100644 node_modules/mysql2/node_modules/lru-cache/dist/cjs/index-cjs.d.ts.map delete mode 100644 node_modules/mysql2/node_modules/lru-cache/dist/cjs/index-cjs.js delete mode 100644 node_modules/mysql2/node_modules/lru-cache/dist/cjs/index-cjs.js.map delete mode 100644 node_modules/mysql2/node_modules/lru-cache/dist/cjs/index.d.ts delete mode 100644 node_modules/mysql2/node_modules/lru-cache/dist/cjs/index.d.ts.map delete mode 100644 node_modules/mysql2/node_modules/lru-cache/dist/cjs/index.js delete mode 100644 node_modules/mysql2/node_modules/lru-cache/dist/cjs/index.js.map delete mode 100644 node_modules/mysql2/node_modules/lru-cache/dist/cjs/index.min.js delete mode 100644 node_modules/mysql2/node_modules/lru-cache/dist/cjs/index.min.js.map delete mode 100644 node_modules/mysql2/node_modules/lru-cache/dist/cjs/package.json delete mode 100644 node_modules/mysql2/node_modules/lru-cache/dist/mjs/index.d.ts delete mode 100644 node_modules/mysql2/node_modules/lru-cache/dist/mjs/index.d.ts.map delete mode 100644 node_modules/mysql2/node_modules/lru-cache/dist/mjs/index.js delete mode 100644 node_modules/mysql2/node_modules/lru-cache/dist/mjs/index.js.map delete mode 100644 node_modules/mysql2/node_modules/lru-cache/dist/mjs/index.min.js delete mode 100644 node_modules/mysql2/node_modules/lru-cache/dist/mjs/index.min.js.map delete mode 100644 node_modules/mysql2/node_modules/lru-cache/dist/mjs/package.json delete mode 100644 node_modules/mysql2/node_modules/lru-cache/package.json delete mode 100644 node_modules/mysql2/package.json delete mode 100644 node_modules/mysql2/promise.d.ts delete mode 100644 node_modules/mysql2/promise.js delete mode 100644 node_modules/mysql2/typings/mysql/LICENSE.txt delete mode 100644 node_modules/mysql2/typings/mysql/index.d.ts delete mode 100644 node_modules/mysql2/typings/mysql/info.txt delete mode 100644 node_modules/mysql2/typings/mysql/lib/Auth.d.ts delete mode 100644 node_modules/mysql2/typings/mysql/lib/Connection.d.ts delete mode 100644 node_modules/mysql2/typings/mysql/lib/Pool.d.ts delete mode 100644 node_modules/mysql2/typings/mysql/lib/PoolCluster.d.ts delete mode 100644 node_modules/mysql2/typings/mysql/lib/PoolConnection.d.ts delete mode 100644 node_modules/mysql2/typings/mysql/lib/Server.d.ts delete mode 100644 node_modules/mysql2/typings/mysql/lib/constants/CharsetToEncoding.d.ts delete mode 100644 node_modules/mysql2/typings/mysql/lib/constants/Charsets.d.ts delete mode 100644 node_modules/mysql2/typings/mysql/lib/constants/Types.d.ts delete mode 100644 node_modules/mysql2/typings/mysql/lib/constants/index.d.ts delete mode 100644 node_modules/mysql2/typings/mysql/lib/parsers/ParserCache.d.ts delete mode 100644 node_modules/mysql2/typings/mysql/lib/parsers/index.d.ts delete mode 100644 node_modules/mysql2/typings/mysql/lib/protocol/packets/Field.d.ts delete mode 100644 node_modules/mysql2/typings/mysql/lib/protocol/packets/FieldPacket.d.ts delete mode 100644 node_modules/mysql2/typings/mysql/lib/protocol/packets/OkPacket.d.ts delete mode 100644 node_modules/mysql2/typings/mysql/lib/protocol/packets/ProcedurePacket.d.ts delete mode 100644 node_modules/mysql2/typings/mysql/lib/protocol/packets/ResultSetHeader.d.ts delete mode 100644 node_modules/mysql2/typings/mysql/lib/protocol/packets/RowDataPacket.d.ts delete mode 100644 node_modules/mysql2/typings/mysql/lib/protocol/packets/index.d.ts delete mode 100644 node_modules/mysql2/typings/mysql/lib/protocol/packets/params/ErrorPacketParams.d.ts delete mode 100644 node_modules/mysql2/typings/mysql/lib/protocol/packets/params/OkPacketParams.d.ts delete mode 100644 node_modules/mysql2/typings/mysql/lib/protocol/sequences/ExecutableBase.d.ts delete mode 100644 node_modules/mysql2/typings/mysql/lib/protocol/sequences/Prepare.d.ts delete mode 100644 node_modules/mysql2/typings/mysql/lib/protocol/sequences/Query.d.ts delete mode 100644 node_modules/mysql2/typings/mysql/lib/protocol/sequences/QueryableBase.d.ts delete mode 100644 node_modules/mysql2/typings/mysql/lib/protocol/sequences/Sequence.d.ts delete mode 100644 node_modules/mysql2/typings/mysql/lib/protocol/sequences/promise/ExecutableBase.d.ts delete mode 100644 node_modules/mysql2/typings/mysql/lib/protocol/sequences/promise/QueryableBase.d.ts delete mode 100644 node_modules/named-placeholders/README.md delete mode 100644 node_modules/named-placeholders/index.js delete mode 100644 node_modules/named-placeholders/node_modules/lru-cache/LICENSE delete mode 100644 node_modules/named-placeholders/node_modules/lru-cache/README.md delete mode 100644 node_modules/named-placeholders/node_modules/lru-cache/index.d.ts delete mode 100644 node_modules/named-placeholders/node_modules/lru-cache/index.js delete mode 100644 node_modules/named-placeholders/node_modules/lru-cache/index.mjs delete mode 100644 node_modules/named-placeholders/node_modules/lru-cache/package.json delete mode 100644 node_modules/named-placeholders/package.json create mode 100644 node_modules/process-nextick-args/index.js rename node_modules/{@eonasdan/tempus-dominus/LICENSE => process-nextick-args/license.md} (85%) create mode 100644 node_modules/process-nextick-args/package.json create mode 100644 node_modules/process-nextick-args/readme.md create mode 100644 node_modules/readable-stream/.travis.yml create mode 100644 node_modules/readable-stream/CONTRIBUTING.md create mode 100644 node_modules/readable-stream/GOVERNANCE.md create mode 100644 node_modules/readable-stream/LICENSE create mode 100644 node_modules/readable-stream/README.md create mode 100644 node_modules/readable-stream/doc/wg-meetings/2015-01-30.md create mode 100644 node_modules/readable-stream/duplex-browser.js create mode 100644 node_modules/readable-stream/duplex.js create mode 100644 node_modules/readable-stream/lib/_stream_duplex.js create mode 100644 node_modules/readable-stream/lib/_stream_passthrough.js create mode 100644 node_modules/readable-stream/lib/_stream_readable.js create mode 100644 node_modules/readable-stream/lib/_stream_transform.js create mode 100644 node_modules/readable-stream/lib/_stream_writable.js create mode 100644 node_modules/readable-stream/lib/internal/streams/BufferList.js create mode 100644 node_modules/readable-stream/lib/internal/streams/destroy.js create mode 100644 node_modules/readable-stream/lib/internal/streams/stream-browser.js create mode 100644 node_modules/readable-stream/lib/internal/streams/stream.js rename node_modules/{generate-function => readable-stream/node_modules/safe-buffer}/LICENSE (95%) create mode 100644 node_modules/readable-stream/node_modules/safe-buffer/README.md create mode 100644 node_modules/readable-stream/node_modules/safe-buffer/index.d.ts create mode 100644 node_modules/readable-stream/node_modules/safe-buffer/index.js create mode 100644 node_modules/readable-stream/node_modules/safe-buffer/package.json create mode 100644 node_modules/readable-stream/package.json create mode 100644 node_modules/readable-stream/passthrough.js create mode 100644 node_modules/readable-stream/readable-browser.js create mode 100644 node_modules/readable-stream/readable.js create mode 100644 node_modules/readable-stream/transform.js create mode 100644 node_modules/readable-stream/writable-browser.js create mode 100644 node_modules/readable-stream/writable.js delete mode 100644 node_modules/router/HISTORY.md delete mode 100644 node_modules/router/LICENSE delete mode 100644 node_modules/router/README.md delete mode 100644 node_modules/router/index.js delete mode 100644 node_modules/router/lib/layer.js delete mode 100644 node_modules/router/lib/route.js delete mode 100644 node_modules/router/node_modules/array-flatten/LICENSE delete mode 100644 node_modules/router/node_modules/array-flatten/README.md delete mode 100644 node_modules/router/node_modules/array-flatten/array-flatten.d.ts delete mode 100644 node_modules/router/node_modules/array-flatten/array-flatten.js delete mode 100644 node_modules/router/node_modules/array-flatten/package.json delete mode 100644 node_modules/router/node_modules/debug/.jshintrc delete mode 100644 node_modules/router/node_modules/debug/.npmignore delete mode 100644 node_modules/router/node_modules/debug/History.md delete mode 100644 node_modules/router/node_modules/debug/Makefile delete mode 100644 node_modules/router/node_modules/debug/Readme.md delete mode 100644 node_modules/router/node_modules/debug/bower.json delete mode 100644 node_modules/router/node_modules/debug/browser.js delete mode 100644 node_modules/router/node_modules/debug/component.json delete mode 100644 node_modules/router/node_modules/debug/debug.js delete mode 100644 node_modules/router/node_modules/debug/node.js delete mode 100644 node_modules/router/node_modules/debug/package.json delete mode 100644 node_modules/router/node_modules/ms/.npmignore delete mode 100644 node_modules/router/node_modules/ms/History.md delete mode 100644 node_modules/router/node_modules/ms/LICENSE delete mode 100644 node_modules/router/node_modules/ms/README.md delete mode 100644 node_modules/router/node_modules/ms/index.js delete mode 100644 node_modules/router/node_modules/ms/package.json delete mode 100644 node_modules/router/node_modules/path-to-regexp/History.md delete mode 100644 node_modules/router/node_modules/path-to-regexp/LICENSE delete mode 100644 node_modules/router/node_modules/path-to-regexp/Readme.md delete mode 100644 node_modules/router/node_modules/path-to-regexp/index.js delete mode 100644 node_modules/router/node_modules/path-to-regexp/package.json delete mode 100644 node_modules/router/node_modules/setprototypeof/LICENSE delete mode 100644 node_modules/router/node_modules/setprototypeof/README.md delete mode 100644 node_modules/router/node_modules/setprototypeof/index.js delete mode 100644 node_modules/router/node_modules/setprototypeof/package.json delete mode 100644 node_modules/router/package.json rename node_modules/{send/node_modules/http-errors => safe-buffer}/LICENSE (95%) create mode 100644 node_modules/safe-buffer/README.md create mode 100644 node_modules/safe-buffer/index.d.ts create mode 100644 node_modules/safe-buffer/index.js create mode 100644 node_modules/safe-buffer/package.json create mode 100644 node_modules/send/SECURITY.md delete mode 100644 node_modules/send/node_modules/debug/.jshintrc delete mode 100644 node_modules/send/node_modules/debug/.npmignore delete mode 100644 node_modules/send/node_modules/debug/History.md delete mode 100644 node_modules/send/node_modules/debug/Makefile delete mode 100644 node_modules/send/node_modules/debug/Readme.md delete mode 100644 node_modules/send/node_modules/debug/bower.json delete mode 100644 node_modules/send/node_modules/debug/browser.js delete mode 100644 node_modules/send/node_modules/debug/component.json delete mode 100644 node_modules/send/node_modules/debug/debug.js delete mode 100644 node_modules/send/node_modules/debug/node.js delete mode 100644 node_modules/send/node_modules/debug/package.json delete mode 100644 node_modules/send/node_modules/depd/History.md delete mode 100644 node_modules/send/node_modules/depd/Readme.md delete mode 100644 node_modules/send/node_modules/depd/index.js delete mode 100644 node_modules/send/node_modules/depd/lib/compat/buffer-concat.js delete mode 100644 node_modules/send/node_modules/depd/lib/compat/callsite-tostring.js delete mode 100644 node_modules/send/node_modules/depd/lib/compat/index.js delete mode 100644 node_modules/send/node_modules/depd/package.json delete mode 100644 node_modules/send/node_modules/destroy/README.md delete mode 100644 node_modules/send/node_modules/destroy/index.js delete mode 100644 node_modules/send/node_modules/destroy/package.json delete mode 100644 node_modules/send/node_modules/http-errors/HISTORY.md delete mode 100644 node_modules/send/node_modules/http-errors/README.md delete mode 100644 node_modules/send/node_modules/http-errors/index.js delete mode 100644 node_modules/send/node_modules/http-errors/package.json delete mode 100644 node_modules/send/node_modules/ms/.npmignore delete mode 100644 node_modules/send/node_modules/ms/History.md delete mode 100644 node_modules/send/node_modules/ms/LICENSE rename node_modules/{named-placeholders/LICENSE => send/node_modules/ms/license.md} (96%) delete mode 100644 node_modules/send/node_modules/on-finished/HISTORY.md delete mode 100644 node_modules/send/node_modules/on-finished/LICENSE delete mode 100644 node_modules/send/node_modules/on-finished/README.md delete mode 100644 node_modules/send/node_modules/on-finished/index.js delete mode 100644 node_modules/send/node_modules/on-finished/package.json delete mode 100644 node_modules/send/node_modules/statuses/README.md delete mode 100644 node_modules/send/node_modules/statuses/codes.json delete mode 100644 node_modules/send/node_modules/statuses/index.js delete mode 100644 node_modules/send/node_modules/statuses/package.json delete mode 100644 node_modules/seq-queue/.jshintrc delete mode 100644 node_modules/seq-queue/.npmignore delete mode 100644 node_modules/seq-queue/AUTHORS delete mode 100644 node_modules/seq-queue/LICENSE delete mode 100644 node_modules/seq-queue/Makefile delete mode 100644 node_modules/seq-queue/README.md delete mode 100644 node_modules/seq-queue/index.js delete mode 100644 node_modules/seq-queue/lib/.npmignore delete mode 100644 node_modules/seq-queue/lib/seq-queue.js delete mode 100644 node_modules/seq-queue/package.json delete mode 100644 node_modules/seq-queue/test/seq-queue-test.js delete mode 100644 node_modules/serve-static/node_modules/debug/.jshintrc delete mode 100644 node_modules/serve-static/node_modules/debug/.npmignore delete mode 100644 node_modules/serve-static/node_modules/debug/History.md delete mode 100644 node_modules/serve-static/node_modules/debug/Makefile delete mode 100644 node_modules/serve-static/node_modules/debug/Readme.md delete mode 100644 node_modules/serve-static/node_modules/debug/bower.json delete mode 100644 node_modules/serve-static/node_modules/debug/browser.js delete mode 100644 node_modules/serve-static/node_modules/debug/component.json delete mode 100644 node_modules/serve-static/node_modules/debug/debug.js delete mode 100644 node_modules/serve-static/node_modules/debug/node.js delete mode 100644 node_modules/serve-static/node_modules/debug/package.json delete mode 100644 node_modules/serve-static/node_modules/depd/History.md delete mode 100644 node_modules/serve-static/node_modules/depd/LICENSE delete mode 100644 node_modules/serve-static/node_modules/depd/Readme.md delete mode 100644 node_modules/serve-static/node_modules/depd/index.js delete mode 100644 node_modules/serve-static/node_modules/depd/lib/browser/index.js delete mode 100644 node_modules/serve-static/node_modules/depd/lib/compat/callsite-tostring.js delete mode 100644 node_modules/serve-static/node_modules/depd/lib/compat/event-listener-count.js delete mode 100644 node_modules/serve-static/node_modules/depd/lib/compat/index.js delete mode 100644 node_modules/serve-static/node_modules/depd/package.json delete mode 100644 node_modules/serve-static/node_modules/destroy/LICENSE delete mode 100644 node_modules/serve-static/node_modules/destroy/README.md delete mode 100644 node_modules/serve-static/node_modules/destroy/index.js delete mode 100644 node_modules/serve-static/node_modules/destroy/package.json delete mode 100644 node_modules/serve-static/node_modules/escape-html/LICENSE delete mode 100644 node_modules/serve-static/node_modules/escape-html/Readme.md delete mode 100644 node_modules/serve-static/node_modules/escape-html/index.js delete mode 100644 node_modules/serve-static/node_modules/escape-html/package.json delete mode 100644 node_modules/serve-static/node_modules/http-errors/HISTORY.md delete mode 100644 node_modules/serve-static/node_modules/http-errors/LICENSE delete mode 100644 node_modules/serve-static/node_modules/http-errors/README.md delete mode 100644 node_modules/serve-static/node_modules/http-errors/index.js delete mode 100644 node_modules/serve-static/node_modules/http-errors/package.json delete mode 100644 node_modules/serve-static/node_modules/ms/.npmignore delete mode 100644 node_modules/serve-static/node_modules/ms/History.md delete mode 100644 node_modules/serve-static/node_modules/ms/LICENSE delete mode 100644 node_modules/serve-static/node_modules/ms/README.md delete mode 100644 node_modules/serve-static/node_modules/ms/index.js delete mode 100644 node_modules/serve-static/node_modules/ms/package.json delete mode 100644 node_modules/serve-static/node_modules/on-finished/HISTORY.md delete mode 100644 node_modules/serve-static/node_modules/on-finished/LICENSE delete mode 100644 node_modules/serve-static/node_modules/on-finished/README.md delete mode 100644 node_modules/serve-static/node_modules/on-finished/index.js delete mode 100644 node_modules/serve-static/node_modules/on-finished/package.json delete mode 100644 node_modules/serve-static/node_modules/send/HISTORY.md delete mode 100644 node_modules/serve-static/node_modules/send/LICENSE delete mode 100644 node_modules/serve-static/node_modules/send/README.md delete mode 100644 node_modules/serve-static/node_modules/send/index.js delete mode 100644 node_modules/serve-static/node_modules/send/package.json delete mode 100644 node_modules/serve-static/node_modules/statuses/LICENSE delete mode 100644 node_modules/serve-static/node_modules/statuses/README.md delete mode 100644 node_modules/serve-static/node_modules/statuses/codes.json delete mode 100644 node_modules/serve-static/node_modules/statuses/index.js delete mode 100644 node_modules/serve-static/node_modules/statuses/package.json create mode 100644 node_modules/utils-merge/.npmignore delete mode 100644 node_modules/utils-merge/.travis.yml rename public/{session.js => scripts-session.js} (94%) diff --git a/.gitignore b/.gitignore index 82b829a..e8e4620 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,3 @@ node_modules.zip .DS_Store node_modules/bcrypt.zip -.env -.env.prod diff --git a/app.js b/app.js index 2be76ce..05d83e3 100644 --- a/app.js +++ b/app.js @@ -1,5 +1,5 @@ const express = require('express') -const mysql = require("mysql2") +const mysql = require("mysql") const dotenv = require('dotenv') const app = express() const path = require("path") @@ -30,10 +30,19 @@ db.connect((error) => { app.set('view engine', 'hbs'); app.use(express.static(publicDir)); app.use('/css', express.static(__dirname + '/node_modules/bootstrap/dist/css')); -app.use('/css', express.static(__dirname + '/node_modules/@eonasdan/tempus-dominus/dist/css')); -app.use('/js', express.static(__dirname + '/node_modules/@eonasdan/tempus-dominus/dist/js')); app.use(bodyParser.urlencoded({extended: false})); -app.use(bodyParser.json()); +app.use(express.json()) + + +async function recupListeSessions() { + let today = functions.getNowDate("yyyymmdd"); + + // On récupère la liste des sessions actives et pour lesquelles il reste de la place + db.query('SELECT ID, topic, DATE_FORMAT(scheduled_on, "%d/%m/%Y") as "date", DATE_FORMAT(scheduled_on, "%Hh%i") as "heure", IF(nb_of_attended-nb_of_participants=0, true, false) as "maxAtteint" FROM session WHERE DATE_FORMAT(scheduled_on, "%Y%m%d") >= ?', [today], async (error, result) => { + if(error){ console.log(error); } + return result; + }); +} // ******************************************* Arrivée sur la page d'accueil ******************************************* diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json index 5a97aef..fc7424c 100644 --- a/node_modules/.package-lock.json +++ b/node_modules/.package-lock.json @@ -4,22 +4,6 @@ "lockfileVersion": 3, "requires": true, "packages": { - "node_modules/@eonasdan/tempus-dominus": { - "version": "6.7.19", - "resolved": "https://registry.npmjs.org/@eonasdan/tempus-dominus/-/tempus-dominus-6.7.19.tgz", - "integrity": "sha512-rUHm1lTZLWdYUBAJJvic1p4Df/0h0rqV523r+DZtCkfty2ejf9NDsTYw3Vi0acSCt2kqwXom9R8jslzxxVcfOw==", - "funding": { - "url": "https://ko-fi.com/eonasdan" - }, - "peerDependencies": { - "@popperjs/core": "^2.11.6" - }, - "peerDependenciesMeta": { - "@popperjs/core\"": { - "optional": true - } - } - }, "node_modules/@mapbox/node-pre-gyp": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz", @@ -57,6 +41,7 @@ "version": "2.11.8", "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", + "peer": true, "funding": { "type": "opencollective", "url": "https://opencollective.com/popperjs" @@ -68,12 +53,12 @@ "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" }, "node_modules/accepts": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.2.13.tgz", - "integrity": "sha512-R190A3EzrS4huFOVZajhXCYZt5p5yrkaQOB4nsWzfth0cYaDcSN5J86l58FJ1dt7igp37fB/QhnuFkGAJmr+eg==", + "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.6", - "negotiator": "0.5.3" + "mime-types": "~2.1.34", + "negotiator": "0.6.3" }, "engines": { "node": ">= 0.6" @@ -162,9 +147,9 @@ } }, "node_modules/array-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.0.tgz", - "integrity": "sha512-B9Cdx2PIqexNnAWplLzRP89pa0vcEMkHGKr6/CY0ZzuI1Z5o6E392/7OtSFyrzEIXZ/pDdoGRoDaWJHg9mJMaA==" + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" }, "node_modules/balanced-match": { "version": "1.0.2", @@ -184,6 +169,14 @@ "node": ">= 10.0.0" } }, + "node_modules/bignumber.js": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.0.tgz", + "integrity": "sha512-t/OYhhJ2SD+YGBQcjY8GzzDHEk9f3nerxjtfa6tlMXfe7frs/WozhvCNoGvpM0P3bNf3Gq5ZRMlGr5f3r4/N8A==", + "engines": { + "node": "*" + } + }, "node_modules/binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", @@ -193,12 +186,12 @@ } }, "node_modules/body-parser": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", - "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "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.5", + "content-type": "~1.0.4", "debug": "2.6.9", "depd": "2.0.0", "destroy": "1.2.0", @@ -206,7 +199,7 @@ "iconv-lite": "0.4.24", "on-finished": "2.4.1", "qs": "6.11.0", - "raw-body": "2.5.2", + "raw-body": "2.5.1", "type-is": "~1.6.18", "unpipe": "1.0.0" }, @@ -327,9 +320,12 @@ "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==" }, "node_modules/content-disposition": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.0.tgz", - "integrity": "sha512-PWzG8GssMHTPSLBoOeK5MvPPJeWU5ZVX8omvJC16BUH/nUX6J/jM/hgm/mrPWzTXVV3B3OoBhFdHXyGLU4TgUw==", + "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" } @@ -343,11 +339,11 @@ } }, "node_modules/cookie": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.1.3.tgz", - "integrity": "sha512-mWkFhcL+HVG1KjeCjEBVJJ7s4sAGMLiBDFSDs4bzzvgLZt7rW8BhP6XV/8b1+pNvx/skd3yYxPuaF3Z6LlQzyw==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", + "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", "engines": { - "node": "*" + "node": ">= 0.6" } }, "node_modules/cookie-parser": { @@ -375,6 +371,11 @@ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" + }, "node_modules/dateformat": { "version": "4.6.3", "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-4.6.3.tgz", @@ -409,14 +410,6 @@ "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==" }, - "node_modules/denque": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", - "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==", - "engines": { - "node": ">=0.10" - } - }, "node_modules/depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", @@ -463,101 +456,68 @@ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, - "node_modules/escape-html": { + "node_modules/encodeurl": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.2.tgz", - "integrity": "sha512-J5ahyCRC4liskWVAfkmosNWfG0eHQxI0W+Ko7k3cZaYVMfgt05dwZ68vw6S/TZM1BPvuTv3kq6CRCb7WWtBUVA==" + "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.7.0", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.7.0.tgz", - "integrity": "sha512-Mbv5pNpLNPrm1b4rzZlZlfTRpdDr31oiD43N362sIyvSWVNu5Du33EcJGzvEV4YdYLuENB1HzND907cQkFmXNw==", + "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": "5.0.0-alpha.2", - "resolved": "https://registry.npmjs.org/express/-/express-5.0.0-alpha.2.tgz", - "integrity": "sha512-dCv747cpHLEUBzHm5MR8y6eq43izDxmfWtpq1oaTY3vlW3nlLugPob1rzg7/mul/a7o/Svg6SNx/oc/3fz61mA==", + "version": "4.18.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", + "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", "dependencies": { - "accepts": "~1.2.10", - "array-flatten": "1.1.0", - "content-disposition": "0.5.0", - "content-type": "~1.0.1", - "cookie": "0.1.3", + "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.2.0", - "depd": "~1.0.1", - "escape-html": "1.0.2", - "etag": "~1.7.0", - "finalhandler": "0.4.0", - "fresh": "0.3.0", - "merge-descriptors": "1.0.0", - "methods": "~1.1.1", - "on-finished": "~2.3.0", - "parseurl": "~1.3.0", - "path-is-absolute": "1.0.0", - "path-to-regexp": "0.1.6", - "proxy-addr": "~1.0.8", - "qs": "4.0.0", - "range-parser": "~1.0.2", - "router": "~1.1.2", - "send": "0.13.0", - "serve-static": "~1.10.0", - "type-is": "~1.6.4", - "utils-merge": "1.0.0", - "vary": "~1.0.0" + "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/node_modules/debug": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", - "integrity": "sha512-X0rGvJcskG1c3TgSCPqHJ0XJgwlcvOC7elJ5Y0hYuKBZoVqWpAMfLOeIh2UI/DCQ5ruodIjvsugZtjUYUw2pUw==", - "dependencies": { - "ms": "0.7.1" - } - }, - "node_modules/express/node_modules/depd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.0.1.tgz", - "integrity": "sha512-OEWAMbCkK9IWQ8pfTvHBhCSqHgR+sk5pbiYqq0FqfARG4Cy+cRsCbITx6wh5pcsmfBPiJAcbd98tfdz5fnBbag==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/express/node_modules/ms": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", - "integrity": "sha512-lRLiIR9fSNpnP6TC4v8+4OU7oStC01esuNowdQ34L+Gk8e5Puoc88IqJ+XAY/B3Mn2ZKis8l8HX90oU8ivzUHg==" - }, - "node_modules/express/node_modules/on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==", - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/express/node_modules/path-is-absolute": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz", - "integrity": "sha512-hUUTsB/vByumPhn43R+Azhsx4TQPvyQqW+XyCR6UA8ae+FGIjf5Oygj6o/FYK4ZdwnrXth2eIBKk4YlrUU0ElQ==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/express/node_modules/qs": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-4.0.0.tgz", - "integrity": "sha512-8MPmJ83uBOPsQj5tQCv4g04/nTiY+d17yl9o3Bw73vC6XlEm2POIRRlOgWJ8i74bkGLII670cDJJZkgiZ2sIkg==" - }, "node_modules/fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -570,60 +530,39 @@ } }, "node_modules/finalhandler": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-0.4.0.tgz", - "integrity": "sha512-jJU2WE88OqUvwAIf/1K2G2fTdKKZ8LvSwYQyFFekDcmBnBmht38enbcmErnA7iNZktcEo/o2JAHYbe1QDOAgaA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", "dependencies": { - "debug": "~2.2.0", - "escape-html": "1.0.2", - "on-finished": "~2.3.0", + "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/finalhandler/node_modules/debug": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", - "integrity": "sha512-X0rGvJcskG1c3TgSCPqHJ0XJgwlcvOC7elJ5Y0hYuKBZoVqWpAMfLOeIh2UI/DCQ5ruodIjvsugZtjUYUw2pUw==", - "dependencies": { - "ms": "0.7.1" - } - }, - "node_modules/finalhandler/node_modules/ms": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", - "integrity": "sha512-lRLiIR9fSNpnP6TC4v8+4OU7oStC01esuNowdQ34L+Gk8e5Puoc88IqJ+XAY/B3Mn2ZKis8l8HX90oU8ivzUHg==" - }, - "node_modules/finalhandler/node_modules/on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==", - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/foreachasync": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/foreachasync/-/foreachasync-3.0.0.tgz", "integrity": "sha512-J+ler7Ta54FwwNcx6wQRDhTIbNeyDcARMkOcguEqnEdtm0jKvN3Li3PDAb2Du3ubJYEWfYL83XMROXdsXAXycw==" }, "node_modules/forwarded": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", - "integrity": "sha512-Ua9xNhH0b8pwE3yRbFfXJvfdWF0UHNCdeyb2sbi9Ul/M+r3PTdrz7Cv4SCfZRMjmzEM9PhraqfZFbGTIg3OMyA==", + "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.3.0", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.3.0.tgz", - "integrity": "sha512-akx5WBKAwMSg36qoHTuMMVncHWctlaDGslJASDYAhoLrzDUDCjZlOngNa/iC6lPm9aA0qk8pN5KnpmbJHSIIQQ==", + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", "engines": { "node": ">= 0.6" } @@ -695,14 +634,6 @@ "node": ">=10" } }, - "node_modules/generate-function": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", - "integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==", - "dependencies": { - "is-property": "^1.0.2" - } - }, "node_modules/get-intrinsic": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.2.tgz", @@ -927,9 +858,9 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "node_modules/ipaddr.js": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.0.5.tgz", - "integrity": "sha512-wBj+q+3uP78gMowwWgFLAYm/q4x5goyZmDsmuvyz+nd1u0D/ghgXXtc1OkgmTzSiWT101kiqGacwFk9eGQw6xQ==", + "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" } @@ -980,15 +911,10 @@ "node": ">=0.12.0" } }, - "node_modules/is-property": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", - "integrity": "sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==" - }, - "node_modules/long": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", - "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" }, "node_modules/lru-cache": { "version": "6.0.0", @@ -1032,9 +958,9 @@ } }, "node_modules/merge-descriptors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.0.tgz", - "integrity": "sha512-YJiZmTZTkrqvgefMsWdioTKsZdHnfAhHHkEdPg+4PCqMJEGHQo5iJQjEbMv3XyBZ6y3Z2Rj1mqq1WNKq9e0yNw==" + "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", @@ -1045,11 +971,14 @@ } }, "node_modules/mime": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz", - "integrity": "sha512-sAaYXszED5ALBt665F0wMQCUXpGuZsGdopoqcHPdL39ZYdi7uHoZlhrfZfhv8WzivhBzr/oXwaj+yiK5wY8MXQ==", + "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": { @@ -1137,66 +1066,29 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" }, - "node_modules/mysql2": { - "version": "3.6.5", - "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.6.5.tgz", - "integrity": "sha512-pS/KqIb0xlXmtmqEuTvBXTmLoQ5LmAz5NW/r8UyQ1ldvnprNEj3P9GbmuQQ2J0A4LO+ynotGi6TbscPa8OUb+w==", + "node_modules/mysql": { + "version": "2.18.1", + "resolved": "https://registry.npmjs.org/mysql/-/mysql-2.18.1.tgz", + "integrity": "sha512-Bca+gk2YWmqp2Uf6k5NFEurwY/0td0cpebAucFpY/3jhrwrVGuxU2uQFCHjU19SJfje0yQvi+rVWdq78hR5lig==", "dependencies": { - "denque": "^2.1.0", - "generate-function": "^2.3.1", - "iconv-lite": "^0.6.3", - "long": "^5.2.1", - "lru-cache": "^8.0.0", - "named-placeholders": "^1.1.3", - "seq-queue": "^0.0.5", - "sqlstring": "^2.3.2" + "bignumber.js": "9.0.0", + "readable-stream": "2.3.7", + "safe-buffer": "5.1.2", + "sqlstring": "2.3.1" }, "engines": { - "node": ">= 8.0" + "node": ">= 0.6" } }, - "node_modules/mysql2/node_modules/iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/mysql2/node_modules/lru-cache": { - "version": "8.0.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-8.0.5.tgz", - "integrity": "sha512-MhWWlVnuab1RG5/zMRRcVGXZLCXrZTgfwMikgzCegsPnG62yDQo5JnqKkrK4jO5iKqDAZGItAqN5CtKBCBWRUA==", - "engines": { - "node": ">=16.14" - } - }, - "node_modules/named-placeholders": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.3.tgz", - "integrity": "sha512-eLoBxg6wE/rZkJPhU/xRX1WTpkFEwDJEN96oxFrTsqBdbT5ec295Q+CoHrL9IT0DipqKhmGcaZmwOt8OON5x1w==", - "dependencies": { - "lru-cache": "^7.14.1" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/named-placeholders/node_modules/lru-cache": { - "version": "7.18.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", - "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", - "engines": { - "node": ">=12" - } + "node_modules/mysql/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, "node_modules/negotiator": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.5.3.tgz", - "integrity": "sha512-oXmnazqehLNFohqgLxRyUdOQU9/UX0NpCpsnbjWUjM62ZM8oSOXYZpHc68XR130ftPNano0oQXGdREAplZRhaQ==", + "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" } @@ -1355,9 +1247,9 @@ } }, "node_modules/path-to-regexp": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.6.tgz", - "integrity": "sha512-Ut++lkiF1BogIUY+3SADhfDDdvzb8EOU/D8JutrlrfEuh+DGQbo5c78P96dSuapLEfeH7rpWhiBfJCDAGvSJVQ==" + "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/picomatch": { "version": "2.3.1", @@ -1370,16 +1262,21 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, "node_modules/proxy-addr": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-1.0.10.tgz", - "integrity": "sha512-iq6kR9KN32aFvXjDyC8nIrm203AHeIBPjL6dpaHgSdbpTO8KoPlD0xG92xwwtkCL9+yt1LE5VwpEk43TyP38Dg==", + "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.1.0", - "ipaddr.js": "1.0.5" + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" }, "engines": { - "node": ">= 0.6" + "node": ">= 0.10" } }, "node_modules/pstree.remy": { @@ -1402,17 +1299,17 @@ } }, "node_modules/range-parser": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.0.3.tgz", - "integrity": "sha512-nDsRrtIxVUO5opg/A8T2S3ebULVIfuh8ECbh4w3N4mWxIiT3QILDJDUQayPqm2e8Q8NUa0RSUkGCfe33AfjR3Q==", + "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.2", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", - "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "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", @@ -1423,6 +1320,25 @@ "node": ">= 0.8" } }, + "node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/readable-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, "node_modules/readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -1448,50 +1364,24 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/router": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/router/-/router-1.1.5.tgz", - "integrity": "sha512-p0l/vfNVavaB7DXh3BxJv3NMZi3QKEiIYDnLVyOV5Bo/7Uo3YYk3z65T2IJHG7cfC9QV8UanGhHLOIfPoS9A5g==", - "dependencies": { - "array-flatten": "2.1.1", - "debug": "~2.2.0", - "methods": "~1.1.2", - "parseurl": "~1.3.1", - "path-to-regexp": "0.1.7", - "setprototypeof": "1.0.2", - "utils-merge": "1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/router/node_modules/array-flatten": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-2.1.1.tgz", - "integrity": "sha512-Ylfqm/V1V/VKGazsJeRDZ31wV9gdNeK3ZsvwbYBAVSNgH8o8CMLfdx/ofn9pnMVsvTMfvC3yfcBYzGpD1vxnlw==" - }, - "node_modules/router/node_modules/debug": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", - "integrity": "sha512-X0rGvJcskG1c3TgSCPqHJ0XJgwlcvOC7elJ5Y0hYuKBZoVqWpAMfLOeIh2UI/DCQ5ruodIjvsugZtjUYUw2pUw==", - "dependencies": { - "ms": "0.7.1" - } - }, - "node_modules/router/node_modules/ms": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", - "integrity": "sha512-lRLiIR9fSNpnP6TC4v8+4OU7oStC01esuNowdQ34L+Gk8e5Puoc88IqJ+XAY/B3Mn2ZKis8l8HX90oU8ivzUHg==" - }, - "node_modules/router/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/router/node_modules/setprototypeof": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.2.tgz", - "integrity": "sha512-mNRSo7UFE4c4tjxlZ3KxO5r+3oQUD1M/KXbp/XTwTwybL4VR9T8Ltmv5DvZX8iRz6C3hQmQftXEV0EmTKRV6mg==" + "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", @@ -1513,180 +1403,47 @@ } }, "node_modules/send": { - "version": "0.13.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.13.0.tgz", - "integrity": "sha512-zck2y84i0SbUUiwq2l5gGPNVpCplL48og5xIhFjNjQa09003YCTy6Vb3rKfVuG8W8PWNUtUOntjQEBdwkJ9oBw==", + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", "dependencies": { - "debug": "~2.2.0", - "depd": "~1.0.1", - "destroy": "1.0.3", - "escape-html": "1.0.2", - "etag": "~1.7.0", - "fresh": "0.3.0", - "http-errors": "~1.3.1", - "mime": "1.3.4", - "ms": "0.7.1", - "on-finished": "~2.3.0", - "range-parser": "~1.0.2", - "statuses": "~1.2.1" + "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/debug": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", - "integrity": "sha512-X0rGvJcskG1c3TgSCPqHJ0XJgwlcvOC7elJ5Y0hYuKBZoVqWpAMfLOeIh2UI/DCQ5ruodIjvsugZtjUYUw2pUw==", - "dependencies": { - "ms": "0.7.1" - } - }, - "node_modules/send/node_modules/depd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.0.1.tgz", - "integrity": "sha512-OEWAMbCkK9IWQ8pfTvHBhCSqHgR+sk5pbiYqq0FqfARG4Cy+cRsCbITx6wh5pcsmfBPiJAcbd98tfdz5fnBbag==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/send/node_modules/destroy": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.3.tgz", - "integrity": "sha512-KB/AVLKRwZPOEo6/lxkDJ+Bv3jFRRrhmnRMPvpWwmIfUggpzGkQBqolyo8FRf833b/F5rzmy1uVN3fHBkjTxgw==" - }, - "node_modules/send/node_modules/http-errors": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.3.1.tgz", - "integrity": "sha512-gMygNskMurDCWfoCdyh1gOeDfSbkAHXqz94QoPj5IHIUjC/BG8/xv7FSEUr7waR5RcAya4j58bft9Wu/wHNeXA==", - "dependencies": { - "inherits": "~2.0.1", - "statuses": "1" - }, - "engines": { - "node": ">= 0.6" - } - }, "node_modules/send/node_modules/ms": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", - "integrity": "sha512-lRLiIR9fSNpnP6TC4v8+4OU7oStC01esuNowdQ34L+Gk8e5Puoc88IqJ+XAY/B3Mn2ZKis8l8HX90oU8ivzUHg==" - }, - "node_modules/send/node_modules/on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==", - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/send/node_modules/statuses": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.2.1.tgz", - "integrity": "sha512-pVEuxHdSGrt8QmQ3LOZXLhSA6MP/iPqKzZeO6Squ7PNGkA/9MBsSfV0/L+bIxkoDmjF4tZcLpcVq/fkqoHvuKg==" - }, - "node_modules/seq-queue": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/seq-queue/-/seq-queue-0.0.5.tgz", - "integrity": "sha512-hr3Wtp/GZIc/6DAGPDcV4/9WoZhjrkXsi5B/07QgX8tsdc6ilr7BFM6PM6rbdAX1kFSDYeZGLipIZZKyQP0O5Q==" + "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.10.3", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.10.3.tgz", - "integrity": "sha512-ScsFovjz3Db+vGgpofR/U8p8UULEcGV9akqyo8TQ1mMnjcxemE7Y5Muo+dvy3tJLY/doY2v1H61eCBMYGmwfrA==", + "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.1", - "send": "0.13.2" + "parseurl": "~1.3.3", + "send": "0.18.0" }, "engines": { "node": ">= 0.8.0" } }, - "node_modules/serve-static/node_modules/debug": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", - "integrity": "sha512-X0rGvJcskG1c3TgSCPqHJ0XJgwlcvOC7elJ5Y0hYuKBZoVqWpAMfLOeIh2UI/DCQ5ruodIjvsugZtjUYUw2pUw==", - "dependencies": { - "ms": "0.7.1" - } - }, - "node_modules/serve-static/node_modules/depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/serve-static/node_modules/destroy": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", - "integrity": "sha512-3NdhDuEXnfun/z7x9GOElY49LoqVHoGScmOKwmxhsS8N5Y+Z8KyPPDnaSzqWgYt/ji4mqwfTS34Htrk0zPIXVg==" - }, - "node_modules/serve-static/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/serve-static/node_modules/http-errors": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.3.1.tgz", - "integrity": "sha512-gMygNskMurDCWfoCdyh1gOeDfSbkAHXqz94QoPj5IHIUjC/BG8/xv7FSEUr7waR5RcAya4j58bft9Wu/wHNeXA==", - "dependencies": { - "inherits": "~2.0.1", - "statuses": "1" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/serve-static/node_modules/ms": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", - "integrity": "sha512-lRLiIR9fSNpnP6TC4v8+4OU7oStC01esuNowdQ34L+Gk8e5Puoc88IqJ+XAY/B3Mn2ZKis8l8HX90oU8ivzUHg==" - }, - "node_modules/serve-static/node_modules/on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==", - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/serve-static/node_modules/send": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/send/-/send-0.13.2.tgz", - "integrity": "sha512-cQ0rmXHrdO2Iof08igV2bG/yXWD106ANwBg6DkGQNT2Vsznbgq6T0oAIQboy1GoFsIuy51jCim26aA9tj3Z3Zg==", - "dependencies": { - "debug": "~2.2.0", - "depd": "~1.1.0", - "destroy": "~1.0.4", - "escape-html": "~1.0.3", - "etag": "~1.7.0", - "fresh": "0.3.0", - "http-errors": "~1.3.1", - "mime": "1.3.4", - "ms": "0.7.1", - "on-finished": "~2.3.0", - "range-parser": "~1.0.3", - "statuses": "~1.2.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/serve-static/node_modules/statuses": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.2.1.tgz", - "integrity": "sha512-pVEuxHdSGrt8QmQ3LOZXLhSA6MP/iPqKzZeO6Squ7PNGkA/9MBsSfV0/L+bIxkoDmjF4tZcLpcVq/fkqoHvuKg==" - }, "node_modules/set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", @@ -1749,9 +1506,9 @@ } }, "node_modules/sqlstring": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.3.tgz", - "integrity": "sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.1.tgz", + "integrity": "sha512-ooAzh/7dxIG5+uDik1z/Rd1vli0+38izZhGzSa34FwR7IbelPWCCKSNIl8jlL/F7ERvy8CB2jNeM1E9i9mXMAQ==", "engines": { "node": ">= 0.6" } @@ -1906,9 +1663,9 @@ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" }, "node_modules/utils-merge": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.0.tgz", - "integrity": "sha512-HwU9SLQEtyo+0uoKXd1nkLqigUWLB+QuNQR4OcmB73eWqksM5ovuqcycks2x043W8XVb75rG1HQ0h93TMXkzQQ==", + "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" } @@ -1926,9 +1683,9 @@ } }, "node_modules/vary": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.0.1.tgz", - "integrity": "sha512-yNsH+tC0r8quK2tg/yqkXqqaYzeKTkSqQ+8T6xCoWgOi/bU/omMYz+6k+I91JJJDeltJzI7oridTOq6OYkY0Tw==", + "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" } diff --git a/node_modules/@eonasdan/tempus-dominus/README.md b/node_modules/@eonasdan/tempus-dominus/README.md deleted file mode 100644 index 80f4593..0000000 --- a/node_modules/@eonasdan/tempus-dominus/README.md +++ /dev/null @@ -1,31 +0,0 @@ -[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/R6R53OEFF) - -# Tempus Dominus Date/Time Picker v6.7.19 - -Tempus Dominus is a powerful and robust date time picker for javascript. Version 6 is another major rewrite over the previous version. V6 is written with modern browsers in mind and is written in typescript. Bootstrap, momentjs and jQuery are no longer required dependencies. Popper2 is all that is required for the picker to position correctly. If you still require jQuery (seriously, you should move off that asap) there's a jQuery provider that wraps the native js functions. - -# Developers - -## Building - -Run `npm i` to install needed packages. - -The docs folder contains the generated documentation site, don't modify this directly as it will be overwritten on build. The dist folder contains the built js/css files. - -## Running - -You can run `npm run serve` which will start a web server. Navigate to `http://localhost:3001/` to view the docs. - -## Watching for changes - -Do not run `npm run serve` at the same time. - -Run `npm start`. This runs web server, the build and watchers for the docs, styles, and typescript. - -## Where do you use this? - -I'd love to know if your public site is using this plugin and list your logo on the documentation site. Leave [create a discussion](https://github.com/Eonasdan/tempus-dominus/discussions/categories/show-your-love) and let me know. - -## Priority support is available at an hourly rate. - -If you have an urgent request, bug or need installation help, please contact in the discord server. diff --git a/node_modules/@eonasdan/tempus-dominus/dist/css/tempus-dominus.css b/node_modules/@eonasdan/tempus-dominus/dist/css/tempus-dominus.css deleted file mode 100644 index 2c830b1..0000000 --- a/node_modules/@eonasdan/tempus-dominus/dist/css/tempus-dominus.css +++ /dev/null @@ -1,700 +0,0 @@ -.visually-hidden, .tempus-dominus-widget [data-action]::after { - position: absolute !important; - width: 1px !important; - height: 1px !important; - padding: 0 !important; - margin: -1px !important; - overflow: hidden !important; - clip: rect(0, 0, 0, 0) !important; - white-space: nowrap !important; - border: 0 !important; -} - -.tempus-dominus-widget { - list-style: none; - padding: 4px; - width: 19rem; - border-radius: 4px; - display: none; - z-index: 9999; - box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.2), 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12); -} -.tempus-dominus-widget.calendarWeeks { - width: 21rem; -} -.tempus-dominus-widget.calendarWeeks .date-container-days { - grid-auto-columns: 12.5%; - grid-template-areas: "a a a a a a a a"; -} -.tempus-dominus-widget [data-action] { - cursor: pointer; -} -.tempus-dominus-widget [data-action]::after { - content: attr(title); -} -.tempus-dominus-widget [data-action].disabled, .tempus-dominus-widget [data-action].disabled:hover { - background: none; - cursor: not-allowed; -} -.tempus-dominus-widget .arrow { - display: none; -} -.tempus-dominus-widget.show { - display: block; -} -.tempus-dominus-widget.show.date-container { - min-height: 315px; -} -.tempus-dominus-widget.show.time-container { - min-height: 217px; -} -.tempus-dominus-widget .td-collapse:not(.show) { - display: none; -} -.tempus-dominus-widget .td-collapsing { - height: 0; - overflow: hidden; - transition: height 0.35s ease; -} -@media (min-width: 576px) { - .tempus-dominus-widget.timepicker-sbs { - width: 38em; - } -} -@media (min-width: 768px) { - .tempus-dominus-widget.timepicker-sbs { - width: 38em; - } -} -@media (min-width: 992px) { - .tempus-dominus-widget.timepicker-sbs { - width: 38em; - } -} -.tempus-dominus-widget.timepicker-sbs .td-row { - display: flex; -} -.tempus-dominus-widget.timepicker-sbs .td-row .td-half { - flex: 0 0 auto; - width: 50%; -} -.tempus-dominus-widget div[data-action]:active { - box-shadow: none; -} -.tempus-dominus-widget .timepicker-hour, -.tempus-dominus-widget .timepicker-minute, -.tempus-dominus-widget .timepicker-second { - width: 54px; - font-weight: bold; - font-size: 1.2em; - margin: 0; -} -.tempus-dominus-widget button[data-action] { - padding: 6px; -} -.tempus-dominus-widget .toggleMeridiem { - text-align: center; - height: 38px; -} -.tempus-dominus-widget .calendar-header { - display: grid; - grid-template-areas: "a a a"; - margin-bottom: 10px; - font-weight: bold; -} -.tempus-dominus-widget .calendar-header .next { - text-align: right; - padding-right: 10px; -} -.tempus-dominus-widget .calendar-header .previous { - text-align: left; - padding-left: 10px; -} -.tempus-dominus-widget .calendar-header .picker-switch { - text-align: center; -} -.tempus-dominus-widget .toolbar { - display: grid; - grid-auto-flow: column; - grid-auto-rows: 40px; -} -.tempus-dominus-widget .toolbar div { - border-radius: 999px; - align-items: center; - justify-content: center; - box-sizing: border-box; - display: flex; -} -.tempus-dominus-widget .date-container-days { - display: grid; - grid-template-areas: "a a a a a a a"; - grid-auto-rows: 40px; - grid-auto-columns: 14.2857142857%; -} -.tempus-dominus-widget .date-container-days .range-in { - background-color: #01419e !important; - border: none; - border-radius: 0 !important; - box-shadow: -5px 0 0 #01419e, 5px 0 0 #01419e; -} -.tempus-dominus-widget .date-container-days .range-end { - border-radius: 0 50px 50px 0 !important; -} -.tempus-dominus-widget .date-container-days .range-start { - border-radius: 50px 0 0 50px !important; -} -.tempus-dominus-widget .date-container-days .dow { - align-items: center; - justify-content: center; - text-align: center; -} -.tempus-dominus-widget .date-container-days .cw { - width: 90%; - height: 90%; - align-items: center; - justify-content: center; - display: flex; - font-size: 0.8em; - line-height: 20px; - cursor: default; -} -.tempus-dominus-widget .date-container-decades, -.tempus-dominus-widget .date-container-years, -.tempus-dominus-widget .date-container-months { - display: grid; - grid-template-areas: "a a a"; - grid-auto-rows: calc((19rem - 8px) / 7); -} -.tempus-dominus-widget .time-container-hour, -.tempus-dominus-widget .time-container-minute, -.tempus-dominus-widget .time-container-second { - display: grid; - grid-template-areas: "a a a a"; - grid-auto-rows: calc((19rem - 8px) / 7); -} -.tempus-dominus-widget .time-container-clock { - display: grid; - grid-auto-rows: calc((19rem - 8px) / 7); -} -.tempus-dominus-widget .time-container-clock .no-highlight { - width: 90%; - height: 90%; - align-items: center; - justify-content: center; - display: flex; -} -.tempus-dominus-widget .date-container-decades div:not(.no-highlight), -.tempus-dominus-widget .date-container-years div:not(.no-highlight), -.tempus-dominus-widget .date-container-months div:not(.no-highlight), -.tempus-dominus-widget .date-container-days div:not(.no-highlight), -.tempus-dominus-widget .time-container-clock div:not(.no-highlight), -.tempus-dominus-widget .time-container-hour div:not(.no-highlight), -.tempus-dominus-widget .time-container-minute div:not(.no-highlight), -.tempus-dominus-widget .time-container-second div:not(.no-highlight) { - width: 90%; - height: 90%; - border-radius: 999px; - align-items: center; - justify-content: center; - box-sizing: border-box; - display: flex; -} -.tempus-dominus-widget .date-container-decades div:not(.no-highlight).disabled, .tempus-dominus-widget .date-container-decades div:not(.no-highlight).disabled:hover, -.tempus-dominus-widget .date-container-years div:not(.no-highlight).disabled, -.tempus-dominus-widget .date-container-years div:not(.no-highlight).disabled:hover, -.tempus-dominus-widget .date-container-months div:not(.no-highlight).disabled, -.tempus-dominus-widget .date-container-months div:not(.no-highlight).disabled:hover, -.tempus-dominus-widget .date-container-days div:not(.no-highlight).disabled, -.tempus-dominus-widget .date-container-days div:not(.no-highlight).disabled:hover, -.tempus-dominus-widget .time-container-clock div:not(.no-highlight).disabled, -.tempus-dominus-widget .time-container-clock div:not(.no-highlight).disabled:hover, -.tempus-dominus-widget .time-container-hour div:not(.no-highlight).disabled, -.tempus-dominus-widget .time-container-hour div:not(.no-highlight).disabled:hover, -.tempus-dominus-widget .time-container-minute div:not(.no-highlight).disabled, -.tempus-dominus-widget .time-container-minute div:not(.no-highlight).disabled:hover, -.tempus-dominus-widget .time-container-second div:not(.no-highlight).disabled, -.tempus-dominus-widget .time-container-second div:not(.no-highlight).disabled:hover { - background: none; - cursor: not-allowed; -} -.tempus-dominus-widget .date-container-decades div:not(.no-highlight).today, -.tempus-dominus-widget .date-container-years div:not(.no-highlight).today, -.tempus-dominus-widget .date-container-months div:not(.no-highlight).today, -.tempus-dominus-widget .date-container-days div:not(.no-highlight).today, -.tempus-dominus-widget .time-container-clock div:not(.no-highlight).today, -.tempus-dominus-widget .time-container-hour div:not(.no-highlight).today, -.tempus-dominus-widget .time-container-minute div:not(.no-highlight).today, -.tempus-dominus-widget .time-container-second div:not(.no-highlight).today { - position: relative; -} -.tempus-dominus-widget .date-container-decades div:not(.no-highlight).today:before, -.tempus-dominus-widget .date-container-years div:not(.no-highlight).today:before, -.tempus-dominus-widget .date-container-months div:not(.no-highlight).today:before, -.tempus-dominus-widget .date-container-days div:not(.no-highlight).today:before, -.tempus-dominus-widget .time-container-clock div:not(.no-highlight).today:before, -.tempus-dominus-widget .time-container-hour div:not(.no-highlight).today:before, -.tempus-dominus-widget .time-container-minute div:not(.no-highlight).today:before, -.tempus-dominus-widget .time-container-second div:not(.no-highlight).today:before { - content: ""; - display: inline-block; - border: solid transparent; - border-width: 0 0 7px 7px; - position: absolute; - bottom: 6px; - right: 6px; -} -.tempus-dominus-widget .time-container { - margin-bottom: 0.5rem; -} -.tempus-dominus-widget button { - display: inline-block; - font-weight: 400; - line-height: 1.5; - text-align: center; - text-decoration: none; - vertical-align: middle; - cursor: pointer; - -webkit-user-select: none; - -moz-user-select: none; - user-select: none; - padding: 0.375rem 0.75rem; - font-size: 1rem; - border-radius: 0.25rem; - transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; -} -.tempus-dominus-widget.tempus-dominus-widget-readonly table td.day, -.tempus-dominus-widget.tempus-dominus-widget-readonly table td.hour, -.tempus-dominus-widget.tempus-dominus-widget-readonly table td.minute, -.tempus-dominus-widget.tempus-dominus-widget-readonly table td.second, -.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=incrementHours], -.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=incrementMinutes], -.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=incrementSeconds], -.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=decrementHours], -.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=decrementMinutes], -.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=decrementSeconds], -.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=showHours], -.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=showMinutes], -.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=showSeconds], -.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=togglePeriod] { - pointer-events: none; - cursor: default; -} -.tempus-dominus-widget.tempus-dominus-widget-readonly table td.day:hover, -.tempus-dominus-widget.tempus-dominus-widget-readonly table td.hour:hover, -.tempus-dominus-widget.tempus-dominus-widget-readonly table td.minute:hover, -.tempus-dominus-widget.tempus-dominus-widget-readonly table td.second:hover, -.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=incrementHours]:hover, -.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=incrementMinutes]:hover, -.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=incrementSeconds]:hover, -.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=decrementHours]:hover, -.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=decrementMinutes]:hover, -.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=decrementSeconds]:hover, -.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=showHours]:hover, -.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=showMinutes]:hover, -.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=showSeconds]:hover, -.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=togglePeriod]:hover { - background: none; -} -.tempus-dominus-widget.light { - color: #000; - background-color: #fff; -} -.tempus-dominus-widget.light [data-action].disabled, .tempus-dominus-widget.light [data-action].disabled:hover { - color: #6c757d; -} -.tempus-dominus-widget.light .toolbar div:hover { - background: #e9ecef; -} -.tempus-dominus-widget.light .date-container-days .dow { - color: rgba(0, 0, 0, 0.5); -} -.tempus-dominus-widget.light .date-container-days .cw { - color: rgba(0, 0, 0, 0.38); -} -.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight):hover, -.tempus-dominus-widget.light .date-container-years div:not(.no-highlight):hover, -.tempus-dominus-widget.light .date-container-months div:not(.no-highlight):hover, -.tempus-dominus-widget.light .date-container-days div:not(.no-highlight):hover, -.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight):hover, -.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight):hover, -.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight):hover, -.tempus-dominus-widget.light .time-container-second div:not(.no-highlight):hover { - background: #e9ecef; -} -.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).active, -.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).active, -.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).active, -.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).active, -.tempus-dominus-widget.light .date-container-days div.range-in:not(.no-highlight), -.tempus-dominus-widget.light .date-container-days div.range-end:not(.no-highlight), -.tempus-dominus-widget.light .date-container-days div.range-start:not(.no-highlight), -.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).active, -.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).active, -.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).active, -.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).active { - background-color: #0d6efd; - color: #fff; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); -} -.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).active.old, .tempus-dominus-widget.light .date-container-decades .date-container-days div.range-in:not(.no-highlight).old, .tempus-dominus-widget.light .date-container-days .date-container-decades div.range-in:not(.no-highlight).old, .tempus-dominus-widget.light .date-container-decades .date-container-days div.range-end:not(.no-highlight).old, .tempus-dominus-widget.light .date-container-days .date-container-decades div.range-end:not(.no-highlight).old, .tempus-dominus-widget.light .date-container-decades .date-container-days div.range-start:not(.no-highlight).old, .tempus-dominus-widget.light .date-container-days .date-container-decades div.range-start:not(.no-highlight).old, .tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).active.new, .tempus-dominus-widget.light .date-container-decades .date-container-days div.range-in:not(.no-highlight).new, .tempus-dominus-widget.light .date-container-days .date-container-decades div.range-in:not(.no-highlight).new, .tempus-dominus-widget.light .date-container-decades .date-container-days div.range-end:not(.no-highlight).new, .tempus-dominus-widget.light .date-container-days .date-container-decades div.range-end:not(.no-highlight).new, .tempus-dominus-widget.light .date-container-decades .date-container-days div.range-start:not(.no-highlight).new, .tempus-dominus-widget.light .date-container-days .date-container-decades div.range-start:not(.no-highlight).new, -.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).active.old, -.tempus-dominus-widget.light .date-container-years .date-container-days div.range-in:not(.no-highlight).old, -.tempus-dominus-widget.light .date-container-days .date-container-years div.range-in:not(.no-highlight).old, -.tempus-dominus-widget.light .date-container-years .date-container-days div.range-end:not(.no-highlight).old, -.tempus-dominus-widget.light .date-container-days .date-container-years div.range-end:not(.no-highlight).old, -.tempus-dominus-widget.light .date-container-years .date-container-days div.range-start:not(.no-highlight).old, -.tempus-dominus-widget.light .date-container-days .date-container-years div.range-start:not(.no-highlight).old, -.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).active.new, -.tempus-dominus-widget.light .date-container-years .date-container-days div.range-in:not(.no-highlight).new, -.tempus-dominus-widget.light .date-container-days .date-container-years div.range-in:not(.no-highlight).new, -.tempus-dominus-widget.light .date-container-years .date-container-days div.range-end:not(.no-highlight).new, -.tempus-dominus-widget.light .date-container-days .date-container-years div.range-end:not(.no-highlight).new, -.tempus-dominus-widget.light .date-container-years .date-container-days div.range-start:not(.no-highlight).new, -.tempus-dominus-widget.light .date-container-days .date-container-years div.range-start:not(.no-highlight).new, -.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).active.old, -.tempus-dominus-widget.light .date-container-months .date-container-days div.range-in:not(.no-highlight).old, -.tempus-dominus-widget.light .date-container-days .date-container-months div.range-in:not(.no-highlight).old, -.tempus-dominus-widget.light .date-container-months .date-container-days div.range-end:not(.no-highlight).old, -.tempus-dominus-widget.light .date-container-days .date-container-months div.range-end:not(.no-highlight).old, -.tempus-dominus-widget.light .date-container-months .date-container-days div.range-start:not(.no-highlight).old, -.tempus-dominus-widget.light .date-container-days .date-container-months div.range-start:not(.no-highlight).old, -.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).active.new, -.tempus-dominus-widget.light .date-container-months .date-container-days div.range-in:not(.no-highlight).new, -.tempus-dominus-widget.light .date-container-days .date-container-months div.range-in:not(.no-highlight).new, -.tempus-dominus-widget.light .date-container-months .date-container-days div.range-end:not(.no-highlight).new, -.tempus-dominus-widget.light .date-container-days .date-container-months div.range-end:not(.no-highlight).new, -.tempus-dominus-widget.light .date-container-months .date-container-days div.range-start:not(.no-highlight).new, -.tempus-dominus-widget.light .date-container-days .date-container-months div.range-start:not(.no-highlight).new, -.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).active.old, -.tempus-dominus-widget.light .date-container-days div.range-in:not(.no-highlight).old, -.tempus-dominus-widget.light .date-container-days div.range-end:not(.no-highlight).old, -.tempus-dominus-widget.light .date-container-days div.range-start:not(.no-highlight).old, -.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).active.new, -.tempus-dominus-widget.light .date-container-days div.range-in:not(.no-highlight).new, -.tempus-dominus-widget.light .date-container-days div.range-end:not(.no-highlight).new, -.tempus-dominus-widget.light .date-container-days div.range-start:not(.no-highlight).new, -.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).active.old, -.tempus-dominus-widget.light .time-container-clock .date-container-days div.range-in:not(.no-highlight).old, -.tempus-dominus-widget.light .date-container-days .time-container-clock div.range-in:not(.no-highlight).old, -.tempus-dominus-widget.light .time-container-clock .date-container-days div.range-end:not(.no-highlight).old, -.tempus-dominus-widget.light .date-container-days .time-container-clock div.range-end:not(.no-highlight).old, -.tempus-dominus-widget.light .time-container-clock .date-container-days div.range-start:not(.no-highlight).old, -.tempus-dominus-widget.light .date-container-days .time-container-clock div.range-start:not(.no-highlight).old, -.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).active.new, -.tempus-dominus-widget.light .time-container-clock .date-container-days div.range-in:not(.no-highlight).new, -.tempus-dominus-widget.light .date-container-days .time-container-clock div.range-in:not(.no-highlight).new, -.tempus-dominus-widget.light .time-container-clock .date-container-days div.range-end:not(.no-highlight).new, -.tempus-dominus-widget.light .date-container-days .time-container-clock div.range-end:not(.no-highlight).new, -.tempus-dominus-widget.light .time-container-clock .date-container-days div.range-start:not(.no-highlight).new, -.tempus-dominus-widget.light .date-container-days .time-container-clock div.range-start:not(.no-highlight).new, -.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).active.old, -.tempus-dominus-widget.light .time-container-hour .date-container-days div.range-in:not(.no-highlight).old, -.tempus-dominus-widget.light .date-container-days .time-container-hour div.range-in:not(.no-highlight).old, -.tempus-dominus-widget.light .time-container-hour .date-container-days div.range-end:not(.no-highlight).old, -.tempus-dominus-widget.light .date-container-days .time-container-hour div.range-end:not(.no-highlight).old, -.tempus-dominus-widget.light .time-container-hour .date-container-days div.range-start:not(.no-highlight).old, -.tempus-dominus-widget.light .date-container-days .time-container-hour div.range-start:not(.no-highlight).old, -.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).active.new, -.tempus-dominus-widget.light .time-container-hour .date-container-days div.range-in:not(.no-highlight).new, -.tempus-dominus-widget.light .date-container-days .time-container-hour div.range-in:not(.no-highlight).new, -.tempus-dominus-widget.light .time-container-hour .date-container-days div.range-end:not(.no-highlight).new, -.tempus-dominus-widget.light .date-container-days .time-container-hour div.range-end:not(.no-highlight).new, -.tempus-dominus-widget.light .time-container-hour .date-container-days div.range-start:not(.no-highlight).new, -.tempus-dominus-widget.light .date-container-days .time-container-hour div.range-start:not(.no-highlight).new, -.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).active.old, -.tempus-dominus-widget.light .time-container-minute .date-container-days div.range-in:not(.no-highlight).old, -.tempus-dominus-widget.light .date-container-days .time-container-minute div.range-in:not(.no-highlight).old, -.tempus-dominus-widget.light .time-container-minute .date-container-days div.range-end:not(.no-highlight).old, -.tempus-dominus-widget.light .date-container-days .time-container-minute div.range-end:not(.no-highlight).old, -.tempus-dominus-widget.light .time-container-minute .date-container-days div.range-start:not(.no-highlight).old, -.tempus-dominus-widget.light .date-container-days .time-container-minute div.range-start:not(.no-highlight).old, -.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).active.new, -.tempus-dominus-widget.light .time-container-minute .date-container-days div.range-in:not(.no-highlight).new, -.tempus-dominus-widget.light .date-container-days .time-container-minute div.range-in:not(.no-highlight).new, -.tempus-dominus-widget.light .time-container-minute .date-container-days div.range-end:not(.no-highlight).new, -.tempus-dominus-widget.light .date-container-days .time-container-minute div.range-end:not(.no-highlight).new, -.tempus-dominus-widget.light .time-container-minute .date-container-days div.range-start:not(.no-highlight).new, -.tempus-dominus-widget.light .date-container-days .time-container-minute div.range-start:not(.no-highlight).new, -.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).active.old, -.tempus-dominus-widget.light .time-container-second .date-container-days div.range-in:not(.no-highlight).old, -.tempus-dominus-widget.light .date-container-days .time-container-second div.range-in:not(.no-highlight).old, -.tempus-dominus-widget.light .time-container-second .date-container-days div.range-end:not(.no-highlight).old, -.tempus-dominus-widget.light .date-container-days .time-container-second div.range-end:not(.no-highlight).old, -.tempus-dominus-widget.light .time-container-second .date-container-days div.range-start:not(.no-highlight).old, -.tempus-dominus-widget.light .date-container-days .time-container-second div.range-start:not(.no-highlight).old, -.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).active.new, -.tempus-dominus-widget.light .time-container-second .date-container-days div.range-in:not(.no-highlight).new, -.tempus-dominus-widget.light .date-container-days .time-container-second div.range-in:not(.no-highlight).new, -.tempus-dominus-widget.light .time-container-second .date-container-days div.range-end:not(.no-highlight).new, -.tempus-dominus-widget.light .date-container-days .time-container-second div.range-end:not(.no-highlight).new, -.tempus-dominus-widget.light .time-container-second .date-container-days div.range-start:not(.no-highlight).new, -.tempus-dominus-widget.light .date-container-days .time-container-second div.range-start:not(.no-highlight).new { - color: #fff; -} -.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).active.today:before, -.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).active.today:before, -.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).active.today:before, -.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).active.today:before, -.tempus-dominus-widget.light .date-container-days div.range-in:not(.no-highlight).today:before, -.tempus-dominus-widget.light .date-container-days div.range-end:not(.no-highlight).today:before, -.tempus-dominus-widget.light .date-container-days div.range-start:not(.no-highlight).today:before, -.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).active.today:before, -.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).active.today:before, -.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).active.today:before, -.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).active.today:before { - border-bottom-color: #fff; -} -.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).old, .tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).new, -.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).old, -.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).new, -.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).old, -.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).new, -.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).old, -.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).new, -.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).old, -.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).new, -.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).old, -.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).new, -.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).old, -.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).new, -.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).old, -.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).new { - color: rgba(0, 0, 0, 0.38); -} -.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).disabled, .tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).disabled:hover, -.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).disabled, -.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).disabled:hover, -.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).disabled, -.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).disabled:hover, -.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).disabled, -.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).disabled:hover, -.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).disabled, -.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).disabled:hover, -.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).disabled, -.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).disabled:hover, -.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).disabled, -.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).disabled:hover, -.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).disabled, -.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).disabled:hover { - color: #6c757d; -} -.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).today:before, -.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).today:before, -.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).today:before, -.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).today:before, -.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).today:before, -.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).today:before, -.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).today:before, -.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).today:before { - border-bottom-color: #0d6efd; - border-top-color: rgba(0, 0, 0, 0.2); -} -.tempus-dominus-widget.light button { - color: #fff; - background-color: #0d6efd; - border-color: #0d6efd; -} -.tempus-dominus-widget.dark { - color: #e3e3e3; - background-color: #1b1b1b; -} -.tempus-dominus-widget.dark [data-action].disabled, .tempus-dominus-widget.dark [data-action].disabled:hover { - color: #6c757d; -} -.tempus-dominus-widget.dark .toolbar div:hover { - background: rgb(35, 38, 39); -} -.tempus-dominus-widget.dark .date-container-days .dow { - color: rgba(232, 230, 227, 0.5); -} -.tempus-dominus-widget.dark .date-container-days .range-in { - background-color: #0071c7 !important; - box-shadow: -5px 0 0 #0071c7, 5px 0 0 #0071c7; -} -.tempus-dominus-widget.dark .date-container-days .cw { - color: rgba(232, 230, 227, 0.38); -} -.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight):hover, -.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight):hover, -.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight):hover, -.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight):hover, -.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight):hover, -.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight):hover, -.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight):hover, -.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight):hover { - background: rgb(35, 38, 39); -} -.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).active, -.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).active, -.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).active, -.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).active, -.tempus-dominus-widget.dark .date-container-days div.range-in:not(.no-highlight), -.tempus-dominus-widget.dark .date-container-days div.range-end:not(.no-highlight), -.tempus-dominus-widget.dark .date-container-days div.range-start:not(.no-highlight), -.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).active, -.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).active, -.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).active, -.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).active { - background-color: #4db2ff; - color: #fff; - text-shadow: 0 -1px 0 rgba(232, 230, 227, 0.25); -} -.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).active.old, .tempus-dominus-widget.dark .date-container-decades .date-container-days div.range-in:not(.no-highlight).old, .tempus-dominus-widget.dark .date-container-days .date-container-decades div.range-in:not(.no-highlight).old, .tempus-dominus-widget.dark .date-container-decades .date-container-days div.range-end:not(.no-highlight).old, .tempus-dominus-widget.dark .date-container-days .date-container-decades div.range-end:not(.no-highlight).old, .tempus-dominus-widget.dark .date-container-decades .date-container-days div.range-start:not(.no-highlight).old, .tempus-dominus-widget.dark .date-container-days .date-container-decades div.range-start:not(.no-highlight).old, .tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).active.new, .tempus-dominus-widget.dark .date-container-decades .date-container-days div.range-in:not(.no-highlight).new, .tempus-dominus-widget.dark .date-container-days .date-container-decades div.range-in:not(.no-highlight).new, .tempus-dominus-widget.dark .date-container-decades .date-container-days div.range-end:not(.no-highlight).new, .tempus-dominus-widget.dark .date-container-days .date-container-decades div.range-end:not(.no-highlight).new, .tempus-dominus-widget.dark .date-container-decades .date-container-days div.range-start:not(.no-highlight).new, .tempus-dominus-widget.dark .date-container-days .date-container-decades div.range-start:not(.no-highlight).new, -.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).active.old, -.tempus-dominus-widget.dark .date-container-years .date-container-days div.range-in:not(.no-highlight).old, -.tempus-dominus-widget.dark .date-container-days .date-container-years div.range-in:not(.no-highlight).old, -.tempus-dominus-widget.dark .date-container-years .date-container-days div.range-end:not(.no-highlight).old, -.tempus-dominus-widget.dark .date-container-days .date-container-years div.range-end:not(.no-highlight).old, -.tempus-dominus-widget.dark .date-container-years .date-container-days div.range-start:not(.no-highlight).old, -.tempus-dominus-widget.dark .date-container-days .date-container-years div.range-start:not(.no-highlight).old, -.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).active.new, -.tempus-dominus-widget.dark .date-container-years .date-container-days div.range-in:not(.no-highlight).new, -.tempus-dominus-widget.dark .date-container-days .date-container-years div.range-in:not(.no-highlight).new, -.tempus-dominus-widget.dark .date-container-years .date-container-days div.range-end:not(.no-highlight).new, -.tempus-dominus-widget.dark .date-container-days .date-container-years div.range-end:not(.no-highlight).new, -.tempus-dominus-widget.dark .date-container-years .date-container-days div.range-start:not(.no-highlight).new, -.tempus-dominus-widget.dark .date-container-days .date-container-years div.range-start:not(.no-highlight).new, -.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).active.old, -.tempus-dominus-widget.dark .date-container-months .date-container-days div.range-in:not(.no-highlight).old, -.tempus-dominus-widget.dark .date-container-days .date-container-months div.range-in:not(.no-highlight).old, -.tempus-dominus-widget.dark .date-container-months .date-container-days div.range-end:not(.no-highlight).old, -.tempus-dominus-widget.dark .date-container-days .date-container-months div.range-end:not(.no-highlight).old, -.tempus-dominus-widget.dark .date-container-months .date-container-days div.range-start:not(.no-highlight).old, -.tempus-dominus-widget.dark .date-container-days .date-container-months div.range-start:not(.no-highlight).old, -.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).active.new, -.tempus-dominus-widget.dark .date-container-months .date-container-days div.range-in:not(.no-highlight).new, -.tempus-dominus-widget.dark .date-container-days .date-container-months div.range-in:not(.no-highlight).new, -.tempus-dominus-widget.dark .date-container-months .date-container-days div.range-end:not(.no-highlight).new, -.tempus-dominus-widget.dark .date-container-days .date-container-months div.range-end:not(.no-highlight).new, -.tempus-dominus-widget.dark .date-container-months .date-container-days div.range-start:not(.no-highlight).new, -.tempus-dominus-widget.dark .date-container-days .date-container-months div.range-start:not(.no-highlight).new, -.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).active.old, -.tempus-dominus-widget.dark .date-container-days div.range-in:not(.no-highlight).old, -.tempus-dominus-widget.dark .date-container-days div.range-end:not(.no-highlight).old, -.tempus-dominus-widget.dark .date-container-days div.range-start:not(.no-highlight).old, -.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).active.new, -.tempus-dominus-widget.dark .date-container-days div.range-in:not(.no-highlight).new, -.tempus-dominus-widget.dark .date-container-days div.range-end:not(.no-highlight).new, -.tempus-dominus-widget.dark .date-container-days div.range-start:not(.no-highlight).new, -.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).active.old, -.tempus-dominus-widget.dark .time-container-clock .date-container-days div.range-in:not(.no-highlight).old, -.tempus-dominus-widget.dark .date-container-days .time-container-clock div.range-in:not(.no-highlight).old, -.tempus-dominus-widget.dark .time-container-clock .date-container-days div.range-end:not(.no-highlight).old, -.tempus-dominus-widget.dark .date-container-days .time-container-clock div.range-end:not(.no-highlight).old, -.tempus-dominus-widget.dark .time-container-clock .date-container-days div.range-start:not(.no-highlight).old, -.tempus-dominus-widget.dark .date-container-days .time-container-clock div.range-start:not(.no-highlight).old, -.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).active.new, -.tempus-dominus-widget.dark .time-container-clock .date-container-days div.range-in:not(.no-highlight).new, -.tempus-dominus-widget.dark .date-container-days .time-container-clock div.range-in:not(.no-highlight).new, -.tempus-dominus-widget.dark .time-container-clock .date-container-days div.range-end:not(.no-highlight).new, -.tempus-dominus-widget.dark .date-container-days .time-container-clock div.range-end:not(.no-highlight).new, -.tempus-dominus-widget.dark .time-container-clock .date-container-days div.range-start:not(.no-highlight).new, -.tempus-dominus-widget.dark .date-container-days .time-container-clock div.range-start:not(.no-highlight).new, -.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).active.old, -.tempus-dominus-widget.dark .time-container-hour .date-container-days div.range-in:not(.no-highlight).old, -.tempus-dominus-widget.dark .date-container-days .time-container-hour div.range-in:not(.no-highlight).old, -.tempus-dominus-widget.dark .time-container-hour .date-container-days div.range-end:not(.no-highlight).old, -.tempus-dominus-widget.dark .date-container-days .time-container-hour div.range-end:not(.no-highlight).old, -.tempus-dominus-widget.dark .time-container-hour .date-container-days div.range-start:not(.no-highlight).old, -.tempus-dominus-widget.dark .date-container-days .time-container-hour div.range-start:not(.no-highlight).old, -.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).active.new, -.tempus-dominus-widget.dark .time-container-hour .date-container-days div.range-in:not(.no-highlight).new, -.tempus-dominus-widget.dark .date-container-days .time-container-hour div.range-in:not(.no-highlight).new, -.tempus-dominus-widget.dark .time-container-hour .date-container-days div.range-end:not(.no-highlight).new, -.tempus-dominus-widget.dark .date-container-days .time-container-hour div.range-end:not(.no-highlight).new, -.tempus-dominus-widget.dark .time-container-hour .date-container-days div.range-start:not(.no-highlight).new, -.tempus-dominus-widget.dark .date-container-days .time-container-hour div.range-start:not(.no-highlight).new, -.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).active.old, -.tempus-dominus-widget.dark .time-container-minute .date-container-days div.range-in:not(.no-highlight).old, -.tempus-dominus-widget.dark .date-container-days .time-container-minute div.range-in:not(.no-highlight).old, -.tempus-dominus-widget.dark .time-container-minute .date-container-days div.range-end:not(.no-highlight).old, -.tempus-dominus-widget.dark .date-container-days .time-container-minute div.range-end:not(.no-highlight).old, -.tempus-dominus-widget.dark .time-container-minute .date-container-days div.range-start:not(.no-highlight).old, -.tempus-dominus-widget.dark .date-container-days .time-container-minute div.range-start:not(.no-highlight).old, -.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).active.new, -.tempus-dominus-widget.dark .time-container-minute .date-container-days div.range-in:not(.no-highlight).new, -.tempus-dominus-widget.dark .date-container-days .time-container-minute div.range-in:not(.no-highlight).new, -.tempus-dominus-widget.dark .time-container-minute .date-container-days div.range-end:not(.no-highlight).new, -.tempus-dominus-widget.dark .date-container-days .time-container-minute div.range-end:not(.no-highlight).new, -.tempus-dominus-widget.dark .time-container-minute .date-container-days div.range-start:not(.no-highlight).new, -.tempus-dominus-widget.dark .date-container-days .time-container-minute div.range-start:not(.no-highlight).new, -.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).active.old, -.tempus-dominus-widget.dark .time-container-second .date-container-days div.range-in:not(.no-highlight).old, -.tempus-dominus-widget.dark .date-container-days .time-container-second div.range-in:not(.no-highlight).old, -.tempus-dominus-widget.dark .time-container-second .date-container-days div.range-end:not(.no-highlight).old, -.tempus-dominus-widget.dark .date-container-days .time-container-second div.range-end:not(.no-highlight).old, -.tempus-dominus-widget.dark .time-container-second .date-container-days div.range-start:not(.no-highlight).old, -.tempus-dominus-widget.dark .date-container-days .time-container-second div.range-start:not(.no-highlight).old, -.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).active.new, -.tempus-dominus-widget.dark .time-container-second .date-container-days div.range-in:not(.no-highlight).new, -.tempus-dominus-widget.dark .date-container-days .time-container-second div.range-in:not(.no-highlight).new, -.tempus-dominus-widget.dark .time-container-second .date-container-days div.range-end:not(.no-highlight).new, -.tempus-dominus-widget.dark .date-container-days .time-container-second div.range-end:not(.no-highlight).new, -.tempus-dominus-widget.dark .time-container-second .date-container-days div.range-start:not(.no-highlight).new, -.tempus-dominus-widget.dark .date-container-days .time-container-second div.range-start:not(.no-highlight).new { - color: #fff; -} -.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).active.today:before, -.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).active.today:before, -.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).active.today:before, -.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).active.today:before, -.tempus-dominus-widget.dark .date-container-days div.range-in:not(.no-highlight).today:before, -.tempus-dominus-widget.dark .date-container-days div.range-end:not(.no-highlight).today:before, -.tempus-dominus-widget.dark .date-container-days div.range-start:not(.no-highlight).today:before, -.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).active.today:before, -.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).active.today:before, -.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).active.today:before, -.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).active.today:before { - border-bottom-color: #1b1b1b; -} -.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).old, .tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).new, -.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).old, -.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).new, -.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).old, -.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).new, -.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).old, -.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).new, -.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).old, -.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).new, -.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).old, -.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).new, -.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).old, -.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).new, -.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).old, -.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).new { - color: rgba(232, 230, 227, 0.38); -} -.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).disabled, .tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).disabled:hover, -.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).disabled, -.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).disabled:hover, -.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).disabled, -.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).disabled:hover, -.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).disabled, -.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).disabled:hover, -.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).disabled, -.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).disabled:hover, -.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).disabled, -.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).disabled:hover, -.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).disabled, -.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).disabled:hover, -.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).disabled, -.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).disabled:hover { - color: #6c757d; -} -.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).today:before, -.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).today:before, -.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).today:before, -.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).today:before, -.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).today:before, -.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).today:before, -.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).today:before, -.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).today:before { - border-bottom-color: #4db2ff; - border-top-color: rgba(232, 230, 227, 0.2); -} -.tempus-dominus-widget.dark button { - color: #fff; - background-color: #4db2ff; - border-color: #4db2ff; -} -/*# sourceMappingURL=tempus-dominus.css.map */ \ No newline at end of file diff --git a/node_modules/@eonasdan/tempus-dominus/dist/css/tempus-dominus.css.map b/node_modules/@eonasdan/tempus-dominus/dist/css/tempus-dominus.css.map deleted file mode 100644 index 7564a06..0000000 --- a/node_modules/@eonasdan/tempus-dominus/dist/css/tempus-dominus.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["tempus-dominus.scss"],"names":[],"mappings":"AAAA;EACE,6BAA6B;EAC7B,qBAAqB;EACrB,sBAAsB;EACtB,qBAAqB;EACrB,uBAAuB;EACvB,2BAA2B;EAC3B,iCAAiC;EACjC,8BAA8B;EAC9B,oBAAoB;AACtB;;AAEA;EACE,gBAAgB;EAChB,YAAY;EACZ,YAAY;EACZ,kBAAkB;EAClB,aAAa;EACb,aAAa;EACb,gHAAgH;AAClH;AACA;EACE,YAAY;AACd;AACA;EACE,wBAAwB;EACxB,sCAAsC;AACxC;AACA;EACE,eAAe;AACjB;AACA;EACE,oBAAoB;AACtB;AACA;EACE,gBAAgB;EAChB,mBAAmB;AACrB;AACA;EACE,aAAa;AACf;AACA;EACE,cAAc;AAChB;AACA;EACE,iBAAiB;AACnB;AACA;EACE,iBAAiB;AACnB;AACA;EACE,aAAa;AACf;AACA;EACE,SAAS;EACT,gBAAgB;EAChB,6BAA6B;AAC/B;AACA;EACE;IACE,WAAW;EACb;AACF;AACA;EACE;IACE,WAAW;EACb;AACF;AACA;EACE;IACE,WAAW;EACb;AACF;AACA;EACE,aAAa;AACf;AACA;EACE,cAAc;EACd,UAAU;AACZ;AACA;EACE,gBAAgB;AAClB;AACA;;;EAGE,WAAW;EACX,iBAAiB;EACjB,gBAAgB;EAChB,SAAS;AACX;AACA;EACE,YAAY;AACd;AACA;EACE,kBAAkB;EAClB,YAAY;AACd;AACA;EACE,aAAa;EACb,4BAA4B;EAC5B,mBAAmB;EACn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;;;;;;;;;;;;;;EAeE,gCAAgC;AAClC;AACA;;;;;;;;;;;;;;;EAeE,cAAc;AAChB;AACA;;;;;;;;EAQE,4BAA4B;EAC5B,0CAA0C;AAC5C;AACA;EACE,WAAW;EACX,yBAAyB;EACzB,qBAAqB;AACvB","file":"tempus-dominus.css","sourcesContent":[".visually-hidden, .tempus-dominus-widget [data-action]::after {\n position: absolute !important;\n width: 1px !important;\n height: 1px !important;\n padding: 0 !important;\n margin: -1px !important;\n overflow: hidden !important;\n clip: rect(0, 0, 0, 0) !important;\n white-space: nowrap !important;\n border: 0 !important;\n}\n\n.tempus-dominus-widget {\n list-style: none;\n padding: 4px;\n width: 19rem;\n border-radius: 4px;\n display: none;\n z-index: 9999;\n box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.2), 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12);\n}\n.tempus-dominus-widget.calendarWeeks {\n width: 21rem;\n}\n.tempus-dominus-widget.calendarWeeks .date-container-days {\n grid-auto-columns: 12.5%;\n grid-template-areas: \"a a a a a a a a\";\n}\n.tempus-dominus-widget [data-action] {\n cursor: pointer;\n}\n.tempus-dominus-widget [data-action]::after {\n content: attr(title);\n}\n.tempus-dominus-widget [data-action].disabled, .tempus-dominus-widget [data-action].disabled:hover {\n background: none;\n cursor: not-allowed;\n}\n.tempus-dominus-widget .arrow {\n display: none;\n}\n.tempus-dominus-widget.show {\n display: block;\n}\n.tempus-dominus-widget.show.date-container {\n min-height: 315px;\n}\n.tempus-dominus-widget.show.time-container {\n min-height: 217px;\n}\n.tempus-dominus-widget .td-collapse:not(.show) {\n display: none;\n}\n.tempus-dominus-widget .td-collapsing {\n height: 0;\n overflow: hidden;\n transition: height 0.35s ease;\n}\n@media (min-width: 576px) {\n .tempus-dominus-widget.timepicker-sbs {\n width: 38em;\n }\n}\n@media (min-width: 768px) {\n .tempus-dominus-widget.timepicker-sbs {\n width: 38em;\n }\n}\n@media (min-width: 992px) {\n .tempus-dominus-widget.timepicker-sbs {\n width: 38em;\n }\n}\n.tempus-dominus-widget.timepicker-sbs .td-row {\n display: flex;\n}\n.tempus-dominus-widget.timepicker-sbs .td-row .td-half {\n flex: 0 0 auto;\n width: 50%;\n}\n.tempus-dominus-widget div[data-action]:active {\n box-shadow: none;\n}\n.tempus-dominus-widget .timepicker-hour,\n.tempus-dominus-widget .timepicker-minute,\n.tempus-dominus-widget .timepicker-second {\n width: 54px;\n font-weight: bold;\n font-size: 1.2em;\n margin: 0;\n}\n.tempus-dominus-widget button[data-action] {\n padding: 6px;\n}\n.tempus-dominus-widget .toggleMeridiem {\n text-align: center;\n height: 38px;\n}\n.tempus-dominus-widget .calendar-header {\n display: grid;\n grid-template-areas: \"a a a\";\n margin-bottom: 10px;\n font-weight: bold;\n}\n.tempus-dominus-widget .calendar-header .next {\n text-align: right;\n padding-right: 10px;\n}\n.tempus-dominus-widget .calendar-header .previous {\n text-align: left;\n padding-left: 10px;\n}\n.tempus-dominus-widget .calendar-header .picker-switch {\n text-align: center;\n}\n.tempus-dominus-widget .toolbar {\n display: grid;\n grid-auto-flow: column;\n grid-auto-rows: 40px;\n}\n.tempus-dominus-widget .toolbar div {\n border-radius: 999px;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n display: flex;\n}\n.tempus-dominus-widget .date-container-days {\n display: grid;\n grid-template-areas: \"a a a a a a a\";\n grid-auto-rows: 40px;\n grid-auto-columns: 14.2857142857%;\n}\n.tempus-dominus-widget .date-container-days .range-in {\n background-color: #01419e !important;\n border: none;\n border-radius: 0 !important;\n box-shadow: -5px 0 0 #01419e, 5px 0 0 #01419e;\n}\n.tempus-dominus-widget .date-container-days .range-end {\n border-radius: 0 50px 50px 0 !important;\n}\n.tempus-dominus-widget .date-container-days .range-start {\n border-radius: 50px 0 0 50px !important;\n}\n.tempus-dominus-widget .date-container-days .dow {\n align-items: center;\n justify-content: center;\n text-align: center;\n}\n.tempus-dominus-widget .date-container-days .cw {\n width: 90%;\n height: 90%;\n align-items: center;\n justify-content: center;\n display: flex;\n font-size: 0.8em;\n line-height: 20px;\n cursor: default;\n}\n.tempus-dominus-widget .date-container-decades,\n.tempus-dominus-widget .date-container-years,\n.tempus-dominus-widget .date-container-months {\n display: grid;\n grid-template-areas: \"a a a\";\n grid-auto-rows: calc((19rem - 8px) / 7);\n}\n.tempus-dominus-widget .time-container-hour,\n.tempus-dominus-widget .time-container-minute,\n.tempus-dominus-widget .time-container-second {\n display: grid;\n grid-template-areas: \"a a a a\";\n grid-auto-rows: calc((19rem - 8px) / 7);\n}\n.tempus-dominus-widget .time-container-clock {\n display: grid;\n grid-auto-rows: calc((19rem - 8px) / 7);\n}\n.tempus-dominus-widget .time-container-clock .no-highlight {\n width: 90%;\n height: 90%;\n align-items: center;\n justify-content: center;\n display: flex;\n}\n.tempus-dominus-widget .date-container-decades div:not(.no-highlight),\n.tempus-dominus-widget .date-container-years div:not(.no-highlight),\n.tempus-dominus-widget .date-container-months div:not(.no-highlight),\n.tempus-dominus-widget .date-container-days div:not(.no-highlight),\n.tempus-dominus-widget .time-container-clock div:not(.no-highlight),\n.tempus-dominus-widget .time-container-hour div:not(.no-highlight),\n.tempus-dominus-widget .time-container-minute div:not(.no-highlight),\n.tempus-dominus-widget .time-container-second div:not(.no-highlight) {\n width: 90%;\n height: 90%;\n border-radius: 999px;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n display: flex;\n}\n.tempus-dominus-widget .date-container-decades div:not(.no-highlight).disabled, .tempus-dominus-widget .date-container-decades div:not(.no-highlight).disabled:hover,\n.tempus-dominus-widget .date-container-years div:not(.no-highlight).disabled,\n.tempus-dominus-widget .date-container-years div:not(.no-highlight).disabled:hover,\n.tempus-dominus-widget .date-container-months div:not(.no-highlight).disabled,\n.tempus-dominus-widget .date-container-months div:not(.no-highlight).disabled:hover,\n.tempus-dominus-widget .date-container-days div:not(.no-highlight).disabled,\n.tempus-dominus-widget .date-container-days div:not(.no-highlight).disabled:hover,\n.tempus-dominus-widget .time-container-clock div:not(.no-highlight).disabled,\n.tempus-dominus-widget .time-container-clock div:not(.no-highlight).disabled:hover,\n.tempus-dominus-widget .time-container-hour div:not(.no-highlight).disabled,\n.tempus-dominus-widget .time-container-hour div:not(.no-highlight).disabled:hover,\n.tempus-dominus-widget .time-container-minute div:not(.no-highlight).disabled,\n.tempus-dominus-widget .time-container-minute div:not(.no-highlight).disabled:hover,\n.tempus-dominus-widget .time-container-second div:not(.no-highlight).disabled,\n.tempus-dominus-widget .time-container-second div:not(.no-highlight).disabled:hover {\n background: none;\n cursor: not-allowed;\n}\n.tempus-dominus-widget .date-container-decades div:not(.no-highlight).today,\n.tempus-dominus-widget .date-container-years div:not(.no-highlight).today,\n.tempus-dominus-widget .date-container-months div:not(.no-highlight).today,\n.tempus-dominus-widget .date-container-days div:not(.no-highlight).today,\n.tempus-dominus-widget .time-container-clock div:not(.no-highlight).today,\n.tempus-dominus-widget .time-container-hour div:not(.no-highlight).today,\n.tempus-dominus-widget .time-container-minute div:not(.no-highlight).today,\n.tempus-dominus-widget .time-container-second div:not(.no-highlight).today {\n position: relative;\n}\n.tempus-dominus-widget .date-container-decades div:not(.no-highlight).today:before,\n.tempus-dominus-widget .date-container-years div:not(.no-highlight).today:before,\n.tempus-dominus-widget .date-container-months div:not(.no-highlight).today:before,\n.tempus-dominus-widget .date-container-days div:not(.no-highlight).today:before,\n.tempus-dominus-widget .time-container-clock div:not(.no-highlight).today:before,\n.tempus-dominus-widget .time-container-hour div:not(.no-highlight).today:before,\n.tempus-dominus-widget .time-container-minute div:not(.no-highlight).today:before,\n.tempus-dominus-widget .time-container-second div:not(.no-highlight).today:before {\n content: \"\";\n display: inline-block;\n border: solid transparent;\n border-width: 0 0 7px 7px;\n position: absolute;\n bottom: 6px;\n right: 6px;\n}\n.tempus-dominus-widget .time-container {\n margin-bottom: 0.5rem;\n}\n.tempus-dominus-widget button {\n display: inline-block;\n font-weight: 400;\n line-height: 1.5;\n text-align: center;\n text-decoration: none;\n vertical-align: middle;\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n padding: 0.375rem 0.75rem;\n font-size: 1rem;\n border-radius: 0.25rem;\n transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;\n}\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td.day,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td.hour,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td.minute,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td.second,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=incrementHours],\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=incrementMinutes],\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=incrementSeconds],\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=decrementHours],\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=decrementMinutes],\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=decrementSeconds],\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=showHours],\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=showMinutes],\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=showSeconds],\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=togglePeriod] {\n pointer-events: none;\n cursor: default;\n}\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td.day:hover,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td.hour:hover,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td.minute:hover,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td.second:hover,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=incrementHours]:hover,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=incrementMinutes]:hover,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=incrementSeconds]:hover,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=decrementHours]:hover,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=decrementMinutes]:hover,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=decrementSeconds]:hover,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=showHours]:hover,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=showMinutes]:hover,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=showSeconds]:hover,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=togglePeriod]:hover {\n background: none;\n}\n.tempus-dominus-widget.light {\n color: #000;\n background-color: #fff;\n}\n.tempus-dominus-widget.light [data-action].disabled, .tempus-dominus-widget.light [data-action].disabled:hover {\n color: #6c757d;\n}\n.tempus-dominus-widget.light .toolbar div:hover {\n background: #e9ecef;\n}\n.tempus-dominus-widget.light .date-container-days .dow {\n color: rgba(0, 0, 0, 0.5);\n}\n.tempus-dominus-widget.light .date-container-days .cw {\n color: rgba(0, 0, 0, 0.38);\n}\n.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight):hover,\n.tempus-dominus-widget.light .date-container-years div:not(.no-highlight):hover,\n.tempus-dominus-widget.light .date-container-months div:not(.no-highlight):hover,\n.tempus-dominus-widget.light .date-container-days div:not(.no-highlight):hover,\n.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight):hover,\n.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight):hover,\n.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight):hover,\n.tempus-dominus-widget.light .time-container-second div:not(.no-highlight):hover {\n background: #e9ecef;\n}\n.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).active,\n.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).active,\n.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).active,\n.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).active,\n.tempus-dominus-widget.light .date-container-days div.range-in:not(.no-highlight),\n.tempus-dominus-widget.light .date-container-days div.range-end:not(.no-highlight),\n.tempus-dominus-widget.light .date-container-days div.range-start:not(.no-highlight),\n.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).active,\n.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).active,\n.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).active,\n.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).active {\n background-color: #0d6efd;\n color: #fff;\n text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);\n}\n.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).active.old, .tempus-dominus-widget.light .date-container-decades .date-container-days div.range-in:not(.no-highlight).old, .tempus-dominus-widget.light .date-container-days .date-container-decades div.range-in:not(.no-highlight).old, .tempus-dominus-widget.light .date-container-decades .date-container-days div.range-end:not(.no-highlight).old, .tempus-dominus-widget.light .date-container-days .date-container-decades div.range-end:not(.no-highlight).old, .tempus-dominus-widget.light .date-container-decades .date-container-days div.range-start:not(.no-highlight).old, .tempus-dominus-widget.light .date-container-days .date-container-decades div.range-start:not(.no-highlight).old, .tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).active.new, .tempus-dominus-widget.light .date-container-decades .date-container-days div.range-in:not(.no-highlight).new, .tempus-dominus-widget.light .date-container-days .date-container-decades div.range-in:not(.no-highlight).new, .tempus-dominus-widget.light .date-container-decades .date-container-days div.range-end:not(.no-highlight).new, .tempus-dominus-widget.light .date-container-days .date-container-decades div.range-end:not(.no-highlight).new, .tempus-dominus-widget.light .date-container-decades .date-container-days div.range-start:not(.no-highlight).new, .tempus-dominus-widget.light .date-container-days .date-container-decades div.range-start:not(.no-highlight).new,\n.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).active.old,\n.tempus-dominus-widget.light .date-container-years .date-container-days div.range-in:not(.no-highlight).old,\n.tempus-dominus-widget.light .date-container-days .date-container-years div.range-in:not(.no-highlight).old,\n.tempus-dominus-widget.light .date-container-years .date-container-days div.range-end:not(.no-highlight).old,\n.tempus-dominus-widget.light .date-container-days .date-container-years div.range-end:not(.no-highlight).old,\n.tempus-dominus-widget.light .date-container-years .date-container-days div.range-start:not(.no-highlight).old,\n.tempus-dominus-widget.light .date-container-days .date-container-years div.range-start:not(.no-highlight).old,\n.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).active.new,\n.tempus-dominus-widget.light .date-container-years .date-container-days div.range-in:not(.no-highlight).new,\n.tempus-dominus-widget.light .date-container-days .date-container-years div.range-in:not(.no-highlight).new,\n.tempus-dominus-widget.light .date-container-years .date-container-days div.range-end:not(.no-highlight).new,\n.tempus-dominus-widget.light .date-container-days .date-container-years div.range-end:not(.no-highlight).new,\n.tempus-dominus-widget.light .date-container-years .date-container-days div.range-start:not(.no-highlight).new,\n.tempus-dominus-widget.light .date-container-days .date-container-years div.range-start:not(.no-highlight).new,\n.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).active.old,\n.tempus-dominus-widget.light .date-container-months .date-container-days div.range-in:not(.no-highlight).old,\n.tempus-dominus-widget.light .date-container-days .date-container-months div.range-in:not(.no-highlight).old,\n.tempus-dominus-widget.light .date-container-months .date-container-days div.range-end:not(.no-highlight).old,\n.tempus-dominus-widget.light .date-container-days .date-container-months div.range-end:not(.no-highlight).old,\n.tempus-dominus-widget.light .date-container-months .date-container-days div.range-start:not(.no-highlight).old,\n.tempus-dominus-widget.light .date-container-days .date-container-months div.range-start:not(.no-highlight).old,\n.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).active.new,\n.tempus-dominus-widget.light .date-container-months .date-container-days div.range-in:not(.no-highlight).new,\n.tempus-dominus-widget.light .date-container-days .date-container-months div.range-in:not(.no-highlight).new,\n.tempus-dominus-widget.light .date-container-months .date-container-days div.range-end:not(.no-highlight).new,\n.tempus-dominus-widget.light .date-container-days .date-container-months div.range-end:not(.no-highlight).new,\n.tempus-dominus-widget.light .date-container-months .date-container-days div.range-start:not(.no-highlight).new,\n.tempus-dominus-widget.light .date-container-days .date-container-months div.range-start:not(.no-highlight).new,\n.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).active.old,\n.tempus-dominus-widget.light .date-container-days div.range-in:not(.no-highlight).old,\n.tempus-dominus-widget.light .date-container-days div.range-end:not(.no-highlight).old,\n.tempus-dominus-widget.light .date-container-days div.range-start:not(.no-highlight).old,\n.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).active.new,\n.tempus-dominus-widget.light .date-container-days div.range-in:not(.no-highlight).new,\n.tempus-dominus-widget.light .date-container-days div.range-end:not(.no-highlight).new,\n.tempus-dominus-widget.light .date-container-days div.range-start:not(.no-highlight).new,\n.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).active.old,\n.tempus-dominus-widget.light .time-container-clock .date-container-days div.range-in:not(.no-highlight).old,\n.tempus-dominus-widget.light .date-container-days .time-container-clock div.range-in:not(.no-highlight).old,\n.tempus-dominus-widget.light .time-container-clock .date-container-days div.range-end:not(.no-highlight).old,\n.tempus-dominus-widget.light .date-container-days .time-container-clock div.range-end:not(.no-highlight).old,\n.tempus-dominus-widget.light .time-container-clock .date-container-days div.range-start:not(.no-highlight).old,\n.tempus-dominus-widget.light .date-container-days .time-container-clock div.range-start:not(.no-highlight).old,\n.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).active.new,\n.tempus-dominus-widget.light .time-container-clock .date-container-days div.range-in:not(.no-highlight).new,\n.tempus-dominus-widget.light .date-container-days .time-container-clock div.range-in:not(.no-highlight).new,\n.tempus-dominus-widget.light .time-container-clock .date-container-days div.range-end:not(.no-highlight).new,\n.tempus-dominus-widget.light .date-container-days .time-container-clock div.range-end:not(.no-highlight).new,\n.tempus-dominus-widget.light .time-container-clock .date-container-days div.range-start:not(.no-highlight).new,\n.tempus-dominus-widget.light .date-container-days .time-container-clock div.range-start:not(.no-highlight).new,\n.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).active.old,\n.tempus-dominus-widget.light .time-container-hour .date-container-days div.range-in:not(.no-highlight).old,\n.tempus-dominus-widget.light .date-container-days .time-container-hour div.range-in:not(.no-highlight).old,\n.tempus-dominus-widget.light .time-container-hour .date-container-days div.range-end:not(.no-highlight).old,\n.tempus-dominus-widget.light .date-container-days .time-container-hour div.range-end:not(.no-highlight).old,\n.tempus-dominus-widget.light .time-container-hour .date-container-days div.range-start:not(.no-highlight).old,\n.tempus-dominus-widget.light .date-container-days .time-container-hour div.range-start:not(.no-highlight).old,\n.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).active.new,\n.tempus-dominus-widget.light .time-container-hour .date-container-days div.range-in:not(.no-highlight).new,\n.tempus-dominus-widget.light .date-container-days .time-container-hour div.range-in:not(.no-highlight).new,\n.tempus-dominus-widget.light .time-container-hour .date-container-days div.range-end:not(.no-highlight).new,\n.tempus-dominus-widget.light .date-container-days .time-container-hour div.range-end:not(.no-highlight).new,\n.tempus-dominus-widget.light .time-container-hour .date-container-days div.range-start:not(.no-highlight).new,\n.tempus-dominus-widget.light .date-container-days .time-container-hour div.range-start:not(.no-highlight).new,\n.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).active.old,\n.tempus-dominus-widget.light .time-container-minute .date-container-days div.range-in:not(.no-highlight).old,\n.tempus-dominus-widget.light .date-container-days .time-container-minute div.range-in:not(.no-highlight).old,\n.tempus-dominus-widget.light .time-container-minute .date-container-days div.range-end:not(.no-highlight).old,\n.tempus-dominus-widget.light .date-container-days .time-container-minute div.range-end:not(.no-highlight).old,\n.tempus-dominus-widget.light .time-container-minute .date-container-days div.range-start:not(.no-highlight).old,\n.tempus-dominus-widget.light .date-container-days .time-container-minute div.range-start:not(.no-highlight).old,\n.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).active.new,\n.tempus-dominus-widget.light .time-container-minute .date-container-days div.range-in:not(.no-highlight).new,\n.tempus-dominus-widget.light .date-container-days .time-container-minute div.range-in:not(.no-highlight).new,\n.tempus-dominus-widget.light .time-container-minute .date-container-days div.range-end:not(.no-highlight).new,\n.tempus-dominus-widget.light .date-container-days .time-container-minute div.range-end:not(.no-highlight).new,\n.tempus-dominus-widget.light .time-container-minute .date-container-days div.range-start:not(.no-highlight).new,\n.tempus-dominus-widget.light .date-container-days .time-container-minute div.range-start:not(.no-highlight).new,\n.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).active.old,\n.tempus-dominus-widget.light .time-container-second .date-container-days div.range-in:not(.no-highlight).old,\n.tempus-dominus-widget.light .date-container-days .time-container-second div.range-in:not(.no-highlight).old,\n.tempus-dominus-widget.light .time-container-second .date-container-days div.range-end:not(.no-highlight).old,\n.tempus-dominus-widget.light .date-container-days .time-container-second div.range-end:not(.no-highlight).old,\n.tempus-dominus-widget.light .time-container-second .date-container-days div.range-start:not(.no-highlight).old,\n.tempus-dominus-widget.light .date-container-days .time-container-second div.range-start:not(.no-highlight).old,\n.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).active.new,\n.tempus-dominus-widget.light .time-container-second .date-container-days div.range-in:not(.no-highlight).new,\n.tempus-dominus-widget.light .date-container-days .time-container-second div.range-in:not(.no-highlight).new,\n.tempus-dominus-widget.light .time-container-second .date-container-days div.range-end:not(.no-highlight).new,\n.tempus-dominus-widget.light .date-container-days .time-container-second div.range-end:not(.no-highlight).new,\n.tempus-dominus-widget.light .time-container-second .date-container-days div.range-start:not(.no-highlight).new,\n.tempus-dominus-widget.light .date-container-days .time-container-second div.range-start:not(.no-highlight).new {\n color: #fff;\n}\n.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).active.today:before,\n.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).active.today:before,\n.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).active.today:before,\n.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).active.today:before,\n.tempus-dominus-widget.light .date-container-days div.range-in:not(.no-highlight).today:before,\n.tempus-dominus-widget.light .date-container-days div.range-end:not(.no-highlight).today:before,\n.tempus-dominus-widget.light .date-container-days div.range-start:not(.no-highlight).today:before,\n.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).active.today:before,\n.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).active.today:before,\n.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).active.today:before,\n.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).active.today:before {\n border-bottom-color: #fff;\n}\n.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).old, .tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).new,\n.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).old,\n.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).new,\n.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).old,\n.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).new,\n.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).old,\n.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).new,\n.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).old,\n.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).new,\n.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).old,\n.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).new,\n.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).old,\n.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).new,\n.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).old,\n.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).new {\n color: rgba(0, 0, 0, 0.38);\n}\n.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).disabled, .tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).disabled:hover,\n.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).disabled,\n.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).disabled:hover,\n.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).disabled,\n.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).disabled:hover,\n.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).disabled,\n.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).disabled:hover,\n.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).disabled,\n.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).disabled:hover,\n.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).disabled,\n.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).disabled:hover,\n.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).disabled,\n.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).disabled:hover,\n.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).disabled,\n.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).disabled:hover {\n color: #6c757d;\n}\n.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).today:before,\n.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).today:before,\n.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).today:before,\n.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).today:before,\n.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).today:before,\n.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).today:before,\n.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).today:before,\n.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).today:before {\n border-bottom-color: #0d6efd;\n border-top-color: rgba(0, 0, 0, 0.2);\n}\n.tempus-dominus-widget.light button {\n color: #fff;\n background-color: #0d6efd;\n border-color: #0d6efd;\n}\n.tempus-dominus-widget.dark {\n color: #e3e3e3;\n background-color: #1b1b1b;\n}\n.tempus-dominus-widget.dark [data-action].disabled, .tempus-dominus-widget.dark [data-action].disabled:hover {\n color: #6c757d;\n}\n.tempus-dominus-widget.dark .toolbar div:hover {\n background: rgb(35, 38, 39);\n}\n.tempus-dominus-widget.dark .date-container-days .dow {\n color: rgba(232, 230, 227, 0.5);\n}\n.tempus-dominus-widget.dark .date-container-days .range-in {\n background-color: #0071c7 !important;\n box-shadow: -5px 0 0 #0071c7, 5px 0 0 #0071c7;\n}\n.tempus-dominus-widget.dark .date-container-days .cw {\n color: rgba(232, 230, 227, 0.38);\n}\n.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight):hover,\n.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight):hover,\n.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight):hover,\n.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight):hover,\n.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight):hover,\n.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight):hover,\n.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight):hover,\n.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight):hover {\n background: rgb(35, 38, 39);\n}\n.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).active,\n.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).active,\n.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).active,\n.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).active,\n.tempus-dominus-widget.dark .date-container-days div.range-in:not(.no-highlight),\n.tempus-dominus-widget.dark .date-container-days div.range-end:not(.no-highlight),\n.tempus-dominus-widget.dark .date-container-days div.range-start:not(.no-highlight),\n.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).active,\n.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).active,\n.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).active,\n.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).active {\n background-color: #4db2ff;\n color: #fff;\n text-shadow: 0 -1px 0 rgba(232, 230, 227, 0.25);\n}\n.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).active.old, .tempus-dominus-widget.dark .date-container-decades .date-container-days div.range-in:not(.no-highlight).old, .tempus-dominus-widget.dark .date-container-days .date-container-decades div.range-in:not(.no-highlight).old, .tempus-dominus-widget.dark .date-container-decades .date-container-days div.range-end:not(.no-highlight).old, .tempus-dominus-widget.dark .date-container-days .date-container-decades div.range-end:not(.no-highlight).old, .tempus-dominus-widget.dark .date-container-decades .date-container-days div.range-start:not(.no-highlight).old, .tempus-dominus-widget.dark .date-container-days .date-container-decades div.range-start:not(.no-highlight).old, .tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).active.new, .tempus-dominus-widget.dark .date-container-decades .date-container-days div.range-in:not(.no-highlight).new, .tempus-dominus-widget.dark .date-container-days .date-container-decades div.range-in:not(.no-highlight).new, .tempus-dominus-widget.dark .date-container-decades .date-container-days div.range-end:not(.no-highlight).new, .tempus-dominus-widget.dark .date-container-days .date-container-decades div.range-end:not(.no-highlight).new, .tempus-dominus-widget.dark .date-container-decades .date-container-days div.range-start:not(.no-highlight).new, .tempus-dominus-widget.dark .date-container-days .date-container-decades div.range-start:not(.no-highlight).new,\n.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).active.old,\n.tempus-dominus-widget.dark .date-container-years .date-container-days div.range-in:not(.no-highlight).old,\n.tempus-dominus-widget.dark .date-container-days .date-container-years div.range-in:not(.no-highlight).old,\n.tempus-dominus-widget.dark .date-container-years .date-container-days div.range-end:not(.no-highlight).old,\n.tempus-dominus-widget.dark .date-container-days .date-container-years div.range-end:not(.no-highlight).old,\n.tempus-dominus-widget.dark .date-container-years .date-container-days div.range-start:not(.no-highlight).old,\n.tempus-dominus-widget.dark .date-container-days .date-container-years div.range-start:not(.no-highlight).old,\n.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).active.new,\n.tempus-dominus-widget.dark .date-container-years .date-container-days div.range-in:not(.no-highlight).new,\n.tempus-dominus-widget.dark .date-container-days .date-container-years div.range-in:not(.no-highlight).new,\n.tempus-dominus-widget.dark .date-container-years .date-container-days div.range-end:not(.no-highlight).new,\n.tempus-dominus-widget.dark .date-container-days .date-container-years div.range-end:not(.no-highlight).new,\n.tempus-dominus-widget.dark .date-container-years .date-container-days div.range-start:not(.no-highlight).new,\n.tempus-dominus-widget.dark .date-container-days .date-container-years div.range-start:not(.no-highlight).new,\n.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).active.old,\n.tempus-dominus-widget.dark .date-container-months .date-container-days div.range-in:not(.no-highlight).old,\n.tempus-dominus-widget.dark .date-container-days .date-container-months div.range-in:not(.no-highlight).old,\n.tempus-dominus-widget.dark .date-container-months .date-container-days div.range-end:not(.no-highlight).old,\n.tempus-dominus-widget.dark .date-container-days .date-container-months div.range-end:not(.no-highlight).old,\n.tempus-dominus-widget.dark .date-container-months .date-container-days div.range-start:not(.no-highlight).old,\n.tempus-dominus-widget.dark .date-container-days .date-container-months div.range-start:not(.no-highlight).old,\n.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).active.new,\n.tempus-dominus-widget.dark .date-container-months .date-container-days div.range-in:not(.no-highlight).new,\n.tempus-dominus-widget.dark .date-container-days .date-container-months div.range-in:not(.no-highlight).new,\n.tempus-dominus-widget.dark .date-container-months .date-container-days div.range-end:not(.no-highlight).new,\n.tempus-dominus-widget.dark .date-container-days .date-container-months div.range-end:not(.no-highlight).new,\n.tempus-dominus-widget.dark .date-container-months .date-container-days div.range-start:not(.no-highlight).new,\n.tempus-dominus-widget.dark .date-container-days .date-container-months div.range-start:not(.no-highlight).new,\n.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).active.old,\n.tempus-dominus-widget.dark .date-container-days div.range-in:not(.no-highlight).old,\n.tempus-dominus-widget.dark .date-container-days div.range-end:not(.no-highlight).old,\n.tempus-dominus-widget.dark .date-container-days div.range-start:not(.no-highlight).old,\n.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).active.new,\n.tempus-dominus-widget.dark .date-container-days div.range-in:not(.no-highlight).new,\n.tempus-dominus-widget.dark .date-container-days div.range-end:not(.no-highlight).new,\n.tempus-dominus-widget.dark .date-container-days div.range-start:not(.no-highlight).new,\n.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).active.old,\n.tempus-dominus-widget.dark .time-container-clock .date-container-days div.range-in:not(.no-highlight).old,\n.tempus-dominus-widget.dark .date-container-days .time-container-clock div.range-in:not(.no-highlight).old,\n.tempus-dominus-widget.dark .time-container-clock .date-container-days div.range-end:not(.no-highlight).old,\n.tempus-dominus-widget.dark .date-container-days .time-container-clock div.range-end:not(.no-highlight).old,\n.tempus-dominus-widget.dark .time-container-clock .date-container-days div.range-start:not(.no-highlight).old,\n.tempus-dominus-widget.dark .date-container-days .time-container-clock div.range-start:not(.no-highlight).old,\n.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).active.new,\n.tempus-dominus-widget.dark .time-container-clock .date-container-days div.range-in:not(.no-highlight).new,\n.tempus-dominus-widget.dark .date-container-days .time-container-clock div.range-in:not(.no-highlight).new,\n.tempus-dominus-widget.dark .time-container-clock .date-container-days div.range-end:not(.no-highlight).new,\n.tempus-dominus-widget.dark .date-container-days .time-container-clock div.range-end:not(.no-highlight).new,\n.tempus-dominus-widget.dark .time-container-clock .date-container-days div.range-start:not(.no-highlight).new,\n.tempus-dominus-widget.dark .date-container-days .time-container-clock div.range-start:not(.no-highlight).new,\n.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).active.old,\n.tempus-dominus-widget.dark .time-container-hour .date-container-days div.range-in:not(.no-highlight).old,\n.tempus-dominus-widget.dark .date-container-days .time-container-hour div.range-in:not(.no-highlight).old,\n.tempus-dominus-widget.dark .time-container-hour .date-container-days div.range-end:not(.no-highlight).old,\n.tempus-dominus-widget.dark .date-container-days .time-container-hour div.range-end:not(.no-highlight).old,\n.tempus-dominus-widget.dark .time-container-hour .date-container-days div.range-start:not(.no-highlight).old,\n.tempus-dominus-widget.dark .date-container-days .time-container-hour div.range-start:not(.no-highlight).old,\n.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).active.new,\n.tempus-dominus-widget.dark .time-container-hour .date-container-days div.range-in:not(.no-highlight).new,\n.tempus-dominus-widget.dark .date-container-days .time-container-hour div.range-in:not(.no-highlight).new,\n.tempus-dominus-widget.dark .time-container-hour .date-container-days div.range-end:not(.no-highlight).new,\n.tempus-dominus-widget.dark .date-container-days .time-container-hour div.range-end:not(.no-highlight).new,\n.tempus-dominus-widget.dark .time-container-hour .date-container-days div.range-start:not(.no-highlight).new,\n.tempus-dominus-widget.dark .date-container-days .time-container-hour div.range-start:not(.no-highlight).new,\n.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).active.old,\n.tempus-dominus-widget.dark .time-container-minute .date-container-days div.range-in:not(.no-highlight).old,\n.tempus-dominus-widget.dark .date-container-days .time-container-minute div.range-in:not(.no-highlight).old,\n.tempus-dominus-widget.dark .time-container-minute .date-container-days div.range-end:not(.no-highlight).old,\n.tempus-dominus-widget.dark .date-container-days .time-container-minute div.range-end:not(.no-highlight).old,\n.tempus-dominus-widget.dark .time-container-minute .date-container-days div.range-start:not(.no-highlight).old,\n.tempus-dominus-widget.dark .date-container-days .time-container-minute div.range-start:not(.no-highlight).old,\n.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).active.new,\n.tempus-dominus-widget.dark .time-container-minute .date-container-days div.range-in:not(.no-highlight).new,\n.tempus-dominus-widget.dark .date-container-days .time-container-minute div.range-in:not(.no-highlight).new,\n.tempus-dominus-widget.dark .time-container-minute .date-container-days div.range-end:not(.no-highlight).new,\n.tempus-dominus-widget.dark .date-container-days .time-container-minute div.range-end:not(.no-highlight).new,\n.tempus-dominus-widget.dark .time-container-minute .date-container-days div.range-start:not(.no-highlight).new,\n.tempus-dominus-widget.dark .date-container-days .time-container-minute div.range-start:not(.no-highlight).new,\n.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).active.old,\n.tempus-dominus-widget.dark .time-container-second .date-container-days div.range-in:not(.no-highlight).old,\n.tempus-dominus-widget.dark .date-container-days .time-container-second div.range-in:not(.no-highlight).old,\n.tempus-dominus-widget.dark .time-container-second .date-container-days div.range-end:not(.no-highlight).old,\n.tempus-dominus-widget.dark .date-container-days .time-container-second div.range-end:not(.no-highlight).old,\n.tempus-dominus-widget.dark .time-container-second .date-container-days div.range-start:not(.no-highlight).old,\n.tempus-dominus-widget.dark .date-container-days .time-container-second div.range-start:not(.no-highlight).old,\n.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).active.new,\n.tempus-dominus-widget.dark .time-container-second .date-container-days div.range-in:not(.no-highlight).new,\n.tempus-dominus-widget.dark .date-container-days .time-container-second div.range-in:not(.no-highlight).new,\n.tempus-dominus-widget.dark .time-container-second .date-container-days div.range-end:not(.no-highlight).new,\n.tempus-dominus-widget.dark .date-container-days .time-container-second div.range-end:not(.no-highlight).new,\n.tempus-dominus-widget.dark .time-container-second .date-container-days div.range-start:not(.no-highlight).new,\n.tempus-dominus-widget.dark .date-container-days .time-container-second div.range-start:not(.no-highlight).new {\n color: #fff;\n}\n.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).active.today:before,\n.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).active.today:before,\n.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).active.today:before,\n.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).active.today:before,\n.tempus-dominus-widget.dark .date-container-days div.range-in:not(.no-highlight).today:before,\n.tempus-dominus-widget.dark .date-container-days div.range-end:not(.no-highlight).today:before,\n.tempus-dominus-widget.dark .date-container-days div.range-start:not(.no-highlight).today:before,\n.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).active.today:before,\n.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).active.today:before,\n.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).active.today:before,\n.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).active.today:before {\n border-bottom-color: #1b1b1b;\n}\n.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).old, .tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).new,\n.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).old,\n.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).new,\n.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).old,\n.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).new,\n.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).old,\n.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).new,\n.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).old,\n.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).new,\n.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).old,\n.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).new,\n.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).old,\n.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).new,\n.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).old,\n.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).new {\n color: rgba(232, 230, 227, 0.38);\n}\n.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).disabled, .tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).disabled:hover,\n.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).disabled,\n.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).disabled:hover,\n.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).disabled,\n.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).disabled:hover,\n.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).disabled,\n.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).disabled:hover,\n.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).disabled,\n.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).disabled:hover,\n.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).disabled,\n.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).disabled:hover,\n.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).disabled,\n.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).disabled:hover,\n.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).disabled,\n.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).disabled:hover {\n color: #6c757d;\n}\n.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).today:before,\n.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).today:before,\n.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).today:before,\n.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).today:before,\n.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).today:before,\n.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).today:before,\n.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).today:before,\n.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).today:before {\n border-bottom-color: #4db2ff;\n border-top-color: rgba(232, 230, 227, 0.2);\n}\n.tempus-dominus-widget.dark button {\n color: #fff;\n background-color: #4db2ff;\n border-color: #4db2ff;\n}"]} \ No newline at end of file diff --git a/node_modules/@eonasdan/tempus-dominus/dist/css/tempus-dominus.min.css b/node_modules/@eonasdan/tempus-dominus/dist/css/tempus-dominus.min.css deleted file mode 100644 index 062b959..0000000 --- a/node_modules/@eonasdan/tempus-dominus/dist/css/tempus-dominus.min.css +++ /dev/null @@ -1 +0,0 @@ -.tempus-dominus-widget [data-action]:after,.visually-hidden{clip:rect(0,0,0,0)!important;border:0!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;white-space:nowrap!important;width:1px!important}.tempus-dominus-widget{border-radius:4px;box-shadow:0 2px 4px -1px rgba(0,0,0,.2),0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12);display:none;list-style:none;padding:4px;width:19rem;z-index:9999}.tempus-dominus-widget.calendarWeeks{width:21rem}.tempus-dominus-widget.calendarWeeks .date-container-days{grid-auto-columns:12.5%;grid-template-areas:"a a a a a a a a"}.tempus-dominus-widget [data-action]{cursor:pointer}.tempus-dominus-widget [data-action]:after{content:attr(title)}.tempus-dominus-widget [data-action].disabled,.tempus-dominus-widget [data-action].disabled:hover{background:none;cursor:not-allowed}.tempus-dominus-widget .arrow{display:none}.tempus-dominus-widget.show{display:block}.tempus-dominus-widget.show.date-container{min-height:315px}.tempus-dominus-widget.show.time-container{min-height:217px}.tempus-dominus-widget .td-collapse:not(.show){display:none}.tempus-dominus-widget .td-collapsing{height:0;overflow:hidden;transition:height .35s ease}@media (min-width:576px){.tempus-dominus-widget.timepicker-sbs{width:38em}}@media (min-width:768px){.tempus-dominus-widget.timepicker-sbs{width:38em}}@media (min-width:992px){.tempus-dominus-widget.timepicker-sbs{width:38em}}.tempus-dominus-widget.timepicker-sbs .td-row{display:flex}.tempus-dominus-widget.timepicker-sbs .td-row .td-half{flex:0 0 auto;width:50%}.tempus-dominus-widget div[data-action]:active{box-shadow:none}.tempus-dominus-widget .timepicker-hour,.tempus-dominus-widget .timepicker-minute,.tempus-dominus-widget .timepicker-second{font-size:1.2em;font-weight:700;margin:0;width:54px}.tempus-dominus-widget button[data-action]{padding:6px}.tempus-dominus-widget .toggleMeridiem{height:38px;text-align:center}.tempus-dominus-widget .calendar-header{display:grid;font-weight:700;grid-template-areas:"a a a";margin-bottom:10px}.tempus-dominus-widget .calendar-header .next{padding-right:10px;text-align:right}.tempus-dominus-widget .calendar-header .previous{padding-left:10px;text-align:left}.tempus-dominus-widget .calendar-header .picker-switch{text-align:center}.tempus-dominus-widget .toolbar{display:grid;grid-auto-flow:column;grid-auto-rows:40px}.tempus-dominus-widget .toolbar div{align-items:center;border-radius:999px;box-sizing:border-box;display:flex;justify-content:center}.tempus-dominus-widget .date-container-days{display:grid;grid-auto-columns:14.2857142857%;grid-auto-rows:40px;grid-template-areas:"a a a a a a a"}.tempus-dominus-widget .date-container-days .range-in{background-color:#01419e!important;border:none;border-radius:0!important;box-shadow:-5px 0 0 #01419e,5px 0 0 #01419e}.tempus-dominus-widget .date-container-days .range-end{border-radius:0 50px 50px 0!important}.tempus-dominus-widget .date-container-days .range-start{border-radius:50px 0 0 50px!important}.tempus-dominus-widget .date-container-days .dow{align-items:center;justify-content:center;text-align:center}.tempus-dominus-widget .date-container-days .cw{align-items:center;cursor:default;display:flex;font-size:.8em;height:90%;justify-content:center;line-height:20px;width:90%}.tempus-dominus-widget .date-container-decades,.tempus-dominus-widget .date-container-months,.tempus-dominus-widget .date-container-years{display:grid;grid-auto-rows:calc(2.71429rem - 1.14286px);grid-template-areas:"a a a"}.tempus-dominus-widget .time-container-hour,.tempus-dominus-widget .time-container-minute,.tempus-dominus-widget .time-container-second{display:grid;grid-auto-rows:calc(2.71429rem - 1.14286px);grid-template-areas:"a a a a"}.tempus-dominus-widget .time-container-clock{display:grid;grid-auto-rows:calc(2.71429rem - 1.14286px)}.tempus-dominus-widget .time-container-clock .no-highlight{align-items:center;display:flex;height:90%;justify-content:center;width:90%}.tempus-dominus-widget .date-container-days div:not(.no-highlight),.tempus-dominus-widget .date-container-decades div:not(.no-highlight),.tempus-dominus-widget .date-container-months div:not(.no-highlight),.tempus-dominus-widget .date-container-years div:not(.no-highlight),.tempus-dominus-widget .time-container-clock div:not(.no-highlight),.tempus-dominus-widget .time-container-hour div:not(.no-highlight),.tempus-dominus-widget .time-container-minute div:not(.no-highlight),.tempus-dominus-widget .time-container-second div:not(.no-highlight){align-items:center;border-radius:999px;box-sizing:border-box;display:flex;height:90%;justify-content:center;width:90%}.tempus-dominus-widget .date-container-days div:not(.no-highlight).disabled,.tempus-dominus-widget .date-container-days div:not(.no-highlight).disabled:hover,.tempus-dominus-widget .date-container-decades div:not(.no-highlight).disabled,.tempus-dominus-widget .date-container-decades div:not(.no-highlight).disabled:hover,.tempus-dominus-widget .date-container-months div:not(.no-highlight).disabled,.tempus-dominus-widget .date-container-months div:not(.no-highlight).disabled:hover,.tempus-dominus-widget .date-container-years div:not(.no-highlight).disabled,.tempus-dominus-widget .date-container-years div:not(.no-highlight).disabled:hover,.tempus-dominus-widget .time-container-clock div:not(.no-highlight).disabled,.tempus-dominus-widget .time-container-clock div:not(.no-highlight).disabled:hover,.tempus-dominus-widget .time-container-hour div:not(.no-highlight).disabled,.tempus-dominus-widget .time-container-hour div:not(.no-highlight).disabled:hover,.tempus-dominus-widget .time-container-minute div:not(.no-highlight).disabled,.tempus-dominus-widget .time-container-minute div:not(.no-highlight).disabled:hover,.tempus-dominus-widget .time-container-second div:not(.no-highlight).disabled,.tempus-dominus-widget .time-container-second div:not(.no-highlight).disabled:hover{background:none;cursor:not-allowed}.tempus-dominus-widget .date-container-days div:not(.no-highlight).today,.tempus-dominus-widget .date-container-decades div:not(.no-highlight).today,.tempus-dominus-widget .date-container-months div:not(.no-highlight).today,.tempus-dominus-widget .date-container-years div:not(.no-highlight).today,.tempus-dominus-widget .time-container-clock div:not(.no-highlight).today,.tempus-dominus-widget .time-container-hour div:not(.no-highlight).today,.tempus-dominus-widget .time-container-minute div:not(.no-highlight).today,.tempus-dominus-widget .time-container-second div:not(.no-highlight).today{position:relative}.tempus-dominus-widget .date-container-days div:not(.no-highlight).today:before,.tempus-dominus-widget .date-container-decades div:not(.no-highlight).today:before,.tempus-dominus-widget .date-container-months div:not(.no-highlight).today:before,.tempus-dominus-widget .date-container-years div:not(.no-highlight).today:before,.tempus-dominus-widget .time-container-clock div:not(.no-highlight).today:before,.tempus-dominus-widget .time-container-hour div:not(.no-highlight).today:before,.tempus-dominus-widget .time-container-minute div:not(.no-highlight).today:before,.tempus-dominus-widget .time-container-second div:not(.no-highlight).today:before{border:solid transparent;border-width:0 0 7px 7px;bottom:6px;content:"";display:inline-block;position:absolute;right:6px}.tempus-dominus-widget .time-container{margin-bottom:.5rem}.tempus-dominus-widget button{border-radius:.25rem;cursor:pointer;display:inline-block;font-size:1rem;font-weight:400;line-height:1.5;padding:.375rem .75rem;text-align:center;text-decoration:none;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle}.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=decrementHours],.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=decrementMinutes],.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=decrementSeconds],.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=incrementHours],.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=incrementMinutes],.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=incrementSeconds],.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=showHours],.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=showMinutes],.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=showSeconds],.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=togglePeriod],.tempus-dominus-widget.tempus-dominus-widget-readonly table td.day,.tempus-dominus-widget.tempus-dominus-widget-readonly table td.hour,.tempus-dominus-widget.tempus-dominus-widget-readonly table td.minute,.tempus-dominus-widget.tempus-dominus-widget-readonly table td.second{cursor:default;pointer-events:none}.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=decrementHours]:hover,.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=decrementMinutes]:hover,.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=decrementSeconds]:hover,.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=incrementHours]:hover,.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=incrementMinutes]:hover,.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=incrementSeconds]:hover,.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=showHours]:hover,.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=showMinutes]:hover,.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=showSeconds]:hover,.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=togglePeriod]:hover,.tempus-dominus-widget.tempus-dominus-widget-readonly table td.day:hover,.tempus-dominus-widget.tempus-dominus-widget-readonly table td.hour:hover,.tempus-dominus-widget.tempus-dominus-widget-readonly table td.minute:hover,.tempus-dominus-widget.tempus-dominus-widget-readonly table td.second:hover{background:none}.tempus-dominus-widget.light{background-color:#fff;color:#000}.tempus-dominus-widget.light [data-action].disabled,.tempus-dominus-widget.light [data-action].disabled:hover{color:#6c757d}.tempus-dominus-widget.light .toolbar div:hover{background:#e9ecef}.tempus-dominus-widget.light .date-container-days .dow{color:rgba(0,0,0,.5)}.tempus-dominus-widget.light .date-container-days .cw{color:rgba(0,0,0,.38)}.tempus-dominus-widget.light .date-container-days div:not(.no-highlight):hover,.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight):hover,.tempus-dominus-widget.light .date-container-months div:not(.no-highlight):hover,.tempus-dominus-widget.light .date-container-years div:not(.no-highlight):hover,.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight):hover,.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight):hover,.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight):hover,.tempus-dominus-widget.light .time-container-second div:not(.no-highlight):hover{background:#e9ecef}.tempus-dominus-widget.light .date-container-days div.range-end:not(.no-highlight),.tempus-dominus-widget.light .date-container-days div.range-in:not(.no-highlight),.tempus-dominus-widget.light .date-container-days div.range-start:not(.no-highlight),.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).active,.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).active,.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).active,.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).active,.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).active,.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).active,.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).active,.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).active{background-color:#0d6efd;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25)}.tempus-dominus-widget.light .date-container-days .date-container-decades div.range-end:not(.no-highlight).new,.tempus-dominus-widget.light .date-container-days .date-container-decades div.range-end:not(.no-highlight).old,.tempus-dominus-widget.light .date-container-days .date-container-decades div.range-in:not(.no-highlight).new,.tempus-dominus-widget.light .date-container-days .date-container-decades div.range-in:not(.no-highlight).old,.tempus-dominus-widget.light .date-container-days .date-container-decades div.range-start:not(.no-highlight).new,.tempus-dominus-widget.light .date-container-days .date-container-decades div.range-start:not(.no-highlight).old,.tempus-dominus-widget.light .date-container-days .date-container-months div.range-end:not(.no-highlight).new,.tempus-dominus-widget.light .date-container-days .date-container-months div.range-end:not(.no-highlight).old,.tempus-dominus-widget.light .date-container-days .date-container-months div.range-in:not(.no-highlight).new,.tempus-dominus-widget.light .date-container-days .date-container-months div.range-in:not(.no-highlight).old,.tempus-dominus-widget.light .date-container-days .date-container-months div.range-start:not(.no-highlight).new,.tempus-dominus-widget.light .date-container-days .date-container-months div.range-start:not(.no-highlight).old,.tempus-dominus-widget.light .date-container-days .date-container-years div.range-end:not(.no-highlight).new,.tempus-dominus-widget.light .date-container-days .date-container-years div.range-end:not(.no-highlight).old,.tempus-dominus-widget.light .date-container-days .date-container-years div.range-in:not(.no-highlight).new,.tempus-dominus-widget.light .date-container-days .date-container-years div.range-in:not(.no-highlight).old,.tempus-dominus-widget.light .date-container-days .date-container-years div.range-start:not(.no-highlight).new,.tempus-dominus-widget.light .date-container-days .date-container-years div.range-start:not(.no-highlight).old,.tempus-dominus-widget.light .date-container-days .time-container-clock div.range-end:not(.no-highlight).new,.tempus-dominus-widget.light .date-container-days .time-container-clock div.range-end:not(.no-highlight).old,.tempus-dominus-widget.light .date-container-days .time-container-clock div.range-in:not(.no-highlight).new,.tempus-dominus-widget.light .date-container-days .time-container-clock div.range-in:not(.no-highlight).old,.tempus-dominus-widget.light .date-container-days .time-container-clock div.range-start:not(.no-highlight).new,.tempus-dominus-widget.light .date-container-days .time-container-clock div.range-start:not(.no-highlight).old,.tempus-dominus-widget.light .date-container-days .time-container-hour div.range-end:not(.no-highlight).new,.tempus-dominus-widget.light .date-container-days .time-container-hour div.range-end:not(.no-highlight).old,.tempus-dominus-widget.light .date-container-days .time-container-hour div.range-in:not(.no-highlight).new,.tempus-dominus-widget.light .date-container-days .time-container-hour div.range-in:not(.no-highlight).old,.tempus-dominus-widget.light .date-container-days .time-container-hour div.range-start:not(.no-highlight).new,.tempus-dominus-widget.light .date-container-days .time-container-hour div.range-start:not(.no-highlight).old,.tempus-dominus-widget.light .date-container-days .time-container-minute div.range-end:not(.no-highlight).new,.tempus-dominus-widget.light .date-container-days .time-container-minute div.range-end:not(.no-highlight).old,.tempus-dominus-widget.light .date-container-days .time-container-minute div.range-in:not(.no-highlight).new,.tempus-dominus-widget.light .date-container-days .time-container-minute div.range-in:not(.no-highlight).old,.tempus-dominus-widget.light .date-container-days .time-container-minute div.range-start:not(.no-highlight).new,.tempus-dominus-widget.light .date-container-days .time-container-minute div.range-start:not(.no-highlight).old,.tempus-dominus-widget.light .date-container-days .time-container-second div.range-end:not(.no-highlight).new,.tempus-dominus-widget.light .date-container-days .time-container-second div.range-end:not(.no-highlight).old,.tempus-dominus-widget.light .date-container-days .time-container-second div.range-in:not(.no-highlight).new,.tempus-dominus-widget.light .date-container-days .time-container-second div.range-in:not(.no-highlight).old,.tempus-dominus-widget.light .date-container-days .time-container-second div.range-start:not(.no-highlight).new,.tempus-dominus-widget.light .date-container-days .time-container-second div.range-start:not(.no-highlight).old,.tempus-dominus-widget.light .date-container-days div.range-end:not(.no-highlight).new,.tempus-dominus-widget.light .date-container-days div.range-end:not(.no-highlight).old,.tempus-dominus-widget.light .date-container-days div.range-in:not(.no-highlight).new,.tempus-dominus-widget.light .date-container-days div.range-in:not(.no-highlight).old,.tempus-dominus-widget.light .date-container-days div.range-start:not(.no-highlight).new,.tempus-dominus-widget.light .date-container-days div.range-start:not(.no-highlight).old,.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).active.new,.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).active.old,.tempus-dominus-widget.light .date-container-decades .date-container-days div.range-end:not(.no-highlight).new,.tempus-dominus-widget.light .date-container-decades .date-container-days div.range-end:not(.no-highlight).old,.tempus-dominus-widget.light .date-container-decades .date-container-days div.range-in:not(.no-highlight).new,.tempus-dominus-widget.light .date-container-decades .date-container-days div.range-in:not(.no-highlight).old,.tempus-dominus-widget.light .date-container-decades .date-container-days div.range-start:not(.no-highlight).new,.tempus-dominus-widget.light .date-container-decades .date-container-days div.range-start:not(.no-highlight).old,.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).active.new,.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).active.old,.tempus-dominus-widget.light .date-container-months .date-container-days div.range-end:not(.no-highlight).new,.tempus-dominus-widget.light .date-container-months .date-container-days div.range-end:not(.no-highlight).old,.tempus-dominus-widget.light .date-container-months .date-container-days div.range-in:not(.no-highlight).new,.tempus-dominus-widget.light .date-container-months .date-container-days div.range-in:not(.no-highlight).old,.tempus-dominus-widget.light .date-container-months .date-container-days div.range-start:not(.no-highlight).new,.tempus-dominus-widget.light .date-container-months .date-container-days div.range-start:not(.no-highlight).old,.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).active.new,.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).active.old,.tempus-dominus-widget.light .date-container-years .date-container-days div.range-end:not(.no-highlight).new,.tempus-dominus-widget.light .date-container-years .date-container-days div.range-end:not(.no-highlight).old,.tempus-dominus-widget.light .date-container-years .date-container-days div.range-in:not(.no-highlight).new,.tempus-dominus-widget.light .date-container-years .date-container-days div.range-in:not(.no-highlight).old,.tempus-dominus-widget.light .date-container-years .date-container-days div.range-start:not(.no-highlight).new,.tempus-dominus-widget.light .date-container-years .date-container-days div.range-start:not(.no-highlight).old,.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).active.new,.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).active.old,.tempus-dominus-widget.light .time-container-clock .date-container-days div.range-end:not(.no-highlight).new,.tempus-dominus-widget.light .time-container-clock .date-container-days div.range-end:not(.no-highlight).old,.tempus-dominus-widget.light .time-container-clock .date-container-days div.range-in:not(.no-highlight).new,.tempus-dominus-widget.light .time-container-clock .date-container-days div.range-in:not(.no-highlight).old,.tempus-dominus-widget.light .time-container-clock .date-container-days div.range-start:not(.no-highlight).new,.tempus-dominus-widget.light .time-container-clock .date-container-days div.range-start:not(.no-highlight).old,.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).active.new,.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).active.old,.tempus-dominus-widget.light .time-container-hour .date-container-days div.range-end:not(.no-highlight).new,.tempus-dominus-widget.light .time-container-hour .date-container-days div.range-end:not(.no-highlight).old,.tempus-dominus-widget.light .time-container-hour .date-container-days div.range-in:not(.no-highlight).new,.tempus-dominus-widget.light .time-container-hour .date-container-days div.range-in:not(.no-highlight).old,.tempus-dominus-widget.light .time-container-hour .date-container-days div.range-start:not(.no-highlight).new,.tempus-dominus-widget.light .time-container-hour .date-container-days div.range-start:not(.no-highlight).old,.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).active.new,.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).active.old,.tempus-dominus-widget.light .time-container-minute .date-container-days div.range-end:not(.no-highlight).new,.tempus-dominus-widget.light .time-container-minute .date-container-days div.range-end:not(.no-highlight).old,.tempus-dominus-widget.light .time-container-minute .date-container-days div.range-in:not(.no-highlight).new,.tempus-dominus-widget.light .time-container-minute .date-container-days div.range-in:not(.no-highlight).old,.tempus-dominus-widget.light .time-container-minute .date-container-days div.range-start:not(.no-highlight).new,.tempus-dominus-widget.light .time-container-minute .date-container-days div.range-start:not(.no-highlight).old,.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).active.new,.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).active.old,.tempus-dominus-widget.light .time-container-second .date-container-days div.range-end:not(.no-highlight).new,.tempus-dominus-widget.light .time-container-second .date-container-days div.range-end:not(.no-highlight).old,.tempus-dominus-widget.light .time-container-second .date-container-days div.range-in:not(.no-highlight).new,.tempus-dominus-widget.light .time-container-second .date-container-days div.range-in:not(.no-highlight).old,.tempus-dominus-widget.light .time-container-second .date-container-days div.range-start:not(.no-highlight).new,.tempus-dominus-widget.light .time-container-second .date-container-days div.range-start:not(.no-highlight).old,.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).active.new,.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).active.old{color:#fff}.tempus-dominus-widget.light .date-container-days div.range-end:not(.no-highlight).today:before,.tempus-dominus-widget.light .date-container-days div.range-in:not(.no-highlight).today:before,.tempus-dominus-widget.light .date-container-days div.range-start:not(.no-highlight).today:before,.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).active.today:before,.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).active.today:before,.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).active.today:before,.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).active.today:before,.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).active.today:before,.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).active.today:before,.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).active.today:before,.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).active.today:before{border-bottom-color:#fff}.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).new,.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).old,.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).new,.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).old,.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).new,.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).old,.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).new,.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).old,.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).new,.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).old,.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).new,.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).old,.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).new,.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).old,.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).new,.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).old{color:rgba(0,0,0,.38)}.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).disabled,.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).disabled:hover,.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).disabled,.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).disabled:hover,.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).disabled,.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).disabled:hover,.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).disabled,.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).disabled:hover,.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).disabled,.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).disabled:hover,.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).disabled,.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).disabled:hover,.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).disabled,.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).disabled:hover,.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).disabled,.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).disabled:hover{color:#6c757d}.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).today:before,.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).today:before,.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).today:before,.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).today:before,.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).today:before,.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).today:before,.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).today:before,.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).today:before{border-bottom-color:#0d6efd;border-top-color:rgba(0,0,0,.2)}.tempus-dominus-widget.light button{background-color:#0d6efd;border-color:#0d6efd;color:#fff}.tempus-dominus-widget.dark{background-color:#1b1b1b;color:#e3e3e3}.tempus-dominus-widget.dark [data-action].disabled,.tempus-dominus-widget.dark [data-action].disabled:hover{color:#6c757d}.tempus-dominus-widget.dark .toolbar div:hover{background:#232627}.tempus-dominus-widget.dark .date-container-days .dow{color:hsla(36,10%,90%,.5)}.tempus-dominus-widget.dark .date-container-days .range-in{background-color:#0071c7!important;box-shadow:-5px 0 0 #0071c7,5px 0 0 #0071c7}.tempus-dominus-widget.dark .date-container-days .cw{color:hsla(36,10%,90%,.38)}.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight):hover,.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight):hover,.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight):hover,.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight):hover,.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight):hover,.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight):hover,.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight):hover,.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight):hover{background:#232627}.tempus-dominus-widget.dark .date-container-days div.range-end:not(.no-highlight),.tempus-dominus-widget.dark .date-container-days div.range-in:not(.no-highlight),.tempus-dominus-widget.dark .date-container-days div.range-start:not(.no-highlight),.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).active,.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).active,.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).active,.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).active,.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).active,.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).active,.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).active,.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).active{background-color:#4db2ff;color:#fff;text-shadow:0 -1px 0 hsla(36,10%,90%,.25)}.tempus-dominus-widget.dark .date-container-days .date-container-decades div.range-end:not(.no-highlight).new,.tempus-dominus-widget.dark .date-container-days .date-container-decades div.range-end:not(.no-highlight).old,.tempus-dominus-widget.dark .date-container-days .date-container-decades div.range-in:not(.no-highlight).new,.tempus-dominus-widget.dark .date-container-days .date-container-decades div.range-in:not(.no-highlight).old,.tempus-dominus-widget.dark .date-container-days .date-container-decades div.range-start:not(.no-highlight).new,.tempus-dominus-widget.dark .date-container-days .date-container-decades div.range-start:not(.no-highlight).old,.tempus-dominus-widget.dark .date-container-days .date-container-months div.range-end:not(.no-highlight).new,.tempus-dominus-widget.dark .date-container-days .date-container-months div.range-end:not(.no-highlight).old,.tempus-dominus-widget.dark .date-container-days .date-container-months div.range-in:not(.no-highlight).new,.tempus-dominus-widget.dark .date-container-days .date-container-months div.range-in:not(.no-highlight).old,.tempus-dominus-widget.dark .date-container-days .date-container-months div.range-start:not(.no-highlight).new,.tempus-dominus-widget.dark .date-container-days .date-container-months div.range-start:not(.no-highlight).old,.tempus-dominus-widget.dark .date-container-days .date-container-years div.range-end:not(.no-highlight).new,.tempus-dominus-widget.dark .date-container-days .date-container-years div.range-end:not(.no-highlight).old,.tempus-dominus-widget.dark .date-container-days .date-container-years div.range-in:not(.no-highlight).new,.tempus-dominus-widget.dark .date-container-days .date-container-years div.range-in:not(.no-highlight).old,.tempus-dominus-widget.dark .date-container-days .date-container-years div.range-start:not(.no-highlight).new,.tempus-dominus-widget.dark .date-container-days .date-container-years div.range-start:not(.no-highlight).old,.tempus-dominus-widget.dark .date-container-days .time-container-clock div.range-end:not(.no-highlight).new,.tempus-dominus-widget.dark .date-container-days .time-container-clock div.range-end:not(.no-highlight).old,.tempus-dominus-widget.dark .date-container-days .time-container-clock div.range-in:not(.no-highlight).new,.tempus-dominus-widget.dark .date-container-days .time-container-clock div.range-in:not(.no-highlight).old,.tempus-dominus-widget.dark .date-container-days .time-container-clock div.range-start:not(.no-highlight).new,.tempus-dominus-widget.dark .date-container-days .time-container-clock div.range-start:not(.no-highlight).old,.tempus-dominus-widget.dark .date-container-days .time-container-hour div.range-end:not(.no-highlight).new,.tempus-dominus-widget.dark .date-container-days .time-container-hour div.range-end:not(.no-highlight).old,.tempus-dominus-widget.dark .date-container-days .time-container-hour div.range-in:not(.no-highlight).new,.tempus-dominus-widget.dark .date-container-days .time-container-hour div.range-in:not(.no-highlight).old,.tempus-dominus-widget.dark .date-container-days .time-container-hour div.range-start:not(.no-highlight).new,.tempus-dominus-widget.dark .date-container-days .time-container-hour div.range-start:not(.no-highlight).old,.tempus-dominus-widget.dark .date-container-days .time-container-minute div.range-end:not(.no-highlight).new,.tempus-dominus-widget.dark .date-container-days .time-container-minute div.range-end:not(.no-highlight).old,.tempus-dominus-widget.dark .date-container-days .time-container-minute div.range-in:not(.no-highlight).new,.tempus-dominus-widget.dark .date-container-days .time-container-minute div.range-in:not(.no-highlight).old,.tempus-dominus-widget.dark .date-container-days .time-container-minute div.range-start:not(.no-highlight).new,.tempus-dominus-widget.dark .date-container-days .time-container-minute div.range-start:not(.no-highlight).old,.tempus-dominus-widget.dark .date-container-days .time-container-second div.range-end:not(.no-highlight).new,.tempus-dominus-widget.dark .date-container-days .time-container-second div.range-end:not(.no-highlight).old,.tempus-dominus-widget.dark .date-container-days .time-container-second div.range-in:not(.no-highlight).new,.tempus-dominus-widget.dark .date-container-days .time-container-second div.range-in:not(.no-highlight).old,.tempus-dominus-widget.dark .date-container-days .time-container-second div.range-start:not(.no-highlight).new,.tempus-dominus-widget.dark .date-container-days .time-container-second div.range-start:not(.no-highlight).old,.tempus-dominus-widget.dark .date-container-days div.range-end:not(.no-highlight).new,.tempus-dominus-widget.dark .date-container-days div.range-end:not(.no-highlight).old,.tempus-dominus-widget.dark .date-container-days div.range-in:not(.no-highlight).new,.tempus-dominus-widget.dark .date-container-days div.range-in:not(.no-highlight).old,.tempus-dominus-widget.dark .date-container-days div.range-start:not(.no-highlight).new,.tempus-dominus-widget.dark .date-container-days div.range-start:not(.no-highlight).old,.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).active.new,.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).active.old,.tempus-dominus-widget.dark .date-container-decades .date-container-days div.range-end:not(.no-highlight).new,.tempus-dominus-widget.dark .date-container-decades .date-container-days div.range-end:not(.no-highlight).old,.tempus-dominus-widget.dark .date-container-decades .date-container-days div.range-in:not(.no-highlight).new,.tempus-dominus-widget.dark .date-container-decades .date-container-days div.range-in:not(.no-highlight).old,.tempus-dominus-widget.dark .date-container-decades .date-container-days div.range-start:not(.no-highlight).new,.tempus-dominus-widget.dark .date-container-decades .date-container-days div.range-start:not(.no-highlight).old,.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).active.new,.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).active.old,.tempus-dominus-widget.dark .date-container-months .date-container-days div.range-end:not(.no-highlight).new,.tempus-dominus-widget.dark .date-container-months .date-container-days div.range-end:not(.no-highlight).old,.tempus-dominus-widget.dark .date-container-months .date-container-days div.range-in:not(.no-highlight).new,.tempus-dominus-widget.dark .date-container-months .date-container-days div.range-in:not(.no-highlight).old,.tempus-dominus-widget.dark .date-container-months .date-container-days div.range-start:not(.no-highlight).new,.tempus-dominus-widget.dark .date-container-months .date-container-days div.range-start:not(.no-highlight).old,.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).active.new,.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).active.old,.tempus-dominus-widget.dark .date-container-years .date-container-days div.range-end:not(.no-highlight).new,.tempus-dominus-widget.dark .date-container-years .date-container-days div.range-end:not(.no-highlight).old,.tempus-dominus-widget.dark .date-container-years .date-container-days div.range-in:not(.no-highlight).new,.tempus-dominus-widget.dark .date-container-years .date-container-days div.range-in:not(.no-highlight).old,.tempus-dominus-widget.dark .date-container-years .date-container-days div.range-start:not(.no-highlight).new,.tempus-dominus-widget.dark .date-container-years .date-container-days div.range-start:not(.no-highlight).old,.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).active.new,.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).active.old,.tempus-dominus-widget.dark .time-container-clock .date-container-days div.range-end:not(.no-highlight).new,.tempus-dominus-widget.dark .time-container-clock .date-container-days div.range-end:not(.no-highlight).old,.tempus-dominus-widget.dark .time-container-clock .date-container-days div.range-in:not(.no-highlight).new,.tempus-dominus-widget.dark .time-container-clock .date-container-days div.range-in:not(.no-highlight).old,.tempus-dominus-widget.dark .time-container-clock .date-container-days div.range-start:not(.no-highlight).new,.tempus-dominus-widget.dark .time-container-clock .date-container-days div.range-start:not(.no-highlight).old,.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).active.new,.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).active.old,.tempus-dominus-widget.dark .time-container-hour .date-container-days div.range-end:not(.no-highlight).new,.tempus-dominus-widget.dark .time-container-hour .date-container-days div.range-end:not(.no-highlight).old,.tempus-dominus-widget.dark .time-container-hour .date-container-days div.range-in:not(.no-highlight).new,.tempus-dominus-widget.dark .time-container-hour .date-container-days div.range-in:not(.no-highlight).old,.tempus-dominus-widget.dark .time-container-hour .date-container-days div.range-start:not(.no-highlight).new,.tempus-dominus-widget.dark .time-container-hour .date-container-days div.range-start:not(.no-highlight).old,.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).active.new,.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).active.old,.tempus-dominus-widget.dark .time-container-minute .date-container-days div.range-end:not(.no-highlight).new,.tempus-dominus-widget.dark .time-container-minute .date-container-days div.range-end:not(.no-highlight).old,.tempus-dominus-widget.dark .time-container-minute .date-container-days div.range-in:not(.no-highlight).new,.tempus-dominus-widget.dark .time-container-minute .date-container-days div.range-in:not(.no-highlight).old,.tempus-dominus-widget.dark .time-container-minute .date-container-days div.range-start:not(.no-highlight).new,.tempus-dominus-widget.dark .time-container-minute .date-container-days div.range-start:not(.no-highlight).old,.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).active.new,.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).active.old,.tempus-dominus-widget.dark .time-container-second .date-container-days div.range-end:not(.no-highlight).new,.tempus-dominus-widget.dark .time-container-second .date-container-days div.range-end:not(.no-highlight).old,.tempus-dominus-widget.dark .time-container-second .date-container-days div.range-in:not(.no-highlight).new,.tempus-dominus-widget.dark .time-container-second .date-container-days div.range-in:not(.no-highlight).old,.tempus-dominus-widget.dark .time-container-second .date-container-days div.range-start:not(.no-highlight).new,.tempus-dominus-widget.dark .time-container-second .date-container-days div.range-start:not(.no-highlight).old,.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).active.new,.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).active.old{color:#fff}.tempus-dominus-widget.dark .date-container-days div.range-end:not(.no-highlight).today:before,.tempus-dominus-widget.dark .date-container-days div.range-in:not(.no-highlight).today:before,.tempus-dominus-widget.dark .date-container-days div.range-start:not(.no-highlight).today:before,.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).active.today:before,.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).active.today:before,.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).active.today:before,.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).active.today:before,.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).active.today:before,.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).active.today:before,.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).active.today:before,.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).active.today:before{border-bottom-color:#1b1b1b}.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).new,.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).old,.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).new,.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).old,.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).new,.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).old,.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).new,.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).old,.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).new,.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).old,.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).new,.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).old,.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).new,.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).old,.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).new,.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).old{color:hsla(36,10%,90%,.38)}.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).disabled,.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).disabled:hover,.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).disabled,.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).disabled:hover,.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).disabled,.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).disabled:hover,.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).disabled,.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).disabled:hover,.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).disabled,.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).disabled:hover,.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).disabled,.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).disabled:hover,.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).disabled,.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).disabled:hover,.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).disabled,.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).disabled:hover{color:#6c757d}.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).today:before,.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).today:before,.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).today:before,.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).today:before,.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).today:before,.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).today:before,.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).today:before,.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).today:before{border-bottom-color:#4db2ff;border-top-color:hsla(36,10%,90%,.2)}.tempus-dominus-widget.dark button{background-color:#4db2ff;border-color:#4db2ff;color:#fff} \ No newline at end of file diff --git a/node_modules/@eonasdan/tempus-dominus/dist/js/jQuery-provider.js b/node_modules/@eonasdan/tempus-dominus/dist/js/jQuery-provider.js deleted file mode 100644 index ebf087f..0000000 --- a/node_modules/@eonasdan/tempus-dominus/dist/js/jQuery-provider.js +++ /dev/null @@ -1,154 +0,0 @@ -/// -/*global $, tempusDominus */ - -/*! - * Tempus Dominus v6.7.19 (https://getdatepicker.com/) - * Copyright 2013-2021 Jonathan Peterson - * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) - */ -tempusDominus.jQueryInterface = function (option, argument) { - if (this.length === 1) { - return tempusDominus.jQueryHandleThis(this, option, argument); - } - // "this" is jquery here - return this.each(function () { - tempusDominus.jQueryHandleThis(this, option, argument); - }); -}; - -tempusDominus.jQueryHandleThis = function (me, option, argument) { - let data = $(me).data(tempusDominus.Namespace.dataKey); - if (typeof option === 'object') { - option = $.extend({}, tempusDominus.DefaultOptions, option); - } - - if (!data) { - data = new tempusDominus.TempusDominus($(me)[0], option); - $(me).data(tempusDominus.Namespace.dataKey, data); - } - - if (typeof option === 'string') { - if (data[option] === undefined) { - throw new Error(`No method named "${option}"`); - } - if (argument === undefined) { - return data[option](); - } else { - if (option === 'date') { - data.isDateUpdateThroughDateOptionFromClientCode = true; - } - const ret = data[option](argument); - data.isDateUpdateThroughDateOptionFromClientCode = false; - return ret; - } - } -}; - -tempusDominus.getSelectorFromElement = function ($element) { - let selector = $element.data('target'), - $selector; - - if (!selector) { - selector = $element.attr('href') || ''; - selector = /^#[a-z]/i.test(selector) ? selector : null; - } - $selector = $(selector); - if ($selector.length === 0) { - return $element; - } - - if (!$selector.data(tempusDominus.Namespace.dataKey)) { - $.extend({}, $selector.data(), $(this).data()); - } - - return $selector; -}; - -/** - * ------------------------------------------------------------------------ - * jQuery - * ------------------------------------------------------------------------ - */ -$(document) - .on( - `click${tempusDominus.Namespace.events.key}.data-api`, - `[data-toggle="${tempusDominus.Namespace.dataKey}"]`, - function () { - const $originalTarget = $(this), - $target = tempusDominus.getSelectorFromElement($originalTarget), - config = $target.data(tempusDominus.Namespace.dataKey); - if ($target.length === 0) { - return; - } - if ( - config._options.allowInputToggle && - $originalTarget.is('input[data-toggle="datetimepicker"]') - ) { - return; - } - tempusDominus.jQueryInterface.call($target, 'toggle'); - } - ) - .on( - tempusDominus.Namespace.events.change, - `.${tempusDominus.Namespace.NAME}-input`, - function (event) { - const $target = tempusDominus.getSelectorFromElement($(this)); - if ($target.length === 0 || event.isInit) { - return; - } - tempusDominus.jQueryInterface.call($target, '_change', event); - } - ) - .on( - tempusDominus.Namespace.events.blur, - `.${tempusDominus.Namespace.NAME}-input`, - function (event) { - const $target = tempusDominus.getSelectorFromElement($(this)), - config = $target.data(tempusDominus.Namespace.dataKey); - if ($target.length === 0) { - return; - } - if (config._options.debug || window.debug) { - return; - } - tempusDominus.jQueryInterface.call($target, 'hide', event); - } - ) - /*.on(tempusDominus.Namespace.Events.keydown, `.${tempusDominus.Namespace.NAME}-input`, function (event) { - const $target = tempusDominus.getSelectorFromElement($(this)); - if ($target.length === 0) { - return; - } - tempusDominus.jQueryInterface.call($target, '_keydown', event); - }) - .on(tempusDominus.Namespace.Events.keyup, `.${tempusDominus.Namespace.NAME}-input`, function (event) { - const $target = tempusDominus.getSelectorFromElement($(this)); - if ($target.length === 0) { - return; - } - tempusDominus.jQueryInterface.call($target, '_keyup', event); - })*/ - .on( - tempusDominus.Namespace.events.focus, - `.${tempusDominus.Namespace.NAME}-input`, - function (event) { - const $target = tempusDominus.getSelectorFromElement($(this)), - config = $target.data(tempusDominus.Namespace.dataKey); - if ($target.length === 0) { - return; - } - if (!config._options.allowInputToggle) { - return; - } - tempusDominus.jQueryInterface.call($target, 'show', event); - } - ); -const name = 'tempusDominus'; -const JQUERY_NO_CONFLICT = $.fn[name]; -$.fn[name] = tempusDominus.jQueryInterface; -$.fn[name].Constructor = tempusDominus.TempusDominus; -$.fn[name].noConflict = function () { - $.fn[name] = JQUERY_NO_CONFLICT; - return tempusDominus.jQueryInterface; -}; diff --git a/node_modules/@eonasdan/tempus-dominus/dist/js/jQuery-provider.min.js b/node_modules/@eonasdan/tempus-dominus/dist/js/jQuery-provider.min.js deleted file mode 100644 index 3a37f20..0000000 --- a/node_modules/@eonasdan/tempus-dominus/dist/js/jQuery-provider.min.js +++ /dev/null @@ -1,6 +0,0 @@ -/*! - * Tempus Dominus v6.7.19 (https://getdatepicker.com/) - * Copyright 2013-2021 Jonathan Peterson - * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) - */ -tempusDominus.jQueryInterface=function(e,t){return 1===this.length?tempusDominus.jQueryHandleThis(this,e,t):this.each((function(){tempusDominus.jQueryHandleThis(this,e,t)}))},tempusDominus.jQueryHandleThis=function(e,t,n){let s=$(e).data(tempusDominus.Namespace.dataKey);if("object"==typeof t&&(t=$.extend({},tempusDominus.DefaultOptions,t)),s||(s=new tempusDominus.TempusDominus($(e)[0],t),$(e).data(tempusDominus.Namespace.dataKey,s)),"string"==typeof t){if(void 0===s[t])throw new Error(`No method named "${t}"`);if(void 0===n)return s[t]();{"date"===t&&(s.isDateUpdateThroughDateOptionFromClientCode=!0);const e=s[t](n);return s.isDateUpdateThroughDateOptionFromClientCode=!1,e}}},tempusDominus.getSelectorFromElement=function(e){let t,n=e.data("target");return n||(n=e.attr("href")||"",n=/^#[a-z]/i.test(n)?n:null),t=$(n),0===t.length?e:(t.data(tempusDominus.Namespace.dataKey)||$.extend({},t.data(),$(this).data()),t)},$(document).on(`click${tempusDominus.Namespace.events.key}.data-api`,`[data-toggle="${tempusDominus.Namespace.dataKey}"]`,(function(){const e=$(this),t=tempusDominus.getSelectorFromElement(e),n=t.data(tempusDominus.Namespace.dataKey);0!==t.length&&(n._options.allowInputToggle&&e.is('input[data-toggle="datetimepicker"]')||tempusDominus.jQueryInterface.call(t,"toggle"))})).on(tempusDominus.Namespace.events.change,`.${tempusDominus.Namespace.NAME}-input`,(function(e){const t=tempusDominus.getSelectorFromElement($(this));0===t.length||e.isInit||tempusDominus.jQueryInterface.call(t,"_change",e)})).on(tempusDominus.Namespace.events.blur,`.${tempusDominus.Namespace.NAME}-input`,(function(e){const t=tempusDominus.getSelectorFromElement($(this)),n=t.data(tempusDominus.Namespace.dataKey);0!==t.length&&(n._options.debug||window.debug||tempusDominus.jQueryInterface.call(t,"hide",e))})).on(tempusDominus.Namespace.events.focus,`.${tempusDominus.Namespace.NAME}-input`,(function(e){const t=tempusDominus.getSelectorFromElement($(this)),n=t.data(tempusDominus.Namespace.dataKey);0!==t.length&&n._options.allowInputToggle&&tempusDominus.jQueryInterface.call(t,"show",e)}));const e="tempusDominus",t=$.fn[e];$.fn[e]=tempusDominus.jQueryInterface,$.fn[e].Constructor=tempusDominus.TempusDominus,$.fn[e].noConflict=function(){return $.fn[e]=t,tempusDominus.jQueryInterface}; diff --git a/node_modules/@eonasdan/tempus-dominus/dist/js/tempus-dominus.esm.js b/node_modules/@eonasdan/tempus-dominus/dist/js/tempus-dominus.esm.js deleted file mode 100644 index 6401c1b..0000000 --- a/node_modules/@eonasdan/tempus-dominus/dist/js/tempus-dominus.esm.js +++ /dev/null @@ -1,4673 +0,0 @@ -/*! - * Tempus Dominus v6.7.19 (https://getdatepicker.com/) - * Copyright 2013-2023 Jonathan Peterson - * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) - */ -class TdError extends Error { -} -class ErrorMessages { - constructor() { - this.base = 'TD:'; - //#endregion - //#region used with notify.error - /** - * Used with an Error Event type if the user selects a date that - * fails restriction validation. - */ - this.failedToSetInvalidDate = 'Failed to set invalid date'; - /** - * Used with an Error Event type when a user changes the value of the - * input field directly, and does not provide a valid date. - */ - this.failedToParseInput = 'Failed parse input field'; - //#endregion - } - //#region out to console - /** - * Throws an error indicating that a key in the options object is invalid. - * @param optionName - */ - unexpectedOption(optionName) { - const error = new TdError(`${this.base} Unexpected option: ${optionName} does not match a known option.`); - error.code = 1; - throw error; - } - /** - * Throws an error indicating that one more keys in the options object is invalid. - * @param optionName - */ - unexpectedOptions(optionName) { - const error = new TdError(`${this.base}: ${optionName.join(', ')}`); - error.code = 1; - throw error; - } - /** - * Throws an error when an option is provide an unsupported value. - * For example a value of 'cheese' for toolbarPlacement which only supports - * 'top', 'bottom', 'default'. - * @param optionName - * @param badValue - * @param validOptions - */ - unexpectedOptionValue(optionName, badValue, validOptions) { - const error = new TdError(`${this.base} Unexpected option value: ${optionName} does not accept a value of "${badValue}". Valid values are: ${validOptions.join(', ')}`); - error.code = 2; - throw error; - } - /** - * Throws an error when an option value is the wrong type. - * For example a string value was provided to multipleDates which only - * supports true or false. - * @param optionName - * @param badType - * @param expectedType - */ - typeMismatch(optionName, badType, expectedType) { - const error = new TdError(`${this.base} Mismatch types: ${optionName} has a type of ${badType} instead of the required ${expectedType}`); - error.code = 3; - throw error; - } - /** - * Throws an error when an option value is outside of the expected range. - * For example restrictions.daysOfWeekDisabled excepts a value between 0 and 6. - * @param optionName - * @param lower - * @param upper - */ - numbersOutOfRange(optionName, lower, upper) { - const error = new TdError(`${this.base} ${optionName} expected an array of number between ${lower} and ${upper}.`); - error.code = 4; - throw error; - } - /** - * Throws an error when a value for a date options couldn't be parsed. Either - * the option was an invalid string or an invalid Date object. - * @param optionName - * @param date - * @param soft If true, logs a warning instead of an error. - */ - //eslint-disable-next-line @typescript-eslint/no-explicit-any - failedToParseDate(optionName, date, soft = false) { - const error = new TdError(`${this.base} Could not correctly parse "${date}" to a date for ${optionName}.`); - error.code = 5; - if (!soft) - throw error; - console.warn(error); - } - /** - * Throws when an element to attach to was not provided in the constructor. - */ - mustProvideElement() { - const error = new TdError(`${this.base} No element was provided.`); - error.code = 6; - throw error; - } - /** - * Throws if providing an array for the events to subscribe method doesn't have - * the same number of callbacks. E.g., subscribe([1,2], [1]) - */ - subscribeMismatch() { - const error = new TdError(`${this.base} The subscribed events does not match the number of callbacks`); - error.code = 7; - throw error; - } - /** - * Throws if the configuration has conflicting rules e.g. minDate is after maxDate - */ - conflictingConfiguration(message) { - const error = new TdError(`${this.base} A configuration value conflicts with another rule. ${message}`); - error.code = 8; - throw error; - } - /** - * customDateFormat errors - */ - customDateFormatError(message) { - const error = new TdError(`${this.base} Custom Date Format: ${message}`); - error.code = 9; - throw error; - } - /** - * Logs a warning if a date option value is provided as a string, instead of - * a date/datetime object. - */ - dateString() { - console.warn(`${this.base} Using a string for date options is not recommended unless you specify an ISO string or use the customDateFormat plugin.`); - } - deprecatedWarning(message, remediation) { - console.warn(`${this.base} Warning ${message} is deprecated and will be removed in a future version. ${remediation}`); - } - throwError(message) { - const error = new TdError(`${this.base} ${message}`); - error.code = 9; - throw error; - } -} - -// this is not the way I want this to stay but nested classes seemed to blown up once its compiled. -const NAME = 'tempus-dominus', dataKey = 'td'; -/** - * Events - */ -class Events { - constructor() { - this.key = `.${dataKey}`; - /** - * Change event. Fired when the user selects a date. - * See also EventTypes.ChangeEvent - */ - this.change = `change${this.key}`; - /** - * Emit when the view changes for example from month view to the year view. - * See also EventTypes.ViewUpdateEvent - */ - this.update = `update${this.key}`; - /** - * Emits when a selected date or value from the input field fails to meet the provided validation rules. - * See also EventTypes.FailEvent - */ - this.error = `error${this.key}`; - /** - * Show event - * @event Events#show - */ - this.show = `show${this.key}`; - /** - * Hide event - * @event Events#hide - */ - this.hide = `hide${this.key}`; - // blur and focus are used in the jQuery provider but are otherwise unused. - // keyup/down will be used later for keybinding options - this.blur = `blur${this.key}`; - this.focus = `focus${this.key}`; - this.keyup = `keyup${this.key}`; - this.keydown = `keydown${this.key}`; - } -} -class Css { - constructor() { - /** - * The outer element for the widget. - */ - this.widget = `${NAME}-widget`; - /** - * Hold the previous, next and switcher divs - */ - this.calendarHeader = 'calendar-header'; - /** - * The element for the action to change the calendar view. E.g. month -> year. - */ - this.switch = 'picker-switch'; - /** - * The elements for all the toolbar options - */ - this.toolbar = 'toolbar'; - /** - * Disables the hover and rounding affect. - */ - this.noHighlight = 'no-highlight'; - /** - * Applied to the widget element when the side by side option is in use. - */ - this.sideBySide = 'timepicker-sbs'; - /** - * The element for the action to change the calendar view, e.g. August -> July - */ - this.previous = 'previous'; - /** - * The element for the action to change the calendar view, e.g. August -> September - */ - this.next = 'next'; - /** - * Applied to any action that would violate any restriction options. ALso applied - * to an input field if the disabled function is called. - */ - this.disabled = 'disabled'; - /** - * Applied to any date that is less than requested view, - * e.g. the last day of the previous month. - */ - this.old = 'old'; - /** - * Applied to any date that is greater than of requested view, - * e.g. the last day of the previous month. - */ - this.new = 'new'; - /** - * Applied to any date that is currently selected. - */ - this.active = 'active'; - //#region date element - /** - * The outer element for the calendar view. - */ - this.dateContainer = 'date-container'; - /** - * The outer element for the decades view. - */ - this.decadesContainer = `${this.dateContainer}-decades`; - /** - * Applied to elements within the decade container, e.g. 2020, 2030 - */ - this.decade = 'decade'; - /** - * The outer element for the years view. - */ - this.yearsContainer = `${this.dateContainer}-years`; - /** - * Applied to elements within the years container, e.g. 2021, 2021 - */ - this.year = 'year'; - /** - * The outer element for the month view. - */ - this.monthsContainer = `${this.dateContainer}-months`; - /** - * Applied to elements within the month container, e.g. January, February - */ - this.month = 'month'; - /** - * The outer element for the calendar view. - */ - this.daysContainer = `${this.dateContainer}-days`; - /** - * Applied to elements within the day container, e.g. 1, 2..31 - */ - this.day = 'day'; - /** - * If display.calendarWeeks is enabled, a column displaying the week of year - * is shown. This class is applied to each cell in that column. - */ - this.calendarWeeks = 'cw'; - /** - * Applied to the first row of the calendar view, e.g. Sunday, Monday - */ - this.dayOfTheWeek = 'dow'; - /** - * Applied to the current date on the calendar view. - */ - this.today = 'today'; - /** - * Applied to the locale's weekend dates on the calendar view, e.g. Sunday, Saturday - */ - this.weekend = 'weekend'; - this.rangeIn = 'range-in'; - this.rangeStart = 'range-start'; - this.rangeEnd = 'range-end'; - //#endregion - //#region time element - /** - * The outer element for all time related elements. - */ - this.timeContainer = 'time-container'; - /** - * Applied the separator columns between time elements, e.g. hour *:* minute *:* second - */ - this.separator = 'separator'; - /** - * The outer element for the clock view. - */ - this.clockContainer = `${this.timeContainer}-clock`; - /** - * The outer element for the hours selection view. - */ - this.hourContainer = `${this.timeContainer}-hour`; - /** - * The outer element for the minutes selection view. - */ - this.minuteContainer = `${this.timeContainer}-minute`; - /** - * The outer element for the seconds selection view. - */ - this.secondContainer = `${this.timeContainer}-second`; - /** - * Applied to each element in the hours selection view. - */ - this.hour = 'hour'; - /** - * Applied to each element in the minutes selection view. - */ - this.minute = 'minute'; - /** - * Applied to each element in the seconds selection view. - */ - this.second = 'second'; - /** - * Applied AM/PM toggle button. - */ - this.toggleMeridiem = 'toggleMeridiem'; - //#endregion - //#region collapse - /** - * Applied the element of the current view mode, e.g. calendar or clock. - */ - this.show = 'show'; - /** - * Applied to the currently showing view mode during a transition - * between calendar and clock views - */ - this.collapsing = 'td-collapsing'; - /** - * Applied to the currently hidden view mode. - */ - this.collapse = 'td-collapse'; - //#endregion - /** - * Applied to the widget when the option display.inline is enabled. - */ - this.inline = 'inline'; - /** - * Applied to the widget when the option display.theme is light. - */ - this.lightTheme = 'light'; - /** - * Applied to the widget when the option display.theme is dark. - */ - this.darkTheme = 'dark'; - /** - * Used for detecting if the system color preference is dark mode - */ - this.isDarkPreferredQuery = '(prefers-color-scheme: dark)'; - } -} -class Namespace { -} -Namespace.NAME = NAME; -// noinspection JSUnusedGlobalSymbols -Namespace.dataKey = dataKey; -Namespace.events = new Events(); -Namespace.css = new Css(); -Namespace.errorMessages = new ErrorMessages(); - -const DefaultFormatLocalization = { - dateFormats: { - LTS: 'h:mm:ss T', - LT: 'h:mm T', - L: 'MM/dd/yyyy', - LL: 'MMMM d, yyyy', - LLL: 'MMMM d, yyyy h:mm T', - LLLL: 'dddd, MMMM d, yyyy h:mm T', - }, - format: 'L LT', - locale: 'default', - hourCycle: undefined, - ordinal: (n) => { - const s = ['th', 'st', 'nd', 'rd']; - const v = n % 100; - return `[${n}${s[(v - 20) % 10] || s[v] || s[0]}]`; - }, -}; -var DefaultFormatLocalization$1 = { ...DefaultFormatLocalization }; - -var Unit; -(function (Unit) { - Unit["seconds"] = "seconds"; - Unit["minutes"] = "minutes"; - Unit["hours"] = "hours"; - Unit["date"] = "date"; - Unit["month"] = "month"; - Unit["year"] = "year"; -})(Unit || (Unit = {})); -const twoDigitTemplate = { - month: '2-digit', - day: '2-digit', - year: 'numeric', - hour: '2-digit', - minute: '2-digit', - second: '2-digit', -}; -/** - * Returns an Intl format object based on the provided object - * @param unit - */ -const getFormatByUnit = (unit) => { - switch (unit) { - case 'date': - return { dateStyle: 'short' }; - case 'month': - return { - month: 'numeric', - year: 'numeric', - }; - case 'year': - return { year: 'numeric' }; - } -}; -/** - * Attempts to guess the hour cycle of the given local - * @param locale - */ -const guessHourCycle = (locale) => { - if (!locale) - return 'h12'; - // noinspection SpellCheckingInspection - const template = { - hour: '2-digit', - minute: '2-digit', - numberingSystem: 'latn', - }; - const dt = new DateTime().setLocalization({ locale }); - dt.hours = 0; - const start = dt.parts(undefined, template).hour; - //midnight is 12 so en-US style 12 AM - if (start === '12') - return 'h12'; - //midnight is 24 is from 00-24 - if (start === '24') - return 'h24'; - dt.hours = 23; - const end = dt.parts(undefined, template).hour; - //if midnight is 00 and hour 23 is 11 then - if (start === '00' && end === '11') - return 'h11'; - if (start === '00' && end === '23') - return 'h23'; - console.warn(`couldn't determine hour cycle for ${locale}. start: ${start}. end: ${end}`); - return undefined; -}; -/** - * For the most part this object behaves exactly the same way - * as the native Date object with a little extra spice. - */ -class DateTime extends Date { - constructor() { - super(...arguments); - this.localization = DefaultFormatLocalization$1; - this.nonLeapLadder = [ - 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, - ]; - this.leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335]; - //#region CDF stuff - this.dateTimeRegex = - //is regex cannot be simplified beyond what it already is - /(\[[^[\]]*])|y{1,4}|M{1,4}|d{1,4}|H{1,2}|h{1,2}|t|T|m{1,2}|s{1,2}|f{3}/g; //NOSONAR - this.formattingTokens = /(\[[^[\]]*])|([-_:/.,()\s]+)|(T|t|yyyy|yy?|MM?M?M?|Do|dd?|hh?|HH?|mm?|ss?)/g; //NOSONAR is regex cannot be simplified beyond what it already is - this.match2 = /\d\d/; // 00 - 99 - this.match3 = /\d{3}/; // 000 - 999 - this.match4 = /\d{4}/; // 0000 - 9999 - this.match1to2 = /\d\d?/; // 0 - 99 - this.matchSigned = /[+-]?\d+/; // -inf - inf - this.matchOffset = /[+-]\d\d:?(\d\d)?|Z/; // +00:00 -00:00 +0000 or -0000 +00 or Z - this.matchWord = /[^\d_:/,\-()\s]+/; // Word - this.zoneExpressions = [ - this.matchOffset, - (obj, input) => { - obj.offset = this.offsetFromString(input); - }, - ]; - this.expressions = { - t: { - pattern: undefined, - parser: (obj, input) => { - obj.afternoon = this.meridiemMatch(input); - }, - }, - T: { - pattern: undefined, - parser: (obj, input) => { - obj.afternoon = this.meridiemMatch(input); - }, - }, - fff: { - pattern: this.match3, - parser: (obj, input) => { - obj.milliseconds = +input; - }, - }, - s: { - pattern: this.match1to2, - parser: this.addInput('seconds'), - }, - ss: { - pattern: this.match1to2, - parser: this.addInput('seconds'), - }, - m: { - pattern: this.match1to2, - parser: this.addInput('minutes'), - }, - mm: { - pattern: this.match1to2, - parser: this.addInput('minutes'), - }, - H: { - pattern: this.match1to2, - parser: this.addInput('hours'), - }, - h: { - pattern: this.match1to2, - parser: this.addInput('hours'), - }, - HH: { - pattern: this.match1to2, - parser: this.addInput('hours'), - }, - hh: { - pattern: this.match1to2, - parser: this.addInput('hours'), - }, - d: { - pattern: this.match1to2, - parser: this.addInput('day'), - }, - dd: { - pattern: this.match2, - parser: this.addInput('day'), - }, - Do: { - pattern: this.matchWord, - parser: (obj, input) => { - obj.day = +(input.match(/\d+/)[0] || 1); - if (!this.localization.ordinal) - return; - for (let i = 1; i <= 31; i += 1) { - if (this.localization.ordinal(i).replace(/[[\]]/g, '') === input) { - obj.day = i; - } - } - }, - }, - M: { - pattern: this.match1to2, - parser: this.addInput('month'), - }, - MM: { - pattern: this.match2, - parser: this.addInput('month'), - }, - MMM: { - pattern: this.matchWord, - parser: (obj, input) => { - const months = this.getAllMonths(); - const monthsShort = this.getAllMonths('short'); - const matchIndex = (monthsShort || months.map((_) => _.slice(0, 3))).indexOf(input) + 1; - if (matchIndex < 1) { - throw new Error(); - } - obj.month = matchIndex % 12 || matchIndex; - }, - }, - MMMM: { - pattern: this.matchWord, - parser: (obj, input) => { - const months = this.getAllMonths(); - const matchIndex = months.indexOf(input) + 1; - if (matchIndex < 1) { - throw new Error(); - } - obj.month = matchIndex % 12 || matchIndex; - }, - }, - y: { - pattern: this.matchSigned, - parser: this.addInput('year'), - }, - yy: { - pattern: this.match2, - parser: (obj, input) => { - obj.year = this.parseTwoDigitYear(+input); - }, - }, - yyyy: { - pattern: this.match4, - parser: this.addInput('year'), - }, - // z: this.zoneExpressions, - // zz: this.zoneExpressions, - // zzz: this.zoneExpressions - }; - //#endregion CDF stuff - } - /** - * Chainable way to set the {@link locale} - * @param value - * @deprecated use setLocalization with a FormatLocalization object instead - */ - setLocale(value) { - if (!this.localization) { - this.localization = DefaultFormatLocalization$1; - this.localization.locale = value; - } - return this; - } - /** - * Chainable way to set the {@link localization} - * @param value - */ - setLocalization(value) { - this.localization = value; - return this; - } - /** - * Converts a plain JS date object to a DateTime object. - * Doing this allows access to format, etc. - * @param date - * @param locale this parameter is deprecated. Use formatLocalization instead. - * @param formatLocalization - */ - static convert(date, locale = 'default', formatLocalization = undefined) { - if (!date) - throw new Error(`A date is required`); - if (!formatLocalization) { - formatLocalization = DefaultFormatLocalization$1; - formatLocalization.locale = locale; - } - return new DateTime(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()).setLocalization(formatLocalization); - } - /** - * Native date manipulations are not pure functions. This function creates a duplicate of the DateTime object. - */ - get clone() { - return new DateTime(this.year, this.month, this.date, this.hours, this.minutes, this.seconds, this.getMilliseconds()).setLocalization(this.localization); - } - static isValid(d) { - if (d === undefined || JSON.stringify(d) === 'null') - return false; - if (d.constructor.name === DateTime.name) - return true; - return false; - } - /** - * Sets the current date to the start of the {@link unit} provided - * Example: Consider a date of "April 30, 2021, 11:45:32.984 AM" => new DateTime(2021, 3, 30, 11, 45, 32, 984).startOf('month') - * would return April 1, 2021, 12:00:00.000 AM (midnight) - * @param unit - * @param startOfTheWeek Allows for the changing the start of the week. - */ - startOf(unit, startOfTheWeek = 0) { - if (this[unit] === undefined) - throw new Error(`Unit '${unit}' is not valid`); - switch (unit) { - case 'seconds': - this.setMilliseconds(0); - break; - case 'minutes': - this.setSeconds(0, 0); - break; - case 'hours': - this.setMinutes(0, 0, 0); - break; - case 'date': - this.setHours(0, 0, 0, 0); - break; - case 'weekDay': { - this.startOf(Unit.date); - if (this.weekDay === startOfTheWeek) - break; - const goBack = (this.weekDay - startOfTheWeek + 7) % 7; - this.manipulate(goBack * -1, Unit.date); - break; - } - case 'month': - this.startOf(Unit.date); - this.setDate(1); - break; - case 'year': - this.startOf(Unit.date); - this.setMonth(0, 1); - break; - } - return this; - } - /** - * Sets the current date to the end of the {@link unit} provided - * Example: Consider a date of "April 30, 2021, 11:45:32.984 AM" => new DateTime(2021, 3, 30, 11, 45, 32, 984).endOf('month') - * would return April 30, 2021, 11:59:59.999 PM - * @param unit - * @param startOfTheWeek - */ - endOf(unit, startOfTheWeek = 0) { - if (this[unit] === undefined) - throw new Error(`Unit '${unit}' is not valid`); - switch (unit) { - case 'seconds': - this.setMilliseconds(999); - break; - case 'minutes': - this.setSeconds(59, 999); - break; - case 'hours': - this.setMinutes(59, 59, 999); - break; - case 'date': - this.setHours(23, 59, 59, 999); - break; - case 'weekDay': { - this.endOf(Unit.date); - const endOfWeek = 6 + startOfTheWeek; - if (this.weekDay === endOfWeek) - break; - this.manipulate(endOfWeek - this.weekDay, Unit.date); - break; - } - case 'month': - this.endOf(Unit.date); - this.manipulate(1, Unit.month); - this.setDate(0); - break; - case 'year': - this.endOf(Unit.date); - this.setMonth(11, 31); - break; - } - return this; - } - /** - * Change a {@link unit} value. Value can be positive or negative - * Example: Consider a date of "April 30, 2021, 11:45:32.984 AM" => new DateTime(2021, 3, 30, 11, 45, 32, 984).manipulate(1, 'month') - * would return May 30, 2021, 11:45:32.984 AM - * @param value A positive or negative number - * @param unit - */ - manipulate(value, unit) { - if (this[unit] === undefined) - throw new Error(`Unit '${unit}' is not valid`); - this[unit] += value; - return this; - } - /** - * Return true if {@link compare} is before this date - * @param compare The Date/DateTime to compare - * @param unit If provided, uses {@link startOf} for - * comparison. - */ - isBefore(compare, unit) { - // If the comparisons is undefined, return false - if (!DateTime.isValid(compare)) - return false; - if (!unit) - return this.valueOf() < compare.valueOf(); - if (this[unit] === undefined) - throw new Error(`Unit '${unit}' is not valid`); - return (this.clone.startOf(unit).valueOf() < compare.clone.startOf(unit).valueOf()); - } - /** - * Return true if {@link compare} is after this date - * @param compare The Date/DateTime to compare - * @param unit If provided, uses {@link startOf} for - * comparison. - */ - isAfter(compare, unit) { - // If the comparisons is undefined, return false - if (!DateTime.isValid(compare)) - return false; - if (!unit) - return this.valueOf() > compare.valueOf(); - if (this[unit] === undefined) - throw new Error(`Unit '${unit}' is not valid`); - return (this.clone.startOf(unit).valueOf() > compare.clone.startOf(unit).valueOf()); - } - /** - * Return true if {@link compare} is same this date - * @param compare The Date/DateTime to compare - * @param unit If provided, uses {@link startOf} for - * comparison. - */ - isSame(compare, unit) { - // If the comparisons is undefined, return false - if (!DateTime.isValid(compare)) - return false; - if (!unit) - return this.valueOf() === compare.valueOf(); - if (this[unit] === undefined) - throw new Error(`Unit '${unit}' is not valid`); - compare = DateTime.convert(compare); - return (this.clone.startOf(unit).valueOf() === compare.startOf(unit).valueOf()); - } - /** - * Check if this is between two other DateTimes, optionally looking at unit scale. The match is exclusive. - * @param left - * @param right - * @param unit. - * @param inclusivity. A [ indicates inclusion of a value. A ( indicates exclusion. - * If the inclusivity parameter is used, both indicators must be passed. - */ - isBetween(left, right, unit, inclusivity = '()') { - // If one of the comparisons is undefined, return false - if (!DateTime.isValid(left) || !DateTime.isValid(right)) - return false; - // If a unit is provided and is not a valid property of the DateTime object, throw an error - if (unit && this[unit] === undefined) { - throw new Error(`Unit '${unit}' is not valid`); - } - const leftInclusivity = inclusivity[0] === '('; - const rightInclusivity = inclusivity[1] === ')'; - const isLeftInRange = leftInclusivity - ? this.isAfter(left, unit) - : !this.isBefore(left, unit); - const isRightInRange = rightInclusivity - ? this.isBefore(right, unit) - : !this.isAfter(right, unit); - return isLeftInRange && isRightInRange; - } - /** - * Returns flattened object of the date. Does not include literals - * @param locale - * @param template - */ - parts(locale = this.localization.locale, template = { dateStyle: 'full', timeStyle: 'long' }) { - const parts = {}; - new Intl.DateTimeFormat(locale, template) - .formatToParts(this) - .filter((x) => x.type !== 'literal') - .forEach((x) => (parts[x.type] = x.value)); - return parts; - } - /** - * Shortcut to Date.getSeconds() - */ - get seconds() { - return this.getSeconds(); - } - /** - * Shortcut to Date.setSeconds() - */ - set seconds(value) { - this.setSeconds(value); - } - /** - * Returns two digit hours - */ - get secondsFormatted() { - return this.parts(undefined, twoDigitTemplate).second; - } - /** - * Shortcut to Date.getMinutes() - */ - get minutes() { - return this.getMinutes(); - } - /** - * Shortcut to Date.setMinutes() - */ - set minutes(value) { - this.setMinutes(value); - } - /** - * Returns two digit minutes - */ - get minutesFormatted() { - return this.parts(undefined, twoDigitTemplate).minute; - } - /** - * Shortcut to Date.getHours() - */ - get hours() { - return this.getHours(); - } - /** - * Shortcut to Date.setHours() - */ - set hours(value) { - this.setHours(value); - } - /** - * Returns two digit hour, e.g. 01...10 - * @param hourCycle Providing an hour cycle will change 00 to 24 depending on the given value. - */ - getHoursFormatted(hourCycle = 'h12') { - return this.parts(undefined, { ...twoDigitTemplate, hourCycle: hourCycle }) - .hour; - } - /** - * Get the meridiem of the date. E.g. AM or PM. - * If the {@link locale} provides a "dayPeriod" then this will be returned, - * otherwise it will return AM or PM. - * @param locale - */ - meridiem(locale = this.localization.locale) { - return new Intl.DateTimeFormat(locale, { - hour: 'numeric', - hour12: true, - }) - .formatToParts(this) - .find((p) => p.type === 'dayPeriod')?.value; - } - /** - * Shortcut to Date.getDate() - */ - get date() { - return this.getDate(); - } - /** - * Shortcut to Date.setDate() - */ - set date(value) { - this.setDate(value); - } - /** - * Return two digit date - */ - get dateFormatted() { - return this.parts(undefined, twoDigitTemplate).day; - } - /** - * Shortcut to Date.getDay() - */ - get weekDay() { - return this.getDay(); - } - /** - * Shortcut to Date.getMonth() - */ - get month() { - return this.getMonth(); - } - /** - * Shortcut to Date.setMonth() - */ - set month(value) { - const targetMonth = new Date(this.year, value + 1); - targetMonth.setDate(0); - const endOfMonth = targetMonth.getDate(); - if (this.date > endOfMonth) { - this.date = endOfMonth; - } - this.setMonth(value); - } - /** - * Return two digit, human expected month. E.g. January = 1, December = 12 - */ - get monthFormatted() { - return this.parts(undefined, twoDigitTemplate).month; - } - /** - * Shortcut to Date.getFullYear() - */ - get year() { - return this.getFullYear(); - } - /** - * Shortcut to Date.setFullYear() - */ - set year(value) { - this.setFullYear(value); - } - // borrowed a bunch of stuff from Luxon - /** - * Gets the week of the year - */ - get week() { - const ordinal = this.computeOrdinal(), weekday = this.getUTCDay(); - let weekNumber = Math.floor((ordinal - weekday + 10) / 7); - if (weekNumber < 1) { - weekNumber = this.weeksInWeekYear(); - } - else if (weekNumber > this.weeksInWeekYear()) { - weekNumber = 1; - } - return weekNumber; - } - /** - * Returns the number of weeks in the year - */ - weeksInWeekYear() { - const p1 = (this.year + - Math.floor(this.year / 4) - - Math.floor(this.year / 100) + - Math.floor(this.year / 400)) % - 7, last = this.year - 1, p2 = (last + - Math.floor(last / 4) - - Math.floor(last / 100) + - Math.floor(last / 400)) % - 7; - return p1 === 4 || p2 === 3 ? 53 : 52; - } - /** - * Returns true or false depending on if the year is a leap year or not. - */ - get isLeapYear() { - return (this.year % 4 === 0 && (this.year % 100 !== 0 || this.year % 400 === 0)); - } - computeOrdinal() { - return (this.date + - (this.isLeapYear ? this.leapLadder : this.nonLeapLadder)[this.month]); - } - /** - * Returns a list of month values based on the current locale - */ - getAllMonths(format = 'long') { - const applyFormat = new Intl.DateTimeFormat(this.localization.locale, { - month: format, - }).format; - return [...Array(12).keys()].map((m) => applyFormat(new Date(2021, m))); - } - /** - * Replaces an expanded token set (e.g. LT/LTS) - */ - replaceTokens(formatStr, formats) { - /*** - * _ => match - * a => first capture group. Anything between [ and ] - * b => second capture group - */ - return formatStr.replace(/(\[[^[\]]*])|(LTS?|l{1,4}|L{1,4})/g, (_, a, b) => { - const B = b && b.toUpperCase(); - return a || formats[B] || DefaultFormatLocalization$1.dateFormats[B]; - }); - } - parseTwoDigitYear(input) { - return input + (input > 68 ? 1900 : 2000); - } - offsetFromString(input) { - if (!input) - return 0; - if (input === 'Z') - return 0; - const [first, second, third] = input.match(/([+-]|\d\d)/g); - const minutes = +second * 60 + (+third || 0); - const signed = first === '+' ? -minutes : minutes; - return minutes === 0 ? 0 : signed; // eslint-disable-line no-nested-ternary - } - /** - * z = -4, zz = -04, zzz = -0400 - * @param date - * @param style - * @private - */ - zoneInformation(date, style) { - let name = date - .parts(this.localization.locale, { timeZoneName: 'longOffset' }) - .timeZoneName.replace('GMT', '') - .replace(':', ''); - const negative = name.includes('-'); - name = name.replace('-', ''); - if (style === 'z') - name = name.substring(1, 2); - else if (style === 'zz') - name = name.substring(0, 2); - return `${negative ? '-' : ''}${name}`; - } - addInput(property) { - return (obj, input) => { - obj[property] = +input; - }; - } - getLocaleAfternoon() { - return new Intl.DateTimeFormat(this.localization.locale, { - hour: 'numeric', - hour12: true, - }) - .formatToParts(new Date(2022, 3, 4, 13)) - .find((p) => p.type === 'dayPeriod') - ?.value?.replace(/\s+/g, ' '); - } - meridiemMatch(input) { - return input.toLowerCase() === this.getLocaleAfternoon().toLowerCase(); - } - correctHours(time) { - const { afternoon } = time; - if (afternoon !== undefined) { - const { hours } = time; - if (afternoon) { - if (hours < 12) { - time.hours += 12; - } - } - else if (hours === 12) { - time.hours = 0; - } - delete time.afternoon; - } - } - makeParser(format) { - format = this.replaceTokens(format, this.localization.dateFormats); - const matchArray = format.match(this.formattingTokens); - const { length } = matchArray; - const expressionArray = []; - for (let i = 0; i < length; i += 1) { - const token = matchArray[i]; - const expression = this.expressions[token]; - if (expression?.parser) { - expressionArray[i] = expression; - } - else { - expressionArray[i] = token.replace(/^\[[^[\]]*]$/g, ''); - } - } - return (input) => { - const time = { - hours: 0, - minutes: 0, - seconds: 0, - milliseconds: 0, - }; - for (let i = 0, start = 0; i < length; i += 1) { - const token = expressionArray[i]; - if (typeof token === 'string') { - start += token.length; - } - else { - const part = input.slice(start); - let value = part; - if (token.pattern) { - const match = token.pattern.exec(part); - value = match[0]; - } - token.parser.call(this, time, value); - input = input.replace(value, ''); - } - } - this.correctHours(time); - return time; - }; - } - /** - * Attempts to create a DateTime from a string. - * @param input date as string - * @param localization provides the date template the string is in via the format property - */ - //eslint-disable-next-line @typescript-eslint/no-unused-vars - static fromString(input, localization) { - if (!localization?.format) { - Namespace.errorMessages.customDateFormatError('No format was provided'); - } - try { - const dt = new DateTime(); - dt.setLocalization(localization); - if (['x', 'X'].indexOf(localization.format) > -1) - return new DateTime((localization.format === 'X' ? 1000 : 1) * +input); - input = input.replace(/\s+/g, ' '); - const parser = dt.makeParser(localization.format); - const { year, month, day, hours, minutes, seconds, milliseconds, zone } = parser(input); - const d = day || (!year && !month ? dt.getDate() : 1); - const y = year || dt.getFullYear(); - let M = 0; - if (!(year && !month)) { - M = month > 0 ? month - 1 : dt.getMonth(); - } - if (zone) { - return new DateTime(Date.UTC(y, M, d, hours, minutes, seconds, milliseconds + zone.offset * 60 * 1000)); - } - return new DateTime(y, M, d, hours, minutes, seconds, milliseconds); - } - catch (e) { - Namespace.errorMessages.customDateFormatError(`Unable to parse provided input: ${input}, format: ${localization.format}`); - } - } - /** - * Returns a string format. - * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat - * for valid templates and locale objects - * @param template An optional object. If provided, method will use Intl., otherwise the localizations format properties - * @param locale Can be a string or an array of strings. Uses browser defaults otherwise. - */ - format(template, locale = this.localization.locale) { - if (template && typeof template === 'object') - return new Intl.DateTimeFormat(locale, template).format(this); - const formatString = this.replaceTokens( - //try template first - template || - //otherwise try localization format - this.localization.format || - //otherwise try date + time - `${DefaultFormatLocalization$1.dateFormats.L}, ${DefaultFormatLocalization$1.dateFormats.LT}`, this.localization.dateFormats); - const formatter = (template) => new Intl.DateTimeFormat(this.localization.locale, template).format(this); - if (!this.localization.hourCycle) - this.localization.hourCycle = guessHourCycle(this.localization.locale); - //if the format asks for a twenty-four-hour string but the hour cycle is not, then make a base guess - const HHCycle = this.localization.hourCycle.startsWith('h1') - ? 'h24' - : this.localization.hourCycle; - const hhCycle = this.localization.hourCycle.startsWith('h2') - ? 'h12' - : this.localization.hourCycle; - const matches = { - y: this.year, - yy: formatter({ year: '2-digit' }), - yyyy: this.year, - M: formatter({ month: 'numeric' }), - MM: this.monthFormatted, - MMM: this.getAllMonths('short')[this.getMonth()], - MMMM: this.getAllMonths()[this.getMonth()], - d: this.date, - dd: this.dateFormatted, - ddd: formatter({ weekday: 'short' }), - dddd: formatter({ weekday: 'long' }), - H: this.getHours(), - HH: this.getHoursFormatted(HHCycle), - h: this.hours > 12 ? this.hours - 12 : this.hours, - hh: this.getHoursFormatted(hhCycle), - t: this.meridiem(), - T: this.meridiem().toUpperCase(), - m: this.minutes, - mm: this.minutesFormatted, - s: this.seconds, - ss: this.secondsFormatted, - fff: this.getMilliseconds(), - // z: this.zoneInformation(dateTime, 'z'), //-4 - // zz: this.zoneInformation(dateTime, 'zz'), //-04 - // zzz: this.zoneInformation(dateTime, 'zzz') //-0400 - }; - return formatString - .replace(this.dateTimeRegex, (match, $1) => { - return $1 || matches[match]; - }) - .replace(/\[/g, '') - .replace(/]/g, ''); - } -} - -class ServiceLocator { - constructor() { - this.cache = new Map(); - } - locate(identifier) { - const service = this.cache.get(identifier); - if (service) - return service; - const value = new identifier(); - this.cache.set(identifier, value); - return value; - } -} -const setupServiceLocator = () => { - serviceLocator = new ServiceLocator(); -}; -let serviceLocator; - -const CalendarModes = [ - { - name: 'calendar', - className: Namespace.css.daysContainer, - unit: Unit.month, - step: 1, - }, - { - name: 'months', - className: Namespace.css.monthsContainer, - unit: Unit.year, - step: 1, - }, - { - name: 'years', - className: Namespace.css.yearsContainer, - unit: Unit.year, - step: 10, - }, - { - name: 'decades', - className: Namespace.css.decadesContainer, - unit: Unit.year, - step: 100, - }, -]; - -class OptionsStore { - constructor() { - this._currentCalendarViewMode = 0; - this._viewDate = new DateTime(); - this.minimumCalendarViewMode = 0; - this.currentView = 'calendar'; - } - get currentCalendarViewMode() { - return this._currentCalendarViewMode; - } - set currentCalendarViewMode(value) { - this._currentCalendarViewMode = value; - this.currentView = CalendarModes[value].name; - } - get viewDate() { - return this._viewDate; - } - set viewDate(v) { - this._viewDate = v; - if (this.options) - this.options.viewDate = v; - } - /** - * When switching back to the calendar from the clock, - * this sets currentView to the correct calendar view. - */ - refreshCurrentView() { - this.currentView = CalendarModes[this.currentCalendarViewMode].name; - } - get isTwelveHour() { - return ['h12', 'h11'].includes(this.options.localization.hourCycle); - } -} - -/** - * Main class for date validation rules based on the options provided. - */ -class Validation { - constructor() { - this.optionsStore = serviceLocator.locate(OptionsStore); - } - /** - * Checks to see if the target date is valid based on the rules provided in the options. - * Granularity can be provided to check portions of the date instead of the whole. - * @param targetDate - * @param granularity - */ - isValid(targetDate, granularity) { - if (!this._enabledDisabledDatesIsValid(granularity, targetDate)) - return false; - if (granularity !== Unit.month && - granularity !== Unit.year && - this.optionsStore.options.restrictions.daysOfWeekDisabled?.length > 0 && - this.optionsStore.options.restrictions.daysOfWeekDisabled.indexOf(targetDate.weekDay) !== -1) - return false; - if (!this._minMaxIsValid(granularity, targetDate)) - return false; - if (granularity === Unit.hours || - granularity === Unit.minutes || - granularity === Unit.seconds) { - if (!this._enabledDisabledHoursIsValid(targetDate)) - return false; - if (this.optionsStore.options.restrictions.disabledTimeIntervals?.filter((internal) => targetDate.isBetween(internal.from, internal.to)).length !== 0) - return false; - } - return true; - } - _enabledDisabledDatesIsValid(granularity, targetDate) { - if (granularity !== Unit.date) - return true; - if (this.optionsStore.options.restrictions.disabledDates.length > 0 && - this._isInDisabledDates(targetDate)) { - return false; - } - // noinspection RedundantIfStatementJS - if (this.optionsStore.options.restrictions.enabledDates.length > 0 && - !this._isInEnabledDates(targetDate)) { - return false; - } - return true; - } - /** - * Checks to see if the disabledDates option is in use and returns true (meaning invalid) - * if the `testDate` is with in the array. Granularity is by date. - * @param testDate - * @private - */ - _isInDisabledDates(testDate) { - if (!this.optionsStore.options.restrictions.disabledDates || - this.optionsStore.options.restrictions.disabledDates.length === 0) - return false; - return !!this.optionsStore.options.restrictions.disabledDates.find((x) => x.isSame(testDate, Unit.date)); - } - /** - * Checks to see if the enabledDates option is in use and returns true (meaning valid) - * if the `testDate` is with in the array. Granularity is by date. - * @param testDate - * @private - */ - _isInEnabledDates(testDate) { - if (!this.optionsStore.options.restrictions.enabledDates || - this.optionsStore.options.restrictions.enabledDates.length === 0) - return true; - return !!this.optionsStore.options.restrictions.enabledDates.find((x) => x.isSame(testDate, Unit.date)); - } - _minMaxIsValid(granularity, targetDate) { - if (this.optionsStore.options.restrictions.minDate && - targetDate.isBefore(this.optionsStore.options.restrictions.minDate, granularity)) { - return false; - } - // noinspection RedundantIfStatementJS - if (this.optionsStore.options.restrictions.maxDate && - targetDate.isAfter(this.optionsStore.options.restrictions.maxDate, granularity)) { - return false; - } - return true; - } - _enabledDisabledHoursIsValid(targetDate) { - if (this.optionsStore.options.restrictions.disabledHours.length > 0 && - this._isInDisabledHours(targetDate)) { - return false; - } - // noinspection RedundantIfStatementJS - if (this.optionsStore.options.restrictions.enabledHours.length > 0 && - !this._isInEnabledHours(targetDate)) { - return false; - } - return true; - } - /** - * Checks to see if the disabledHours option is in use and returns true (meaning invalid) - * if the `testDate` is with in the array. Granularity is by hours. - * @param testDate - * @private - */ - _isInDisabledHours(testDate) { - if (!this.optionsStore.options.restrictions.disabledHours || - this.optionsStore.options.restrictions.disabledHours.length === 0) - return false; - const formattedDate = testDate.hours; - return this.optionsStore.options.restrictions.disabledHours.includes(formattedDate); - } - /** - * Checks to see if the enabledHours option is in use and returns true (meaning valid) - * if the `testDate` is with in the array. Granularity is by hours. - * @param testDate - * @private - */ - _isInEnabledHours(testDate) { - if (!this.optionsStore.options.restrictions.enabledHours || - this.optionsStore.options.restrictions.enabledHours.length === 0) - return true; - const formattedDate = testDate.hours; - return this.optionsStore.options.restrictions.enabledHours.includes(formattedDate); - } - dateRangeIsValid(dates, index, target) { - // if we're not using the option, then return valid - if (!this.optionsStore.options.dateRange) - return true; - // if we've only selected 0..1 dates, and we're not setting the end date - // then return valid. We only want to validate the range if both are selected, - // because the other validation on the target has already occurred. - if (dates.length !== 2 && index !== 1) - return true; - // initialize start date - const start = dates[0].clone; - // check if start date is not the same as target date - if (start.isSame(target, Unit.date)) - return true; - // add one day to start; start has already been validated - start.manipulate(1, Unit.date); - // check each date in the range to make sure it's valid - while (!start.isSame(target, Unit.date)) { - const valid = this.isValid(start, Unit.date); - if (!valid) - return false; - start.manipulate(1, Unit.date); - } - return true; - } -} - -class EventEmitter { - constructor() { - this.subscribers = []; - } - subscribe(callback) { - this.subscribers.push(callback); - return this.unsubscribe.bind(this, this.subscribers.length - 1); - } - unsubscribe(index) { - this.subscribers.splice(index, 1); - } - emit(value) { - this.subscribers.forEach((callback) => { - callback(value); - }); - } - destroy() { - this.subscribers = null; - this.subscribers = []; - } -} -class EventEmitters { - constructor() { - this.triggerEvent = new EventEmitter(); - this.viewUpdate = new EventEmitter(); - this.updateDisplay = new EventEmitter(); - this.action = new EventEmitter(); //eslint-disable-line @typescript-eslint/no-explicit-any - this.updateViewDate = new EventEmitter(); - } - destroy() { - this.triggerEvent.destroy(); - this.viewUpdate.destroy(); - this.updateDisplay.destroy(); - this.action.destroy(); - this.updateViewDate.destroy(); - } -} - -const defaultEnLocalization = { - clear: 'Clear selection', - close: 'Close the picker', - dateFormats: DefaultFormatLocalization$1.dateFormats, - dayViewHeaderFormat: { month: 'long', year: '2-digit' }, - decrementHour: 'Decrement Hour', - decrementMinute: 'Decrement Minute', - decrementSecond: 'Decrement Second', - format: DefaultFormatLocalization$1.format, - hourCycle: DefaultFormatLocalization$1.hourCycle, - incrementHour: 'Increment Hour', - incrementMinute: 'Increment Minute', - incrementSecond: 'Increment Second', - locale: DefaultFormatLocalization$1.locale, - maxWeekdayLength: 0, - nextCentury: 'Next Century', - nextDecade: 'Next Decade', - nextMonth: 'Next Month', - nextYear: 'Next Year', - ordinal: DefaultFormatLocalization$1.ordinal, - pickHour: 'Pick Hour', - pickMinute: 'Pick Minute', - pickSecond: 'Pick Second', - previousCentury: 'Previous Century', - previousDecade: 'Previous Decade', - previousMonth: 'Previous Month', - previousYear: 'Previous Year', - selectDate: 'Select Date', - selectDecade: 'Select Decade', - selectMonth: 'Select Month', - selectTime: 'Select Time', - selectYear: 'Select Year', - startOfTheWeek: 0, - today: 'Go to today', - toggleMeridiem: 'Toggle Meridiem', -}; -const DefaultOptions = { - allowInputToggle: false, - container: undefined, - dateRange: false, - debug: false, - defaultDate: undefined, - display: { - icons: { - type: 'icons', - time: 'fa-solid fa-clock', - date: 'fa-solid fa-calendar', - up: 'fa-solid fa-arrow-up', - down: 'fa-solid fa-arrow-down', - previous: 'fa-solid fa-chevron-left', - next: 'fa-solid fa-chevron-right', - today: 'fa-solid fa-calendar-check', - clear: 'fa-solid fa-trash', - close: 'fa-solid fa-xmark', - }, - sideBySide: false, - calendarWeeks: false, - viewMode: 'calendar', - toolbarPlacement: 'bottom', - keepOpen: false, - buttons: { - today: false, - clear: false, - close: false, - }, - components: { - calendar: true, - date: true, - month: true, - year: true, - decades: true, - clock: true, - hours: true, - minutes: true, - seconds: false, - useTwentyfourHour: undefined, - }, - inline: false, - theme: 'auto', - placement: 'bottom', - }, - keepInvalid: false, - localization: defaultEnLocalization, - meta: {}, - multipleDates: false, - multipleDatesSeparator: '; ', - promptTimeOnDateChange: false, - promptTimeOnDateChangeTransitionDelay: 200, - restrictions: { - minDate: undefined, - maxDate: undefined, - disabledDates: [], - enabledDates: [], - daysOfWeekDisabled: [], - disabledTimeIntervals: [], - disabledHours: [], - enabledHours: [], - }, - stepping: 1, - useCurrent: true, - viewDate: new DateTime(), -}; -const DefaultEnLocalization = { ...defaultEnLocalization }; - -/** - * Attempts to prove `d` is a DateTime or Date or can be converted into one. - * @param d If a string will attempt creating a date from it. - * @param localization object containing locale and format settings. Only used with the custom formats - * @private - */ -function tryConvertToDateTime(d, localization) { - if (!d) - return null; - if (d.constructor.name === DateTime.name) - return d; - if (d.constructor.name === Date.name) { - return DateTime.convert(d); - } - if (typeof d === typeof '') { - const dateTime = DateTime.fromString(d, localization); - if (JSON.stringify(dateTime) === 'null') { - return null; - } - return dateTime; - } - return null; -} -/** - * Attempts to convert `d` to a DateTime object - * @param d value to convert - * @param optionName Provides text to error messages e.g. disabledDates - * @param localization object containing locale and format settings. Only used with the custom formats - */ -function convertToDateTime(d, optionName, localization) { - if (typeof d === typeof '' && optionName !== 'input') { - Namespace.errorMessages.dateString(); - } - const converted = tryConvertToDateTime(d, localization); - if (!converted) { - Namespace.errorMessages.failedToParseDate(optionName, d, optionName === 'input'); - } - return converted; -} -/** - * Type checks that `value` is an array of Date or DateTime - * @param optionName Provides text to error messages e.g. disabledDates - * @param value Option value - * @param providedType Used to provide text to error messages - * @param localization - */ -function typeCheckDateArray(optionName, value, //eslint-disable-line @typescript-eslint/no-explicit-any -providedType, localization = DefaultFormatLocalization$1) { - if (!Array.isArray(value)) { - Namespace.errorMessages.typeMismatch(optionName, providedType, 'array of DateTime or Date'); - } - for (let i = 0; i < value.length; i++) { - const d = value[i]; - const dateTime = convertToDateTime(d, optionName, localization); - dateTime.setLocalization(localization); - value[i] = dateTime; - } -} -/** - * Type checks that `value` is an array of numbers - * @param optionName Provides text to error messages e.g. disabledDates - * @param value Option value - * @param providedType Used to provide text to error messages - */ -function typeCheckNumberArray(optionName, value, //eslint-disable-line @typescript-eslint/no-explicit-any -providedType) { - if (!Array.isArray(value) || value.some((x) => typeof x !== typeof 0)) { - Namespace.errorMessages.typeMismatch(optionName, providedType, 'array of numbers'); - } -} - -function mandatoryDate(key) { - return ({ value, providedType, localization }) => { - const dateTime = convertToDateTime(value, key, localization); - if (dateTime !== undefined) { - dateTime.setLocalization(localization); - return dateTime; - } - }; -} -function optionalDate(key) { - const mandatory = mandatoryDate(key); - return (args) => { - if (args.value === undefined) { - return args.value; - } - return mandatory(args); - }; -} -function numbersInRange(key, lower, upper) { - return ({ value, providedType }) => { - if (value === undefined) { - return []; - } - typeCheckNumberArray(key, value, providedType); - if (value.some((x) => x < lower || x > upper)) - Namespace.errorMessages.numbersOutOfRange(key, lower, upper); - return value; - }; -} -function validHourRange(key) { - return numbersInRange(key, 0, 23); -} -function validDateArray(key) { - return ({ value, providedType, localization }) => { - if (value === undefined) { - return []; - } - typeCheckDateArray(key, value, providedType, localization); - return value; - }; -} -function validKeyOption(keyOptions) { - return ({ value, path }) => { - if (!keyOptions.includes(value)) - Namespace.errorMessages.unexpectedOptionValue(path.substring(1), value, keyOptions); - return value; - }; -} -const optionProcessors = Object.freeze({ - defaultDate: mandatoryDate('defaultDate'), - viewDate: mandatoryDate('viewDate'), - minDate: optionalDate('restrictions.minDate'), - maxDate: optionalDate('restrictions.maxDate'), - disabledHours: validHourRange('restrictions.disabledHours'), - enabledHours: validHourRange('restrictions.enabledHours'), - disabledDates: validDateArray('restrictions.disabledDates'), - enabledDates: validDateArray('restrictions.enabledDates'), - daysOfWeekDisabled: numbersInRange('restrictions.daysOfWeekDisabled', 0, 6), - disabledTimeIntervals: ({ key, value, providedType, localization }) => { - if (value === undefined) { - return []; - } - if (!Array.isArray(value)) { - Namespace.errorMessages.typeMismatch(key, providedType, 'array of { from: DateTime|Date, to: DateTime|Date }'); - } - const valueObject = value; //eslint-disable-line @typescript-eslint/no-explicit-any - for (let i = 0; i < valueObject.length; i++) { - Object.keys(valueObject[i]).forEach((vk) => { - const subOptionName = `${key}[${i}].${vk}`; - const d = valueObject[i][vk]; - const dateTime = convertToDateTime(d, subOptionName, localization); - dateTime.setLocalization(localization); - valueObject[i][vk] = dateTime; - }); - } - return valueObject; - }, - toolbarPlacement: validKeyOption(['top', 'bottom', 'default']), - type: validKeyOption(['icons', 'sprites']), - viewMode: validKeyOption([ - 'clock', - 'calendar', - 'months', - 'years', - 'decades', - ]), - theme: validKeyOption(['light', 'dark', 'auto']), - placement: validKeyOption(['top', 'bottom']), - meta: ({ value }) => value, - dayViewHeaderFormat: ({ value }) => value, - container: ({ value, path }) => { - if (value && - !(value instanceof HTMLElement || - value instanceof Element || - value?.appendChild)) { - Namespace.errorMessages.typeMismatch(path.substring(1), typeof value, 'HTMLElement'); - } - return value; - }, - useTwentyfourHour: ({ value, path, providedType, defaultType }) => { - Namespace.errorMessages.deprecatedWarning('useTwentyfourHour', 'Please use "options.localization.hourCycle" instead'); - if (value === undefined || providedType === 'boolean') - return value; - Namespace.errorMessages.typeMismatch(path, providedType, defaultType); - }, - hourCycle: validKeyOption(['h11', 'h12', 'h23', 'h24']), -}); -const defaultProcessor = ({ value, defaultType, providedType, path, }) => { - switch (defaultType) { - case 'boolean': - return value === 'true' || value === true; - case 'number': - return +value; - case 'string': - return value.toString(); - case 'object': - return {}; - case 'function': - return value; - default: - Namespace.errorMessages.typeMismatch(path, providedType, defaultType); - } -}; -function processKey(args) { - return (optionProcessors[args.key] || defaultProcessor)(args); -} - -class OptionConverter { - static deepCopy(input) { - const o = {}; - Object.keys(input).forEach((key) => { - const inputElement = input[key]; - if (inputElement instanceof DateTime) { - o[key] = inputElement.clone; - return; - } - else if (inputElement instanceof Date) { - o[key] = new Date(inputElement.valueOf()); - return; - } - o[key] = inputElement; - if (typeof inputElement !== 'object' || - inputElement instanceof HTMLElement || - inputElement instanceof Element) - return; - if (!Array.isArray(inputElement)) { - o[key] = OptionConverter.deepCopy(inputElement); - } - }); - return o; - } - /** - * Finds value out of an object based on a string, period delimited, path - * @param paths - * @param obj - */ - static objectPath(paths, obj) { - if (paths.charAt(0) === '.') - paths = paths.slice(1); - if (!paths) - return obj; - return paths - .split('.') - .reduce((value, key) => OptionConverter.isValue(value) || OptionConverter.isValue(value[key]) - ? value[key] - : undefined, obj); - } - /** - * The spread operator caused sub keys to be missing after merging. - * This is to fix that issue by using spread on the child objects first. - * Also handles complex options like disabledDates - * @param provided An option from new providedOptions - * @param copyTo Destination object. This was added to prevent reference copies - * @param localization - * @param path - */ - static spread(provided, copyTo, localization, path = '') { - const defaultOptions = OptionConverter.objectPath(path, DefaultOptions); - const unsupportedOptions = Object.keys(provided).filter((x) => !Object.keys(defaultOptions).includes(x)); - if (unsupportedOptions.length > 0) { - const flattenedOptions = OptionConverter.getFlattenDefaultOptions(); - const errors = unsupportedOptions.map((x) => { - let error = `"${path}.${x}" in not a known option.`; - const didYouMean = flattenedOptions.find((y) => y.includes(x)); - if (didYouMean) - error += ` Did you mean "${didYouMean}"?`; - return error; - }); - Namespace.errorMessages.unexpectedOptions(errors); - } - Object.keys(provided) - .filter((key) => key !== '__proto__' && key !== 'constructor') - .forEach((key) => { - path += `.${key}`; - if (path.charAt(0) === '.') - path = path.slice(1); - const defaultOptionValue = defaultOptions[key]; - const providedType = typeof provided[key]; - const defaultType = typeof defaultOptionValue; - const value = provided[key]; - if (value === undefined || value === null) { - copyTo[key] = value; - path = path.substring(0, path.lastIndexOf(`.${key}`)); - return; - } - if (typeof defaultOptionValue === 'object' && - !Array.isArray(provided[key]) && - !(defaultOptionValue instanceof Date || - OptionConverter.ignoreProperties.includes(key))) { - OptionConverter.spread(provided[key], copyTo[key], localization, path); - } - else { - copyTo[key] = OptionConverter.processKey(key, value, providedType, defaultType, path, localization); - } - path = path.substring(0, path.lastIndexOf(`.${key}`)); - }); - } - static processKey(key, value, //eslint-disable-line @typescript-eslint/no-explicit-any - providedType, defaultType, path, localization) { - return processKey({ - key, - value, - providedType, - defaultType, - path, - localization, - }); - } - static _mergeOptions(providedOptions, mergeTo) { - const newConfig = OptionConverter.deepCopy(mergeTo); - //see if the options specify a locale - const localization = mergeTo.localization?.locale !== 'default' - ? mergeTo.localization - : providedOptions?.localization || DefaultOptions.localization; - OptionConverter.spread(providedOptions, newConfig, localization, ''); - return newConfig; - } - static _dataToOptions(element, options) { - const eData = JSON.parse(JSON.stringify(element.dataset)); - if (eData?.tdTargetInput) - delete eData.tdTargetInput; - if (eData?.tdTargetToggle) - delete eData.tdTargetToggle; - if (!eData || - Object.keys(eData).length === 0 || - eData.constructor !== DOMStringMap) - return options; - const dataOptions = {}; - // because dataset returns camelCase including the 'td' key the option - // key won't align - const objectToNormalized = (object) => { - const lowered = {}; - Object.keys(object).forEach((x) => { - lowered[x.toLowerCase()] = x; - }); - return lowered; - }; - const normalizeObject = this.normalizeObject(objectToNormalized); - const optionsLower = objectToNormalized(options); - Object.keys(eData) - .filter((x) => x.startsWith(Namespace.dataKey)) - .map((x) => x.substring(2)) - .forEach((key) => { - let keyOption = optionsLower[key.toLowerCase()]; - // dataset merges dashes to camelCase... yay - // i.e. key = display_components_seconds - if (key.includes('_')) { - // [display, components, seconds] - const split = key.split('_'); - // display - keyOption = optionsLower[split[0].toLowerCase()]; - if (keyOption !== undefined && - options[keyOption].constructor === Object) { - dataOptions[keyOption] = normalizeObject(split, 1, options[keyOption], eData[`td${key}`]); - } - } - // or key = multipleDate - else if (keyOption !== undefined) { - dataOptions[keyOption] = eData[`td${key}`]; - } - }); - return this._mergeOptions(dataOptions, options); - } - //todo clean this up - static normalizeObject(objectToNormalized) { - const normalizeObject = (split, index, optionSubgroup, value) => { - // first round = display { ... } - const normalizedOptions = objectToNormalized(optionSubgroup); - const keyOption = normalizedOptions[split[index].toLowerCase()]; - const internalObject = {}; - if (keyOption === undefined) - return internalObject; - // if this is another object, continue down the rabbit hole - if (optionSubgroup[keyOption].constructor === Object) { - index++; - internalObject[keyOption] = normalizeObject(split, index, optionSubgroup[keyOption], value); - } - else { - internalObject[keyOption] = value; - } - return internalObject; - }; - return normalizeObject; - } - /** - * Attempts to prove `d` is a DateTime or Date or can be converted into one. - * @param d If a string will attempt creating a date from it. - * @param localization object containing locale and format settings. Only used with the custom formats - * @private - */ - static _dateTypeCheck(d, //eslint-disable-line @typescript-eslint/no-explicit-any - localization) { - return tryConvertToDateTime(d, localization); - } - /** - * Type checks that `value` is an array of Date or DateTime - * @param optionName Provides text to error messages e.g. disabledDates - * @param value Option value - * @param providedType Used to provide text to error messages - * @param localization - */ - static _typeCheckDateArray(optionName, value, providedType, localization) { - return typeCheckDateArray(optionName, value, providedType, localization); - } - /** - * Type checks that `value` is an array of numbers - * @param optionName Provides text to error messages e.g. disabledDates - * @param value Option value - * @param providedType Used to provide text to error messages - */ - static _typeCheckNumberArray(optionName, value, providedType) { - return typeCheckNumberArray(optionName, value, providedType); - } - /** - * Attempts to convert `d` to a DateTime object - * @param d value to convert - * @param optionName Provides text to error messages e.g. disabledDates - * @param localization object containing locale and format settings. Only used with the custom formats - */ - static dateConversion(d, //eslint-disable-line @typescript-eslint/no-explicit-any - optionName, localization) { - return convertToDateTime(d, optionName, localization); - } - static getFlattenDefaultOptions() { - if (this._flattenDefaults) - return this._flattenDefaults; - const deepKeys = (t, pre = []) => { - if (Array.isArray(t)) - return []; - if (Object(t) === t) { - return Object.entries(t).flatMap(([k, v]) => deepKeys(v, [...pre, k])); - } - else { - return pre.join('.'); - } - }; - this._flattenDefaults = deepKeys(DefaultOptions); - return this._flattenDefaults; - } - /** - * Some options conflict like min/max date. Verify that these kinds of options - * are set correctly. - * @param config - */ - static _validateConflicts(config) { - if (config.display.sideBySide && - (!config.display.components.clock || - !(config.display.components.hours || - config.display.components.minutes || - config.display.components.seconds))) { - Namespace.errorMessages.conflictingConfiguration('Cannot use side by side mode without the clock components'); - } - if (config.restrictions.minDate && config.restrictions.maxDate) { - if (config.restrictions.minDate.isAfter(config.restrictions.maxDate)) { - Namespace.errorMessages.conflictingConfiguration('minDate is after maxDate'); - } - if (config.restrictions.maxDate.isBefore(config.restrictions.minDate)) { - Namespace.errorMessages.conflictingConfiguration('maxDate is before minDate'); - } - } - if (config.multipleDates && config.dateRange) { - Namespace.errorMessages.conflictingConfiguration('Cannot uss option "multipleDates" with "dateRange"'); - } - } -} -OptionConverter.ignoreProperties = [ - 'meta', - 'dayViewHeaderFormat', - 'container', - 'dateForms', - 'ordinal', -]; -OptionConverter.isValue = (a) => a != null; // everything except undefined + null - -class Dates { - constructor() { - this._dates = []; - this.optionsStore = serviceLocator.locate(OptionsStore); - this.validation = serviceLocator.locate(Validation); - this._eventEmitters = serviceLocator.locate(EventEmitters); - } - /** - * Returns the array of selected dates - */ - get picked() { - return [...this._dates]; - } - /** - * Returns the last picked value. - */ - get lastPicked() { - return this._dates[this.lastPickedIndex]?.clone; - } - /** - * Returns the length of picked dates -1 or 0 if none are selected. - */ - get lastPickedIndex() { - if (this._dates.length === 0) - return 0; - return this._dates.length - 1; - } - /** - * Formats a DateTime object to a string. Used when setting the input value. - * @param date - */ - formatInput(date) { - if (!date) - return ''; - date.localization = this.optionsStore.options.localization; - return date.format(); - } - /** - * parse the value into a DateTime object. - * this can be overwritten to supply your own parsing. - */ - //eslint-disable-next-line @typescript-eslint/no-explicit-any - parseInput(value) { - return OptionConverter.dateConversion(value, 'input', this.optionsStore.options.localization); - } - /** - * Tries to convert the provided value to a DateTime object. - * If value is null|undefined then clear the value of the provided index (or 0). - * @param value Value to convert or null|undefined - * @param index When using multidates this is the index in the array - */ - //eslint-disable-next-line @typescript-eslint/no-explicit-any - setFromInput(value, index) { - if (!value) { - this.setValue(undefined, index); - return; - } - const converted = this.parseInput(value); - if (converted) { - converted.setLocalization(this.optionsStore.options.localization); - this.setValue(converted, index); - } - } - /** - * Adds a new DateTime to selected dates array - * @param date - */ - add(date) { - this._dates.push(date); - } - /** - * Returns true if the `targetDate` is part of the selected dates array. - * If `unit` is provided then a granularity to that unit will be used. - * @param targetDate - * @param unit - */ - isPicked(targetDate, unit) { - if (!DateTime.isValid(targetDate)) - return false; - if (!unit) - return this._dates.find((x) => x.isSame(targetDate)) !== undefined; - const format = getFormatByUnit(unit); - const innerDateFormatted = targetDate.format(format); - return (this._dates - .map((x) => x.format(format)) - .find((x) => x === innerDateFormatted) !== undefined); - } - /** - * Returns the index at which `targetDate` is in the array. - * This is used for updating or removing a date when multi-date is used - * If `unit` is provided then a granularity to that unit will be used. - * @param targetDate - * @param unit - */ - pickedIndex(targetDate, unit) { - if (!DateTime.isValid(targetDate)) - return -1; - if (!unit) - return this._dates.map((x) => x.valueOf()).indexOf(targetDate.valueOf()); - const format = getFormatByUnit(unit); - const innerDateFormatted = targetDate.format(format); - return this._dates.map((x) => x.format(format)).indexOf(innerDateFormatted); - } - /** - * Clears all selected dates. - */ - clear() { - this.optionsStore.unset = true; - this._eventEmitters.triggerEvent.emit({ - type: Namespace.events.change, - date: undefined, - oldDate: this.lastPicked, - isClear: true, - isValid: true, - }); - this._dates = []; - if (this.optionsStore.input) - this.optionsStore.input.value = ''; - this._eventEmitters.updateDisplay.emit('all'); - } - /** - * Find the "book end" years given a `year` and a `factor` - * @param factor e.g. 100 for decades - * @param year e.g. 2021 - */ - static getStartEndYear(factor, year) { - const step = factor / 10, startYear = Math.floor(year / factor) * factor, endYear = startYear + step * 9, focusValue = Math.floor(year / step) * step; - return [startYear, endYear, focusValue]; - } - updateInput(target) { - if (!this.optionsStore.input) - return; - let newValue = this.formatInput(target); - if (this.optionsStore.options.multipleDates || - this.optionsStore.options.dateRange) { - newValue = this._dates - .map((d) => this.formatInput(d)) - .join(this.optionsStore.options.multipleDatesSeparator); - } - if (this.optionsStore.input.value != newValue) - this.optionsStore.input.value = newValue; - } - /** - * Attempts to either clear or set the `target` date at `index`. - * If the `target` is null then the date will be cleared. - * If multi-date is being used then it will be removed from the array. - * If `target` is valid and multi-date is used then if `index` is - * provided the date at that index will be replaced, otherwise it is appended. - * @param target - * @param index - */ - setValue(target, index) { - const noIndex = typeof index === 'undefined', isClear = !target && noIndex; - let oldDate = this.optionsStore.unset ? null : this._dates[index]?.clone; - if (!oldDate && !this.optionsStore.unset && noIndex && isClear) { - oldDate = this.lastPicked; - } - if (target && oldDate?.isSame(target)) { - this.updateInput(target); - return; - } - // case of calling setValue(null) - if (!target) { - this._setValueNull(isClear, index, oldDate); - return; - } - index = index || 0; - target = target.clone; - // minute stepping is being used, force the minute to the closest value - if (this.optionsStore.options.stepping !== 1) { - target.minutes = - Math.round(target.minutes / this.optionsStore.options.stepping) * - this.optionsStore.options.stepping; - target.startOf(Unit.minutes); - } - const onUpdate = (isValid) => { - this._dates[index] = target; - this._eventEmitters.updateViewDate.emit(target.clone); - this.updateInput(target); - this.optionsStore.unset = false; - this._eventEmitters.updateDisplay.emit('all'); - this._eventEmitters.triggerEvent.emit({ - type: Namespace.events.change, - date: target, - oldDate, - isClear, - isValid: isValid, - }); - }; - if (this.validation.isValid(target) && - this.validation.dateRangeIsValid(this.picked, index, target)) { - onUpdate(true); - return; - } - if (this.optionsStore.options.keepInvalid) { - onUpdate(false); - } - this._eventEmitters.triggerEvent.emit({ - type: Namespace.events.error, - reason: Namespace.errorMessages.failedToSetInvalidDate, - date: target, - oldDate, - }); - } - _setValueNull(isClear, index, oldDate) { - if (!this.optionsStore.options.multipleDates || - this._dates.length === 1 || - isClear) { - this.optionsStore.unset = true; - this._dates = []; - } - else { - this._dates.splice(index, 1); - } - this.updateInput(); - this._eventEmitters.triggerEvent.emit({ - type: Namespace.events.change, - date: undefined, - oldDate, - isClear, - isValid: true, - }); - this._eventEmitters.updateDisplay.emit('all'); - } -} - -var ActionTypes; -(function (ActionTypes) { - ActionTypes["next"] = "next"; - ActionTypes["previous"] = "previous"; - ActionTypes["changeCalendarView"] = "changeCalendarView"; - ActionTypes["selectMonth"] = "selectMonth"; - ActionTypes["selectYear"] = "selectYear"; - ActionTypes["selectDecade"] = "selectDecade"; - ActionTypes["selectDay"] = "selectDay"; - ActionTypes["selectHour"] = "selectHour"; - ActionTypes["selectMinute"] = "selectMinute"; - ActionTypes["selectSecond"] = "selectSecond"; - ActionTypes["incrementHours"] = "incrementHours"; - ActionTypes["incrementMinutes"] = "incrementMinutes"; - ActionTypes["incrementSeconds"] = "incrementSeconds"; - ActionTypes["decrementHours"] = "decrementHours"; - ActionTypes["decrementMinutes"] = "decrementMinutes"; - ActionTypes["decrementSeconds"] = "decrementSeconds"; - ActionTypes["toggleMeridiem"] = "toggleMeridiem"; - ActionTypes["togglePicker"] = "togglePicker"; - ActionTypes["showClock"] = "showClock"; - ActionTypes["showHours"] = "showHours"; - ActionTypes["showMinutes"] = "showMinutes"; - ActionTypes["showSeconds"] = "showSeconds"; - ActionTypes["clear"] = "clear"; - ActionTypes["close"] = "close"; - ActionTypes["today"] = "today"; -})(ActionTypes || (ActionTypes = {})); -var ActionTypes$1 = ActionTypes; - -/** - * Creates and updates the grid for `date` - */ -class DateDisplay { - constructor() { - this.optionsStore = serviceLocator.locate(OptionsStore); - this.dates = serviceLocator.locate(Dates); - this.validation = serviceLocator.locate(Validation); - } - /** - * Build the container html for the display - * @private - */ - getPicker() { - const container = document.createElement('div'); - container.classList.add(Namespace.css.daysContainer); - container.append(...this._daysOfTheWeek()); - if (this.optionsStore.options.display.calendarWeeks) { - const div = document.createElement('div'); - div.classList.add(Namespace.css.calendarWeeks, Namespace.css.noHighlight); - container.appendChild(div); - } - const { rangeHoverEvent, rangeHoverOutEvent } = this.handleMouseEvents(container); - for (let i = 0; i < 42; i++) { - if (i !== 0 && i % 7 === 0) { - if (this.optionsStore.options.display.calendarWeeks) { - const div = document.createElement('div'); - div.classList.add(Namespace.css.calendarWeeks, Namespace.css.noHighlight); - container.appendChild(div); - } - } - const div = document.createElement('div'); - div.setAttribute('data-action', ActionTypes$1.selectDay); - container.appendChild(div); - // if hover is supported then add the events - if (matchMedia('(hover: hover)').matches && - this.optionsStore.options.dateRange) { - div.addEventListener('mouseover', rangeHoverEvent); - div.addEventListener('mouseout', rangeHoverOutEvent); - } - } - return container; - } - /** - * Populates the grid and updates enabled states - * @private - */ - _update(widget, paint) { - const container = widget.getElementsByClassName(Namespace.css.daysContainer)[0]; - this._updateCalendarView(container); - const innerDate = this.optionsStore.viewDate.clone - .startOf(Unit.month) - .startOf('weekDay', this.optionsStore.options.localization.startOfTheWeek) - .manipulate(12, Unit.hours); - this._handleCalendarWeeks(container, innerDate.clone); - container - .querySelectorAll(`[data-action="${ActionTypes$1.selectDay}"]`) - .forEach((element) => { - const classes = []; - classes.push(Namespace.css.day); - if (innerDate.isBefore(this.optionsStore.viewDate, Unit.month)) { - classes.push(Namespace.css.old); - } - if (innerDate.isAfter(this.optionsStore.viewDate, Unit.month)) { - classes.push(Namespace.css.new); - } - if (!this.optionsStore.unset && - !this.optionsStore.options.dateRange && - this.dates.isPicked(innerDate, Unit.date)) { - classes.push(Namespace.css.active); - } - if (!this.validation.isValid(innerDate, Unit.date)) { - classes.push(Namespace.css.disabled); - } - if (innerDate.isSame(new DateTime(), Unit.date)) { - classes.push(Namespace.css.today); - } - if (innerDate.weekDay === 0 || innerDate.weekDay === 6) { - classes.push(Namespace.css.weekend); - } - this._handleDateRange(innerDate, classes); - paint(Unit.date, innerDate, classes, element); - element.classList.remove(...element.classList); - element.classList.add(...classes); - element.setAttribute('data-value', this._dateToDataValue(innerDate)); - element.setAttribute('data-day', `${innerDate.date}`); - element.innerText = innerDate.parts(undefined, { - day: 'numeric', - }).day; - innerDate.manipulate(1, Unit.date); - }); - } - _dateToDataValue(date) { - if (!DateTime.isValid(date)) - return ''; - return `${date.year}-${date.monthFormatted}-${date.dateFormatted}`; - } - _handleDateRange(innerDate, classes) { - const rangeStart = this.dates.picked[0]; - const rangeEnd = this.dates.picked[1]; - if (this.optionsStore.options.dateRange) { - if (innerDate.isBetween(rangeStart, rangeEnd, Unit.date)) { - classes.push(Namespace.css.rangeIn); - } - if (innerDate.isSame(rangeStart, Unit.date)) { - classes.push(Namespace.css.rangeStart); - } - if (innerDate.isSame(rangeEnd, Unit.date)) { - classes.push(Namespace.css.rangeEnd); - } - } - } - handleMouseEvents(container) { - const rangeHoverEvent = (e) => { - const currentTarget = e?.currentTarget; - // if we have 0 or 2 selected or if the target is disabled then ignore - if (this.dates.picked.length !== 1 || - currentTarget.classList.contains(Namespace.css.disabled)) - return; - // select all the date divs - const allDays = [...container.querySelectorAll('.day')]; - // get the date value from the element being hovered over - const attributeValue = currentTarget.getAttribute('data-value'); - // format the string to a date - const innerDate = DateTime.fromString(attributeValue, { - format: 'yyyy-MM-dd', - }); - // find the position of the target in the date container - const dayIndex = allDays.findIndex((e) => e.getAttribute('data-value') === attributeValue); - // find the first and second selected dates - const rangeStart = this.dates.picked[0]; - const rangeEnd = this.dates.picked[1]; - //format the start date so that it can be found by the attribute - const rangeStartFormatted = this._dateToDataValue(rangeStart); - const rangeStartIndex = allDays.findIndex((e) => e.getAttribute('data-value') === rangeStartFormatted); - const rangeStartElement = allDays[rangeStartIndex]; - //make sure we don't leave start/end classes if we don't need them - if (!innerDate.isSame(rangeStart, Unit.date)) { - currentTarget.classList.remove(Namespace.css.rangeStart); - } - if (!innerDate.isSame(rangeEnd, Unit.date)) { - currentTarget.classList.remove(Namespace.css.rangeEnd); - } - // the following figures out which direct from start date is selected - // the selection "cap" classes are applied if needed - // otherwise all the dates between will get the `rangeIn` class. - // We make this selection based on the element's index and the rangeStart index - let lambda; - if (innerDate.isBefore(rangeStart)) { - currentTarget.classList.add(Namespace.css.rangeStart); - rangeStartElement?.classList.remove(Namespace.css.rangeStart); - rangeStartElement?.classList.add(Namespace.css.rangeEnd); - lambda = (_, index) => index > dayIndex && index < rangeStartIndex; - } - else { - currentTarget.classList.add(Namespace.css.rangeEnd); - rangeStartElement?.classList.remove(Namespace.css.rangeEnd); - rangeStartElement?.classList.add(Namespace.css.rangeStart); - lambda = (_, index) => index < dayIndex && index > rangeStartIndex; - } - allDays.filter(lambda).forEach((e) => { - e.classList.add(Namespace.css.rangeIn); - }); - }; - const rangeHoverOutEvent = (e) => { - // find all the dates in the container - const allDays = [...container.querySelectorAll('.day')]; - // if only the start is selected, remove all the rangeIn classes - // we do this because once the user hovers over a new date the range will be recalculated. - if (this.dates.picked.length === 1) - allDays.forEach((e) => e.classList.remove(Namespace.css.rangeIn)); - // if we have 0 or 2 dates selected then ignore - if (this.dates.picked.length !== 1) - return; - const currentTarget = e?.currentTarget; - // get the elements date from the attribute value - const innerDate = new DateTime(currentTarget.getAttribute('data-value')); - // verify selections and remove invalid classes - if (!innerDate.isSame(this.dates.picked[0], Unit.date)) { - currentTarget.classList.remove(Namespace.css.rangeStart); - } - if (!innerDate.isSame(this.dates.picked[1], Unit.date)) { - currentTarget.classList.remove(Namespace.css.rangeEnd); - } - }; - return { rangeHoverEvent, rangeHoverOutEvent }; - } - _updateCalendarView(container) { - if (this.optionsStore.currentView !== 'calendar') - return; - const [previous, switcher, next] = container.parentElement - .getElementsByClassName(Namespace.css.calendarHeader)[0] - .getElementsByTagName('div'); - switcher.setAttribute(Namespace.css.daysContainer, this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat)); - this.optionsStore.options.display.components.month - ? switcher.classList.remove(Namespace.css.disabled) - : switcher.classList.add(Namespace.css.disabled); - this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1, Unit.month), Unit.month) - ? previous.classList.remove(Namespace.css.disabled) - : previous.classList.add(Namespace.css.disabled); - this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1, Unit.month), Unit.month) - ? next.classList.remove(Namespace.css.disabled) - : next.classList.add(Namespace.css.disabled); - } - /*** - * Generates a html row that contains the days of the week. - * @private - */ - _daysOfTheWeek() { - const innerDate = this.optionsStore.viewDate.clone - .startOf('weekDay', this.optionsStore.options.localization.startOfTheWeek) - .startOf(Unit.date); - const row = []; - document.createElement('div'); - if (this.optionsStore.options.display.calendarWeeks) { - const htmlDivElement = document.createElement('div'); - htmlDivElement.classList.add(Namespace.css.calendarWeeks, Namespace.css.noHighlight); - htmlDivElement.innerText = '#'; - row.push(htmlDivElement); - } - for (let i = 0; i < 7; i++) { - const htmlDivElement = document.createElement('div'); - htmlDivElement.classList.add(Namespace.css.dayOfTheWeek, Namespace.css.noHighlight); - let weekDay = innerDate.format({ weekday: 'short' }); - if (this.optionsStore.options.localization.maxWeekdayLength > 0) - weekDay = weekDay.substring(0, this.optionsStore.options.localization.maxWeekdayLength); - htmlDivElement.innerText = weekDay; - innerDate.manipulate(1, Unit.date); - row.push(htmlDivElement); - } - return row; - } - _handleCalendarWeeks(container, innerDate) { - [...container.querySelectorAll(`.${Namespace.css.calendarWeeks}`)] - .filter((e) => e.innerText !== '#') - .forEach((element) => { - element.innerText = `${innerDate.week}`; - innerDate.manipulate(7, Unit.date); - }); - } -} - -/** - * Creates and updates the grid for `month` - */ -class MonthDisplay { - constructor() { - this.optionsStore = serviceLocator.locate(OptionsStore); - this.dates = serviceLocator.locate(Dates); - this.validation = serviceLocator.locate(Validation); - } - /** - * Build the container html for the display - * @private - */ - getPicker() { - const container = document.createElement('div'); - container.classList.add(Namespace.css.monthsContainer); - for (let i = 0; i < 12; i++) { - const div = document.createElement('div'); - div.setAttribute('data-action', ActionTypes$1.selectMonth); - container.appendChild(div); - } - return container; - } - /** - * Populates the grid and updates enabled states - * @private - */ - _update(widget, paint) { - const container = widget.getElementsByClassName(Namespace.css.monthsContainer)[0]; - if (this.optionsStore.currentView === 'months') { - const [previous, switcher, next] = container.parentElement - .getElementsByClassName(Namespace.css.calendarHeader)[0] - .getElementsByTagName('div'); - switcher.setAttribute(Namespace.css.monthsContainer, this.optionsStore.viewDate.format({ year: 'numeric' })); - this.optionsStore.options.display.components.year - ? switcher.classList.remove(Namespace.css.disabled) - : switcher.classList.add(Namespace.css.disabled); - this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1, Unit.year), Unit.year) - ? previous.classList.remove(Namespace.css.disabled) - : previous.classList.add(Namespace.css.disabled); - this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1, Unit.year), Unit.year) - ? next.classList.remove(Namespace.css.disabled) - : next.classList.add(Namespace.css.disabled); - } - const innerDate = this.optionsStore.viewDate.clone.startOf(Unit.year); - container - .querySelectorAll(`[data-action="${ActionTypes$1.selectMonth}"]`) - .forEach((containerClone, index) => { - const classes = []; - classes.push(Namespace.css.month); - if (!this.optionsStore.unset && - this.dates.isPicked(innerDate, Unit.month)) { - classes.push(Namespace.css.active); - } - if (!this.validation.isValid(innerDate, Unit.month)) { - classes.push(Namespace.css.disabled); - } - paint(Unit.month, innerDate, classes, containerClone); - containerClone.classList.remove(...containerClone.classList); - containerClone.classList.add(...classes); - containerClone.setAttribute('data-value', `${index}`); - containerClone.innerText = `${innerDate.format({ month: 'short' })}`; - innerDate.manipulate(1, Unit.month); - }); - } -} - -/** - * Creates and updates the grid for `year` - */ -class YearDisplay { - constructor() { - this.optionsStore = serviceLocator.locate(OptionsStore); - this.dates = serviceLocator.locate(Dates); - this.validation = serviceLocator.locate(Validation); - } - /** - * Build the container html for the display - * @private - */ - getPicker() { - const container = document.createElement('div'); - container.classList.add(Namespace.css.yearsContainer); - for (let i = 0; i < 12; i++) { - const div = document.createElement('div'); - div.setAttribute('data-action', ActionTypes$1.selectYear); - container.appendChild(div); - } - return container; - } - /** - * Populates the grid and updates enabled states - * @private - */ - _update(widget, paint) { - this._startYear = this.optionsStore.viewDate.clone.manipulate(-1, Unit.year); - this._endYear = this.optionsStore.viewDate.clone.manipulate(10, Unit.year); - const container = widget.getElementsByClassName(Namespace.css.yearsContainer)[0]; - if (this.optionsStore.currentView === 'years') { - const [previous, switcher, next] = container.parentElement - .getElementsByClassName(Namespace.css.calendarHeader)[0] - .getElementsByTagName('div'); - switcher.setAttribute(Namespace.css.yearsContainer, `${this._startYear.format({ year: 'numeric' })}-${this._endYear.format({ - year: 'numeric', - })}`); - this.optionsStore.options.display.components.decades - ? switcher.classList.remove(Namespace.css.disabled) - : switcher.classList.add(Namespace.css.disabled); - this.validation.isValid(this._startYear, Unit.year) - ? previous.classList.remove(Namespace.css.disabled) - : previous.classList.add(Namespace.css.disabled); - this.validation.isValid(this._endYear, Unit.year) - ? next.classList.remove(Namespace.css.disabled) - : next.classList.add(Namespace.css.disabled); - } - const innerDate = this.optionsStore.viewDate.clone - .startOf(Unit.year) - .manipulate(-1, Unit.year); - container - .querySelectorAll(`[data-action="${ActionTypes$1.selectYear}"]`) - .forEach((containerClone) => { - const classes = []; - classes.push(Namespace.css.year); - if (!this.optionsStore.unset && - this.dates.isPicked(innerDate, Unit.year)) { - classes.push(Namespace.css.active); - } - if (!this.validation.isValid(innerDate, Unit.year)) { - classes.push(Namespace.css.disabled); - } - paint(Unit.year, innerDate, classes, containerClone); - containerClone.classList.remove(...containerClone.classList); - containerClone.classList.add(...classes); - containerClone.setAttribute('data-value', `${innerDate.year}`); - containerClone.innerText = innerDate.format({ year: 'numeric' }); - innerDate.manipulate(1, Unit.year); - }); - } -} - -/** - * Creates and updates the grid for `seconds` - */ -class DecadeDisplay { - constructor() { - this.optionsStore = serviceLocator.locate(OptionsStore); - this.dates = serviceLocator.locate(Dates); - this.validation = serviceLocator.locate(Validation); - } - /** - * Build the container html for the display - * @private - */ - getPicker() { - const container = document.createElement('div'); - container.classList.add(Namespace.css.decadesContainer); - for (let i = 0; i < 12; i++) { - const div = document.createElement('div'); - div.setAttribute('data-action', ActionTypes$1.selectDecade); - container.appendChild(div); - } - return container; - } - /** - * Populates the grid and updates enabled states - * @private - */ - _update(widget, paint) { - const [start, end] = Dates.getStartEndYear(100, this.optionsStore.viewDate.year); - this._startDecade = this.optionsStore.viewDate.clone.startOf(Unit.year); - this._startDecade.year = start; - this._endDecade = this.optionsStore.viewDate.clone.startOf(Unit.year); - this._endDecade.year = end; - const container = widget.getElementsByClassName(Namespace.css.decadesContainer)[0]; - const [previous, switcher, next] = container.parentElement - .getElementsByClassName(Namespace.css.calendarHeader)[0] - .getElementsByTagName('div'); - if (this.optionsStore.currentView === 'decades') { - switcher.setAttribute(Namespace.css.decadesContainer, `${this._startDecade.format({ - year: 'numeric', - })}-${this._endDecade.format({ year: 'numeric' })}`); - this.validation.isValid(this._startDecade, Unit.year) - ? previous.classList.remove(Namespace.css.disabled) - : previous.classList.add(Namespace.css.disabled); - this.validation.isValid(this._endDecade, Unit.year) - ? next.classList.remove(Namespace.css.disabled) - : next.classList.add(Namespace.css.disabled); - } - const pickedYears = this.dates.picked.map((x) => x.year); - container - .querySelectorAll(`[data-action="${ActionTypes$1.selectDecade}"]`) - .forEach((containerClone, index) => { - if (index === 0) { - containerClone.classList.add(Namespace.css.old); - if (this._startDecade.year - 10 < 0) { - containerClone.textContent = ' '; - previous.classList.add(Namespace.css.disabled); - containerClone.classList.add(Namespace.css.disabled); - containerClone.setAttribute('data-value', ''); - return; - } - else { - containerClone.innerText = this._startDecade.clone - .manipulate(-10, Unit.year) - .format({ year: 'numeric' }); - containerClone.setAttribute('data-value', `${this._startDecade.year}`); - return; - } - } - const classes = []; - classes.push(Namespace.css.decade); - const startDecadeYear = this._startDecade.year; - const endDecadeYear = this._startDecade.year + 9; - if (!this.optionsStore.unset && - pickedYears.filter((x) => x >= startDecadeYear && x <= endDecadeYear) - .length > 0) { - classes.push(Namespace.css.active); - } - paint('decade', this._startDecade, classes, containerClone); - containerClone.classList.remove(...containerClone.classList); - containerClone.classList.add(...classes); - containerClone.setAttribute('data-value', `${this._startDecade.year}`); - containerClone.innerText = `${this._startDecade.format({ - year: 'numeric', - })}`; - this._startDecade.manipulate(10, Unit.year); - }); - } -} - -/** - * Creates the clock display - */ -class TimeDisplay { - constructor() { - this._gridColumns = ''; - this.optionsStore = serviceLocator.locate(OptionsStore); - this.dates = serviceLocator.locate(Dates); - this.validation = serviceLocator.locate(Validation); - } - /** - * Build the container html for the clock display - * @private - */ - getPicker(iconTag) { - const container = document.createElement('div'); - container.classList.add(Namespace.css.clockContainer); - container.append(...this._grid(iconTag)); - return container; - } - /** - * Populates the various elements with in the clock display - * like the current hour and if the manipulation icons are enabled. - * @private - */ - _update(widget) { - const timesDiv = (widget.getElementsByClassName(Namespace.css.clockContainer)[0]); - let lastPicked = this.dates.lastPicked?.clone; - if (!lastPicked && this.optionsStore.options.useCurrent) - lastPicked = this.optionsStore.viewDate.clone; - timesDiv - .querySelectorAll('.disabled') - .forEach((element) => element.classList.remove(Namespace.css.disabled)); - if (this.optionsStore.options.display.components.hours) { - if (!this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1, Unit.hours), Unit.hours)) { - timesDiv - .querySelector(`[data-action=${ActionTypes$1.incrementHours}]`) - .classList.add(Namespace.css.disabled); - } - if (!this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1, Unit.hours), Unit.hours)) { - timesDiv - .querySelector(`[data-action=${ActionTypes$1.decrementHours}]`) - .classList.add(Namespace.css.disabled); - } - timesDiv.querySelector(`[data-time-component=${Unit.hours}]`).innerText = lastPicked - ? lastPicked.getHoursFormatted(this.optionsStore.options.localization.hourCycle) - : '--'; - } - if (this.optionsStore.options.display.components.minutes) { - if (!this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1, Unit.minutes), Unit.minutes)) { - timesDiv - .querySelector(`[data-action=${ActionTypes$1.incrementMinutes}]`) - .classList.add(Namespace.css.disabled); - } - if (!this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1, Unit.minutes), Unit.minutes)) { - timesDiv - .querySelector(`[data-action=${ActionTypes$1.decrementMinutes}]`) - .classList.add(Namespace.css.disabled); - } - timesDiv.querySelector(`[data-time-component=${Unit.minutes}]`).innerText = lastPicked ? lastPicked.minutesFormatted : '--'; - } - if (this.optionsStore.options.display.components.seconds) { - if (!this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1, Unit.seconds), Unit.seconds)) { - timesDiv - .querySelector(`[data-action=${ActionTypes$1.incrementSeconds}]`) - .classList.add(Namespace.css.disabled); - } - if (!this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1, Unit.seconds), Unit.seconds)) { - timesDiv - .querySelector(`[data-action=${ActionTypes$1.decrementSeconds}]`) - .classList.add(Namespace.css.disabled); - } - timesDiv.querySelector(`[data-time-component=${Unit.seconds}]`).innerText = lastPicked ? lastPicked.secondsFormatted : '--'; - } - if (this.optionsStore.isTwelveHour) { - const toggle = timesDiv.querySelector(`[data-action=${ActionTypes$1.toggleMeridiem}]`); - const meridiemDate = (lastPicked || this.optionsStore.viewDate).clone; - toggle.innerText = meridiemDate.meridiem(); - if (!this.validation.isValid(meridiemDate.manipulate(meridiemDate.hours >= 12 ? -12 : 12, Unit.hours))) { - toggle.classList.add(Namespace.css.disabled); - } - else { - toggle.classList.remove(Namespace.css.disabled); - } - } - timesDiv.style.gridTemplateAreas = `"${this._gridColumns}"`; - } - /** - * Creates the table for the clock display depending on what options are selected. - * @private - */ - _grid(iconTag) { - this._gridColumns = ''; - const top = [], middle = [], bottom = [], separator = document.createElement('div'), upIcon = iconTag(this.optionsStore.options.display.icons.up), downIcon = iconTag(this.optionsStore.options.display.icons.down); - separator.classList.add(Namespace.css.separator, Namespace.css.noHighlight); - const separatorColon = separator.cloneNode(true); - separatorColon.innerHTML = ':'; - const getSeparator = (colon = false) => { - return colon - ? separatorColon.cloneNode(true) - : separator.cloneNode(true); - }; - if (this.optionsStore.options.display.components.hours) { - let divElement = document.createElement('div'); - divElement.setAttribute('title', this.optionsStore.options.localization.incrementHour); - divElement.setAttribute('data-action', ActionTypes$1.incrementHours); - divElement.appendChild(upIcon.cloneNode(true)); - top.push(divElement); - divElement = document.createElement('div'); - divElement.setAttribute('title', this.optionsStore.options.localization.pickHour); - divElement.setAttribute('data-action', ActionTypes$1.showHours); - divElement.setAttribute('data-time-component', Unit.hours); - middle.push(divElement); - divElement = document.createElement('div'); - divElement.setAttribute('title', this.optionsStore.options.localization.decrementHour); - divElement.setAttribute('data-action', ActionTypes$1.decrementHours); - divElement.appendChild(downIcon.cloneNode(true)); - bottom.push(divElement); - this._gridColumns += 'a'; - } - if (this.optionsStore.options.display.components.minutes) { - this._gridColumns += ' a'; - if (this.optionsStore.options.display.components.hours) { - top.push(getSeparator()); - middle.push(getSeparator(true)); - bottom.push(getSeparator()); - this._gridColumns += ' a'; - } - let divElement = document.createElement('div'); - divElement.setAttribute('title', this.optionsStore.options.localization.incrementMinute); - divElement.setAttribute('data-action', ActionTypes$1.incrementMinutes); - divElement.appendChild(upIcon.cloneNode(true)); - top.push(divElement); - divElement = document.createElement('div'); - divElement.setAttribute('title', this.optionsStore.options.localization.pickMinute); - divElement.setAttribute('data-action', ActionTypes$1.showMinutes); - divElement.setAttribute('data-time-component', Unit.minutes); - middle.push(divElement); - divElement = document.createElement('div'); - divElement.setAttribute('title', this.optionsStore.options.localization.decrementMinute); - divElement.setAttribute('data-action', ActionTypes$1.decrementMinutes); - divElement.appendChild(downIcon.cloneNode(true)); - bottom.push(divElement); - } - if (this.optionsStore.options.display.components.seconds) { - this._gridColumns += ' a'; - if (this.optionsStore.options.display.components.minutes) { - top.push(getSeparator()); - middle.push(getSeparator(true)); - bottom.push(getSeparator()); - this._gridColumns += ' a'; - } - let divElement = document.createElement('div'); - divElement.setAttribute('title', this.optionsStore.options.localization.incrementSecond); - divElement.setAttribute('data-action', ActionTypes$1.incrementSeconds); - divElement.appendChild(upIcon.cloneNode(true)); - top.push(divElement); - divElement = document.createElement('div'); - divElement.setAttribute('title', this.optionsStore.options.localization.pickSecond); - divElement.setAttribute('data-action', ActionTypes$1.showSeconds); - divElement.setAttribute('data-time-component', Unit.seconds); - middle.push(divElement); - divElement = document.createElement('div'); - divElement.setAttribute('title', this.optionsStore.options.localization.decrementSecond); - divElement.setAttribute('data-action', ActionTypes$1.decrementSeconds); - divElement.appendChild(downIcon.cloneNode(true)); - bottom.push(divElement); - } - if (this.optionsStore.isTwelveHour) { - this._gridColumns += ' a'; - let divElement = getSeparator(); - top.push(divElement); - const button = document.createElement('button'); - button.setAttribute('type', 'button'); - button.setAttribute('title', this.optionsStore.options.localization.toggleMeridiem); - button.setAttribute('data-action', ActionTypes$1.toggleMeridiem); - button.setAttribute('tabindex', '-1'); - if (Namespace.css.toggleMeridiem.includes(',')) { - //todo move this to paint function? - button.classList.add(...Namespace.css.toggleMeridiem.split(',')); - } - else - button.classList.add(Namespace.css.toggleMeridiem); - divElement = document.createElement('div'); - divElement.classList.add(Namespace.css.noHighlight); - divElement.appendChild(button); - middle.push(divElement); - divElement = getSeparator(); - bottom.push(divElement); - } - this._gridColumns = this._gridColumns.trim(); - return [...top, ...middle, ...bottom]; - } -} - -/** - * Creates and updates the grid for `hours` - */ -class HourDisplay { - constructor() { - this.optionsStore = serviceLocator.locate(OptionsStore); - this.validation = serviceLocator.locate(Validation); - } - /** - * Build the container html for the display - * @private - */ - getPicker() { - const container = document.createElement('div'); - container.classList.add(Namespace.css.hourContainer); - for (let i = 0; i < (this.optionsStore.isTwelveHour ? 12 : 24); i++) { - const div = document.createElement('div'); - div.setAttribute('data-action', ActionTypes$1.selectHour); - container.appendChild(div); - } - return container; - } - /** - * Populates the grid and updates enabled states - * @private - */ - _update(widget, paint) { - const container = widget.getElementsByClassName(Namespace.css.hourContainer)[0]; - const innerDate = this.optionsStore.viewDate.clone.startOf(Unit.date); - container - .querySelectorAll(`[data-action="${ActionTypes$1.selectHour}"]`) - .forEach((containerClone) => { - const classes = []; - classes.push(Namespace.css.hour); - if (!this.validation.isValid(innerDate, Unit.hours)) { - classes.push(Namespace.css.disabled); - } - paint(Unit.hours, innerDate, classes, containerClone); - containerClone.classList.remove(...containerClone.classList); - containerClone.classList.add(...classes); - containerClone.setAttribute('data-value', `${innerDate.hours}`); - containerClone.innerText = innerDate.getHoursFormatted(this.optionsStore.options.localization.hourCycle); - innerDate.manipulate(1, Unit.hours); - }); - } -} - -/** - * Creates and updates the grid for `minutes` - */ -class MinuteDisplay { - constructor() { - this.optionsStore = serviceLocator.locate(OptionsStore); - this.validation = serviceLocator.locate(Validation); - } - /** - * Build the container html for the display - * @private - */ - getPicker() { - const container = document.createElement('div'); - container.classList.add(Namespace.css.minuteContainer); - const step = this.optionsStore.options.stepping === 1 - ? 5 - : this.optionsStore.options.stepping; - for (let i = 0; i < 60 / step; i++) { - const div = document.createElement('div'); - div.setAttribute('data-action', ActionTypes$1.selectMinute); - container.appendChild(div); - } - return container; - } - /** - * Populates the grid and updates enabled states - * @private - */ - _update(widget, paint) { - const container = widget.getElementsByClassName(Namespace.css.minuteContainer)[0]; - const innerDate = this.optionsStore.viewDate.clone.startOf(Unit.hours); - const step = this.optionsStore.options.stepping === 1 - ? 5 - : this.optionsStore.options.stepping; - container - .querySelectorAll(`[data-action="${ActionTypes$1.selectMinute}"]`) - .forEach((containerClone) => { - const classes = []; - classes.push(Namespace.css.minute); - if (!this.validation.isValid(innerDate, Unit.minutes)) { - classes.push(Namespace.css.disabled); - } - paint(Unit.minutes, innerDate, classes, containerClone); - containerClone.classList.remove(...containerClone.classList); - containerClone.classList.add(...classes); - containerClone.setAttribute('data-value', `${innerDate.minutes}`); - containerClone.innerText = innerDate.minutesFormatted; - innerDate.manipulate(step, Unit.minutes); - }); - } -} - -/** - * Creates and updates the grid for `seconds` - */ -class secondDisplay { - constructor() { - this.optionsStore = serviceLocator.locate(OptionsStore); - this.validation = serviceLocator.locate(Validation); - } - /** - * Build the container html for the display - * @private - */ - getPicker() { - const container = document.createElement('div'); - container.classList.add(Namespace.css.secondContainer); - for (let i = 0; i < 12; i++) { - const div = document.createElement('div'); - div.setAttribute('data-action', ActionTypes$1.selectSecond); - container.appendChild(div); - } - return container; - } - /** - * Populates the grid and updates enabled states - * @private - */ - _update(widget, paint) { - const container = widget.getElementsByClassName(Namespace.css.secondContainer)[0]; - const innerDate = this.optionsStore.viewDate.clone.startOf(Unit.minutes); - container - .querySelectorAll(`[data-action="${ActionTypes$1.selectSecond}"]`) - .forEach((containerClone) => { - const classes = []; - classes.push(Namespace.css.second); - if (!this.validation.isValid(innerDate, Unit.seconds)) { - classes.push(Namespace.css.disabled); - } - paint(Unit.seconds, innerDate, classes, containerClone); - containerClone.classList.remove(...containerClone.classList); - containerClone.classList.add(...classes); - containerClone.setAttribute('data-value', `${innerDate.seconds}`); - containerClone.innerText = innerDate.secondsFormatted; - innerDate.manipulate(5, Unit.seconds); - }); - } -} - -/** - * Provides a collapse functionality to the view changes - */ -class Collapse { - /** - * Flips the show/hide state of `target` - * @param target html element to affect. - */ - static toggle(target) { - if (target.classList.contains(Namespace.css.show)) { - this.hide(target); - } - else { - this.show(target); - } - } - /** - * Skips any animation or timeouts and immediately set the element to show. - * @param target - */ - static showImmediately(target) { - target.classList.remove(Namespace.css.collapsing); - target.classList.add(Namespace.css.collapse, Namespace.css.show); - target.style.height = ''; - } - /** - * If `target` is not already showing, then show after the animation. - * @param target - */ - static show(target) { - if (target.classList.contains(Namespace.css.collapsing) || - target.classList.contains(Namespace.css.show)) - return; - const complete = () => { - Collapse.showImmediately(target); - }; - target.style.height = '0'; - target.classList.remove(Namespace.css.collapse); - target.classList.add(Namespace.css.collapsing); - //eslint-disable-next-line @typescript-eslint/no-unused-vars - setTimeout(complete, this.getTransitionDurationFromElement(target)); - target.style.height = `${target.scrollHeight}px`; - } - /** - * Skips any animation or timeouts and immediately set the element to hide. - * @param target - */ - static hideImmediately(target) { - if (!target) - return; - target.classList.remove(Namespace.css.collapsing, Namespace.css.show); - target.classList.add(Namespace.css.collapse); - } - /** - * If `target` is not already hidden, then hide after the animation. - * @param target HTML Element - */ - static hide(target) { - if (target.classList.contains(Namespace.css.collapsing) || - !target.classList.contains(Namespace.css.show)) - return; - const complete = () => { - Collapse.hideImmediately(target); - }; - target.style.height = `${target.getBoundingClientRect()['height']}px`; - const reflow = (element) => element.offsetHeight; - reflow(target); - target.classList.remove(Namespace.css.collapse, Namespace.css.show); - target.classList.add(Namespace.css.collapsing); - target.style.height = ''; - //eslint-disable-next-line @typescript-eslint/no-unused-vars - setTimeout(complete, this.getTransitionDurationFromElement(target)); - } -} -/** - * Gets the transition duration from the `element` by getting css properties - * `transition-duration` and `transition-delay` - * @param element HTML Element - */ -Collapse.getTransitionDurationFromElement = (element) => { - if (!element) { - return 0; - } - // Get transition-duration of the element - let { transitionDuration, transitionDelay } = window.getComputedStyle(element); - const floatTransitionDuration = Number.parseFloat(transitionDuration); - const floatTransitionDelay = Number.parseFloat(transitionDelay); - // Return 0 if element or transition duration is not found - if (!floatTransitionDuration && !floatTransitionDelay) { - return 0; - } - // If multiple durations are defined, take the first - transitionDuration = transitionDuration.split(',')[0]; - transitionDelay = transitionDelay.split(',')[0]; - return ((Number.parseFloat(transitionDuration) + - Number.parseFloat(transitionDelay)) * - 1000); -}; - -/** - * Main class for all things display related. - */ -class Display { - constructor() { - this._isVisible = false; - /** - * A document click event to hide the widget if click is outside - * @private - * @param e MouseEvent - */ - this._documentClickEvent = (e) => { - if (this.optionsStore.options.debug || window.debug) - return; //eslint-disable-line @typescript-eslint/no-explicit-any - if (this._isVisible && - !e.composedPath().includes(this.widget) && // click inside the widget - !e.composedPath()?.includes(this.optionsStore.element) // click on the element - ) { - this.hide(); - } - }; - /** - * Click event for any action like selecting a date - * @param e MouseEvent - * @private - */ - this._actionsClickEvent = (e) => { - this._eventEmitters.action.emit({ e: e }); - }; - this.optionsStore = serviceLocator.locate(OptionsStore); - this.validation = serviceLocator.locate(Validation); - this.dates = serviceLocator.locate(Dates); - this.dateDisplay = serviceLocator.locate(DateDisplay); - this.monthDisplay = serviceLocator.locate(MonthDisplay); - this.yearDisplay = serviceLocator.locate(YearDisplay); - this.decadeDisplay = serviceLocator.locate(DecadeDisplay); - this.timeDisplay = serviceLocator.locate(TimeDisplay); - this.hourDisplay = serviceLocator.locate(HourDisplay); - this.minuteDisplay = serviceLocator.locate(MinuteDisplay); - this.secondDisplay = serviceLocator.locate(secondDisplay); - this._eventEmitters = serviceLocator.locate(EventEmitters); - this._widget = undefined; - this._eventEmitters.updateDisplay.subscribe((result) => { - this._update(result); - }); - } - /** - * Returns the widget body or undefined - * @private - */ - get widget() { - return this._widget; - } - get dateContainer() { - return this.widget?.querySelector(`div.${Namespace.css.dateContainer}`); - } - get timeContainer() { - return this.widget?.querySelector(`div.${Namespace.css.timeContainer}`); - } - /** - * Returns this visible state of the picker (shown) - */ - get isVisible() { - return this._isVisible; - } - /** - * Updates the table for a particular unit. Used when an option as changed or - * whenever the class list might need to be refreshed. - * @param unit - * @private - */ - _update(unit) { - if (!this.widget) - return; - switch (unit) { - case Unit.seconds: - this.secondDisplay._update(this.widget, this.paint); - break; - case Unit.minutes: - this.minuteDisplay._update(this.widget, this.paint); - break; - case Unit.hours: - this.hourDisplay._update(this.widget, this.paint); - break; - case Unit.date: - this.dateDisplay._update(this.widget, this.paint); - break; - case Unit.month: - this.monthDisplay._update(this.widget, this.paint); - break; - case Unit.year: - this.yearDisplay._update(this.widget, this.paint); - break; - case 'decade': - this.decadeDisplay._update(this.widget, this.paint); - break; - case 'clock': - if (!this._hasTime) - break; - this.timeDisplay._update(this.widget); - this._update(Unit.hours); - this._update(Unit.minutes); - this._update(Unit.seconds); - break; - case 'calendar': - this._update(Unit.date); - this._update(Unit.year); - this._update(Unit.month); - this.decadeDisplay._update(this.widget, this.paint); - this._updateCalendarHeader(); - break; - case 'all': - if (this._hasTime) { - this._update('clock'); - } - if (this._hasDate) { - this._update('calendar'); - } - } - } - // noinspection JSUnusedLocalSymbols - /** - * Allows developers to add/remove classes from an element. - * @param _unit - * @param _date - * @param _classes - * @param _element - */ - /* eslint-disable @typescript-eslint/no-unused-vars */ - paint(_unit, _date, _classes, _element) { - // implemented in plugin - } - /** - * Shows the picker and creates a Popper instance if needed. - * Add document click event to hide when clicking outside the picker. - * fires Events#show - */ - show() { - if (this.widget == undefined) { - this._showSetDefaultIfNeeded(); - this._buildWidget(); - this._updateTheme(); - this._showSetupViewMode(); - if (!this.optionsStore.options.display.inline) { - // If needed to change the parent container - const container = this.optionsStore.options?.container || document.body; - const placement = this.optionsStore.options?.display?.placement || 'bottom'; - container.appendChild(this.widget); - this.createPopup(this.optionsStore.element, this.widget, { - modifiers: [{ name: 'eventListeners', enabled: true }], - //#2400 - placement: document.documentElement.dir === 'rtl' - ? `${placement}-end` - : `${placement}-start`, - }).then(); - } - else { - this.optionsStore.element.appendChild(this.widget); - } - if (this.optionsStore.options.display.viewMode == 'clock') { - this._eventEmitters.action.emit({ - e: null, - action: ActionTypes$1.showClock, - }); - } - this.widget - .querySelectorAll('[data-action]') - .forEach((element) => element.addEventListener('click', this._actionsClickEvent)); - // show the clock when using sideBySide - if (this._hasTime && this.optionsStore.options.display.sideBySide) { - this.timeDisplay._update(this.widget); - this.widget.getElementsByClassName(Namespace.css.clockContainer)[0].style.display = 'grid'; - } - } - this.widget.classList.add(Namespace.css.show); - if (!this.optionsStore.options.display.inline) { - this.updatePopup(); - document.addEventListener('click', this._documentClickEvent); - } - this._eventEmitters.triggerEvent.emit({ type: Namespace.events.show }); - this._isVisible = true; - } - _showSetupViewMode() { - // If modeView is only clock - const onlyClock = this._hasTime && !this._hasDate; - // reset the view to the clock if there's no date components - if (onlyClock) { - this.optionsStore.currentView = 'clock'; - this._eventEmitters.action.emit({ - e: null, - action: ActionTypes$1.showClock, - }); - } - // otherwise return to the calendar view - else if (!this.optionsStore.currentCalendarViewMode) { - this.optionsStore.currentCalendarViewMode = - this.optionsStore.minimumCalendarViewMode; - } - if (!onlyClock && this.optionsStore.options.display.viewMode !== 'clock') { - if (this._hasTime) { - if (!this.optionsStore.options.display.sideBySide) { - Collapse.hideImmediately(this.timeContainer); - } - else { - Collapse.show(this.timeContainer); - } - } - Collapse.show(this.dateContainer); - } - if (this._hasDate) { - this._showMode(); - } - } - _showSetDefaultIfNeeded() { - if (this.dates.picked.length != 0) - return; - if (this.optionsStore.options.useCurrent && - !this.optionsStore.options.defaultDate) { - const date = new DateTime().setLocalization(this.optionsStore.options.localization); - if (!this.optionsStore.options.keepInvalid) { - let tries = 0; - let direction = 1; - if (this.optionsStore.options.restrictions.maxDate?.isBefore(date)) { - direction = -1; - } - while (!this.validation.isValid(date) && tries > 31) { - date.manipulate(direction, Unit.date); - tries++; - } - } - this.dates.setValue(date); - } - if (this.optionsStore.options.defaultDate) { - this.dates.setValue(this.optionsStore.options.defaultDate); - } - } - async createPopup(element, widget, - //eslint-disable-next-line @typescript-eslint/no-explicit-any - options) { - let createPopperFunction; - //eslint-disable-next-line @typescript-eslint/no-explicit-any - if (window?.Popper) { - //eslint-disable-next-line @typescript-eslint/no-explicit-any - createPopperFunction = window?.Popper?.createPopper; - } - else { - const { createPopper } = await import('@popperjs/core'); - createPopperFunction = createPopper; - } - if (createPopperFunction) { - this._popperInstance = createPopperFunction(element, widget, options); - } - } - updatePopup() { - this._popperInstance?.update(); - } - /** - * Changes the calendar view mode. E.g. month <-> year - * @param direction -/+ number to move currentViewMode - * @private - */ - _showMode(direction) { - if (!this.widget) { - return; - } - if (direction) { - const max = Math.max(this.optionsStore.minimumCalendarViewMode, Math.min(3, this.optionsStore.currentCalendarViewMode + direction)); - if (this.optionsStore.currentCalendarViewMode == max) - return; - this.optionsStore.currentCalendarViewMode = max; - } - this.widget - .querySelectorAll(`.${Namespace.css.dateContainer} > div:not(.${Namespace.css.calendarHeader}), .${Namespace.css.timeContainer} > div:not(.${Namespace.css.clockContainer})`) - .forEach((e) => (e.style.display = 'none')); - const datePickerMode = CalendarModes[this.optionsStore.currentCalendarViewMode]; - const picker = this.widget.querySelector(`.${datePickerMode.className}`); - switch (datePickerMode.className) { - case Namespace.css.decadesContainer: - this.decadeDisplay._update(this.widget, this.paint); - break; - case Namespace.css.yearsContainer: - this.yearDisplay._update(this.widget, this.paint); - break; - case Namespace.css.monthsContainer: - this.monthDisplay._update(this.widget, this.paint); - break; - case Namespace.css.daysContainer: - this.dateDisplay._update(this.widget, this.paint); - break; - } - picker.style.display = 'grid'; - if (this.optionsStore.options.display.sideBySide) - (this.widget.querySelectorAll(`.${Namespace.css.clockContainer}`)[0]).style.display = 'grid'; - this._updateCalendarHeader(); - this._eventEmitters.viewUpdate.emit(); - } - /** - * Changes the theme. E.g. light, dark or auto - * @param theme the theme name - * @private - */ - _updateTheme(theme) { - if (!this.widget) { - return; - } - if (theme) { - if (this.optionsStore.options.display.theme === theme) - return; - this.optionsStore.options.display.theme = theme; - } - this.widget.classList.remove('light', 'dark'); - this.widget.classList.add(this._getThemeClass()); - if (this.optionsStore.options.display.theme === 'auto') { - window - .matchMedia(Namespace.css.isDarkPreferredQuery) - .addEventListener('change', () => this._updateTheme()); - } - else { - window - .matchMedia(Namespace.css.isDarkPreferredQuery) - .removeEventListener('change', () => this._updateTheme()); - } - } - _getThemeClass() { - const currentTheme = this.optionsStore.options.display.theme || 'auto'; - const isDarkMode = window.matchMedia && - window.matchMedia(Namespace.css.isDarkPreferredQuery).matches; - switch (currentTheme) { - case 'light': - return Namespace.css.lightTheme; - case 'dark': - return Namespace.css.darkTheme; - case 'auto': - return isDarkMode ? Namespace.css.darkTheme : Namespace.css.lightTheme; - } - } - _updateCalendarHeader() { - if (!this._hasDate) - return; - const showing = [ - ...this.widget.querySelector(`.${Namespace.css.dateContainer} div[style*="display: grid"]`).classList, - ].find((x) => x.startsWith(Namespace.css.dateContainer)); - const [previous, switcher, next] = this.widget - .getElementsByClassName(Namespace.css.calendarHeader)[0] - .getElementsByTagName('div'); - switch (showing) { - case Namespace.css.decadesContainer: - previous.setAttribute('title', this.optionsStore.options.localization.previousCentury); - switcher.setAttribute('title', ''); - next.setAttribute('title', this.optionsStore.options.localization.nextCentury); - break; - case Namespace.css.yearsContainer: - previous.setAttribute('title', this.optionsStore.options.localization.previousDecade); - switcher.setAttribute('title', this.optionsStore.options.localization.selectDecade); - next.setAttribute('title', this.optionsStore.options.localization.nextDecade); - break; - case Namespace.css.monthsContainer: - previous.setAttribute('title', this.optionsStore.options.localization.previousYear); - switcher.setAttribute('title', this.optionsStore.options.localization.selectYear); - next.setAttribute('title', this.optionsStore.options.localization.nextYear); - break; - case Namespace.css.daysContainer: - previous.setAttribute('title', this.optionsStore.options.localization.previousMonth); - switcher.setAttribute('title', this.optionsStore.options.localization.selectMonth); - next.setAttribute('title', this.optionsStore.options.localization.nextMonth); - switcher.setAttribute(showing, this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat)); - break; - } - switcher.innerText = switcher.getAttribute(showing); - } - /** - * Hides the picker if needed. - * Remove document click event to hide when clicking outside the picker. - * fires Events#hide - */ - hide() { - if (!this.widget || !this._isVisible) - return; - this.widget.classList.remove(Namespace.css.show); - if (this._isVisible) { - this._eventEmitters.triggerEvent.emit({ - type: Namespace.events.hide, - date: this.optionsStore.unset ? null : this.dates.lastPicked?.clone, - }); - this._isVisible = false; - } - document.removeEventListener('click', this._documentClickEvent); - } - /** - * Toggles the picker's open state. Fires a show/hide event depending. - */ - toggle() { - return this._isVisible ? this.hide() : this.show(); - } - /** - * Removes document and data-action click listener and reset the widget - * @private - */ - _dispose() { - document.removeEventListener('click', this._documentClickEvent); - if (!this.widget) - return; - this.widget - .querySelectorAll('[data-action]') - .forEach((element) => element.removeEventListener('click', this._actionsClickEvent)); - this.widget.parentNode.removeChild(this.widget); - this._widget = undefined; - } - /** - * Builds the widgets html template. - * @private - */ - _buildWidget() { - const template = document.createElement('div'); - template.classList.add(Namespace.css.widget); - const dateView = document.createElement('div'); - dateView.classList.add(Namespace.css.dateContainer); - dateView.append(this.getHeadTemplate(), this.decadeDisplay.getPicker(), this.yearDisplay.getPicker(), this.monthDisplay.getPicker(), this.dateDisplay.getPicker()); - const timeView = document.createElement('div'); - timeView.classList.add(Namespace.css.timeContainer); - timeView.appendChild(this.timeDisplay.getPicker(this._iconTag.bind(this))); - timeView.appendChild(this.hourDisplay.getPicker()); - timeView.appendChild(this.minuteDisplay.getPicker()); - timeView.appendChild(this.secondDisplay.getPicker()); - const toolbar = document.createElement('div'); - toolbar.classList.add(Namespace.css.toolbar); - toolbar.append(...this.getToolbarElements()); - if (this.optionsStore.options.display.inline) { - template.classList.add(Namespace.css.inline); - } - if (this.optionsStore.options.display.calendarWeeks) { - template.classList.add('calendarWeeks'); - } - if (this.optionsStore.options.display.sideBySide && this._hasDateAndTime) { - this._buildWidgetSideBySide(template, dateView, timeView, toolbar); - return; - } - if (this.optionsStore.options.display.toolbarPlacement === 'top') { - template.appendChild(toolbar); - } - const setupComponentView = (hasFirst, hasSecond, element, shouldShow) => { - if (!hasFirst) - return; - if (hasSecond) { - element.classList.add(Namespace.css.collapse); - if (shouldShow) - element.classList.add(Namespace.css.show); - } - template.appendChild(element); - }; - setupComponentView(this._hasDate, this._hasTime, dateView, this.optionsStore.options.display.viewMode !== 'clock'); - setupComponentView(this._hasTime, this._hasDate, timeView, this.optionsStore.options.display.viewMode === 'clock'); - if (this.optionsStore.options.display.toolbarPlacement === 'bottom') { - template.appendChild(toolbar); - } - const arrow = document.createElement('div'); - arrow.classList.add('arrow'); - arrow.setAttribute('data-popper-arrow', ''); - template.appendChild(arrow); - this._widget = template; - } - _buildWidgetSideBySide(template, dateView, timeView, toolbar) { - template.classList.add(Namespace.css.sideBySide); - if (this.optionsStore.options.display.toolbarPlacement === 'top') { - template.appendChild(toolbar); - } - const row = document.createElement('div'); - row.classList.add('td-row'); - dateView.classList.add('td-half'); - timeView.classList.add('td-half'); - row.appendChild(dateView); - row.appendChild(timeView); - template.appendChild(row); - if (this.optionsStore.options.display.toolbarPlacement === 'bottom') { - template.appendChild(toolbar); - } - this._widget = template; - } - /** - * Returns true if the hours, minutes, or seconds component is turned on - */ - get _hasTime() { - return (this.optionsStore.options.display.components.clock && - (this.optionsStore.options.display.components.hours || - this.optionsStore.options.display.components.minutes || - this.optionsStore.options.display.components.seconds)); - } - /** - * Returns true if the year, month, or date component is turned on - */ - get _hasDate() { - return (this.optionsStore.options.display.components.calendar && - (this.optionsStore.options.display.components.year || - this.optionsStore.options.display.components.month || - this.optionsStore.options.display.components.date)); - } - get _hasDateAndTime() { - return this._hasDate && this._hasTime; - } - /** - * Get the toolbar html based on options like buttons => today - * @private - */ - getToolbarElements() { - const toolbar = []; - if (this.optionsStore.options.display.buttons.today) { - const div = document.createElement('div'); - div.setAttribute('data-action', ActionTypes$1.today); - div.setAttribute('title', this.optionsStore.options.localization.today); - div.appendChild(this._iconTag(this.optionsStore.options.display.icons.today)); - toolbar.push(div); - } - if (!this.optionsStore.options.display.sideBySide && - this._hasDate && - this._hasTime) { - let title, icon; - if (this.optionsStore.options.display.viewMode === 'clock') { - title = this.optionsStore.options.localization.selectDate; - icon = this.optionsStore.options.display.icons.date; - } - else { - title = this.optionsStore.options.localization.selectTime; - icon = this.optionsStore.options.display.icons.time; - } - const div = document.createElement('div'); - div.setAttribute('data-action', ActionTypes$1.togglePicker); - div.setAttribute('title', title); - div.appendChild(this._iconTag(icon)); - toolbar.push(div); - } - if (this.optionsStore.options.display.buttons.clear) { - const div = document.createElement('div'); - div.setAttribute('data-action', ActionTypes$1.clear); - div.setAttribute('title', this.optionsStore.options.localization.clear); - div.appendChild(this._iconTag(this.optionsStore.options.display.icons.clear)); - toolbar.push(div); - } - if (this.optionsStore.options.display.buttons.close) { - const div = document.createElement('div'); - div.setAttribute('data-action', ActionTypes$1.close); - div.setAttribute('title', this.optionsStore.options.localization.close); - div.appendChild(this._iconTag(this.optionsStore.options.display.icons.close)); - toolbar.push(div); - } - return toolbar; - } - /*** - * Builds the base header template with next and previous icons - * @private - */ - getHeadTemplate() { - const calendarHeader = document.createElement('div'); - calendarHeader.classList.add(Namespace.css.calendarHeader); - const previous = document.createElement('div'); - previous.classList.add(Namespace.css.previous); - previous.setAttribute('data-action', ActionTypes$1.previous); - previous.appendChild(this._iconTag(this.optionsStore.options.display.icons.previous)); - const switcher = document.createElement('div'); - switcher.classList.add(Namespace.css.switch); - switcher.setAttribute('data-action', ActionTypes$1.changeCalendarView); - const next = document.createElement('div'); - next.classList.add(Namespace.css.next); - next.setAttribute('data-action', ActionTypes$1.next); - next.appendChild(this._iconTag(this.optionsStore.options.display.icons.next)); - calendarHeader.append(previous, switcher, next); - return calendarHeader; - } - /** - * Builds an icon tag as either an `` - * or with icons => type is `sprites` then a svg tag instead - * @param iconClass - * @private - */ - _iconTag(iconClass) { - if (this.optionsStore.options.display.icons.type === 'sprites') { - const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); - const icon = document.createElementNS('http://www.w3.org/2000/svg', 'use'); - icon.setAttribute('xlink:href', iconClass); // Deprecated. Included for backward compatibility - icon.setAttribute('href', iconClass); - svg.appendChild(icon); - return svg; - } - const icon = document.createElement('i'); - icon.classList.add(...iconClass.split(' ')); - return icon; - } - /** - * Causes the widget to get rebuilt on next show. If the picker is already open - * then hide and reshow it. - * @private - */ - _rebuild() { - const wasVisible = this._isVisible; - this._dispose(); - if (wasVisible) - this.show(); - } - refreshCurrentView() { - //if the widget is not showing, just destroy it - if (!this._isVisible) - this._dispose(); - switch (this.optionsStore.currentView) { - case 'clock': - this._update('clock'); - break; - case 'calendar': - this._update(Unit.date); - break; - case 'months': - this._update(Unit.month); - break; - case 'years': - this._update(Unit.year); - break; - case 'decades': - this._update('decade'); - break; - } - } -} - -/** - * Logic for various click actions - */ -class Actions { - constructor() { - this.optionsStore = serviceLocator.locate(OptionsStore); - this.dates = serviceLocator.locate(Dates); - this.validation = serviceLocator.locate(Validation); - this.display = serviceLocator.locate(Display); - this._eventEmitters = serviceLocator.locate(EventEmitters); - this._eventEmitters.action.subscribe((result) => { - this.do(result.e, result.action); - }); - } - /** - * Performs the selected `action`. See ActionTypes - * @param e This is normally a click event - * @param action If not provided, then look for a [data-action] - */ - //eslint-disable-next-line @typescript-eslint/no-explicit-any - do(e, action) { - const currentTarget = e?.currentTarget; - if (currentTarget?.classList?.contains(Namespace.css.disabled)) - return; - action = action || currentTarget?.dataset?.action; - const lastPicked = (this.dates.lastPicked || this.optionsStore.viewDate) - .clone; - switch (action) { - case ActionTypes$1.next: - case ActionTypes$1.previous: - this.handleNextPrevious(action); - break; - case ActionTypes$1.changeCalendarView: - this.display._showMode(1); - this.display._updateCalendarHeader(); - break; - case ActionTypes$1.selectMonth: - case ActionTypes$1.selectYear: - case ActionTypes$1.selectDecade: - this.handleSelectCalendarMode(action, currentTarget); - break; - case ActionTypes$1.selectDay: - this.handleSelectDay(currentTarget); - break; - case ActionTypes$1.selectHour: { - let hour = +currentTarget.dataset.value; - if (lastPicked.hours >= 12 && this.optionsStore.isTwelveHour) - hour += 12; - lastPicked.hours = hour; - this.dates.setValue(lastPicked, this.dates.lastPickedIndex); - this.hideOrClock(e); - break; - } - case ActionTypes$1.selectMinute: { - lastPicked.minutes = +currentTarget.dataset.value; - this.dates.setValue(lastPicked, this.dates.lastPickedIndex); - this.hideOrClock(e); - break; - } - case ActionTypes$1.selectSecond: { - lastPicked.seconds = +currentTarget.dataset.value; - this.dates.setValue(lastPicked, this.dates.lastPickedIndex); - this.hideOrClock(e); - break; - } - case ActionTypes$1.incrementHours: - this.manipulateAndSet(lastPicked, Unit.hours); - break; - case ActionTypes$1.incrementMinutes: - this.manipulateAndSet(lastPicked, Unit.minutes, this.optionsStore.options.stepping); - break; - case ActionTypes$1.incrementSeconds: - this.manipulateAndSet(lastPicked, Unit.seconds); - break; - case ActionTypes$1.decrementHours: - this.manipulateAndSet(lastPicked, Unit.hours, -1); - break; - case ActionTypes$1.decrementMinutes: - this.manipulateAndSet(lastPicked, Unit.minutes, this.optionsStore.options.stepping * -1); - break; - case ActionTypes$1.decrementSeconds: - this.manipulateAndSet(lastPicked, Unit.seconds, -1); - break; - case ActionTypes$1.toggleMeridiem: - this.manipulateAndSet(lastPicked, Unit.hours, this.dates.lastPicked.hours >= 12 ? -12 : 12); - break; - case ActionTypes$1.togglePicker: - this.handleToggle(currentTarget); - break; - case ActionTypes$1.showClock: - case ActionTypes$1.showHours: - case ActionTypes$1.showMinutes: - case ActionTypes$1.showSeconds: - //make sure the clock is actually displaying - if (!this.optionsStore.options.display.sideBySide && - this.optionsStore.currentView !== 'clock') { - //hide calendar - Collapse.hideImmediately(this.display.dateContainer); - //show clock - Collapse.showImmediately(this.display.timeContainer); - } - this.handleShowClockContainers(action); - break; - case ActionTypes$1.clear: - this.dates.setValue(null); - this.display._updateCalendarHeader(); - break; - case ActionTypes$1.close: - this.display.hide(); - break; - case ActionTypes$1.today: { - const today = new DateTime().setLocalization(this.optionsStore.options.localization); - this._eventEmitters.updateViewDate.emit(today); - //todo this this really a good idea? - if (this.validation.isValid(today, Unit.date)) - this.dates.setValue(today, this.dates.lastPickedIndex); - break; - } - } - } - handleShowClockContainers(action) { - if (!this.display._hasTime) { - Namespace.errorMessages.throwError('Cannot show clock containers when time is disabled.'); - /* ignore coverage: should never happen */ - return; - } - this.optionsStore.currentView = 'clock'; - this.display.widget - .querySelectorAll(`.${Namespace.css.timeContainer} > div`) - .forEach((htmlElement) => (htmlElement.style.display = 'none')); - let classToUse = ''; - switch (action) { - case ActionTypes$1.showClock: - classToUse = Namespace.css.clockContainer; - this.display._update('clock'); - break; - case ActionTypes$1.showHours: - classToUse = Namespace.css.hourContainer; - this.display._update(Unit.hours); - break; - case ActionTypes$1.showMinutes: - classToUse = Namespace.css.minuteContainer; - this.display._update(Unit.minutes); - break; - case ActionTypes$1.showSeconds: - classToUse = Namespace.css.secondContainer; - this.display._update(Unit.seconds); - break; - } - (this.display.widget.getElementsByClassName(classToUse)[0]).style.display = 'grid'; - } - handleNextPrevious(action) { - const { unit, step } = CalendarModes[this.optionsStore.currentCalendarViewMode]; - if (action === ActionTypes$1.next) - this.optionsStore.viewDate.manipulate(step, unit); - else - this.optionsStore.viewDate.manipulate(step * -1, unit); - this._eventEmitters.viewUpdate.emit(); - this.display._showMode(); - } - /** - * After setting the value it will either show the clock or hide the widget. - * @param e - */ - hideOrClock(e) { - if (!this.optionsStore.isTwelveHour && - !this.optionsStore.options.display.components.minutes && - !this.optionsStore.options.display.keepOpen && - !this.optionsStore.options.display.inline) { - this.display.hide(); - } - else { - this.do(e, ActionTypes$1.showClock); - } - } - /** - * Common function to manipulate {@link lastPicked} by `unit`. - * @param lastPicked - * @param unit - * @param value Value to change by - */ - manipulateAndSet(lastPicked, unit, value = 1) { - const newDate = lastPicked.manipulate(value, unit); - if (this.validation.isValid(newDate, unit)) { - this.dates.setValue(newDate, this.dates.lastPickedIndex); - } - } - handleSelectCalendarMode(action, currentTarget) { - const value = +currentTarget.dataset.value; - switch (action) { - case ActionTypes$1.selectMonth: - this.optionsStore.viewDate.month = value; - break; - case ActionTypes$1.selectYear: - case ActionTypes$1.selectDecade: - this.optionsStore.viewDate.year = value; - break; - } - if (this.optionsStore.currentCalendarViewMode === - this.optionsStore.minimumCalendarViewMode) { - this.dates.setValue(this.optionsStore.viewDate, this.dates.lastPickedIndex); - if (!this.optionsStore.options.display.inline) { - this.display.hide(); - } - } - else { - this.display._showMode(-1); - } - } - handleToggle(currentTarget) { - if (currentTarget.getAttribute('title') === - this.optionsStore.options.localization.selectDate) { - currentTarget.setAttribute('title', this.optionsStore.options.localization.selectTime); - currentTarget.innerHTML = this.display._iconTag(this.optionsStore.options.display.icons.time).outerHTML; - this.display._updateCalendarHeader(); - this.optionsStore.refreshCurrentView(); - } - else { - currentTarget.setAttribute('title', this.optionsStore.options.localization.selectDate); - currentTarget.innerHTML = this.display._iconTag(this.optionsStore.options.display.icons.date).outerHTML; - if (this.display._hasTime) { - this.handleShowClockContainers(ActionTypes$1.showClock); - this.display._update('clock'); - } - } - this.display.widget - .querySelectorAll(`.${Namespace.css.dateContainer}, .${Namespace.css.timeContainer}`) - .forEach((htmlElement) => Collapse.toggle(htmlElement)); - this._eventEmitters.viewUpdate.emit(); - } - handleSelectDay(currentTarget) { - const day = this.optionsStore.viewDate.clone; - if (currentTarget.classList.contains(Namespace.css.old)) { - day.manipulate(-1, Unit.month); - } - if (currentTarget.classList.contains(Namespace.css.new)) { - day.manipulate(1, Unit.month); - } - day.date = +currentTarget.dataset.day; - if (this.optionsStore.options.dateRange) - this.handleDateRange(day); - else if (this.optionsStore.options.multipleDates) { - this.handleMultiDate(day); - } - else { - this.dates.setValue(day, this.dates.lastPickedIndex); - } - if (!this.display._hasTime && - !this.optionsStore.options.display.keepOpen && - !this.optionsStore.options.display.inline && - !this.optionsStore.options.multipleDates && - !this.optionsStore.options.dateRange) { - this.display.hide(); - } - } - handleMultiDate(day) { - let index = this.dates.pickedIndex(day, Unit.date); - console.log(index); - if (index !== -1) { - this.dates.setValue(null, index); //deselect multi-date - } - else { - index = this.dates.lastPickedIndex + 1; - if (this.dates.picked.length === 0) - index = 0; - this.dates.setValue(day, index); - } - } - handleDateRange(day) { - switch (this.dates.picked.length) { - case 2: { - this.dates.clear(); - break; - } - case 1: { - const other = this.dates.picked[0]; - if (day.getTime() === other.getTime()) { - this.dates.clear(); - break; - } - if (day.isBefore(other)) { - this.dates.setValue(day, 0); - this.dates.setValue(other, 1); - return; - } - else { - this.dates.setValue(day, 1); - return; - } - } - } - this.dates.setValue(day, 0); - } -} - -/** - * A robust and powerful date/time picker component. - */ -class TempusDominus { - constructor(element, options = {}) { - //eslint-disable-next-line @typescript-eslint/no-explicit-any - this._subscribers = {}; - this._isDisabled = false; - /** - * Event for when the input field changes. This is a class level method so there's - * something for the remove listener function. - * @private - */ - //eslint-disable-next-line @typescript-eslint/no-explicit-any - this._inputChangeEvent = (event) => { - const internallyTriggered = event?.detail; - if (internallyTriggered) - return; - const setViewDate = () => { - if (this.dates.lastPicked) - this.optionsStore.viewDate = this.dates.lastPicked.clone; - }; - const value = this.optionsStore.input.value; - if (this.optionsStore.options.multipleDates || - this.optionsStore.options.dateRange) { - try { - const valueSplit = value.split(this.optionsStore.options.multipleDatesSeparator); - for (let i = 0; i < valueSplit.length; i++) { - this.dates.setFromInput(valueSplit[i], i); - } - setViewDate(); - } - catch { - console.warn('TD: Something went wrong trying to set the multipleDates values from the input field.'); - } - } - else { - this.dates.setFromInput(value, 0); - setViewDate(); - } - }; - /** - * Event for when the toggle is clicked. This is a class level method so there's - * something for the remove listener function. - * @private - */ - this._toggleClickEvent = () => { - if (this.optionsStore.element?.disabled || - this.optionsStore.input?.disabled || - //if we just have the input and allow input toggle is enabled, then don't cause a toggle - (this._toggle.nodeName === 'INPUT' && - this._toggle?.type === 'text' && - this.optionsStore.options.allowInputToggle)) - return; - this.toggle(); - }; - /** - * Event for when the toggle is clicked. This is a class level method so there's - * something for the remove listener function. - * @private - */ - this._openClickEvent = () => { - if (this.optionsStore.element?.disabled || - this.optionsStore.input?.disabled) - return; - if (!this.display.isVisible) - this.show(); - }; - setupServiceLocator(); - this._eventEmitters = serviceLocator.locate(EventEmitters); - this.optionsStore = serviceLocator.locate(OptionsStore); - this.display = serviceLocator.locate(Display); - this.dates = serviceLocator.locate(Dates); - this.actions = serviceLocator.locate(Actions); - if (!element) { - Namespace.errorMessages.mustProvideElement(); - } - this.optionsStore.element = element; - this._initializeOptions(options, DefaultOptions, true); - this.optionsStore.viewDate.setLocalization(this.optionsStore.options.localization); - this.optionsStore.unset = true; - this._initializeInput(); - this._initializeToggle(); - if (this.optionsStore.options.display.inline) - this.display.show(); - this._eventEmitters.triggerEvent.subscribe((e) => { - this._triggerEvent(e); - }); - this._eventEmitters.viewUpdate.subscribe(() => { - this._viewUpdate(); - }); - this._eventEmitters.updateViewDate.subscribe((dateTime) => { - this.viewDate = dateTime; - }); - } - get viewDate() { - return this.optionsStore.viewDate; - } - set viewDate(value) { - this.optionsStore.viewDate = value; - this.optionsStore.viewDate.setLocalization(this.optionsStore.options.localization); - this.display._update(this.optionsStore.currentView === 'clock' ? 'clock' : 'calendar'); - } - // noinspection JSUnusedGlobalSymbols - /** - * Update the picker options. If `reset` is provide `options` will be merged with DefaultOptions instead. - * @param options - * @param reset - * @public - */ - updateOptions(options, reset = false) { - if (reset) - this._initializeOptions(options, DefaultOptions); - else - this._initializeOptions(options, this.optionsStore.options); - this.optionsStore.viewDate.setLocalization(this.optionsStore.options.localization); - this.display.refreshCurrentView(); - } - // noinspection JSUnusedGlobalSymbols - /** - * Toggles the picker open or closed. If the picker is disabled, nothing will happen. - * @public - */ - toggle() { - if (this._isDisabled) - return; - this.display.toggle(); - } - // noinspection JSUnusedGlobalSymbols - /** - * Shows the picker unless the picker is disabled. - * @public - */ - show() { - if (this._isDisabled) - return; - this.display.show(); - } - // noinspection JSUnusedGlobalSymbols - /** - * Hides the picker unless the picker is disabled. - * @public - */ - hide() { - this.display.hide(); - } - // noinspection JSUnusedGlobalSymbols - /** - * Disables the picker and the target input field. - * @public - */ - disable() { - this._isDisabled = true; - // todo this might be undesired. If a dev disables the input field to - // only allow using the picker, this will break that. - this.optionsStore.input?.setAttribute('disabled', 'disabled'); - this.display.hide(); - } - // noinspection JSUnusedGlobalSymbols - /** - * Enables the picker and the target input field. - * @public - */ - enable() { - this._isDisabled = false; - this.optionsStore.input?.removeAttribute('disabled'); - } - // noinspection JSUnusedGlobalSymbols - /** - * Clears all the selected dates - * @public - */ - clear() { - this.optionsStore.input.value = ''; - this.dates.clear(); - } - // noinspection JSUnusedGlobalSymbols - /** - * Allows for a direct subscription to picker events, without having to use addEventListener on the element. - * @param eventTypes See Namespace.Events - * @param callbacks Function to call when event is triggered - * @public - */ - subscribe(eventTypes, callbacks //eslint-disable-line @typescript-eslint/no-explicit-any - ) { - if (typeof eventTypes === 'string') { - eventTypes = [eventTypes]; - } - let callBackArray; //eslint-disable-line @typescript-eslint/no-explicit-any - if (!Array.isArray(callbacks)) { - callBackArray = [callbacks]; - } - else { - callBackArray = callbacks; - } - if (eventTypes.length !== callBackArray.length) { - Namespace.errorMessages.subscribeMismatch(); - } - const returnArray = []; - for (let i = 0; i < eventTypes.length; i++) { - const eventType = eventTypes[i]; - if (!Array.isArray(this._subscribers[eventType])) { - this._subscribers[eventType] = []; - } - this._subscribers[eventType].push(callBackArray[i]); - returnArray.push({ - unsubscribe: this._unsubscribe.bind(this, eventType, this._subscribers[eventType].length - 1), - }); - if (eventTypes.length === 1) { - return returnArray[0]; - } - } - return returnArray; - } - // noinspection JSUnusedGlobalSymbols - /** - * Hides the picker and removes event listeners - */ - dispose() { - this.display.hide(); - // this will clear the document click event listener - this.display._dispose(); - this._eventEmitters.destroy(); - this.optionsStore.input?.removeEventListener('change', this._inputChangeEvent); - if (this.optionsStore.options.allowInputToggle) { - this.optionsStore.input?.removeEventListener('click', this._openClickEvent); - this.optionsStore.input?.removeEventListener('focus', this._openClickEvent); - } - this._toggle?.removeEventListener('click', this._toggleClickEvent); - this._subscribers = {}; - } - /** - * Updates the options to use the provided language. - * THe language file must be loaded first. - * @param language - */ - locale(language) { - const asked = loadedLocales[language]; - if (!asked) - return; - this.updateOptions({ - localization: asked, - }); - } - /** - * Triggers an event like ChangeEvent when the picker has updated the value - * of a selected date. - * @param event Accepts a BaseEvent object. - * @private - */ - _triggerEvent(event) { - event.viewMode = this.optionsStore.currentView; - const isChangeEvent = event.type === Namespace.events.change; - if (isChangeEvent) { - const { date, oldDate, isClear } = event; - if ((date && oldDate && date.isSame(oldDate)) || - (!isClear && !date && !oldDate)) { - return; - } - this._handleAfterChangeEvent(event); - this.optionsStore.input?.dispatchEvent( - //eslint-disable-next-line @typescript-eslint/no-explicit-any - new CustomEvent('change', { detail: event })); - } - this.optionsStore.element.dispatchEvent( - //eslint-disable-next-line @typescript-eslint/no-explicit-any - new CustomEvent(event.type, { detail: event })); - //eslint-disable-next-line @typescript-eslint/no-explicit-any - if (window.jQuery) { - //eslint-disable-next-line @typescript-eslint/no-explicit-any - const $ = window.jQuery; - if (isChangeEvent && this.optionsStore.input) { - $(this.optionsStore.input).trigger(event); - } - else { - $(this.optionsStore.element).trigger(event); - } - } - this._publish(event); - } - _publish(event) { - // return if event is not subscribed - if (!Array.isArray(this._subscribers[event.type])) { - return; - } - // Trigger callback for each subscriber - this._subscribers[event.type].forEach((callback) => { - callback(event); - }); - } - /** - * Fires a ViewUpdate event when, for example, the month view is changed. - * @private - */ - _viewUpdate() { - this._triggerEvent({ - type: Namespace.events.update, - viewDate: this.optionsStore.viewDate.clone, - }); - } - _unsubscribe(eventName, index) { - this._subscribers[eventName].splice(index, 1); - } - /** - * Merges two Option objects together and validates options type - * @param config new Options - * @param mergeTo Options to merge into - * @param includeDataset When true, the elements data-td attributes will be included in the - * @private - */ - _initializeOptions(config, mergeTo, includeDataset = false) { - let newConfig = OptionConverter.deepCopy(config); - newConfig = OptionConverter._mergeOptions(newConfig, mergeTo); - if (includeDataset) - newConfig = OptionConverter._dataToOptions(this.optionsStore.element, newConfig); - OptionConverter._validateConflicts(newConfig); - newConfig.viewDate = newConfig.viewDate.setLocalization(newConfig.localization); - if (!this.optionsStore.viewDate.isSame(newConfig.viewDate)) { - this.optionsStore.viewDate = newConfig.viewDate; - } - /** - * Sets the minimum view allowed by the picker. For example the case of only - * allowing year and month to be selected but not date. - */ - if (newConfig.display.components.year) { - this.optionsStore.minimumCalendarViewMode = 2; - } - if (newConfig.display.components.month) { - this.optionsStore.minimumCalendarViewMode = 1; - } - if (newConfig.display.components.date) { - this.optionsStore.minimumCalendarViewMode = 0; - } - this.optionsStore.currentCalendarViewMode = Math.max(this.optionsStore.minimumCalendarViewMode, this.optionsStore.currentCalendarViewMode); - // Update view mode if needed - if (CalendarModes[this.optionsStore.currentCalendarViewMode].name !== - newConfig.display.viewMode) { - this.optionsStore.currentCalendarViewMode = Math.max(CalendarModes.findIndex((x) => x.name === newConfig.display.viewMode), this.optionsStore.minimumCalendarViewMode); - } - if (this.display?.isVisible) { - this.display._update('all'); - } - if (newConfig.display.components.useTwentyfourHour && - newConfig.localization.hourCycle === undefined) - newConfig.localization.hourCycle = 'h24'; - else if (newConfig.localization.hourCycle === undefined) { - newConfig.localization.hourCycle = guessHourCycle(newConfig.localization.locale); - } - this.optionsStore.options = newConfig; - if (newConfig.restrictions.maxDate && - this.viewDate.isAfter(newConfig.restrictions.maxDate)) - this.viewDate = newConfig.restrictions.maxDate; - if (newConfig.restrictions.minDate && - this.viewDate.isBefore(newConfig.restrictions.minDate)) - this.viewDate = newConfig.restrictions.minDate; - } - /** - * Checks if an input field is being used, attempts to locate one and sets an - * event listener if found. - * @private - */ - _initializeInput() { - if (this.optionsStore.element.tagName == 'INPUT') { - this.optionsStore.input = this.optionsStore.element; - } - else { - const query = this.optionsStore.element.dataset.tdTargetInput; - if (query == undefined || query == 'nearest') { - this.optionsStore.input = - this.optionsStore.element.querySelector('input'); - } - else { - this.optionsStore.input = - this.optionsStore.element.querySelector(query); - } - } - if (!this.optionsStore.input) - return; - if (!this.optionsStore.input.value && this.optionsStore.options.defaultDate) - this.optionsStore.input.value = this.dates.formatInput(this.optionsStore.options.defaultDate); - this.optionsStore.input.addEventListener('change', this._inputChangeEvent); - if (this.optionsStore.options.allowInputToggle) { - this.optionsStore.input.addEventListener('click', this._openClickEvent); - this.optionsStore.input.addEventListener('focus', this._openClickEvent); - } - if (this.optionsStore.input.value) { - this._inputChangeEvent(); - } - } - /** - * Attempts to locate a toggle for the picker and sets an event listener - * @private - */ - _initializeToggle() { - if (this.optionsStore.options.display.inline) - return; - let query = this.optionsStore.element.dataset.tdTargetToggle; - if (query == 'nearest') { - query = '[data-td-toggle="datetimepicker"]'; - } - this._toggle = - query == undefined - ? this.optionsStore.element - : this.optionsStore.element.querySelector(query); - this._toggle.addEventListener('click', this._toggleClickEvent); - } - /** - * If the option is enabled this will render the clock view after a date pick. - * @param e change event - * @private - */ - _handleAfterChangeEvent(e) { - if ( - // options is disabled - !this.optionsStore.options.promptTimeOnDateChange || - this.optionsStore.options.multipleDates || - this.optionsStore.options.display.inline || - this.optionsStore.options.display.sideBySide || - // time is disabled - !this.display._hasTime || - // clock component is already showing - this.display.widget - ?.getElementsByClassName(Namespace.css.show)[0] - .classList.contains(Namespace.css.timeContainer)) - return; - // First time ever. If useCurrent option is set to true (default), do nothing - // because the first date is selected automatically. - // or date didn't change (time did) or date changed because time did. - if ((!e.oldDate && this.optionsStore.options.useCurrent) || - (e.oldDate && e.date?.isSame(e.oldDate))) { - return; - } - clearTimeout(this._currentPromptTimeTimeout); - this._currentPromptTimeTimeout = setTimeout(() => { - if (this.display.widget) { - this._eventEmitters.action.emit({ - e: { - currentTarget: this.display.widget.querySelector('[data-action="togglePicker"]'), - }, - action: ActionTypes$1.togglePicker, - }); - } - }, this.optionsStore.options.promptTimeOnDateChangeTransitionDelay); - } -} -/** - * Whenever a locale is loaded via a plugin then store it here based on the - * locale name. E.g. loadedLocales['ru'] - */ -const loadedLocales = {}; -// noinspection JSUnusedGlobalSymbols -/** - * Called from a locale plugin. - * @param l locale object for localization options - */ -const loadLocale = (l) => { - if (loadedLocales[l.name]) - return; - loadedLocales[l.name] = l.localization; -}; -/** - * A sets the global localization options to the provided locale name. - * `loadLocale` MUST be called first. - * @param l - */ -const locale = (l) => { - const asked = loadedLocales[l]; - if (!asked) - return; - DefaultOptions.localization = asked; -}; -// noinspection JSUnusedGlobalSymbols -/** - * Called from a plugin to extend or override picker defaults. - * @param plugin - * @param option - */ -const extend = function (plugin, option = undefined) { - if (!plugin) - return tempusDominus; - if (!plugin.installed) { - // install plugin only once - plugin(option, { TempusDominus, Dates, Display, DateTime, Namespace }, tempusDominus); - plugin.installed = true; - } - return tempusDominus; -}; -const version = '6.7.19'; -const tempusDominus = { - TempusDominus, - extend, - loadLocale, - locale, - Namespace, - DefaultOptions, - DateTime, - Unit, - version, - DefaultEnLocalization, -}; - -export { DateTime, DefaultEnLocalization, DefaultOptions, Namespace, TempusDominus, Unit, extend, loadLocale, locale, version }; -//# sourceMappingURL=tempus-dominus.esm.js.map diff --git a/node_modules/@eonasdan/tempus-dominus/dist/js/tempus-dominus.esm.js.map b/node_modules/@eonasdan/tempus-dominus/dist/js/tempus-dominus.esm.js.map deleted file mode 100644 index 4e51d2a..0000000 --- a/node_modules/@eonasdan/tempus-dominus/dist/js/tempus-dominus.esm.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tempus-dominus.esm.js","sources":["../../src/js/utilities/errors.ts","../../src/js/utilities/namespace.ts","../../src/js/utilities/default-format-localization.ts","../../src/js/datetime.ts","../../src/js/utilities/service-locator.ts","../../src/js/utilities/calendar-modes.ts","../../src/js/utilities/optionsStore.ts","../../src/js/validation.ts","../../src/js/utilities/event-emitter.ts","../../src/js/utilities/default-options.ts","../../src/js/utilities/typeChecker.ts","../../src/js/utilities/optionProcessor.ts","../../src/js/utilities/optionConverter.ts","../../src/js/dates.ts","../../src/js/utilities/action-types.ts","../../src/js/display/calendar/date-display.ts","../../src/js/display/calendar/month-display.ts","../../src/js/display/calendar/year-display.ts","../../src/js/display/calendar/decade-display.ts","../../src/js/display/time/time-display.ts","../../src/js/display/time/hour-display.ts","../../src/js/display/time/minute-display.ts","../../src/js/display/time/second-display.ts","../../src/js/display/collapse.ts","../../src/js/display/index.ts","../../src/js/actions.ts","../../src/js/tempus-dominus.ts"],"sourcesContent":["export class TdError extends Error {\n code: number;\n}\n\nexport class ErrorMessages {\n private base = 'TD:';\n\n //#region out to console\n\n /**\n * Throws an error indicating that a key in the options object is invalid.\n * @param optionName\n */\n unexpectedOption(optionName: string) {\n const error = new TdError(\n `${this.base} Unexpected option: ${optionName} does not match a known option.`\n );\n error.code = 1;\n throw error;\n }\n\n /**\n * Throws an error indicating that one more keys in the options object is invalid.\n * @param optionName\n */\n unexpectedOptions(optionName: string[]) {\n const error = new TdError(`${this.base}: ${optionName.join(', ')}`);\n error.code = 1;\n throw error;\n }\n\n /**\n * Throws an error when an option is provide an unsupported value.\n * For example a value of 'cheese' for toolbarPlacement which only supports\n * 'top', 'bottom', 'default'.\n * @param optionName\n * @param badValue\n * @param validOptions\n */\n unexpectedOptionValue(\n optionName: string,\n badValue: string,\n validOptions: string[]\n ) {\n const error = new TdError(\n `${\n this.base\n } Unexpected option value: ${optionName} does not accept a value of \"${badValue}\". Valid values are: ${validOptions.join(\n ', '\n )}`\n );\n error.code = 2;\n throw error;\n }\n\n /**\n * Throws an error when an option value is the wrong type.\n * For example a string value was provided to multipleDates which only\n * supports true or false.\n * @param optionName\n * @param badType\n * @param expectedType\n */\n typeMismatch(optionName: string, badType: string, expectedType: string) {\n const error = new TdError(\n `${this.base} Mismatch types: ${optionName} has a type of ${badType} instead of the required ${expectedType}`\n );\n error.code = 3;\n throw error;\n }\n\n /**\n * Throws an error when an option value is outside of the expected range.\n * For example restrictions.daysOfWeekDisabled excepts a value between 0 and 6.\n * @param optionName\n * @param lower\n * @param upper\n */\n numbersOutOfRange(optionName: string, lower: number, upper: number) {\n const error = new TdError(\n `${this.base} ${optionName} expected an array of number between ${lower} and ${upper}.`\n );\n error.code = 4;\n throw error;\n }\n\n /**\n * Throws an error when a value for a date options couldn't be parsed. Either\n * the option was an invalid string or an invalid Date object.\n * @param optionName\n * @param date\n * @param soft If true, logs a warning instead of an error.\n */\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n failedToParseDate(optionName: string, date: any, soft = false) {\n const error = new TdError(\n `${this.base} Could not correctly parse \"${date}\" to a date for ${optionName}.`\n );\n error.code = 5;\n if (!soft) throw error;\n console.warn(error);\n }\n\n /**\n * Throws when an element to attach to was not provided in the constructor.\n */\n mustProvideElement() {\n const error = new TdError(`${this.base} No element was provided.`);\n error.code = 6;\n throw error;\n }\n\n /**\n * Throws if providing an array for the events to subscribe method doesn't have\n * the same number of callbacks. E.g., subscribe([1,2], [1])\n */\n subscribeMismatch() {\n const error = new TdError(\n `${this.base} The subscribed events does not match the number of callbacks`\n );\n error.code = 7;\n throw error;\n }\n\n /**\n * Throws if the configuration has conflicting rules e.g. minDate is after maxDate\n */\n conflictingConfiguration(message?: string) {\n const error = new TdError(\n `${this.base} A configuration value conflicts with another rule. ${message}`\n );\n error.code = 8;\n throw error;\n }\n\n /**\n * customDateFormat errors\n */\n customDateFormatError(message?: string) {\n const error = new TdError(`${this.base} Custom Date Format: ${message}`);\n error.code = 9;\n throw error;\n }\n\n /**\n * Logs a warning if a date option value is provided as a string, instead of\n * a date/datetime object.\n */\n dateString() {\n console.warn(\n `${this.base} Using a string for date options is not recommended unless you specify an ISO string or use the customDateFormat plugin.`\n );\n }\n\n deprecatedWarning(message: string, remediation?: string) {\n console.warn(\n `${this.base} Warning ${message} is deprecated and will be removed in a future version. ${remediation}`\n );\n }\n\n throwError(message) {\n const error = new TdError(`${this.base} ${message}`);\n error.code = 9;\n throw error;\n }\n\n //#endregion\n\n //#region used with notify.error\n\n /**\n * Used with an Error Event type if the user selects a date that\n * fails restriction validation.\n */\n failedToSetInvalidDate = 'Failed to set invalid date';\n\n /**\n * Used with an Error Event type when a user changes the value of the\n * input field directly, and does not provide a valid date.\n */\n failedToParseInput = 'Failed parse input field';\n\n //#endregion\n}\n","import { ErrorMessages } from './errors';\n// this is not the way I want this to stay but nested classes seemed to blown up once its compiled.\nconst NAME = 'tempus-dominus',\n dataKey = 'td';\n\n/**\n * Events\n */\nclass Events {\n key = `.${dataKey}`;\n\n /**\n * Change event. Fired when the user selects a date.\n * See also EventTypes.ChangeEvent\n */\n change = `change${this.key}`;\n\n /**\n * Emit when the view changes for example from month view to the year view.\n * See also EventTypes.ViewUpdateEvent\n */\n update = `update${this.key}`;\n\n /**\n * Emits when a selected date or value from the input field fails to meet the provided validation rules.\n * See also EventTypes.FailEvent\n */\n error = `error${this.key}`;\n\n /**\n * Show event\n * @event Events#show\n */\n show = `show${this.key}`;\n\n /**\n * Hide event\n * @event Events#hide\n */\n hide = `hide${this.key}`;\n\n // blur and focus are used in the jQuery provider but are otherwise unused.\n // keyup/down will be used later for keybinding options\n\n blur = `blur${this.key}`;\n focus = `focus${this.key}`;\n keyup = `keyup${this.key}`;\n keydown = `keydown${this.key}`;\n}\n\nclass Css {\n /**\n * The outer element for the widget.\n */\n widget = `${NAME}-widget`;\n\n /**\n * Hold the previous, next and switcher divs\n */\n calendarHeader = 'calendar-header';\n\n /**\n * The element for the action to change the calendar view. E.g. month -> year.\n */\n switch = 'picker-switch';\n\n /**\n * The elements for all the toolbar options\n */\n toolbar = 'toolbar';\n\n /**\n * Disables the hover and rounding affect.\n */\n noHighlight = 'no-highlight';\n\n /**\n * Applied to the widget element when the side by side option is in use.\n */\n sideBySide = 'timepicker-sbs';\n\n /**\n * The element for the action to change the calendar view, e.g. August -> July\n */\n previous = 'previous';\n\n /**\n * The element for the action to change the calendar view, e.g. August -> September\n */\n next = 'next';\n\n /**\n * Applied to any action that would violate any restriction options. ALso applied\n * to an input field if the disabled function is called.\n */\n disabled = 'disabled';\n\n /**\n * Applied to any date that is less than requested view,\n * e.g. the last day of the previous month.\n */\n old = 'old';\n\n /**\n * Applied to any date that is greater than of requested view,\n * e.g. the last day of the previous month.\n */\n new = 'new';\n\n /**\n * Applied to any date that is currently selected.\n */\n active = 'active';\n\n //#region date element\n\n /**\n * The outer element for the calendar view.\n */\n dateContainer = 'date-container';\n\n /**\n * The outer element for the decades view.\n */\n decadesContainer = `${this.dateContainer}-decades`;\n\n /**\n * Applied to elements within the decade container, e.g. 2020, 2030\n */\n decade = 'decade';\n\n /**\n * The outer element for the years view.\n */\n yearsContainer = `${this.dateContainer}-years`;\n\n /**\n * Applied to elements within the years container, e.g. 2021, 2021\n */\n year = 'year';\n\n /**\n * The outer element for the month view.\n */\n monthsContainer = `${this.dateContainer}-months`;\n\n /**\n * Applied to elements within the month container, e.g. January, February\n */\n month = 'month';\n\n /**\n * The outer element for the calendar view.\n */\n daysContainer = `${this.dateContainer}-days`;\n\n /**\n * Applied to elements within the day container, e.g. 1, 2..31\n */\n day = 'day';\n\n /**\n * If display.calendarWeeks is enabled, a column displaying the week of year\n * is shown. This class is applied to each cell in that column.\n */\n calendarWeeks = 'cw';\n\n /**\n * Applied to the first row of the calendar view, e.g. Sunday, Monday\n */\n dayOfTheWeek = 'dow';\n\n /**\n * Applied to the current date on the calendar view.\n */\n today = 'today';\n\n /**\n * Applied to the locale's weekend dates on the calendar view, e.g. Sunday, Saturday\n */\n weekend = 'weekend';\n\n rangeIn = 'range-in';\n rangeStart = 'range-start';\n rangeEnd = 'range-end';\n\n //#endregion\n\n //#region time element\n\n /**\n * The outer element for all time related elements.\n */\n timeContainer = 'time-container';\n\n /**\n * Applied the separator columns between time elements, e.g. hour *:* minute *:* second\n */\n separator = 'separator';\n\n /**\n * The outer element for the clock view.\n */\n clockContainer = `${this.timeContainer}-clock`;\n\n /**\n * The outer element for the hours selection view.\n */\n hourContainer = `${this.timeContainer}-hour`;\n\n /**\n * The outer element for the minutes selection view.\n */\n minuteContainer = `${this.timeContainer}-minute`;\n\n /**\n * The outer element for the seconds selection view.\n */\n secondContainer = `${this.timeContainer}-second`;\n\n /**\n * Applied to each element in the hours selection view.\n */\n hour = 'hour';\n\n /**\n * Applied to each element in the minutes selection view.\n */\n minute = 'minute';\n\n /**\n * Applied to each element in the seconds selection view.\n */\n second = 'second';\n\n /**\n * Applied AM/PM toggle button.\n */\n toggleMeridiem = 'toggleMeridiem';\n\n //#endregion\n\n //#region collapse\n\n /**\n * Applied the element of the current view mode, e.g. calendar or clock.\n */\n show = 'show';\n\n /**\n * Applied to the currently showing view mode during a transition\n * between calendar and clock views\n */\n collapsing = 'td-collapsing';\n\n /**\n * Applied to the currently hidden view mode.\n */\n collapse = 'td-collapse';\n\n //#endregion\n\n /**\n * Applied to the widget when the option display.inline is enabled.\n */\n inline = 'inline';\n\n /**\n * Applied to the widget when the option display.theme is light.\n */\n lightTheme = 'light';\n\n /**\n * Applied to the widget when the option display.theme is dark.\n */\n darkTheme = 'dark';\n\n /**\n * Used for detecting if the system color preference is dark mode\n */\n isDarkPreferredQuery = '(prefers-color-scheme: dark)';\n}\n\nexport default class Namespace {\n static NAME = NAME;\n // noinspection JSUnusedGlobalSymbols\n static dataKey = dataKey;\n\n static events = new Events();\n\n static css = new Css();\n\n static errorMessages = new ErrorMessages();\n}\n","import { FormatLocalization } from './options';\n\nconst DefaultFormatLocalization: FormatLocalization = {\n dateFormats: {\n LTS: 'h:mm:ss T',\n LT: 'h:mm T',\n L: 'MM/dd/yyyy',\n LL: 'MMMM d, yyyy',\n LLL: 'MMMM d, yyyy h:mm T',\n LLLL: 'dddd, MMMM d, yyyy h:mm T',\n },\n format: 'L LT',\n locale: 'default',\n hourCycle: undefined,\n ordinal: (n) => {\n const s = ['th', 'st', 'nd', 'rd'];\n const v = n % 100;\n return `[${n}${s[(v - 20) % 10] || s[v] || s[0]}]`;\n },\n};\n\nexport default { ...DefaultFormatLocalization };\n","import { FormatLocalization } from './utilities/options';\nimport Namespace from './utilities/namespace';\nimport DefaultFormatLocalization from './utilities/default-format-localization';\n\ntype parsedTime = {\n afternoon?: boolean;\n year?: number;\n month?: number;\n day?: number;\n hours?: number;\n minutes?: number;\n seconds?: number;\n milliseconds?: number;\n zone?: {\n offset: number;\n };\n};\n\nexport enum Unit {\n seconds = 'seconds',\n minutes = 'minutes',\n hours = 'hours',\n date = 'date',\n month = 'month',\n year = 'year',\n}\n\nconst twoDigitTemplate = {\n month: '2-digit',\n day: '2-digit',\n year: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n};\n\nexport interface DateTimeFormatOptions extends Intl.DateTimeFormatOptions {\n timeStyle?: 'short' | 'medium' | 'long';\n dateStyle?: 'short' | 'medium' | 'long' | 'full';\n numberingSystem?: string;\n}\n\n/**\n * Returns an Intl format object based on the provided object\n * @param unit\n */\nexport const getFormatByUnit = (unit: Unit): object => {\n switch (unit) {\n case 'date':\n return { dateStyle: 'short' };\n case 'month':\n return {\n month: 'numeric',\n year: 'numeric',\n };\n case 'year':\n return { year: 'numeric' };\n }\n};\n\n/**\n * Attempts to guess the hour cycle of the given local\n * @param locale\n */\nexport const guessHourCycle = (locale: string): Intl.LocaleHourCycleKey => {\n if (!locale) return 'h12';\n\n // noinspection SpellCheckingInspection\n const template = {\n hour: '2-digit',\n minute: '2-digit',\n numberingSystem: 'latn',\n };\n\n const dt = new DateTime().setLocalization({ locale });\n dt.hours = 0;\n\n const start = dt.parts(undefined, template).hour;\n\n //midnight is 12 so en-US style 12 AM\n if (start === '12') return 'h12';\n //midnight is 24 is from 00-24\n if (start === '24') return 'h24';\n\n dt.hours = 23;\n const end = dt.parts(undefined, template).hour;\n\n //if midnight is 00 and hour 23 is 11 then\n if (start === '00' && end === '11') return 'h11';\n\n if (start === '00' && end === '23') return 'h23';\n\n console.warn(\n `couldn't determine hour cycle for ${locale}. start: ${start}. end: ${end}`\n );\n\n return undefined;\n};\n\ninterface FormatMatch {\n parser: (obj: parsedTime, input: number) => void;\n pattern?: RegExp;\n}\n\ninterface FormatMatchString {\n parser: (obj: parsedTime, input: string) => void;\n pattern?: RegExp;\n}\n\ninterface FormatExpression {\n t: FormatMatchString;\n T: FormatMatchString;\n fff: FormatMatch;\n s: FormatMatch;\n ss: FormatMatch;\n m: FormatMatch;\n mm: FormatMatch;\n H: FormatMatch;\n h: FormatMatch;\n HH: FormatMatch;\n hh: FormatMatch;\n d: FormatMatch;\n dd: FormatMatch;\n Do: FormatMatchString;\n M: FormatMatch;\n MM: FormatMatch;\n MMM: FormatMatchString;\n MMMM: FormatMatchString;\n y: FormatMatch;\n yy: FormatMatch;\n yyyy: FormatMatch;\n}\n\n/**\n * For the most part this object behaves exactly the same way\n * as the native Date object with a little extra spice.\n */\nexport class DateTime extends Date {\n localization: FormatLocalization = DefaultFormatLocalization;\n\n /**\n * Chainable way to set the {@link locale}\n * @param value\n * @deprecated use setLocalization with a FormatLocalization object instead\n */\n setLocale(value: string): this {\n if (!this.localization) {\n this.localization = DefaultFormatLocalization;\n this.localization.locale = value;\n }\n return this;\n }\n\n /**\n * Chainable way to set the {@link localization}\n * @param value\n */\n setLocalization(value: FormatLocalization): this {\n this.localization = value;\n return this;\n }\n\n /**\n * Converts a plain JS date object to a DateTime object.\n * Doing this allows access to format, etc.\n * @param date\n * @param locale this parameter is deprecated. Use formatLocalization instead.\n * @param formatLocalization\n */\n static convert(\n date: Date,\n locale = 'default',\n formatLocalization: FormatLocalization = undefined\n ): DateTime {\n if (!date) throw new Error(`A date is required`);\n\n if (!formatLocalization) {\n formatLocalization = DefaultFormatLocalization;\n formatLocalization.locale = locale;\n }\n\n return new DateTime(\n date.getFullYear(),\n date.getMonth(),\n date.getDate(),\n date.getHours(),\n date.getMinutes(),\n date.getSeconds(),\n date.getMilliseconds()\n ).setLocalization(formatLocalization);\n }\n\n /**\n * Native date manipulations are not pure functions. This function creates a duplicate of the DateTime object.\n */\n get clone() {\n return new DateTime(\n this.year,\n this.month,\n this.date,\n this.hours,\n this.minutes,\n this.seconds,\n this.getMilliseconds()\n ).setLocalization(this.localization);\n }\n\n static isValid(d): boolean {\n if (d === undefined || JSON.stringify(d) === 'null') return false;\n if (d.constructor.name === DateTime.name) return true;\n return false;\n }\n\n /**\n * Sets the current date to the start of the {@link unit} provided\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).startOf('month')\n * would return April 1, 2021, 12:00:00.000 AM (midnight)\n * @param unit\n * @param startOfTheWeek Allows for the changing the start of the week.\n */\n startOf(unit: Unit | 'weekDay', startOfTheWeek = 0): this {\n if (this[unit] === undefined)\n throw new Error(`Unit '${unit}' is not valid`);\n switch (unit) {\n case 'seconds':\n this.setMilliseconds(0);\n break;\n case 'minutes':\n this.setSeconds(0, 0);\n break;\n case 'hours':\n this.setMinutes(0, 0, 0);\n break;\n case 'date':\n this.setHours(0, 0, 0, 0);\n break;\n case 'weekDay': {\n this.startOf(Unit.date);\n if (this.weekDay === startOfTheWeek) break;\n const goBack = (this.weekDay - startOfTheWeek + 7) % 7;\n this.manipulate(goBack * -1, Unit.date);\n break;\n }\n case 'month':\n this.startOf(Unit.date);\n this.setDate(1);\n break;\n case 'year':\n this.startOf(Unit.date);\n this.setMonth(0, 1);\n break;\n }\n return this;\n }\n\n /**\n * Sets the current date to the end of the {@link unit} provided\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).endOf('month')\n * would return April 30, 2021, 11:59:59.999 PM\n * @param unit\n * @param startOfTheWeek\n */\n endOf(unit: Unit | 'weekDay', startOfTheWeek = 0): this {\n if (this[unit] === undefined)\n throw new Error(`Unit '${unit}' is not valid`);\n switch (unit) {\n case 'seconds':\n this.setMilliseconds(999);\n break;\n case 'minutes':\n this.setSeconds(59, 999);\n break;\n case 'hours':\n this.setMinutes(59, 59, 999);\n break;\n case 'date':\n this.setHours(23, 59, 59, 999);\n break;\n case 'weekDay': {\n this.endOf(Unit.date);\n const endOfWeek = 6 + startOfTheWeek;\n if (this.weekDay === endOfWeek) break;\n this.manipulate(endOfWeek - this.weekDay, Unit.date);\n break;\n }\n case 'month':\n this.endOf(Unit.date);\n this.manipulate(1, Unit.month);\n this.setDate(0);\n break;\n case 'year':\n this.endOf(Unit.date);\n this.setMonth(11, 31);\n break;\n }\n return this;\n }\n\n /**\n * Change a {@link unit} value. Value can be positive or negative\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).manipulate(1, 'month')\n * would return May 30, 2021, 11:45:32.984 AM\n * @param value A positive or negative number\n * @param unit\n */\n manipulate(value: number, unit: Unit): this {\n if (this[unit] === undefined)\n throw new Error(`Unit '${unit}' is not valid`);\n this[unit] += value;\n return this;\n }\n\n /**\n * Return true if {@link compare} is before this date\n * @param compare The Date/DateTime to compare\n * @param unit If provided, uses {@link startOf} for\n * comparison.\n */\n isBefore(compare: DateTime, unit?: Unit): boolean {\n // If the comparisons is undefined, return false\n if (!DateTime.isValid(compare)) return false;\n\n if (!unit) return this.valueOf() < compare.valueOf();\n if (this[unit] === undefined)\n throw new Error(`Unit '${unit}' is not valid`);\n return (\n this.clone.startOf(unit).valueOf() < compare.clone.startOf(unit).valueOf()\n );\n }\n\n /**\n * Return true if {@link compare} is after this date\n * @param compare The Date/DateTime to compare\n * @param unit If provided, uses {@link startOf} for\n * comparison.\n */\n isAfter(compare: DateTime, unit?: Unit): boolean {\n // If the comparisons is undefined, return false\n if (!DateTime.isValid(compare)) return false;\n\n if (!unit) return this.valueOf() > compare.valueOf();\n if (this[unit] === undefined)\n throw new Error(`Unit '${unit}' is not valid`);\n return (\n this.clone.startOf(unit).valueOf() > compare.clone.startOf(unit).valueOf()\n );\n }\n\n /**\n * Return true if {@link compare} is same this date\n * @param compare The Date/DateTime to compare\n * @param unit If provided, uses {@link startOf} for\n * comparison.\n */\n isSame(compare: DateTime, unit?: Unit): boolean {\n // If the comparisons is undefined, return false\n if (!DateTime.isValid(compare)) return false;\n\n if (!unit) return this.valueOf() === compare.valueOf();\n if (this[unit] === undefined)\n throw new Error(`Unit '${unit}' is not valid`);\n compare = DateTime.convert(compare);\n return (\n this.clone.startOf(unit).valueOf() === compare.startOf(unit).valueOf()\n );\n }\n\n /**\n * Check if this is between two other DateTimes, optionally looking at unit scale. The match is exclusive.\n * @param left\n * @param right\n * @param unit.\n * @param inclusivity. A [ indicates inclusion of a value. A ( indicates exclusion.\n * If the inclusivity parameter is used, both indicators must be passed.\n */\n isBetween(\n left: DateTime,\n right: DateTime,\n unit?: Unit,\n inclusivity: '()' | '[]' | '(]' | '[)' = '()'\n ): boolean {\n // If one of the comparisons is undefined, return false\n if (!DateTime.isValid(left) || !DateTime.isValid(right)) return false;\n // If a unit is provided and is not a valid property of the DateTime object, throw an error\n if (unit && this[unit] === undefined) {\n throw new Error(`Unit '${unit}' is not valid`);\n }\n\n const leftInclusivity = inclusivity[0] === '(';\n const rightInclusivity = inclusivity[1] === ')';\n\n const isLeftInRange = leftInclusivity\n ? this.isAfter(left, unit)\n : !this.isBefore(left, unit);\n const isRightInRange = rightInclusivity\n ? this.isBefore(right, unit)\n : !this.isAfter(right, unit);\n\n return isLeftInRange && isRightInRange;\n }\n\n /**\n * Returns flattened object of the date. Does not include literals\n * @param locale\n * @param template\n */\n parts(\n locale = this.localization.locale,\n template: Record = { dateStyle: 'full', timeStyle: 'long' }\n ): Record {\n const parts = {};\n new Intl.DateTimeFormat(locale, template)\n .formatToParts(this)\n .filter((x) => x.type !== 'literal')\n .forEach((x) => (parts[x.type] = x.value));\n return parts;\n }\n\n /**\n * Shortcut to Date.getSeconds()\n */\n get seconds(): number {\n return this.getSeconds();\n }\n\n /**\n * Shortcut to Date.setSeconds()\n */\n set seconds(value: number) {\n this.setSeconds(value);\n }\n\n /**\n * Returns two digit hours\n */\n get secondsFormatted(): string {\n return this.parts(undefined, twoDigitTemplate).second;\n }\n\n /**\n * Shortcut to Date.getMinutes()\n */\n get minutes(): number {\n return this.getMinutes();\n }\n\n /**\n * Shortcut to Date.setMinutes()\n */\n set minutes(value: number) {\n this.setMinutes(value);\n }\n\n /**\n * Returns two digit minutes\n */\n get minutesFormatted(): string {\n return this.parts(undefined, twoDigitTemplate).minute;\n }\n\n /**\n * Shortcut to Date.getHours()\n */\n get hours(): number {\n return this.getHours();\n }\n\n /**\n * Shortcut to Date.setHours()\n */\n set hours(value: number) {\n this.setHours(value);\n }\n\n /**\n * Returns two digit hour, e.g. 01...10\n * @param hourCycle Providing an hour cycle will change 00 to 24 depending on the given value.\n */\n getHoursFormatted(hourCycle: Intl.LocaleHourCycleKey = 'h12') {\n return this.parts(undefined, { ...twoDigitTemplate, hourCycle: hourCycle })\n .hour;\n }\n\n /**\n * Get the meridiem of the date. E.g. AM or PM.\n * If the {@link locale} provides a \"dayPeriod\" then this will be returned,\n * otherwise it will return AM or PM.\n * @param locale\n */\n meridiem(locale: string = this.localization.locale): string {\n return new Intl.DateTimeFormat(locale, {\n hour: 'numeric',\n hour12: true,\n })\n .formatToParts(this)\n .find((p) => p.type === 'dayPeriod')?.value;\n }\n\n /**\n * Shortcut to Date.getDate()\n */\n get date(): number {\n return this.getDate();\n }\n\n /**\n * Shortcut to Date.setDate()\n */\n set date(value: number) {\n this.setDate(value);\n }\n\n /**\n * Return two digit date\n */\n get dateFormatted(): string {\n return this.parts(undefined, twoDigitTemplate).day;\n }\n\n /**\n * Shortcut to Date.getDay()\n */\n get weekDay(): number {\n return this.getDay();\n }\n\n /**\n * Shortcut to Date.getMonth()\n */\n get month(): number {\n return this.getMonth();\n }\n\n /**\n * Shortcut to Date.setMonth()\n */\n set month(value: number) {\n const targetMonth = new Date(this.year, value + 1);\n targetMonth.setDate(0);\n const endOfMonth = targetMonth.getDate();\n if (this.date > endOfMonth) {\n this.date = endOfMonth;\n }\n this.setMonth(value);\n }\n\n /**\n * Return two digit, human expected month. E.g. January = 1, December = 12\n */\n get monthFormatted(): string {\n return this.parts(undefined, twoDigitTemplate).month;\n }\n\n /**\n * Shortcut to Date.getFullYear()\n */\n get year(): number {\n return this.getFullYear();\n }\n\n /**\n * Shortcut to Date.setFullYear()\n */\n set year(value: number) {\n this.setFullYear(value);\n }\n\n // borrowed a bunch of stuff from Luxon\n /**\n * Gets the week of the year\n */\n get week(): number {\n const ordinal = this.computeOrdinal(),\n weekday = this.getUTCDay();\n\n let weekNumber = Math.floor((ordinal - weekday + 10) / 7);\n\n if (weekNumber < 1) {\n weekNumber = this.weeksInWeekYear();\n } else if (weekNumber > this.weeksInWeekYear()) {\n weekNumber = 1;\n }\n\n return weekNumber;\n }\n\n /**\n * Returns the number of weeks in the year\n */\n weeksInWeekYear() {\n const p1 =\n (this.year +\n Math.floor(this.year / 4) -\n Math.floor(this.year / 100) +\n Math.floor(this.year / 400)) %\n 7,\n last = this.year - 1,\n p2 =\n (last +\n Math.floor(last / 4) -\n Math.floor(last / 100) +\n Math.floor(last / 400)) %\n 7;\n return p1 === 4 || p2 === 3 ? 53 : 52;\n }\n\n /**\n * Returns true or false depending on if the year is a leap year or not.\n */\n get isLeapYear() {\n return (\n this.year % 4 === 0 && (this.year % 100 !== 0 || this.year % 400 === 0)\n );\n }\n\n private computeOrdinal() {\n return (\n this.date +\n (this.isLeapYear ? this.leapLadder : this.nonLeapLadder)[this.month]\n );\n }\n\n private nonLeapLadder = [\n 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334,\n ];\n private leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];\n\n //#region CDF stuff\n\n private dateTimeRegex =\n //is regex cannot be simplified beyond what it already is\n /(\\[[^[\\]]*])|y{1,4}|M{1,4}|d{1,4}|H{1,2}|h{1,2}|t|T|m{1,2}|s{1,2}|f{3}/g; //NOSONAR\n\n private formattingTokens =\n /(\\[[^[\\]]*])|([-_:/.,()\\s]+)|(T|t|yyyy|yy?|MM?M?M?|Do|dd?|hh?|HH?|mm?|ss?)/g; //NOSONAR is regex cannot be simplified beyond what it already is\n\n /**\n * Returns a list of month values based on the current locale\n */\n private getAllMonths(\n format: '2-digit' | 'numeric' | 'long' | 'short' | 'narrow' = 'long'\n ) {\n const applyFormat = new Intl.DateTimeFormat(this.localization.locale, {\n month: format,\n }).format;\n return [...Array(12).keys()].map((m) => applyFormat(new Date(2021, m)));\n }\n\n /**\n * Replaces an expanded token set (e.g. LT/LTS)\n */\n private replaceTokens(formatStr, formats) {\n /***\n * _ => match\n * a => first capture group. Anything between [ and ]\n * b => second capture group\n */\n return formatStr.replace(\n /(\\[[^[\\]]*])|(LTS?|l{1,4}|L{1,4})/g,\n (_, a, b) => {\n const B = b && b.toUpperCase();\n return a || formats[B] || DefaultFormatLocalization.dateFormats[B];\n }\n );\n }\n\n private match2 = /\\d\\d/; // 00 - 99\n private match3 = /\\d{3}/; // 000 - 999\n private match4 = /\\d{4}/; // 0000 - 9999\n private match1to2 = /\\d\\d?/; // 0 - 99\n private matchSigned = /[+-]?\\d+/; // -inf - inf\n private matchOffset = /[+-]\\d\\d:?(\\d\\d)?|Z/; // +00:00 -00:00 +0000 or -0000 +00 or Z\n private matchWord = /[^\\d_:/,\\-()\\s]+/; // Word\n\n private parseTwoDigitYear(input: number) {\n return input + (input > 68 ? 1900 : 2000);\n }\n\n private offsetFromString(input: string) {\n if (!input) return 0;\n if (input === 'Z') return 0;\n const [first, second, third] = input.match(/([+-]|\\d\\d)/g);\n const minutes = +second * 60 + (+third || 0);\n const signed = first === '+' ? -minutes : minutes;\n return minutes === 0 ? 0 : signed; // eslint-disable-line no-nested-ternary\n }\n\n /**\n * z = -4, zz = -04, zzz = -0400\n * @param date\n * @param style\n * @private\n */\n private zoneInformation(date: DateTime, style: 'z' | 'zz' | 'zzz') {\n let name = date\n .parts(this.localization.locale, { timeZoneName: 'longOffset' })\n .timeZoneName.replace('GMT', '')\n .replace(':', '');\n\n const negative = name.includes('-');\n\n name = name.replace('-', '');\n\n if (style === 'z') name = name.substring(1, 2);\n else if (style === 'zz') name = name.substring(0, 2);\n\n return `${negative ? '-' : ''}${name}`;\n }\n\n private zoneExpressions = [\n this.matchOffset,\n (obj, input) => {\n obj.offset = this.offsetFromString(input);\n },\n ];\n\n private addInput(property) {\n return (obj, input) => {\n obj[property] = +input;\n };\n }\n\n private getLocaleAfternoon(): string {\n return new Intl.DateTimeFormat(this.localization.locale, {\n hour: 'numeric',\n hour12: true,\n })\n .formatToParts(new Date(2022, 3, 4, 13))\n .find((p) => p.type === 'dayPeriod')\n ?.value?.replace(/\\s+/g, ' ');\n }\n\n private meridiemMatch(input: string) {\n return input.toLowerCase() === this.getLocaleAfternoon().toLowerCase();\n }\n\n private expressions: FormatExpression = {\n t: {\n pattern: undefined, //this.matchWord,\n parser: (obj, input) => {\n obj.afternoon = this.meridiemMatch(input);\n },\n },\n T: {\n pattern: undefined, //this.matchWord,\n parser: (obj, input) => {\n obj.afternoon = this.meridiemMatch(input);\n },\n },\n fff: {\n pattern: this.match3,\n parser: (obj, input) => {\n obj.milliseconds = +input;\n },\n },\n s: {\n pattern: this.match1to2,\n parser: this.addInput('seconds'),\n },\n ss: {\n pattern: this.match1to2,\n parser: this.addInput('seconds'),\n },\n m: {\n pattern: this.match1to2,\n parser: this.addInput('minutes'),\n },\n mm: {\n pattern: this.match1to2,\n parser: this.addInput('minutes'),\n },\n H: {\n pattern: this.match1to2,\n parser: this.addInput('hours'),\n },\n h: {\n pattern: this.match1to2,\n parser: this.addInput('hours'),\n },\n HH: {\n pattern: this.match1to2,\n parser: this.addInput('hours'),\n },\n hh: {\n pattern: this.match1to2,\n parser: this.addInput('hours'),\n },\n d: {\n pattern: this.match1to2,\n parser: this.addInput('day'),\n },\n dd: {\n pattern: this.match2,\n parser: this.addInput('day'),\n },\n Do: {\n pattern: this.matchWord,\n parser: (obj, input) => {\n obj.day = +(input.match(/\\d+/)[0] || 1);\n if (!this.localization.ordinal) return;\n for (let i = 1; i <= 31; i += 1) {\n if (this.localization.ordinal(i).replace(/[[\\]]/g, '') === input) {\n obj.day = i;\n }\n }\n },\n },\n M: {\n pattern: this.match1to2,\n parser: this.addInput('month'),\n },\n MM: {\n pattern: this.match2,\n parser: this.addInput('month'),\n },\n MMM: {\n pattern: this.matchWord,\n parser: (obj, input) => {\n const months = this.getAllMonths();\n const monthsShort = this.getAllMonths('short');\n const matchIndex =\n (monthsShort || months.map((_) => _.slice(0, 3))).indexOf(input) + 1;\n if (matchIndex < 1) {\n throw new Error();\n }\n obj.month = matchIndex % 12 || matchIndex;\n },\n },\n MMMM: {\n pattern: this.matchWord,\n parser: (obj, input) => {\n const months = this.getAllMonths();\n const matchIndex = months.indexOf(input) + 1;\n if (matchIndex < 1) {\n throw new Error();\n }\n obj.month = matchIndex % 12 || matchIndex;\n },\n },\n y: {\n pattern: this.matchSigned,\n parser: this.addInput('year'),\n },\n yy: {\n pattern: this.match2,\n parser: (obj, input) => {\n obj.year = this.parseTwoDigitYear(+input);\n },\n },\n yyyy: {\n pattern: this.match4,\n parser: this.addInput('year'),\n },\n // z: this.zoneExpressions,\n // zz: this.zoneExpressions,\n // zzz: this.zoneExpressions\n };\n\n private correctHours(time) {\n const { afternoon } = time;\n if (afternoon !== undefined) {\n const { hours } = time;\n if (afternoon) {\n if (hours < 12) {\n time.hours += 12;\n }\n } else if (hours === 12) {\n time.hours = 0;\n }\n delete time.afternoon;\n }\n }\n\n private makeParser(format: string) {\n format = this.replaceTokens(format, this.localization.dateFormats);\n const matchArray = format.match(this.formattingTokens);\n const { length } = matchArray;\n const expressionArray: (FormatMatch | string)[] = [];\n for (let i = 0; i < length; i += 1) {\n const token = matchArray[i];\n const expression = this.expressions[token] as FormatMatch;\n if (expression?.parser) {\n expressionArray[i] = expression;\n } else {\n expressionArray[i] = (token as string).replace(/^\\[[^[\\]]*]$/g, '');\n }\n }\n\n return (input: string): parsedTime => {\n const time = {\n hours: 0,\n minutes: 0,\n seconds: 0,\n milliseconds: 0,\n };\n for (let i = 0, start = 0; i < length; i += 1) {\n const token = expressionArray[i];\n if (typeof token === 'string') {\n start += token.length;\n } else {\n const part = input.slice(start);\n let value = part;\n\n if (token.pattern) {\n const match = token.pattern.exec(part);\n value = match[0];\n }\n token.parser.call(this, time, value);\n input = input.replace(value, '');\n }\n }\n this.correctHours(time);\n return time;\n };\n }\n\n /**\n * Attempts to create a DateTime from a string.\n * @param input date as string\n * @param localization provides the date template the string is in via the format property\n */\n //eslint-disable-next-line @typescript-eslint/no-unused-vars\n static fromString(input: string, localization: FormatLocalization): DateTime {\n if (!localization?.format) {\n Namespace.errorMessages.customDateFormatError('No format was provided');\n }\n try {\n const dt = new DateTime();\n dt.setLocalization(localization);\n if (['x', 'X'].indexOf(localization.format) > -1)\n return new DateTime((localization.format === 'X' ? 1000 : 1) * +input);\n\n input = input.replace(/\\s+/g, ' ');\n const parser = dt.makeParser(localization.format);\n const { year, month, day, hours, minutes, seconds, milliseconds, zone } =\n parser(input);\n const d = day || (!year && !month ? dt.getDate() : 1);\n const y = year || dt.getFullYear();\n let M = 0;\n if (!(year && !month)) {\n M = month > 0 ? month - 1 : dt.getMonth();\n }\n if (zone) {\n return new DateTime(\n Date.UTC(\n y,\n M,\n d,\n hours,\n minutes,\n seconds,\n milliseconds + zone.offset * 60 * 1000\n )\n );\n }\n return new DateTime(y, M, d, hours, minutes, seconds, milliseconds);\n } catch (e) {\n Namespace.errorMessages.customDateFormatError(\n `Unable to parse provided input: ${input}, format: ${localization.format}`\n );\n }\n }\n\n /**\n * Returns a string format.\n * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat\n * for valid templates and locale objects\n * @param template An optional object. If provided, method will use Intl., otherwise the localizations format properties\n * @param locale Can be a string or an array of strings. Uses browser defaults otherwise.\n */\n format(\n template?: DateTimeFormatOptions | string,\n locale = this.localization.locale\n ): string {\n if (template && typeof template === 'object')\n return new Intl.DateTimeFormat(locale, template).format(this);\n\n const formatString = this.replaceTokens(\n //try template first\n template ||\n //otherwise try localization format\n this.localization.format ||\n //otherwise try date + time\n `${DefaultFormatLocalization.dateFormats.L}, ${DefaultFormatLocalization.dateFormats.LT}`,\n this.localization.dateFormats\n );\n\n const formatter = (template) =>\n new Intl.DateTimeFormat(this.localization.locale, template).format(this);\n\n if (!this.localization.hourCycle)\n this.localization.hourCycle = guessHourCycle(this.localization.locale);\n\n //if the format asks for a twenty-four-hour string but the hour cycle is not, then make a base guess\n const HHCycle = this.localization.hourCycle.startsWith('h1')\n ? 'h24'\n : this.localization.hourCycle;\n const hhCycle = this.localization.hourCycle.startsWith('h2')\n ? 'h12'\n : this.localization.hourCycle;\n\n const matches = {\n y: this.year,\n yy: formatter({ year: '2-digit' }),\n yyyy: this.year,\n M: formatter({ month: 'numeric' }),\n MM: this.monthFormatted,\n MMM: this.getAllMonths('short')[this.getMonth()],\n MMMM: this.getAllMonths()[this.getMonth()],\n d: this.date,\n dd: this.dateFormatted,\n ddd: formatter({ weekday: 'short' }),\n dddd: formatter({ weekday: 'long' }),\n H: this.getHours(),\n HH: this.getHoursFormatted(HHCycle),\n h: this.hours > 12 ? this.hours - 12 : this.hours,\n hh: this.getHoursFormatted(hhCycle),\n t: this.meridiem(),\n T: this.meridiem().toUpperCase(),\n m: this.minutes,\n mm: this.minutesFormatted,\n s: this.seconds,\n ss: this.secondsFormatted,\n fff: this.getMilliseconds(),\n // z: this.zoneInformation(dateTime, 'z'), //-4\n // zz: this.zoneInformation(dateTime, 'zz'), //-04\n // zzz: this.zoneInformation(dateTime, 'zzz') //-0400\n };\n\n return formatString\n .replace(this.dateTimeRegex, (match, $1) => {\n return $1 || matches[match];\n })\n .replace(/\\[/g, '')\n .replace(/]/g, '');\n }\n\n //#endregion CDF stuff\n}\n","//eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport declare type Constructable = new (...args: any[]) => T;\n\nclass ServiceLocator {\n private cache: Map, unknown | symbol> = new Map();\n\n locate(identifier: Constructable): T {\n const service = this.cache.get(identifier);\n if (service) return service as T;\n const value = new identifier();\n this.cache.set(identifier, value);\n return value;\n }\n}\nexport const setupServiceLocator = () => {\n serviceLocator = new ServiceLocator();\n};\n\nexport let serviceLocator: ServiceLocator;\n","import { Unit } from '../datetime';\nimport Namespace from './namespace';\nimport ViewMode from './view-mode';\n\nconst CalendarModes: {\n name: keyof ViewMode;\n className: string;\n unit: Unit;\n step: number;\n}[] = [\n {\n name: 'calendar',\n className: Namespace.css.daysContainer,\n unit: Unit.month,\n step: 1,\n },\n {\n name: 'months',\n className: Namespace.css.monthsContainer,\n unit: Unit.year,\n step: 1,\n },\n {\n name: 'years',\n className: Namespace.css.yearsContainer,\n unit: Unit.year,\n step: 10,\n },\n {\n name: 'decades',\n className: Namespace.css.decadesContainer,\n unit: Unit.year,\n step: 100,\n },\n];\n\nexport default CalendarModes;\n","import { DateTime } from '../datetime';\nimport CalendarModes from './calendar-modes';\nimport ViewMode from './view-mode';\nimport Options from './options';\n\nexport class OptionsStore {\n options: Options;\n element: HTMLElement;\n input: HTMLInputElement;\n unset: boolean;\n private _currentCalendarViewMode = 0;\n\n get currentCalendarViewMode() {\n return this._currentCalendarViewMode;\n }\n\n set currentCalendarViewMode(value) {\n this._currentCalendarViewMode = value;\n this.currentView = CalendarModes[value].name;\n }\n\n _viewDate = new DateTime();\n\n get viewDate() {\n return this._viewDate;\n }\n\n set viewDate(v) {\n this._viewDate = v;\n if (this.options) this.options.viewDate = v;\n }\n\n /**\n * When switching back to the calendar from the clock,\n * this sets currentView to the correct calendar view.\n */\n refreshCurrentView() {\n this.currentView = CalendarModes[this.currentCalendarViewMode].name;\n }\n\n minimumCalendarViewMode = 0;\n currentView: keyof ViewMode = 'calendar';\n\n get isTwelveHour() {\n return ['h12', 'h11'].includes(this.options.localization.hourCycle);\n }\n}\n","import { DateTime, Unit } from './datetime';\nimport { serviceLocator } from './utilities/service-locator';\nimport { OptionsStore } from './utilities/optionsStore';\n\n/**\n * Main class for date validation rules based on the options provided.\n */\nexport default class Validation {\n private optionsStore: OptionsStore;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n }\n\n /**\n * Checks to see if the target date is valid based on the rules provided in the options.\n * Granularity can be provided to check portions of the date instead of the whole.\n * @param targetDate\n * @param granularity\n */\n isValid(targetDate: DateTime, granularity?: Unit): boolean {\n if (!this._enabledDisabledDatesIsValid(granularity, targetDate))\n return false;\n\n if (\n granularity !== Unit.month &&\n granularity !== Unit.year &&\n this.optionsStore.options.restrictions.daysOfWeekDisabled?.length > 0 &&\n this.optionsStore.options.restrictions.daysOfWeekDisabled.indexOf(\n targetDate.weekDay\n ) !== -1\n )\n return false;\n\n if (!this._minMaxIsValid(granularity, targetDate)) return false;\n\n if (\n granularity === Unit.hours ||\n granularity === Unit.minutes ||\n granularity === Unit.seconds\n ) {\n if (!this._enabledDisabledHoursIsValid(targetDate)) return false;\n\n if (\n this.optionsStore.options.restrictions.disabledTimeIntervals?.filter(\n (internal) => targetDate.isBetween(internal.from, internal.to)\n ).length !== 0\n )\n return false;\n }\n\n return true;\n }\n\n private _enabledDisabledDatesIsValid(\n granularity: Unit,\n targetDate: DateTime\n ): boolean {\n if (granularity !== Unit.date) return true;\n\n if (\n this.optionsStore.options.restrictions.disabledDates.length > 0 &&\n this._isInDisabledDates(targetDate)\n ) {\n return false;\n }\n\n // noinspection RedundantIfStatementJS\n if (\n this.optionsStore.options.restrictions.enabledDates.length > 0 &&\n !this._isInEnabledDates(targetDate)\n ) {\n return false;\n }\n\n return true;\n }\n\n /**\n * Checks to see if the disabledDates option is in use and returns true (meaning invalid)\n * if the `testDate` is with in the array. Granularity is by date.\n * @param testDate\n * @private\n */\n private _isInDisabledDates(testDate: DateTime) {\n if (\n !this.optionsStore.options.restrictions.disabledDates ||\n this.optionsStore.options.restrictions.disabledDates.length === 0\n )\n return false;\n\n return !!this.optionsStore.options.restrictions.disabledDates.find((x) =>\n x.isSame(testDate, Unit.date)\n );\n }\n\n /**\n * Checks to see if the enabledDates option is in use and returns true (meaning valid)\n * if the `testDate` is with in the array. Granularity is by date.\n * @param testDate\n * @private\n */\n private _isInEnabledDates(testDate: DateTime) {\n if (\n !this.optionsStore.options.restrictions.enabledDates ||\n this.optionsStore.options.restrictions.enabledDates.length === 0\n )\n return true;\n\n return !!this.optionsStore.options.restrictions.enabledDates.find((x) =>\n x.isSame(testDate, Unit.date)\n );\n }\n\n private _minMaxIsValid(granularity: Unit, targetDate: DateTime) {\n if (\n this.optionsStore.options.restrictions.minDate &&\n targetDate.isBefore(\n this.optionsStore.options.restrictions.minDate,\n granularity\n )\n ) {\n return false;\n }\n\n // noinspection RedundantIfStatementJS\n if (\n this.optionsStore.options.restrictions.maxDate &&\n targetDate.isAfter(\n this.optionsStore.options.restrictions.maxDate,\n granularity\n )\n ) {\n return false;\n }\n\n return true;\n }\n\n private _enabledDisabledHoursIsValid(targetDate) {\n if (\n this.optionsStore.options.restrictions.disabledHours.length > 0 &&\n this._isInDisabledHours(targetDate)\n ) {\n return false;\n }\n\n // noinspection RedundantIfStatementJS\n if (\n this.optionsStore.options.restrictions.enabledHours.length > 0 &&\n !this._isInEnabledHours(targetDate)\n ) {\n return false;\n }\n\n return true;\n }\n\n /**\n * Checks to see if the disabledHours option is in use and returns true (meaning invalid)\n * if the `testDate` is with in the array. Granularity is by hours.\n * @param testDate\n * @private\n */\n private _isInDisabledHours(testDate: DateTime) {\n if (\n !this.optionsStore.options.restrictions.disabledHours ||\n this.optionsStore.options.restrictions.disabledHours.length === 0\n )\n return false;\n\n const formattedDate = testDate.hours;\n return this.optionsStore.options.restrictions.disabledHours.includes(\n formattedDate\n );\n }\n\n /**\n * Checks to see if the enabledHours option is in use and returns true (meaning valid)\n * if the `testDate` is with in the array. Granularity is by hours.\n * @param testDate\n * @private\n */\n private _isInEnabledHours(testDate: DateTime) {\n if (\n !this.optionsStore.options.restrictions.enabledHours ||\n this.optionsStore.options.restrictions.enabledHours.length === 0\n )\n return true;\n\n const formattedDate = testDate.hours;\n return this.optionsStore.options.restrictions.enabledHours.includes(\n formattedDate\n );\n }\n\n dateRangeIsValid(dates: DateTime[], index: number, target: DateTime) {\n // if we're not using the option, then return valid\n if (!this.optionsStore.options.dateRange) return true;\n\n // if we've only selected 0..1 dates, and we're not setting the end date\n // then return valid. We only want to validate the range if both are selected,\n // because the other validation on the target has already occurred.\n if (dates.length !== 2 && index !== 1) return true;\n\n // initialize start date\n const start = dates[0].clone;\n // check if start date is not the same as target date\n if (start.isSame(target, Unit.date)) return true;\n\n // add one day to start; start has already been validated\n start.manipulate(1, Unit.date);\n\n // check each date in the range to make sure it's valid\n while (!start.isSame(target, Unit.date)) {\n const valid = this.isValid(start, Unit.date);\n if (!valid) return false;\n start.manipulate(1, Unit.date);\n }\n\n return true;\n }\n}\n","import { DateTime, Unit } from '../datetime';\nimport ActionTypes from './action-types';\nimport { BaseEvent } from './event-types';\n\nexport type ViewUpdateValues = Unit | 'decade' | 'clock' | 'calendar' | 'all';\n\nclass EventEmitter {\n private subscribers: ((value?: T) => void)[] = [];\n\n subscribe(callback: (value: T) => void) {\n this.subscribers.push(callback);\n return this.unsubscribe.bind(this, this.subscribers.length - 1);\n }\n\n unsubscribe(index: number) {\n this.subscribers.splice(index, 1);\n }\n\n emit(value?: T) {\n this.subscribers.forEach((callback) => {\n callback(value);\n });\n }\n\n destroy() {\n this.subscribers = null;\n this.subscribers = [];\n }\n}\n\nexport class EventEmitters {\n triggerEvent = new EventEmitter();\n viewUpdate = new EventEmitter();\n updateDisplay = new EventEmitter();\n action = new EventEmitter<{ e: any; action?: ActionTypes }>(); //eslint-disable-line @typescript-eslint/no-explicit-any\n updateViewDate = new EventEmitter();\n\n destroy() {\n this.triggerEvent.destroy();\n this.viewUpdate.destroy();\n this.updateDisplay.destroy();\n this.action.destroy();\n this.updateViewDate.destroy();\n }\n}\n","import Options, { Localization } from './options';\nimport { DateTime } from '../datetime';\nimport DefaultFormatLocalization from './default-format-localization';\n\nconst defaultEnLocalization: Localization = {\n clear: 'Clear selection',\n close: 'Close the picker',\n dateFormats: DefaultFormatLocalization.dateFormats,\n dayViewHeaderFormat: { month: 'long', year: '2-digit' },\n decrementHour: 'Decrement Hour',\n decrementMinute: 'Decrement Minute',\n decrementSecond: 'Decrement Second',\n format: DefaultFormatLocalization.format,\n hourCycle: DefaultFormatLocalization.hourCycle,\n incrementHour: 'Increment Hour',\n incrementMinute: 'Increment Minute',\n incrementSecond: 'Increment Second',\n locale: DefaultFormatLocalization.locale,\n maxWeekdayLength: 0,\n nextCentury: 'Next Century',\n nextDecade: 'Next Decade',\n nextMonth: 'Next Month',\n nextYear: 'Next Year',\n ordinal: DefaultFormatLocalization.ordinal,\n pickHour: 'Pick Hour',\n pickMinute: 'Pick Minute',\n pickSecond: 'Pick Second',\n previousCentury: 'Previous Century',\n previousDecade: 'Previous Decade',\n previousMonth: 'Previous Month',\n previousYear: 'Previous Year',\n selectDate: 'Select Date',\n selectDecade: 'Select Decade',\n selectMonth: 'Select Month',\n selectTime: 'Select Time',\n selectYear: 'Select Year',\n startOfTheWeek: 0,\n today: 'Go to today',\n toggleMeridiem: 'Toggle Meridiem',\n};\n\nconst DefaultOptions: Options = {\n allowInputToggle: false,\n container: undefined,\n dateRange: false,\n debug: false,\n defaultDate: undefined,\n display: {\n icons: {\n type: 'icons',\n time: 'fa-solid fa-clock',\n date: 'fa-solid fa-calendar',\n up: 'fa-solid fa-arrow-up',\n down: 'fa-solid fa-arrow-down',\n previous: 'fa-solid fa-chevron-left',\n next: 'fa-solid fa-chevron-right',\n today: 'fa-solid fa-calendar-check',\n clear: 'fa-solid fa-trash',\n close: 'fa-solid fa-xmark',\n },\n sideBySide: false,\n calendarWeeks: false,\n viewMode: 'calendar',\n toolbarPlacement: 'bottom',\n keepOpen: false,\n buttons: {\n today: false,\n clear: false,\n close: false,\n },\n components: {\n calendar: true,\n date: true,\n month: true,\n year: true,\n decades: true,\n clock: true,\n hours: true,\n minutes: true,\n seconds: false,\n useTwentyfourHour: undefined,\n },\n inline: false,\n theme: 'auto',\n placement: 'bottom',\n },\n keepInvalid: false,\n localization: defaultEnLocalization,\n meta: {},\n multipleDates: false,\n multipleDatesSeparator: '; ',\n promptTimeOnDateChange: false,\n promptTimeOnDateChangeTransitionDelay: 200,\n restrictions: {\n minDate: undefined,\n maxDate: undefined,\n disabledDates: [],\n enabledDates: [],\n daysOfWeekDisabled: [],\n disabledTimeIntervals: [],\n disabledHours: [],\n enabledHours: [],\n },\n stepping: 1,\n useCurrent: true,\n viewDate: new DateTime(),\n};\n\nexport default DefaultOptions;\nexport const DefaultEnLocalization = { ...defaultEnLocalization };\n","import Namespace from './namespace';\nimport { DateTime } from '../datetime';\nimport { FormatLocalization } from './options';\nimport DefaultFormatLocalization from './default-format-localization';\n\n/**\n * Attempts to prove `d` is a DateTime or Date or can be converted into one.\n * @param d If a string will attempt creating a date from it.\n * @param localization object containing locale and format settings. Only used with the custom formats\n * @private\n */\nexport function tryConvertToDateTime(\n this: void,\n d: DateTime | Date | string,\n localization: FormatLocalization\n): DateTime | null {\n if (!d) return null;\n if (d.constructor.name === DateTime.name) return d as DateTime;\n if (d.constructor.name === Date.name) {\n return DateTime.convert(d as Date);\n }\n if (typeof d === typeof '') {\n const dateTime = DateTime.fromString(d as unknown as string, localization);\n if (JSON.stringify(dateTime) === 'null') {\n return null;\n }\n return dateTime;\n }\n return null;\n}\n\n/**\n * Attempts to convert `d` to a DateTime object\n * @param d value to convert\n * @param optionName Provides text to error messages e.g. disabledDates\n * @param localization object containing locale and format settings. Only used with the custom formats\n */\nexport function convertToDateTime(\n this: void,\n d: DateTime | Date | string,\n optionName: string,\n localization: FormatLocalization\n): DateTime {\n if (typeof d === typeof '' && optionName !== 'input') {\n Namespace.errorMessages.dateString();\n }\n\n const converted = tryConvertToDateTime(d, localization);\n\n if (!converted) {\n Namespace.errorMessages.failedToParseDate(\n optionName,\n d,\n optionName === 'input'\n );\n }\n return converted;\n}\n\n/**\n * Type checks that `value` is an array of Date or DateTime\n * @param optionName Provides text to error messages e.g. disabledDates\n * @param value Option value\n * @param providedType Used to provide text to error messages\n * @param localization\n */\nexport function typeCheckDateArray(\n this: void,\n optionName: string,\n value: any, //eslint-disable-line @typescript-eslint/no-explicit-any\n providedType: string,\n localization: FormatLocalization = DefaultFormatLocalization\n) {\n if (!Array.isArray(value)) {\n Namespace.errorMessages.typeMismatch(\n optionName,\n providedType,\n 'array of DateTime or Date'\n );\n }\n for (let i = 0; i < value.length; i++) {\n const d = value[i];\n const dateTime = convertToDateTime(d, optionName, localization);\n dateTime.setLocalization(localization);\n value[i] = dateTime;\n }\n}\n\n/**\n * Type checks that `value` is an array of numbers\n * @param optionName Provides text to error messages e.g. disabledDates\n * @param value Option value\n * @param providedType Used to provide text to error messages\n */\nexport function typeCheckNumberArray(\n this: void,\n optionName: string,\n value: any, //eslint-disable-line @typescript-eslint/no-explicit-any\n providedType: string\n) {\n if (!Array.isArray(value) || value.some((x) => typeof x !== typeof 0)) {\n Namespace.errorMessages.typeMismatch(\n optionName,\n providedType,\n 'array of numbers'\n );\n }\n}\n","import Namespace from './namespace';\nimport type { FormatLocalization } from './options';\nimport {\n convertToDateTime,\n typeCheckNumberArray,\n typeCheckDateArray,\n} from './typeChecker';\n\ninterface OptionProcessorFunctionArguments {\n key: string;\n value: any; //eslint-disable-line @typescript-eslint/no-explicit-any\n providedType: string;\n defaultType: string;\n path: string;\n localization: FormatLocalization;\n}\n\ntype OptionProcessorFunction = (\n this: void,\n args: OptionProcessorFunctionArguments\n) => any; //eslint-disable-line @typescript-eslint/no-explicit-any\n\nfunction mandatoryDate(key: string): OptionProcessorFunction {\n return ({ value, providedType, localization }) => {\n const dateTime = convertToDateTime(value, key, localization);\n if (dateTime !== undefined) {\n dateTime.setLocalization(localization);\n return dateTime;\n }\n };\n}\n\nfunction optionalDate(key: string): OptionProcessorFunction {\n const mandatory = mandatoryDate(key);\n return (args) => {\n if (args.value === undefined) {\n return args.value;\n }\n return mandatory(args);\n };\n}\n\nfunction numbersInRange(\n key: string,\n lower: number,\n upper: number\n): OptionProcessorFunction {\n return ({ value, providedType }) => {\n if (value === undefined) {\n return [];\n }\n typeCheckNumberArray(key, value, providedType);\n if ((value as number[]).some((x) => x < lower || x > upper))\n Namespace.errorMessages.numbersOutOfRange(key, lower, upper);\n return value;\n };\n}\n\nfunction validHourRange(key: string): OptionProcessorFunction {\n return numbersInRange(key, 0, 23);\n}\n\nfunction validDateArray(key: string): OptionProcessorFunction {\n return ({ value, providedType, localization }) => {\n if (value === undefined) {\n return [];\n }\n typeCheckDateArray(key, value, providedType, localization);\n return value;\n };\n}\n\nfunction validKeyOption(keyOptions: string[]): OptionProcessorFunction {\n return ({ value, path }) => {\n if (!keyOptions.includes(value))\n Namespace.errorMessages.unexpectedOptionValue(\n path.substring(1),\n value,\n keyOptions\n );\n return value;\n };\n}\n\nconst optionProcessors: { [key: string]: OptionProcessorFunction } =\n Object.freeze({\n defaultDate: mandatoryDate('defaultDate'),\n viewDate: mandatoryDate('viewDate'),\n minDate: optionalDate('restrictions.minDate'),\n maxDate: optionalDate('restrictions.maxDate'),\n disabledHours: validHourRange('restrictions.disabledHours'),\n enabledHours: validHourRange('restrictions.enabledHours'),\n disabledDates: validDateArray('restrictions.disabledDates'),\n enabledDates: validDateArray('restrictions.enabledDates'),\n daysOfWeekDisabled: numbersInRange('restrictions.daysOfWeekDisabled', 0, 6),\n disabledTimeIntervals: ({ key, value, providedType, localization }) => {\n if (value === undefined) {\n return [];\n }\n if (!Array.isArray(value)) {\n Namespace.errorMessages.typeMismatch(\n key,\n providedType,\n 'array of { from: DateTime|Date, to: DateTime|Date }'\n );\n }\n const valueObject = value as { from: any; to: any }[]; //eslint-disable-line @typescript-eslint/no-explicit-any\n for (let i = 0; i < valueObject.length; i++) {\n Object.keys(valueObject[i]).forEach((vk) => {\n const subOptionName = `${key}[${i}].${vk}`;\n const d = valueObject[i][vk];\n const dateTime = convertToDateTime(d, subOptionName, localization);\n dateTime.setLocalization(localization);\n valueObject[i][vk] = dateTime;\n });\n }\n return valueObject;\n },\n toolbarPlacement: validKeyOption(['top', 'bottom', 'default']),\n type: validKeyOption(['icons', 'sprites']),\n viewMode: validKeyOption([\n 'clock',\n 'calendar',\n 'months',\n 'years',\n 'decades',\n ]),\n theme: validKeyOption(['light', 'dark', 'auto']),\n placement: validKeyOption(['top', 'bottom']),\n meta: ({ value }) => value,\n dayViewHeaderFormat: ({ value }) => value,\n container: ({ value, path }) => {\n if (\n value &&\n !(\n value instanceof HTMLElement ||\n value instanceof Element ||\n value?.appendChild\n )\n ) {\n Namespace.errorMessages.typeMismatch(\n path.substring(1),\n typeof value,\n 'HTMLElement'\n );\n }\n return value;\n },\n useTwentyfourHour: ({ value, path, providedType, defaultType }) => {\n Namespace.errorMessages.deprecatedWarning(\n 'useTwentyfourHour',\n 'Please use \"options.localization.hourCycle\" instead'\n );\n if (value === undefined || providedType === 'boolean') return value;\n Namespace.errorMessages.typeMismatch(path, providedType, defaultType);\n },\n hourCycle: validKeyOption(['h11', 'h12', 'h23', 'h24']),\n });\n\nconst defaultProcessor: OptionProcessorFunction = ({\n value,\n defaultType,\n providedType,\n path,\n}) => {\n switch (defaultType) {\n case 'boolean':\n return value === 'true' || value === true;\n case 'number':\n return +value;\n case 'string':\n return value.toString();\n case 'object':\n return {};\n case 'function':\n return value;\n default:\n Namespace.errorMessages.typeMismatch(path, providedType, defaultType);\n }\n};\n\nexport function processKey(this: void, args: OptionProcessorFunctionArguments) {\n return (optionProcessors[args.key] || defaultProcessor)(args);\n}\n","import Namespace from './namespace';\nimport { DateTime } from '../datetime';\nimport DefaultOptions from './default-options';\nimport Options, { FormatLocalization } from './options';\nimport { processKey } from './optionProcessor';\nimport {\n convertToDateTime,\n tryConvertToDateTime,\n typeCheckDateArray,\n typeCheckNumberArray,\n} from './typeChecker';\n\nexport class OptionConverter {\n private static ignoreProperties = [\n 'meta',\n 'dayViewHeaderFormat',\n 'container',\n 'dateForms',\n 'ordinal',\n ];\n\n static deepCopy(input): Options {\n const o = {};\n\n Object.keys(input).forEach((key) => {\n const inputElement = input[key];\n\n if (inputElement instanceof DateTime) {\n o[key] = inputElement.clone;\n return;\n } else if (inputElement instanceof Date) {\n o[key] = new Date(inputElement.valueOf());\n return;\n }\n\n o[key] = inputElement;\n if (\n typeof inputElement !== 'object' ||\n inputElement instanceof HTMLElement ||\n inputElement instanceof Element\n )\n return;\n if (!Array.isArray(inputElement)) {\n o[key] = OptionConverter.deepCopy(inputElement);\n }\n });\n\n return o;\n }\n\n private static isValue = (a) => a != null; // everything except undefined + null\n\n /**\n * Finds value out of an object based on a string, period delimited, path\n * @param paths\n * @param obj\n */\n static objectPath(paths: string, obj) {\n if (paths.charAt(0) === '.') paths = paths.slice(1);\n if (!paths) return obj;\n return paths\n .split('.')\n .reduce(\n (value, key) =>\n OptionConverter.isValue(value) || OptionConverter.isValue(value[key])\n ? value[key]\n : undefined,\n obj\n );\n }\n\n /**\n * The spread operator caused sub keys to be missing after merging.\n * This is to fix that issue by using spread on the child objects first.\n * Also handles complex options like disabledDates\n * @param provided An option from new providedOptions\n * @param copyTo Destination object. This was added to prevent reference copies\n * @param localization\n * @param path\n */\n static spread(provided, copyTo, localization: FormatLocalization, path = '') {\n const defaultOptions = OptionConverter.objectPath(path, DefaultOptions);\n\n const unsupportedOptions = Object.keys(provided).filter(\n (x) => !Object.keys(defaultOptions).includes(x)\n );\n\n if (unsupportedOptions.length > 0) {\n const flattenedOptions = OptionConverter.getFlattenDefaultOptions();\n\n const errors = unsupportedOptions.map((x) => {\n let error = `\"${path}.${x}\" in not a known option.`;\n const didYouMean = flattenedOptions.find((y) => y.includes(x));\n if (didYouMean) error += ` Did you mean \"${didYouMean}\"?`;\n return error;\n });\n Namespace.errorMessages.unexpectedOptions(errors);\n }\n\n Object.keys(provided)\n .filter((key) => key !== '__proto__' && key !== 'constructor')\n .forEach((key) => {\n path += `.${key}`;\n if (path.charAt(0) === '.') path = path.slice(1);\n\n const defaultOptionValue = defaultOptions[key];\n const providedType = typeof provided[key];\n const defaultType = typeof defaultOptionValue;\n const value = provided[key];\n\n if (value === undefined || value === null) {\n copyTo[key] = value;\n path = path.substring(0, path.lastIndexOf(`.${key}`));\n return;\n }\n\n if (\n typeof defaultOptionValue === 'object' &&\n !Array.isArray(provided[key]) &&\n !(\n defaultOptionValue instanceof Date ||\n OptionConverter.ignoreProperties.includes(key)\n )\n ) {\n OptionConverter.spread(\n provided[key],\n copyTo[key],\n localization,\n path\n );\n } else {\n copyTo[key] = OptionConverter.processKey(\n key,\n value,\n providedType,\n defaultType,\n path,\n localization\n );\n }\n\n path = path.substring(0, path.lastIndexOf(`.${key}`));\n });\n }\n\n static processKey(\n key: string,\n value: any, //eslint-disable-line @typescript-eslint/no-explicit-any\n providedType: string,\n defaultType: string,\n path: string,\n localization: FormatLocalization\n ) {\n return processKey({\n key,\n value,\n providedType,\n defaultType,\n path,\n localization,\n });\n }\n\n static _mergeOptions(providedOptions: Options, mergeTo: Options): Options {\n const newConfig = OptionConverter.deepCopy(mergeTo);\n //see if the options specify a locale\n const localization =\n mergeTo.localization?.locale !== 'default'\n ? mergeTo.localization\n : providedOptions?.localization || DefaultOptions.localization;\n\n OptionConverter.spread(providedOptions, newConfig, localization, '');\n\n return newConfig;\n }\n\n static _dataToOptions(element, options: Options): Options {\n const eData = JSON.parse(JSON.stringify(element.dataset));\n\n if (eData?.tdTargetInput) delete eData.tdTargetInput;\n if (eData?.tdTargetToggle) delete eData.tdTargetToggle;\n\n if (\n !eData ||\n Object.keys(eData).length === 0 ||\n eData.constructor !== DOMStringMap\n )\n return options;\n const dataOptions = {} as Options;\n\n // because dataset returns camelCase including the 'td' key the option\n // key won't align\n const objectToNormalized = (object) => {\n const lowered = {};\n Object.keys(object).forEach((x) => {\n lowered[x.toLowerCase()] = x;\n });\n\n return lowered;\n };\n\n const normalizeObject = this.normalizeObject(objectToNormalized);\n const optionsLower = objectToNormalized(options);\n\n Object.keys(eData)\n .filter((x) => x.startsWith(Namespace.dataKey))\n .map((x) => x.substring(2))\n .forEach((key) => {\n let keyOption = optionsLower[key.toLowerCase()];\n\n // dataset merges dashes to camelCase... yay\n // i.e. key = display_components_seconds\n if (key.includes('_')) {\n // [display, components, seconds]\n const split = key.split('_');\n // display\n keyOption = optionsLower[split[0].toLowerCase()];\n if (\n keyOption !== undefined &&\n options[keyOption].constructor === Object\n ) {\n dataOptions[keyOption] = normalizeObject(\n split,\n 1,\n options[keyOption],\n eData[`td${key}`]\n );\n }\n }\n // or key = multipleDate\n else if (keyOption !== undefined) {\n dataOptions[keyOption] = eData[`td${key}`];\n }\n });\n\n return this._mergeOptions(dataOptions, options);\n }\n\n //todo clean this up\n private static normalizeObject(objectToNormalized: (object) => object) {\n const normalizeObject = (\n split: string[],\n index: number,\n optionSubgroup: unknown,\n value: unknown\n ) => {\n // first round = display { ... }\n const normalizedOptions = objectToNormalized(optionSubgroup);\n\n const keyOption = normalizedOptions[split[index].toLowerCase()];\n const internalObject = {};\n\n if (keyOption === undefined) return internalObject;\n\n // if this is another object, continue down the rabbit hole\n if (optionSubgroup[keyOption].constructor === Object) {\n index++;\n internalObject[keyOption] = normalizeObject(\n split,\n index,\n optionSubgroup[keyOption],\n value\n );\n } else {\n internalObject[keyOption] = value;\n }\n return internalObject;\n };\n return normalizeObject;\n }\n\n /**\n * Attempts to prove `d` is a DateTime or Date or can be converted into one.\n * @param d If a string will attempt creating a date from it.\n * @param localization object containing locale and format settings. Only used with the custom formats\n * @private\n */\n static _dateTypeCheck(\n d: any, //eslint-disable-line @typescript-eslint/no-explicit-any\n localization: FormatLocalization\n ): DateTime | null {\n return tryConvertToDateTime(d, localization);\n }\n\n /**\n * Type checks that `value` is an array of Date or DateTime\n * @param optionName Provides text to error messages e.g. disabledDates\n * @param value Option value\n * @param providedType Used to provide text to error messages\n * @param localization\n */\n static _typeCheckDateArray(\n optionName: string,\n value,\n providedType: string,\n localization: FormatLocalization\n ) {\n return typeCheckDateArray(optionName, value, providedType, localization);\n }\n\n /**\n * Type checks that `value` is an array of numbers\n * @param optionName Provides text to error messages e.g. disabledDates\n * @param value Option value\n * @param providedType Used to provide text to error messages\n */\n static _typeCheckNumberArray(\n optionName: string,\n value,\n providedType: string\n ) {\n return typeCheckNumberArray(optionName, value, providedType);\n }\n\n /**\n * Attempts to convert `d` to a DateTime object\n * @param d value to convert\n * @param optionName Provides text to error messages e.g. disabledDates\n * @param localization object containing locale and format settings. Only used with the custom formats\n */\n static dateConversion(\n d: any, //eslint-disable-line @typescript-eslint/no-explicit-any\n optionName: string,\n localization: FormatLocalization\n ): DateTime {\n return convertToDateTime(d, optionName, localization);\n }\n\n private static _flattenDefaults: string[];\n\n private static getFlattenDefaultOptions(): string[] {\n if (this._flattenDefaults) return this._flattenDefaults;\n const deepKeys = (t, pre = []) => {\n if (Array.isArray(t)) return [];\n if (Object(t) === t) {\n return Object.entries(t).flatMap(([k, v]) => deepKeys(v, [...pre, k]));\n } else {\n return pre.join('.');\n }\n };\n\n this._flattenDefaults = deepKeys(DefaultOptions);\n\n return this._flattenDefaults;\n }\n\n /**\n * Some options conflict like min/max date. Verify that these kinds of options\n * are set correctly.\n * @param config\n */\n static _validateConflicts(config: Options) {\n if (\n config.display.sideBySide &&\n (!config.display.components.clock ||\n !(\n config.display.components.hours ||\n config.display.components.minutes ||\n config.display.components.seconds\n ))\n ) {\n Namespace.errorMessages.conflictingConfiguration(\n 'Cannot use side by side mode without the clock components'\n );\n }\n\n if (config.restrictions.minDate && config.restrictions.maxDate) {\n if (config.restrictions.minDate.isAfter(config.restrictions.maxDate)) {\n Namespace.errorMessages.conflictingConfiguration(\n 'minDate is after maxDate'\n );\n }\n\n if (config.restrictions.maxDate.isBefore(config.restrictions.minDate)) {\n Namespace.errorMessages.conflictingConfiguration(\n 'maxDate is before minDate'\n );\n }\n }\n\n if (config.multipleDates && config.dateRange) {\n Namespace.errorMessages.conflictingConfiguration(\n 'Cannot uss option \"multipleDates\" with \"dateRange\"'\n );\n }\n }\n}\n","import { DateTime, getFormatByUnit, Unit } from './datetime';\nimport Namespace from './utilities/namespace';\nimport { ChangeEvent, FailEvent } from './utilities/event-types';\nimport Validation from './validation';\nimport { serviceLocator } from './utilities/service-locator';\nimport { EventEmitters } from './utilities/event-emitter';\nimport { OptionsStore } from './utilities/optionsStore';\nimport { OptionConverter } from './utilities/optionConverter';\n\nexport default class Dates {\n private _dates: DateTime[] = [];\n private optionsStore: OptionsStore;\n private validation: Validation;\n private _eventEmitters: EventEmitters;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.validation = serviceLocator.locate(Validation);\n this._eventEmitters = serviceLocator.locate(EventEmitters);\n }\n\n /**\n * Returns the array of selected dates\n */\n get picked(): DateTime[] {\n return [...this._dates];\n }\n\n /**\n * Returns the last picked value.\n */\n get lastPicked(): DateTime {\n return this._dates[this.lastPickedIndex]?.clone;\n }\n\n /**\n * Returns the length of picked dates -1 or 0 if none are selected.\n */\n get lastPickedIndex(): number {\n if (this._dates.length === 0) return 0;\n return this._dates.length - 1;\n }\n\n /**\n * Formats a DateTime object to a string. Used when setting the input value.\n * @param date\n */\n formatInput(date: DateTime): string {\n if (!date) return '';\n date.localization = this.optionsStore.options.localization;\n return date.format();\n }\n\n /**\n * parse the value into a DateTime object.\n * this can be overwritten to supply your own parsing.\n */\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n parseInput(value: any): DateTime {\n return OptionConverter.dateConversion(\n value,\n 'input',\n this.optionsStore.options.localization\n );\n }\n\n /**\n * Tries to convert the provided value to a DateTime object.\n * If value is null|undefined then clear the value of the provided index (or 0).\n * @param value Value to convert or null|undefined\n * @param index When using multidates this is the index in the array\n */\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n setFromInput(value: any, index?: number) {\n if (!value) {\n this.setValue(undefined, index);\n return;\n }\n const converted = this.parseInput(value);\n if (converted) {\n converted.setLocalization(this.optionsStore.options.localization);\n this.setValue(converted, index);\n }\n }\n\n /**\n * Adds a new DateTime to selected dates array\n * @param date\n */\n add(date: DateTime): void {\n this._dates.push(date);\n }\n\n /**\n * Returns true if the `targetDate` is part of the selected dates array.\n * If `unit` is provided then a granularity to that unit will be used.\n * @param targetDate\n * @param unit\n */\n isPicked(targetDate: DateTime, unit?: Unit): boolean {\n if (!DateTime.isValid(targetDate)) return false;\n if (!unit)\n return this._dates.find((x) => x.isSame(targetDate)) !== undefined;\n\n const format = getFormatByUnit(unit);\n\n const innerDateFormatted = targetDate.format(format);\n\n return (\n this._dates\n .map((x) => x.format(format))\n .find((x) => x === innerDateFormatted) !== undefined\n );\n }\n\n /**\n * Returns the index at which `targetDate` is in the array.\n * This is used for updating or removing a date when multi-date is used\n * If `unit` is provided then a granularity to that unit will be used.\n * @param targetDate\n * @param unit\n */\n pickedIndex(targetDate: DateTime, unit?: Unit): number {\n if (!DateTime.isValid(targetDate)) return -1;\n if (!unit)\n return this._dates.map((x) => x.valueOf()).indexOf(targetDate.valueOf());\n\n const format = getFormatByUnit(unit);\n\n const innerDateFormatted = targetDate.format(format);\n\n return this._dates.map((x) => x.format(format)).indexOf(innerDateFormatted);\n }\n\n /**\n * Clears all selected dates.\n */\n clear() {\n this.optionsStore.unset = true;\n this._eventEmitters.triggerEvent.emit({\n type: Namespace.events.change,\n date: undefined,\n oldDate: this.lastPicked,\n isClear: true,\n isValid: true,\n } as ChangeEvent);\n this._dates = [];\n if (this.optionsStore.input) this.optionsStore.input.value = '';\n this._eventEmitters.updateDisplay.emit('all');\n }\n\n /**\n * Find the \"book end\" years given a `year` and a `factor`\n * @param factor e.g. 100 for decades\n * @param year e.g. 2021\n */\n static getStartEndYear(\n factor: number,\n year: number\n ): [number, number, number] {\n const step = factor / 10,\n startYear = Math.floor(year / factor) * factor,\n endYear = startYear + step * 9,\n focusValue = Math.floor(year / step) * step;\n return [startYear, endYear, focusValue];\n }\n\n updateInput(target?: DateTime) {\n if (!this.optionsStore.input) return;\n\n let newValue = this.formatInput(target);\n if (\n this.optionsStore.options.multipleDates ||\n this.optionsStore.options.dateRange\n ) {\n newValue = this._dates\n .map((d) => this.formatInput(d))\n .join(this.optionsStore.options.multipleDatesSeparator);\n }\n if (this.optionsStore.input.value != newValue)\n this.optionsStore.input.value = newValue;\n }\n\n /**\n * Attempts to either clear or set the `target` date at `index`.\n * If the `target` is null then the date will be cleared.\n * If multi-date is being used then it will be removed from the array.\n * If `target` is valid and multi-date is used then if `index` is\n * provided the date at that index will be replaced, otherwise it is appended.\n * @param target\n * @param index\n */\n setValue(target?: DateTime, index?: number): void {\n const noIndex = typeof index === 'undefined',\n isClear = !target && noIndex;\n let oldDate = this.optionsStore.unset ? null : this._dates[index]?.clone;\n if (!oldDate && !this.optionsStore.unset && noIndex && isClear) {\n oldDate = this.lastPicked;\n }\n\n if (target && oldDate?.isSame(target)) {\n this.updateInput(target);\n return;\n }\n\n // case of calling setValue(null)\n if (!target) {\n this._setValueNull(isClear, index, oldDate);\n return;\n }\n\n index = index || 0;\n target = target.clone;\n\n // minute stepping is being used, force the minute to the closest value\n if (this.optionsStore.options.stepping !== 1) {\n target.minutes =\n Math.round(target.minutes / this.optionsStore.options.stepping) *\n this.optionsStore.options.stepping;\n target.startOf(Unit.minutes);\n }\n\n const onUpdate = (isValid: boolean) => {\n this._dates[index] = target;\n this._eventEmitters.updateViewDate.emit(target.clone);\n\n this.updateInput(target);\n\n this.optionsStore.unset = false;\n this._eventEmitters.updateDisplay.emit('all');\n this._eventEmitters.triggerEvent.emit({\n type: Namespace.events.change,\n date: target,\n oldDate,\n isClear,\n isValid: isValid,\n } as ChangeEvent);\n };\n\n if (\n this.validation.isValid(target) &&\n this.validation.dateRangeIsValid(this.picked, index, target)\n ) {\n onUpdate(true);\n return;\n }\n\n if (this.optionsStore.options.keepInvalid) {\n onUpdate(false);\n }\n\n this._eventEmitters.triggerEvent.emit({\n type: Namespace.events.error,\n reason: Namespace.errorMessages.failedToSetInvalidDate,\n date: target,\n oldDate,\n } as FailEvent);\n }\n\n private _setValueNull(isClear: boolean, index: number, oldDate: DateTime) {\n if (\n !this.optionsStore.options.multipleDates ||\n this._dates.length === 1 ||\n isClear\n ) {\n this.optionsStore.unset = true;\n this._dates = [];\n } else {\n this._dates.splice(index, 1);\n }\n\n this.updateInput();\n\n this._eventEmitters.triggerEvent.emit({\n type: Namespace.events.change,\n date: undefined,\n oldDate,\n isClear,\n isValid: true,\n } as ChangeEvent);\n\n this._eventEmitters.updateDisplay.emit('all');\n }\n}\n","enum ActionTypes {\n next = 'next',\n previous = 'previous',\n changeCalendarView = 'changeCalendarView',\n selectMonth = 'selectMonth',\n selectYear = 'selectYear',\n selectDecade = 'selectDecade',\n selectDay = 'selectDay',\n selectHour = 'selectHour',\n selectMinute = 'selectMinute',\n selectSecond = 'selectSecond',\n incrementHours = 'incrementHours',\n incrementMinutes = 'incrementMinutes',\n incrementSeconds = 'incrementSeconds',\n decrementHours = 'decrementHours',\n decrementMinutes = 'decrementMinutes',\n decrementSeconds = 'decrementSeconds',\n toggleMeridiem = 'toggleMeridiem',\n togglePicker = 'togglePicker',\n showClock = 'showClock',\n showHours = 'showHours',\n showMinutes = 'showMinutes',\n showSeconds = 'showSeconds',\n clear = 'clear',\n close = 'close',\n today = 'today',\n}\n\nexport default ActionTypes;\n","import { DateTime, Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport Dates from '../../dates';\nimport { Paint } from '../index';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `date`\n */\nexport default class DateDisplay {\n private optionsStore: OptionsStore;\n private dates: Dates;\n private validation: Validation;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.dates = serviceLocator.locate(Dates);\n this.validation = serviceLocator.locate(Validation);\n }\n\n /**\n * Build the container html for the display\n * @private\n */\n getPicker(): HTMLElement {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.daysContainer);\n\n container.append(...this._daysOfTheWeek());\n\n if (this.optionsStore.options.display.calendarWeeks) {\n const div = document.createElement('div');\n div.classList.add(Namespace.css.calendarWeeks, Namespace.css.noHighlight);\n container.appendChild(div);\n }\n\n const { rangeHoverEvent, rangeHoverOutEvent } =\n this.handleMouseEvents(container);\n\n for (let i = 0; i < 42; i++) {\n if (i !== 0 && i % 7 === 0) {\n if (this.optionsStore.options.display.calendarWeeks) {\n const div = document.createElement('div');\n div.classList.add(\n Namespace.css.calendarWeeks,\n Namespace.css.noHighlight\n );\n container.appendChild(div);\n }\n }\n\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.selectDay);\n container.appendChild(div);\n\n // if hover is supported then add the events\n if (\n matchMedia('(hover: hover)').matches &&\n this.optionsStore.options.dateRange\n ) {\n div.addEventListener('mouseover', rangeHoverEvent);\n div.addEventListener('mouseout', rangeHoverOutEvent);\n }\n }\n\n return container;\n }\n\n /**\n * Populates the grid and updates enabled states\n * @private\n */\n _update(widget: HTMLElement, paint: Paint): void {\n const container = widget.getElementsByClassName(\n Namespace.css.daysContainer\n )[0] as HTMLElement;\n\n this._updateCalendarView(container);\n\n const innerDate = this.optionsStore.viewDate.clone\n .startOf(Unit.month)\n .startOf('weekDay', this.optionsStore.options.localization.startOfTheWeek)\n .manipulate(12, Unit.hours);\n\n this._handleCalendarWeeks(container, innerDate.clone);\n\n container\n .querySelectorAll(`[data-action=\"${ActionTypes.selectDay}\"]`)\n .forEach((element: HTMLElement) => {\n const classes: string[] = [];\n classes.push(Namespace.css.day);\n\n if (innerDate.isBefore(this.optionsStore.viewDate, Unit.month)) {\n classes.push(Namespace.css.old);\n }\n if (innerDate.isAfter(this.optionsStore.viewDate, Unit.month)) {\n classes.push(Namespace.css.new);\n }\n\n if (\n !this.optionsStore.unset &&\n !this.optionsStore.options.dateRange &&\n this.dates.isPicked(innerDate, Unit.date)\n ) {\n classes.push(Namespace.css.active);\n }\n if (!this.validation.isValid(innerDate, Unit.date)) {\n classes.push(Namespace.css.disabled);\n }\n if (innerDate.isSame(new DateTime(), Unit.date)) {\n classes.push(Namespace.css.today);\n }\n if (innerDate.weekDay === 0 || innerDate.weekDay === 6) {\n classes.push(Namespace.css.weekend);\n }\n\n this._handleDateRange(innerDate, classes);\n\n paint(Unit.date, innerDate, classes, element);\n\n element.classList.remove(...element.classList);\n element.classList.add(...classes);\n element.setAttribute('data-value', this._dateToDataValue(innerDate));\n element.setAttribute('data-day', `${innerDate.date}`);\n element.innerText = innerDate.parts(undefined, {\n day: 'numeric',\n }).day;\n innerDate.manipulate(1, Unit.date);\n });\n }\n\n private _dateToDataValue(date: DateTime): string {\n if (!DateTime.isValid(date)) return '';\n\n return `${date.year}-${date.monthFormatted}-${date.dateFormatted}`;\n }\n\n private _handleDateRange(innerDate: DateTime, classes: string[]) {\n const rangeStart = this.dates.picked[0];\n const rangeEnd = this.dates.picked[1];\n\n if (this.optionsStore.options.dateRange) {\n if (innerDate.isBetween(rangeStart, rangeEnd, Unit.date)) {\n classes.push(Namespace.css.rangeIn);\n }\n\n if (innerDate.isSame(rangeStart, Unit.date)) {\n classes.push(Namespace.css.rangeStart);\n }\n\n if (innerDate.isSame(rangeEnd, Unit.date)) {\n classes.push(Namespace.css.rangeEnd);\n }\n }\n }\n\n private handleMouseEvents(container: HTMLElement) {\n const rangeHoverEvent = (e: MouseEvent) => {\n const currentTarget = e?.currentTarget as HTMLElement;\n\n // if we have 0 or 2 selected or if the target is disabled then ignore\n if (\n this.dates.picked.length !== 1 ||\n currentTarget.classList.contains(Namespace.css.disabled)\n )\n return;\n\n // select all the date divs\n const allDays = [...container.querySelectorAll('.day')] as HTMLElement[];\n\n // get the date value from the element being hovered over\n const attributeValue = currentTarget.getAttribute('data-value');\n\n // format the string to a date\n const innerDate = DateTime.fromString(attributeValue, {\n format: 'yyyy-MM-dd',\n });\n\n // find the position of the target in the date container\n const dayIndex = allDays.findIndex(\n (e) => e.getAttribute('data-value') === attributeValue\n );\n\n // find the first and second selected dates\n const rangeStart = this.dates.picked[0];\n const rangeEnd = this.dates.picked[1];\n\n //format the start date so that it can be found by the attribute\n const rangeStartFormatted = this._dateToDataValue(rangeStart);\n const rangeStartIndex = allDays.findIndex(\n (e) => e.getAttribute('data-value') === rangeStartFormatted\n );\n const rangeStartElement = allDays[rangeStartIndex];\n\n //make sure we don't leave start/end classes if we don't need them\n if (!innerDate.isSame(rangeStart, Unit.date)) {\n currentTarget.classList.remove(Namespace.css.rangeStart);\n }\n\n if (!innerDate.isSame(rangeEnd, Unit.date)) {\n currentTarget.classList.remove(Namespace.css.rangeEnd);\n }\n\n // the following figures out which direct from start date is selected\n // the selection \"cap\" classes are applied if needed\n // otherwise all the dates between will get the `rangeIn` class.\n // We make this selection based on the element's index and the rangeStart index\n\n let lambda: (_, index) => boolean;\n\n if (innerDate.isBefore(rangeStart)) {\n currentTarget.classList.add(Namespace.css.rangeStart);\n rangeStartElement?.classList.remove(Namespace.css.rangeStart);\n rangeStartElement?.classList.add(Namespace.css.rangeEnd);\n lambda = (_, index) => index > dayIndex && index < rangeStartIndex;\n } else {\n currentTarget.classList.add(Namespace.css.rangeEnd);\n rangeStartElement?.classList.remove(Namespace.css.rangeEnd);\n rangeStartElement?.classList.add(Namespace.css.rangeStart);\n lambda = (_, index) => index < dayIndex && index > rangeStartIndex;\n }\n\n allDays.filter(lambda).forEach((e) => {\n e.classList.add(Namespace.css.rangeIn);\n });\n };\n\n const rangeHoverOutEvent = (e: MouseEvent) => {\n // find all the dates in the container\n const allDays = [...container.querySelectorAll('.day')] as HTMLElement[];\n\n // if only the start is selected, remove all the rangeIn classes\n // we do this because once the user hovers over a new date the range will be recalculated.\n if (this.dates.picked.length === 1)\n allDays.forEach((e) => e.classList.remove(Namespace.css.rangeIn));\n\n // if we have 0 or 2 dates selected then ignore\n if (this.dates.picked.length !== 1) return;\n\n const currentTarget = e?.currentTarget as HTMLElement;\n\n // get the elements date from the attribute value\n const innerDate = new DateTime(currentTarget.getAttribute('data-value'));\n\n // verify selections and remove invalid classes\n if (!innerDate.isSame(this.dates.picked[0], Unit.date)) {\n currentTarget.classList.remove(Namespace.css.rangeStart);\n }\n\n if (!innerDate.isSame(this.dates.picked[1], Unit.date)) {\n currentTarget.classList.remove(Namespace.css.rangeEnd);\n }\n };\n\n return { rangeHoverEvent, rangeHoverOutEvent };\n }\n\n private _updateCalendarView(container: Element) {\n if (this.optionsStore.currentView !== 'calendar') return;\n const [previous, switcher, next] = container.parentElement\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\n .getElementsByTagName('div');\n switcher.setAttribute(\n Namespace.css.daysContainer,\n this.optionsStore.viewDate.format(\n this.optionsStore.options.localization.dayViewHeaderFormat\n )\n );\n this.optionsStore.options.display.components.month\n ? switcher.classList.remove(Namespace.css.disabled)\n : switcher.classList.add(Namespace.css.disabled);\n this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.month),\n Unit.month\n )\n ? previous.classList.remove(Namespace.css.disabled)\n : previous.classList.add(Namespace.css.disabled);\n this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(1, Unit.month),\n Unit.month\n )\n ? next.classList.remove(Namespace.css.disabled)\n : next.classList.add(Namespace.css.disabled);\n }\n\n /***\n * Generates a html row that contains the days of the week.\n * @private\n */\n private _daysOfTheWeek(): HTMLElement[] {\n const innerDate = this.optionsStore.viewDate.clone\n .startOf('weekDay', this.optionsStore.options.localization.startOfTheWeek)\n .startOf(Unit.date);\n const row = [];\n document.createElement('div');\n\n if (this.optionsStore.options.display.calendarWeeks) {\n const htmlDivElement = document.createElement('div');\n htmlDivElement.classList.add(\n Namespace.css.calendarWeeks,\n Namespace.css.noHighlight\n );\n htmlDivElement.innerText = '#';\n row.push(htmlDivElement);\n }\n\n for (let i = 0; i < 7; i++) {\n const htmlDivElement = document.createElement('div');\n htmlDivElement.classList.add(\n Namespace.css.dayOfTheWeek,\n Namespace.css.noHighlight\n );\n let weekDay = innerDate.format({ weekday: 'short' });\n if (this.optionsStore.options.localization.maxWeekdayLength > 0)\n weekDay = weekDay.substring(\n 0,\n this.optionsStore.options.localization.maxWeekdayLength\n );\n htmlDivElement.innerText = weekDay;\n innerDate.manipulate(1, Unit.date);\n row.push(htmlDivElement);\n }\n\n return row;\n }\n\n private _handleCalendarWeeks(container: HTMLElement, innerDate: DateTime) {\n [...container.querySelectorAll(`.${Namespace.css.calendarWeeks}`)]\n .filter((e: HTMLElement) => e.innerText !== '#')\n .forEach((element: HTMLElement) => {\n element.innerText = `${innerDate.week}`;\n innerDate.manipulate(7, Unit.date);\n });\n }\n}\n","import { Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport Dates from '../../dates';\nimport { Paint } from '../index';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `month`\n */\nexport default class MonthDisplay {\n private optionsStore: OptionsStore;\n private dates: Dates;\n private validation: Validation;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.dates = serviceLocator.locate(Dates);\n this.validation = serviceLocator.locate(Validation);\n }\n /**\n * Build the container html for the display\n * @private\n */\n getPicker(): HTMLElement {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.monthsContainer);\n\n for (let i = 0; i < 12; i++) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.selectMonth);\n container.appendChild(div);\n }\n\n return container;\n }\n\n /**\n * Populates the grid and updates enabled states\n * @private\n */\n _update(widget: HTMLElement, paint: Paint): void {\n const container = widget.getElementsByClassName(\n Namespace.css.monthsContainer\n )[0];\n\n if (this.optionsStore.currentView === 'months') {\n const [previous, switcher, next] = container.parentElement\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\n .getElementsByTagName('div');\n\n switcher.setAttribute(\n Namespace.css.monthsContainer,\n this.optionsStore.viewDate.format({ year: 'numeric' })\n );\n\n this.optionsStore.options.display.components.year\n ? switcher.classList.remove(Namespace.css.disabled)\n : switcher.classList.add(Namespace.css.disabled);\n\n this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.year),\n Unit.year\n )\n ? previous.classList.remove(Namespace.css.disabled)\n : previous.classList.add(Namespace.css.disabled);\n\n this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(1, Unit.year),\n Unit.year\n )\n ? next.classList.remove(Namespace.css.disabled)\n : next.classList.add(Namespace.css.disabled);\n }\n\n const innerDate = this.optionsStore.viewDate.clone.startOf(Unit.year);\n\n container\n .querySelectorAll(`[data-action=\"${ActionTypes.selectMonth}\"]`)\n .forEach((containerClone: HTMLElement, index) => {\n const classes = [];\n classes.push(Namespace.css.month);\n\n if (\n !this.optionsStore.unset &&\n this.dates.isPicked(innerDate, Unit.month)\n ) {\n classes.push(Namespace.css.active);\n }\n if (!this.validation.isValid(innerDate, Unit.month)) {\n classes.push(Namespace.css.disabled);\n }\n\n paint(Unit.month, innerDate, classes, containerClone);\n\n containerClone.classList.remove(...containerClone.classList);\n containerClone.classList.add(...classes);\n containerClone.setAttribute('data-value', `${index}`);\n containerClone.innerText = `${innerDate.format({ month: 'short' })}`;\n innerDate.manipulate(1, Unit.month);\n });\n }\n}\n","import { DateTime, Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Dates from '../../dates';\nimport Validation from '../../validation';\nimport { Paint } from '../index';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `year`\n */\nexport default class YearDisplay {\n private _startYear: DateTime;\n private _endYear: DateTime;\n private optionsStore: OptionsStore;\n private dates: Dates;\n private validation: Validation;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.dates = serviceLocator.locate(Dates);\n this.validation = serviceLocator.locate(Validation);\n }\n\n /**\n * Build the container html for the display\n * @private\n */\n getPicker(): HTMLElement {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.yearsContainer);\n\n for (let i = 0; i < 12; i++) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.selectYear);\n container.appendChild(div);\n }\n\n return container;\n }\n\n /**\n * Populates the grid and updates enabled states\n * @private\n */\n _update(widget: HTMLElement, paint: Paint) {\n this._startYear = this.optionsStore.viewDate.clone.manipulate(\n -1,\n Unit.year\n );\n this._endYear = this.optionsStore.viewDate.clone.manipulate(10, Unit.year);\n\n const container = widget.getElementsByClassName(\n Namespace.css.yearsContainer\n )[0];\n\n if (this.optionsStore.currentView === 'years') {\n const [previous, switcher, next] = container.parentElement\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\n .getElementsByTagName('div');\n\n switcher.setAttribute(\n Namespace.css.yearsContainer,\n `${this._startYear.format({ year: 'numeric' })}-${this._endYear.format({\n year: 'numeric',\n })}`\n );\n\n this.optionsStore.options.display.components.decades\n ? switcher.classList.remove(Namespace.css.disabled)\n : switcher.classList.add(Namespace.css.disabled);\n\n this.validation.isValid(this._startYear, Unit.year)\n ? previous.classList.remove(Namespace.css.disabled)\n : previous.classList.add(Namespace.css.disabled);\n this.validation.isValid(this._endYear, Unit.year)\n ? next.classList.remove(Namespace.css.disabled)\n : next.classList.add(Namespace.css.disabled);\n }\n\n const innerDate = this.optionsStore.viewDate.clone\n .startOf(Unit.year)\n .manipulate(-1, Unit.year);\n\n container\n .querySelectorAll(`[data-action=\"${ActionTypes.selectYear}\"]`)\n .forEach((containerClone: HTMLElement) => {\n const classes = [];\n classes.push(Namespace.css.year);\n\n if (\n !this.optionsStore.unset &&\n this.dates.isPicked(innerDate, Unit.year)\n ) {\n classes.push(Namespace.css.active);\n }\n if (!this.validation.isValid(innerDate, Unit.year)) {\n classes.push(Namespace.css.disabled);\n }\n\n paint(Unit.year, innerDate, classes, containerClone);\n\n containerClone.classList.remove(...containerClone.classList);\n containerClone.classList.add(...classes);\n containerClone.setAttribute('data-value', `${innerDate.year}`);\n containerClone.innerText = innerDate.format({ year: 'numeric' });\n\n innerDate.manipulate(1, Unit.year);\n });\n }\n}\n","import Dates from '../../dates';\nimport { DateTime, Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport { Paint } from '../index';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `seconds`\n */\nexport default class DecadeDisplay {\n private _startDecade: DateTime;\n private _endDecade: DateTime;\n private optionsStore: OptionsStore;\n private dates: Dates;\n private validation: Validation;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.dates = serviceLocator.locate(Dates);\n this.validation = serviceLocator.locate(Validation);\n }\n\n /**\n * Build the container html for the display\n * @private\n */\n getPicker() {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.decadesContainer);\n\n for (let i = 0; i < 12; i++) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.selectDecade);\n container.appendChild(div);\n }\n return container;\n }\n\n /**\n * Populates the grid and updates enabled states\n * @private\n */\n _update(widget: HTMLElement, paint: Paint) {\n const [start, end] = Dates.getStartEndYear(\n 100,\n this.optionsStore.viewDate.year\n );\n this._startDecade = this.optionsStore.viewDate.clone.startOf(Unit.year);\n this._startDecade.year = start;\n this._endDecade = this.optionsStore.viewDate.clone.startOf(Unit.year);\n this._endDecade.year = end;\n\n const container = widget.getElementsByClassName(\n Namespace.css.decadesContainer\n )[0];\n\n const [previous, switcher, next] = container.parentElement\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\n .getElementsByTagName('div');\n\n if (this.optionsStore.currentView === 'decades') {\n switcher.setAttribute(\n Namespace.css.decadesContainer,\n `${this._startDecade.format({\n year: 'numeric',\n })}-${this._endDecade.format({ year: 'numeric' })}`\n );\n\n this.validation.isValid(this._startDecade, Unit.year)\n ? previous.classList.remove(Namespace.css.disabled)\n : previous.classList.add(Namespace.css.disabled);\n this.validation.isValid(this._endDecade, Unit.year)\n ? next.classList.remove(Namespace.css.disabled)\n : next.classList.add(Namespace.css.disabled);\n }\n\n const pickedYears = this.dates.picked.map((x) => x.year);\n\n container\n .querySelectorAll(`[data-action=\"${ActionTypes.selectDecade}\"]`)\n .forEach((containerClone: HTMLElement, index) => {\n if (index === 0) {\n containerClone.classList.add(Namespace.css.old);\n if (this._startDecade.year - 10 < 0) {\n containerClone.textContent = ' ';\n previous.classList.add(Namespace.css.disabled);\n containerClone.classList.add(Namespace.css.disabled);\n containerClone.setAttribute('data-value', '');\n return;\n } else {\n containerClone.innerText = this._startDecade.clone\n .manipulate(-10, Unit.year)\n .format({ year: 'numeric' });\n containerClone.setAttribute(\n 'data-value',\n `${this._startDecade.year}`\n );\n return;\n }\n }\n\n const classes = [];\n classes.push(Namespace.css.decade);\n const startDecadeYear = this._startDecade.year;\n const endDecadeYear = this._startDecade.year + 9;\n\n if (\n !this.optionsStore.unset &&\n pickedYears.filter((x) => x >= startDecadeYear && x <= endDecadeYear)\n .length > 0\n ) {\n classes.push(Namespace.css.active);\n }\n\n paint('decade', this._startDecade, classes, containerClone);\n\n containerClone.classList.remove(...containerClone.classList);\n containerClone.classList.add(...classes);\n containerClone.setAttribute('data-value', `${this._startDecade.year}`);\n containerClone.innerText = `${this._startDecade.format({\n year: 'numeric',\n })}`;\n\n this._startDecade.manipulate(10, Unit.year);\n });\n }\n}\n","import { Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport Dates from '../../dates';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates the clock display\n */\nexport default class TimeDisplay {\n private _gridColumns = '';\n private optionsStore: OptionsStore;\n private validation: Validation;\n private dates: Dates;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.dates = serviceLocator.locate(Dates);\n this.validation = serviceLocator.locate(Validation);\n }\n\n /**\n * Build the container html for the clock display\n * @private\n */\n getPicker(iconTag: (iconClass: string) => HTMLElement): HTMLElement {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.clockContainer);\n\n container.append(...this._grid(iconTag));\n\n return container;\n }\n\n /**\n * Populates the various elements with in the clock display\n * like the current hour and if the manipulation icons are enabled.\n * @private\n */\n _update(widget: HTMLElement): void {\n const timesDiv = (\n widget.getElementsByClassName(Namespace.css.clockContainer)[0]\n );\n let lastPicked = this.dates.lastPicked?.clone;\n if (!lastPicked && this.optionsStore.options.useCurrent)\n lastPicked = this.optionsStore.viewDate.clone;\n\n timesDiv\n .querySelectorAll('.disabled')\n .forEach((element) => element.classList.remove(Namespace.css.disabled));\n\n if (this.optionsStore.options.display.components.hours) {\n if (\n !this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(1, Unit.hours),\n Unit.hours\n )\n ) {\n timesDiv\n .querySelector(`[data-action=${ActionTypes.incrementHours}]`)\n .classList.add(Namespace.css.disabled);\n }\n\n if (\n !this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.hours),\n Unit.hours\n )\n ) {\n timesDiv\n .querySelector(`[data-action=${ActionTypes.decrementHours}]`)\n .classList.add(Namespace.css.disabled);\n }\n\n timesDiv.querySelector(\n `[data-time-component=${Unit.hours}]`\n ).innerText = lastPicked\n ? lastPicked.getHoursFormatted(\n this.optionsStore.options.localization.hourCycle\n )\n : '--';\n }\n\n if (this.optionsStore.options.display.components.minutes) {\n if (\n !this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(1, Unit.minutes),\n Unit.minutes\n )\n ) {\n timesDiv\n .querySelector(`[data-action=${ActionTypes.incrementMinutes}]`)\n .classList.add(Namespace.css.disabled);\n }\n\n if (\n !this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.minutes),\n Unit.minutes\n )\n ) {\n timesDiv\n .querySelector(`[data-action=${ActionTypes.decrementMinutes}]`)\n .classList.add(Namespace.css.disabled);\n }\n timesDiv.querySelector(\n `[data-time-component=${Unit.minutes}]`\n ).innerText = lastPicked ? lastPicked.minutesFormatted : '--';\n }\n\n if (this.optionsStore.options.display.components.seconds) {\n if (\n !this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(1, Unit.seconds),\n Unit.seconds\n )\n ) {\n timesDiv\n .querySelector(`[data-action=${ActionTypes.incrementSeconds}]`)\n .classList.add(Namespace.css.disabled);\n }\n\n if (\n !this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.seconds),\n Unit.seconds\n )\n ) {\n timesDiv\n .querySelector(`[data-action=${ActionTypes.decrementSeconds}]`)\n .classList.add(Namespace.css.disabled);\n }\n timesDiv.querySelector(\n `[data-time-component=${Unit.seconds}]`\n ).innerText = lastPicked ? lastPicked.secondsFormatted : '--';\n }\n\n if (this.optionsStore.isTwelveHour) {\n const toggle = timesDiv.querySelector(\n `[data-action=${ActionTypes.toggleMeridiem}]`\n );\n\n const meridiemDate = (lastPicked || this.optionsStore.viewDate).clone;\n\n toggle.innerText = meridiemDate.meridiem();\n\n if (\n !this.validation.isValid(\n meridiemDate.manipulate(\n meridiemDate.hours >= 12 ? -12 : 12,\n Unit.hours\n )\n )\n ) {\n toggle.classList.add(Namespace.css.disabled);\n } else {\n toggle.classList.remove(Namespace.css.disabled);\n }\n }\n\n timesDiv.style.gridTemplateAreas = `\"${this._gridColumns}\"`;\n }\n\n /**\n * Creates the table for the clock display depending on what options are selected.\n * @private\n */\n private _grid(iconTag: (iconClass: string) => HTMLElement): HTMLElement[] {\n this._gridColumns = '';\n const top = [],\n middle = [],\n bottom = [],\n separator = document.createElement('div'),\n upIcon = iconTag(this.optionsStore.options.display.icons.up),\n downIcon = iconTag(this.optionsStore.options.display.icons.down);\n\n separator.classList.add(Namespace.css.separator, Namespace.css.noHighlight);\n const separatorColon = separator.cloneNode(true);\n separatorColon.innerHTML = ':';\n\n const getSeparator = (colon = false): HTMLElement => {\n return colon\n ? separatorColon.cloneNode(true)\n : separator.cloneNode(true);\n };\n\n if (this.optionsStore.options.display.components.hours) {\n let divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.incrementHour\n );\n divElement.setAttribute('data-action', ActionTypes.incrementHours);\n divElement.appendChild(upIcon.cloneNode(true));\n top.push(divElement);\n\n divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.pickHour\n );\n divElement.setAttribute('data-action', ActionTypes.showHours);\n divElement.setAttribute('data-time-component', Unit.hours);\n middle.push(divElement);\n\n divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.decrementHour\n );\n divElement.setAttribute('data-action', ActionTypes.decrementHours);\n divElement.appendChild(downIcon.cloneNode(true));\n bottom.push(divElement);\n this._gridColumns += 'a';\n }\n\n if (this.optionsStore.options.display.components.minutes) {\n this._gridColumns += ' a';\n if (this.optionsStore.options.display.components.hours) {\n top.push(getSeparator());\n middle.push(getSeparator(true));\n bottom.push(getSeparator());\n this._gridColumns += ' a';\n }\n let divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.incrementMinute\n );\n divElement.setAttribute('data-action', ActionTypes.incrementMinutes);\n divElement.appendChild(upIcon.cloneNode(true));\n top.push(divElement);\n\n divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.pickMinute\n );\n divElement.setAttribute('data-action', ActionTypes.showMinutes);\n divElement.setAttribute('data-time-component', Unit.minutes);\n middle.push(divElement);\n\n divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.decrementMinute\n );\n divElement.setAttribute('data-action', ActionTypes.decrementMinutes);\n divElement.appendChild(downIcon.cloneNode(true));\n bottom.push(divElement);\n }\n\n if (this.optionsStore.options.display.components.seconds) {\n this._gridColumns += ' a';\n if (this.optionsStore.options.display.components.minutes) {\n top.push(getSeparator());\n middle.push(getSeparator(true));\n bottom.push(getSeparator());\n this._gridColumns += ' a';\n }\n let divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.incrementSecond\n );\n divElement.setAttribute('data-action', ActionTypes.incrementSeconds);\n divElement.appendChild(upIcon.cloneNode(true));\n top.push(divElement);\n\n divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.pickSecond\n );\n divElement.setAttribute('data-action', ActionTypes.showSeconds);\n divElement.setAttribute('data-time-component', Unit.seconds);\n middle.push(divElement);\n\n divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.decrementSecond\n );\n divElement.setAttribute('data-action', ActionTypes.decrementSeconds);\n divElement.appendChild(downIcon.cloneNode(true));\n bottom.push(divElement);\n }\n\n if (this.optionsStore.isTwelveHour) {\n this._gridColumns += ' a';\n let divElement = getSeparator();\n top.push(divElement);\n\n const button = document.createElement('button');\n button.setAttribute('type', 'button');\n button.setAttribute(\n 'title',\n this.optionsStore.options.localization.toggleMeridiem\n );\n button.setAttribute('data-action', ActionTypes.toggleMeridiem);\n button.setAttribute('tabindex', '-1');\n if (Namespace.css.toggleMeridiem.includes(',')) {\n //todo move this to paint function?\n button.classList.add(...Namespace.css.toggleMeridiem.split(','));\n } else button.classList.add(Namespace.css.toggleMeridiem);\n\n divElement = document.createElement('div');\n divElement.classList.add(Namespace.css.noHighlight);\n divElement.appendChild(button);\n middle.push(divElement);\n\n divElement = getSeparator();\n bottom.push(divElement);\n }\n\n this._gridColumns = this._gridColumns.trim();\n\n return [...top, ...middle, ...bottom];\n }\n}\n","import { Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport { Paint } from '../index';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `hours`\n */\nexport default class HourDisplay {\n private optionsStore: OptionsStore;\n private validation: Validation;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.validation = serviceLocator.locate(Validation);\n }\n /**\n * Build the container html for the display\n * @private\n */\n getPicker(): HTMLElement {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.hourContainer);\n\n for (let i = 0; i < (this.optionsStore.isTwelveHour ? 12 : 24); i++) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.selectHour);\n container.appendChild(div);\n }\n\n return container;\n }\n\n /**\n * Populates the grid and updates enabled states\n * @private\n */\n _update(widget: HTMLElement, paint: Paint): void {\n const container = widget.getElementsByClassName(\n Namespace.css.hourContainer\n )[0];\n const innerDate = this.optionsStore.viewDate.clone.startOf(Unit.date);\n\n container\n .querySelectorAll(`[data-action=\"${ActionTypes.selectHour}\"]`)\n .forEach((containerClone: HTMLElement) => {\n const classes = [];\n classes.push(Namespace.css.hour);\n\n if (!this.validation.isValid(innerDate, Unit.hours)) {\n classes.push(Namespace.css.disabled);\n }\n\n paint(Unit.hours, innerDate, classes, containerClone);\n\n containerClone.classList.remove(...containerClone.classList);\n containerClone.classList.add(...classes);\n containerClone.setAttribute('data-value', `${innerDate.hours}`);\n containerClone.innerText = innerDate.getHoursFormatted(\n this.optionsStore.options.localization.hourCycle\n );\n innerDate.manipulate(1, Unit.hours);\n });\n }\n}\n","import { Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport { Paint } from '../index';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `minutes`\n */\nexport default class MinuteDisplay {\n private optionsStore: OptionsStore;\n private validation: Validation;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.validation = serviceLocator.locate(Validation);\n }\n /**\n * Build the container html for the display\n * @private\n */\n getPicker(): HTMLElement {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.minuteContainer);\n\n const step =\n this.optionsStore.options.stepping === 1\n ? 5\n : this.optionsStore.options.stepping;\n for (let i = 0; i < 60 / step; i++) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.selectMinute);\n container.appendChild(div);\n }\n\n return container;\n }\n\n /**\n * Populates the grid and updates enabled states\n * @private\n */\n _update(widget: HTMLElement, paint: Paint): void {\n const container = widget.getElementsByClassName(\n Namespace.css.minuteContainer\n )[0];\n const innerDate = this.optionsStore.viewDate.clone.startOf(Unit.hours);\n const step =\n this.optionsStore.options.stepping === 1\n ? 5\n : this.optionsStore.options.stepping;\n\n container\n .querySelectorAll(`[data-action=\"${ActionTypes.selectMinute}\"]`)\n .forEach((containerClone: HTMLElement) => {\n const classes = [];\n classes.push(Namespace.css.minute);\n\n if (!this.validation.isValid(innerDate, Unit.minutes)) {\n classes.push(Namespace.css.disabled);\n }\n\n paint(Unit.minutes, innerDate, classes, containerClone);\n\n containerClone.classList.remove(...containerClone.classList);\n containerClone.classList.add(...classes);\n containerClone.setAttribute('data-value', `${innerDate.minutes}`);\n containerClone.innerText = innerDate.minutesFormatted;\n innerDate.manipulate(step, Unit.minutes);\n });\n }\n}\n","import { Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport { Paint } from '../index';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `seconds`\n */\nexport default class secondDisplay {\n private optionsStore: OptionsStore;\n private validation: Validation;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.validation = serviceLocator.locate(Validation);\n }\n /**\n * Build the container html for the display\n * @private\n */\n getPicker(): HTMLElement {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.secondContainer);\n\n for (let i = 0; i < 12; i++) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.selectSecond);\n container.appendChild(div);\n }\n\n return container;\n }\n\n /**\n * Populates the grid and updates enabled states\n * @private\n */\n _update(widget: HTMLElement, paint: Paint): void {\n const container = widget.getElementsByClassName(\n Namespace.css.secondContainer\n )[0];\n const innerDate = this.optionsStore.viewDate.clone.startOf(Unit.minutes);\n\n container\n .querySelectorAll(`[data-action=\"${ActionTypes.selectSecond}\"]`)\n .forEach((containerClone: HTMLElement) => {\n const classes = [];\n classes.push(Namespace.css.second);\n\n if (!this.validation.isValid(innerDate, Unit.seconds)) {\n classes.push(Namespace.css.disabled);\n }\n\n paint(Unit.seconds, innerDate, classes, containerClone);\n\n containerClone.classList.remove(...containerClone.classList);\n containerClone.classList.add(...classes);\n containerClone.setAttribute('data-value', `${innerDate.seconds}`);\n containerClone.innerText = innerDate.secondsFormatted;\n innerDate.manipulate(5, Unit.seconds);\n });\n }\n}\n","import Namespace from '../utilities/namespace';\n\n/**\n * Provides a collapse functionality to the view changes\n */\nexport default class Collapse {\n /**\n * Flips the show/hide state of `target`\n * @param target html element to affect.\n */\n static toggle(target: HTMLElement) {\n if (target.classList.contains(Namespace.css.show)) {\n this.hide(target);\n } else {\n this.show(target);\n }\n }\n\n /**\n * Skips any animation or timeouts and immediately set the element to show.\n * @param target\n */\n static showImmediately(target: HTMLElement) {\n target.classList.remove(Namespace.css.collapsing);\n target.classList.add(Namespace.css.collapse, Namespace.css.show);\n target.style.height = '';\n }\n\n /**\n * If `target` is not already showing, then show after the animation.\n * @param target\n */\n static show(target: HTMLElement) {\n if (\n target.classList.contains(Namespace.css.collapsing) ||\n target.classList.contains(Namespace.css.show)\n )\n return;\n\n let timeOut = null;\n const complete = () => {\n Collapse.showImmediately(target);\n timeOut = null;\n };\n\n target.style.height = '0';\n target.classList.remove(Namespace.css.collapse);\n target.classList.add(Namespace.css.collapsing);\n\n //eslint-disable-next-line @typescript-eslint/no-unused-vars\n timeOut = setTimeout(\n complete,\n this.getTransitionDurationFromElement(target)\n );\n target.style.height = `${target.scrollHeight}px`;\n }\n\n /**\n * Skips any animation or timeouts and immediately set the element to hide.\n * @param target\n */\n static hideImmediately(target: HTMLElement) {\n if (!target) return;\n target.classList.remove(Namespace.css.collapsing, Namespace.css.show);\n target.classList.add(Namespace.css.collapse);\n }\n\n /**\n * If `target` is not already hidden, then hide after the animation.\n * @param target HTML Element\n */\n static hide(target: HTMLElement) {\n if (\n target.classList.contains(Namespace.css.collapsing) ||\n !target.classList.contains(Namespace.css.show)\n )\n return;\n\n let timeOut = null;\n const complete = () => {\n Collapse.hideImmediately(target);\n timeOut = null;\n };\n\n target.style.height = `${target.getBoundingClientRect()['height']}px`;\n\n const reflow = (element) => element.offsetHeight;\n\n reflow(target);\n\n target.classList.remove(Namespace.css.collapse, Namespace.css.show);\n target.classList.add(Namespace.css.collapsing);\n target.style.height = '';\n\n //eslint-disable-next-line @typescript-eslint/no-unused-vars\n timeOut = setTimeout(\n complete,\n this.getTransitionDurationFromElement(target)\n );\n }\n\n /**\n * Gets the transition duration from the `element` by getting css properties\n * `transition-duration` and `transition-delay`\n * @param element HTML Element\n */\n private static getTransitionDurationFromElement = (element: HTMLElement) => {\n if (!element) {\n return 0;\n }\n\n // Get transition-duration of the element\n let { transitionDuration, transitionDelay } =\n window.getComputedStyle(element);\n\n const floatTransitionDuration = Number.parseFloat(transitionDuration);\n const floatTransitionDelay = Number.parseFloat(transitionDelay);\n\n // Return 0 if element or transition duration is not found\n if (!floatTransitionDuration && !floatTransitionDelay) {\n return 0;\n }\n\n // If multiple durations are defined, take the first\n transitionDuration = transitionDuration.split(',')[0];\n transitionDelay = transitionDelay.split(',')[0];\n\n return (\n (Number.parseFloat(transitionDuration) +\n Number.parseFloat(transitionDelay)) *\n 1000\n );\n };\n}\n","import DateDisplay from './calendar/date-display';\nimport MonthDisplay from './calendar/month-display';\nimport YearDisplay from './calendar/year-display';\nimport DecadeDisplay from './calendar/decade-display';\nimport TimeDisplay from './time/time-display';\nimport HourDisplay from './time/hour-display';\nimport MinuteDisplay from './time/minute-display';\nimport SecondDisplay from './time/second-display';\nimport { DateTime, Unit } from '../datetime';\nimport Namespace from '../utilities/namespace';\nimport { HideEvent } from '../utilities/event-types';\nimport Collapse from './collapse';\nimport Validation from '../validation';\nimport Dates from '../dates';\nimport { EventEmitters, ViewUpdateValues } from '../utilities/event-emitter';\nimport { serviceLocator } from '../utilities/service-locator';\nimport ActionTypes from '../utilities/action-types';\nimport CalendarModes from '../utilities/calendar-modes';\nimport { OptionsStore } from '../utilities/optionsStore';\n\n/**\n * Main class for all things display related.\n */\nexport default class Display {\n private _widget: HTMLElement;\n private _popperInstance: any; // eslint-disable-line @typescript-eslint/no-explicit-any\n private _isVisible = false;\n private optionsStore: OptionsStore;\n private validation: Validation;\n private dates: Dates;\n\n dateDisplay: DateDisplay;\n monthDisplay: MonthDisplay;\n yearDisplay: YearDisplay;\n decadeDisplay: DecadeDisplay;\n timeDisplay: TimeDisplay;\n hourDisplay: HourDisplay;\n minuteDisplay: MinuteDisplay;\n secondDisplay: SecondDisplay;\n private _eventEmitters: EventEmitters;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.validation = serviceLocator.locate(Validation);\n this.dates = serviceLocator.locate(Dates);\n\n this.dateDisplay = serviceLocator.locate(DateDisplay);\n this.monthDisplay = serviceLocator.locate(MonthDisplay);\n this.yearDisplay = serviceLocator.locate(YearDisplay);\n this.decadeDisplay = serviceLocator.locate(DecadeDisplay);\n this.timeDisplay = serviceLocator.locate(TimeDisplay);\n this.hourDisplay = serviceLocator.locate(HourDisplay);\n this.minuteDisplay = serviceLocator.locate(MinuteDisplay);\n this.secondDisplay = serviceLocator.locate(SecondDisplay);\n this._eventEmitters = serviceLocator.locate(EventEmitters);\n this._widget = undefined;\n\n this._eventEmitters.updateDisplay.subscribe((result: ViewUpdateValues) => {\n this._update(result);\n });\n }\n\n /**\n * Returns the widget body or undefined\n * @private\n */\n get widget(): HTMLElement | undefined {\n return this._widget;\n }\n\n get dateContainer(): HTMLElement | undefined {\n return this.widget?.querySelector(`div.${Namespace.css.dateContainer}`);\n }\n\n get timeContainer(): HTMLElement | undefined {\n return this.widget?.querySelector(`div.${Namespace.css.timeContainer}`);\n }\n\n /**\n * Returns this visible state of the picker (shown)\n */\n get isVisible() {\n return this._isVisible;\n }\n\n /**\n * Updates the table for a particular unit. Used when an option as changed or\n * whenever the class list might need to be refreshed.\n * @param unit\n * @private\n */\n _update(unit: ViewUpdateValues): void {\n if (!this.widget) return;\n switch (unit) {\n case Unit.seconds:\n this.secondDisplay._update(this.widget, this.paint);\n break;\n case Unit.minutes:\n this.minuteDisplay._update(this.widget, this.paint);\n break;\n case Unit.hours:\n this.hourDisplay._update(this.widget, this.paint);\n break;\n case Unit.date:\n this.dateDisplay._update(this.widget, this.paint);\n break;\n case Unit.month:\n this.monthDisplay._update(this.widget, this.paint);\n break;\n case Unit.year:\n this.yearDisplay._update(this.widget, this.paint);\n break;\n case 'decade':\n this.decadeDisplay._update(this.widget, this.paint);\n break;\n case 'clock':\n if (!this._hasTime) break;\n this.timeDisplay._update(this.widget);\n this._update(Unit.hours);\n this._update(Unit.minutes);\n this._update(Unit.seconds);\n break;\n case 'calendar':\n this._update(Unit.date);\n this._update(Unit.year);\n this._update(Unit.month);\n this.decadeDisplay._update(this.widget, this.paint);\n this._updateCalendarHeader();\n break;\n case 'all':\n if (this._hasTime) {\n this._update('clock');\n }\n if (this._hasDate) {\n this._update('calendar');\n }\n }\n }\n\n // noinspection JSUnusedLocalSymbols\n /**\n * Allows developers to add/remove classes from an element.\n * @param _unit\n * @param _date\n * @param _classes\n * @param _element\n */\n\n /* eslint-disable @typescript-eslint/no-unused-vars */\n paint(\n _unit: Unit | 'decade',\n _date: DateTime,\n _classes: string[],\n _element: HTMLElement\n ) {\n // implemented in plugin\n }\n\n /**\n * Shows the picker and creates a Popper instance if needed.\n * Add document click event to hide when clicking outside the picker.\n * fires Events#show\n */\n show(): void {\n if (this.widget == undefined) {\n this._showSetDefaultIfNeeded();\n\n this._buildWidget();\n this._updateTheme();\n\n this._showSetupViewMode();\n\n if (!this.optionsStore.options.display.inline) {\n // If needed to change the parent container\n const container = this.optionsStore.options?.container || document.body;\n const placement =\n this.optionsStore.options?.display?.placement || 'bottom';\n\n container.appendChild(this.widget);\n this.createPopup(this.optionsStore.element, this.widget, {\n modifiers: [{ name: 'eventListeners', enabled: true }],\n //#2400\n placement:\n document.documentElement.dir === 'rtl'\n ? `${placement}-end`\n : `${placement}-start`,\n }).then();\n } else {\n this.optionsStore.element.appendChild(this.widget);\n }\n\n if (this.optionsStore.options.display.viewMode == 'clock') {\n this._eventEmitters.action.emit({\n e: null,\n action: ActionTypes.showClock,\n });\n }\n\n this.widget\n .querySelectorAll('[data-action]')\n .forEach((element) =>\n element.addEventListener('click', this._actionsClickEvent)\n );\n\n // show the clock when using sideBySide\n if (this._hasTime && this.optionsStore.options.display.sideBySide) {\n this.timeDisplay._update(this.widget);\n (\n this.widget.getElementsByClassName(\n Namespace.css.clockContainer\n )[0] as HTMLElement\n ).style.display = 'grid';\n }\n }\n\n this.widget.classList.add(Namespace.css.show);\n if (!this.optionsStore.options.display.inline) {\n this.updatePopup();\n document.addEventListener('click', this._documentClickEvent);\n }\n this._eventEmitters.triggerEvent.emit({ type: Namespace.events.show });\n this._isVisible = true;\n }\n\n private _showSetupViewMode() {\n // If modeView is only clock\n const onlyClock = this._hasTime && !this._hasDate;\n\n // reset the view to the clock if there's no date components\n if (onlyClock) {\n this.optionsStore.currentView = 'clock';\n this._eventEmitters.action.emit({\n e: null,\n action: ActionTypes.showClock,\n });\n }\n // otherwise return to the calendar view\n else if (!this.optionsStore.currentCalendarViewMode) {\n this.optionsStore.currentCalendarViewMode =\n this.optionsStore.minimumCalendarViewMode;\n }\n\n if (!onlyClock && this.optionsStore.options.display.viewMode !== 'clock') {\n if (this._hasTime) {\n if (!this.optionsStore.options.display.sideBySide) {\n Collapse.hideImmediately(this.timeContainer);\n } else {\n Collapse.show(this.timeContainer);\n }\n }\n Collapse.show(this.dateContainer);\n }\n\n if (this._hasDate) {\n this._showMode();\n }\n }\n\n private _showSetDefaultIfNeeded() {\n if (this.dates.picked.length != 0) return;\n\n if (\n this.optionsStore.options.useCurrent &&\n !this.optionsStore.options.defaultDate\n ) {\n const date = new DateTime().setLocalization(\n this.optionsStore.options.localization\n );\n if (!this.optionsStore.options.keepInvalid) {\n let tries = 0;\n let direction = 1;\n if (this.optionsStore.options.restrictions.maxDate?.isBefore(date)) {\n direction = -1;\n }\n while (!this.validation.isValid(date) && tries > 31) {\n date.manipulate(direction, Unit.date);\n tries++;\n }\n }\n this.dates.setValue(date);\n }\n\n if (this.optionsStore.options.defaultDate) {\n this.dates.setValue(this.optionsStore.options.defaultDate);\n }\n }\n\n async createPopup(\n element: HTMLElement,\n widget: HTMLElement,\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n options: any\n ): Promise {\n let createPopperFunction;\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((window as any)?.Popper) {\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n createPopperFunction = (window as any)?.Popper?.createPopper;\n } else {\n const { createPopper } = await import('@popperjs/core');\n createPopperFunction = createPopper;\n }\n if (createPopperFunction) {\n this._popperInstance = createPopperFunction(element, widget, options);\n }\n }\n\n updatePopup(): void {\n this._popperInstance?.update();\n }\n\n /**\n * Changes the calendar view mode. E.g. month <-> year\n * @param direction -/+ number to move currentViewMode\n * @private\n */\n _showMode(direction?: number): void {\n if (!this.widget) {\n return;\n }\n if (direction) {\n const max = Math.max(\n this.optionsStore.minimumCalendarViewMode,\n Math.min(3, this.optionsStore.currentCalendarViewMode + direction)\n );\n if (this.optionsStore.currentCalendarViewMode == max) return;\n this.optionsStore.currentCalendarViewMode = max;\n }\n\n this.widget\n .querySelectorAll(\n `.${Namespace.css.dateContainer} > div:not(.${Namespace.css.calendarHeader}), .${Namespace.css.timeContainer} > div:not(.${Namespace.css.clockContainer})`\n )\n .forEach((e: HTMLElement) => (e.style.display = 'none'));\n\n const datePickerMode =\n CalendarModes[this.optionsStore.currentCalendarViewMode];\n const picker: HTMLElement = this.widget.querySelector(\n `.${datePickerMode.className}`\n );\n\n switch (datePickerMode.className) {\n case Namespace.css.decadesContainer:\n this.decadeDisplay._update(this.widget, this.paint);\n break;\n case Namespace.css.yearsContainer:\n this.yearDisplay._update(this.widget, this.paint);\n break;\n case Namespace.css.monthsContainer:\n this.monthDisplay._update(this.widget, this.paint);\n break;\n case Namespace.css.daysContainer:\n this.dateDisplay._update(this.widget, this.paint);\n break;\n }\n\n picker.style.display = 'grid';\n\n if (this.optionsStore.options.display.sideBySide)\n ((\n this.widget.querySelectorAll(`.${Namespace.css.clockContainer}`)[0]\n )).style.display = 'grid';\n\n this._updateCalendarHeader();\n this._eventEmitters.viewUpdate.emit();\n }\n\n /**\n * Changes the theme. E.g. light, dark or auto\n * @param theme the theme name\n * @private\n */\n _updateTheme(theme?: 'light' | 'dark' | 'auto'): void {\n if (!this.widget) {\n return;\n }\n if (theme) {\n if (this.optionsStore.options.display.theme === theme) return;\n this.optionsStore.options.display.theme = theme;\n }\n\n this.widget.classList.remove('light', 'dark');\n this.widget.classList.add(this._getThemeClass());\n\n if (this.optionsStore.options.display.theme === 'auto') {\n window\n .matchMedia(Namespace.css.isDarkPreferredQuery)\n .addEventListener('change', () => this._updateTheme());\n } else {\n window\n .matchMedia(Namespace.css.isDarkPreferredQuery)\n .removeEventListener('change', () => this._updateTheme());\n }\n }\n\n _getThemeClass(): string {\n const currentTheme = this.optionsStore.options.display.theme || 'auto';\n\n const isDarkMode =\n window.matchMedia &&\n window.matchMedia(Namespace.css.isDarkPreferredQuery).matches;\n\n switch (currentTheme) {\n case 'light':\n return Namespace.css.lightTheme;\n case 'dark':\n return Namespace.css.darkTheme;\n case 'auto':\n return isDarkMode ? Namespace.css.darkTheme : Namespace.css.lightTheme;\n }\n }\n\n _updateCalendarHeader() {\n if (!this._hasDate) return;\n const showing = [\n ...this.widget.querySelector(\n `.${Namespace.css.dateContainer} div[style*=\"display: grid\"]`\n ).classList,\n ].find((x) => x.startsWith(Namespace.css.dateContainer));\n\n const [previous, switcher, next] = this.widget\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\n .getElementsByTagName('div');\n\n switch (showing) {\n case Namespace.css.decadesContainer:\n previous.setAttribute(\n 'title',\n this.optionsStore.options.localization.previousCentury\n );\n switcher.setAttribute('title', '');\n next.setAttribute(\n 'title',\n this.optionsStore.options.localization.nextCentury\n );\n break;\n case Namespace.css.yearsContainer:\n previous.setAttribute(\n 'title',\n this.optionsStore.options.localization.previousDecade\n );\n switcher.setAttribute(\n 'title',\n this.optionsStore.options.localization.selectDecade\n );\n next.setAttribute(\n 'title',\n this.optionsStore.options.localization.nextDecade\n );\n break;\n case Namespace.css.monthsContainer:\n previous.setAttribute(\n 'title',\n this.optionsStore.options.localization.previousYear\n );\n switcher.setAttribute(\n 'title',\n this.optionsStore.options.localization.selectYear\n );\n next.setAttribute(\n 'title',\n this.optionsStore.options.localization.nextYear\n );\n break;\n case Namespace.css.daysContainer:\n previous.setAttribute(\n 'title',\n this.optionsStore.options.localization.previousMonth\n );\n switcher.setAttribute(\n 'title',\n this.optionsStore.options.localization.selectMonth\n );\n next.setAttribute(\n 'title',\n this.optionsStore.options.localization.nextMonth\n );\n switcher.setAttribute(\n showing,\n this.optionsStore.viewDate.format(\n this.optionsStore.options.localization.dayViewHeaderFormat\n )\n );\n break;\n }\n switcher.innerText = switcher.getAttribute(showing);\n }\n\n /**\n * Hides the picker if needed.\n * Remove document click event to hide when clicking outside the picker.\n * fires Events#hide\n */\n hide(): void {\n if (!this.widget || !this._isVisible) return;\n\n this.widget.classList.remove(Namespace.css.show);\n\n if (this._isVisible) {\n this._eventEmitters.triggerEvent.emit({\n type: Namespace.events.hide,\n date: this.optionsStore.unset ? null : this.dates.lastPicked?.clone,\n } as HideEvent);\n this._isVisible = false;\n }\n\n document.removeEventListener('click', this._documentClickEvent);\n }\n\n /**\n * Toggles the picker's open state. Fires a show/hide event depending.\n */\n toggle() {\n return this._isVisible ? this.hide() : this.show();\n }\n\n /**\n * Removes document and data-action click listener and reset the widget\n * @private\n */\n _dispose() {\n document.removeEventListener('click', this._documentClickEvent);\n if (!this.widget) return;\n this.widget\n .querySelectorAll('[data-action]')\n .forEach((element) =>\n element.removeEventListener('click', this._actionsClickEvent)\n );\n this.widget.parentNode.removeChild(this.widget);\n this._widget = undefined;\n }\n\n /**\n * Builds the widgets html template.\n * @private\n */\n private _buildWidget(): HTMLElement {\n const template = document.createElement('div');\n template.classList.add(Namespace.css.widget);\n\n const dateView = document.createElement('div');\n dateView.classList.add(Namespace.css.dateContainer);\n dateView.append(\n this.getHeadTemplate(),\n this.decadeDisplay.getPicker(),\n this.yearDisplay.getPicker(),\n this.monthDisplay.getPicker(),\n this.dateDisplay.getPicker()\n );\n\n const timeView = document.createElement('div');\n timeView.classList.add(Namespace.css.timeContainer);\n timeView.appendChild(this.timeDisplay.getPicker(this._iconTag.bind(this)));\n timeView.appendChild(this.hourDisplay.getPicker());\n timeView.appendChild(this.minuteDisplay.getPicker());\n timeView.appendChild(this.secondDisplay.getPicker());\n\n const toolbar = document.createElement('div');\n toolbar.classList.add(Namespace.css.toolbar);\n toolbar.append(...this.getToolbarElements());\n\n if (this.optionsStore.options.display.inline) {\n template.classList.add(Namespace.css.inline);\n }\n\n if (this.optionsStore.options.display.calendarWeeks) {\n template.classList.add('calendarWeeks');\n }\n\n if (this.optionsStore.options.display.sideBySide && this._hasDateAndTime) {\n this._buildWidgetSideBySide(template, dateView, timeView, toolbar);\n return;\n }\n\n if (this.optionsStore.options.display.toolbarPlacement === 'top') {\n template.appendChild(toolbar);\n }\n\n const setupComponentView = (hasFirst, hasSecond, element, shouldShow) => {\n if (!hasFirst) return;\n if (hasSecond) {\n element.classList.add(Namespace.css.collapse);\n if (shouldShow) element.classList.add(Namespace.css.show);\n }\n template.appendChild(element);\n };\n\n setupComponentView(\n this._hasDate,\n this._hasTime,\n dateView,\n this.optionsStore.options.display.viewMode !== 'clock'\n );\n\n setupComponentView(\n this._hasTime,\n this._hasDate,\n timeView,\n this.optionsStore.options.display.viewMode === 'clock'\n );\n\n if (this.optionsStore.options.display.toolbarPlacement === 'bottom') {\n template.appendChild(toolbar);\n }\n\n const arrow = document.createElement('div');\n arrow.classList.add('arrow');\n arrow.setAttribute('data-popper-arrow', '');\n template.appendChild(arrow);\n\n this._widget = template;\n }\n\n private _buildWidgetSideBySide(\n template: HTMLDivElement,\n dateView: HTMLDivElement,\n timeView: HTMLDivElement,\n toolbar: HTMLDivElement\n ) {\n template.classList.add(Namespace.css.sideBySide);\n if (this.optionsStore.options.display.toolbarPlacement === 'top') {\n template.appendChild(toolbar);\n }\n const row = document.createElement('div');\n row.classList.add('td-row');\n dateView.classList.add('td-half');\n timeView.classList.add('td-half');\n\n row.appendChild(dateView);\n row.appendChild(timeView);\n template.appendChild(row);\n if (this.optionsStore.options.display.toolbarPlacement === 'bottom') {\n template.appendChild(toolbar);\n }\n this._widget = template;\n }\n\n /**\n * Returns true if the hours, minutes, or seconds component is turned on\n */\n get _hasTime(): boolean {\n return (\n this.optionsStore.options.display.components.clock &&\n (this.optionsStore.options.display.components.hours ||\n this.optionsStore.options.display.components.minutes ||\n this.optionsStore.options.display.components.seconds)\n );\n }\n\n /**\n * Returns true if the year, month, or date component is turned on\n */\n get _hasDate(): boolean {\n return (\n this.optionsStore.options.display.components.calendar &&\n (this.optionsStore.options.display.components.year ||\n this.optionsStore.options.display.components.month ||\n this.optionsStore.options.display.components.date)\n );\n }\n\n get _hasDateAndTime(): boolean {\n return this._hasDate && this._hasTime;\n }\n\n /**\n * Get the toolbar html based on options like buttons => today\n * @private\n */\n getToolbarElements(): HTMLElement[] {\n const toolbar = [];\n\n if (this.optionsStore.options.display.buttons.today) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.today);\n div.setAttribute('title', this.optionsStore.options.localization.today);\n\n div.appendChild(\n this._iconTag(this.optionsStore.options.display.icons.today)\n );\n toolbar.push(div);\n }\n if (\n !this.optionsStore.options.display.sideBySide &&\n this._hasDate &&\n this._hasTime\n ) {\n let title, icon;\n if (this.optionsStore.options.display.viewMode === 'clock') {\n title = this.optionsStore.options.localization.selectDate;\n icon = this.optionsStore.options.display.icons.date;\n } else {\n title = this.optionsStore.options.localization.selectTime;\n icon = this.optionsStore.options.display.icons.time;\n }\n\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.togglePicker);\n div.setAttribute('title', title);\n\n div.appendChild(this._iconTag(icon));\n toolbar.push(div);\n }\n if (this.optionsStore.options.display.buttons.clear) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.clear);\n div.setAttribute('title', this.optionsStore.options.localization.clear);\n\n div.appendChild(\n this._iconTag(this.optionsStore.options.display.icons.clear)\n );\n toolbar.push(div);\n }\n if (this.optionsStore.options.display.buttons.close) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.close);\n div.setAttribute('title', this.optionsStore.options.localization.close);\n\n div.appendChild(\n this._iconTag(this.optionsStore.options.display.icons.close)\n );\n toolbar.push(div);\n }\n\n return toolbar;\n }\n\n /***\n * Builds the base header template with next and previous icons\n * @private\n */\n getHeadTemplate(): HTMLElement {\n const calendarHeader = document.createElement('div');\n calendarHeader.classList.add(Namespace.css.calendarHeader);\n\n const previous = document.createElement('div');\n previous.classList.add(Namespace.css.previous);\n previous.setAttribute('data-action', ActionTypes.previous);\n previous.appendChild(\n this._iconTag(this.optionsStore.options.display.icons.previous)\n );\n\n const switcher = document.createElement('div');\n switcher.classList.add(Namespace.css.switch);\n switcher.setAttribute('data-action', ActionTypes.changeCalendarView);\n\n const next = document.createElement('div');\n next.classList.add(Namespace.css.next);\n next.setAttribute('data-action', ActionTypes.next);\n next.appendChild(\n this._iconTag(this.optionsStore.options.display.icons.next)\n );\n\n calendarHeader.append(previous, switcher, next);\n return calendarHeader;\n }\n\n /**\n * Builds an icon tag as either an ``\n * or with icons => type is `sprites` then a svg tag instead\n * @param iconClass\n * @private\n */\n _iconTag(iconClass: string): HTMLElement | SVGElement {\n if (this.optionsStore.options.display.icons.type === 'sprites') {\n const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n\n const icon = document.createElementNS(\n 'http://www.w3.org/2000/svg',\n 'use'\n );\n icon.setAttribute('xlink:href', iconClass); // Deprecated. Included for backward compatibility\n icon.setAttribute('href', iconClass);\n svg.appendChild(icon);\n\n return svg;\n }\n const icon = document.createElement('i');\n icon.classList.add(...iconClass.split(' '));\n return icon;\n }\n\n /**\n * A document click event to hide the widget if click is outside\n * @private\n * @param e MouseEvent\n */\n private _documentClickEvent = (e: MouseEvent) => {\n if (this.optionsStore.options.debug || (window as any).debug) return; //eslint-disable-line @typescript-eslint/no-explicit-any\n\n if (\n this._isVisible &&\n !e.composedPath().includes(this.widget) && // click inside the widget\n !e.composedPath()?.includes(this.optionsStore.element) // click on the element\n ) {\n this.hide();\n }\n };\n\n /**\n * Click event for any action like selecting a date\n * @param e MouseEvent\n * @private\n */\n private _actionsClickEvent = (e: MouseEvent) => {\n this._eventEmitters.action.emit({ e: e });\n };\n\n /**\n * Causes the widget to get rebuilt on next show. If the picker is already open\n * then hide and reshow it.\n * @private\n */\n _rebuild() {\n const wasVisible = this._isVisible;\n this._dispose();\n if (wasVisible) this.show();\n }\n\n refreshCurrentView() {\n //if the widget is not showing, just destroy it\n if (!this._isVisible) this._dispose();\n\n switch (this.optionsStore.currentView) {\n case 'clock':\n this._update('clock');\n break;\n case 'calendar':\n this._update(Unit.date);\n break;\n case 'months':\n this._update(Unit.month);\n break;\n case 'years':\n this._update(Unit.year);\n break;\n case 'decades':\n this._update('decade');\n break;\n }\n }\n}\n\nexport type Paint = (\n unit: Unit | 'decade',\n innerDate: DateTime,\n classes: string[],\n element: HTMLElement\n) => void;\n","import { DateTime, Unit } from './datetime';\nimport Collapse from './display/collapse';\nimport Namespace from './utilities/namespace';\nimport Dates from './dates';\nimport Validation from './validation';\nimport Display from './display';\nimport { EventEmitters } from './utilities/event-emitter';\nimport { serviceLocator } from './utilities/service-locator.js';\nimport ActionTypes from './utilities/action-types';\nimport CalendarModes from './utilities/calendar-modes';\nimport { OptionsStore } from './utilities/optionsStore';\n\n/**\n * Logic for various click actions\n */\nexport default class Actions {\n private optionsStore: OptionsStore;\n private validation: Validation;\n private dates: Dates;\n private display: Display;\n private _eventEmitters: EventEmitters;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.dates = serviceLocator.locate(Dates);\n this.validation = serviceLocator.locate(Validation);\n this.display = serviceLocator.locate(Display);\n this._eventEmitters = serviceLocator.locate(EventEmitters);\n\n this._eventEmitters.action.subscribe((result) => {\n this.do(result.e, result.action);\n });\n }\n\n /**\n * Performs the selected `action`. See ActionTypes\n * @param e This is normally a click event\n * @param action If not provided, then look for a [data-action]\n */\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n do(e: any, action?: ActionTypes) {\n const currentTarget = e?.currentTarget as HTMLElement;\n if (currentTarget?.classList?.contains(Namespace.css.disabled)) return;\n action = action || (currentTarget?.dataset?.action as ActionTypes);\n const lastPicked = (this.dates.lastPicked || this.optionsStore.viewDate)\n .clone;\n\n switch (action) {\n case ActionTypes.next:\n case ActionTypes.previous:\n this.handleNextPrevious(action);\n break;\n case ActionTypes.changeCalendarView:\n this.display._showMode(1);\n this.display._updateCalendarHeader();\n break;\n case ActionTypes.selectMonth:\n case ActionTypes.selectYear:\n case ActionTypes.selectDecade:\n this.handleSelectCalendarMode(action, currentTarget);\n break;\n case ActionTypes.selectDay:\n this.handleSelectDay(currentTarget);\n break;\n case ActionTypes.selectHour: {\n let hour = +currentTarget.dataset.value;\n if (lastPicked.hours >= 12 && this.optionsStore.isTwelveHour)\n hour += 12;\n lastPicked.hours = hour;\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\n this.hideOrClock(e);\n break;\n }\n case ActionTypes.selectMinute: {\n lastPicked.minutes = +currentTarget.dataset.value;\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\n this.hideOrClock(e);\n break;\n }\n case ActionTypes.selectSecond: {\n lastPicked.seconds = +currentTarget.dataset.value;\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\n this.hideOrClock(e);\n break;\n }\n case ActionTypes.incrementHours:\n this.manipulateAndSet(lastPicked, Unit.hours);\n break;\n case ActionTypes.incrementMinutes:\n this.manipulateAndSet(\n lastPicked,\n Unit.minutes,\n this.optionsStore.options.stepping\n );\n break;\n case ActionTypes.incrementSeconds:\n this.manipulateAndSet(lastPicked, Unit.seconds);\n break;\n case ActionTypes.decrementHours:\n this.manipulateAndSet(lastPicked, Unit.hours, -1);\n break;\n case ActionTypes.decrementMinutes:\n this.manipulateAndSet(\n lastPicked,\n Unit.minutes,\n this.optionsStore.options.stepping * -1\n );\n break;\n case ActionTypes.decrementSeconds:\n this.manipulateAndSet(lastPicked, Unit.seconds, -1);\n break;\n case ActionTypes.toggleMeridiem:\n this.manipulateAndSet(\n lastPicked,\n Unit.hours,\n this.dates.lastPicked.hours >= 12 ? -12 : 12\n );\n break;\n case ActionTypes.togglePicker:\n this.handleToggle(currentTarget);\n break;\n case ActionTypes.showClock:\n case ActionTypes.showHours:\n case ActionTypes.showMinutes:\n case ActionTypes.showSeconds:\n //make sure the clock is actually displaying\n if (\n !this.optionsStore.options.display.sideBySide &&\n this.optionsStore.currentView !== 'clock'\n ) {\n //hide calendar\n Collapse.hideImmediately(this.display.dateContainer);\n //show clock\n Collapse.showImmediately(this.display.timeContainer);\n }\n this.handleShowClockContainers(action);\n break;\n case ActionTypes.clear:\n this.dates.setValue(null);\n this.display._updateCalendarHeader();\n break;\n case ActionTypes.close:\n this.display.hide();\n break;\n case ActionTypes.today: {\n const today = new DateTime().setLocalization(\n this.optionsStore.options.localization\n );\n this._eventEmitters.updateViewDate.emit(today);\n\n //todo this this really a good idea?\n if (this.validation.isValid(today, Unit.date))\n this.dates.setValue(today, this.dates.lastPickedIndex);\n break;\n }\n }\n }\n\n private handleShowClockContainers(action: ActionTypes) {\n if (!this.display._hasTime) {\n Namespace.errorMessages.throwError(\n 'Cannot show clock containers when time is disabled.'\n );\n /* ignore coverage: should never happen */\n return;\n }\n\n this.optionsStore.currentView = 'clock';\n this.display.widget\n .querySelectorAll(`.${Namespace.css.timeContainer} > div`)\n .forEach(\n (htmlElement: HTMLElement) => (htmlElement.style.display = 'none')\n );\n\n let classToUse = '';\n switch (action) {\n case ActionTypes.showClock:\n classToUse = Namespace.css.clockContainer;\n this.display._update('clock');\n break;\n case ActionTypes.showHours:\n classToUse = Namespace.css.hourContainer;\n this.display._update(Unit.hours);\n break;\n case ActionTypes.showMinutes:\n classToUse = Namespace.css.minuteContainer;\n this.display._update(Unit.minutes);\n break;\n case ActionTypes.showSeconds:\n classToUse = Namespace.css.secondContainer;\n this.display._update(Unit.seconds);\n break;\n }\n\n ((\n this.display.widget.getElementsByClassName(classToUse)[0]\n )).style.display = 'grid';\n }\n\n private handleNextPrevious(action: ActionTypes) {\n const { unit, step } =\n CalendarModes[this.optionsStore.currentCalendarViewMode];\n if (action === ActionTypes.next)\n this.optionsStore.viewDate.manipulate(step, unit);\n else this.optionsStore.viewDate.manipulate(step * -1, unit);\n this._eventEmitters.viewUpdate.emit();\n\n this.display._showMode();\n }\n\n /**\n * After setting the value it will either show the clock or hide the widget.\n * @param e\n */\n private hideOrClock(e) {\n if (\n !this.optionsStore.isTwelveHour &&\n !this.optionsStore.options.display.components.minutes &&\n !this.optionsStore.options.display.keepOpen &&\n !this.optionsStore.options.display.inline\n ) {\n this.display.hide();\n } else {\n this.do(e, ActionTypes.showClock);\n }\n }\n\n /**\n * Common function to manipulate {@link lastPicked} by `unit`.\n * @param lastPicked\n * @param unit\n * @param value Value to change by\n */\n private manipulateAndSet(lastPicked: DateTime, unit: Unit, value = 1) {\n const newDate = lastPicked.manipulate(value, unit);\n if (this.validation.isValid(newDate, unit)) {\n this.dates.setValue(newDate, this.dates.lastPickedIndex);\n }\n }\n\n private handleSelectCalendarMode(\n action:\n | ActionTypes.selectMonth\n | ActionTypes.selectYear\n | ActionTypes.selectDecade,\n currentTarget: HTMLElement\n ) {\n const value = +currentTarget.dataset.value;\n switch (action) {\n case ActionTypes.selectMonth:\n this.optionsStore.viewDate.month = value;\n break;\n case ActionTypes.selectYear:\n case ActionTypes.selectDecade:\n this.optionsStore.viewDate.year = value;\n break;\n }\n\n if (\n this.optionsStore.currentCalendarViewMode ===\n this.optionsStore.minimumCalendarViewMode\n ) {\n this.dates.setValue(\n this.optionsStore.viewDate,\n this.dates.lastPickedIndex\n );\n\n if (!this.optionsStore.options.display.inline) {\n this.display.hide();\n }\n } else {\n this.display._showMode(-1);\n }\n }\n\n private handleToggle(currentTarget: HTMLElement) {\n if (\n currentTarget.getAttribute('title') ===\n this.optionsStore.options.localization.selectDate\n ) {\n currentTarget.setAttribute(\n 'title',\n this.optionsStore.options.localization.selectTime\n );\n currentTarget.innerHTML = this.display._iconTag(\n this.optionsStore.options.display.icons.time\n ).outerHTML;\n\n this.display._updateCalendarHeader();\n this.optionsStore.refreshCurrentView();\n } else {\n currentTarget.setAttribute(\n 'title',\n this.optionsStore.options.localization.selectDate\n );\n currentTarget.innerHTML = this.display._iconTag(\n this.optionsStore.options.display.icons.date\n ).outerHTML;\n if (this.display._hasTime) {\n this.handleShowClockContainers(ActionTypes.showClock);\n this.display._update('clock');\n }\n }\n\n this.display.widget\n .querySelectorAll(\n `.${Namespace.css.dateContainer}, .${Namespace.css.timeContainer}`\n )\n .forEach((htmlElement: HTMLElement) => Collapse.toggle(htmlElement));\n this._eventEmitters.viewUpdate.emit();\n }\n\n private handleSelectDay(currentTarget: HTMLElement) {\n const day = this.optionsStore.viewDate.clone;\n if (currentTarget.classList.contains(Namespace.css.old)) {\n day.manipulate(-1, Unit.month);\n }\n if (currentTarget.classList.contains(Namespace.css.new)) {\n day.manipulate(1, Unit.month);\n }\n\n day.date = +currentTarget.dataset.day;\n if (this.optionsStore.options.dateRange) this.handleDateRange(day);\n else if (this.optionsStore.options.multipleDates) {\n this.handleMultiDate(day);\n } else {\n this.dates.setValue(day, this.dates.lastPickedIndex);\n }\n\n if (\n !this.display._hasTime &&\n !this.optionsStore.options.display.keepOpen &&\n !this.optionsStore.options.display.inline &&\n !this.optionsStore.options.multipleDates &&\n !this.optionsStore.options.dateRange\n ) {\n this.display.hide();\n }\n }\n\n private handleMultiDate(day: DateTime) {\n let index = this.dates.pickedIndex(day, Unit.date);\n console.log(index);\n if (index !== -1) {\n this.dates.setValue(null, index); //deselect multi-date\n } else {\n index = this.dates.lastPickedIndex + 1;\n if (this.dates.picked.length === 0) index = 0;\n\n this.dates.setValue(day, index);\n }\n }\n\n private handleDateRange(day: DateTime) {\n switch (this.dates.picked.length) {\n case 2: {\n this.dates.clear();\n break;\n }\n case 1: {\n const other = this.dates.picked[0];\n if (day.getTime() === other.getTime()) {\n this.dates.clear();\n break;\n }\n if (day.isBefore(other)) {\n this.dates.setValue(day, 0);\n this.dates.setValue(other, 1);\n return;\n } else {\n this.dates.setValue(day, 1);\n return;\n }\n }\n }\n\n this.dates.setValue(day, 0);\n }\n}\n","import Display from './display/index';\nimport Dates from './dates';\nimport Actions from './actions';\nimport {\n DateTime,\n DateTimeFormatOptions,\n guessHourCycle,\n Unit,\n} from './datetime';\nimport Namespace from './utilities/namespace';\nimport Options from './utilities/options';\nimport {\n BaseEvent,\n ChangeEvent,\n ViewUpdateEvent,\n} from './utilities/event-types';\nimport { EventEmitters } from './utilities/event-emitter';\nimport {\n serviceLocator,\n setupServiceLocator,\n} from './utilities/service-locator';\nimport CalendarModes from './utilities/calendar-modes';\nimport DefaultOptions, {\n DefaultEnLocalization,\n} from './utilities/default-options';\nimport ActionTypes from './utilities/action-types';\nimport { OptionsStore } from './utilities/optionsStore';\nimport { OptionConverter } from './utilities/optionConverter';\n\n/**\n * A robust and powerful date/time picker component.\n */\nclass TempusDominus {\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n _subscribers: { [key: string]: ((event: any) => Record)[] } =\n {};\n private _isDisabled = false;\n private _toggle: HTMLElement;\n private _currentPromptTimeTimeout: NodeJS.Timeout;\n private actions: Actions;\n private optionsStore: OptionsStore;\n private _eventEmitters: EventEmitters;\n display: Display;\n dates: Dates;\n\n constructor(element: HTMLElement, options: Options = {} as Options) {\n setupServiceLocator();\n this._eventEmitters = serviceLocator.locate(EventEmitters);\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.display = serviceLocator.locate(Display);\n this.dates = serviceLocator.locate(Dates);\n this.actions = serviceLocator.locate(Actions);\n\n if (!element) {\n Namespace.errorMessages.mustProvideElement();\n }\n\n this.optionsStore.element = element;\n this._initializeOptions(options, DefaultOptions, true);\n this.optionsStore.viewDate.setLocalization(\n this.optionsStore.options.localization\n );\n this.optionsStore.unset = true;\n\n this._initializeInput();\n this._initializeToggle();\n\n if (this.optionsStore.options.display.inline) this.display.show();\n\n this._eventEmitters.triggerEvent.subscribe((e) => {\n this._triggerEvent(e);\n });\n\n this._eventEmitters.viewUpdate.subscribe(() => {\n this._viewUpdate();\n });\n\n this._eventEmitters.updateViewDate.subscribe((dateTime) => {\n this.viewDate = dateTime;\n });\n }\n\n get viewDate() {\n return this.optionsStore.viewDate;\n }\n\n set viewDate(value) {\n this.optionsStore.viewDate = value;\n this.optionsStore.viewDate.setLocalization(\n this.optionsStore.options.localization\n );\n this.display._update(\n this.optionsStore.currentView === 'clock' ? 'clock' : 'calendar'\n );\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Update the picker options. If `reset` is provide `options` will be merged with DefaultOptions instead.\n * @param options\n * @param reset\n * @public\n */\n updateOptions(options, reset = false): void {\n if (reset) this._initializeOptions(options, DefaultOptions);\n else this._initializeOptions(options, this.optionsStore.options);\n\n this.optionsStore.viewDate.setLocalization(\n this.optionsStore.options.localization\n );\n this.display.refreshCurrentView();\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Toggles the picker open or closed. If the picker is disabled, nothing will happen.\n * @public\n */\n toggle(): void {\n if (this._isDisabled) return;\n this.display.toggle();\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Shows the picker unless the picker is disabled.\n * @public\n */\n show(): void {\n if (this._isDisabled) return;\n this.display.show();\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Hides the picker unless the picker is disabled.\n * @public\n */\n hide(): void {\n this.display.hide();\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Disables the picker and the target input field.\n * @public\n */\n disable(): void {\n this._isDisabled = true;\n // todo this might be undesired. If a dev disables the input field to\n // only allow using the picker, this will break that.\n this.optionsStore.input?.setAttribute('disabled', 'disabled');\n this.display.hide();\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Enables the picker and the target input field.\n * @public\n */\n enable(): void {\n this._isDisabled = false;\n this.optionsStore.input?.removeAttribute('disabled');\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Clears all the selected dates\n * @public\n */\n clear(): void {\n this.optionsStore.input.value = '';\n this.dates.clear();\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Allows for a direct subscription to picker events, without having to use addEventListener on the element.\n * @param eventTypes See Namespace.Events\n * @param callbacks Function to call when event is triggered\n * @public\n */\n subscribe(\n eventTypes: string | string[],\n callbacks: (event: any) => void | ((event: any) => void)[] //eslint-disable-line @typescript-eslint/no-explicit-any\n ): { unsubscribe: () => void } | { unsubscribe: () => void }[] {\n if (typeof eventTypes === 'string') {\n eventTypes = [eventTypes];\n }\n let callBackArray: any[]; //eslint-disable-line @typescript-eslint/no-explicit-any\n if (!Array.isArray(callbacks)) {\n callBackArray = [callbacks];\n } else {\n callBackArray = callbacks;\n }\n\n if (eventTypes.length !== callBackArray.length) {\n Namespace.errorMessages.subscribeMismatch();\n }\n\n const returnArray = [];\n\n for (let i = 0; i < eventTypes.length; i++) {\n const eventType = eventTypes[i];\n if (!Array.isArray(this._subscribers[eventType])) {\n this._subscribers[eventType] = [];\n }\n\n this._subscribers[eventType].push(callBackArray[i]);\n\n returnArray.push({\n unsubscribe: this._unsubscribe.bind(\n this,\n eventType,\n this._subscribers[eventType].length - 1\n ),\n });\n\n if (eventTypes.length === 1) {\n return returnArray[0];\n }\n }\n\n return returnArray;\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Hides the picker and removes event listeners\n */\n dispose() {\n this.display.hide();\n // this will clear the document click event listener\n this.display._dispose();\n this._eventEmitters.destroy();\n this.optionsStore.input?.removeEventListener(\n 'change',\n this._inputChangeEvent\n );\n if (this.optionsStore.options.allowInputToggle) {\n this.optionsStore.input?.removeEventListener(\n 'click',\n this._openClickEvent\n );\n this.optionsStore.input?.removeEventListener(\n 'focus',\n this._openClickEvent\n );\n }\n this._toggle?.removeEventListener('click', this._toggleClickEvent);\n this._subscribers = {};\n }\n\n /**\n * Updates the options to use the provided language.\n * THe language file must be loaded first.\n * @param language\n */\n locale(language: string) {\n const asked = loadedLocales[language];\n if (!asked) return;\n this.updateOptions({\n localization: asked,\n });\n }\n\n /**\n * Triggers an event like ChangeEvent when the picker has updated the value\n * of a selected date.\n * @param event Accepts a BaseEvent object.\n * @private\n */\n private _triggerEvent(event: BaseEvent) {\n event.viewMode = this.optionsStore.currentView;\n\n const isChangeEvent = event.type === Namespace.events.change;\n if (isChangeEvent) {\n const { date, oldDate, isClear } = event as ChangeEvent;\n if (\n (date && oldDate && date.isSame(oldDate)) ||\n (!isClear && !date && !oldDate)\n ) {\n return;\n }\n this._handleAfterChangeEvent(event as ChangeEvent);\n\n this.optionsStore.input?.dispatchEvent(\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n new CustomEvent('change', { detail: event as any })\n );\n }\n\n this.optionsStore.element.dispatchEvent(\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n new CustomEvent(event.type, { detail: event as any })\n );\n\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((window as any).jQuery) {\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n const $ = (window as any).jQuery;\n\n if (isChangeEvent && this.optionsStore.input) {\n $(this.optionsStore.input).trigger(event);\n } else {\n $(this.optionsStore.element).trigger(event);\n }\n }\n\n this._publish(event);\n }\n\n private _publish(event: BaseEvent) {\n // return if event is not subscribed\n if (!Array.isArray(this._subscribers[event.type])) {\n return;\n }\n\n // Trigger callback for each subscriber\n this._subscribers[event.type].forEach((callback) => {\n callback(event);\n });\n }\n\n /**\n * Fires a ViewUpdate event when, for example, the month view is changed.\n * @private\n */\n private _viewUpdate() {\n this._triggerEvent({\n type: Namespace.events.update,\n viewDate: this.optionsStore.viewDate.clone,\n } as ViewUpdateEvent);\n }\n\n private _unsubscribe(eventName, index) {\n this._subscribers[eventName].splice(index, 1);\n }\n\n /**\n * Merges two Option objects together and validates options type\n * @param config new Options\n * @param mergeTo Options to merge into\n * @param includeDataset When true, the elements data-td attributes will be included in the\n * @private\n */\n private _initializeOptions(\n config: Options,\n mergeTo: Options,\n includeDataset = false\n ): void {\n let newConfig = OptionConverter.deepCopy(config);\n newConfig = OptionConverter._mergeOptions(newConfig, mergeTo);\n if (includeDataset)\n newConfig = OptionConverter._dataToOptions(\n this.optionsStore.element,\n newConfig\n );\n\n OptionConverter._validateConflicts(newConfig);\n\n newConfig.viewDate = newConfig.viewDate.setLocalization(\n newConfig.localization\n );\n\n if (!this.optionsStore.viewDate.isSame(newConfig.viewDate)) {\n this.optionsStore.viewDate = newConfig.viewDate;\n }\n\n /**\n * Sets the minimum view allowed by the picker. For example the case of only\n * allowing year and month to be selected but not date.\n */\n if (newConfig.display.components.year) {\n this.optionsStore.minimumCalendarViewMode = 2;\n }\n if (newConfig.display.components.month) {\n this.optionsStore.minimumCalendarViewMode = 1;\n }\n if (newConfig.display.components.date) {\n this.optionsStore.minimumCalendarViewMode = 0;\n }\n\n this.optionsStore.currentCalendarViewMode = Math.max(\n this.optionsStore.minimumCalendarViewMode,\n this.optionsStore.currentCalendarViewMode\n );\n\n // Update view mode if needed\n if (\n CalendarModes[this.optionsStore.currentCalendarViewMode].name !==\n newConfig.display.viewMode\n ) {\n this.optionsStore.currentCalendarViewMode = Math.max(\n CalendarModes.findIndex((x) => x.name === newConfig.display.viewMode),\n this.optionsStore.minimumCalendarViewMode\n );\n }\n\n if (this.display?.isVisible) {\n this.display._update('all');\n }\n\n if (\n newConfig.display.components.useTwentyfourHour &&\n newConfig.localization.hourCycle === undefined\n )\n newConfig.localization.hourCycle = 'h24';\n else if (newConfig.localization.hourCycle === undefined) {\n newConfig.localization.hourCycle = guessHourCycle(\n newConfig.localization.locale\n );\n }\n\n this.optionsStore.options = newConfig;\n\n if (\n newConfig.restrictions.maxDate &&\n this.viewDate.isAfter(newConfig.restrictions.maxDate)\n )\n this.viewDate = newConfig.restrictions.maxDate;\n\n if (\n newConfig.restrictions.minDate &&\n this.viewDate.isBefore(newConfig.restrictions.minDate)\n )\n this.viewDate = newConfig.restrictions.minDate;\n }\n\n /**\n * Checks if an input field is being used, attempts to locate one and sets an\n * event listener if found.\n * @private\n */\n private _initializeInput() {\n if (this.optionsStore.element.tagName == 'INPUT') {\n this.optionsStore.input = this.optionsStore.element as HTMLInputElement;\n } else {\n const query = this.optionsStore.element.dataset.tdTargetInput;\n if (query == undefined || query == 'nearest') {\n this.optionsStore.input =\n this.optionsStore.element.querySelector('input');\n } else {\n this.optionsStore.input =\n this.optionsStore.element.querySelector(query);\n }\n }\n\n if (!this.optionsStore.input) return;\n\n if (!this.optionsStore.input.value && this.optionsStore.options.defaultDate)\n this.optionsStore.input.value = this.dates.formatInput(\n this.optionsStore.options.defaultDate\n );\n\n this.optionsStore.input.addEventListener('change', this._inputChangeEvent);\n if (this.optionsStore.options.allowInputToggle) {\n this.optionsStore.input.addEventListener('click', this._openClickEvent);\n this.optionsStore.input.addEventListener('focus', this._openClickEvent);\n }\n\n if (this.optionsStore.input.value) {\n this._inputChangeEvent();\n }\n }\n\n /**\n * Attempts to locate a toggle for the picker and sets an event listener\n * @private\n */\n private _initializeToggle() {\n if (this.optionsStore.options.display.inline) return;\n let query = this.optionsStore.element.dataset.tdTargetToggle;\n if (query == 'nearest') {\n query = '[data-td-toggle=\"datetimepicker\"]';\n }\n this._toggle =\n query == undefined\n ? this.optionsStore.element\n : this.optionsStore.element.querySelector(query);\n this._toggle.addEventListener('click', this._toggleClickEvent);\n }\n\n /**\n * If the option is enabled this will render the clock view after a date pick.\n * @param e change event\n * @private\n */\n private _handleAfterChangeEvent(e: ChangeEvent) {\n if (\n // options is disabled\n !this.optionsStore.options.promptTimeOnDateChange ||\n this.optionsStore.options.multipleDates ||\n this.optionsStore.options.display.inline ||\n this.optionsStore.options.display.sideBySide ||\n // time is disabled\n !this.display._hasTime ||\n // clock component is already showing\n this.display.widget\n ?.getElementsByClassName(Namespace.css.show)[0]\n .classList.contains(Namespace.css.timeContainer)\n )\n return;\n\n // First time ever. If useCurrent option is set to true (default), do nothing\n // because the first date is selected automatically.\n // or date didn't change (time did) or date changed because time did.\n if (\n (!e.oldDate && this.optionsStore.options.useCurrent) ||\n (e.oldDate && e.date?.isSame(e.oldDate))\n ) {\n return;\n }\n\n clearTimeout(this._currentPromptTimeTimeout);\n this._currentPromptTimeTimeout = setTimeout(() => {\n if (this.display.widget) {\n this._eventEmitters.action.emit({\n e: {\n currentTarget: this.display.widget.querySelector(\n '[data-action=\"togglePicker\"]'\n ),\n },\n action: ActionTypes.togglePicker,\n });\n }\n }, this.optionsStore.options.promptTimeOnDateChangeTransitionDelay);\n }\n\n /**\n * Event for when the input field changes. This is a class level method so there's\n * something for the remove listener function.\n * @private\n */\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _inputChangeEvent = (event?: any) => {\n const internallyTriggered = event?.detail;\n if (internallyTriggered) return;\n\n const setViewDate = () => {\n if (this.dates.lastPicked)\n this.optionsStore.viewDate = this.dates.lastPicked.clone;\n };\n\n const value = this.optionsStore.input.value;\n if (\n this.optionsStore.options.multipleDates ||\n this.optionsStore.options.dateRange\n ) {\n try {\n const valueSplit = value.split(\n this.optionsStore.options.multipleDatesSeparator\n );\n for (let i = 0; i < valueSplit.length; i++) {\n this.dates.setFromInput(valueSplit[i], i);\n }\n setViewDate();\n } catch {\n console.warn(\n 'TD: Something went wrong trying to set the multipleDates values from the input field.'\n );\n }\n } else {\n this.dates.setFromInput(value, 0);\n setViewDate();\n }\n };\n\n /**\n * Event for when the toggle is clicked. This is a class level method so there's\n * something for the remove listener function.\n * @private\n */\n private _toggleClickEvent = () => {\n if (\n (this.optionsStore.element as HTMLInputElement)?.disabled ||\n this.optionsStore.input?.disabled ||\n //if we just have the input and allow input toggle is enabled, then don't cause a toggle\n (this._toggle.nodeName === 'INPUT' &&\n (this._toggle as HTMLInputElement)?.type === 'text' &&\n this.optionsStore.options.allowInputToggle)\n )\n return;\n this.toggle();\n };\n\n /**\n * Event for when the toggle is clicked. This is a class level method so there's\n * something for the remove listener function.\n * @private\n */\n private _openClickEvent = () => {\n if (\n (this.optionsStore.element as HTMLInputElement)?.disabled ||\n this.optionsStore.input?.disabled\n )\n return;\n if (!this.display.isVisible) this.show();\n };\n}\n\n/**\n * Whenever a locale is loaded via a plugin then store it here based on the\n * locale name. E.g. loadedLocales['ru']\n */\nconst loadedLocales = {};\n\n// noinspection JSUnusedGlobalSymbols\n/**\n * Called from a locale plugin.\n * @param l locale object for localization options\n */\nconst loadLocale = (l) => {\n if (loadedLocales[l.name]) return;\n loadedLocales[l.name] = l.localization;\n};\n\n/**\n * A sets the global localization options to the provided locale name.\n * `loadLocale` MUST be called first.\n * @param l\n */\nconst locale = (l: string) => {\n const asked = loadedLocales[l];\n if (!asked) return;\n DefaultOptions.localization = asked;\n};\n\n// noinspection JSUnusedGlobalSymbols\n/**\n * Called from a plugin to extend or override picker defaults.\n * @param plugin\n * @param option\n */\nconst extend = function (plugin, option = undefined) {\n if (!plugin) return tempusDominus;\n if (!plugin.installed) {\n // install plugin only once\n plugin(\n option,\n { TempusDominus, Dates, Display, DateTime, Namespace },\n tempusDominus\n );\n plugin.installed = true;\n }\n return tempusDominus;\n};\n\nconst version = '6.7.19';\n\nconst tempusDominus = {\n TempusDominus,\n extend,\n loadLocale,\n locale,\n Namespace,\n DefaultOptions,\n DateTime,\n Unit,\n version,\n DefaultEnLocalization,\n};\n\nexport {\n TempusDominus,\n extend,\n loadLocale,\n locale,\n Namespace,\n DefaultOptions,\n DateTime,\n Unit,\n version,\n DateTimeFormatOptions,\n Options,\n DefaultEnLocalization,\n};\n"],"names":["DefaultFormatLocalization","ActionTypes","SecondDisplay"],"mappings":";;;;;AAAM,MAAO,OAAQ,SAAQ,KAAK,CAAA;AAEjC,CAAA;MAEY,aAAa,CAAA;AAA1B,IAAA,WAAA,GAAA;QACU,IAAI,CAAA,IAAA,GAAG,KAAK,CAAC;;;AAqKrB;;;AAGG;QACH,IAAsB,CAAA,sBAAA,GAAG,4BAA4B,CAAC;AAEtD;;;AAGG;QACH,IAAkB,CAAA,kBAAA,GAAG,0BAA0B,CAAC;;KAGjD;;AA9KC;;;AAGG;AACH,IAAA,gBAAgB,CAAC,UAAkB,EAAA;AACjC,QAAA,MAAM,KAAK,GAAG,IAAI,OAAO,CACvB,CAAA,EAAG,IAAI,CAAC,IAAI,CAAA,oBAAA,EAAuB,UAAU,CAAA,+BAAA,CAAiC,CAC/E,CAAC;AACF,QAAA,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC;AACf,QAAA,MAAM,KAAK,CAAC;KACb;AAED;;;AAGG;AACH,IAAA,iBAAiB,CAAC,UAAoB,EAAA;AACpC,QAAA,MAAM,KAAK,GAAG,IAAI,OAAO,CAAC,CAAA,EAAG,IAAI,CAAC,IAAI,CAAK,EAAA,EAAA,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA,CAAE,CAAC,CAAC;AACpE,QAAA,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC;AACf,QAAA,MAAM,KAAK,CAAC;KACb;AAED;;;;;;;AAOG;AACH,IAAA,qBAAqB,CACnB,UAAkB,EAClB,QAAgB,EAChB,YAAsB,EAAA;QAEtB,MAAM,KAAK,GAAG,IAAI,OAAO,CACvB,CACE,EAAA,IAAI,CAAC,IACP,C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EAAE;;AAErB,QAAA,MAAM,CACJ,MAAM,EACN,EAAE,aAAa,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,EACtD,aAAa,CACd,CAAC;AACF,QAAA,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC;AACzB,KAAA;AACD,IAAA,OAAO,aAAa,CAAC;AACvB,EAAE;AAEI,MAAA,OAAO,GAAG,SAAS;AAEzB,MAAM,aAAa,GAAG;IACpB,aAAa;IACb,MAAM;IACN,UAAU;IACV,MAAM;IACN,SAAS;IACT,cAAc;IACd,QAAQ;IACR,IAAI;IACJ,OAAO;IACP,qBAAqB;CACtB;;;;"} \ No newline at end of file diff --git a/node_modules/@eonasdan/tempus-dominus/dist/js/tempus-dominus.esm.min.js b/node_modules/@eonasdan/tempus-dominus/dist/js/tempus-dominus.esm.min.js deleted file mode 100644 index b3dd416..0000000 --- a/node_modules/@eonasdan/tempus-dominus/dist/js/tempus-dominus.esm.min.js +++ /dev/null @@ -1,6 +0,0 @@ -/*! - * Tempus Dominus v6.7.19 (https://getdatepicker.com/) - * Copyright 2013-2023 Jonathan Peterson - * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) - */ -class t extends Error{}const e="tempus-dominus";class s{}s.NAME=e,s.dataKey="td",s.events=new class{constructor(){this.key=".td",this.change=`change${this.key}`,this.update=`update${this.key}`,this.error=`error${this.key}`,this.show=`show${this.key}`,this.hide=`hide${this.key}`,this.blur=`blur${this.key}`,this.focus=`focus${this.key}`,this.keyup=`keyup${this.key}`,this.keydown=`keydown${this.key}`}},s.css=new class{constructor(){this.widget=`${e}-widget`,this.calendarHeader="calendar-header",this.switch="picker-switch",this.toolbar="toolbar",this.noHighlight="no-highlight",this.sideBySide="timepicker-sbs",this.previous="previous",this.next="next",this.disabled="disabled",this.old="old",this.new="new",this.active="active",this.dateContainer="date-container",this.decadesContainer=`${this.dateContainer}-decades`,this.decade="decade",this.yearsContainer=`${this.dateContainer}-years`,this.year="year",this.monthsContainer=`${this.dateContainer}-months`,this.month="month",this.daysContainer=`${this.dateContainer}-days`,this.day="day",this.calendarWeeks="cw",this.dayOfTheWeek="dow",this.today="today",this.weekend="weekend",this.rangeIn="range-in",this.rangeStart="range-start",this.rangeEnd="range-end",this.timeContainer="time-container",this.separator="separator",this.clockContainer=`${this.timeContainer}-clock`,this.hourContainer=`${this.timeContainer}-hour`,this.minuteContainer=`${this.timeContainer}-minute`,this.secondContainer=`${this.timeContainer}-second`,this.hour="hour",this.minute="minute",this.second="second",this.toggleMeridiem="toggleMeridiem",this.show="show",this.collapsing="td-collapsing",this.collapse="td-collapse",this.inline="inline",this.lightTheme="light",this.darkTheme="dark",this.isDarkPreferredQuery="(prefers-color-scheme: dark)"}},s.errorMessages=new class{constructor(){this.base="TD:",this.failedToSetInvalidDate="Failed to set invalid date",this.failedToParseInput="Failed parse input field"}unexpectedOption(e){const s=new t(`${this.base} Unexpected option: ${e} does not match a known option.`);throw s.code=1,s}unexpectedOptions(e){const s=new t(`${this.base}: ${e.join(", ")}`);throw s.code=1,s}unexpectedOptionValue(e,s,i){const o=new t(`${this.base} Unexpected option value: ${e} does not accept a value of "${s}". Valid values are: ${i.join(", ")}`);throw o.code=2,o}typeMismatch(e,s,i){const o=new t(`${this.base} Mismatch types: ${e} has a type of ${s} instead of the required ${i}`);throw o.code=3,o}numbersOutOfRange(e,s,i){const o=new t(`${this.base} ${e} expected an array of number between ${s} and ${i}.`);throw o.code=4,o}failedToParseDate(e,s,i=!1){const o=new t(`${this.base} Could not correctly parse "${s}" to a date for ${e}.`);if(o.code=5,!i)throw o;console.warn(o)}mustProvideElement(){const e=new t(`${this.base} No element was provided.`);throw e.code=6,e}subscribeMismatch(){const e=new t(`${this.base} The subscribed events does not match the number of callbacks`);throw e.code=7,e}conflictingConfiguration(e){const s=new t(`${this.base} A configuration value conflicts with another rule. ${e}`);throw s.code=8,s}customDateFormatError(e){const s=new t(`${this.base} Custom Date Format: ${e}`);throw s.code=9,s}dateString(){console.warn(`${this.base} Using a string for date options is not recommended unless you specify an ISO string or use the customDateFormat plugin.`)}deprecatedWarning(t,e){console.warn(`${this.base} Warning ${t} is deprecated and will be removed in a future version. ${e}`)}throwError(e){const s=new t(`${this.base} ${e}`);throw s.code=9,s}};var i,o={...{dateFormats:{LTS:"h:mm:ss T",LT:"h:mm T",L:"MM/dd/yyyy",LL:"MMMM d, yyyy",LLL:"MMMM d, yyyy h:mm T",LLLL:"dddd, MMMM d, yyyy h:mm T"},format:"L LT",locale:"default",hourCycle:void 0,ordinal:t=>{const e=["th","st","nd","rd"],s=t%100;return`[${t}${e[(s-20)%10]||e[s]||e[0]}]`}}};!function(t){t.seconds="seconds",t.minutes="minutes",t.hours="hours",t.date="date",t.month="month",t.year="year"}(i||(i={}));const a={month:"2-digit",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"},n=t=>{switch(t){case"date":return{dateStyle:"short"};case"month":return{month:"numeric",year:"numeric"};case"year":return{year:"numeric"}}},r=t=>{if(!t)return"h12";const e={hour:"2-digit",minute:"2-digit",numberingSystem:"latn"},s=(new d).setLocalization({locale:t});s.hours=0;const i=s.parts(void 0,e).hour;if("12"===i)return"h12";if("24"===i)return"h24";s.hours=23;const o=s.parts(void 0,e).hour;return"00"===i&&"11"===o?"h11":"00"===i&&"23"===o?"h23":void console.warn(`couldn't determine hour cycle for ${t}. start: ${i}. end: ${o}`)};class d extends Date{constructor(){super(...arguments),this.localization=o,this.nonLeapLadder=[0,31,59,90,120,151,181,212,243,273,304,334],this.leapLadder=[0,31,60,91,121,152,182,213,244,274,305,335],this.dateTimeRegex=/(\[[^[\]]*])|y{1,4}|M{1,4}|d{1,4}|H{1,2}|h{1,2}|t|T|m{1,2}|s{1,2}|f{3}/g,this.formattingTokens=/(\[[^[\]]*])|([-_:/.,()\s]+)|(T|t|yyyy|yy?|MM?M?M?|Do|dd?|hh?|HH?|mm?|ss?)/g,this.match2=/\d\d/,this.match3=/\d{3}/,this.match4=/\d{4}/,this.match1to2=/\d\d?/,this.matchSigned=/[+-]?\d+/,this.matchOffset=/[+-]\d\d:?(\d\d)?|Z/,this.matchWord=/[^\d_:/,\-()\s]+/,this.zoneExpressions=[this.matchOffset,(t,e)=>{t.offset=this.offsetFromString(e)}],this.expressions={t:{pattern:void 0,parser:(t,e)=>{t.afternoon=this.meridiemMatch(e)}},T:{pattern:void 0,parser:(t,e)=>{t.afternoon=this.meridiemMatch(e)}},fff:{pattern:this.match3,parser:(t,e)=>{t.milliseconds=+e}},s:{pattern:this.match1to2,parser:this.addInput("seconds")},ss:{pattern:this.match1to2,parser:this.addInput("seconds")},m:{pattern:this.match1to2,parser:this.addInput("minutes")},mm:{pattern:this.match1to2,parser:this.addInput("minutes")},H:{pattern:this.match1to2,parser:this.addInput("hours")},h:{pattern:this.match1to2,parser:this.addInput("hours")},HH:{pattern:this.match1to2,parser:this.addInput("hours")},hh:{pattern:this.match1to2,parser:this.addInput("hours")},d:{pattern:this.match1to2,parser:this.addInput("day")},dd:{pattern:this.match2,parser:this.addInput("day")},Do:{pattern:this.matchWord,parser:(t,e)=>{if(t.day=+(e.match(/\d+/)[0]||1),this.localization.ordinal)for(let s=1;s<=31;s+=1)this.localization.ordinal(s).replace(/[[\]]/g,"")===e&&(t.day=s)}},M:{pattern:this.match1to2,parser:this.addInput("month")},MM:{pattern:this.match2,parser:this.addInput("month")},MMM:{pattern:this.matchWord,parser:(t,e)=>{const s=this.getAllMonths(),i=(this.getAllMonths("short")||s.map((t=>t.slice(0,3)))).indexOf(e)+1;if(i<1)throw new Error;t.month=i%12||i}},MMMM:{pattern:this.matchWord,parser:(t,e)=>{const s=this.getAllMonths().indexOf(e)+1;if(s<1)throw new Error;t.month=s%12||s}},y:{pattern:this.matchSigned,parser:this.addInput("year")},yy:{pattern:this.match2,parser:(t,e)=>{t.year=this.parseTwoDigitYear(+e)}},yyyy:{pattern:this.match4,parser:this.addInput("year")}}}setLocale(t){return this.localization||(this.localization=o,this.localization.locale=t),this}setLocalization(t){return this.localization=t,this}static convert(t,e="default",s=undefined){if(!t)throw new Error("A date is required");return s||((s=o).locale=e),new d(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()).setLocalization(s)}get clone(){return new d(this.year,this.month,this.date,this.hours,this.minutes,this.seconds,this.getMilliseconds()).setLocalization(this.localization)}static isValid(t){return void 0!==t&&"null"!==JSON.stringify(t)&&t.constructor.name===d.name}startOf(t,e=0){if(void 0===this[t])throw new Error(`Unit '${t}' is not valid`);switch(t){case"seconds":this.setMilliseconds(0);break;case"minutes":this.setSeconds(0,0);break;case"hours":this.setMinutes(0,0,0);break;case"date":this.setHours(0,0,0,0);break;case"weekDay":{if(this.startOf(i.date),this.weekDay===e)break;const t=(this.weekDay-e+7)%7;this.manipulate(-1*t,i.date);break}case"month":this.startOf(i.date),this.setDate(1);break;case"year":this.startOf(i.date),this.setMonth(0,1)}return this}endOf(t,e=0){if(void 0===this[t])throw new Error(`Unit '${t}' is not valid`);switch(t){case"seconds":this.setMilliseconds(999);break;case"minutes":this.setSeconds(59,999);break;case"hours":this.setMinutes(59,59,999);break;case"date":this.setHours(23,59,59,999);break;case"weekDay":{this.endOf(i.date);const t=6+e;if(this.weekDay===t)break;this.manipulate(t-this.weekDay,i.date);break}case"month":this.endOf(i.date),this.manipulate(1,i.month),this.setDate(0);break;case"year":this.endOf(i.date),this.setMonth(11,31)}return this}manipulate(t,e){if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return this[e]+=t,this}isBefore(t,e){if(!d.isValid(t))return!1;if(!e)return this.valueOf()t.valueOf();if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return this.clone.startOf(e).valueOf()>t.clone.startOf(e).valueOf()}isSame(t,e){if(!d.isValid(t))return!1;if(!e)return this.valueOf()===t.valueOf();if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return t=d.convert(t),this.clone.startOf(e).valueOf()===t.startOf(e).valueOf()}isBetween(t,e,s,i="()"){if(!d.isValid(t)||!d.isValid(e))return!1;if(s&&void 0===this[s])throw new Error(`Unit '${s}' is not valid`);const o="("===i[0],a=")"===i[1],n=o?this.isAfter(t,s):!this.isBefore(t,s),r=a?this.isBefore(e,s):!this.isAfter(e,s);return n&&r}parts(t=this.localization.locale,e={dateStyle:"full",timeStyle:"long"}){const s={};return new Intl.DateTimeFormat(t,e).formatToParts(this).filter((t=>"literal"!==t.type)).forEach((t=>s[t.type]=t.value)),s}get seconds(){return this.getSeconds()}set seconds(t){this.setSeconds(t)}get secondsFormatted(){return this.parts(void 0,a).second}get minutes(){return this.getMinutes()}set minutes(t){this.setMinutes(t)}get minutesFormatted(){return this.parts(void 0,a).minute}get hours(){return this.getHours()}set hours(t){this.setHours(t)}getHoursFormatted(t="h12"){return this.parts(void 0,{...a,hourCycle:t}).hour}meridiem(t=this.localization.locale){return new Intl.DateTimeFormat(t,{hour:"numeric",hour12:!0}).formatToParts(this).find((t=>"dayPeriod"===t.type))?.value}get date(){return this.getDate()}set date(t){this.setDate(t)}get dateFormatted(){return this.parts(void 0,a).day}get weekDay(){return this.getDay()}get month(){return this.getMonth()}set month(t){const e=new Date(this.year,t+1);e.setDate(0);const s=e.getDate();this.date>s&&(this.date=s),this.setMonth(t)}get monthFormatted(){return this.parts(void 0,a).month}get year(){return this.getFullYear()}set year(t){this.setFullYear(t)}get week(){const t=this.computeOrdinal(),e=this.getUTCDay();let s=Math.floor((t-e+10)/7);return s<1?s=this.weeksInWeekYear():s>this.weeksInWeekYear()&&(s=1),s}weeksInWeekYear(){const t=(this.year+Math.floor(this.year/4)-Math.floor(this.year/100)+Math.floor(this.year/400))%7,e=this.year-1,s=(e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400))%7;return 4===t||3===s?53:52}get isLeapYear(){return this.year%4==0&&(this.year%100!=0||this.year%400==0)}computeOrdinal(){return this.date+(this.isLeapYear?this.leapLadder:this.nonLeapLadder)[this.month]}getAllMonths(t="long"){const e=new Intl.DateTimeFormat(this.localization.locale,{month:t}).format;return[...Array(12).keys()].map((t=>e(new Date(2021,t))))}replaceTokens(t,e){return t.replace(/(\[[^[\]]*])|(LTS?|l{1,4}|L{1,4})/g,((t,s,i)=>{const a=i&&i.toUpperCase();return s||e[a]||o.dateFormats[a]}))}parseTwoDigitYear(t){return t+(t>68?1900:2e3)}offsetFromString(t){if(!t)return 0;if("Z"===t)return 0;const[e,s,i]=t.match(/([+-]|\d\d)/g),o=60*+s+(+i||0);return 0===o?0:"+"===e?-o:o}zoneInformation(t,e){let s=t.parts(this.localization.locale,{timeZoneName:"longOffset"}).timeZoneName.replace("GMT","").replace(":","");const i=s.includes("-");return s=s.replace("-",""),"z"===e?s=s.substring(1,2):"zz"===e&&(s=s.substring(0,2)),`${i?"-":""}${s}`}addInput(t){return(e,s)=>{e[t]=+s}}getLocaleAfternoon(){return new Intl.DateTimeFormat(this.localization.locale,{hour:"numeric",hour12:!0}).formatToParts(new Date(2022,3,4,13)).find((t=>"dayPeriod"===t.type))?.value?.replace(/\s+/g," ")}meridiemMatch(t){return t.toLowerCase()===this.getLocaleAfternoon().toLowerCase()}correctHours(t){const{afternoon:e}=t;if(void 0!==e){const{hours:s}=t;e?s<12&&(t.hours+=12):12===s&&(t.hours=0),delete t.afternoon}}makeParser(t){const e=(t=this.replaceTokens(t,this.localization.dateFormats)).match(this.formattingTokens),{length:s}=e,i=[];for(let t=0;t{const e={hours:0,minutes:0,seconds:0,milliseconds:0};for(let o=0,a=0;o-1)return new d(("X"===e.format?1e3:1)*+t);t=t.replace(/\s+/g," ");const i=s.makeParser(e.format),{year:o,month:a,day:n,hours:r,minutes:l,seconds:c,milliseconds:h,zone:p}=i(t),u=n||(o||a?1:s.getDate()),m=o||s.getFullYear();let y=0;return o&&!a||(y=a>0?a-1:s.getMonth()),p?new d(Date.UTC(m,y,u,r,l,c,h+60*p.offset*1e3)):new d(m,y,u,r,l,c,h)}catch(i){s.errorMessages.customDateFormatError(`Unable to parse provided input: ${t}, format: ${e.format}`)}}format(t,e=this.localization.locale){if(t&&"object"==typeof t)return new Intl.DateTimeFormat(e,t).format(this);const s=this.replaceTokens(t||this.localization.format||`${o.dateFormats.L}, ${o.dateFormats.LT}`,this.localization.dateFormats),i=t=>new Intl.DateTimeFormat(this.localization.locale,t).format(this);this.localization.hourCycle||(this.localization.hourCycle=r(this.localization.locale));const a=this.localization.hourCycle.startsWith("h1")?"h24":this.localization.hourCycle,n=this.localization.hourCycle.startsWith("h2")?"h12":this.localization.hourCycle,d={y:this.year,yy:i({year:"2-digit"}),yyyy:this.year,M:i({month:"numeric"}),MM:this.monthFormatted,MMM:this.getAllMonths("short")[this.getMonth()],MMMM:this.getAllMonths()[this.getMonth()],d:this.date,dd:this.dateFormatted,ddd:i({weekday:"short"}),dddd:i({weekday:"long"}),H:this.getHours(),HH:this.getHoursFormatted(a),h:this.hours>12?this.hours-12:this.hours,hh:this.getHoursFormatted(n),t:this.meridiem(),T:this.meridiem().toUpperCase(),m:this.minutes,mm:this.minutesFormatted,s:this.seconds,ss:this.secondsFormatted,fff:this.getMilliseconds()};return s.replace(this.dateTimeRegex,((t,e)=>e||d[t])).replace(/\[/g,"").replace(/]/g,"")}}class l{constructor(){this.cache=new Map}locate(t){const e=this.cache.get(t);if(e)return e;const s=new t;return this.cache.set(t,s),s}}let c;const h=[{name:"calendar",className:s.css.daysContainer,unit:i.month,step:1},{name:"months",className:s.css.monthsContainer,unit:i.year,step:1},{name:"years",className:s.css.yearsContainer,unit:i.year,step:10},{name:"decades",className:s.css.decadesContainer,unit:i.year,step:100}];class p{constructor(){this._currentCalendarViewMode=0,this._viewDate=new d,this.minimumCalendarViewMode=0,this.currentView="calendar"}get currentCalendarViewMode(){return this._currentCalendarViewMode}set currentCalendarViewMode(t){this._currentCalendarViewMode=t,this.currentView=h[t].name}get viewDate(){return this._viewDate}set viewDate(t){this._viewDate=t,this.options&&(this.options.viewDate=t)}refreshCurrentView(){this.currentView=h[this.currentCalendarViewMode].name}get isTwelveHour(){return["h12","h11"].includes(this.options.localization.hourCycle)}}class u{constructor(){this.optionsStore=c.locate(p)}isValid(t,e){if(!this._enabledDisabledDatesIsValid(e,t))return!1;if(e!==i.month&&e!==i.year&&this.optionsStore.options.restrictions.daysOfWeekDisabled?.length>0&&-1!==this.optionsStore.options.restrictions.daysOfWeekDisabled.indexOf(t.weekDay))return!1;if(!this._minMaxIsValid(e,t))return!1;if(e===i.hours||e===i.minutes||e===i.seconds){if(!this._enabledDisabledHoursIsValid(t))return!1;if(0!==this.optionsStore.options.restrictions.disabledTimeIntervals?.filter((e=>t.isBetween(e.from,e.to))).length)return!1}return!0}_enabledDisabledDatesIsValid(t,e){return t!==i.date||!(this.optionsStore.options.restrictions.disabledDates.length>0&&this._isInDisabledDates(e))&&!(this.optionsStore.options.restrictions.enabledDates.length>0&&!this._isInEnabledDates(e))}_isInDisabledDates(t){return!(!this.optionsStore.options.restrictions.disabledDates||0===this.optionsStore.options.restrictions.disabledDates.length)&&!!this.optionsStore.options.restrictions.disabledDates.find((e=>e.isSame(t,i.date)))}_isInEnabledDates(t){return!this.optionsStore.options.restrictions.enabledDates||0===this.optionsStore.options.restrictions.enabledDates.length||!!this.optionsStore.options.restrictions.enabledDates.find((e=>e.isSame(t,i.date)))}_minMaxIsValid(t,e){return(!this.optionsStore.options.restrictions.minDate||!e.isBefore(this.optionsStore.options.restrictions.minDate,t))&&(!this.optionsStore.options.restrictions.maxDate||!e.isAfter(this.optionsStore.options.restrictions.maxDate,t))}_enabledDisabledHoursIsValid(t){return!(this.optionsStore.options.restrictions.disabledHours.length>0&&this._isInDisabledHours(t))&&!(this.optionsStore.options.restrictions.enabledHours.length>0&&!this._isInEnabledHours(t))}_isInDisabledHours(t){if(!this.optionsStore.options.restrictions.disabledHours||0===this.optionsStore.options.restrictions.disabledHours.length)return!1;const e=t.hours;return this.optionsStore.options.restrictions.disabledHours.includes(e)}_isInEnabledHours(t){if(!this.optionsStore.options.restrictions.enabledHours||0===this.optionsStore.options.restrictions.enabledHours.length)return!0;const e=t.hours;return this.optionsStore.options.restrictions.enabledHours.includes(e)}dateRangeIsValid(t,e,s){if(!this.optionsStore.options.dateRange)return!0;if(2!==t.length&&1!==e)return!0;const o=t[0].clone;if(o.isSame(s,i.date))return!0;for(o.manipulate(1,i.date);!o.isSame(s,i.date);){if(!this.isValid(o,i.date))return!1;o.manipulate(1,i.date)}return!0}}class m{constructor(){this.subscribers=[]}subscribe(t){return this.subscribers.push(t),this.unsubscribe.bind(this,this.subscribers.length-1)}unsubscribe(t){this.subscribers.splice(t,1)}emit(t){this.subscribers.forEach((e=>{e(t)}))}destroy(){this.subscribers=null,this.subscribers=[]}}class y{constructor(){this.triggerEvent=new m,this.viewUpdate=new m,this.updateDisplay=new m,this.action=new m,this.updateViewDate=new m}destroy(){this.triggerEvent.destroy(),this.viewUpdate.destroy(),this.updateDisplay.destroy(),this.action.destroy(),this.updateViewDate.destroy()}}const g={clear:"Clear selection",close:"Close the picker",dateFormats:o.dateFormats,dayViewHeaderFormat:{month:"long",year:"2-digit"},decrementHour:"Decrement Hour",decrementMinute:"Decrement Minute",decrementSecond:"Decrement Second",format:o.format,hourCycle:o.hourCycle,incrementHour:"Increment Hour",incrementMinute:"Increment Minute",incrementSecond:"Increment Second",locale:o.locale,maxWeekdayLength:0,nextCentury:"Next Century",nextDecade:"Next Decade",nextMonth:"Next Month",nextYear:"Next Year",ordinal:o.ordinal,pickHour:"Pick Hour",pickMinute:"Pick Minute",pickSecond:"Pick Second",previousCentury:"Previous Century",previousDecade:"Previous Decade",previousMonth:"Previous Month",previousYear:"Previous Year",selectDate:"Select Date",selectDecade:"Select Decade",selectMonth:"Select Month",selectTime:"Select Time",selectYear:"Select Year",startOfTheWeek:0,today:"Go to today",toggleMeridiem:"Toggle Meridiem"},v={allowInputToggle:!1,container:void 0,dateRange:!1,debug:!1,defaultDate:void 0,display:{icons:{type:"icons",time:"fa-solid fa-clock",date:"fa-solid fa-calendar",up:"fa-solid fa-arrow-up",down:"fa-solid fa-arrow-down",previous:"fa-solid fa-chevron-left",next:"fa-solid fa-chevron-right",today:"fa-solid fa-calendar-check",clear:"fa-solid fa-trash",close:"fa-solid fa-xmark"},sideBySide:!1,calendarWeeks:!1,viewMode:"calendar",toolbarPlacement:"bottom",keepOpen:!1,buttons:{today:!1,clear:!1,close:!1},components:{calendar:!0,date:!0,month:!0,year:!0,decades:!0,clock:!0,hours:!0,minutes:!0,seconds:!1,useTwentyfourHour:void 0},inline:!1,theme:"auto",placement:"bottom"},keepInvalid:!1,localization:g,meta:{},multipleDates:!1,multipleDatesSeparator:"; ",promptTimeOnDateChange:!1,promptTimeOnDateChangeTransitionDelay:200,restrictions:{minDate:void 0,maxDate:void 0,disabledDates:[],enabledDates:[],daysOfWeekDisabled:[],disabledTimeIntervals:[],disabledHours:[],enabledHours:[]},stepping:1,useCurrent:!0,viewDate:new d},S={...g};function f(t,e){if(!t)return null;if(t.constructor.name===d.name)return t;if(t.constructor.name===Date.name)return d.convert(t);if("string"==typeof t){const s=d.fromString(t,e);return"null"===JSON.stringify(s)?null:s}return null}function w(t,e,i){"string"==typeof t&&"input"!==e&&s.errorMessages.dateString();const o=f(t,i);return o||s.errorMessages.failedToParseDate(e,t,"input"===e),o}function b(t,e,i,a=o){Array.isArray(e)||s.errorMessages.typeMismatch(t,i,"array of DateTime or Date");for(let s=0;s"number"!=typeof t))||s.errorMessages.typeMismatch(t,i,"array of numbers")}function _(t){return({value:e,providedType:s,localization:i})=>{const o=w(e,t,i);if(void 0!==o)return o.setLocalization(i),o}}function k(t){const e=_(t);return t=>void 0===t.value?t.value:e(t)}function C(t,e,i){return({value:o,providedType:a})=>void 0===o?[]:(D(t,o,a),o.some((t=>ti))&&s.errorMessages.numbersOutOfRange(t,e,i),o)}function M(t){return C(t,0,23)}function E(t){return({value:e,providedType:s,localization:i})=>void 0===e?[]:(b(t,e,s,i),e)}function L(t){return({value:e,path:i})=>(t.includes(e)||s.errorMessages.unexpectedOptionValue(i.substring(1),e,t),e)}const T=Object.freeze({defaultDate:_("defaultDate"),viewDate:_("viewDate"),minDate:k("restrictions.minDate"),maxDate:k("restrictions.maxDate"),disabledHours:M("restrictions.disabledHours"),enabledHours:M("restrictions.enabledHours"),disabledDates:E("restrictions.disabledDates"),enabledDates:E("restrictions.enabledDates"),daysOfWeekDisabled:C("restrictions.daysOfWeekDisabled",0,6),disabledTimeIntervals:({key:t,value:e,providedType:i,localization:o})=>{if(void 0===e)return[];Array.isArray(e)||s.errorMessages.typeMismatch(t,i,"array of { from: DateTime|Date, to: DateTime|Date }");const a=e;for(let e=0;e{const i=`${t}[${e}].${s}`,n=w(a[e][s],i,o);n.setLocalization(o),a[e][s]=n}));return a},toolbarPlacement:L(["top","bottom","default"]),type:L(["icons","sprites"]),viewMode:L(["clock","calendar","months","years","decades"]),theme:L(["light","dark","auto"]),placement:L(["top","bottom"]),meta:({value:t})=>t,dayViewHeaderFormat:({value:t})=>t,container:({value:t,path:e})=>(t&&!(t instanceof HTMLElement||t instanceof Element||t?.appendChild)&&s.errorMessages.typeMismatch(e.substring(1),typeof t,"HTMLElement"),t),useTwentyfourHour:({value:t,path:e,providedType:i,defaultType:o})=>{if(s.errorMessages.deprecatedWarning("useTwentyfourHour",'Please use "options.localization.hourCycle" instead'),void 0===t||"boolean"===i)return t;s.errorMessages.typeMismatch(e,i,o)},hourCycle:L(["h11","h12","h23","h24"])}),A=({value:t,defaultType:e,providedType:i,path:o})=>{switch(e){case"boolean":return"true"===t||!0===t;case"number":return+t;case"string":return t.toString();case"object":return{};case"function":return t;default:s.errorMessages.typeMismatch(o,i,e)}};class V{static deepCopy(t){const e={};return Object.keys(t).forEach((s=>{const i=t[s];i instanceof d?e[s]=i.clone:i instanceof Date?e[s]=new Date(i.valueOf()):(e[s]=i,"object"!=typeof i||i instanceof HTMLElement||i instanceof Element||Array.isArray(i)||(e[s]=V.deepCopy(i)))})),e}static objectPath(t,e){return"."===t.charAt(0)&&(t=t.slice(1)),t?t.split(".").reduce(((t,e)=>V.isValue(t)||V.isValue(t[e])?t[e]:void 0),e):e}static spread(t,e,i,o=""){const a=V.objectPath(o,v),n=Object.keys(t).filter((t=>!Object.keys(a).includes(t)));if(n.length>0){const t=V.getFlattenDefaultOptions(),e=n.map((e=>{let s=`"${o}.${e}" in not a known option.`;const i=t.find((t=>t.includes(e)));return i&&(s+=` Did you mean "${i}"?`),s}));s.errorMessages.unexpectedOptions(e)}Object.keys(t).filter((t=>"__proto__"!==t&&"constructor"!==t)).forEach((s=>{"."===(o+=`.${s}`).charAt(0)&&(o=o.slice(1));const n=a[s],r=typeof t[s],d=typeof n,l=t[s];if(null==l)return e[s]=l,void(o=o.substring(0,o.lastIndexOf(`.${s}`)));"object"!=typeof n||Array.isArray(t[s])||n instanceof Date||V.ignoreProperties.includes(s)?e[s]=V.processKey(s,l,r,d,o,i):V.spread(t[s],e[s],i,o),o=o.substring(0,o.lastIndexOf(`.${s}`))}))}static processKey(t,e,s,i,o,a){return(T[(n={key:t,value:e,providedType:s,defaultType:i,path:o,localization:a}).key]||A)(n);var n}static _mergeOptions(t,e){const s=V.deepCopy(e),i="default"!==e.localization?.locale?e.localization:t?.localization||v.localization;return V.spread(t,s,i,""),s}static _dataToOptions(t,e){const i=JSON.parse(JSON.stringify(t.dataset));if(i?.tdTargetInput&&delete i.tdTargetInput,i?.tdTargetToggle&&delete i.tdTargetToggle,!i||0===Object.keys(i).length||i.constructor!==DOMStringMap)return e;const o={},a=t=>{const e={};return Object.keys(t).forEach((t=>{e[t.toLowerCase()]=t})),e},n=this.normalizeObject(a),r=a(e);return Object.keys(i).filter((t=>t.startsWith(s.dataKey))).map((t=>t.substring(2))).forEach((t=>{let s=r[t.toLowerCase()];if(t.includes("_")){const a=t.split("_");s=r[a[0].toLowerCase()],void 0!==s&&e[s].constructor===Object&&(o[s]=n(a,1,e[s],i[`td${t}`]))}else void 0!==s&&(o[s]=i[`td${t}`])})),this._mergeOptions(o,e)}static normalizeObject(t){const e=(s,i,o,a)=>{const n=t(o)[s[i].toLowerCase()],r={};return void 0===n||(o[n].constructor===Object?(i++,r[n]=e(s,i,o[n],a)):r[n]=a),r};return e}static _dateTypeCheck(t,e){return f(t,e)}static _typeCheckDateArray(t,e,s,i){return b(t,e,s,i)}static _typeCheckNumberArray(t,e,s){return D(t,e,s)}static dateConversion(t,e,s){return w(t,e,s)}static getFlattenDefaultOptions(){if(this._flattenDefaults)return this._flattenDefaults;const t=(e,s=[])=>Array.isArray(e)?[]:Object(e)===e?Object.entries(e).flatMap((([e,i])=>t(i,[...s,e]))):s.join(".");return this._flattenDefaults=t(v),this._flattenDefaults}static _validateConflicts(t){!t.display.sideBySide||t.display.components.clock&&(t.display.components.hours||t.display.components.minutes||t.display.components.seconds)||s.errorMessages.conflictingConfiguration("Cannot use side by side mode without the clock components"),t.restrictions.minDate&&t.restrictions.maxDate&&(t.restrictions.minDate.isAfter(t.restrictions.maxDate)&&s.errorMessages.conflictingConfiguration("minDate is after maxDate"),t.restrictions.maxDate.isBefore(t.restrictions.minDate)&&s.errorMessages.conflictingConfiguration("maxDate is before minDate")),t.multipleDates&&t.dateRange&&s.errorMessages.conflictingConfiguration('Cannot uss option "multipleDates" with "dateRange"')}}V.ignoreProperties=["meta","dayViewHeaderFormat","container","dateForms","ordinal"],V.isValue=t=>null!=t;class ${constructor(){this._dates=[],this.optionsStore=c.locate(p),this.validation=c.locate(u),this._eventEmitters=c.locate(y)}get picked(){return[...this._dates]}get lastPicked(){return this._dates[this.lastPickedIndex]?.clone}get lastPickedIndex(){return 0===this._dates.length?0:this._dates.length-1}formatInput(t){return t?(t.localization=this.optionsStore.options.localization,t.format()):""}parseInput(t){return V.dateConversion(t,"input",this.optionsStore.options.localization)}setFromInput(t,e){if(!t)return void this.setValue(void 0,e);const s=this.parseInput(t);s&&(s.setLocalization(this.optionsStore.options.localization),this.setValue(s,e))}add(t){this._dates.push(t)}isPicked(t,e){if(!d.isValid(t))return!1;if(!e)return void 0!==this._dates.find((e=>e.isSame(t)));const s=n(e),i=t.format(s);return void 0!==this._dates.map((t=>t.format(s))).find((t=>t===i))}pickedIndex(t,e){if(!d.isValid(t))return-1;if(!e)return this._dates.map((t=>t.valueOf())).indexOf(t.valueOf());const s=n(e),i=t.format(s);return this._dates.map((t=>t.format(s))).indexOf(i)}clear(){this.optionsStore.unset=!0,this._eventEmitters.triggerEvent.emit({type:s.events.change,date:void 0,oldDate:this.lastPicked,isClear:!0,isValid:!0}),this._dates=[],this.optionsStore.input&&(this.optionsStore.input.value=""),this._eventEmitters.updateDisplay.emit("all")}static getStartEndYear(t,e){const s=t/10,i=Math.floor(e/t)*t;return[i,i+9*s,Math.floor(e/s)*s]}updateInput(t){if(!this.optionsStore.input)return;let e=this.formatInput(t);(this.optionsStore.options.multipleDates||this.optionsStore.options.dateRange)&&(e=this._dates.map((t=>this.formatInput(t))).join(this.optionsStore.options.multipleDatesSeparator)),this.optionsStore.input.value!=e&&(this.optionsStore.input.value=e)}setValue(t,e){const o=void 0===e,a=!t&&o;let n=this.optionsStore.unset?null:this._dates[e]?.clone;if(!n&&!this.optionsStore.unset&&o&&a&&(n=this.lastPicked),t&&n?.isSame(t))return void this.updateInput(t);if(!t)return void this._setValueNull(a,e,n);e=e||0,t=t.clone,1!==this.optionsStore.options.stepping&&(t.minutes=Math.round(t.minutes/this.optionsStore.options.stepping)*this.optionsStore.options.stepping,t.startOf(i.minutes));const r=i=>{this._dates[e]=t,this._eventEmitters.updateViewDate.emit(t.clone),this.updateInput(t),this.optionsStore.unset=!1,this._eventEmitters.updateDisplay.emit("all"),this._eventEmitters.triggerEvent.emit({type:s.events.change,date:t,oldDate:n,isClear:a,isValid:i})};this.validation.isValid(t)&&this.validation.dateRangeIsValid(this.picked,e,t)?r(!0):(this.optionsStore.options.keepInvalid&&r(!1),this._eventEmitters.triggerEvent.emit({type:s.events.error,reason:s.errorMessages.failedToSetInvalidDate,date:t,oldDate:n}))}_setValueNull(t,e,i){!this.optionsStore.options.multipleDates||1===this._dates.length||t?(this.optionsStore.unset=!0,this._dates=[]):this._dates.splice(e,1),this.updateInput(),this._eventEmitters.triggerEvent.emit({type:s.events.change,date:void 0,oldDate:i,isClear:t,isValid:!0}),this._eventEmitters.updateDisplay.emit("all")}}var z;!function(t){t.next="next",t.previous="previous",t.changeCalendarView="changeCalendarView",t.selectMonth="selectMonth",t.selectYear="selectYear",t.selectDecade="selectDecade",t.selectDay="selectDay",t.selectHour="selectHour",t.selectMinute="selectMinute",t.selectSecond="selectSecond",t.incrementHours="incrementHours",t.incrementMinutes="incrementMinutes",t.incrementSeconds="incrementSeconds",t.decrementHours="decrementHours",t.decrementMinutes="decrementMinutes",t.decrementSeconds="decrementSeconds",t.toggleMeridiem="toggleMeridiem",t.togglePicker="togglePicker",t.showClock="showClock",t.showHours="showHours",t.showMinutes="showMinutes",t.showSeconds="showSeconds",t.clear="clear",t.close="close",t.today="today"}(z||(z={}));var H=z;class O{constructor(){this.optionsStore=c.locate(p),this.dates=c.locate($),this.validation=c.locate(u)}getPicker(){const t=document.createElement("div");if(t.classList.add(s.css.daysContainer),t.append(...this._daysOfTheWeek()),this.optionsStore.options.display.calendarWeeks){const e=document.createElement("div");e.classList.add(s.css.calendarWeeks,s.css.noHighlight),t.appendChild(e)}const{rangeHoverEvent:e,rangeHoverOutEvent:i}=this.handleMouseEvents(t);for(let o=0;o<42;o++){if(0!==o&&o%7==0&&this.optionsStore.options.display.calendarWeeks){const e=document.createElement("div");e.classList.add(s.css.calendarWeeks,s.css.noHighlight),t.appendChild(e)}const a=document.createElement("div");a.setAttribute("data-action",H.selectDay),t.appendChild(a),matchMedia("(hover: hover)").matches&&this.optionsStore.options.dateRange&&(a.addEventListener("mouseover",e),a.addEventListener("mouseout",i))}return t}_update(t,e){const o=t.getElementsByClassName(s.css.daysContainer)[0];this._updateCalendarView(o);const a=this.optionsStore.viewDate.clone.startOf(i.month).startOf("weekDay",this.optionsStore.options.localization.startOfTheWeek).manipulate(12,i.hours);this._handleCalendarWeeks(o,a.clone),o.querySelectorAll(`[data-action="${H.selectDay}"]`).forEach((t=>{const o=[];o.push(s.css.day),a.isBefore(this.optionsStore.viewDate,i.month)&&o.push(s.css.old),a.isAfter(this.optionsStore.viewDate,i.month)&&o.push(s.css.new),this.optionsStore.unset||this.optionsStore.options.dateRange||!this.dates.isPicked(a,i.date)||o.push(s.css.active),this.validation.isValid(a,i.date)||o.push(s.css.disabled),a.isSame(new d,i.date)&&o.push(s.css.today),0!==a.weekDay&&6!==a.weekDay||o.push(s.css.weekend),this._handleDateRange(a,o),e(i.date,a,o,t),t.classList.remove(...t.classList),t.classList.add(...o),t.setAttribute("data-value",this._dateToDataValue(a)),t.setAttribute("data-day",`${a.date}`),t.innerText=a.parts(void 0,{day:"numeric"}).day,a.manipulate(1,i.date)}))}_dateToDataValue(t){return d.isValid(t)?`${t.year}-${t.monthFormatted}-${t.dateFormatted}`:""}_handleDateRange(t,e){const o=this.dates.picked[0],a=this.dates.picked[1];this.optionsStore.options.dateRange&&(t.isBetween(o,a,i.date)&&e.push(s.css.rangeIn),t.isSame(o,i.date)&&e.push(s.css.rangeStart),t.isSame(a,i.date)&&e.push(s.css.rangeEnd))}handleMouseEvents(t){return{rangeHoverEvent:e=>{const o=e?.currentTarget;if(1!==this.dates.picked.length||o.classList.contains(s.css.disabled))return;const a=[...t.querySelectorAll(".day")],n=o.getAttribute("data-value"),r=d.fromString(n,{format:"yyyy-MM-dd"}),l=a.findIndex((t=>t.getAttribute("data-value")===n)),c=this.dates.picked[0],h=this.dates.picked[1],p=this._dateToDataValue(c),u=a.findIndex((t=>t.getAttribute("data-value")===p)),m=a[u];let y;r.isSame(c,i.date)||o.classList.remove(s.css.rangeStart),r.isSame(h,i.date)||o.classList.remove(s.css.rangeEnd),r.isBefore(c)?(o.classList.add(s.css.rangeStart),m?.classList.remove(s.css.rangeStart),m?.classList.add(s.css.rangeEnd),y=(t,e)=>e>l&&eeu),a.filter(y).forEach((t=>{t.classList.add(s.css.rangeIn)}))},rangeHoverOutEvent:e=>{const o=[...t.querySelectorAll(".day")];if(1===this.dates.picked.length&&o.forEach((t=>t.classList.remove(s.css.rangeIn))),1!==this.dates.picked.length)return;const a=e?.currentTarget,n=new d(a.getAttribute("data-value"));n.isSame(this.dates.picked[0],i.date)||a.classList.remove(s.css.rangeStart),n.isSame(this.dates.picked[1],i.date)||a.classList.remove(s.css.rangeEnd)}}}_updateCalendarView(t){if("calendar"!==this.optionsStore.currentView)return;const[e,o,a]=t.parentElement.getElementsByClassName(s.css.calendarHeader)[0].getElementsByTagName("div");o.setAttribute(s.css.daysContainer,this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat)),this.optionsStore.options.display.components.month?o.classList.remove(s.css.disabled):o.classList.add(s.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,i.month),i.month)?e.classList.remove(s.css.disabled):e.classList.add(s.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,i.month),i.month)?a.classList.remove(s.css.disabled):a.classList.add(s.css.disabled)}_daysOfTheWeek(){const t=this.optionsStore.viewDate.clone.startOf("weekDay",this.optionsStore.options.localization.startOfTheWeek).startOf(i.date),e=[];if(document.createElement("div"),this.optionsStore.options.display.calendarWeeks){const t=document.createElement("div");t.classList.add(s.css.calendarWeeks,s.css.noHighlight),t.innerText="#",e.push(t)}for(let o=0;o<7;o++){const o=document.createElement("div");o.classList.add(s.css.dayOfTheWeek,s.css.noHighlight);let a=t.format({weekday:"short"});this.optionsStore.options.localization.maxWeekdayLength>0&&(a=a.substring(0,this.optionsStore.options.localization.maxWeekdayLength)),o.innerText=a,t.manipulate(1,i.date),e.push(o)}return e}_handleCalendarWeeks(t,e){[...t.querySelectorAll(`.${s.css.calendarWeeks}`)].filter((t=>"#"!==t.innerText)).forEach((t=>{t.innerText=`${e.week}`,e.manipulate(7,i.date)}))}}class x{constructor(){this.optionsStore=c.locate(p),this.dates=c.locate($),this.validation=c.locate(u)}getPicker(){const t=document.createElement("div");t.classList.add(s.css.monthsContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",H.selectMonth),t.appendChild(e)}return t}_update(t,e){const o=t.getElementsByClassName(s.css.monthsContainer)[0];if("months"===this.optionsStore.currentView){const[t,e,a]=o.parentElement.getElementsByClassName(s.css.calendarHeader)[0].getElementsByTagName("div");e.setAttribute(s.css.monthsContainer,this.optionsStore.viewDate.format({year:"numeric"})),this.optionsStore.options.display.components.year?e.classList.remove(s.css.disabled):e.classList.add(s.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,i.year),i.year)?t.classList.remove(s.css.disabled):t.classList.add(s.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,i.year),i.year)?a.classList.remove(s.css.disabled):a.classList.add(s.css.disabled)}const a=this.optionsStore.viewDate.clone.startOf(i.year);o.querySelectorAll(`[data-action="${H.selectMonth}"]`).forEach(((t,o)=>{const n=[];n.push(s.css.month),!this.optionsStore.unset&&this.dates.isPicked(a,i.month)&&n.push(s.css.active),this.validation.isValid(a,i.month)||n.push(s.css.disabled),e(i.month,a,n,t),t.classList.remove(...t.classList),t.classList.add(...n),t.setAttribute("data-value",`${o}`),t.innerText=`${a.format({month:"short"})}`,a.manipulate(1,i.month)}))}}class I{constructor(){this.optionsStore=c.locate(p),this.dates=c.locate($),this.validation=c.locate(u)}getPicker(){const t=document.createElement("div");t.classList.add(s.css.yearsContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",H.selectYear),t.appendChild(e)}return t}_update(t,e){this._startYear=this.optionsStore.viewDate.clone.manipulate(-1,i.year),this._endYear=this.optionsStore.viewDate.clone.manipulate(10,i.year);const o=t.getElementsByClassName(s.css.yearsContainer)[0];if("years"===this.optionsStore.currentView){const[t,e,a]=o.parentElement.getElementsByClassName(s.css.calendarHeader)[0].getElementsByTagName("div");e.setAttribute(s.css.yearsContainer,`${this._startYear.format({year:"numeric"})}-${this._endYear.format({year:"numeric"})}`),this.optionsStore.options.display.components.decades?e.classList.remove(s.css.disabled):e.classList.add(s.css.disabled),this.validation.isValid(this._startYear,i.year)?t.classList.remove(s.css.disabled):t.classList.add(s.css.disabled),this.validation.isValid(this._endYear,i.year)?a.classList.remove(s.css.disabled):a.classList.add(s.css.disabled)}const a=this.optionsStore.viewDate.clone.startOf(i.year).manipulate(-1,i.year);o.querySelectorAll(`[data-action="${H.selectYear}"]`).forEach((t=>{const o=[];o.push(s.css.year),!this.optionsStore.unset&&this.dates.isPicked(a,i.year)&&o.push(s.css.active),this.validation.isValid(a,i.year)||o.push(s.css.disabled),e(i.year,a,o,t),t.classList.remove(...t.classList),t.classList.add(...o),t.setAttribute("data-value",`${a.year}`),t.innerText=a.format({year:"numeric"}),a.manipulate(1,i.year)}))}}class P{constructor(){this.optionsStore=c.locate(p),this.dates=c.locate($),this.validation=c.locate(u)}getPicker(){const t=document.createElement("div");t.classList.add(s.css.decadesContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",H.selectDecade),t.appendChild(e)}return t}_update(t,e){const[o,a]=$.getStartEndYear(100,this.optionsStore.viewDate.year);this._startDecade=this.optionsStore.viewDate.clone.startOf(i.year),this._startDecade.year=o,this._endDecade=this.optionsStore.viewDate.clone.startOf(i.year),this._endDecade.year=a;const n=t.getElementsByClassName(s.css.decadesContainer)[0],[r,d,l]=n.parentElement.getElementsByClassName(s.css.calendarHeader)[0].getElementsByTagName("div");"decades"===this.optionsStore.currentView&&(d.setAttribute(s.css.decadesContainer,`${this._startDecade.format({year:"numeric"})}-${this._endDecade.format({year:"numeric"})}`),this.validation.isValid(this._startDecade,i.year)?r.classList.remove(s.css.disabled):r.classList.add(s.css.disabled),this.validation.isValid(this._endDecade,i.year)?l.classList.remove(s.css.disabled):l.classList.add(s.css.disabled));const c=this.dates.picked.map((t=>t.year));n.querySelectorAll(`[data-action="${H.selectDecade}"]`).forEach(((t,o)=>{if(0===o)return t.classList.add(s.css.old),this._startDecade.year-10<0?(t.textContent=" ",r.classList.add(s.css.disabled),t.classList.add(s.css.disabled),void t.setAttribute("data-value","")):(t.innerText=this._startDecade.clone.manipulate(-10,i.year).format({year:"numeric"}),void t.setAttribute("data-value",`${this._startDecade.year}`));const a=[];a.push(s.css.decade);const n=this._startDecade.year,d=this._startDecade.year+9;!this.optionsStore.unset&&c.filter((t=>t>=n&&t<=d)).length>0&&a.push(s.css.active),e("decade",this._startDecade,a,t),t.classList.remove(...t.classList),t.classList.add(...a),t.setAttribute("data-value",`${this._startDecade.year}`),t.innerText=`${this._startDecade.format({year:"numeric"})}`,this._startDecade.manipulate(10,i.year)}))}}class N{constructor(){this._gridColumns="",this.optionsStore=c.locate(p),this.dates=c.locate($),this.validation=c.locate(u)}getPicker(t){const e=document.createElement("div");return e.classList.add(s.css.clockContainer),e.append(...this._grid(t)),e}_update(t){const e=t.getElementsByClassName(s.css.clockContainer)[0];let o=this.dates.lastPicked?.clone;if(!o&&this.optionsStore.options.useCurrent&&(o=this.optionsStore.viewDate.clone),e.querySelectorAll(".disabled").forEach((t=>t.classList.remove(s.css.disabled))),this.optionsStore.options.display.components.hours&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,i.hours),i.hours)||e.querySelector(`[data-action=${H.incrementHours}]`).classList.add(s.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,i.hours),i.hours)||e.querySelector(`[data-action=${H.decrementHours}]`).classList.add(s.css.disabled),e.querySelector(`[data-time-component=${i.hours}]`).innerText=o?o.getHoursFormatted(this.optionsStore.options.localization.hourCycle):"--"),this.optionsStore.options.display.components.minutes&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,i.minutes),i.minutes)||e.querySelector(`[data-action=${H.incrementMinutes}]`).classList.add(s.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,i.minutes),i.minutes)||e.querySelector(`[data-action=${H.decrementMinutes}]`).classList.add(s.css.disabled),e.querySelector(`[data-time-component=${i.minutes}]`).innerText=o?o.minutesFormatted:"--"),this.optionsStore.options.display.components.seconds&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,i.seconds),i.seconds)||e.querySelector(`[data-action=${H.incrementSeconds}]`).classList.add(s.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,i.seconds),i.seconds)||e.querySelector(`[data-action=${H.decrementSeconds}]`).classList.add(s.css.disabled),e.querySelector(`[data-time-component=${i.seconds}]`).innerText=o?o.secondsFormatted:"--"),this.optionsStore.isTwelveHour){const t=e.querySelector(`[data-action=${H.toggleMeridiem}]`),a=(o||this.optionsStore.viewDate).clone;t.innerText=a.meridiem(),this.validation.isValid(a.manipulate(a.hours>=12?-12:12,i.hours))?t.classList.remove(s.css.disabled):t.classList.add(s.css.disabled)}e.style.gridTemplateAreas=`"${this._gridColumns}"`}_grid(t){this._gridColumns="";const e=[],o=[],a=[],n=document.createElement("div"),r=t(this.optionsStore.options.display.icons.up),d=t(this.optionsStore.options.display.icons.down);n.classList.add(s.css.separator,s.css.noHighlight);const l=n.cloneNode(!0);l.innerHTML=":";const c=(t=!1)=>t?l.cloneNode(!0):n.cloneNode(!0);if(this.optionsStore.options.display.components.hours){let t=document.createElement("div");t.setAttribute("title",this.optionsStore.options.localization.incrementHour),t.setAttribute("data-action",H.incrementHours),t.appendChild(r.cloneNode(!0)),e.push(t),t=document.createElement("div"),t.setAttribute("title",this.optionsStore.options.localization.pickHour),t.setAttribute("data-action",H.showHours),t.setAttribute("data-time-component",i.hours),o.push(t),t=document.createElement("div"),t.setAttribute("title",this.optionsStore.options.localization.decrementHour),t.setAttribute("data-action",H.decrementHours),t.appendChild(d.cloneNode(!0)),a.push(t),this._gridColumns+="a"}if(this.optionsStore.options.display.components.minutes){this._gridColumns+=" a",this.optionsStore.options.display.components.hours&&(e.push(c()),o.push(c(!0)),a.push(c()),this._gridColumns+=" a");let t=document.createElement("div");t.setAttribute("title",this.optionsStore.options.localization.incrementMinute),t.setAttribute("data-action",H.incrementMinutes),t.appendChild(r.cloneNode(!0)),e.push(t),t=document.createElement("div"),t.setAttribute("title",this.optionsStore.options.localization.pickMinute),t.setAttribute("data-action",H.showMinutes),t.setAttribute("data-time-component",i.minutes),o.push(t),t=document.createElement("div"),t.setAttribute("title",this.optionsStore.options.localization.decrementMinute),t.setAttribute("data-action",H.decrementMinutes),t.appendChild(d.cloneNode(!0)),a.push(t)}if(this.optionsStore.options.display.components.seconds){this._gridColumns+=" a",this.optionsStore.options.display.components.minutes&&(e.push(c()),o.push(c(!0)),a.push(c()),this._gridColumns+=" a");let t=document.createElement("div");t.setAttribute("title",this.optionsStore.options.localization.incrementSecond),t.setAttribute("data-action",H.incrementSeconds),t.appendChild(r.cloneNode(!0)),e.push(t),t=document.createElement("div"),t.setAttribute("title",this.optionsStore.options.localization.pickSecond),t.setAttribute("data-action",H.showSeconds),t.setAttribute("data-time-component",i.seconds),o.push(t),t=document.createElement("div"),t.setAttribute("title",this.optionsStore.options.localization.decrementSecond),t.setAttribute("data-action",H.decrementSeconds),t.appendChild(d.cloneNode(!0)),a.push(t)}if(this.optionsStore.isTwelveHour){this._gridColumns+=" a";let t=c();e.push(t);const i=document.createElement("button");i.setAttribute("type","button"),i.setAttribute("title",this.optionsStore.options.localization.toggleMeridiem),i.setAttribute("data-action",H.toggleMeridiem),i.setAttribute("tabindex","-1"),s.css.toggleMeridiem.includes(",")?i.classList.add(...s.css.toggleMeridiem.split(",")):i.classList.add(s.css.toggleMeridiem),t=document.createElement("div"),t.classList.add(s.css.noHighlight),t.appendChild(i),o.push(t),t=c(),a.push(t)}return this._gridColumns=this._gridColumns.trim(),[...e,...o,...a]}}class F{constructor(){this.optionsStore=c.locate(p),this.validation=c.locate(u)}getPicker(){const t=document.createElement("div");t.classList.add(s.css.hourContainer);for(let e=0;e<(this.optionsStore.isTwelveHour?12:24);e++){const e=document.createElement("div");e.setAttribute("data-action",H.selectHour),t.appendChild(e)}return t}_update(t,e){const o=t.getElementsByClassName(s.css.hourContainer)[0],a=this.optionsStore.viewDate.clone.startOf(i.date);o.querySelectorAll(`[data-action="${H.selectHour}"]`).forEach((t=>{const o=[];o.push(s.css.hour),this.validation.isValid(a,i.hours)||o.push(s.css.disabled),e(i.hours,a,o,t),t.classList.remove(...t.classList),t.classList.add(...o),t.setAttribute("data-value",`${a.hours}`),t.innerText=a.getHoursFormatted(this.optionsStore.options.localization.hourCycle),a.manipulate(1,i.hours)}))}}class B{constructor(){this.optionsStore=c.locate(p),this.validation=c.locate(u)}getPicker(){const t=document.createElement("div");t.classList.add(s.css.minuteContainer);const e=1===this.optionsStore.options.stepping?5:this.optionsStore.options.stepping;for(let s=0;s<60/e;s++){const e=document.createElement("div");e.setAttribute("data-action",H.selectMinute),t.appendChild(e)}return t}_update(t,e){const o=t.getElementsByClassName(s.css.minuteContainer)[0],a=this.optionsStore.viewDate.clone.startOf(i.hours),n=1===this.optionsStore.options.stepping?5:this.optionsStore.options.stepping;o.querySelectorAll(`[data-action="${H.selectMinute}"]`).forEach((t=>{const o=[];o.push(s.css.minute),this.validation.isValid(a,i.minutes)||o.push(s.css.disabled),e(i.minutes,a,o,t),t.classList.remove(...t.classList),t.classList.add(...o),t.setAttribute("data-value",`${a.minutes}`),t.innerText=a.minutesFormatted,a.manipulate(n,i.minutes)}))}}class W{constructor(){this.optionsStore=c.locate(p),this.validation=c.locate(u)}getPicker(){const t=document.createElement("div");t.classList.add(s.css.secondContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",H.selectSecond),t.appendChild(e)}return t}_update(t,e){const o=t.getElementsByClassName(s.css.secondContainer)[0],a=this.optionsStore.viewDate.clone.startOf(i.minutes);o.querySelectorAll(`[data-action="${H.selectSecond}"]`).forEach((t=>{const o=[];o.push(s.css.second),this.validation.isValid(a,i.seconds)||o.push(s.css.disabled),e(i.seconds,a,o,t),t.classList.remove(...t.classList),t.classList.add(...o),t.setAttribute("data-value",`${a.seconds}`),t.innerText=a.secondsFormatted,a.manipulate(5,i.seconds)}))}}class q{static toggle(t){t.classList.contains(s.css.show)?this.hide(t):this.show(t)}static showImmediately(t){t.classList.remove(s.css.collapsing),t.classList.add(s.css.collapse,s.css.show),t.style.height=""}static show(t){if(t.classList.contains(s.css.collapsing)||t.classList.contains(s.css.show))return;t.style.height="0",t.classList.remove(s.css.collapse),t.classList.add(s.css.collapsing),setTimeout((()=>{q.showImmediately(t)}),this.getTransitionDurationFromElement(t)),t.style.height=`${t.scrollHeight}px`}static hideImmediately(t){t&&(t.classList.remove(s.css.collapsing,s.css.show),t.classList.add(s.css.collapse))}static hide(t){if(t.classList.contains(s.css.collapsing)||!t.classList.contains(s.css.show))return;t.style.height=`${t.getBoundingClientRect().height}px`;t.offsetHeight,t.classList.remove(s.css.collapse,s.css.show),t.classList.add(s.css.collapsing),t.style.height="",setTimeout((()=>{q.hideImmediately(t)}),this.getTransitionDurationFromElement(t))}}q.getTransitionDurationFromElement=t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:s}=window.getComputedStyle(t);const i=Number.parseFloat(e),o=Number.parseFloat(s);return i||o?(e=e.split(",")[0],s=s.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(s))):0};class Y{constructor(){this._isVisible=!1,this._documentClickEvent=t=>{this.optionsStore.options.debug||window.debug||!this._isVisible||t.composedPath().includes(this.widget)||t.composedPath()?.includes(this.optionsStore.element)||this.hide()},this._actionsClickEvent=t=>{this._eventEmitters.action.emit({e:t})},this.optionsStore=c.locate(p),this.validation=c.locate(u),this.dates=c.locate($),this.dateDisplay=c.locate(O),this.monthDisplay=c.locate(x),this.yearDisplay=c.locate(I),this.decadeDisplay=c.locate(P),this.timeDisplay=c.locate(N),this.hourDisplay=c.locate(F),this.minuteDisplay=c.locate(B),this.secondDisplay=c.locate(W),this._eventEmitters=c.locate(y),this._widget=void 0,this._eventEmitters.updateDisplay.subscribe((t=>{this._update(t)}))}get widget(){return this._widget}get dateContainer(){return this.widget?.querySelector(`div.${s.css.dateContainer}`)}get timeContainer(){return this.widget?.querySelector(`div.${s.css.timeContainer}`)}get isVisible(){return this._isVisible}_update(t){if(this.widget)switch(t){case i.seconds:this.secondDisplay._update(this.widget,this.paint);break;case i.minutes:this.minuteDisplay._update(this.widget,this.paint);break;case i.hours:this.hourDisplay._update(this.widget,this.paint);break;case i.date:this.dateDisplay._update(this.widget,this.paint);break;case i.month:this.monthDisplay._update(this.widget,this.paint);break;case i.year:this.yearDisplay._update(this.widget,this.paint);break;case"decade":this.decadeDisplay._update(this.widget,this.paint);break;case"clock":if(!this._hasTime)break;this.timeDisplay._update(this.widget),this._update(i.hours),this._update(i.minutes),this._update(i.seconds);break;case"calendar":this._update(i.date),this._update(i.year),this._update(i.month),this.decadeDisplay._update(this.widget,this.paint),this._updateCalendarHeader();break;case"all":this._hasTime&&this._update("clock"),this._hasDate&&this._update("calendar")}}paint(t,e,s,i){}show(){if(null==this.widget){if(this._showSetDefaultIfNeeded(),this._buildWidget(),this._updateTheme(),this._showSetupViewMode(),this.optionsStore.options.display.inline)this.optionsStore.element.appendChild(this.widget);else{const t=this.optionsStore.options?.container||document.body,e=this.optionsStore.options?.display?.placement||"bottom";t.appendChild(this.widget),this.createPopup(this.optionsStore.element,this.widget,{modifiers:[{name:"eventListeners",enabled:!0}],placement:"rtl"===document.documentElement.dir?`${e}-end`:`${e}-start`}).then()}"clock"==this.optionsStore.options.display.viewMode&&this._eventEmitters.action.emit({e:null,action:H.showClock}),this.widget.querySelectorAll("[data-action]").forEach((t=>t.addEventListener("click",this._actionsClickEvent))),this._hasTime&&this.optionsStore.options.display.sideBySide&&(this.timeDisplay._update(this.widget),this.widget.getElementsByClassName(s.css.clockContainer)[0].style.display="grid")}this.widget.classList.add(s.css.show),this.optionsStore.options.display.inline||(this.updatePopup(),document.addEventListener("click",this._documentClickEvent)),this._eventEmitters.triggerEvent.emit({type:s.events.show}),this._isVisible=!0}_showSetupViewMode(){const t=this._hasTime&&!this._hasDate;t?(this.optionsStore.currentView="clock",this._eventEmitters.action.emit({e:null,action:H.showClock})):this.optionsStore.currentCalendarViewMode||(this.optionsStore.currentCalendarViewMode=this.optionsStore.minimumCalendarViewMode),t||"clock"===this.optionsStore.options.display.viewMode||(this._hasTime&&(this.optionsStore.options.display.sideBySide?q.show(this.timeContainer):q.hideImmediately(this.timeContainer)),q.show(this.dateContainer)),this._hasDate&&this._showMode()}_showSetDefaultIfNeeded(){if(0==this.dates.picked.length){if(this.optionsStore.options.useCurrent&&!this.optionsStore.options.defaultDate){const t=(new d).setLocalization(this.optionsStore.options.localization);if(!this.optionsStore.options.keepInvalid){let e=0,s=1;for(this.optionsStore.options.restrictions.maxDate?.isBefore(t)&&(s=-1);!this.validation.isValid(t)&&e>31;)t.manipulate(s,i.date),e++}this.dates.setValue(t)}this.optionsStore.options.defaultDate&&this.dates.setValue(this.optionsStore.options.defaultDate)}}async createPopup(t,e,s){let i;if(window?.Popper)i=window?.Popper?.createPopper;else{const{createPopper:t}=await import("@popperjs/core");i=t}i&&(this._popperInstance=i(t,e,s))}updatePopup(){this._popperInstance?.update()}_showMode(t){if(!this.widget)return;if(t){const e=Math.max(this.optionsStore.minimumCalendarViewMode,Math.min(3,this.optionsStore.currentCalendarViewMode+t));if(this.optionsStore.currentCalendarViewMode==e)return;this.optionsStore.currentCalendarViewMode=e}this.widget.querySelectorAll(`.${s.css.dateContainer} > div:not(.${s.css.calendarHeader}), .${s.css.timeContainer} > div:not(.${s.css.clockContainer})`).forEach((t=>t.style.display="none"));const e=h[this.optionsStore.currentCalendarViewMode],i=this.widget.querySelector(`.${e.className}`);switch(e.className){case s.css.decadesContainer:this.decadeDisplay._update(this.widget,this.paint);break;case s.css.yearsContainer:this.yearDisplay._update(this.widget,this.paint);break;case s.css.monthsContainer:this.monthDisplay._update(this.widget,this.paint);break;case s.css.daysContainer:this.dateDisplay._update(this.widget,this.paint)}i.style.display="grid",this.optionsStore.options.display.sideBySide&&(this.widget.querySelectorAll(`.${s.css.clockContainer}`)[0].style.display="grid"),this._updateCalendarHeader(),this._eventEmitters.viewUpdate.emit()}_updateTheme(t){if(this.widget){if(t){if(this.optionsStore.options.display.theme===t)return;this.optionsStore.options.display.theme=t}this.widget.classList.remove("light","dark"),this.widget.classList.add(this._getThemeClass()),"auto"===this.optionsStore.options.display.theme?window.matchMedia(s.css.isDarkPreferredQuery).addEventListener("change",(()=>this._updateTheme())):window.matchMedia(s.css.isDarkPreferredQuery).removeEventListener("change",(()=>this._updateTheme()))}}_getThemeClass(){const t=this.optionsStore.options.display.theme||"auto",e=window.matchMedia&&window.matchMedia(s.css.isDarkPreferredQuery).matches;switch(t){case"light":return s.css.lightTheme;case"dark":return s.css.darkTheme;case"auto":return e?s.css.darkTheme:s.css.lightTheme}}_updateCalendarHeader(){if(!this._hasDate)return;const t=[...this.widget.querySelector(`.${s.css.dateContainer} div[style*="display: grid"]`).classList].find((t=>t.startsWith(s.css.dateContainer))),[e,i,o]=this.widget.getElementsByClassName(s.css.calendarHeader)[0].getElementsByTagName("div");switch(t){case s.css.decadesContainer:e.setAttribute("title",this.optionsStore.options.localization.previousCentury),i.setAttribute("title",""),o.setAttribute("title",this.optionsStore.options.localization.nextCentury);break;case s.css.yearsContainer:e.setAttribute("title",this.optionsStore.options.localization.previousDecade),i.setAttribute("title",this.optionsStore.options.localization.selectDecade),o.setAttribute("title",this.optionsStore.options.localization.nextDecade);break;case s.css.monthsContainer:e.setAttribute("title",this.optionsStore.options.localization.previousYear),i.setAttribute("title",this.optionsStore.options.localization.selectYear),o.setAttribute("title",this.optionsStore.options.localization.nextYear);break;case s.css.daysContainer:e.setAttribute("title",this.optionsStore.options.localization.previousMonth),i.setAttribute("title",this.optionsStore.options.localization.selectMonth),o.setAttribute("title",this.optionsStore.options.localization.nextMonth),i.setAttribute(t,this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat))}i.innerText=i.getAttribute(t)}hide(){this.widget&&this._isVisible&&(this.widget.classList.remove(s.css.show),this._isVisible&&(this._eventEmitters.triggerEvent.emit({type:s.events.hide,date:this.optionsStore.unset?null:this.dates.lastPicked?.clone}),this._isVisible=!1),document.removeEventListener("click",this._documentClickEvent))}toggle(){return this._isVisible?this.hide():this.show()}_dispose(){document.removeEventListener("click",this._documentClickEvent),this.widget&&(this.widget.querySelectorAll("[data-action]").forEach((t=>t.removeEventListener("click",this._actionsClickEvent))),this.widget.parentNode.removeChild(this.widget),this._widget=void 0)}_buildWidget(){const t=document.createElement("div");t.classList.add(s.css.widget);const e=document.createElement("div");e.classList.add(s.css.dateContainer),e.append(this.getHeadTemplate(),this.decadeDisplay.getPicker(),this.yearDisplay.getPicker(),this.monthDisplay.getPicker(),this.dateDisplay.getPicker());const i=document.createElement("div");i.classList.add(s.css.timeContainer),i.appendChild(this.timeDisplay.getPicker(this._iconTag.bind(this))),i.appendChild(this.hourDisplay.getPicker()),i.appendChild(this.minuteDisplay.getPicker()),i.appendChild(this.secondDisplay.getPicker());const o=document.createElement("div");if(o.classList.add(s.css.toolbar),o.append(...this.getToolbarElements()),this.optionsStore.options.display.inline&&t.classList.add(s.css.inline),this.optionsStore.options.display.calendarWeeks&&t.classList.add("calendarWeeks"),this.optionsStore.options.display.sideBySide&&this._hasDateAndTime)return void this._buildWidgetSideBySide(t,e,i,o);"top"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(o);const a=(e,i,o,a)=>{e&&(i&&(o.classList.add(s.css.collapse),a&&o.classList.add(s.css.show)),t.appendChild(o))};a(this._hasDate,this._hasTime,e,"clock"!==this.optionsStore.options.display.viewMode),a(this._hasTime,this._hasDate,i,"clock"===this.optionsStore.options.display.viewMode),"bottom"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(o);const n=document.createElement("div");n.classList.add("arrow"),n.setAttribute("data-popper-arrow",""),t.appendChild(n),this._widget=t}_buildWidgetSideBySide(t,e,i,o){t.classList.add(s.css.sideBySide),"top"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(o);const a=document.createElement("div");a.classList.add("td-row"),e.classList.add("td-half"),i.classList.add("td-half"),a.appendChild(e),a.appendChild(i),t.appendChild(a),"bottom"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(o),this._widget=t}get _hasTime(){return this.optionsStore.options.display.components.clock&&(this.optionsStore.options.display.components.hours||this.optionsStore.options.display.components.minutes||this.optionsStore.options.display.components.seconds)}get _hasDate(){return this.optionsStore.options.display.components.calendar&&(this.optionsStore.options.display.components.year||this.optionsStore.options.display.components.month||this.optionsStore.options.display.components.date)}get _hasDateAndTime(){return this._hasDate&&this._hasTime}getToolbarElements(){const t=[];if(this.optionsStore.options.display.buttons.today){const e=document.createElement("div");e.setAttribute("data-action",H.today),e.setAttribute("title",this.optionsStore.options.localization.today),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.today)),t.push(e)}if(!this.optionsStore.options.display.sideBySide&&this._hasDate&&this._hasTime){let e,s;"clock"===this.optionsStore.options.display.viewMode?(e=this.optionsStore.options.localization.selectDate,s=this.optionsStore.options.display.icons.date):(e=this.optionsStore.options.localization.selectTime,s=this.optionsStore.options.display.icons.time);const i=document.createElement("div");i.setAttribute("data-action",H.togglePicker),i.setAttribute("title",e),i.appendChild(this._iconTag(s)),t.push(i)}if(this.optionsStore.options.display.buttons.clear){const e=document.createElement("div");e.setAttribute("data-action",H.clear),e.setAttribute("title",this.optionsStore.options.localization.clear),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.clear)),t.push(e)}if(this.optionsStore.options.display.buttons.close){const e=document.createElement("div");e.setAttribute("data-action",H.close),e.setAttribute("title",this.optionsStore.options.localization.close),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.close)),t.push(e)}return t}getHeadTemplate(){const t=document.createElement("div");t.classList.add(s.css.calendarHeader);const e=document.createElement("div");e.classList.add(s.css.previous),e.setAttribute("data-action",H.previous),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.previous));const i=document.createElement("div");i.classList.add(s.css.switch),i.setAttribute("data-action",H.changeCalendarView);const o=document.createElement("div");return o.classList.add(s.css.next),o.setAttribute("data-action",H.next),o.appendChild(this._iconTag(this.optionsStore.options.display.icons.next)),t.append(e,i,o),t}_iconTag(t){if("sprites"===this.optionsStore.options.display.icons.type){const e=document.createElementNS("http://www.w3.org/2000/svg","svg"),s=document.createElementNS("http://www.w3.org/2000/svg","use");return s.setAttribute("xlink:href",t),s.setAttribute("href",t),e.appendChild(s),e}const e=document.createElement("i");return e.classList.add(...t.split(" ")),e}_rebuild(){const t=this._isVisible;this._dispose(),t&&this.show()}refreshCurrentView(){switch(this._isVisible||this._dispose(),this.optionsStore.currentView){case"clock":this._update("clock");break;case"calendar":this._update(i.date);break;case"months":this._update(i.month);break;case"years":this._update(i.year);break;case"decades":this._update("decade")}}}class j{constructor(){this.optionsStore=c.locate(p),this.dates=c.locate($),this.validation=c.locate(u),this.display=c.locate(Y),this._eventEmitters=c.locate(y),this._eventEmitters.action.subscribe((t=>{this.do(t.e,t.action)}))}do(t,e){const o=t?.currentTarget;if(o?.classList?.contains(s.css.disabled))return;e=e||o?.dataset?.action;const a=(this.dates.lastPicked||this.optionsStore.viewDate).clone;switch(e){case H.next:case H.previous:this.handleNextPrevious(e);break;case H.changeCalendarView:this.display._showMode(1),this.display._updateCalendarHeader();break;case H.selectMonth:case H.selectYear:case H.selectDecade:this.handleSelectCalendarMode(e,o);break;case H.selectDay:this.handleSelectDay(o);break;case H.selectHour:{let e=+o.dataset.value;a.hours>=12&&this.optionsStore.isTwelveHour&&(e+=12),a.hours=e,this.dates.setValue(a,this.dates.lastPickedIndex),this.hideOrClock(t);break}case H.selectMinute:a.minutes=+o.dataset.value,this.dates.setValue(a,this.dates.lastPickedIndex),this.hideOrClock(t);break;case H.selectSecond:a.seconds=+o.dataset.value,this.dates.setValue(a,this.dates.lastPickedIndex),this.hideOrClock(t);break;case H.incrementHours:this.manipulateAndSet(a,i.hours);break;case H.incrementMinutes:this.manipulateAndSet(a,i.minutes,this.optionsStore.options.stepping);break;case H.incrementSeconds:this.manipulateAndSet(a,i.seconds);break;case H.decrementHours:this.manipulateAndSet(a,i.hours,-1);break;case H.decrementMinutes:this.manipulateAndSet(a,i.minutes,-1*this.optionsStore.options.stepping);break;case H.decrementSeconds:this.manipulateAndSet(a,i.seconds,-1);break;case H.toggleMeridiem:this.manipulateAndSet(a,i.hours,this.dates.lastPicked.hours>=12?-12:12);break;case H.togglePicker:this.handleToggle(o);break;case H.showClock:case H.showHours:case H.showMinutes:case H.showSeconds:this.optionsStore.options.display.sideBySide||"clock"===this.optionsStore.currentView||(q.hideImmediately(this.display.dateContainer),q.showImmediately(this.display.timeContainer)),this.handleShowClockContainers(e);break;case H.clear:this.dates.setValue(null),this.display._updateCalendarHeader();break;case H.close:this.display.hide();break;case H.today:{const t=(new d).setLocalization(this.optionsStore.options.localization);this._eventEmitters.updateViewDate.emit(t),this.validation.isValid(t,i.date)&&this.dates.setValue(t,this.dates.lastPickedIndex);break}}}handleShowClockContainers(t){if(!this.display._hasTime)return void s.errorMessages.throwError("Cannot show clock containers when time is disabled.");this.optionsStore.currentView="clock",this.display.widget.querySelectorAll(`.${s.css.timeContainer} > div`).forEach((t=>t.style.display="none"));let e="";switch(t){case H.showClock:e=s.css.clockContainer,this.display._update("clock");break;case H.showHours:e=s.css.hourContainer,this.display._update(i.hours);break;case H.showMinutes:e=s.css.minuteContainer,this.display._update(i.minutes);break;case H.showSeconds:e=s.css.secondContainer,this.display._update(i.seconds)}this.display.widget.getElementsByClassName(e)[0].style.display="grid"}handleNextPrevious(t){const{unit:e,step:s}=h[this.optionsStore.currentCalendarViewMode];t===H.next?this.optionsStore.viewDate.manipulate(s,e):this.optionsStore.viewDate.manipulate(-1*s,e),this._eventEmitters.viewUpdate.emit(),this.display._showMode()}hideOrClock(t){this.optionsStore.isTwelveHour||this.optionsStore.options.display.components.minutes||this.optionsStore.options.display.keepOpen||this.optionsStore.options.display.inline?this.do(t,H.showClock):this.display.hide()}manipulateAndSet(t,e,s=1){const i=t.manipulate(s,e);this.validation.isValid(i,e)&&this.dates.setValue(i,this.dates.lastPickedIndex)}handleSelectCalendarMode(t,e){const s=+e.dataset.value;switch(t){case H.selectMonth:this.optionsStore.viewDate.month=s;break;case H.selectYear:case H.selectDecade:this.optionsStore.viewDate.year=s}this.optionsStore.currentCalendarViewMode===this.optionsStore.minimumCalendarViewMode?(this.dates.setValue(this.optionsStore.viewDate,this.dates.lastPickedIndex),this.optionsStore.options.display.inline||this.display.hide()):this.display._showMode(-1)}handleToggle(t){t.getAttribute("title")===this.optionsStore.options.localization.selectDate?(t.setAttribute("title",this.optionsStore.options.localization.selectTime),t.innerHTML=this.display._iconTag(this.optionsStore.options.display.icons.time).outerHTML,this.display._updateCalendarHeader(),this.optionsStore.refreshCurrentView()):(t.setAttribute("title",this.optionsStore.options.localization.selectDate),t.innerHTML=this.display._iconTag(this.optionsStore.options.display.icons.date).outerHTML,this.display._hasTime&&(this.handleShowClockContainers(H.showClock),this.display._update("clock"))),this.display.widget.querySelectorAll(`.${s.css.dateContainer}, .${s.css.timeContainer}`).forEach((t=>q.toggle(t))),this._eventEmitters.viewUpdate.emit()}handleSelectDay(t){const e=this.optionsStore.viewDate.clone;t.classList.contains(s.css.old)&&e.manipulate(-1,i.month),t.classList.contains(s.css.new)&&e.manipulate(1,i.month),e.date=+t.dataset.day,this.optionsStore.options.dateRange?this.handleDateRange(e):this.optionsStore.options.multipleDates?this.handleMultiDate(e):this.dates.setValue(e,this.dates.lastPickedIndex),this.display._hasTime||this.optionsStore.options.display.keepOpen||this.optionsStore.options.display.inline||this.optionsStore.options.multipleDates||this.optionsStore.options.dateRange||this.display.hide()}handleMultiDate(t){let e=this.dates.pickedIndex(t,i.date);console.log(e),-1!==e?this.dates.setValue(null,e):(e=this.dates.lastPickedIndex+1,0===this.dates.picked.length&&(e=0),this.dates.setValue(t,e))}handleDateRange(t){switch(this.dates.picked.length){case 2:this.dates.clear();break;case 1:{const e=this.dates.picked[0];if(t.getTime()===e.getTime()){this.dates.clear();break}return t.isBefore(e)?(this.dates.setValue(t,0),void this.dates.setValue(e,1)):void this.dates.setValue(t,1)}}this.dates.setValue(t,0)}}class U{constructor(t,e={}){this._subscribers={},this._isDisabled=!1,this._inputChangeEvent=t=>{const e=t?.detail;if(e)return;const s=()=>{this.dates.lastPicked&&(this.optionsStore.viewDate=this.dates.lastPicked.clone)},i=this.optionsStore.input.value;if(this.optionsStore.options.multipleDates||this.optionsStore.options.dateRange)try{const t=i.split(this.optionsStore.options.multipleDatesSeparator);for(let e=0;e{this.optionsStore.element?.disabled||this.optionsStore.input?.disabled||"INPUT"===this._toggle.nodeName&&"text"===this._toggle?.type&&this.optionsStore.options.allowInputToggle||this.toggle()},this._openClickEvent=()=>{this.optionsStore.element?.disabled||this.optionsStore.input?.disabled||this.display.isVisible||this.show()},c=new l,this._eventEmitters=c.locate(y),this.optionsStore=c.locate(p),this.display=c.locate(Y),this.dates=c.locate($),this.actions=c.locate(j),t||s.errorMessages.mustProvideElement(),this.optionsStore.element=t,this._initializeOptions(e,v,!0),this.optionsStore.viewDate.setLocalization(this.optionsStore.options.localization),this.optionsStore.unset=!0,this._initializeInput(),this._initializeToggle(),this.optionsStore.options.display.inline&&this.display.show(),this._eventEmitters.triggerEvent.subscribe((t=>{this._triggerEvent(t)})),this._eventEmitters.viewUpdate.subscribe((()=>{this._viewUpdate()})),this._eventEmitters.updateViewDate.subscribe((t=>{this.viewDate=t}))}get viewDate(){return this.optionsStore.viewDate}set viewDate(t){this.optionsStore.viewDate=t,this.optionsStore.viewDate.setLocalization(this.optionsStore.options.localization),this.display._update("clock"===this.optionsStore.currentView?"clock":"calendar")}updateOptions(t,e=!1){e?this._initializeOptions(t,v):this._initializeOptions(t,this.optionsStore.options),this.optionsStore.viewDate.setLocalization(this.optionsStore.options.localization),this.display.refreshCurrentView()}toggle(){this._isDisabled||this.display.toggle()}show(){this._isDisabled||this.display.show()}hide(){this.display.hide()}disable(){this._isDisabled=!0,this.optionsStore.input?.setAttribute("disabled","disabled"),this.display.hide()}enable(){this._isDisabled=!1,this.optionsStore.input?.removeAttribute("disabled")}clear(){this.optionsStore.input.value="",this.dates.clear()}subscribe(t,e){let i;"string"==typeof t&&(t=[t]),i=Array.isArray(e)?e:[e],t.length!==i.length&&s.errorMessages.subscribeMismatch();const o=[];for(let e=0;e{e(t)}))}_viewUpdate(){this._triggerEvent({type:s.events.update,viewDate:this.optionsStore.viewDate.clone})}_unsubscribe(t,e){this._subscribers[t].splice(e,1)}_initializeOptions(t,e,s=!1){let i=V.deepCopy(t);i=V._mergeOptions(i,e),s&&(i=V._dataToOptions(this.optionsStore.element,i)),V._validateConflicts(i),i.viewDate=i.viewDate.setLocalization(i.localization),this.optionsStore.viewDate.isSame(i.viewDate)||(this.optionsStore.viewDate=i.viewDate),i.display.components.year&&(this.optionsStore.minimumCalendarViewMode=2),i.display.components.month&&(this.optionsStore.minimumCalendarViewMode=1),i.display.components.date&&(this.optionsStore.minimumCalendarViewMode=0),this.optionsStore.currentCalendarViewMode=Math.max(this.optionsStore.minimumCalendarViewMode,this.optionsStore.currentCalendarViewMode),h[this.optionsStore.currentCalendarViewMode].name!==i.display.viewMode&&(this.optionsStore.currentCalendarViewMode=Math.max(h.findIndex((t=>t.name===i.display.viewMode)),this.optionsStore.minimumCalendarViewMode)),this.display?.isVisible&&this.display._update("all"),i.display.components.useTwentyfourHour&&void 0===i.localization.hourCycle?i.localization.hourCycle="h24":void 0===i.localization.hourCycle&&(i.localization.hourCycle=r(i.localization.locale)),this.optionsStore.options=i,i.restrictions.maxDate&&this.viewDate.isAfter(i.restrictions.maxDate)&&(this.viewDate=i.restrictions.maxDate),i.restrictions.minDate&&this.viewDate.isBefore(i.restrictions.minDate)&&(this.viewDate=i.restrictions.minDate)}_initializeInput(){if("INPUT"==this.optionsStore.element.tagName)this.optionsStore.input=this.optionsStore.element;else{const t=this.optionsStore.element.dataset.tdTargetInput;this.optionsStore.input=null==t||"nearest"==t?this.optionsStore.element.querySelector("input"):this.optionsStore.element.querySelector(t)}this.optionsStore.input&&(!this.optionsStore.input.value&&this.optionsStore.options.defaultDate&&(this.optionsStore.input.value=this.dates.formatInput(this.optionsStore.options.defaultDate)),this.optionsStore.input.addEventListener("change",this._inputChangeEvent),this.optionsStore.options.allowInputToggle&&(this.optionsStore.input.addEventListener("click",this._openClickEvent),this.optionsStore.input.addEventListener("focus",this._openClickEvent)),this.optionsStore.input.value&&this._inputChangeEvent())}_initializeToggle(){if(this.optionsStore.options.display.inline)return;let t=this.optionsStore.element.dataset.tdTargetToggle;"nearest"==t&&(t='[data-td-toggle="datetimepicker"]'),this._toggle=null==t?this.optionsStore.element:this.optionsStore.element.querySelector(t),this._toggle.addEventListener("click",this._toggleClickEvent)}_handleAfterChangeEvent(t){!this.optionsStore.options.promptTimeOnDateChange||this.optionsStore.options.multipleDates||this.optionsStore.options.display.inline||this.optionsStore.options.display.sideBySide||!this.display._hasTime||this.display.widget?.getElementsByClassName(s.css.show)[0].classList.contains(s.css.timeContainer)||!t.oldDate&&this.optionsStore.options.useCurrent||t.oldDate&&t.date?.isSame(t.oldDate)||(clearTimeout(this._currentPromptTimeTimeout),this._currentPromptTimeTimeout=setTimeout((()=>{this.display.widget&&this._eventEmitters.action.emit({e:{currentTarget:this.display.widget.querySelector('[data-action="togglePicker"]')},action:H.togglePicker})}),this.optionsStore.options.promptTimeOnDateChangeTransitionDelay))}}const R={},Q=t=>{R[t.name]||(R[t.name]=t.localization)},J=t=>{const e=R[t];e&&(v.localization=e)},K=function(t,e=undefined){return t?(t.installed||(t(e,{TempusDominus:U,Dates:$,Display:Y,DateTime:d,Namespace:s},G),t.installed=!0),G):G},Z="6.7.19",G={TempusDominus:U,extend:K,loadLocale:Q,locale:J,Namespace:s,DefaultOptions:v,DateTime:d,Unit:i,version:Z,DefaultEnLocalization:S};export{d as DateTime,S as DefaultEnLocalization,v as DefaultOptions,s as Namespace,U as TempusDominus,i as Unit,K as extend,Q as loadLocale,J as locale,Z as version}; diff --git a/node_modules/@eonasdan/tempus-dominus/dist/js/tempus-dominus.js b/node_modules/@eonasdan/tempus-dominus/dist/js/tempus-dominus.js deleted file mode 100644 index cb9d513..0000000 --- a/node_modules/@eonasdan/tempus-dominus/dist/js/tempus-dominus.js +++ /dev/null @@ -1,4691 +0,0 @@ -/*! - * Tempus Dominus v6.7.19 (https://getdatepicker.com/) - * Copyright 2013-2023 Jonathan Peterson - * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) - */ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : - typeof define === 'function' && define.amd ? define(['exports'], factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.tempusDominus = {})); -})(this, (function (exports) { 'use strict'; - - class TdError extends Error { - } - class ErrorMessages { - constructor() { - this.base = 'TD:'; - //#endregion - //#region used with notify.error - /** - * Used with an Error Event type if the user selects a date that - * fails restriction validation. - */ - this.failedToSetInvalidDate = 'Failed to set invalid date'; - /** - * Used with an Error Event type when a user changes the value of the - * input field directly, and does not provide a valid date. - */ - this.failedToParseInput = 'Failed parse input field'; - //#endregion - } - //#region out to console - /** - * Throws an error indicating that a key in the options object is invalid. - * @param optionName - */ - unexpectedOption(optionName) { - const error = new TdError(`${this.base} Unexpected option: ${optionName} does not match a known option.`); - error.code = 1; - throw error; - } - /** - * Throws an error indicating that one more keys in the options object is invalid. - * @param optionName - */ - unexpectedOptions(optionName) { - const error = new TdError(`${this.base}: ${optionName.join(', ')}`); - error.code = 1; - throw error; - } - /** - * Throws an error when an option is provide an unsupported value. - * For example a value of 'cheese' for toolbarPlacement which only supports - * 'top', 'bottom', 'default'. - * @param optionName - * @param badValue - * @param validOptions - */ - unexpectedOptionValue(optionName, badValue, validOptions) { - const error = new TdError(`${this.base} Unexpected option value: ${optionName} does not accept a value of "${badValue}". Valid values are: ${validOptions.join(', ')}`); - error.code = 2; - throw error; - } - /** - * Throws an error when an option value is the wrong type. - * For example a string value was provided to multipleDates which only - * supports true or false. - * @param optionName - * @param badType - * @param expectedType - */ - typeMismatch(optionName, badType, expectedType) { - const error = new TdError(`${this.base} Mismatch types: ${optionName} has a type of ${badType} instead of the required ${expectedType}`); - error.code = 3; - throw error; - } - /** - * Throws an error when an option value is outside of the expected range. - * For example restrictions.daysOfWeekDisabled excepts a value between 0 and 6. - * @param optionName - * @param lower - * @param upper - */ - numbersOutOfRange(optionName, lower, upper) { - const error = new TdError(`${this.base} ${optionName} expected an array of number between ${lower} and ${upper}.`); - error.code = 4; - throw error; - } - /** - * Throws an error when a value for a date options couldn't be parsed. Either - * the option was an invalid string or an invalid Date object. - * @param optionName - * @param date - * @param soft If true, logs a warning instead of an error. - */ - //eslint-disable-next-line @typescript-eslint/no-explicit-any - failedToParseDate(optionName, date, soft = false) { - const error = new TdError(`${this.base} Could not correctly parse "${date}" to a date for ${optionName}.`); - error.code = 5; - if (!soft) - throw error; - console.warn(error); - } - /** - * Throws when an element to attach to was not provided in the constructor. - */ - mustProvideElement() { - const error = new TdError(`${this.base} No element was provided.`); - error.code = 6; - throw error; - } - /** - * Throws if providing an array for the events to subscribe method doesn't have - * the same number of callbacks. E.g., subscribe([1,2], [1]) - */ - subscribeMismatch() { - const error = new TdError(`${this.base} The subscribed events does not match the number of callbacks`); - error.code = 7; - throw error; - } - /** - * Throws if the configuration has conflicting rules e.g. minDate is after maxDate - */ - conflictingConfiguration(message) { - const error = new TdError(`${this.base} A configuration value conflicts with another rule. ${message}`); - error.code = 8; - throw error; - } - /** - * customDateFormat errors - */ - customDateFormatError(message) { - const error = new TdError(`${this.base} Custom Date Format: ${message}`); - error.code = 9; - throw error; - } - /** - * Logs a warning if a date option value is provided as a string, instead of - * a date/datetime object. - */ - dateString() { - console.warn(`${this.base} Using a string for date options is not recommended unless you specify an ISO string or use the customDateFormat plugin.`); - } - deprecatedWarning(message, remediation) { - console.warn(`${this.base} Warning ${message} is deprecated and will be removed in a future version. ${remediation}`); - } - throwError(message) { - const error = new TdError(`${this.base} ${message}`); - error.code = 9; - throw error; - } - } - - // this is not the way I want this to stay but nested classes seemed to blown up once its compiled. - const NAME = 'tempus-dominus', dataKey = 'td'; - /** - * Events - */ - class Events { - constructor() { - this.key = `.${dataKey}`; - /** - * Change event. Fired when the user selects a date. - * See also EventTypes.ChangeEvent - */ - this.change = `change${this.key}`; - /** - * Emit when the view changes for example from month view to the year view. - * See also EventTypes.ViewUpdateEvent - */ - this.update = `update${this.key}`; - /** - * Emits when a selected date or value from the input field fails to meet the provided validation rules. - * See also EventTypes.FailEvent - */ - this.error = `error${this.key}`; - /** - * Show event - * @event Events#show - */ - this.show = `show${this.key}`; - /** - * Hide event - * @event Events#hide - */ - this.hide = `hide${this.key}`; - // blur and focus are used in the jQuery provider but are otherwise unused. - // keyup/down will be used later for keybinding options - this.blur = `blur${this.key}`; - this.focus = `focus${this.key}`; - this.keyup = `keyup${this.key}`; - this.keydown = `keydown${this.key}`; - } - } - class Css { - constructor() { - /** - * The outer element for the widget. - */ - this.widget = `${NAME}-widget`; - /** - * Hold the previous, next and switcher divs - */ - this.calendarHeader = 'calendar-header'; - /** - * The element for the action to change the calendar view. E.g. month -> year. - */ - this.switch = 'picker-switch'; - /** - * The elements for all the toolbar options - */ - this.toolbar = 'toolbar'; - /** - * Disables the hover and rounding affect. - */ - this.noHighlight = 'no-highlight'; - /** - * Applied to the widget element when the side by side option is in use. - */ - this.sideBySide = 'timepicker-sbs'; - /** - * The element for the action to change the calendar view, e.g. August -> July - */ - this.previous = 'previous'; - /** - * The element for the action to change the calendar view, e.g. August -> September - */ - this.next = 'next'; - /** - * Applied to any action that would violate any restriction options. ALso applied - * to an input field if the disabled function is called. - */ - this.disabled = 'disabled'; - /** - * Applied to any date that is less than requested view, - * e.g. the last day of the previous month. - */ - this.old = 'old'; - /** - * Applied to any date that is greater than of requested view, - * e.g. the last day of the previous month. - */ - this.new = 'new'; - /** - * Applied to any date that is currently selected. - */ - this.active = 'active'; - //#region date element - /** - * The outer element for the calendar view. - */ - this.dateContainer = 'date-container'; - /** - * The outer element for the decades view. - */ - this.decadesContainer = `${this.dateContainer}-decades`; - /** - * Applied to elements within the decade container, e.g. 2020, 2030 - */ - this.decade = 'decade'; - /** - * The outer element for the years view. - */ - this.yearsContainer = `${this.dateContainer}-years`; - /** - * Applied to elements within the years container, e.g. 2021, 2021 - */ - this.year = 'year'; - /** - * The outer element for the month view. - */ - this.monthsContainer = `${this.dateContainer}-months`; - /** - * Applied to elements within the month container, e.g. January, February - */ - this.month = 'month'; - /** - * The outer element for the calendar view. - */ - this.daysContainer = `${this.dateContainer}-days`; - /** - * Applied to elements within the day container, e.g. 1, 2..31 - */ - this.day = 'day'; - /** - * If display.calendarWeeks is enabled, a column displaying the week of year - * is shown. This class is applied to each cell in that column. - */ - this.calendarWeeks = 'cw'; - /** - * Applied to the first row of the calendar view, e.g. Sunday, Monday - */ - this.dayOfTheWeek = 'dow'; - /** - * Applied to the current date on the calendar view. - */ - this.today = 'today'; - /** - * Applied to the locale's weekend dates on the calendar view, e.g. Sunday, Saturday - */ - this.weekend = 'weekend'; - this.rangeIn = 'range-in'; - this.rangeStart = 'range-start'; - this.rangeEnd = 'range-end'; - //#endregion - //#region time element - /** - * The outer element for all time related elements. - */ - this.timeContainer = 'time-container'; - /** - * Applied the separator columns between time elements, e.g. hour *:* minute *:* second - */ - this.separator = 'separator'; - /** - * The outer element for the clock view. - */ - this.clockContainer = `${this.timeContainer}-clock`; - /** - * The outer element for the hours selection view. - */ - this.hourContainer = `${this.timeContainer}-hour`; - /** - * The outer element for the minutes selection view. - */ - this.minuteContainer = `${this.timeContainer}-minute`; - /** - * The outer element for the seconds selection view. - */ - this.secondContainer = `${this.timeContainer}-second`; - /** - * Applied to each element in the hours selection view. - */ - this.hour = 'hour'; - /** - * Applied to each element in the minutes selection view. - */ - this.minute = 'minute'; - /** - * Applied to each element in the seconds selection view. - */ - this.second = 'second'; - /** - * Applied AM/PM toggle button. - */ - this.toggleMeridiem = 'toggleMeridiem'; - //#endregion - //#region collapse - /** - * Applied the element of the current view mode, e.g. calendar or clock. - */ - this.show = 'show'; - /** - * Applied to the currently showing view mode during a transition - * between calendar and clock views - */ - this.collapsing = 'td-collapsing'; - /** - * Applied to the currently hidden view mode. - */ - this.collapse = 'td-collapse'; - //#endregion - /** - * Applied to the widget when the option display.inline is enabled. - */ - this.inline = 'inline'; - /** - * Applied to the widget when the option display.theme is light. - */ - this.lightTheme = 'light'; - /** - * Applied to the widget when the option display.theme is dark. - */ - this.darkTheme = 'dark'; - /** - * Used for detecting if the system color preference is dark mode - */ - this.isDarkPreferredQuery = '(prefers-color-scheme: dark)'; - } - } - class Namespace { - } - Namespace.NAME = NAME; - // noinspection JSUnusedGlobalSymbols - Namespace.dataKey = dataKey; - Namespace.events = new Events(); - Namespace.css = new Css(); - Namespace.errorMessages = new ErrorMessages(); - - const DefaultFormatLocalization = { - dateFormats: { - LTS: 'h:mm:ss T', - LT: 'h:mm T', - L: 'MM/dd/yyyy', - LL: 'MMMM d, yyyy', - LLL: 'MMMM d, yyyy h:mm T', - LLLL: 'dddd, MMMM d, yyyy h:mm T', - }, - format: 'L LT', - locale: 'default', - hourCycle: undefined, - ordinal: (n) => { - const s = ['th', 'st', 'nd', 'rd']; - const v = n % 100; - return `[${n}${s[(v - 20) % 10] || s[v] || s[0]}]`; - }, - }; - var DefaultFormatLocalization$1 = { ...DefaultFormatLocalization }; - - exports.Unit = void 0; - (function (Unit) { - Unit["seconds"] = "seconds"; - Unit["minutes"] = "minutes"; - Unit["hours"] = "hours"; - Unit["date"] = "date"; - Unit["month"] = "month"; - Unit["year"] = "year"; - })(exports.Unit || (exports.Unit = {})); - const twoDigitTemplate = { - month: '2-digit', - day: '2-digit', - year: 'numeric', - hour: '2-digit', - minute: '2-digit', - second: '2-digit', - }; - /** - * Returns an Intl format object based on the provided object - * @param unit - */ - const getFormatByUnit = (unit) => { - switch (unit) { - case 'date': - return { dateStyle: 'short' }; - case 'month': - return { - month: 'numeric', - year: 'numeric', - }; - case 'year': - return { year: 'numeric' }; - } - }; - /** - * Attempts to guess the hour cycle of the given local - * @param locale - */ - const guessHourCycle = (locale) => { - if (!locale) - return 'h12'; - // noinspection SpellCheckingInspection - const template = { - hour: '2-digit', - minute: '2-digit', - numberingSystem: 'latn', - }; - const dt = new DateTime().setLocalization({ locale }); - dt.hours = 0; - const start = dt.parts(undefined, template).hour; - //midnight is 12 so en-US style 12 AM - if (start === '12') - return 'h12'; - //midnight is 24 is from 00-24 - if (start === '24') - return 'h24'; - dt.hours = 23; - const end = dt.parts(undefined, template).hour; - //if midnight is 00 and hour 23 is 11 then - if (start === '00' && end === '11') - return 'h11'; - if (start === '00' && end === '23') - return 'h23'; - console.warn(`couldn't determine hour cycle for ${locale}. start: ${start}. end: ${end}`); - return undefined; - }; - /** - * For the most part this object behaves exactly the same way - * as the native Date object with a little extra spice. - */ - class DateTime extends Date { - constructor() { - super(...arguments); - this.localization = DefaultFormatLocalization$1; - this.nonLeapLadder = [ - 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, - ]; - this.leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335]; - //#region CDF stuff - this.dateTimeRegex = - //is regex cannot be simplified beyond what it already is - /(\[[^[\]]*])|y{1,4}|M{1,4}|d{1,4}|H{1,2}|h{1,2}|t|T|m{1,2}|s{1,2}|f{3}/g; //NOSONAR - this.formattingTokens = /(\[[^[\]]*])|([-_:/.,()\s]+)|(T|t|yyyy|yy?|MM?M?M?|Do|dd?|hh?|HH?|mm?|ss?)/g; //NOSONAR is regex cannot be simplified beyond what it already is - this.match2 = /\d\d/; // 00 - 99 - this.match3 = /\d{3}/; // 000 - 999 - this.match4 = /\d{4}/; // 0000 - 9999 - this.match1to2 = /\d\d?/; // 0 - 99 - this.matchSigned = /[+-]?\d+/; // -inf - inf - this.matchOffset = /[+-]\d\d:?(\d\d)?|Z/; // +00:00 -00:00 +0000 or -0000 +00 or Z - this.matchWord = /[^\d_:/,\-()\s]+/; // Word - this.zoneExpressions = [ - this.matchOffset, - (obj, input) => { - obj.offset = this.offsetFromString(input); - }, - ]; - this.expressions = { - t: { - pattern: undefined, - parser: (obj, input) => { - obj.afternoon = this.meridiemMatch(input); - }, - }, - T: { - pattern: undefined, - parser: (obj, input) => { - obj.afternoon = this.meridiemMatch(input); - }, - }, - fff: { - pattern: this.match3, - parser: (obj, input) => { - obj.milliseconds = +input; - }, - }, - s: { - pattern: this.match1to2, - parser: this.addInput('seconds'), - }, - ss: { - pattern: this.match1to2, - parser: this.addInput('seconds'), - }, - m: { - pattern: this.match1to2, - parser: this.addInput('minutes'), - }, - mm: { - pattern: this.match1to2, - parser: this.addInput('minutes'), - }, - H: { - pattern: this.match1to2, - parser: this.addInput('hours'), - }, - h: { - pattern: this.match1to2, - parser: this.addInput('hours'), - }, - HH: { - pattern: this.match1to2, - parser: this.addInput('hours'), - }, - hh: { - pattern: this.match1to2, - parser: this.addInput('hours'), - }, - d: { - pattern: this.match1to2, - parser: this.addInput('day'), - }, - dd: { - pattern: this.match2, - parser: this.addInput('day'), - }, - Do: { - pattern: this.matchWord, - parser: (obj, input) => { - obj.day = +(input.match(/\d+/)[0] || 1); - if (!this.localization.ordinal) - return; - for (let i = 1; i <= 31; i += 1) { - if (this.localization.ordinal(i).replace(/[[\]]/g, '') === input) { - obj.day = i; - } - } - }, - }, - M: { - pattern: this.match1to2, - parser: this.addInput('month'), - }, - MM: { - pattern: this.match2, - parser: this.addInput('month'), - }, - MMM: { - pattern: this.matchWord, - parser: (obj, input) => { - const months = this.getAllMonths(); - const monthsShort = this.getAllMonths('short'); - const matchIndex = (monthsShort || months.map((_) => _.slice(0, 3))).indexOf(input) + 1; - if (matchIndex < 1) { - throw new Error(); - } - obj.month = matchIndex % 12 || matchIndex; - }, - }, - MMMM: { - pattern: this.matchWord, - parser: (obj, input) => { - const months = this.getAllMonths(); - const matchIndex = months.indexOf(input) + 1; - if (matchIndex < 1) { - throw new Error(); - } - obj.month = matchIndex % 12 || matchIndex; - }, - }, - y: { - pattern: this.matchSigned, - parser: this.addInput('year'), - }, - yy: { - pattern: this.match2, - parser: (obj, input) => { - obj.year = this.parseTwoDigitYear(+input); - }, - }, - yyyy: { - pattern: this.match4, - parser: this.addInput('year'), - }, - // z: this.zoneExpressions, - // zz: this.zoneExpressions, - // zzz: this.zoneExpressions - }; - //#endregion CDF stuff - } - /** - * Chainable way to set the {@link locale} - * @param value - * @deprecated use setLocalization with a FormatLocalization object instead - */ - setLocale(value) { - if (!this.localization) { - this.localization = DefaultFormatLocalization$1; - this.localization.locale = value; - } - return this; - } - /** - * Chainable way to set the {@link localization} - * @param value - */ - setLocalization(value) { - this.localization = value; - return this; - } - /** - * Converts a plain JS date object to a DateTime object. - * Doing this allows access to format, etc. - * @param date - * @param locale this parameter is deprecated. Use formatLocalization instead. - * @param formatLocalization - */ - static convert(date, locale = 'default', formatLocalization = undefined) { - if (!date) - throw new Error(`A date is required`); - if (!formatLocalization) { - formatLocalization = DefaultFormatLocalization$1; - formatLocalization.locale = locale; - } - return new DateTime(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()).setLocalization(formatLocalization); - } - /** - * Native date manipulations are not pure functions. This function creates a duplicate of the DateTime object. - */ - get clone() { - return new DateTime(this.year, this.month, this.date, this.hours, this.minutes, this.seconds, this.getMilliseconds()).setLocalization(this.localization); - } - static isValid(d) { - if (d === undefined || JSON.stringify(d) === 'null') - return false; - if (d.constructor.name === DateTime.name) - return true; - return false; - } - /** - * Sets the current date to the start of the {@link unit} provided - * Example: Consider a date of "April 30, 2021, 11:45:32.984 AM" => new DateTime(2021, 3, 30, 11, 45, 32, 984).startOf('month') - * would return April 1, 2021, 12:00:00.000 AM (midnight) - * @param unit - * @param startOfTheWeek Allows for the changing the start of the week. - */ - startOf(unit, startOfTheWeek = 0) { - if (this[unit] === undefined) - throw new Error(`Unit '${unit}' is not valid`); - switch (unit) { - case 'seconds': - this.setMilliseconds(0); - break; - case 'minutes': - this.setSeconds(0, 0); - break; - case 'hours': - this.setMinutes(0, 0, 0); - break; - case 'date': - this.setHours(0, 0, 0, 0); - break; - case 'weekDay': { - this.startOf(exports.Unit.date); - if (this.weekDay === startOfTheWeek) - break; - const goBack = (this.weekDay - startOfTheWeek + 7) % 7; - this.manipulate(goBack * -1, exports.Unit.date); - break; - } - case 'month': - this.startOf(exports.Unit.date); - this.setDate(1); - break; - case 'year': - this.startOf(exports.Unit.date); - this.setMonth(0, 1); - break; - } - return this; - } - /** - * Sets the current date to the end of the {@link unit} provided - * Example: Consider a date of "April 30, 2021, 11:45:32.984 AM" => new DateTime(2021, 3, 30, 11, 45, 32, 984).endOf('month') - * would return April 30, 2021, 11:59:59.999 PM - * @param unit - * @param startOfTheWeek - */ - endOf(unit, startOfTheWeek = 0) { - if (this[unit] === undefined) - throw new Error(`Unit '${unit}' is not valid`); - switch (unit) { - case 'seconds': - this.setMilliseconds(999); - break; - case 'minutes': - this.setSeconds(59, 999); - break; - case 'hours': - this.setMinutes(59, 59, 999); - break; - case 'date': - this.setHours(23, 59, 59, 999); - break; - case 'weekDay': { - this.endOf(exports.Unit.date); - const endOfWeek = 6 + startOfTheWeek; - if (this.weekDay === endOfWeek) - break; - this.manipulate(endOfWeek - this.weekDay, exports.Unit.date); - break; - } - case 'month': - this.endOf(exports.Unit.date); - this.manipulate(1, exports.Unit.month); - this.setDate(0); - break; - case 'year': - this.endOf(exports.Unit.date); - this.setMonth(11, 31); - break; - } - return this; - } - /** - * Change a {@link unit} value. Value can be positive or negative - * Example: Consider a date of "April 30, 2021, 11:45:32.984 AM" => new DateTime(2021, 3, 30, 11, 45, 32, 984).manipulate(1, 'month') - * would return May 30, 2021, 11:45:32.984 AM - * @param value A positive or negative number - * @param unit - */ - manipulate(value, unit) { - if (this[unit] === undefined) - throw new Error(`Unit '${unit}' is not valid`); - this[unit] += value; - return this; - } - /** - * Return true if {@link compare} is before this date - * @param compare The Date/DateTime to compare - * @param unit If provided, uses {@link startOf} for - * comparison. - */ - isBefore(compare, unit) { - // If the comparisons is undefined, return false - if (!DateTime.isValid(compare)) - return false; - if (!unit) - return this.valueOf() < compare.valueOf(); - if (this[unit] === undefined) - throw new Error(`Unit '${unit}' is not valid`); - return (this.clone.startOf(unit).valueOf() < compare.clone.startOf(unit).valueOf()); - } - /** - * Return true if {@link compare} is after this date - * @param compare The Date/DateTime to compare - * @param unit If provided, uses {@link startOf} for - * comparison. - */ - isAfter(compare, unit) { - // If the comparisons is undefined, return false - if (!DateTime.isValid(compare)) - return false; - if (!unit) - return this.valueOf() > compare.valueOf(); - if (this[unit] === undefined) - throw new Error(`Unit '${unit}' is not valid`); - return (this.clone.startOf(unit).valueOf() > compare.clone.startOf(unit).valueOf()); - } - /** - * Return true if {@link compare} is same this date - * @param compare The Date/DateTime to compare - * @param unit If provided, uses {@link startOf} for - * comparison. - */ - isSame(compare, unit) { - // If the comparisons is undefined, return false - if (!DateTime.isValid(compare)) - return false; - if (!unit) - return this.valueOf() === compare.valueOf(); - if (this[unit] === undefined) - throw new Error(`Unit '${unit}' is not valid`); - compare = DateTime.convert(compare); - return (this.clone.startOf(unit).valueOf() === compare.startOf(unit).valueOf()); - } - /** - * Check if this is between two other DateTimes, optionally looking at unit scale. The match is exclusive. - * @param left - * @param right - * @param unit. - * @param inclusivity. A [ indicates inclusion of a value. A ( indicates exclusion. - * If the inclusivity parameter is used, both indicators must be passed. - */ - isBetween(left, right, unit, inclusivity = '()') { - // If one of the comparisons is undefined, return false - if (!DateTime.isValid(left) || !DateTime.isValid(right)) - return false; - // If a unit is provided and is not a valid property of the DateTime object, throw an error - if (unit && this[unit] === undefined) { - throw new Error(`Unit '${unit}' is not valid`); - } - const leftInclusivity = inclusivity[0] === '('; - const rightInclusivity = inclusivity[1] === ')'; - const isLeftInRange = leftInclusivity - ? this.isAfter(left, unit) - : !this.isBefore(left, unit); - const isRightInRange = rightInclusivity - ? this.isBefore(right, unit) - : !this.isAfter(right, unit); - return isLeftInRange && isRightInRange; - } - /** - * Returns flattened object of the date. Does not include literals - * @param locale - * @param template - */ - parts(locale = this.localization.locale, template = { dateStyle: 'full', timeStyle: 'long' }) { - const parts = {}; - new Intl.DateTimeFormat(locale, template) - .formatToParts(this) - .filter((x) => x.type !== 'literal') - .forEach((x) => (parts[x.type] = x.value)); - return parts; - } - /** - * Shortcut to Date.getSeconds() - */ - get seconds() { - return this.getSeconds(); - } - /** - * Shortcut to Date.setSeconds() - */ - set seconds(value) { - this.setSeconds(value); - } - /** - * Returns two digit hours - */ - get secondsFormatted() { - return this.parts(undefined, twoDigitTemplate).second; - } - /** - * Shortcut to Date.getMinutes() - */ - get minutes() { - return this.getMinutes(); - } - /** - * Shortcut to Date.setMinutes() - */ - set minutes(value) { - this.setMinutes(value); - } - /** - * Returns two digit minutes - */ - get minutesFormatted() { - return this.parts(undefined, twoDigitTemplate).minute; - } - /** - * Shortcut to Date.getHours() - */ - get hours() { - return this.getHours(); - } - /** - * Shortcut to Date.setHours() - */ - set hours(value) { - this.setHours(value); - } - /** - * Returns two digit hour, e.g. 01...10 - * @param hourCycle Providing an hour cycle will change 00 to 24 depending on the given value. - */ - getHoursFormatted(hourCycle = 'h12') { - return this.parts(undefined, { ...twoDigitTemplate, hourCycle: hourCycle }) - .hour; - } - /** - * Get the meridiem of the date. E.g. AM or PM. - * If the {@link locale} provides a "dayPeriod" then this will be returned, - * otherwise it will return AM or PM. - * @param locale - */ - meridiem(locale = this.localization.locale) { - return new Intl.DateTimeFormat(locale, { - hour: 'numeric', - hour12: true, - }) - .formatToParts(this) - .find((p) => p.type === 'dayPeriod')?.value; - } - /** - * Shortcut to Date.getDate() - */ - get date() { - return this.getDate(); - } - /** - * Shortcut to Date.setDate() - */ - set date(value) { - this.setDate(value); - } - /** - * Return two digit date - */ - get dateFormatted() { - return this.parts(undefined, twoDigitTemplate).day; - } - /** - * Shortcut to Date.getDay() - */ - get weekDay() { - return this.getDay(); - } - /** - * Shortcut to Date.getMonth() - */ - get month() { - return this.getMonth(); - } - /** - * Shortcut to Date.setMonth() - */ - set month(value) { - const targetMonth = new Date(this.year, value + 1); - targetMonth.setDate(0); - const endOfMonth = targetMonth.getDate(); - if (this.date > endOfMonth) { - this.date = endOfMonth; - } - this.setMonth(value); - } - /** - * Return two digit, human expected month. E.g. January = 1, December = 12 - */ - get monthFormatted() { - return this.parts(undefined, twoDigitTemplate).month; - } - /** - * Shortcut to Date.getFullYear() - */ - get year() { - return this.getFullYear(); - } - /** - * Shortcut to Date.setFullYear() - */ - set year(value) { - this.setFullYear(value); - } - // borrowed a bunch of stuff from Luxon - /** - * Gets the week of the year - */ - get week() { - const ordinal = this.computeOrdinal(), weekday = this.getUTCDay(); - let weekNumber = Math.floor((ordinal - weekday + 10) / 7); - if (weekNumber < 1) { - weekNumber = this.weeksInWeekYear(); - } - else if (weekNumber > this.weeksInWeekYear()) { - weekNumber = 1; - } - return weekNumber; - } - /** - * Returns the number of weeks in the year - */ - weeksInWeekYear() { - const p1 = (this.year + - Math.floor(this.year / 4) - - Math.floor(this.year / 100) + - Math.floor(this.year / 400)) % - 7, last = this.year - 1, p2 = (last + - Math.floor(last / 4) - - Math.floor(last / 100) + - Math.floor(last / 400)) % - 7; - return p1 === 4 || p2 === 3 ? 53 : 52; - } - /** - * Returns true or false depending on if the year is a leap year or not. - */ - get isLeapYear() { - return (this.year % 4 === 0 && (this.year % 100 !== 0 || this.year % 400 === 0)); - } - computeOrdinal() { - return (this.date + - (this.isLeapYear ? this.leapLadder : this.nonLeapLadder)[this.month]); - } - /** - * Returns a list of month values based on the current locale - */ - getAllMonths(format = 'long') { - const applyFormat = new Intl.DateTimeFormat(this.localization.locale, { - month: format, - }).format; - return [...Array(12).keys()].map((m) => applyFormat(new Date(2021, m))); - } - /** - * Replaces an expanded token set (e.g. LT/LTS) - */ - replaceTokens(formatStr, formats) { - /*** - * _ => match - * a => first capture group. Anything between [ and ] - * b => second capture group - */ - return formatStr.replace(/(\[[^[\]]*])|(LTS?|l{1,4}|L{1,4})/g, (_, a, b) => { - const B = b && b.toUpperCase(); - return a || formats[B] || DefaultFormatLocalization$1.dateFormats[B]; - }); - } - parseTwoDigitYear(input) { - return input + (input > 68 ? 1900 : 2000); - } - offsetFromString(input) { - if (!input) - return 0; - if (input === 'Z') - return 0; - const [first, second, third] = input.match(/([+-]|\d\d)/g); - const minutes = +second * 60 + (+third || 0); - const signed = first === '+' ? -minutes : minutes; - return minutes === 0 ? 0 : signed; // eslint-disable-line no-nested-ternary - } - /** - * z = -4, zz = -04, zzz = -0400 - * @param date - * @param style - * @private - */ - zoneInformation(date, style) { - let name = date - .parts(this.localization.locale, { timeZoneName: 'longOffset' }) - .timeZoneName.replace('GMT', '') - .replace(':', ''); - const negative = name.includes('-'); - name = name.replace('-', ''); - if (style === 'z') - name = name.substring(1, 2); - else if (style === 'zz') - name = name.substring(0, 2); - return `${negative ? '-' : ''}${name}`; - } - addInput(property) { - return (obj, input) => { - obj[property] = +input; - }; - } - getLocaleAfternoon() { - return new Intl.DateTimeFormat(this.localization.locale, { - hour: 'numeric', - hour12: true, - }) - .formatToParts(new Date(2022, 3, 4, 13)) - .find((p) => p.type === 'dayPeriod') - ?.value?.replace(/\s+/g, ' '); - } - meridiemMatch(input) { - return input.toLowerCase() === this.getLocaleAfternoon().toLowerCase(); - } - correctHours(time) { - const { afternoon } = time; - if (afternoon !== undefined) { - const { hours } = time; - if (afternoon) { - if (hours < 12) { - time.hours += 12; - } - } - else if (hours === 12) { - time.hours = 0; - } - delete time.afternoon; - } - } - makeParser(format) { - format = this.replaceTokens(format, this.localization.dateFormats); - const matchArray = format.match(this.formattingTokens); - const { length } = matchArray; - const expressionArray = []; - for (let i = 0; i < length; i += 1) { - const token = matchArray[i]; - const expression = this.expressions[token]; - if (expression?.parser) { - expressionArray[i] = expression; - } - else { - expressionArray[i] = token.replace(/^\[[^[\]]*]$/g, ''); - } - } - return (input) => { - const time = { - hours: 0, - minutes: 0, - seconds: 0, - milliseconds: 0, - }; - for (let i = 0, start = 0; i < length; i += 1) { - const token = expressionArray[i]; - if (typeof token === 'string') { - start += token.length; - } - else { - const part = input.slice(start); - let value = part; - if (token.pattern) { - const match = token.pattern.exec(part); - value = match[0]; - } - token.parser.call(this, time, value); - input = input.replace(value, ''); - } - } - this.correctHours(time); - return time; - }; - } - /** - * Attempts to create a DateTime from a string. - * @param input date as string - * @param localization provides the date template the string is in via the format property - */ - //eslint-disable-next-line @typescript-eslint/no-unused-vars - static fromString(input, localization) { - if (!localization?.format) { - Namespace.errorMessages.customDateFormatError('No format was provided'); - } - try { - const dt = new DateTime(); - dt.setLocalization(localization); - if (['x', 'X'].indexOf(localization.format) > -1) - return new DateTime((localization.format === 'X' ? 1000 : 1) * +input); - input = input.replace(/\s+/g, ' '); - const parser = dt.makeParser(localization.format); - const { year, month, day, hours, minutes, seconds, milliseconds, zone } = parser(input); - const d = day || (!year && !month ? dt.getDate() : 1); - const y = year || dt.getFullYear(); - let M = 0; - if (!(year && !month)) { - M = month > 0 ? month - 1 : dt.getMonth(); - } - if (zone) { - return new DateTime(Date.UTC(y, M, d, hours, minutes, seconds, milliseconds + zone.offset * 60 * 1000)); - } - return new DateTime(y, M, d, hours, minutes, seconds, milliseconds); - } - catch (e) { - Namespace.errorMessages.customDateFormatError(`Unable to parse provided input: ${input}, format: ${localization.format}`); - } - } - /** - * Returns a string format. - * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat - * for valid templates and locale objects - * @param template An optional object. If provided, method will use Intl., otherwise the localizations format properties - * @param locale Can be a string or an array of strings. Uses browser defaults otherwise. - */ - format(template, locale = this.localization.locale) { - if (template && typeof template === 'object') - return new Intl.DateTimeFormat(locale, template).format(this); - const formatString = this.replaceTokens( - //try template first - template || - //otherwise try localization format - this.localization.format || - //otherwise try date + time - `${DefaultFormatLocalization$1.dateFormats.L}, ${DefaultFormatLocalization$1.dateFormats.LT}`, this.localization.dateFormats); - const formatter = (template) => new Intl.DateTimeFormat(this.localization.locale, template).format(this); - if (!this.localization.hourCycle) - this.localization.hourCycle = guessHourCycle(this.localization.locale); - //if the format asks for a twenty-four-hour string but the hour cycle is not, then make a base guess - const HHCycle = this.localization.hourCycle.startsWith('h1') - ? 'h24' - : this.localization.hourCycle; - const hhCycle = this.localization.hourCycle.startsWith('h2') - ? 'h12' - : this.localization.hourCycle; - const matches = { - y: this.year, - yy: formatter({ year: '2-digit' }), - yyyy: this.year, - M: formatter({ month: 'numeric' }), - MM: this.monthFormatted, - MMM: this.getAllMonths('short')[this.getMonth()], - MMMM: this.getAllMonths()[this.getMonth()], - d: this.date, - dd: this.dateFormatted, - ddd: formatter({ weekday: 'short' }), - dddd: formatter({ weekday: 'long' }), - H: this.getHours(), - HH: this.getHoursFormatted(HHCycle), - h: this.hours > 12 ? this.hours - 12 : this.hours, - hh: this.getHoursFormatted(hhCycle), - t: this.meridiem(), - T: this.meridiem().toUpperCase(), - m: this.minutes, - mm: this.minutesFormatted, - s: this.seconds, - ss: this.secondsFormatted, - fff: this.getMilliseconds(), - // z: this.zoneInformation(dateTime, 'z'), //-4 - // zz: this.zoneInformation(dateTime, 'zz'), //-04 - // zzz: this.zoneInformation(dateTime, 'zzz') //-0400 - }; - return formatString - .replace(this.dateTimeRegex, (match, $1) => { - return $1 || matches[match]; - }) - .replace(/\[/g, '') - .replace(/]/g, ''); - } - } - - class ServiceLocator { - constructor() { - this.cache = new Map(); - } - locate(identifier) { - const service = this.cache.get(identifier); - if (service) - return service; - const value = new identifier(); - this.cache.set(identifier, value); - return value; - } - } - const setupServiceLocator = () => { - serviceLocator = new ServiceLocator(); - }; - let serviceLocator; - - const CalendarModes = [ - { - name: 'calendar', - className: Namespace.css.daysContainer, - unit: exports.Unit.month, - step: 1, - }, - { - name: 'months', - className: Namespace.css.monthsContainer, - unit: exports.Unit.year, - step: 1, - }, - { - name: 'years', - className: Namespace.css.yearsContainer, - unit: exports.Unit.year, - step: 10, - }, - { - name: 'decades', - className: Namespace.css.decadesContainer, - unit: exports.Unit.year, - step: 100, - }, - ]; - - class OptionsStore { - constructor() { - this._currentCalendarViewMode = 0; - this._viewDate = new DateTime(); - this.minimumCalendarViewMode = 0; - this.currentView = 'calendar'; - } - get currentCalendarViewMode() { - return this._currentCalendarViewMode; - } - set currentCalendarViewMode(value) { - this._currentCalendarViewMode = value; - this.currentView = CalendarModes[value].name; - } - get viewDate() { - return this._viewDate; - } - set viewDate(v) { - this._viewDate = v; - if (this.options) - this.options.viewDate = v; - } - /** - * When switching back to the calendar from the clock, - * this sets currentView to the correct calendar view. - */ - refreshCurrentView() { - this.currentView = CalendarModes[this.currentCalendarViewMode].name; - } - get isTwelveHour() { - return ['h12', 'h11'].includes(this.options.localization.hourCycle); - } - } - - /** - * Main class for date validation rules based on the options provided. - */ - class Validation { - constructor() { - this.optionsStore = serviceLocator.locate(OptionsStore); - } - /** - * Checks to see if the target date is valid based on the rules provided in the options. - * Granularity can be provided to check portions of the date instead of the whole. - * @param targetDate - * @param granularity - */ - isValid(targetDate, granularity) { - if (!this._enabledDisabledDatesIsValid(granularity, targetDate)) - return false; - if (granularity !== exports.Unit.month && - granularity !== exports.Unit.year && - this.optionsStore.options.restrictions.daysOfWeekDisabled?.length > 0 && - this.optionsStore.options.restrictions.daysOfWeekDisabled.indexOf(targetDate.weekDay) !== -1) - return false; - if (!this._minMaxIsValid(granularity, targetDate)) - return false; - if (granularity === exports.Unit.hours || - granularity === exports.Unit.minutes || - granularity === exports.Unit.seconds) { - if (!this._enabledDisabledHoursIsValid(targetDate)) - return false; - if (this.optionsStore.options.restrictions.disabledTimeIntervals?.filter((internal) => targetDate.isBetween(internal.from, internal.to)).length !== 0) - return false; - } - return true; - } - _enabledDisabledDatesIsValid(granularity, targetDate) { - if (granularity !== exports.Unit.date) - return true; - if (this.optionsStore.options.restrictions.disabledDates.length > 0 && - this._isInDisabledDates(targetDate)) { - return false; - } - // noinspection RedundantIfStatementJS - if (this.optionsStore.options.restrictions.enabledDates.length > 0 && - !this._isInEnabledDates(targetDate)) { - return false; - } - return true; - } - /** - * Checks to see if the disabledDates option is in use and returns true (meaning invalid) - * if the `testDate` is with in the array. Granularity is by date. - * @param testDate - * @private - */ - _isInDisabledDates(testDate) { - if (!this.optionsStore.options.restrictions.disabledDates || - this.optionsStore.options.restrictions.disabledDates.length === 0) - return false; - return !!this.optionsStore.options.restrictions.disabledDates.find((x) => x.isSame(testDate, exports.Unit.date)); - } - /** - * Checks to see if the enabledDates option is in use and returns true (meaning valid) - * if the `testDate` is with in the array. Granularity is by date. - * @param testDate - * @private - */ - _isInEnabledDates(testDate) { - if (!this.optionsStore.options.restrictions.enabledDates || - this.optionsStore.options.restrictions.enabledDates.length === 0) - return true; - return !!this.optionsStore.options.restrictions.enabledDates.find((x) => x.isSame(testDate, exports.Unit.date)); - } - _minMaxIsValid(granularity, targetDate) { - if (this.optionsStore.options.restrictions.minDate && - targetDate.isBefore(this.optionsStore.options.restrictions.minDate, granularity)) { - return false; - } - // noinspection RedundantIfStatementJS - if (this.optionsStore.options.restrictions.maxDate && - targetDate.isAfter(this.optionsStore.options.restrictions.maxDate, granularity)) { - return false; - } - return true; - } - _enabledDisabledHoursIsValid(targetDate) { - if (this.optionsStore.options.restrictions.disabledHours.length > 0 && - this._isInDisabledHours(targetDate)) { - return false; - } - // noinspection RedundantIfStatementJS - if (this.optionsStore.options.restrictions.enabledHours.length > 0 && - !this._isInEnabledHours(targetDate)) { - return false; - } - return true; - } - /** - * Checks to see if the disabledHours option is in use and returns true (meaning invalid) - * if the `testDate` is with in the array. Granularity is by hours. - * @param testDate - * @private - */ - _isInDisabledHours(testDate) { - if (!this.optionsStore.options.restrictions.disabledHours || - this.optionsStore.options.restrictions.disabledHours.length === 0) - return false; - const formattedDate = testDate.hours; - return this.optionsStore.options.restrictions.disabledHours.includes(formattedDate); - } - /** - * Checks to see if the enabledHours option is in use and returns true (meaning valid) - * if the `testDate` is with in the array. Granularity is by hours. - * @param testDate - * @private - */ - _isInEnabledHours(testDate) { - if (!this.optionsStore.options.restrictions.enabledHours || - this.optionsStore.options.restrictions.enabledHours.length === 0) - return true; - const formattedDate = testDate.hours; - return this.optionsStore.options.restrictions.enabledHours.includes(formattedDate); - } - dateRangeIsValid(dates, index, target) { - // if we're not using the option, then return valid - if (!this.optionsStore.options.dateRange) - return true; - // if we've only selected 0..1 dates, and we're not setting the end date - // then return valid. We only want to validate the range if both are selected, - // because the other validation on the target has already occurred. - if (dates.length !== 2 && index !== 1) - return true; - // initialize start date - const start = dates[0].clone; - // check if start date is not the same as target date - if (start.isSame(target, exports.Unit.date)) - return true; - // add one day to start; start has already been validated - start.manipulate(1, exports.Unit.date); - // check each date in the range to make sure it's valid - while (!start.isSame(target, exports.Unit.date)) { - const valid = this.isValid(start, exports.Unit.date); - if (!valid) - return false; - start.manipulate(1, exports.Unit.date); - } - return true; - } - } - - class EventEmitter { - constructor() { - this.subscribers = []; - } - subscribe(callback) { - this.subscribers.push(callback); - return this.unsubscribe.bind(this, this.subscribers.length - 1); - } - unsubscribe(index) { - this.subscribers.splice(index, 1); - } - emit(value) { - this.subscribers.forEach((callback) => { - callback(value); - }); - } - destroy() { - this.subscribers = null; - this.subscribers = []; - } - } - class EventEmitters { - constructor() { - this.triggerEvent = new EventEmitter(); - this.viewUpdate = new EventEmitter(); - this.updateDisplay = new EventEmitter(); - this.action = new EventEmitter(); //eslint-disable-line @typescript-eslint/no-explicit-any - this.updateViewDate = new EventEmitter(); - } - destroy() { - this.triggerEvent.destroy(); - this.viewUpdate.destroy(); - this.updateDisplay.destroy(); - this.action.destroy(); - this.updateViewDate.destroy(); - } - } - - const defaultEnLocalization = { - clear: 'Clear selection', - close: 'Close the picker', - dateFormats: DefaultFormatLocalization$1.dateFormats, - dayViewHeaderFormat: { month: 'long', year: '2-digit' }, - decrementHour: 'Decrement Hour', - decrementMinute: 'Decrement Minute', - decrementSecond: 'Decrement Second', - format: DefaultFormatLocalization$1.format, - hourCycle: DefaultFormatLocalization$1.hourCycle, - incrementHour: 'Increment Hour', - incrementMinute: 'Increment Minute', - incrementSecond: 'Increment Second', - locale: DefaultFormatLocalization$1.locale, - maxWeekdayLength: 0, - nextCentury: 'Next Century', - nextDecade: 'Next Decade', - nextMonth: 'Next Month', - nextYear: 'Next Year', - ordinal: DefaultFormatLocalization$1.ordinal, - pickHour: 'Pick Hour', - pickMinute: 'Pick Minute', - pickSecond: 'Pick Second', - previousCentury: 'Previous Century', - previousDecade: 'Previous Decade', - previousMonth: 'Previous Month', - previousYear: 'Previous Year', - selectDate: 'Select Date', - selectDecade: 'Select Decade', - selectMonth: 'Select Month', - selectTime: 'Select Time', - selectYear: 'Select Year', - startOfTheWeek: 0, - today: 'Go to today', - toggleMeridiem: 'Toggle Meridiem', - }; - const DefaultOptions = { - allowInputToggle: false, - container: undefined, - dateRange: false, - debug: false, - defaultDate: undefined, - display: { - icons: { - type: 'icons', - time: 'fa-solid fa-clock', - date: 'fa-solid fa-calendar', - up: 'fa-solid fa-arrow-up', - down: 'fa-solid fa-arrow-down', - previous: 'fa-solid fa-chevron-left', - next: 'fa-solid fa-chevron-right', - today: 'fa-solid fa-calendar-check', - clear: 'fa-solid fa-trash', - close: 'fa-solid fa-xmark', - }, - sideBySide: false, - calendarWeeks: false, - viewMode: 'calendar', - toolbarPlacement: 'bottom', - keepOpen: false, - buttons: { - today: false, - clear: false, - close: false, - }, - components: { - calendar: true, - date: true, - month: true, - year: true, - decades: true, - clock: true, - hours: true, - minutes: true, - seconds: false, - useTwentyfourHour: undefined, - }, - inline: false, - theme: 'auto', - placement: 'bottom', - }, - keepInvalid: false, - localization: defaultEnLocalization, - meta: {}, - multipleDates: false, - multipleDatesSeparator: '; ', - promptTimeOnDateChange: false, - promptTimeOnDateChangeTransitionDelay: 200, - restrictions: { - minDate: undefined, - maxDate: undefined, - disabledDates: [], - enabledDates: [], - daysOfWeekDisabled: [], - disabledTimeIntervals: [], - disabledHours: [], - enabledHours: [], - }, - stepping: 1, - useCurrent: true, - viewDate: new DateTime(), - }; - const DefaultEnLocalization = { ...defaultEnLocalization }; - - /** - * Attempts to prove `d` is a DateTime or Date or can be converted into one. - * @param d If a string will attempt creating a date from it. - * @param localization object containing locale and format settings. Only used with the custom formats - * @private - */ - function tryConvertToDateTime(d, localization) { - if (!d) - return null; - if (d.constructor.name === DateTime.name) - return d; - if (d.constructor.name === Date.name) { - return DateTime.convert(d); - } - if (typeof d === typeof '') { - const dateTime = DateTime.fromString(d, localization); - if (JSON.stringify(dateTime) === 'null') { - return null; - } - return dateTime; - } - return null; - } - /** - * Attempts to convert `d` to a DateTime object - * @param d value to convert - * @param optionName Provides text to error messages e.g. disabledDates - * @param localization object containing locale and format settings. Only used with the custom formats - */ - function convertToDateTime(d, optionName, localization) { - if (typeof d === typeof '' && optionName !== 'input') { - Namespace.errorMessages.dateString(); - } - const converted = tryConvertToDateTime(d, localization); - if (!converted) { - Namespace.errorMessages.failedToParseDate(optionName, d, optionName === 'input'); - } - return converted; - } - /** - * Type checks that `value` is an array of Date or DateTime - * @param optionName Provides text to error messages e.g. disabledDates - * @param value Option value - * @param providedType Used to provide text to error messages - * @param localization - */ - function typeCheckDateArray(optionName, value, //eslint-disable-line @typescript-eslint/no-explicit-any - providedType, localization = DefaultFormatLocalization$1) { - if (!Array.isArray(value)) { - Namespace.errorMessages.typeMismatch(optionName, providedType, 'array of DateTime or Date'); - } - for (let i = 0; i < value.length; i++) { - const d = value[i]; - const dateTime = convertToDateTime(d, optionName, localization); - dateTime.setLocalization(localization); - value[i] = dateTime; - } - } - /** - * Type checks that `value` is an array of numbers - * @param optionName Provides text to error messages e.g. disabledDates - * @param value Option value - * @param providedType Used to provide text to error messages - */ - function typeCheckNumberArray(optionName, value, //eslint-disable-line @typescript-eslint/no-explicit-any - providedType) { - if (!Array.isArray(value) || value.some((x) => typeof x !== typeof 0)) { - Namespace.errorMessages.typeMismatch(optionName, providedType, 'array of numbers'); - } - } - - function mandatoryDate(key) { - return ({ value, providedType, localization }) => { - const dateTime = convertToDateTime(value, key, localization); - if (dateTime !== undefined) { - dateTime.setLocalization(localization); - return dateTime; - } - }; - } - function optionalDate(key) { - const mandatory = mandatoryDate(key); - return (args) => { - if (args.value === undefined) { - return args.value; - } - return mandatory(args); - }; - } - function numbersInRange(key, lower, upper) { - return ({ value, providedType }) => { - if (value === undefined) { - return []; - } - typeCheckNumberArray(key, value, providedType); - if (value.some((x) => x < lower || x > upper)) - Namespace.errorMessages.numbersOutOfRange(key, lower, upper); - return value; - }; - } - function validHourRange(key) { - return numbersInRange(key, 0, 23); - } - function validDateArray(key) { - return ({ value, providedType, localization }) => { - if (value === undefined) { - return []; - } - typeCheckDateArray(key, value, providedType, localization); - return value; - }; - } - function validKeyOption(keyOptions) { - return ({ value, path }) => { - if (!keyOptions.includes(value)) - Namespace.errorMessages.unexpectedOptionValue(path.substring(1), value, keyOptions); - return value; - }; - } - const optionProcessors = Object.freeze({ - defaultDate: mandatoryDate('defaultDate'), - viewDate: mandatoryDate('viewDate'), - minDate: optionalDate('restrictions.minDate'), - maxDate: optionalDate('restrictions.maxDate'), - disabledHours: validHourRange('restrictions.disabledHours'), - enabledHours: validHourRange('restrictions.enabledHours'), - disabledDates: validDateArray('restrictions.disabledDates'), - enabledDates: validDateArray('restrictions.enabledDates'), - daysOfWeekDisabled: numbersInRange('restrictions.daysOfWeekDisabled', 0, 6), - disabledTimeIntervals: ({ key, value, providedType, localization }) => { - if (value === undefined) { - return []; - } - if (!Array.isArray(value)) { - Namespace.errorMessages.typeMismatch(key, providedType, 'array of { from: DateTime|Date, to: DateTime|Date }'); - } - const valueObject = value; //eslint-disable-line @typescript-eslint/no-explicit-any - for (let i = 0; i < valueObject.length; i++) { - Object.keys(valueObject[i]).forEach((vk) => { - const subOptionName = `${key}[${i}].${vk}`; - const d = valueObject[i][vk]; - const dateTime = convertToDateTime(d, subOptionName, localization); - dateTime.setLocalization(localization); - valueObject[i][vk] = dateTime; - }); - } - return valueObject; - }, - toolbarPlacement: validKeyOption(['top', 'bottom', 'default']), - type: validKeyOption(['icons', 'sprites']), - viewMode: validKeyOption([ - 'clock', - 'calendar', - 'months', - 'years', - 'decades', - ]), - theme: validKeyOption(['light', 'dark', 'auto']), - placement: validKeyOption(['top', 'bottom']), - meta: ({ value }) => value, - dayViewHeaderFormat: ({ value }) => value, - container: ({ value, path }) => { - if (value && - !(value instanceof HTMLElement || - value instanceof Element || - value?.appendChild)) { - Namespace.errorMessages.typeMismatch(path.substring(1), typeof value, 'HTMLElement'); - } - return value; - }, - useTwentyfourHour: ({ value, path, providedType, defaultType }) => { - Namespace.errorMessages.deprecatedWarning('useTwentyfourHour', 'Please use "options.localization.hourCycle" instead'); - if (value === undefined || providedType === 'boolean') - return value; - Namespace.errorMessages.typeMismatch(path, providedType, defaultType); - }, - hourCycle: validKeyOption(['h11', 'h12', 'h23', 'h24']), - }); - const defaultProcessor = ({ value, defaultType, providedType, path, }) => { - switch (defaultType) { - case 'boolean': - return value === 'true' || value === true; - case 'number': - return +value; - case 'string': - return value.toString(); - case 'object': - return {}; - case 'function': - return value; - default: - Namespace.errorMessages.typeMismatch(path, providedType, defaultType); - } - }; - function processKey(args) { - return (optionProcessors[args.key] || defaultProcessor)(args); - } - - class OptionConverter { - static deepCopy(input) { - const o = {}; - Object.keys(input).forEach((key) => { - const inputElement = input[key]; - if (inputElement instanceof DateTime) { - o[key] = inputElement.clone; - return; - } - else if (inputElement instanceof Date) { - o[key] = new Date(inputElement.valueOf()); - return; - } - o[key] = inputElement; - if (typeof inputElement !== 'object' || - inputElement instanceof HTMLElement || - inputElement instanceof Element) - return; - if (!Array.isArray(inputElement)) { - o[key] = OptionConverter.deepCopy(inputElement); - } - }); - return o; - } - /** - * Finds value out of an object based on a string, period delimited, path - * @param paths - * @param obj - */ - static objectPath(paths, obj) { - if (paths.charAt(0) === '.') - paths = paths.slice(1); - if (!paths) - return obj; - return paths - .split('.') - .reduce((value, key) => OptionConverter.isValue(value) || OptionConverter.isValue(value[key]) - ? value[key] - : undefined, obj); - } - /** - * The spread operator caused sub keys to be missing after merging. - * This is to fix that issue by using spread on the child objects first. - * Also handles complex options like disabledDates - * @param provided An option from new providedOptions - * @param copyTo Destination object. This was added to prevent reference copies - * @param localization - * @param path - */ - static spread(provided, copyTo, localization, path = '') { - const defaultOptions = OptionConverter.objectPath(path, DefaultOptions); - const unsupportedOptions = Object.keys(provided).filter((x) => !Object.keys(defaultOptions).includes(x)); - if (unsupportedOptions.length > 0) { - const flattenedOptions = OptionConverter.getFlattenDefaultOptions(); - const errors = unsupportedOptions.map((x) => { - let error = `"${path}.${x}" in not a known option.`; - const didYouMean = flattenedOptions.find((y) => y.includes(x)); - if (didYouMean) - error += ` Did you mean "${didYouMean}"?`; - return error; - }); - Namespace.errorMessages.unexpectedOptions(errors); - } - Object.keys(provided) - .filter((key) => key !== '__proto__' && key !== 'constructor') - .forEach((key) => { - path += `.${key}`; - if (path.charAt(0) === '.') - path = path.slice(1); - const defaultOptionValue = defaultOptions[key]; - const providedType = typeof provided[key]; - const defaultType = typeof defaultOptionValue; - const value = provided[key]; - if (value === undefined || value === null) { - copyTo[key] = value; - path = path.substring(0, path.lastIndexOf(`.${key}`)); - return; - } - if (typeof defaultOptionValue === 'object' && - !Array.isArray(provided[key]) && - !(defaultOptionValue instanceof Date || - OptionConverter.ignoreProperties.includes(key))) { - OptionConverter.spread(provided[key], copyTo[key], localization, path); - } - else { - copyTo[key] = OptionConverter.processKey(key, value, providedType, defaultType, path, localization); - } - path = path.substring(0, path.lastIndexOf(`.${key}`)); - }); - } - static processKey(key, value, //eslint-disable-line @typescript-eslint/no-explicit-any - providedType, defaultType, path, localization) { - return processKey({ - key, - value, - providedType, - defaultType, - path, - localization, - }); - } - static _mergeOptions(providedOptions, mergeTo) { - const newConfig = OptionConverter.deepCopy(mergeTo); - //see if the options specify a locale - const localization = mergeTo.localization?.locale !== 'default' - ? mergeTo.localization - : providedOptions?.localization || DefaultOptions.localization; - OptionConverter.spread(providedOptions, newConfig, localization, ''); - return newConfig; - } - static _dataToOptions(element, options) { - const eData = JSON.parse(JSON.stringify(element.dataset)); - if (eData?.tdTargetInput) - delete eData.tdTargetInput; - if (eData?.tdTargetToggle) - delete eData.tdTargetToggle; - if (!eData || - Object.keys(eData).length === 0 || - eData.constructor !== DOMStringMap) - return options; - const dataOptions = {}; - // because dataset returns camelCase including the 'td' key the option - // key won't align - const objectToNormalized = (object) => { - const lowered = {}; - Object.keys(object).forEach((x) => { - lowered[x.toLowerCase()] = x; - }); - return lowered; - }; - const normalizeObject = this.normalizeObject(objectToNormalized); - const optionsLower = objectToNormalized(options); - Object.keys(eData) - .filter((x) => x.startsWith(Namespace.dataKey)) - .map((x) => x.substring(2)) - .forEach((key) => { - let keyOption = optionsLower[key.toLowerCase()]; - // dataset merges dashes to camelCase... yay - // i.e. key = display_components_seconds - if (key.includes('_')) { - // [display, components, seconds] - const split = key.split('_'); - // display - keyOption = optionsLower[split[0].toLowerCase()]; - if (keyOption !== undefined && - options[keyOption].constructor === Object) { - dataOptions[keyOption] = normalizeObject(split, 1, options[keyOption], eData[`td${key}`]); - } - } - // or key = multipleDate - else if (keyOption !== undefined) { - dataOptions[keyOption] = eData[`td${key}`]; - } - }); - return this._mergeOptions(dataOptions, options); - } - //todo clean this up - static normalizeObject(objectToNormalized) { - const normalizeObject = (split, index, optionSubgroup, value) => { - // first round = display { ... } - const normalizedOptions = objectToNormalized(optionSubgroup); - const keyOption = normalizedOptions[split[index].toLowerCase()]; - const internalObject = {}; - if (keyOption === undefined) - return internalObject; - // if this is another object, continue down the rabbit hole - if (optionSubgroup[keyOption].constructor === Object) { - index++; - internalObject[keyOption] = normalizeObject(split, index, optionSubgroup[keyOption], value); - } - else { - internalObject[keyOption] = value; - } - return internalObject; - }; - return normalizeObject; - } - /** - * Attempts to prove `d` is a DateTime or Date or can be converted into one. - * @param d If a string will attempt creating a date from it. - * @param localization object containing locale and format settings. Only used with the custom formats - * @private - */ - static _dateTypeCheck(d, //eslint-disable-line @typescript-eslint/no-explicit-any - localization) { - return tryConvertToDateTime(d, localization); - } - /** - * Type checks that `value` is an array of Date or DateTime - * @param optionName Provides text to error messages e.g. disabledDates - * @param value Option value - * @param providedType Used to provide text to error messages - * @param localization - */ - static _typeCheckDateArray(optionName, value, providedType, localization) { - return typeCheckDateArray(optionName, value, providedType, localization); - } - /** - * Type checks that `value` is an array of numbers - * @param optionName Provides text to error messages e.g. disabledDates - * @param value Option value - * @param providedType Used to provide text to error messages - */ - static _typeCheckNumberArray(optionName, value, providedType) { - return typeCheckNumberArray(optionName, value, providedType); - } - /** - * Attempts to convert `d` to a DateTime object - * @param d value to convert - * @param optionName Provides text to error messages e.g. disabledDates - * @param localization object containing locale and format settings. Only used with the custom formats - */ - static dateConversion(d, //eslint-disable-line @typescript-eslint/no-explicit-any - optionName, localization) { - return convertToDateTime(d, optionName, localization); - } - static getFlattenDefaultOptions() { - if (this._flattenDefaults) - return this._flattenDefaults; - const deepKeys = (t, pre = []) => { - if (Array.isArray(t)) - return []; - if (Object(t) === t) { - return Object.entries(t).flatMap(([k, v]) => deepKeys(v, [...pre, k])); - } - else { - return pre.join('.'); - } - }; - this._flattenDefaults = deepKeys(DefaultOptions); - return this._flattenDefaults; - } - /** - * Some options conflict like min/max date. Verify that these kinds of options - * are set correctly. - * @param config - */ - static _validateConflicts(config) { - if (config.display.sideBySide && - (!config.display.components.clock || - !(config.display.components.hours || - config.display.components.minutes || - config.display.components.seconds))) { - Namespace.errorMessages.conflictingConfiguration('Cannot use side by side mode without the clock components'); - } - if (config.restrictions.minDate && config.restrictions.maxDate) { - if (config.restrictions.minDate.isAfter(config.restrictions.maxDate)) { - Namespace.errorMessages.conflictingConfiguration('minDate is after maxDate'); - } - if (config.restrictions.maxDate.isBefore(config.restrictions.minDate)) { - Namespace.errorMessages.conflictingConfiguration('maxDate is before minDate'); - } - } - if (config.multipleDates && config.dateRange) { - Namespace.errorMessages.conflictingConfiguration('Cannot uss option "multipleDates" with "dateRange"'); - } - } - } - OptionConverter.ignoreProperties = [ - 'meta', - 'dayViewHeaderFormat', - 'container', - 'dateForms', - 'ordinal', - ]; - OptionConverter.isValue = (a) => a != null; // everything except undefined + null - - class Dates { - constructor() { - this._dates = []; - this.optionsStore = serviceLocator.locate(OptionsStore); - this.validation = serviceLocator.locate(Validation); - this._eventEmitters = serviceLocator.locate(EventEmitters); - } - /** - * Returns the array of selected dates - */ - get picked() { - return [...this._dates]; - } - /** - * Returns the last picked value. - */ - get lastPicked() { - return this._dates[this.lastPickedIndex]?.clone; - } - /** - * Returns the length of picked dates -1 or 0 if none are selected. - */ - get lastPickedIndex() { - if (this._dates.length === 0) - return 0; - return this._dates.length - 1; - } - /** - * Formats a DateTime object to a string. Used when setting the input value. - * @param date - */ - formatInput(date) { - if (!date) - return ''; - date.localization = this.optionsStore.options.localization; - return date.format(); - } - /** - * parse the value into a DateTime object. - * this can be overwritten to supply your own parsing. - */ - //eslint-disable-next-line @typescript-eslint/no-explicit-any - parseInput(value) { - return OptionConverter.dateConversion(value, 'input', this.optionsStore.options.localization); - } - /** - * Tries to convert the provided value to a DateTime object. - * If value is null|undefined then clear the value of the provided index (or 0). - * @param value Value to convert or null|undefined - * @param index When using multidates this is the index in the array - */ - //eslint-disable-next-line @typescript-eslint/no-explicit-any - setFromInput(value, index) { - if (!value) { - this.setValue(undefined, index); - return; - } - const converted = this.parseInput(value); - if (converted) { - converted.setLocalization(this.optionsStore.options.localization); - this.setValue(converted, index); - } - } - /** - * Adds a new DateTime to selected dates array - * @param date - */ - add(date) { - this._dates.push(date); - } - /** - * Returns true if the `targetDate` is part of the selected dates array. - * If `unit` is provided then a granularity to that unit will be used. - * @param targetDate - * @param unit - */ - isPicked(targetDate, unit) { - if (!DateTime.isValid(targetDate)) - return false; - if (!unit) - return this._dates.find((x) => x.isSame(targetDate)) !== undefined; - const format = getFormatByUnit(unit); - const innerDateFormatted = targetDate.format(format); - return (this._dates - .map((x) => x.format(format)) - .find((x) => x === innerDateFormatted) !== undefined); - } - /** - * Returns the index at which `targetDate` is in the array. - * This is used for updating or removing a date when multi-date is used - * If `unit` is provided then a granularity to that unit will be used. - * @param targetDate - * @param unit - */ - pickedIndex(targetDate, unit) { - if (!DateTime.isValid(targetDate)) - return -1; - if (!unit) - return this._dates.map((x) => x.valueOf()).indexOf(targetDate.valueOf()); - const format = getFormatByUnit(unit); - const innerDateFormatted = targetDate.format(format); - return this._dates.map((x) => x.format(format)).indexOf(innerDateFormatted); - } - /** - * Clears all selected dates. - */ - clear() { - this.optionsStore.unset = true; - this._eventEmitters.triggerEvent.emit({ - type: Namespace.events.change, - date: undefined, - oldDate: this.lastPicked, - isClear: true, - isValid: true, - }); - this._dates = []; - if (this.optionsStore.input) - this.optionsStore.input.value = ''; - this._eventEmitters.updateDisplay.emit('all'); - } - /** - * Find the "book end" years given a `year` and a `factor` - * @param factor e.g. 100 for decades - * @param year e.g. 2021 - */ - static getStartEndYear(factor, year) { - const step = factor / 10, startYear = Math.floor(year / factor) * factor, endYear = startYear + step * 9, focusValue = Math.floor(year / step) * step; - return [startYear, endYear, focusValue]; - } - updateInput(target) { - if (!this.optionsStore.input) - return; - let newValue = this.formatInput(target); - if (this.optionsStore.options.multipleDates || - this.optionsStore.options.dateRange) { - newValue = this._dates - .map((d) => this.formatInput(d)) - .join(this.optionsStore.options.multipleDatesSeparator); - } - if (this.optionsStore.input.value != newValue) - this.optionsStore.input.value = newValue; - } - /** - * Attempts to either clear or set the `target` date at `index`. - * If the `target` is null then the date will be cleared. - * If multi-date is being used then it will be removed from the array. - * If `target` is valid and multi-date is used then if `index` is - * provided the date at that index will be replaced, otherwise it is appended. - * @param target - * @param index - */ - setValue(target, index) { - const noIndex = typeof index === 'undefined', isClear = !target && noIndex; - let oldDate = this.optionsStore.unset ? null : this._dates[index]?.clone; - if (!oldDate && !this.optionsStore.unset && noIndex && isClear) { - oldDate = this.lastPicked; - } - if (target && oldDate?.isSame(target)) { - this.updateInput(target); - return; - } - // case of calling setValue(null) - if (!target) { - this._setValueNull(isClear, index, oldDate); - return; - } - index = index || 0; - target = target.clone; - // minute stepping is being used, force the minute to the closest value - if (this.optionsStore.options.stepping !== 1) { - target.minutes = - Math.round(target.minutes / this.optionsStore.options.stepping) * - this.optionsStore.options.stepping; - target.startOf(exports.Unit.minutes); - } - const onUpdate = (isValid) => { - this._dates[index] = target; - this._eventEmitters.updateViewDate.emit(target.clone); - this.updateInput(target); - this.optionsStore.unset = false; - this._eventEmitters.updateDisplay.emit('all'); - this._eventEmitters.triggerEvent.emit({ - type: Namespace.events.change, - date: target, - oldDate, - isClear, - isValid: isValid, - }); - }; - if (this.validation.isValid(target) && - this.validation.dateRangeIsValid(this.picked, index, target)) { - onUpdate(true); - return; - } - if (this.optionsStore.options.keepInvalid) { - onUpdate(false); - } - this._eventEmitters.triggerEvent.emit({ - type: Namespace.events.error, - reason: Namespace.errorMessages.failedToSetInvalidDate, - date: target, - oldDate, - }); - } - _setValueNull(isClear, index, oldDate) { - if (!this.optionsStore.options.multipleDates || - this._dates.length === 1 || - isClear) { - this.optionsStore.unset = true; - this._dates = []; - } - else { - this._dates.splice(index, 1); - } - this.updateInput(); - this._eventEmitters.triggerEvent.emit({ - type: Namespace.events.change, - date: undefined, - oldDate, - isClear, - isValid: true, - }); - this._eventEmitters.updateDisplay.emit('all'); - } - } - - var ActionTypes; - (function (ActionTypes) { - ActionTypes["next"] = "next"; - ActionTypes["previous"] = "previous"; - ActionTypes["changeCalendarView"] = "changeCalendarView"; - ActionTypes["selectMonth"] = "selectMonth"; - ActionTypes["selectYear"] = "selectYear"; - ActionTypes["selectDecade"] = "selectDecade"; - ActionTypes["selectDay"] = "selectDay"; - ActionTypes["selectHour"] = "selectHour"; - ActionTypes["selectMinute"] = "selectMinute"; - ActionTypes["selectSecond"] = "selectSecond"; - ActionTypes["incrementHours"] = "incrementHours"; - ActionTypes["incrementMinutes"] = "incrementMinutes"; - ActionTypes["incrementSeconds"] = "incrementSeconds"; - ActionTypes["decrementHours"] = "decrementHours"; - ActionTypes["decrementMinutes"] = "decrementMinutes"; - ActionTypes["decrementSeconds"] = "decrementSeconds"; - ActionTypes["toggleMeridiem"] = "toggleMeridiem"; - ActionTypes["togglePicker"] = "togglePicker"; - ActionTypes["showClock"] = "showClock"; - ActionTypes["showHours"] = "showHours"; - ActionTypes["showMinutes"] = "showMinutes"; - ActionTypes["showSeconds"] = "showSeconds"; - ActionTypes["clear"] = "clear"; - ActionTypes["close"] = "close"; - ActionTypes["today"] = "today"; - })(ActionTypes || (ActionTypes = {})); - var ActionTypes$1 = ActionTypes; - - /** - * Creates and updates the grid for `date` - */ - class DateDisplay { - constructor() { - this.optionsStore = serviceLocator.locate(OptionsStore); - this.dates = serviceLocator.locate(Dates); - this.validation = serviceLocator.locate(Validation); - } - /** - * Build the container html for the display - * @private - */ - getPicker() { - const container = document.createElement('div'); - container.classList.add(Namespace.css.daysContainer); - container.append(...this._daysOfTheWeek()); - if (this.optionsStore.options.display.calendarWeeks) { - const div = document.createElement('div'); - div.classList.add(Namespace.css.calendarWeeks, Namespace.css.noHighlight); - container.appendChild(div); - } - const { rangeHoverEvent, rangeHoverOutEvent } = this.handleMouseEvents(container); - for (let i = 0; i < 42; i++) { - if (i !== 0 && i % 7 === 0) { - if (this.optionsStore.options.display.calendarWeeks) { - const div = document.createElement('div'); - div.classList.add(Namespace.css.calendarWeeks, Namespace.css.noHighlight); - container.appendChild(div); - } - } - const div = document.createElement('div'); - div.setAttribute('data-action', ActionTypes$1.selectDay); - container.appendChild(div); - // if hover is supported then add the events - if (matchMedia('(hover: hover)').matches && - this.optionsStore.options.dateRange) { - div.addEventListener('mouseover', rangeHoverEvent); - div.addEventListener('mouseout', rangeHoverOutEvent); - } - } - return container; - } - /** - * Populates the grid and updates enabled states - * @private - */ - _update(widget, paint) { - const container = widget.getElementsByClassName(Namespace.css.daysContainer)[0]; - this._updateCalendarView(container); - const innerDate = this.optionsStore.viewDate.clone - .startOf(exports.Unit.month) - .startOf('weekDay', this.optionsStore.options.localization.startOfTheWeek) - .manipulate(12, exports.Unit.hours); - this._handleCalendarWeeks(container, innerDate.clone); - container - .querySelectorAll(`[data-action="${ActionTypes$1.selectDay}"]`) - .forEach((element) => { - const classes = []; - classes.push(Namespace.css.day); - if (innerDate.isBefore(this.optionsStore.viewDate, exports.Unit.month)) { - classes.push(Namespace.css.old); - } - if (innerDate.isAfter(this.optionsStore.viewDate, exports.Unit.month)) { - classes.push(Namespace.css.new); - } - if (!this.optionsStore.unset && - !this.optionsStore.options.dateRange && - this.dates.isPicked(innerDate, exports.Unit.date)) { - classes.push(Namespace.css.active); - } - if (!this.validation.isValid(innerDate, exports.Unit.date)) { - classes.push(Namespace.css.disabled); - } - if (innerDate.isSame(new DateTime(), exports.Unit.date)) { - classes.push(Namespace.css.today); - } - if (innerDate.weekDay === 0 || innerDate.weekDay === 6) { - classes.push(Namespace.css.weekend); - } - this._handleDateRange(innerDate, classes); - paint(exports.Unit.date, innerDate, classes, element); - element.classList.remove(...element.classList); - element.classList.add(...classes); - element.setAttribute('data-value', this._dateToDataValue(innerDate)); - element.setAttribute('data-day', `${innerDate.date}`); - element.innerText = innerDate.parts(undefined, { - day: 'numeric', - }).day; - innerDate.manipulate(1, exports.Unit.date); - }); - } - _dateToDataValue(date) { - if (!DateTime.isValid(date)) - return ''; - return `${date.year}-${date.monthFormatted}-${date.dateFormatted}`; - } - _handleDateRange(innerDate, classes) { - const rangeStart = this.dates.picked[0]; - const rangeEnd = this.dates.picked[1]; - if (this.optionsStore.options.dateRange) { - if (innerDate.isBetween(rangeStart, rangeEnd, exports.Unit.date)) { - classes.push(Namespace.css.rangeIn); - } - if (innerDate.isSame(rangeStart, exports.Unit.date)) { - classes.push(Namespace.css.rangeStart); - } - if (innerDate.isSame(rangeEnd, exports.Unit.date)) { - classes.push(Namespace.css.rangeEnd); - } - } - } - handleMouseEvents(container) { - const rangeHoverEvent = (e) => { - const currentTarget = e?.currentTarget; - // if we have 0 or 2 selected or if the target is disabled then ignore - if (this.dates.picked.length !== 1 || - currentTarget.classList.contains(Namespace.css.disabled)) - return; - // select all the date divs - const allDays = [...container.querySelectorAll('.day')]; - // get the date value from the element being hovered over - const attributeValue = currentTarget.getAttribute('data-value'); - // format the string to a date - const innerDate = DateTime.fromString(attributeValue, { - format: 'yyyy-MM-dd', - }); - // find the position of the target in the date container - const dayIndex = allDays.findIndex((e) => e.getAttribute('data-value') === attributeValue); - // find the first and second selected dates - const rangeStart = this.dates.picked[0]; - const rangeEnd = this.dates.picked[1]; - //format the start date so that it can be found by the attribute - const rangeStartFormatted = this._dateToDataValue(rangeStart); - const rangeStartIndex = allDays.findIndex((e) => e.getAttribute('data-value') === rangeStartFormatted); - const rangeStartElement = allDays[rangeStartIndex]; - //make sure we don't leave start/end classes if we don't need them - if (!innerDate.isSame(rangeStart, exports.Unit.date)) { - currentTarget.classList.remove(Namespace.css.rangeStart); - } - if (!innerDate.isSame(rangeEnd, exports.Unit.date)) { - currentTarget.classList.remove(Namespace.css.rangeEnd); - } - // the following figures out which direct from start date is selected - // the selection "cap" classes are applied if needed - // otherwise all the dates between will get the `rangeIn` class. - // We make this selection based on the element's index and the rangeStart index - let lambda; - if (innerDate.isBefore(rangeStart)) { - currentTarget.classList.add(Namespace.css.rangeStart); - rangeStartElement?.classList.remove(Namespace.css.rangeStart); - rangeStartElement?.classList.add(Namespace.css.rangeEnd); - lambda = (_, index) => index > dayIndex && index < rangeStartIndex; - } - else { - currentTarget.classList.add(Namespace.css.rangeEnd); - rangeStartElement?.classList.remove(Namespace.css.rangeEnd); - rangeStartElement?.classList.add(Namespace.css.rangeStart); - lambda = (_, index) => index < dayIndex && index > rangeStartIndex; - } - allDays.filter(lambda).forEach((e) => { - e.classList.add(Namespace.css.rangeIn); - }); - }; - const rangeHoverOutEvent = (e) => { - // find all the dates in the container - const allDays = [...container.querySelectorAll('.day')]; - // if only the start is selected, remove all the rangeIn classes - // we do this because once the user hovers over a new date the range will be recalculated. - if (this.dates.picked.length === 1) - allDays.forEach((e) => e.classList.remove(Namespace.css.rangeIn)); - // if we have 0 or 2 dates selected then ignore - if (this.dates.picked.length !== 1) - return; - const currentTarget = e?.currentTarget; - // get the elements date from the attribute value - const innerDate = new DateTime(currentTarget.getAttribute('data-value')); - // verify selections and remove invalid classes - if (!innerDate.isSame(this.dates.picked[0], exports.Unit.date)) { - currentTarget.classList.remove(Namespace.css.rangeStart); - } - if (!innerDate.isSame(this.dates.picked[1], exports.Unit.date)) { - currentTarget.classList.remove(Namespace.css.rangeEnd); - } - }; - return { rangeHoverEvent, rangeHoverOutEvent }; - } - _updateCalendarView(container) { - if (this.optionsStore.currentView !== 'calendar') - return; - const [previous, switcher, next] = container.parentElement - .getElementsByClassName(Namespace.css.calendarHeader)[0] - .getElementsByTagName('div'); - switcher.setAttribute(Namespace.css.daysContainer, this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat)); - this.optionsStore.options.display.components.month - ? switcher.classList.remove(Namespace.css.disabled) - : switcher.classList.add(Namespace.css.disabled); - this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1, exports.Unit.month), exports.Unit.month) - ? previous.classList.remove(Namespace.css.disabled) - : previous.classList.add(Namespace.css.disabled); - this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1, exports.Unit.month), exports.Unit.month) - ? next.classList.remove(Namespace.css.disabled) - : next.classList.add(Namespace.css.disabled); - } - /*** - * Generates a html row that contains the days of the week. - * @private - */ - _daysOfTheWeek() { - const innerDate = this.optionsStore.viewDate.clone - .startOf('weekDay', this.optionsStore.options.localization.startOfTheWeek) - .startOf(exports.Unit.date); - const row = []; - document.createElement('div'); - if (this.optionsStore.options.display.calendarWeeks) { - const htmlDivElement = document.createElement('div'); - htmlDivElement.classList.add(Namespace.css.calendarWeeks, Namespace.css.noHighlight); - htmlDivElement.innerText = '#'; - row.push(htmlDivElement); - } - for (let i = 0; i < 7; i++) { - const htmlDivElement = document.createElement('div'); - htmlDivElement.classList.add(Namespace.css.dayOfTheWeek, Namespace.css.noHighlight); - let weekDay = innerDate.format({ weekday: 'short' }); - if (this.optionsStore.options.localization.maxWeekdayLength > 0) - weekDay = weekDay.substring(0, this.optionsStore.options.localization.maxWeekdayLength); - htmlDivElement.innerText = weekDay; - innerDate.manipulate(1, exports.Unit.date); - row.push(htmlDivElement); - } - return row; - } - _handleCalendarWeeks(container, innerDate) { - [...container.querySelectorAll(`.${Namespace.css.calendarWeeks}`)] - .filter((e) => e.innerText !== '#') - .forEach((element) => { - element.innerText = `${innerDate.week}`; - innerDate.manipulate(7, exports.Unit.date); - }); - } - } - - /** - * Creates and updates the grid for `month` - */ - class MonthDisplay { - constructor() { - this.optionsStore = serviceLocator.locate(OptionsStore); - this.dates = serviceLocator.locate(Dates); - this.validation = serviceLocator.locate(Validation); - } - /** - * Build the container html for the display - * @private - */ - getPicker() { - const container = document.createElement('div'); - container.classList.add(Namespace.css.monthsContainer); - for (let i = 0; i < 12; i++) { - const div = document.createElement('div'); - div.setAttribute('data-action', ActionTypes$1.selectMonth); - container.appendChild(div); - } - return container; - } - /** - * Populates the grid and updates enabled states - * @private - */ - _update(widget, paint) { - const container = widget.getElementsByClassName(Namespace.css.monthsContainer)[0]; - if (this.optionsStore.currentView === 'months') { - const [previous, switcher, next] = container.parentElement - .getElementsByClassName(Namespace.css.calendarHeader)[0] - .getElementsByTagName('div'); - switcher.setAttribute(Namespace.css.monthsContainer, this.optionsStore.viewDate.format({ year: 'numeric' })); - this.optionsStore.options.display.components.year - ? switcher.classList.remove(Namespace.css.disabled) - : switcher.classList.add(Namespace.css.disabled); - this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1, exports.Unit.year), exports.Unit.year) - ? previous.classList.remove(Namespace.css.disabled) - : previous.classList.add(Namespace.css.disabled); - this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1, exports.Unit.year), exports.Unit.year) - ? next.classList.remove(Namespace.css.disabled) - : next.classList.add(Namespace.css.disabled); - } - const innerDate = this.optionsStore.viewDate.clone.startOf(exports.Unit.year); - container - .querySelectorAll(`[data-action="${ActionTypes$1.selectMonth}"]`) - .forEach((containerClone, index) => { - const classes = []; - classes.push(Namespace.css.month); - if (!this.optionsStore.unset && - this.dates.isPicked(innerDate, exports.Unit.month)) { - classes.push(Namespace.css.active); - } - if (!this.validation.isValid(innerDate, exports.Unit.month)) { - classes.push(Namespace.css.disabled); - } - paint(exports.Unit.month, innerDate, classes, containerClone); - containerClone.classList.remove(...containerClone.classList); - containerClone.classList.add(...classes); - containerClone.setAttribute('data-value', `${index}`); - containerClone.innerText = `${innerDate.format({ month: 'short' })}`; - innerDate.manipulate(1, exports.Unit.month); - }); - } - } - - /** - * Creates and updates the grid for `year` - */ - class YearDisplay { - constructor() { - this.optionsStore = serviceLocator.locate(OptionsStore); - this.dates = serviceLocator.locate(Dates); - this.validation = serviceLocator.locate(Validation); - } - /** - * Build the container html for the display - * @private - */ - getPicker() { - const container = document.createElement('div'); - container.classList.add(Namespace.css.yearsContainer); - for (let i = 0; i < 12; i++) { - const div = document.createElement('div'); - div.setAttribute('data-action', ActionTypes$1.selectYear); - container.appendChild(div); - } - return container; - } - /** - * Populates the grid and updates enabled states - * @private - */ - _update(widget, paint) { - this._startYear = this.optionsStore.viewDate.clone.manipulate(-1, exports.Unit.year); - this._endYear = this.optionsStore.viewDate.clone.manipulate(10, exports.Unit.year); - const container = widget.getElementsByClassName(Namespace.css.yearsContainer)[0]; - if (this.optionsStore.currentView === 'years') { - const [previous, switcher, next] = container.parentElement - .getElementsByClassName(Namespace.css.calendarHeader)[0] - .getElementsByTagName('div'); - switcher.setAttribute(Namespace.css.yearsContainer, `${this._startYear.format({ year: 'numeric' })}-${this._endYear.format({ - year: 'numeric', - })}`); - this.optionsStore.options.display.components.decades - ? switcher.classList.remove(Namespace.css.disabled) - : switcher.classList.add(Namespace.css.disabled); - this.validation.isValid(this._startYear, exports.Unit.year) - ? previous.classList.remove(Namespace.css.disabled) - : previous.classList.add(Namespace.css.disabled); - this.validation.isValid(this._endYear, exports.Unit.year) - ? next.classList.remove(Namespace.css.disabled) - : next.classList.add(Namespace.css.disabled); - } - const innerDate = this.optionsStore.viewDate.clone - .startOf(exports.Unit.year) - .manipulate(-1, exports.Unit.year); - container - .querySelectorAll(`[data-action="${ActionTypes$1.selectYear}"]`) - .forEach((containerClone) => { - const classes = []; - classes.push(Namespace.css.year); - if (!this.optionsStore.unset && - this.dates.isPicked(innerDate, exports.Unit.year)) { - classes.push(Namespace.css.active); - } - if (!this.validation.isValid(innerDate, exports.Unit.year)) { - classes.push(Namespace.css.disabled); - } - paint(exports.Unit.year, innerDate, classes, containerClone); - containerClone.classList.remove(...containerClone.classList); - containerClone.classList.add(...classes); - containerClone.setAttribute('data-value', `${innerDate.year}`); - containerClone.innerText = innerDate.format({ year: 'numeric' }); - innerDate.manipulate(1, exports.Unit.year); - }); - } - } - - /** - * Creates and updates the grid for `seconds` - */ - class DecadeDisplay { - constructor() { - this.optionsStore = serviceLocator.locate(OptionsStore); - this.dates = serviceLocator.locate(Dates); - this.validation = serviceLocator.locate(Validation); - } - /** - * Build the container html for the display - * @private - */ - getPicker() { - const container = document.createElement('div'); - container.classList.add(Namespace.css.decadesContainer); - for (let i = 0; i < 12; i++) { - const div = document.createElement('div'); - div.setAttribute('data-action', ActionTypes$1.selectDecade); - container.appendChild(div); - } - return container; - } - /** - * Populates the grid and updates enabled states - * @private - */ - _update(widget, paint) { - const [start, end] = Dates.getStartEndYear(100, this.optionsStore.viewDate.year); - this._startDecade = this.optionsStore.viewDate.clone.startOf(exports.Unit.year); - this._startDecade.year = start; - this._endDecade = this.optionsStore.viewDate.clone.startOf(exports.Unit.year); - this._endDecade.year = end; - const container = widget.getElementsByClassName(Namespace.css.decadesContainer)[0]; - const [previous, switcher, next] = container.parentElement - .getElementsByClassName(Namespace.css.calendarHeader)[0] - .getElementsByTagName('div'); - if (this.optionsStore.currentView === 'decades') { - switcher.setAttribute(Namespace.css.decadesContainer, `${this._startDecade.format({ - year: 'numeric', - })}-${this._endDecade.format({ year: 'numeric' })}`); - this.validation.isValid(this._startDecade, exports.Unit.year) - ? previous.classList.remove(Namespace.css.disabled) - : previous.classList.add(Namespace.css.disabled); - this.validation.isValid(this._endDecade, exports.Unit.year) - ? next.classList.remove(Namespace.css.disabled) - : next.classList.add(Namespace.css.disabled); - } - const pickedYears = this.dates.picked.map((x) => x.year); - container - .querySelectorAll(`[data-action="${ActionTypes$1.selectDecade}"]`) - .forEach((containerClone, index) => { - if (index === 0) { - containerClone.classList.add(Namespace.css.old); - if (this._startDecade.year - 10 < 0) { - containerClone.textContent = ' '; - previous.classList.add(Namespace.css.disabled); - containerClone.classList.add(Namespace.css.disabled); - containerClone.setAttribute('data-value', ''); - return; - } - else { - containerClone.innerText = this._startDecade.clone - .manipulate(-10, exports.Unit.year) - .format({ year: 'numeric' }); - containerClone.setAttribute('data-value', `${this._startDecade.year}`); - return; - } - } - const classes = []; - classes.push(Namespace.css.decade); - const startDecadeYear = this._startDecade.year; - const endDecadeYear = this._startDecade.year + 9; - if (!this.optionsStore.unset && - pickedYears.filter((x) => x >= startDecadeYear && x <= endDecadeYear) - .length > 0) { - classes.push(Namespace.css.active); - } - paint('decade', this._startDecade, classes, containerClone); - containerClone.classList.remove(...containerClone.classList); - containerClone.classList.add(...classes); - containerClone.setAttribute('data-value', `${this._startDecade.year}`); - containerClone.innerText = `${this._startDecade.format({ - year: 'numeric', - })}`; - this._startDecade.manipulate(10, exports.Unit.year); - }); - } - } - - /** - * Creates the clock display - */ - class TimeDisplay { - constructor() { - this._gridColumns = ''; - this.optionsStore = serviceLocator.locate(OptionsStore); - this.dates = serviceLocator.locate(Dates); - this.validation = serviceLocator.locate(Validation); - } - /** - * Build the container html for the clock display - * @private - */ - getPicker(iconTag) { - const container = document.createElement('div'); - container.classList.add(Namespace.css.clockContainer); - container.append(...this._grid(iconTag)); - return container; - } - /** - * Populates the various elements with in the clock display - * like the current hour and if the manipulation icons are enabled. - * @private - */ - _update(widget) { - const timesDiv = (widget.getElementsByClassName(Namespace.css.clockContainer)[0]); - let lastPicked = this.dates.lastPicked?.clone; - if (!lastPicked && this.optionsStore.options.useCurrent) - lastPicked = this.optionsStore.viewDate.clone; - timesDiv - .querySelectorAll('.disabled') - .forEach((element) => element.classList.remove(Namespace.css.disabled)); - if (this.optionsStore.options.display.components.hours) { - if (!this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1, exports.Unit.hours), exports.Unit.hours)) { - timesDiv - .querySelector(`[data-action=${ActionTypes$1.incrementHours}]`) - .classList.add(Namespace.css.disabled); - } - if (!this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1, exports.Unit.hours), exports.Unit.hours)) { - timesDiv - .querySelector(`[data-action=${ActionTypes$1.decrementHours}]`) - .classList.add(Namespace.css.disabled); - } - timesDiv.querySelector(`[data-time-component=${exports.Unit.hours}]`).innerText = lastPicked - ? lastPicked.getHoursFormatted(this.optionsStore.options.localization.hourCycle) - : '--'; - } - if (this.optionsStore.options.display.components.minutes) { - if (!this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1, exports.Unit.minutes), exports.Unit.minutes)) { - timesDiv - .querySelector(`[data-action=${ActionTypes$1.incrementMinutes}]`) - .classList.add(Namespace.css.disabled); - } - if (!this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1, exports.Unit.minutes), exports.Unit.minutes)) { - timesDiv - .querySelector(`[data-action=${ActionTypes$1.decrementMinutes}]`) - .classList.add(Namespace.css.disabled); - } - timesDiv.querySelector(`[data-time-component=${exports.Unit.minutes}]`).innerText = lastPicked ? lastPicked.minutesFormatted : '--'; - } - if (this.optionsStore.options.display.components.seconds) { - if (!this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1, exports.Unit.seconds), exports.Unit.seconds)) { - timesDiv - .querySelector(`[data-action=${ActionTypes$1.incrementSeconds}]`) - .classList.add(Namespace.css.disabled); - } - if (!this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1, exports.Unit.seconds), exports.Unit.seconds)) { - timesDiv - .querySelector(`[data-action=${ActionTypes$1.decrementSeconds}]`) - .classList.add(Namespace.css.disabled); - } - timesDiv.querySelector(`[data-time-component=${exports.Unit.seconds}]`).innerText = lastPicked ? lastPicked.secondsFormatted : '--'; - } - if (this.optionsStore.isTwelveHour) { - const toggle = timesDiv.querySelector(`[data-action=${ActionTypes$1.toggleMeridiem}]`); - const meridiemDate = (lastPicked || this.optionsStore.viewDate).clone; - toggle.innerText = meridiemDate.meridiem(); - if (!this.validation.isValid(meridiemDate.manipulate(meridiemDate.hours >= 12 ? -12 : 12, exports.Unit.hours))) { - toggle.classList.add(Namespace.css.disabled); - } - else { - toggle.classList.remove(Namespace.css.disabled); - } - } - timesDiv.style.gridTemplateAreas = `"${this._gridColumns}"`; - } - /** - * Creates the table for the clock display depending on what options are selected. - * @private - */ - _grid(iconTag) { - this._gridColumns = ''; - const top = [], middle = [], bottom = [], separator = document.createElement('div'), upIcon = iconTag(this.optionsStore.options.display.icons.up), downIcon = iconTag(this.optionsStore.options.display.icons.down); - separator.classList.add(Namespace.css.separator, Namespace.css.noHighlight); - const separatorColon = separator.cloneNode(true); - separatorColon.innerHTML = ':'; - const getSeparator = (colon = false) => { - return colon - ? separatorColon.cloneNode(true) - : separator.cloneNode(true); - }; - if (this.optionsStore.options.display.components.hours) { - let divElement = document.createElement('div'); - divElement.setAttribute('title', this.optionsStore.options.localization.incrementHour); - divElement.setAttribute('data-action', ActionTypes$1.incrementHours); - divElement.appendChild(upIcon.cloneNode(true)); - top.push(divElement); - divElement = document.createElement('div'); - divElement.setAttribute('title', this.optionsStore.options.localization.pickHour); - divElement.setAttribute('data-action', ActionTypes$1.showHours); - divElement.setAttribute('data-time-component', exports.Unit.hours); - middle.push(divElement); - divElement = document.createElement('div'); - divElement.setAttribute('title', this.optionsStore.options.localization.decrementHour); - divElement.setAttribute('data-action', ActionTypes$1.decrementHours); - divElement.appendChild(downIcon.cloneNode(true)); - bottom.push(divElement); - this._gridColumns += 'a'; - } - if (this.optionsStore.options.display.components.minutes) { - this._gridColumns += ' a'; - if (this.optionsStore.options.display.components.hours) { - top.push(getSeparator()); - middle.push(getSeparator(true)); - bottom.push(getSeparator()); - this._gridColumns += ' a'; - } - let divElement = document.createElement('div'); - divElement.setAttribute('title', this.optionsStore.options.localization.incrementMinute); - divElement.setAttribute('data-action', ActionTypes$1.incrementMinutes); - divElement.appendChild(upIcon.cloneNode(true)); - top.push(divElement); - divElement = document.createElement('div'); - divElement.setAttribute('title', this.optionsStore.options.localization.pickMinute); - divElement.setAttribute('data-action', ActionTypes$1.showMinutes); - divElement.setAttribute('data-time-component', exports.Unit.minutes); - middle.push(divElement); - divElement = document.createElement('div'); - divElement.setAttribute('title', this.optionsStore.options.localization.decrementMinute); - divElement.setAttribute('data-action', ActionTypes$1.decrementMinutes); - divElement.appendChild(downIcon.cloneNode(true)); - bottom.push(divElement); - } - if (this.optionsStore.options.display.components.seconds) { - this._gridColumns += ' a'; - if (this.optionsStore.options.display.components.minutes) { - top.push(getSeparator()); - middle.push(getSeparator(true)); - bottom.push(getSeparator()); - this._gridColumns += ' a'; - } - let divElement = document.createElement('div'); - divElement.setAttribute('title', this.optionsStore.options.localization.incrementSecond); - divElement.setAttribute('data-action', ActionTypes$1.incrementSeconds); - divElement.appendChild(upIcon.cloneNode(true)); - top.push(divElement); - divElement = document.createElement('div'); - divElement.setAttribute('title', this.optionsStore.options.localization.pickSecond); - divElement.setAttribute('data-action', ActionTypes$1.showSeconds); - divElement.setAttribute('data-time-component', exports.Unit.seconds); - middle.push(divElement); - divElement = document.createElement('div'); - divElement.setAttribute('title', this.optionsStore.options.localization.decrementSecond); - divElement.setAttribute('data-action', ActionTypes$1.decrementSeconds); - divElement.appendChild(downIcon.cloneNode(true)); - bottom.push(divElement); - } - if (this.optionsStore.isTwelveHour) { - this._gridColumns += ' a'; - let divElement = getSeparator(); - top.push(divElement); - const button = document.createElement('button'); - button.setAttribute('type', 'button'); - button.setAttribute('title', this.optionsStore.options.localization.toggleMeridiem); - button.setAttribute('data-action', ActionTypes$1.toggleMeridiem); - button.setAttribute('tabindex', '-1'); - if (Namespace.css.toggleMeridiem.includes(',')) { - //todo move this to paint function? - button.classList.add(...Namespace.css.toggleMeridiem.split(',')); - } - else - button.classList.add(Namespace.css.toggleMeridiem); - divElement = document.createElement('div'); - divElement.classList.add(Namespace.css.noHighlight); - divElement.appendChild(button); - middle.push(divElement); - divElement = getSeparator(); - bottom.push(divElement); - } - this._gridColumns = this._gridColumns.trim(); - return [...top, ...middle, ...bottom]; - } - } - - /** - * Creates and updates the grid for `hours` - */ - class HourDisplay { - constructor() { - this.optionsStore = serviceLocator.locate(OptionsStore); - this.validation = serviceLocator.locate(Validation); - } - /** - * Build the container html for the display - * @private - */ - getPicker() { - const container = document.createElement('div'); - container.classList.add(Namespace.css.hourContainer); - for (let i = 0; i < (this.optionsStore.isTwelveHour ? 12 : 24); i++) { - const div = document.createElement('div'); - div.setAttribute('data-action', ActionTypes$1.selectHour); - container.appendChild(div); - } - return container; - } - /** - * Populates the grid and updates enabled states - * @private - */ - _update(widget, paint) { - const container = widget.getElementsByClassName(Namespace.css.hourContainer)[0]; - const innerDate = this.optionsStore.viewDate.clone.startOf(exports.Unit.date); - container - .querySelectorAll(`[data-action="${ActionTypes$1.selectHour}"]`) - .forEach((containerClone) => { - const classes = []; - classes.push(Namespace.css.hour); - if (!this.validation.isValid(innerDate, exports.Unit.hours)) { - classes.push(Namespace.css.disabled); - } - paint(exports.Unit.hours, innerDate, classes, containerClone); - containerClone.classList.remove(...containerClone.classList); - containerClone.classList.add(...classes); - containerClone.setAttribute('data-value', `${innerDate.hours}`); - containerClone.innerText = innerDate.getHoursFormatted(this.optionsStore.options.localization.hourCycle); - innerDate.manipulate(1, exports.Unit.hours); - }); - } - } - - /** - * Creates and updates the grid for `minutes` - */ - class MinuteDisplay { - constructor() { - this.optionsStore = serviceLocator.locate(OptionsStore); - this.validation = serviceLocator.locate(Validation); - } - /** - * Build the container html for the display - * @private - */ - getPicker() { - const container = document.createElement('div'); - container.classList.add(Namespace.css.minuteContainer); - const step = this.optionsStore.options.stepping === 1 - ? 5 - : this.optionsStore.options.stepping; - for (let i = 0; i < 60 / step; i++) { - const div = document.createElement('div'); - div.setAttribute('data-action', ActionTypes$1.selectMinute); - container.appendChild(div); - } - return container; - } - /** - * Populates the grid and updates enabled states - * @private - */ - _update(widget, paint) { - const container = widget.getElementsByClassName(Namespace.css.minuteContainer)[0]; - const innerDate = this.optionsStore.viewDate.clone.startOf(exports.Unit.hours); - const step = this.optionsStore.options.stepping === 1 - ? 5 - : this.optionsStore.options.stepping; - container - .querySelectorAll(`[data-action="${ActionTypes$1.selectMinute}"]`) - .forEach((containerClone) => { - const classes = []; - classes.push(Namespace.css.minute); - if (!this.validation.isValid(innerDate, exports.Unit.minutes)) { - classes.push(Namespace.css.disabled); - } - paint(exports.Unit.minutes, innerDate, classes, containerClone); - containerClone.classList.remove(...containerClone.classList); - containerClone.classList.add(...classes); - containerClone.setAttribute('data-value', `${innerDate.minutes}`); - containerClone.innerText = innerDate.minutesFormatted; - innerDate.manipulate(step, exports.Unit.minutes); - }); - } - } - - /** - * Creates and updates the grid for `seconds` - */ - class secondDisplay { - constructor() { - this.optionsStore = serviceLocator.locate(OptionsStore); - this.validation = serviceLocator.locate(Validation); - } - /** - * Build the container html for the display - * @private - */ - getPicker() { - const container = document.createElement('div'); - container.classList.add(Namespace.css.secondContainer); - for (let i = 0; i < 12; i++) { - const div = document.createElement('div'); - div.setAttribute('data-action', ActionTypes$1.selectSecond); - container.appendChild(div); - } - return container; - } - /** - * Populates the grid and updates enabled states - * @private - */ - _update(widget, paint) { - const container = widget.getElementsByClassName(Namespace.css.secondContainer)[0]; - const innerDate = this.optionsStore.viewDate.clone.startOf(exports.Unit.minutes); - container - .querySelectorAll(`[data-action="${ActionTypes$1.selectSecond}"]`) - .forEach((containerClone) => { - const classes = []; - classes.push(Namespace.css.second); - if (!this.validation.isValid(innerDate, exports.Unit.seconds)) { - classes.push(Namespace.css.disabled); - } - paint(exports.Unit.seconds, innerDate, classes, containerClone); - containerClone.classList.remove(...containerClone.classList); - containerClone.classList.add(...classes); - containerClone.setAttribute('data-value', `${innerDate.seconds}`); - containerClone.innerText = innerDate.secondsFormatted; - innerDate.manipulate(5, exports.Unit.seconds); - }); - } - } - - /** - * Provides a collapse functionality to the view changes - */ - class Collapse { - /** - * Flips the show/hide state of `target` - * @param target html element to affect. - */ - static toggle(target) { - if (target.classList.contains(Namespace.css.show)) { - this.hide(target); - } - else { - this.show(target); - } - } - /** - * Skips any animation or timeouts and immediately set the element to show. - * @param target - */ - static showImmediately(target) { - target.classList.remove(Namespace.css.collapsing); - target.classList.add(Namespace.css.collapse, Namespace.css.show); - target.style.height = ''; - } - /** - * If `target` is not already showing, then show after the animation. - * @param target - */ - static show(target) { - if (target.classList.contains(Namespace.css.collapsing) || - target.classList.contains(Namespace.css.show)) - return; - const complete = () => { - Collapse.showImmediately(target); - }; - target.style.height = '0'; - target.classList.remove(Namespace.css.collapse); - target.classList.add(Namespace.css.collapsing); - //eslint-disable-next-line @typescript-eslint/no-unused-vars - setTimeout(complete, this.getTransitionDurationFromElement(target)); - target.style.height = `${target.scrollHeight}px`; - } - /** - * Skips any animation or timeouts and immediately set the element to hide. - * @param target - */ - static hideImmediately(target) { - if (!target) - return; - target.classList.remove(Namespace.css.collapsing, Namespace.css.show); - target.classList.add(Namespace.css.collapse); - } - /** - * If `target` is not already hidden, then hide after the animation. - * @param target HTML Element - */ - static hide(target) { - if (target.classList.contains(Namespace.css.collapsing) || - !target.classList.contains(Namespace.css.show)) - return; - const complete = () => { - Collapse.hideImmediately(target); - }; - target.style.height = `${target.getBoundingClientRect()['height']}px`; - const reflow = (element) => element.offsetHeight; - reflow(target); - target.classList.remove(Namespace.css.collapse, Namespace.css.show); - target.classList.add(Namespace.css.collapsing); - target.style.height = ''; - //eslint-disable-next-line @typescript-eslint/no-unused-vars - setTimeout(complete, this.getTransitionDurationFromElement(target)); - } - } - /** - * Gets the transition duration from the `element` by getting css properties - * `transition-duration` and `transition-delay` - * @param element HTML Element - */ - Collapse.getTransitionDurationFromElement = (element) => { - if (!element) { - return 0; - } - // Get transition-duration of the element - let { transitionDuration, transitionDelay } = window.getComputedStyle(element); - const floatTransitionDuration = Number.parseFloat(transitionDuration); - const floatTransitionDelay = Number.parseFloat(transitionDelay); - // Return 0 if element or transition duration is not found - if (!floatTransitionDuration && !floatTransitionDelay) { - return 0; - } - // If multiple durations are defined, take the first - transitionDuration = transitionDuration.split(',')[0]; - transitionDelay = transitionDelay.split(',')[0]; - return ((Number.parseFloat(transitionDuration) + - Number.parseFloat(transitionDelay)) * - 1000); - }; - - /** - * Main class for all things display related. - */ - class Display { - constructor() { - this._isVisible = false; - /** - * A document click event to hide the widget if click is outside - * @private - * @param e MouseEvent - */ - this._documentClickEvent = (e) => { - if (this.optionsStore.options.debug || window.debug) - return; //eslint-disable-line @typescript-eslint/no-explicit-any - if (this._isVisible && - !e.composedPath().includes(this.widget) && // click inside the widget - !e.composedPath()?.includes(this.optionsStore.element) // click on the element - ) { - this.hide(); - } - }; - /** - * Click event for any action like selecting a date - * @param e MouseEvent - * @private - */ - this._actionsClickEvent = (e) => { - this._eventEmitters.action.emit({ e: e }); - }; - this.optionsStore = serviceLocator.locate(OptionsStore); - this.validation = serviceLocator.locate(Validation); - this.dates = serviceLocator.locate(Dates); - this.dateDisplay = serviceLocator.locate(DateDisplay); - this.monthDisplay = serviceLocator.locate(MonthDisplay); - this.yearDisplay = serviceLocator.locate(YearDisplay); - this.decadeDisplay = serviceLocator.locate(DecadeDisplay); - this.timeDisplay = serviceLocator.locate(TimeDisplay); - this.hourDisplay = serviceLocator.locate(HourDisplay); - this.minuteDisplay = serviceLocator.locate(MinuteDisplay); - this.secondDisplay = serviceLocator.locate(secondDisplay); - this._eventEmitters = serviceLocator.locate(EventEmitters); - this._widget = undefined; - this._eventEmitters.updateDisplay.subscribe((result) => { - this._update(result); - }); - } - /** - * Returns the widget body or undefined - * @private - */ - get widget() { - return this._widget; - } - get dateContainer() { - return this.widget?.querySelector(`div.${Namespace.css.dateContainer}`); - } - get timeContainer() { - return this.widget?.querySelector(`div.${Namespace.css.timeContainer}`); - } - /** - * Returns this visible state of the picker (shown) - */ - get isVisible() { - return this._isVisible; - } - /** - * Updates the table for a particular unit. Used when an option as changed or - * whenever the class list might need to be refreshed. - * @param unit - * @private - */ - _update(unit) { - if (!this.widget) - return; - switch (unit) { - case exports.Unit.seconds: - this.secondDisplay._update(this.widget, this.paint); - break; - case exports.Unit.minutes: - this.minuteDisplay._update(this.widget, this.paint); - break; - case exports.Unit.hours: - this.hourDisplay._update(this.widget, this.paint); - break; - case exports.Unit.date: - this.dateDisplay._update(this.widget, this.paint); - break; - case exports.Unit.month: - this.monthDisplay._update(this.widget, this.paint); - break; - case exports.Unit.year: - this.yearDisplay._update(this.widget, this.paint); - break; - case 'decade': - this.decadeDisplay._update(this.widget, this.paint); - break; - case 'clock': - if (!this._hasTime) - break; - this.timeDisplay._update(this.widget); - this._update(exports.Unit.hours); - this._update(exports.Unit.minutes); - this._update(exports.Unit.seconds); - break; - case 'calendar': - this._update(exports.Unit.date); - this._update(exports.Unit.year); - this._update(exports.Unit.month); - this.decadeDisplay._update(this.widget, this.paint); - this._updateCalendarHeader(); - break; - case 'all': - if (this._hasTime) { - this._update('clock'); - } - if (this._hasDate) { - this._update('calendar'); - } - } - } - // noinspection JSUnusedLocalSymbols - /** - * Allows developers to add/remove classes from an element. - * @param _unit - * @param _date - * @param _classes - * @param _element - */ - /* eslint-disable @typescript-eslint/no-unused-vars */ - paint(_unit, _date, _classes, _element) { - // implemented in plugin - } - /** - * Shows the picker and creates a Popper instance if needed. - * Add document click event to hide when clicking outside the picker. - * fires Events#show - */ - show() { - if (this.widget == undefined) { - this._showSetDefaultIfNeeded(); - this._buildWidget(); - this._updateTheme(); - this._showSetupViewMode(); - if (!this.optionsStore.options.display.inline) { - // If needed to change the parent container - const container = this.optionsStore.options?.container || document.body; - const placement = this.optionsStore.options?.display?.placement || 'bottom'; - container.appendChild(this.widget); - this.createPopup(this.optionsStore.element, this.widget, { - modifiers: [{ name: 'eventListeners', enabled: true }], - //#2400 - placement: document.documentElement.dir === 'rtl' - ? `${placement}-end` - : `${placement}-start`, - }).then(); - } - else { - this.optionsStore.element.appendChild(this.widget); - } - if (this.optionsStore.options.display.viewMode == 'clock') { - this._eventEmitters.action.emit({ - e: null, - action: ActionTypes$1.showClock, - }); - } - this.widget - .querySelectorAll('[data-action]') - .forEach((element) => element.addEventListener('click', this._actionsClickEvent)); - // show the clock when using sideBySide - if (this._hasTime && this.optionsStore.options.display.sideBySide) { - this.timeDisplay._update(this.widget); - this.widget.getElementsByClassName(Namespace.css.clockContainer)[0].style.display = 'grid'; - } - } - this.widget.classList.add(Namespace.css.show); - if (!this.optionsStore.options.display.inline) { - this.updatePopup(); - document.addEventListener('click', this._documentClickEvent); - } - this._eventEmitters.triggerEvent.emit({ type: Namespace.events.show }); - this._isVisible = true; - } - _showSetupViewMode() { - // If modeView is only clock - const onlyClock = this._hasTime && !this._hasDate; - // reset the view to the clock if there's no date components - if (onlyClock) { - this.optionsStore.currentView = 'clock'; - this._eventEmitters.action.emit({ - e: null, - action: ActionTypes$1.showClock, - }); - } - // otherwise return to the calendar view - else if (!this.optionsStore.currentCalendarViewMode) { - this.optionsStore.currentCalendarViewMode = - this.optionsStore.minimumCalendarViewMode; - } - if (!onlyClock && this.optionsStore.options.display.viewMode !== 'clock') { - if (this._hasTime) { - if (!this.optionsStore.options.display.sideBySide) { - Collapse.hideImmediately(this.timeContainer); - } - else { - Collapse.show(this.timeContainer); - } - } - Collapse.show(this.dateContainer); - } - if (this._hasDate) { - this._showMode(); - } - } - _showSetDefaultIfNeeded() { - if (this.dates.picked.length != 0) - return; - if (this.optionsStore.options.useCurrent && - !this.optionsStore.options.defaultDate) { - const date = new DateTime().setLocalization(this.optionsStore.options.localization); - if (!this.optionsStore.options.keepInvalid) { - let tries = 0; - let direction = 1; - if (this.optionsStore.options.restrictions.maxDate?.isBefore(date)) { - direction = -1; - } - while (!this.validation.isValid(date) && tries > 31) { - date.manipulate(direction, exports.Unit.date); - tries++; - } - } - this.dates.setValue(date); - } - if (this.optionsStore.options.defaultDate) { - this.dates.setValue(this.optionsStore.options.defaultDate); - } - } - async createPopup(element, widget, - //eslint-disable-next-line @typescript-eslint/no-explicit-any - options) { - let createPopperFunction; - //eslint-disable-next-line @typescript-eslint/no-explicit-any - if (window?.Popper) { - //eslint-disable-next-line @typescript-eslint/no-explicit-any - createPopperFunction = window?.Popper?.createPopper; - } - else { - const { createPopper } = await import('@popperjs/core'); - createPopperFunction = createPopper; - } - if (createPopperFunction) { - this._popperInstance = createPopperFunction(element, widget, options); - } - } - updatePopup() { - this._popperInstance?.update(); - } - /** - * Changes the calendar view mode. E.g. month <-> year - * @param direction -/+ number to move currentViewMode - * @private - */ - _showMode(direction) { - if (!this.widget) { - return; - } - if (direction) { - const max = Math.max(this.optionsStore.minimumCalendarViewMode, Math.min(3, this.optionsStore.currentCalendarViewMode + direction)); - if (this.optionsStore.currentCalendarViewMode == max) - return; - this.optionsStore.currentCalendarViewMode = max; - } - this.widget - .querySelectorAll(`.${Namespace.css.dateContainer} > div:not(.${Namespace.css.calendarHeader}), .${Namespace.css.timeContainer} > div:not(.${Namespace.css.clockContainer})`) - .forEach((e) => (e.style.display = 'none')); - const datePickerMode = CalendarModes[this.optionsStore.currentCalendarViewMode]; - const picker = this.widget.querySelector(`.${datePickerMode.className}`); - switch (datePickerMode.className) { - case Namespace.css.decadesContainer: - this.decadeDisplay._update(this.widget, this.paint); - break; - case Namespace.css.yearsContainer: - this.yearDisplay._update(this.widget, this.paint); - break; - case Namespace.css.monthsContainer: - this.monthDisplay._update(this.widget, this.paint); - break; - case Namespace.css.daysContainer: - this.dateDisplay._update(this.widget, this.paint); - break; - } - picker.style.display = 'grid'; - if (this.optionsStore.options.display.sideBySide) - (this.widget.querySelectorAll(`.${Namespace.css.clockContainer}`)[0]).style.display = 'grid'; - this._updateCalendarHeader(); - this._eventEmitters.viewUpdate.emit(); - } - /** - * Changes the theme. E.g. light, dark or auto - * @param theme the theme name - * @private - */ - _updateTheme(theme) { - if (!this.widget) { - return; - } - if (theme) { - if (this.optionsStore.options.display.theme === theme) - return; - this.optionsStore.options.display.theme = theme; - } - this.widget.classList.remove('light', 'dark'); - this.widget.classList.add(this._getThemeClass()); - if (this.optionsStore.options.display.theme === 'auto') { - window - .matchMedia(Namespace.css.isDarkPreferredQuery) - .addEventListener('change', () => this._updateTheme()); - } - else { - window - .matchMedia(Namespace.css.isDarkPreferredQuery) - .removeEventListener('change', () => this._updateTheme()); - } - } - _getThemeClass() { - const currentTheme = this.optionsStore.options.display.theme || 'auto'; - const isDarkMode = window.matchMedia && - window.matchMedia(Namespace.css.isDarkPreferredQuery).matches; - switch (currentTheme) { - case 'light': - return Namespace.css.lightTheme; - case 'dark': - return Namespace.css.darkTheme; - case 'auto': - return isDarkMode ? Namespace.css.darkTheme : Namespace.css.lightTheme; - } - } - _updateCalendarHeader() { - if (!this._hasDate) - return; - const showing = [ - ...this.widget.querySelector(`.${Namespace.css.dateContainer} div[style*="display: grid"]`).classList, - ].find((x) => x.startsWith(Namespace.css.dateContainer)); - const [previous, switcher, next] = this.widget - .getElementsByClassName(Namespace.css.calendarHeader)[0] - .getElementsByTagName('div'); - switch (showing) { - case Namespace.css.decadesContainer: - previous.setAttribute('title', this.optionsStore.options.localization.previousCentury); - switcher.setAttribute('title', ''); - next.setAttribute('title', this.optionsStore.options.localization.nextCentury); - break; - case Namespace.css.yearsContainer: - previous.setAttribute('title', this.optionsStore.options.localization.previousDecade); - switcher.setAttribute('title', this.optionsStore.options.localization.selectDecade); - next.setAttribute('title', this.optionsStore.options.localization.nextDecade); - break; - case Namespace.css.monthsContainer: - previous.setAttribute('title', this.optionsStore.options.localization.previousYear); - switcher.setAttribute('title', this.optionsStore.options.localization.selectYear); - next.setAttribute('title', this.optionsStore.options.localization.nextYear); - break; - case Namespace.css.daysContainer: - previous.setAttribute('title', this.optionsStore.options.localization.previousMonth); - switcher.setAttribute('title', this.optionsStore.options.localization.selectMonth); - next.setAttribute('title', this.optionsStore.options.localization.nextMonth); - switcher.setAttribute(showing, this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat)); - break; - } - switcher.innerText = switcher.getAttribute(showing); - } - /** - * Hides the picker if needed. - * Remove document click event to hide when clicking outside the picker. - * fires Events#hide - */ - hide() { - if (!this.widget || !this._isVisible) - return; - this.widget.classList.remove(Namespace.css.show); - if (this._isVisible) { - this._eventEmitters.triggerEvent.emit({ - type: Namespace.events.hide, - date: this.optionsStore.unset ? null : this.dates.lastPicked?.clone, - }); - this._isVisible = false; - } - document.removeEventListener('click', this._documentClickEvent); - } - /** - * Toggles the picker's open state. Fires a show/hide event depending. - */ - toggle() { - return this._isVisible ? this.hide() : this.show(); - } - /** - * Removes document and data-action click listener and reset the widget - * @private - */ - _dispose() { - document.removeEventListener('click', this._documentClickEvent); - if (!this.widget) - return; - this.widget - .querySelectorAll('[data-action]') - .forEach((element) => element.removeEventListener('click', this._actionsClickEvent)); - this.widget.parentNode.removeChild(this.widget); - this._widget = undefined; - } - /** - * Builds the widgets html template. - * @private - */ - _buildWidget() { - const template = document.createElement('div'); - template.classList.add(Namespace.css.widget); - const dateView = document.createElement('div'); - dateView.classList.add(Namespace.css.dateContainer); - dateView.append(this.getHeadTemplate(), this.decadeDisplay.getPicker(), this.yearDisplay.getPicker(), this.monthDisplay.getPicker(), this.dateDisplay.getPicker()); - const timeView = document.createElement('div'); - timeView.classList.add(Namespace.css.timeContainer); - timeView.appendChild(this.timeDisplay.getPicker(this._iconTag.bind(this))); - timeView.appendChild(this.hourDisplay.getPicker()); - timeView.appendChild(this.minuteDisplay.getPicker()); - timeView.appendChild(this.secondDisplay.getPicker()); - const toolbar = document.createElement('div'); - toolbar.classList.add(Namespace.css.toolbar); - toolbar.append(...this.getToolbarElements()); - if (this.optionsStore.options.display.inline) { - template.classList.add(Namespace.css.inline); - } - if (this.optionsStore.options.display.calendarWeeks) { - template.classList.add('calendarWeeks'); - } - if (this.optionsStore.options.display.sideBySide && this._hasDateAndTime) { - this._buildWidgetSideBySide(template, dateView, timeView, toolbar); - return; - } - if (this.optionsStore.options.display.toolbarPlacement === 'top') { - template.appendChild(toolbar); - } - const setupComponentView = (hasFirst, hasSecond, element, shouldShow) => { - if (!hasFirst) - return; - if (hasSecond) { - element.classList.add(Namespace.css.collapse); - if (shouldShow) - element.classList.add(Namespace.css.show); - } - template.appendChild(element); - }; - setupComponentView(this._hasDate, this._hasTime, dateView, this.optionsStore.options.display.viewMode !== 'clock'); - setupComponentView(this._hasTime, this._hasDate, timeView, this.optionsStore.options.display.viewMode === 'clock'); - if (this.optionsStore.options.display.toolbarPlacement === 'bottom') { - template.appendChild(toolbar); - } - const arrow = document.createElement('div'); - arrow.classList.add('arrow'); - arrow.setAttribute('data-popper-arrow', ''); - template.appendChild(arrow); - this._widget = template; - } - _buildWidgetSideBySide(template, dateView, timeView, toolbar) { - template.classList.add(Namespace.css.sideBySide); - if (this.optionsStore.options.display.toolbarPlacement === 'top') { - template.appendChild(toolbar); - } - const row = document.createElement('div'); - row.classList.add('td-row'); - dateView.classList.add('td-half'); - timeView.classList.add('td-half'); - row.appendChild(dateView); - row.appendChild(timeView); - template.appendChild(row); - if (this.optionsStore.options.display.toolbarPlacement === 'bottom') { - template.appendChild(toolbar); - } - this._widget = template; - } - /** - * Returns true if the hours, minutes, or seconds component is turned on - */ - get _hasTime() { - return (this.optionsStore.options.display.components.clock && - (this.optionsStore.options.display.components.hours || - this.optionsStore.options.display.components.minutes || - this.optionsStore.options.display.components.seconds)); - } - /** - * Returns true if the year, month, or date component is turned on - */ - get _hasDate() { - return (this.optionsStore.options.display.components.calendar && - (this.optionsStore.options.display.components.year || - this.optionsStore.options.display.components.month || - this.optionsStore.options.display.components.date)); - } - get _hasDateAndTime() { - return this._hasDate && this._hasTime; - } - /** - * Get the toolbar html based on options like buttons => today - * @private - */ - getToolbarElements() { - const toolbar = []; - if (this.optionsStore.options.display.buttons.today) { - const div = document.createElement('div'); - div.setAttribute('data-action', ActionTypes$1.today); - div.setAttribute('title', this.optionsStore.options.localization.today); - div.appendChild(this._iconTag(this.optionsStore.options.display.icons.today)); - toolbar.push(div); - } - if (!this.optionsStore.options.display.sideBySide && - this._hasDate && - this._hasTime) { - let title, icon; - if (this.optionsStore.options.display.viewMode === 'clock') { - title = this.optionsStore.options.localization.selectDate; - icon = this.optionsStore.options.display.icons.date; - } - else { - title = this.optionsStore.options.localization.selectTime; - icon = this.optionsStore.options.display.icons.time; - } - const div = document.createElement('div'); - div.setAttribute('data-action', ActionTypes$1.togglePicker); - div.setAttribute('title', title); - div.appendChild(this._iconTag(icon)); - toolbar.push(div); - } - if (this.optionsStore.options.display.buttons.clear) { - const div = document.createElement('div'); - div.setAttribute('data-action', ActionTypes$1.clear); - div.setAttribute('title', this.optionsStore.options.localization.clear); - div.appendChild(this._iconTag(this.optionsStore.options.display.icons.clear)); - toolbar.push(div); - } - if (this.optionsStore.options.display.buttons.close) { - const div = document.createElement('div'); - div.setAttribute('data-action', ActionTypes$1.close); - div.setAttribute('title', this.optionsStore.options.localization.close); - div.appendChild(this._iconTag(this.optionsStore.options.display.icons.close)); - toolbar.push(div); - } - return toolbar; - } - /*** - * Builds the base header template with next and previous icons - * @private - */ - getHeadTemplate() { - const calendarHeader = document.createElement('div'); - calendarHeader.classList.add(Namespace.css.calendarHeader); - const previous = document.createElement('div'); - previous.classList.add(Namespace.css.previous); - previous.setAttribute('data-action', ActionTypes$1.previous); - previous.appendChild(this._iconTag(this.optionsStore.options.display.icons.previous)); - const switcher = document.createElement('div'); - switcher.classList.add(Namespace.css.switch); - switcher.setAttribute('data-action', ActionTypes$1.changeCalendarView); - const next = document.createElement('div'); - next.classList.add(Namespace.css.next); - next.setAttribute('data-action', ActionTypes$1.next); - next.appendChild(this._iconTag(this.optionsStore.options.display.icons.next)); - calendarHeader.append(previous, switcher, next); - return calendarHeader; - } - /** - * Builds an icon tag as either an `` - * or with icons => type is `sprites` then a svg tag instead - * @param iconClass - * @private - */ - _iconTag(iconClass) { - if (this.optionsStore.options.display.icons.type === 'sprites') { - const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); - const icon = document.createElementNS('http://www.w3.org/2000/svg', 'use'); - icon.setAttribute('xlink:href', iconClass); // Deprecated. Included for backward compatibility - icon.setAttribute('href', iconClass); - svg.appendChild(icon); - return svg; - } - const icon = document.createElement('i'); - icon.classList.add(...iconClass.split(' ')); - return icon; - } - /** - * Causes the widget to get rebuilt on next show. If the picker is already open - * then hide and reshow it. - * @private - */ - _rebuild() { - const wasVisible = this._isVisible; - this._dispose(); - if (wasVisible) - this.show(); - } - refreshCurrentView() { - //if the widget is not showing, just destroy it - if (!this._isVisible) - this._dispose(); - switch (this.optionsStore.currentView) { - case 'clock': - this._update('clock'); - break; - case 'calendar': - this._update(exports.Unit.date); - break; - case 'months': - this._update(exports.Unit.month); - break; - case 'years': - this._update(exports.Unit.year); - break; - case 'decades': - this._update('decade'); - break; - } - } - } - - /** - * Logic for various click actions - */ - class Actions { - constructor() { - this.optionsStore = serviceLocator.locate(OptionsStore); - this.dates = serviceLocator.locate(Dates); - this.validation = serviceLocator.locate(Validation); - this.display = serviceLocator.locate(Display); - this._eventEmitters = serviceLocator.locate(EventEmitters); - this._eventEmitters.action.subscribe((result) => { - this.do(result.e, result.action); - }); - } - /** - * Performs the selected `action`. See ActionTypes - * @param e This is normally a click event - * @param action If not provided, then look for a [data-action] - */ - //eslint-disable-next-line @typescript-eslint/no-explicit-any - do(e, action) { - const currentTarget = e?.currentTarget; - if (currentTarget?.classList?.contains(Namespace.css.disabled)) - return; - action = action || currentTarget?.dataset?.action; - const lastPicked = (this.dates.lastPicked || this.optionsStore.viewDate) - .clone; - switch (action) { - case ActionTypes$1.next: - case ActionTypes$1.previous: - this.handleNextPrevious(action); - break; - case ActionTypes$1.changeCalendarView: - this.display._showMode(1); - this.display._updateCalendarHeader(); - break; - case ActionTypes$1.selectMonth: - case ActionTypes$1.selectYear: - case ActionTypes$1.selectDecade: - this.handleSelectCalendarMode(action, currentTarget); - break; - case ActionTypes$1.selectDay: - this.handleSelectDay(currentTarget); - break; - case ActionTypes$1.selectHour: { - let hour = +currentTarget.dataset.value; - if (lastPicked.hours >= 12 && this.optionsStore.isTwelveHour) - hour += 12; - lastPicked.hours = hour; - this.dates.setValue(lastPicked, this.dates.lastPickedIndex); - this.hideOrClock(e); - break; - } - case ActionTypes$1.selectMinute: { - lastPicked.minutes = +currentTarget.dataset.value; - this.dates.setValue(lastPicked, this.dates.lastPickedIndex); - this.hideOrClock(e); - break; - } - case ActionTypes$1.selectSecond: { - lastPicked.seconds = +currentTarget.dataset.value; - this.dates.setValue(lastPicked, this.dates.lastPickedIndex); - this.hideOrClock(e); - break; - } - case ActionTypes$1.incrementHours: - this.manipulateAndSet(lastPicked, exports.Unit.hours); - break; - case ActionTypes$1.incrementMinutes: - this.manipulateAndSet(lastPicked, exports.Unit.minutes, this.optionsStore.options.stepping); - break; - case ActionTypes$1.incrementSeconds: - this.manipulateAndSet(lastPicked, exports.Unit.seconds); - break; - case ActionTypes$1.decrementHours: - this.manipulateAndSet(lastPicked, exports.Unit.hours, -1); - break; - case ActionTypes$1.decrementMinutes: - this.manipulateAndSet(lastPicked, exports.Unit.minutes, this.optionsStore.options.stepping * -1); - break; - case ActionTypes$1.decrementSeconds: - this.manipulateAndSet(lastPicked, exports.Unit.seconds, -1); - break; - case ActionTypes$1.toggleMeridiem: - this.manipulateAndSet(lastPicked, exports.Unit.hours, this.dates.lastPicked.hours >= 12 ? -12 : 12); - break; - case ActionTypes$1.togglePicker: - this.handleToggle(currentTarget); - break; - case ActionTypes$1.showClock: - case ActionTypes$1.showHours: - case ActionTypes$1.showMinutes: - case ActionTypes$1.showSeconds: - //make sure the clock is actually displaying - if (!this.optionsStore.options.display.sideBySide && - this.optionsStore.currentView !== 'clock') { - //hide calendar - Collapse.hideImmediately(this.display.dateContainer); - //show clock - Collapse.showImmediately(this.display.timeContainer); - } - this.handleShowClockContainers(action); - break; - case ActionTypes$1.clear: - this.dates.setValue(null); - this.display._updateCalendarHeader(); - break; - case ActionTypes$1.close: - this.display.hide(); - break; - case ActionTypes$1.today: { - const today = new DateTime().setLocalization(this.optionsStore.options.localization); - this._eventEmitters.updateViewDate.emit(today); - //todo this this really a good idea? - if (this.validation.isValid(today, exports.Unit.date)) - this.dates.setValue(today, this.dates.lastPickedIndex); - break; - } - } - } - handleShowClockContainers(action) { - if (!this.display._hasTime) { - Namespace.errorMessages.throwError('Cannot show clock containers when time is disabled.'); - /* ignore coverage: should never happen */ - return; - } - this.optionsStore.currentView = 'clock'; - this.display.widget - .querySelectorAll(`.${Namespace.css.timeContainer} > div`) - .forEach((htmlElement) => (htmlElement.style.display = 'none')); - let classToUse = ''; - switch (action) { - case ActionTypes$1.showClock: - classToUse = Namespace.css.clockContainer; - this.display._update('clock'); - break; - case ActionTypes$1.showHours: - classToUse = Namespace.css.hourContainer; - this.display._update(exports.Unit.hours); - break; - case ActionTypes$1.showMinutes: - classToUse = Namespace.css.minuteContainer; - this.display._update(exports.Unit.minutes); - break; - case ActionTypes$1.showSeconds: - classToUse = Namespace.css.secondContainer; - this.display._update(exports.Unit.seconds); - break; - } - (this.display.widget.getElementsByClassName(classToUse)[0]).style.display = 'grid'; - } - handleNextPrevious(action) { - const { unit, step } = CalendarModes[this.optionsStore.currentCalendarViewMode]; - if (action === ActionTypes$1.next) - this.optionsStore.viewDate.manipulate(step, unit); - else - this.optionsStore.viewDate.manipulate(step * -1, unit); - this._eventEmitters.viewUpdate.emit(); - this.display._showMode(); - } - /** - * After setting the value it will either show the clock or hide the widget. - * @param e - */ - hideOrClock(e) { - if (!this.optionsStore.isTwelveHour && - !this.optionsStore.options.display.components.minutes && - !this.optionsStore.options.display.keepOpen && - !this.optionsStore.options.display.inline) { - this.display.hide(); - } - else { - this.do(e, ActionTypes$1.showClock); - } - } - /** - * Common function to manipulate {@link lastPicked} by `unit`. - * @param lastPicked - * @param unit - * @param value Value to change by - */ - manipulateAndSet(lastPicked, unit, value = 1) { - const newDate = lastPicked.manipulate(value, unit); - if (this.validation.isValid(newDate, unit)) { - this.dates.setValue(newDate, this.dates.lastPickedIndex); - } - } - handleSelectCalendarMode(action, currentTarget) { - const value = +currentTarget.dataset.value; - switch (action) { - case ActionTypes$1.selectMonth: - this.optionsStore.viewDate.month = value; - break; - case ActionTypes$1.selectYear: - case ActionTypes$1.selectDecade: - this.optionsStore.viewDate.year = value; - break; - } - if (this.optionsStore.currentCalendarViewMode === - this.optionsStore.minimumCalendarViewMode) { - this.dates.setValue(this.optionsStore.viewDate, this.dates.lastPickedIndex); - if (!this.optionsStore.options.display.inline) { - this.display.hide(); - } - } - else { - this.display._showMode(-1); - } - } - handleToggle(currentTarget) { - if (currentTarget.getAttribute('title') === - this.optionsStore.options.localization.selectDate) { - currentTarget.setAttribute('title', this.optionsStore.options.localization.selectTime); - currentTarget.innerHTML = this.display._iconTag(this.optionsStore.options.display.icons.time).outerHTML; - this.display._updateCalendarHeader(); - this.optionsStore.refreshCurrentView(); - } - else { - currentTarget.setAttribute('title', this.optionsStore.options.localization.selectDate); - currentTarget.innerHTML = this.display._iconTag(this.optionsStore.options.display.icons.date).outerHTML; - if (this.display._hasTime) { - this.handleShowClockContainers(ActionTypes$1.showClock); - this.display._update('clock'); - } - } - this.display.widget - .querySelectorAll(`.${Namespace.css.dateContainer}, .${Namespace.css.timeContainer}`) - .forEach((htmlElement) => Collapse.toggle(htmlElement)); - this._eventEmitters.viewUpdate.emit(); - } - handleSelectDay(currentTarget) { - const day = this.optionsStore.viewDate.clone; - if (currentTarget.classList.contains(Namespace.css.old)) { - day.manipulate(-1, exports.Unit.month); - } - if (currentTarget.classList.contains(Namespace.css.new)) { - day.manipulate(1, exports.Unit.month); - } - day.date = +currentTarget.dataset.day; - if (this.optionsStore.options.dateRange) - this.handleDateRange(day); - else if (this.optionsStore.options.multipleDates) { - this.handleMultiDate(day); - } - else { - this.dates.setValue(day, this.dates.lastPickedIndex); - } - if (!this.display._hasTime && - !this.optionsStore.options.display.keepOpen && - !this.optionsStore.options.display.inline && - !this.optionsStore.options.multipleDates && - !this.optionsStore.options.dateRange) { - this.display.hide(); - } - } - handleMultiDate(day) { - let index = this.dates.pickedIndex(day, exports.Unit.date); - console.log(index); - if (index !== -1) { - this.dates.setValue(null, index); //deselect multi-date - } - else { - index = this.dates.lastPickedIndex + 1; - if (this.dates.picked.length === 0) - index = 0; - this.dates.setValue(day, index); - } - } - handleDateRange(day) { - switch (this.dates.picked.length) { - case 2: { - this.dates.clear(); - break; - } - case 1: { - const other = this.dates.picked[0]; - if (day.getTime() === other.getTime()) { - this.dates.clear(); - break; - } - if (day.isBefore(other)) { - this.dates.setValue(day, 0); - this.dates.setValue(other, 1); - return; - } - else { - this.dates.setValue(day, 1); - return; - } - } - } - this.dates.setValue(day, 0); - } - } - - /** - * A robust and powerful date/time picker component. - */ - class TempusDominus { - constructor(element, options = {}) { - //eslint-disable-next-line @typescript-eslint/no-explicit-any - this._subscribers = {}; - this._isDisabled = false; - /** - * Event for when the input field changes. This is a class level method so there's - * something for the remove listener function. - * @private - */ - //eslint-disable-next-line @typescript-eslint/no-explicit-any - this._inputChangeEvent = (event) => { - const internallyTriggered = event?.detail; - if (internallyTriggered) - return; - const setViewDate = () => { - if (this.dates.lastPicked) - this.optionsStore.viewDate = this.dates.lastPicked.clone; - }; - const value = this.optionsStore.input.value; - if (this.optionsStore.options.multipleDates || - this.optionsStore.options.dateRange) { - try { - const valueSplit = value.split(this.optionsStore.options.multipleDatesSeparator); - for (let i = 0; i < valueSplit.length; i++) { - this.dates.setFromInput(valueSplit[i], i); - } - setViewDate(); - } - catch { - console.warn('TD: Something went wrong trying to set the multipleDates values from the input field.'); - } - } - else { - this.dates.setFromInput(value, 0); - setViewDate(); - } - }; - /** - * Event for when the toggle is clicked. This is a class level method so there's - * something for the remove listener function. - * @private - */ - this._toggleClickEvent = () => { - if (this.optionsStore.element?.disabled || - this.optionsStore.input?.disabled || - //if we just have the input and allow input toggle is enabled, then don't cause a toggle - (this._toggle.nodeName === 'INPUT' && - this._toggle?.type === 'text' && - this.optionsStore.options.allowInputToggle)) - return; - this.toggle(); - }; - /** - * Event for when the toggle is clicked. This is a class level method so there's - * something for the remove listener function. - * @private - */ - this._openClickEvent = () => { - if (this.optionsStore.element?.disabled || - this.optionsStore.input?.disabled) - return; - if (!this.display.isVisible) - this.show(); - }; - setupServiceLocator(); - this._eventEmitters = serviceLocator.locate(EventEmitters); - this.optionsStore = serviceLocator.locate(OptionsStore); - this.display = serviceLocator.locate(Display); - this.dates = serviceLocator.locate(Dates); - this.actions = serviceLocator.locate(Actions); - if (!element) { - Namespace.errorMessages.mustProvideElement(); - } - this.optionsStore.element = element; - this._initializeOptions(options, DefaultOptions, true); - this.optionsStore.viewDate.setLocalization(this.optionsStore.options.localization); - this.optionsStore.unset = true; - this._initializeInput(); - this._initializeToggle(); - if (this.optionsStore.options.display.inline) - this.display.show(); - this._eventEmitters.triggerEvent.subscribe((e) => { - this._triggerEvent(e); - }); - this._eventEmitters.viewUpdate.subscribe(() => { - this._viewUpdate(); - }); - this._eventEmitters.updateViewDate.subscribe((dateTime) => { - this.viewDate = dateTime; - }); - } - get viewDate() { - return this.optionsStore.viewDate; - } - set viewDate(value) { - this.optionsStore.viewDate = value; - this.optionsStore.viewDate.setLocalization(this.optionsStore.options.localization); - this.display._update(this.optionsStore.currentView === 'clock' ? 'clock' : 'calendar'); - } - // noinspection JSUnusedGlobalSymbols - /** - * Update the picker options. If `reset` is provide `options` will be merged with DefaultOptions instead. - * @param options - * @param reset - * @public - */ - updateOptions(options, reset = false) { - if (reset) - this._initializeOptions(options, DefaultOptions); - else - this._initializeOptions(options, this.optionsStore.options); - this.optionsStore.viewDate.setLocalization(this.optionsStore.options.localization); - this.display.refreshCurrentView(); - } - // noinspection JSUnusedGlobalSymbols - /** - * Toggles the picker open or closed. If the picker is disabled, nothing will happen. - * @public - */ - toggle() { - if (this._isDisabled) - return; - this.display.toggle(); - } - // noinspection JSUnusedGlobalSymbols - /** - * Shows the picker unless the picker is disabled. - * @public - */ - show() { - if (this._isDisabled) - return; - this.display.show(); - } - // noinspection JSUnusedGlobalSymbols - /** - * Hides the picker unless the picker is disabled. - * @public - */ - hide() { - this.display.hide(); - } - // noinspection JSUnusedGlobalSymbols - /** - * Disables the picker and the target input field. - * @public - */ - disable() { - this._isDisabled = true; - // todo this might be undesired. If a dev disables the input field to - // only allow using the picker, this will break that. - this.optionsStore.input?.setAttribute('disabled', 'disabled'); - this.display.hide(); - } - // noinspection JSUnusedGlobalSymbols - /** - * Enables the picker and the target input field. - * @public - */ - enable() { - this._isDisabled = false; - this.optionsStore.input?.removeAttribute('disabled'); - } - // noinspection JSUnusedGlobalSymbols - /** - * Clears all the selected dates - * @public - */ - clear() { - this.optionsStore.input.value = ''; - this.dates.clear(); - } - // noinspection JSUnusedGlobalSymbols - /** - * Allows for a direct subscription to picker events, without having to use addEventListener on the element. - * @param eventTypes See Namespace.Events - * @param callbacks Function to call when event is triggered - * @public - */ - subscribe(eventTypes, callbacks //eslint-disable-line @typescript-eslint/no-explicit-any - ) { - if (typeof eventTypes === 'string') { - eventTypes = [eventTypes]; - } - let callBackArray; //eslint-disable-line @typescript-eslint/no-explicit-any - if (!Array.isArray(callbacks)) { - callBackArray = [callbacks]; - } - else { - callBackArray = callbacks; - } - if (eventTypes.length !== callBackArray.length) { - Namespace.errorMessages.subscribeMismatch(); - } - const returnArray = []; - for (let i = 0; i < eventTypes.length; i++) { - const eventType = eventTypes[i]; - if (!Array.isArray(this._subscribers[eventType])) { - this._subscribers[eventType] = []; - } - this._subscribers[eventType].push(callBackArray[i]); - returnArray.push({ - unsubscribe: this._unsubscribe.bind(this, eventType, this._subscribers[eventType].length - 1), - }); - if (eventTypes.length === 1) { - return returnArray[0]; - } - } - return returnArray; - } - // noinspection JSUnusedGlobalSymbols - /** - * Hides the picker and removes event listeners - */ - dispose() { - this.display.hide(); - // this will clear the document click event listener - this.display._dispose(); - this._eventEmitters.destroy(); - this.optionsStore.input?.removeEventListener('change', this._inputChangeEvent); - if (this.optionsStore.options.allowInputToggle) { - this.optionsStore.input?.removeEventListener('click', this._openClickEvent); - this.optionsStore.input?.removeEventListener('focus', this._openClickEvent); - } - this._toggle?.removeEventListener('click', this._toggleClickEvent); - this._subscribers = {}; - } - /** - * Updates the options to use the provided language. - * THe language file must be loaded first. - * @param language - */ - locale(language) { - const asked = loadedLocales[language]; - if (!asked) - return; - this.updateOptions({ - localization: asked, - }); - } - /** - * Triggers an event like ChangeEvent when the picker has updated the value - * of a selected date. - * @param event Accepts a BaseEvent object. - * @private - */ - _triggerEvent(event) { - event.viewMode = this.optionsStore.currentView; - const isChangeEvent = event.type === Namespace.events.change; - if (isChangeEvent) { - const { date, oldDate, isClear } = event; - if ((date && oldDate && date.isSame(oldDate)) || - (!isClear && !date && !oldDate)) { - return; - } - this._handleAfterChangeEvent(event); - this.optionsStore.input?.dispatchEvent( - //eslint-disable-next-line @typescript-eslint/no-explicit-any - new CustomEvent('change', { detail: event })); - } - this.optionsStore.element.dispatchEvent( - //eslint-disable-next-line @typescript-eslint/no-explicit-any - new CustomEvent(event.type, { detail: event })); - //eslint-disable-next-line @typescript-eslint/no-explicit-any - if (window.jQuery) { - //eslint-disable-next-line @typescript-eslint/no-explicit-any - const $ = window.jQuery; - if (isChangeEvent && this.optionsStore.input) { - $(this.optionsStore.input).trigger(event); - } - else { - $(this.optionsStore.element).trigger(event); - } - } - this._publish(event); - } - _publish(event) { - // return if event is not subscribed - if (!Array.isArray(this._subscribers[event.type])) { - return; - } - // Trigger callback for each subscriber - this._subscribers[event.type].forEach((callback) => { - callback(event); - }); - } - /** - * Fires a ViewUpdate event when, for example, the month view is changed. - * @private - */ - _viewUpdate() { - this._triggerEvent({ - type: Namespace.events.update, - viewDate: this.optionsStore.viewDate.clone, - }); - } - _unsubscribe(eventName, index) { - this._subscribers[eventName].splice(index, 1); - } - /** - * Merges two Option objects together and validates options type - * @param config new Options - * @param mergeTo Options to merge into - * @param includeDataset When true, the elements data-td attributes will be included in the - * @private - */ - _initializeOptions(config, mergeTo, includeDataset = false) { - let newConfig = OptionConverter.deepCopy(config); - newConfig = OptionConverter._mergeOptions(newConfig, mergeTo); - if (includeDataset) - newConfig = OptionConverter._dataToOptions(this.optionsStore.element, newConfig); - OptionConverter._validateConflicts(newConfig); - newConfig.viewDate = newConfig.viewDate.setLocalization(newConfig.localization); - if (!this.optionsStore.viewDate.isSame(newConfig.viewDate)) { - this.optionsStore.viewDate = newConfig.viewDate; - } - /** - * Sets the minimum view allowed by the picker. For example the case of only - * allowing year and month to be selected but not date. - */ - if (newConfig.display.components.year) { - this.optionsStore.minimumCalendarViewMode = 2; - } - if (newConfig.display.components.month) { - this.optionsStore.minimumCalendarViewMode = 1; - } - if (newConfig.display.components.date) { - this.optionsStore.minimumCalendarViewMode = 0; - } - this.optionsStore.currentCalendarViewMode = Math.max(this.optionsStore.minimumCalendarViewMode, this.optionsStore.currentCalendarViewMode); - // Update view mode if needed - if (CalendarModes[this.optionsStore.currentCalendarViewMode].name !== - newConfig.display.viewMode) { - this.optionsStore.currentCalendarViewMode = Math.max(CalendarModes.findIndex((x) => x.name === newConfig.display.viewMode), this.optionsStore.minimumCalendarViewMode); - } - if (this.display?.isVisible) { - this.display._update('all'); - } - if (newConfig.display.components.useTwentyfourHour && - newConfig.localization.hourCycle === undefined) - newConfig.localization.hourCycle = 'h24'; - else if (newConfig.localization.hourCycle === undefined) { - newConfig.localization.hourCycle = guessHourCycle(newConfig.localization.locale); - } - this.optionsStore.options = newConfig; - if (newConfig.restrictions.maxDate && - this.viewDate.isAfter(newConfig.restrictions.maxDate)) - this.viewDate = newConfig.restrictions.maxDate; - if (newConfig.restrictions.minDate && - this.viewDate.isBefore(newConfig.restrictions.minDate)) - this.viewDate = newConfig.restrictions.minDate; - } - /** - * Checks if an input field is being used, attempts to locate one and sets an - * event listener if found. - * @private - */ - _initializeInput() { - if (this.optionsStore.element.tagName == 'INPUT') { - this.optionsStore.input = this.optionsStore.element; - } - else { - const query = this.optionsStore.element.dataset.tdTargetInput; - if (query == undefined || query == 'nearest') { - this.optionsStore.input = - this.optionsStore.element.querySelector('input'); - } - else { - this.optionsStore.input = - this.optionsStore.element.querySelector(query); - } - } - if (!this.optionsStore.input) - return; - if (!this.optionsStore.input.value && this.optionsStore.options.defaultDate) - this.optionsStore.input.value = this.dates.formatInput(this.optionsStore.options.defaultDate); - this.optionsStore.input.addEventListener('change', this._inputChangeEvent); - if (this.optionsStore.options.allowInputToggle) { - this.optionsStore.input.addEventListener('click', this._openClickEvent); - this.optionsStore.input.addEventListener('focus', this._openClickEvent); - } - if (this.optionsStore.input.value) { - this._inputChangeEvent(); - } - } - /** - * Attempts to locate a toggle for the picker and sets an event listener - * @private - */ - _initializeToggle() { - if (this.optionsStore.options.display.inline) - return; - let query = this.optionsStore.element.dataset.tdTargetToggle; - if (query == 'nearest') { - query = '[data-td-toggle="datetimepicker"]'; - } - this._toggle = - query == undefined - ? this.optionsStore.element - : this.optionsStore.element.querySelector(query); - this._toggle.addEventListener('click', this._toggleClickEvent); - } - /** - * If the option is enabled this will render the clock view after a date pick. - * @param e change event - * @private - */ - _handleAfterChangeEvent(e) { - if ( - // options is disabled - !this.optionsStore.options.promptTimeOnDateChange || - this.optionsStore.options.multipleDates || - this.optionsStore.options.display.inline || - this.optionsStore.options.display.sideBySide || - // time is disabled - !this.display._hasTime || - // clock component is already showing - this.display.widget - ?.getElementsByClassName(Namespace.css.show)[0] - .classList.contains(Namespace.css.timeContainer)) - return; - // First time ever. If useCurrent option is set to true (default), do nothing - // because the first date is selected automatically. - // or date didn't change (time did) or date changed because time did. - if ((!e.oldDate && this.optionsStore.options.useCurrent) || - (e.oldDate && e.date?.isSame(e.oldDate))) { - return; - } - clearTimeout(this._currentPromptTimeTimeout); - this._currentPromptTimeTimeout = setTimeout(() => { - if (this.display.widget) { - this._eventEmitters.action.emit({ - e: { - currentTarget: this.display.widget.querySelector('[data-action="togglePicker"]'), - }, - action: ActionTypes$1.togglePicker, - }); - } - }, this.optionsStore.options.promptTimeOnDateChangeTransitionDelay); - } - } - /** - * Whenever a locale is loaded via a plugin then store it here based on the - * locale name. E.g. loadedLocales['ru'] - */ - const loadedLocales = {}; - // noinspection JSUnusedGlobalSymbols - /** - * Called from a locale plugin. - * @param l locale object for localization options - */ - const loadLocale = (l) => { - if (loadedLocales[l.name]) - return; - loadedLocales[l.name] = l.localization; - }; - /** - * A sets the global localization options to the provided locale name. - * `loadLocale` MUST be called first. - * @param l - */ - const locale = (l) => { - const asked = loadedLocales[l]; - if (!asked) - return; - DefaultOptions.localization = asked; - }; - // noinspection JSUnusedGlobalSymbols - /** - * Called from a plugin to extend or override picker defaults. - * @param plugin - * @param option - */ - const extend = function (plugin, option = undefined) { - if (!plugin) - return tempusDominus; - if (!plugin.installed) { - // install plugin only once - plugin(option, { TempusDominus, Dates, Display, DateTime, Namespace }, tempusDominus); - plugin.installed = true; - } - return tempusDominus; - }; - const version = '6.7.19'; - const tempusDominus = { - TempusDominus, - extend, - loadLocale, - locale, - Namespace, - DefaultOptions, - DateTime, - Unit: exports.Unit, - version, - DefaultEnLocalization, - }; - - exports.DateTime = DateTime; - exports.DefaultEnLocalization = DefaultEnLocalization; - exports.DefaultOptions = DefaultOptions; - exports.Namespace = Namespace; - exports.TempusDominus = TempusDominus; - exports.extend = extend; - exports.loadLocale = loadLocale; - exports.locale = locale; - exports.version = version; - - Object.defineProperty(exports, '__esModule', { value: true }); - -})); -//# sourceMappingURL=tempus-dominus.js.map diff --git a/node_modules/@eonasdan/tempus-dominus/dist/js/tempus-dominus.js.map b/node_modules/@eonasdan/tempus-dominus/dist/js/tempus-dominus.js.map deleted file mode 100644 index 56597d9..0000000 --- a/node_modules/@eonasdan/tempus-dominus/dist/js/tempus-dominus.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tempus-dominus.js","sources":["../../src/js/utilities/errors.ts","../../src/js/utilities/namespace.ts","../../src/js/utilities/default-format-localization.ts","../../src/js/datetime.ts","../../src/js/utilities/service-locator.ts","../../src/js/utilities/calendar-modes.ts","../../src/js/utilities/optionsStore.ts","../../src/js/validation.ts","../../src/js/utilities/event-emitter.ts","../../src/js/utilities/default-options.ts","../../src/js/utilities/typeChecker.ts","../../src/js/utilities/optionProcessor.ts","../../src/js/utilities/optionConverter.ts","../../src/js/dates.ts","../../src/js/utilities/action-types.ts","../../src/js/display/calendar/date-display.ts","../../src/js/display/calendar/month-display.ts","../../src/js/display/calendar/year-display.ts","../../src/js/display/calendar/decade-display.ts","../../src/js/display/time/time-display.ts","../../src/js/display/time/hour-display.ts","../../src/js/display/time/minute-display.ts","../../src/js/display/time/second-display.ts","../../src/js/display/collapse.ts","../../src/js/display/index.ts","../../src/js/actions.ts","../../src/js/tempus-dominus.ts"],"sourcesContent":["export class TdError extends Error {\n code: number;\n}\n\nexport class ErrorMessages {\n private base = 'TD:';\n\n //#region out to console\n\n /**\n * Throws an error indicating that a key in the options object is invalid.\n * @param optionName\n */\n unexpectedOption(optionName: string) {\n const error = new TdError(\n `${this.base} Unexpected option: ${optionName} does not match a known option.`\n );\n error.code = 1;\n throw error;\n }\n\n /**\n * Throws an error indicating that one more keys in the options object is invalid.\n * @param optionName\n */\n unexpectedOptions(optionName: string[]) {\n const error = new TdError(`${this.base}: ${optionName.join(', ')}`);\n error.code = 1;\n throw error;\n }\n\n /**\n * Throws an error when an option is provide an unsupported value.\n * For example a value of 'cheese' for toolbarPlacement which only supports\n * 'top', 'bottom', 'default'.\n * @param optionName\n * @param badValue\n * @param validOptions\n */\n unexpectedOptionValue(\n optionName: string,\n badValue: string,\n validOptions: string[]\n ) {\n const error = new TdError(\n `${\n this.base\n } Unexpected option value: ${optionName} does not accept a value of \"${badValue}\". Valid values are: ${validOptions.join(\n ', '\n )}`\n );\n error.code = 2;\n throw error;\n }\n\n /**\n * Throws an error when an option value is the wrong type.\n * For example a string value was provided to multipleDates which only\n * supports true or false.\n * @param optionName\n * @param badType\n * @param expectedType\n */\n typeMismatch(optionName: string, badType: string, expectedType: string) {\n const error = new TdError(\n `${this.base} Mismatch types: ${optionName} has a type of ${badType} instead of the required ${expectedType}`\n );\n error.code = 3;\n throw error;\n }\n\n /**\n * Throws an error when an option value is outside of the expected range.\n * For example restrictions.daysOfWeekDisabled excepts a value between 0 and 6.\n * @param optionName\n * @param lower\n * @param upper\n */\n numbersOutOfRange(optionName: string, lower: number, upper: number) {\n const error = new TdError(\n `${this.base} ${optionName} expected an array of number between ${lower} and ${upper}.`\n );\n error.code = 4;\n throw error;\n }\n\n /**\n * Throws an error when a value for a date options couldn't be parsed. Either\n * the option was an invalid string or an invalid Date object.\n * @param optionName\n * @param date\n * @param soft If true, logs a warning instead of an error.\n */\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n failedToParseDate(optionName: string, date: any, soft = false) {\n const error = new TdError(\n `${this.base} Could not correctly parse \"${date}\" to a date for ${optionName}.`\n );\n error.code = 5;\n if (!soft) throw error;\n console.warn(error);\n }\n\n /**\n * Throws when an element to attach to was not provided in the constructor.\n */\n mustProvideElement() {\n const error = new TdError(`${this.base} No element was provided.`);\n error.code = 6;\n throw error;\n }\n\n /**\n * Throws if providing an array for the events to subscribe method doesn't have\n * the same number of callbacks. E.g., subscribe([1,2], [1])\n */\n subscribeMismatch() {\n const error = new TdError(\n `${this.base} The subscribed events does not match the number of callbacks`\n );\n error.code = 7;\n throw error;\n }\n\n /**\n * Throws if the configuration has conflicting rules e.g. minDate is after maxDate\n */\n conflictingConfiguration(message?: string) {\n const error = new TdError(\n `${this.base} A configuration value conflicts with another rule. ${message}`\n );\n error.code = 8;\n throw error;\n }\n\n /**\n * customDateFormat errors\n */\n customDateFormatError(message?: string) {\n const error = new TdError(`${this.base} Custom Date Format: ${message}`);\n error.code = 9;\n throw error;\n }\n\n /**\n * Logs a warning if a date option value is provided as a string, instead of\n * a date/datetime object.\n */\n dateString() {\n console.warn(\n `${this.base} Using a string for date options is not recommended unless you specify an ISO string or use the customDateFormat plugin.`\n );\n }\n\n deprecatedWarning(message: string, remediation?: string) {\n console.warn(\n `${this.base} Warning ${message} is deprecated and will be removed in a future version. ${remediation}`\n );\n }\n\n throwError(message) {\n const error = new TdError(`${this.base} ${message}`);\n error.code = 9;\n throw error;\n }\n\n //#endregion\n\n //#region used with notify.error\n\n /**\n * Used with an Error Event type if the user selects a date that\n * fails restriction validation.\n */\n failedToSetInvalidDate = 'Failed to set invalid date';\n\n /**\n * Used with an Error Event type when a user changes the value of the\n * input field directly, and does not provide a valid date.\n */\n failedToParseInput = 'Failed parse input field';\n\n //#endregion\n}\n","import { ErrorMessages } from './errors';\n// this is not the way I want this to stay but nested classes seemed to blown up once its compiled.\nconst NAME = 'tempus-dominus',\n dataKey = 'td';\n\n/**\n * Events\n */\nclass Events {\n key = `.${dataKey}`;\n\n /**\n * Change event. Fired when the user selects a date.\n * See also EventTypes.ChangeEvent\n */\n change = `change${this.key}`;\n\n /**\n * Emit when the view changes for example from month view to the year view.\n * See also EventTypes.ViewUpdateEvent\n */\n update = `update${this.key}`;\n\n /**\n * Emits when a selected date or value from the input field fails to meet the provided validation rules.\n * See also EventTypes.FailEvent\n */\n error = `error${this.key}`;\n\n /**\n * Show event\n * @event Events#show\n */\n show = `show${this.key}`;\n\n /**\n * Hide event\n * @event Events#hide\n */\n hide = `hide${this.key}`;\n\n // blur and focus are used in the jQuery provider but are otherwise unused.\n // keyup/down will be used later for keybinding options\n\n blur = `blur${this.key}`;\n focus = `focus${this.key}`;\n keyup = `keyup${this.key}`;\n keydown = `keydown${this.key}`;\n}\n\nclass Css {\n /**\n * The outer element for the widget.\n */\n widget = `${NAME}-widget`;\n\n /**\n * Hold the previous, next and switcher divs\n */\n calendarHeader = 'calendar-header';\n\n /**\n * The element for the action to change the calendar view. E.g. month -> year.\n */\n switch = 'picker-switch';\n\n /**\n * The elements for all the toolbar options\n */\n toolbar = 'toolbar';\n\n /**\n * Disables the hover and rounding affect.\n */\n noHighlight = 'no-highlight';\n\n /**\n * Applied to the widget element when the side by side option is in use.\n */\n sideBySide = 'timepicker-sbs';\n\n /**\n * The element for the action to change the calendar view, e.g. August -> July\n */\n previous = 'previous';\n\n /**\n * The element for the action to change the calendar view, e.g. August -> September\n */\n next = 'next';\n\n /**\n * Applied to any action that would violate any restriction options. ALso applied\n * to an input field if the disabled function is called.\n */\n disabled = 'disabled';\n\n /**\n * Applied to any date that is less than requested view,\n * e.g. the last day of the previous month.\n */\n old = 'old';\n\n /**\n * Applied to any date that is greater than of requested view,\n * e.g. the last day of the previous month.\n */\n new = 'new';\n\n /**\n * Applied to any date that is currently selected.\n */\n active = 'active';\n\n //#region date element\n\n /**\n * The outer element for the calendar view.\n */\n dateContainer = 'date-container';\n\n /**\n * The outer element for the decades view.\n */\n decadesContainer = `${this.dateContainer}-decades`;\n\n /**\n * Applied to elements within the decade container, e.g. 2020, 2030\n */\n decade = 'decade';\n\n /**\n * The outer element for the years view.\n */\n yearsContainer = `${this.dateContainer}-years`;\n\n /**\n * Applied to elements within the years container, e.g. 2021, 2021\n */\n year = 'year';\n\n /**\n * The outer element for the month view.\n */\n monthsContainer = `${this.dateContainer}-months`;\n\n /**\n * Applied to elements within the month container, e.g. January, February\n */\n month = 'month';\n\n /**\n * The outer element for the calendar view.\n */\n daysContainer = `${this.dateContainer}-days`;\n\n /**\n * Applied to elements within the day container, e.g. 1, 2..31\n */\n day = 'day';\n\n /**\n * If display.calendarWeeks is enabled, a column displaying the week of year\n * is shown. This class is applied to each cell in that column.\n */\n calendarWeeks = 'cw';\n\n /**\n * Applied to the first row of the calendar view, e.g. Sunday, Monday\n */\n dayOfTheWeek = 'dow';\n\n /**\n * Applied to the current date on the calendar view.\n */\n today = 'today';\n\n /**\n * Applied to the locale's weekend dates on the calendar view, e.g. Sunday, Saturday\n */\n weekend = 'weekend';\n\n rangeIn = 'range-in';\n rangeStart = 'range-start';\n rangeEnd = 'range-end';\n\n //#endregion\n\n //#region time element\n\n /**\n * The outer element for all time related elements.\n */\n timeContainer = 'time-container';\n\n /**\n * Applied the separator columns between time elements, e.g. hour *:* minute *:* second\n */\n separator = 'separator';\n\n /**\n * The outer element for the clock view.\n */\n clockContainer = `${this.timeContainer}-clock`;\n\n /**\n * The outer element for the hours selection view.\n */\n hourContainer = `${this.timeContainer}-hour`;\n\n /**\n * The outer element for the minutes selection view.\n */\n minuteContainer = `${this.timeContainer}-minute`;\n\n /**\n * The outer element for the seconds selection view.\n */\n secondContainer = `${this.timeContainer}-second`;\n\n /**\n * Applied to each element in the hours selection view.\n */\n hour = 'hour';\n\n /**\n * Applied to each element in the minutes selection view.\n */\n minute = 'minute';\n\n /**\n * Applied to each element in the seconds selection view.\n */\n second = 'second';\n\n /**\n * Applied AM/PM toggle button.\n */\n toggleMeridiem = 'toggleMeridiem';\n\n //#endregion\n\n //#region collapse\n\n /**\n * Applied the element of the current view mode, e.g. calendar or clock.\n */\n show = 'show';\n\n /**\n * Applied to the currently showing view mode during a transition\n * between calendar and clock views\n */\n collapsing = 'td-collapsing';\n\n /**\n * Applied to the currently hidden view mode.\n */\n collapse = 'td-collapse';\n\n //#endregion\n\n /**\n * Applied to the widget when the option display.inline is enabled.\n */\n inline = 'inline';\n\n /**\n * Applied to the widget when the option display.theme is light.\n */\n lightTheme = 'light';\n\n /**\n * Applied to the widget when the option display.theme is dark.\n */\n darkTheme = 'dark';\n\n /**\n * Used for detecting if the system color preference is dark mode\n */\n isDarkPreferredQuery = '(prefers-color-scheme: dark)';\n}\n\nexport default class Namespace {\n static NAME = NAME;\n // noinspection JSUnusedGlobalSymbols\n static dataKey = dataKey;\n\n static events = new Events();\n\n static css = new Css();\n\n static errorMessages = new ErrorMessages();\n}\n","import { FormatLocalization } from './options';\n\nconst DefaultFormatLocalization: FormatLocalization = {\n dateFormats: {\n LTS: 'h:mm:ss T',\n LT: 'h:mm T',\n L: 'MM/dd/yyyy',\n LL: 'MMMM d, yyyy',\n LLL: 'MMMM d, yyyy h:mm T',\n LLLL: 'dddd, MMMM d, yyyy h:mm T',\n },\n format: 'L LT',\n locale: 'default',\n hourCycle: undefined,\n ordinal: (n) => {\n const s = ['th', 'st', 'nd', 'rd'];\n const v = n % 100;\n return `[${n}${s[(v - 20) % 10] || s[v] || s[0]}]`;\n },\n};\n\nexport default { ...DefaultFormatLocalization };\n","import { FormatLocalization } from './utilities/options';\nimport Namespace from './utilities/namespace';\nimport DefaultFormatLocalization from './utilities/default-format-localization';\n\ntype parsedTime = {\n afternoon?: boolean;\n year?: number;\n month?: number;\n day?: number;\n hours?: number;\n minutes?: number;\n seconds?: number;\n milliseconds?: number;\n zone?: {\n offset: number;\n };\n};\n\nexport enum Unit {\n seconds = 'seconds',\n minutes = 'minutes',\n hours = 'hours',\n date = 'date',\n month = 'month',\n year = 'year',\n}\n\nconst twoDigitTemplate = {\n month: '2-digit',\n day: '2-digit',\n year: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n};\n\nexport interface DateTimeFormatOptions extends Intl.DateTimeFormatOptions {\n timeStyle?: 'short' | 'medium' | 'long';\n dateStyle?: 'short' | 'medium' | 'long' | 'full';\n numberingSystem?: string;\n}\n\n/**\n * Returns an Intl format object based on the provided object\n * @param unit\n */\nexport const getFormatByUnit = (unit: Unit): object => {\n switch (unit) {\n case 'date':\n return { dateStyle: 'short' };\n case 'month':\n return {\n month: 'numeric',\n year: 'numeric',\n };\n case 'year':\n return { year: 'numeric' };\n }\n};\n\n/**\n * Attempts to guess the hour cycle of the given local\n * @param locale\n */\nexport const guessHourCycle = (locale: string): Intl.LocaleHourCycleKey => {\n if (!locale) return 'h12';\n\n // noinspection SpellCheckingInspection\n const template = {\n hour: '2-digit',\n minute: '2-digit',\n numberingSystem: 'latn',\n };\n\n const dt = new DateTime().setLocalization({ locale });\n dt.hours = 0;\n\n const start = dt.parts(undefined, template).hour;\n\n //midnight is 12 so en-US style 12 AM\n if (start === '12') return 'h12';\n //midnight is 24 is from 00-24\n if (start === '24') return 'h24';\n\n dt.hours = 23;\n const end = dt.parts(undefined, template).hour;\n\n //if midnight is 00 and hour 23 is 11 then\n if (start === '00' && end === '11') return 'h11';\n\n if (start === '00' && end === '23') return 'h23';\n\n console.warn(\n `couldn't determine hour cycle for ${locale}. start: ${start}. end: ${end}`\n );\n\n return undefined;\n};\n\ninterface FormatMatch {\n parser: (obj: parsedTime, input: number) => void;\n pattern?: RegExp;\n}\n\ninterface FormatMatchString {\n parser: (obj: parsedTime, input: string) => void;\n pattern?: RegExp;\n}\n\ninterface FormatExpression {\n t: FormatMatchString;\n T: FormatMatchString;\n fff: FormatMatch;\n s: FormatMatch;\n ss: FormatMatch;\n m: FormatMatch;\n mm: FormatMatch;\n H: FormatMatch;\n h: FormatMatch;\n HH: FormatMatch;\n hh: FormatMatch;\n d: FormatMatch;\n dd: FormatMatch;\n Do: FormatMatchString;\n M: FormatMatch;\n MM: FormatMatch;\n MMM: FormatMatchString;\n MMMM: FormatMatchString;\n y: FormatMatch;\n yy: FormatMatch;\n yyyy: FormatMatch;\n}\n\n/**\n * For the most part this object behaves exactly the same way\n * as the native Date object with a little extra spice.\n */\nexport class DateTime extends Date {\n localization: FormatLocalization = DefaultFormatLocalization;\n\n /**\n * Chainable way to set the {@link locale}\n * @param value\n * @deprecated use setLocalization with a FormatLocalization object instead\n */\n setLocale(value: string): this {\n if (!this.localization) {\n this.localization = DefaultFormatLocalization;\n this.localization.locale = value;\n }\n return this;\n }\n\n /**\n * Chainable way to set the {@link localization}\n * @param value\n */\n setLocalization(value: FormatLocalization): this {\n this.localization = value;\n return this;\n }\n\n /**\n * Converts a plain JS date object to a DateTime object.\n * Doing this allows access to format, etc.\n * @param date\n * @param locale this parameter is deprecated. Use formatLocalization instead.\n * @param formatLocalization\n */\n static convert(\n date: Date,\n locale = 'default',\n formatLocalization: FormatLocalization = undefined\n ): DateTime {\n if (!date) throw new Error(`A date is required`);\n\n if (!formatLocalization) {\n formatLocalization = DefaultFormatLocalization;\n formatLocalization.locale = locale;\n }\n\n return new DateTime(\n date.getFullYear(),\n date.getMonth(),\n date.getDate(),\n date.getHours(),\n date.getMinutes(),\n date.getSeconds(),\n date.getMilliseconds()\n ).setLocalization(formatLocalization);\n }\n\n /**\n * Native date manipulations are not pure functions. This function creates a duplicate of the DateTime object.\n */\n get clone() {\n return new DateTime(\n this.year,\n this.month,\n this.date,\n this.hours,\n this.minutes,\n this.seconds,\n this.getMilliseconds()\n ).setLocalization(this.localization);\n }\n\n static isValid(d): boolean {\n if (d === undefined || JSON.stringify(d) === 'null') return false;\n if (d.constructor.name === DateTime.name) return true;\n return false;\n }\n\n /**\n * Sets the current date to the start of the {@link unit} provided\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).startOf('month')\n * would return April 1, 2021, 12:00:00.000 AM (midnight)\n * @param unit\n * @param startOfTheWeek Allows for the changing the start of the week.\n */\n startOf(unit: Unit | 'weekDay', startOfTheWeek = 0): this {\n if (this[unit] === undefined)\n throw new Error(`Unit '${unit}' is not valid`);\n switch (unit) {\n case 'seconds':\n this.setMilliseconds(0);\n break;\n case 'minutes':\n this.setSeconds(0, 0);\n break;\n case 'hours':\n this.setMinutes(0, 0, 0);\n break;\n case 'date':\n this.setHours(0, 0, 0, 0);\n break;\n case 'weekDay': {\n this.startOf(Unit.date);\n if (this.weekDay === startOfTheWeek) break;\n const goBack = (this.weekDay - startOfTheWeek + 7) % 7;\n this.manipulate(goBack * -1, Unit.date);\n break;\n }\n case 'month':\n this.startOf(Unit.date);\n this.setDate(1);\n break;\n case 'year':\n this.startOf(Unit.date);\n this.setMonth(0, 1);\n break;\n }\n return this;\n }\n\n /**\n * Sets the current date to the end of the {@link unit} provided\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).endOf('month')\n * would return April 30, 2021, 11:59:59.999 PM\n * @param unit\n * @param startOfTheWeek\n */\n endOf(unit: Unit | 'weekDay', startOfTheWeek = 0): this {\n if (this[unit] === undefined)\n throw new Error(`Unit '${unit}' is not valid`);\n switch (unit) {\n case 'seconds':\n this.setMilliseconds(999);\n break;\n case 'minutes':\n this.setSeconds(59, 999);\n break;\n case 'hours':\n this.setMinutes(59, 59, 999);\n break;\n case 'date':\n this.setHours(23, 59, 59, 999);\n break;\n case 'weekDay': {\n this.endOf(Unit.date);\n const endOfWeek = 6 + startOfTheWeek;\n if (this.weekDay === endOfWeek) break;\n this.manipulate(endOfWeek - this.weekDay, Unit.date);\n break;\n }\n case 'month':\n this.endOf(Unit.date);\n this.manipulate(1, Unit.month);\n this.setDate(0);\n break;\n case 'year':\n this.endOf(Unit.date);\n this.setMonth(11, 31);\n break;\n }\n return this;\n }\n\n /**\n * Change a {@link unit} value. Value can be positive or negative\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).manipulate(1, 'month')\n * would return May 30, 2021, 11:45:32.984 AM\n * @param value A positive or negative number\n * @param unit\n */\n manipulate(value: number, unit: Unit): this {\n if (this[unit] === undefined)\n throw new Error(`Unit '${unit}' is not valid`);\n this[unit] += value;\n return this;\n }\n\n /**\n * Return true if {@link compare} is before this date\n * @param compare The Date/DateTime to compare\n * @param unit If provided, uses {@link startOf} for\n * comparison.\n */\n isBefore(compare: DateTime, unit?: Unit): boolean {\n // If the comparisons is undefined, return false\n if (!DateTime.isValid(compare)) return false;\n\n if (!unit) return this.valueOf() < compare.valueOf();\n if (this[unit] === undefined)\n throw new Error(`Unit '${unit}' is not valid`);\n return (\n this.clone.startOf(unit).valueOf() < compare.clone.startOf(unit).valueOf()\n );\n }\n\n /**\n * Return true if {@link compare} is after this date\n * @param compare The Date/DateTime to compare\n * @param unit If provided, uses {@link startOf} for\n * comparison.\n */\n isAfter(compare: DateTime, unit?: Unit): boolean {\n // If the comparisons is undefined, return false\n if (!DateTime.isValid(compare)) return false;\n\n if (!unit) return this.valueOf() > compare.valueOf();\n if (this[unit] === undefined)\n throw new Error(`Unit '${unit}' is not valid`);\n return (\n this.clone.startOf(unit).valueOf() > compare.clone.startOf(unit).valueOf()\n );\n }\n\n /**\n * Return true if {@link compare} is same this date\n * @param compare The Date/DateTime to compare\n * @param unit If provided, uses {@link startOf} for\n * comparison.\n */\n isSame(compare: DateTime, unit?: Unit): boolean {\n // If the comparisons is undefined, return false\n if (!DateTime.isValid(compare)) return false;\n\n if (!unit) return this.valueOf() === compare.valueOf();\n if (this[unit] === undefined)\n throw new Error(`Unit '${unit}' is not valid`);\n compare = DateTime.convert(compare);\n return (\n this.clone.startOf(unit).valueOf() === compare.startOf(unit).valueOf()\n );\n }\n\n /**\n * Check if this is between two other DateTimes, optionally looking at unit scale. The match is exclusive.\n * @param left\n * @param right\n * @param unit.\n * @param inclusivity. A [ indicates inclusion of a value. A ( indicates exclusion.\n * If the inclusivity parameter is used, both indicators must be passed.\n */\n isBetween(\n left: DateTime,\n right: DateTime,\n unit?: Unit,\n inclusivity: '()' | '[]' | '(]' | '[)' = '()'\n ): boolean {\n // If one of the comparisons is undefined, return false\n if (!DateTime.isValid(left) || !DateTime.isValid(right)) return false;\n // If a unit is provided and is not a valid property of the DateTime object, throw an error\n if (unit && this[unit] === undefined) {\n throw new Error(`Unit '${unit}' is not valid`);\n }\n\n const leftInclusivity = inclusivity[0] === '(';\n const rightInclusivity = inclusivity[1] === ')';\n\n const isLeftInRange = leftInclusivity\n ? this.isAfter(left, unit)\n : !this.isBefore(left, unit);\n const isRightInRange = rightInclusivity\n ? this.isBefore(right, unit)\n : !this.isAfter(right, unit);\n\n return isLeftInRange && isRightInRange;\n }\n\n /**\n * Returns flattened object of the date. Does not include literals\n * @param locale\n * @param template\n */\n parts(\n locale = this.localization.locale,\n template: Record = { dateStyle: 'full', timeStyle: 'long' }\n ): Record {\n const parts = {};\n new Intl.DateTimeFormat(locale, template)\n .formatToParts(this)\n .filter((x) => x.type !== 'literal')\n .forEach((x) => (parts[x.type] = x.value));\n return parts;\n }\n\n /**\n * Shortcut to Date.getSeconds()\n */\n get seconds(): number {\n return this.getSeconds();\n }\n\n /**\n * Shortcut to Date.setSeconds()\n */\n set seconds(value: number) {\n this.setSeconds(value);\n }\n\n /**\n * Returns two digit hours\n */\n get secondsFormatted(): string {\n return this.parts(undefined, twoDigitTemplate).second;\n }\n\n /**\n * Shortcut to Date.getMinutes()\n */\n get minutes(): number {\n return this.getMinutes();\n }\n\n /**\n * Shortcut to Date.setMinutes()\n */\n set minutes(value: number) {\n this.setMinutes(value);\n }\n\n /**\n * Returns two digit minutes\n */\n get minutesFormatted(): string {\n return this.parts(undefined, twoDigitTemplate).minute;\n }\n\n /**\n * Shortcut to Date.getHours()\n */\n get hours(): number {\n return this.getHours();\n }\n\n /**\n * Shortcut to Date.setHours()\n */\n set hours(value: number) {\n this.setHours(value);\n }\n\n /**\n * Returns two digit hour, e.g. 01...10\n * @param hourCycle Providing an hour cycle will change 00 to 24 depending on the given value.\n */\n getHoursFormatted(hourCycle: Intl.LocaleHourCycleKey = 'h12') {\n return this.parts(undefined, { ...twoDigitTemplate, hourCycle: hourCycle })\n .hour;\n }\n\n /**\n * Get the meridiem of the date. E.g. AM or PM.\n * If the {@link locale} provides a \"dayPeriod\" then this will be returned,\n * otherwise it will return AM or PM.\n * @param locale\n */\n meridiem(locale: string = this.localization.locale): string {\n return new Intl.DateTimeFormat(locale, {\n hour: 'numeric',\n hour12: true,\n })\n .formatToParts(this)\n .find((p) => p.type === 'dayPeriod')?.value;\n }\n\n /**\n * Shortcut to Date.getDate()\n */\n get date(): number {\n return this.getDate();\n }\n\n /**\n * Shortcut to Date.setDate()\n */\n set date(value: number) {\n this.setDate(value);\n }\n\n /**\n * Return two digit date\n */\n get dateFormatted(): string {\n return this.parts(undefined, twoDigitTemplate).day;\n }\n\n /**\n * Shortcut to Date.getDay()\n */\n get weekDay(): number {\n return this.getDay();\n }\n\n /**\n * Shortcut to Date.getMonth()\n */\n get month(): number {\n return this.getMonth();\n }\n\n /**\n * Shortcut to Date.setMonth()\n */\n set month(value: number) {\n const targetMonth = new Date(this.year, value + 1);\n targetMonth.setDate(0);\n const endOfMonth = targetMonth.getDate();\n if (this.date > endOfMonth) {\n this.date = endOfMonth;\n }\n this.setMonth(value);\n }\n\n /**\n * Return two digit, human expected month. E.g. January = 1, December = 12\n */\n get monthFormatted(): string {\n return this.parts(undefined, twoDigitTemplate).month;\n }\n\n /**\n * Shortcut to Date.getFullYear()\n */\n get year(): number {\n return this.getFullYear();\n }\n\n /**\n * Shortcut to Date.setFullYear()\n */\n set year(value: number) {\n this.setFullYear(value);\n }\n\n // borrowed a bunch of stuff from Luxon\n /**\n * Gets the week of the year\n */\n get week(): number {\n const ordinal = this.computeOrdinal(),\n weekday = this.getUTCDay();\n\n let weekNumber = Math.floor((ordinal - weekday + 10) / 7);\n\n if (weekNumber < 1) {\n weekNumber = this.weeksInWeekYear();\n } else if (weekNumber > this.weeksInWeekYear()) {\n weekNumber = 1;\n }\n\n return weekNumber;\n }\n\n /**\n * Returns the number of weeks in the year\n */\n weeksInWeekYear() {\n const p1 =\n (this.year +\n Math.floor(this.year / 4) -\n Math.floor(this.year / 100) +\n Math.floor(this.year / 400)) %\n 7,\n last = this.year - 1,\n p2 =\n (last +\n Math.floor(last / 4) -\n Math.floor(last / 100) +\n Math.floor(last / 400)) %\n 7;\n return p1 === 4 || p2 === 3 ? 53 : 52;\n }\n\n /**\n * Returns true or false depending on if the year is a leap year or not.\n */\n get isLeapYear() {\n return (\n this.year % 4 === 0 && (this.year % 100 !== 0 || this.year % 400 === 0)\n );\n }\n\n private computeOrdinal() {\n return (\n this.date +\n (this.isLeapYear ? this.leapLadder : this.nonLeapLadder)[this.month]\n );\n }\n\n private nonLeapLadder = [\n 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334,\n ];\n private leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];\n\n //#region CDF stuff\n\n private dateTimeRegex =\n //is regex cannot be simplified beyond what it already is\n /(\\[[^[\\]]*])|y{1,4}|M{1,4}|d{1,4}|H{1,2}|h{1,2}|t|T|m{1,2}|s{1,2}|f{3}/g; //NOSONAR\n\n private formattingTokens =\n /(\\[[^[\\]]*])|([-_:/.,()\\s]+)|(T|t|yyyy|yy?|MM?M?M?|Do|dd?|hh?|HH?|mm?|ss?)/g; //NOSONAR is regex cannot be simplified beyond what it already is\n\n /**\n * Returns a list of month values based on the current locale\n */\n private getAllMonths(\n format: '2-digit' | 'numeric' | 'long' | 'short' | 'narrow' = 'long'\n ) {\n const applyFormat = new Intl.DateTimeFormat(this.localization.locale, {\n month: format,\n }).format;\n return [...Array(12).keys()].map((m) => applyFormat(new Date(2021, m)));\n }\n\n /**\n * Replaces an expanded token set (e.g. LT/LTS)\n */\n private replaceTokens(formatStr, formats) {\n /***\n * _ => match\n * a => first capture group. Anything between [ and ]\n * b => second capture group\n */\n return formatStr.replace(\n /(\\[[^[\\]]*])|(LTS?|l{1,4}|L{1,4})/g,\n (_, a, b) => {\n const B = b && b.toUpperCase();\n return a || formats[B] || DefaultFormatLocalization.dateFormats[B];\n }\n );\n }\n\n private match2 = /\\d\\d/; // 00 - 99\n private match3 = /\\d{3}/; // 000 - 999\n private match4 = /\\d{4}/; // 0000 - 9999\n private match1to2 = /\\d\\d?/; // 0 - 99\n private matchSigned = /[+-]?\\d+/; // -inf - inf\n private matchOffset = /[+-]\\d\\d:?(\\d\\d)?|Z/; // +00:00 -00:00 +0000 or -0000 +00 or Z\n private matchWord = /[^\\d_:/,\\-()\\s]+/; // Word\n\n private parseTwoDigitYear(input: number) {\n return input + (input > 68 ? 1900 : 2000);\n }\n\n private offsetFromString(input: string) {\n if (!input) return 0;\n if (input === 'Z') return 0;\n const [first, second, third] = input.match(/([+-]|\\d\\d)/g);\n const minutes = +second * 60 + (+third || 0);\n const signed = first === '+' ? -minutes : minutes;\n return minutes === 0 ? 0 : signed; // eslint-disable-line no-nested-ternary\n }\n\n /**\n * z = -4, zz = -04, zzz = -0400\n * @param date\n * @param style\n * @private\n */\n private zoneInformation(date: DateTime, style: 'z' | 'zz' | 'zzz') {\n let name = date\n .parts(this.localization.locale, { timeZoneName: 'longOffset' })\n .timeZoneName.replace('GMT', '')\n .replace(':', '');\n\n const negative = name.includes('-');\n\n name = name.replace('-', '');\n\n if (style === 'z') name = name.substring(1, 2);\n else if (style === 'zz') name = name.substring(0, 2);\n\n return `${negative ? '-' : ''}${name}`;\n }\n\n private zoneExpressions = [\n this.matchOffset,\n (obj, input) => {\n obj.offset = this.offsetFromString(input);\n },\n ];\n\n private addInput(property) {\n return (obj, input) => {\n obj[property] = +input;\n };\n }\n\n private getLocaleAfternoon(): string {\n return new Intl.DateTimeFormat(this.localization.locale, {\n hour: 'numeric',\n hour12: true,\n })\n .formatToParts(new Date(2022, 3, 4, 13))\n .find((p) => p.type === 'dayPeriod')\n ?.value?.replace(/\\s+/g, ' ');\n }\n\n private meridiemMatch(input: string) {\n return input.toLowerCase() === this.getLocaleAfternoon().toLowerCase();\n }\n\n private expressions: FormatExpression = {\n t: {\n pattern: undefined, //this.matchWord,\n parser: (obj, input) => {\n obj.afternoon = this.meridiemMatch(input);\n },\n },\n T: {\n pattern: undefined, //this.matchWord,\n parser: (obj, input) => {\n obj.afternoon = this.meridiemMatch(input);\n },\n },\n fff: {\n pattern: this.match3,\n parser: (obj, input) => {\n obj.milliseconds = +input;\n },\n },\n s: {\n pattern: this.match1to2,\n parser: this.addInput('seconds'),\n },\n ss: {\n pattern: this.match1to2,\n parser: this.addInput('seconds'),\n },\n m: {\n pattern: this.match1to2,\n parser: this.addInput('minutes'),\n },\n mm: {\n pattern: this.match1to2,\n parser: this.addInput('minutes'),\n },\n H: {\n pattern: this.match1to2,\n parser: this.addInput('hours'),\n },\n h: {\n pattern: this.match1to2,\n parser: this.addInput('hours'),\n },\n HH: {\n pattern: this.match1to2,\n parser: this.addInput('hours'),\n },\n hh: {\n pattern: this.match1to2,\n parser: this.addInput('hours'),\n },\n d: {\n pattern: this.match1to2,\n parser: this.addInput('day'),\n },\n dd: {\n pattern: this.match2,\n parser: this.addInput('day'),\n },\n Do: {\n pattern: this.matchWord,\n parser: (obj, input) => {\n obj.day = +(input.match(/\\d+/)[0] || 1);\n if (!this.localization.ordinal) return;\n for (let i = 1; i <= 31; i += 1) {\n if (this.localization.ordinal(i).replace(/[[\\]]/g, '') === input) {\n obj.day = i;\n }\n }\n },\n },\n M: {\n pattern: this.match1to2,\n parser: this.addInput('month'),\n },\n MM: {\n pattern: this.match2,\n parser: this.addInput('month'),\n },\n MMM: {\n pattern: this.matchWord,\n parser: (obj, input) => {\n const months = this.getAllMonths();\n const monthsShort = this.getAllMonths('short');\n const matchIndex =\n (monthsShort || months.map((_) => _.slice(0, 3))).indexOf(input) + 1;\n if (matchIndex < 1) {\n throw new Error();\n }\n obj.month = matchIndex % 12 || matchIndex;\n },\n },\n MMMM: {\n pattern: this.matchWord,\n parser: (obj, input) => {\n const months = this.getAllMonths();\n const matchIndex = months.indexOf(input) + 1;\n if (matchIndex < 1) {\n throw new Error();\n }\n obj.month = matchIndex % 12 || matchIndex;\n },\n },\n y: {\n pattern: this.matchSigned,\n parser: this.addInput('year'),\n },\n yy: {\n pattern: this.match2,\n parser: (obj, input) => {\n obj.year = this.parseTwoDigitYear(+input);\n },\n },\n yyyy: {\n pattern: this.match4,\n parser: this.addInput('year'),\n },\n // z: this.zoneExpressions,\n // zz: this.zoneExpressions,\n // zzz: this.zoneExpressions\n };\n\n private correctHours(time) {\n const { afternoon } = time;\n if (afternoon !== undefined) {\n const { hours } = time;\n if (afternoon) {\n if (hours < 12) {\n time.hours += 12;\n }\n } else if (hours === 12) {\n time.hours = 0;\n }\n delete time.afternoon;\n }\n }\n\n private makeParser(format: string) {\n format = this.replaceTokens(format, this.localization.dateFormats);\n const matchArray = format.match(this.formattingTokens);\n const { length } = matchArray;\n const expressionArray: (FormatMatch | string)[] = [];\n for (let i = 0; i < length; i += 1) {\n const token = matchArray[i];\n const expression = this.expressions[token] as FormatMatch;\n if (expression?.parser) {\n expressionArray[i] = expression;\n } else {\n expressionArray[i] = (token as string).replace(/^\\[[^[\\]]*]$/g, '');\n }\n }\n\n return (input: string): parsedTime => {\n const time = {\n hours: 0,\n minutes: 0,\n seconds: 0,\n milliseconds: 0,\n };\n for (let i = 0, start = 0; i < length; i += 1) {\n const token = expressionArray[i];\n if (typeof token === 'string') {\n start += token.length;\n } else {\n const part = input.slice(start);\n let value = part;\n\n if (token.pattern) {\n const match = token.pattern.exec(part);\n value = match[0];\n }\n token.parser.call(this, time, value);\n input = input.replace(value, '');\n }\n }\n this.correctHours(time);\n return time;\n };\n }\n\n /**\n * Attempts to create a DateTime from a string.\n * @param input date as string\n * @param localization provides the date template the string is in via the format property\n */\n //eslint-disable-next-line @typescript-eslint/no-unused-vars\n static fromString(input: string, localization: FormatLocalization): DateTime {\n if (!localization?.format) {\n Namespace.errorMessages.customDateFormatError('No format was provided');\n }\n try {\n const dt = new DateTime();\n dt.setLocalization(localization);\n if (['x', 'X'].indexOf(localization.format) > -1)\n return new DateTime((localization.format === 'X' ? 1000 : 1) * +input);\n\n input = input.replace(/\\s+/g, ' ');\n const parser = dt.makeParser(localization.format);\n const { year, month, day, hours, minutes, seconds, milliseconds, zone } =\n parser(input);\n const d = day || (!year && !month ? dt.getDate() : 1);\n const y = year || dt.getFullYear();\n let M = 0;\n if (!(year && !month)) {\n M = month > 0 ? month - 1 : dt.getMonth();\n }\n if (zone) {\n return new DateTime(\n Date.UTC(\n y,\n M,\n d,\n hours,\n minutes,\n seconds,\n milliseconds + zone.offset * 60 * 1000\n )\n );\n }\n return new DateTime(y, M, d, hours, minutes, seconds, milliseconds);\n } catch (e) {\n Namespace.errorMessages.customDateFormatError(\n `Unable to parse provided input: ${input}, format: ${localization.format}`\n );\n }\n }\n\n /**\n * Returns a string format.\n * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat\n * for valid templates and locale objects\n * @param template An optional object. If provided, method will use Intl., otherwise the localizations format properties\n * @param locale Can be a string or an array of strings. Uses browser defaults otherwise.\n */\n format(\n template?: DateTimeFormatOptions | string,\n locale = this.localization.locale\n ): string {\n if (template && typeof template === 'object')\n return new Intl.DateTimeFormat(locale, template).format(this);\n\n const formatString = this.replaceTokens(\n //try template first\n template ||\n //otherwise try localization format\n this.localization.format ||\n //otherwise try date + time\n `${DefaultFormatLocalization.dateFormats.L}, ${DefaultFormatLocalization.dateFormats.LT}`,\n this.localization.dateFormats\n );\n\n const formatter = (template) =>\n new Intl.DateTimeFormat(this.localization.locale, template).format(this);\n\n if (!this.localization.hourCycle)\n this.localization.hourCycle = guessHourCycle(this.localization.locale);\n\n //if the format asks for a twenty-four-hour string but the hour cycle is not, then make a base guess\n const HHCycle = this.localization.hourCycle.startsWith('h1')\n ? 'h24'\n : this.localization.hourCycle;\n const hhCycle = this.localization.hourCycle.startsWith('h2')\n ? 'h12'\n : this.localization.hourCycle;\n\n const matches = {\n y: this.year,\n yy: formatter({ year: '2-digit' }),\n yyyy: this.year,\n M: formatter({ month: 'numeric' }),\n MM: this.monthFormatted,\n MMM: this.getAllMonths('short')[this.getMonth()],\n MMMM: this.getAllMonths()[this.getMonth()],\n d: this.date,\n dd: this.dateFormatted,\n ddd: formatter({ weekday: 'short' }),\n dddd: formatter({ weekday: 'long' }),\n H: this.getHours(),\n HH: this.getHoursFormatted(HHCycle),\n h: this.hours > 12 ? this.hours - 12 : this.hours,\n hh: this.getHoursFormatted(hhCycle),\n t: this.meridiem(),\n T: this.meridiem().toUpperCase(),\n m: this.minutes,\n mm: this.minutesFormatted,\n s: this.seconds,\n ss: this.secondsFormatted,\n fff: this.getMilliseconds(),\n // z: this.zoneInformation(dateTime, 'z'), //-4\n // zz: this.zoneInformation(dateTime, 'zz'), //-04\n // zzz: this.zoneInformation(dateTime, 'zzz') //-0400\n };\n\n return formatString\n .replace(this.dateTimeRegex, (match, $1) => {\n return $1 || matches[match];\n })\n .replace(/\\[/g, '')\n .replace(/]/g, '');\n }\n\n //#endregion CDF stuff\n}\n","//eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport declare type Constructable = new (...args: any[]) => T;\n\nclass ServiceLocator {\n private cache: Map, unknown | symbol> = new Map();\n\n locate(identifier: Constructable): T {\n const service = this.cache.get(identifier);\n if (service) return service as T;\n const value = new identifier();\n this.cache.set(identifier, value);\n return value;\n }\n}\nexport const setupServiceLocator = () => {\n serviceLocator = new ServiceLocator();\n};\n\nexport let serviceLocator: ServiceLocator;\n","import { Unit } from '../datetime';\nimport Namespace from './namespace';\nimport ViewMode from './view-mode';\n\nconst CalendarModes: {\n name: keyof ViewMode;\n className: string;\n unit: Unit;\n step: number;\n}[] = [\n {\n name: 'calendar',\n className: Namespace.css.daysContainer,\n unit: Unit.month,\n step: 1,\n },\n {\n name: 'months',\n className: Namespace.css.monthsContainer,\n unit: Unit.year,\n step: 1,\n },\n {\n name: 'years',\n className: Namespace.css.yearsContainer,\n unit: Unit.year,\n step: 10,\n },\n {\n name: 'decades',\n className: Namespace.css.decadesContainer,\n unit: Unit.year,\n step: 100,\n },\n];\n\nexport default CalendarModes;\n","import { DateTime } from '../datetime';\nimport CalendarModes from './calendar-modes';\nimport ViewMode from './view-mode';\nimport Options from './options';\n\nexport class OptionsStore {\n options: Options;\n element: HTMLElement;\n input: HTMLInputElement;\n unset: boolean;\n private _currentCalendarViewMode = 0;\n\n get currentCalendarViewMode() {\n return this._currentCalendarViewMode;\n }\n\n set currentCalendarViewMode(value) {\n this._currentCalendarViewMode = value;\n this.currentView = CalendarModes[value].name;\n }\n\n _viewDate = new DateTime();\n\n get viewDate() {\n return this._viewDate;\n }\n\n set viewDate(v) {\n this._viewDate = v;\n if (this.options) this.options.viewDate = v;\n }\n\n /**\n * When switching back to the calendar from the clock,\n * this sets currentView to the correct calendar view.\n */\n refreshCurrentView() {\n this.currentView = CalendarModes[this.currentCalendarViewMode].name;\n }\n\n minimumCalendarViewMode = 0;\n currentView: keyof ViewMode = 'calendar';\n\n get isTwelveHour() {\n return ['h12', 'h11'].includes(this.options.localization.hourCycle);\n }\n}\n","import { DateTime, Unit } from './datetime';\nimport { serviceLocator } from './utilities/service-locator';\nimport { OptionsStore } from './utilities/optionsStore';\n\n/**\n * Main class for date validation rules based on the options provided.\n */\nexport default class Validation {\n private optionsStore: OptionsStore;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n }\n\n /**\n * Checks to see if the target date is valid based on the rules provided in the options.\n * Granularity can be provided to check portions of the date instead of the whole.\n * @param targetDate\n * @param granularity\n */\n isValid(targetDate: DateTime, granularity?: Unit): boolean {\n if (!this._enabledDisabledDatesIsValid(granularity, targetDate))\n return false;\n\n if (\n granularity !== Unit.month &&\n granularity !== Unit.year &&\n this.optionsStore.options.restrictions.daysOfWeekDisabled?.length > 0 &&\n this.optionsStore.options.restrictions.daysOfWeekDisabled.indexOf(\n targetDate.weekDay\n ) !== -1\n )\n return false;\n\n if (!this._minMaxIsValid(granularity, targetDate)) return false;\n\n if (\n granularity === Unit.hours ||\n granularity === Unit.minutes ||\n granularity === Unit.seconds\n ) {\n if (!this._enabledDisabledHoursIsValid(targetDate)) return false;\n\n if (\n this.optionsStore.options.restrictions.disabledTimeIntervals?.filter(\n (internal) => targetDate.isBetween(internal.from, internal.to)\n ).length !== 0\n )\n return false;\n }\n\n return true;\n }\n\n private _enabledDisabledDatesIsValid(\n granularity: Unit,\n targetDate: DateTime\n ): boolean {\n if (granularity !== Unit.date) return true;\n\n if (\n this.optionsStore.options.restrictions.disabledDates.length > 0 &&\n this._isInDisabledDates(targetDate)\n ) {\n return false;\n }\n\n // noinspection RedundantIfStatementJS\n if (\n this.optionsStore.options.restrictions.enabledDates.length > 0 &&\n !this._isInEnabledDates(targetDate)\n ) {\n return false;\n }\n\n return true;\n }\n\n /**\n * Checks to see if the disabledDates option is in use and returns true (meaning invalid)\n * if the `testDate` is with in the array. Granularity is by date.\n * @param testDate\n * @private\n */\n private _isInDisabledDates(testDate: DateTime) {\n if (\n !this.optionsStore.options.restrictions.disabledDates ||\n this.optionsStore.options.restrictions.disabledDates.length === 0\n )\n return false;\n\n return !!this.optionsStore.options.restrictions.disabledDates.find((x) =>\n x.isSame(testDate, Unit.date)\n );\n }\n\n /**\n * Checks to see if the enabledDates option is in use and returns true (meaning valid)\n * if the `testDate` is with in the array. Granularity is by date.\n * @param testDate\n * @private\n */\n private _isInEnabledDates(testDate: DateTime) {\n if (\n !this.optionsStore.options.restrictions.enabledDates ||\n this.optionsStore.options.restrictions.enabledDates.length === 0\n )\n return true;\n\n return !!this.optionsStore.options.restrictions.enabledDates.find((x) =>\n x.isSame(testDate, Unit.date)\n );\n }\n\n private _minMaxIsValid(granularity: Unit, targetDate: DateTime) {\n if (\n this.optionsStore.options.restrictions.minDate &&\n targetDate.isBefore(\n this.optionsStore.options.restrictions.minDate,\n granularity\n )\n ) {\n return false;\n }\n\n // noinspection RedundantIfStatementJS\n if (\n this.optionsStore.options.restrictions.maxDate &&\n targetDate.isAfter(\n this.optionsStore.options.restrictions.maxDate,\n granularity\n )\n ) {\n return false;\n }\n\n return true;\n }\n\n private _enabledDisabledHoursIsValid(targetDate) {\n if (\n this.optionsStore.options.restrictions.disabledHours.length > 0 &&\n this._isInDisabledHours(targetDate)\n ) {\n return false;\n }\n\n // noinspection RedundantIfStatementJS\n if (\n this.optionsStore.options.restrictions.enabledHours.length > 0 &&\n !this._isInEnabledHours(targetDate)\n ) {\n return false;\n }\n\n return true;\n }\n\n /**\n * Checks to see if the disabledHours option is in use and returns true (meaning invalid)\n * if the `testDate` is with in the array. Granularity is by hours.\n * @param testDate\n * @private\n */\n private _isInDisabledHours(testDate: DateTime) {\n if (\n !this.optionsStore.options.restrictions.disabledHours ||\n this.optionsStore.options.restrictions.disabledHours.length === 0\n )\n return false;\n\n const formattedDate = testDate.hours;\n return this.optionsStore.options.restrictions.disabledHours.includes(\n formattedDate\n );\n }\n\n /**\n * Checks to see if the enabledHours option is in use and returns true (meaning valid)\n * if the `testDate` is with in the array. Granularity is by hours.\n * @param testDate\n * @private\n */\n private _isInEnabledHours(testDate: DateTime) {\n if (\n !this.optionsStore.options.restrictions.enabledHours ||\n this.optionsStore.options.restrictions.enabledHours.length === 0\n )\n return true;\n\n const formattedDate = testDate.hours;\n return this.optionsStore.options.restrictions.enabledHours.includes(\n formattedDate\n );\n }\n\n dateRangeIsValid(dates: DateTime[], index: number, target: DateTime) {\n // if we're not using the option, then return valid\n if (!this.optionsStore.options.dateRange) return true;\n\n // if we've only selected 0..1 dates, and we're not setting the end date\n // then return valid. We only want to validate the range if both are selected,\n // because the other validation on the target has already occurred.\n if (dates.length !== 2 && index !== 1) return true;\n\n // initialize start date\n const start = dates[0].clone;\n // check if start date is not the same as target date\n if (start.isSame(target, Unit.date)) return true;\n\n // add one day to start; start has already been validated\n start.manipulate(1, Unit.date);\n\n // check each date in the range to make sure it's valid\n while (!start.isSame(target, Unit.date)) {\n const valid = this.isValid(start, Unit.date);\n if (!valid) return false;\n start.manipulate(1, Unit.date);\n }\n\n return true;\n }\n}\n","import { DateTime, Unit } from '../datetime';\nimport ActionTypes from './action-types';\nimport { BaseEvent } from './event-types';\n\nexport type ViewUpdateValues = Unit | 'decade' | 'clock' | 'calendar' | 'all';\n\nclass EventEmitter {\n private subscribers: ((value?: T) => void)[] = [];\n\n subscribe(callback: (value: T) => void) {\n this.subscribers.push(callback);\n return this.unsubscribe.bind(this, this.subscribers.length - 1);\n }\n\n unsubscribe(index: number) {\n this.subscribers.splice(index, 1);\n }\n\n emit(value?: T) {\n this.subscribers.forEach((callback) => {\n callback(value);\n });\n }\n\n destroy() {\n this.subscribers = null;\n this.subscribers = [];\n }\n}\n\nexport class EventEmitters {\n triggerEvent = new EventEmitter();\n viewUpdate = new EventEmitter();\n updateDisplay = new EventEmitter();\n action = new EventEmitter<{ e: any; action?: ActionTypes }>(); //eslint-disable-line @typescript-eslint/no-explicit-any\n updateViewDate = new EventEmitter();\n\n destroy() {\n this.triggerEvent.destroy();\n this.viewUpdate.destroy();\n this.updateDisplay.destroy();\n this.action.destroy();\n this.updateViewDate.destroy();\n }\n}\n","import Options, { Localization } from './options';\nimport { DateTime } from '../datetime';\nimport DefaultFormatLocalization from './default-format-localization';\n\nconst defaultEnLocalization: Localization = {\n clear: 'Clear selection',\n close: 'Close the picker',\n dateFormats: DefaultFormatLocalization.dateFormats,\n dayViewHeaderFormat: { month: 'long', year: '2-digit' },\n decrementHour: 'Decrement Hour',\n decrementMinute: 'Decrement Minute',\n decrementSecond: 'Decrement Second',\n format: DefaultFormatLocalization.format,\n hourCycle: DefaultFormatLocalization.hourCycle,\n incrementHour: 'Increment Hour',\n incrementMinute: 'Increment Minute',\n incrementSecond: 'Increment Second',\n locale: DefaultFormatLocalization.locale,\n maxWeekdayLength: 0,\n nextCentury: 'Next Century',\n nextDecade: 'Next Decade',\n nextMonth: 'Next Month',\n nextYear: 'Next Year',\n ordinal: DefaultFormatLocalization.ordinal,\n pickHour: 'Pick Hour',\n pickMinute: 'Pick Minute',\n pickSecond: 'Pick Second',\n previousCentury: 'Previous Century',\n previousDecade: 'Previous Decade',\n previousMonth: 'Previous Month',\n previousYear: 'Previous Year',\n selectDate: 'Select Date',\n selectDecade: 'Select Decade',\n selectMonth: 'Select Month',\n selectTime: 'Select Time',\n selectYear: 'Select Year',\n startOfTheWeek: 0,\n today: 'Go to today',\n toggleMeridiem: 'Toggle Meridiem',\n};\n\nconst DefaultOptions: Options = {\n allowInputToggle: false,\n container: undefined,\n dateRange: false,\n debug: false,\n defaultDate: undefined,\n display: {\n icons: {\n type: 'icons',\n time: 'fa-solid fa-clock',\n date: 'fa-solid fa-calendar',\n up: 'fa-solid fa-arrow-up',\n down: 'fa-solid fa-arrow-down',\n previous: 'fa-solid fa-chevron-left',\n next: 'fa-solid fa-chevron-right',\n today: 'fa-solid fa-calendar-check',\n clear: 'fa-solid fa-trash',\n close: 'fa-solid fa-xmark',\n },\n sideBySide: false,\n calendarWeeks: false,\n viewMode: 'calendar',\n toolbarPlacement: 'bottom',\n keepOpen: false,\n buttons: {\n today: false,\n clear: false,\n close: false,\n },\n components: {\n calendar: true,\n date: true,\n month: true,\n year: true,\n decades: true,\n clock: true,\n hours: true,\n minutes: true,\n seconds: false,\n useTwentyfourHour: undefined,\n },\n inline: false,\n theme: 'auto',\n placement: 'bottom',\n },\n keepInvalid: false,\n localization: defaultEnLocalization,\n meta: {},\n multipleDates: false,\n multipleDatesSeparator: '; ',\n promptTimeOnDateChange: false,\n promptTimeOnDateChangeTransitionDelay: 200,\n restrictions: {\n minDate: undefined,\n maxDate: undefined,\n disabledDates: [],\n enabledDates: [],\n daysOfWeekDisabled: [],\n disabledTimeIntervals: [],\n disabledHours: [],\n enabledHours: [],\n },\n stepping: 1,\n useCurrent: true,\n viewDate: new DateTime(),\n};\n\nexport default DefaultOptions;\nexport const DefaultEnLocalization = { ...defaultEnLocalization };\n","import Namespace from './namespace';\nimport { DateTime } from '../datetime';\nimport { FormatLocalization } from './options';\nimport DefaultFormatLocalization from './default-format-localization';\n\n/**\n * Attempts to prove `d` is a DateTime or Date or can be converted into one.\n * @param d If a string will attempt creating a date from it.\n * @param localization object containing locale and format settings. Only used with the custom formats\n * @private\n */\nexport function tryConvertToDateTime(\n this: void,\n d: DateTime | Date | string,\n localization: FormatLocalization\n): DateTime | null {\n if (!d) return null;\n if (d.constructor.name === DateTime.name) return d as DateTime;\n if (d.constructor.name === Date.name) {\n return DateTime.convert(d as Date);\n }\n if (typeof d === typeof '') {\n const dateTime = DateTime.fromString(d as unknown as string, localization);\n if (JSON.stringify(dateTime) === 'null') {\n return null;\n }\n return dateTime;\n }\n return null;\n}\n\n/**\n * Attempts to convert `d` to a DateTime object\n * @param d value to convert\n * @param optionName Provides text to error messages e.g. disabledDates\n * @param localization object containing locale and format settings. Only used with the custom formats\n */\nexport function convertToDateTime(\n this: void,\n d: DateTime | Date | string,\n optionName: string,\n localization: FormatLocalization\n): DateTime {\n if (typeof d === typeof '' && optionName !== 'input') {\n Namespace.errorMessages.dateString();\n }\n\n const converted = tryConvertToDateTime(d, localization);\n\n if (!converted) {\n Namespace.errorMessages.failedToParseDate(\n optionName,\n d,\n optionName === 'input'\n );\n }\n return converted;\n}\n\n/**\n * Type checks that `value` is an array of Date or DateTime\n * @param optionName Provides text to error messages e.g. disabledDates\n * @param value Option value\n * @param providedType Used to provide text to error messages\n * @param localization\n */\nexport function typeCheckDateArray(\n this: void,\n optionName: string,\n value: any, //eslint-disable-line @typescript-eslint/no-explicit-any\n providedType: string,\n localization: FormatLocalization = DefaultFormatLocalization\n) {\n if (!Array.isArray(value)) {\n Namespace.errorMessages.typeMismatch(\n optionName,\n providedType,\n 'array of DateTime or Date'\n );\n }\n for (let i = 0; i < value.length; i++) {\n const d = value[i];\n const dateTime = convertToDateTime(d, optionName, localization);\n dateTime.setLocalization(localization);\n value[i] = dateTime;\n }\n}\n\n/**\n * Type checks that `value` is an array of numbers\n * @param optionName Provides text to error messages e.g. disabledDates\n * @param value Option value\n * @param providedType Used to provide text to error messages\n */\nexport function typeCheckNumberArray(\n this: void,\n optionName: string,\n value: any, //eslint-disable-line @typescript-eslint/no-explicit-any\n providedType: string\n) {\n if (!Array.isArray(value) || value.some((x) => typeof x !== typeof 0)) {\n Namespace.errorMessages.typeMismatch(\n optionName,\n providedType,\n 'array of numbers'\n );\n }\n}\n","import Namespace from './namespace';\nimport type { FormatLocalization } from './options';\nimport {\n convertToDateTime,\n typeCheckNumberArray,\n typeCheckDateArray,\n} from './typeChecker';\n\ninterface OptionProcessorFunctionArguments {\n key: string;\n value: any; //eslint-disable-line @typescript-eslint/no-explicit-any\n providedType: string;\n defaultType: string;\n path: string;\n localization: FormatLocalization;\n}\n\ntype OptionProcessorFunction = (\n this: void,\n args: OptionProcessorFunctionArguments\n) => any; //eslint-disable-line @typescript-eslint/no-explicit-any\n\nfunction mandatoryDate(key: string): OptionProcessorFunction {\n return ({ value, providedType, localization }) => {\n const dateTime = convertToDateTime(value, key, localization);\n if (dateTime !== undefined) {\n dateTime.setLocalization(localization);\n return dateTime;\n }\n };\n}\n\nfunction optionalDate(key: string): OptionProcessorFunction {\n const mandatory = mandatoryDate(key);\n return (args) => {\n if (args.value === undefined) {\n return args.value;\n }\n return mandatory(args);\n };\n}\n\nfunction numbersInRange(\n key: string,\n lower: number,\n upper: number\n): OptionProcessorFunction {\n return ({ value, providedType }) => {\n if (value === undefined) {\n return [];\n }\n typeCheckNumberArray(key, value, providedType);\n if ((value as number[]).some((x) => x < lower || x > upper))\n Namespace.errorMessages.numbersOutOfRange(key, lower, upper);\n return value;\n };\n}\n\nfunction validHourRange(key: string): OptionProcessorFunction {\n return numbersInRange(key, 0, 23);\n}\n\nfunction validDateArray(key: string): OptionProcessorFunction {\n return ({ value, providedType, localization }) => {\n if (value === undefined) {\n return [];\n }\n typeCheckDateArray(key, value, providedType, localization);\n return value;\n };\n}\n\nfunction validKeyOption(keyOptions: string[]): OptionProcessorFunction {\n return ({ value, path }) => {\n if (!keyOptions.includes(value))\n Namespace.errorMessages.unexpectedOptionValue(\n path.substring(1),\n value,\n keyOptions\n );\n return value;\n };\n}\n\nconst optionProcessors: { [key: string]: OptionProcessorFunction } =\n Object.freeze({\n defaultDate: mandatoryDate('defaultDate'),\n viewDate: mandatoryDate('viewDate'),\n minDate: optionalDate('restrictions.minDate'),\n maxDate: optionalDate('restrictions.maxDate'),\n disabledHours: validHourRange('restrictions.disabledHours'),\n enabledHours: validHourRange('restrictions.enabledHours'),\n disabledDates: validDateArray('restrictions.disabledDates'),\n enabledDates: validDateArray('restrictions.enabledDates'),\n daysOfWeekDisabled: numbersInRange('restrictions.daysOfWeekDisabled', 0, 6),\n disabledTimeIntervals: ({ key, value, providedType, localization }) => {\n if (value === undefined) {\n return [];\n }\n if (!Array.isArray(value)) {\n Namespace.errorMessages.typeMismatch(\n key,\n providedType,\n 'array of { from: DateTime|Date, to: DateTime|Date }'\n );\n }\n const valueObject = value as { from: any; to: any }[]; //eslint-disable-line @typescript-eslint/no-explicit-any\n for (let i = 0; i < valueObject.length; i++) {\n Object.keys(valueObject[i]).forEach((vk) => {\n const subOptionName = `${key}[${i}].${vk}`;\n const d = valueObject[i][vk];\n const dateTime = convertToDateTime(d, subOptionName, localization);\n dateTime.setLocalization(localization);\n valueObject[i][vk] = dateTime;\n });\n }\n return valueObject;\n },\n toolbarPlacement: validKeyOption(['top', 'bottom', 'default']),\n type: validKeyOption(['icons', 'sprites']),\n viewMode: validKeyOption([\n 'clock',\n 'calendar',\n 'months',\n 'years',\n 'decades',\n ]),\n theme: validKeyOption(['light', 'dark', 'auto']),\n placement: validKeyOption(['top', 'bottom']),\n meta: ({ value }) => value,\n dayViewHeaderFormat: ({ value }) => value,\n container: ({ value, path }) => {\n if (\n value &&\n !(\n value instanceof HTMLElement ||\n value instanceof Element ||\n value?.appendChild\n )\n ) {\n Namespace.errorMessages.typeMismatch(\n path.substring(1),\n typeof value,\n 'HTMLElement'\n );\n }\n return value;\n },\n useTwentyfourHour: ({ value, path, providedType, defaultType }) => {\n Namespace.errorMessages.deprecatedWarning(\n 'useTwentyfourHour',\n 'Please use \"options.localization.hourCycle\" instead'\n );\n if (value === undefined || providedType === 'boolean') return value;\n Namespace.errorMessages.typeMismatch(path, providedType, defaultType);\n },\n hourCycle: validKeyOption(['h11', 'h12', 'h23', 'h24']),\n });\n\nconst defaultProcessor: OptionProcessorFunction = ({\n value,\n defaultType,\n providedType,\n path,\n}) => {\n switch (defaultType) {\n case 'boolean':\n return value === 'true' || value === true;\n case 'number':\n return +value;\n case 'string':\n return value.toString();\n case 'object':\n return {};\n case 'function':\n return value;\n default:\n Namespace.errorMessages.typeMismatch(path, providedType, defaultType);\n }\n};\n\nexport function processKey(this: void, args: OptionProcessorFunctionArguments) {\n return (optionProcessors[args.key] || defaultProcessor)(args);\n}\n","import Namespace from './namespace';\nimport { DateTime } from '../datetime';\nimport DefaultOptions from './default-options';\nimport Options, { FormatLocalization } from './options';\nimport { processKey } from './optionProcessor';\nimport {\n convertToDateTime,\n tryConvertToDateTime,\n typeCheckDateArray,\n typeCheckNumberArray,\n} from './typeChecker';\n\nexport class OptionConverter {\n private static ignoreProperties = [\n 'meta',\n 'dayViewHeaderFormat',\n 'container',\n 'dateForms',\n 'ordinal',\n ];\n\n static deepCopy(input): Options {\n const o = {};\n\n Object.keys(input).forEach((key) => {\n const inputElement = input[key];\n\n if (inputElement instanceof DateTime) {\n o[key] = inputElement.clone;\n return;\n } else if (inputElement instanceof Date) {\n o[key] = new Date(inputElement.valueOf());\n return;\n }\n\n o[key] = inputElement;\n if (\n typeof inputElement !== 'object' ||\n inputElement instanceof HTMLElement ||\n inputElement instanceof Element\n )\n return;\n if (!Array.isArray(inputElement)) {\n o[key] = OptionConverter.deepCopy(inputElement);\n }\n });\n\n return o;\n }\n\n private static isValue = (a) => a != null; // everything except undefined + null\n\n /**\n * Finds value out of an object based on a string, period delimited, path\n * @param paths\n * @param obj\n */\n static objectPath(paths: string, obj) {\n if (paths.charAt(0) === '.') paths = paths.slice(1);\n if (!paths) return obj;\n return paths\n .split('.')\n .reduce(\n (value, key) =>\n OptionConverter.isValue(value) || OptionConverter.isValue(value[key])\n ? value[key]\n : undefined,\n obj\n );\n }\n\n /**\n * The spread operator caused sub keys to be missing after merging.\n * This is to fix that issue by using spread on the child objects first.\n * Also handles complex options like disabledDates\n * @param provided An option from new providedOptions\n * @param copyTo Destination object. This was added to prevent reference copies\n * @param localization\n * @param path\n */\n static spread(provided, copyTo, localization: FormatLocalization, path = '') {\n const defaultOptions = OptionConverter.objectPath(path, DefaultOptions);\n\n const unsupportedOptions = Object.keys(provided).filter(\n (x) => !Object.keys(defaultOptions).includes(x)\n );\n\n if (unsupportedOptions.length > 0) {\n const flattenedOptions = OptionConverter.getFlattenDefaultOptions();\n\n const errors = unsupportedOptions.map((x) => {\n let error = `\"${path}.${x}\" in not a known option.`;\n const didYouMean = flattenedOptions.find((y) => y.includes(x));\n if (didYouMean) error += ` Did you mean \"${didYouMean}\"?`;\n return error;\n });\n Namespace.errorMessages.unexpectedOptions(errors);\n }\n\n Object.keys(provided)\n .filter((key) => key !== '__proto__' && key !== 'constructor')\n .forEach((key) => {\n path += `.${key}`;\n if (path.charAt(0) === '.') path = path.slice(1);\n\n const defaultOptionValue = defaultOptions[key];\n const providedType = typeof provided[key];\n const defaultType = typeof defaultOptionValue;\n const value = provided[key];\n\n if (value === undefined || value === null) {\n copyTo[key] = value;\n path = path.substring(0, path.lastIndexOf(`.${key}`));\n return;\n }\n\n if (\n typeof defaultOptionValue === 'object' &&\n !Array.isArray(provided[key]) &&\n !(\n defaultOptionValue instanceof Date ||\n OptionConverter.ignoreProperties.includes(key)\n )\n ) {\n OptionConverter.spread(\n provided[key],\n copyTo[key],\n localization,\n path\n );\n } else {\n copyTo[key] = OptionConverter.processKey(\n key,\n value,\n providedType,\n defaultType,\n path,\n localization\n );\n }\n\n path = path.substring(0, path.lastIndexOf(`.${key}`));\n });\n }\n\n static processKey(\n key: string,\n value: any, //eslint-disable-line @typescript-eslint/no-explicit-any\n providedType: string,\n defaultType: string,\n path: string,\n localization: FormatLocalization\n ) {\n return processKey({\n key,\n value,\n providedType,\n defaultType,\n path,\n localization,\n });\n }\n\n static _mergeOptions(providedOptions: Options, mergeTo: Options): Options {\n const newConfig = OptionConverter.deepCopy(mergeTo);\n //see if the options specify a locale\n const localization =\n mergeTo.localization?.locale !== 'default'\n ? mergeTo.localization\n : providedOptions?.localization || DefaultOptions.localization;\n\n OptionConverter.spread(providedOptions, newConfig, localization, '');\n\n return newConfig;\n }\n\n static _dataToOptions(element, options: Options): Options {\n const eData = JSON.parse(JSON.stringify(element.dataset));\n\n if (eData?.tdTargetInput) delete eData.tdTargetInput;\n if (eData?.tdTargetToggle) delete eData.tdTargetToggle;\n\n if (\n !eData ||\n Object.keys(eData).length === 0 ||\n eData.constructor !== DOMStringMap\n )\n return options;\n const dataOptions = {} as Options;\n\n // because dataset returns camelCase including the 'td' key the option\n // key won't align\n const objectToNormalized = (object) => {\n const lowered = {};\n Object.keys(object).forEach((x) => {\n lowered[x.toLowerCase()] = x;\n });\n\n return lowered;\n };\n\n const normalizeObject = this.normalizeObject(objectToNormalized);\n const optionsLower = objectToNormalized(options);\n\n Object.keys(eData)\n .filter((x) => x.startsWith(Namespace.dataKey))\n .map((x) => x.substring(2))\n .forEach((key) => {\n let keyOption = optionsLower[key.toLowerCase()];\n\n // dataset merges dashes to camelCase... yay\n // i.e. key = display_components_seconds\n if (key.includes('_')) {\n // [display, components, seconds]\n const split = key.split('_');\n // display\n keyOption = optionsLower[split[0].toLowerCase()];\n if (\n keyOption !== undefined &&\n options[keyOption].constructor === Object\n ) {\n dataOptions[keyOption] = normalizeObject(\n split,\n 1,\n options[keyOption],\n eData[`td${key}`]\n );\n }\n }\n // or key = multipleDate\n else if (keyOption !== undefined) {\n dataOptions[keyOption] = eData[`td${key}`];\n }\n });\n\n return this._mergeOptions(dataOptions, options);\n }\n\n //todo clean this up\n private static normalizeObject(objectToNormalized: (object) => object) {\n const normalizeObject = (\n split: string[],\n index: number,\n optionSubgroup: unknown,\n value: unknown\n ) => {\n // first round = display { ... }\n const normalizedOptions = objectToNormalized(optionSubgroup);\n\n const keyOption = normalizedOptions[split[index].toLowerCase()];\n const internalObject = {};\n\n if (keyOption === undefined) return internalObject;\n\n // if this is another object, continue down the rabbit hole\n if (optionSubgroup[keyOption].constructor === Object) {\n index++;\n internalObject[keyOption] = normalizeObject(\n split,\n index,\n optionSubgroup[keyOption],\n value\n );\n } else {\n internalObject[keyOption] = value;\n }\n return internalObject;\n };\n return normalizeObject;\n }\n\n /**\n * Attempts to prove `d` is a DateTime or Date or can be converted into one.\n * @param d If a string will attempt creating a date from it.\n * @param localization object containing locale and format settings. Only used with the custom formats\n * @private\n */\n static _dateTypeCheck(\n d: any, //eslint-disable-line @typescript-eslint/no-explicit-any\n localization: FormatLocalization\n ): DateTime | null {\n return tryConvertToDateTime(d, localization);\n }\n\n /**\n * Type checks that `value` is an array of Date or DateTime\n * @param optionName Provides text to error messages e.g. disabledDates\n * @param value Option value\n * @param providedType Used to provide text to error messages\n * @param localization\n */\n static _typeCheckDateArray(\n optionName: string,\n value,\n providedType: string,\n localization: FormatLocalization\n ) {\n return typeCheckDateArray(optionName, value, providedType, localization);\n }\n\n /**\n * Type checks that `value` is an array of numbers\n * @param optionName Provides text to error messages e.g. disabledDates\n * @param value Option value\n * @param providedType Used to provide text to error messages\n */\n static _typeCheckNumberArray(\n optionName: string,\n value,\n providedType: string\n ) {\n return typeCheckNumberArray(optionName, value, providedType);\n }\n\n /**\n * Attempts to convert `d` to a DateTime object\n * @param d value to convert\n * @param optionName Provides text to error messages e.g. disabledDates\n * @param localization object containing locale and format settings. Only used with the custom formats\n */\n static dateConversion(\n d: any, //eslint-disable-line @typescript-eslint/no-explicit-any\n optionName: string,\n localization: FormatLocalization\n ): DateTime {\n return convertToDateTime(d, optionName, localization);\n }\n\n private static _flattenDefaults: string[];\n\n private static getFlattenDefaultOptions(): string[] {\n if (this._flattenDefaults) return this._flattenDefaults;\n const deepKeys = (t, pre = []) => {\n if (Array.isArray(t)) return [];\n if (Object(t) === t) {\n return Object.entries(t).flatMap(([k, v]) => deepKeys(v, [...pre, k]));\n } else {\n return pre.join('.');\n }\n };\n\n this._flattenDefaults = deepKeys(DefaultOptions);\n\n return this._flattenDefaults;\n }\n\n /**\n * Some options conflict like min/max date. Verify that these kinds of options\n * are set correctly.\n * @param config\n */\n static _validateConflicts(config: Options) {\n if (\n config.display.sideBySide &&\n (!config.display.components.clock ||\n !(\n config.display.components.hours ||\n config.display.components.minutes ||\n config.display.components.seconds\n ))\n ) {\n Namespace.errorMessages.conflictingConfiguration(\n 'Cannot use side by side mode without the clock components'\n );\n }\n\n if (config.restrictions.minDate && config.restrictions.maxDate) {\n if (config.restrictions.minDate.isAfter(config.restrictions.maxDate)) {\n Namespace.errorMessages.conflictingConfiguration(\n 'minDate is after maxDate'\n );\n }\n\n if (config.restrictions.maxDate.isBefore(config.restrictions.minDate)) {\n Namespace.errorMessages.conflictingConfiguration(\n 'maxDate is before minDate'\n );\n }\n }\n\n if (config.multipleDates && config.dateRange) {\n Namespace.errorMessages.conflictingConfiguration(\n 'Cannot uss option \"multipleDates\" with \"dateRange\"'\n );\n }\n }\n}\n","import { DateTime, getFormatByUnit, Unit } from './datetime';\nimport Namespace from './utilities/namespace';\nimport { ChangeEvent, FailEvent } from './utilities/event-types';\nimport Validation from './validation';\nimport { serviceLocator } from './utilities/service-locator';\nimport { EventEmitters } from './utilities/event-emitter';\nimport { OptionsStore } from './utilities/optionsStore';\nimport { OptionConverter } from './utilities/optionConverter';\n\nexport default class Dates {\n private _dates: DateTime[] = [];\n private optionsStore: OptionsStore;\n private validation: Validation;\n private _eventEmitters: EventEmitters;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.validation = serviceLocator.locate(Validation);\n this._eventEmitters = serviceLocator.locate(EventEmitters);\n }\n\n /**\n * Returns the array of selected dates\n */\n get picked(): DateTime[] {\n return [...this._dates];\n }\n\n /**\n * Returns the last picked value.\n */\n get lastPicked(): DateTime {\n return this._dates[this.lastPickedIndex]?.clone;\n }\n\n /**\n * Returns the length of picked dates -1 or 0 if none are selected.\n */\n get lastPickedIndex(): number {\n if (this._dates.length === 0) return 0;\n return this._dates.length - 1;\n }\n\n /**\n * Formats a DateTime object to a string. Used when setting the input value.\n * @param date\n */\n formatInput(date: DateTime): string {\n if (!date) return '';\n date.localization = this.optionsStore.options.localization;\n return date.format();\n }\n\n /**\n * parse the value into a DateTime object.\n * this can be overwritten to supply your own parsing.\n */\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n parseInput(value: any): DateTime {\n return OptionConverter.dateConversion(\n value,\n 'input',\n this.optionsStore.options.localization\n );\n }\n\n /**\n * Tries to convert the provided value to a DateTime object.\n * If value is null|undefined then clear the value of the provided index (or 0).\n * @param value Value to convert or null|undefined\n * @param index When using multidates this is the index in the array\n */\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n setFromInput(value: any, index?: number) {\n if (!value) {\n this.setValue(undefined, index);\n return;\n }\n const converted = this.parseInput(value);\n if (converted) {\n converted.setLocalization(this.optionsStore.options.localization);\n this.setValue(converted, index);\n }\n }\n\n /**\n * Adds a new DateTime to selected dates array\n * @param date\n */\n add(date: DateTime): void {\n this._dates.push(date);\n }\n\n /**\n * Returns true if the `targetDate` is part of the selected dates array.\n * If `unit` is provided then a granularity to that unit will be used.\n * @param targetDate\n * @param unit\n */\n isPicked(targetDate: DateTime, unit?: Unit): boolean {\n if (!DateTime.isValid(targetDate)) return false;\n if (!unit)\n return this._dates.find((x) => x.isSame(targetDate)) !== undefined;\n\n const format = getFormatByUnit(unit);\n\n const innerDateFormatted = targetDate.format(format);\n\n return (\n this._dates\n .map((x) => x.format(format))\n .find((x) => x === innerDateFormatted) !== undefined\n );\n }\n\n /**\n * Returns the index at which `targetDate` is in the array.\n * This is used for updating or removing a date when multi-date is used\n * If `unit` is provided then a granularity to that unit will be used.\n * @param targetDate\n * @param unit\n */\n pickedIndex(targetDate: DateTime, unit?: Unit): number {\n if (!DateTime.isValid(targetDate)) return -1;\n if (!unit)\n return this._dates.map((x) => x.valueOf()).indexOf(targetDate.valueOf());\n\n const format = getFormatByUnit(unit);\n\n const innerDateFormatted = targetDate.format(format);\n\n return this._dates.map((x) => x.format(format)).indexOf(innerDateFormatted);\n }\n\n /**\n * Clears all selected dates.\n */\n clear() {\n this.optionsStore.unset = true;\n this._eventEmitters.triggerEvent.emit({\n type: Namespace.events.change,\n date: undefined,\n oldDate: this.lastPicked,\n isClear: true,\n isValid: true,\n } as ChangeEvent);\n this._dates = [];\n if (this.optionsStore.input) this.optionsStore.input.value = '';\n this._eventEmitters.updateDisplay.emit('all');\n }\n\n /**\n * Find the \"book end\" years given a `year` and a `factor`\n * @param factor e.g. 100 for decades\n * @param year e.g. 2021\n */\n static getStartEndYear(\n factor: number,\n year: number\n ): [number, number, number] {\n const step = factor / 10,\n startYear = Math.floor(year / factor) * factor,\n endYear = startYear + step * 9,\n focusValue = Math.floor(year / step) * step;\n return [startYear, endYear, focusValue];\n }\n\n updateInput(target?: DateTime) {\n if (!this.optionsStore.input) return;\n\n let newValue = this.formatInput(target);\n if (\n this.optionsStore.options.multipleDates ||\n this.optionsStore.options.dateRange\n ) {\n newValue = this._dates\n .map((d) => this.formatInput(d))\n .join(this.optionsStore.options.multipleDatesSeparator);\n }\n if (this.optionsStore.input.value != newValue)\n this.optionsStore.input.value = newValue;\n }\n\n /**\n * Attempts to either clear or set the `target` date at `index`.\n * If the `target` is null then the date will be cleared.\n * If multi-date is being used then it will be removed from the array.\n * If `target` is valid and multi-date is used then if `index` is\n * provided the date at that index will be replaced, otherwise it is appended.\n * @param target\n * @param index\n */\n setValue(target?: DateTime, index?: number): void {\n const noIndex = typeof index === 'undefined',\n isClear = !target && noIndex;\n let oldDate = this.optionsStore.unset ? null : this._dates[index]?.clone;\n if (!oldDate && !this.optionsStore.unset && noIndex && isClear) {\n oldDate = this.lastPicked;\n }\n\n if (target && oldDate?.isSame(target)) {\n this.updateInput(target);\n return;\n }\n\n // case of calling setValue(null)\n if (!target) {\n this._setValueNull(isClear, index, oldDate);\n return;\n }\n\n index = index || 0;\n target = target.clone;\n\n // minute stepping is being used, force the minute to the closest value\n if (this.optionsStore.options.stepping !== 1) {\n target.minutes =\n Math.round(target.minutes / this.optionsStore.options.stepping) *\n this.optionsStore.options.stepping;\n target.startOf(Unit.minutes);\n }\n\n const onUpdate = (isValid: boolean) => {\n this._dates[index] = target;\n this._eventEmitters.updateViewDate.emit(target.clone);\n\n this.updateInput(target);\n\n this.optionsStore.unset = false;\n this._eventEmitters.updateDisplay.emit('all');\n this._eventEmitters.triggerEvent.emit({\n type: Namespace.events.change,\n date: target,\n oldDate,\n isClear,\n isValid: isValid,\n } as ChangeEvent);\n };\n\n if (\n this.validation.isValid(target) &&\n this.validation.dateRangeIsValid(this.picked, index, target)\n ) {\n onUpdate(true);\n return;\n }\n\n if (this.optionsStore.options.keepInvalid) {\n onUpdate(false);\n }\n\n this._eventEmitters.triggerEvent.emit({\n type: Namespace.events.error,\n reason: Namespace.errorMessages.failedToSetInvalidDate,\n date: target,\n oldDate,\n } as FailEvent);\n }\n\n private _setValueNull(isClear: boolean, index: number, oldDate: DateTime) {\n if (\n !this.optionsStore.options.multipleDates ||\n this._dates.length === 1 ||\n isClear\n ) {\n this.optionsStore.unset = true;\n this._dates = [];\n } else {\n this._dates.splice(index, 1);\n }\n\n this.updateInput();\n\n this._eventEmitters.triggerEvent.emit({\n type: Namespace.events.change,\n date: undefined,\n oldDate,\n isClear,\n isValid: true,\n } as ChangeEvent);\n\n this._eventEmitters.updateDisplay.emit('all');\n }\n}\n","enum ActionTypes {\n next = 'next',\n previous = 'previous',\n changeCalendarView = 'changeCalendarView',\n selectMonth = 'selectMonth',\n selectYear = 'selectYear',\n selectDecade = 'selectDecade',\n selectDay = 'selectDay',\n selectHour = 'selectHour',\n selectMinute = 'selectMinute',\n selectSecond = 'selectSecond',\n incrementHours = 'incrementHours',\n incrementMinutes = 'incrementMinutes',\n incrementSeconds = 'incrementSeconds',\n decrementHours = 'decrementHours',\n decrementMinutes = 'decrementMinutes',\n decrementSeconds = 'decrementSeconds',\n toggleMeridiem = 'toggleMeridiem',\n togglePicker = 'togglePicker',\n showClock = 'showClock',\n showHours = 'showHours',\n showMinutes = 'showMinutes',\n showSeconds = 'showSeconds',\n clear = 'clear',\n close = 'close',\n today = 'today',\n}\n\nexport default ActionTypes;\n","import { DateTime, Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport Dates from '../../dates';\nimport { Paint } from '../index';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `date`\n */\nexport default class DateDisplay {\n private optionsStore: OptionsStore;\n private dates: Dates;\n private validation: Validation;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.dates = serviceLocator.locate(Dates);\n this.validation = serviceLocator.locate(Validation);\n }\n\n /**\n * Build the container html for the display\n * @private\n */\n getPicker(): HTMLElement {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.daysContainer);\n\n container.append(...this._daysOfTheWeek());\n\n if (this.optionsStore.options.display.calendarWeeks) {\n const div = document.createElement('div');\n div.classList.add(Namespace.css.calendarWeeks, Namespace.css.noHighlight);\n container.appendChild(div);\n }\n\n const { rangeHoverEvent, rangeHoverOutEvent } =\n this.handleMouseEvents(container);\n\n for (let i = 0; i < 42; i++) {\n if (i !== 0 && i % 7 === 0) {\n if (this.optionsStore.options.display.calendarWeeks) {\n const div = document.createElement('div');\n div.classList.add(\n Namespace.css.calendarWeeks,\n Namespace.css.noHighlight\n );\n container.appendChild(div);\n }\n }\n\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.selectDay);\n container.appendChild(div);\n\n // if hover is supported then add the events\n if (\n matchMedia('(hover: hover)').matches &&\n this.optionsStore.options.dateRange\n ) {\n div.addEventListener('mouseover', rangeHoverEvent);\n div.addEventListener('mouseout', rangeHoverOutEvent);\n }\n }\n\n return container;\n }\n\n /**\n * Populates the grid and updates enabled states\n * @private\n */\n _update(widget: HTMLElement, paint: Paint): void {\n const container = widget.getElementsByClassName(\n Namespace.css.daysContainer\n )[0] as HTMLElement;\n\n this._updateCalendarView(container);\n\n const innerDate = this.optionsStore.viewDate.clone\n .startOf(Unit.month)\n .startOf('weekDay', this.optionsStore.options.localization.startOfTheWeek)\n .manipulate(12, Unit.hours);\n\n this._handleCalendarWeeks(container, innerDate.clone);\n\n container\n .querySelectorAll(`[data-action=\"${ActionTypes.selectDay}\"]`)\n .forEach((element: HTMLElement) => {\n const classes: string[] = [];\n classes.push(Namespace.css.day);\n\n if (innerDate.isBefore(this.optionsStore.viewDate, Unit.month)) {\n classes.push(Namespace.css.old);\n }\n if (innerDate.isAfter(this.optionsStore.viewDate, Unit.month)) {\n classes.push(Namespace.css.new);\n }\n\n if (\n !this.optionsStore.unset &&\n !this.optionsStore.options.dateRange &&\n this.dates.isPicked(innerDate, Unit.date)\n ) {\n classes.push(Namespace.css.active);\n }\n if (!this.validation.isValid(innerDate, Unit.date)) {\n classes.push(Namespace.css.disabled);\n }\n if (innerDate.isSame(new DateTime(), Unit.date)) {\n classes.push(Namespace.css.today);\n }\n if (innerDate.weekDay === 0 || innerDate.weekDay === 6) {\n classes.push(Namespace.css.weekend);\n }\n\n this._handleDateRange(innerDate, classes);\n\n paint(Unit.date, innerDate, classes, element);\n\n element.classList.remove(...element.classList);\n element.classList.add(...classes);\n element.setAttribute('data-value', this._dateToDataValue(innerDate));\n element.setAttribute('data-day', `${innerDate.date}`);\n element.innerText = innerDate.parts(undefined, {\n day: 'numeric',\n }).day;\n innerDate.manipulate(1, Unit.date);\n });\n }\n\n private _dateToDataValue(date: DateTime): string {\n if (!DateTime.isValid(date)) return '';\n\n return `${date.year}-${date.monthFormatted}-${date.dateFormatted}`;\n }\n\n private _handleDateRange(innerDate: DateTime, classes: string[]) {\n const rangeStart = this.dates.picked[0];\n const rangeEnd = this.dates.picked[1];\n\n if (this.optionsStore.options.dateRange) {\n if (innerDate.isBetween(rangeStart, rangeEnd, Unit.date)) {\n classes.push(Namespace.css.rangeIn);\n }\n\n if (innerDate.isSame(rangeStart, Unit.date)) {\n classes.push(Namespace.css.rangeStart);\n }\n\n if (innerDate.isSame(rangeEnd, Unit.date)) {\n classes.push(Namespace.css.rangeEnd);\n }\n }\n }\n\n private handleMouseEvents(container: HTMLElement) {\n const rangeHoverEvent = (e: MouseEvent) => {\n const currentTarget = e?.currentTarget as HTMLElement;\n\n // if we have 0 or 2 selected or if the target is disabled then ignore\n if (\n this.dates.picked.length !== 1 ||\n currentTarget.classList.contains(Namespace.css.disabled)\n )\n return;\n\n // select all the date divs\n const allDays = [...container.querySelectorAll('.day')] as HTMLElement[];\n\n // get the date value from the element being hovered over\n const attributeValue = currentTarget.getAttribute('data-value');\n\n // format the string to a date\n const innerDate = DateTime.fromString(attributeValue, {\n format: 'yyyy-MM-dd',\n });\n\n // find the position of the target in the date container\n const dayIndex = allDays.findIndex(\n (e) => e.getAttribute('data-value') === attributeValue\n );\n\n // find the first and second selected dates\n const rangeStart = this.dates.picked[0];\n const rangeEnd = this.dates.picked[1];\n\n //format the start date so that it can be found by the attribute\n const rangeStartFormatted = this._dateToDataValue(rangeStart);\n const rangeStartIndex = allDays.findIndex(\n (e) => e.getAttribute('data-value') === rangeStartFormatted\n );\n const rangeStartElement = allDays[rangeStartIndex];\n\n //make sure we don't leave start/end classes if we don't need them\n if (!innerDate.isSame(rangeStart, Unit.date)) {\n currentTarget.classList.remove(Namespace.css.rangeStart);\n }\n\n if (!innerDate.isSame(rangeEnd, Unit.date)) {\n currentTarget.classList.remove(Namespace.css.rangeEnd);\n }\n\n // the following figures out which direct from start date is selected\n // the selection \"cap\" classes are applied if needed\n // otherwise all the dates between will get the `rangeIn` class.\n // We make this selection based on the element's index and the rangeStart index\n\n let lambda: (_, index) => boolean;\n\n if (innerDate.isBefore(rangeStart)) {\n currentTarget.classList.add(Namespace.css.rangeStart);\n rangeStartElement?.classList.remove(Namespace.css.rangeStart);\n rangeStartElement?.classList.add(Namespace.css.rangeEnd);\n lambda = (_, index) => index > dayIndex && index < rangeStartIndex;\n } else {\n currentTarget.classList.add(Namespace.css.rangeEnd);\n rangeStartElement?.classList.remove(Namespace.css.rangeEnd);\n rangeStartElement?.classList.add(Namespace.css.rangeStart);\n lambda = (_, index) => index < dayIndex && index > rangeStartIndex;\n }\n\n allDays.filter(lambda).forEach((e) => {\n e.classList.add(Namespace.css.rangeIn);\n });\n };\n\n const rangeHoverOutEvent = (e: MouseEvent) => {\n // find all the dates in the container\n const allDays = [...container.querySelectorAll('.day')] as HTMLElement[];\n\n // if only the start is selected, remove all the rangeIn classes\n // we do this because once the user hovers over a new date the range will be recalculated.\n if (this.dates.picked.length === 1)\n allDays.forEach((e) => e.classList.remove(Namespace.css.rangeIn));\n\n // if we have 0 or 2 dates selected then ignore\n if (this.dates.picked.length !== 1) return;\n\n const currentTarget = e?.currentTarget as HTMLElement;\n\n // get the elements date from the attribute value\n const innerDate = new DateTime(currentTarget.getAttribute('data-value'));\n\n // verify selections and remove invalid classes\n if (!innerDate.isSame(this.dates.picked[0], Unit.date)) {\n currentTarget.classList.remove(Namespace.css.rangeStart);\n }\n\n if (!innerDate.isSame(this.dates.picked[1], Unit.date)) {\n currentTarget.classList.remove(Namespace.css.rangeEnd);\n }\n };\n\n return { rangeHoverEvent, rangeHoverOutEvent };\n }\n\n private _updateCalendarView(container: Element) {\n if (this.optionsStore.currentView !== 'calendar') return;\n const [previous, switcher, next] = container.parentElement\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\n .getElementsByTagName('div');\n switcher.setAttribute(\n Namespace.css.daysContainer,\n this.optionsStore.viewDate.format(\n this.optionsStore.options.localization.dayViewHeaderFormat\n )\n );\n this.optionsStore.options.display.components.month\n ? switcher.classList.remove(Namespace.css.disabled)\n : switcher.classList.add(Namespace.css.disabled);\n this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.month),\n Unit.month\n )\n ? previous.classList.remove(Namespace.css.disabled)\n : previous.classList.add(Namespace.css.disabled);\n this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(1, Unit.month),\n Unit.month\n )\n ? next.classList.remove(Namespace.css.disabled)\n : next.classList.add(Namespace.css.disabled);\n }\n\n /***\n * Generates a html row that contains the days of the week.\n * @private\n */\n private _daysOfTheWeek(): HTMLElement[] {\n const innerDate = this.optionsStore.viewDate.clone\n .startOf('weekDay', this.optionsStore.options.localization.startOfTheWeek)\n .startOf(Unit.date);\n const row = [];\n document.createElement('div');\n\n if (this.optionsStore.options.display.calendarWeeks) {\n const htmlDivElement = document.createElement('div');\n htmlDivElement.classList.add(\n Namespace.css.calendarWeeks,\n Namespace.css.noHighlight\n );\n htmlDivElement.innerText = '#';\n row.push(htmlDivElement);\n }\n\n for (let i = 0; i < 7; i++) {\n const htmlDivElement = document.createElement('div');\n htmlDivElement.classList.add(\n Namespace.css.dayOfTheWeek,\n Namespace.css.noHighlight\n );\n let weekDay = innerDate.format({ weekday: 'short' });\n if (this.optionsStore.options.localization.maxWeekdayLength > 0)\n weekDay = weekDay.substring(\n 0,\n this.optionsStore.options.localization.maxWeekdayLength\n );\n htmlDivElement.innerText = weekDay;\n innerDate.manipulate(1, Unit.date);\n row.push(htmlDivElement);\n }\n\n return row;\n }\n\n private _handleCalendarWeeks(container: HTMLElement, innerDate: DateTime) {\n [...container.querySelectorAll(`.${Namespace.css.calendarWeeks}`)]\n .filter((e: HTMLElement) => e.innerText !== '#')\n .forEach((element: HTMLElement) => {\n element.innerText = `${innerDate.week}`;\n innerDate.manipulate(7, Unit.date);\n });\n }\n}\n","import { Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport Dates from '../../dates';\nimport { Paint } from '../index';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `month`\n */\nexport default class MonthDisplay {\n private optionsStore: OptionsStore;\n private dates: Dates;\n private validation: Validation;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.dates = serviceLocator.locate(Dates);\n this.validation = serviceLocator.locate(Validation);\n }\n /**\n * Build the container html for the display\n * @private\n */\n getPicker(): HTMLElement {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.monthsContainer);\n\n for (let i = 0; i < 12; i++) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.selectMonth);\n container.appendChild(div);\n }\n\n return container;\n }\n\n /**\n * Populates the grid and updates enabled states\n * @private\n */\n _update(widget: HTMLElement, paint: Paint): void {\n const container = widget.getElementsByClassName(\n Namespace.css.monthsContainer\n )[0];\n\n if (this.optionsStore.currentView === 'months') {\n const [previous, switcher, next] = container.parentElement\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\n .getElementsByTagName('div');\n\n switcher.setAttribute(\n Namespace.css.monthsContainer,\n this.optionsStore.viewDate.format({ year: 'numeric' })\n );\n\n this.optionsStore.options.display.components.year\n ? switcher.classList.remove(Namespace.css.disabled)\n : switcher.classList.add(Namespace.css.disabled);\n\n this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.year),\n Unit.year\n )\n ? previous.classList.remove(Namespace.css.disabled)\n : previous.classList.add(Namespace.css.disabled);\n\n this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(1, Unit.year),\n Unit.year\n )\n ? next.classList.remove(Namespace.css.disabled)\n : next.classList.add(Namespace.css.disabled);\n }\n\n const innerDate = this.optionsStore.viewDate.clone.startOf(Unit.year);\n\n container\n .querySelectorAll(`[data-action=\"${ActionTypes.selectMonth}\"]`)\n .forEach((containerClone: HTMLElement, index) => {\n const classes = [];\n classes.push(Namespace.css.month);\n\n if (\n !this.optionsStore.unset &&\n this.dates.isPicked(innerDate, Unit.month)\n ) {\n classes.push(Namespace.css.active);\n }\n if (!this.validation.isValid(innerDate, Unit.month)) {\n classes.push(Namespace.css.disabled);\n }\n\n paint(Unit.month, innerDate, classes, containerClone);\n\n containerClone.classList.remove(...containerClone.classList);\n containerClone.classList.add(...classes);\n containerClone.setAttribute('data-value', `${index}`);\n containerClone.innerText = `${innerDate.format({ month: 'short' })}`;\n innerDate.manipulate(1, Unit.month);\n });\n }\n}\n","import { DateTime, Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Dates from '../../dates';\nimport Validation from '../../validation';\nimport { Paint } from '../index';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `year`\n */\nexport default class YearDisplay {\n private _startYear: DateTime;\n private _endYear: DateTime;\n private optionsStore: OptionsStore;\n private dates: Dates;\n private validation: Validation;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.dates = serviceLocator.locate(Dates);\n this.validation = serviceLocator.locate(Validation);\n }\n\n /**\n * Build the container html for the display\n * @private\n */\n getPicker(): HTMLElement {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.yearsContainer);\n\n for (let i = 0; i < 12; i++) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.selectYear);\n container.appendChild(div);\n }\n\n return container;\n }\n\n /**\n * Populates the grid and updates enabled states\n * @private\n */\n _update(widget: HTMLElement, paint: Paint) {\n this._startYear = this.optionsStore.viewDate.clone.manipulate(\n -1,\n Unit.year\n );\n this._endYear = this.optionsStore.viewDate.clone.manipulate(10, Unit.year);\n\n const container = widget.getElementsByClassName(\n Namespace.css.yearsContainer\n )[0];\n\n if (this.optionsStore.currentView === 'years') {\n const [previous, switcher, next] = container.parentElement\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\n .getElementsByTagName('div');\n\n switcher.setAttribute(\n Namespace.css.yearsContainer,\n `${this._startYear.format({ year: 'numeric' })}-${this._endYear.format({\n year: 'numeric',\n })}`\n );\n\n this.optionsStore.options.display.components.decades\n ? switcher.classList.remove(Namespace.css.disabled)\n : switcher.classList.add(Namespace.css.disabled);\n\n this.validation.isValid(this._startYear, Unit.year)\n ? previous.classList.remove(Namespace.css.disabled)\n : previous.classList.add(Namespace.css.disabled);\n this.validation.isValid(this._endYear, Unit.year)\n ? next.classList.remove(Namespace.css.disabled)\n : next.classList.add(Namespace.css.disabled);\n }\n\n const innerDate = this.optionsStore.viewDate.clone\n .startOf(Unit.year)\n .manipulate(-1, Unit.year);\n\n container\n .querySelectorAll(`[data-action=\"${ActionTypes.selectYear}\"]`)\n .forEach((containerClone: HTMLElement) => {\n const classes = [];\n classes.push(Namespace.css.year);\n\n if (\n !this.optionsStore.unset &&\n this.dates.isPicked(innerDate, Unit.year)\n ) {\n classes.push(Namespace.css.active);\n }\n if (!this.validation.isValid(innerDate, Unit.year)) {\n classes.push(Namespace.css.disabled);\n }\n\n paint(Unit.year, innerDate, classes, containerClone);\n\n containerClone.classList.remove(...containerClone.classList);\n containerClone.classList.add(...classes);\n containerClone.setAttribute('data-value', `${innerDate.year}`);\n containerClone.innerText = innerDate.format({ year: 'numeric' });\n\n innerDate.manipulate(1, Unit.year);\n });\n }\n}\n","import Dates from '../../dates';\nimport { DateTime, Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport { Paint } from '../index';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `seconds`\n */\nexport default class DecadeDisplay {\n private _startDecade: DateTime;\n private _endDecade: DateTime;\n private optionsStore: OptionsStore;\n private dates: Dates;\n private validation: Validation;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.dates = serviceLocator.locate(Dates);\n this.validation = serviceLocator.locate(Validation);\n }\n\n /**\n * Build the container html for the display\n * @private\n */\n getPicker() {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.decadesContainer);\n\n for (let i = 0; i < 12; i++) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.selectDecade);\n container.appendChild(div);\n }\n return container;\n }\n\n /**\n * Populates the grid and updates enabled states\n * @private\n */\n _update(widget: HTMLElement, paint: Paint) {\n const [start, end] = Dates.getStartEndYear(\n 100,\n this.optionsStore.viewDate.year\n );\n this._startDecade = this.optionsStore.viewDate.clone.startOf(Unit.year);\n this._startDecade.year = start;\n this._endDecade = this.optionsStore.viewDate.clone.startOf(Unit.year);\n this._endDecade.year = end;\n\n const container = widget.getElementsByClassName(\n Namespace.css.decadesContainer\n )[0];\n\n const [previous, switcher, next] = container.parentElement\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\n .getElementsByTagName('div');\n\n if (this.optionsStore.currentView === 'decades') {\n switcher.setAttribute(\n Namespace.css.decadesContainer,\n `${this._startDecade.format({\n year: 'numeric',\n })}-${this._endDecade.format({ year: 'numeric' })}`\n );\n\n this.validation.isValid(this._startDecade, Unit.year)\n ? previous.classList.remove(Namespace.css.disabled)\n : previous.classList.add(Namespace.css.disabled);\n this.validation.isValid(this._endDecade, Unit.year)\n ? next.classList.remove(Namespace.css.disabled)\n : next.classList.add(Namespace.css.disabled);\n }\n\n const pickedYears = this.dates.picked.map((x) => x.year);\n\n container\n .querySelectorAll(`[data-action=\"${ActionTypes.selectDecade}\"]`)\n .forEach((containerClone: HTMLElement, index) => {\n if (index === 0) {\n containerClone.classList.add(Namespace.css.old);\n if (this._startDecade.year - 10 < 0) {\n containerClone.textContent = ' ';\n previous.classList.add(Namespace.css.disabled);\n containerClone.classList.add(Namespace.css.disabled);\n containerClone.setAttribute('data-value', '');\n return;\n } else {\n containerClone.innerText = this._startDecade.clone\n .manipulate(-10, Unit.year)\n .format({ year: 'numeric' });\n containerClone.setAttribute(\n 'data-value',\n `${this._startDecade.year}`\n );\n return;\n }\n }\n\n const classes = [];\n classes.push(Namespace.css.decade);\n const startDecadeYear = this._startDecade.year;\n const endDecadeYear = this._startDecade.year + 9;\n\n if (\n !this.optionsStore.unset &&\n pickedYears.filter((x) => x >= startDecadeYear && x <= endDecadeYear)\n .length > 0\n ) {\n classes.push(Namespace.css.active);\n }\n\n paint('decade', this._startDecade, classes, containerClone);\n\n containerClone.classList.remove(...containerClone.classList);\n containerClone.classList.add(...classes);\n containerClone.setAttribute('data-value', `${this._startDecade.year}`);\n containerClone.innerText = `${this._startDecade.format({\n year: 'numeric',\n })}`;\n\n this._startDecade.manipulate(10, Unit.year);\n });\n }\n}\n","import { Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport Dates from '../../dates';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates the clock display\n */\nexport default class TimeDisplay {\n private _gridColumns = '';\n private optionsStore: OptionsStore;\n private validation: Validation;\n private dates: Dates;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.dates = serviceLocator.locate(Dates);\n this.validation = serviceLocator.locate(Validation);\n }\n\n /**\n * Build the container html for the clock display\n * @private\n */\n getPicker(iconTag: (iconClass: string) => HTMLElement): HTMLElement {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.clockContainer);\n\n container.append(...this._grid(iconTag));\n\n return container;\n }\n\n /**\n * Populates the various elements with in the clock display\n * like the current hour and if the manipulation icons are enabled.\n * @private\n */\n _update(widget: HTMLElement): void {\n const timesDiv = (\n widget.getElementsByClassName(Namespace.css.clockContainer)[0]\n );\n let lastPicked = this.dates.lastPicked?.clone;\n if (!lastPicked && this.optionsStore.options.useCurrent)\n lastPicked = this.optionsStore.viewDate.clone;\n\n timesDiv\n .querySelectorAll('.disabled')\n .forEach((element) => element.classList.remove(Namespace.css.disabled));\n\n if (this.optionsStore.options.display.components.hours) {\n if (\n !this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(1, Unit.hours),\n Unit.hours\n )\n ) {\n timesDiv\n .querySelector(`[data-action=${ActionTypes.incrementHours}]`)\n .classList.add(Namespace.css.disabled);\n }\n\n if (\n !this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.hours),\n Unit.hours\n )\n ) {\n timesDiv\n .querySelector(`[data-action=${ActionTypes.decrementHours}]`)\n .classList.add(Namespace.css.disabled);\n }\n\n timesDiv.querySelector(\n `[data-time-component=${Unit.hours}]`\n ).innerText = lastPicked\n ? lastPicked.getHoursFormatted(\n this.optionsStore.options.localization.hourCycle\n )\n : '--';\n }\n\n if (this.optionsStore.options.display.components.minutes) {\n if (\n !this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(1, Unit.minutes),\n Unit.minutes\n )\n ) {\n timesDiv\n .querySelector(`[data-action=${ActionTypes.incrementMinutes}]`)\n .classList.add(Namespace.css.disabled);\n }\n\n if (\n !this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.minutes),\n Unit.minutes\n )\n ) {\n timesDiv\n .querySelector(`[data-action=${ActionTypes.decrementMinutes}]`)\n .classList.add(Namespace.css.disabled);\n }\n timesDiv.querySelector(\n `[data-time-component=${Unit.minutes}]`\n ).innerText = lastPicked ? lastPicked.minutesFormatted : '--';\n }\n\n if (this.optionsStore.options.display.components.seconds) {\n if (\n !this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(1, Unit.seconds),\n Unit.seconds\n )\n ) {\n timesDiv\n .querySelector(`[data-action=${ActionTypes.incrementSeconds}]`)\n .classList.add(Namespace.css.disabled);\n }\n\n if (\n !this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.seconds),\n Unit.seconds\n )\n ) {\n timesDiv\n .querySelector(`[data-action=${ActionTypes.decrementSeconds}]`)\n .classList.add(Namespace.css.disabled);\n }\n timesDiv.querySelector(\n `[data-time-component=${Unit.seconds}]`\n ).innerText = lastPicked ? lastPicked.secondsFormatted : '--';\n }\n\n if (this.optionsStore.isTwelveHour) {\n const toggle = timesDiv.querySelector(\n `[data-action=${ActionTypes.toggleMeridiem}]`\n );\n\n const meridiemDate = (lastPicked || this.optionsStore.viewDate).clone;\n\n toggle.innerText = meridiemDate.meridiem();\n\n if (\n !this.validation.isValid(\n meridiemDate.manipulate(\n meridiemDate.hours >= 12 ? -12 : 12,\n Unit.hours\n )\n )\n ) {\n toggle.classList.add(Namespace.css.disabled);\n } else {\n toggle.classList.remove(Namespace.css.disabled);\n }\n }\n\n timesDiv.style.gridTemplateAreas = `\"${this._gridColumns}\"`;\n }\n\n /**\n * Creates the table for the clock display depending on what options are selected.\n * @private\n */\n private _grid(iconTag: (iconClass: string) => HTMLElement): HTMLElement[] {\n this._gridColumns = '';\n const top = [],\n middle = [],\n bottom = [],\n separator = document.createElement('div'),\n upIcon = iconTag(this.optionsStore.options.display.icons.up),\n downIcon = iconTag(this.optionsStore.options.display.icons.down);\n\n separator.classList.add(Namespace.css.separator, Namespace.css.noHighlight);\n const separatorColon = separator.cloneNode(true);\n separatorColon.innerHTML = ':';\n\n const getSeparator = (colon = false): HTMLElement => {\n return colon\n ? separatorColon.cloneNode(true)\n : separator.cloneNode(true);\n };\n\n if (this.optionsStore.options.display.components.hours) {\n let divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.incrementHour\n );\n divElement.setAttribute('data-action', ActionTypes.incrementHours);\n divElement.appendChild(upIcon.cloneNode(true));\n top.push(divElement);\n\n divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.pickHour\n );\n divElement.setAttribute('data-action', ActionTypes.showHours);\n divElement.setAttribute('data-time-component', Unit.hours);\n middle.push(divElement);\n\n divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.decrementHour\n );\n divElement.setAttribute('data-action', ActionTypes.decrementHours);\n divElement.appendChild(downIcon.cloneNode(true));\n bottom.push(divElement);\n this._gridColumns += 'a';\n }\n\n if (this.optionsStore.options.display.components.minutes) {\n this._gridColumns += ' a';\n if (this.optionsStore.options.display.components.hours) {\n top.push(getSeparator());\n middle.push(getSeparator(true));\n bottom.push(getSeparator());\n this._gridColumns += ' a';\n }\n let divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.incrementMinute\n );\n divElement.setAttribute('data-action', ActionTypes.incrementMinutes);\n divElement.appendChild(upIcon.cloneNode(true));\n top.push(divElement);\n\n divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.pickMinute\n );\n divElement.setAttribute('data-action', ActionTypes.showMinutes);\n divElement.setAttribute('data-time-component', Unit.minutes);\n middle.push(divElement);\n\n divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.decrementMinute\n );\n divElement.setAttribute('data-action', ActionTypes.decrementMinutes);\n divElement.appendChild(downIcon.cloneNode(true));\n bottom.push(divElement);\n }\n\n if (this.optionsStore.options.display.components.seconds) {\n this._gridColumns += ' a';\n if (this.optionsStore.options.display.components.minutes) {\n top.push(getSeparator());\n middle.push(getSeparator(true));\n bottom.push(getSeparator());\n this._gridColumns += ' a';\n }\n let divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.incrementSecond\n );\n divElement.setAttribute('data-action', ActionTypes.incrementSeconds);\n divElement.appendChild(upIcon.cloneNode(true));\n top.push(divElement);\n\n divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.pickSecond\n );\n divElement.setAttribute('data-action', ActionTypes.showSeconds);\n divElement.setAttribute('data-time-component', Unit.seconds);\n middle.push(divElement);\n\n divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.decrementSecond\n );\n divElement.setAttribute('data-action', ActionTypes.decrementSeconds);\n divElement.appendChild(downIcon.cloneNode(true));\n bottom.push(divElement);\n }\n\n if (this.optionsStore.isTwelveHour) {\n this._gridColumns += ' a';\n let divElement = getSeparator();\n top.push(divElement);\n\n const button = document.createElement('button');\n button.setAttribute('type', 'button');\n button.setAttribute(\n 'title',\n this.optionsStore.options.localization.toggleMeridiem\n );\n button.setAttribute('data-action', ActionTypes.toggleMeridiem);\n button.setAttribute('tabindex', '-1');\n if (Namespace.css.toggleMeridiem.includes(',')) {\n //todo move this to paint function?\n button.classList.add(...Namespace.css.toggleMeridiem.split(','));\n } else button.classList.add(Namespace.css.toggleMeridiem);\n\n divElement = document.createElement('div');\n divElement.classList.add(Namespace.css.noHighlight);\n divElement.appendChild(button);\n middle.push(divElement);\n\n divElement = getSeparator();\n bottom.push(divElement);\n }\n\n this._gridColumns = this._gridColumns.trim();\n\n return [...top, ...middle, ...bottom];\n }\n}\n","import { Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport { Paint } from '../index';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `hours`\n */\nexport default class HourDisplay {\n private optionsStore: OptionsStore;\n private validation: Validation;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.validation = serviceLocator.locate(Validation);\n }\n /**\n * Build the container html for the display\n * @private\n */\n getPicker(): HTMLElement {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.hourContainer);\n\n for (let i = 0; i < (this.optionsStore.isTwelveHour ? 12 : 24); i++) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.selectHour);\n container.appendChild(div);\n }\n\n return container;\n }\n\n /**\n * Populates the grid and updates enabled states\n * @private\n */\n _update(widget: HTMLElement, paint: Paint): void {\n const container = widget.getElementsByClassName(\n Namespace.css.hourContainer\n )[0];\n const innerDate = this.optionsStore.viewDate.clone.startOf(Unit.date);\n\n container\n .querySelectorAll(`[data-action=\"${ActionTypes.selectHour}\"]`)\n .forEach((containerClone: HTMLElement) => {\n const classes = [];\n classes.push(Namespace.css.hour);\n\n if (!this.validation.isValid(innerDate, Unit.hours)) {\n classes.push(Namespace.css.disabled);\n }\n\n paint(Unit.hours, innerDate, classes, containerClone);\n\n containerClone.classList.remove(...containerClone.classList);\n containerClone.classList.add(...classes);\n containerClone.setAttribute('data-value', `${innerDate.hours}`);\n containerClone.innerText = innerDate.getHoursFormatted(\n this.optionsStore.options.localization.hourCycle\n );\n innerDate.manipulate(1, Unit.hours);\n });\n }\n}\n","import { Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport { Paint } from '../index';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `minutes`\n */\nexport default class MinuteDisplay {\n private optionsStore: OptionsStore;\n private validation: Validation;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.validation = serviceLocator.locate(Validation);\n }\n /**\n * Build the container html for the display\n * @private\n */\n getPicker(): HTMLElement {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.minuteContainer);\n\n const step =\n this.optionsStore.options.stepping === 1\n ? 5\n : this.optionsStore.options.stepping;\n for (let i = 0; i < 60 / step; i++) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.selectMinute);\n container.appendChild(div);\n }\n\n return container;\n }\n\n /**\n * Populates the grid and updates enabled states\n * @private\n */\n _update(widget: HTMLElement, paint: Paint): void {\n const container = widget.getElementsByClassName(\n Namespace.css.minuteContainer\n )[0];\n const innerDate = this.optionsStore.viewDate.clone.startOf(Unit.hours);\n const step =\n this.optionsStore.options.stepping === 1\n ? 5\n : this.optionsStore.options.stepping;\n\n container\n .querySelectorAll(`[data-action=\"${ActionTypes.selectMinute}\"]`)\n .forEach((containerClone: HTMLElement) => {\n const classes = [];\n classes.push(Namespace.css.minute);\n\n if (!this.validation.isValid(innerDate, Unit.minutes)) {\n classes.push(Namespace.css.disabled);\n }\n\n paint(Unit.minutes, innerDate, classes, containerClone);\n\n containerClone.classList.remove(...containerClone.classList);\n containerClone.classList.add(...classes);\n containerClone.setAttribute('data-value', `${innerDate.minutes}`);\n containerClone.innerText = innerDate.minutesFormatted;\n innerDate.manipulate(step, Unit.minutes);\n });\n }\n}\n","import { Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport { Paint } from '../index';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `seconds`\n */\nexport default class secondDisplay {\n private optionsStore: OptionsStore;\n private validation: Validation;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.validation = serviceLocator.locate(Validation);\n }\n /**\n * Build the container html for the display\n * @private\n */\n getPicker(): HTMLElement {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.secondContainer);\n\n for (let i = 0; i < 12; i++) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.selectSecond);\n container.appendChild(div);\n }\n\n return container;\n }\n\n /**\n * Populates the grid and updates enabled states\n * @private\n */\n _update(widget: HTMLElement, paint: Paint): void {\n const container = widget.getElementsByClassName(\n Namespace.css.secondContainer\n )[0];\n const innerDate = this.optionsStore.viewDate.clone.startOf(Unit.minutes);\n\n container\n .querySelectorAll(`[data-action=\"${ActionTypes.selectSecond}\"]`)\n .forEach((containerClone: HTMLElement) => {\n const classes = [];\n classes.push(Namespace.css.second);\n\n if (!this.validation.isValid(innerDate, Unit.seconds)) {\n classes.push(Namespace.css.disabled);\n }\n\n paint(Unit.seconds, innerDate, classes, containerClone);\n\n containerClone.classList.remove(...containerClone.classList);\n containerClone.classList.add(...classes);\n containerClone.setAttribute('data-value', `${innerDate.seconds}`);\n containerClone.innerText = innerDate.secondsFormatted;\n innerDate.manipulate(5, Unit.seconds);\n });\n }\n}\n","import Namespace from '../utilities/namespace';\n\n/**\n * Provides a collapse functionality to the view changes\n */\nexport default class Collapse {\n /**\n * Flips the show/hide state of `target`\n * @param target html element to affect.\n */\n static toggle(target: HTMLElement) {\n if (target.classList.contains(Namespace.css.show)) {\n this.hide(target);\n } else {\n this.show(target);\n }\n }\n\n /**\n * Skips any animation or timeouts and immediately set the element to show.\n * @param target\n */\n static showImmediately(target: HTMLElement) {\n target.classList.remove(Namespace.css.collapsing);\n target.classList.add(Namespace.css.collapse, Namespace.css.show);\n target.style.height = '';\n }\n\n /**\n * If `target` is not already showing, then show after the animation.\n * @param target\n */\n static show(target: HTMLElement) {\n if (\n target.classList.contains(Namespace.css.collapsing) ||\n target.classList.contains(Namespace.css.show)\n )\n return;\n\n let timeOut = null;\n const complete = () => {\n Collapse.showImmediately(target);\n timeOut = null;\n };\n\n target.style.height = '0';\n target.classList.remove(Namespace.css.collapse);\n target.classList.add(Namespace.css.collapsing);\n\n //eslint-disable-next-line @typescript-eslint/no-unused-vars\n timeOut = setTimeout(\n complete,\n this.getTransitionDurationFromElement(target)\n );\n target.style.height = `${target.scrollHeight}px`;\n }\n\n /**\n * Skips any animation or timeouts and immediately set the element to hide.\n * @param target\n */\n static hideImmediately(target: HTMLElement) {\n if (!target) return;\n target.classList.remove(Namespace.css.collapsing, Namespace.css.show);\n target.classList.add(Namespace.css.collapse);\n }\n\n /**\n * If `target` is not already hidden, then hide after the animation.\n * @param target HTML Element\n */\n static hide(target: HTMLElement) {\n if (\n target.classList.contains(Namespace.css.collapsing) ||\n !target.classList.contains(Namespace.css.show)\n )\n return;\n\n let timeOut = null;\n const complete = () => {\n Collapse.hideImmediately(target);\n timeOut = null;\n };\n\n target.style.height = `${target.getBoundingClientRect()['height']}px`;\n\n const reflow = (element) => element.offsetHeight;\n\n reflow(target);\n\n target.classList.remove(Namespace.css.collapse, Namespace.css.show);\n target.classList.add(Namespace.css.collapsing);\n target.style.height = '';\n\n //eslint-disable-next-line @typescript-eslint/no-unused-vars\n timeOut = setTimeout(\n complete,\n this.getTransitionDurationFromElement(target)\n );\n }\n\n /**\n * Gets the transition duration from the `element` by getting css properties\n * `transition-duration` and `transition-delay`\n * @param element HTML Element\n */\n private static getTransitionDurationFromElement = (element: HTMLElement) => {\n if (!element) {\n return 0;\n }\n\n // Get transition-duration of the element\n let { transitionDuration, transitionDelay } =\n window.getComputedStyle(element);\n\n const floatTransitionDuration = Number.parseFloat(transitionDuration);\n const floatTransitionDelay = Number.parseFloat(transitionDelay);\n\n // Return 0 if element or transition duration is not found\n if (!floatTransitionDuration && !floatTransitionDelay) {\n return 0;\n }\n\n // If multiple durations are defined, take the first\n transitionDuration = transitionDuration.split(',')[0];\n transitionDelay = transitionDelay.split(',')[0];\n\n return (\n (Number.parseFloat(transitionDuration) +\n Number.parseFloat(transitionDelay)) *\n 1000\n );\n };\n}\n","import DateDisplay from './calendar/date-display';\nimport MonthDisplay from './calendar/month-display';\nimport YearDisplay from './calendar/year-display';\nimport DecadeDisplay from './calendar/decade-display';\nimport TimeDisplay from './time/time-display';\nimport HourDisplay from './time/hour-display';\nimport MinuteDisplay from './time/minute-display';\nimport SecondDisplay from './time/second-display';\nimport { DateTime, Unit } from '../datetime';\nimport Namespace from '../utilities/namespace';\nimport { HideEvent } from '../utilities/event-types';\nimport Collapse from './collapse';\nimport Validation from '../validation';\nimport Dates from '../dates';\nimport { EventEmitters, ViewUpdateValues } from '../utilities/event-emitter';\nimport { serviceLocator } from '../utilities/service-locator';\nimport ActionTypes from '../utilities/action-types';\nimport CalendarModes from '../utilities/calendar-modes';\nimport { OptionsStore } from '../utilities/optionsStore';\n\n/**\n * Main class for all things display related.\n */\nexport default class Display {\n private _widget: HTMLElement;\n private _popperInstance: any; // eslint-disable-line @typescript-eslint/no-explicit-any\n private _isVisible = false;\n private optionsStore: OptionsStore;\n private validation: Validation;\n private dates: Dates;\n\n dateDisplay: DateDisplay;\n monthDisplay: MonthDisplay;\n yearDisplay: YearDisplay;\n decadeDisplay: DecadeDisplay;\n timeDisplay: TimeDisplay;\n hourDisplay: HourDisplay;\n minuteDisplay: MinuteDisplay;\n secondDisplay: SecondDisplay;\n private _eventEmitters: EventEmitters;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.validation = serviceLocator.locate(Validation);\n this.dates = serviceLocator.locate(Dates);\n\n this.dateDisplay = serviceLocator.locate(DateDisplay);\n this.monthDisplay = serviceLocator.locate(MonthDisplay);\n this.yearDisplay = serviceLocator.locate(YearDisplay);\n this.decadeDisplay = serviceLocator.locate(DecadeDisplay);\n this.timeDisplay = serviceLocator.locate(TimeDisplay);\n this.hourDisplay = serviceLocator.locate(HourDisplay);\n this.minuteDisplay = serviceLocator.locate(MinuteDisplay);\n this.secondDisplay = serviceLocator.locate(SecondDisplay);\n this._eventEmitters = serviceLocator.locate(EventEmitters);\n this._widget = undefined;\n\n this._eventEmitters.updateDisplay.subscribe((result: ViewUpdateValues) => {\n this._update(result);\n });\n }\n\n /**\n * Returns the widget body or undefined\n * @private\n */\n get widget(): HTMLElement | undefined {\n return this._widget;\n }\n\n get dateContainer(): HTMLElement | undefined {\n return this.widget?.querySelector(`div.${Namespace.css.dateContainer}`);\n }\n\n get timeContainer(): HTMLElement | undefined {\n return this.widget?.querySelector(`div.${Namespace.css.timeContainer}`);\n }\n\n /**\n * Returns this visible state of the picker (shown)\n */\n get isVisible() {\n return this._isVisible;\n }\n\n /**\n * Updates the table for a particular unit. Used when an option as changed or\n * whenever the class list might need to be refreshed.\n * @param unit\n * @private\n */\n _update(unit: ViewUpdateValues): void {\n if (!this.widget) return;\n switch (unit) {\n case Unit.seconds:\n this.secondDisplay._update(this.widget, this.paint);\n break;\n case Unit.minutes:\n this.minuteDisplay._update(this.widget, this.paint);\n break;\n case Unit.hours:\n this.hourDisplay._update(this.widget, this.paint);\n break;\n case Unit.date:\n this.dateDisplay._update(this.widget, this.paint);\n break;\n case Unit.month:\n this.monthDisplay._update(this.widget, this.paint);\n break;\n case Unit.year:\n this.yearDisplay._update(this.widget, this.paint);\n break;\n case 'decade':\n this.decadeDisplay._update(this.widget, this.paint);\n break;\n case 'clock':\n if (!this._hasTime) break;\n this.timeDisplay._update(this.widget);\n this._update(Unit.hours);\n this._update(Unit.minutes);\n this._update(Unit.seconds);\n break;\n case 'calendar':\n this._update(Unit.date);\n this._update(Unit.year);\n this._update(Unit.month);\n this.decadeDisplay._update(this.widget, this.paint);\n this._updateCalendarHeader();\n break;\n case 'all':\n if (this._hasTime) {\n this._update('clock');\n }\n if (this._hasDate) {\n this._update('calendar');\n }\n }\n }\n\n // noinspection JSUnusedLocalSymbols\n /**\n * Allows developers to add/remove classes from an element.\n * @param _unit\n * @param _date\n * @param _classes\n * @param _element\n */\n\n /* eslint-disable @typescript-eslint/no-unused-vars */\n paint(\n _unit: Unit | 'decade',\n _date: DateTime,\n _classes: string[],\n _element: HTMLElement\n ) {\n // implemented in plugin\n }\n\n /**\n * Shows the picker and creates a Popper instance if needed.\n * Add document click event to hide when clicking outside the picker.\n * fires Events#show\n */\n show(): void {\n if (this.widget == undefined) {\n this._showSetDefaultIfNeeded();\n\n this._buildWidget();\n this._updateTheme();\n\n this._showSetupViewMode();\n\n if (!this.optionsStore.options.display.inline) {\n // If needed to change the parent container\n const container = this.optionsStore.options?.container || document.body;\n const placement =\n this.optionsStore.options?.display?.placement || 'bottom';\n\n container.appendChild(this.widget);\n this.createPopup(this.optionsStore.element, this.widget, {\n modifiers: [{ name: 'eventListeners', enabled: true }],\n //#2400\n placement:\n document.documentElement.dir === 'rtl'\n ? `${placement}-end`\n : `${placement}-start`,\n }).then();\n } else {\n this.optionsStore.element.appendChild(this.widget);\n }\n\n if (this.optionsStore.options.display.viewMode == 'clock') {\n this._eventEmitters.action.emit({\n e: null,\n action: ActionTypes.showClock,\n });\n }\n\n this.widget\n .querySelectorAll('[data-action]')\n .forEach((element) =>\n element.addEventListener('click', this._actionsClickEvent)\n );\n\n // show the clock when using sideBySide\n if (this._hasTime && this.optionsStore.options.display.sideBySide) {\n this.timeDisplay._update(this.widget);\n (\n this.widget.getElementsByClassName(\n Namespace.css.clockContainer\n )[0] as HTMLElement\n ).style.display = 'grid';\n }\n }\n\n this.widget.classList.add(Namespace.css.show);\n if (!this.optionsStore.options.display.inline) {\n this.updatePopup();\n document.addEventListener('click', this._documentClickEvent);\n }\n this._eventEmitters.triggerEvent.emit({ type: Namespace.events.show });\n this._isVisible = true;\n }\n\n private _showSetupViewMode() {\n // If modeView is only clock\n const onlyClock = this._hasTime && !this._hasDate;\n\n // reset the view to the clock if there's no date components\n if (onlyClock) {\n this.optionsStore.currentView = 'clock';\n this._eventEmitters.action.emit({\n e: null,\n action: ActionTypes.showClock,\n });\n }\n // otherwise return to the calendar view\n else if (!this.optionsStore.currentCalendarViewMode) {\n this.optionsStore.currentCalendarViewMode =\n this.optionsStore.minimumCalendarViewMode;\n }\n\n if (!onlyClock && this.optionsStore.options.display.viewMode !== 'clock') {\n if (this._hasTime) {\n if (!this.optionsStore.options.display.sideBySide) {\n Collapse.hideImmediately(this.timeContainer);\n } else {\n Collapse.show(this.timeContainer);\n }\n }\n Collapse.show(this.dateContainer);\n }\n\n if (this._hasDate) {\n this._showMode();\n }\n }\n\n private _showSetDefaultIfNeeded() {\n if (this.dates.picked.length != 0) return;\n\n if (\n this.optionsStore.options.useCurrent &&\n !this.optionsStore.options.defaultDate\n ) {\n const date = new DateTime().setLocalization(\n this.optionsStore.options.localization\n );\n if (!this.optionsStore.options.keepInvalid) {\n let tries = 0;\n let direction = 1;\n if (this.optionsStore.options.restrictions.maxDate?.isBefore(date)) {\n direction = -1;\n }\n while (!this.validation.isValid(date) && tries > 31) {\n date.manipulate(direction, Unit.date);\n tries++;\n }\n }\n this.dates.setValue(date);\n }\n\n if (this.optionsStore.options.defaultDate) {\n this.dates.setValue(this.optionsStore.options.defaultDate);\n }\n }\n\n async createPopup(\n element: HTMLElement,\n widget: HTMLElement,\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n options: any\n ): Promise {\n let createPopperFunction;\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((window as any)?.Popper) {\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n createPopperFunction = (window as any)?.Popper?.createPopper;\n } else {\n const { createPopper } = await import('@popperjs/core');\n createPopperFunction = createPopper;\n }\n if (createPopperFunction) {\n this._popperInstance = createPopperFunction(element, widget, options);\n }\n }\n\n updatePopup(): void {\n this._popperInstance?.update();\n }\n\n /**\n * Changes the calendar view mode. E.g. month <-> year\n * @param direction -/+ number to move currentViewMode\n * @private\n */\n _showMode(direction?: number): void {\n if (!this.widget) {\n return;\n }\n if (direction) {\n const max = Math.max(\n this.optionsStore.minimumCalendarViewMode,\n Math.min(3, this.optionsStore.currentCalendarViewMode + direction)\n );\n if (this.optionsStore.currentCalendarViewMode == max) return;\n this.optionsStore.currentCalendarViewMode = max;\n }\n\n this.widget\n .querySelectorAll(\n `.${Namespace.css.dateContainer} > div:not(.${Namespace.css.calendarHeader}), .${Namespace.css.timeContainer} > div:not(.${Namespace.css.clockContainer})`\n )\n .forEach((e: HTMLElement) => (e.style.display = 'none'));\n\n const datePickerMode =\n CalendarModes[this.optionsStore.currentCalendarViewMode];\n const picker: HTMLElement = this.widget.querySelector(\n `.${datePickerMode.className}`\n );\n\n switch (datePickerMode.className) {\n case Namespace.css.decadesContainer:\n this.decadeDisplay._update(this.widget, this.paint);\n break;\n case Namespace.css.yearsContainer:\n this.yearDisplay._update(this.widget, this.paint);\n break;\n case Namespace.css.monthsContainer:\n this.monthDisplay._update(this.widget, this.paint);\n break;\n case Namespace.css.daysContainer:\n this.dateDisplay._update(this.widget, this.paint);\n break;\n }\n\n picker.style.display = 'grid';\n\n if (this.optionsStore.options.display.sideBySide)\n ((\n this.widget.querySelectorAll(`.${Namespace.css.clockContainer}`)[0]\n )).style.display = 'grid';\n\n this._updateCalendarHeader();\n this._eventEmitters.viewUpdate.emit();\n }\n\n /**\n * Changes the theme. E.g. light, dark or auto\n * @param theme the theme name\n * @private\n */\n _updateTheme(theme?: 'light' | 'dark' | 'auto'): void {\n if (!this.widget) {\n return;\n }\n if (theme) {\n if (this.optionsStore.options.display.theme === theme) return;\n this.optionsStore.options.display.theme = theme;\n }\n\n this.widget.classList.remove('light', 'dark');\n this.widget.classList.add(this._getThemeClass());\n\n if (this.optionsStore.options.display.theme === 'auto') {\n window\n .matchMedia(Namespace.css.isDarkPreferredQuery)\n .addEventListener('change', () => this._updateTheme());\n } else {\n window\n .matchMedia(Namespace.css.isDarkPreferredQuery)\n .removeEventListener('change', () => this._updateTheme());\n }\n }\n\n _getThemeClass(): string {\n const currentTheme = this.optionsStore.options.display.theme || 'auto';\n\n const isDarkMode =\n window.matchMedia &&\n window.matchMedia(Namespace.css.isDarkPreferredQuery).matches;\n\n switch (currentTheme) {\n case 'light':\n return Namespace.css.lightTheme;\n case 'dark':\n return Namespace.css.darkTheme;\n case 'auto':\n return isDarkMode ? Namespace.css.darkTheme : Namespace.css.lightTheme;\n }\n }\n\n _updateCalendarHeader() {\n if (!this._hasDate) return;\n const showing = [\n ...this.widget.querySelector(\n `.${Namespace.css.dateContainer} div[style*=\"display: grid\"]`\n ).classList,\n ].find((x) => x.startsWith(Namespace.css.dateContainer));\n\n const [previous, switcher, next] = this.widget\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\n .getElementsByTagName('div');\n\n switch (showing) {\n case Namespace.css.decadesContainer:\n previous.setAttribute(\n 'title',\n this.optionsStore.options.localization.previousCentury\n );\n switcher.setAttribute('title', '');\n next.setAttribute(\n 'title',\n this.optionsStore.options.localization.nextCentury\n );\n break;\n case Namespace.css.yearsContainer:\n previous.setAttribute(\n 'title',\n this.optionsStore.options.localization.previousDecade\n );\n switcher.setAttribute(\n 'title',\n this.optionsStore.options.localization.selectDecade\n );\n next.setAttribute(\n 'title',\n this.optionsStore.options.localization.nextDecade\n );\n break;\n case Namespace.css.monthsContainer:\n previous.setAttribute(\n 'title',\n this.optionsStore.options.localization.previousYear\n );\n switcher.setAttribute(\n 'title',\n this.optionsStore.options.localization.selectYear\n );\n next.setAttribute(\n 'title',\n this.optionsStore.options.localization.nextYear\n );\n break;\n case Namespace.css.daysContainer:\n previous.setAttribute(\n 'title',\n this.optionsStore.options.localization.previousMonth\n );\n switcher.setAttribute(\n 'title',\n this.optionsStore.options.localization.selectMonth\n );\n next.setAttribute(\n 'title',\n this.optionsStore.options.localization.nextMonth\n );\n switcher.setAttribute(\n showing,\n this.optionsStore.viewDate.format(\n this.optionsStore.options.localization.dayViewHeaderFormat\n )\n );\n break;\n }\n switcher.innerText = switcher.getAttribute(showing);\n }\n\n /**\n * Hides the picker if needed.\n * Remove document click event to hide when clicking outside the picker.\n * fires Events#hide\n */\n hide(): void {\n if (!this.widget || !this._isVisible) return;\n\n this.widget.classList.remove(Namespace.css.show);\n\n if (this._isVisible) {\n this._eventEmitters.triggerEvent.emit({\n type: Namespace.events.hide,\n date: this.optionsStore.unset ? null : this.dates.lastPicked?.clone,\n } as HideEvent);\n this._isVisible = false;\n }\n\n document.removeEventListener('click', this._documentClickEvent);\n }\n\n /**\n * Toggles the picker's open state. Fires a show/hide event depending.\n */\n toggle() {\n return this._isVisible ? this.hide() : this.show();\n }\n\n /**\n * Removes document and data-action click listener and reset the widget\n * @private\n */\n _dispose() {\n document.removeEventListener('click', this._documentClickEvent);\n if (!this.widget) return;\n this.widget\n .querySelectorAll('[data-action]')\n .forEach((element) =>\n element.removeEventListener('click', this._actionsClickEvent)\n );\n this.widget.parentNode.removeChild(this.widget);\n this._widget = undefined;\n }\n\n /**\n * Builds the widgets html template.\n * @private\n */\n private _buildWidget(): HTMLElement {\n const template = document.createElement('div');\n template.classList.add(Namespace.css.widget);\n\n const dateView = document.createElement('div');\n dateView.classList.add(Namespace.css.dateContainer);\n dateView.append(\n this.getHeadTemplate(),\n this.decadeDisplay.getPicker(),\n this.yearDisplay.getPicker(),\n this.monthDisplay.getPicker(),\n this.dateDisplay.getPicker()\n );\n\n const timeView = document.createElement('div');\n timeView.classList.add(Namespace.css.timeContainer);\n timeView.appendChild(this.timeDisplay.getPicker(this._iconTag.bind(this)));\n timeView.appendChild(this.hourDisplay.getPicker());\n timeView.appendChild(this.minuteDisplay.getPicker());\n timeView.appendChild(this.secondDisplay.getPicker());\n\n const toolbar = document.createElement('div');\n toolbar.classList.add(Namespace.css.toolbar);\n toolbar.append(...this.getToolbarElements());\n\n if (this.optionsStore.options.display.inline) {\n template.classList.add(Namespace.css.inline);\n }\n\n if (this.optionsStore.options.display.calendarWeeks) {\n template.classList.add('calendarWeeks');\n }\n\n if (this.optionsStore.options.display.sideBySide && this._hasDateAndTime) {\n this._buildWidgetSideBySide(template, dateView, timeView, toolbar);\n return;\n }\n\n if (this.optionsStore.options.display.toolbarPlacement === 'top') {\n template.appendChild(toolbar);\n }\n\n const setupComponentView = (hasFirst, hasSecond, element, shouldShow) => {\n if (!hasFirst) return;\n if (hasSecond) {\n element.classList.add(Namespace.css.collapse);\n if (shouldShow) element.classList.add(Namespace.css.show);\n }\n template.appendChild(element);\n };\n\n setupComponentView(\n this._hasDate,\n this._hasTime,\n dateView,\n this.optionsStore.options.display.viewMode !== 'clock'\n );\n\n setupComponentView(\n this._hasTime,\n this._hasDate,\n timeView,\n this.optionsStore.options.display.viewMode === 'clock'\n );\n\n if (this.optionsStore.options.display.toolbarPlacement === 'bottom') {\n template.appendChild(toolbar);\n }\n\n const arrow = document.createElement('div');\n arrow.classList.add('arrow');\n arrow.setAttribute('data-popper-arrow', '');\n template.appendChild(arrow);\n\n this._widget = template;\n }\n\n private _buildWidgetSideBySide(\n template: HTMLDivElement,\n dateView: HTMLDivElement,\n timeView: HTMLDivElement,\n toolbar: HTMLDivElement\n ) {\n template.classList.add(Namespace.css.sideBySide);\n if (this.optionsStore.options.display.toolbarPlacement === 'top') {\n template.appendChild(toolbar);\n }\n const row = document.createElement('div');\n row.classList.add('td-row');\n dateView.classList.add('td-half');\n timeView.classList.add('td-half');\n\n row.appendChild(dateView);\n row.appendChild(timeView);\n template.appendChild(row);\n if (this.optionsStore.options.display.toolbarPlacement === 'bottom') {\n template.appendChild(toolbar);\n }\n this._widget = template;\n }\n\n /**\n * Returns true if the hours, minutes, or seconds component is turned on\n */\n get _hasTime(): boolean {\n return (\n this.optionsStore.options.display.components.clock &&\n (this.optionsStore.options.display.components.hours ||\n this.optionsStore.options.display.components.minutes ||\n this.optionsStore.options.display.components.seconds)\n );\n }\n\n /**\n * Returns true if the year, month, or date component is turned on\n */\n get _hasDate(): boolean {\n return (\n this.optionsStore.options.display.components.calendar &&\n (this.optionsStore.options.display.components.year ||\n this.optionsStore.options.display.components.month ||\n this.optionsStore.options.display.components.date)\n );\n }\n\n get _hasDateAndTime(): boolean {\n return this._hasDate && this._hasTime;\n }\n\n /**\n * Get the toolbar html based on options like buttons => today\n * @private\n */\n getToolbarElements(): HTMLElement[] {\n const toolbar = [];\n\n if (this.optionsStore.options.display.buttons.today) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.today);\n div.setAttribute('title', this.optionsStore.options.localization.today);\n\n div.appendChild(\n this._iconTag(this.optionsStore.options.display.icons.today)\n );\n toolbar.push(div);\n }\n if (\n !this.optionsStore.options.display.sideBySide &&\n this._hasDate &&\n this._hasTime\n ) {\n let title, icon;\n if (this.optionsStore.options.display.viewMode === 'clock') {\n title = this.optionsStore.options.localization.selectDate;\n icon = this.optionsStore.options.display.icons.date;\n } else {\n title = this.optionsStore.options.localization.selectTime;\n icon = this.optionsStore.options.display.icons.time;\n }\n\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.togglePicker);\n div.setAttribute('title', title);\n\n div.appendChild(this._iconTag(icon));\n toolbar.push(div);\n }\n if (this.optionsStore.options.display.buttons.clear) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.clear);\n div.setAttribute('title', this.optionsStore.options.localization.clear);\n\n div.appendChild(\n this._iconTag(this.optionsStore.options.display.icons.clear)\n );\n toolbar.push(div);\n }\n if (this.optionsStore.options.display.buttons.close) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.close);\n div.setAttribute('title', this.optionsStore.options.localization.close);\n\n div.appendChild(\n this._iconTag(this.optionsStore.options.display.icons.close)\n );\n toolbar.push(div);\n }\n\n return toolbar;\n }\n\n /***\n * Builds the base header template with next and previous icons\n * @private\n */\n getHeadTemplate(): HTMLElement {\n const calendarHeader = document.createElement('div');\n calendarHeader.classList.add(Namespace.css.calendarHeader);\n\n const previous = document.createElement('div');\n previous.classList.add(Namespace.css.previous);\n previous.setAttribute('data-action', ActionTypes.previous);\n previous.appendChild(\n this._iconTag(this.optionsStore.options.display.icons.previous)\n );\n\n const switcher = document.createElement('div');\n switcher.classList.add(Namespace.css.switch);\n switcher.setAttribute('data-action', ActionTypes.changeCalendarView);\n\n const next = document.createElement('div');\n next.classList.add(Namespace.css.next);\n next.setAttribute('data-action', ActionTypes.next);\n next.appendChild(\n this._iconTag(this.optionsStore.options.display.icons.next)\n );\n\n calendarHeader.append(previous, switcher, next);\n return calendarHeader;\n }\n\n /**\n * Builds an icon tag as either an ``\n * or with icons => type is `sprites` then a svg tag instead\n * @param iconClass\n * @private\n */\n _iconTag(iconClass: string): HTMLElement | SVGElement {\n if (this.optionsStore.options.display.icons.type === 'sprites') {\n const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n\n const icon = document.createElementNS(\n 'http://www.w3.org/2000/svg',\n 'use'\n );\n icon.setAttribute('xlink:href', iconClass); // Deprecated. Included for backward compatibility\n icon.setAttribute('href', iconClass);\n svg.appendChild(icon);\n\n return svg;\n }\n const icon = document.createElement('i');\n icon.classList.add(...iconClass.split(' '));\n return icon;\n }\n\n /**\n * A document click event to hide the widget if click is outside\n * @private\n * @param e MouseEvent\n */\n private _documentClickEvent = (e: MouseEvent) => {\n if (this.optionsStore.options.debug || (window as any).debug) return; //eslint-disable-line @typescript-eslint/no-explicit-any\n\n if (\n this._isVisible &&\n !e.composedPath().includes(this.widget) && // click inside the widget\n !e.composedPath()?.includes(this.optionsStore.element) // click on the element\n ) {\n this.hide();\n }\n };\n\n /**\n * Click event for any action like selecting a date\n * @param e MouseEvent\n * @private\n */\n private _actionsClickEvent = (e: MouseEvent) => {\n this._eventEmitters.action.emit({ e: e });\n };\n\n /**\n * Causes the widget to get rebuilt on next show. If the picker is already open\n * then hide and reshow it.\n * @private\n */\n _rebuild() {\n const wasVisible = this._isVisible;\n this._dispose();\n if (wasVisible) this.show();\n }\n\n refreshCurrentView() {\n //if the widget is not showing, just destroy it\n if (!this._isVisible) this._dispose();\n\n switch (this.optionsStore.currentView) {\n case 'clock':\n this._update('clock');\n break;\n case 'calendar':\n this._update(Unit.date);\n break;\n case 'months':\n this._update(Unit.month);\n break;\n case 'years':\n this._update(Unit.year);\n break;\n case 'decades':\n this._update('decade');\n break;\n }\n }\n}\n\nexport type Paint = (\n unit: Unit | 'decade',\n innerDate: DateTime,\n classes: string[],\n element: HTMLElement\n) => void;\n","import { DateTime, Unit } from './datetime';\nimport Collapse from './display/collapse';\nimport Namespace from './utilities/namespace';\nimport Dates from './dates';\nimport Validation from './validation';\nimport Display from './display';\nimport { EventEmitters } from './utilities/event-emitter';\nimport { serviceLocator } from './utilities/service-locator.js';\nimport ActionTypes from './utilities/action-types';\nimport CalendarModes from './utilities/calendar-modes';\nimport { OptionsStore } from './utilities/optionsStore';\n\n/**\n * Logic for various click actions\n */\nexport default class Actions {\n private optionsStore: OptionsStore;\n private validation: Validation;\n private dates: Dates;\n private display: Display;\n private _eventEmitters: EventEmitters;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.dates = serviceLocator.locate(Dates);\n this.validation = serviceLocator.locate(Validation);\n this.display = serviceLocator.locate(Display);\n this._eventEmitters = serviceLocator.locate(EventEmitters);\n\n this._eventEmitters.action.subscribe((result) => {\n this.do(result.e, result.action);\n });\n }\n\n /**\n * Performs the selected `action`. See ActionTypes\n * @param e This is normally a click event\n * @param action If not provided, then look for a [data-action]\n */\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n do(e: any, action?: ActionTypes) {\n const currentTarget = e?.currentTarget as HTMLElement;\n if (currentTarget?.classList?.contains(Namespace.css.disabled)) return;\n action = action || (currentTarget?.dataset?.action as ActionTypes);\n const lastPicked = (this.dates.lastPicked || this.optionsStore.viewDate)\n .clone;\n\n switch (action) {\n case ActionTypes.next:\n case ActionTypes.previous:\n this.handleNextPrevious(action);\n break;\n case ActionTypes.changeCalendarView:\n this.display._showMode(1);\n this.display._updateCalendarHeader();\n break;\n case ActionTypes.selectMonth:\n case ActionTypes.selectYear:\n case ActionTypes.selectDecade:\n this.handleSelectCalendarMode(action, currentTarget);\n break;\n case ActionTypes.selectDay:\n this.handleSelectDay(currentTarget);\n break;\n case ActionTypes.selectHour: {\n let hour = +currentTarget.dataset.value;\n if (lastPicked.hours >= 12 && this.optionsStore.isTwelveHour)\n hour += 12;\n lastPicked.hours = hour;\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\n this.hideOrClock(e);\n break;\n }\n case ActionTypes.selectMinute: {\n lastPicked.minutes = +currentTarget.dataset.value;\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\n this.hideOrClock(e);\n break;\n }\n case ActionTypes.selectSecond: {\n lastPicked.seconds = +currentTarget.dataset.value;\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\n this.hideOrClock(e);\n break;\n }\n case ActionTypes.incrementHours:\n this.manipulateAndSet(lastPicked, Unit.hours);\n break;\n case ActionTypes.incrementMinutes:\n this.manipulateAndSet(\n lastPicked,\n Unit.minutes,\n this.optionsStore.options.stepping\n );\n break;\n case ActionTypes.incrementSeconds:\n this.manipulateAndSet(lastPicked, Unit.seconds);\n break;\n case ActionTypes.decrementHours:\n this.manipulateAndSet(lastPicked, Unit.hours, -1);\n break;\n case ActionTypes.decrementMinutes:\n this.manipulateAndSet(\n lastPicked,\n Unit.minutes,\n this.optionsStore.options.stepping * -1\n );\n break;\n case ActionTypes.decrementSeconds:\n this.manipulateAndSet(lastPicked, Unit.seconds, -1);\n break;\n case ActionTypes.toggleMeridiem:\n this.manipulateAndSet(\n lastPicked,\n Unit.hours,\n this.dates.lastPicked.hours >= 12 ? -12 : 12\n );\n break;\n case ActionTypes.togglePicker:\n this.handleToggle(currentTarget);\n break;\n case ActionTypes.showClock:\n case ActionTypes.showHours:\n case ActionTypes.showMinutes:\n case ActionTypes.showSeconds:\n //make sure the clock is actually displaying\n if (\n !this.optionsStore.options.display.sideBySide &&\n this.optionsStore.currentView !== 'clock'\n ) {\n //hide calendar\n Collapse.hideImmediately(this.display.dateContainer);\n //show clock\n Collapse.showImmediately(this.display.timeContainer);\n }\n this.handleShowClockContainers(action);\n break;\n case ActionTypes.clear:\n this.dates.setValue(null);\n this.display._updateCalendarHeader();\n break;\n case ActionTypes.close:\n this.display.hide();\n break;\n case ActionTypes.today: {\n const today = new DateTime().setLocalization(\n this.optionsStore.options.localization\n );\n this._eventEmitters.updateViewDate.emit(today);\n\n //todo this this really a good idea?\n if (this.validation.isValid(today, Unit.date))\n this.dates.setValue(today, this.dates.lastPickedIndex);\n break;\n }\n }\n }\n\n private handleShowClockContainers(action: ActionTypes) {\n if (!this.display._hasTime) {\n Namespace.errorMessages.throwError(\n 'Cannot show clock containers when time is disabled.'\n );\n /* ignore coverage: should never happen */\n return;\n }\n\n this.optionsStore.currentView = 'clock';\n this.display.widget\n .querySelectorAll(`.${Namespace.css.timeContainer} > div`)\n .forEach(\n (htmlElement: HTMLElement) => (htmlElement.style.display = 'none')\n );\n\n let classToUse = '';\n switch (action) {\n case ActionTypes.showClock:\n classToUse = Namespace.css.clockContainer;\n this.display._update('clock');\n break;\n case ActionTypes.showHours:\n classToUse = Namespace.css.hourContainer;\n this.display._update(Unit.hours);\n break;\n case ActionTypes.showMinutes:\n classToUse = Namespace.css.minuteContainer;\n this.display._update(Unit.minutes);\n break;\n case ActionTypes.showSeconds:\n classToUse = Namespace.css.secondContainer;\n this.display._update(Unit.seconds);\n break;\n }\n\n ((\n this.display.widget.getElementsByClassName(classToUse)[0]\n )).style.display = 'grid';\n }\n\n private handleNextPrevious(action: ActionTypes) {\n const { unit, step } =\n CalendarModes[this.optionsStore.currentCalendarViewMode];\n if (action === ActionTypes.next)\n this.optionsStore.viewDate.manipulate(step, unit);\n else this.optionsStore.viewDate.manipulate(step * -1, unit);\n this._eventEmitters.viewUpdate.emit();\n\n this.display._showMode();\n }\n\n /**\n * After setting the value it will either show the clock or hide the widget.\n * @param e\n */\n private hideOrClock(e) {\n if (\n !this.optionsStore.isTwelveHour &&\n !this.optionsStore.options.display.components.minutes &&\n !this.optionsStore.options.display.keepOpen &&\n !this.optionsStore.options.display.inline\n ) {\n this.display.hide();\n } else {\n this.do(e, ActionTypes.showClock);\n }\n }\n\n /**\n * Common function to manipulate {@link lastPicked} by `unit`.\n * @param lastPicked\n * @param unit\n * @param value Value to change by\n */\n private manipulateAndSet(lastPicked: DateTime, unit: Unit, value = 1) {\n const newDate = lastPicked.manipulate(value, unit);\n if (this.validation.isValid(newDate, unit)) {\n this.dates.setValue(newDate, this.dates.lastPickedIndex);\n }\n }\n\n private handleSelectCalendarMode(\n action:\n | ActionTypes.selectMonth\n | ActionTypes.selectYear\n | ActionTypes.selectDecade,\n currentTarget: HTMLElement\n ) {\n const value = +currentTarget.dataset.value;\n switch (action) {\n case ActionTypes.selectMonth:\n this.optionsStore.viewDate.month = value;\n break;\n case ActionTypes.selectYear:\n case ActionTypes.selectDecade:\n this.optionsStore.viewDate.year = value;\n break;\n }\n\n if (\n this.optionsStore.currentCalendarViewMode ===\n this.optionsStore.minimumCalendarViewMode\n ) {\n this.dates.setValue(\n this.optionsStore.viewDate,\n this.dates.lastPickedIndex\n );\n\n if (!this.optionsStore.options.display.inline) {\n this.display.hide();\n }\n } else {\n this.display._showMode(-1);\n }\n }\n\n private handleToggle(currentTarget: HTMLElement) {\n if (\n currentTarget.getAttribute('title') ===\n this.optionsStore.options.localization.selectDate\n ) {\n currentTarget.setAttribute(\n 'title',\n this.optionsStore.options.localization.selectTime\n );\n currentTarget.innerHTML = this.display._iconTag(\n this.optionsStore.options.display.icons.time\n ).outerHTML;\n\n this.display._updateCalendarHeader();\n this.optionsStore.refreshCurrentView();\n } else {\n currentTarget.setAttribute(\n 'title',\n this.optionsStore.options.localization.selectDate\n );\n currentTarget.innerHTML = this.display._iconTag(\n this.optionsStore.options.display.icons.date\n ).outerHTML;\n if (this.display._hasTime) {\n this.handleShowClockContainers(ActionTypes.showClock);\n this.display._update('clock');\n }\n }\n\n this.display.widget\n .querySelectorAll(\n `.${Namespace.css.dateContainer}, .${Namespace.css.timeContainer}`\n )\n .forEach((htmlElement: HTMLElement) => Collapse.toggle(htmlElement));\n this._eventEmitters.viewUpdate.emit();\n }\n\n private handleSelectDay(currentTarget: HTMLElement) {\n const day = this.optionsStore.viewDate.clone;\n if (currentTarget.classList.contains(Namespace.css.old)) {\n day.manipulate(-1, Unit.month);\n }\n if (currentTarget.classList.contains(Namespace.css.new)) {\n day.manipulate(1, Unit.month);\n }\n\n day.date = +currentTarget.dataset.day;\n if (this.optionsStore.options.dateRange) this.handleDateRange(day);\n else if (this.optionsStore.options.multipleDates) {\n this.handleMultiDate(day);\n } else {\n this.dates.setValue(day, this.dates.lastPickedIndex);\n }\n\n if (\n !this.display._hasTime &&\n !this.optionsStore.options.display.keepOpen &&\n !this.optionsStore.options.display.inline &&\n !this.optionsStore.options.multipleDates &&\n !this.optionsStore.options.dateRange\n ) {\n this.display.hide();\n }\n }\n\n private handleMultiDate(day: DateTime) {\n let index = this.dates.pickedIndex(day, Unit.date);\n console.log(index);\n if (index !== -1) {\n this.dates.setValue(null, index); //deselect multi-date\n } else {\n index = this.dates.lastPickedIndex + 1;\n if (this.dates.picked.length === 0) index = 0;\n\n this.dates.setValue(day, index);\n }\n }\n\n private handleDateRange(day: DateTime) {\n switch (this.dates.picked.length) {\n case 2: {\n this.dates.clear();\n break;\n }\n case 1: {\n const other = this.dates.picked[0];\n if (day.getTime() === other.getTime()) {\n this.dates.clear();\n break;\n }\n if (day.isBefore(other)) {\n this.dates.setValue(day, 0);\n this.dates.setValue(other, 1);\n return;\n } else {\n this.dates.setValue(day, 1);\n return;\n }\n }\n }\n\n this.dates.setValue(day, 0);\n }\n}\n","import Display from './display/index';\nimport Dates from './dates';\nimport Actions from './actions';\nimport {\n DateTime,\n DateTimeFormatOptions,\n guessHourCycle,\n Unit,\n} from './datetime';\nimport Namespace from './utilities/namespace';\nimport Options from './utilities/options';\nimport {\n BaseEvent,\n ChangeEvent,\n ViewUpdateEvent,\n} from './utilities/event-types';\nimport { EventEmitters } from './utilities/event-emitter';\nimport {\n serviceLocator,\n setupServiceLocator,\n} from './utilities/service-locator';\nimport CalendarModes from './utilities/calendar-modes';\nimport DefaultOptions, {\n DefaultEnLocalization,\n} from './utilities/default-options';\nimport ActionTypes from './utilities/action-types';\nimport { OptionsStore } from './utilities/optionsStore';\nimport { OptionConverter } from './utilities/optionConverter';\n\n/**\n * A robust and powerful date/time picker component.\n */\nclass TempusDominus {\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n _subscribers: { [key: string]: ((event: any) => Record)[] } =\n {};\n private _isDisabled = false;\n private _toggle: HTMLElement;\n private _currentPromptTimeTimeout: NodeJS.Timeout;\n private actions: Actions;\n private optionsStore: OptionsStore;\n private _eventEmitters: EventEmitters;\n display: Display;\n dates: Dates;\n\n constructor(element: HTMLElement, options: Options = {} as Options) {\n setupServiceLocator();\n this._eventEmitters = serviceLocator.locate(EventEmitters);\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.display = serviceLocator.locate(Display);\n this.dates = serviceLocator.locate(Dates);\n this.actions = serviceLocator.locate(Actions);\n\n if (!element) {\n Namespace.errorMessages.mustProvideElement();\n }\n\n this.optionsStore.element = element;\n this._initializeOptions(options, DefaultOptions, true);\n this.optionsStore.viewDate.setLocalization(\n this.optionsStore.options.localization\n );\n this.optionsStore.unset = true;\n\n this._initializeInput();\n this._initializeToggle();\n\n if (this.optionsStore.options.display.inline) this.display.show();\n\n this._eventEmitters.triggerEvent.subscribe((e) => {\n this._triggerEvent(e);\n });\n\n this._eventEmitters.viewUpdate.subscribe(() => {\n this._viewUpdate();\n });\n\n this._eventEmitters.updateViewDate.subscribe((dateTime) => {\n this.viewDate = dateTime;\n });\n }\n\n get viewDate() {\n return this.optionsStore.viewDate;\n }\n\n set viewDate(value) {\n this.optionsStore.viewDate = value;\n this.optionsStore.viewDate.setLocalization(\n this.optionsStore.options.localization\n );\n this.display._update(\n this.optionsStore.currentView === 'clock' ? 'clock' : 'calendar'\n );\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Update the picker options. If `reset` is provide `options` will be merged with DefaultOptions instead.\n * @param options\n * @param reset\n * @public\n */\n updateOptions(options, reset = false): void {\n if (reset) this._initializeOptions(options, DefaultOptions);\n else this._initializeOptions(options, this.optionsStore.options);\n\n this.optionsStore.viewDate.setLocalization(\n this.optionsStore.options.localization\n );\n this.display.refreshCurrentView();\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Toggles the picker open or closed. If the picker is disabled, nothing will happen.\n * @public\n */\n toggle(): void {\n if (this._isDisabled) return;\n this.display.toggle();\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Shows the picker unless the picker is disabled.\n * @public\n */\n show(): void {\n if (this._isDisabled) return;\n this.display.show();\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Hides the picker unless the picker is disabled.\n * @public\n */\n hide(): void {\n this.display.hide();\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Disables the picker and the target input field.\n * @public\n */\n disable(): void {\n this._isDisabled = true;\n // todo this might be undesired. If a dev disables the input field to\n // only allow using the picker, this will break that.\n this.optionsStore.input?.setAttribute('disabled', 'disabled');\n this.display.hide();\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Enables the picker and the target input field.\n * @public\n */\n enable(): void {\n this._isDisabled = false;\n this.optionsStore.input?.removeAttribute('disabled');\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Clears all the selected dates\n * @public\n */\n clear(): void {\n this.optionsStore.input.value = '';\n this.dates.clear();\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Allows for a direct subscription to picker events, without having to use addEventListener on the element.\n * @param eventTypes See Namespace.Events\n * @param callbacks Function to call when event is triggered\n * @public\n */\n subscribe(\n eventTypes: string | string[],\n callbacks: (event: any) => void | ((event: any) => void)[] //eslint-disable-line @typescript-eslint/no-explicit-any\n ): { unsubscribe: () => void } | { unsubscribe: () => void }[] {\n if (typeof eventTypes === 'string') {\n eventTypes = [eventTypes];\n }\n let callBackArray: any[]; //eslint-disable-line @typescript-eslint/no-explicit-any\n if (!Array.isArray(callbacks)) {\n callBackArray = [callbacks];\n } else {\n callBackArray = callbacks;\n }\n\n if (eventTypes.length !== callBackArray.length) {\n Namespace.errorMessages.subscribeMismatch();\n }\n\n const returnArray = [];\n\n for (let i = 0; i < eventTypes.length; i++) {\n const eventType = eventTypes[i];\n if (!Array.isArray(this._subscribers[eventType])) {\n this._subscribers[eventType] = [];\n }\n\n this._subscribers[eventType].push(callBackArray[i]);\n\n returnArray.push({\n unsubscribe: this._unsubscribe.bind(\n this,\n eventType,\n this._subscribers[eventType].length - 1\n ),\n });\n\n if (eventTypes.length === 1) {\n return returnArray[0];\n }\n }\n\n return returnArray;\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Hides the picker and removes event listeners\n */\n dispose() {\n this.display.hide();\n // this will clear the document click event listener\n this.display._dispose();\n this._eventEmitters.destroy();\n this.optionsStore.input?.removeEventListener(\n 'change',\n this._inputChangeEvent\n );\n if (this.optionsStore.options.allowInputToggle) {\n this.optionsStore.input?.removeEventListener(\n 'click',\n this._openClickEvent\n );\n this.optionsStore.input?.removeEventListener(\n 'focus',\n this._openClickEvent\n );\n }\n this._toggle?.removeEventListener('click', this._toggleClickEvent);\n this._subscribers = {};\n }\n\n /**\n * Updates the options to use the provided language.\n * THe language file must be loaded first.\n * @param language\n */\n locale(language: string) {\n const asked = loadedLocales[language];\n if (!asked) return;\n this.updateOptions({\n localization: asked,\n });\n }\n\n /**\n * Triggers an event like ChangeEvent when the picker has updated the value\n * of a selected date.\n * @param event Accepts a BaseEvent object.\n * @private\n */\n private _triggerEvent(event: BaseEvent) {\n event.viewMode = this.optionsStore.currentView;\n\n const isChangeEvent = event.type === Namespace.events.change;\n if (isChangeEvent) {\n const { date, oldDate, isClear } = event as ChangeEvent;\n if (\n (date && oldDate && date.isSame(oldDate)) ||\n (!isClear && !date && !oldDate)\n ) {\n return;\n }\n this._handleAfterChangeEvent(event as ChangeEvent);\n\n this.optionsStore.input?.dispatchEvent(\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n new CustomEvent('change', { detail: event as any })\n );\n }\n\n this.optionsStore.element.dispatchEvent(\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n new CustomEvent(event.type, { detail: event as any })\n );\n\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((window as any).jQuery) {\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n const $ = (window as any).jQuery;\n\n if (isChangeEvent && this.optionsStore.input) {\n $(this.optionsStore.input).trigger(event);\n } else {\n $(this.optionsStore.element).trigger(event);\n }\n }\n\n this._publish(event);\n }\n\n private _publish(event: BaseEvent) {\n // return if event is not subscribed\n if (!Array.isArray(this._subscribers[event.type])) {\n return;\n }\n\n // Trigger callback for each subscriber\n this._subscribers[event.type].forEach((callback) => {\n callback(event);\n });\n }\n\n /**\n * Fires a ViewUpdate event when, for example, the month view is changed.\n * @private\n */\n private _viewUpdate() {\n this._triggerEvent({\n type: Namespace.events.update,\n viewDate: this.optionsStore.viewDate.clone,\n } as ViewUpdateEvent);\n }\n\n private _unsubscribe(eventName, index) {\n this._subscribers[eventName].splice(index, 1);\n }\n\n /**\n * Merges two Option objects together and validates options type\n * @param config new Options\n * @param mergeTo Options to merge into\n * @param includeDataset When true, the elements data-td attributes will be included in the\n * @private\n */\n private _initializeOptions(\n config: Options,\n mergeTo: Options,\n includeDataset = false\n ): void {\n let newConfig = OptionConverter.deepCopy(config);\n newConfig = OptionConverter._mergeOptions(newConfig, mergeTo);\n if (includeDataset)\n newConfig = OptionConverter._dataToOptions(\n this.optionsStore.element,\n newConfig\n );\n\n OptionConverter._validateConflicts(newConfig);\n\n newConfig.viewDate = newConfig.viewDate.setLocalization(\n newConfig.localization\n );\n\n if (!this.optionsStore.viewDate.isSame(newConfig.viewDate)) {\n this.optionsStore.viewDate = newConfig.viewDate;\n }\n\n /**\n * Sets the minimum view allowed by the picker. For example the case of only\n * allowing year and month to be selected but not date.\n */\n if (newConfig.display.components.year) {\n this.optionsStore.minimumCalendarViewMode = 2;\n }\n if (newConfig.display.components.month) {\n this.optionsStore.minimumCalendarViewMode = 1;\n }\n if (newConfig.display.components.date) {\n this.optionsStore.minimumCalendarViewMode = 0;\n }\n\n this.optionsStore.currentCalendarViewMode = Math.max(\n this.optionsStore.minimumCalendarViewMode,\n this.optionsStore.currentCalendarViewMode\n );\n\n // Update view mode if needed\n if (\n CalendarModes[this.optionsStore.currentCalendarViewMode].name !==\n newConfig.display.viewMode\n ) {\n this.optionsStore.currentCalendarViewMode = Math.max(\n CalendarModes.findIndex((x) => x.name === newConfig.display.viewMode),\n this.optionsStore.minimumCalendarViewMode\n );\n }\n\n if (this.display?.isVisible) {\n this.display._update('all');\n }\n\n if (\n newConfig.display.components.useTwentyfourHour &&\n newConfig.localization.hourCycle === undefined\n )\n newConfig.localization.hourCycle = 'h24';\n else if (newConfig.localization.hourCycle === undefined) {\n newConfig.localization.hourCycle = guessHourCycle(\n newConfig.localization.locale\n );\n }\n\n this.optionsStore.options = newConfig;\n\n if (\n newConfig.restrictions.maxDate &&\n this.viewDate.isAfter(newConfig.restrictions.maxDate)\n )\n this.viewDate = newConfig.restrictions.maxDate;\n\n if (\n newConfig.restrictions.minDate &&\n this.viewDate.isBefore(newConfig.restrictions.minDate)\n )\n this.viewDate = newConfig.restrictions.minDate;\n }\n\n /**\n * Checks if an input field is being used, attempts to locate one and sets an\n * event listener if found.\n * @private\n */\n private _initializeInput() {\n if (this.optionsStore.element.tagName == 'INPUT') {\n this.optionsStore.input = this.optionsStore.element as HTMLInputElement;\n } else {\n const query = this.optionsStore.element.dataset.tdTargetInput;\n if (query == undefined || query == 'nearest') {\n this.optionsStore.input =\n this.optionsStore.element.querySelector('input');\n } else {\n this.optionsStore.input =\n this.optionsStore.element.querySelector(query);\n }\n }\n\n if (!this.optionsStore.input) return;\n\n if (!this.optionsStore.input.value && this.optionsStore.options.defaultDate)\n this.optionsStore.input.value = this.dates.formatInput(\n this.optionsStore.options.defaultDate\n );\n\n this.optionsStore.input.addEventListener('change', this._inputChangeEvent);\n if (this.optionsStore.options.allowInputToggle) {\n this.optionsStore.input.addEventListener('click', this._openClickEvent);\n this.optionsStore.input.addEventListener('focus', this._openClickEvent);\n }\n\n if (this.optionsStore.input.value) {\n this._inputChangeEvent();\n }\n }\n\n /**\n * Attempts to locate a toggle for the picker and sets an event listener\n * @private\n */\n private _initializeToggle() {\n if (this.optionsStore.options.display.inline) return;\n let query = this.optionsStore.element.dataset.tdTargetToggle;\n if (query == 'nearest') {\n query = '[data-td-toggle=\"datetimepicker\"]';\n }\n this._toggle =\n query == undefined\n ? this.optionsStore.element\n : this.optionsStore.element.querySelector(query);\n this._toggle.addEventListener('click', this._toggleClickEvent);\n }\n\n /**\n * If the option is enabled this will render the clock view after a date pick.\n * @param e change event\n * @private\n */\n private _handleAfterChangeEvent(e: ChangeEvent) {\n if (\n // options is disabled\n !this.optionsStore.options.promptTimeOnDateChange ||\n this.optionsStore.options.multipleDates ||\n this.optionsStore.options.display.inline ||\n this.optionsStore.options.display.sideBySide ||\n // time is disabled\n !this.display._hasTime ||\n // clock component is already showing\n this.display.widget\n ?.getElementsByClassName(Namespace.css.show)[0]\n .classList.contains(Namespace.css.timeContainer)\n )\n return;\n\n // First time ever. If useCurrent option is set to true (default), do nothing\n // because the first date is selected automatically.\n // or date didn't change (time did) or date changed because time did.\n if (\n (!e.oldDate && this.optionsStore.options.useCurrent) ||\n (e.oldDate && e.date?.isSame(e.oldDate))\n ) {\n return;\n }\n\n clearTimeout(this._currentPromptTimeTimeout);\n this._currentPromptTimeTimeout = setTimeout(() => {\n if (this.display.widget) {\n this._eventEmitters.action.emit({\n e: {\n currentTarget: this.display.widget.querySelector(\n '[data-action=\"togglePicker\"]'\n ),\n },\n action: ActionTypes.togglePicker,\n });\n }\n }, this.optionsStore.options.promptTimeOnDateChangeTransitionDelay);\n }\n\n /**\n * Event for when the input field changes. This is a class level method so there's\n * something for the remove listener function.\n * @private\n */\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _inputChangeEvent = (event?: any) => {\n const internallyTriggered = event?.detail;\n if (internallyTriggered) return;\n\n const setViewDate = () => {\n if (this.dates.lastPicked)\n this.optionsStore.viewDate = this.dates.lastPicked.clone;\n };\n\n const value = this.optionsStore.input.value;\n if (\n this.optionsStore.options.multipleDates ||\n this.optionsStore.options.dateRange\n ) {\n try {\n const valueSplit = value.split(\n this.optionsStore.options.multipleDatesSeparator\n );\n for (let i = 0; i < valueSplit.length; i++) {\n this.dates.setFromInput(valueSplit[i], i);\n }\n setViewDate();\n } catch {\n console.warn(\n 'TD: Something went wrong trying to set the multipleDates values from the input field.'\n );\n }\n } else {\n this.dates.setFromInput(value, 0);\n setViewDate();\n }\n };\n\n /**\n * Event for when the toggle is clicked. This is a class level method so there's\n * something for the remove listener function.\n * @private\n */\n private _toggleClickEvent = () => {\n if (\n (this.optionsStore.element as HTMLInputElement)?.disabled ||\n this.optionsStore.input?.disabled ||\n //if we just have the input and allow input toggle is enabled, then don't cause a toggle\n (this._toggle.nodeName === 'INPUT' &&\n (this._toggle as HTMLInputElement)?.type === 'text' &&\n this.optionsStore.options.allowInputToggle)\n )\n return;\n this.toggle();\n };\n\n /**\n * Event for when the toggle is clicked. This is a class level method so there's\n * something for the remove listener function.\n * @private\n */\n private _openClickEvent = () => {\n if (\n (this.optionsStore.element as HTMLInputElement)?.disabled ||\n this.optionsStore.input?.disabled\n )\n return;\n if (!this.display.isVisible) this.show();\n };\n}\n\n/**\n * Whenever a locale is loaded via a plugin then store it here based on the\n * locale name. E.g. loadedLocales['ru']\n */\nconst loadedLocales = {};\n\n// noinspection JSUnusedGlobalSymbols\n/**\n * Called from a locale plugin.\n * @param l locale object for localization options\n */\nconst loadLocale = (l) => {\n if (loadedLocales[l.name]) return;\n loadedLocales[l.name] = l.localization;\n};\n\n/**\n * A sets the global localization options to the provided locale name.\n * `loadLocale` MUST be called first.\n * @param l\n */\nconst locale = (l: string) => {\n const asked = loadedLocales[l];\n if (!asked) return;\n DefaultOptions.localization = asked;\n};\n\n// noinspection JSUnusedGlobalSymbols\n/**\n * Called from a plugin to extend or override picker defaults.\n * @param plugin\n * @param option\n */\nconst extend = function (plugin, option = undefined) {\n if (!plugin) return tempusDominus;\n if (!plugin.installed) {\n // install plugin only once\n plugin(\n option,\n { TempusDominus, Dates, Display, DateTime, Namespace },\n tempusDominus\n );\n plugin.installed = true;\n }\n return tempusDominus;\n};\n\nconst version = '6.7.19';\n\nconst tempusDominus = {\n TempusDominus,\n extend,\n loadLocale,\n locale,\n Namespace,\n DefaultOptions,\n DateTime,\n Unit,\n version,\n DefaultEnLocalization,\n};\n\nexport {\n TempusDominus,\n extend,\n loadLocale,\n locale,\n Namespace,\n DefaultOptions,\n DateTime,\n Unit,\n version,\n DateTimeFormatOptions,\n Options,\n DefaultEnLocalization,\n};\n"],"names":["Unit","DefaultFormatLocalization","ActionTypes","SecondDisplay"],"mappings":";;;;;;;;;;;EAAM,MAAO,OAAQ,SAAQ,KAAK,CAAA;EAEjC,CAAA;QAEY,aAAa,CAAA;EAA1B,IAAA,WAAA,GAAA;UACU,IAAI,CAAA,IAAA,GAAG,KAAK,CAAC;;;EAqKrB;;;EAGG;UACH,IAAsB,CAAA,sBAAA,GAAG,4BAA4B,CAAC;EAEtD;;;EAGG;UACH,IAAkB,CAAA,kBAAA,GAAG,0BAA0B,CAAC;;OAGjD;;EA9KC;;;EAGG;EACH,IAAA,gBAAgB,CAAC,UAAkB,EAAA;EACjC,QAAA,MAAM,KAAK,GAAG,IAAI,OAAO,CACvB,CAAA,EAAG,IAAI,CAAC,IAAI,CAAA,oBAAA,EAAuB,UAAU,CAAA,+BAAA,CAAiC,CAC/E,CAAC;EACF,QAAA,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC;EACf,QAAA,MAAM,KAAK,CAAC;OACb;EAED;;;EAGG;EACH,IAAA,iBAAiB,CAAC,UAAoB,EAAA;EACpC,QAAA,MAAM,KAAK,GAAG,IAAI,OAAO,CAAC,CAAA,EAAG,IAAI,CAAC,IAAI,CAAK,EAAA,EAAA,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA,CAAE,CAAC,CAAC;EACpE,QAAA,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC;EACf,QAAA,MAAM,KAAK,CAAC;OACb;EAED;;;;;;;EAOG;EACH,IAAA,qBAAqB,CACnB,UAAkB,EAClB,QAAgB,EAChB,YAAsB,EAAA;UAEtB,MAAM,KAAK,GAAG,IA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EACA;;;;EAIG;AACH,QAAM,MAAM,GAAG,UAAU,MAAM,EAAE,MAAM,GAAG,SAAS,EAAA;EACjD,IAAA,IAAI,CAAC,MAAM;EAAE,QAAA,OAAO,aAAa,CAAC;EAClC,IAAA,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE;;EAErB,QAAA,MAAM,CACJ,MAAM,EACN,EAAE,aAAa,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,EACtD,aAAa,CACd,CAAC;EACF,QAAA,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC;EACzB,KAAA;EACD,IAAA,OAAO,aAAa,CAAC;EACvB,EAAE;AAEI,QAAA,OAAO,GAAG,SAAS;EAEzB,MAAM,aAAa,GAAG;MACpB,aAAa;MACb,MAAM;MACN,UAAU;MACV,MAAM;MACN,SAAS;MACT,cAAc;MACd,QAAQ;YACRF,YAAI;MACJ,OAAO;MACP,qBAAqB;GACtB;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/@eonasdan/tempus-dominus/dist/js/tempus-dominus.min.js b/node_modules/@eonasdan/tempus-dominus/dist/js/tempus-dominus.min.js deleted file mode 100644 index 92df3cc..0000000 --- a/node_modules/@eonasdan/tempus-dominus/dist/js/tempus-dominus.min.js +++ /dev/null @@ -1,6 +0,0 @@ -/*! - * Tempus Dominus v6.7.19 (https://getdatepicker.com/) - * Copyright 2013-2023 Jonathan Peterson - * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) - */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).tempusDominus={})}(this,(function(t){"use strict";class e extends Error{}const s="tempus-dominus";class i{}i.NAME=s,i.dataKey="td",i.events=new class{constructor(){this.key=".td",this.change=`change${this.key}`,this.update=`update${this.key}`,this.error=`error${this.key}`,this.show=`show${this.key}`,this.hide=`hide${this.key}`,this.blur=`blur${this.key}`,this.focus=`focus${this.key}`,this.keyup=`keyup${this.key}`,this.keydown=`keydown${this.key}`}},i.css=new class{constructor(){this.widget=`${s}-widget`,this.calendarHeader="calendar-header",this.switch="picker-switch",this.toolbar="toolbar",this.noHighlight="no-highlight",this.sideBySide="timepicker-sbs",this.previous="previous",this.next="next",this.disabled="disabled",this.old="old",this.new="new",this.active="active",this.dateContainer="date-container",this.decadesContainer=`${this.dateContainer}-decades`,this.decade="decade",this.yearsContainer=`${this.dateContainer}-years`,this.year="year",this.monthsContainer=`${this.dateContainer}-months`,this.month="month",this.daysContainer=`${this.dateContainer}-days`,this.day="day",this.calendarWeeks="cw",this.dayOfTheWeek="dow",this.today="today",this.weekend="weekend",this.rangeIn="range-in",this.rangeStart="range-start",this.rangeEnd="range-end",this.timeContainer="time-container",this.separator="separator",this.clockContainer=`${this.timeContainer}-clock`,this.hourContainer=`${this.timeContainer}-hour`,this.minuteContainer=`${this.timeContainer}-minute`,this.secondContainer=`${this.timeContainer}-second`,this.hour="hour",this.minute="minute",this.second="second",this.toggleMeridiem="toggleMeridiem",this.show="show",this.collapsing="td-collapsing",this.collapse="td-collapse",this.inline="inline",this.lightTheme="light",this.darkTheme="dark",this.isDarkPreferredQuery="(prefers-color-scheme: dark)"}},i.errorMessages=new class{constructor(){this.base="TD:",this.failedToSetInvalidDate="Failed to set invalid date",this.failedToParseInput="Failed parse input field"}unexpectedOption(t){const s=new e(`${this.base} Unexpected option: ${t} does not match a known option.`);throw s.code=1,s}unexpectedOptions(t){const s=new e(`${this.base}: ${t.join(", ")}`);throw s.code=1,s}unexpectedOptionValue(t,s,i){const o=new e(`${this.base} Unexpected option value: ${t} does not accept a value of "${s}". Valid values are: ${i.join(", ")}`);throw o.code=2,o}typeMismatch(t,s,i){const o=new e(`${this.base} Mismatch types: ${t} has a type of ${s} instead of the required ${i}`);throw o.code=3,o}numbersOutOfRange(t,s,i){const o=new e(`${this.base} ${t} expected an array of number between ${s} and ${i}.`);throw o.code=4,o}failedToParseDate(t,s,i=!1){const o=new e(`${this.base} Could not correctly parse "${s}" to a date for ${t}.`);if(o.code=5,!i)throw o;console.warn(o)}mustProvideElement(){const t=new e(`${this.base} No element was provided.`);throw t.code=6,t}subscribeMismatch(){const t=new e(`${this.base} The subscribed events does not match the number of callbacks`);throw t.code=7,t}conflictingConfiguration(t){const s=new e(`${this.base} A configuration value conflicts with another rule. ${t}`);throw s.code=8,s}customDateFormatError(t){const s=new e(`${this.base} Custom Date Format: ${t}`);throw s.code=9,s}dateString(){console.warn(`${this.base} Using a string for date options is not recommended unless you specify an ISO string or use the customDateFormat plugin.`)}deprecatedWarning(t,e){console.warn(`${this.base} Warning ${t} is deprecated and will be removed in a future version. ${e}`)}throwError(t){const s=new e(`${this.base} ${t}`);throw s.code=9,s}};var o,a={...{dateFormats:{LTS:"h:mm:ss T",LT:"h:mm T",L:"MM/dd/yyyy",LL:"MMMM d, yyyy",LLL:"MMMM d, yyyy h:mm T",LLLL:"dddd, MMMM d, yyyy h:mm T"},format:"L LT",locale:"default",hourCycle:void 0,ordinal:t=>{const e=["th","st","nd","rd"],s=t%100;return`[${t}${e[(s-20)%10]||e[s]||e[0]}]`}}};t.Unit=void 0,(o=t.Unit||(t.Unit={})).seconds="seconds",o.minutes="minutes",o.hours="hours",o.date="date",o.month="month",o.year="year";const n={month:"2-digit",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"},r=t=>{switch(t){case"date":return{dateStyle:"short"};case"month":return{month:"numeric",year:"numeric"};case"year":return{year:"numeric"}}},d=t=>{if(!t)return"h12";const e={hour:"2-digit",minute:"2-digit",numberingSystem:"latn"},s=(new l).setLocalization({locale:t});s.hours=0;const i=s.parts(void 0,e).hour;if("12"===i)return"h12";if("24"===i)return"h24";s.hours=23;const o=s.parts(void 0,e).hour;return"00"===i&&"11"===o?"h11":"00"===i&&"23"===o?"h23":void console.warn(`couldn't determine hour cycle for ${t}. start: ${i}. end: ${o}`)};class l extends Date{constructor(){super(...arguments),this.localization=a,this.nonLeapLadder=[0,31,59,90,120,151,181,212,243,273,304,334],this.leapLadder=[0,31,60,91,121,152,182,213,244,274,305,335],this.dateTimeRegex=/(\[[^[\]]*])|y{1,4}|M{1,4}|d{1,4}|H{1,2}|h{1,2}|t|T|m{1,2}|s{1,2}|f{3}/g,this.formattingTokens=/(\[[^[\]]*])|([-_:/.,()\s]+)|(T|t|yyyy|yy?|MM?M?M?|Do|dd?|hh?|HH?|mm?|ss?)/g,this.match2=/\d\d/,this.match3=/\d{3}/,this.match4=/\d{4}/,this.match1to2=/\d\d?/,this.matchSigned=/[+-]?\d+/,this.matchOffset=/[+-]\d\d:?(\d\d)?|Z/,this.matchWord=/[^\d_:/,\-()\s]+/,this.zoneExpressions=[this.matchOffset,(t,e)=>{t.offset=this.offsetFromString(e)}],this.expressions={t:{pattern:void 0,parser:(t,e)=>{t.afternoon=this.meridiemMatch(e)}},T:{pattern:void 0,parser:(t,e)=>{t.afternoon=this.meridiemMatch(e)}},fff:{pattern:this.match3,parser:(t,e)=>{t.milliseconds=+e}},s:{pattern:this.match1to2,parser:this.addInput("seconds")},ss:{pattern:this.match1to2,parser:this.addInput("seconds")},m:{pattern:this.match1to2,parser:this.addInput("minutes")},mm:{pattern:this.match1to2,parser:this.addInput("minutes")},H:{pattern:this.match1to2,parser:this.addInput("hours")},h:{pattern:this.match1to2,parser:this.addInput("hours")},HH:{pattern:this.match1to2,parser:this.addInput("hours")},hh:{pattern:this.match1to2,parser:this.addInput("hours")},d:{pattern:this.match1to2,parser:this.addInput("day")},dd:{pattern:this.match2,parser:this.addInput("day")},Do:{pattern:this.matchWord,parser:(t,e)=>{if(t.day=+(e.match(/\d+/)[0]||1),this.localization.ordinal)for(let s=1;s<=31;s+=1)this.localization.ordinal(s).replace(/[[\]]/g,"")===e&&(t.day=s)}},M:{pattern:this.match1to2,parser:this.addInput("month")},MM:{pattern:this.match2,parser:this.addInput("month")},MMM:{pattern:this.matchWord,parser:(t,e)=>{const s=this.getAllMonths(),i=(this.getAllMonths("short")||s.map((t=>t.slice(0,3)))).indexOf(e)+1;if(i<1)throw new Error;t.month=i%12||i}},MMMM:{pattern:this.matchWord,parser:(t,e)=>{const s=this.getAllMonths().indexOf(e)+1;if(s<1)throw new Error;t.month=s%12||s}},y:{pattern:this.matchSigned,parser:this.addInput("year")},yy:{pattern:this.match2,parser:(t,e)=>{t.year=this.parseTwoDigitYear(+e)}},yyyy:{pattern:this.match4,parser:this.addInput("year")}}}setLocale(t){return this.localization||(this.localization=a,this.localization.locale=t),this}setLocalization(t){return this.localization=t,this}static convert(t,e="default",s=undefined){if(!t)throw new Error("A date is required");return s||((s=a).locale=e),new l(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()).setLocalization(s)}get clone(){return new l(this.year,this.month,this.date,this.hours,this.minutes,this.seconds,this.getMilliseconds()).setLocalization(this.localization)}static isValid(t){return void 0!==t&&"null"!==JSON.stringify(t)&&t.constructor.name===l.name}startOf(e,s=0){if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);switch(e){case"seconds":this.setMilliseconds(0);break;case"minutes":this.setSeconds(0,0);break;case"hours":this.setMinutes(0,0,0);break;case"date":this.setHours(0,0,0,0);break;case"weekDay":{if(this.startOf(t.Unit.date),this.weekDay===s)break;const e=(this.weekDay-s+7)%7;this.manipulate(-1*e,t.Unit.date);break}case"month":this.startOf(t.Unit.date),this.setDate(1);break;case"year":this.startOf(t.Unit.date),this.setMonth(0,1)}return this}endOf(e,s=0){if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);switch(e){case"seconds":this.setMilliseconds(999);break;case"minutes":this.setSeconds(59,999);break;case"hours":this.setMinutes(59,59,999);break;case"date":this.setHours(23,59,59,999);break;case"weekDay":{this.endOf(t.Unit.date);const e=6+s;if(this.weekDay===e)break;this.manipulate(e-this.weekDay,t.Unit.date);break}case"month":this.endOf(t.Unit.date),this.manipulate(1,t.Unit.month),this.setDate(0);break;case"year":this.endOf(t.Unit.date),this.setMonth(11,31)}return this}manipulate(t,e){if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return this[e]+=t,this}isBefore(t,e){if(!l.isValid(t))return!1;if(!e)return this.valueOf()t.valueOf();if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return this.clone.startOf(e).valueOf()>t.clone.startOf(e).valueOf()}isSame(t,e){if(!l.isValid(t))return!1;if(!e)return this.valueOf()===t.valueOf();if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return t=l.convert(t),this.clone.startOf(e).valueOf()===t.startOf(e).valueOf()}isBetween(t,e,s,i="()"){if(!l.isValid(t)||!l.isValid(e))return!1;if(s&&void 0===this[s])throw new Error(`Unit '${s}' is not valid`);const o="("===i[0],a=")"===i[1],n=o?this.isAfter(t,s):!this.isBefore(t,s),r=a?this.isBefore(e,s):!this.isAfter(e,s);return n&&r}parts(t=this.localization.locale,e={dateStyle:"full",timeStyle:"long"}){const s={};return new Intl.DateTimeFormat(t,e).formatToParts(this).filter((t=>"literal"!==t.type)).forEach((t=>s[t.type]=t.value)),s}get seconds(){return this.getSeconds()}set seconds(t){this.setSeconds(t)}get secondsFormatted(){return this.parts(void 0,n).second}get minutes(){return this.getMinutes()}set minutes(t){this.setMinutes(t)}get minutesFormatted(){return this.parts(void 0,n).minute}get hours(){return this.getHours()}set hours(t){this.setHours(t)}getHoursFormatted(t="h12"){return this.parts(void 0,{...n,hourCycle:t}).hour}meridiem(t=this.localization.locale){return new Intl.DateTimeFormat(t,{hour:"numeric",hour12:!0}).formatToParts(this).find((t=>"dayPeriod"===t.type))?.value}get date(){return this.getDate()}set date(t){this.setDate(t)}get dateFormatted(){return this.parts(void 0,n).day}get weekDay(){return this.getDay()}get month(){return this.getMonth()}set month(t){const e=new Date(this.year,t+1);e.setDate(0);const s=e.getDate();this.date>s&&(this.date=s),this.setMonth(t)}get monthFormatted(){return this.parts(void 0,n).month}get year(){return this.getFullYear()}set year(t){this.setFullYear(t)}get week(){const t=this.computeOrdinal(),e=this.getUTCDay();let s=Math.floor((t-e+10)/7);return s<1?s=this.weeksInWeekYear():s>this.weeksInWeekYear()&&(s=1),s}weeksInWeekYear(){const t=(this.year+Math.floor(this.year/4)-Math.floor(this.year/100)+Math.floor(this.year/400))%7,e=this.year-1,s=(e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400))%7;return 4===t||3===s?53:52}get isLeapYear(){return this.year%4==0&&(this.year%100!=0||this.year%400==0)}computeOrdinal(){return this.date+(this.isLeapYear?this.leapLadder:this.nonLeapLadder)[this.month]}getAllMonths(t="long"){const e=new Intl.DateTimeFormat(this.localization.locale,{month:t}).format;return[...Array(12).keys()].map((t=>e(new Date(2021,t))))}replaceTokens(t,e){return t.replace(/(\[[^[\]]*])|(LTS?|l{1,4}|L{1,4})/g,((t,s,i)=>{const o=i&&i.toUpperCase();return s||e[o]||a.dateFormats[o]}))}parseTwoDigitYear(t){return t+(t>68?1900:2e3)}offsetFromString(t){if(!t)return 0;if("Z"===t)return 0;const[e,s,i]=t.match(/([+-]|\d\d)/g),o=60*+s+(+i||0);return 0===o?0:"+"===e?-o:o}zoneInformation(t,e){let s=t.parts(this.localization.locale,{timeZoneName:"longOffset"}).timeZoneName.replace("GMT","").replace(":","");const i=s.includes("-");return s=s.replace("-",""),"z"===e?s=s.substring(1,2):"zz"===e&&(s=s.substring(0,2)),`${i?"-":""}${s}`}addInput(t){return(e,s)=>{e[t]=+s}}getLocaleAfternoon(){return new Intl.DateTimeFormat(this.localization.locale,{hour:"numeric",hour12:!0}).formatToParts(new Date(2022,3,4,13)).find((t=>"dayPeriod"===t.type))?.value?.replace(/\s+/g," ")}meridiemMatch(t){return t.toLowerCase()===this.getLocaleAfternoon().toLowerCase()}correctHours(t){const{afternoon:e}=t;if(void 0!==e){const{hours:s}=t;e?s<12&&(t.hours+=12):12===s&&(t.hours=0),delete t.afternoon}}makeParser(t){const e=(t=this.replaceTokens(t,this.localization.dateFormats)).match(this.formattingTokens),{length:s}=e,i=[];for(let t=0;t{const e={hours:0,minutes:0,seconds:0,milliseconds:0};for(let o=0,a=0;o-1)return new l(("X"===e.format?1e3:1)*+t);t=t.replace(/\s+/g," ");const i=s.makeParser(e.format),{year:o,month:a,day:n,hours:r,minutes:d,seconds:c,milliseconds:h,zone:p}=i(t),u=n||(o||a?1:s.getDate()),m=o||s.getFullYear();let y=0;return o&&!a||(y=a>0?a-1:s.getMonth()),p?new l(Date.UTC(m,y,u,r,d,c,h+60*p.offset*1e3)):new l(m,y,u,r,d,c,h)}catch(s){i.errorMessages.customDateFormatError(`Unable to parse provided input: ${t}, format: ${e.format}`)}}format(t,e=this.localization.locale){if(t&&"object"==typeof t)return new Intl.DateTimeFormat(e,t).format(this);const s=this.replaceTokens(t||this.localization.format||`${a.dateFormats.L}, ${a.dateFormats.LT}`,this.localization.dateFormats),i=t=>new Intl.DateTimeFormat(this.localization.locale,t).format(this);this.localization.hourCycle||(this.localization.hourCycle=d(this.localization.locale));const o=this.localization.hourCycle.startsWith("h1")?"h24":this.localization.hourCycle,n=this.localization.hourCycle.startsWith("h2")?"h12":this.localization.hourCycle,r={y:this.year,yy:i({year:"2-digit"}),yyyy:this.year,M:i({month:"numeric"}),MM:this.monthFormatted,MMM:this.getAllMonths("short")[this.getMonth()],MMMM:this.getAllMonths()[this.getMonth()],d:this.date,dd:this.dateFormatted,ddd:i({weekday:"short"}),dddd:i({weekday:"long"}),H:this.getHours(),HH:this.getHoursFormatted(o),h:this.hours>12?this.hours-12:this.hours,hh:this.getHoursFormatted(n),t:this.meridiem(),T:this.meridiem().toUpperCase(),m:this.minutes,mm:this.minutesFormatted,s:this.seconds,ss:this.secondsFormatted,fff:this.getMilliseconds()};return s.replace(this.dateTimeRegex,((t,e)=>e||r[t])).replace(/\[/g,"").replace(/]/g,"")}}class c{constructor(){this.cache=new Map}locate(t){const e=this.cache.get(t);if(e)return e;const s=new t;return this.cache.set(t,s),s}}let h;const p=[{name:"calendar",className:i.css.daysContainer,unit:t.Unit.month,step:1},{name:"months",className:i.css.monthsContainer,unit:t.Unit.year,step:1},{name:"years",className:i.css.yearsContainer,unit:t.Unit.year,step:10},{name:"decades",className:i.css.decadesContainer,unit:t.Unit.year,step:100}];class u{constructor(){this._currentCalendarViewMode=0,this._viewDate=new l,this.minimumCalendarViewMode=0,this.currentView="calendar"}get currentCalendarViewMode(){return this._currentCalendarViewMode}set currentCalendarViewMode(t){this._currentCalendarViewMode=t,this.currentView=p[t].name}get viewDate(){return this._viewDate}set viewDate(t){this._viewDate=t,this.options&&(this.options.viewDate=t)}refreshCurrentView(){this.currentView=p[this.currentCalendarViewMode].name}get isTwelveHour(){return["h12","h11"].includes(this.options.localization.hourCycle)}}class m{constructor(){this.optionsStore=h.locate(u)}isValid(e,s){if(!this._enabledDisabledDatesIsValid(s,e))return!1;if(s!==t.Unit.month&&s!==t.Unit.year&&this.optionsStore.options.restrictions.daysOfWeekDisabled?.length>0&&-1!==this.optionsStore.options.restrictions.daysOfWeekDisabled.indexOf(e.weekDay))return!1;if(!this._minMaxIsValid(s,e))return!1;if(s===t.Unit.hours||s===t.Unit.minutes||s===t.Unit.seconds){if(!this._enabledDisabledHoursIsValid(e))return!1;if(0!==this.optionsStore.options.restrictions.disabledTimeIntervals?.filter((t=>e.isBetween(t.from,t.to))).length)return!1}return!0}_enabledDisabledDatesIsValid(e,s){return e!==t.Unit.date||!(this.optionsStore.options.restrictions.disabledDates.length>0&&this._isInDisabledDates(s))&&!(this.optionsStore.options.restrictions.enabledDates.length>0&&!this._isInEnabledDates(s))}_isInDisabledDates(e){return!(!this.optionsStore.options.restrictions.disabledDates||0===this.optionsStore.options.restrictions.disabledDates.length)&&!!this.optionsStore.options.restrictions.disabledDates.find((s=>s.isSame(e,t.Unit.date)))}_isInEnabledDates(e){return!this.optionsStore.options.restrictions.enabledDates||0===this.optionsStore.options.restrictions.enabledDates.length||!!this.optionsStore.options.restrictions.enabledDates.find((s=>s.isSame(e,t.Unit.date)))}_minMaxIsValid(t,e){return(!this.optionsStore.options.restrictions.minDate||!e.isBefore(this.optionsStore.options.restrictions.minDate,t))&&(!this.optionsStore.options.restrictions.maxDate||!e.isAfter(this.optionsStore.options.restrictions.maxDate,t))}_enabledDisabledHoursIsValid(t){return!(this.optionsStore.options.restrictions.disabledHours.length>0&&this._isInDisabledHours(t))&&!(this.optionsStore.options.restrictions.enabledHours.length>0&&!this._isInEnabledHours(t))}_isInDisabledHours(t){if(!this.optionsStore.options.restrictions.disabledHours||0===this.optionsStore.options.restrictions.disabledHours.length)return!1;const e=t.hours;return this.optionsStore.options.restrictions.disabledHours.includes(e)}_isInEnabledHours(t){if(!this.optionsStore.options.restrictions.enabledHours||0===this.optionsStore.options.restrictions.enabledHours.length)return!0;const e=t.hours;return this.optionsStore.options.restrictions.enabledHours.includes(e)}dateRangeIsValid(e,s,i){if(!this.optionsStore.options.dateRange)return!0;if(2!==e.length&&1!==s)return!0;const o=e[0].clone;if(o.isSame(i,t.Unit.date))return!0;for(o.manipulate(1,t.Unit.date);!o.isSame(i,t.Unit.date);){if(!this.isValid(o,t.Unit.date))return!1;o.manipulate(1,t.Unit.date)}return!0}}class y{constructor(){this.subscribers=[]}subscribe(t){return this.subscribers.push(t),this.unsubscribe.bind(this,this.subscribers.length-1)}unsubscribe(t){this.subscribers.splice(t,1)}emit(t){this.subscribers.forEach((e=>{e(t)}))}destroy(){this.subscribers=null,this.subscribers=[]}}class g{constructor(){this.triggerEvent=new y,this.viewUpdate=new y,this.updateDisplay=new y,this.action=new y,this.updateViewDate=new y}destroy(){this.triggerEvent.destroy(),this.viewUpdate.destroy(),this.updateDisplay.destroy(),this.action.destroy(),this.updateViewDate.destroy()}}const v={clear:"Clear selection",close:"Close the picker",dateFormats:a.dateFormats,dayViewHeaderFormat:{month:"long",year:"2-digit"},decrementHour:"Decrement Hour",decrementMinute:"Decrement Minute",decrementSecond:"Decrement Second",format:a.format,hourCycle:a.hourCycle,incrementHour:"Increment Hour",incrementMinute:"Increment Minute",incrementSecond:"Increment Second",locale:a.locale,maxWeekdayLength:0,nextCentury:"Next Century",nextDecade:"Next Decade",nextMonth:"Next Month",nextYear:"Next Year",ordinal:a.ordinal,pickHour:"Pick Hour",pickMinute:"Pick Minute",pickSecond:"Pick Second",previousCentury:"Previous Century",previousDecade:"Previous Decade",previousMonth:"Previous Month",previousYear:"Previous Year",selectDate:"Select Date",selectDecade:"Select Decade",selectMonth:"Select Month",selectTime:"Select Time",selectYear:"Select Year",startOfTheWeek:0,today:"Go to today",toggleMeridiem:"Toggle Meridiem"},f={allowInputToggle:!1,container:void 0,dateRange:!1,debug:!1,defaultDate:void 0,display:{icons:{type:"icons",time:"fa-solid fa-clock",date:"fa-solid fa-calendar",up:"fa-solid fa-arrow-up",down:"fa-solid fa-arrow-down",previous:"fa-solid fa-chevron-left",next:"fa-solid fa-chevron-right",today:"fa-solid fa-calendar-check",clear:"fa-solid fa-trash",close:"fa-solid fa-xmark"},sideBySide:!1,calendarWeeks:!1,viewMode:"calendar",toolbarPlacement:"bottom",keepOpen:!1,buttons:{today:!1,clear:!1,close:!1},components:{calendar:!0,date:!0,month:!0,year:!0,decades:!0,clock:!0,hours:!0,minutes:!0,seconds:!1,useTwentyfourHour:void 0},inline:!1,theme:"auto",placement:"bottom"},keepInvalid:!1,localization:v,meta:{},multipleDates:!1,multipleDatesSeparator:"; ",promptTimeOnDateChange:!1,promptTimeOnDateChangeTransitionDelay:200,restrictions:{minDate:void 0,maxDate:void 0,disabledDates:[],enabledDates:[],daysOfWeekDisabled:[],disabledTimeIntervals:[],disabledHours:[],enabledHours:[]},stepping:1,useCurrent:!0,viewDate:new l},S={...v};function w(t,e){if(!t)return null;if(t.constructor.name===l.name)return t;if(t.constructor.name===Date.name)return l.convert(t);if("string"==typeof t){const s=l.fromString(t,e);return"null"===JSON.stringify(s)?null:s}return null}function b(t,e,s){"string"==typeof t&&"input"!==e&&i.errorMessages.dateString();const o=w(t,s);return o||i.errorMessages.failedToParseDate(e,t,"input"===e),o}function D(t,e,s,o=a){Array.isArray(e)||i.errorMessages.typeMismatch(t,s,"array of DateTime or Date");for(let s=0;s"number"!=typeof t))||i.errorMessages.typeMismatch(t,s,"array of numbers")}function k(t){return({value:e,providedType:s,localization:i})=>{const o=b(e,t,i);if(void 0!==o)return o.setLocalization(i),o}}function C(t){const e=k(t);return t=>void 0===t.value?t.value:e(t)}function M(t,e,s){return({value:o,providedType:a})=>void 0===o?[]:(_(t,o,a),o.some((t=>ts))&&i.errorMessages.numbersOutOfRange(t,e,s),o)}function E(t){return M(t,0,23)}function T(t){return({value:e,providedType:s,localization:i})=>void 0===e?[]:(D(t,e,s,i),e)}function L(t){return({value:e,path:s})=>(t.includes(e)||i.errorMessages.unexpectedOptionValue(s.substring(1),e,t),e)}const U=Object.freeze({defaultDate:k("defaultDate"),viewDate:k("viewDate"),minDate:C("restrictions.minDate"),maxDate:C("restrictions.maxDate"),disabledHours:E("restrictions.disabledHours"),enabledHours:E("restrictions.enabledHours"),disabledDates:T("restrictions.disabledDates"),enabledDates:T("restrictions.enabledDates"),daysOfWeekDisabled:M("restrictions.daysOfWeekDisabled",0,6),disabledTimeIntervals:({key:t,value:e,providedType:s,localization:o})=>{if(void 0===e)return[];Array.isArray(e)||i.errorMessages.typeMismatch(t,s,"array of { from: DateTime|Date, to: DateTime|Date }");const a=e;for(let e=0;e{const i=`${t}[${e}].${s}`,n=b(a[e][s],i,o);n.setLocalization(o),a[e][s]=n}));return a},toolbarPlacement:L(["top","bottom","default"]),type:L(["icons","sprites"]),viewMode:L(["clock","calendar","months","years","decades"]),theme:L(["light","dark","auto"]),placement:L(["top","bottom"]),meta:({value:t})=>t,dayViewHeaderFormat:({value:t})=>t,container:({value:t,path:e})=>(t&&!(t instanceof HTMLElement||t instanceof Element||t?.appendChild)&&i.errorMessages.typeMismatch(e.substring(1),typeof t,"HTMLElement"),t),useTwentyfourHour:({value:t,path:e,providedType:s,defaultType:o})=>{if(i.errorMessages.deprecatedWarning("useTwentyfourHour",'Please use "options.localization.hourCycle" instead'),void 0===t||"boolean"===s)return t;i.errorMessages.typeMismatch(e,s,o)},hourCycle:L(["h11","h12","h23","h24"])}),A=({value:t,defaultType:e,providedType:s,path:o})=>{switch(e){case"boolean":return"true"===t||!0===t;case"number":return+t;case"string":return t.toString();case"object":return{};case"function":return t;default:i.errorMessages.typeMismatch(o,s,e)}};class V{static deepCopy(t){const e={};return Object.keys(t).forEach((s=>{const i=t[s];i instanceof l?e[s]=i.clone:i instanceof Date?e[s]=new Date(i.valueOf()):(e[s]=i,"object"!=typeof i||i instanceof HTMLElement||i instanceof Element||Array.isArray(i)||(e[s]=V.deepCopy(i)))})),e}static objectPath(t,e){return"."===t.charAt(0)&&(t=t.slice(1)),t?t.split(".").reduce(((t,e)=>V.isValue(t)||V.isValue(t[e])?t[e]:void 0),e):e}static spread(t,e,s,o=""){const a=V.objectPath(o,f),n=Object.keys(t).filter((t=>!Object.keys(a).includes(t)));if(n.length>0){const t=V.getFlattenDefaultOptions(),e=n.map((e=>{let s=`"${o}.${e}" in not a known option.`;const i=t.find((t=>t.includes(e)));return i&&(s+=` Did you mean "${i}"?`),s}));i.errorMessages.unexpectedOptions(e)}Object.keys(t).filter((t=>"__proto__"!==t&&"constructor"!==t)).forEach((i=>{"."===(o+=`.${i}`).charAt(0)&&(o=o.slice(1));const n=a[i],r=typeof t[i],d=typeof n,l=t[i];if(null==l)return e[i]=l,void(o=o.substring(0,o.lastIndexOf(`.${i}`)));"object"!=typeof n||Array.isArray(t[i])||n instanceof Date||V.ignoreProperties.includes(i)?e[i]=V.processKey(i,l,r,d,o,s):V.spread(t[i],e[i],s,o),o=o.substring(0,o.lastIndexOf(`.${i}`))}))}static processKey(t,e,s,i,o,a){return(U[(n={key:t,value:e,providedType:s,defaultType:i,path:o,localization:a}).key]||A)(n);var n}static _mergeOptions(t,e){const s=V.deepCopy(e),i="default"!==e.localization?.locale?e.localization:t?.localization||f.localization;return V.spread(t,s,i,""),s}static _dataToOptions(t,e){const s=JSON.parse(JSON.stringify(t.dataset));if(s?.tdTargetInput&&delete s.tdTargetInput,s?.tdTargetToggle&&delete s.tdTargetToggle,!s||0===Object.keys(s).length||s.constructor!==DOMStringMap)return e;const o={},a=t=>{const e={};return Object.keys(t).forEach((t=>{e[t.toLowerCase()]=t})),e},n=this.normalizeObject(a),r=a(e);return Object.keys(s).filter((t=>t.startsWith(i.dataKey))).map((t=>t.substring(2))).forEach((t=>{let i=r[t.toLowerCase()];if(t.includes("_")){const a=t.split("_");i=r[a[0].toLowerCase()],void 0!==i&&e[i].constructor===Object&&(o[i]=n(a,1,e[i],s[`td${t}`]))}else void 0!==i&&(o[i]=s[`td${t}`])})),this._mergeOptions(o,e)}static normalizeObject(t){const e=(s,i,o,a)=>{const n=t(o)[s[i].toLowerCase()],r={};return void 0===n||(o[n].constructor===Object?(i++,r[n]=e(s,i,o[n],a)):r[n]=a),r};return e}static _dateTypeCheck(t,e){return w(t,e)}static _typeCheckDateArray(t,e,s,i){return D(t,e,s,i)}static _typeCheckNumberArray(t,e,s){return _(t,e,s)}static dateConversion(t,e,s){return b(t,e,s)}static getFlattenDefaultOptions(){if(this._flattenDefaults)return this._flattenDefaults;const t=(e,s=[])=>Array.isArray(e)?[]:Object(e)===e?Object.entries(e).flatMap((([e,i])=>t(i,[...s,e]))):s.join(".");return this._flattenDefaults=t(f),this._flattenDefaults}static _validateConflicts(t){!t.display.sideBySide||t.display.components.clock&&(t.display.components.hours||t.display.components.minutes||t.display.components.seconds)||i.errorMessages.conflictingConfiguration("Cannot use side by side mode without the clock components"),t.restrictions.minDate&&t.restrictions.maxDate&&(t.restrictions.minDate.isAfter(t.restrictions.maxDate)&&i.errorMessages.conflictingConfiguration("minDate is after maxDate"),t.restrictions.maxDate.isBefore(t.restrictions.minDate)&&i.errorMessages.conflictingConfiguration("maxDate is before minDate")),t.multipleDates&&t.dateRange&&i.errorMessages.conflictingConfiguration('Cannot uss option "multipleDates" with "dateRange"')}}V.ignoreProperties=["meta","dayViewHeaderFormat","container","dateForms","ordinal"],V.isValue=t=>null!=t;class ${constructor(){this._dates=[],this.optionsStore=h.locate(u),this.validation=h.locate(m),this._eventEmitters=h.locate(g)}get picked(){return[...this._dates]}get lastPicked(){return this._dates[this.lastPickedIndex]?.clone}get lastPickedIndex(){return 0===this._dates.length?0:this._dates.length-1}formatInput(t){return t?(t.localization=this.optionsStore.options.localization,t.format()):""}parseInput(t){return V.dateConversion(t,"input",this.optionsStore.options.localization)}setFromInput(t,e){if(!t)return void this.setValue(void 0,e);const s=this.parseInput(t);s&&(s.setLocalization(this.optionsStore.options.localization),this.setValue(s,e))}add(t){this._dates.push(t)}isPicked(t,e){if(!l.isValid(t))return!1;if(!e)return void 0!==this._dates.find((e=>e.isSame(t)));const s=r(e),i=t.format(s);return void 0!==this._dates.map((t=>t.format(s))).find((t=>t===i))}pickedIndex(t,e){if(!l.isValid(t))return-1;if(!e)return this._dates.map((t=>t.valueOf())).indexOf(t.valueOf());const s=r(e),i=t.format(s);return this._dates.map((t=>t.format(s))).indexOf(i)}clear(){this.optionsStore.unset=!0,this._eventEmitters.triggerEvent.emit({type:i.events.change,date:void 0,oldDate:this.lastPicked,isClear:!0,isValid:!0}),this._dates=[],this.optionsStore.input&&(this.optionsStore.input.value=""),this._eventEmitters.updateDisplay.emit("all")}static getStartEndYear(t,e){const s=t/10,i=Math.floor(e/t)*t;return[i,i+9*s,Math.floor(e/s)*s]}updateInput(t){if(!this.optionsStore.input)return;let e=this.formatInput(t);(this.optionsStore.options.multipleDates||this.optionsStore.options.dateRange)&&(e=this._dates.map((t=>this.formatInput(t))).join(this.optionsStore.options.multipleDatesSeparator)),this.optionsStore.input.value!=e&&(this.optionsStore.input.value=e)}setValue(e,s){const o=void 0===s,a=!e&&o;let n=this.optionsStore.unset?null:this._dates[s]?.clone;if(!n&&!this.optionsStore.unset&&o&&a&&(n=this.lastPicked),e&&n?.isSame(e))return void this.updateInput(e);if(!e)return void this._setValueNull(a,s,n);s=s||0,e=e.clone,1!==this.optionsStore.options.stepping&&(e.minutes=Math.round(e.minutes/this.optionsStore.options.stepping)*this.optionsStore.options.stepping,e.startOf(t.Unit.minutes));const r=t=>{this._dates[s]=e,this._eventEmitters.updateViewDate.emit(e.clone),this.updateInput(e),this.optionsStore.unset=!1,this._eventEmitters.updateDisplay.emit("all"),this._eventEmitters.triggerEvent.emit({type:i.events.change,date:e,oldDate:n,isClear:a,isValid:t})};this.validation.isValid(e)&&this.validation.dateRangeIsValid(this.picked,s,e)?r(!0):(this.optionsStore.options.keepInvalid&&r(!1),this._eventEmitters.triggerEvent.emit({type:i.events.error,reason:i.errorMessages.failedToSetInvalidDate,date:e,oldDate:n}))}_setValueNull(t,e,s){!this.optionsStore.options.multipleDates||1===this._dates.length||t?(this.optionsStore.unset=!0,this._dates=[]):this._dates.splice(e,1),this.updateInput(),this._eventEmitters.triggerEvent.emit({type:i.events.change,date:void 0,oldDate:s,isClear:t,isValid:!0}),this._eventEmitters.updateDisplay.emit("all")}}var z;!function(t){t.next="next",t.previous="previous",t.changeCalendarView="changeCalendarView",t.selectMonth="selectMonth",t.selectYear="selectYear",t.selectDecade="selectDecade",t.selectDay="selectDay",t.selectHour="selectHour",t.selectMinute="selectMinute",t.selectSecond="selectSecond",t.incrementHours="incrementHours",t.incrementMinutes="incrementMinutes",t.incrementSeconds="incrementSeconds",t.decrementHours="decrementHours",t.decrementMinutes="decrementMinutes",t.decrementSeconds="decrementSeconds",t.toggleMeridiem="toggleMeridiem",t.togglePicker="togglePicker",t.showClock="showClock",t.showHours="showHours",t.showMinutes="showMinutes",t.showSeconds="showSeconds",t.clear="clear",t.close="close",t.today="today"}(z||(z={}));var O=z;class H{constructor(){this.optionsStore=h.locate(u),this.dates=h.locate($),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");if(t.classList.add(i.css.daysContainer),t.append(...this._daysOfTheWeek()),this.optionsStore.options.display.calendarWeeks){const e=document.createElement("div");e.classList.add(i.css.calendarWeeks,i.css.noHighlight),t.appendChild(e)}const{rangeHoverEvent:e,rangeHoverOutEvent:s}=this.handleMouseEvents(t);for(let o=0;o<42;o++){if(0!==o&&o%7==0&&this.optionsStore.options.display.calendarWeeks){const e=document.createElement("div");e.classList.add(i.css.calendarWeeks,i.css.noHighlight),t.appendChild(e)}const a=document.createElement("div");a.setAttribute("data-action",O.selectDay),t.appendChild(a),matchMedia("(hover: hover)").matches&&this.optionsStore.options.dateRange&&(a.addEventListener("mouseover",e),a.addEventListener("mouseout",s))}return t}_update(e,s){const o=e.getElementsByClassName(i.css.daysContainer)[0];this._updateCalendarView(o);const a=this.optionsStore.viewDate.clone.startOf(t.Unit.month).startOf("weekDay",this.optionsStore.options.localization.startOfTheWeek).manipulate(12,t.Unit.hours);this._handleCalendarWeeks(o,a.clone),o.querySelectorAll(`[data-action="${O.selectDay}"]`).forEach((e=>{const o=[];o.push(i.css.day),a.isBefore(this.optionsStore.viewDate,t.Unit.month)&&o.push(i.css.old),a.isAfter(this.optionsStore.viewDate,t.Unit.month)&&o.push(i.css.new),this.optionsStore.unset||this.optionsStore.options.dateRange||!this.dates.isPicked(a,t.Unit.date)||o.push(i.css.active),this.validation.isValid(a,t.Unit.date)||o.push(i.css.disabled),a.isSame(new l,t.Unit.date)&&o.push(i.css.today),0!==a.weekDay&&6!==a.weekDay||o.push(i.css.weekend),this._handleDateRange(a,o),s(t.Unit.date,a,o,e),e.classList.remove(...e.classList),e.classList.add(...o),e.setAttribute("data-value",this._dateToDataValue(a)),e.setAttribute("data-day",`${a.date}`),e.innerText=a.parts(void 0,{day:"numeric"}).day,a.manipulate(1,t.Unit.date)}))}_dateToDataValue(t){return l.isValid(t)?`${t.year}-${t.monthFormatted}-${t.dateFormatted}`:""}_handleDateRange(e,s){const o=this.dates.picked[0],a=this.dates.picked[1];this.optionsStore.options.dateRange&&(e.isBetween(o,a,t.Unit.date)&&s.push(i.css.rangeIn),e.isSame(o,t.Unit.date)&&s.push(i.css.rangeStart),e.isSame(a,t.Unit.date)&&s.push(i.css.rangeEnd))}handleMouseEvents(e){return{rangeHoverEvent:s=>{const o=s?.currentTarget;if(1!==this.dates.picked.length||o.classList.contains(i.css.disabled))return;const a=[...e.querySelectorAll(".day")],n=o.getAttribute("data-value"),r=l.fromString(n,{format:"yyyy-MM-dd"}),d=a.findIndex((t=>t.getAttribute("data-value")===n)),c=this.dates.picked[0],h=this.dates.picked[1],p=this._dateToDataValue(c),u=a.findIndex((t=>t.getAttribute("data-value")===p)),m=a[u];let y;r.isSame(c,t.Unit.date)||o.classList.remove(i.css.rangeStart),r.isSame(h,t.Unit.date)||o.classList.remove(i.css.rangeEnd),r.isBefore(c)?(o.classList.add(i.css.rangeStart),m?.classList.remove(i.css.rangeStart),m?.classList.add(i.css.rangeEnd),y=(t,e)=>e>d&&eeu),a.filter(y).forEach((t=>{t.classList.add(i.css.rangeIn)}))},rangeHoverOutEvent:s=>{const o=[...e.querySelectorAll(".day")];if(1===this.dates.picked.length&&o.forEach((t=>t.classList.remove(i.css.rangeIn))),1!==this.dates.picked.length)return;const a=s?.currentTarget,n=new l(a.getAttribute("data-value"));n.isSame(this.dates.picked[0],t.Unit.date)||a.classList.remove(i.css.rangeStart),n.isSame(this.dates.picked[1],t.Unit.date)||a.classList.remove(i.css.rangeEnd)}}}_updateCalendarView(e){if("calendar"!==this.optionsStore.currentView)return;const[s,o,a]=e.parentElement.getElementsByClassName(i.css.calendarHeader)[0].getElementsByTagName("div");o.setAttribute(i.css.daysContainer,this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat)),this.optionsStore.options.display.components.month?o.classList.remove(i.css.disabled):o.classList.add(i.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.month),t.Unit.month)?s.classList.remove(i.css.disabled):s.classList.add(i.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.Unit.month),t.Unit.month)?a.classList.remove(i.css.disabled):a.classList.add(i.css.disabled)}_daysOfTheWeek(){const e=this.optionsStore.viewDate.clone.startOf("weekDay",this.optionsStore.options.localization.startOfTheWeek).startOf(t.Unit.date),s=[];if(document.createElement("div"),this.optionsStore.options.display.calendarWeeks){const t=document.createElement("div");t.classList.add(i.css.calendarWeeks,i.css.noHighlight),t.innerText="#",s.push(t)}for(let o=0;o<7;o++){const o=document.createElement("div");o.classList.add(i.css.dayOfTheWeek,i.css.noHighlight);let a=e.format({weekday:"short"});this.optionsStore.options.localization.maxWeekdayLength>0&&(a=a.substring(0,this.optionsStore.options.localization.maxWeekdayLength)),o.innerText=a,e.manipulate(1,t.Unit.date),s.push(o)}return s}_handleCalendarWeeks(e,s){[...e.querySelectorAll(`.${i.css.calendarWeeks}`)].filter((t=>"#"!==t.innerText)).forEach((e=>{e.innerText=`${s.week}`,s.manipulate(7,t.Unit.date)}))}}class x{constructor(){this.optionsStore=h.locate(u),this.dates=h.locate($),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");t.classList.add(i.css.monthsContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",O.selectMonth),t.appendChild(e)}return t}_update(e,s){const o=e.getElementsByClassName(i.css.monthsContainer)[0];if("months"===this.optionsStore.currentView){const[e,s,a]=o.parentElement.getElementsByClassName(i.css.calendarHeader)[0].getElementsByTagName("div");s.setAttribute(i.css.monthsContainer,this.optionsStore.viewDate.format({year:"numeric"})),this.optionsStore.options.display.components.year?s.classList.remove(i.css.disabled):s.classList.add(i.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.year),t.Unit.year)?e.classList.remove(i.css.disabled):e.classList.add(i.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.Unit.year),t.Unit.year)?a.classList.remove(i.css.disabled):a.classList.add(i.css.disabled)}const a=this.optionsStore.viewDate.clone.startOf(t.Unit.year);o.querySelectorAll(`[data-action="${O.selectMonth}"]`).forEach(((e,o)=>{const n=[];n.push(i.css.month),!this.optionsStore.unset&&this.dates.isPicked(a,t.Unit.month)&&n.push(i.css.active),this.validation.isValid(a,t.Unit.month)||n.push(i.css.disabled),s(t.Unit.month,a,n,e),e.classList.remove(...e.classList),e.classList.add(...n),e.setAttribute("data-value",`${o}`),e.innerText=`${a.format({month:"short"})}`,a.manipulate(1,t.Unit.month)}))}}class I{constructor(){this.optionsStore=h.locate(u),this.dates=h.locate($),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");t.classList.add(i.css.yearsContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",O.selectYear),t.appendChild(e)}return t}_update(e,s){this._startYear=this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.year),this._endYear=this.optionsStore.viewDate.clone.manipulate(10,t.Unit.year);const o=e.getElementsByClassName(i.css.yearsContainer)[0];if("years"===this.optionsStore.currentView){const[e,s,a]=o.parentElement.getElementsByClassName(i.css.calendarHeader)[0].getElementsByTagName("div");s.setAttribute(i.css.yearsContainer,`${this._startYear.format({year:"numeric"})}-${this._endYear.format({year:"numeric"})}`),this.optionsStore.options.display.components.decades?s.classList.remove(i.css.disabled):s.classList.add(i.css.disabled),this.validation.isValid(this._startYear,t.Unit.year)?e.classList.remove(i.css.disabled):e.classList.add(i.css.disabled),this.validation.isValid(this._endYear,t.Unit.year)?a.classList.remove(i.css.disabled):a.classList.add(i.css.disabled)}const a=this.optionsStore.viewDate.clone.startOf(t.Unit.year).manipulate(-1,t.Unit.year);o.querySelectorAll(`[data-action="${O.selectYear}"]`).forEach((e=>{const o=[];o.push(i.css.year),!this.optionsStore.unset&&this.dates.isPicked(a,t.Unit.year)&&o.push(i.css.active),this.validation.isValid(a,t.Unit.year)||o.push(i.css.disabled),s(t.Unit.year,a,o,e),e.classList.remove(...e.classList),e.classList.add(...o),e.setAttribute("data-value",`${a.year}`),e.innerText=a.format({year:"numeric"}),a.manipulate(1,t.Unit.year)}))}}class P{constructor(){this.optionsStore=h.locate(u),this.dates=h.locate($),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");t.classList.add(i.css.decadesContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",O.selectDecade),t.appendChild(e)}return t}_update(e,s){const[o,a]=$.getStartEndYear(100,this.optionsStore.viewDate.year);this._startDecade=this.optionsStore.viewDate.clone.startOf(t.Unit.year),this._startDecade.year=o,this._endDecade=this.optionsStore.viewDate.clone.startOf(t.Unit.year),this._endDecade.year=a;const n=e.getElementsByClassName(i.css.decadesContainer)[0],[r,d,l]=n.parentElement.getElementsByClassName(i.css.calendarHeader)[0].getElementsByTagName("div");"decades"===this.optionsStore.currentView&&(d.setAttribute(i.css.decadesContainer,`${this._startDecade.format({year:"numeric"})}-${this._endDecade.format({year:"numeric"})}`),this.validation.isValid(this._startDecade,t.Unit.year)?r.classList.remove(i.css.disabled):r.classList.add(i.css.disabled),this.validation.isValid(this._endDecade,t.Unit.year)?l.classList.remove(i.css.disabled):l.classList.add(i.css.disabled));const c=this.dates.picked.map((t=>t.year));n.querySelectorAll(`[data-action="${O.selectDecade}"]`).forEach(((e,o)=>{if(0===o)return e.classList.add(i.css.old),this._startDecade.year-10<0?(e.textContent=" ",r.classList.add(i.css.disabled),e.classList.add(i.css.disabled),void e.setAttribute("data-value","")):(e.innerText=this._startDecade.clone.manipulate(-10,t.Unit.year).format({year:"numeric"}),void e.setAttribute("data-value",`${this._startDecade.year}`));const a=[];a.push(i.css.decade);const n=this._startDecade.year,d=this._startDecade.year+9;!this.optionsStore.unset&&c.filter((t=>t>=n&&t<=d)).length>0&&a.push(i.css.active),s("decade",this._startDecade,a,e),e.classList.remove(...e.classList),e.classList.add(...a),e.setAttribute("data-value",`${this._startDecade.year}`),e.innerText=`${this._startDecade.format({year:"numeric"})}`,this._startDecade.manipulate(10,t.Unit.year)}))}}class N{constructor(){this._gridColumns="",this.optionsStore=h.locate(u),this.dates=h.locate($),this.validation=h.locate(m)}getPicker(t){const e=document.createElement("div");return e.classList.add(i.css.clockContainer),e.append(...this._grid(t)),e}_update(e){const s=e.getElementsByClassName(i.css.clockContainer)[0];let o=this.dates.lastPicked?.clone;if(!o&&this.optionsStore.options.useCurrent&&(o=this.optionsStore.viewDate.clone),s.querySelectorAll(".disabled").forEach((t=>t.classList.remove(i.css.disabled))),this.optionsStore.options.display.components.hours&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.Unit.hours),t.Unit.hours)||s.querySelector(`[data-action=${O.incrementHours}]`).classList.add(i.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.hours),t.Unit.hours)||s.querySelector(`[data-action=${O.decrementHours}]`).classList.add(i.css.disabled),s.querySelector(`[data-time-component=${t.Unit.hours}]`).innerText=o?o.getHoursFormatted(this.optionsStore.options.localization.hourCycle):"--"),this.optionsStore.options.display.components.minutes&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.Unit.minutes),t.Unit.minutes)||s.querySelector(`[data-action=${O.incrementMinutes}]`).classList.add(i.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.minutes),t.Unit.minutes)||s.querySelector(`[data-action=${O.decrementMinutes}]`).classList.add(i.css.disabled),s.querySelector(`[data-time-component=${t.Unit.minutes}]`).innerText=o?o.minutesFormatted:"--"),this.optionsStore.options.display.components.seconds&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.Unit.seconds),t.Unit.seconds)||s.querySelector(`[data-action=${O.incrementSeconds}]`).classList.add(i.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.seconds),t.Unit.seconds)||s.querySelector(`[data-action=${O.decrementSeconds}]`).classList.add(i.css.disabled),s.querySelector(`[data-time-component=${t.Unit.seconds}]`).innerText=o?o.secondsFormatted:"--"),this.optionsStore.isTwelveHour){const e=s.querySelector(`[data-action=${O.toggleMeridiem}]`),a=(o||this.optionsStore.viewDate).clone;e.innerText=a.meridiem(),this.validation.isValid(a.manipulate(a.hours>=12?-12:12,t.Unit.hours))?e.classList.remove(i.css.disabled):e.classList.add(i.css.disabled)}s.style.gridTemplateAreas=`"${this._gridColumns}"`}_grid(e){this._gridColumns="";const s=[],o=[],a=[],n=document.createElement("div"),r=e(this.optionsStore.options.display.icons.up),d=e(this.optionsStore.options.display.icons.down);n.classList.add(i.css.separator,i.css.noHighlight);const l=n.cloneNode(!0);l.innerHTML=":";const c=(t=!1)=>t?l.cloneNode(!0):n.cloneNode(!0);if(this.optionsStore.options.display.components.hours){let e=document.createElement("div");e.setAttribute("title",this.optionsStore.options.localization.incrementHour),e.setAttribute("data-action",O.incrementHours),e.appendChild(r.cloneNode(!0)),s.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.pickHour),e.setAttribute("data-action",O.showHours),e.setAttribute("data-time-component",t.Unit.hours),o.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.decrementHour),e.setAttribute("data-action",O.decrementHours),e.appendChild(d.cloneNode(!0)),a.push(e),this._gridColumns+="a"}if(this.optionsStore.options.display.components.minutes){this._gridColumns+=" a",this.optionsStore.options.display.components.hours&&(s.push(c()),o.push(c(!0)),a.push(c()),this._gridColumns+=" a");let e=document.createElement("div");e.setAttribute("title",this.optionsStore.options.localization.incrementMinute),e.setAttribute("data-action",O.incrementMinutes),e.appendChild(r.cloneNode(!0)),s.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.pickMinute),e.setAttribute("data-action",O.showMinutes),e.setAttribute("data-time-component",t.Unit.minutes),o.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.decrementMinute),e.setAttribute("data-action",O.decrementMinutes),e.appendChild(d.cloneNode(!0)),a.push(e)}if(this.optionsStore.options.display.components.seconds){this._gridColumns+=" a",this.optionsStore.options.display.components.minutes&&(s.push(c()),o.push(c(!0)),a.push(c()),this._gridColumns+=" a");let e=document.createElement("div");e.setAttribute("title",this.optionsStore.options.localization.incrementSecond),e.setAttribute("data-action",O.incrementSeconds),e.appendChild(r.cloneNode(!0)),s.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.pickSecond),e.setAttribute("data-action",O.showSeconds),e.setAttribute("data-time-component",t.Unit.seconds),o.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.decrementSecond),e.setAttribute("data-action",O.decrementSeconds),e.appendChild(d.cloneNode(!0)),a.push(e)}if(this.optionsStore.isTwelveHour){this._gridColumns+=" a";let t=c();s.push(t);const e=document.createElement("button");e.setAttribute("type","button"),e.setAttribute("title",this.optionsStore.options.localization.toggleMeridiem),e.setAttribute("data-action",O.toggleMeridiem),e.setAttribute("tabindex","-1"),i.css.toggleMeridiem.includes(",")?e.classList.add(...i.css.toggleMeridiem.split(",")):e.classList.add(i.css.toggleMeridiem),t=document.createElement("div"),t.classList.add(i.css.noHighlight),t.appendChild(e),o.push(t),t=c(),a.push(t)}return this._gridColumns=this._gridColumns.trim(),[...s,...o,...a]}}class F{constructor(){this.optionsStore=h.locate(u),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");t.classList.add(i.css.hourContainer);for(let e=0;e<(this.optionsStore.isTwelveHour?12:24);e++){const e=document.createElement("div");e.setAttribute("data-action",O.selectHour),t.appendChild(e)}return t}_update(e,s){const o=e.getElementsByClassName(i.css.hourContainer)[0],a=this.optionsStore.viewDate.clone.startOf(t.Unit.date);o.querySelectorAll(`[data-action="${O.selectHour}"]`).forEach((e=>{const o=[];o.push(i.css.hour),this.validation.isValid(a,t.Unit.hours)||o.push(i.css.disabled),s(t.Unit.hours,a,o,e),e.classList.remove(...e.classList),e.classList.add(...o),e.setAttribute("data-value",`${a.hours}`),e.innerText=a.getHoursFormatted(this.optionsStore.options.localization.hourCycle),a.manipulate(1,t.Unit.hours)}))}}class B{constructor(){this.optionsStore=h.locate(u),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");t.classList.add(i.css.minuteContainer);const e=1===this.optionsStore.options.stepping?5:this.optionsStore.options.stepping;for(let s=0;s<60/e;s++){const e=document.createElement("div");e.setAttribute("data-action",O.selectMinute),t.appendChild(e)}return t}_update(e,s){const o=e.getElementsByClassName(i.css.minuteContainer)[0],a=this.optionsStore.viewDate.clone.startOf(t.Unit.hours),n=1===this.optionsStore.options.stepping?5:this.optionsStore.options.stepping;o.querySelectorAll(`[data-action="${O.selectMinute}"]`).forEach((e=>{const o=[];o.push(i.css.minute),this.validation.isValid(a,t.Unit.minutes)||o.push(i.css.disabled),s(t.Unit.minutes,a,o,e),e.classList.remove(...e.classList),e.classList.add(...o),e.setAttribute("data-value",`${a.minutes}`),e.innerText=a.minutesFormatted,a.manipulate(n,t.Unit.minutes)}))}}class W{constructor(){this.optionsStore=h.locate(u),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");t.classList.add(i.css.secondContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",O.selectSecond),t.appendChild(e)}return t}_update(e,s){const o=e.getElementsByClassName(i.css.secondContainer)[0],a=this.optionsStore.viewDate.clone.startOf(t.Unit.minutes);o.querySelectorAll(`[data-action="${O.selectSecond}"]`).forEach((e=>{const o=[];o.push(i.css.second),this.validation.isValid(a,t.Unit.seconds)||o.push(i.css.disabled),s(t.Unit.seconds,a,o,e),e.classList.remove(...e.classList),e.classList.add(...o),e.setAttribute("data-value",`${a.seconds}`),e.innerText=a.secondsFormatted,a.manipulate(5,t.Unit.seconds)}))}}class q{static toggle(t){t.classList.contains(i.css.show)?this.hide(t):this.show(t)}static showImmediately(t){t.classList.remove(i.css.collapsing),t.classList.add(i.css.collapse,i.css.show),t.style.height=""}static show(t){if(t.classList.contains(i.css.collapsing)||t.classList.contains(i.css.show))return;t.style.height="0",t.classList.remove(i.css.collapse),t.classList.add(i.css.collapsing),setTimeout((()=>{q.showImmediately(t)}),this.getTransitionDurationFromElement(t)),t.style.height=`${t.scrollHeight}px`}static hideImmediately(t){t&&(t.classList.remove(i.css.collapsing,i.css.show),t.classList.add(i.css.collapse))}static hide(t){if(t.classList.contains(i.css.collapsing)||!t.classList.contains(i.css.show))return;t.style.height=`${t.getBoundingClientRect().height}px`;t.offsetHeight,t.classList.remove(i.css.collapse,i.css.show),t.classList.add(i.css.collapsing),t.style.height="",setTimeout((()=>{q.hideImmediately(t)}),this.getTransitionDurationFromElement(t))}}q.getTransitionDurationFromElement=t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:s}=window.getComputedStyle(t);const i=Number.parseFloat(e),o=Number.parseFloat(s);return i||o?(e=e.split(",")[0],s=s.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(s))):0};class Y{constructor(){this._isVisible=!1,this._documentClickEvent=t=>{this.optionsStore.options.debug||window.debug||!this._isVisible||t.composedPath().includes(this.widget)||t.composedPath()?.includes(this.optionsStore.element)||this.hide()},this._actionsClickEvent=t=>{this._eventEmitters.action.emit({e:t})},this.optionsStore=h.locate(u),this.validation=h.locate(m),this.dates=h.locate($),this.dateDisplay=h.locate(H),this.monthDisplay=h.locate(x),this.yearDisplay=h.locate(I),this.decadeDisplay=h.locate(P),this.timeDisplay=h.locate(N),this.hourDisplay=h.locate(F),this.minuteDisplay=h.locate(B),this.secondDisplay=h.locate(W),this._eventEmitters=h.locate(g),this._widget=void 0,this._eventEmitters.updateDisplay.subscribe((t=>{this._update(t)}))}get widget(){return this._widget}get dateContainer(){return this.widget?.querySelector(`div.${i.css.dateContainer}`)}get timeContainer(){return this.widget?.querySelector(`div.${i.css.timeContainer}`)}get isVisible(){return this._isVisible}_update(e){if(this.widget)switch(e){case t.Unit.seconds:this.secondDisplay._update(this.widget,this.paint);break;case t.Unit.minutes:this.minuteDisplay._update(this.widget,this.paint);break;case t.Unit.hours:this.hourDisplay._update(this.widget,this.paint);break;case t.Unit.date:this.dateDisplay._update(this.widget,this.paint);break;case t.Unit.month:this.monthDisplay._update(this.widget,this.paint);break;case t.Unit.year:this.yearDisplay._update(this.widget,this.paint);break;case"decade":this.decadeDisplay._update(this.widget,this.paint);break;case"clock":if(!this._hasTime)break;this.timeDisplay._update(this.widget),this._update(t.Unit.hours),this._update(t.Unit.minutes),this._update(t.Unit.seconds);break;case"calendar":this._update(t.Unit.date),this._update(t.Unit.year),this._update(t.Unit.month),this.decadeDisplay._update(this.widget,this.paint),this._updateCalendarHeader();break;case"all":this._hasTime&&this._update("clock"),this._hasDate&&this._update("calendar")}}paint(t,e,s,i){}show(){if(null==this.widget){if(this._showSetDefaultIfNeeded(),this._buildWidget(),this._updateTheme(),this._showSetupViewMode(),this.optionsStore.options.display.inline)this.optionsStore.element.appendChild(this.widget);else{const t=this.optionsStore.options?.container||document.body,e=this.optionsStore.options?.display?.placement||"bottom";t.appendChild(this.widget),this.createPopup(this.optionsStore.element,this.widget,{modifiers:[{name:"eventListeners",enabled:!0}],placement:"rtl"===document.documentElement.dir?`${e}-end`:`${e}-start`}).then()}"clock"==this.optionsStore.options.display.viewMode&&this._eventEmitters.action.emit({e:null,action:O.showClock}),this.widget.querySelectorAll("[data-action]").forEach((t=>t.addEventListener("click",this._actionsClickEvent))),this._hasTime&&this.optionsStore.options.display.sideBySide&&(this.timeDisplay._update(this.widget),this.widget.getElementsByClassName(i.css.clockContainer)[0].style.display="grid")}this.widget.classList.add(i.css.show),this.optionsStore.options.display.inline||(this.updatePopup(),document.addEventListener("click",this._documentClickEvent)),this._eventEmitters.triggerEvent.emit({type:i.events.show}),this._isVisible=!0}_showSetupViewMode(){const t=this._hasTime&&!this._hasDate;t?(this.optionsStore.currentView="clock",this._eventEmitters.action.emit({e:null,action:O.showClock})):this.optionsStore.currentCalendarViewMode||(this.optionsStore.currentCalendarViewMode=this.optionsStore.minimumCalendarViewMode),t||"clock"===this.optionsStore.options.display.viewMode||(this._hasTime&&(this.optionsStore.options.display.sideBySide?q.show(this.timeContainer):q.hideImmediately(this.timeContainer)),q.show(this.dateContainer)),this._hasDate&&this._showMode()}_showSetDefaultIfNeeded(){if(0==this.dates.picked.length){if(this.optionsStore.options.useCurrent&&!this.optionsStore.options.defaultDate){const e=(new l).setLocalization(this.optionsStore.options.localization);if(!this.optionsStore.options.keepInvalid){let s=0,i=1;for(this.optionsStore.options.restrictions.maxDate?.isBefore(e)&&(i=-1);!this.validation.isValid(e)&&s>31;)e.manipulate(i,t.Unit.date),s++}this.dates.setValue(e)}this.optionsStore.options.defaultDate&&this.dates.setValue(this.optionsStore.options.defaultDate)}}async createPopup(t,e,s){let i;if(window?.Popper)i=window?.Popper?.createPopper;else{const{createPopper:t}=await import("@popperjs/core");i=t}i&&(this._popperInstance=i(t,e,s))}updatePopup(){this._popperInstance?.update()}_showMode(t){if(!this.widget)return;if(t){const e=Math.max(this.optionsStore.minimumCalendarViewMode,Math.min(3,this.optionsStore.currentCalendarViewMode+t));if(this.optionsStore.currentCalendarViewMode==e)return;this.optionsStore.currentCalendarViewMode=e}this.widget.querySelectorAll(`.${i.css.dateContainer} > div:not(.${i.css.calendarHeader}), .${i.css.timeContainer} > div:not(.${i.css.clockContainer})`).forEach((t=>t.style.display="none"));const e=p[this.optionsStore.currentCalendarViewMode],s=this.widget.querySelector(`.${e.className}`);switch(e.className){case i.css.decadesContainer:this.decadeDisplay._update(this.widget,this.paint);break;case i.css.yearsContainer:this.yearDisplay._update(this.widget,this.paint);break;case i.css.monthsContainer:this.monthDisplay._update(this.widget,this.paint);break;case i.css.daysContainer:this.dateDisplay._update(this.widget,this.paint)}s.style.display="grid",this.optionsStore.options.display.sideBySide&&(this.widget.querySelectorAll(`.${i.css.clockContainer}`)[0].style.display="grid"),this._updateCalendarHeader(),this._eventEmitters.viewUpdate.emit()}_updateTheme(t){if(this.widget){if(t){if(this.optionsStore.options.display.theme===t)return;this.optionsStore.options.display.theme=t}this.widget.classList.remove("light","dark"),this.widget.classList.add(this._getThemeClass()),"auto"===this.optionsStore.options.display.theme?window.matchMedia(i.css.isDarkPreferredQuery).addEventListener("change",(()=>this._updateTheme())):window.matchMedia(i.css.isDarkPreferredQuery).removeEventListener("change",(()=>this._updateTheme()))}}_getThemeClass(){const t=this.optionsStore.options.display.theme||"auto",e=window.matchMedia&&window.matchMedia(i.css.isDarkPreferredQuery).matches;switch(t){case"light":return i.css.lightTheme;case"dark":return i.css.darkTheme;case"auto":return e?i.css.darkTheme:i.css.lightTheme}}_updateCalendarHeader(){if(!this._hasDate)return;const t=[...this.widget.querySelector(`.${i.css.dateContainer} div[style*="display: grid"]`).classList].find((t=>t.startsWith(i.css.dateContainer))),[e,s,o]=this.widget.getElementsByClassName(i.css.calendarHeader)[0].getElementsByTagName("div");switch(t){case i.css.decadesContainer:e.setAttribute("title",this.optionsStore.options.localization.previousCentury),s.setAttribute("title",""),o.setAttribute("title",this.optionsStore.options.localization.nextCentury);break;case i.css.yearsContainer:e.setAttribute("title",this.optionsStore.options.localization.previousDecade),s.setAttribute("title",this.optionsStore.options.localization.selectDecade),o.setAttribute("title",this.optionsStore.options.localization.nextDecade);break;case i.css.monthsContainer:e.setAttribute("title",this.optionsStore.options.localization.previousYear),s.setAttribute("title",this.optionsStore.options.localization.selectYear),o.setAttribute("title",this.optionsStore.options.localization.nextYear);break;case i.css.daysContainer:e.setAttribute("title",this.optionsStore.options.localization.previousMonth),s.setAttribute("title",this.optionsStore.options.localization.selectMonth),o.setAttribute("title",this.optionsStore.options.localization.nextMonth),s.setAttribute(t,this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat))}s.innerText=s.getAttribute(t)}hide(){this.widget&&this._isVisible&&(this.widget.classList.remove(i.css.show),this._isVisible&&(this._eventEmitters.triggerEvent.emit({type:i.events.hide,date:this.optionsStore.unset?null:this.dates.lastPicked?.clone}),this._isVisible=!1),document.removeEventListener("click",this._documentClickEvent))}toggle(){return this._isVisible?this.hide():this.show()}_dispose(){document.removeEventListener("click",this._documentClickEvent),this.widget&&(this.widget.querySelectorAll("[data-action]").forEach((t=>t.removeEventListener("click",this._actionsClickEvent))),this.widget.parentNode.removeChild(this.widget),this._widget=void 0)}_buildWidget(){const t=document.createElement("div");t.classList.add(i.css.widget);const e=document.createElement("div");e.classList.add(i.css.dateContainer),e.append(this.getHeadTemplate(),this.decadeDisplay.getPicker(),this.yearDisplay.getPicker(),this.monthDisplay.getPicker(),this.dateDisplay.getPicker());const s=document.createElement("div");s.classList.add(i.css.timeContainer),s.appendChild(this.timeDisplay.getPicker(this._iconTag.bind(this))),s.appendChild(this.hourDisplay.getPicker()),s.appendChild(this.minuteDisplay.getPicker()),s.appendChild(this.secondDisplay.getPicker());const o=document.createElement("div");if(o.classList.add(i.css.toolbar),o.append(...this.getToolbarElements()),this.optionsStore.options.display.inline&&t.classList.add(i.css.inline),this.optionsStore.options.display.calendarWeeks&&t.classList.add("calendarWeeks"),this.optionsStore.options.display.sideBySide&&this._hasDateAndTime)return void this._buildWidgetSideBySide(t,e,s,o);"top"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(o);const a=(e,s,o,a)=>{e&&(s&&(o.classList.add(i.css.collapse),a&&o.classList.add(i.css.show)),t.appendChild(o))};a(this._hasDate,this._hasTime,e,"clock"!==this.optionsStore.options.display.viewMode),a(this._hasTime,this._hasDate,s,"clock"===this.optionsStore.options.display.viewMode),"bottom"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(o);const n=document.createElement("div");n.classList.add("arrow"),n.setAttribute("data-popper-arrow",""),t.appendChild(n),this._widget=t}_buildWidgetSideBySide(t,e,s,o){t.classList.add(i.css.sideBySide),"top"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(o);const a=document.createElement("div");a.classList.add("td-row"),e.classList.add("td-half"),s.classList.add("td-half"),a.appendChild(e),a.appendChild(s),t.appendChild(a),"bottom"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(o),this._widget=t}get _hasTime(){return this.optionsStore.options.display.components.clock&&(this.optionsStore.options.display.components.hours||this.optionsStore.options.display.components.minutes||this.optionsStore.options.display.components.seconds)}get _hasDate(){return this.optionsStore.options.display.components.calendar&&(this.optionsStore.options.display.components.year||this.optionsStore.options.display.components.month||this.optionsStore.options.display.components.date)}get _hasDateAndTime(){return this._hasDate&&this._hasTime}getToolbarElements(){const t=[];if(this.optionsStore.options.display.buttons.today){const e=document.createElement("div");e.setAttribute("data-action",O.today),e.setAttribute("title",this.optionsStore.options.localization.today),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.today)),t.push(e)}if(!this.optionsStore.options.display.sideBySide&&this._hasDate&&this._hasTime){let e,s;"clock"===this.optionsStore.options.display.viewMode?(e=this.optionsStore.options.localization.selectDate,s=this.optionsStore.options.display.icons.date):(e=this.optionsStore.options.localization.selectTime,s=this.optionsStore.options.display.icons.time);const i=document.createElement("div");i.setAttribute("data-action",O.togglePicker),i.setAttribute("title",e),i.appendChild(this._iconTag(s)),t.push(i)}if(this.optionsStore.options.display.buttons.clear){const e=document.createElement("div");e.setAttribute("data-action",O.clear),e.setAttribute("title",this.optionsStore.options.localization.clear),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.clear)),t.push(e)}if(this.optionsStore.options.display.buttons.close){const e=document.createElement("div");e.setAttribute("data-action",O.close),e.setAttribute("title",this.optionsStore.options.localization.close),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.close)),t.push(e)}return t}getHeadTemplate(){const t=document.createElement("div");t.classList.add(i.css.calendarHeader);const e=document.createElement("div");e.classList.add(i.css.previous),e.setAttribute("data-action",O.previous),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.previous));const s=document.createElement("div");s.classList.add(i.css.switch),s.setAttribute("data-action",O.changeCalendarView);const o=document.createElement("div");return o.classList.add(i.css.next),o.setAttribute("data-action",O.next),o.appendChild(this._iconTag(this.optionsStore.options.display.icons.next)),t.append(e,s,o),t}_iconTag(t){if("sprites"===this.optionsStore.options.display.icons.type){const e=document.createElementNS("http://www.w3.org/2000/svg","svg"),s=document.createElementNS("http://www.w3.org/2000/svg","use");return s.setAttribute("xlink:href",t),s.setAttribute("href",t),e.appendChild(s),e}const e=document.createElement("i");return e.classList.add(...t.split(" ")),e}_rebuild(){const t=this._isVisible;this._dispose(),t&&this.show()}refreshCurrentView(){switch(this._isVisible||this._dispose(),this.optionsStore.currentView){case"clock":this._update("clock");break;case"calendar":this._update(t.Unit.date);break;case"months":this._update(t.Unit.month);break;case"years":this._update(t.Unit.year);break;case"decades":this._update("decade")}}}class j{constructor(){this.optionsStore=h.locate(u),this.dates=h.locate($),this.validation=h.locate(m),this.display=h.locate(Y),this._eventEmitters=h.locate(g),this._eventEmitters.action.subscribe((t=>{this.do(t.e,t.action)}))}do(e,s){const o=e?.currentTarget;if(o?.classList?.contains(i.css.disabled))return;s=s||o?.dataset?.action;const a=(this.dates.lastPicked||this.optionsStore.viewDate).clone;switch(s){case O.next:case O.previous:this.handleNextPrevious(s);break;case O.changeCalendarView:this.display._showMode(1),this.display._updateCalendarHeader();break;case O.selectMonth:case O.selectYear:case O.selectDecade:this.handleSelectCalendarMode(s,o);break;case O.selectDay:this.handleSelectDay(o);break;case O.selectHour:{let t=+o.dataset.value;a.hours>=12&&this.optionsStore.isTwelveHour&&(t+=12),a.hours=t,this.dates.setValue(a,this.dates.lastPickedIndex),this.hideOrClock(e);break}case O.selectMinute:a.minutes=+o.dataset.value,this.dates.setValue(a,this.dates.lastPickedIndex),this.hideOrClock(e);break;case O.selectSecond:a.seconds=+o.dataset.value,this.dates.setValue(a,this.dates.lastPickedIndex),this.hideOrClock(e);break;case O.incrementHours:this.manipulateAndSet(a,t.Unit.hours);break;case O.incrementMinutes:this.manipulateAndSet(a,t.Unit.minutes,this.optionsStore.options.stepping);break;case O.incrementSeconds:this.manipulateAndSet(a,t.Unit.seconds);break;case O.decrementHours:this.manipulateAndSet(a,t.Unit.hours,-1);break;case O.decrementMinutes:this.manipulateAndSet(a,t.Unit.minutes,-1*this.optionsStore.options.stepping);break;case O.decrementSeconds:this.manipulateAndSet(a,t.Unit.seconds,-1);break;case O.toggleMeridiem:this.manipulateAndSet(a,t.Unit.hours,this.dates.lastPicked.hours>=12?-12:12);break;case O.togglePicker:this.handleToggle(o);break;case O.showClock:case O.showHours:case O.showMinutes:case O.showSeconds:this.optionsStore.options.display.sideBySide||"clock"===this.optionsStore.currentView||(q.hideImmediately(this.display.dateContainer),q.showImmediately(this.display.timeContainer)),this.handleShowClockContainers(s);break;case O.clear:this.dates.setValue(null),this.display._updateCalendarHeader();break;case O.close:this.display.hide();break;case O.today:{const e=(new l).setLocalization(this.optionsStore.options.localization);this._eventEmitters.updateViewDate.emit(e),this.validation.isValid(e,t.Unit.date)&&this.dates.setValue(e,this.dates.lastPickedIndex);break}}}handleShowClockContainers(e){if(!this.display._hasTime)return void i.errorMessages.throwError("Cannot show clock containers when time is disabled.");this.optionsStore.currentView="clock",this.display.widget.querySelectorAll(`.${i.css.timeContainer} > div`).forEach((t=>t.style.display="none"));let s="";switch(e){case O.showClock:s=i.css.clockContainer,this.display._update("clock");break;case O.showHours:s=i.css.hourContainer,this.display._update(t.Unit.hours);break;case O.showMinutes:s=i.css.minuteContainer,this.display._update(t.Unit.minutes);break;case O.showSeconds:s=i.css.secondContainer,this.display._update(t.Unit.seconds)}this.display.widget.getElementsByClassName(s)[0].style.display="grid"}handleNextPrevious(t){const{unit:e,step:s}=p[this.optionsStore.currentCalendarViewMode];t===O.next?this.optionsStore.viewDate.manipulate(s,e):this.optionsStore.viewDate.manipulate(-1*s,e),this._eventEmitters.viewUpdate.emit(),this.display._showMode()}hideOrClock(t){this.optionsStore.isTwelveHour||this.optionsStore.options.display.components.minutes||this.optionsStore.options.display.keepOpen||this.optionsStore.options.display.inline?this.do(t,O.showClock):this.display.hide()}manipulateAndSet(t,e,s=1){const i=t.manipulate(s,e);this.validation.isValid(i,e)&&this.dates.setValue(i,this.dates.lastPickedIndex)}handleSelectCalendarMode(t,e){const s=+e.dataset.value;switch(t){case O.selectMonth:this.optionsStore.viewDate.month=s;break;case O.selectYear:case O.selectDecade:this.optionsStore.viewDate.year=s}this.optionsStore.currentCalendarViewMode===this.optionsStore.minimumCalendarViewMode?(this.dates.setValue(this.optionsStore.viewDate,this.dates.lastPickedIndex),this.optionsStore.options.display.inline||this.display.hide()):this.display._showMode(-1)}handleToggle(t){t.getAttribute("title")===this.optionsStore.options.localization.selectDate?(t.setAttribute("title",this.optionsStore.options.localization.selectTime),t.innerHTML=this.display._iconTag(this.optionsStore.options.display.icons.time).outerHTML,this.display._updateCalendarHeader(),this.optionsStore.refreshCurrentView()):(t.setAttribute("title",this.optionsStore.options.localization.selectDate),t.innerHTML=this.display._iconTag(this.optionsStore.options.display.icons.date).outerHTML,this.display._hasTime&&(this.handleShowClockContainers(O.showClock),this.display._update("clock"))),this.display.widget.querySelectorAll(`.${i.css.dateContainer}, .${i.css.timeContainer}`).forEach((t=>q.toggle(t))),this._eventEmitters.viewUpdate.emit()}handleSelectDay(e){const s=this.optionsStore.viewDate.clone;e.classList.contains(i.css.old)&&s.manipulate(-1,t.Unit.month),e.classList.contains(i.css.new)&&s.manipulate(1,t.Unit.month),s.date=+e.dataset.day,this.optionsStore.options.dateRange?this.handleDateRange(s):this.optionsStore.options.multipleDates?this.handleMultiDate(s):this.dates.setValue(s,this.dates.lastPickedIndex),this.display._hasTime||this.optionsStore.options.display.keepOpen||this.optionsStore.options.display.inline||this.optionsStore.options.multipleDates||this.optionsStore.options.dateRange||this.display.hide()}handleMultiDate(e){let s=this.dates.pickedIndex(e,t.Unit.date);console.log(s),-1!==s?this.dates.setValue(null,s):(s=this.dates.lastPickedIndex+1,0===this.dates.picked.length&&(s=0),this.dates.setValue(e,s))}handleDateRange(t){switch(this.dates.picked.length){case 2:this.dates.clear();break;case 1:{const e=this.dates.picked[0];if(t.getTime()===e.getTime()){this.dates.clear();break}return t.isBefore(e)?(this.dates.setValue(t,0),void this.dates.setValue(e,1)):void this.dates.setValue(t,1)}}this.dates.setValue(t,0)}}class R{constructor(t,e={}){this._subscribers={},this._isDisabled=!1,this._inputChangeEvent=t=>{const e=t?.detail;if(e)return;const s=()=>{this.dates.lastPicked&&(this.optionsStore.viewDate=this.dates.lastPicked.clone)},i=this.optionsStore.input.value;if(this.optionsStore.options.multipleDates||this.optionsStore.options.dateRange)try{const t=i.split(this.optionsStore.options.multipleDatesSeparator);for(let e=0;e{this.optionsStore.element?.disabled||this.optionsStore.input?.disabled||"INPUT"===this._toggle.nodeName&&"text"===this._toggle?.type&&this.optionsStore.options.allowInputToggle||this.toggle()},this._openClickEvent=()=>{this.optionsStore.element?.disabled||this.optionsStore.input?.disabled||this.display.isVisible||this.show()},h=new c,this._eventEmitters=h.locate(g),this.optionsStore=h.locate(u),this.display=h.locate(Y),this.dates=h.locate($),this.actions=h.locate(j),t||i.errorMessages.mustProvideElement(),this.optionsStore.element=t,this._initializeOptions(e,f,!0),this.optionsStore.viewDate.setLocalization(this.optionsStore.options.localization),this.optionsStore.unset=!0,this._initializeInput(),this._initializeToggle(),this.optionsStore.options.display.inline&&this.display.show(),this._eventEmitters.triggerEvent.subscribe((t=>{this._triggerEvent(t)})),this._eventEmitters.viewUpdate.subscribe((()=>{this._viewUpdate()})),this._eventEmitters.updateViewDate.subscribe((t=>{this.viewDate=t}))}get viewDate(){return this.optionsStore.viewDate}set viewDate(t){this.optionsStore.viewDate=t,this.optionsStore.viewDate.setLocalization(this.optionsStore.options.localization),this.display._update("clock"===this.optionsStore.currentView?"clock":"calendar")}updateOptions(t,e=!1){e?this._initializeOptions(t,f):this._initializeOptions(t,this.optionsStore.options),this.optionsStore.viewDate.setLocalization(this.optionsStore.options.localization),this.display.refreshCurrentView()}toggle(){this._isDisabled||this.display.toggle()}show(){this._isDisabled||this.display.show()}hide(){this.display.hide()}disable(){this._isDisabled=!0,this.optionsStore.input?.setAttribute("disabled","disabled"),this.display.hide()}enable(){this._isDisabled=!1,this.optionsStore.input?.removeAttribute("disabled")}clear(){this.optionsStore.input.value="",this.dates.clear()}subscribe(t,e){let s;"string"==typeof t&&(t=[t]),s=Array.isArray(e)?e:[e],t.length!==s.length&&i.errorMessages.subscribeMismatch();const o=[];for(let e=0;e{e(t)}))}_viewUpdate(){this._triggerEvent({type:i.events.update,viewDate:this.optionsStore.viewDate.clone})}_unsubscribe(t,e){this._subscribers[t].splice(e,1)}_initializeOptions(t,e,s=!1){let i=V.deepCopy(t);i=V._mergeOptions(i,e),s&&(i=V._dataToOptions(this.optionsStore.element,i)),V._validateConflicts(i),i.viewDate=i.viewDate.setLocalization(i.localization),this.optionsStore.viewDate.isSame(i.viewDate)||(this.optionsStore.viewDate=i.viewDate),i.display.components.year&&(this.optionsStore.minimumCalendarViewMode=2),i.display.components.month&&(this.optionsStore.minimumCalendarViewMode=1),i.display.components.date&&(this.optionsStore.minimumCalendarViewMode=0),this.optionsStore.currentCalendarViewMode=Math.max(this.optionsStore.minimumCalendarViewMode,this.optionsStore.currentCalendarViewMode),p[this.optionsStore.currentCalendarViewMode].name!==i.display.viewMode&&(this.optionsStore.currentCalendarViewMode=Math.max(p.findIndex((t=>t.name===i.display.viewMode)),this.optionsStore.minimumCalendarViewMode)),this.display?.isVisible&&this.display._update("all"),i.display.components.useTwentyfourHour&&void 0===i.localization.hourCycle?i.localization.hourCycle="h24":void 0===i.localization.hourCycle&&(i.localization.hourCycle=d(i.localization.locale)),this.optionsStore.options=i,i.restrictions.maxDate&&this.viewDate.isAfter(i.restrictions.maxDate)&&(this.viewDate=i.restrictions.maxDate),i.restrictions.minDate&&this.viewDate.isBefore(i.restrictions.minDate)&&(this.viewDate=i.restrictions.minDate)}_initializeInput(){if("INPUT"==this.optionsStore.element.tagName)this.optionsStore.input=this.optionsStore.element;else{const t=this.optionsStore.element.dataset.tdTargetInput;this.optionsStore.input=null==t||"nearest"==t?this.optionsStore.element.querySelector("input"):this.optionsStore.element.querySelector(t)}this.optionsStore.input&&(!this.optionsStore.input.value&&this.optionsStore.options.defaultDate&&(this.optionsStore.input.value=this.dates.formatInput(this.optionsStore.options.defaultDate)),this.optionsStore.input.addEventListener("change",this._inputChangeEvent),this.optionsStore.options.allowInputToggle&&(this.optionsStore.input.addEventListener("click",this._openClickEvent),this.optionsStore.input.addEventListener("focus",this._openClickEvent)),this.optionsStore.input.value&&this._inputChangeEvent())}_initializeToggle(){if(this.optionsStore.options.display.inline)return;let t=this.optionsStore.element.dataset.tdTargetToggle;"nearest"==t&&(t='[data-td-toggle="datetimepicker"]'),this._toggle=null==t?this.optionsStore.element:this.optionsStore.element.querySelector(t),this._toggle.addEventListener("click",this._toggleClickEvent)}_handleAfterChangeEvent(t){!this.optionsStore.options.promptTimeOnDateChange||this.optionsStore.options.multipleDates||this.optionsStore.options.display.inline||this.optionsStore.options.display.sideBySide||!this.display._hasTime||this.display.widget?.getElementsByClassName(i.css.show)[0].classList.contains(i.css.timeContainer)||!t.oldDate&&this.optionsStore.options.useCurrent||t.oldDate&&t.date?.isSame(t.oldDate)||(clearTimeout(this._currentPromptTimeTimeout),this._currentPromptTimeTimeout=setTimeout((()=>{this.display.widget&&this._eventEmitters.action.emit({e:{currentTarget:this.display.widget.querySelector('[data-action="togglePicker"]')},action:O.togglePicker})}),this.optionsStore.options.promptTimeOnDateChangeTransitionDelay))}}const Q={},J=t=>{Q[t.name]||(Q[t.name]=t.localization)},K=t=>{const e=Q[t];e&&(f.localization=e)},Z=function(t,e=undefined){return t?(t.installed||(t(e,{TempusDominus:R,Dates:$,Display:Y,DateTime:l,Namespace:i},X),t.installed=!0),X):X},G="6.7.19",X={TempusDominus:R,extend:Z,loadLocale:J,locale:K,Namespace:i,DefaultOptions:f,DateTime:l,Unit:t.Unit,version:G,DefaultEnLocalization:S};t.DateTime=l,t.DefaultEnLocalization=S,t.DefaultOptions=f,t.Namespace=i,t.TempusDominus=R,t.extend=Z,t.loadLocale=J,t.locale=K,t.version=G,Object.defineProperty(t,"__esModule",{value:!0})})); diff --git a/node_modules/@eonasdan/tempus-dominus/dist/locales/ar-SA.js b/node_modules/@eonasdan/tempus-dominus/dist/locales/ar-SA.js deleted file mode 100644 index 6043f8f..0000000 --- a/node_modules/@eonasdan/tempus-dominus/dist/locales/ar-SA.js +++ /dev/null @@ -1,47 +0,0 @@ -/*! - * Tempus Dominus v6.7.19 (https://getdatepicker.com/) - * Copyright 2013-2023 Jonathan Peterson - * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) - */ -(function(g,f){typeof exports==='object'&&typeof module!=='undefined'?f(exports):typeof define==='function'&&define.amd?define(['exports'],f):(g=typeof globalThis!=='undefined'?globalThis:g||self,f((g.tempusDominus=g.tempusDominus||{},g.tempusDominus.locales=g.tempusDominus.locales||{},g.tempusDominus.locales.ar_SA={})));})(this,(function(exports){'use strict';const name = 'ar-SA'; -const localization = { - today: 'اليوم', - clear: 'مسح', - close: 'إغلاق', - selectMonth: 'اختر الشهر', - previousMonth: 'الشهر السابق', - nextMonth: 'الشهر التالي', - selectYear: 'اختر السنة', - previousYear: 'العام السابق', - nextYear: 'العام التالي', - selectDecade: 'اختر العقد', - previousDecade: 'العقد السابق', - nextDecade: 'العقد التالي', - previousCentury: 'القرن السابق', - nextCentury: 'القرن التالي', - pickHour: 'اختر الساعة', - incrementHour: 'أضف ساعة', - decrementHour: 'أنقص ساعة', - pickMinute: 'اختر الدقيقة', - incrementMinute: 'أضف دقيقة', - decrementMinute: 'أنقص دقيقة', - pickSecond: 'اختر الثانية', - incrementSecond: 'أضف ثانية', - decrementSecond: 'أنقص ثانية', - toggleMeridiem: 'تبديل الفترة', - selectTime: 'اخر الوقت', - selectDate: 'اختر التاريخ', - dayViewHeaderFormat: { month: 'long', year: '2-digit' }, - locale: 'ar-SA', - startOfTheWeek: 1, - dateFormats: { - LT: 'HH:mm', - LTS: 'HH:mm:ss', - L: 'dd/MM/yyyy', - LL: 'd MMMM yyyy', - LLL: 'd MMMM yyyy HH:mm', - LLLL: 'dddd d MMMM yyyy HH:mm', - }, - ordinal: (n) => n, - format: 'L LT', -};exports.localization=localization;exports.name=name;Object.defineProperty(exports,'__esModule',{value:true});})); \ No newline at end of file diff --git a/node_modules/@eonasdan/tempus-dominus/dist/locales/ar.js b/node_modules/@eonasdan/tempus-dominus/dist/locales/ar.js deleted file mode 100644 index eadeb73..0000000 --- a/node_modules/@eonasdan/tempus-dominus/dist/locales/ar.js +++ /dev/null @@ -1,47 +0,0 @@ -/*! - * Tempus Dominus v6.7.19 (https://getdatepicker.com/) - * Copyright 2013-2023 Jonathan Peterson - * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) - */ -(function(g,f){typeof exports==='object'&&typeof module!=='undefined'?f(exports):typeof define==='function'&&define.amd?define(['exports'],f):(g=typeof globalThis!=='undefined'?globalThis:g||self,f((g.tempusDominus=g.tempusDominus||{},g.tempusDominus.locales=g.tempusDominus.locales||{},g.tempusDominus.locales.ar={})));})(this,(function(exports){'use strict';const name = 'ar'; -const localization = { - today: 'اليوم', - clear: 'مسح', - close: 'إغلاق', - selectMonth: 'اختر الشهر', - previousMonth: 'الشهر السابق', - nextMonth: 'الشهر التالي', - selectYear: 'اختر السنة', - previousYear: 'العام السابق', - nextYear: 'العام التالي', - selectDecade: 'اختر العقد', - previousDecade: 'العقد السابق', - nextDecade: 'العقد التالي', - previousCentury: 'القرن السابق', - nextCentury: 'القرن التالي', - pickHour: 'اختر الساعة', - incrementHour: 'أضف ساعة', - decrementHour: 'أنقص ساعة', - pickMinute: 'اختر الدقيقة', - incrementMinute: 'أضف دقيقة', - decrementMinute: 'أنقص دقيقة', - pickSecond: 'اختر الثانية', - incrementSecond: 'أضف ثانية', - decrementSecond: 'أنقص ثانية', - toggleMeridiem: 'تبديل الفترة', - selectTime: 'اخر الوقت', - selectDate: 'اختر التاريخ', - dayViewHeaderFormat: { month: 'long', year: '2-digit' }, - locale: 'ar', - startOfTheWeek: 1, - dateFormats: { - LT: 'HH:mm', - LTS: 'HH:mm:ss', - L: 'd/M/yyyy', - LL: 'd MMMM yyyy', - LLL: 'd MMMM yyyy HH:mm', - LLLL: 'dddd d MMMM yyyy HH:mm', - }, - ordinal: (n) => n, - format: 'L LT', -};exports.localization=localization;exports.name=name;Object.defineProperty(exports,'__esModule',{value:true});})); \ No newline at end of file diff --git a/node_modules/@eonasdan/tempus-dominus/dist/locales/ca.js b/node_modules/@eonasdan/tempus-dominus/dist/locales/ca.js deleted file mode 100644 index e4a62fa..0000000 --- a/node_modules/@eonasdan/tempus-dominus/dist/locales/ca.js +++ /dev/null @@ -1,47 +0,0 @@ -/*! - * Tempus Dominus v6.7.19 (https://getdatepicker.com/) - * Copyright 2013-2023 Jonathan Peterson - * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) - */ -(function(g,f){typeof exports==='object'&&typeof module!=='undefined'?f(exports):typeof define==='function'&&define.amd?define(['exports'],f):(g=typeof globalThis!=='undefined'?globalThis:g||self,f((g.tempusDominus=g.tempusDominus||{},g.tempusDominus.locales=g.tempusDominus.locales||{},g.tempusDominus.locales.ca={})));})(this,(function(exports){'use strict';const name = 'ca'; -const localization = { - today: 'Avui', - clear: 'Esborrar selecció', - close: 'Tancar selector', - selectMonth: 'Seleccionar mes', - previousMonth: 'Mes anterior', - nextMonth: 'Pròxim mes', - selectYear: 'Seleccionar any', - previousYear: 'Any anterior', - nextYear: 'Pròxim any', - selectDecade: 'Seleccionar dècada', - previousDecade: 'Dècada anterior', - nextDecade: 'Pròxima dècada', - previousCentury: 'Segle anterior', - nextCentury: 'Pròxim segle', - pickHour: 'Escollir hora', - incrementHour: 'Incrementar hora', - decrementHour: 'Decrementar hora', - pickMinute: 'Escollir minut', - incrementMinute: 'Incrementar minut', - decrementMinute: 'Decrementar minut', - pickSecond: 'Escollir segon', - incrementSecond: 'Incrementar segon', - decrementSecond: 'Decrementar segon', - toggleMeridiem: 'Canviar AM/PM', - selectTime: 'Seleccionar temps', - selectDate: 'Seleccionar data', - dayViewHeaderFormat: { month: 'long', year: '2-digit' }, - startOfTheWeek: 1, - locale: 'ca', - dateFormats: { - LT: 'H:mm', - LTS: 'H:mm:ss', - L: 'dd/MM/yyyy', - LL: 'd [de] MMMM [de] yyyy', - LLL: 'd [de] MMMM [de] yyyy H:mm', - LLLL: 'dddd, d [de] MMMM [de] yyyy H:mm', - }, - ordinal: (n) => `${n}º`, - format: 'L LT', -};exports.localization=localization;exports.name=name;Object.defineProperty(exports,'__esModule',{value:true});})); \ No newline at end of file diff --git a/node_modules/@eonasdan/tempus-dominus/dist/locales/cs.js b/node_modules/@eonasdan/tempus-dominus/dist/locales/cs.js deleted file mode 100644 index 0f67e4b..0000000 --- a/node_modules/@eonasdan/tempus-dominus/dist/locales/cs.js +++ /dev/null @@ -1,47 +0,0 @@ -/*! - * Tempus Dominus v6.7.19 (https://getdatepicker.com/) - * Copyright 2013-2023 Jonathan Peterson - * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) - */ -(function(g,f){typeof exports==='object'&&typeof module!=='undefined'?f(exports):typeof define==='function'&&define.amd?define(['exports'],f):(g=typeof globalThis!=='undefined'?globalThis:g||self,f((g.tempusDominus=g.tempusDominus||{},g.tempusDominus.locales=g.tempusDominus.locales||{},g.tempusDominus.locales.cs={})));})(this,(function(exports){'use strict';const name = 'cs'; -const localization = { - today: 'Dnes', - clear: 'Vymazat výběr', - close: 'Zavřít výběrové okno', - selectMonth: 'Vybrat měsíc', - previousMonth: 'Předchozí měsíc', - nextMonth: 'Následující měsíc', - selectYear: 'Vybrat rok', - previousYear: 'Předchozí rok', - nextYear: 'Následující rok', - selectDecade: 'Vybrat desetiletí', - previousDecade: 'Předchozí desetiletí', - nextDecade: 'Následující desetiletí', - previousCentury: 'Předchozí století', - nextCentury: 'Následující století', - pickHour: 'Vybrat hodinu', - incrementHour: 'Zvýšit hodinu', - decrementHour: 'Snížit hodinu', - pickMinute: 'Vybrat minutu', - incrementMinute: 'Zvýšit minutu', - decrementMinute: 'Snížit minutu', - pickSecond: 'Vybrat sekundu', - incrementSecond: 'Zvýšit sekundu', - decrementSecond: 'Snížit sekundu', - toggleMeridiem: 'Přepnout ráno / odpoledne', - selectTime: 'Vybrat čas', - selectDate: 'Vybrat datum', - dayViewHeaderFormat: { month: 'long', year: '2-digit' }, - locale: 'de', - startOfTheWeek: 1, - dateFormats: { - LTS: 'HH:mm:ss', - LT: 'HH:mm', - L: 'dd.MM.yyyy', - LL: 'd. MMMM yyyy', - LLL: 'd. MMMM yyyy HH:mm', - LLLL: 'dddd, d. MMMM yyyy HH:mm', - }, - ordinal: (n) => `${n}.`, - format: 'L LT', -};exports.localization=localization;exports.name=name;Object.defineProperty(exports,'__esModule',{value:true});})); \ No newline at end of file diff --git a/node_modules/@eonasdan/tempus-dominus/dist/locales/de.js b/node_modules/@eonasdan/tempus-dominus/dist/locales/de.js deleted file mode 100644 index c000828..0000000 --- a/node_modules/@eonasdan/tempus-dominus/dist/locales/de.js +++ /dev/null @@ -1,47 +0,0 @@ -/*! - * Tempus Dominus v6.7.19 (https://getdatepicker.com/) - * Copyright 2013-2023 Jonathan Peterson - * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) - */ -(function(g,f){typeof exports==='object'&&typeof module!=='undefined'?f(exports):typeof define==='function'&&define.amd?define(['exports'],f):(g=typeof globalThis!=='undefined'?globalThis:g||self,f((g.tempusDominus=g.tempusDominus||{},g.tempusDominus.locales=g.tempusDominus.locales||{},g.tempusDominus.locales.de={})));})(this,(function(exports){'use strict';const name = 'de'; -const localization = { - today: 'Heute', - clear: 'Auswahl löschen', - close: 'Auswahlbox schließen', - selectMonth: 'Monat wählen', - previousMonth: 'Letzter Monat', - nextMonth: 'Nächster Monat', - selectYear: 'Jahr wählen', - previousYear: 'Letztes Jahr', - nextYear: 'Nächstes Jahr', - selectDecade: 'Jahrzehnt wählen', - previousDecade: 'Letztes Jahrzehnt', - nextDecade: 'Nächstes Jahrzehnt', - previousCentury: 'Letztes Jahrhundert', - nextCentury: 'Nächstes Jahrhundert', - pickHour: 'Stunde wählen', - incrementHour: 'Stunde erhöhen', - decrementHour: 'Stunde verringern', - pickMinute: 'Minute wählen', - incrementMinute: 'Minute erhöhen', - decrementMinute: 'Minute verringern', - pickSecond: 'Sekunde wählen', - incrementSecond: 'Sekunde erhöhen', - decrementSecond: 'Sekunde verringern', - toggleMeridiem: 'Tageszeit umschalten', - selectTime: 'Zeit wählen', - selectDate: 'Datum wählen', - dayViewHeaderFormat: { month: 'long', year: '2-digit' }, - locale: 'de', - startOfTheWeek: 1, - dateFormats: { - LTS: 'HH:mm:ss', - LT: 'HH:mm', - L: 'dd.MM.yyyy', - LL: 'd. MMMM yyyy', - LLL: 'd. MMMM yyyy HH:mm', - LLLL: 'dddd, d. MMMM yyyy HH:mm', - }, - ordinal: (n) => `${n}.`, - format: 'L LT', -};exports.localization=localization;exports.name=name;Object.defineProperty(exports,'__esModule',{value:true});})); \ No newline at end of file diff --git a/node_modules/@eonasdan/tempus-dominus/dist/locales/es.js b/node_modules/@eonasdan/tempus-dominus/dist/locales/es.js deleted file mode 100644 index 7deb6d2..0000000 --- a/node_modules/@eonasdan/tempus-dominus/dist/locales/es.js +++ /dev/null @@ -1,47 +0,0 @@ -/*! - * Tempus Dominus v6.7.19 (https://getdatepicker.com/) - * Copyright 2013-2023 Jonathan Peterson - * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) - */ -(function(g,f){typeof exports==='object'&&typeof module!=='undefined'?f(exports):typeof define==='function'&&define.amd?define(['exports'],f):(g=typeof globalThis!=='undefined'?globalThis:g||self,f((g.tempusDominus=g.tempusDominus||{},g.tempusDominus.locales=g.tempusDominus.locales||{},g.tempusDominus.locales.es={})));})(this,(function(exports){'use strict';const name = 'es'; -const localization = { - today: 'Hoy', - clear: 'Borrar selección', - close: 'Cerrar selector', - selectMonth: 'Seleccionar mes', - previousMonth: 'Mes anterior', - nextMonth: 'Próximo mes', - selectYear: 'Seleccionar año', - previousYear: 'Año anterior', - nextYear: 'Próximo año', - selectDecade: 'Seleccionar década', - previousDecade: 'Década anterior', - nextDecade: 'Próxima década', - previousCentury: 'Siglo anterior', - nextCentury: 'Próximo siglo', - pickHour: 'Elegir hora', - incrementHour: 'Incrementar hora', - decrementHour: 'Decrementar hora', - pickMinute: 'Elegir minuto', - incrementMinute: 'Incrementar minuto', - decrementMinute: 'Decrementar minuto', - pickSecond: 'Elegir segundo', - incrementSecond: 'Incrementar segundo', - decrementSecond: 'Decrementar segundo', - toggleMeridiem: 'Cambiar AM/PM', - selectTime: 'Seleccionar tiempo', - selectDate: 'Seleccionar fecha', - dayViewHeaderFormat: { month: 'long', year: '2-digit' }, - startOfTheWeek: 1, - locale: 'es', - dateFormats: { - LT: 'H:mm', - LTS: 'H:mm:ss', - L: 'dd/MM/yyyy', - LL: 'd [de] MMMM [de] yyyy', - LLL: 'd [de] MMMM [de] yyyy H:mm', - LLLL: 'dddd, d [de] MMMM [de] yyyy H:mm', - }, - ordinal: (n) => `${n}º`, - format: 'L LT', -};exports.localization=localization;exports.name=name;Object.defineProperty(exports,'__esModule',{value:true});})); \ No newline at end of file diff --git a/node_modules/@eonasdan/tempus-dominus/dist/locales/fi.js b/node_modules/@eonasdan/tempus-dominus/dist/locales/fi.js deleted file mode 100644 index e1b2f31..0000000 --- a/node_modules/@eonasdan/tempus-dominus/dist/locales/fi.js +++ /dev/null @@ -1,47 +0,0 @@ -/*! - * Tempus Dominus v6.7.19 (https://getdatepicker.com/) - * Copyright 2013-2023 Jonathan Peterson - * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) - */ -(function(g,f){typeof exports==='object'&&typeof module!=='undefined'?f(exports):typeof define==='function'&&define.amd?define(['exports'],f):(g=typeof globalThis!=='undefined'?globalThis:g||self,f((g.tempusDominus=g.tempusDominus||{},g.tempusDominus.locales=g.tempusDominus.locales||{},g.tempusDominus.locales.fi={})));})(this,(function(exports){'use strict';const name = 'fi'; -const localization = { - today: 'Tänään', - clear: 'Tyhjennä', - close: 'Sulje', - selectMonth: 'Valitse kuukausi', - previousMonth: 'Edellinen kuukausi', - nextMonth: 'Seuraava kuukausi', - selectYear: 'Valitse vuosi', - previousYear: 'Edellinen vuosi', - nextYear: 'Seuraava vuosi', - selectDecade: 'Valitse vuosikymmen', - previousDecade: 'Edellinen vuosikymmen', - nextDecade: 'Seuraava vuosikymmen', - previousCentury: 'Edellinen vuosisata', - nextCentury: 'Seuraava vuosisata', - pickHour: 'Valitse tunnit', - incrementHour: 'Vähennä tunteja', - decrementHour: 'Lisää tunteja', - pickMinute: 'Valitse minuutit', - incrementMinute: 'Vähennä minuutteja', - decrementMinute: 'Lisää minuutteja', - pickSecond: 'Valitse sekuntit', - incrementSecond: 'Vähennä sekunteja', - decrementSecond: 'Lisää sekunteja', - toggleMeridiem: 'Vaihda kellonaikaa', - selectTime: 'Valitse aika', - selectDate: 'Valise päivä', - dayViewHeaderFormat: { month: 'long', year: '2-digit' }, - locale: 'fi', - startOfTheWeek: 1, - dateFormats: { - LT: 'HH.mm', - LTS: 'HH.mm.ss', - L: 'dd.MM.yyyy', - LL: 'd. MMMM[ta] yyyy', - LLL: 'd. MMMM[ta] yyyy, [klo] HH.mm', - LLLL: 'dddd, d. MMMM[ta] yyyy, [klo] HH.mm', - }, - ordinal: (n) => `${n}.`, - format: 'L LT', -};exports.localization=localization;exports.name=name;Object.defineProperty(exports,'__esModule',{value:true});})); \ No newline at end of file diff --git a/node_modules/@eonasdan/tempus-dominus/dist/locales/fr.js b/node_modules/@eonasdan/tempus-dominus/dist/locales/fr.js deleted file mode 100644 index 41a9bb7..0000000 --- a/node_modules/@eonasdan/tempus-dominus/dist/locales/fr.js +++ /dev/null @@ -1,50 +0,0 @@ -/*! - * Tempus Dominus v6.7.19 (https://getdatepicker.com/) - * Copyright 2013-2023 Jonathan Peterson - * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) - */ -(function(g,f){typeof exports==='object'&&typeof module!=='undefined'?f(exports):typeof define==='function'&&define.amd?define(['exports'],f):(g=typeof globalThis!=='undefined'?globalThis:g||self,f((g.tempusDominus=g.tempusDominus||{},g.tempusDominus.locales=g.tempusDominus.locales||{},g.tempusDominus.locales.fr={})));})(this,(function(exports){'use strict';const name = 'fr'; -const localization = { - today: "Aujourd'hui", - clear: 'Effacer la sélection', - close: 'Fermer', - selectMonth: 'Sélectionner le mois', - previousMonth: 'Mois précédent', - nextMonth: 'Mois suivant', - selectYear: "Sélectionner l'année", - previousYear: 'Année précédente', - nextYear: 'Année suivante', - selectDecade: 'Sélectionner la décennie', - previousDecade: 'Décennie précédente', - nextDecade: 'Décennie suivante', - previousCentury: 'Siècle précédente', - nextCentury: 'Siècle suivante', - pickHour: "Sélectionner l'heure", - incrementHour: "Incrementer l'heure", - decrementHour: "Diminuer l'heure", - pickMinute: 'Sélectionner les minutes', - incrementMinute: 'Incrementer les minutes', - decrementMinute: 'Diminuer les minutes', - pickSecond: 'Sélectionner les secondes', - incrementSecond: 'Incrementer les secondes', - decrementSecond: 'Diminuer les secondes', - toggleMeridiem: 'Basculer AM-PM', - selectTime: "Sélectionner l'heure", - selectDate: 'Sélectionner une date', - dayViewHeaderFormat: { month: 'long', year: '2-digit' }, - locale: 'fr', - startOfTheWeek: 1, - dateFormats: { - LT: 'HH:mm', - LTS: 'HH:mm:ss', - L: 'dd/MM/yyyy', - LL: 'd MMMM yyyy', - LLL: 'd MMMM yyyy HH:mm', - LLLL: 'dddd d MMMM yyyy HH:mm', - }, - ordinal: (n) => { - const o = n === 1 ? 'er' : ''; - return `${n}${o}`; - }, - format: 'L LT', -};exports.localization=localization;exports.name=name;Object.defineProperty(exports,'__esModule',{value:true});})); \ No newline at end of file diff --git a/node_modules/@eonasdan/tempus-dominus/dist/locales/hy.js b/node_modules/@eonasdan/tempus-dominus/dist/locales/hy.js deleted file mode 100644 index 0168146..0000000 --- a/node_modules/@eonasdan/tempus-dominus/dist/locales/hy.js +++ /dev/null @@ -1,47 +0,0 @@ -/*! - * Tempus Dominus v6.7.19 (https://getdatepicker.com/) - * Copyright 2013-2023 Jonathan Peterson - * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) - */ -(function(g,f){typeof exports==='object'&&typeof module!=='undefined'?f(exports):typeof define==='function'&&define.amd?define(['exports'],f):(g=typeof globalThis!=='undefined'?globalThis:g||self,f((g.tempusDominus=g.tempusDominus||{},g.tempusDominus.locales=g.tempusDominus.locales||{},g.tempusDominus.locales.hy={})));})(this,(function(exports){'use strict';const name = 'hy'; -const localization = { - today: 'Այսօր', - clear: 'Ջնջել ընտրվածը', - close: 'Փակել', - selectMonth: 'Ընտրել ամիս', - previousMonth: 'Նախորդ ամիս', - nextMonth: 'Հաջորդ ամիս', - selectYear: 'Ընտրել տարի', - previousYear: 'Նախորդ տարի', - nextYear: 'Հաջորդ տարի', - selectDecade: 'Ընտրել տասնամյակ', - previousDecade: 'Նախորդ տասնամյակ', - nextDecade: 'Հաջորդ տասնամյակ', - previousCentury: 'Նախորդ դար', - nextCentury: 'Հաջորդ դար', - pickHour: 'Ընտրել ժամ', - incrementHour: 'Ավելացնել ժամ', - decrementHour: 'Նվազեցնել ժամ', - pickMinute: 'Ընտրել րոպե', - incrementMinute: 'Ավելացնել րոպե', - decrementMinute: 'Նվազեցնել րոպե', - pickSecond: 'Ընտրել երկրորդը', - incrementSecond: 'Ավելացնել վայրկյան', - decrementSecond: 'Նվազեցնել վայրկյան', - toggleMeridiem: 'Փոփոխել Ժամանակաշրջանը', - selectTime: 'Ընտրել Ժամ', - selectDate: 'Ընտրել ամսաթիվ', - dayViewHeaderFormat: { month: 'long', year: '2-digit' }, - locale: 'hy', - startOfTheWeek: 1, - dateFormats: { - LT: 'H:mm', - LTS: 'H:mm:ss', - L: 'dd.MM.yyyy', - LL: 'd MMMM yyyy թ.', - LLL: 'd MMMM yyyy թ., H:mm', - LLLL: 'dddd, d MMMM yyyy թ., H:mm', - }, - ordinal: (n) => n, - format: 'L LTS', -};exports.localization=localization;exports.name=name;Object.defineProperty(exports,'__esModule',{value:true});})); \ No newline at end of file diff --git a/node_modules/@eonasdan/tempus-dominus/dist/locales/it.js b/node_modules/@eonasdan/tempus-dominus/dist/locales/it.js deleted file mode 100644 index 4c9d098..0000000 --- a/node_modules/@eonasdan/tempus-dominus/dist/locales/it.js +++ /dev/null @@ -1,47 +0,0 @@ -/*! - * Tempus Dominus v6.7.19 (https://getdatepicker.com/) - * Copyright 2013-2023 Jonathan Peterson - * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) - */ -(function(g,f){typeof exports==='object'&&typeof module!=='undefined'?f(exports):typeof define==='function'&&define.amd?define(['exports'],f):(g=typeof globalThis!=='undefined'?globalThis:g||self,f((g.tempusDominus=g.tempusDominus||{},g.tempusDominus.locales=g.tempusDominus.locales||{},g.tempusDominus.locales.it={})));})(this,(function(exports){'use strict';const name = 'it'; -const localization = { - today: 'Oggi', - clear: 'Cancella selezione', - close: 'Chiudi', - selectMonth: 'Seleziona mese', - previousMonth: 'Mese precedente', - nextMonth: 'Mese successivo', - selectYear: 'Seleziona anno', - previousYear: 'Anno precedente', - nextYear: 'Anno successivo', - selectDecade: 'Seleziona decennio', - previousDecade: 'Decennio precedente', - nextDecade: 'Decennio successivo', - previousCentury: 'Secolo precedente', - nextCentury: 'Secolo successivo', - pickHour: "Seleziona l'ora", - incrementHour: "Incrementa l'ora", - decrementHour: "Decrementa l'ora", - pickMinute: 'Seleziona i minuti', - incrementMinute: 'Incrementa i minuti', - decrementMinute: 'Decrementa i minuti', - pickSecond: 'Seleziona i secondi', - incrementSecond: 'Incrementa i secondi', - decrementSecond: 'Decrementa i secondi', - toggleMeridiem: 'Scambia AM-PM', - selectTime: "Seleziona l'ora", - selectDate: 'Seleziona una data', - dayViewHeaderFormat: { month: 'long', year: '2-digit' }, - locale: 'it', - startOfTheWeek: 1, - dateFormats: { - LT: 'HH:mm', - LTS: 'HH:mm:ss', - L: 'dd/MM/yyyy', - LL: 'd MMMM yyyy', - LLL: 'd MMMM yyyy HH:mm', - LLLL: 'dddd d MMMM yyyy HH:mm', - }, - ordinal: (n) => `${n}º`, - format: 'L LT', -};exports.localization=localization;exports.name=name;Object.defineProperty(exports,'__esModule',{value:true});})); \ No newline at end of file diff --git a/node_modules/@eonasdan/tempus-dominus/dist/locales/nl.js b/node_modules/@eonasdan/tempus-dominus/dist/locales/nl.js deleted file mode 100644 index 523befd..0000000 --- a/node_modules/@eonasdan/tempus-dominus/dist/locales/nl.js +++ /dev/null @@ -1,47 +0,0 @@ -/*! - * Tempus Dominus v6.7.19 (https://getdatepicker.com/) - * Copyright 2013-2023 Jonathan Peterson - * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) - */ -(function(g,f){typeof exports==='object'&&typeof module!=='undefined'?f(exports):typeof define==='function'&&define.amd?define(['exports'],f):(g=typeof globalThis!=='undefined'?globalThis:g||self,f((g.tempusDominus=g.tempusDominus||{},g.tempusDominus.locales=g.tempusDominus.locales||{},g.tempusDominus.locales.nl={})));})(this,(function(exports){'use strict';const name = 'nl'; -const localization = { - today: 'Vandaag', - clear: 'Verwijder selectie', - close: 'Sluit de picker', - selectMonth: 'Selecteer een maand', - previousMonth: 'Vorige maand', - nextMonth: 'Volgende maand', - selectYear: 'Selecteer een jaar', - previousYear: 'Vorige jaar', - nextYear: 'Volgende jaar', - selectDecade: 'Selecteer decennium', - previousDecade: 'Vorige decennium', - nextDecade: 'Volgende decennium', - previousCentury: 'Vorige eeuw', - nextCentury: 'Volgende eeuw', - pickHour: 'Kies een uur', - incrementHour: 'Verhoog uur', - decrementHour: 'Verlaag uur', - pickMinute: 'Kies een minute', - incrementMinute: 'Verhoog minuut', - decrementMinute: 'Verlaag minuut', - pickSecond: 'Kies een seconde', - incrementSecond: 'Verhoog seconde', - decrementSecond: 'Verlaag seconde', - toggleMeridiem: 'Schakel tussen AM/PM', - selectTime: 'Selecteer een tijd', - selectDate: 'Selecteer een datum', - dayViewHeaderFormat: { month: 'long', year: '2-digit' }, - locale: 'nl', - startOfTheWeek: 1, - dateFormats: { - LT: 'HH:mm', - LTS: 'HH:mm:ss', - L: 'dd-MM-yyyy', - LL: 'd MMMM yyyy', - LLL: 'd MMMM yyyy HH:mm', - LLLL: 'dddd d MMMM yyyy HH:mm', - }, - ordinal: (n) => `[${n}${n === 1 || n === 8 || n >= 20 ? 'ste' : 'de'}]`, - format: 'L LT', -};exports.localization=localization;exports.name=name;Object.defineProperty(exports,'__esModule',{value:true});})); \ No newline at end of file diff --git a/node_modules/@eonasdan/tempus-dominus/dist/locales/pl.js b/node_modules/@eonasdan/tempus-dominus/dist/locales/pl.js deleted file mode 100644 index b764c70..0000000 --- a/node_modules/@eonasdan/tempus-dominus/dist/locales/pl.js +++ /dev/null @@ -1,47 +0,0 @@ -/*! - * Tempus Dominus v6.7.19 (https://getdatepicker.com/) - * Copyright 2013-2023 Jonathan Peterson - * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) - */ -(function(g,f){typeof exports==='object'&&typeof module!=='undefined'?f(exports):typeof define==='function'&&define.amd?define(['exports'],f):(g=typeof globalThis!=='undefined'?globalThis:g||self,f((g.tempusDominus=g.tempusDominus||{},g.tempusDominus.locales=g.tempusDominus.locales||{},g.tempusDominus.locales.pl={})));})(this,(function(exports){'use strict';const name = 'pl'; -const localization = { - today: 'Dzisiaj', - clear: 'Wyczyść', - close: 'Zamknij', - selectMonth: 'Wybierz miesiąc', - previousMonth: 'Poprzedni miesiąc', - nextMonth: 'Następny miesiąc', - selectYear: 'Wybierz rok', - previousYear: 'Poprzedni rok', - nextYear: 'Następny rok', - selectDecade: 'Wybierz dekadę', - previousDecade: 'Poprzednia dekada', - nextDecade: 'Następna dekada', - previousCentury: 'Poprzednie stulecie', - nextCentury: 'Następne stulecie', - pickHour: 'Wybierz godzinę', - incrementHour: 'Kolejna godzina', - decrementHour: 'Poprzednia godzina', - pickMinute: 'Wybierz minutę', - incrementMinute: 'Kolejna minuta', - decrementMinute: 'Poprzednia minuta', - pickSecond: 'Wybierz sekundę', - incrementSecond: 'Kolejna sekunda', - decrementSecond: 'Poprzednia sekunda', - toggleMeridiem: 'Przełącz porę dnia', - selectTime: 'Ustaw godzinę', - selectDate: 'Ustaw datę', - dayViewHeaderFormat: { month: 'long', year: '2-digit' }, - locale: 'pl', - startOfTheWeek: 1, - dateFormats: { - LT: 'HH:mm', - LTS: 'HH:mm:ss', - L: 'dd.MM.yyyy', - LL: 'd MMMM yyyy', - LLL: 'd MMMM yyyy HH:mm', - LLLL: 'dddd, d MMMM yyyy HH:mm', - }, - ordinal: (n) => `${n}.`, - format: 'L LT', -};exports.localization=localization;exports.name=name;Object.defineProperty(exports,'__esModule',{value:true});})); \ No newline at end of file diff --git a/node_modules/@eonasdan/tempus-dominus/dist/locales/ro.js b/node_modules/@eonasdan/tempus-dominus/dist/locales/ro.js deleted file mode 100644 index 2cd12ea..0000000 --- a/node_modules/@eonasdan/tempus-dominus/dist/locales/ro.js +++ /dev/null @@ -1,47 +0,0 @@ -/*! - * Tempus Dominus v6.7.19 (https://getdatepicker.com/) - * Copyright 2013-2023 Jonathan Peterson - * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) - */ -(function(g,f){typeof exports==='object'&&typeof module!=='undefined'?f(exports):typeof define==='function'&&define.amd?define(['exports'],f):(g=typeof globalThis!=='undefined'?globalThis:g||self,f((g.tempusDominus=g.tempusDominus||{},g.tempusDominus.locales=g.tempusDominus.locales||{},g.tempusDominus.locales.ro={})));})(this,(function(exports){'use strict';const name = 'ro'; -const localization = { - today: 'Mergi la ziua de astăzi', - clear: 'Șterge selecția', - close: 'Închide calendarul', - selectMonth: 'Selectează luna', - previousMonth: 'Luna precedentă', - nextMonth: 'Luna următoare', - selectYear: 'Selectează anul', - previousYear: 'Anul precedent', - nextYear: 'Anul următor', - selectDecade: 'Selectează deceniul', - previousDecade: 'Deceniul precedent', - nextDecade: 'Deceniul următor', - previousCentury: 'Secolul precedent', - nextCentury: 'Secolul următor', - pickHour: 'Alege ora', - incrementHour: 'Incrementează ora', - decrementHour: 'Decrementează ora', - pickMinute: 'Alege minutul', - incrementMinute: 'Incrementează minutul', - decrementMinute: 'Decrementează minutul', - pickSecond: 'Alege secunda', - incrementSecond: 'Incrementează secunda', - decrementSecond: 'Decrementează secunda', - toggleMeridiem: 'Comută modul AM/PM', - selectTime: 'Selectează ora', - selectDate: 'Selectează data', - dayViewHeaderFormat: { month: 'long', year: '2-digit' }, - locale: 'ro', - startOfTheWeek: 1, - dateFormats: { - LT: 'H:mm', - LTS: 'H:mm:ss', - L: 'dd.MM.yyyy', - LL: 'd MMMM yyyy', - LLL: 'd MMMM yyyy H:mm', - LLLL: 'dddd, d MMMM yyyy H:mm', - }, - ordinal: (n) => n, - format: 'L LT', -};exports.localization=localization;exports.name=name;Object.defineProperty(exports,'__esModule',{value:true});})); \ No newline at end of file diff --git a/node_modules/@eonasdan/tempus-dominus/dist/locales/ru.js b/node_modules/@eonasdan/tempus-dominus/dist/locales/ru.js deleted file mode 100644 index 4fd9040..0000000 --- a/node_modules/@eonasdan/tempus-dominus/dist/locales/ru.js +++ /dev/null @@ -1,47 +0,0 @@ -/*! - * Tempus Dominus v6.7.19 (https://getdatepicker.com/) - * Copyright 2013-2023 Jonathan Peterson - * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) - */ -(function(g,f){typeof exports==='object'&&typeof module!=='undefined'?f(exports):typeof define==='function'&&define.amd?define(['exports'],f):(g=typeof globalThis!=='undefined'?globalThis:g||self,f((g.tempusDominus=g.tempusDominus||{},g.tempusDominus.locales=g.tempusDominus.locales||{},g.tempusDominus.locales.ru={})));})(this,(function(exports){'use strict';const name = 'ru'; -const localization = { - today: 'Перейти сегодня', - clear: 'Очистить выделение', - close: 'Закрыть сборщик', - selectMonth: 'Выбрать месяц', - previousMonth: 'Предыдущий месяц', - nextMonth: 'В следующем месяце', - selectYear: 'Выбрать год', - previousYear: 'Предыдущий год', - nextYear: 'В следующем году', - selectDecade: 'Выбрать десятилетие', - previousDecade: 'Предыдущее десятилетие', - nextDecade: 'Следующее десятилетие', - previousCentury: 'Предыдущий век', - nextCentury: 'Следующий век', - pickHour: 'Выберите час', - incrementHour: 'Время увеличения', - decrementHour: 'Уменьшить час', - pickMinute: 'Выбрать минуту', - incrementMinute: 'Минута приращения', - decrementMinute: 'Уменьшить минуту', - pickSecond: 'Выбрать второй', - incrementSecond: 'Увеличение секунды', - decrementSecond: 'Уменьшение секунды', - toggleMeridiem: 'Переключить период', - selectTime: 'Выбрать время', - selectDate: 'Выбрать дату', - dayViewHeaderFormat: { month: 'long', year: '2-digit' }, - locale: 'ru', - startOfTheWeek: 1, - dateFormats: { - LT: 'H:mm', - LTS: 'H:mm:ss', - L: 'dd.MM.yyyy', - LL: 'd MMMM yyyy г.', - LLL: 'd MMMM yyyy г., H:mm', - LLLL: 'dddd, d MMMM yyyy г., H:mm', - }, - ordinal: (n) => n, - format: 'L LT', -};exports.localization=localization;exports.name=name;Object.defineProperty(exports,'__esModule',{value:true});})); \ No newline at end of file diff --git a/node_modules/@eonasdan/tempus-dominus/dist/locales/sl.js b/node_modules/@eonasdan/tempus-dominus/dist/locales/sl.js deleted file mode 100644 index ac6f6c1..0000000 --- a/node_modules/@eonasdan/tempus-dominus/dist/locales/sl.js +++ /dev/null @@ -1,47 +0,0 @@ -/*! - * Tempus Dominus v6.7.19 (https://getdatepicker.com/) - * Copyright 2013-2023 Jonathan Peterson - * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) - */ -(function(g,f){typeof exports==='object'&&typeof module!=='undefined'?f(exports):typeof define==='function'&&define.amd?define(['exports'],f):(g=typeof globalThis!=='undefined'?globalThis:g||self,f((g.tempusDominus=g.tempusDominus||{},g.tempusDominus.locales=g.tempusDominus.locales||{},g.tempusDominus.locales.sl={})));})(this,(function(exports){'use strict';const name = 'sl'; -const localization = { - today: 'Danes', - clear: 'Počisti', - close: 'Zapri', - selectMonth: 'Izberite mesec', - previousMonth: 'Prejšnji mesec', - nextMonth: 'Naslednji mesec', - selectYear: 'Izberite leto', - previousYear: 'Prejšnje Leto', - nextYear: 'Naslednje leto', - selectDecade: 'Izberite desetletje', - previousDecade: 'Prejšnje desetletje', - nextDecade: 'Naslednje desetletje', - previousCentury: 'Prejšnje stoletje', - nextCentury: 'Naslednje stoletje', - pickHour: 'Izberite uro', - incrementHour: 'Povečaj ure', - decrementHour: 'Zmanjšaj uro', - pickMinute: 'Izberite minuto', - incrementMinute: 'Povečaj minuto', - decrementMinute: 'Zmanjšaj minuto', - pickSecond: 'Izberite drugo', - incrementSecond: 'Povečaj sekundo', - decrementSecond: 'Zmanjšaj sekundo', - toggleMeridiem: 'Preklop dopoldne/popoldne', - selectTime: 'Izberite čas', - selectDate: 'Izberite Datum', - dayViewHeaderFormat: { month: 'long', year: 'numeric' }, - locale: 'sl', - startOfTheWeek: 1, - dateFormats: { - LT: 'H:mm', - LTS: 'H:mm:ss', - L: 'dd.MM.yyyy', - LL: 'd. MMMM yyyy', - LLL: 'd. MMMM yyyy H:mm', - LLLL: 'dddd, d. MMMM yyyy H:mm', - }, - ordinal: (n) => `${n}.`, - format: 'L LT', -};exports.localization=localization;exports.name=name;Object.defineProperty(exports,'__esModule',{value:true});})); \ No newline at end of file diff --git a/node_modules/@eonasdan/tempus-dominus/dist/locales/tr.js b/node_modules/@eonasdan/tempus-dominus/dist/locales/tr.js deleted file mode 100644 index c457138..0000000 --- a/node_modules/@eonasdan/tempus-dominus/dist/locales/tr.js +++ /dev/null @@ -1,47 +0,0 @@ -/*! - * Tempus Dominus v6.7.19 (https://getdatepicker.com/) - * Copyright 2013-2023 Jonathan Peterson - * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) - */ -(function(g,f){typeof exports==='object'&&typeof module!=='undefined'?f(exports):typeof define==='function'&&define.amd?define(['exports'],f):(g=typeof globalThis!=='undefined'?globalThis:g||self,f((g.tempusDominus=g.tempusDominus||{},g.tempusDominus.locales=g.tempusDominus.locales||{},g.tempusDominus.locales.tr={})));})(this,(function(exports){'use strict';const name = 'tr'; -const localization = { - today: 'Bugün', - clear: 'Temizle', - close: 'Kapat', - selectMonth: 'Ay seçin', - previousMonth: 'Önceki Ay', - nextMonth: 'Sonraki Ay', - selectYear: 'Yıl seçin', - previousYear: 'Önceki yıl', - nextYear: 'Sonraki yıl', - selectDecade: 'On yıl seçin', - previousDecade: 'Önceki on yıl', - nextDecade: 'Sonraki on yıl', - previousCentury: 'Önceki yüzyıl', - nextCentury: 'Sonraki yüzyıl', - pickHour: 'Saat seçin', - incrementHour: 'Saati ilerlet', - decrementHour: 'Saati gerilet', - pickMinute: 'Dakika seçin', - incrementMinute: 'Dakikayı ilerlet', - decrementMinute: 'Dakikayı gerilet', - pickSecond: 'Saniye seç', - incrementSecond: 'Saniyeyi ilerlet', - decrementSecond: 'Saniyeyi gerilet', - toggleMeridiem: 'Meridemi Değiştir AM-PM', - selectTime: 'Saat seçin', - selectDate: 'Tarih seçin', - dayViewHeaderFormat: { month: 'long', year: 'numeric' }, - locale: 'tr', - startOfTheWeek: 1, - dateFormats: { - LT: 'HH:mm', - LTS: 'HH:mm:ss', - L: 'dd.MM.yyyy', - LL: 'd MMMM yyyy', - LLL: 'd MMMM yyyy HH:mm', - LLLL: 'dddd, d MMMM yyyy HH:mm', - }, - ordinal: (n) => `${n}.`, - format: 'L LT', -};exports.localization=localization;exports.name=name;Object.defineProperty(exports,'__esModule',{value:true});})); \ No newline at end of file diff --git a/node_modules/@eonasdan/tempus-dominus/dist/plugins/bi-one.js b/node_modules/@eonasdan/tempus-dominus/dist/plugins/bi-one.js deleted file mode 100644 index 44f7b66..0000000 --- a/node_modules/@eonasdan/tempus-dominus/dist/plugins/bi-one.js +++ /dev/null @@ -1,22 +0,0 @@ -/*! - * Tempus Dominus v6.7.19 (https://getdatepicker.com/) - * Copyright 2013-2023 Jonathan Peterson - * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) - */ -(function(g,f){typeof exports==='object'&&typeof module!=='undefined'?f(exports):typeof define==='function'&&define.amd?define(['exports'],f):(g=typeof globalThis!=='undefined'?globalThis:g||self,f((g.tempusDominus=g.tempusDominus||{},g.tempusDominus.plugins=g.tempusDominus.plugins||{},g.tempusDominus.plugins.bi_one={})));})(this,(function(exports){'use strict';// this obviously requires the Bootstrap Icons v1 libraries to be loaded -const biOneIcons = { - type: 'icons', - time: 'bi bi-clock', - date: 'bi bi-calendar-week', - up: 'bi bi-arrow-up', - down: 'bi bi-arrow-down', - previous: 'bi bi-chevron-left', - next: 'bi bi-chevron-right', - today: 'bi bi-calendar-check', - clear: 'bi bi-trash', - close: 'bi bi-x', -}; -// noinspection JSUnusedGlobalSymbols -const load = (_, __, tdFactory) => { - tdFactory.DefaultOptions.display.icons = biOneIcons; -};exports.biOneIcons=biOneIcons;exports.load=load;Object.defineProperty(exports,'__esModule',{value:true});})); \ No newline at end of file diff --git a/node_modules/@eonasdan/tempus-dominus/dist/plugins/customDateFormat.js b/node_modules/@eonasdan/tempus-dominus/dist/plugins/customDateFormat.js deleted file mode 100644 index ab333b4..0000000 --- a/node_modules/@eonasdan/tempus-dominus/dist/plugins/customDateFormat.js +++ /dev/null @@ -1,8 +0,0 @@ -/*! - * Tempus Dominus v6.7.19 (https://getdatepicker.com/) - * Copyright 2013-2023 Jonathan Peterson - * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) - */ -(function(g,f){typeof exports==='object'&&typeof module!=='undefined'?module.exports=f():typeof define==='function'&&define.amd?define(f):(g=typeof globalThis!=='undefined'?globalThis:g||self,(g.tempusDominus=g.tempusDominus||{},g.tempusDominus.plugins=g.tempusDominus.plugins||{},g.tempusDominus.plugins.customDateFormat=f()));})(this,(function(){'use strict';var index = () => { - console.warn('This plugin has been merged with the main picker and is now longer required'); -};return index;})); \ No newline at end of file diff --git a/node_modules/@eonasdan/tempus-dominus/dist/plugins/examples/custom-paint-job.js b/node_modules/@eonasdan/tempus-dominus/dist/plugins/examples/custom-paint-job.js deleted file mode 100644 index 4d369d6..0000000 --- a/node_modules/@eonasdan/tempus-dominus/dist/plugins/examples/custom-paint-job.js +++ /dev/null @@ -1,17 +0,0 @@ -/*! - * Tempus Dominus v6.7.19 (https://getdatepicker.com/) - * Copyright 2013-2023 Jonathan Peterson - * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) - */ -(function(g,f){typeof exports==='object'&&typeof module!=='undefined'?module.exports=f():typeof define==='function'&&define.amd?define(f):(g=typeof globalThis!=='undefined'?globalThis:g||self,(g.tempusDominus=g.tempusDominus||{},g.tempusDominus.plugins=g.tempusDominus.plugins||{},g.tempusDominus.plugins.custom_paint_job=f()));})(this,(function(){'use strict';/* eslint-disable */ -// noinspection JSUnusedGlobalSymbols -var customPaintJob = (option, tdClasses, tdFactory) => { - // noinspection JSUnusedLocalSymbols - tdClasses.Display.prototype.paint = (unit, date, classes, element) => { - if (unit === tdFactory.Unit.date) { - if (date.isSame(new tdFactory.DateTime(), unit)) { - classes.push('special-day'); - } - } - }; -};return customPaintJob;})); \ No newline at end of file diff --git a/node_modules/@eonasdan/tempus-dominus/dist/plugins/examples/sample.js b/node_modules/@eonasdan/tempus-dominus/dist/plugins/examples/sample.js deleted file mode 100644 index b646d4a..0000000 --- a/node_modules/@eonasdan/tempus-dominus/dist/plugins/examples/sample.js +++ /dev/null @@ -1,30 +0,0 @@ -/*! - * Tempus Dominus v6.7.19 (https://getdatepicker.com/) - * Copyright 2013-2023 Jonathan Peterson - * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) - */ -(function(g,f){typeof exports==='object'&&typeof module!=='undefined'?module.exports=f():typeof define==='function'&&define.amd?define(f):(g=typeof globalThis!=='undefined'?globalThis:g||self,(g.tempusDominus=g.tempusDominus||{},g.tempusDominus.plugins=g.tempusDominus.plugins||{},g.tempusDominus.plugins.sample=f()));})(this,(function(){'use strict';// noinspection JSUnusedGlobalSymbols -var sample = (option, tdClasses, tdFactory) => { - // extend the picker - // e.g. add new tempusDominus.TempusDominus(...).someFunction() - tdClasses.TempusDominus.prototype.someFunction = (a, logger) => { - logger = logger || console.log; - logger(a); - }; - // extend tempusDominus - // e.g. add tempusDominus.example() - tdFactory.example = (a, logger) => { - logger = logger || console.log; - logger(a); - }; - // overriding existing API - // e.g. extend new tempusDominus.TempusDominus(...).show() - const oldShow = tdClasses.TempusDominus.prototype.show; - tdClasses.TempusDominus.prototype.show = function (a, logger) { - logger = logger || console.log; - alert('from plugin'); - logger(a); - oldShow.bind(this)(); - // return modified result - }; -};return sample;})); \ No newline at end of file diff --git a/node_modules/@eonasdan/tempus-dominus/dist/plugins/fa-five.js b/node_modules/@eonasdan/tempus-dominus/dist/plugins/fa-five.js deleted file mode 100644 index fa369c8..0000000 --- a/node_modules/@eonasdan/tempus-dominus/dist/plugins/fa-five.js +++ /dev/null @@ -1,22 +0,0 @@ -/*! - * Tempus Dominus v6.7.19 (https://getdatepicker.com/) - * Copyright 2013-2023 Jonathan Peterson - * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) - */ -(function(g,f){typeof exports==='object'&&typeof module!=='undefined'?f(exports):typeof define==='function'&&define.amd?define(['exports'],f):(g=typeof globalThis!=='undefined'?globalThis:g||self,f((g.tempusDominus=g.tempusDominus||{},g.tempusDominus.plugins=g.tempusDominus.plugins||{},g.tempusDominus.plugins.fa_five={})));})(this,(function(exports){'use strict';// this obviously requires the FA 6 libraries to be loaded -const faFiveIcons = { - type: 'icons', - time: 'fas fa-clock', - date: 'fas fa-calendar', - up: 'fas fa-arrow-up', - down: 'fas fa-arrow-down', - previous: 'fas fa-chevron-left', - next: 'fas fa-chevron-right', - today: 'fas fa-calendar-check', - clear: 'fas fa-trash', - close: 'fas fa-times', -}; -// noinspection JSUnusedGlobalSymbols -const load = (_, __, tdFactory) => { - tdFactory.DefaultOptions.display.icons = faFiveIcons; -};exports.faFiveIcons=faFiveIcons;exports.load=load;Object.defineProperty(exports,'__esModule',{value:true});})); \ No newline at end of file diff --git a/node_modules/@eonasdan/tempus-dominus/dist/plugins/moment-parse.js b/node_modules/@eonasdan/tempus-dominus/dist/plugins/moment-parse.js deleted file mode 100644 index 2e0acc2..0000000 --- a/node_modules/@eonasdan/tempus-dominus/dist/plugins/moment-parse.js +++ /dev/null @@ -1,20 +0,0 @@ -/*! - * Tempus Dominus v6.7.19 (https://getdatepicker.com/) - * Copyright 2013-2023 Jonathan Peterson - * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) - */ -(function(g,f){typeof exports==='object'&&typeof module!=='undefined'?module.exports=f():typeof define==='function'&&define.amd?define(f):(g=typeof globalThis!=='undefined'?globalThis:g||self,(g.tempusDominus=g.tempusDominus||{},g.tempusDominus.plugins=g.tempusDominus.plugins||{},g.tempusDominus.plugins.moment_parse=f()));})(this,(function(){'use strict';var index = (option, tdClasses, tdFactory) => { - tdClasses.Dates.prototype.setFromInput = function (value, index) { - const converted = moment(value, option); - if (converted.isValid()) { - const date = tdFactory.DateTime.convert(converted.toDate(), this.optionsStore.options.localization.locale); - this.setValue(date, index); - } - else { - console.warn('Momentjs failed to parse the input date.'); - } - }; - tdClasses.Dates.prototype.formatInput = function (date) { - return moment(date).format(option); - }; -};return index;})); \ No newline at end of file diff --git a/node_modules/@eonasdan/tempus-dominus/package.json b/node_modules/@eonasdan/tempus-dominus/package.json deleted file mode 100644 index ebc3c6f..0000000 --- a/node_modules/@eonasdan/tempus-dominus/package.json +++ /dev/null @@ -1,115 +0,0 @@ -{ - "author": { - "name": "Jonathan Peterson" - }, - "name": "@eonasdan/tempus-dominus", - "version": "6.7.19", - "style": "dist/css/tempus-dominus.css", - "sass": "scss/tempus-dominus.scss", - "main": "dist/js/tempus-dominus.js", - "module": "dist/js/tempus-dominus.esm.js", - "types": "types/tempus-dominus.d.ts", - "files": [ - "dist/**/*", - "src/js/**/*.ts", - "src/js/locales/**/*.ts", - "src/js/plugins/**/*.ts", - "src/scss/**/*.scss", - "types/**/*" - ], - "scripts": { - "start": "npm run build && concurrently \"npm:*-watch\"", - "test": "vitest --ui", - "test:silent": "vitest --run --silent", - "test:coverage": "vitest run --coverage", - "serve": "node ./build/serve.js", - "clean": "node ./build/utilities.js --clean ./dist && node ./build/utilities.js --clean ./types", - "build": "npm run clean && node ./build/utilities.js --copy && npm run rollup && npm run build:declarations && npm run build:plugins-and-locales", - "build:plugins": "node ./build/plugins.js -p", - "build:locales": "node ./build/plugins.js -l", - "build:plugins-and-locales": "node ./build/plugins.js", - "build:declarations": "node ./build/utilities.js --clean ./types && tsc --declaration --emitDeclarationOnly --outDir types", - "sass": "sass src/scss/tempus-dominus.scss ./dist/css/tempus-dominus.css", - "rollup": "rollup -c ./build/rollup.config.js", - "rollup-watch": "rollup -c ./build/rollup.config.js -w", - "docs": "node ./src/docs/make.js", - "docs-watch": "node ./src/docs/make.js --watch", - "release": "npm run eslint && npm run test:silent && npm run build", - "release:version": "npm run release && node build/change-version.js", - "prepare": "husky install", - "prettier": "prettier --ignore-unknown --write .", - "eslint": "npm run prettier && npx eslint --ext .html,.ts ." - }, - "lint-staged": { - "**/*!(.d)/.ts": [ - "npm run eslint" - ], - "**/*": [ - "npm run prettier" - ] - }, - "bugs": { - "url": "https://github.com/eonasdan/tempus-dominus/issues" - }, - "peerDependencies": { - "@popperjs/core": "^2.11.6" - }, - "peerDependenciesMeta": { - "@popperjs/core\"": { - "optional": true - } - }, - "description": "A robust and powerful date/time picker component. For usage, installation and demos see Project Site on GitHub", - "devDependencies": { - "@eonasdan/parvus-server": "^1.1.9", - "@popperjs/core": "^2.11.6", - "@rollup/plugin-node-resolve": "^14.1.0", - "@types/node": "^18.14.2", - "@typescript-eslint/eslint-plugin": "^5.54.0", - "@typescript-eslint/parser": "^5.54.0", - "@vitest/coverage-c8": "^0.29.2", - "@vitest/ui": "^0.29.2", - "bootstrap": "^5.2.3", - "chokidar": "^3.5.3", - "clean-css": "^5.3.2", - "concurrently": "^7.6.0", - "dropcss": "^1.0.16", - "eslint": "^8.35.0", - "eslint-config-prettier": "^8.6.0", - "glob": "^7.2.3", - "globby": "^11.1.0", - "html-minifier-terser": "^5.1.1", - "husky": "^8.0.3", - "jsdom": "^20.0.3", - "lint-staged": "^13.1.2", - "prettier": "^2.8.4", - "rollup": "^2.79.1", - "rollup-plugin-ignore": "^1.0.10", - "rollup-plugin-postcss": "^4.0.2", - "rollup-plugin-terser": "^7.0.2", - "rollup-plugin-ts": "^3.2.0", - "sass": "^1.58.3", - "terser": "^5.16.5", - "tslib": "^2.5.0", - "typescript": "~4.9.5", - "vitest": "^0.29.2", - "vitest-github-actions-reporter": "^0.10.0" - }, - "homepage": "https://getdatepicker.com/", - "keywords": [ - "datepicker", - "datetimepicker", - "timepicker" - ], - "license": "MIT", - "repository": { - "type": "git", - "url": "https://github.com/Eonasdan/tempus-dominus.git" - }, - "wallaby": { - "filesWithNoCoverageCalculated": [ - "test/fixtures/**/*" - ] - }, - "funding": "https://ko-fi.com/eonasdan" -} diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/actions.ts b/node_modules/@eonasdan/tempus-dominus/src/js/actions.ts deleted file mode 100644 index fa18510..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/actions.ts +++ /dev/null @@ -1,379 +0,0 @@ -import { DateTime, Unit } from './datetime'; -import Collapse from './display/collapse'; -import Namespace from './utilities/namespace'; -import Dates from './dates'; -import Validation from './validation'; -import Display from './display'; -import { EventEmitters } from './utilities/event-emitter'; -import { serviceLocator } from './utilities/service-locator.js'; -import ActionTypes from './utilities/action-types'; -import CalendarModes from './utilities/calendar-modes'; -import { OptionsStore } from './utilities/optionsStore'; - -/** - * Logic for various click actions - */ -export default class Actions { - private optionsStore: OptionsStore; - private validation: Validation; - private dates: Dates; - private display: Display; - private _eventEmitters: EventEmitters; - - constructor() { - this.optionsStore = serviceLocator.locate(OptionsStore); - this.dates = serviceLocator.locate(Dates); - this.validation = serviceLocator.locate(Validation); - this.display = serviceLocator.locate(Display); - this._eventEmitters = serviceLocator.locate(EventEmitters); - - this._eventEmitters.action.subscribe((result) => { - this.do(result.e, result.action); - }); - } - - /** - * Performs the selected `action`. See ActionTypes - * @param e This is normally a click event - * @param action If not provided, then look for a [data-action] - */ - //eslint-disable-next-line @typescript-eslint/no-explicit-any - do(e: any, action?: ActionTypes) { - const currentTarget = e?.currentTarget as HTMLElement; - if (currentTarget?.classList?.contains(Namespace.css.disabled)) return; - action = action || (currentTarget?.dataset?.action as ActionTypes); - const lastPicked = (this.dates.lastPicked || this.optionsStore.viewDate) - .clone; - - switch (action) { - case ActionTypes.next: - case ActionTypes.previous: - this.handleNextPrevious(action); - break; - case ActionTypes.changeCalendarView: - this.display._showMode(1); - this.display._updateCalendarHeader(); - break; - case ActionTypes.selectMonth: - case ActionTypes.selectYear: - case ActionTypes.selectDecade: - this.handleSelectCalendarMode(action, currentTarget); - break; - case ActionTypes.selectDay: - this.handleSelectDay(currentTarget); - break; - case ActionTypes.selectHour: { - let hour = +currentTarget.dataset.value; - if (lastPicked.hours >= 12 && this.optionsStore.isTwelveHour) - hour += 12; - lastPicked.hours = hour; - this.dates.setValue(lastPicked, this.dates.lastPickedIndex); - this.hideOrClock(e); - break; - } - case ActionTypes.selectMinute: { - lastPicked.minutes = +currentTarget.dataset.value; - this.dates.setValue(lastPicked, this.dates.lastPickedIndex); - this.hideOrClock(e); - break; - } - case ActionTypes.selectSecond: { - lastPicked.seconds = +currentTarget.dataset.value; - this.dates.setValue(lastPicked, this.dates.lastPickedIndex); - this.hideOrClock(e); - break; - } - case ActionTypes.incrementHours: - this.manipulateAndSet(lastPicked, Unit.hours); - break; - case ActionTypes.incrementMinutes: - this.manipulateAndSet( - lastPicked, - Unit.minutes, - this.optionsStore.options.stepping - ); - break; - case ActionTypes.incrementSeconds: - this.manipulateAndSet(lastPicked, Unit.seconds); - break; - case ActionTypes.decrementHours: - this.manipulateAndSet(lastPicked, Unit.hours, -1); - break; - case ActionTypes.decrementMinutes: - this.manipulateAndSet( - lastPicked, - Unit.minutes, - this.optionsStore.options.stepping * -1 - ); - break; - case ActionTypes.decrementSeconds: - this.manipulateAndSet(lastPicked, Unit.seconds, -1); - break; - case ActionTypes.toggleMeridiem: - this.manipulateAndSet( - lastPicked, - Unit.hours, - this.dates.lastPicked.hours >= 12 ? -12 : 12 - ); - break; - case ActionTypes.togglePicker: - this.handleToggle(currentTarget); - break; - case ActionTypes.showClock: - case ActionTypes.showHours: - case ActionTypes.showMinutes: - case ActionTypes.showSeconds: - //make sure the clock is actually displaying - if ( - !this.optionsStore.options.display.sideBySide && - this.optionsStore.currentView !== 'clock' - ) { - //hide calendar - Collapse.hideImmediately(this.display.dateContainer); - //show clock - Collapse.showImmediately(this.display.timeContainer); - } - this.handleShowClockContainers(action); - break; - case ActionTypes.clear: - this.dates.setValue(null); - this.display._updateCalendarHeader(); - break; - case ActionTypes.close: - this.display.hide(); - break; - case ActionTypes.today: { - const today = new DateTime().setLocalization( - this.optionsStore.options.localization - ); - this._eventEmitters.updateViewDate.emit(today); - - //todo this this really a good idea? - if (this.validation.isValid(today, Unit.date)) - this.dates.setValue(today, this.dates.lastPickedIndex); - break; - } - } - } - - private handleShowClockContainers(action: ActionTypes) { - if (!this.display._hasTime) { - Namespace.errorMessages.throwError( - 'Cannot show clock containers when time is disabled.' - ); - /* ignore coverage: should never happen */ - return; - } - - this.optionsStore.currentView = 'clock'; - this.display.widget - .querySelectorAll(`.${Namespace.css.timeContainer} > div`) - .forEach( - (htmlElement: HTMLElement) => (htmlElement.style.display = 'none') - ); - - let classToUse = ''; - switch (action) { - case ActionTypes.showClock: - classToUse = Namespace.css.clockContainer; - this.display._update('clock'); - break; - case ActionTypes.showHours: - classToUse = Namespace.css.hourContainer; - this.display._update(Unit.hours); - break; - case ActionTypes.showMinutes: - classToUse = Namespace.css.minuteContainer; - this.display._update(Unit.minutes); - break; - case ActionTypes.showSeconds: - classToUse = Namespace.css.secondContainer; - this.display._update(Unit.seconds); - break; - } - - (( - this.display.widget.getElementsByClassName(classToUse)[0] - )).style.display = 'grid'; - } - - private handleNextPrevious(action: ActionTypes) { - const { unit, step } = - CalendarModes[this.optionsStore.currentCalendarViewMode]; - if (action === ActionTypes.next) - this.optionsStore.viewDate.manipulate(step, unit); - else this.optionsStore.viewDate.manipulate(step * -1, unit); - this._eventEmitters.viewUpdate.emit(); - - this.display._showMode(); - } - - /** - * After setting the value it will either show the clock or hide the widget. - * @param e - */ - private hideOrClock(e) { - if ( - !this.optionsStore.isTwelveHour && - !this.optionsStore.options.display.components.minutes && - !this.optionsStore.options.display.keepOpen && - !this.optionsStore.options.display.inline - ) { - this.display.hide(); - } else { - this.do(e, ActionTypes.showClock); - } - } - - /** - * Common function to manipulate {@link lastPicked} by `unit`. - * @param lastPicked - * @param unit - * @param value Value to change by - */ - private manipulateAndSet(lastPicked: DateTime, unit: Unit, value = 1) { - const newDate = lastPicked.manipulate(value, unit); - if (this.validation.isValid(newDate, unit)) { - this.dates.setValue(newDate, this.dates.lastPickedIndex); - } - } - - private handleSelectCalendarMode( - action: - | ActionTypes.selectMonth - | ActionTypes.selectYear - | ActionTypes.selectDecade, - currentTarget: HTMLElement - ) { - const value = +currentTarget.dataset.value; - switch (action) { - case ActionTypes.selectMonth: - this.optionsStore.viewDate.month = value; - break; - case ActionTypes.selectYear: - case ActionTypes.selectDecade: - this.optionsStore.viewDate.year = value; - break; - } - - if ( - this.optionsStore.currentCalendarViewMode === - this.optionsStore.minimumCalendarViewMode - ) { - this.dates.setValue( - this.optionsStore.viewDate, - this.dates.lastPickedIndex - ); - - if (!this.optionsStore.options.display.inline) { - this.display.hide(); - } - } else { - this.display._showMode(-1); - } - } - - private handleToggle(currentTarget: HTMLElement) { - if ( - currentTarget.getAttribute('title') === - this.optionsStore.options.localization.selectDate - ) { - currentTarget.setAttribute( - 'title', - this.optionsStore.options.localization.selectTime - ); - currentTarget.innerHTML = this.display._iconTag( - this.optionsStore.options.display.icons.time - ).outerHTML; - - this.display._updateCalendarHeader(); - this.optionsStore.refreshCurrentView(); - } else { - currentTarget.setAttribute( - 'title', - this.optionsStore.options.localization.selectDate - ); - currentTarget.innerHTML = this.display._iconTag( - this.optionsStore.options.display.icons.date - ).outerHTML; - if (this.display._hasTime) { - this.handleShowClockContainers(ActionTypes.showClock); - this.display._update('clock'); - } - } - - this.display.widget - .querySelectorAll( - `.${Namespace.css.dateContainer}, .${Namespace.css.timeContainer}` - ) - .forEach((htmlElement: HTMLElement) => Collapse.toggle(htmlElement)); - this._eventEmitters.viewUpdate.emit(); - } - - private handleSelectDay(currentTarget: HTMLElement) { - const day = this.optionsStore.viewDate.clone; - if (currentTarget.classList.contains(Namespace.css.old)) { - day.manipulate(-1, Unit.month); - } - if (currentTarget.classList.contains(Namespace.css.new)) { - day.manipulate(1, Unit.month); - } - - day.date = +currentTarget.dataset.day; - if (this.optionsStore.options.dateRange) this.handleDateRange(day); - else if (this.optionsStore.options.multipleDates) { - this.handleMultiDate(day); - } else { - this.dates.setValue(day, this.dates.lastPickedIndex); - } - - if ( - !this.display._hasTime && - !this.optionsStore.options.display.keepOpen && - !this.optionsStore.options.display.inline && - !this.optionsStore.options.multipleDates && - !this.optionsStore.options.dateRange - ) { - this.display.hide(); - } - } - - private handleMultiDate(day: DateTime) { - let index = this.dates.pickedIndex(day, Unit.date); - console.log(index); - if (index !== -1) { - this.dates.setValue(null, index); //deselect multi-date - } else { - index = this.dates.lastPickedIndex + 1; - if (this.dates.picked.length === 0) index = 0; - - this.dates.setValue(day, index); - } - } - - private handleDateRange(day: DateTime) { - switch (this.dates.picked.length) { - case 2: { - this.dates.clear(); - break; - } - case 1: { - const other = this.dates.picked[0]; - if (day.getTime() === other.getTime()) { - this.dates.clear(); - break; - } - if (day.isBefore(other)) { - this.dates.setValue(day, 0); - this.dates.setValue(other, 1); - return; - } else { - this.dates.setValue(day, 1); - return; - } - } - } - - this.dates.setValue(day, 0); - } -} diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/dates.ts b/node_modules/@eonasdan/tempus-dominus/src/js/dates.ts deleted file mode 100644 index cf2fe90..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/dates.ts +++ /dev/null @@ -1,284 +0,0 @@ -import { DateTime, getFormatByUnit, Unit } from './datetime'; -import Namespace from './utilities/namespace'; -import { ChangeEvent, FailEvent } from './utilities/event-types'; -import Validation from './validation'; -import { serviceLocator } from './utilities/service-locator'; -import { EventEmitters } from './utilities/event-emitter'; -import { OptionsStore } from './utilities/optionsStore'; -import { OptionConverter } from './utilities/optionConverter'; - -export default class Dates { - private _dates: DateTime[] = []; - private optionsStore: OptionsStore; - private validation: Validation; - private _eventEmitters: EventEmitters; - - constructor() { - this.optionsStore = serviceLocator.locate(OptionsStore); - this.validation = serviceLocator.locate(Validation); - this._eventEmitters = serviceLocator.locate(EventEmitters); - } - - /** - * Returns the array of selected dates - */ - get picked(): DateTime[] { - return [...this._dates]; - } - - /** - * Returns the last picked value. - */ - get lastPicked(): DateTime { - return this._dates[this.lastPickedIndex]?.clone; - } - - /** - * Returns the length of picked dates -1 or 0 if none are selected. - */ - get lastPickedIndex(): number { - if (this._dates.length === 0) return 0; - return this._dates.length - 1; - } - - /** - * Formats a DateTime object to a string. Used when setting the input value. - * @param date - */ - formatInput(date: DateTime): string { - if (!date) return ''; - date.localization = this.optionsStore.options.localization; - return date.format(); - } - - /** - * parse the value into a DateTime object. - * this can be overwritten to supply your own parsing. - */ - //eslint-disable-next-line @typescript-eslint/no-explicit-any - parseInput(value: any): DateTime { - return OptionConverter.dateConversion( - value, - 'input', - this.optionsStore.options.localization - ); - } - - /** - * Tries to convert the provided value to a DateTime object. - * If value is null|undefined then clear the value of the provided index (or 0). - * @param value Value to convert or null|undefined - * @param index When using multidates this is the index in the array - */ - //eslint-disable-next-line @typescript-eslint/no-explicit-any - setFromInput(value: any, index?: number) { - if (!value) { - this.setValue(undefined, index); - return; - } - const converted = this.parseInput(value); - if (converted) { - converted.setLocalization(this.optionsStore.options.localization); - this.setValue(converted, index); - } - } - - /** - * Adds a new DateTime to selected dates array - * @param date - */ - add(date: DateTime): void { - this._dates.push(date); - } - - /** - * Returns true if the `targetDate` is part of the selected dates array. - * If `unit` is provided then a granularity to that unit will be used. - * @param targetDate - * @param unit - */ - isPicked(targetDate: DateTime, unit?: Unit): boolean { - if (!DateTime.isValid(targetDate)) return false; - if (!unit) - return this._dates.find((x) => x.isSame(targetDate)) !== undefined; - - const format = getFormatByUnit(unit); - - const innerDateFormatted = targetDate.format(format); - - return ( - this._dates - .map((x) => x.format(format)) - .find((x) => x === innerDateFormatted) !== undefined - ); - } - - /** - * Returns the index at which `targetDate` is in the array. - * This is used for updating or removing a date when multi-date is used - * If `unit` is provided then a granularity to that unit will be used. - * @param targetDate - * @param unit - */ - pickedIndex(targetDate: DateTime, unit?: Unit): number { - if (!DateTime.isValid(targetDate)) return -1; - if (!unit) - return this._dates.map((x) => x.valueOf()).indexOf(targetDate.valueOf()); - - const format = getFormatByUnit(unit); - - const innerDateFormatted = targetDate.format(format); - - return this._dates.map((x) => x.format(format)).indexOf(innerDateFormatted); - } - - /** - * Clears all selected dates. - */ - clear() { - this.optionsStore.unset = true; - this._eventEmitters.triggerEvent.emit({ - type: Namespace.events.change, - date: undefined, - oldDate: this.lastPicked, - isClear: true, - isValid: true, - } as ChangeEvent); - this._dates = []; - if (this.optionsStore.input) this.optionsStore.input.value = ''; - this._eventEmitters.updateDisplay.emit('all'); - } - - /** - * Find the "book end" years given a `year` and a `factor` - * @param factor e.g. 100 for decades - * @param year e.g. 2021 - */ - static getStartEndYear( - factor: number, - year: number - ): [number, number, number] { - const step = factor / 10, - startYear = Math.floor(year / factor) * factor, - endYear = startYear + step * 9, - focusValue = Math.floor(year / step) * step; - return [startYear, endYear, focusValue]; - } - - updateInput(target?: DateTime) { - if (!this.optionsStore.input) return; - - let newValue = this.formatInput(target); - if ( - this.optionsStore.options.multipleDates || - this.optionsStore.options.dateRange - ) { - newValue = this._dates - .map((d) => this.formatInput(d)) - .join(this.optionsStore.options.multipleDatesSeparator); - } - if (this.optionsStore.input.value != newValue) - this.optionsStore.input.value = newValue; - } - - /** - * Attempts to either clear or set the `target` date at `index`. - * If the `target` is null then the date will be cleared. - * If multi-date is being used then it will be removed from the array. - * If `target` is valid and multi-date is used then if `index` is - * provided the date at that index will be replaced, otherwise it is appended. - * @param target - * @param index - */ - setValue(target?: DateTime, index?: number): void { - const noIndex = typeof index === 'undefined', - isClear = !target && noIndex; - let oldDate = this.optionsStore.unset ? null : this._dates[index]?.clone; - if (!oldDate && !this.optionsStore.unset && noIndex && isClear) { - oldDate = this.lastPicked; - } - - if (target && oldDate?.isSame(target)) { - this.updateInput(target); - return; - } - - // case of calling setValue(null) - if (!target) { - this._setValueNull(isClear, index, oldDate); - return; - } - - index = index || 0; - target = target.clone; - - // minute stepping is being used, force the minute to the closest value - if (this.optionsStore.options.stepping !== 1) { - target.minutes = - Math.round(target.minutes / this.optionsStore.options.stepping) * - this.optionsStore.options.stepping; - target.startOf(Unit.minutes); - } - - const onUpdate = (isValid: boolean) => { - this._dates[index] = target; - this._eventEmitters.updateViewDate.emit(target.clone); - - this.updateInput(target); - - this.optionsStore.unset = false; - this._eventEmitters.updateDisplay.emit('all'); - this._eventEmitters.triggerEvent.emit({ - type: Namespace.events.change, - date: target, - oldDate, - isClear, - isValid: isValid, - } as ChangeEvent); - }; - - if ( - this.validation.isValid(target) && - this.validation.dateRangeIsValid(this.picked, index, target) - ) { - onUpdate(true); - return; - } - - if (this.optionsStore.options.keepInvalid) { - onUpdate(false); - } - - this._eventEmitters.triggerEvent.emit({ - type: Namespace.events.error, - reason: Namespace.errorMessages.failedToSetInvalidDate, - date: target, - oldDate, - } as FailEvent); - } - - private _setValueNull(isClear: boolean, index: number, oldDate: DateTime) { - if ( - !this.optionsStore.options.multipleDates || - this._dates.length === 1 || - isClear - ) { - this.optionsStore.unset = true; - this._dates = []; - } else { - this._dates.splice(index, 1); - } - - this.updateInput(); - - this._eventEmitters.triggerEvent.emit({ - type: Namespace.events.change, - date: undefined, - oldDate, - isClear, - isValid: true, - } as ChangeEvent); - - this._eventEmitters.updateDisplay.emit('all'); - } -} diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/datetime.ts b/node_modules/@eonasdan/tempus-dominus/src/js/datetime.ts deleted file mode 100644 index fb03a46..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/datetime.ts +++ /dev/null @@ -1,1039 +0,0 @@ -import { FormatLocalization } from './utilities/options'; -import Namespace from './utilities/namespace'; -import DefaultFormatLocalization from './utilities/default-format-localization'; - -type parsedTime = { - afternoon?: boolean; - year?: number; - month?: number; - day?: number; - hours?: number; - minutes?: number; - seconds?: number; - milliseconds?: number; - zone?: { - offset: number; - }; -}; - -export enum Unit { - seconds = 'seconds', - minutes = 'minutes', - hours = 'hours', - date = 'date', - month = 'month', - year = 'year', -} - -const twoDigitTemplate = { - month: '2-digit', - day: '2-digit', - year: 'numeric', - hour: '2-digit', - minute: '2-digit', - second: '2-digit', -}; - -export interface DateTimeFormatOptions extends Intl.DateTimeFormatOptions { - timeStyle?: 'short' | 'medium' | 'long'; - dateStyle?: 'short' | 'medium' | 'long' | 'full'; - numberingSystem?: string; -} - -/** - * Returns an Intl format object based on the provided object - * @param unit - */ -export const getFormatByUnit = (unit: Unit): object => { - switch (unit) { - case 'date': - return { dateStyle: 'short' }; - case 'month': - return { - month: 'numeric', - year: 'numeric', - }; - case 'year': - return { year: 'numeric' }; - } -}; - -/** - * Attempts to guess the hour cycle of the given local - * @param locale - */ -export const guessHourCycle = (locale: string): Intl.LocaleHourCycleKey => { - if (!locale) return 'h12'; - - // noinspection SpellCheckingInspection - const template = { - hour: '2-digit', - minute: '2-digit', - numberingSystem: 'latn', - }; - - const dt = new DateTime().setLocalization({ locale }); - dt.hours = 0; - - const start = dt.parts(undefined, template).hour; - - //midnight is 12 so en-US style 12 AM - if (start === '12') return 'h12'; - //midnight is 24 is from 00-24 - if (start === '24') return 'h24'; - - dt.hours = 23; - const end = dt.parts(undefined, template).hour; - - //if midnight is 00 and hour 23 is 11 then - if (start === '00' && end === '11') return 'h11'; - - if (start === '00' && end === '23') return 'h23'; - - console.warn( - `couldn't determine hour cycle for ${locale}. start: ${start}. end: ${end}` - ); - - return undefined; -}; - -interface FormatMatch { - parser: (obj: parsedTime, input: number) => void; - pattern?: RegExp; -} - -interface FormatMatchString { - parser: (obj: parsedTime, input: string) => void; - pattern?: RegExp; -} - -interface FormatExpression { - t: FormatMatchString; - T: FormatMatchString; - fff: FormatMatch; - s: FormatMatch; - ss: FormatMatch; - m: FormatMatch; - mm: FormatMatch; - H: FormatMatch; - h: FormatMatch; - HH: FormatMatch; - hh: FormatMatch; - d: FormatMatch; - dd: FormatMatch; - Do: FormatMatchString; - M: FormatMatch; - MM: FormatMatch; - MMM: FormatMatchString; - MMMM: FormatMatchString; - y: FormatMatch; - yy: FormatMatch; - yyyy: FormatMatch; -} - -/** - * For the most part this object behaves exactly the same way - * as the native Date object with a little extra spice. - */ -export class DateTime extends Date { - localization: FormatLocalization = DefaultFormatLocalization; - - /** - * Chainable way to set the {@link locale} - * @param value - * @deprecated use setLocalization with a FormatLocalization object instead - */ - setLocale(value: string): this { - if (!this.localization) { - this.localization = DefaultFormatLocalization; - this.localization.locale = value; - } - return this; - } - - /** - * Chainable way to set the {@link localization} - * @param value - */ - setLocalization(value: FormatLocalization): this { - this.localization = value; - return this; - } - - /** - * Converts a plain JS date object to a DateTime object. - * Doing this allows access to format, etc. - * @param date - * @param locale this parameter is deprecated. Use formatLocalization instead. - * @param formatLocalization - */ - static convert( - date: Date, - locale = 'default', - formatLocalization: FormatLocalization = undefined - ): DateTime { - if (!date) throw new Error(`A date is required`); - - if (!formatLocalization) { - formatLocalization = DefaultFormatLocalization; - formatLocalization.locale = locale; - } - - return new DateTime( - date.getFullYear(), - date.getMonth(), - date.getDate(), - date.getHours(), - date.getMinutes(), - date.getSeconds(), - date.getMilliseconds() - ).setLocalization(formatLocalization); - } - - /** - * Native date manipulations are not pure functions. This function creates a duplicate of the DateTime object. - */ - get clone() { - return new DateTime( - this.year, - this.month, - this.date, - this.hours, - this.minutes, - this.seconds, - this.getMilliseconds() - ).setLocalization(this.localization); - } - - static isValid(d): boolean { - if (d === undefined || JSON.stringify(d) === 'null') return false; - if (d.constructor.name === DateTime.name) return true; - return false; - } - - /** - * Sets the current date to the start of the {@link unit} provided - * Example: Consider a date of "April 30, 2021, 11:45:32.984 AM" => new DateTime(2021, 3, 30, 11, 45, 32, 984).startOf('month') - * would return April 1, 2021, 12:00:00.000 AM (midnight) - * @param unit - * @param startOfTheWeek Allows for the changing the start of the week. - */ - startOf(unit: Unit | 'weekDay', startOfTheWeek = 0): this { - if (this[unit] === undefined) - throw new Error(`Unit '${unit}' is not valid`); - switch (unit) { - case 'seconds': - this.setMilliseconds(0); - break; - case 'minutes': - this.setSeconds(0, 0); - break; - case 'hours': - this.setMinutes(0, 0, 0); - break; - case 'date': - this.setHours(0, 0, 0, 0); - break; - case 'weekDay': { - this.startOf(Unit.date); - if (this.weekDay === startOfTheWeek) break; - const goBack = (this.weekDay - startOfTheWeek + 7) % 7; - this.manipulate(goBack * -1, Unit.date); - break; - } - case 'month': - this.startOf(Unit.date); - this.setDate(1); - break; - case 'year': - this.startOf(Unit.date); - this.setMonth(0, 1); - break; - } - return this; - } - - /** - * Sets the current date to the end of the {@link unit} provided - * Example: Consider a date of "April 30, 2021, 11:45:32.984 AM" => new DateTime(2021, 3, 30, 11, 45, 32, 984).endOf('month') - * would return April 30, 2021, 11:59:59.999 PM - * @param unit - * @param startOfTheWeek - */ - endOf(unit: Unit | 'weekDay', startOfTheWeek = 0): this { - if (this[unit] === undefined) - throw new Error(`Unit '${unit}' is not valid`); - switch (unit) { - case 'seconds': - this.setMilliseconds(999); - break; - case 'minutes': - this.setSeconds(59, 999); - break; - case 'hours': - this.setMinutes(59, 59, 999); - break; - case 'date': - this.setHours(23, 59, 59, 999); - break; - case 'weekDay': { - this.endOf(Unit.date); - const endOfWeek = 6 + startOfTheWeek; - if (this.weekDay === endOfWeek) break; - this.manipulate(endOfWeek - this.weekDay, Unit.date); - break; - } - case 'month': - this.endOf(Unit.date); - this.manipulate(1, Unit.month); - this.setDate(0); - break; - case 'year': - this.endOf(Unit.date); - this.setMonth(11, 31); - break; - } - return this; - } - - /** - * Change a {@link unit} value. Value can be positive or negative - * Example: Consider a date of "April 30, 2021, 11:45:32.984 AM" => new DateTime(2021, 3, 30, 11, 45, 32, 984).manipulate(1, 'month') - * would return May 30, 2021, 11:45:32.984 AM - * @param value A positive or negative number - * @param unit - */ - manipulate(value: number, unit: Unit): this { - if (this[unit] === undefined) - throw new Error(`Unit '${unit}' is not valid`); - this[unit] += value; - return this; - } - - /** - * Return true if {@link compare} is before this date - * @param compare The Date/DateTime to compare - * @param unit If provided, uses {@link startOf} for - * comparison. - */ - isBefore(compare: DateTime, unit?: Unit): boolean { - // If the comparisons is undefined, return false - if (!DateTime.isValid(compare)) return false; - - if (!unit) return this.valueOf() < compare.valueOf(); - if (this[unit] === undefined) - throw new Error(`Unit '${unit}' is not valid`); - return ( - this.clone.startOf(unit).valueOf() < compare.clone.startOf(unit).valueOf() - ); - } - - /** - * Return true if {@link compare} is after this date - * @param compare The Date/DateTime to compare - * @param unit If provided, uses {@link startOf} for - * comparison. - */ - isAfter(compare: DateTime, unit?: Unit): boolean { - // If the comparisons is undefined, return false - if (!DateTime.isValid(compare)) return false; - - if (!unit) return this.valueOf() > compare.valueOf(); - if (this[unit] === undefined) - throw new Error(`Unit '${unit}' is not valid`); - return ( - this.clone.startOf(unit).valueOf() > compare.clone.startOf(unit).valueOf() - ); - } - - /** - * Return true if {@link compare} is same this date - * @param compare The Date/DateTime to compare - * @param unit If provided, uses {@link startOf} for - * comparison. - */ - isSame(compare: DateTime, unit?: Unit): boolean { - // If the comparisons is undefined, return false - if (!DateTime.isValid(compare)) return false; - - if (!unit) return this.valueOf() === compare.valueOf(); - if (this[unit] === undefined) - throw new Error(`Unit '${unit}' is not valid`); - compare = DateTime.convert(compare); - return ( - this.clone.startOf(unit).valueOf() === compare.startOf(unit).valueOf() - ); - } - - /** - * Check if this is between two other DateTimes, optionally looking at unit scale. The match is exclusive. - * @param left - * @param right - * @param unit. - * @param inclusivity. A [ indicates inclusion of a value. A ( indicates exclusion. - * If the inclusivity parameter is used, both indicators must be passed. - */ - isBetween( - left: DateTime, - right: DateTime, - unit?: Unit, - inclusivity: '()' | '[]' | '(]' | '[)' = '()' - ): boolean { - // If one of the comparisons is undefined, return false - if (!DateTime.isValid(left) || !DateTime.isValid(right)) return false; - // If a unit is provided and is not a valid property of the DateTime object, throw an error - if (unit && this[unit] === undefined) { - throw new Error(`Unit '${unit}' is not valid`); - } - - const leftInclusivity = inclusivity[0] === '('; - const rightInclusivity = inclusivity[1] === ')'; - - const isLeftInRange = leftInclusivity - ? this.isAfter(left, unit) - : !this.isBefore(left, unit); - const isRightInRange = rightInclusivity - ? this.isBefore(right, unit) - : !this.isAfter(right, unit); - - return isLeftInRange && isRightInRange; - } - - /** - * Returns flattened object of the date. Does not include literals - * @param locale - * @param template - */ - parts( - locale = this.localization.locale, - template: Record = { dateStyle: 'full', timeStyle: 'long' } - ): Record { - const parts = {}; - new Intl.DateTimeFormat(locale, template) - .formatToParts(this) - .filter((x) => x.type !== 'literal') - .forEach((x) => (parts[x.type] = x.value)); - return parts; - } - - /** - * Shortcut to Date.getSeconds() - */ - get seconds(): number { - return this.getSeconds(); - } - - /** - * Shortcut to Date.setSeconds() - */ - set seconds(value: number) { - this.setSeconds(value); - } - - /** - * Returns two digit hours - */ - get secondsFormatted(): string { - return this.parts(undefined, twoDigitTemplate).second; - } - - /** - * Shortcut to Date.getMinutes() - */ - get minutes(): number { - return this.getMinutes(); - } - - /** - * Shortcut to Date.setMinutes() - */ - set minutes(value: number) { - this.setMinutes(value); - } - - /** - * Returns two digit minutes - */ - get minutesFormatted(): string { - return this.parts(undefined, twoDigitTemplate).minute; - } - - /** - * Shortcut to Date.getHours() - */ - get hours(): number { - return this.getHours(); - } - - /** - * Shortcut to Date.setHours() - */ - set hours(value: number) { - this.setHours(value); - } - - /** - * Returns two digit hour, e.g. 01...10 - * @param hourCycle Providing an hour cycle will change 00 to 24 depending on the given value. - */ - getHoursFormatted(hourCycle: Intl.LocaleHourCycleKey = 'h12') { - return this.parts(undefined, { ...twoDigitTemplate, hourCycle: hourCycle }) - .hour; - } - - /** - * Get the meridiem of the date. E.g. AM or PM. - * If the {@link locale} provides a "dayPeriod" then this will be returned, - * otherwise it will return AM or PM. - * @param locale - */ - meridiem(locale: string = this.localization.locale): string { - return new Intl.DateTimeFormat(locale, { - hour: 'numeric', - hour12: true, - }) - .formatToParts(this) - .find((p) => p.type === 'dayPeriod')?.value; - } - - /** - * Shortcut to Date.getDate() - */ - get date(): number { - return this.getDate(); - } - - /** - * Shortcut to Date.setDate() - */ - set date(value: number) { - this.setDate(value); - } - - /** - * Return two digit date - */ - get dateFormatted(): string { - return this.parts(undefined, twoDigitTemplate).day; - } - - /** - * Shortcut to Date.getDay() - */ - get weekDay(): number { - return this.getDay(); - } - - /** - * Shortcut to Date.getMonth() - */ - get month(): number { - return this.getMonth(); - } - - /** - * Shortcut to Date.setMonth() - */ - set month(value: number) { - const targetMonth = new Date(this.year, value + 1); - targetMonth.setDate(0); - const endOfMonth = targetMonth.getDate(); - if (this.date > endOfMonth) { - this.date = endOfMonth; - } - this.setMonth(value); - } - - /** - * Return two digit, human expected month. E.g. January = 1, December = 12 - */ - get monthFormatted(): string { - return this.parts(undefined, twoDigitTemplate).month; - } - - /** - * Shortcut to Date.getFullYear() - */ - get year(): number { - return this.getFullYear(); - } - - /** - * Shortcut to Date.setFullYear() - */ - set year(value: number) { - this.setFullYear(value); - } - - // borrowed a bunch of stuff from Luxon - /** - * Gets the week of the year - */ - get week(): number { - const ordinal = this.computeOrdinal(), - weekday = this.getUTCDay(); - - let weekNumber = Math.floor((ordinal - weekday + 10) / 7); - - if (weekNumber < 1) { - weekNumber = this.weeksInWeekYear(); - } else if (weekNumber > this.weeksInWeekYear()) { - weekNumber = 1; - } - - return weekNumber; - } - - /** - * Returns the number of weeks in the year - */ - weeksInWeekYear() { - const p1 = - (this.year + - Math.floor(this.year / 4) - - Math.floor(this.year / 100) + - Math.floor(this.year / 400)) % - 7, - last = this.year - 1, - p2 = - (last + - Math.floor(last / 4) - - Math.floor(last / 100) + - Math.floor(last / 400)) % - 7; - return p1 === 4 || p2 === 3 ? 53 : 52; - } - - /** - * Returns true or false depending on if the year is a leap year or not. - */ - get isLeapYear() { - return ( - this.year % 4 === 0 && (this.year % 100 !== 0 || this.year % 400 === 0) - ); - } - - private computeOrdinal() { - return ( - this.date + - (this.isLeapYear ? this.leapLadder : this.nonLeapLadder)[this.month] - ); - } - - private nonLeapLadder = [ - 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, - ]; - private leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335]; - - //#region CDF stuff - - private dateTimeRegex = - //is regex cannot be simplified beyond what it already is - /(\[[^[\]]*])|y{1,4}|M{1,4}|d{1,4}|H{1,2}|h{1,2}|t|T|m{1,2}|s{1,2}|f{3}/g; //NOSONAR - - private formattingTokens = - /(\[[^[\]]*])|([-_:/.,()\s]+)|(T|t|yyyy|yy?|MM?M?M?|Do|dd?|hh?|HH?|mm?|ss?)/g; //NOSONAR is regex cannot be simplified beyond what it already is - - /** - * Returns a list of month values based on the current locale - */ - private getAllMonths( - format: '2-digit' | 'numeric' | 'long' | 'short' | 'narrow' = 'long' - ) { - const applyFormat = new Intl.DateTimeFormat(this.localization.locale, { - month: format, - }).format; - return [...Array(12).keys()].map((m) => applyFormat(new Date(2021, m))); - } - - /** - * Replaces an expanded token set (e.g. LT/LTS) - */ - private replaceTokens(formatStr, formats) { - /*** - * _ => match - * a => first capture group. Anything between [ and ] - * b => second capture group - */ - return formatStr.replace( - /(\[[^[\]]*])|(LTS?|l{1,4}|L{1,4})/g, - (_, a, b) => { - const B = b && b.toUpperCase(); - return a || formats[B] || DefaultFormatLocalization.dateFormats[B]; - } - ); - } - - private match2 = /\d\d/; // 00 - 99 - private match3 = /\d{3}/; // 000 - 999 - private match4 = /\d{4}/; // 0000 - 9999 - private match1to2 = /\d\d?/; // 0 - 99 - private matchSigned = /[+-]?\d+/; // -inf - inf - private matchOffset = /[+-]\d\d:?(\d\d)?|Z/; // +00:00 -00:00 +0000 or -0000 +00 or Z - private matchWord = /[^\d_:/,\-()\s]+/; // Word - - private parseTwoDigitYear(input: number) { - return input + (input > 68 ? 1900 : 2000); - } - - private offsetFromString(input: string) { - if (!input) return 0; - if (input === 'Z') return 0; - const [first, second, third] = input.match(/([+-]|\d\d)/g); - const minutes = +second * 60 + (+third || 0); - const signed = first === '+' ? -minutes : minutes; - return minutes === 0 ? 0 : signed; // eslint-disable-line no-nested-ternary - } - - /** - * z = -4, zz = -04, zzz = -0400 - * @param date - * @param style - * @private - */ - private zoneInformation(date: DateTime, style: 'z' | 'zz' | 'zzz') { - let name = date - .parts(this.localization.locale, { timeZoneName: 'longOffset' }) - .timeZoneName.replace('GMT', '') - .replace(':', ''); - - const negative = name.includes('-'); - - name = name.replace('-', ''); - - if (style === 'z') name = name.substring(1, 2); - else if (style === 'zz') name = name.substring(0, 2); - - return `${negative ? '-' : ''}${name}`; - } - - private zoneExpressions = [ - this.matchOffset, - (obj, input) => { - obj.offset = this.offsetFromString(input); - }, - ]; - - private addInput(property) { - return (obj, input) => { - obj[property] = +input; - }; - } - - private getLocaleAfternoon(): string { - return new Intl.DateTimeFormat(this.localization.locale, { - hour: 'numeric', - hour12: true, - }) - .formatToParts(new Date(2022, 3, 4, 13)) - .find((p) => p.type === 'dayPeriod') - ?.value?.replace(/\s+/g, ' '); - } - - private meridiemMatch(input: string) { - return input.toLowerCase() === this.getLocaleAfternoon().toLowerCase(); - } - - private expressions: FormatExpression = { - t: { - pattern: undefined, //this.matchWord, - parser: (obj, input) => { - obj.afternoon = this.meridiemMatch(input); - }, - }, - T: { - pattern: undefined, //this.matchWord, - parser: (obj, input) => { - obj.afternoon = this.meridiemMatch(input); - }, - }, - fff: { - pattern: this.match3, - parser: (obj, input) => { - obj.milliseconds = +input; - }, - }, - s: { - pattern: this.match1to2, - parser: this.addInput('seconds'), - }, - ss: { - pattern: this.match1to2, - parser: this.addInput('seconds'), - }, - m: { - pattern: this.match1to2, - parser: this.addInput('minutes'), - }, - mm: { - pattern: this.match1to2, - parser: this.addInput('minutes'), - }, - H: { - pattern: this.match1to2, - parser: this.addInput('hours'), - }, - h: { - pattern: this.match1to2, - parser: this.addInput('hours'), - }, - HH: { - pattern: this.match1to2, - parser: this.addInput('hours'), - }, - hh: { - pattern: this.match1to2, - parser: this.addInput('hours'), - }, - d: { - pattern: this.match1to2, - parser: this.addInput('day'), - }, - dd: { - pattern: this.match2, - parser: this.addInput('day'), - }, - Do: { - pattern: this.matchWord, - parser: (obj, input) => { - obj.day = +(input.match(/\d+/)[0] || 1); - if (!this.localization.ordinal) return; - for (let i = 1; i <= 31; i += 1) { - if (this.localization.ordinal(i).replace(/[[\]]/g, '') === input) { - obj.day = i; - } - } - }, - }, - M: { - pattern: this.match1to2, - parser: this.addInput('month'), - }, - MM: { - pattern: this.match2, - parser: this.addInput('month'), - }, - MMM: { - pattern: this.matchWord, - parser: (obj, input) => { - const months = this.getAllMonths(); - const monthsShort = this.getAllMonths('short'); - const matchIndex = - (monthsShort || months.map((_) => _.slice(0, 3))).indexOf(input) + 1; - if (matchIndex < 1) { - throw new Error(); - } - obj.month = matchIndex % 12 || matchIndex; - }, - }, - MMMM: { - pattern: this.matchWord, - parser: (obj, input) => { - const months = this.getAllMonths(); - const matchIndex = months.indexOf(input) + 1; - if (matchIndex < 1) { - throw new Error(); - } - obj.month = matchIndex % 12 || matchIndex; - }, - }, - y: { - pattern: this.matchSigned, - parser: this.addInput('year'), - }, - yy: { - pattern: this.match2, - parser: (obj, input) => { - obj.year = this.parseTwoDigitYear(+input); - }, - }, - yyyy: { - pattern: this.match4, - parser: this.addInput('year'), - }, - // z: this.zoneExpressions, - // zz: this.zoneExpressions, - // zzz: this.zoneExpressions - }; - - private correctHours(time) { - const { afternoon } = time; - if (afternoon !== undefined) { - const { hours } = time; - if (afternoon) { - if (hours < 12) { - time.hours += 12; - } - } else if (hours === 12) { - time.hours = 0; - } - delete time.afternoon; - } - } - - private makeParser(format: string) { - format = this.replaceTokens(format, this.localization.dateFormats); - const matchArray = format.match(this.formattingTokens); - const { length } = matchArray; - const expressionArray: (FormatMatch | string)[] = []; - for (let i = 0; i < length; i += 1) { - const token = matchArray[i]; - const expression = this.expressions[token] as FormatMatch; - if (expression?.parser) { - expressionArray[i] = expression; - } else { - expressionArray[i] = (token as string).replace(/^\[[^[\]]*]$/g, ''); - } - } - - return (input: string): parsedTime => { - const time = { - hours: 0, - minutes: 0, - seconds: 0, - milliseconds: 0, - }; - for (let i = 0, start = 0; i < length; i += 1) { - const token = expressionArray[i]; - if (typeof token === 'string') { - start += token.length; - } else { - const part = input.slice(start); - let value = part; - - if (token.pattern) { - const match = token.pattern.exec(part); - value = match[0]; - } - token.parser.call(this, time, value); - input = input.replace(value, ''); - } - } - this.correctHours(time); - return time; - }; - } - - /** - * Attempts to create a DateTime from a string. - * @param input date as string - * @param localization provides the date template the string is in via the format property - */ - //eslint-disable-next-line @typescript-eslint/no-unused-vars - static fromString(input: string, localization: FormatLocalization): DateTime { - if (!localization?.format) { - Namespace.errorMessages.customDateFormatError('No format was provided'); - } - try { - const dt = new DateTime(); - dt.setLocalization(localization); - if (['x', 'X'].indexOf(localization.format) > -1) - return new DateTime((localization.format === 'X' ? 1000 : 1) * +input); - - input = input.replace(/\s+/g, ' '); - const parser = dt.makeParser(localization.format); - const { year, month, day, hours, minutes, seconds, milliseconds, zone } = - parser(input); - const d = day || (!year && !month ? dt.getDate() : 1); - const y = year || dt.getFullYear(); - let M = 0; - if (!(year && !month)) { - M = month > 0 ? month - 1 : dt.getMonth(); - } - if (zone) { - return new DateTime( - Date.UTC( - y, - M, - d, - hours, - minutes, - seconds, - milliseconds + zone.offset * 60 * 1000 - ) - ); - } - return new DateTime(y, M, d, hours, minutes, seconds, milliseconds); - } catch (e) { - Namespace.errorMessages.customDateFormatError( - `Unable to parse provided input: ${input}, format: ${localization.format}` - ); - } - } - - /** - * Returns a string format. - * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat - * for valid templates and locale objects - * @param template An optional object. If provided, method will use Intl., otherwise the localizations format properties - * @param locale Can be a string or an array of strings. Uses browser defaults otherwise. - */ - format( - template?: DateTimeFormatOptions | string, - locale = this.localization.locale - ): string { - if (template && typeof template === 'object') - return new Intl.DateTimeFormat(locale, template).format(this); - - const formatString = this.replaceTokens( - //try template first - template || - //otherwise try localization format - this.localization.format || - //otherwise try date + time - `${DefaultFormatLocalization.dateFormats.L}, ${DefaultFormatLocalization.dateFormats.LT}`, - this.localization.dateFormats - ); - - const formatter = (template) => - new Intl.DateTimeFormat(this.localization.locale, template).format(this); - - if (!this.localization.hourCycle) - this.localization.hourCycle = guessHourCycle(this.localization.locale); - - //if the format asks for a twenty-four-hour string but the hour cycle is not, then make a base guess - const HHCycle = this.localization.hourCycle.startsWith('h1') - ? 'h24' - : this.localization.hourCycle; - const hhCycle = this.localization.hourCycle.startsWith('h2') - ? 'h12' - : this.localization.hourCycle; - - const matches = { - y: this.year, - yy: formatter({ year: '2-digit' }), - yyyy: this.year, - M: formatter({ month: 'numeric' }), - MM: this.monthFormatted, - MMM: this.getAllMonths('short')[this.getMonth()], - MMMM: this.getAllMonths()[this.getMonth()], - d: this.date, - dd: this.dateFormatted, - ddd: formatter({ weekday: 'short' }), - dddd: formatter({ weekday: 'long' }), - H: this.getHours(), - HH: this.getHoursFormatted(HHCycle), - h: this.hours > 12 ? this.hours - 12 : this.hours, - hh: this.getHoursFormatted(hhCycle), - t: this.meridiem(), - T: this.meridiem().toUpperCase(), - m: this.minutes, - mm: this.minutesFormatted, - s: this.seconds, - ss: this.secondsFormatted, - fff: this.getMilliseconds(), - // z: this.zoneInformation(dateTime, 'z'), //-4 - // zz: this.zoneInformation(dateTime, 'zz'), //-04 - // zzz: this.zoneInformation(dateTime, 'zzz') //-0400 - }; - - return formatString - .replace(this.dateTimeRegex, (match, $1) => { - return $1 || matches[match]; - }) - .replace(/\[/g, '') - .replace(/]/g, ''); - } - - //#endregion CDF stuff -} diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/display/calendar/date-display.ts b/node_modules/@eonasdan/tempus-dominus/src/js/display/calendar/date-display.ts deleted file mode 100644 index 01ad586..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/display/calendar/date-display.ts +++ /dev/null @@ -1,338 +0,0 @@ -import { DateTime, Unit } from '../../datetime'; -import Namespace from '../../utilities/namespace'; -import Validation from '../../validation'; -import Dates from '../../dates'; -import { Paint } from '../index'; -import { serviceLocator } from '../../utilities/service-locator'; -import ActionTypes from '../../utilities/action-types'; -import { OptionsStore } from '../../utilities/optionsStore'; - -/** - * Creates and updates the grid for `date` - */ -export default class DateDisplay { - private optionsStore: OptionsStore; - private dates: Dates; - private validation: Validation; - - constructor() { - this.optionsStore = serviceLocator.locate(OptionsStore); - this.dates = serviceLocator.locate(Dates); - this.validation = serviceLocator.locate(Validation); - } - - /** - * Build the container html for the display - * @private - */ - getPicker(): HTMLElement { - const container = document.createElement('div'); - container.classList.add(Namespace.css.daysContainer); - - container.append(...this._daysOfTheWeek()); - - if (this.optionsStore.options.display.calendarWeeks) { - const div = document.createElement('div'); - div.classList.add(Namespace.css.calendarWeeks, Namespace.css.noHighlight); - container.appendChild(div); - } - - const { rangeHoverEvent, rangeHoverOutEvent } = - this.handleMouseEvents(container); - - for (let i = 0; i < 42; i++) { - if (i !== 0 && i % 7 === 0) { - if (this.optionsStore.options.display.calendarWeeks) { - const div = document.createElement('div'); - div.classList.add( - Namespace.css.calendarWeeks, - Namespace.css.noHighlight - ); - container.appendChild(div); - } - } - - const div = document.createElement('div'); - div.setAttribute('data-action', ActionTypes.selectDay); - container.appendChild(div); - - // if hover is supported then add the events - if ( - matchMedia('(hover: hover)').matches && - this.optionsStore.options.dateRange - ) { - div.addEventListener('mouseover', rangeHoverEvent); - div.addEventListener('mouseout', rangeHoverOutEvent); - } - } - - return container; - } - - /** - * Populates the grid and updates enabled states - * @private - */ - _update(widget: HTMLElement, paint: Paint): void { - const container = widget.getElementsByClassName( - Namespace.css.daysContainer - )[0] as HTMLElement; - - this._updateCalendarView(container); - - const innerDate = this.optionsStore.viewDate.clone - .startOf(Unit.month) - .startOf('weekDay', this.optionsStore.options.localization.startOfTheWeek) - .manipulate(12, Unit.hours); - - this._handleCalendarWeeks(container, innerDate.clone); - - container - .querySelectorAll(`[data-action="${ActionTypes.selectDay}"]`) - .forEach((element: HTMLElement) => { - const classes: string[] = []; - classes.push(Namespace.css.day); - - if (innerDate.isBefore(this.optionsStore.viewDate, Unit.month)) { - classes.push(Namespace.css.old); - } - if (innerDate.isAfter(this.optionsStore.viewDate, Unit.month)) { - classes.push(Namespace.css.new); - } - - if ( - !this.optionsStore.unset && - !this.optionsStore.options.dateRange && - this.dates.isPicked(innerDate, Unit.date) - ) { - classes.push(Namespace.css.active); - } - if (!this.validation.isValid(innerDate, Unit.date)) { - classes.push(Namespace.css.disabled); - } - if (innerDate.isSame(new DateTime(), Unit.date)) { - classes.push(Namespace.css.today); - } - if (innerDate.weekDay === 0 || innerDate.weekDay === 6) { - classes.push(Namespace.css.weekend); - } - - this._handleDateRange(innerDate, classes); - - paint(Unit.date, innerDate, classes, element); - - element.classList.remove(...element.classList); - element.classList.add(...classes); - element.setAttribute('data-value', this._dateToDataValue(innerDate)); - element.setAttribute('data-day', `${innerDate.date}`); - element.innerText = innerDate.parts(undefined, { - day: 'numeric', - }).day; - innerDate.manipulate(1, Unit.date); - }); - } - - private _dateToDataValue(date: DateTime): string { - if (!DateTime.isValid(date)) return ''; - - return `${date.year}-${date.monthFormatted}-${date.dateFormatted}`; - } - - private _handleDateRange(innerDate: DateTime, classes: string[]) { - const rangeStart = this.dates.picked[0]; - const rangeEnd = this.dates.picked[1]; - - if (this.optionsStore.options.dateRange) { - if (innerDate.isBetween(rangeStart, rangeEnd, Unit.date)) { - classes.push(Namespace.css.rangeIn); - } - - if (innerDate.isSame(rangeStart, Unit.date)) { - classes.push(Namespace.css.rangeStart); - } - - if (innerDate.isSame(rangeEnd, Unit.date)) { - classes.push(Namespace.css.rangeEnd); - } - } - } - - private handleMouseEvents(container: HTMLElement) { - const rangeHoverEvent = (e: MouseEvent) => { - const currentTarget = e?.currentTarget as HTMLElement; - - // if we have 0 or 2 selected or if the target is disabled then ignore - if ( - this.dates.picked.length !== 1 || - currentTarget.classList.contains(Namespace.css.disabled) - ) - return; - - // select all the date divs - const allDays = [...container.querySelectorAll('.day')] as HTMLElement[]; - - // get the date value from the element being hovered over - const attributeValue = currentTarget.getAttribute('data-value'); - - // format the string to a date - const innerDate = DateTime.fromString(attributeValue, { - format: 'yyyy-MM-dd', - }); - - // find the position of the target in the date container - const dayIndex = allDays.findIndex( - (e) => e.getAttribute('data-value') === attributeValue - ); - - // find the first and second selected dates - const rangeStart = this.dates.picked[0]; - const rangeEnd = this.dates.picked[1]; - - //format the start date so that it can be found by the attribute - const rangeStartFormatted = this._dateToDataValue(rangeStart); - const rangeStartIndex = allDays.findIndex( - (e) => e.getAttribute('data-value') === rangeStartFormatted - ); - const rangeStartElement = allDays[rangeStartIndex]; - - //make sure we don't leave start/end classes if we don't need them - if (!innerDate.isSame(rangeStart, Unit.date)) { - currentTarget.classList.remove(Namespace.css.rangeStart); - } - - if (!innerDate.isSame(rangeEnd, Unit.date)) { - currentTarget.classList.remove(Namespace.css.rangeEnd); - } - - // the following figures out which direct from start date is selected - // the selection "cap" classes are applied if needed - // otherwise all the dates between will get the `rangeIn` class. - // We make this selection based on the element's index and the rangeStart index - - let lambda: (_, index) => boolean; - - if (innerDate.isBefore(rangeStart)) { - currentTarget.classList.add(Namespace.css.rangeStart); - rangeStartElement?.classList.remove(Namespace.css.rangeStart); - rangeStartElement?.classList.add(Namespace.css.rangeEnd); - lambda = (_, index) => index > dayIndex && index < rangeStartIndex; - } else { - currentTarget.classList.add(Namespace.css.rangeEnd); - rangeStartElement?.classList.remove(Namespace.css.rangeEnd); - rangeStartElement?.classList.add(Namespace.css.rangeStart); - lambda = (_, index) => index < dayIndex && index > rangeStartIndex; - } - - allDays.filter(lambda).forEach((e) => { - e.classList.add(Namespace.css.rangeIn); - }); - }; - - const rangeHoverOutEvent = (e: MouseEvent) => { - // find all the dates in the container - const allDays = [...container.querySelectorAll('.day')] as HTMLElement[]; - - // if only the start is selected, remove all the rangeIn classes - // we do this because once the user hovers over a new date the range will be recalculated. - if (this.dates.picked.length === 1) - allDays.forEach((e) => e.classList.remove(Namespace.css.rangeIn)); - - // if we have 0 or 2 dates selected then ignore - if (this.dates.picked.length !== 1) return; - - const currentTarget = e?.currentTarget as HTMLElement; - - // get the elements date from the attribute value - const innerDate = new DateTime(currentTarget.getAttribute('data-value')); - - // verify selections and remove invalid classes - if (!innerDate.isSame(this.dates.picked[0], Unit.date)) { - currentTarget.classList.remove(Namespace.css.rangeStart); - } - - if (!innerDate.isSame(this.dates.picked[1], Unit.date)) { - currentTarget.classList.remove(Namespace.css.rangeEnd); - } - }; - - return { rangeHoverEvent, rangeHoverOutEvent }; - } - - private _updateCalendarView(container: Element) { - if (this.optionsStore.currentView !== 'calendar') return; - const [previous, switcher, next] = container.parentElement - .getElementsByClassName(Namespace.css.calendarHeader)[0] - .getElementsByTagName('div'); - switcher.setAttribute( - Namespace.css.daysContainer, - this.optionsStore.viewDate.format( - this.optionsStore.options.localization.dayViewHeaderFormat - ) - ); - this.optionsStore.options.display.components.month - ? switcher.classList.remove(Namespace.css.disabled) - : switcher.classList.add(Namespace.css.disabled); - this.validation.isValid( - this.optionsStore.viewDate.clone.manipulate(-1, Unit.month), - Unit.month - ) - ? previous.classList.remove(Namespace.css.disabled) - : previous.classList.add(Namespace.css.disabled); - this.validation.isValid( - this.optionsStore.viewDate.clone.manipulate(1, Unit.month), - Unit.month - ) - ? next.classList.remove(Namespace.css.disabled) - : next.classList.add(Namespace.css.disabled); - } - - /*** - * Generates a html row that contains the days of the week. - * @private - */ - private _daysOfTheWeek(): HTMLElement[] { - const innerDate = this.optionsStore.viewDate.clone - .startOf('weekDay', this.optionsStore.options.localization.startOfTheWeek) - .startOf(Unit.date); - const row = []; - document.createElement('div'); - - if (this.optionsStore.options.display.calendarWeeks) { - const htmlDivElement = document.createElement('div'); - htmlDivElement.classList.add( - Namespace.css.calendarWeeks, - Namespace.css.noHighlight - ); - htmlDivElement.innerText = '#'; - row.push(htmlDivElement); - } - - for (let i = 0; i < 7; i++) { - const htmlDivElement = document.createElement('div'); - htmlDivElement.classList.add( - Namespace.css.dayOfTheWeek, - Namespace.css.noHighlight - ); - let weekDay = innerDate.format({ weekday: 'short' }); - if (this.optionsStore.options.localization.maxWeekdayLength > 0) - weekDay = weekDay.substring( - 0, - this.optionsStore.options.localization.maxWeekdayLength - ); - htmlDivElement.innerText = weekDay; - innerDate.manipulate(1, Unit.date); - row.push(htmlDivElement); - } - - return row; - } - - private _handleCalendarWeeks(container: HTMLElement, innerDate: DateTime) { - [...container.querySelectorAll(`.${Namespace.css.calendarWeeks}`)] - .filter((e: HTMLElement) => e.innerText !== '#') - .forEach((element: HTMLElement) => { - element.innerText = `${innerDate.week}`; - innerDate.manipulate(7, Unit.date); - }); - } -} diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/display/calendar/decade-display.ts b/node_modules/@eonasdan/tempus-dominus/src/js/display/calendar/decade-display.ts deleted file mode 100644 index 261e05e..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/display/calendar/decade-display.ts +++ /dev/null @@ -1,130 +0,0 @@ -import Dates from '../../dates'; -import { DateTime, Unit } from '../../datetime'; -import Namespace from '../../utilities/namespace'; -import Validation from '../../validation'; -import { Paint } from '../index'; -import { serviceLocator } from '../../utilities/service-locator'; -import ActionTypes from '../../utilities/action-types'; -import { OptionsStore } from '../../utilities/optionsStore'; - -/** - * Creates and updates the grid for `seconds` - */ -export default class DecadeDisplay { - private _startDecade: DateTime; - private _endDecade: DateTime; - private optionsStore: OptionsStore; - private dates: Dates; - private validation: Validation; - - constructor() { - this.optionsStore = serviceLocator.locate(OptionsStore); - this.dates = serviceLocator.locate(Dates); - this.validation = serviceLocator.locate(Validation); - } - - /** - * Build the container html for the display - * @private - */ - getPicker() { - const container = document.createElement('div'); - container.classList.add(Namespace.css.decadesContainer); - - for (let i = 0; i < 12; i++) { - const div = document.createElement('div'); - div.setAttribute('data-action', ActionTypes.selectDecade); - container.appendChild(div); - } - return container; - } - - /** - * Populates the grid and updates enabled states - * @private - */ - _update(widget: HTMLElement, paint: Paint) { - const [start, end] = Dates.getStartEndYear( - 100, - this.optionsStore.viewDate.year - ); - this._startDecade = this.optionsStore.viewDate.clone.startOf(Unit.year); - this._startDecade.year = start; - this._endDecade = this.optionsStore.viewDate.clone.startOf(Unit.year); - this._endDecade.year = end; - - const container = widget.getElementsByClassName( - Namespace.css.decadesContainer - )[0]; - - const [previous, switcher, next] = container.parentElement - .getElementsByClassName(Namespace.css.calendarHeader)[0] - .getElementsByTagName('div'); - - if (this.optionsStore.currentView === 'decades') { - switcher.setAttribute( - Namespace.css.decadesContainer, - `${this._startDecade.format({ - year: 'numeric', - })}-${this._endDecade.format({ year: 'numeric' })}` - ); - - this.validation.isValid(this._startDecade, Unit.year) - ? previous.classList.remove(Namespace.css.disabled) - : previous.classList.add(Namespace.css.disabled); - this.validation.isValid(this._endDecade, Unit.year) - ? next.classList.remove(Namespace.css.disabled) - : next.classList.add(Namespace.css.disabled); - } - - const pickedYears = this.dates.picked.map((x) => x.year); - - container - .querySelectorAll(`[data-action="${ActionTypes.selectDecade}"]`) - .forEach((containerClone: HTMLElement, index) => { - if (index === 0) { - containerClone.classList.add(Namespace.css.old); - if (this._startDecade.year - 10 < 0) { - containerClone.textContent = ' '; - previous.classList.add(Namespace.css.disabled); - containerClone.classList.add(Namespace.css.disabled); - containerClone.setAttribute('data-value', ''); - return; - } else { - containerClone.innerText = this._startDecade.clone - .manipulate(-10, Unit.year) - .format({ year: 'numeric' }); - containerClone.setAttribute( - 'data-value', - `${this._startDecade.year}` - ); - return; - } - } - - const classes = []; - classes.push(Namespace.css.decade); - const startDecadeYear = this._startDecade.year; - const endDecadeYear = this._startDecade.year + 9; - - if ( - !this.optionsStore.unset && - pickedYears.filter((x) => x >= startDecadeYear && x <= endDecadeYear) - .length > 0 - ) { - classes.push(Namespace.css.active); - } - - paint('decade', this._startDecade, classes, containerClone); - - containerClone.classList.remove(...containerClone.classList); - containerClone.classList.add(...classes); - containerClone.setAttribute('data-value', `${this._startDecade.year}`); - containerClone.innerText = `${this._startDecade.format({ - year: 'numeric', - })}`; - - this._startDecade.manipulate(10, Unit.year); - }); - } -} diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/display/calendar/month-display.ts b/node_modules/@eonasdan/tempus-dominus/src/js/display/calendar/month-display.ts deleted file mode 100644 index 431631e..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/display/calendar/month-display.ts +++ /dev/null @@ -1,105 +0,0 @@ -import { Unit } from '../../datetime'; -import Namespace from '../../utilities/namespace'; -import Validation from '../../validation'; -import Dates from '../../dates'; -import { Paint } from '../index'; -import { serviceLocator } from '../../utilities/service-locator'; -import ActionTypes from '../../utilities/action-types'; -import { OptionsStore } from '../../utilities/optionsStore'; - -/** - * Creates and updates the grid for `month` - */ -export default class MonthDisplay { - private optionsStore: OptionsStore; - private dates: Dates; - private validation: Validation; - - constructor() { - this.optionsStore = serviceLocator.locate(OptionsStore); - this.dates = serviceLocator.locate(Dates); - this.validation = serviceLocator.locate(Validation); - } - /** - * Build the container html for the display - * @private - */ - getPicker(): HTMLElement { - const container = document.createElement('div'); - container.classList.add(Namespace.css.monthsContainer); - - for (let i = 0; i < 12; i++) { - const div = document.createElement('div'); - div.setAttribute('data-action', ActionTypes.selectMonth); - container.appendChild(div); - } - - return container; - } - - /** - * Populates the grid and updates enabled states - * @private - */ - _update(widget: HTMLElement, paint: Paint): void { - const container = widget.getElementsByClassName( - Namespace.css.monthsContainer - )[0]; - - if (this.optionsStore.currentView === 'months') { - const [previous, switcher, next] = container.parentElement - .getElementsByClassName(Namespace.css.calendarHeader)[0] - .getElementsByTagName('div'); - - switcher.setAttribute( - Namespace.css.monthsContainer, - this.optionsStore.viewDate.format({ year: 'numeric' }) - ); - - this.optionsStore.options.display.components.year - ? switcher.classList.remove(Namespace.css.disabled) - : switcher.classList.add(Namespace.css.disabled); - - this.validation.isValid( - this.optionsStore.viewDate.clone.manipulate(-1, Unit.year), - Unit.year - ) - ? previous.classList.remove(Namespace.css.disabled) - : previous.classList.add(Namespace.css.disabled); - - this.validation.isValid( - this.optionsStore.viewDate.clone.manipulate(1, Unit.year), - Unit.year - ) - ? next.classList.remove(Namespace.css.disabled) - : next.classList.add(Namespace.css.disabled); - } - - const innerDate = this.optionsStore.viewDate.clone.startOf(Unit.year); - - container - .querySelectorAll(`[data-action="${ActionTypes.selectMonth}"]`) - .forEach((containerClone: HTMLElement, index) => { - const classes = []; - classes.push(Namespace.css.month); - - if ( - !this.optionsStore.unset && - this.dates.isPicked(innerDate, Unit.month) - ) { - classes.push(Namespace.css.active); - } - if (!this.validation.isValid(innerDate, Unit.month)) { - classes.push(Namespace.css.disabled); - } - - paint(Unit.month, innerDate, classes, containerClone); - - containerClone.classList.remove(...containerClone.classList); - containerClone.classList.add(...classes); - containerClone.setAttribute('data-value', `${index}`); - containerClone.innerText = `${innerDate.format({ month: 'short' })}`; - innerDate.manipulate(1, Unit.month); - }); - } -} diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/display/calendar/year-display.ts b/node_modules/@eonasdan/tempus-dominus/src/js/display/calendar/year-display.ts deleted file mode 100644 index 27e2880..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/display/calendar/year-display.ts +++ /dev/null @@ -1,112 +0,0 @@ -import { DateTime, Unit } from '../../datetime'; -import Namespace from '../../utilities/namespace'; -import Dates from '../../dates'; -import Validation from '../../validation'; -import { Paint } from '../index'; -import { serviceLocator } from '../../utilities/service-locator'; -import ActionTypes from '../../utilities/action-types'; -import { OptionsStore } from '../../utilities/optionsStore'; - -/** - * Creates and updates the grid for `year` - */ -export default class YearDisplay { - private _startYear: DateTime; - private _endYear: DateTime; - private optionsStore: OptionsStore; - private dates: Dates; - private validation: Validation; - - constructor() { - this.optionsStore = serviceLocator.locate(OptionsStore); - this.dates = serviceLocator.locate(Dates); - this.validation = serviceLocator.locate(Validation); - } - - /** - * Build the container html for the display - * @private - */ - getPicker(): HTMLElement { - const container = document.createElement('div'); - container.classList.add(Namespace.css.yearsContainer); - - for (let i = 0; i < 12; i++) { - const div = document.createElement('div'); - div.setAttribute('data-action', ActionTypes.selectYear); - container.appendChild(div); - } - - return container; - } - - /** - * Populates the grid and updates enabled states - * @private - */ - _update(widget: HTMLElement, paint: Paint) { - this._startYear = this.optionsStore.viewDate.clone.manipulate( - -1, - Unit.year - ); - this._endYear = this.optionsStore.viewDate.clone.manipulate(10, Unit.year); - - const container = widget.getElementsByClassName( - Namespace.css.yearsContainer - )[0]; - - if (this.optionsStore.currentView === 'years') { - const [previous, switcher, next] = container.parentElement - .getElementsByClassName(Namespace.css.calendarHeader)[0] - .getElementsByTagName('div'); - - switcher.setAttribute( - Namespace.css.yearsContainer, - `${this._startYear.format({ year: 'numeric' })}-${this._endYear.format({ - year: 'numeric', - })}` - ); - - this.optionsStore.options.display.components.decades - ? switcher.classList.remove(Namespace.css.disabled) - : switcher.classList.add(Namespace.css.disabled); - - this.validation.isValid(this._startYear, Unit.year) - ? previous.classList.remove(Namespace.css.disabled) - : previous.classList.add(Namespace.css.disabled); - this.validation.isValid(this._endYear, Unit.year) - ? next.classList.remove(Namespace.css.disabled) - : next.classList.add(Namespace.css.disabled); - } - - const innerDate = this.optionsStore.viewDate.clone - .startOf(Unit.year) - .manipulate(-1, Unit.year); - - container - .querySelectorAll(`[data-action="${ActionTypes.selectYear}"]`) - .forEach((containerClone: HTMLElement) => { - const classes = []; - classes.push(Namespace.css.year); - - if ( - !this.optionsStore.unset && - this.dates.isPicked(innerDate, Unit.year) - ) { - classes.push(Namespace.css.active); - } - if (!this.validation.isValid(innerDate, Unit.year)) { - classes.push(Namespace.css.disabled); - } - - paint(Unit.year, innerDate, classes, containerClone); - - containerClone.classList.remove(...containerClone.classList); - containerClone.classList.add(...classes); - containerClone.setAttribute('data-value', `${innerDate.year}`); - containerClone.innerText = innerDate.format({ year: 'numeric' }); - - innerDate.manipulate(1, Unit.year); - }); - } -} diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/display/collapse.ts b/node_modules/@eonasdan/tempus-dominus/src/js/display/collapse.ts deleted file mode 100644 index 1a73248..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/display/collapse.ts +++ /dev/null @@ -1,134 +0,0 @@ -import Namespace from '../utilities/namespace'; - -/** - * Provides a collapse functionality to the view changes - */ -export default class Collapse { - /** - * Flips the show/hide state of `target` - * @param target html element to affect. - */ - static toggle(target: HTMLElement) { - if (target.classList.contains(Namespace.css.show)) { - this.hide(target); - } else { - this.show(target); - } - } - - /** - * Skips any animation or timeouts and immediately set the element to show. - * @param target - */ - static showImmediately(target: HTMLElement) { - target.classList.remove(Namespace.css.collapsing); - target.classList.add(Namespace.css.collapse, Namespace.css.show); - target.style.height = ''; - } - - /** - * If `target` is not already showing, then show after the animation. - * @param target - */ - static show(target: HTMLElement) { - if ( - target.classList.contains(Namespace.css.collapsing) || - target.classList.contains(Namespace.css.show) - ) - return; - - let timeOut = null; - const complete = () => { - Collapse.showImmediately(target); - timeOut = null; - }; - - target.style.height = '0'; - target.classList.remove(Namespace.css.collapse); - target.classList.add(Namespace.css.collapsing); - - //eslint-disable-next-line @typescript-eslint/no-unused-vars - timeOut = setTimeout( - complete, - this.getTransitionDurationFromElement(target) - ); - target.style.height = `${target.scrollHeight}px`; - } - - /** - * Skips any animation or timeouts and immediately set the element to hide. - * @param target - */ - static hideImmediately(target: HTMLElement) { - if (!target) return; - target.classList.remove(Namespace.css.collapsing, Namespace.css.show); - target.classList.add(Namespace.css.collapse); - } - - /** - * If `target` is not already hidden, then hide after the animation. - * @param target HTML Element - */ - static hide(target: HTMLElement) { - if ( - target.classList.contains(Namespace.css.collapsing) || - !target.classList.contains(Namespace.css.show) - ) - return; - - let timeOut = null; - const complete = () => { - Collapse.hideImmediately(target); - timeOut = null; - }; - - target.style.height = `${target.getBoundingClientRect()['height']}px`; - - const reflow = (element) => element.offsetHeight; - - reflow(target); - - target.classList.remove(Namespace.css.collapse, Namespace.css.show); - target.classList.add(Namespace.css.collapsing); - target.style.height = ''; - - //eslint-disable-next-line @typescript-eslint/no-unused-vars - timeOut = setTimeout( - complete, - this.getTransitionDurationFromElement(target) - ); - } - - /** - * Gets the transition duration from the `element` by getting css properties - * `transition-duration` and `transition-delay` - * @param element HTML Element - */ - private static getTransitionDurationFromElement = (element: HTMLElement) => { - if (!element) { - return 0; - } - - // Get transition-duration of the element - let { transitionDuration, transitionDelay } = - window.getComputedStyle(element); - - const floatTransitionDuration = Number.parseFloat(transitionDuration); - const floatTransitionDelay = Number.parseFloat(transitionDelay); - - // Return 0 if element or transition duration is not found - if (!floatTransitionDuration && !floatTransitionDelay) { - return 0; - } - - // If multiple durations are defined, take the first - transitionDuration = transitionDuration.split(',')[0]; - transitionDelay = transitionDelay.split(',')[0]; - - return ( - (Number.parseFloat(transitionDuration) + - Number.parseFloat(transitionDelay)) * - 1000 - ); - }; -} diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/display/index.ts b/node_modules/@eonasdan/tempus-dominus/src/js/display/index.ts deleted file mode 100644 index 8e087f1..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/display/index.ts +++ /dev/null @@ -1,849 +0,0 @@ -import DateDisplay from './calendar/date-display'; -import MonthDisplay from './calendar/month-display'; -import YearDisplay from './calendar/year-display'; -import DecadeDisplay from './calendar/decade-display'; -import TimeDisplay from './time/time-display'; -import HourDisplay from './time/hour-display'; -import MinuteDisplay from './time/minute-display'; -import SecondDisplay from './time/second-display'; -import { DateTime, Unit } from '../datetime'; -import Namespace from '../utilities/namespace'; -import { HideEvent } from '../utilities/event-types'; -import Collapse from './collapse'; -import Validation from '../validation'; -import Dates from '../dates'; -import { EventEmitters, ViewUpdateValues } from '../utilities/event-emitter'; -import { serviceLocator } from '../utilities/service-locator'; -import ActionTypes from '../utilities/action-types'; -import CalendarModes from '../utilities/calendar-modes'; -import { OptionsStore } from '../utilities/optionsStore'; - -/** - * Main class for all things display related. - */ -export default class Display { - private _widget: HTMLElement; - private _popperInstance: any; // eslint-disable-line @typescript-eslint/no-explicit-any - private _isVisible = false; - private optionsStore: OptionsStore; - private validation: Validation; - private dates: Dates; - - dateDisplay: DateDisplay; - monthDisplay: MonthDisplay; - yearDisplay: YearDisplay; - decadeDisplay: DecadeDisplay; - timeDisplay: TimeDisplay; - hourDisplay: HourDisplay; - minuteDisplay: MinuteDisplay; - secondDisplay: SecondDisplay; - private _eventEmitters: EventEmitters; - - constructor() { - this.optionsStore = serviceLocator.locate(OptionsStore); - this.validation = serviceLocator.locate(Validation); - this.dates = serviceLocator.locate(Dates); - - this.dateDisplay = serviceLocator.locate(DateDisplay); - this.monthDisplay = serviceLocator.locate(MonthDisplay); - this.yearDisplay = serviceLocator.locate(YearDisplay); - this.decadeDisplay = serviceLocator.locate(DecadeDisplay); - this.timeDisplay = serviceLocator.locate(TimeDisplay); - this.hourDisplay = serviceLocator.locate(HourDisplay); - this.minuteDisplay = serviceLocator.locate(MinuteDisplay); - this.secondDisplay = serviceLocator.locate(SecondDisplay); - this._eventEmitters = serviceLocator.locate(EventEmitters); - this._widget = undefined; - - this._eventEmitters.updateDisplay.subscribe((result: ViewUpdateValues) => { - this._update(result); - }); - } - - /** - * Returns the widget body or undefined - * @private - */ - get widget(): HTMLElement | undefined { - return this._widget; - } - - get dateContainer(): HTMLElement | undefined { - return this.widget?.querySelector(`div.${Namespace.css.dateContainer}`); - } - - get timeContainer(): HTMLElement | undefined { - return this.widget?.querySelector(`div.${Namespace.css.timeContainer}`); - } - - /** - * Returns this visible state of the picker (shown) - */ - get isVisible() { - return this._isVisible; - } - - /** - * Updates the table for a particular unit. Used when an option as changed or - * whenever the class list might need to be refreshed. - * @param unit - * @private - */ - _update(unit: ViewUpdateValues): void { - if (!this.widget) return; - switch (unit) { - case Unit.seconds: - this.secondDisplay._update(this.widget, this.paint); - break; - case Unit.minutes: - this.minuteDisplay._update(this.widget, this.paint); - break; - case Unit.hours: - this.hourDisplay._update(this.widget, this.paint); - break; - case Unit.date: - this.dateDisplay._update(this.widget, this.paint); - break; - case Unit.month: - this.monthDisplay._update(this.widget, this.paint); - break; - case Unit.year: - this.yearDisplay._update(this.widget, this.paint); - break; - case 'decade': - this.decadeDisplay._update(this.widget, this.paint); - break; - case 'clock': - if (!this._hasTime) break; - this.timeDisplay._update(this.widget); - this._update(Unit.hours); - this._update(Unit.minutes); - this._update(Unit.seconds); - break; - case 'calendar': - this._update(Unit.date); - this._update(Unit.year); - this._update(Unit.month); - this.decadeDisplay._update(this.widget, this.paint); - this._updateCalendarHeader(); - break; - case 'all': - if (this._hasTime) { - this._update('clock'); - } - if (this._hasDate) { - this._update('calendar'); - } - } - } - - // noinspection JSUnusedLocalSymbols - /** - * Allows developers to add/remove classes from an element. - * @param _unit - * @param _date - * @param _classes - * @param _element - */ - - /* eslint-disable @typescript-eslint/no-unused-vars */ - paint( - _unit: Unit | 'decade', - _date: DateTime, - _classes: string[], - _element: HTMLElement - ) { - // implemented in plugin - } - - /** - * Shows the picker and creates a Popper instance if needed. - * Add document click event to hide when clicking outside the picker. - * fires Events#show - */ - show(): void { - if (this.widget == undefined) { - this._showSetDefaultIfNeeded(); - - this._buildWidget(); - this._updateTheme(); - - this._showSetupViewMode(); - - if (!this.optionsStore.options.display.inline) { - // If needed to change the parent container - const container = this.optionsStore.options?.container || document.body; - const placement = - this.optionsStore.options?.display?.placement || 'bottom'; - - container.appendChild(this.widget); - this.createPopup(this.optionsStore.element, this.widget, { - modifiers: [{ name: 'eventListeners', enabled: true }], - //#2400 - placement: - document.documentElement.dir === 'rtl' - ? `${placement}-end` - : `${placement}-start`, - }).then(); - } else { - this.optionsStore.element.appendChild(this.widget); - } - - if (this.optionsStore.options.display.viewMode == 'clock') { - this._eventEmitters.action.emit({ - e: null, - action: ActionTypes.showClock, - }); - } - - this.widget - .querySelectorAll('[data-action]') - .forEach((element) => - element.addEventListener('click', this._actionsClickEvent) - ); - - // show the clock when using sideBySide - if (this._hasTime && this.optionsStore.options.display.sideBySide) { - this.timeDisplay._update(this.widget); - ( - this.widget.getElementsByClassName( - Namespace.css.clockContainer - )[0] as HTMLElement - ).style.display = 'grid'; - } - } - - this.widget.classList.add(Namespace.css.show); - if (!this.optionsStore.options.display.inline) { - this.updatePopup(); - document.addEventListener('click', this._documentClickEvent); - } - this._eventEmitters.triggerEvent.emit({ type: Namespace.events.show }); - this._isVisible = true; - } - - private _showSetupViewMode() { - // If modeView is only clock - const onlyClock = this._hasTime && !this._hasDate; - - // reset the view to the clock if there's no date components - if (onlyClock) { - this.optionsStore.currentView = 'clock'; - this._eventEmitters.action.emit({ - e: null, - action: ActionTypes.showClock, - }); - } - // otherwise return to the calendar view - else if (!this.optionsStore.currentCalendarViewMode) { - this.optionsStore.currentCalendarViewMode = - this.optionsStore.minimumCalendarViewMode; - } - - if (!onlyClock && this.optionsStore.options.display.viewMode !== 'clock') { - if (this._hasTime) { - if (!this.optionsStore.options.display.sideBySide) { - Collapse.hideImmediately(this.timeContainer); - } else { - Collapse.show(this.timeContainer); - } - } - Collapse.show(this.dateContainer); - } - - if (this._hasDate) { - this._showMode(); - } - } - - private _showSetDefaultIfNeeded() { - if (this.dates.picked.length != 0) return; - - if ( - this.optionsStore.options.useCurrent && - !this.optionsStore.options.defaultDate - ) { - const date = new DateTime().setLocalization( - this.optionsStore.options.localization - ); - if (!this.optionsStore.options.keepInvalid) { - let tries = 0; - let direction = 1; - if (this.optionsStore.options.restrictions.maxDate?.isBefore(date)) { - direction = -1; - } - while (!this.validation.isValid(date) && tries > 31) { - date.manipulate(direction, Unit.date); - tries++; - } - } - this.dates.setValue(date); - } - - if (this.optionsStore.options.defaultDate) { - this.dates.setValue(this.optionsStore.options.defaultDate); - } - } - - async createPopup( - element: HTMLElement, - widget: HTMLElement, - //eslint-disable-next-line @typescript-eslint/no-explicit-any - options: any - ): Promise { - let createPopperFunction; - //eslint-disable-next-line @typescript-eslint/no-explicit-any - if ((window as any)?.Popper) { - //eslint-disable-next-line @typescript-eslint/no-explicit-any - createPopperFunction = (window as any)?.Popper?.createPopper; - } else { - const { createPopper } = await import('@popperjs/core'); - createPopperFunction = createPopper; - } - if (createPopperFunction) { - this._popperInstance = createPopperFunction(element, widget, options); - } - } - - updatePopup(): void { - this._popperInstance?.update(); - } - - /** - * Changes the calendar view mode. E.g. month <-> year - * @param direction -/+ number to move currentViewMode - * @private - */ - _showMode(direction?: number): void { - if (!this.widget) { - return; - } - if (direction) { - const max = Math.max( - this.optionsStore.minimumCalendarViewMode, - Math.min(3, this.optionsStore.currentCalendarViewMode + direction) - ); - if (this.optionsStore.currentCalendarViewMode == max) return; - this.optionsStore.currentCalendarViewMode = max; - } - - this.widget - .querySelectorAll( - `.${Namespace.css.dateContainer} > div:not(.${Namespace.css.calendarHeader}), .${Namespace.css.timeContainer} > div:not(.${Namespace.css.clockContainer})` - ) - .forEach((e: HTMLElement) => (e.style.display = 'none')); - - const datePickerMode = - CalendarModes[this.optionsStore.currentCalendarViewMode]; - const picker: HTMLElement = this.widget.querySelector( - `.${datePickerMode.className}` - ); - - switch (datePickerMode.className) { - case Namespace.css.decadesContainer: - this.decadeDisplay._update(this.widget, this.paint); - break; - case Namespace.css.yearsContainer: - this.yearDisplay._update(this.widget, this.paint); - break; - case Namespace.css.monthsContainer: - this.monthDisplay._update(this.widget, this.paint); - break; - case Namespace.css.daysContainer: - this.dateDisplay._update(this.widget, this.paint); - break; - } - - picker.style.display = 'grid'; - - if (this.optionsStore.options.display.sideBySide) - (( - this.widget.querySelectorAll(`.${Namespace.css.clockContainer}`)[0] - )).style.display = 'grid'; - - this._updateCalendarHeader(); - this._eventEmitters.viewUpdate.emit(); - } - - /** - * Changes the theme. E.g. light, dark or auto - * @param theme the theme name - * @private - */ - _updateTheme(theme?: 'light' | 'dark' | 'auto'): void { - if (!this.widget) { - return; - } - if (theme) { - if (this.optionsStore.options.display.theme === theme) return; - this.optionsStore.options.display.theme = theme; - } - - this.widget.classList.remove('light', 'dark'); - this.widget.classList.add(this._getThemeClass()); - - if (this.optionsStore.options.display.theme === 'auto') { - window - .matchMedia(Namespace.css.isDarkPreferredQuery) - .addEventListener('change', () => this._updateTheme()); - } else { - window - .matchMedia(Namespace.css.isDarkPreferredQuery) - .removeEventListener('change', () => this._updateTheme()); - } - } - - _getThemeClass(): string { - const currentTheme = this.optionsStore.options.display.theme || 'auto'; - - const isDarkMode = - window.matchMedia && - window.matchMedia(Namespace.css.isDarkPreferredQuery).matches; - - switch (currentTheme) { - case 'light': - return Namespace.css.lightTheme; - case 'dark': - return Namespace.css.darkTheme; - case 'auto': - return isDarkMode ? Namespace.css.darkTheme : Namespace.css.lightTheme; - } - } - - _updateCalendarHeader() { - if (!this._hasDate) return; - const showing = [ - ...this.widget.querySelector( - `.${Namespace.css.dateContainer} div[style*="display: grid"]` - ).classList, - ].find((x) => x.startsWith(Namespace.css.dateContainer)); - - const [previous, switcher, next] = this.widget - .getElementsByClassName(Namespace.css.calendarHeader)[0] - .getElementsByTagName('div'); - - switch (showing) { - case Namespace.css.decadesContainer: - previous.setAttribute( - 'title', - this.optionsStore.options.localization.previousCentury - ); - switcher.setAttribute('title', ''); - next.setAttribute( - 'title', - this.optionsStore.options.localization.nextCentury - ); - break; - case Namespace.css.yearsContainer: - previous.setAttribute( - 'title', - this.optionsStore.options.localization.previousDecade - ); - switcher.setAttribute( - 'title', - this.optionsStore.options.localization.selectDecade - ); - next.setAttribute( - 'title', - this.optionsStore.options.localization.nextDecade - ); - break; - case Namespace.css.monthsContainer: - previous.setAttribute( - 'title', - this.optionsStore.options.localization.previousYear - ); - switcher.setAttribute( - 'title', - this.optionsStore.options.localization.selectYear - ); - next.setAttribute( - 'title', - this.optionsStore.options.localization.nextYear - ); - break; - case Namespace.css.daysContainer: - previous.setAttribute( - 'title', - this.optionsStore.options.localization.previousMonth - ); - switcher.setAttribute( - 'title', - this.optionsStore.options.localization.selectMonth - ); - next.setAttribute( - 'title', - this.optionsStore.options.localization.nextMonth - ); - switcher.setAttribute( - showing, - this.optionsStore.viewDate.format( - this.optionsStore.options.localization.dayViewHeaderFormat - ) - ); - break; - } - switcher.innerText = switcher.getAttribute(showing); - } - - /** - * Hides the picker if needed. - * Remove document click event to hide when clicking outside the picker. - * fires Events#hide - */ - hide(): void { - if (!this.widget || !this._isVisible) return; - - this.widget.classList.remove(Namespace.css.show); - - if (this._isVisible) { - this._eventEmitters.triggerEvent.emit({ - type: Namespace.events.hide, - date: this.optionsStore.unset ? null : this.dates.lastPicked?.clone, - } as HideEvent); - this._isVisible = false; - } - - document.removeEventListener('click', this._documentClickEvent); - } - - /** - * Toggles the picker's open state. Fires a show/hide event depending. - */ - toggle() { - return this._isVisible ? this.hide() : this.show(); - } - - /** - * Removes document and data-action click listener and reset the widget - * @private - */ - _dispose() { - document.removeEventListener('click', this._documentClickEvent); - if (!this.widget) return; - this.widget - .querySelectorAll('[data-action]') - .forEach((element) => - element.removeEventListener('click', this._actionsClickEvent) - ); - this.widget.parentNode.removeChild(this.widget); - this._widget = undefined; - } - - /** - * Builds the widgets html template. - * @private - */ - private _buildWidget(): HTMLElement { - const template = document.createElement('div'); - template.classList.add(Namespace.css.widget); - - const dateView = document.createElement('div'); - dateView.classList.add(Namespace.css.dateContainer); - dateView.append( - this.getHeadTemplate(), - this.decadeDisplay.getPicker(), - this.yearDisplay.getPicker(), - this.monthDisplay.getPicker(), - this.dateDisplay.getPicker() - ); - - const timeView = document.createElement('div'); - timeView.classList.add(Namespace.css.timeContainer); - timeView.appendChild(this.timeDisplay.getPicker(this._iconTag.bind(this))); - timeView.appendChild(this.hourDisplay.getPicker()); - timeView.appendChild(this.minuteDisplay.getPicker()); - timeView.appendChild(this.secondDisplay.getPicker()); - - const toolbar = document.createElement('div'); - toolbar.classList.add(Namespace.css.toolbar); - toolbar.append(...this.getToolbarElements()); - - if (this.optionsStore.options.display.inline) { - template.classList.add(Namespace.css.inline); - } - - if (this.optionsStore.options.display.calendarWeeks) { - template.classList.add('calendarWeeks'); - } - - if (this.optionsStore.options.display.sideBySide && this._hasDateAndTime) { - this._buildWidgetSideBySide(template, dateView, timeView, toolbar); - return; - } - - if (this.optionsStore.options.display.toolbarPlacement === 'top') { - template.appendChild(toolbar); - } - - const setupComponentView = (hasFirst, hasSecond, element, shouldShow) => { - if (!hasFirst) return; - if (hasSecond) { - element.classList.add(Namespace.css.collapse); - if (shouldShow) element.classList.add(Namespace.css.show); - } - template.appendChild(element); - }; - - setupComponentView( - this._hasDate, - this._hasTime, - dateView, - this.optionsStore.options.display.viewMode !== 'clock' - ); - - setupComponentView( - this._hasTime, - this._hasDate, - timeView, - this.optionsStore.options.display.viewMode === 'clock' - ); - - if (this.optionsStore.options.display.toolbarPlacement === 'bottom') { - template.appendChild(toolbar); - } - - const arrow = document.createElement('div'); - arrow.classList.add('arrow'); - arrow.setAttribute('data-popper-arrow', ''); - template.appendChild(arrow); - - this._widget = template; - } - - private _buildWidgetSideBySide( - template: HTMLDivElement, - dateView: HTMLDivElement, - timeView: HTMLDivElement, - toolbar: HTMLDivElement - ) { - template.classList.add(Namespace.css.sideBySide); - if (this.optionsStore.options.display.toolbarPlacement === 'top') { - template.appendChild(toolbar); - } - const row = document.createElement('div'); - row.classList.add('td-row'); - dateView.classList.add('td-half'); - timeView.classList.add('td-half'); - - row.appendChild(dateView); - row.appendChild(timeView); - template.appendChild(row); - if (this.optionsStore.options.display.toolbarPlacement === 'bottom') { - template.appendChild(toolbar); - } - this._widget = template; - } - - /** - * Returns true if the hours, minutes, or seconds component is turned on - */ - get _hasTime(): boolean { - return ( - this.optionsStore.options.display.components.clock && - (this.optionsStore.options.display.components.hours || - this.optionsStore.options.display.components.minutes || - this.optionsStore.options.display.components.seconds) - ); - } - - /** - * Returns true if the year, month, or date component is turned on - */ - get _hasDate(): boolean { - return ( - this.optionsStore.options.display.components.calendar && - (this.optionsStore.options.display.components.year || - this.optionsStore.options.display.components.month || - this.optionsStore.options.display.components.date) - ); - } - - get _hasDateAndTime(): boolean { - return this._hasDate && this._hasTime; - } - - /** - * Get the toolbar html based on options like buttons => today - * @private - */ - getToolbarElements(): HTMLElement[] { - const toolbar = []; - - if (this.optionsStore.options.display.buttons.today) { - const div = document.createElement('div'); - div.setAttribute('data-action', ActionTypes.today); - div.setAttribute('title', this.optionsStore.options.localization.today); - - div.appendChild( - this._iconTag(this.optionsStore.options.display.icons.today) - ); - toolbar.push(div); - } - if ( - !this.optionsStore.options.display.sideBySide && - this._hasDate && - this._hasTime - ) { - let title, icon; - if (this.optionsStore.options.display.viewMode === 'clock') { - title = this.optionsStore.options.localization.selectDate; - icon = this.optionsStore.options.display.icons.date; - } else { - title = this.optionsStore.options.localization.selectTime; - icon = this.optionsStore.options.display.icons.time; - } - - const div = document.createElement('div'); - div.setAttribute('data-action', ActionTypes.togglePicker); - div.setAttribute('title', title); - - div.appendChild(this._iconTag(icon)); - toolbar.push(div); - } - if (this.optionsStore.options.display.buttons.clear) { - const div = document.createElement('div'); - div.setAttribute('data-action', ActionTypes.clear); - div.setAttribute('title', this.optionsStore.options.localization.clear); - - div.appendChild( - this._iconTag(this.optionsStore.options.display.icons.clear) - ); - toolbar.push(div); - } - if (this.optionsStore.options.display.buttons.close) { - const div = document.createElement('div'); - div.setAttribute('data-action', ActionTypes.close); - div.setAttribute('title', this.optionsStore.options.localization.close); - - div.appendChild( - this._iconTag(this.optionsStore.options.display.icons.close) - ); - toolbar.push(div); - } - - return toolbar; - } - - /*** - * Builds the base header template with next and previous icons - * @private - */ - getHeadTemplate(): HTMLElement { - const calendarHeader = document.createElement('div'); - calendarHeader.classList.add(Namespace.css.calendarHeader); - - const previous = document.createElement('div'); - previous.classList.add(Namespace.css.previous); - previous.setAttribute('data-action', ActionTypes.previous); - previous.appendChild( - this._iconTag(this.optionsStore.options.display.icons.previous) - ); - - const switcher = document.createElement('div'); - switcher.classList.add(Namespace.css.switch); - switcher.setAttribute('data-action', ActionTypes.changeCalendarView); - - const next = document.createElement('div'); - next.classList.add(Namespace.css.next); - next.setAttribute('data-action', ActionTypes.next); - next.appendChild( - this._iconTag(this.optionsStore.options.display.icons.next) - ); - - calendarHeader.append(previous, switcher, next); - return calendarHeader; - } - - /** - * Builds an icon tag as either an `` - * or with icons => type is `sprites` then a svg tag instead - * @param iconClass - * @private - */ - _iconTag(iconClass: string): HTMLElement | SVGElement { - if (this.optionsStore.options.display.icons.type === 'sprites') { - const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); - - const icon = document.createElementNS( - 'http://www.w3.org/2000/svg', - 'use' - ); - icon.setAttribute('xlink:href', iconClass); // Deprecated. Included for backward compatibility - icon.setAttribute('href', iconClass); - svg.appendChild(icon); - - return svg; - } - const icon = document.createElement('i'); - icon.classList.add(...iconClass.split(' ')); - return icon; - } - - /** - * A document click event to hide the widget if click is outside - * @private - * @param e MouseEvent - */ - private _documentClickEvent = (e: MouseEvent) => { - if (this.optionsStore.options.debug || (window as any).debug) return; //eslint-disable-line @typescript-eslint/no-explicit-any - - if ( - this._isVisible && - !e.composedPath().includes(this.widget) && // click inside the widget - !e.composedPath()?.includes(this.optionsStore.element) // click on the element - ) { - this.hide(); - } - }; - - /** - * Click event for any action like selecting a date - * @param e MouseEvent - * @private - */ - private _actionsClickEvent = (e: MouseEvent) => { - this._eventEmitters.action.emit({ e: e }); - }; - - /** - * Causes the widget to get rebuilt on next show. If the picker is already open - * then hide and reshow it. - * @private - */ - _rebuild() { - const wasVisible = this._isVisible; - this._dispose(); - if (wasVisible) this.show(); - } - - refreshCurrentView() { - //if the widget is not showing, just destroy it - if (!this._isVisible) this._dispose(); - - switch (this.optionsStore.currentView) { - case 'clock': - this._update('clock'); - break; - case 'calendar': - this._update(Unit.date); - break; - case 'months': - this._update(Unit.month); - break; - case 'years': - this._update(Unit.year); - break; - case 'decades': - this._update('decade'); - break; - } - } -} - -export type Paint = ( - unit: Unit | 'decade', - innerDate: DateTime, - classes: string[], - element: HTMLElement -) => void; diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/display/time/hour-display.ts b/node_modules/@eonasdan/tempus-dominus/src/js/display/time/hour-display.ts deleted file mode 100644 index a43be5d..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/display/time/hour-display.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { Unit } from '../../datetime'; -import Namespace from '../../utilities/namespace'; -import Validation from '../../validation'; -import { serviceLocator } from '../../utilities/service-locator'; -import { Paint } from '../index'; -import ActionTypes from '../../utilities/action-types'; -import { OptionsStore } from '../../utilities/optionsStore'; - -/** - * Creates and updates the grid for `hours` - */ -export default class HourDisplay { - private optionsStore: OptionsStore; - private validation: Validation; - - constructor() { - this.optionsStore = serviceLocator.locate(OptionsStore); - this.validation = serviceLocator.locate(Validation); - } - /** - * Build the container html for the display - * @private - */ - getPicker(): HTMLElement { - const container = document.createElement('div'); - container.classList.add(Namespace.css.hourContainer); - - for (let i = 0; i < (this.optionsStore.isTwelveHour ? 12 : 24); i++) { - const div = document.createElement('div'); - div.setAttribute('data-action', ActionTypes.selectHour); - container.appendChild(div); - } - - return container; - } - - /** - * Populates the grid and updates enabled states - * @private - */ - _update(widget: HTMLElement, paint: Paint): void { - const container = widget.getElementsByClassName( - Namespace.css.hourContainer - )[0]; - const innerDate = this.optionsStore.viewDate.clone.startOf(Unit.date); - - container - .querySelectorAll(`[data-action="${ActionTypes.selectHour}"]`) - .forEach((containerClone: HTMLElement) => { - const classes = []; - classes.push(Namespace.css.hour); - - if (!this.validation.isValid(innerDate, Unit.hours)) { - classes.push(Namespace.css.disabled); - } - - paint(Unit.hours, innerDate, classes, containerClone); - - containerClone.classList.remove(...containerClone.classList); - containerClone.classList.add(...classes); - containerClone.setAttribute('data-value', `${innerDate.hours}`); - containerClone.innerText = innerDate.getHoursFormatted( - this.optionsStore.options.localization.hourCycle - ); - innerDate.manipulate(1, Unit.hours); - }); - } -} diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/display/time/minute-display.ts b/node_modules/@eonasdan/tempus-dominus/src/js/display/time/minute-display.ts deleted file mode 100644 index 483355f..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/display/time/minute-display.ts +++ /dev/null @@ -1,74 +0,0 @@ -import { Unit } from '../../datetime'; -import Namespace from '../../utilities/namespace'; -import Validation from '../../validation'; -import { serviceLocator } from '../../utilities/service-locator'; -import { Paint } from '../index'; -import ActionTypes from '../../utilities/action-types'; -import { OptionsStore } from '../../utilities/optionsStore'; - -/** - * Creates and updates the grid for `minutes` - */ -export default class MinuteDisplay { - private optionsStore: OptionsStore; - private validation: Validation; - - constructor() { - this.optionsStore = serviceLocator.locate(OptionsStore); - this.validation = serviceLocator.locate(Validation); - } - /** - * Build the container html for the display - * @private - */ - getPicker(): HTMLElement { - const container = document.createElement('div'); - container.classList.add(Namespace.css.minuteContainer); - - const step = - this.optionsStore.options.stepping === 1 - ? 5 - : this.optionsStore.options.stepping; - for (let i = 0; i < 60 / step; i++) { - const div = document.createElement('div'); - div.setAttribute('data-action', ActionTypes.selectMinute); - container.appendChild(div); - } - - return container; - } - - /** - * Populates the grid and updates enabled states - * @private - */ - _update(widget: HTMLElement, paint: Paint): void { - const container = widget.getElementsByClassName( - Namespace.css.minuteContainer - )[0]; - const innerDate = this.optionsStore.viewDate.clone.startOf(Unit.hours); - const step = - this.optionsStore.options.stepping === 1 - ? 5 - : this.optionsStore.options.stepping; - - container - .querySelectorAll(`[data-action="${ActionTypes.selectMinute}"]`) - .forEach((containerClone: HTMLElement) => { - const classes = []; - classes.push(Namespace.css.minute); - - if (!this.validation.isValid(innerDate, Unit.minutes)) { - classes.push(Namespace.css.disabled); - } - - paint(Unit.minutes, innerDate, classes, containerClone); - - containerClone.classList.remove(...containerClone.classList); - containerClone.classList.add(...classes); - containerClone.setAttribute('data-value', `${innerDate.minutes}`); - containerClone.innerText = innerDate.minutesFormatted; - innerDate.manipulate(step, Unit.minutes); - }); - } -} diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/display/time/second-display.ts b/node_modules/@eonasdan/tempus-dominus/src/js/display/time/second-display.ts deleted file mode 100644 index 7702d7d..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/display/time/second-display.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { Unit } from '../../datetime'; -import Namespace from '../../utilities/namespace'; -import Validation from '../../validation'; -import { serviceLocator } from '../../utilities/service-locator'; -import { Paint } from '../index'; -import ActionTypes from '../../utilities/action-types'; -import { OptionsStore } from '../../utilities/optionsStore'; - -/** - * Creates and updates the grid for `seconds` - */ -export default class secondDisplay { - private optionsStore: OptionsStore; - private validation: Validation; - - constructor() { - this.optionsStore = serviceLocator.locate(OptionsStore); - this.validation = serviceLocator.locate(Validation); - } - /** - * Build the container html for the display - * @private - */ - getPicker(): HTMLElement { - const container = document.createElement('div'); - container.classList.add(Namespace.css.secondContainer); - - for (let i = 0; i < 12; i++) { - const div = document.createElement('div'); - div.setAttribute('data-action', ActionTypes.selectSecond); - container.appendChild(div); - } - - return container; - } - - /** - * Populates the grid and updates enabled states - * @private - */ - _update(widget: HTMLElement, paint: Paint): void { - const container = widget.getElementsByClassName( - Namespace.css.secondContainer - )[0]; - const innerDate = this.optionsStore.viewDate.clone.startOf(Unit.minutes); - - container - .querySelectorAll(`[data-action="${ActionTypes.selectSecond}"]`) - .forEach((containerClone: HTMLElement) => { - const classes = []; - classes.push(Namespace.css.second); - - if (!this.validation.isValid(innerDate, Unit.seconds)) { - classes.push(Namespace.css.disabled); - } - - paint(Unit.seconds, innerDate, classes, containerClone); - - containerClone.classList.remove(...containerClone.classList); - containerClone.classList.add(...classes); - containerClone.setAttribute('data-value', `${innerDate.seconds}`); - containerClone.innerText = innerDate.secondsFormatted; - innerDate.manipulate(5, Unit.seconds); - }); - } -} diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/display/time/time-display.ts b/node_modules/@eonasdan/tempus-dominus/src/js/display/time/time-display.ts deleted file mode 100644 index d4221a0..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/display/time/time-display.ts +++ /dev/null @@ -1,322 +0,0 @@ -import { Unit } from '../../datetime'; -import Namespace from '../../utilities/namespace'; -import Validation from '../../validation'; -import Dates from '../../dates'; -import { serviceLocator } from '../../utilities/service-locator'; -import ActionTypes from '../../utilities/action-types'; -import { OptionsStore } from '../../utilities/optionsStore'; - -/** - * Creates the clock display - */ -export default class TimeDisplay { - private _gridColumns = ''; - private optionsStore: OptionsStore; - private validation: Validation; - private dates: Dates; - - constructor() { - this.optionsStore = serviceLocator.locate(OptionsStore); - this.dates = serviceLocator.locate(Dates); - this.validation = serviceLocator.locate(Validation); - } - - /** - * Build the container html for the clock display - * @private - */ - getPicker(iconTag: (iconClass: string) => HTMLElement): HTMLElement { - const container = document.createElement('div'); - container.classList.add(Namespace.css.clockContainer); - - container.append(...this._grid(iconTag)); - - return container; - } - - /** - * Populates the various elements with in the clock display - * like the current hour and if the manipulation icons are enabled. - * @private - */ - _update(widget: HTMLElement): void { - const timesDiv = ( - widget.getElementsByClassName(Namespace.css.clockContainer)[0] - ); - let lastPicked = this.dates.lastPicked?.clone; - if (!lastPicked && this.optionsStore.options.useCurrent) - lastPicked = this.optionsStore.viewDate.clone; - - timesDiv - .querySelectorAll('.disabled') - .forEach((element) => element.classList.remove(Namespace.css.disabled)); - - if (this.optionsStore.options.display.components.hours) { - if ( - !this.validation.isValid( - this.optionsStore.viewDate.clone.manipulate(1, Unit.hours), - Unit.hours - ) - ) { - timesDiv - .querySelector(`[data-action=${ActionTypes.incrementHours}]`) - .classList.add(Namespace.css.disabled); - } - - if ( - !this.validation.isValid( - this.optionsStore.viewDate.clone.manipulate(-1, Unit.hours), - Unit.hours - ) - ) { - timesDiv - .querySelector(`[data-action=${ActionTypes.decrementHours}]`) - .classList.add(Namespace.css.disabled); - } - - timesDiv.querySelector( - `[data-time-component=${Unit.hours}]` - ).innerText = lastPicked - ? lastPicked.getHoursFormatted( - this.optionsStore.options.localization.hourCycle - ) - : '--'; - } - - if (this.optionsStore.options.display.components.minutes) { - if ( - !this.validation.isValid( - this.optionsStore.viewDate.clone.manipulate(1, Unit.minutes), - Unit.minutes - ) - ) { - timesDiv - .querySelector(`[data-action=${ActionTypes.incrementMinutes}]`) - .classList.add(Namespace.css.disabled); - } - - if ( - !this.validation.isValid( - this.optionsStore.viewDate.clone.manipulate(-1, Unit.minutes), - Unit.minutes - ) - ) { - timesDiv - .querySelector(`[data-action=${ActionTypes.decrementMinutes}]`) - .classList.add(Namespace.css.disabled); - } - timesDiv.querySelector( - `[data-time-component=${Unit.minutes}]` - ).innerText = lastPicked ? lastPicked.minutesFormatted : '--'; - } - - if (this.optionsStore.options.display.components.seconds) { - if ( - !this.validation.isValid( - this.optionsStore.viewDate.clone.manipulate(1, Unit.seconds), - Unit.seconds - ) - ) { - timesDiv - .querySelector(`[data-action=${ActionTypes.incrementSeconds}]`) - .classList.add(Namespace.css.disabled); - } - - if ( - !this.validation.isValid( - this.optionsStore.viewDate.clone.manipulate(-1, Unit.seconds), - Unit.seconds - ) - ) { - timesDiv - .querySelector(`[data-action=${ActionTypes.decrementSeconds}]`) - .classList.add(Namespace.css.disabled); - } - timesDiv.querySelector( - `[data-time-component=${Unit.seconds}]` - ).innerText = lastPicked ? lastPicked.secondsFormatted : '--'; - } - - if (this.optionsStore.isTwelveHour) { - const toggle = timesDiv.querySelector( - `[data-action=${ActionTypes.toggleMeridiem}]` - ); - - const meridiemDate = (lastPicked || this.optionsStore.viewDate).clone; - - toggle.innerText = meridiemDate.meridiem(); - - if ( - !this.validation.isValid( - meridiemDate.manipulate( - meridiemDate.hours >= 12 ? -12 : 12, - Unit.hours - ) - ) - ) { - toggle.classList.add(Namespace.css.disabled); - } else { - toggle.classList.remove(Namespace.css.disabled); - } - } - - timesDiv.style.gridTemplateAreas = `"${this._gridColumns}"`; - } - - /** - * Creates the table for the clock display depending on what options are selected. - * @private - */ - private _grid(iconTag: (iconClass: string) => HTMLElement): HTMLElement[] { - this._gridColumns = ''; - const top = [], - middle = [], - bottom = [], - separator = document.createElement('div'), - upIcon = iconTag(this.optionsStore.options.display.icons.up), - downIcon = iconTag(this.optionsStore.options.display.icons.down); - - separator.classList.add(Namespace.css.separator, Namespace.css.noHighlight); - const separatorColon = separator.cloneNode(true); - separatorColon.innerHTML = ':'; - - const getSeparator = (colon = false): HTMLElement => { - return colon - ? separatorColon.cloneNode(true) - : separator.cloneNode(true); - }; - - if (this.optionsStore.options.display.components.hours) { - let divElement = document.createElement('div'); - divElement.setAttribute( - 'title', - this.optionsStore.options.localization.incrementHour - ); - divElement.setAttribute('data-action', ActionTypes.incrementHours); - divElement.appendChild(upIcon.cloneNode(true)); - top.push(divElement); - - divElement = document.createElement('div'); - divElement.setAttribute( - 'title', - this.optionsStore.options.localization.pickHour - ); - divElement.setAttribute('data-action', ActionTypes.showHours); - divElement.setAttribute('data-time-component', Unit.hours); - middle.push(divElement); - - divElement = document.createElement('div'); - divElement.setAttribute( - 'title', - this.optionsStore.options.localization.decrementHour - ); - divElement.setAttribute('data-action', ActionTypes.decrementHours); - divElement.appendChild(downIcon.cloneNode(true)); - bottom.push(divElement); - this._gridColumns += 'a'; - } - - if (this.optionsStore.options.display.components.minutes) { - this._gridColumns += ' a'; - if (this.optionsStore.options.display.components.hours) { - top.push(getSeparator()); - middle.push(getSeparator(true)); - bottom.push(getSeparator()); - this._gridColumns += ' a'; - } - let divElement = document.createElement('div'); - divElement.setAttribute( - 'title', - this.optionsStore.options.localization.incrementMinute - ); - divElement.setAttribute('data-action', ActionTypes.incrementMinutes); - divElement.appendChild(upIcon.cloneNode(true)); - top.push(divElement); - - divElement = document.createElement('div'); - divElement.setAttribute( - 'title', - this.optionsStore.options.localization.pickMinute - ); - divElement.setAttribute('data-action', ActionTypes.showMinutes); - divElement.setAttribute('data-time-component', Unit.minutes); - middle.push(divElement); - - divElement = document.createElement('div'); - divElement.setAttribute( - 'title', - this.optionsStore.options.localization.decrementMinute - ); - divElement.setAttribute('data-action', ActionTypes.decrementMinutes); - divElement.appendChild(downIcon.cloneNode(true)); - bottom.push(divElement); - } - - if (this.optionsStore.options.display.components.seconds) { - this._gridColumns += ' a'; - if (this.optionsStore.options.display.components.minutes) { - top.push(getSeparator()); - middle.push(getSeparator(true)); - bottom.push(getSeparator()); - this._gridColumns += ' a'; - } - let divElement = document.createElement('div'); - divElement.setAttribute( - 'title', - this.optionsStore.options.localization.incrementSecond - ); - divElement.setAttribute('data-action', ActionTypes.incrementSeconds); - divElement.appendChild(upIcon.cloneNode(true)); - top.push(divElement); - - divElement = document.createElement('div'); - divElement.setAttribute( - 'title', - this.optionsStore.options.localization.pickSecond - ); - divElement.setAttribute('data-action', ActionTypes.showSeconds); - divElement.setAttribute('data-time-component', Unit.seconds); - middle.push(divElement); - - divElement = document.createElement('div'); - divElement.setAttribute( - 'title', - this.optionsStore.options.localization.decrementSecond - ); - divElement.setAttribute('data-action', ActionTypes.decrementSeconds); - divElement.appendChild(downIcon.cloneNode(true)); - bottom.push(divElement); - } - - if (this.optionsStore.isTwelveHour) { - this._gridColumns += ' a'; - let divElement = getSeparator(); - top.push(divElement); - - const button = document.createElement('button'); - button.setAttribute('type', 'button'); - button.setAttribute( - 'title', - this.optionsStore.options.localization.toggleMeridiem - ); - button.setAttribute('data-action', ActionTypes.toggleMeridiem); - button.setAttribute('tabindex', '-1'); - if (Namespace.css.toggleMeridiem.includes(',')) { - //todo move this to paint function? - button.classList.add(...Namespace.css.toggleMeridiem.split(',')); - } else button.classList.add(Namespace.css.toggleMeridiem); - - divElement = document.createElement('div'); - divElement.classList.add(Namespace.css.noHighlight); - divElement.appendChild(button); - middle.push(divElement); - - divElement = getSeparator(); - bottom.push(divElement); - } - - this._gridColumns = this._gridColumns.trim(); - - return [...top, ...middle, ...bottom]; - } -} diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/locales/ar-SA.ts b/node_modules/@eonasdan/tempus-dominus/src/js/locales/ar-SA.ts deleted file mode 100644 index 419685b..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/locales/ar-SA.ts +++ /dev/null @@ -1,45 +0,0 @@ -const name = 'ar-SA'; - -const localization = { - today: 'اليوم', - clear: 'مسح', - close: 'إغلاق', - selectMonth: 'اختر الشهر', - previousMonth: 'الشهر السابق', - nextMonth: 'الشهر التالي', - selectYear: 'اختر السنة', - previousYear: 'العام السابق', - nextYear: 'العام التالي', - selectDecade: 'اختر العقد', - previousDecade: 'العقد السابق', - nextDecade: 'العقد التالي', - previousCentury: 'القرن السابق', - nextCentury: 'القرن التالي', - pickHour: 'اختر الساعة', - incrementHour: 'أضف ساعة', - decrementHour: 'أنقص ساعة', - pickMinute: 'اختر الدقيقة', - incrementMinute: 'أضف دقيقة', - decrementMinute: 'أنقص دقيقة', - pickSecond: 'اختر الثانية', - incrementSecond: 'أضف ثانية', - decrementSecond: 'أنقص ثانية', - toggleMeridiem: 'تبديل الفترة', - selectTime: 'اخر الوقت', - selectDate: 'اختر التاريخ', - dayViewHeaderFormat: { month: 'long', year: '2-digit' }, - locale: 'ar-SA', - startOfTheWeek: 1, - dateFormats: { - LT: 'HH:mm', - LTS: 'HH:mm:ss', - L: 'dd/MM/yyyy', - LL: 'd MMMM yyyy', - LLL: 'd MMMM yyyy HH:mm', - LLLL: 'dddd d MMMM yyyy HH:mm', - }, - ordinal: (n) => n, - format: 'L LT', -}; - -export { localization, name }; diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/locales/ar.ts b/node_modules/@eonasdan/tempus-dominus/src/js/locales/ar.ts deleted file mode 100644 index 7bb29bc..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/locales/ar.ts +++ /dev/null @@ -1,45 +0,0 @@ -const name = 'ar'; - -const localization = { - today: 'اليوم', - clear: 'مسح', - close: 'إغلاق', - selectMonth: 'اختر الشهر', - previousMonth: 'الشهر السابق', - nextMonth: 'الشهر التالي', - selectYear: 'اختر السنة', - previousYear: 'العام السابق', - nextYear: 'العام التالي', - selectDecade: 'اختر العقد', - previousDecade: 'العقد السابق', - nextDecade: 'العقد التالي', - previousCentury: 'القرن السابق', - nextCentury: 'القرن التالي', - pickHour: 'اختر الساعة', - incrementHour: 'أضف ساعة', - decrementHour: 'أنقص ساعة', - pickMinute: 'اختر الدقيقة', - incrementMinute: 'أضف دقيقة', - decrementMinute: 'أنقص دقيقة', - pickSecond: 'اختر الثانية', - incrementSecond: 'أضف ثانية', - decrementSecond: 'أنقص ثانية', - toggleMeridiem: 'تبديل الفترة', - selectTime: 'اخر الوقت', - selectDate: 'اختر التاريخ', - dayViewHeaderFormat: { month: 'long', year: '2-digit' }, - locale: 'ar', - startOfTheWeek: 1, - dateFormats: { - LT: 'HH:mm', - LTS: 'HH:mm:ss', - L: 'd/M/yyyy', - LL: 'd MMMM yyyy', - LLL: 'd MMMM yyyy HH:mm', - LLLL: 'dddd d MMMM yyyy HH:mm', - }, - ordinal: (n) => n, - format: 'L LT', -}; - -export { localization, name }; diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/locales/ca.ts b/node_modules/@eonasdan/tempus-dominus/src/js/locales/ca.ts deleted file mode 100644 index a43ed25..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/locales/ca.ts +++ /dev/null @@ -1,45 +0,0 @@ -const name = 'ca'; - -const localization = { - today: 'Avui', - clear: 'Esborrar selecció', - close: 'Tancar selector', - selectMonth: 'Seleccionar mes', - previousMonth: 'Mes anterior', - nextMonth: 'Pròxim mes', - selectYear: 'Seleccionar any', - previousYear: 'Any anterior', - nextYear: 'Pròxim any', - selectDecade: 'Seleccionar dècada', - previousDecade: 'Dècada anterior', - nextDecade: 'Pròxima dècada', - previousCentury: 'Segle anterior', - nextCentury: 'Pròxim segle', - pickHour: 'Escollir hora', - incrementHour: 'Incrementar hora', - decrementHour: 'Decrementar hora', - pickMinute: 'Escollir minut', - incrementMinute: 'Incrementar minut', - decrementMinute: 'Decrementar minut', - pickSecond: 'Escollir segon', - incrementSecond: 'Incrementar segon', - decrementSecond: 'Decrementar segon', - toggleMeridiem: 'Canviar AM/PM', - selectTime: 'Seleccionar temps', - selectDate: 'Seleccionar data', - dayViewHeaderFormat: { month: 'long', year: '2-digit' }, - startOfTheWeek: 1, - locale: 'ca', - dateFormats: { - LT: 'H:mm', - LTS: 'H:mm:ss', - L: 'dd/MM/yyyy', - LL: 'd [de] MMMM [de] yyyy', - LLL: 'd [de] MMMM [de] yyyy H:mm', - LLLL: 'dddd, d [de] MMMM [de] yyyy H:mm', - }, - ordinal: (n) => `${n}º`, - format: 'L LT', -}; - -export { localization, name }; diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/locales/cs.ts b/node_modules/@eonasdan/tempus-dominus/src/js/locales/cs.ts deleted file mode 100644 index ce56fea..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/locales/cs.ts +++ /dev/null @@ -1,45 +0,0 @@ -const name = 'cs'; - -const localization = { - today: 'Dnes', - clear: 'Vymazat výběr', - close: 'Zavřít výběrové okno', - selectMonth: 'Vybrat měsíc', - previousMonth: 'Předchozí měsíc', - nextMonth: 'Následující měsíc', - selectYear: 'Vybrat rok', - previousYear: 'Předchozí rok', - nextYear: 'Následující rok', - selectDecade: 'Vybrat desetiletí', - previousDecade: 'Předchozí desetiletí', - nextDecade: 'Následující desetiletí', - previousCentury: 'Předchozí století', - nextCentury: 'Následující století', - pickHour: 'Vybrat hodinu', - incrementHour: 'Zvýšit hodinu', - decrementHour: 'Snížit hodinu', - pickMinute: 'Vybrat minutu', - incrementMinute: 'Zvýšit minutu', - decrementMinute: 'Snížit minutu', - pickSecond: 'Vybrat sekundu', - incrementSecond: 'Zvýšit sekundu', - decrementSecond: 'Snížit sekundu', - toggleMeridiem: 'Přepnout ráno / odpoledne', - selectTime: 'Vybrat čas', - selectDate: 'Vybrat datum', - dayViewHeaderFormat: { month: 'long', year: '2-digit' }, - locale: 'de', - startOfTheWeek: 1, - dateFormats: { - LTS: 'HH:mm:ss', - LT: 'HH:mm', - L: 'dd.MM.yyyy', - LL: 'd. MMMM yyyy', - LLL: 'd. MMMM yyyy HH:mm', - LLLL: 'dddd, d. MMMM yyyy HH:mm', - }, - ordinal: (n) => `${n}.`, - format: 'L LT', -}; - -export { localization, name }; diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/locales/de.ts b/node_modules/@eonasdan/tempus-dominus/src/js/locales/de.ts deleted file mode 100644 index 6bd9d3e..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/locales/de.ts +++ /dev/null @@ -1,45 +0,0 @@ -const name = 'de'; - -const localization = { - today: 'Heute', - clear: 'Auswahl löschen', - close: 'Auswahlbox schließen', - selectMonth: 'Monat wählen', - previousMonth: 'Letzter Monat', - nextMonth: 'Nächster Monat', - selectYear: 'Jahr wählen', - previousYear: 'Letztes Jahr', - nextYear: 'Nächstes Jahr', - selectDecade: 'Jahrzehnt wählen', - previousDecade: 'Letztes Jahrzehnt', - nextDecade: 'Nächstes Jahrzehnt', - previousCentury: 'Letztes Jahrhundert', - nextCentury: 'Nächstes Jahrhundert', - pickHour: 'Stunde wählen', - incrementHour: 'Stunde erhöhen', - decrementHour: 'Stunde verringern', - pickMinute: 'Minute wählen', - incrementMinute: 'Minute erhöhen', - decrementMinute: 'Minute verringern', - pickSecond: 'Sekunde wählen', - incrementSecond: 'Sekunde erhöhen', - decrementSecond: 'Sekunde verringern', - toggleMeridiem: 'Tageszeit umschalten', - selectTime: 'Zeit wählen', - selectDate: 'Datum wählen', - dayViewHeaderFormat: { month: 'long', year: '2-digit' }, - locale: 'de', - startOfTheWeek: 1, - dateFormats: { - LTS: 'HH:mm:ss', - LT: 'HH:mm', - L: 'dd.MM.yyyy', - LL: 'd. MMMM yyyy', - LLL: 'd. MMMM yyyy HH:mm', - LLLL: 'dddd, d. MMMM yyyy HH:mm', - }, - ordinal: (n) => `${n}.`, - format: 'L LT', -}; - -export { localization, name }; diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/locales/es.ts b/node_modules/@eonasdan/tempus-dominus/src/js/locales/es.ts deleted file mode 100644 index 0c90a3e..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/locales/es.ts +++ /dev/null @@ -1,45 +0,0 @@ -const name = 'es'; - -const localization = { - today: 'Hoy', - clear: 'Borrar selección', - close: 'Cerrar selector', - selectMonth: 'Seleccionar mes', - previousMonth: 'Mes anterior', - nextMonth: 'Próximo mes', - selectYear: 'Seleccionar año', - previousYear: 'Año anterior', - nextYear: 'Próximo año', - selectDecade: 'Seleccionar década', - previousDecade: 'Década anterior', - nextDecade: 'Próxima década', - previousCentury: 'Siglo anterior', - nextCentury: 'Próximo siglo', - pickHour: 'Elegir hora', - incrementHour: 'Incrementar hora', - decrementHour: 'Decrementar hora', - pickMinute: 'Elegir minuto', - incrementMinute: 'Incrementar minuto', - decrementMinute: 'Decrementar minuto', - pickSecond: 'Elegir segundo', - incrementSecond: 'Incrementar segundo', - decrementSecond: 'Decrementar segundo', - toggleMeridiem: 'Cambiar AM/PM', - selectTime: 'Seleccionar tiempo', - selectDate: 'Seleccionar fecha', - dayViewHeaderFormat: { month: 'long', year: '2-digit' }, - startOfTheWeek: 1, - locale: 'es', - dateFormats: { - LT: 'H:mm', - LTS: 'H:mm:ss', - L: 'dd/MM/yyyy', - LL: 'd [de] MMMM [de] yyyy', - LLL: 'd [de] MMMM [de] yyyy H:mm', - LLLL: 'dddd, d [de] MMMM [de] yyyy H:mm', - }, - ordinal: (n) => `${n}º`, - format: 'L LT', -}; - -export { localization, name }; diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/locales/fi.ts b/node_modules/@eonasdan/tempus-dominus/src/js/locales/fi.ts deleted file mode 100644 index 4fade3f..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/locales/fi.ts +++ /dev/null @@ -1,45 +0,0 @@ -const name = 'fi'; - -const localization = { - today: 'Tänään', - clear: 'Tyhjennä', - close: 'Sulje', - selectMonth: 'Valitse kuukausi', - previousMonth: 'Edellinen kuukausi', - nextMonth: 'Seuraava kuukausi', - selectYear: 'Valitse vuosi', - previousYear: 'Edellinen vuosi', - nextYear: 'Seuraava vuosi', - selectDecade: 'Valitse vuosikymmen', - previousDecade: 'Edellinen vuosikymmen', - nextDecade: 'Seuraava vuosikymmen', - previousCentury: 'Edellinen vuosisata', - nextCentury: 'Seuraava vuosisata', - pickHour: 'Valitse tunnit', - incrementHour: 'Vähennä tunteja', - decrementHour: 'Lisää tunteja', - pickMinute: 'Valitse minuutit', - incrementMinute: 'Vähennä minuutteja', - decrementMinute: 'Lisää minuutteja', - pickSecond: 'Valitse sekuntit', - incrementSecond: 'Vähennä sekunteja', - decrementSecond: 'Lisää sekunteja', - toggleMeridiem: 'Vaihda kellonaikaa', - selectTime: 'Valitse aika', - selectDate: 'Valise päivä', - dayViewHeaderFormat: { month: 'long', year: '2-digit' }, - locale: 'fi', - startOfTheWeek: 1, - dateFormats: { - LT: 'HH.mm', - LTS: 'HH.mm.ss', - L: 'dd.MM.yyyy', - LL: 'd. MMMM[ta] yyyy', - LLL: 'd. MMMM[ta] yyyy, [klo] HH.mm', - LLLL: 'dddd, d. MMMM[ta] yyyy, [klo] HH.mm', - }, - ordinal: (n) => `${n}.`, - format: 'L LT', -}; - -export { localization, name }; diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/locales/fr.ts b/node_modules/@eonasdan/tempus-dominus/src/js/locales/fr.ts deleted file mode 100644 index e691d39..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/locales/fr.ts +++ /dev/null @@ -1,48 +0,0 @@ -const name = 'fr'; - -const localization = { - today: "Aujourd'hui", - clear: 'Effacer la sélection', - close: 'Fermer', - selectMonth: 'Sélectionner le mois', - previousMonth: 'Mois précédent', - nextMonth: 'Mois suivant', - selectYear: "Sélectionner l'année", - previousYear: 'Année précédente', - nextYear: 'Année suivante', - selectDecade: 'Sélectionner la décennie', - previousDecade: 'Décennie précédente', - nextDecade: 'Décennie suivante', - previousCentury: 'Siècle précédente', - nextCentury: 'Siècle suivante', - pickHour: "Sélectionner l'heure", - incrementHour: "Incrementer l'heure", - decrementHour: "Diminuer l'heure", - pickMinute: 'Sélectionner les minutes', - incrementMinute: 'Incrementer les minutes', - decrementMinute: 'Diminuer les minutes', - pickSecond: 'Sélectionner les secondes', - incrementSecond: 'Incrementer les secondes', - decrementSecond: 'Diminuer les secondes', - toggleMeridiem: 'Basculer AM-PM', - selectTime: "Sélectionner l'heure", - selectDate: 'Sélectionner une date', - dayViewHeaderFormat: { month: 'long', year: '2-digit' }, - locale: 'fr', - startOfTheWeek: 1, - dateFormats: { - LT: 'HH:mm', - LTS: 'HH:mm:ss', - L: 'dd/MM/yyyy', - LL: 'd MMMM yyyy', - LLL: 'd MMMM yyyy HH:mm', - LLLL: 'dddd d MMMM yyyy HH:mm', - }, - ordinal: (n) => { - const o = n === 1 ? 'er' : ''; - return `${n}${o}`; - }, - format: 'L LT', -}; - -export { localization, name }; diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/locales/hy.ts b/node_modules/@eonasdan/tempus-dominus/src/js/locales/hy.ts deleted file mode 100644 index 93ead03..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/locales/hy.ts +++ /dev/null @@ -1,45 +0,0 @@ -const name = 'hy'; - -const localization = { - today: 'Այսօր', - clear: 'Ջնջել ընտրվածը', - close: 'Փակել', - selectMonth: 'Ընտրել ամիս', - previousMonth: 'Նախորդ ամիս', - nextMonth: 'Հաջորդ ամիս', - selectYear: 'Ընտրել տարի', - previousYear: 'Նախորդ տարի', - nextYear: 'Հաջորդ տարի', - selectDecade: 'Ընտրել տասնամյակ', - previousDecade: 'Նախորդ տասնամյակ', - nextDecade: 'Հաջորդ տասնամյակ', - previousCentury: 'Նախորդ դար', - nextCentury: 'Հաջորդ դար', - pickHour: 'Ընտրել ժամ', - incrementHour: 'Ավելացնել ժամ', - decrementHour: 'Նվազեցնել ժամ', - pickMinute: 'Ընտրել րոպե', - incrementMinute: 'Ավելացնել րոպե', - decrementMinute: 'Նվազեցնել րոպե', - pickSecond: 'Ընտրել երկրորդը', - incrementSecond: 'Ավելացնել վայրկյան', - decrementSecond: 'Նվազեցնել վայրկյան', - toggleMeridiem: 'Փոփոխել Ժամանակաշրջանը', - selectTime: 'Ընտրել Ժամ', - selectDate: 'Ընտրել ամսաթիվ', - dayViewHeaderFormat: { month: 'long', year: '2-digit' }, - locale: 'hy', - startOfTheWeek: 1, - dateFormats: { - LT: 'H:mm', - LTS: 'H:mm:ss', - L: 'dd.MM.yyyy', - LL: 'd MMMM yyyy թ.', - LLL: 'd MMMM yyyy թ., H:mm', - LLLL: 'dddd, d MMMM yyyy թ., H:mm', - }, - ordinal: (n) => n, - format: 'L LTS', -}; - -export { localization, name }; diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/locales/it.ts b/node_modules/@eonasdan/tempus-dominus/src/js/locales/it.ts deleted file mode 100644 index f51a4f4..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/locales/it.ts +++ /dev/null @@ -1,45 +0,0 @@ -const name = 'it'; - -const localization = { - today: 'Oggi', - clear: 'Cancella selezione', - close: 'Chiudi', - selectMonth: 'Seleziona mese', - previousMonth: 'Mese precedente', - nextMonth: 'Mese successivo', - selectYear: 'Seleziona anno', - previousYear: 'Anno precedente', - nextYear: 'Anno successivo', - selectDecade: 'Seleziona decennio', - previousDecade: 'Decennio precedente', - nextDecade: 'Decennio successivo', - previousCentury: 'Secolo precedente', - nextCentury: 'Secolo successivo', - pickHour: "Seleziona l'ora", - incrementHour: "Incrementa l'ora", - decrementHour: "Decrementa l'ora", - pickMinute: 'Seleziona i minuti', - incrementMinute: 'Incrementa i minuti', - decrementMinute: 'Decrementa i minuti', - pickSecond: 'Seleziona i secondi', - incrementSecond: 'Incrementa i secondi', - decrementSecond: 'Decrementa i secondi', - toggleMeridiem: 'Scambia AM-PM', - selectTime: "Seleziona l'ora", - selectDate: 'Seleziona una data', - dayViewHeaderFormat: { month: 'long', year: '2-digit' }, - locale: 'it', - startOfTheWeek: 1, - dateFormats: { - LT: 'HH:mm', - LTS: 'HH:mm:ss', - L: 'dd/MM/yyyy', - LL: 'd MMMM yyyy', - LLL: 'd MMMM yyyy HH:mm', - LLLL: 'dddd d MMMM yyyy HH:mm', - }, - ordinal: (n) => `${n}º`, - format: 'L LT', -}; - -export { localization, name }; diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/locales/nl.ts b/node_modules/@eonasdan/tempus-dominus/src/js/locales/nl.ts deleted file mode 100644 index 5e2b7ac..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/locales/nl.ts +++ /dev/null @@ -1,45 +0,0 @@ -const name = 'nl'; - -const localization = { - today: 'Vandaag', - clear: 'Verwijder selectie', - close: 'Sluit de picker', - selectMonth: 'Selecteer een maand', - previousMonth: 'Vorige maand', - nextMonth: 'Volgende maand', - selectYear: 'Selecteer een jaar', - previousYear: 'Vorige jaar', - nextYear: 'Volgende jaar', - selectDecade: 'Selecteer decennium', - previousDecade: 'Vorige decennium', - nextDecade: 'Volgende decennium', - previousCentury: 'Vorige eeuw', - nextCentury: 'Volgende eeuw', - pickHour: 'Kies een uur', - incrementHour: 'Verhoog uur', - decrementHour: 'Verlaag uur', - pickMinute: 'Kies een minute', - incrementMinute: 'Verhoog minuut', - decrementMinute: 'Verlaag minuut', - pickSecond: 'Kies een seconde', - incrementSecond: 'Verhoog seconde', - decrementSecond: 'Verlaag seconde', - toggleMeridiem: 'Schakel tussen AM/PM', - selectTime: 'Selecteer een tijd', - selectDate: 'Selecteer een datum', - dayViewHeaderFormat: { month: 'long', year: '2-digit' }, - locale: 'nl', - startOfTheWeek: 1, - dateFormats: { - LT: 'HH:mm', - LTS: 'HH:mm:ss', - L: 'dd-MM-yyyy', - LL: 'd MMMM yyyy', - LLL: 'd MMMM yyyy HH:mm', - LLLL: 'dddd d MMMM yyyy HH:mm', - }, - ordinal: (n) => `[${n}${n === 1 || n === 8 || n >= 20 ? 'ste' : 'de'}]`, - format: 'L LT', -}; - -export { localization, name }; diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/locales/pl.ts b/node_modules/@eonasdan/tempus-dominus/src/js/locales/pl.ts deleted file mode 100644 index 31c77e9..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/locales/pl.ts +++ /dev/null @@ -1,45 +0,0 @@ -const name = 'pl'; - -const localization = { - today: 'Dzisiaj', - clear: 'Wyczyść', - close: 'Zamknij', - selectMonth: 'Wybierz miesiąc', - previousMonth: 'Poprzedni miesiąc', - nextMonth: 'Następny miesiąc', - selectYear: 'Wybierz rok', - previousYear: 'Poprzedni rok', - nextYear: 'Następny rok', - selectDecade: 'Wybierz dekadę', - previousDecade: 'Poprzednia dekada', - nextDecade: 'Następna dekada', - previousCentury: 'Poprzednie stulecie', - nextCentury: 'Następne stulecie', - pickHour: 'Wybierz godzinę', - incrementHour: 'Kolejna godzina', - decrementHour: 'Poprzednia godzina', - pickMinute: 'Wybierz minutę', - incrementMinute: 'Kolejna minuta', - decrementMinute: 'Poprzednia minuta', - pickSecond: 'Wybierz sekundę', - incrementSecond: 'Kolejna sekunda', - decrementSecond: 'Poprzednia sekunda', - toggleMeridiem: 'Przełącz porę dnia', - selectTime: 'Ustaw godzinę', - selectDate: 'Ustaw datę', - dayViewHeaderFormat: { month: 'long', year: '2-digit' }, - locale: 'pl', - startOfTheWeek: 1, - dateFormats: { - LT: 'HH:mm', - LTS: 'HH:mm:ss', - L: 'dd.MM.yyyy', - LL: 'd MMMM yyyy', - LLL: 'd MMMM yyyy HH:mm', - LLLL: 'dddd, d MMMM yyyy HH:mm', - }, - ordinal: (n) => `${n}.`, - format: 'L LT', -}; - -export { localization, name }; diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/locales/ro.ts b/node_modules/@eonasdan/tempus-dominus/src/js/locales/ro.ts deleted file mode 100644 index 084bb00..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/locales/ro.ts +++ /dev/null @@ -1,45 +0,0 @@ -const name = 'ro'; - -const localization = { - today: 'Mergi la ziua de astăzi', - clear: 'Șterge selecția', - close: 'Închide calendarul', - selectMonth: 'Selectează luna', - previousMonth: 'Luna precedentă', - nextMonth: 'Luna următoare', - selectYear: 'Selectează anul', - previousYear: 'Anul precedent', - nextYear: 'Anul următor', - selectDecade: 'Selectează deceniul', - previousDecade: 'Deceniul precedent', - nextDecade: 'Deceniul următor', - previousCentury: 'Secolul precedent', - nextCentury: 'Secolul următor', - pickHour: 'Alege ora', - incrementHour: 'Incrementează ora', - decrementHour: 'Decrementează ora', - pickMinute: 'Alege minutul', - incrementMinute: 'Incrementează minutul', - decrementMinute: 'Decrementează minutul', - pickSecond: 'Alege secunda', - incrementSecond: 'Incrementează secunda', - decrementSecond: 'Decrementează secunda', - toggleMeridiem: 'Comută modul AM/PM', - selectTime: 'Selectează ora', - selectDate: 'Selectează data', - dayViewHeaderFormat: { month: 'long', year: '2-digit' }, - locale: 'ro', - startOfTheWeek: 1, - dateFormats: { - LT: 'H:mm', - LTS: 'H:mm:ss', - L: 'dd.MM.yyyy', - LL: 'd MMMM yyyy', - LLL: 'd MMMM yyyy H:mm', - LLLL: 'dddd, d MMMM yyyy H:mm', - }, - ordinal: (n) => n, - format: 'L LT', -}; - -export { localization, name }; diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/locales/ru.ts b/node_modules/@eonasdan/tempus-dominus/src/js/locales/ru.ts deleted file mode 100644 index 6931af2..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/locales/ru.ts +++ /dev/null @@ -1,45 +0,0 @@ -const name = 'ru'; - -const localization = { - today: 'Перейти сегодня', - clear: 'Очистить выделение', - close: 'Закрыть сборщик', - selectMonth: 'Выбрать месяц', - previousMonth: 'Предыдущий месяц', - nextMonth: 'В следующем месяце', - selectYear: 'Выбрать год', - previousYear: 'Предыдущий год', - nextYear: 'В следующем году', - selectDecade: 'Выбрать десятилетие', - previousDecade: 'Предыдущее десятилетие', - nextDecade: 'Следующее десятилетие', - previousCentury: 'Предыдущий век', - nextCentury: 'Следующий век', - pickHour: 'Выберите час', - incrementHour: 'Время увеличения', - decrementHour: 'Уменьшить час', - pickMinute: 'Выбрать минуту', - incrementMinute: 'Минута приращения', - decrementMinute: 'Уменьшить минуту', - pickSecond: 'Выбрать второй', - incrementSecond: 'Увеличение секунды', - decrementSecond: 'Уменьшение секунды', - toggleMeridiem: 'Переключить период', - selectTime: 'Выбрать время', - selectDate: 'Выбрать дату', - dayViewHeaderFormat: { month: 'long', year: '2-digit' }, - locale: 'ru', - startOfTheWeek: 1, - dateFormats: { - LT: 'H:mm', - LTS: 'H:mm:ss', - L: 'dd.MM.yyyy', - LL: 'd MMMM yyyy г.', - LLL: 'd MMMM yyyy г., H:mm', - LLLL: 'dddd, d MMMM yyyy г., H:mm', - }, - ordinal: (n) => n, - format: 'L LT', -}; - -export { localization, name }; diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/locales/sl.ts b/node_modules/@eonasdan/tempus-dominus/src/js/locales/sl.ts deleted file mode 100644 index ff1bfd2..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/locales/sl.ts +++ /dev/null @@ -1,45 +0,0 @@ -const name = 'sl'; - -const localization = { - today: 'Danes', - clear: 'Počisti', - close: 'Zapri', - selectMonth: 'Izberite mesec', - previousMonth: 'Prejšnji mesec', - nextMonth: 'Naslednji mesec', - selectYear: 'Izberite leto', - previousYear: 'Prejšnje Leto', - nextYear: 'Naslednje leto', - selectDecade: 'Izberite desetletje', - previousDecade: 'Prejšnje desetletje', - nextDecade: 'Naslednje desetletje', - previousCentury: 'Prejšnje stoletje', - nextCentury: 'Naslednje stoletje', - pickHour: 'Izberite uro', - incrementHour: 'Povečaj ure', - decrementHour: 'Zmanjšaj uro', - pickMinute: 'Izberite minuto', - incrementMinute: 'Povečaj minuto', - decrementMinute: 'Zmanjšaj minuto', - pickSecond: 'Izberite drugo', - incrementSecond: 'Povečaj sekundo', - decrementSecond: 'Zmanjšaj sekundo', - toggleMeridiem: 'Preklop dopoldne/popoldne', - selectTime: 'Izberite čas', - selectDate: 'Izberite Datum', - dayViewHeaderFormat: { month: 'long', year: 'numeric' }, - locale: 'sl', - startOfTheWeek: 1, - dateFormats: { - LT: 'H:mm', - LTS: 'H:mm:ss', - L: 'dd.MM.yyyy', - LL: 'd. MMMM yyyy', - LLL: 'd. MMMM yyyy H:mm', - LLLL: 'dddd, d. MMMM yyyy H:mm', - }, - ordinal: (n) => `${n}.`, - format: 'L LT', -}; - -export { localization, name }; diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/locales/tr.ts b/node_modules/@eonasdan/tempus-dominus/src/js/locales/tr.ts deleted file mode 100644 index ee4a382..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/locales/tr.ts +++ /dev/null @@ -1,45 +0,0 @@ -const name = 'tr'; - -const localization = { - today: 'Bugün', - clear: 'Temizle', - close: 'Kapat', - selectMonth: 'Ay seçin', - previousMonth: 'Önceki Ay', - nextMonth: 'Sonraki Ay', - selectYear: 'Yıl seçin', - previousYear: 'Önceki yıl', - nextYear: 'Sonraki yıl', - selectDecade: 'On yıl seçin', - previousDecade: 'Önceki on yıl', - nextDecade: 'Sonraki on yıl', - previousCentury: 'Önceki yüzyıl', - nextCentury: 'Sonraki yüzyıl', - pickHour: 'Saat seçin', - incrementHour: 'Saati ilerlet', - decrementHour: 'Saati gerilet', - pickMinute: 'Dakika seçin', - incrementMinute: 'Dakikayı ilerlet', - decrementMinute: 'Dakikayı gerilet', - pickSecond: 'Saniye seç', - incrementSecond: 'Saniyeyi ilerlet', - decrementSecond: 'Saniyeyi gerilet', - toggleMeridiem: 'Meridemi Değiştir AM-PM', - selectTime: 'Saat seçin', - selectDate: 'Tarih seçin', - dayViewHeaderFormat: { month: 'long', year: 'numeric' }, - locale: 'tr', - startOfTheWeek: 1, - dateFormats: { - LT: 'HH:mm', - LTS: 'HH:mm:ss', - L: 'dd.MM.yyyy', - LL: 'd MMMM yyyy', - LLL: 'd MMMM yyyy HH:mm', - LLLL: 'dddd, d MMMM yyyy HH:mm', - }, - ordinal: (n) => `${n}.`, - format: 'L LT', -}; - -export { localization, name }; diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/plugins/bi-one/index.ts b/node_modules/@eonasdan/tempus-dominus/src/js/plugins/bi-one/index.ts deleted file mode 100644 index 543191c..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/plugins/bi-one/index.ts +++ /dev/null @@ -1,21 +0,0 @@ -// this obviously requires the Bootstrap Icons v1 libraries to be loaded - -const biOneIcons = { - type: 'icons', - time: 'bi bi-clock', - date: 'bi bi-calendar-week', - up: 'bi bi-arrow-up', - down: 'bi bi-arrow-down', - previous: 'bi bi-chevron-left', - next: 'bi bi-chevron-right', - today: 'bi bi-calendar-check', - clear: 'bi bi-trash', - close: 'bi bi-x', -}; - -// noinspection JSUnusedGlobalSymbols -const load = (_, __, tdFactory) => { - tdFactory.DefaultOptions.display.icons = biOneIcons; -}; - -export { biOneIcons, load }; diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/plugins/customDateFormat/index.ts b/node_modules/@eonasdan/tempus-dominus/src/js/plugins/customDateFormat/index.ts deleted file mode 100644 index 502040d..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/plugins/customDateFormat/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export default () => { - console.warn( - 'This plugin has been merged with the main picker and is now longer required' - ); -}; diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/plugins/examples/custom-paint-job.ts b/node_modules/@eonasdan/tempus-dominus/src/js/plugins/examples/custom-paint-job.ts deleted file mode 100644 index bc0cae8..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/plugins/examples/custom-paint-job.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* eslint-disable */ -// noinspection JSUnusedGlobalSymbols -export default (option, tdClasses, tdFactory) => { - // noinspection JSUnusedLocalSymbols - tdClasses.Display.prototype.paint = ( - unit, - date, - classes: string[], - element: HTMLElement - ) => { - if (unit === tdFactory.Unit.date) { - if (date.isSame(new tdFactory.DateTime(), unit)) { - classes.push('special-day'); - } - } - }; -}; diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/plugins/examples/sample.ts b/node_modules/@eonasdan/tempus-dominus/src/js/plugins/examples/sample.ts deleted file mode 100644 index a283f5a..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/plugins/examples/sample.ts +++ /dev/null @@ -1,28 +0,0 @@ -// noinspection JSUnusedGlobalSymbols - -export default (option, tdClasses, tdFactory) => { - // extend the picker - // e.g. add new tempusDominus.TempusDominus(...).someFunction() - tdClasses.TempusDominus.prototype.someFunction = (a, logger) => { - logger = logger || console.log; - logger(a); - }; - - // extend tempusDominus - // e.g. add tempusDominus.example() - tdFactory.example = (a, logger) => { - logger = logger || console.log; - logger(a); - }; - - // overriding existing API - // e.g. extend new tempusDominus.TempusDominus(...).show() - const oldShow = tdClasses.TempusDominus.prototype.show; - tdClasses.TempusDominus.prototype.show = function (a, logger) { - logger = logger || console.log; - alert('from plugin'); - logger(a); - oldShow.bind(this)(); - // return modified result - }; -}; diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/plugins/fa-five/index.ts b/node_modules/@eonasdan/tempus-dominus/src/js/plugins/fa-five/index.ts deleted file mode 100644 index 3e9e4ab..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/plugins/fa-five/index.ts +++ /dev/null @@ -1,21 +0,0 @@ -// this obviously requires the FA 6 libraries to be loaded - -const faFiveIcons = { - type: 'icons', - time: 'fas fa-clock', - date: 'fas fa-calendar', - up: 'fas fa-arrow-up', - down: 'fas fa-arrow-down', - previous: 'fas fa-chevron-left', - next: 'fas fa-chevron-right', - today: 'fas fa-calendar-check', - clear: 'fas fa-trash', - close: 'fas fa-times', -}; - -// noinspection JSUnusedGlobalSymbols -const load = (_, __, tdFactory) => { - tdFactory.DefaultOptions.display.icons = faFiveIcons; -}; - -export { faFiveIcons, load }; diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/plugins/moment-parse/index.ts b/node_modules/@eonasdan/tempus-dominus/src/js/plugins/moment-parse/index.ts deleted file mode 100644 index d8c2c67..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/plugins/moment-parse/index.ts +++ /dev/null @@ -1,20 +0,0 @@ -//obviously, loading moment js is required. -declare let moment; -export default (option, tdClasses, tdFactory) => { - tdClasses.Dates.prototype.setFromInput = function (value, index) { - const converted = moment(value, option); - if (converted.isValid()) { - const date = tdFactory.DateTime.convert( - converted.toDate(), - this.optionsStore.options.localization.locale - ); - this.setValue(date, index); - } else { - console.warn('Momentjs failed to parse the input date.'); - } - }; - - tdClasses.Dates.prototype.formatInput = function (date) { - return moment(date).format(option); - }; -}; diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/tempus-dominus.ts b/node_modules/@eonasdan/tempus-dominus/src/js/tempus-dominus.ts deleted file mode 100644 index f152c5f..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/tempus-dominus.ts +++ /dev/null @@ -1,677 +0,0 @@ -import Display from './display/index'; -import Dates from './dates'; -import Actions from './actions'; -import { - DateTime, - DateTimeFormatOptions, - guessHourCycle, - Unit, -} from './datetime'; -import Namespace from './utilities/namespace'; -import Options from './utilities/options'; -import { - BaseEvent, - ChangeEvent, - ViewUpdateEvent, -} from './utilities/event-types'; -import { EventEmitters } from './utilities/event-emitter'; -import { - serviceLocator, - setupServiceLocator, -} from './utilities/service-locator'; -import CalendarModes from './utilities/calendar-modes'; -import DefaultOptions, { - DefaultEnLocalization, -} from './utilities/default-options'; -import ActionTypes from './utilities/action-types'; -import { OptionsStore } from './utilities/optionsStore'; -import { OptionConverter } from './utilities/optionConverter'; - -/** - * A robust and powerful date/time picker component. - */ -class TempusDominus { - //eslint-disable-next-line @typescript-eslint/no-explicit-any - _subscribers: { [key: string]: ((event: any) => Record)[] } = - {}; - private _isDisabled = false; - private _toggle: HTMLElement; - private _currentPromptTimeTimeout: NodeJS.Timeout; - private actions: Actions; - private optionsStore: OptionsStore; - private _eventEmitters: EventEmitters; - display: Display; - dates: Dates; - - constructor(element: HTMLElement, options: Options = {} as Options) { - setupServiceLocator(); - this._eventEmitters = serviceLocator.locate(EventEmitters); - this.optionsStore = serviceLocator.locate(OptionsStore); - this.display = serviceLocator.locate(Display); - this.dates = serviceLocator.locate(Dates); - this.actions = serviceLocator.locate(Actions); - - if (!element) { - Namespace.errorMessages.mustProvideElement(); - } - - this.optionsStore.element = element; - this._initializeOptions(options, DefaultOptions, true); - this.optionsStore.viewDate.setLocalization( - this.optionsStore.options.localization - ); - this.optionsStore.unset = true; - - this._initializeInput(); - this._initializeToggle(); - - if (this.optionsStore.options.display.inline) this.display.show(); - - this._eventEmitters.triggerEvent.subscribe((e) => { - this._triggerEvent(e); - }); - - this._eventEmitters.viewUpdate.subscribe(() => { - this._viewUpdate(); - }); - - this._eventEmitters.updateViewDate.subscribe((dateTime) => { - this.viewDate = dateTime; - }); - } - - get viewDate() { - return this.optionsStore.viewDate; - } - - set viewDate(value) { - this.optionsStore.viewDate = value; - this.optionsStore.viewDate.setLocalization( - this.optionsStore.options.localization - ); - this.display._update( - this.optionsStore.currentView === 'clock' ? 'clock' : 'calendar' - ); - } - - // noinspection JSUnusedGlobalSymbols - /** - * Update the picker options. If `reset` is provide `options` will be merged with DefaultOptions instead. - * @param options - * @param reset - * @public - */ - updateOptions(options, reset = false): void { - if (reset) this._initializeOptions(options, DefaultOptions); - else this._initializeOptions(options, this.optionsStore.options); - - this.optionsStore.viewDate.setLocalization( - this.optionsStore.options.localization - ); - this.display.refreshCurrentView(); - } - - // noinspection JSUnusedGlobalSymbols - /** - * Toggles the picker open or closed. If the picker is disabled, nothing will happen. - * @public - */ - toggle(): void { - if (this._isDisabled) return; - this.display.toggle(); - } - - // noinspection JSUnusedGlobalSymbols - /** - * Shows the picker unless the picker is disabled. - * @public - */ - show(): void { - if (this._isDisabled) return; - this.display.show(); - } - - // noinspection JSUnusedGlobalSymbols - /** - * Hides the picker unless the picker is disabled. - * @public - */ - hide(): void { - this.display.hide(); - } - - // noinspection JSUnusedGlobalSymbols - /** - * Disables the picker and the target input field. - * @public - */ - disable(): void { - this._isDisabled = true; - // todo this might be undesired. If a dev disables the input field to - // only allow using the picker, this will break that. - this.optionsStore.input?.setAttribute('disabled', 'disabled'); - this.display.hide(); - } - - // noinspection JSUnusedGlobalSymbols - /** - * Enables the picker and the target input field. - * @public - */ - enable(): void { - this._isDisabled = false; - this.optionsStore.input?.removeAttribute('disabled'); - } - - // noinspection JSUnusedGlobalSymbols - /** - * Clears all the selected dates - * @public - */ - clear(): void { - this.optionsStore.input.value = ''; - this.dates.clear(); - } - - // noinspection JSUnusedGlobalSymbols - /** - * Allows for a direct subscription to picker events, without having to use addEventListener on the element. - * @param eventTypes See Namespace.Events - * @param callbacks Function to call when event is triggered - * @public - */ - subscribe( - eventTypes: string | string[], - callbacks: (event: any) => void | ((event: any) => void)[] //eslint-disable-line @typescript-eslint/no-explicit-any - ): { unsubscribe: () => void } | { unsubscribe: () => void }[] { - if (typeof eventTypes === 'string') { - eventTypes = [eventTypes]; - } - let callBackArray: any[]; //eslint-disable-line @typescript-eslint/no-explicit-any - if (!Array.isArray(callbacks)) { - callBackArray = [callbacks]; - } else { - callBackArray = callbacks; - } - - if (eventTypes.length !== callBackArray.length) { - Namespace.errorMessages.subscribeMismatch(); - } - - const returnArray = []; - - for (let i = 0; i < eventTypes.length; i++) { - const eventType = eventTypes[i]; - if (!Array.isArray(this._subscribers[eventType])) { - this._subscribers[eventType] = []; - } - - this._subscribers[eventType].push(callBackArray[i]); - - returnArray.push({ - unsubscribe: this._unsubscribe.bind( - this, - eventType, - this._subscribers[eventType].length - 1 - ), - }); - - if (eventTypes.length === 1) { - return returnArray[0]; - } - } - - return returnArray; - } - - // noinspection JSUnusedGlobalSymbols - /** - * Hides the picker and removes event listeners - */ - dispose() { - this.display.hide(); - // this will clear the document click event listener - this.display._dispose(); - this._eventEmitters.destroy(); - this.optionsStore.input?.removeEventListener( - 'change', - this._inputChangeEvent - ); - if (this.optionsStore.options.allowInputToggle) { - this.optionsStore.input?.removeEventListener( - 'click', - this._openClickEvent - ); - this.optionsStore.input?.removeEventListener( - 'focus', - this._openClickEvent - ); - } - this._toggle?.removeEventListener('click', this._toggleClickEvent); - this._subscribers = {}; - } - - /** - * Updates the options to use the provided language. - * THe language file must be loaded first. - * @param language - */ - locale(language: string) { - const asked = loadedLocales[language]; - if (!asked) return; - this.updateOptions({ - localization: asked, - }); - } - - /** - * Triggers an event like ChangeEvent when the picker has updated the value - * of a selected date. - * @param event Accepts a BaseEvent object. - * @private - */ - private _triggerEvent(event: BaseEvent) { - event.viewMode = this.optionsStore.currentView; - - const isChangeEvent = event.type === Namespace.events.change; - if (isChangeEvent) { - const { date, oldDate, isClear } = event as ChangeEvent; - if ( - (date && oldDate && date.isSame(oldDate)) || - (!isClear && !date && !oldDate) - ) { - return; - } - this._handleAfterChangeEvent(event as ChangeEvent); - - this.optionsStore.input?.dispatchEvent( - //eslint-disable-next-line @typescript-eslint/no-explicit-any - new CustomEvent('change', { detail: event as any }) - ); - } - - this.optionsStore.element.dispatchEvent( - //eslint-disable-next-line @typescript-eslint/no-explicit-any - new CustomEvent(event.type, { detail: event as any }) - ); - - //eslint-disable-next-line @typescript-eslint/no-explicit-any - if ((window as any).jQuery) { - //eslint-disable-next-line @typescript-eslint/no-explicit-any - const $ = (window as any).jQuery; - - if (isChangeEvent && this.optionsStore.input) { - $(this.optionsStore.input).trigger(event); - } else { - $(this.optionsStore.element).trigger(event); - } - } - - this._publish(event); - } - - private _publish(event: BaseEvent) { - // return if event is not subscribed - if (!Array.isArray(this._subscribers[event.type])) { - return; - } - - // Trigger callback for each subscriber - this._subscribers[event.type].forEach((callback) => { - callback(event); - }); - } - - /** - * Fires a ViewUpdate event when, for example, the month view is changed. - * @private - */ - private _viewUpdate() { - this._triggerEvent({ - type: Namespace.events.update, - viewDate: this.optionsStore.viewDate.clone, - } as ViewUpdateEvent); - } - - private _unsubscribe(eventName, index) { - this._subscribers[eventName].splice(index, 1); - } - - /** - * Merges two Option objects together and validates options type - * @param config new Options - * @param mergeTo Options to merge into - * @param includeDataset When true, the elements data-td attributes will be included in the - * @private - */ - private _initializeOptions( - config: Options, - mergeTo: Options, - includeDataset = false - ): void { - let newConfig = OptionConverter.deepCopy(config); - newConfig = OptionConverter._mergeOptions(newConfig, mergeTo); - if (includeDataset) - newConfig = OptionConverter._dataToOptions( - this.optionsStore.element, - newConfig - ); - - OptionConverter._validateConflicts(newConfig); - - newConfig.viewDate = newConfig.viewDate.setLocalization( - newConfig.localization - ); - - if (!this.optionsStore.viewDate.isSame(newConfig.viewDate)) { - this.optionsStore.viewDate = newConfig.viewDate; - } - - /** - * Sets the minimum view allowed by the picker. For example the case of only - * allowing year and month to be selected but not date. - */ - if (newConfig.display.components.year) { - this.optionsStore.minimumCalendarViewMode = 2; - } - if (newConfig.display.components.month) { - this.optionsStore.minimumCalendarViewMode = 1; - } - if (newConfig.display.components.date) { - this.optionsStore.minimumCalendarViewMode = 0; - } - - this.optionsStore.currentCalendarViewMode = Math.max( - this.optionsStore.minimumCalendarViewMode, - this.optionsStore.currentCalendarViewMode - ); - - // Update view mode if needed - if ( - CalendarModes[this.optionsStore.currentCalendarViewMode].name !== - newConfig.display.viewMode - ) { - this.optionsStore.currentCalendarViewMode = Math.max( - CalendarModes.findIndex((x) => x.name === newConfig.display.viewMode), - this.optionsStore.minimumCalendarViewMode - ); - } - - if (this.display?.isVisible) { - this.display._update('all'); - } - - if ( - newConfig.display.components.useTwentyfourHour && - newConfig.localization.hourCycle === undefined - ) - newConfig.localization.hourCycle = 'h24'; - else if (newConfig.localization.hourCycle === undefined) { - newConfig.localization.hourCycle = guessHourCycle( - newConfig.localization.locale - ); - } - - this.optionsStore.options = newConfig; - - if ( - newConfig.restrictions.maxDate && - this.viewDate.isAfter(newConfig.restrictions.maxDate) - ) - this.viewDate = newConfig.restrictions.maxDate; - - if ( - newConfig.restrictions.minDate && - this.viewDate.isBefore(newConfig.restrictions.minDate) - ) - this.viewDate = newConfig.restrictions.minDate; - } - - /** - * Checks if an input field is being used, attempts to locate one and sets an - * event listener if found. - * @private - */ - private _initializeInput() { - if (this.optionsStore.element.tagName == 'INPUT') { - this.optionsStore.input = this.optionsStore.element as HTMLInputElement; - } else { - const query = this.optionsStore.element.dataset.tdTargetInput; - if (query == undefined || query == 'nearest') { - this.optionsStore.input = - this.optionsStore.element.querySelector('input'); - } else { - this.optionsStore.input = - this.optionsStore.element.querySelector(query); - } - } - - if (!this.optionsStore.input) return; - - if (!this.optionsStore.input.value && this.optionsStore.options.defaultDate) - this.optionsStore.input.value = this.dates.formatInput( - this.optionsStore.options.defaultDate - ); - - this.optionsStore.input.addEventListener('change', this._inputChangeEvent); - if (this.optionsStore.options.allowInputToggle) { - this.optionsStore.input.addEventListener('click', this._openClickEvent); - this.optionsStore.input.addEventListener('focus', this._openClickEvent); - } - - if (this.optionsStore.input.value) { - this._inputChangeEvent(); - } - } - - /** - * Attempts to locate a toggle for the picker and sets an event listener - * @private - */ - private _initializeToggle() { - if (this.optionsStore.options.display.inline) return; - let query = this.optionsStore.element.dataset.tdTargetToggle; - if (query == 'nearest') { - query = '[data-td-toggle="datetimepicker"]'; - } - this._toggle = - query == undefined - ? this.optionsStore.element - : this.optionsStore.element.querySelector(query); - this._toggle.addEventListener('click', this._toggleClickEvent); - } - - /** - * If the option is enabled this will render the clock view after a date pick. - * @param e change event - * @private - */ - private _handleAfterChangeEvent(e: ChangeEvent) { - if ( - // options is disabled - !this.optionsStore.options.promptTimeOnDateChange || - this.optionsStore.options.multipleDates || - this.optionsStore.options.display.inline || - this.optionsStore.options.display.sideBySide || - // time is disabled - !this.display._hasTime || - // clock component is already showing - this.display.widget - ?.getElementsByClassName(Namespace.css.show)[0] - .classList.contains(Namespace.css.timeContainer) - ) - return; - - // First time ever. If useCurrent option is set to true (default), do nothing - // because the first date is selected automatically. - // or date didn't change (time did) or date changed because time did. - if ( - (!e.oldDate && this.optionsStore.options.useCurrent) || - (e.oldDate && e.date?.isSame(e.oldDate)) - ) { - return; - } - - clearTimeout(this._currentPromptTimeTimeout); - this._currentPromptTimeTimeout = setTimeout(() => { - if (this.display.widget) { - this._eventEmitters.action.emit({ - e: { - currentTarget: this.display.widget.querySelector( - '[data-action="togglePicker"]' - ), - }, - action: ActionTypes.togglePicker, - }); - } - }, this.optionsStore.options.promptTimeOnDateChangeTransitionDelay); - } - - /** - * Event for when the input field changes. This is a class level method so there's - * something for the remove listener function. - * @private - */ - //eslint-disable-next-line @typescript-eslint/no-explicit-any - private _inputChangeEvent = (event?: any) => { - const internallyTriggered = event?.detail; - if (internallyTriggered) return; - - const setViewDate = () => { - if (this.dates.lastPicked) - this.optionsStore.viewDate = this.dates.lastPicked.clone; - }; - - const value = this.optionsStore.input.value; - if ( - this.optionsStore.options.multipleDates || - this.optionsStore.options.dateRange - ) { - try { - const valueSplit = value.split( - this.optionsStore.options.multipleDatesSeparator - ); - for (let i = 0; i < valueSplit.length; i++) { - this.dates.setFromInput(valueSplit[i], i); - } - setViewDate(); - } catch { - console.warn( - 'TD: Something went wrong trying to set the multipleDates values from the input field.' - ); - } - } else { - this.dates.setFromInput(value, 0); - setViewDate(); - } - }; - - /** - * Event for when the toggle is clicked. This is a class level method so there's - * something for the remove listener function. - * @private - */ - private _toggleClickEvent = () => { - if ( - (this.optionsStore.element as HTMLInputElement)?.disabled || - this.optionsStore.input?.disabled || - //if we just have the input and allow input toggle is enabled, then don't cause a toggle - (this._toggle.nodeName === 'INPUT' && - (this._toggle as HTMLInputElement)?.type === 'text' && - this.optionsStore.options.allowInputToggle) - ) - return; - this.toggle(); - }; - - /** - * Event for when the toggle is clicked. This is a class level method so there's - * something for the remove listener function. - * @private - */ - private _openClickEvent = () => { - if ( - (this.optionsStore.element as HTMLInputElement)?.disabled || - this.optionsStore.input?.disabled - ) - return; - if (!this.display.isVisible) this.show(); - }; -} - -/** - * Whenever a locale is loaded via a plugin then store it here based on the - * locale name. E.g. loadedLocales['ru'] - */ -const loadedLocales = {}; - -// noinspection JSUnusedGlobalSymbols -/** - * Called from a locale plugin. - * @param l locale object for localization options - */ -const loadLocale = (l) => { - if (loadedLocales[l.name]) return; - loadedLocales[l.name] = l.localization; -}; - -/** - * A sets the global localization options to the provided locale name. - * `loadLocale` MUST be called first. - * @param l - */ -const locale = (l: string) => { - const asked = loadedLocales[l]; - if (!asked) return; - DefaultOptions.localization = asked; -}; - -// noinspection JSUnusedGlobalSymbols -/** - * Called from a plugin to extend or override picker defaults. - * @param plugin - * @param option - */ -const extend = function (plugin, option = undefined) { - if (!plugin) return tempusDominus; - if (!plugin.installed) { - // install plugin only once - plugin( - option, - { TempusDominus, Dates, Display, DateTime, Namespace }, - tempusDominus - ); - plugin.installed = true; - } - return tempusDominus; -}; - -const version = '6.7.19'; - -const tempusDominus = { - TempusDominus, - extend, - loadLocale, - locale, - Namespace, - DefaultOptions, - DateTime, - Unit, - version, - DefaultEnLocalization, -}; - -export { - TempusDominus, - extend, - loadLocale, - locale, - Namespace, - DefaultOptions, - DateTime, - Unit, - version, - DateTimeFormatOptions, - Options, - DefaultEnLocalization, -}; diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/utilities/action-types.ts b/node_modules/@eonasdan/tempus-dominus/src/js/utilities/action-types.ts deleted file mode 100644 index e183f68..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/utilities/action-types.ts +++ /dev/null @@ -1,29 +0,0 @@ -enum ActionTypes { - next = 'next', - previous = 'previous', - changeCalendarView = 'changeCalendarView', - selectMonth = 'selectMonth', - selectYear = 'selectYear', - selectDecade = 'selectDecade', - selectDay = 'selectDay', - selectHour = 'selectHour', - selectMinute = 'selectMinute', - selectSecond = 'selectSecond', - incrementHours = 'incrementHours', - incrementMinutes = 'incrementMinutes', - incrementSeconds = 'incrementSeconds', - decrementHours = 'decrementHours', - decrementMinutes = 'decrementMinutes', - decrementSeconds = 'decrementSeconds', - toggleMeridiem = 'toggleMeridiem', - togglePicker = 'togglePicker', - showClock = 'showClock', - showHours = 'showHours', - showMinutes = 'showMinutes', - showSeconds = 'showSeconds', - clear = 'clear', - close = 'close', - today = 'today', -} - -export default ActionTypes; diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/utilities/calendar-modes.ts b/node_modules/@eonasdan/tempus-dominus/src/js/utilities/calendar-modes.ts deleted file mode 100644 index cf8eb6a..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/utilities/calendar-modes.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { Unit } from '../datetime'; -import Namespace from './namespace'; -import ViewMode from './view-mode'; - -const CalendarModes: { - name: keyof ViewMode; - className: string; - unit: Unit; - step: number; -}[] = [ - { - name: 'calendar', - className: Namespace.css.daysContainer, - unit: Unit.month, - step: 1, - }, - { - name: 'months', - className: Namespace.css.monthsContainer, - unit: Unit.year, - step: 1, - }, - { - name: 'years', - className: Namespace.css.yearsContainer, - unit: Unit.year, - step: 10, - }, - { - name: 'decades', - className: Namespace.css.decadesContainer, - unit: Unit.year, - step: 100, - }, -]; - -export default CalendarModes; diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/utilities/default-format-localization.ts b/node_modules/@eonasdan/tempus-dominus/src/js/utilities/default-format-localization.ts deleted file mode 100644 index 34c1ad7..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/utilities/default-format-localization.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { FormatLocalization } from './options'; - -const DefaultFormatLocalization: FormatLocalization = { - dateFormats: { - LTS: 'h:mm:ss T', - LT: 'h:mm T', - L: 'MM/dd/yyyy', - LL: 'MMMM d, yyyy', - LLL: 'MMMM d, yyyy h:mm T', - LLLL: 'dddd, MMMM d, yyyy h:mm T', - }, - format: 'L LT', - locale: 'default', - hourCycle: undefined, - ordinal: (n) => { - const s = ['th', 'st', 'nd', 'rd']; - const v = n % 100; - return `[${n}${s[(v - 20) % 10] || s[v] || s[0]}]`; - }, -}; - -export default { ...DefaultFormatLocalization }; diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/utilities/default-options.ts b/node_modules/@eonasdan/tempus-dominus/src/js/utilities/default-options.ts deleted file mode 100644 index 77b31cb..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/utilities/default-options.ts +++ /dev/null @@ -1,110 +0,0 @@ -import Options, { Localization } from './options'; -import { DateTime } from '../datetime'; -import DefaultFormatLocalization from './default-format-localization'; - -const defaultEnLocalization: Localization = { - clear: 'Clear selection', - close: 'Close the picker', - dateFormats: DefaultFormatLocalization.dateFormats, - dayViewHeaderFormat: { month: 'long', year: '2-digit' }, - decrementHour: 'Decrement Hour', - decrementMinute: 'Decrement Minute', - decrementSecond: 'Decrement Second', - format: DefaultFormatLocalization.format, - hourCycle: DefaultFormatLocalization.hourCycle, - incrementHour: 'Increment Hour', - incrementMinute: 'Increment Minute', - incrementSecond: 'Increment Second', - locale: DefaultFormatLocalization.locale, - maxWeekdayLength: 0, - nextCentury: 'Next Century', - nextDecade: 'Next Decade', - nextMonth: 'Next Month', - nextYear: 'Next Year', - ordinal: DefaultFormatLocalization.ordinal, - pickHour: 'Pick Hour', - pickMinute: 'Pick Minute', - pickSecond: 'Pick Second', - previousCentury: 'Previous Century', - previousDecade: 'Previous Decade', - previousMonth: 'Previous Month', - previousYear: 'Previous Year', - selectDate: 'Select Date', - selectDecade: 'Select Decade', - selectMonth: 'Select Month', - selectTime: 'Select Time', - selectYear: 'Select Year', - startOfTheWeek: 0, - today: 'Go to today', - toggleMeridiem: 'Toggle Meridiem', -}; - -const DefaultOptions: Options = { - allowInputToggle: false, - container: undefined, - dateRange: false, - debug: false, - defaultDate: undefined, - display: { - icons: { - type: 'icons', - time: 'fa-solid fa-clock', - date: 'fa-solid fa-calendar', - up: 'fa-solid fa-arrow-up', - down: 'fa-solid fa-arrow-down', - previous: 'fa-solid fa-chevron-left', - next: 'fa-solid fa-chevron-right', - today: 'fa-solid fa-calendar-check', - clear: 'fa-solid fa-trash', - close: 'fa-solid fa-xmark', - }, - sideBySide: false, - calendarWeeks: false, - viewMode: 'calendar', - toolbarPlacement: 'bottom', - keepOpen: false, - buttons: { - today: false, - clear: false, - close: false, - }, - components: { - calendar: true, - date: true, - month: true, - year: true, - decades: true, - clock: true, - hours: true, - minutes: true, - seconds: false, - useTwentyfourHour: undefined, - }, - inline: false, - theme: 'auto', - placement: 'bottom', - }, - keepInvalid: false, - localization: defaultEnLocalization, - meta: {}, - multipleDates: false, - multipleDatesSeparator: '; ', - promptTimeOnDateChange: false, - promptTimeOnDateChangeTransitionDelay: 200, - restrictions: { - minDate: undefined, - maxDate: undefined, - disabledDates: [], - enabledDates: [], - daysOfWeekDisabled: [], - disabledTimeIntervals: [], - disabledHours: [], - enabledHours: [], - }, - stepping: 1, - useCurrent: true, - viewDate: new DateTime(), -}; - -export default DefaultOptions; -export const DefaultEnLocalization = { ...defaultEnLocalization }; diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/utilities/errors.ts b/node_modules/@eonasdan/tempus-dominus/src/js/utilities/errors.ts deleted file mode 100644 index d4682a1..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/utilities/errors.ts +++ /dev/null @@ -1,184 +0,0 @@ -export class TdError extends Error { - code: number; -} - -export class ErrorMessages { - private base = 'TD:'; - - //#region out to console - - /** - * Throws an error indicating that a key in the options object is invalid. - * @param optionName - */ - unexpectedOption(optionName: string) { - const error = new TdError( - `${this.base} Unexpected option: ${optionName} does not match a known option.` - ); - error.code = 1; - throw error; - } - - /** - * Throws an error indicating that one more keys in the options object is invalid. - * @param optionName - */ - unexpectedOptions(optionName: string[]) { - const error = new TdError(`${this.base}: ${optionName.join(', ')}`); - error.code = 1; - throw error; - } - - /** - * Throws an error when an option is provide an unsupported value. - * For example a value of 'cheese' for toolbarPlacement which only supports - * 'top', 'bottom', 'default'. - * @param optionName - * @param badValue - * @param validOptions - */ - unexpectedOptionValue( - optionName: string, - badValue: string, - validOptions: string[] - ) { - const error = new TdError( - `${ - this.base - } Unexpected option value: ${optionName} does not accept a value of "${badValue}". Valid values are: ${validOptions.join( - ', ' - )}` - ); - error.code = 2; - throw error; - } - - /** - * Throws an error when an option value is the wrong type. - * For example a string value was provided to multipleDates which only - * supports true or false. - * @param optionName - * @param badType - * @param expectedType - */ - typeMismatch(optionName: string, badType: string, expectedType: string) { - const error = new TdError( - `${this.base} Mismatch types: ${optionName} has a type of ${badType} instead of the required ${expectedType}` - ); - error.code = 3; - throw error; - } - - /** - * Throws an error when an option value is outside of the expected range. - * For example restrictions.daysOfWeekDisabled excepts a value between 0 and 6. - * @param optionName - * @param lower - * @param upper - */ - numbersOutOfRange(optionName: string, lower: number, upper: number) { - const error = new TdError( - `${this.base} ${optionName} expected an array of number between ${lower} and ${upper}.` - ); - error.code = 4; - throw error; - } - - /** - * Throws an error when a value for a date options couldn't be parsed. Either - * the option was an invalid string or an invalid Date object. - * @param optionName - * @param date - * @param soft If true, logs a warning instead of an error. - */ - //eslint-disable-next-line @typescript-eslint/no-explicit-any - failedToParseDate(optionName: string, date: any, soft = false) { - const error = new TdError( - `${this.base} Could not correctly parse "${date}" to a date for ${optionName}.` - ); - error.code = 5; - if (!soft) throw error; - console.warn(error); - } - - /** - * Throws when an element to attach to was not provided in the constructor. - */ - mustProvideElement() { - const error = new TdError(`${this.base} No element was provided.`); - error.code = 6; - throw error; - } - - /** - * Throws if providing an array for the events to subscribe method doesn't have - * the same number of callbacks. E.g., subscribe([1,2], [1]) - */ - subscribeMismatch() { - const error = new TdError( - `${this.base} The subscribed events does not match the number of callbacks` - ); - error.code = 7; - throw error; - } - - /** - * Throws if the configuration has conflicting rules e.g. minDate is after maxDate - */ - conflictingConfiguration(message?: string) { - const error = new TdError( - `${this.base} A configuration value conflicts with another rule. ${message}` - ); - error.code = 8; - throw error; - } - - /** - * customDateFormat errors - */ - customDateFormatError(message?: string) { - const error = new TdError(`${this.base} Custom Date Format: ${message}`); - error.code = 9; - throw error; - } - - /** - * Logs a warning if a date option value is provided as a string, instead of - * a date/datetime object. - */ - dateString() { - console.warn( - `${this.base} Using a string for date options is not recommended unless you specify an ISO string or use the customDateFormat plugin.` - ); - } - - deprecatedWarning(message: string, remediation?: string) { - console.warn( - `${this.base} Warning ${message} is deprecated and will be removed in a future version. ${remediation}` - ); - } - - throwError(message) { - const error = new TdError(`${this.base} ${message}`); - error.code = 9; - throw error; - } - - //#endregion - - //#region used with notify.error - - /** - * Used with an Error Event type if the user selects a date that - * fails restriction validation. - */ - failedToSetInvalidDate = 'Failed to set invalid date'; - - /** - * Used with an Error Event type when a user changes the value of the - * input field directly, and does not provide a valid date. - */ - failedToParseInput = 'Failed parse input field'; - - //#endregion -} diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/utilities/event-emitter.ts b/node_modules/@eonasdan/tempus-dominus/src/js/utilities/event-emitter.ts deleted file mode 100644 index ce074da..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/utilities/event-emitter.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { DateTime, Unit } from '../datetime'; -import ActionTypes from './action-types'; -import { BaseEvent } from './event-types'; - -export type ViewUpdateValues = Unit | 'decade' | 'clock' | 'calendar' | 'all'; - -class EventEmitter { - private subscribers: ((value?: T) => void)[] = []; - - subscribe(callback: (value: T) => void) { - this.subscribers.push(callback); - return this.unsubscribe.bind(this, this.subscribers.length - 1); - } - - unsubscribe(index: number) { - this.subscribers.splice(index, 1); - } - - emit(value?: T) { - this.subscribers.forEach((callback) => { - callback(value); - }); - } - - destroy() { - this.subscribers = null; - this.subscribers = []; - } -} - -export class EventEmitters { - triggerEvent = new EventEmitter(); - viewUpdate = new EventEmitter(); - updateDisplay = new EventEmitter(); - action = new EventEmitter<{ e: any; action?: ActionTypes }>(); //eslint-disable-line @typescript-eslint/no-explicit-any - updateViewDate = new EventEmitter(); - - destroy() { - this.triggerEvent.destroy(); - this.viewUpdate.destroy(); - this.updateDisplay.destroy(); - this.action.destroy(); - this.updateViewDate.destroy(); - } -} diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/utilities/event-types.ts b/node_modules/@eonasdan/tempus-dominus/src/js/utilities/event-types.ts deleted file mode 100644 index f68b7ee..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/utilities/event-types.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { DateTime } from '../datetime'; -import ViewMode from './view-mode'; - -interface BaseEvent { - type: string; - viewMode?: keyof ViewMode; -} - -/** - * Triggers when setValue fails because of validation rules etc. - * @event FailEvent - */ -interface FailEvent extends BaseEvent { - reason: string; - date: DateTime; - oldDate: DateTime; -} - -/** - * Triggers when the picker is hidden. - */ -interface HideEvent extends BaseEvent { - date: DateTime; -} - -/** - * Triggers when a change is successful. - */ -interface ChangeEvent extends BaseEvent { - date: DateTime | undefined; - oldDate: DateTime; - isClear: boolean; - isValid: boolean; -} - -/** - * Triggers when the view is changed for instance from month to year. - */ -interface ViewUpdateEvent extends BaseEvent { - viewDate: DateTime; -} - -export { BaseEvent, FailEvent, HideEvent, ChangeEvent, ViewUpdateEvent }; diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/utilities/namespace.ts b/node_modules/@eonasdan/tempus-dominus/src/js/utilities/namespace.ts deleted file mode 100644 index 29b2488..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/utilities/namespace.ts +++ /dev/null @@ -1,294 +0,0 @@ -import { ErrorMessages } from './errors'; -// this is not the way I want this to stay but nested classes seemed to blown up once its compiled. -const NAME = 'tempus-dominus', - dataKey = 'td'; - -/** - * Events - */ -class Events { - key = `.${dataKey}`; - - /** - * Change event. Fired when the user selects a date. - * See also EventTypes.ChangeEvent - */ - change = `change${this.key}`; - - /** - * Emit when the view changes for example from month view to the year view. - * See also EventTypes.ViewUpdateEvent - */ - update = `update${this.key}`; - - /** - * Emits when a selected date or value from the input field fails to meet the provided validation rules. - * See also EventTypes.FailEvent - */ - error = `error${this.key}`; - - /** - * Show event - * @event Events#show - */ - show = `show${this.key}`; - - /** - * Hide event - * @event Events#hide - */ - hide = `hide${this.key}`; - - // blur and focus are used in the jQuery provider but are otherwise unused. - // keyup/down will be used later for keybinding options - - blur = `blur${this.key}`; - focus = `focus${this.key}`; - keyup = `keyup${this.key}`; - keydown = `keydown${this.key}`; -} - -class Css { - /** - * The outer element for the widget. - */ - widget = `${NAME}-widget`; - - /** - * Hold the previous, next and switcher divs - */ - calendarHeader = 'calendar-header'; - - /** - * The element for the action to change the calendar view. E.g. month -> year. - */ - switch = 'picker-switch'; - - /** - * The elements for all the toolbar options - */ - toolbar = 'toolbar'; - - /** - * Disables the hover and rounding affect. - */ - noHighlight = 'no-highlight'; - - /** - * Applied to the widget element when the side by side option is in use. - */ - sideBySide = 'timepicker-sbs'; - - /** - * The element for the action to change the calendar view, e.g. August -> July - */ - previous = 'previous'; - - /** - * The element for the action to change the calendar view, e.g. August -> September - */ - next = 'next'; - - /** - * Applied to any action that would violate any restriction options. ALso applied - * to an input field if the disabled function is called. - */ - disabled = 'disabled'; - - /** - * Applied to any date that is less than requested view, - * e.g. the last day of the previous month. - */ - old = 'old'; - - /** - * Applied to any date that is greater than of requested view, - * e.g. the last day of the previous month. - */ - new = 'new'; - - /** - * Applied to any date that is currently selected. - */ - active = 'active'; - - //#region date element - - /** - * The outer element for the calendar view. - */ - dateContainer = 'date-container'; - - /** - * The outer element for the decades view. - */ - decadesContainer = `${this.dateContainer}-decades`; - - /** - * Applied to elements within the decade container, e.g. 2020, 2030 - */ - decade = 'decade'; - - /** - * The outer element for the years view. - */ - yearsContainer = `${this.dateContainer}-years`; - - /** - * Applied to elements within the years container, e.g. 2021, 2021 - */ - year = 'year'; - - /** - * The outer element for the month view. - */ - monthsContainer = `${this.dateContainer}-months`; - - /** - * Applied to elements within the month container, e.g. January, February - */ - month = 'month'; - - /** - * The outer element for the calendar view. - */ - daysContainer = `${this.dateContainer}-days`; - - /** - * Applied to elements within the day container, e.g. 1, 2..31 - */ - day = 'day'; - - /** - * If display.calendarWeeks is enabled, a column displaying the week of year - * is shown. This class is applied to each cell in that column. - */ - calendarWeeks = 'cw'; - - /** - * Applied to the first row of the calendar view, e.g. Sunday, Monday - */ - dayOfTheWeek = 'dow'; - - /** - * Applied to the current date on the calendar view. - */ - today = 'today'; - - /** - * Applied to the locale's weekend dates on the calendar view, e.g. Sunday, Saturday - */ - weekend = 'weekend'; - - rangeIn = 'range-in'; - rangeStart = 'range-start'; - rangeEnd = 'range-end'; - - //#endregion - - //#region time element - - /** - * The outer element for all time related elements. - */ - timeContainer = 'time-container'; - - /** - * Applied the separator columns between time elements, e.g. hour *:* minute *:* second - */ - separator = 'separator'; - - /** - * The outer element for the clock view. - */ - clockContainer = `${this.timeContainer}-clock`; - - /** - * The outer element for the hours selection view. - */ - hourContainer = `${this.timeContainer}-hour`; - - /** - * The outer element for the minutes selection view. - */ - minuteContainer = `${this.timeContainer}-minute`; - - /** - * The outer element for the seconds selection view. - */ - secondContainer = `${this.timeContainer}-second`; - - /** - * Applied to each element in the hours selection view. - */ - hour = 'hour'; - - /** - * Applied to each element in the minutes selection view. - */ - minute = 'minute'; - - /** - * Applied to each element in the seconds selection view. - */ - second = 'second'; - - /** - * Applied AM/PM toggle button. - */ - toggleMeridiem = 'toggleMeridiem'; - - //#endregion - - //#region collapse - - /** - * Applied the element of the current view mode, e.g. calendar or clock. - */ - show = 'show'; - - /** - * Applied to the currently showing view mode during a transition - * between calendar and clock views - */ - collapsing = 'td-collapsing'; - - /** - * Applied to the currently hidden view mode. - */ - collapse = 'td-collapse'; - - //#endregion - - /** - * Applied to the widget when the option display.inline is enabled. - */ - inline = 'inline'; - - /** - * Applied to the widget when the option display.theme is light. - */ - lightTheme = 'light'; - - /** - * Applied to the widget when the option display.theme is dark. - */ - darkTheme = 'dark'; - - /** - * Used for detecting if the system color preference is dark mode - */ - isDarkPreferredQuery = '(prefers-color-scheme: dark)'; -} - -export default class Namespace { - static NAME = NAME; - // noinspection JSUnusedGlobalSymbols - static dataKey = dataKey; - - static events = new Events(); - - static css = new Css(); - - static errorMessages = new ErrorMessages(); -} diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/utilities/optionConverter.ts b/node_modules/@eonasdan/tempus-dominus/src/js/utilities/optionConverter.ts deleted file mode 100644 index 6fb4f53..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/utilities/optionConverter.ts +++ /dev/null @@ -1,387 +0,0 @@ -import Namespace from './namespace'; -import { DateTime } from '../datetime'; -import DefaultOptions from './default-options'; -import Options, { FormatLocalization } from './options'; -import { processKey } from './optionProcessor'; -import { - convertToDateTime, - tryConvertToDateTime, - typeCheckDateArray, - typeCheckNumberArray, -} from './typeChecker'; - -export class OptionConverter { - private static ignoreProperties = [ - 'meta', - 'dayViewHeaderFormat', - 'container', - 'dateForms', - 'ordinal', - ]; - - static deepCopy(input): Options { - const o = {}; - - Object.keys(input).forEach((key) => { - const inputElement = input[key]; - - if (inputElement instanceof DateTime) { - o[key] = inputElement.clone; - return; - } else if (inputElement instanceof Date) { - o[key] = new Date(inputElement.valueOf()); - return; - } - - o[key] = inputElement; - if ( - typeof inputElement !== 'object' || - inputElement instanceof HTMLElement || - inputElement instanceof Element - ) - return; - if (!Array.isArray(inputElement)) { - o[key] = OptionConverter.deepCopy(inputElement); - } - }); - - return o; - } - - private static isValue = (a) => a != null; // everything except undefined + null - - /** - * Finds value out of an object based on a string, period delimited, path - * @param paths - * @param obj - */ - static objectPath(paths: string, obj) { - if (paths.charAt(0) === '.') paths = paths.slice(1); - if (!paths) return obj; - return paths - .split('.') - .reduce( - (value, key) => - OptionConverter.isValue(value) || OptionConverter.isValue(value[key]) - ? value[key] - : undefined, - obj - ); - } - - /** - * The spread operator caused sub keys to be missing after merging. - * This is to fix that issue by using spread on the child objects first. - * Also handles complex options like disabledDates - * @param provided An option from new providedOptions - * @param copyTo Destination object. This was added to prevent reference copies - * @param localization - * @param path - */ - static spread(provided, copyTo, localization: FormatLocalization, path = '') { - const defaultOptions = OptionConverter.objectPath(path, DefaultOptions); - - const unsupportedOptions = Object.keys(provided).filter( - (x) => !Object.keys(defaultOptions).includes(x) - ); - - if (unsupportedOptions.length > 0) { - const flattenedOptions = OptionConverter.getFlattenDefaultOptions(); - - const errors = unsupportedOptions.map((x) => { - let error = `"${path}.${x}" in not a known option.`; - const didYouMean = flattenedOptions.find((y) => y.includes(x)); - if (didYouMean) error += ` Did you mean "${didYouMean}"?`; - return error; - }); - Namespace.errorMessages.unexpectedOptions(errors); - } - - Object.keys(provided) - .filter((key) => key !== '__proto__' && key !== 'constructor') - .forEach((key) => { - path += `.${key}`; - if (path.charAt(0) === '.') path = path.slice(1); - - const defaultOptionValue = defaultOptions[key]; - const providedType = typeof provided[key]; - const defaultType = typeof defaultOptionValue; - const value = provided[key]; - - if (value === undefined || value === null) { - copyTo[key] = value; - path = path.substring(0, path.lastIndexOf(`.${key}`)); - return; - } - - if ( - typeof defaultOptionValue === 'object' && - !Array.isArray(provided[key]) && - !( - defaultOptionValue instanceof Date || - OptionConverter.ignoreProperties.includes(key) - ) - ) { - OptionConverter.spread( - provided[key], - copyTo[key], - localization, - path - ); - } else { - copyTo[key] = OptionConverter.processKey( - key, - value, - providedType, - defaultType, - path, - localization - ); - } - - path = path.substring(0, path.lastIndexOf(`.${key}`)); - }); - } - - static processKey( - key: string, - value: any, //eslint-disable-line @typescript-eslint/no-explicit-any - providedType: string, - defaultType: string, - path: string, - localization: FormatLocalization - ) { - return processKey({ - key, - value, - providedType, - defaultType, - path, - localization, - }); - } - - static _mergeOptions(providedOptions: Options, mergeTo: Options): Options { - const newConfig = OptionConverter.deepCopy(mergeTo); - //see if the options specify a locale - const localization = - mergeTo.localization?.locale !== 'default' - ? mergeTo.localization - : providedOptions?.localization || DefaultOptions.localization; - - OptionConverter.spread(providedOptions, newConfig, localization, ''); - - return newConfig; - } - - static _dataToOptions(element, options: Options): Options { - const eData = JSON.parse(JSON.stringify(element.dataset)); - - if (eData?.tdTargetInput) delete eData.tdTargetInput; - if (eData?.tdTargetToggle) delete eData.tdTargetToggle; - - if ( - !eData || - Object.keys(eData).length === 0 || - eData.constructor !== DOMStringMap - ) - return options; - const dataOptions = {} as Options; - - // because dataset returns camelCase including the 'td' key the option - // key won't align - const objectToNormalized = (object) => { - const lowered = {}; - Object.keys(object).forEach((x) => { - lowered[x.toLowerCase()] = x; - }); - - return lowered; - }; - - const normalizeObject = this.normalizeObject(objectToNormalized); - const optionsLower = objectToNormalized(options); - - Object.keys(eData) - .filter((x) => x.startsWith(Namespace.dataKey)) - .map((x) => x.substring(2)) - .forEach((key) => { - let keyOption = optionsLower[key.toLowerCase()]; - - // dataset merges dashes to camelCase... yay - // i.e. key = display_components_seconds - if (key.includes('_')) { - // [display, components, seconds] - const split = key.split('_'); - // display - keyOption = optionsLower[split[0].toLowerCase()]; - if ( - keyOption !== undefined && - options[keyOption].constructor === Object - ) { - dataOptions[keyOption] = normalizeObject( - split, - 1, - options[keyOption], - eData[`td${key}`] - ); - } - } - // or key = multipleDate - else if (keyOption !== undefined) { - dataOptions[keyOption] = eData[`td${key}`]; - } - }); - - return this._mergeOptions(dataOptions, options); - } - - //todo clean this up - private static normalizeObject(objectToNormalized: (object) => object) { - const normalizeObject = ( - split: string[], - index: number, - optionSubgroup: unknown, - value: unknown - ) => { - // first round = display { ... } - const normalizedOptions = objectToNormalized(optionSubgroup); - - const keyOption = normalizedOptions[split[index].toLowerCase()]; - const internalObject = {}; - - if (keyOption === undefined) return internalObject; - - // if this is another object, continue down the rabbit hole - if (optionSubgroup[keyOption].constructor === Object) { - index++; - internalObject[keyOption] = normalizeObject( - split, - index, - optionSubgroup[keyOption], - value - ); - } else { - internalObject[keyOption] = value; - } - return internalObject; - }; - return normalizeObject; - } - - /** - * Attempts to prove `d` is a DateTime or Date or can be converted into one. - * @param d If a string will attempt creating a date from it. - * @param localization object containing locale and format settings. Only used with the custom formats - * @private - */ - static _dateTypeCheck( - d: any, //eslint-disable-line @typescript-eslint/no-explicit-any - localization: FormatLocalization - ): DateTime | null { - return tryConvertToDateTime(d, localization); - } - - /** - * Type checks that `value` is an array of Date or DateTime - * @param optionName Provides text to error messages e.g. disabledDates - * @param value Option value - * @param providedType Used to provide text to error messages - * @param localization - */ - static _typeCheckDateArray( - optionName: string, - value, - providedType: string, - localization: FormatLocalization - ) { - return typeCheckDateArray(optionName, value, providedType, localization); - } - - /** - * Type checks that `value` is an array of numbers - * @param optionName Provides text to error messages e.g. disabledDates - * @param value Option value - * @param providedType Used to provide text to error messages - */ - static _typeCheckNumberArray( - optionName: string, - value, - providedType: string - ) { - return typeCheckNumberArray(optionName, value, providedType); - } - - /** - * Attempts to convert `d` to a DateTime object - * @param d value to convert - * @param optionName Provides text to error messages e.g. disabledDates - * @param localization object containing locale and format settings. Only used with the custom formats - */ - static dateConversion( - d: any, //eslint-disable-line @typescript-eslint/no-explicit-any - optionName: string, - localization: FormatLocalization - ): DateTime { - return convertToDateTime(d, optionName, localization); - } - - private static _flattenDefaults: string[]; - - private static getFlattenDefaultOptions(): string[] { - if (this._flattenDefaults) return this._flattenDefaults; - const deepKeys = (t, pre = []) => { - if (Array.isArray(t)) return []; - if (Object(t) === t) { - return Object.entries(t).flatMap(([k, v]) => deepKeys(v, [...pre, k])); - } else { - return pre.join('.'); - } - }; - - this._flattenDefaults = deepKeys(DefaultOptions); - - return this._flattenDefaults; - } - - /** - * Some options conflict like min/max date. Verify that these kinds of options - * are set correctly. - * @param config - */ - static _validateConflicts(config: Options) { - if ( - config.display.sideBySide && - (!config.display.components.clock || - !( - config.display.components.hours || - config.display.components.minutes || - config.display.components.seconds - )) - ) { - Namespace.errorMessages.conflictingConfiguration( - 'Cannot use side by side mode without the clock components' - ); - } - - if (config.restrictions.minDate && config.restrictions.maxDate) { - if (config.restrictions.minDate.isAfter(config.restrictions.maxDate)) { - Namespace.errorMessages.conflictingConfiguration( - 'minDate is after maxDate' - ); - } - - if (config.restrictions.maxDate.isBefore(config.restrictions.minDate)) { - Namespace.errorMessages.conflictingConfiguration( - 'maxDate is before minDate' - ); - } - } - - if (config.multipleDates && config.dateRange) { - Namespace.errorMessages.conflictingConfiguration( - 'Cannot uss option "multipleDates" with "dateRange"' - ); - } - } -} diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/utilities/optionProcessor.ts b/node_modules/@eonasdan/tempus-dominus/src/js/utilities/optionProcessor.ts deleted file mode 100644 index 00d3dd2..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/utilities/optionProcessor.ts +++ /dev/null @@ -1,184 +0,0 @@ -import Namespace from './namespace'; -import type { FormatLocalization } from './options'; -import { - convertToDateTime, - typeCheckNumberArray, - typeCheckDateArray, -} from './typeChecker'; - -interface OptionProcessorFunctionArguments { - key: string; - value: any; //eslint-disable-line @typescript-eslint/no-explicit-any - providedType: string; - defaultType: string; - path: string; - localization: FormatLocalization; -} - -type OptionProcessorFunction = ( - this: void, - args: OptionProcessorFunctionArguments -) => any; //eslint-disable-line @typescript-eslint/no-explicit-any - -function mandatoryDate(key: string): OptionProcessorFunction { - return ({ value, providedType, localization }) => { - const dateTime = convertToDateTime(value, key, localization); - if (dateTime !== undefined) { - dateTime.setLocalization(localization); - return dateTime; - } - }; -} - -function optionalDate(key: string): OptionProcessorFunction { - const mandatory = mandatoryDate(key); - return (args) => { - if (args.value === undefined) { - return args.value; - } - return mandatory(args); - }; -} - -function numbersInRange( - key: string, - lower: number, - upper: number -): OptionProcessorFunction { - return ({ value, providedType }) => { - if (value === undefined) { - return []; - } - typeCheckNumberArray(key, value, providedType); - if ((value as number[]).some((x) => x < lower || x > upper)) - Namespace.errorMessages.numbersOutOfRange(key, lower, upper); - return value; - }; -} - -function validHourRange(key: string): OptionProcessorFunction { - return numbersInRange(key, 0, 23); -} - -function validDateArray(key: string): OptionProcessorFunction { - return ({ value, providedType, localization }) => { - if (value === undefined) { - return []; - } - typeCheckDateArray(key, value, providedType, localization); - return value; - }; -} - -function validKeyOption(keyOptions: string[]): OptionProcessorFunction { - return ({ value, path }) => { - if (!keyOptions.includes(value)) - Namespace.errorMessages.unexpectedOptionValue( - path.substring(1), - value, - keyOptions - ); - return value; - }; -} - -const optionProcessors: { [key: string]: OptionProcessorFunction } = - Object.freeze({ - defaultDate: mandatoryDate('defaultDate'), - viewDate: mandatoryDate('viewDate'), - minDate: optionalDate('restrictions.minDate'), - maxDate: optionalDate('restrictions.maxDate'), - disabledHours: validHourRange('restrictions.disabledHours'), - enabledHours: validHourRange('restrictions.enabledHours'), - disabledDates: validDateArray('restrictions.disabledDates'), - enabledDates: validDateArray('restrictions.enabledDates'), - daysOfWeekDisabled: numbersInRange('restrictions.daysOfWeekDisabled', 0, 6), - disabledTimeIntervals: ({ key, value, providedType, localization }) => { - if (value === undefined) { - return []; - } - if (!Array.isArray(value)) { - Namespace.errorMessages.typeMismatch( - key, - providedType, - 'array of { from: DateTime|Date, to: DateTime|Date }' - ); - } - const valueObject = value as { from: any; to: any }[]; //eslint-disable-line @typescript-eslint/no-explicit-any - for (let i = 0; i < valueObject.length; i++) { - Object.keys(valueObject[i]).forEach((vk) => { - const subOptionName = `${key}[${i}].${vk}`; - const d = valueObject[i][vk]; - const dateTime = convertToDateTime(d, subOptionName, localization); - dateTime.setLocalization(localization); - valueObject[i][vk] = dateTime; - }); - } - return valueObject; - }, - toolbarPlacement: validKeyOption(['top', 'bottom', 'default']), - type: validKeyOption(['icons', 'sprites']), - viewMode: validKeyOption([ - 'clock', - 'calendar', - 'months', - 'years', - 'decades', - ]), - theme: validKeyOption(['light', 'dark', 'auto']), - placement: validKeyOption(['top', 'bottom']), - meta: ({ value }) => value, - dayViewHeaderFormat: ({ value }) => value, - container: ({ value, path }) => { - if ( - value && - !( - value instanceof HTMLElement || - value instanceof Element || - value?.appendChild - ) - ) { - Namespace.errorMessages.typeMismatch( - path.substring(1), - typeof value, - 'HTMLElement' - ); - } - return value; - }, - useTwentyfourHour: ({ value, path, providedType, defaultType }) => { - Namespace.errorMessages.deprecatedWarning( - 'useTwentyfourHour', - 'Please use "options.localization.hourCycle" instead' - ); - if (value === undefined || providedType === 'boolean') return value; - Namespace.errorMessages.typeMismatch(path, providedType, defaultType); - }, - hourCycle: validKeyOption(['h11', 'h12', 'h23', 'h24']), - }); - -const defaultProcessor: OptionProcessorFunction = ({ - value, - defaultType, - providedType, - path, -}) => { - switch (defaultType) { - case 'boolean': - return value === 'true' || value === true; - case 'number': - return +value; - case 'string': - return value.toString(); - case 'object': - return {}; - case 'function': - return value; - default: - Namespace.errorMessages.typeMismatch(path, providedType, defaultType); - } -}; - -export function processKey(this: void, args: OptionProcessorFunctionArguments) { - return (optionProcessors[args.key] || defaultProcessor)(args); -} diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/utilities/options.ts b/node_modules/@eonasdan/tempus-dominus/src/js/utilities/options.ts deleted file mode 100644 index ed75931..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/utilities/options.ts +++ /dev/null @@ -1,112 +0,0 @@ -import { DateTime, DateTimeFormatOptions } from '../datetime'; -import ViewMode from './view-mode'; - -export default interface Options { - allowInputToggle?: boolean; - container?: HTMLElement; - dateRange?: boolean; - debug?: boolean; - defaultDate?: DateTime; - display?: { - toolbarPlacement?: 'top' | 'bottom'; - components?: { - calendar?: boolean; - date?: boolean; - month?: boolean; - year?: boolean; - decades?: boolean; - clock?: boolean; - hours?: boolean; - minutes?: boolean; - seconds?: boolean; - useTwentyfourHour?: boolean; - }; - buttons?: { today?: boolean; close?: boolean; clear?: boolean }; - calendarWeeks?: boolean; - icons?: { - clear?: string; - close?: string; - date?: string; - down?: string; - next?: string; - previous?: string; - time?: string; - today?: string; - type?: 'icons' | 'sprites'; - up?: string; - }; - viewMode?: keyof ViewMode; - sideBySide?: boolean; - inline?: boolean; - keepOpen?: boolean; - theme?: 'light' | 'dark' | 'auto'; - placement?: 'top' | 'bottom'; - }; - keepInvalid?: boolean; - localization?: Localization; - meta?: Record; - multipleDates?: boolean; - multipleDatesSeparator?: string; - promptTimeOnDateChange?: boolean; - promptTimeOnDateChangeTransitionDelay?: number; - restrictions?: { - minDate?: DateTime; - maxDate?: DateTime; - enabledDates?: DateTime[]; - disabledDates?: DateTime[]; - enabledHours?: number[]; - disabledHours?: number[]; - disabledTimeIntervals?: { from: DateTime; to: DateTime }[]; - daysOfWeekDisabled?: number[]; - }; - stepping?: number; - useCurrent?: boolean; - viewDate?: DateTime; -} - -export interface FormatLocalization { - dateFormats?: { - L?: string; - LL?: string; - LLL?: string; - LLLL?: string; - LT?: string; - LTS?: string; - }; - format?: string; - hourCycle?: Intl.LocaleHourCycleKey; - locale?: string; - ordinal?: (n: number) => any; //eslint-disable-line @typescript-eslint/no-explicit-any -} - -export interface Localization extends FormatLocalization { - clear?: string; - close?: string; - dayViewHeaderFormat?: DateTimeFormatOptions; - decrementHour?: string; - decrementMinute?: string; - decrementSecond?: string; - incrementHour?: string; - incrementMinute?: string; - incrementSecond?: string; - maxWeekdayLength?: number; - nextCentury?: string; - nextDecade?: string; - nextMonth?: string; - nextYear?: string; - pickHour?: string; - pickMinute?: string; - pickSecond?: string; - previousCentury?: string; - previousDecade?: string; - previousMonth?: string; - previousYear?: string; - selectDate?: string; - selectDecade?: string; - selectMonth?: string; - selectTime?: string; - selectYear?: string; - startOfTheWeek?: number; - today?: string; - toggleMeridiem?: string; -} diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/utilities/optionsStore.ts b/node_modules/@eonasdan/tempus-dominus/src/js/utilities/optionsStore.ts deleted file mode 100644 index 00e5627..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/utilities/optionsStore.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { DateTime } from '../datetime'; -import CalendarModes from './calendar-modes'; -import ViewMode from './view-mode'; -import Options from './options'; - -export class OptionsStore { - options: Options; - element: HTMLElement; - input: HTMLInputElement; - unset: boolean; - private _currentCalendarViewMode = 0; - - get currentCalendarViewMode() { - return this._currentCalendarViewMode; - } - - set currentCalendarViewMode(value) { - this._currentCalendarViewMode = value; - this.currentView = CalendarModes[value].name; - } - - _viewDate = new DateTime(); - - get viewDate() { - return this._viewDate; - } - - set viewDate(v) { - this._viewDate = v; - if (this.options) this.options.viewDate = v; - } - - /** - * When switching back to the calendar from the clock, - * this sets currentView to the correct calendar view. - */ - refreshCurrentView() { - this.currentView = CalendarModes[this.currentCalendarViewMode].name; - } - - minimumCalendarViewMode = 0; - currentView: keyof ViewMode = 'calendar'; - - get isTwelveHour() { - return ['h12', 'h11'].includes(this.options.localization.hourCycle); - } -} diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/utilities/service-locator.ts b/node_modules/@eonasdan/tempus-dominus/src/js/utilities/service-locator.ts deleted file mode 100644 index d534907..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/utilities/service-locator.ts +++ /dev/null @@ -1,19 +0,0 @@ -//eslint-disable-next-line @typescript-eslint/no-explicit-any -export declare type Constructable = new (...args: any[]) => T; - -class ServiceLocator { - private cache: Map, unknown | symbol> = new Map(); - - locate(identifier: Constructable): T { - const service = this.cache.get(identifier); - if (service) return service as T; - const value = new identifier(); - this.cache.set(identifier, value); - return value; - } -} -export const setupServiceLocator = () => { - serviceLocator = new ServiceLocator(); -}; - -export let serviceLocator: ServiceLocator; diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/utilities/typeChecker.ts b/node_modules/@eonasdan/tempus-dominus/src/js/utilities/typeChecker.ts deleted file mode 100644 index 8678710..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/utilities/typeChecker.ts +++ /dev/null @@ -1,108 +0,0 @@ -import Namespace from './namespace'; -import { DateTime } from '../datetime'; -import { FormatLocalization } from './options'; -import DefaultFormatLocalization from './default-format-localization'; - -/** - * Attempts to prove `d` is a DateTime or Date or can be converted into one. - * @param d If a string will attempt creating a date from it. - * @param localization object containing locale and format settings. Only used with the custom formats - * @private - */ -export function tryConvertToDateTime( - this: void, - d: DateTime | Date | string, - localization: FormatLocalization -): DateTime | null { - if (!d) return null; - if (d.constructor.name === DateTime.name) return d as DateTime; - if (d.constructor.name === Date.name) { - return DateTime.convert(d as Date); - } - if (typeof d === typeof '') { - const dateTime = DateTime.fromString(d as unknown as string, localization); - if (JSON.stringify(dateTime) === 'null') { - return null; - } - return dateTime; - } - return null; -} - -/** - * Attempts to convert `d` to a DateTime object - * @param d value to convert - * @param optionName Provides text to error messages e.g. disabledDates - * @param localization object containing locale and format settings. Only used with the custom formats - */ -export function convertToDateTime( - this: void, - d: DateTime | Date | string, - optionName: string, - localization: FormatLocalization -): DateTime { - if (typeof d === typeof '' && optionName !== 'input') { - Namespace.errorMessages.dateString(); - } - - const converted = tryConvertToDateTime(d, localization); - - if (!converted) { - Namespace.errorMessages.failedToParseDate( - optionName, - d, - optionName === 'input' - ); - } - return converted; -} - -/** - * Type checks that `value` is an array of Date or DateTime - * @param optionName Provides text to error messages e.g. disabledDates - * @param value Option value - * @param providedType Used to provide text to error messages - * @param localization - */ -export function typeCheckDateArray( - this: void, - optionName: string, - value: any, //eslint-disable-line @typescript-eslint/no-explicit-any - providedType: string, - localization: FormatLocalization = DefaultFormatLocalization -) { - if (!Array.isArray(value)) { - Namespace.errorMessages.typeMismatch( - optionName, - providedType, - 'array of DateTime or Date' - ); - } - for (let i = 0; i < value.length; i++) { - const d = value[i]; - const dateTime = convertToDateTime(d, optionName, localization); - dateTime.setLocalization(localization); - value[i] = dateTime; - } -} - -/** - * Type checks that `value` is an array of numbers - * @param optionName Provides text to error messages e.g. disabledDates - * @param value Option value - * @param providedType Used to provide text to error messages - */ -export function typeCheckNumberArray( - this: void, - optionName: string, - value: any, //eslint-disable-line @typescript-eslint/no-explicit-any - providedType: string -) { - if (!Array.isArray(value) || value.some((x) => typeof x !== typeof 0)) { - Namespace.errorMessages.typeMismatch( - optionName, - providedType, - 'array of numbers' - ); - } -} diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/utilities/view-mode.ts b/node_modules/@eonasdan/tempus-dominus/src/js/utilities/view-mode.ts deleted file mode 100644 index 9809036..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/utilities/view-mode.ts +++ /dev/null @@ -1,9 +0,0 @@ -type ViewMode = { - clock; - calendar; - months; - years; - decades; -}; - -export default ViewMode; diff --git a/node_modules/@eonasdan/tempus-dominus/src/js/validation.ts b/node_modules/@eonasdan/tempus-dominus/src/js/validation.ts deleted file mode 100644 index cebabab..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/js/validation.ts +++ /dev/null @@ -1,223 +0,0 @@ -import { DateTime, Unit } from './datetime'; -import { serviceLocator } from './utilities/service-locator'; -import { OptionsStore } from './utilities/optionsStore'; - -/** - * Main class for date validation rules based on the options provided. - */ -export default class Validation { - private optionsStore: OptionsStore; - - constructor() { - this.optionsStore = serviceLocator.locate(OptionsStore); - } - - /** - * Checks to see if the target date is valid based on the rules provided in the options. - * Granularity can be provided to check portions of the date instead of the whole. - * @param targetDate - * @param granularity - */ - isValid(targetDate: DateTime, granularity?: Unit): boolean { - if (!this._enabledDisabledDatesIsValid(granularity, targetDate)) - return false; - - if ( - granularity !== Unit.month && - granularity !== Unit.year && - this.optionsStore.options.restrictions.daysOfWeekDisabled?.length > 0 && - this.optionsStore.options.restrictions.daysOfWeekDisabled.indexOf( - targetDate.weekDay - ) !== -1 - ) - return false; - - if (!this._minMaxIsValid(granularity, targetDate)) return false; - - if ( - granularity === Unit.hours || - granularity === Unit.minutes || - granularity === Unit.seconds - ) { - if (!this._enabledDisabledHoursIsValid(targetDate)) return false; - - if ( - this.optionsStore.options.restrictions.disabledTimeIntervals?.filter( - (internal) => targetDate.isBetween(internal.from, internal.to) - ).length !== 0 - ) - return false; - } - - return true; - } - - private _enabledDisabledDatesIsValid( - granularity: Unit, - targetDate: DateTime - ): boolean { - if (granularity !== Unit.date) return true; - - if ( - this.optionsStore.options.restrictions.disabledDates.length > 0 && - this._isInDisabledDates(targetDate) - ) { - return false; - } - - // noinspection RedundantIfStatementJS - if ( - this.optionsStore.options.restrictions.enabledDates.length > 0 && - !this._isInEnabledDates(targetDate) - ) { - return false; - } - - return true; - } - - /** - * Checks to see if the disabledDates option is in use and returns true (meaning invalid) - * if the `testDate` is with in the array. Granularity is by date. - * @param testDate - * @private - */ - private _isInDisabledDates(testDate: DateTime) { - if ( - !this.optionsStore.options.restrictions.disabledDates || - this.optionsStore.options.restrictions.disabledDates.length === 0 - ) - return false; - - return !!this.optionsStore.options.restrictions.disabledDates.find((x) => - x.isSame(testDate, Unit.date) - ); - } - - /** - * Checks to see if the enabledDates option is in use and returns true (meaning valid) - * if the `testDate` is with in the array. Granularity is by date. - * @param testDate - * @private - */ - private _isInEnabledDates(testDate: DateTime) { - if ( - !this.optionsStore.options.restrictions.enabledDates || - this.optionsStore.options.restrictions.enabledDates.length === 0 - ) - return true; - - return !!this.optionsStore.options.restrictions.enabledDates.find((x) => - x.isSame(testDate, Unit.date) - ); - } - - private _minMaxIsValid(granularity: Unit, targetDate: DateTime) { - if ( - this.optionsStore.options.restrictions.minDate && - targetDate.isBefore( - this.optionsStore.options.restrictions.minDate, - granularity - ) - ) { - return false; - } - - // noinspection RedundantIfStatementJS - if ( - this.optionsStore.options.restrictions.maxDate && - targetDate.isAfter( - this.optionsStore.options.restrictions.maxDate, - granularity - ) - ) { - return false; - } - - return true; - } - - private _enabledDisabledHoursIsValid(targetDate) { - if ( - this.optionsStore.options.restrictions.disabledHours.length > 0 && - this._isInDisabledHours(targetDate) - ) { - return false; - } - - // noinspection RedundantIfStatementJS - if ( - this.optionsStore.options.restrictions.enabledHours.length > 0 && - !this._isInEnabledHours(targetDate) - ) { - return false; - } - - return true; - } - - /** - * Checks to see if the disabledHours option is in use and returns true (meaning invalid) - * if the `testDate` is with in the array. Granularity is by hours. - * @param testDate - * @private - */ - private _isInDisabledHours(testDate: DateTime) { - if ( - !this.optionsStore.options.restrictions.disabledHours || - this.optionsStore.options.restrictions.disabledHours.length === 0 - ) - return false; - - const formattedDate = testDate.hours; - return this.optionsStore.options.restrictions.disabledHours.includes( - formattedDate - ); - } - - /** - * Checks to see if the enabledHours option is in use and returns true (meaning valid) - * if the `testDate` is with in the array. Granularity is by hours. - * @param testDate - * @private - */ - private _isInEnabledHours(testDate: DateTime) { - if ( - !this.optionsStore.options.restrictions.enabledHours || - this.optionsStore.options.restrictions.enabledHours.length === 0 - ) - return true; - - const formattedDate = testDate.hours; - return this.optionsStore.options.restrictions.enabledHours.includes( - formattedDate - ); - } - - dateRangeIsValid(dates: DateTime[], index: number, target: DateTime) { - // if we're not using the option, then return valid - if (!this.optionsStore.options.dateRange) return true; - - // if we've only selected 0..1 dates, and we're not setting the end date - // then return valid. We only want to validate the range if both are selected, - // because the other validation on the target has already occurred. - if (dates.length !== 2 && index !== 1) return true; - - // initialize start date - const start = dates[0].clone; - // check if start date is not the same as target date - if (start.isSame(target, Unit.date)) return true; - - // add one day to start; start has already been validated - start.manipulate(1, Unit.date); - - // check each date in the range to make sure it's valid - while (!start.isSame(target, Unit.date)) { - const valid = this.isValid(start, Unit.date); - if (!valid) return false; - start.manipulate(1, Unit.date); - } - - return true; - } -} diff --git a/node_modules/@eonasdan/tempus-dominus/src/scss/_variables.scss b/node_modules/@eonasdan/tempus-dominus/src/scss/_variables.scss deleted file mode 100644 index 4b34aaa..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/scss/_variables.scss +++ /dev/null @@ -1,35 +0,0 @@ -@use 'sass:color'; - -$td-light: #fff !default; -$td-widget-background: $td-light !default; -$td-font-color: #000 !default; -$td-timepicker-font-size: 1.2em !default; -$td-active-bg: #0d6efd !default; -$td-range-bg: color.scale($td-active-bg, $lightness: -40%); -$td-active-color: $td-light !default; -$td-active-border-color: $td-light; -$td-border-radius: 999px !default; -$td-btn-hover-bg: #e9ecef !default; -$td-disabled-color: #6c757d !default; -$td-alternate-color: rgba(0, 0, 0, 0.38) !default; -$td-secondary-border-color: #ccc !default; -$td-secondary-border-color-rgba: rgba(0, 0, 0, 0.2) !default; -$td-primary-border-color: $td-light !default; -$td-text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25) !default; -$td-dow-color: rgba(0, 0, 0, 0.5); - -$td-dark: #1b1b1b !default; -$td-dark-widget-background: $td-dark !default; -$td-dark-font-color: #e3e3e3; -$td-dark-active-bg: #4db2ff !default; -$td-dark-range-bg: color.scale($td-dark-active-bg, $lightness: -40%); -$td-dark-active-color: #fff !default; -$td-dark-active-border-color: $td-dark; -$td-dark-btn-hover-bg: rgb(35, 38, 39) !default; -$td-dark-disabled-color: #6c757d !default; -$td-dark-alternate-color: rgba(232, 230, 227, 0.38) !default; -$td-dark-secondary-border-color: #ccc !default; -$td-dark-secondary-border-color-rgba: rgba(232, 230, 227, 0.2) !default; -$td-dark-primary-border-color: $td-dark !default; -$td-dark-text-shadow: 0 -1px 0 rgba(232, 230, 227, 0.25) !default; -$td-dark-dow-color: rgba(232, 230, 227, 0.5); diff --git a/node_modules/@eonasdan/tempus-dominus/src/scss/tempus-dominus.scss b/node_modules/@eonasdan/tempus-dominus/src/scss/tempus-dominus.scss deleted file mode 100644 index f7c32de..0000000 --- a/node_modules/@eonasdan/tempus-dominus/src/scss/tempus-dominus.scss +++ /dev/null @@ -1,485 +0,0 @@ -@import 'variables'; - -.visually-hidden { - position: absolute !important; - width: 1px !important; - height: 1px !important; - padding: 0 !important; - margin: -1px !important; // Fix for https://github.com/twbs/bootstrap/issues/25686 - overflow: hidden !important; - clip: rect(0, 0, 0, 0) !important; - white-space: nowrap !important; - border: 0 !important; -} - -.tempus-dominus-widget { - list-style: none; - padding: 4px; - width: 19rem; - border-radius: 4px; - display: none; - z-index: 9999; - box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.2), 0 4px 5px 0 rgba(0, 0, 0, 0.14), - 0 1px 10px 0 rgba(0, 0, 0, 0.12); - - &.calendarWeeks { - width: 21rem; - - & .date-container-days { - grid-auto-columns: 12.5%; - grid-template-areas: 'a a a a a a a a'; - } - } - - [data-action] { - cursor: pointer; - - &::after { - @extend .visually-hidden; - content: attr(title); - } - - &.disabled, - &.disabled:hover { - background: none; - cursor: not-allowed; - } - } - - //popper - .arrow { - display: none; - } - - //end popper - - &.show { - display: block; - &.date-container { - min-height: 315px; - } - - &.time-container { - min-height: 217px; - } - } - - .td-collapse { - &:not(.show) { - display: none; - } - } - - .td-collapsing { - height: 0; - overflow: hidden; - transition: height 0.35s ease; - } - - &.timepicker-sbs { - @media (min-width: 576px) { - width: 38em; - } - - @media (min-width: 768px) { - width: 38em; - } - - @media (min-width: 992px) { - width: 38em; - } - - .td-row { - display: flex; - - .td-half { - flex: 0 0 auto; - width: 50%; - } - } - } - - div[data-action]:active { - box-shadow: none; - } - - .timepicker-hour, - .timepicker-minute, - .timepicker-second { - width: 54px; - font-weight: bold; - font-size: $td-timepicker-font-size; - margin: 0; - } - - button[data-action] { - padding: 6px; - } - - .toggleMeridiem { - text-align: center; - height: 38px; - } - - .calendar-header { - display: grid; - grid-template-areas: 'a a a'; - margin-bottom: 10px; - font-weight: bold; - - & .next { - text-align: right; - padding-right: 10px; - } - - & .previous { - text-align: left; - padding-left: 10px; - } - - & .picker-switch { - text-align: center; - } - } - - .toolbar { - display: grid; - grid-auto-flow: column; - grid-auto-rows: 40px; - - & div { - border-radius: $td-border-radius; - align-items: center; - justify-content: center; - box-sizing: border-box; - display: flex; - } - } - - .date-container-days { - display: grid; - grid-template-areas: 'a a a a a a a'; - grid-auto-rows: 40px; - grid-auto-columns: calc(100% / 7); - - .range-in { - @extend .active; - background-color: $td-range-bg !important; - border: none; - border-radius: 0 !important; - box-shadow: -5px 0 0 $td-range-bg, 5px 0 0 $td-range-bg; - } - - .range-end { - @extend .active; - border-radius: 0 50px 50px 0 !important; - } - - .range-start { - @extend .active; - border-radius: 50px 0 0 50px !important; - } - - & .dow { - align-items: center; - justify-content: center; - text-align: center; - } - - & .cw { - width: 90%; - height: 90%; - align-items: center; - justify-content: center; - display: flex; - font-size: 0.8em; - line-height: 20px; - cursor: default; - } - } - - .date-container-decades, - .date-container-years, - .date-container-months { - display: grid; - grid-template-areas: 'a a a'; - grid-auto-rows: calc(calc(19rem - 2 * 4px) / 7); - } - - .time-container-hour, - .time-container-minute, - .time-container-second { - display: grid; - grid-template-areas: 'a a a a'; - grid-auto-rows: calc(calc(19rem - 2 * 4px) / 7); - } - - .time-container-clock { - display: grid; - grid-auto-rows: calc(calc(19rem - 2 * 4px) / 7); - - & .no-highlight { - width: 90%; - height: 90%; - align-items: center; - justify-content: center; - display: flex; - } - } - - .date-container-decades, - .date-container-years, - .date-container-months, - .date-container-days, - .time-container-clock, - .time-container-hour, - .time-container-minute, - .time-container-second { - div:not(.no-highlight) { - width: 90%; - height: 90%; - border-radius: $td-border-radius; - align-items: center; - justify-content: center; - box-sizing: border-box; - display: flex; - - &.disabled, - &.disabled:hover { - background: none; - cursor: not-allowed; - } - - &.today { - position: relative; - - &:before { - content: ''; - display: inline-block; - border: solid transparent; - border-width: 0 0 7px 7px; - position: absolute; - bottom: 6px; - right: 6px; - } - } - } - } - - .time-container { - margin-bottom: 0.5rem; - } - - button { - display: inline-block; - font-weight: 400; - line-height: 1.5; - text-align: center; - text-decoration: none; - vertical-align: middle; - cursor: pointer; - -webkit-user-select: none; - -moz-user-select: none; - user-select: none; - padding: 0.375rem 0.75rem; - font-size: 1rem; - border-radius: 0.25rem; - transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, - border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; - } - - &.tempus-dominus-widget-readonly { - table td.day, - table td.hour, - table td.minute, - table td.second, - table td [data-action='incrementHours'], - table td [data-action='incrementMinutes'], - table td [data-action='incrementSeconds'], - table td [data-action='decrementHours'], - table td [data-action='decrementMinutes'], - table td [data-action='decrementSeconds'], - table td [data-action='showHours'], - table td [data-action='showMinutes'], - table td [data-action='showSeconds'], - table td [data-action='togglePeriod'] { - pointer-events: none; - cursor: default; - - &:hover { - background: none; - } - } - } - - &.light { - color: $td-font-color; - background-color: $td-widget-background; - - [data-action] { - &.disabled, - &.disabled:hover { - color: $td-disabled-color; - } - } - - .toolbar { - & div { - &:hover { - background: $td-btn-hover-bg; - } - } - } - - .date-container-days { - & .dow { - color: $td-dow-color; - } - - & .cw { - color: $td-alternate-color; - } - } - - .date-container-decades, - .date-container-years, - .date-container-months, - .date-container-days, - .time-container-clock, - .time-container-hour, - .time-container-minute, - .time-container-second { - div:not(.no-highlight) { - &:hover { - background: $td-btn-hover-bg; - } - - &.active { - background-color: $td-active-bg; - color: $td-active-color; - text-shadow: $td-text-shadow; - - &.old, - &.new { - color: $td-active-color; - } - } - - &.active.today:before { - border-bottom-color: $td-active-border-color; - } - - &.old, - &.new { - color: $td-alternate-color; - } - - &.disabled, - &.disabled:hover { - color: $td-disabled-color; - } - - &.today { - &:before { - border-bottom-color: $td-active-bg; - border-top-color: $td-secondary-border-color-rgba; - } - } - } - } - - button { - color: $td-active-color; - background-color: $td-active-bg; - border-color: $td-active-bg; - } - } - - &.dark { - color: $td-dark-font-color; - background-color: $td-dark-widget-background; - - [data-action] { - &.disabled, - &.disabled:hover { - color: $td-dark-disabled-color; - } - } - - .toolbar { - & div { - &:hover { - background: $td-dark-btn-hover-bg; - } - } - } - - .date-container-days { - & .dow { - color: $td-dark-dow-color; - } - - .range-in { - background-color: $td-dark-range-bg !important; - box-shadow: -5px 0 0 $td-dark-range-bg, 5px 0 0 $td-dark-range-bg; - } - - & .cw { - color: $td-dark-alternate-color; - } - } - - .date-container-decades, - .date-container-years, - .date-container-months, - .date-container-days, - .time-container-clock, - .time-container-hour, - .time-container-minute, - .time-container-second { - div:not(.no-highlight) { - &:hover { - background: $td-dark-btn-hover-bg; - } - - &.active { - background-color: $td-dark-active-bg; - color: $td-dark-active-color; - text-shadow: $td-dark-text-shadow; - - &.old, - &.new { - color: $td-dark-active-color; - } - } - - &.active.today:before { - border-bottom-color: $td-dark-active-border-color; - } - - &.old, - &.new { - color: $td-dark-alternate-color; - } - - &.disabled, - &.disabled:hover { - color: $td-dark-disabled-color; - } - - &.today { - &:before { - border-bottom-color: $td-dark-active-bg; - border-top-color: $td-dark-secondary-border-color-rgba; - } - } - } - } - - button { - color: $td-dark-active-color; - background-color: $td-dark-active-bg; - border-color: $td-dark-active-bg; - } - } -} diff --git a/node_modules/@eonasdan/tempus-dominus/types/actions.d.ts b/node_modules/@eonasdan/tempus-dominus/types/actions.d.ts deleted file mode 100644 index 31ad96c..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/actions.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -import ActionTypes from './utilities/action-types'; -/** - * Logic for various click actions - */ -export default class Actions { - private optionsStore; - private validation; - private dates; - private display; - private _eventEmitters; - constructor(); - /** - * Performs the selected `action`. See ActionTypes - * @param e This is normally a click event - * @param action If not provided, then look for a [data-action] - */ - do(e: any, action?: ActionTypes): void; - private handleShowClockContainers; - private handleNextPrevious; - /** - * After setting the value it will either show the clock or hide the widget. - * @param e - */ - private hideOrClock; - /** - * Common function to manipulate {@link lastPicked} by `unit`. - * @param lastPicked - * @param unit - * @param value Value to change by - */ - private manipulateAndSet; - private handleSelectCalendarMode; - private handleToggle; - private handleSelectDay; - private handleMultiDate; - private handleDateRange; -} diff --git a/node_modules/@eonasdan/tempus-dominus/types/dates.d.ts b/node_modules/@eonasdan/tempus-dominus/types/dates.d.ts deleted file mode 100644 index 2228546..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/dates.d.ts +++ /dev/null @@ -1,79 +0,0 @@ -import { DateTime, Unit } from './datetime'; -export default class Dates { - private _dates; - private optionsStore; - private validation; - private _eventEmitters; - constructor(); - /** - * Returns the array of selected dates - */ - get picked(): DateTime[]; - /** - * Returns the last picked value. - */ - get lastPicked(): DateTime; - /** - * Returns the length of picked dates -1 or 0 if none are selected. - */ - get lastPickedIndex(): number; - /** - * Formats a DateTime object to a string. Used when setting the input value. - * @param date - */ - formatInput(date: DateTime): string; - /** - * parse the value into a DateTime object. - * this can be overwritten to supply your own parsing. - */ - parseInput(value: any): DateTime; - /** - * Tries to convert the provided value to a DateTime object. - * If value is null|undefined then clear the value of the provided index (or 0). - * @param value Value to convert or null|undefined - * @param index When using multidates this is the index in the array - */ - setFromInput(value: any, index?: number): void; - /** - * Adds a new DateTime to selected dates array - * @param date - */ - add(date: DateTime): void; - /** - * Returns true if the `targetDate` is part of the selected dates array. - * If `unit` is provided then a granularity to that unit will be used. - * @param targetDate - * @param unit - */ - isPicked(targetDate: DateTime, unit?: Unit): boolean; - /** - * Returns the index at which `targetDate` is in the array. - * This is used for updating or removing a date when multi-date is used - * If `unit` is provided then a granularity to that unit will be used. - * @param targetDate - * @param unit - */ - pickedIndex(targetDate: DateTime, unit?: Unit): number; - /** - * Clears all selected dates. - */ - clear(): void; - /** - * Find the "book end" years given a `year` and a `factor` - * @param factor e.g. 100 for decades - * @param year e.g. 2021 - */ - static getStartEndYear(factor: number, year: number): [number, number, number]; - updateInput(target?: DateTime): void; - /** - * Attempts to either clear or set the `target` date at `index`. - * If the `target` is null then the date will be cleared. - * If multi-date is being used then it will be removed from the array. - * If `target` is valid and multi-date is used then if `index` is - * provided the date at that index will be replaced, otherwise it is appended. - * @param target - * @param index - */ - setValue(target?: DateTime, index?: number): void; - private _setValueNull; -} diff --git a/node_modules/@eonasdan/tempus-dominus/types/datetime.d.ts b/node_modules/@eonasdan/tempus-dominus/types/datetime.d.ts deleted file mode 100644 index db62632..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/datetime.d.ts +++ /dev/null @@ -1,257 +0,0 @@ -import { FormatLocalization } from './utilities/options'; -export declare enum Unit { - seconds = "seconds", - minutes = "minutes", - hours = "hours", - date = "date", - month = "month", - year = "year" -} -export interface DateTimeFormatOptions extends Intl.DateTimeFormatOptions { - timeStyle?: 'short' | 'medium' | 'long'; - dateStyle?: 'short' | 'medium' | 'long' | 'full'; - numberingSystem?: string; -} -/** - * Returns an Intl format object based on the provided object - * @param unit - */ -export declare const getFormatByUnit: (unit: Unit) => object; -/** - * Attempts to guess the hour cycle of the given local - * @param locale - */ -export declare const guessHourCycle: (locale: string) => Intl.LocaleHourCycleKey; -/** - * For the most part this object behaves exactly the same way - * as the native Date object with a little extra spice. - */ -export declare class DateTime extends Date { - localization: FormatLocalization; - /** - * Chainable way to set the {@link locale} - * @param value - * @deprecated use setLocalization with a FormatLocalization object instead - */ - setLocale(value: string): this; - /** - * Chainable way to set the {@link localization} - * @param value - */ - setLocalization(value: FormatLocalization): this; - /** - * Converts a plain JS date object to a DateTime object. - * Doing this allows access to format, etc. - * @param date - * @param locale this parameter is deprecated. Use formatLocalization instead. - * @param formatLocalization - */ - static convert(date: Date, locale?: string, formatLocalization?: FormatLocalization): DateTime; - /** - * Native date manipulations are not pure functions. This function creates a duplicate of the DateTime object. - */ - get clone(): DateTime; - static isValid(d: any): boolean; - /** - * Sets the current date to the start of the {@link unit} provided - * Example: Consider a date of "April 30, 2021, 11:45:32.984 AM" => new DateTime(2021, 3, 30, 11, 45, 32, 984).startOf('month') - * would return April 1, 2021, 12:00:00.000 AM (midnight) - * @param unit - * @param startOfTheWeek Allows for the changing the start of the week. - */ - startOf(unit: Unit | 'weekDay', startOfTheWeek?: number): this; - /** - * Sets the current date to the end of the {@link unit} provided - * Example: Consider a date of "April 30, 2021, 11:45:32.984 AM" => new DateTime(2021, 3, 30, 11, 45, 32, 984).endOf('month') - * would return April 30, 2021, 11:59:59.999 PM - * @param unit - * @param startOfTheWeek - */ - endOf(unit: Unit | 'weekDay', startOfTheWeek?: number): this; - /** - * Change a {@link unit} value. Value can be positive or negative - * Example: Consider a date of "April 30, 2021, 11:45:32.984 AM" => new DateTime(2021, 3, 30, 11, 45, 32, 984).manipulate(1, 'month') - * would return May 30, 2021, 11:45:32.984 AM - * @param value A positive or negative number - * @param unit - */ - manipulate(value: number, unit: Unit): this; - /** - * Return true if {@link compare} is before this date - * @param compare The Date/DateTime to compare - * @param unit If provided, uses {@link startOf} for - * comparison. - */ - isBefore(compare: DateTime, unit?: Unit): boolean; - /** - * Return true if {@link compare} is after this date - * @param compare The Date/DateTime to compare - * @param unit If provided, uses {@link startOf} for - * comparison. - */ - isAfter(compare: DateTime, unit?: Unit): boolean; - /** - * Return true if {@link compare} is same this date - * @param compare The Date/DateTime to compare - * @param unit If provided, uses {@link startOf} for - * comparison. - */ - isSame(compare: DateTime, unit?: Unit): boolean; - /** - * Check if this is between two other DateTimes, optionally looking at unit scale. The match is exclusive. - * @param left - * @param right - * @param unit. - * @param inclusivity. A [ indicates inclusion of a value. A ( indicates exclusion. - * If the inclusivity parameter is used, both indicators must be passed. - */ - isBetween(left: DateTime, right: DateTime, unit?: Unit, inclusivity?: '()' | '[]' | '(]' | '[)'): boolean; - /** - * Returns flattened object of the date. Does not include literals - * @param locale - * @param template - */ - parts(locale?: string, template?: Record): Record; - /** - * Shortcut to Date.getSeconds() - */ - get seconds(): number; - /** - * Shortcut to Date.setSeconds() - */ - set seconds(value: number); - /** - * Returns two digit hours - */ - get secondsFormatted(): string; - /** - * Shortcut to Date.getMinutes() - */ - get minutes(): number; - /** - * Shortcut to Date.setMinutes() - */ - set minutes(value: number); - /** - * Returns two digit minutes - */ - get minutesFormatted(): string; - /** - * Shortcut to Date.getHours() - */ - get hours(): number; - /** - * Shortcut to Date.setHours() - */ - set hours(value: number); - /** - * Returns two digit hour, e.g. 01...10 - * @param hourCycle Providing an hour cycle will change 00 to 24 depending on the given value. - */ - getHoursFormatted(hourCycle?: Intl.LocaleHourCycleKey): string; - /** - * Get the meridiem of the date. E.g. AM or PM. - * If the {@link locale} provides a "dayPeriod" then this will be returned, - * otherwise it will return AM or PM. - * @param locale - */ - meridiem(locale?: string): string; - /** - * Shortcut to Date.getDate() - */ - get date(): number; - /** - * Shortcut to Date.setDate() - */ - set date(value: number); - /** - * Return two digit date - */ - get dateFormatted(): string; - /** - * Shortcut to Date.getDay() - */ - get weekDay(): number; - /** - * Shortcut to Date.getMonth() - */ - get month(): number; - /** - * Shortcut to Date.setMonth() - */ - set month(value: number); - /** - * Return two digit, human expected month. E.g. January = 1, December = 12 - */ - get monthFormatted(): string; - /** - * Shortcut to Date.getFullYear() - */ - get year(): number; - /** - * Shortcut to Date.setFullYear() - */ - set year(value: number); - /** - * Gets the week of the year - */ - get week(): number; - /** - * Returns the number of weeks in the year - */ - weeksInWeekYear(): 53 | 52; - /** - * Returns true or false depending on if the year is a leap year or not. - */ - get isLeapYear(): boolean; - private computeOrdinal; - private nonLeapLadder; - private leapLadder; - private dateTimeRegex; - private formattingTokens; - /** - * Returns a list of month values based on the current locale - */ - private getAllMonths; - /** - * Replaces an expanded token set (e.g. LT/LTS) - */ - private replaceTokens; - private match2; - private match3; - private match4; - private match1to2; - private matchSigned; - private matchOffset; - private matchWord; - private parseTwoDigitYear; - private offsetFromString; - /** - * z = -4, zz = -04, zzz = -0400 - * @param date - * @param style - * @private - */ - private zoneInformation; - private zoneExpressions; - private addInput; - private getLocaleAfternoon; - private meridiemMatch; - private expressions; - private correctHours; - private makeParser; - /** - * Attempts to create a DateTime from a string. - * @param input date as string - * @param localization provides the date template the string is in via the format property - */ - static fromString(input: string, localization: FormatLocalization): DateTime; - /** - * Returns a string format. - * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat - * for valid templates and locale objects - * @param template An optional object. If provided, method will use Intl., otherwise the localizations format properties - * @param locale Can be a string or an array of strings. Uses browser defaults otherwise. - */ - format(template?: DateTimeFormatOptions | string, locale?: string): string; -} diff --git a/node_modules/@eonasdan/tempus-dominus/types/display/calendar/date-display.d.ts b/node_modules/@eonasdan/tempus-dominus/types/display/calendar/date-display.d.ts deleted file mode 100644 index daf3b68..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/display/calendar/date-display.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { Paint } from '../index'; -/** - * Creates and updates the grid for `date` - */ -export default class DateDisplay { - private optionsStore; - private dates; - private validation; - constructor(); - /** - * Build the container html for the display - * @private - */ - getPicker(): HTMLElement; - /** - * Populates the grid and updates enabled states - * @private - */ - _update(widget: HTMLElement, paint: Paint): void; - private _dateToDataValue; - private _handleDateRange; - private handleMouseEvents; - private _updateCalendarView; - /*** - * Generates a html row that contains the days of the week. - * @private - */ - private _daysOfTheWeek; - private _handleCalendarWeeks; -} diff --git a/node_modules/@eonasdan/tempus-dominus/types/display/calendar/decade-display.d.ts b/node_modules/@eonasdan/tempus-dominus/types/display/calendar/decade-display.d.ts deleted file mode 100644 index 11587f8..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/display/calendar/decade-display.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { Paint } from '../index'; -/** - * Creates and updates the grid for `seconds` - */ -export default class DecadeDisplay { - private _startDecade; - private _endDecade; - private optionsStore; - private dates; - private validation; - constructor(); - /** - * Build the container html for the display - * @private - */ - getPicker(): HTMLDivElement; - /** - * Populates the grid and updates enabled states - * @private - */ - _update(widget: HTMLElement, paint: Paint): void; -} diff --git a/node_modules/@eonasdan/tempus-dominus/types/display/calendar/month-display.d.ts b/node_modules/@eonasdan/tempus-dominus/types/display/calendar/month-display.d.ts deleted file mode 100644 index 54580a2..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/display/calendar/month-display.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { Paint } from '../index'; -/** - * Creates and updates the grid for `month` - */ -export default class MonthDisplay { - private optionsStore; - private dates; - private validation; - constructor(); - /** - * Build the container html for the display - * @private - */ - getPicker(): HTMLElement; - /** - * Populates the grid and updates enabled states - * @private - */ - _update(widget: HTMLElement, paint: Paint): void; -} diff --git a/node_modules/@eonasdan/tempus-dominus/types/display/calendar/year-display.d.ts b/node_modules/@eonasdan/tempus-dominus/types/display/calendar/year-display.d.ts deleted file mode 100644 index 35e6463..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/display/calendar/year-display.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { Paint } from '../index'; -/** - * Creates and updates the grid for `year` - */ -export default class YearDisplay { - private _startYear; - private _endYear; - private optionsStore; - private dates; - private validation; - constructor(); - /** - * Build the container html for the display - * @private - */ - getPicker(): HTMLElement; - /** - * Populates the grid and updates enabled states - * @private - */ - _update(widget: HTMLElement, paint: Paint): void; -} diff --git a/node_modules/@eonasdan/tempus-dominus/types/display/collapse.d.ts b/node_modules/@eonasdan/tempus-dominus/types/display/collapse.d.ts deleted file mode 100644 index a3507f7..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/display/collapse.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Provides a collapse functionality to the view changes - */ -export default class Collapse { - /** - * Flips the show/hide state of `target` - * @param target html element to affect. - */ - static toggle(target: HTMLElement): void; - /** - * Skips any animation or timeouts and immediately set the element to show. - * @param target - */ - static showImmediately(target: HTMLElement): void; - /** - * If `target` is not already showing, then show after the animation. - * @param target - */ - static show(target: HTMLElement): void; - /** - * Skips any animation or timeouts and immediately set the element to hide. - * @param target - */ - static hideImmediately(target: HTMLElement): void; - /** - * If `target` is not already hidden, then hide after the animation. - * @param target HTML Element - */ - static hide(target: HTMLElement): void; - /** - * Gets the transition duration from the `element` by getting css properties - * `transition-duration` and `transition-delay` - * @param element HTML Element - */ - private static getTransitionDurationFromElement; -} diff --git a/node_modules/@eonasdan/tempus-dominus/types/display/index.d.ts b/node_modules/@eonasdan/tempus-dominus/types/display/index.d.ts deleted file mode 100644 index e043854..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/display/index.d.ts +++ /dev/null @@ -1,148 +0,0 @@ -import DateDisplay from './calendar/date-display'; -import MonthDisplay from './calendar/month-display'; -import YearDisplay from './calendar/year-display'; -import DecadeDisplay from './calendar/decade-display'; -import TimeDisplay from './time/time-display'; -import HourDisplay from './time/hour-display'; -import MinuteDisplay from './time/minute-display'; -import SecondDisplay from './time/second-display'; -import { DateTime, Unit } from '../datetime'; -import { ViewUpdateValues } from '../utilities/event-emitter'; -/** - * Main class for all things display related. - */ -export default class Display { - private _widget; - private _popperInstance; - private _isVisible; - private optionsStore; - private validation; - private dates; - dateDisplay: DateDisplay; - monthDisplay: MonthDisplay; - yearDisplay: YearDisplay; - decadeDisplay: DecadeDisplay; - timeDisplay: TimeDisplay; - hourDisplay: HourDisplay; - minuteDisplay: MinuteDisplay; - secondDisplay: SecondDisplay; - private _eventEmitters; - constructor(); - /** - * Returns the widget body or undefined - * @private - */ - get widget(): HTMLElement | undefined; - get dateContainer(): HTMLElement | undefined; - get timeContainer(): HTMLElement | undefined; - /** - * Returns this visible state of the picker (shown) - */ - get isVisible(): boolean; - /** - * Updates the table for a particular unit. Used when an option as changed or - * whenever the class list might need to be refreshed. - * @param unit - * @private - */ - _update(unit: ViewUpdateValues): void; - /** - * Allows developers to add/remove classes from an element. - * @param _unit - * @param _date - * @param _classes - * @param _element - */ - paint(_unit: Unit | 'decade', _date: DateTime, _classes: string[], _element: HTMLElement): void; - /** - * Shows the picker and creates a Popper instance if needed. - * Add document click event to hide when clicking outside the picker. - * fires Events#show - */ - show(): void; - private _showSetupViewMode; - private _showSetDefaultIfNeeded; - createPopup(element: HTMLElement, widget: HTMLElement, options: any): Promise; - updatePopup(): void; - /** - * Changes the calendar view mode. E.g. month <-> year - * @param direction -/+ number to move currentViewMode - * @private - */ - _showMode(direction?: number): void; - /** - * Changes the theme. E.g. light, dark or auto - * @param theme the theme name - * @private - */ - _updateTheme(theme?: 'light' | 'dark' | 'auto'): void; - _getThemeClass(): string; - _updateCalendarHeader(): void; - /** - * Hides the picker if needed. - * Remove document click event to hide when clicking outside the picker. - * fires Events#hide - */ - hide(): void; - /** - * Toggles the picker's open state. Fires a show/hide event depending. - */ - toggle(): void; - /** - * Removes document and data-action click listener and reset the widget - * @private - */ - _dispose(): void; - /** - * Builds the widgets html template. - * @private - */ - private _buildWidget; - private _buildWidgetSideBySide; - /** - * Returns true if the hours, minutes, or seconds component is turned on - */ - get _hasTime(): boolean; - /** - * Returns true if the year, month, or date component is turned on - */ - get _hasDate(): boolean; - get _hasDateAndTime(): boolean; - /** - * Get the toolbar html based on options like buttons => today - * @private - */ - getToolbarElements(): HTMLElement[]; - /*** - * Builds the base header template with next and previous icons - * @private - */ - getHeadTemplate(): HTMLElement; - /** - * Builds an icon tag as either an `` - * or with icons => type is `sprites` then a svg tag instead - * @param iconClass - * @private - */ - _iconTag(iconClass: string): HTMLElement | SVGElement; - /** - * A document click event to hide the widget if click is outside - * @private - * @param e MouseEvent - */ - private _documentClickEvent; - /** - * Click event for any action like selecting a date - * @param e MouseEvent - * @private - */ - private _actionsClickEvent; - /** - * Causes the widget to get rebuilt on next show. If the picker is already open - * then hide and reshow it. - * @private - */ - _rebuild(): void; - refreshCurrentView(): void; -} -export type Paint = (unit: Unit | 'decade', innerDate: DateTime, classes: string[], element: HTMLElement) => void; diff --git a/node_modules/@eonasdan/tempus-dominus/types/display/time/hour-display.d.ts b/node_modules/@eonasdan/tempus-dominus/types/display/time/hour-display.d.ts deleted file mode 100644 index 740b9ed..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/display/time/hour-display.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Paint } from '../index'; -/** - * Creates and updates the grid for `hours` - */ -export default class HourDisplay { - private optionsStore; - private validation; - constructor(); - /** - * Build the container html for the display - * @private - */ - getPicker(): HTMLElement; - /** - * Populates the grid and updates enabled states - * @private - */ - _update(widget: HTMLElement, paint: Paint): void; -} diff --git a/node_modules/@eonasdan/tempus-dominus/types/display/time/minute-display.d.ts b/node_modules/@eonasdan/tempus-dominus/types/display/time/minute-display.d.ts deleted file mode 100644 index b1eb8b2..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/display/time/minute-display.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Paint } from '../index'; -/** - * Creates and updates the grid for `minutes` - */ -export default class MinuteDisplay { - private optionsStore; - private validation; - constructor(); - /** - * Build the container html for the display - * @private - */ - getPicker(): HTMLElement; - /** - * Populates the grid and updates enabled states - * @private - */ - _update(widget: HTMLElement, paint: Paint): void; -} diff --git a/node_modules/@eonasdan/tempus-dominus/types/display/time/second-display.d.ts b/node_modules/@eonasdan/tempus-dominus/types/display/time/second-display.d.ts deleted file mode 100644 index 2751522..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/display/time/second-display.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Paint } from '../index'; -/** - * Creates and updates the grid for `seconds` - */ -export default class secondDisplay { - private optionsStore; - private validation; - constructor(); - /** - * Build the container html for the display - * @private - */ - getPicker(): HTMLElement; - /** - * Populates the grid and updates enabled states - * @private - */ - _update(widget: HTMLElement, paint: Paint): void; -} diff --git a/node_modules/@eonasdan/tempus-dominus/types/display/time/time-display.d.ts b/node_modules/@eonasdan/tempus-dominus/types/display/time/time-display.d.ts deleted file mode 100644 index 4ae29b2..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/display/time/time-display.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Creates the clock display - */ -export default class TimeDisplay { - private _gridColumns; - private optionsStore; - private validation; - private dates; - constructor(); - /** - * Build the container html for the clock display - * @private - */ - getPicker(iconTag: (iconClass: string) => HTMLElement): HTMLElement; - /** - * Populates the various elements with in the clock display - * like the current hour and if the manipulation icons are enabled. - * @private - */ - _update(widget: HTMLElement): void; - /** - * Creates the table for the clock display depending on what options are selected. - * @private - */ - private _grid; -} diff --git a/node_modules/@eonasdan/tempus-dominus/types/locales/ar-SA.d.ts b/node_modules/@eonasdan/tempus-dominus/types/locales/ar-SA.d.ts deleted file mode 100644 index 2f2e64f..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/locales/ar-SA.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -declare const name = "ar-SA"; -declare const localization: { - today: string; - clear: string; - close: string; - selectMonth: string; - previousMonth: string; - nextMonth: string; - selectYear: string; - previousYear: string; - nextYear: string; - selectDecade: string; - previousDecade: string; - nextDecade: string; - previousCentury: string; - nextCentury: string; - pickHour: string; - incrementHour: string; - decrementHour: string; - pickMinute: string; - incrementMinute: string; - decrementMinute: string; - pickSecond: string; - incrementSecond: string; - decrementSecond: string; - toggleMeridiem: string; - selectTime: string; - selectDate: string; - dayViewHeaderFormat: { - month: string; - year: string; - }; - locale: string; - startOfTheWeek: number; - dateFormats: { - LT: string; - LTS: string; - L: string; - LL: string; - LLL: string; - LLLL: string; - }; - ordinal: (n: any) => any; - format: string; -}; -export { localization, name }; diff --git a/node_modules/@eonasdan/tempus-dominus/types/locales/ar.d.ts b/node_modules/@eonasdan/tempus-dominus/types/locales/ar.d.ts deleted file mode 100644 index bb84836..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/locales/ar.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -declare const name = "ar"; -declare const localization: { - today: string; - clear: string; - close: string; - selectMonth: string; - previousMonth: string; - nextMonth: string; - selectYear: string; - previousYear: string; - nextYear: string; - selectDecade: string; - previousDecade: string; - nextDecade: string; - previousCentury: string; - nextCentury: string; - pickHour: string; - incrementHour: string; - decrementHour: string; - pickMinute: string; - incrementMinute: string; - decrementMinute: string; - pickSecond: string; - incrementSecond: string; - decrementSecond: string; - toggleMeridiem: string; - selectTime: string; - selectDate: string; - dayViewHeaderFormat: { - month: string; - year: string; - }; - locale: string; - startOfTheWeek: number; - dateFormats: { - LT: string; - LTS: string; - L: string; - LL: string; - LLL: string; - LLLL: string; - }; - ordinal: (n: any) => any; - format: string; -}; -export { localization, name }; diff --git a/node_modules/@eonasdan/tempus-dominus/types/locales/ca.d.ts b/node_modules/@eonasdan/tempus-dominus/types/locales/ca.d.ts deleted file mode 100644 index 304b8a2..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/locales/ca.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -declare const name = "ca"; -declare const localization: { - today: string; - clear: string; - close: string; - selectMonth: string; - previousMonth: string; - nextMonth: string; - selectYear: string; - previousYear: string; - nextYear: string; - selectDecade: string; - previousDecade: string; - nextDecade: string; - previousCentury: string; - nextCentury: string; - pickHour: string; - incrementHour: string; - decrementHour: string; - pickMinute: string; - incrementMinute: string; - decrementMinute: string; - pickSecond: string; - incrementSecond: string; - decrementSecond: string; - toggleMeridiem: string; - selectTime: string; - selectDate: string; - dayViewHeaderFormat: { - month: string; - year: string; - }; - startOfTheWeek: number; - locale: string; - dateFormats: { - LT: string; - LTS: string; - L: string; - LL: string; - LLL: string; - LLLL: string; - }; - ordinal: (n: any) => string; - format: string; -}; -export { localization, name }; diff --git a/node_modules/@eonasdan/tempus-dominus/types/locales/cs.d.ts b/node_modules/@eonasdan/tempus-dominus/types/locales/cs.d.ts deleted file mode 100644 index 44030be..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/locales/cs.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -declare const name = "cs"; -declare const localization: { - today: string; - clear: string; - close: string; - selectMonth: string; - previousMonth: string; - nextMonth: string; - selectYear: string; - previousYear: string; - nextYear: string; - selectDecade: string; - previousDecade: string; - nextDecade: string; - previousCentury: string; - nextCentury: string; - pickHour: string; - incrementHour: string; - decrementHour: string; - pickMinute: string; - incrementMinute: string; - decrementMinute: string; - pickSecond: string; - incrementSecond: string; - decrementSecond: string; - toggleMeridiem: string; - selectTime: string; - selectDate: string; - dayViewHeaderFormat: { - month: string; - year: string; - }; - locale: string; - startOfTheWeek: number; - dateFormats: { - LTS: string; - LT: string; - L: string; - LL: string; - LLL: string; - LLLL: string; - }; - ordinal: (n: any) => string; - format: string; -}; -export { localization, name }; diff --git a/node_modules/@eonasdan/tempus-dominus/types/locales/de.d.ts b/node_modules/@eonasdan/tempus-dominus/types/locales/de.d.ts deleted file mode 100644 index 333ec99..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/locales/de.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -declare const name = "de"; -declare const localization: { - today: string; - clear: string; - close: string; - selectMonth: string; - previousMonth: string; - nextMonth: string; - selectYear: string; - previousYear: string; - nextYear: string; - selectDecade: string; - previousDecade: string; - nextDecade: string; - previousCentury: string; - nextCentury: string; - pickHour: string; - incrementHour: string; - decrementHour: string; - pickMinute: string; - incrementMinute: string; - decrementMinute: string; - pickSecond: string; - incrementSecond: string; - decrementSecond: string; - toggleMeridiem: string; - selectTime: string; - selectDate: string; - dayViewHeaderFormat: { - month: string; - year: string; - }; - locale: string; - startOfTheWeek: number; - dateFormats: { - LTS: string; - LT: string; - L: string; - LL: string; - LLL: string; - LLLL: string; - }; - ordinal: (n: any) => string; - format: string; -}; -export { localization, name }; diff --git a/node_modules/@eonasdan/tempus-dominus/types/locales/es.d.ts b/node_modules/@eonasdan/tempus-dominus/types/locales/es.d.ts deleted file mode 100644 index 42ed947..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/locales/es.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -declare const name = "es"; -declare const localization: { - today: string; - clear: string; - close: string; - selectMonth: string; - previousMonth: string; - nextMonth: string; - selectYear: string; - previousYear: string; - nextYear: string; - selectDecade: string; - previousDecade: string; - nextDecade: string; - previousCentury: string; - nextCentury: string; - pickHour: string; - incrementHour: string; - decrementHour: string; - pickMinute: string; - incrementMinute: string; - decrementMinute: string; - pickSecond: string; - incrementSecond: string; - decrementSecond: string; - toggleMeridiem: string; - selectTime: string; - selectDate: string; - dayViewHeaderFormat: { - month: string; - year: string; - }; - startOfTheWeek: number; - locale: string; - dateFormats: { - LT: string; - LTS: string; - L: string; - LL: string; - LLL: string; - LLLL: string; - }; - ordinal: (n: any) => string; - format: string; -}; -export { localization, name }; diff --git a/node_modules/@eonasdan/tempus-dominus/types/locales/fi.d.ts b/node_modules/@eonasdan/tempus-dominus/types/locales/fi.d.ts deleted file mode 100644 index de01096..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/locales/fi.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -declare const name = "fi"; -declare const localization: { - today: string; - clear: string; - close: string; - selectMonth: string; - previousMonth: string; - nextMonth: string; - selectYear: string; - previousYear: string; - nextYear: string; - selectDecade: string; - previousDecade: string; - nextDecade: string; - previousCentury: string; - nextCentury: string; - pickHour: string; - incrementHour: string; - decrementHour: string; - pickMinute: string; - incrementMinute: string; - decrementMinute: string; - pickSecond: string; - incrementSecond: string; - decrementSecond: string; - toggleMeridiem: string; - selectTime: string; - selectDate: string; - dayViewHeaderFormat: { - month: string; - year: string; - }; - locale: string; - startOfTheWeek: number; - dateFormats: { - LT: string; - LTS: string; - L: string; - LL: string; - LLL: string; - LLLL: string; - }; - ordinal: (n: any) => string; - format: string; -}; -export { localization, name }; diff --git a/node_modules/@eonasdan/tempus-dominus/types/locales/fr.d.ts b/node_modules/@eonasdan/tempus-dominus/types/locales/fr.d.ts deleted file mode 100644 index d6eddc2..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/locales/fr.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -declare const name = "fr"; -declare const localization: { - today: string; - clear: string; - close: string; - selectMonth: string; - previousMonth: string; - nextMonth: string; - selectYear: string; - previousYear: string; - nextYear: string; - selectDecade: string; - previousDecade: string; - nextDecade: string; - previousCentury: string; - nextCentury: string; - pickHour: string; - incrementHour: string; - decrementHour: string; - pickMinute: string; - incrementMinute: string; - decrementMinute: string; - pickSecond: string; - incrementSecond: string; - decrementSecond: string; - toggleMeridiem: string; - selectTime: string; - selectDate: string; - dayViewHeaderFormat: { - month: string; - year: string; - }; - locale: string; - startOfTheWeek: number; - dateFormats: { - LT: string; - LTS: string; - L: string; - LL: string; - LLL: string; - LLLL: string; - }; - ordinal: (n: any) => string; - format: string; -}; -export { localization, name }; diff --git a/node_modules/@eonasdan/tempus-dominus/types/locales/hy.d.ts b/node_modules/@eonasdan/tempus-dominus/types/locales/hy.d.ts deleted file mode 100644 index 5dd6791..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/locales/hy.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -declare const name = "hy"; -declare const localization: { - today: string; - clear: string; - close: string; - selectMonth: string; - previousMonth: string; - nextMonth: string; - selectYear: string; - previousYear: string; - nextYear: string; - selectDecade: string; - previousDecade: string; - nextDecade: string; - previousCentury: string; - nextCentury: string; - pickHour: string; - incrementHour: string; - decrementHour: string; - pickMinute: string; - incrementMinute: string; - decrementMinute: string; - pickSecond: string; - incrementSecond: string; - decrementSecond: string; - toggleMeridiem: string; - selectTime: string; - selectDate: string; - dayViewHeaderFormat: { - month: string; - year: string; - }; - locale: string; - startOfTheWeek: number; - dateFormats: { - LT: string; - LTS: string; - L: string; - LL: string; - LLL: string; - LLLL: string; - }; - ordinal: (n: any) => any; - format: string; -}; -export { localization, name }; diff --git a/node_modules/@eonasdan/tempus-dominus/types/locales/it.d.ts b/node_modules/@eonasdan/tempus-dominus/types/locales/it.d.ts deleted file mode 100644 index 9e0d9a6..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/locales/it.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -declare const name = "it"; -declare const localization: { - today: string; - clear: string; - close: string; - selectMonth: string; - previousMonth: string; - nextMonth: string; - selectYear: string; - previousYear: string; - nextYear: string; - selectDecade: string; - previousDecade: string; - nextDecade: string; - previousCentury: string; - nextCentury: string; - pickHour: string; - incrementHour: string; - decrementHour: string; - pickMinute: string; - incrementMinute: string; - decrementMinute: string; - pickSecond: string; - incrementSecond: string; - decrementSecond: string; - toggleMeridiem: string; - selectTime: string; - selectDate: string; - dayViewHeaderFormat: { - month: string; - year: string; - }; - locale: string; - startOfTheWeek: number; - dateFormats: { - LT: string; - LTS: string; - L: string; - LL: string; - LLL: string; - LLLL: string; - }; - ordinal: (n: any) => string; - format: string; -}; -export { localization, name }; diff --git a/node_modules/@eonasdan/tempus-dominus/types/locales/nl.d.ts b/node_modules/@eonasdan/tempus-dominus/types/locales/nl.d.ts deleted file mode 100644 index 80731a9..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/locales/nl.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -declare const name = "nl"; -declare const localization: { - today: string; - clear: string; - close: string; - selectMonth: string; - previousMonth: string; - nextMonth: string; - selectYear: string; - previousYear: string; - nextYear: string; - selectDecade: string; - previousDecade: string; - nextDecade: string; - previousCentury: string; - nextCentury: string; - pickHour: string; - incrementHour: string; - decrementHour: string; - pickMinute: string; - incrementMinute: string; - decrementMinute: string; - pickSecond: string; - incrementSecond: string; - decrementSecond: string; - toggleMeridiem: string; - selectTime: string; - selectDate: string; - dayViewHeaderFormat: { - month: string; - year: string; - }; - locale: string; - startOfTheWeek: number; - dateFormats: { - LT: string; - LTS: string; - L: string; - LL: string; - LLL: string; - LLLL: string; - }; - ordinal: (n: any) => string; - format: string; -}; -export { localization, name }; diff --git a/node_modules/@eonasdan/tempus-dominus/types/locales/pl.d.ts b/node_modules/@eonasdan/tempus-dominus/types/locales/pl.d.ts deleted file mode 100644 index 4f7584f..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/locales/pl.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -declare const name = "pl"; -declare const localization: { - today: string; - clear: string; - close: string; - selectMonth: string; - previousMonth: string; - nextMonth: string; - selectYear: string; - previousYear: string; - nextYear: string; - selectDecade: string; - previousDecade: string; - nextDecade: string; - previousCentury: string; - nextCentury: string; - pickHour: string; - incrementHour: string; - decrementHour: string; - pickMinute: string; - incrementMinute: string; - decrementMinute: string; - pickSecond: string; - incrementSecond: string; - decrementSecond: string; - toggleMeridiem: string; - selectTime: string; - selectDate: string; - dayViewHeaderFormat: { - month: string; - year: string; - }; - locale: string; - startOfTheWeek: number; - dateFormats: { - LT: string; - LTS: string; - L: string; - LL: string; - LLL: string; - LLLL: string; - }; - ordinal: (n: any) => string; - format: string; -}; -export { localization, name }; diff --git a/node_modules/@eonasdan/tempus-dominus/types/locales/ro.d.ts b/node_modules/@eonasdan/tempus-dominus/types/locales/ro.d.ts deleted file mode 100644 index 6311669..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/locales/ro.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -declare const name = "ro"; -declare const localization: { - today: string; - clear: string; - close: string; - selectMonth: string; - previousMonth: string; - nextMonth: string; - selectYear: string; - previousYear: string; - nextYear: string; - selectDecade: string; - previousDecade: string; - nextDecade: string; - previousCentury: string; - nextCentury: string; - pickHour: string; - incrementHour: string; - decrementHour: string; - pickMinute: string; - incrementMinute: string; - decrementMinute: string; - pickSecond: string; - incrementSecond: string; - decrementSecond: string; - toggleMeridiem: string; - selectTime: string; - selectDate: string; - dayViewHeaderFormat: { - month: string; - year: string; - }; - locale: string; - startOfTheWeek: number; - dateFormats: { - LT: string; - LTS: string; - L: string; - LL: string; - LLL: string; - LLLL: string; - }; - ordinal: (n: any) => any; - format: string; -}; -export { localization, name }; diff --git a/node_modules/@eonasdan/tempus-dominus/types/locales/ru.d.ts b/node_modules/@eonasdan/tempus-dominus/types/locales/ru.d.ts deleted file mode 100644 index 23c45d9..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/locales/ru.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -declare const name = "ru"; -declare const localization: { - today: string; - clear: string; - close: string; - selectMonth: string; - previousMonth: string; - nextMonth: string; - selectYear: string; - previousYear: string; - nextYear: string; - selectDecade: string; - previousDecade: string; - nextDecade: string; - previousCentury: string; - nextCentury: string; - pickHour: string; - incrementHour: string; - decrementHour: string; - pickMinute: string; - incrementMinute: string; - decrementMinute: string; - pickSecond: string; - incrementSecond: string; - decrementSecond: string; - toggleMeridiem: string; - selectTime: string; - selectDate: string; - dayViewHeaderFormat: { - month: string; - year: string; - }; - locale: string; - startOfTheWeek: number; - dateFormats: { - LT: string; - LTS: string; - L: string; - LL: string; - LLL: string; - LLLL: string; - }; - ordinal: (n: any) => any; - format: string; -}; -export { localization, name }; diff --git a/node_modules/@eonasdan/tempus-dominus/types/locales/sl.d.ts b/node_modules/@eonasdan/tempus-dominus/types/locales/sl.d.ts deleted file mode 100644 index b205b39..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/locales/sl.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -declare const name = "sl"; -declare const localization: { - today: string; - clear: string; - close: string; - selectMonth: string; - previousMonth: string; - nextMonth: string; - selectYear: string; - previousYear: string; - nextYear: string; - selectDecade: string; - previousDecade: string; - nextDecade: string; - previousCentury: string; - nextCentury: string; - pickHour: string; - incrementHour: string; - decrementHour: string; - pickMinute: string; - incrementMinute: string; - decrementMinute: string; - pickSecond: string; - incrementSecond: string; - decrementSecond: string; - toggleMeridiem: string; - selectTime: string; - selectDate: string; - dayViewHeaderFormat: { - month: string; - year: string; - }; - locale: string; - startOfTheWeek: number; - dateFormats: { - LT: string; - LTS: string; - L: string; - LL: string; - LLL: string; - LLLL: string; - }; - ordinal: (n: any) => string; - format: string; -}; -export { localization, name }; diff --git a/node_modules/@eonasdan/tempus-dominus/types/locales/tr.d.ts b/node_modules/@eonasdan/tempus-dominus/types/locales/tr.d.ts deleted file mode 100644 index 0330754..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/locales/tr.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -declare const name = "tr"; -declare const localization: { - today: string; - clear: string; - close: string; - selectMonth: string; - previousMonth: string; - nextMonth: string; - selectYear: string; - previousYear: string; - nextYear: string; - selectDecade: string; - previousDecade: string; - nextDecade: string; - previousCentury: string; - nextCentury: string; - pickHour: string; - incrementHour: string; - decrementHour: string; - pickMinute: string; - incrementMinute: string; - decrementMinute: string; - pickSecond: string; - incrementSecond: string; - decrementSecond: string; - toggleMeridiem: string; - selectTime: string; - selectDate: string; - dayViewHeaderFormat: { - month: string; - year: string; - }; - locale: string; - startOfTheWeek: number; - dateFormats: { - LT: string; - LTS: string; - L: string; - LL: string; - LLL: string; - LLLL: string; - }; - ordinal: (n: any) => string; - format: string; -}; -export { localization, name }; diff --git a/node_modules/@eonasdan/tempus-dominus/types/plugins/bi-one.d.ts b/node_modules/@eonasdan/tempus-dominus/types/plugins/bi-one.d.ts deleted file mode 100644 index b1c9f81..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/plugins/bi-one.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -declare const biOneIcons: { - type: string; - time: string; - date: string; - up: string; - down: string; - previous: string; - next: string; - today: string; - clear: string; - close: string; -}; -declare const load: (_: any, __: any, tdFactory: any) => void; -export { biOneIcons, load }; diff --git a/node_modules/@eonasdan/tempus-dominus/types/plugins/customDateFormat.d.ts b/node_modules/@eonasdan/tempus-dominus/types/plugins/customDateFormat.d.ts deleted file mode 100644 index 71bcbd7..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/plugins/customDateFormat.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const _default: () => void; -export { _default as default }; diff --git a/node_modules/@eonasdan/tempus-dominus/types/plugins/fa-five.d.ts b/node_modules/@eonasdan/tempus-dominus/types/plugins/fa-five.d.ts deleted file mode 100644 index ad75fc6..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/plugins/fa-five.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -declare const faFiveIcons: { - type: string; - time: string; - date: string; - up: string; - down: string; - previous: string; - next: string; - today: string; - clear: string; - close: string; -}; -declare const load: (_: any, __: any, tdFactory: any) => void; -export { faFiveIcons, load }; diff --git a/node_modules/@eonasdan/tempus-dominus/types/plugins/moment-parse.d.ts b/node_modules/@eonasdan/tempus-dominus/types/plugins/moment-parse.d.ts deleted file mode 100644 index f7ea595..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/plugins/moment-parse.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const _default: (option: any, tdClasses: any, tdFactory: any) => void; -export { _default as default }; diff --git a/node_modules/@eonasdan/tempus-dominus/types/tempus-dominus.d.ts b/node_modules/@eonasdan/tempus-dominus/types/tempus-dominus.d.ts deleted file mode 100644 index aaa5db0..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/tempus-dominus.d.ts +++ /dev/null @@ -1,212 +0,0 @@ -import Display from './display/index'; -import Dates from './dates'; -import { DateTime, DateTimeFormatOptions, Unit } from './datetime'; -import Namespace from './utilities/namespace'; -import Options from './utilities/options'; -import DefaultOptions, { DefaultEnLocalization } from './utilities/default-options'; -/** - * A robust and powerful date/time picker component. - */ -declare class TempusDominus { - _subscribers: { - [key: string]: ((event: any) => Record)[]; - }; - private _isDisabled; - private _toggle; - private _currentPromptTimeTimeout; - private actions; - private optionsStore; - private _eventEmitters; - display: Display; - dates: Dates; - constructor(element: HTMLElement, options?: Options); - get viewDate(): DateTime; - set viewDate(value: DateTime); - /** - * Update the picker options. If `reset` is provide `options` will be merged with DefaultOptions instead. - * @param options - * @param reset - * @public - */ - updateOptions(options: any, reset?: boolean): void; - /** - * Toggles the picker open or closed. If the picker is disabled, nothing will happen. - * @public - */ - toggle(): void; - /** - * Shows the picker unless the picker is disabled. - * @public - */ - show(): void; - /** - * Hides the picker unless the picker is disabled. - * @public - */ - hide(): void; - /** - * Disables the picker and the target input field. - * @public - */ - disable(): void; - /** - * Enables the picker and the target input field. - * @public - */ - enable(): void; - /** - * Clears all the selected dates - * @public - */ - clear(): void; - /** - * Allows for a direct subscription to picker events, without having to use addEventListener on the element. - * @param eventTypes See Namespace.Events - * @param callbacks Function to call when event is triggered - * @public - */ - subscribe(eventTypes: string | string[], callbacks: (event: any) => void | ((event: any) => void)[]): { - unsubscribe: () => void; - } | { - unsubscribe: () => void; - }[]; - /** - * Hides the picker and removes event listeners - */ - dispose(): void; - /** - * Updates the options to use the provided language. - * THe language file must be loaded first. - * @param language - */ - locale(language: string): void; - /** - * Triggers an event like ChangeEvent when the picker has updated the value - * of a selected date. - * @param event Accepts a BaseEvent object. - * @private - */ - private _triggerEvent; - private _publish; - /** - * Fires a ViewUpdate event when, for example, the month view is changed. - * @private - */ - private _viewUpdate; - private _unsubscribe; - /** - * Merges two Option objects together and validates options type - * @param config new Options - * @param mergeTo Options to merge into - * @param includeDataset When true, the elements data-td attributes will be included in the - * @private - */ - private _initializeOptions; - /** - * Checks if an input field is being used, attempts to locate one and sets an - * event listener if found. - * @private - */ - private _initializeInput; - /** - * Attempts to locate a toggle for the picker and sets an event listener - * @private - */ - private _initializeToggle; - /** - * If the option is enabled this will render the clock view after a date pick. - * @param e change event - * @private - */ - private _handleAfterChangeEvent; - /** - * Event for when the input field changes. This is a class level method so there's - * something for the remove listener function. - * @private - */ - private _inputChangeEvent; - /** - * Event for when the toggle is clicked. This is a class level method so there's - * something for the remove listener function. - * @private - */ - private _toggleClickEvent; - /** - * Event for when the toggle is clicked. This is a class level method so there's - * something for the remove listener function. - * @private - */ - private _openClickEvent; -} -/** - * Called from a locale plugin. - * @param l locale object for localization options - */ -declare const loadLocale: (l: any) => void; -/** - * A sets the global localization options to the provided locale name. - * `loadLocale` MUST be called first. - * @param l - */ -declare const locale: (l: string) => void; -/** - * Called from a plugin to extend or override picker defaults. - * @param plugin - * @param option - */ -declare const extend: (plugin: any, option?: any) => { - TempusDominus: typeof TempusDominus; - extend: any; - loadLocale: (l: any) => void; - locale: (l: string) => void; - Namespace: typeof Namespace; - DefaultOptions: Options; - DateTime: typeof DateTime; - Unit: typeof Unit; - version: string; - DefaultEnLocalization: { - clear?: string; - close?: string; - dayViewHeaderFormat?: DateTimeFormatOptions; - decrementHour?: string; - decrementMinute?: string; - decrementSecond?: string; - incrementHour?: string; - incrementMinute?: string; - incrementSecond?: string; - maxWeekdayLength?: number; - nextCentury?: string; - nextDecade?: string; - nextMonth?: string; - nextYear?: string; - pickHour?: string; - pickMinute?: string; - pickSecond?: string; - previousCentury?: string; - previousDecade?: string; - previousMonth?: string; - previousYear?: string; - selectDate?: string; - selectDecade?: string; - selectMonth?: string; - selectTime?: string; - selectYear?: string; - startOfTheWeek?: number; - today?: string; - toggleMeridiem?: string; - dateFormats?: { - L?: string; - LL?: string; - LLL?: string; - LLLL?: string; - LT?: string; - LTS?: string; - }; - format?: string; - hourCycle?: Intl.LocaleHourCycleKey; - locale?: string; - ordinal?: (n: number) => any; - }; -}; -declare const version = "6.7.19"; -export { TempusDominus, extend, loadLocale, locale, Namespace, DefaultOptions, DateTime, Unit, version, DateTimeFormatOptions, Options, DefaultEnLocalization, }; diff --git a/node_modules/@eonasdan/tempus-dominus/types/utilities/action-types.d.ts b/node_modules/@eonasdan/tempus-dominus/types/utilities/action-types.d.ts deleted file mode 100644 index c54bd82..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/utilities/action-types.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -declare enum ActionTypes { - next = "next", - previous = "previous", - changeCalendarView = "changeCalendarView", - selectMonth = "selectMonth", - selectYear = "selectYear", - selectDecade = "selectDecade", - selectDay = "selectDay", - selectHour = "selectHour", - selectMinute = "selectMinute", - selectSecond = "selectSecond", - incrementHours = "incrementHours", - incrementMinutes = "incrementMinutes", - incrementSeconds = "incrementSeconds", - decrementHours = "decrementHours", - decrementMinutes = "decrementMinutes", - decrementSeconds = "decrementSeconds", - toggleMeridiem = "toggleMeridiem", - togglePicker = "togglePicker", - showClock = "showClock", - showHours = "showHours", - showMinutes = "showMinutes", - showSeconds = "showSeconds", - clear = "clear", - close = "close", - today = "today" -} -export default ActionTypes; diff --git a/node_modules/@eonasdan/tempus-dominus/types/utilities/calendar-modes.d.ts b/node_modules/@eonasdan/tempus-dominus/types/utilities/calendar-modes.d.ts deleted file mode 100644 index 1ffb0c1..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/utilities/calendar-modes.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Unit } from '../datetime'; -import ViewMode from './view-mode'; -declare const CalendarModes: { - name: keyof ViewMode; - className: string; - unit: Unit; - step: number; -}[]; -export default CalendarModes; diff --git a/node_modules/@eonasdan/tempus-dominus/types/utilities/default-format-localization.d.ts b/node_modules/@eonasdan/tempus-dominus/types/utilities/default-format-localization.d.ts deleted file mode 100644 index 9765322..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/utilities/default-format-localization.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -declare const _default: { - dateFormats?: { - L?: string; - LL?: string; - LLL?: string; - LLLL?: string; - LT?: string; - LTS?: string; - }; - format?: string; - hourCycle?: Intl.LocaleHourCycleKey; - locale?: string; - ordinal?: (n: number) => any; -}; -export default _default; diff --git a/node_modules/@eonasdan/tempus-dominus/types/utilities/default-options.d.ts b/node_modules/@eonasdan/tempus-dominus/types/utilities/default-options.d.ts deleted file mode 100644 index 14c3de9..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/utilities/default-options.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -import Options from './options'; -declare const DefaultOptions: Options; -export default DefaultOptions; -export declare const DefaultEnLocalization: { - clear?: string; - close?: string; - dayViewHeaderFormat?: import("../datetime").DateTimeFormatOptions; - decrementHour?: string; - decrementMinute?: string; - decrementSecond?: string; - incrementHour?: string; - incrementMinute?: string; - incrementSecond?: string; - maxWeekdayLength?: number; - nextCentury?: string; - nextDecade?: string; - nextMonth?: string; - nextYear?: string; - pickHour?: string; - pickMinute?: string; - pickSecond?: string; - previousCentury?: string; - previousDecade?: string; - previousMonth?: string; - previousYear?: string; - selectDate?: string; - selectDecade?: string; - selectMonth?: string; - selectTime?: string; - selectYear?: string; - startOfTheWeek?: number; - today?: string; - toggleMeridiem?: string; - dateFormats?: { - L?: string; - LL?: string; - LLL?: string; - LLLL?: string; - LT?: string; - LTS?: string; - }; - format?: string; - hourCycle?: Intl.LocaleHourCycleKey; - locale?: string; - ordinal?: (n: number) => any; -}; diff --git a/node_modules/@eonasdan/tempus-dominus/types/utilities/errors.d.ts b/node_modules/@eonasdan/tempus-dominus/types/utilities/errors.d.ts deleted file mode 100644 index 2dc7b81..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/utilities/errors.d.ts +++ /dev/null @@ -1,84 +0,0 @@ -export declare class TdError extends Error { - code: number; -} -export declare class ErrorMessages { - private base; - /** - * Throws an error indicating that a key in the options object is invalid. - * @param optionName - */ - unexpectedOption(optionName: string): void; - /** - * Throws an error indicating that one more keys in the options object is invalid. - * @param optionName - */ - unexpectedOptions(optionName: string[]): void; - /** - * Throws an error when an option is provide an unsupported value. - * For example a value of 'cheese' for toolbarPlacement which only supports - * 'top', 'bottom', 'default'. - * @param optionName - * @param badValue - * @param validOptions - */ - unexpectedOptionValue(optionName: string, badValue: string, validOptions: string[]): void; - /** - * Throws an error when an option value is the wrong type. - * For example a string value was provided to multipleDates which only - * supports true or false. - * @param optionName - * @param badType - * @param expectedType - */ - typeMismatch(optionName: string, badType: string, expectedType: string): void; - /** - * Throws an error when an option value is outside of the expected range. - * For example restrictions.daysOfWeekDisabled excepts a value between 0 and 6. - * @param optionName - * @param lower - * @param upper - */ - numbersOutOfRange(optionName: string, lower: number, upper: number): void; - /** - * Throws an error when a value for a date options couldn't be parsed. Either - * the option was an invalid string or an invalid Date object. - * @param optionName - * @param date - * @param soft If true, logs a warning instead of an error. - */ - failedToParseDate(optionName: string, date: any, soft?: boolean): void; - /** - * Throws when an element to attach to was not provided in the constructor. - */ - mustProvideElement(): void; - /** - * Throws if providing an array for the events to subscribe method doesn't have - * the same number of callbacks. E.g., subscribe([1,2], [1]) - */ - subscribeMismatch(): void; - /** - * Throws if the configuration has conflicting rules e.g. minDate is after maxDate - */ - conflictingConfiguration(message?: string): void; - /** - * customDateFormat errors - */ - customDateFormatError(message?: string): void; - /** - * Logs a warning if a date option value is provided as a string, instead of - * a date/datetime object. - */ - dateString(): void; - deprecatedWarning(message: string, remediation?: string): void; - throwError(message: any): void; - /** - * Used with an Error Event type if the user selects a date that - * fails restriction validation. - */ - failedToSetInvalidDate: string; - /** - * Used with an Error Event type when a user changes the value of the - * input field directly, and does not provide a valid date. - */ - failedToParseInput: string; -} diff --git a/node_modules/@eonasdan/tempus-dominus/types/utilities/event-emitter.d.ts b/node_modules/@eonasdan/tempus-dominus/types/utilities/event-emitter.d.ts deleted file mode 100644 index e2881e7..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/utilities/event-emitter.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { DateTime, Unit } from '../datetime'; -import ActionTypes from './action-types'; -import { BaseEvent } from './event-types'; -export type ViewUpdateValues = Unit | 'decade' | 'clock' | 'calendar' | 'all'; -declare class EventEmitter { - private subscribers; - subscribe(callback: (value: T) => void): any; - unsubscribe(index: number): void; - emit(value?: T): void; - destroy(): void; -} -export declare class EventEmitters { - triggerEvent: EventEmitter; - viewUpdate: EventEmitter; - updateDisplay: EventEmitter; - action: EventEmitter<{ - e: any; - action?: ActionTypes; - }>; - updateViewDate: EventEmitter; - destroy(): void; -} -export {}; diff --git a/node_modules/@eonasdan/tempus-dominus/types/utilities/event-types.d.ts b/node_modules/@eonasdan/tempus-dominus/types/utilities/event-types.d.ts deleted file mode 100644 index bc621f7..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/utilities/event-types.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { DateTime } from '../datetime'; -import ViewMode from './view-mode'; -interface BaseEvent { - type: string; - viewMode?: keyof ViewMode; -} -/** - * Triggers when setValue fails because of validation rules etc. - * @event FailEvent - */ -interface FailEvent extends BaseEvent { - reason: string; - date: DateTime; - oldDate: DateTime; -} -/** - * Triggers when the picker is hidden. - */ -interface HideEvent extends BaseEvent { - date: DateTime; -} -/** - * Triggers when a change is successful. - */ -interface ChangeEvent extends BaseEvent { - date: DateTime | undefined; - oldDate: DateTime; - isClear: boolean; - isValid: boolean; -} -/** - * Triggers when the view is changed for instance from month to year. - */ -interface ViewUpdateEvent extends BaseEvent { - viewDate: DateTime; -} -export { BaseEvent, FailEvent, HideEvent, ChangeEvent, ViewUpdateEvent }; diff --git a/node_modules/@eonasdan/tempus-dominus/types/utilities/namespace.d.ts b/node_modules/@eonasdan/tempus-dominus/types/utilities/namespace.d.ts deleted file mode 100644 index 38f2df3..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/utilities/namespace.d.ts +++ /dev/null @@ -1,222 +0,0 @@ -import { ErrorMessages } from './errors'; -/** - * Events - */ -declare class Events { - key: string; - /** - * Change event. Fired when the user selects a date. - * See also EventTypes.ChangeEvent - */ - change: string; - /** - * Emit when the view changes for example from month view to the year view. - * See also EventTypes.ViewUpdateEvent - */ - update: string; - /** - * Emits when a selected date or value from the input field fails to meet the provided validation rules. - * See also EventTypes.FailEvent - */ - error: string; - /** - * Show event - * @event Events#show - */ - show: string; - /** - * Hide event - * @event Events#hide - */ - hide: string; - blur: string; - focus: string; - keyup: string; - keydown: string; -} -declare class Css { - /** - * The outer element for the widget. - */ - widget: string; - /** - * Hold the previous, next and switcher divs - */ - calendarHeader: string; - /** - * The element for the action to change the calendar view. E.g. month -> year. - */ - switch: string; - /** - * The elements for all the toolbar options - */ - toolbar: string; - /** - * Disables the hover and rounding affect. - */ - noHighlight: string; - /** - * Applied to the widget element when the side by side option is in use. - */ - sideBySide: string; - /** - * The element for the action to change the calendar view, e.g. August -> July - */ - previous: string; - /** - * The element for the action to change the calendar view, e.g. August -> September - */ - next: string; - /** - * Applied to any action that would violate any restriction options. ALso applied - * to an input field if the disabled function is called. - */ - disabled: string; - /** - * Applied to any date that is less than requested view, - * e.g. the last day of the previous month. - */ - old: string; - /** - * Applied to any date that is greater than of requested view, - * e.g. the last day of the previous month. - */ - new: string; - /** - * Applied to any date that is currently selected. - */ - active: string; - /** - * The outer element for the calendar view. - */ - dateContainer: string; - /** - * The outer element for the decades view. - */ - decadesContainer: string; - /** - * Applied to elements within the decade container, e.g. 2020, 2030 - */ - decade: string; - /** - * The outer element for the years view. - */ - yearsContainer: string; - /** - * Applied to elements within the years container, e.g. 2021, 2021 - */ - year: string; - /** - * The outer element for the month view. - */ - monthsContainer: string; - /** - * Applied to elements within the month container, e.g. January, February - */ - month: string; - /** - * The outer element for the calendar view. - */ - daysContainer: string; - /** - * Applied to elements within the day container, e.g. 1, 2..31 - */ - day: string; - /** - * If display.calendarWeeks is enabled, a column displaying the week of year - * is shown. This class is applied to each cell in that column. - */ - calendarWeeks: string; - /** - * Applied to the first row of the calendar view, e.g. Sunday, Monday - */ - dayOfTheWeek: string; - /** - * Applied to the current date on the calendar view. - */ - today: string; - /** - * Applied to the locale's weekend dates on the calendar view, e.g. Sunday, Saturday - */ - weekend: string; - rangeIn: string; - rangeStart: string; - rangeEnd: string; - /** - * The outer element for all time related elements. - */ - timeContainer: string; - /** - * Applied the separator columns between time elements, e.g. hour *:* minute *:* second - */ - separator: string; - /** - * The outer element for the clock view. - */ - clockContainer: string; - /** - * The outer element for the hours selection view. - */ - hourContainer: string; - /** - * The outer element for the minutes selection view. - */ - minuteContainer: string; - /** - * The outer element for the seconds selection view. - */ - secondContainer: string; - /** - * Applied to each element in the hours selection view. - */ - hour: string; - /** - * Applied to each element in the minutes selection view. - */ - minute: string; - /** - * Applied to each element in the seconds selection view. - */ - second: string; - /** - * Applied AM/PM toggle button. - */ - toggleMeridiem: string; - /** - * Applied the element of the current view mode, e.g. calendar or clock. - */ - show: string; - /** - * Applied to the currently showing view mode during a transition - * between calendar and clock views - */ - collapsing: string; - /** - * Applied to the currently hidden view mode. - */ - collapse: string; - /** - * Applied to the widget when the option display.inline is enabled. - */ - inline: string; - /** - * Applied to the widget when the option display.theme is light. - */ - lightTheme: string; - /** - * Applied to the widget when the option display.theme is dark. - */ - darkTheme: string; - /** - * Used for detecting if the system color preference is dark mode - */ - isDarkPreferredQuery: string; -} -export default class Namespace { - static NAME: string; - static dataKey: string; - static events: Events; - static css: Css; - static errorMessages: ErrorMessages; -} -export {}; diff --git a/node_modules/@eonasdan/tempus-dominus/types/utilities/optionConverter.d.ts b/node_modules/@eonasdan/tempus-dominus/types/utilities/optionConverter.d.ts deleted file mode 100644 index 9086533..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/utilities/optionConverter.d.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { DateTime } from '../datetime'; -import Options, { FormatLocalization } from './options'; -export declare class OptionConverter { - private static ignoreProperties; - static deepCopy(input: any): Options; - private static isValue; - /** - * Finds value out of an object based on a string, period delimited, path - * @param paths - * @param obj - */ - static objectPath(paths: string, obj: any): any; - /** - * The spread operator caused sub keys to be missing after merging. - * This is to fix that issue by using spread on the child objects first. - * Also handles complex options like disabledDates - * @param provided An option from new providedOptions - * @param copyTo Destination object. This was added to prevent reference copies - * @param localization - * @param path - */ - static spread(provided: any, copyTo: any, localization: FormatLocalization, path?: string): void; - static processKey(key: string, value: any, //eslint-disable-line @typescript-eslint/no-explicit-any - providedType: string, defaultType: string, path: string, localization: FormatLocalization): any; - static _mergeOptions(providedOptions: Options, mergeTo: Options): Options; - static _dataToOptions(element: any, options: Options): Options; - private static normalizeObject; - /** - * Attempts to prove `d` is a DateTime or Date or can be converted into one. - * @param d If a string will attempt creating a date from it. - * @param localization object containing locale and format settings. Only used with the custom formats - * @private - */ - static _dateTypeCheck(d: any, //eslint-disable-line @typescript-eslint/no-explicit-any - localization: FormatLocalization): DateTime | null; - /** - * Type checks that `value` is an array of Date or DateTime - * @param optionName Provides text to error messages e.g. disabledDates - * @param value Option value - * @param providedType Used to provide text to error messages - * @param localization - */ - static _typeCheckDateArray(optionName: string, value: any, providedType: string, localization: FormatLocalization): void; - /** - * Type checks that `value` is an array of numbers - * @param optionName Provides text to error messages e.g. disabledDates - * @param value Option value - * @param providedType Used to provide text to error messages - */ - static _typeCheckNumberArray(optionName: string, value: any, providedType: string): void; - /** - * Attempts to convert `d` to a DateTime object - * @param d value to convert - * @param optionName Provides text to error messages e.g. disabledDates - * @param localization object containing locale and format settings. Only used with the custom formats - */ - static dateConversion(d: any, //eslint-disable-line @typescript-eslint/no-explicit-any - optionName: string, localization: FormatLocalization): DateTime; - private static _flattenDefaults; - private static getFlattenDefaultOptions; - /** - * Some options conflict like min/max date. Verify that these kinds of options - * are set correctly. - * @param config - */ - static _validateConflicts(config: Options): void; -} diff --git a/node_modules/@eonasdan/tempus-dominus/types/utilities/optionProcessor.d.ts b/node_modules/@eonasdan/tempus-dominus/types/utilities/optionProcessor.d.ts deleted file mode 100644 index 786ef9f..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/utilities/optionProcessor.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { FormatLocalization } from './options'; -interface OptionProcessorFunctionArguments { - key: string; - value: any; - providedType: string; - defaultType: string; - path: string; - localization: FormatLocalization; -} -export declare function processKey(this: void, args: OptionProcessorFunctionArguments): any; -export {}; diff --git a/node_modules/@eonasdan/tempus-dominus/types/utilities/options.d.ts b/node_modules/@eonasdan/tempus-dominus/types/utilities/options.d.ts deleted file mode 100644 index 3068aff..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/utilities/options.d.ts +++ /dev/null @@ -1,116 +0,0 @@ -import { DateTime, DateTimeFormatOptions } from '../datetime'; -import ViewMode from './view-mode'; -export default interface Options { - allowInputToggle?: boolean; - container?: HTMLElement; - dateRange?: boolean; - debug?: boolean; - defaultDate?: DateTime; - display?: { - toolbarPlacement?: 'top' | 'bottom'; - components?: { - calendar?: boolean; - date?: boolean; - month?: boolean; - year?: boolean; - decades?: boolean; - clock?: boolean; - hours?: boolean; - minutes?: boolean; - seconds?: boolean; - useTwentyfourHour?: boolean; - }; - buttons?: { - today?: boolean; - close?: boolean; - clear?: boolean; - }; - calendarWeeks?: boolean; - icons?: { - clear?: string; - close?: string; - date?: string; - down?: string; - next?: string; - previous?: string; - time?: string; - today?: string; - type?: 'icons' | 'sprites'; - up?: string; - }; - viewMode?: keyof ViewMode; - sideBySide?: boolean; - inline?: boolean; - keepOpen?: boolean; - theme?: 'light' | 'dark' | 'auto'; - placement?: 'top' | 'bottom'; - }; - keepInvalid?: boolean; - localization?: Localization; - meta?: Record; - multipleDates?: boolean; - multipleDatesSeparator?: string; - promptTimeOnDateChange?: boolean; - promptTimeOnDateChangeTransitionDelay?: number; - restrictions?: { - minDate?: DateTime; - maxDate?: DateTime; - enabledDates?: DateTime[]; - disabledDates?: DateTime[]; - enabledHours?: number[]; - disabledHours?: number[]; - disabledTimeIntervals?: { - from: DateTime; - to: DateTime; - }[]; - daysOfWeekDisabled?: number[]; - }; - stepping?: number; - useCurrent?: boolean; - viewDate?: DateTime; -} -export interface FormatLocalization { - dateFormats?: { - L?: string; - LL?: string; - LLL?: string; - LLLL?: string; - LT?: string; - LTS?: string; - }; - format?: string; - hourCycle?: Intl.LocaleHourCycleKey; - locale?: string; - ordinal?: (n: number) => any; -} -export interface Localization extends FormatLocalization { - clear?: string; - close?: string; - dayViewHeaderFormat?: DateTimeFormatOptions; - decrementHour?: string; - decrementMinute?: string; - decrementSecond?: string; - incrementHour?: string; - incrementMinute?: string; - incrementSecond?: string; - maxWeekdayLength?: number; - nextCentury?: string; - nextDecade?: string; - nextMonth?: string; - nextYear?: string; - pickHour?: string; - pickMinute?: string; - pickSecond?: string; - previousCentury?: string; - previousDecade?: string; - previousMonth?: string; - previousYear?: string; - selectDate?: string; - selectDecade?: string; - selectMonth?: string; - selectTime?: string; - selectYear?: string; - startOfTheWeek?: number; - today?: string; - toggleMeridiem?: string; -} diff --git a/node_modules/@eonasdan/tempus-dominus/types/utilities/optionsStore.d.ts b/node_modules/@eonasdan/tempus-dominus/types/utilities/optionsStore.d.ts deleted file mode 100644 index ea52a0d..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/utilities/optionsStore.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { DateTime } from '../datetime'; -import ViewMode from './view-mode'; -import Options from './options'; -export declare class OptionsStore { - options: Options; - element: HTMLElement; - input: HTMLInputElement; - unset: boolean; - private _currentCalendarViewMode; - get currentCalendarViewMode(): number; - set currentCalendarViewMode(value: number); - _viewDate: DateTime; - get viewDate(): DateTime; - set viewDate(v: DateTime); - /** - * When switching back to the calendar from the clock, - * this sets currentView to the correct calendar view. - */ - refreshCurrentView(): void; - minimumCalendarViewMode: number; - currentView: keyof ViewMode; - get isTwelveHour(): boolean; -} diff --git a/node_modules/@eonasdan/tempus-dominus/types/utilities/service-locator.d.ts b/node_modules/@eonasdan/tempus-dominus/types/utilities/service-locator.d.ts deleted file mode 100644 index 4f6b2ba..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/utilities/service-locator.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -export declare type Constructable = new (...args: any[]) => T; -declare class ServiceLocator { - private cache; - locate(identifier: Constructable): T; -} -export declare const setupServiceLocator: () => void; -export declare let serviceLocator: ServiceLocator; -export {}; diff --git a/node_modules/@eonasdan/tempus-dominus/types/utilities/typeChecker.d.ts b/node_modules/@eonasdan/tempus-dominus/types/utilities/typeChecker.d.ts deleted file mode 100644 index e63562d..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/utilities/typeChecker.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { DateTime } from '../datetime'; -import { FormatLocalization } from './options'; -/** - * Attempts to prove `d` is a DateTime or Date or can be converted into one. - * @param d If a string will attempt creating a date from it. - * @param localization object containing locale and format settings. Only used with the custom formats - * @private - */ -export declare function tryConvertToDateTime(this: void, d: DateTime | Date | string, localization: FormatLocalization): DateTime | null; -/** - * Attempts to convert `d` to a DateTime object - * @param d value to convert - * @param optionName Provides text to error messages e.g. disabledDates - * @param localization object containing locale and format settings. Only used with the custom formats - */ -export declare function convertToDateTime(this: void, d: DateTime | Date | string, optionName: string, localization: FormatLocalization): DateTime; -/** - * Type checks that `value` is an array of Date or DateTime - * @param optionName Provides text to error messages e.g. disabledDates - * @param value Option value - * @param providedType Used to provide text to error messages - * @param localization - */ -export declare function typeCheckDateArray(this: void, optionName: string, value: any, //eslint-disable-line @typescript-eslint/no-explicit-any -providedType: string, localization?: FormatLocalization): void; -/** - * Type checks that `value` is an array of numbers - * @param optionName Provides text to error messages e.g. disabledDates - * @param value Option value - * @param providedType Used to provide text to error messages - */ -export declare function typeCheckNumberArray(this: void, optionName: string, value: any, //eslint-disable-line @typescript-eslint/no-explicit-any -providedType: string): void; diff --git a/node_modules/@eonasdan/tempus-dominus/types/utilities/view-mode.d.ts b/node_modules/@eonasdan/tempus-dominus/types/utilities/view-mode.d.ts deleted file mode 100644 index 83bbc63..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/utilities/view-mode.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -type ViewMode = { - clock: any; - calendar: any; - months: any; - years: any; - decades: any; -}; -export default ViewMode; diff --git a/node_modules/@eonasdan/tempus-dominus/types/validation.d.ts b/node_modules/@eonasdan/tempus-dominus/types/validation.d.ts deleted file mode 100644 index e192ef8..0000000 --- a/node_modules/@eonasdan/tempus-dominus/types/validation.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { DateTime, Unit } from './datetime'; -/** - * Main class for date validation rules based on the options provided. - */ -export default class Validation { - private optionsStore; - constructor(); - /** - * Checks to see if the target date is valid based on the rules provided in the options. - * Granularity can be provided to check portions of the date instead of the whole. - * @param targetDate - * @param granularity - */ - isValid(targetDate: DateTime, granularity?: Unit): boolean; - private _enabledDisabledDatesIsValid; - /** - * Checks to see if the disabledDates option is in use and returns true (meaning invalid) - * if the `testDate` is with in the array. Granularity is by date. - * @param testDate - * @private - */ - private _isInDisabledDates; - /** - * Checks to see if the enabledDates option is in use and returns true (meaning valid) - * if the `testDate` is with in the array. Granularity is by date. - * @param testDate - * @private - */ - private _isInEnabledDates; - private _minMaxIsValid; - private _enabledDisabledHoursIsValid; - /** - * Checks to see if the disabledHours option is in use and returns true (meaning invalid) - * if the `testDate` is with in the array. Granularity is by hours. - * @param testDate - * @private - */ - private _isInDisabledHours; - /** - * Checks to see if the enabledHours option is in use and returns true (meaning valid) - * if the `testDate` is with in the array. Granularity is by hours. - * @param testDate - * @private - */ - private _isInEnabledHours; - dateRangeIsValid(dates: DateTime[], index: number, target: DateTime): boolean; -} diff --git a/node_modules/accepts/HISTORY.md b/node_modules/accepts/HISTORY.md index 397636e..cb5990c 100644 --- a/node_modules/accepts/HISTORY.md +++ b/node_modules/accepts/HISTORY.md @@ -1,3 +1,76 @@ +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 =================== diff --git a/node_modules/accepts/README.md b/node_modules/accepts/README.md index ae36676..82680c5 100644 --- a/node_modules/accepts/README.md +++ b/node_modules/accepts/README.md @@ -1,24 +1,30 @@ # accepts -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] +[![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][travis-image]][travis-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. +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 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 +$ npm install accepts ``` ## API @@ -88,11 +94,11 @@ server. var accepts = require('accepts') var http = require('http') -function app(req, res) { +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'])) { + switch (accept.type(['json', 'html'])) { case 'json': res.setHeader('Content-Type', 'application/json') res.write('{"hello":"world!"}') @@ -123,13 +129,12 @@ curl -I -H'Accept: text/html' http://localhost:3000/ [MIT](LICENSE) -[npm-image]: https://img.shields.io/npm/v/accepts.svg +[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 -[node-version-image]: https://img.shields.io/node/v/accepts.svg -[node-version-url]: http://nodejs.org/download/ -[travis-image]: https://img.shields.io/travis/jshttp/accepts/master.svg -[travis-url]: https://travis-ci.org/jshttp/accepts -[coveralls-image]: https://img.shields.io/coveralls/jshttp/accepts/master.svg -[coveralls-url]: https://coveralls.io/r/jshttp/accepts -[downloads-image]: https://img.shields.io/npm/dm/accepts.svg -[downloads-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 index e80192a..e9b2f63 100644 --- a/node_modules/accepts/index.js +++ b/node_modules/accepts/index.js @@ -29,9 +29,10 @@ module.exports = Accepts * @public */ -function Accepts(req) { - if (!(this instanceof Accepts)) +function Accepts (req) { + if (!(this instanceof Accepts)) { return new Accepts(req) + } this.headers = req.headers this.negotiator = new Negotiator(req) @@ -95,12 +96,18 @@ Accepts.prototype.types = function (types_) { return this.negotiator.mediaTypes() } - if (!this.headers.accept) return types[0]; - var mimes = types.map(extToMime); - var accepts = this.negotiator.mediaTypes(mimes.filter(validMime)); - var first = accepts[0]; - if (!first) return false; - return types[mimes.indexOf(first)]; + // 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 } /** @@ -212,7 +219,7 @@ Accepts.prototype.languages = function (languages_) { * @private */ -function extToMime(type) { +function extToMime (type) { return type.indexOf('/') === -1 ? mime.lookup(type) : type @@ -226,6 +233,6 @@ function extToMime(type) { * @private */ -function validMime(type) { - return typeof type === 'string'; +function validMime (type) { + return typeof type === 'string' } diff --git a/node_modules/accepts/package.json b/node_modules/accepts/package.json index 299a168..0f2d15d 100644 --- a/node_modules/accepts/package.json +++ b/node_modules/accepts/package.json @@ -1,7 +1,7 @@ { "name": "accepts", "description": "Higher-level content negotiation", - "version": "1.2.13", + "version": "1.3.8", "contributors": [ "Douglas Christopher Wilson ", "Jonathan Ong (http://jongleberry.com)" @@ -9,12 +9,20 @@ "license": "MIT", "repository": "jshttp/accepts", "dependencies": { - "mime-types": "~2.1.6", - "negotiator": "0.5.3" + "mime-types": "~2.1.34", + "negotiator": "0.6.3" }, "devDependencies": { - "istanbul": "0.3.19", - "mocha": "~1.21.5" + "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", @@ -25,9 +33,10 @@ "node": ">= 0.6" }, "scripts": { + "lint": "eslint .", "test": "mocha --reporter spec --check-leaks --bail test/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + "test-ci": "nyc --reporter=lcov --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" }, "keywords": [ "content", diff --git a/node_modules/array-flatten/array-flatten.js b/node_modules/array-flatten/array-flatten.js index cf2fa93..089117b 100644 --- a/node_modules/array-flatten/array-flatten.js +++ b/node_modules/array-flatten/array-flatten.js @@ -1,3 +1,10 @@ +'use strict' + +/** + * Expose `arrayFlatten`. + */ +module.exports = arrayFlatten + /** * Recursive flatten function with depth. * @@ -6,12 +13,12 @@ * @param {Number} depth * @return {Array} */ -function flattenDepth (array, result, depth) { +function flattenWithDepth (array, result, depth) { for (var i = 0; i < array.length; i++) { var value = array[i] if (depth > 0 && Array.isArray(value)) { - flattenDepth(value, result, depth - 1) + flattenWithDepth(value, result, depth - 1) } else { result.push(value) } @@ -48,10 +55,10 @@ function flattenForever (array, result) { * @param {Number} depth * @return {Array} */ -module.exports = function (array, depth) { +function arrayFlatten (array, depth) { if (depth == null) { return flattenForever(array, []) } - return flattenDepth(array, [], depth) + return flattenWithDepth(array, [], depth) } diff --git a/node_modules/array-flatten/package.json b/node_modules/array-flatten/package.json index 285df29..1a24e2a 100644 --- a/node_modules/array-flatten/package.json +++ b/node_modules/array-flatten/package.json @@ -1,6 +1,6 @@ { "name": "array-flatten", - "version": "1.1.0", + "version": "1.1.1", "description": "Flatten an array of nested arrays into a single flat array", "main": "array-flatten.js", "files": [ diff --git a/node_modules/bignumber.js/CHANGELOG.md b/node_modules/bignumber.js/CHANGELOG.md new file mode 100644 index 0000000..e288a93 --- /dev/null +++ b/node_modules/bignumber.js/CHANGELOG.md @@ -0,0 +1,266 @@ +#### 9.0.0 +* 27/05/2019 +* For compatibility with legacy browsers, remove `Symbol` references. + +#### 8.1.1 +* 24/02/2019 +* [BUGFIX] #222 Restore missing `var` to `export BigNumber`. +* Allow any key in BigNumber.Instance in *bignumber.d.ts*. + +#### 8.1.0 +* 23/02/2019 +* [NEW FEATURE] #220 Create a BigNumber using `{s, e, c}`. +* [NEW FEATURE] `isBigNumber`: if `BigNumber.DEBUG` is `true`, also check that the BigNumber instance is well-formed. +* Remove `instanceof` checks; just use `_isBigNumber` to identify a BigNumber instance. +* Add `_isBigNumber` to prototype in *bignumber.mjs*. +* Add tests for BigNumber creation from object. +* Update *API.html*. + +#### 8.0.2 +* 13/01/2019 +* #209 `toPrecision` without argument should follow `toString`. +* Improve *Use* section of *README*. +* Optimise `toString(10)`. +* Add verson number to API doc. + +#### 8.0.1 +* 01/11/2018 +* Rest parameter must be array type in *bignumber.d.ts*. + +#### 8.0.0 +* 01/11/2018 +* [NEW FEATURE] Add `BigNumber.sum` method. +* [NEW FEATURE]`toFormat`: add `prefix` and `suffix` options. +* [NEW FEATURE] #178 Pass custom formatting to `toFormat`. +* [BREAKING CHANGE] #184 `toFraction`: return array of BigNumbers not strings. +* [NEW FEATURE] #185 Enable overwrite of `valueOf` to prevent accidental addition to string. +* #183 Add Node.js `crypto` requirement to documentation. +* [BREAKING CHANGE] #198 Disallow signs and whitespace in custom alphabet. +* [NEW FEATURE] #188 Implement `util.inspect.custom` for Node.js REPL. +* #170 Make `isBigNumber` a type guard in *bignumber.d.ts*. +* [BREAKING CHANGE] `BigNumber.min` and `BigNumber.max`: don't accept an array. +* Update *.travis.yml*. +* Remove *bower.json*. + +#### 7.2.1 +* 24/05/2018 +* Add `browser` field to *package.json*. + +#### 7.2.0 +* 22/05/2018 +* #166 Correct *.mjs* file. Remove extension from `main` field in *package.json*. + +#### 7.1.0 +* 18/05/2018 +* Add `module` field to *package.json* for *bignumber.mjs*. + +#### 7.0.2 +* 17/05/2018 +* #165 Bugfix: upper-case letters for bases 11-36 in a custom alphabet. +* Add note to *README* regarding creating BigNumbers from Number values. + +#### 7.0.1 +* 26/04/2018 +* #158 Fix global object variable name typo. + +#### 7.0.0 +* 26/04/2018 +* #143 Remove global BigNumber from typings. +* #144 Enable compatibility with `Object.freeze(Object.prototype)`. +* #148 #123 #11 Only throw on a number primitive with more than 15 significant digits if `BigNumber.DEBUG` is `true`. +* Only throw on an invalid BigNumber value if `BigNumber.DEBUG` is `true`. Return BigNumber `NaN` instead. +* #154 `exponentiatedBy`: allow BigNumber exponent. +* #156 Prevent Content Security Policy *unsafe-eval* issue. +* `toFraction`: allow `Infinity` maximum denominator. +* Comment-out some excess tests to reduce test time. +* Amend indentation and other spacing. + +#### 6.0.0 +* 26/01/2018 +* #137 Implement `APLHABET` configuration option. +* Remove `ERRORS` configuration option. +* Remove `toDigits` method; extend `precision` method accordingly. +* Remove s`round` method; extend `decimalPlaces` method accordingly. +* Remove methods: `ceil`, `floor`, and `truncated`. +* Remove method aliases: `add`, `cmp`, `isInt`, `isNeg`, `trunc`, `mul`, `neg` and `sub`. +* Rename methods: `shift` to `shiftedBy`, `another` to `clone`, `toPower` to `exponentiatedBy`, and `equals` to `isEqualTo`. +* Rename methods: add `is` prefix to `greaterThan`, `greaterThanOrEqualTo`, `lessThan` and `lessThanOrEqualTo`. +* Add methods: `multipliedBy`, `isBigNumber`, `isPositive`, `integerValue`, `maximum` and `minimum`. +* Refactor test suite. +* Add *CHANGELOG.md*. +* Rewrite *bignumber.d.ts*. +* Redo API image. + +#### 5.0.0 +* 27/11/2017 +* #81 Don't throw on constructor call without `new`. + +#### 4.1.0 +* 26/09/2017 +* Remove node 0.6 from *.travis.yml*. +* Add *bignumber.mjs*. + +#### 4.0.4 +* 03/09/2017 +* Add missing aliases to *bignumber.d.ts*. + +#### 4.0.3 +* 30/08/2017 +* Add types: *bignumber.d.ts*. + +#### 4.0.2 +* 03/05/2017 +* #120 Workaround Safari/Webkit bug. + +#### 4.0.1 +* 05/04/2017 +* #121 BigNumber.default to BigNumber['default']. + +#### 4.0.0 +* 09/01/2017 +* Replace BigNumber.isBigNumber method with isBigNumber prototype property. + +#### 3.1.2 +* 08/01/2017 +* Minor documentation edit. + +#### 3.1.1 +* 08/01/2017 +* Uncomment `isBigNumber` tests. +* Ignore dot files. + +#### 3.1.0 +* 08/01/2017 +* Add `isBigNumber` method. + +#### 3.0.2 +* 08/01/2017 +* Bugfix: Possible incorrect value of `ERRORS` after a `BigNumber.another` call (due to `parseNumeric` declaration in outer scope). + +#### 3.0.1 +* 23/11/2016 +* Apply fix for old ipads with `%` issue, see #57 and #102. +* Correct error message. + +#### 3.0.0 +* 09/11/2016 +* Remove `require('crypto')` - leave it to the user. +* Add `BigNumber.set` as `BigNumber.config` alias. +* Default `POW_PRECISION` to `0`. + +#### 2.4.0 +* 14/07/2016 +* #97 Add exports to support ES6 imports. + +#### 2.3.0 +* 07/03/2016 +* #86 Add modulus parameter to `toPower`. + +#### 2.2.0 +* 03/03/2016 +* #91 Permit larger JS integers. + +#### 2.1.4 +* 15/12/2015 +* Correct UMD. + +#### 2.1.3 +* 13/12/2015 +* Refactor re global object and crypto availability when bundling. + +#### 2.1.2 +* 10/12/2015 +* Bugfix: `window.crypto` not assigned to `crypto`. + +#### 2.1.1 +* 09/12/2015 +* Prevent code bundler from adding `crypto` shim. + +#### 2.1.0 +* 26/10/2015 +* For `valueOf` and `toJSON`, include the minus sign with negative zero. + +#### 2.0.8 +* 2/10/2015 +* Internal round function bugfix. + +#### 2.0.6 +* 31/03/2015 +* Add bower.json. Tweak division after in-depth review. + +#### 2.0.5 +* 25/03/2015 +* Amend README. Remove bitcoin address. + +#### 2.0.4 +* 25/03/2015 +* Critical bugfix #58: division. + +#### 2.0.3 +* 18/02/2015 +* Amend README. Add source map. + +#### 2.0.2 +* 18/02/2015 +* Correct links. + +#### 2.0.1 +* 18/02/2015 +* Add `max`, `min`, `precision`, `random`, `shiftedBy`, `toDigits` and `truncated` methods. +* Add the short-forms: `add`, `mul`, `sd`, `sub` and `trunc`. +* Add an `another` method to enable multiple independent constructors to be created. +* Add support for the base 2, 8 and 16 prefixes `0b`, `0o` and `0x`. +* Enable a rounding mode to be specified as a second parameter to `toExponential`, `toFixed`, `toFormat` and `toPrecision`. +* Add a `CRYPTO` configuration property so cryptographically-secure pseudo-random number generation can be specified. +* Add a `MODULO_MODE` configuration property to enable the rounding mode used by the `modulo` operation to be specified. +* Add a `POW_PRECISION` configuration property to enable the number of significant digits calculated by the power operation to be limited. +* Improve code quality. +* Improve documentation. + +#### 2.0.0 +* 29/12/2014 +* Add `dividedToIntegerBy`, `isInteger` and `toFormat` methods. +* Remove the following short-forms: `isF`, `isZ`, `toE`, `toF`, `toFr`, `toN`, `toP`, `toS`. +* Store a BigNumber's coefficient in base 1e14, rather than base 10. +* Add fast path for integers to BigNumber constructor. +* Incorporate the library into the online documentation. + +#### 1.5.0 +* 13/11/2014 +* Add `toJSON` and `decimalPlaces` methods. + +#### 1.4.1 +* 08/06/2014 +* Amend README. + +#### 1.4.0 +* 08/05/2014 +* Add `toNumber`. + +#### 1.3.0 +* 08/11/2013 +* Ensure correct rounding of `sqrt` in all, rather than almost all, cases. +* Maximum radix to 64. + +#### 1.2.1 +* 17/10/2013 +* Sign of zero when x < 0 and x + (-x) = 0. + +#### 1.2.0 +* 19/9/2013 +* Throw Error objects for stack. + +#### 1.1.1 +* 22/8/2013 +* Show original value in constructor error message. + +#### 1.1.0 +* 1/8/2013 +* Allow numbers with trailing radix point. + +#### 1.0.1 +* Bugfix: error messages with incorrect method name + +#### 1.0.0 +* 8/11/2012 +* Initial release diff --git a/node_modules/express/node_modules/depd/LICENSE b/node_modules/bignumber.js/LICENCE similarity index 92% rename from node_modules/express/node_modules/depd/LICENSE rename to node_modules/bignumber.js/LICENCE index b7dce6c..87a9b15 100644 --- a/node_modules/express/node_modules/depd/LICENSE +++ b/node_modules/bignumber.js/LICENCE @@ -1,22 +1,23 @@ -(The MIT License) - -Copyright (c) 2014 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. +The MIT Licence. + +Copyright (c) 2019 Michael Mclaughlin + +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/bignumber.js/README.md b/node_modules/bignumber.js/README.md new file mode 100644 index 0000000..fc3c84c --- /dev/null +++ b/node_modules/bignumber.js/README.md @@ -0,0 +1,268 @@ +![bignumber.js](https://raw.githubusercontent.com/MikeMcl/bignumber.js/gh-pages/bignumberjs.png) + +A JavaScript library for arbitrary-precision decimal and non-decimal arithmetic. + +[![Build Status](https://travis-ci.org/MikeMcl/bignumber.js.svg)](https://travis-ci.org/MikeMcl/bignumber.js) + +
+ +## Features + + - Integers and decimals + - Simple API but full-featured + - Faster, smaller, and perhaps easier to use than JavaScript versions of Java's BigDecimal + - 8 KB minified and gzipped + - Replicates the `toExponential`, `toFixed`, `toPrecision` and `toString` methods of JavaScript's Number type + - Includes a `toFraction` and a correctly-rounded `squareRoot` method + - Supports cryptographically-secure pseudo-random number generation + - No dependencies + - Wide platform compatibility: uses JavaScript 1.5 (ECMAScript 3) features only + - Comprehensive [documentation](http://mikemcl.github.io/bignumber.js/) and test set + +![API](https://raw.githubusercontent.com/MikeMcl/bignumber.js/gh-pages/API.png) + +If a smaller and simpler library is required see [big.js](https://github.com/MikeMcl/big.js/). +It's less than half the size but only works with decimal numbers and only has half the methods. +It also does not allow `NaN` or `Infinity`, or have the configuration options of this library. + +See also [decimal.js](https://github.com/MikeMcl/decimal.js/), which among other things adds support for non-integer powers, and performs all operations to a specified number of significant digits. + +## Load + +The library is the single JavaScript file *bignumber.js* (or minified, *bignumber.min.js*). + +Browser: + +```html + +``` + +[Node.js](http://nodejs.org): + +```bash +$ npm install bignumber.js +``` + +```javascript +const BigNumber = require('bignumber.js'); +``` + +ES6 module: + +```javascript +import BigNumber from "./bignumber.mjs" +``` + +AMD loader libraries such as [requireJS](http://requirejs.org/): + +```javascript +require(['bignumber'], function(BigNumber) { + // Use BigNumber here in local scope. No global BigNumber. +}); +``` + +## Use + +The library exports a single constructor function, [`BigNumber`](http://mikemcl.github.io/bignumber.js/#bignumber), which accepts a value of type Number, String or BigNumber, + +```javascript +let x = new BigNumber(123.4567); +let y = BigNumber('123456.7e-3'); +let z = new BigNumber(x); +x.isEqualTo(y) && y.isEqualTo(z) && x.isEqualTo(z); // true +``` + +To get the string value of a BigNumber use [`toString()`](http://mikemcl.github.io/bignumber.js/#toS) or [`toFixed()`](http://mikemcl.github.io/bignumber.js/#toFix). Using `toFixed()` prevents exponential notation being returned, no matter how large or small the value. + +```javascript +let x = new BigNumber('1111222233334444555566'); +x.toString(); // "1.111222233334444555566e+21" +x.toFixed(); // "1111222233334444555566" +``` + +If the limited precision of Number values is not well understood, it is recommended to create BigNumbers from String values rather than Number values to avoid a potential loss of precision. + +*In all further examples below, `let`, semicolons and `toString` calls are not shown. If a commented-out value is in quotes it means `toString` has been called on the preceding expression.* + +```javascript +// Precision loss from using numeric literals with more than 15 significant digits. +new BigNumber(1.0000000000000001) // '1' +new BigNumber(88259496234518.57) // '88259496234518.56' +new BigNumber(99999999999999999999) // '100000000000000000000' + +// Precision loss from using numeric literals outside the range of Number values. +new BigNumber(2e+308) // 'Infinity' +new BigNumber(1e-324) // '0' + +// Precision loss from the unexpected result of arithmetic with Number values. +new BigNumber(0.7 + 0.1) // '0.7999999999999999' +``` + +When creating a BigNumber from a Number, note that a BigNumber is created from a Number's decimal `toString()` value not from its underlying binary value. If the latter is required, then pass the Number's `toString(2)` value and specify base 2. + +```javascript +new BigNumber(Number.MAX_VALUE.toString(2), 2) +``` + +BigNumbers can be created from values in bases from 2 to 36. See [`ALPHABET`](http://mikemcl.github.io/bignumber.js/#alphabet) to extend this range. + +```javascript +a = new BigNumber(1011, 2) // "11" +b = new BigNumber('zz.9', 36) // "1295.25" +c = a.plus(b) // "1306.25" +``` + +Performance is better if base 10 is NOT specified for decimal values. Only specify base 10 when it is desired that the number of decimal places of the input value be limited to the current [`DECIMAL_PLACES`](http://mikemcl.github.io/bignumber.js/#decimal-places) setting. + +A BigNumber is immutable in the sense that it is not changed by its methods. + +```javascript +0.3 - 0.1 // 0.19999999999999998 +x = new BigNumber(0.3) +x.minus(0.1) // "0.2" +x // "0.3" +``` + +The methods that return a BigNumber can be chained. + +```javascript +x.dividedBy(y).plus(z).times(9) +x.times('1.23456780123456789e+9').plus(9876.5432321).dividedBy('4444562598.111772').integerValue() +``` + +Some of the longer method names have a shorter alias. + +```javascript +x.squareRoot().dividedBy(y).exponentiatedBy(3).isEqualTo(x.sqrt().div(y).pow(3)) // true +x.modulo(y).multipliedBy(z).eq(x.mod(y).times(z)) // true +``` + +As with JavaScript's Number type, there are [`toExponential`](http://mikemcl.github.io/bignumber.js/#toE), [`toFixed`](http://mikemcl.github.io/bignumber.js/#toFix) and [`toPrecision`](http://mikemcl.github.io/bignumber.js/#toP) methods. + +```javascript +x = new BigNumber(255.5) +x.toExponential(5) // "2.55500e+2" +x.toFixed(5) // "255.50000" +x.toPrecision(5) // "255.50" +x.toNumber() // 255.5 +``` + + A base can be specified for [`toString`](http://mikemcl.github.io/bignumber.js/#toS). Performance is better if base 10 is NOT specified, i.e. use `toString()` not `toString(10)`. Only specify base 10 when it is desired that the number of decimal places be limited to the current [`DECIMAL_PLACES`](http://mikemcl.github.io/bignumber.js/#decimal-places) setting. + + ```javascript + x.toString(16) // "ff.8" + ``` + +There is a [`toFormat`](http://mikemcl.github.io/bignumber.js/#toFor) method which may be useful for internationalisation. + +```javascript +y = new BigNumber('1234567.898765') +y.toFormat(2) // "1,234,567.90" +``` + +The maximum number of decimal places of the result of an operation involving division (i.e. a division, square root, base conversion or negative power operation) is set using the `set` or `config` method of the `BigNumber` constructor. + +The other arithmetic operations always give the exact result. + +```javascript +BigNumber.set({ DECIMAL_PLACES: 10, ROUNDING_MODE: 4 }) + +x = new BigNumber(2) +y = new BigNumber(3) +z = x.dividedBy(y) // "0.6666666667" +z.squareRoot() // "0.8164965809" +z.exponentiatedBy(-3) // "3.3749999995" +z.toString(2) // "0.1010101011" +z.multipliedBy(z) // "0.44444444448888888889" +z.multipliedBy(z).decimalPlaces(10) // "0.4444444445" +``` + +There is a [`toFraction`](http://mikemcl.github.io/bignumber.js/#toFr) method with an optional *maximum denominator* argument + +```javascript +y = new BigNumber(355) +pi = y.dividedBy(113) // "3.1415929204" +pi.toFraction() // [ "7853982301", "2500000000" ] +pi.toFraction(1000) // [ "355", "113" ] +``` + +and [`isNaN`](http://mikemcl.github.io/bignumber.js/#isNaN) and [`isFinite`](http://mikemcl.github.io/bignumber.js/#isF) methods, as `NaN` and `Infinity` are valid `BigNumber` values. + +```javascript +x = new BigNumber(NaN) // "NaN" +y = new BigNumber(Infinity) // "Infinity" +x.isNaN() && !y.isNaN() && !x.isFinite() && !y.isFinite() // true +``` + +The value of a BigNumber is stored in a decimal floating point format in terms of a coefficient, exponent and sign. + +```javascript +x = new BigNumber(-123.456); +x.c // [ 123, 45600000000000 ] coefficient (i.e. significand) +x.e // 2 exponent +x.s // -1 sign +``` + +For advanced usage, multiple BigNumber constructors can be created, each with their own independent configuration. + +```javascript +// Set DECIMAL_PLACES for the original BigNumber constructor +BigNumber.set({ DECIMAL_PLACES: 10 }) + +// Create another BigNumber constructor, optionally passing in a configuration object +BN = BigNumber.clone({ DECIMAL_PLACES: 5 }) + +x = new BigNumber(1) +y = new BN(1) + +x.div(3) // '0.3333333333' +y.div(3) // '0.33333' +``` + +For further information see the [API](http://mikemcl.github.io/bignumber.js/) reference in the *doc* directory. + +## Test + +The *test/modules* directory contains the test scripts for each method. + +The tests can be run with Node.js or a browser. For Node.js use + + $ npm test + +or + + $ node test/test + +To test a single method, use, for example + + $ node test/methods/toFraction + +For the browser, open *test/test.html*. + +## Build + +For Node, if [uglify-js](https://github.com/mishoo/UglifyJS2) is installed + + npm install uglify-js -g + +then + + npm run build + +will create *bignumber.min.js*. + +A source map will also be created in the root directory. + +## Feedback + +Open an issue, or email + +Michael + +M8ch88l@gmail.com + +## Licence + +The MIT Licence. + +See [LICENCE](https://github.com/MikeMcl/bignumber.js/blob/master/LICENCE). diff --git a/node_modules/bignumber.js/bignumber.d.ts b/node_modules/bignumber.js/bignumber.d.ts new file mode 100644 index 0000000..ac6a3e4 --- /dev/null +++ b/node_modules/bignumber.js/bignumber.d.ts @@ -0,0 +1,1829 @@ +// Type definitions for bignumber.js >=8.1.0 +// Project: https://github.com/MikeMcl/bignumber.js +// Definitions by: Michael Mclaughlin +// Definitions: https://github.com/MikeMcl/bignumber.js + +// Documentation: http://mikemcl.github.io/bignumber.js/ +// +// Exports: +// +// class BigNumber (default export) +// type BigNumber.Constructor +// type BigNumber.ModuloMode +// type BigNumber.RoundingMOde +// type BigNumber.Value +// interface BigNumber.Config +// interface BigNumber.Format +// interface BigNumber.Instance +// +// Example: +// +// import {BigNumber} from "bignumber.js" +// //import BigNumber from "bignumber.js" +// +// let rm: BigNumber.RoundingMode = BigNumber.ROUND_UP; +// let f: BigNumber.Format = { decimalSeparator: ',' }; +// let c: BigNumber.Config = { DECIMAL_PLACES: 4, ROUNDING_MODE: rm, FORMAT: f }; +// BigNumber.config(c); +// +// let v: BigNumber.Value = '12345.6789'; +// let b: BigNumber = new BigNumber(v); +// +// The use of compiler option `--strictNullChecks` is recommended. + +export default BigNumber; + +export namespace BigNumber { + + /** See `BigNumber.config` (alias `BigNumber.set`) and `BigNumber.clone`. */ + interface Config { + + /** + * An integer, 0 to 1e+9. Default value: 20. + * + * The maximum number of decimal places of the result of operations involving division, i.e. + * division, square root and base conversion operations, and exponentiation when the exponent is + * negative. + * + * ```ts + * BigNumber.config({ DECIMAL_PLACES: 5 }) + * BigNumber.set({ DECIMAL_PLACES: 5 }) + * ``` + */ + DECIMAL_PLACES?: number; + + /** + * An integer, 0 to 8. Default value: `BigNumber.ROUND_HALF_UP` (4). + * + * The rounding mode used in operations that involve division (see `DECIMAL_PLACES`) and the + * default rounding mode of the `decimalPlaces`, `precision`, `toExponential`, `toFixed`, + * `toFormat` and `toPrecision` methods. + * + * The modes are available as enumerated properties of the BigNumber constructor. + * + * ```ts + * BigNumber.config({ ROUNDING_MODE: 0 }) + * BigNumber.set({ ROUNDING_MODE: BigNumber.ROUND_UP }) + * ``` + */ + ROUNDING_MODE?: BigNumber.RoundingMode; + + /** + * An integer, 0 to 1e+9, or an array, [-1e+9 to 0, 0 to 1e+9]. + * Default value: `[-7, 20]`. + * + * The exponent value(s) at which `toString` returns exponential notation. + * + * If a single number is assigned, the value is the exponent magnitude. + * + * If an array of two numbers is assigned then the first number is the negative exponent value at + * and beneath which exponential notation is used, and the second number is the positive exponent + * value at and above which exponential notation is used. + * + * For example, to emulate JavaScript numbers in terms of the exponent values at which they begin + * to use exponential notation, use `[-7, 20]`. + * + * ```ts + * BigNumber.config({ EXPONENTIAL_AT: 2 }) + * new BigNumber(12.3) // '12.3' e is only 1 + * new BigNumber(123) // '1.23e+2' + * new BigNumber(0.123) // '0.123' e is only -1 + * new BigNumber(0.0123) // '1.23e-2' + * + * BigNumber.config({ EXPONENTIAL_AT: [-7, 20] }) + * new BigNumber(123456789) // '123456789' e is only 8 + * new BigNumber(0.000000123) // '1.23e-7' + * + * // Almost never return exponential notation: + * BigNumber.config({ EXPONENTIAL_AT: 1e+9 }) + * + * // Always return exponential notation: + * BigNumber.config({ EXPONENTIAL_AT: 0 }) + * ``` + * + * Regardless of the value of `EXPONENTIAL_AT`, the `toFixed` method will always return a value in + * normal notation and the `toExponential` method will always return a value in exponential form. + * Calling `toString` with a base argument, e.g. `toString(10)`, will also always return normal + * notation. + */ + EXPONENTIAL_AT?: number | [number, number]; + + /** + * An integer, magnitude 1 to 1e+9, or an array, [-1e+9 to -1, 1 to 1e+9]. + * Default value: `[-1e+9, 1e+9]`. + * + * The exponent value(s) beyond which overflow to Infinity and underflow to zero occurs. + * + * If a single number is assigned, it is the maximum exponent magnitude: values wth a positive + * exponent of greater magnitude become Infinity and those with a negative exponent of greater + * magnitude become zero. + * + * If an array of two numbers is assigned then the first number is the negative exponent limit and + * the second number is the positive exponent limit. + * + * For example, to emulate JavaScript numbers in terms of the exponent values at which they + * become zero and Infinity, use [-324, 308]. + * + * ```ts + * BigNumber.config({ RANGE: 500 }) + * BigNumber.config().RANGE // [ -500, 500 ] + * new BigNumber('9.999e499') // '9.999e+499' + * new BigNumber('1e500') // 'Infinity' + * new BigNumber('1e-499') // '1e-499' + * new BigNumber('1e-500') // '0' + * + * BigNumber.config({ RANGE: [-3, 4] }) + * new BigNumber(99999) // '99999' e is only 4 + * new BigNumber(100000) // 'Infinity' e is 5 + * new BigNumber(0.001) // '0.01' e is only -3 + * new BigNumber(0.0001) // '0' e is -4 + * ``` + * The largest possible magnitude of a finite BigNumber is 9.999...e+1000000000. + * The smallest possible magnitude of a non-zero BigNumber is 1e-1000000000. + */ + RANGE?: number | [number, number]; + + /** + * A boolean: `true` or `false`. Default value: `false`. + * + * The value that determines whether cryptographically-secure pseudo-random number generation is + * used. If `CRYPTO` is set to true then the random method will generate random digits using + * `crypto.getRandomValues` in browsers that support it, or `crypto.randomBytes` if using a + * version of Node.js that supports it. + * + * If neither function is supported by the host environment then attempting to set `CRYPTO` to + * `true` will fail and an exception will be thrown. + * + * If `CRYPTO` is `false` then the source of randomness used will be `Math.random` (which is + * assumed to generate at least 30 bits of randomness). + * + * See `BigNumber.random`. + * + * ```ts + * // Node.js + * global.crypto = require('crypto') + * + * BigNumber.config({ CRYPTO: true }) + * BigNumber.config().CRYPTO // true + * BigNumber.random() // 0.54340758610486147524 + * ``` + */ + CRYPTO?: boolean; + + /** + * An integer, 0, 1, 3, 6 or 9. Default value: `BigNumber.ROUND_DOWN` (1). + * + * The modulo mode used when calculating the modulus: `a mod n`. + * The quotient, `q = a / n`, is calculated according to the `ROUNDING_MODE` that corresponds to + * the chosen `MODULO_MODE`. + * The remainder, `r`, is calculated as: `r = a - n * q`. + * + * The modes that are most commonly used for the modulus/remainder operation are shown in the + * following table. Although the other rounding modes can be used, they may not give useful + * results. + * + * Property | Value | Description + * :------------------|:------|:------------------------------------------------------------------ + * `ROUND_UP` | 0 | The remainder is positive if the dividend is negative. + * `ROUND_DOWN` | 1 | The remainder has the same sign as the dividend. + * | | Uses 'truncating division' and matches JavaScript's `%` operator . + * `ROUND_FLOOR` | 3 | The remainder has the same sign as the divisor. + * | | This matches Python's `%` operator. + * `ROUND_HALF_EVEN` | 6 | The IEEE 754 remainder function. + * `EUCLID` | 9 | The remainder is always positive. + * | | Euclidian division: `q = sign(n) * floor(a / abs(n))` + * + * The rounding/modulo modes are available as enumerated properties of the BigNumber constructor. + * + * See `modulo`. + * + * ```ts + * BigNumber.config({ MODULO_MODE: BigNumber.EUCLID }) + * BigNumber.set({ MODULO_MODE: 9 }) // equivalent + * ``` + */ + MODULO_MODE?: BigNumber.ModuloMode; + + /** + * An integer, 0 to 1e+9. Default value: 0. + * + * The maximum precision, i.e. number of significant digits, of the result of the power operation + * - unless a modulus is specified. + * + * If set to 0, the number of significant digits will not be limited. + * + * See `exponentiatedBy`. + * + * ```ts + * BigNumber.config({ POW_PRECISION: 100 }) + * ``` + */ + POW_PRECISION?: number; + + /** + * An object including any number of the properties shown below. + * + * The object configures the format of the string returned by the `toFormat` method. + * The example below shows the properties of the object that are recognised, and + * their default values. + * + * Unlike the other configuration properties, the values of the properties of the `FORMAT` object + * will not be checked for validity - the existing object will simply be replaced by the object + * that is passed in. + * + * See `toFormat`. + * + * ```ts + * BigNumber.config({ + * FORMAT: { + * // string to prepend + * prefix: '', + * // the decimal separator + * decimalSeparator: '.', + * // the grouping separator of the integer part + * groupSeparator: ',', + * // the primary grouping size of the integer part + * groupSize: 3, + * // the secondary grouping size of the integer part + * secondaryGroupSize: 0, + * // the grouping separator of the fraction part + * fractionGroupSeparator: ' ', + * // the grouping size of the fraction part + * fractionGroupSize: 0, + * // string to append + * suffix: '' + * } + * }) + * ``` + */ + FORMAT?: BigNumber.Format; + + /** + * The alphabet used for base conversion. The length of the alphabet corresponds to the maximum + * value of the base argument that can be passed to the BigNumber constructor or `toString`. + * + * Default value: `'0123456789abcdefghijklmnopqrstuvwxyz'`. + * + * There is no maximum length for the alphabet, but it must be at least 2 characters long, + * and it must not contain whitespace or a repeated character, or the sign indicators '+' and + * '-', or the decimal separator '.'. + * + * ```ts + * // duodecimal (base 12) + * BigNumber.config({ ALPHABET: '0123456789TE' }) + * x = new BigNumber('T', 12) + * x.toString() // '10' + * x.toString(12) // 'T' + * ``` + */ + ALPHABET?: string; + } + + /** See `FORMAT` and `toFormat`. */ + interface Format { + + /** The string to prepend. */ + prefix?: string; + + /** The decimal separator. */ + decimalSeparator?: string; + + /** The grouping separator of the integer part. */ + groupSeparator?: string; + + /** The primary grouping size of the integer part. */ + groupSize?: number; + + /** The secondary grouping size of the integer part. */ + secondaryGroupSize?: number; + + /** The grouping separator of the fraction part. */ + fractionGroupSeparator?: string; + + /** The grouping size of the fraction part. */ + fractionGroupSize?: number; + + /** The string to append. */ + suffix?: string; + } + + interface Instance { + + /** The coefficient of the value of this BigNumber, an array of base 1e14 integer numbers, or null. */ + readonly c: number[] | null; + + /** The exponent of the value of this BigNumber, an integer number, -1000000000 to 1000000000, or null. */ + readonly e: number | null; + + /** The sign of the value of this BigNumber, -1, 1, or null. */ + readonly s: number | null; + + [key: string]: any; + } + + type Constructor = typeof BigNumber; + type ModuloMode = 0 | 1 | 3 | 6 | 9; + type RoundingMode = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8; + type Value = string | number | Instance; +} + +export declare class BigNumber implements BigNumber.Instance { + + /** Used internally to identify a BigNumber instance. */ + private readonly _isBigNumber: true; + + /** The coefficient of the value of this BigNumber, an array of base 1e14 integer numbers, or null. */ + readonly c: number[] | null; + + /** The exponent of the value of this BigNumber, an integer number, -1000000000 to 1000000000, or null. */ + readonly e: number | null; + + /** The sign of the value of this BigNumber, -1, 1, or null. */ + readonly s: number | null; + + /** + * Returns a new instance of a BigNumber object with value `n`, where `n` is a numeric value in + * the specified `base`, or base 10 if `base` is omitted or is `null` or `undefined`. + * + * ```ts + * x = new BigNumber(123.4567) // '123.4567' + * // 'new' is optional + * y = BigNumber(x) // '123.4567' + * ``` + * + * If `n` is a base 10 value it can be in normal (fixed-point) or exponential notation. + * Values in other bases must be in normal notation. Values in any base can have fraction digits, + * i.e. digits after the decimal point. + * + * ```ts + * new BigNumber(43210) // '43210' + * new BigNumber('4.321e+4') // '43210' + * new BigNumber('-735.0918e-430') // '-7.350918e-428' + * new BigNumber('123412421.234324', 5) // '607236.557696' + * ``` + * + * Signed `0`, signed `Infinity` and `NaN` are supported. + * + * ```ts + * new BigNumber('-Infinity') // '-Infinity' + * new BigNumber(NaN) // 'NaN' + * new BigNumber(-0) // '0' + * new BigNumber('.5') // '0.5' + * new BigNumber('+2') // '2' + * ``` + * + * String values in hexadecimal literal form, e.g. `'0xff'`, are valid, as are string values with + * the octal and binary prefixs `'0o'` and `'0b'`. String values in octal literal form without the + * prefix will be interpreted as decimals, e.g. `'011'` is interpreted as 11, not 9. + * + * ```ts + * new BigNumber(-10110100.1, 2) // '-180.5' + * new BigNumber('-0b10110100.1') // '-180.5' + * new BigNumber('ff.8', 16) // '255.5' + * new BigNumber('0xff.8') // '255.5' + * ``` + * + * If a base is specified, `n` is rounded according to the current `DECIMAL_PLACES` and + * `ROUNDING_MODE` settings. This includes base 10, so don't include a `base` parameter for decimal + * values unless this behaviour is desired. + * + * ```ts + * BigNumber.config({ DECIMAL_PLACES: 5 }) + * new BigNumber(1.23456789) // '1.23456789' + * new BigNumber(1.23456789, 10) // '1.23457' + * ``` + * + * An error is thrown if `base` is invalid. + * + * There is no limit to the number of digits of a value of type string (other than that of + * JavaScript's maximum array size). See `RANGE` to set the maximum and minimum possible exponent + * value of a BigNumber. + * + * ```ts + * new BigNumber('5032485723458348569331745.33434346346912144534543') + * new BigNumber('4.321e10000000') + * ``` + * + * BigNumber `NaN` is returned if `n` is invalid (unless `BigNumber.DEBUG` is `true`, see below). + * + * ```ts + * new BigNumber('.1*') // 'NaN' + * new BigNumber('blurgh') // 'NaN' + * new BigNumber(9, 2) // 'NaN' + * ``` + * + * To aid in debugging, if `BigNumber.DEBUG` is `true` then an error will be thrown on an + * invalid `n`. An error will also be thrown if `n` is of type number with more than 15 + * significant digits, as calling `toString` or `valueOf` on these numbers may not result in the + * intended value. + * + * ```ts + * console.log(823456789123456.3) // 823456789123456.2 + * new BigNumber(823456789123456.3) // '823456789123456.2' + * BigNumber.DEBUG = true + * // 'Error: Number has more than 15 significant digits' + * new BigNumber(823456789123456.3) + * // 'Error: Not a base 2 number' + * new BigNumber(9, 2) + * ``` + * + * A BigNumber can also be created from an object literal. + * Use `isBigNumber` to check that it is well-formed. + * + * ```ts + * new BigNumber({ s: 1, e: 2, c: [ 777, 12300000000000 ], _isBigNumber: true }) // '777.123' + * ``` + * + * @param n A numeric value. + * @param base The base of `n`, integer, 2 to 36 (or `ALPHABET.length`, see `ALPHABET`). + */ + constructor(n: BigNumber.Value, base?: number); + + /** + * Returns a BigNumber whose value is the absolute value, i.e. the magnitude, of the value of this + * BigNumber. + * + * The return value is always exact and unrounded. + * + * ```ts + * x = new BigNumber(-0.8) + * x.absoluteValue() // '0.8' + * ``` + */ + absoluteValue(): BigNumber; + + /** + * Returns a BigNumber whose value is the absolute value, i.e. the magnitude, of the value of this + * BigNumber. + * + * The return value is always exact and unrounded. + * + * ```ts + * x = new BigNumber(-0.8) + * x.abs() // '0.8' + * ``` + */ + abs(): BigNumber; + + /** + * Returns | | + * :-------:|:--------------------------------------------------------------| + * 1 | If the value of this BigNumber is greater than the value of `n` + * -1 | If the value of this BigNumber is less than the value of `n` + * 0 | If this BigNumber and `n` have the same value + * `null` | If the value of either this BigNumber or `n` is `NaN` + * + * ```ts + * + * x = new BigNumber(Infinity) + * y = new BigNumber(5) + * x.comparedTo(y) // 1 + * x.comparedTo(x.minus(1)) // 0 + * y.comparedTo(NaN) // null + * y.comparedTo('110', 2) // -1 + * ``` + * @param n A numeric value. + * @param [base] The base of n. + */ + comparedTo(n: BigNumber.Value, base?: number): number; + + /** + * Returns a BigNumber whose value is the value of this BigNumber rounded by rounding mode + * `roundingMode` to a maximum of `decimalPlaces` decimal places. + * + * If `decimalPlaces` is omitted, or is `null` or `undefined`, the return value is the number of + * decimal places of the value of this BigNumber, or `null` if the value of this BigNumber is + * ±`Infinity` or `NaN`. + * + * If `roundingMode` is omitted, or is `null` or `undefined`, `ROUNDING_MODE` is used. + * + * Throws if `decimalPlaces` or `roundingMode` is invalid. + * + * ```ts + * x = new BigNumber(1234.56) + * x.decimalPlaces() // 2 + * x.decimalPlaces(1) // '1234.6' + * x.decimalPlaces(2) // '1234.56' + * x.decimalPlaces(10) // '1234.56' + * x.decimalPlaces(0, 1) // '1234' + * x.decimalPlaces(0, 6) // '1235' + * x.decimalPlaces(1, 1) // '1234.5' + * x.decimalPlaces(1, BigNumber.ROUND_HALF_EVEN) // '1234.6' + * x // '1234.56' + * y = new BigNumber('9.9e-101') + * y.decimalPlaces() // 102 + * ``` + * + * @param [decimalPlaces] Decimal places, integer, 0 to 1e+9. + * @param [roundingMode] Rounding mode, integer, 0 to 8. + */ + decimalPlaces(): number; + decimalPlaces(decimalPlaces: number, roundingMode?: BigNumber.RoundingMode): BigNumber; + + /** + * Returns a BigNumber whose value is the value of this BigNumber rounded by rounding mode + * `roundingMode` to a maximum of `decimalPlaces` decimal places. + * + * If `decimalPlaces` is omitted, or is `null` or `undefined`, the return value is the number of + * decimal places of the value of this BigNumber, or `null` if the value of this BigNumber is + * ±`Infinity` or `NaN`. + * + * If `roundingMode` is omitted, or is `null` or `undefined`, `ROUNDING_MODE` is used. + * + * Throws if `decimalPlaces` or `roundingMode` is invalid. + * + * ```ts + * x = new BigNumber(1234.56) + * x.dp() // 2 + * x.dp(1) // '1234.6' + * x.dp(2) // '1234.56' + * x.dp(10) // '1234.56' + * x.dp(0, 1) // '1234' + * x.dp(0, 6) // '1235' + * x.dp(1, 1) // '1234.5' + * x.dp(1, BigNumber.ROUND_HALF_EVEN) // '1234.6' + * x // '1234.56' + * y = new BigNumber('9.9e-101') + * y.dp() // 102 + * ``` + * + * @param [decimalPlaces] Decimal places, integer, 0 to 1e+9. + * @param [roundingMode] Rounding mode, integer, 0 to 8. + */ + dp(): number; + dp(decimalPlaces: number, roundingMode?: BigNumber.RoundingMode): BigNumber; + + /** + * Returns a BigNumber whose value is the value of this BigNumber divided by `n`, rounded + * according to the current `DECIMAL_PLACES` and `ROUNDING_MODE` settings. + * + * ```ts + * x = new BigNumber(355) + * y = new BigNumber(113) + * x.dividedBy(y) // '3.14159292035398230088' + * x.dividedBy(5) // '71' + * x.dividedBy(47, 16) // '5' + * ``` + * + * @param n A numeric value. + * @param [base] The base of n. + */ + dividedBy(n: BigNumber.Value, base?: number): BigNumber; + + /** + * Returns a BigNumber whose value is the value of this BigNumber divided by `n`, rounded + * according to the current `DECIMAL_PLACES` and `ROUNDING_MODE` settings. + * + * ```ts + * x = new BigNumber(355) + * y = new BigNumber(113) + * x.div(y) // '3.14159292035398230088' + * x.div(5) // '71' + * x.div(47, 16) // '5' + * ``` + * + * @param n A numeric value. + * @param [base] The base of n. + */ + div(n: BigNumber.Value, base?: number): BigNumber; + + /** + * Returns a BigNumber whose value is the integer part of dividing the value of this BigNumber by + * `n`. + * + * ```ts + * x = new BigNumber(5) + * y = new BigNumber(3) + * x.dividedToIntegerBy(y) // '1' + * x.dividedToIntegerBy(0.7) // '7' + * x.dividedToIntegerBy('0.f', 16) // '5' + * ``` + * + * @param n A numeric value. + * @param [base] The base of n. + */ + dividedToIntegerBy(n: BigNumber.Value, base?: number): BigNumber; + + /** + * Returns a BigNumber whose value is the integer part of dividing the value of this BigNumber by + * `n`. + * + * ```ts + * x = new BigNumber(5) + * y = new BigNumber(3) + * x.idiv(y) // '1' + * x.idiv(0.7) // '7' + * x.idiv('0.f', 16) // '5' + * ``` + * + * @param n A numeric value. + * @param [base] The base of n. + */ + idiv(n: BigNumber.Value, base?: number): BigNumber; + + /** + * Returns a BigNumber whose value is the value of this BigNumber exponentiated by `n`, i.e. + * raised to the power `n`, and optionally modulo a modulus `m`. + * + * If `n` is negative the result is rounded according to the current `DECIMAL_PLACES` and + * `ROUNDING_MODE` settings. + * + * As the number of digits of the result of the power operation can grow so large so quickly, + * e.g. 123.456**10000 has over 50000 digits, the number of significant digits calculated is + * limited to the value of the `POW_PRECISION` setting (unless a modulus `m` is specified). + * + * By default `POW_PRECISION` is set to 0. This means that an unlimited number of significant + * digits will be calculated, and that the method's performance will decrease dramatically for + * larger exponents. + * + * If `m` is specified and the value of `m`, `n` and this BigNumber are integers and `n` is + * positive, then a fast modular exponentiation algorithm is used, otherwise the operation will + * be performed as `x.exponentiatedBy(n).modulo(m)` with a `POW_PRECISION` of 0. + * + * Throws if `n` is not an integer. + * + * ```ts + * Math.pow(0.7, 2) // 0.48999999999999994 + * x = new BigNumber(0.7) + * x.exponentiatedBy(2) // '0.49' + * BigNumber(3).exponentiatedBy(-2) // '0.11111111111111111111' + * ``` + * + * @param n The exponent, an integer. + * @param [m] The modulus. + */ + exponentiatedBy(n: BigNumber.Value, m?: BigNumber.Value): BigNumber; + exponentiatedBy(n: number, m?: BigNumber.Value): BigNumber; + + /** + * Returns a BigNumber whose value is the value of this BigNumber exponentiated by `n`, i.e. + * raised to the power `n`, and optionally modulo a modulus `m`. + * + * If `n` is negative the result is rounded according to the current `DECIMAL_PLACES` and + * `ROUNDING_MODE` settings. + * + * As the number of digits of the result of the power operation can grow so large so quickly, + * e.g. 123.456**10000 has over 50000 digits, the number of significant digits calculated is + * limited to the value of the `POW_PRECISION` setting (unless a modulus `m` is specified). + * + * By default `POW_PRECISION` is set to 0. This means that an unlimited number of significant + * digits will be calculated, and that the method's performance will decrease dramatically for + * larger exponents. + * + * If `m` is specified and the value of `m`, `n` and this BigNumber are integers and `n` is + * positive, then a fast modular exponentiation algorithm is used, otherwise the operation will + * be performed as `x.pow(n).modulo(m)` with a `POW_PRECISION` of 0. + * + * Throws if `n` is not an integer. + * + * ```ts + * Math.pow(0.7, 2) // 0.48999999999999994 + * x = new BigNumber(0.7) + * x.pow(2) // '0.49' + * BigNumber(3).pow(-2) // '0.11111111111111111111' + * ``` + * + * @param n The exponent, an integer. + * @param [m] The modulus. + */ + pow(n: BigNumber.Value, m?: BigNumber.Value): BigNumber; + pow(n: number, m?: BigNumber.Value): BigNumber; + + /** + * Returns a BigNumber whose value is the value of this BigNumber rounded to an integer using + * rounding mode `rm`. + * + * If `rm` is omitted, or is `null` or `undefined`, `ROUNDING_MODE` is used. + * + * Throws if `rm` is invalid. + * + * ```ts + * x = new BigNumber(123.456) + * x.integerValue() // '123' + * x.integerValue(BigNumber.ROUND_CEIL) // '124' + * y = new BigNumber(-12.7) + * y.integerValue() // '-13' + * x.integerValue(BigNumber.ROUND_DOWN) // '-12' + * ``` + * + * @param {BigNumber.RoundingMode} [rm] The roundng mode, an integer, 0 to 8. + */ + integerValue(rm?: BigNumber.RoundingMode): BigNumber; + + /** + * Returns `true` if the value of this BigNumber is equal to the value of `n`, otherwise returns + * `false`. + * + * As with JavaScript, `NaN` does not equal `NaN`. + * + * ```ts + * 0 === 1e-324 // true + * x = new BigNumber(0) + * x.isEqualTo('1e-324') // false + * BigNumber(-0).isEqualTo(x) // true ( -0 === 0 ) + * BigNumber(255).isEqualTo('ff', 16) // true + * + * y = new BigNumber(NaN) + * y.isEqualTo(NaN) // false + * ``` + * + * @param n A numeric value. + * @param [base] The base of n. + */ + isEqualTo(n: BigNumber.Value, base?: number): boolean; + + /** + * Returns `true` if the value of this BigNumber is equal to the value of `n`, otherwise returns + * `false`. + * + * As with JavaScript, `NaN` does not equal `NaN`. + * + * ```ts + * 0 === 1e-324 // true + * x = new BigNumber(0) + * x.eq('1e-324') // false + * BigNumber(-0).eq(x) // true ( -0 === 0 ) + * BigNumber(255).eq('ff', 16) // true + * + * y = new BigNumber(NaN) + * y.eq(NaN) // false + * ``` + * + * @param n A numeric value. + * @param [base] The base of n. + */ + eq(n: BigNumber.Value, base?: number): boolean; + + /** + * Returns `true` if the value of this BigNumber is a finite number, otherwise returns `false`. + * + * The only possible non-finite values of a BigNumber are `NaN`, `Infinity` and `-Infinity`. + * + * ```ts + * x = new BigNumber(1) + * x.isFinite() // true + * y = new BigNumber(Infinity) + * y.isFinite() // false + * ``` + */ + isFinite(): boolean; + + /** + * Returns `true` if the value of this BigNumber is greater than the value of `n`, otherwise + * returns `false`. + * + * ```ts + * 0.1 > (0.3 - 0.2) // true + * x = new BigNumber(0.1) + * x.isGreaterThan(BigNumber(0.3).minus(0.2)) // false + * BigNumber(0).isGreaterThan(x) // false + * BigNumber(11, 3).isGreaterThan(11.1, 2) // true + * ``` + * + * @param n A numeric value. + * @param [base] The base of n. + */ + isGreaterThan(n: BigNumber.Value, base?: number): boolean; + + /** + * Returns `true` if the value of this BigNumber is greater than the value of `n`, otherwise + * returns `false`. + * + * ```ts + * 0.1 > (0.3 - 0 // true + * x = new BigNumber(0.1) + * x.gt(BigNumber(0.3).minus(0.2)) // false + * BigNumber(0).gt(x) // false + * BigNumber(11, 3).gt(11.1, 2) // true + * ``` + * + * @param n A numeric value. + * @param [base] The base of n. + */ + gt(n: BigNumber.Value, base?: number): boolean; + + /** + * Returns `true` if the value of this BigNumber is greater than or equal to the value of `n`, + * otherwise returns `false`. + * + * ```ts + * (0.3 - 0.2) >= 0.1 // false + * x = new BigNumber(0.3).minus(0.2) + * x.isGreaterThanOrEqualTo(0.1) // true + * BigNumber(1).isGreaterThanOrEqualTo(x) // true + * BigNumber(10, 18).isGreaterThanOrEqualTo('i', 36) // true + * ``` + * + * @param n A numeric value. + * @param [base] The base of n. + */ + isGreaterThanOrEqualTo(n: BigNumber.Value, base?: number): boolean; + + /** + * Returns `true` if the value of this BigNumber is greater than or equal to the value of `n`, + * otherwise returns `false`. + * + * ```ts + * (0.3 - 0.2) >= 0.1 // false + * x = new BigNumber(0.3).minus(0.2) + * x.gte(0.1) // true + * BigNumber(1).gte(x) // true + * BigNumber(10, 18).gte('i', 36) // true + * ``` + * + * @param n A numeric value. + * @param [base] The base of n. + */ + gte(n: BigNumber.Value, base?: number): boolean; + + /** + * Returns `true` if the value of this BigNumber is an integer, otherwise returns `false`. + * + * ```ts + * x = new BigNumber(1) + * x.isInteger() // true + * y = new BigNumber(123.456) + * y.isInteger() // false + * ``` + */ + isInteger(): boolean; + + /** + * Returns `true` if the value of this BigNumber is less than the value of `n`, otherwise returns + * `false`. + * + * ```ts + * (0.3 - 0.2) < 0.1 // true + * x = new BigNumber(0.3).minus(0.2) + * x.isLessThan(0.1) // false + * BigNumber(0).isLessThan(x) // true + * BigNumber(11.1, 2).isLessThan(11, 3) // true + * ``` + * + * @param n A numeric value. + * @param [base] The base of n. + */ + isLessThan(n: BigNumber.Value, base?: number): boolean; + + /** + * Returns `true` if the value of this BigNumber is less than the value of `n`, otherwise returns + * `false`. + * + * ```ts + * (0.3 - 0.2) < 0.1 // true + * x = new BigNumber(0.3).minus(0.2) + * x.lt(0.1) // false + * BigNumber(0).lt(x) // true + * BigNumber(11.1, 2).lt(11, 3) // true + * ``` + * + * @param n A numeric value. + * @param [base] The base of n. + */ + lt(n: BigNumber.Value, base?: number): boolean; + + /** + * Returns `true` if the value of this BigNumber is less than or equal to the value of `n`, + * otherwise returns `false`. + * + * ```ts + * 0.1 <= (0.3 - 0.2) // false + * x = new BigNumber(0.1) + * x.isLessThanOrEqualTo(BigNumber(0.3).minus(0.2)) // true + * BigNumber(-1).isLessThanOrEqualTo(x) // true + * BigNumber(10, 18).isLessThanOrEqualTo('i', 36) // true + * ``` + * + * @param n A numeric value. + * @param [base] The base of n. + */ + isLessThanOrEqualTo(n: BigNumber.Value, base?: number): boolean; + + /** + * Returns `true` if the value of this BigNumber is less than or equal to the value of `n`, + * otherwise returns `false`. + * + * ```ts + * 0.1 <= (0.3 - 0.2) // false + * x = new BigNumber(0.1) + * x.lte(BigNumber(0.3).minus(0.2)) // true + * BigNumber(-1).lte(x) // true + * BigNumber(10, 18).lte('i', 36) // true + * ``` + * + * @param n A numeric value. + * @param [base] The base of n. + */ + lte(n: BigNumber.Value, base?: number): boolean; + + /** + * Returns `true` if the value of this BigNumber is `NaN`, otherwise returns `false`. + * + * ```ts + * x = new BigNumber(NaN) + * x.isNaN() // true + * y = new BigNumber('Infinity') + * y.isNaN() // false + * ``` + */ + isNaN(): boolean; + + /** + * Returns `true` if the value of this BigNumber is negative, otherwise returns `false`. + * + * ```ts + * x = new BigNumber(-0) + * x.isNegative() // true + * y = new BigNumber(2) + * y.isNegative() // false + * ``` + */ + isNegative(): boolean; + + /** + * Returns `true` if the value of this BigNumber is positive, otherwise returns `false`. + * + * ```ts + * x = new BigNumber(-0) + * x.isPositive() // false + * y = new BigNumber(2) + * y.isPositive() // true + * ``` + */ + isPositive(): boolean; + + /** + * Returns `true` if the value of this BigNumber is zero or minus zero, otherwise returns `false`. + * + * ```ts + * x = new BigNumber(-0) + * x.isZero() // true + * ``` + */ + isZero(): boolean; + + /** + * Returns a BigNumber whose value is the value of this BigNumber minus `n`. + * + * The return value is always exact and unrounded. + * + * ```ts + * 0.3 - 0.1 // 0.19999999999999998 + * x = new BigNumber(0.3) + * x.minus(0.1) // '0.2' + * x.minus(0.6, 20) // '0' + * ``` + * + * @param n A numeric value. + * @param [base] The base of n. + */ + minus(n: BigNumber.Value, base?: number): BigNumber; + + /** + * Returns a BigNumber whose value is the value of this BigNumber modulo `n`, i.e. the integer + * remainder of dividing this BigNumber by `n`. + * + * The value returned, and in particular its sign, is dependent on the value of the `MODULO_MODE` + * setting of this BigNumber constructor. If it is 1 (default value), the result will have the + * same sign as this BigNumber, and it will match that of Javascript's `%` operator (within the + * limits of double precision) and BigDecimal's `remainder` method. + * + * The return value is always exact and unrounded. + * + * See `MODULO_MODE` for a description of the other modulo modes. + * + * ```ts + * 1 % 0.9 // 0.09999999999999998 + * x = new BigNumber(1) + * x.modulo(0.9) // '0.1' + * y = new BigNumber(33) + * y.modulo('a', 33) // '3' + * ``` + * + * @param n A numeric value. + * @param [base] The base of n. + */ + modulo(n: BigNumber.Value, base?: number): BigNumber; + + /** + * Returns a BigNumber whose value is the value of this BigNumber modulo `n`, i.e. the integer + * remainder of dividing this BigNumber by `n`. + * + * The value returned, and in particular its sign, is dependent on the value of the `MODULO_MODE` + * setting of this BigNumber constructor. If it is 1 (default value), the result will have the + * same sign as this BigNumber, and it will match that of Javascript's `%` operator (within the + * limits of double precision) and BigDecimal's `remainder` method. + * + * The return value is always exact and unrounded. + * + * See `MODULO_MODE` for a description of the other modulo modes. + * + * ```ts + * 1 % 0.9 // 0.09999999999999998 + * x = new BigNumber(1) + * x.mod(0.9) // '0.1' + * y = new BigNumber(33) + * y.mod('a', 33) // '3' + * ``` + * + * @param n A numeric value. + * @param [base] The base of n. + */ + mod(n: BigNumber.Value, base?: number): BigNumber; + + /** + * Returns a BigNumber whose value is the value of this BigNumber multiplied by `n`. + * + * The return value is always exact and unrounded. + * + * ```ts + * 0.6 * 3 // 1.7999999999999998 + * x = new BigNumber(0.6) + * y = x.multipliedBy(3) // '1.8' + * BigNumber('7e+500').multipliedBy(y) // '1.26e+501' + * x.multipliedBy('-a', 16) // '-6' + * ``` + * + * @param n A numeric value. + * @param [base] The base of n. + */ + multipliedBy(n: BigNumber.Value, base?: number): BigNumber; + + /** + * Returns a BigNumber whose value is the value of this BigNumber multiplied by `n`. + * + * The return value is always exact and unrounded. + * + * ```ts + * 0.6 * 3 // 1.7999999999999998 + * x = new BigNumber(0.6) + * y = x.times(3) // '1.8' + * BigNumber('7e+500').times(y) // '1.26e+501' + * x.times('-a', 16) // '-6' + * ``` + * + * @param n A numeric value. + * @param [base] The base of n. + */ + times(n: BigNumber.Value, base?: number): BigNumber; + + /** + * Returns a BigNumber whose value is the value of this BigNumber negated, i.e. multiplied by -1. + * + * ```ts + * x = new BigNumber(1.8) + * x.negated() // '-1.8' + * y = new BigNumber(-1.3) + * y.negated() // '1.3' + * ``` + */ + negated(): BigNumber; + + /** + * Returns a BigNumber whose value is the value of this BigNumber plus `n`. + * + * The return value is always exact and unrounded. + * + * ```ts + * 0.1 + 0.2 // 0.30000000000000004 + * x = new BigNumber(0.1) + * y = x.plus(0.2) // '0.3' + * BigNumber(0.7).plus(x).plus(y) // '1' + * x.plus('0.1', 8) // '0.225' + * ``` + * + * @param n A numeric value. + * @param [base] The base of n. + */ + plus(n: BigNumber.Value, base?: number): BigNumber; + + /** + * Returns the number of significant digits of the value of this BigNumber, or `null` if the value + * of this BigNumber is ±`Infinity` or `NaN`. + * + * If `includeZeros` is true then any trailing zeros of the integer part of the value of this + * BigNumber are counted as significant digits, otherwise they are not. + * + * Throws if `includeZeros` is invalid. + * + * ```ts + * x = new BigNumber(9876.54321) + * x.precision() // 9 + * y = new BigNumber(987000) + * y.precision(false) // 3 + * y.precision(true) // 6 + * ``` + * + * @param [includeZeros] Whether to include integer trailing zeros in the significant digit count. + */ + precision(includeZeros?: boolean): number; + + /** + * Returns a BigNumber whose value is the value of this BigNumber rounded to a precision of + * `significantDigits` significant digits using rounding mode `roundingMode`. + * + * If `roundingMode` is omitted or is `null` or `undefined`, `ROUNDING_MODE` will be used. + * + * Throws if `significantDigits` or `roundingMode` is invalid. + * + * ```ts + * x = new BigNumber(9876.54321) + * x.precision(6) // '9876.54' + * x.precision(6, BigNumber.ROUND_UP) // '9876.55' + * x.precision(2) // '9900' + * x.precision(2, 1) // '9800' + * x // '9876.54321' + * ``` + * + * @param significantDigits Significant digits, integer, 1 to 1e+9. + * @param [roundingMode] Rounding mode, integer, 0 to 8. + */ + precision(significantDigits: number, roundingMode?: BigNumber.RoundingMode): BigNumber; + + /** + * Returns the number of significant digits of the value of this BigNumber, + * or `null` if the value of this BigNumber is ±`Infinity` or `NaN`. + * + * If `includeZeros` is true then any trailing zeros of the integer part of + * the value of this BigNumber are counted as significant digits, otherwise + * they are not. + * + * Throws if `includeZeros` is invalid. + * + * ```ts + * x = new BigNumber(9876.54321) + * x.sd() // 9 + * y = new BigNumber(987000) + * y.sd(false) // 3 + * y.sd(true) // 6 + * ``` + * + * @param [includeZeros] Whether to include integer trailing zeros in the significant digit count. + */ + sd(includeZeros?: boolean): number; + + /** + * Returns a BigNumber whose value is the value of this BigNumber rounded to a precision of + * `significantDigits` significant digits using rounding mode `roundingMode`. + * + * If `roundingMode` is omitted or is `null` or `undefined`, `ROUNDING_MODE` will be used. + * + * Throws if `significantDigits` or `roundingMode` is invalid. + * + * ```ts + * x = new BigNumber(9876.54321) + * x.sd(6) // '9876.54' + * x.sd(6, BigNumber.ROUND_UP) // '9876.55' + * x.sd(2) // '9900' + * x.sd(2, 1) // '9800' + * x // '9876.54321' + * ``` + * + * @param significantDigits Significant digits, integer, 1 to 1e+9. + * @param [roundingMode] Rounding mode, integer, 0 to 8. + */ + sd(significantDigits: number, roundingMode?: BigNumber.RoundingMode): BigNumber; + + /** + * Returns a BigNumber whose value is the value of this BigNumber shifted by `n` places. + * + * The shift is of the decimal point, i.e. of powers of ten, and is to the left if `n` is negative + * or to the right if `n` is positive. + * + * The return value is always exact and unrounded. + * + * Throws if `n` is invalid. + * + * ```ts + * x = new BigNumber(1.23) + * x.shiftedBy(3) // '1230' + * x.shiftedBy(-3) // '0.00123' + * ``` + * + * @param n The shift value, integer, -9007199254740991 to 9007199254740991. + */ + shiftedBy(n: number): BigNumber; + + /** + * Returns a BigNumber whose value is the square root of the value of this BigNumber, rounded + * according to the current `DECIMAL_PLACES` and `ROUNDING_MODE` settings. + * + * The return value will be correctly rounded, i.e. rounded as if the result was first calculated + * to an infinite number of correct digits before rounding. + * + * ```ts + * x = new BigNumber(16) + * x.squareRoot() // '4' + * y = new BigNumber(3) + * y.squareRoot() // '1.73205080756887729353' + * ``` + */ + squareRoot(): BigNumber; + + /** + * Returns a BigNumber whose value is the square root of the value of this BigNumber, rounded + * according to the current `DECIMAL_PLACES` and `ROUNDING_MODE` settings. + * + * The return value will be correctly rounded, i.e. rounded as if the result was first calculated + * to an infinite number of correct digits before rounding. + * + * ```ts + * x = new BigNumber(16) + * x.sqrt() // '4' + * y = new BigNumber(3) + * y.sqrt() // '1.73205080756887729353' + * ``` + */ + sqrt(): BigNumber; + + /** + * Returns a string representing the value of this BigNumber in exponential notation rounded using + * rounding mode `roundingMode` to `decimalPlaces` decimal places, i.e with one digit before the + * decimal point and `decimalPlaces` digits after it. + * + * If the value of this BigNumber in exponential notation has fewer than `decimalPlaces` fraction + * digits, the return value will be appended with zeros accordingly. + * + * If `decimalPlaces` is omitted, or is `null` or `undefined`, the number of digits after the + * decimal point defaults to the minimum number of digits necessary to represent the value + * exactly. + * + * If `roundingMode` is omitted or is `null` or `undefined`, `ROUNDING_MODE` is used. + * + * Throws if `decimalPlaces` or `roundingMode` is invalid. + * + * ```ts + * x = 45.6 + * y = new BigNumber(x) + * x.toExponential() // '4.56e+1' + * y.toExponential() // '4.56e+1' + * x.toExponential(0) // '5e+1' + * y.toExponential(0) // '5e+1' + * x.toExponential(1) // '4.6e+1' + * y.toExponential(1) // '4.6e+1' + * y.toExponential(1, 1) // '4.5e+1' (ROUND_DOWN) + * x.toExponential(3) // '4.560e+1' + * y.toExponential(3) // '4.560e+1' + * ``` + * + * @param [decimalPlaces] Decimal places, integer, 0 to 1e+9. + * @param [roundingMode] Rounding mode, integer, 0 to 8. + */ + toExponential(decimalPlaces: number, roundingMode?: BigNumber.RoundingMode): string; + toExponential(): string; + + /** + * Returns a string representing the value of this BigNumber in normal (fixed-point) notation + * rounded to `decimalPlaces` decimal places using rounding mode `roundingMode`. + * + * If the value of this BigNumber in normal notation has fewer than `decimalPlaces` fraction + * digits, the return value will be appended with zeros accordingly. + * + * Unlike `Number.prototype.toFixed`, which returns exponential notation if a number is greater or + * equal to 10**21, this method will always return normal notation. + * + * If `decimalPlaces` is omitted or is `null` or `undefined`, the return value will be unrounded + * and in normal notation. This is also unlike `Number.prototype.toFixed`, which returns the value + * to zero decimal places. It is useful when normal notation is required and the current + * `EXPONENTIAL_AT` setting causes `toString` to return exponential notation. + * + * If `roundingMode` is omitted or is `null` or `undefined`, `ROUNDING_MODE` is used. + * + * Throws if `decimalPlaces` or `roundingMode` is invalid. + * + * ```ts + * x = 3.456 + * y = new BigNumber(x) + * x.toFixed() // '3' + * y.toFixed() // '3.456' + * y.toFixed(0) // '3' + * x.toFixed(2) // '3.46' + * y.toFixed(2) // '3.46' + * y.toFixed(2, 1) // '3.45' (ROUND_DOWN) + * x.toFixed(5) // '3.45600' + * y.toFixed(5) // '3.45600' + * ``` + * + * @param [decimalPlaces] Decimal places, integer, 0 to 1e+9. + * @param [roundingMode] Rounding mode, integer, 0 to 8. + */ + toFixed(decimalPlaces: number, roundingMode?: BigNumber.RoundingMode): string; + toFixed(): string; + + /** + * Returns a string representing the value of this BigNumber in normal (fixed-point) notation + * rounded to `decimalPlaces` decimal places using rounding mode `roundingMode`, and formatted + * according to the properties of the `format` or `FORMAT` object. + * + * The formatting object may contain some or all of the properties shown in the examples below. + * + * If `decimalPlaces` is omitted or is `null` or `undefined`, then the return value is not + * rounded to a fixed number of decimal places. + * + * If `roundingMode` is omitted or is `null` or `undefined`, `ROUNDING_MODE` is used. + * + * If `format` is omitted or is `null` or `undefined`, `FORMAT` is used. + * + * Throws if `decimalPlaces`, `roundingMode`, or `format` is invalid. + * + * ```ts + * fmt = { + * decimalSeparator: '.', + * groupSeparator: ',', + * groupSize: 3, + * secondaryGroupSize: 0, + * fractionGroupSeparator: ' ', + * fractionGroupSize: 0 + * } + * + * x = new BigNumber('123456789.123456789') + * + * // Set the global formatting options + * BigNumber.config({ FORMAT: fmt }) + * + * x.toFormat() // '123,456,789.123456789' + * x.toFormat(3) // '123,456,789.123' + * + * // If a reference to the object assigned to FORMAT has been retained, + * // the format properties can be changed directly + * fmt.groupSeparator = ' ' + * fmt.fractionGroupSize = 5 + * x.toFormat() // '123 456 789.12345 6789' + * + * // Alternatively, pass the formatting options as an argument + * fmt = { + * decimalSeparator: ',', + * groupSeparator: '.', + * groupSize: 3, + * secondaryGroupSize: 2 + * } + * + * x.toFormat() // '123 456 789.12345 6789' + * x.toFormat(fmt) // '12.34.56.789,123456789' + * x.toFormat(2, fmt) // '12.34.56.789,12' + * x.toFormat(3, BigNumber.ROUND_UP, fmt) // '12.34.56.789,124' + * ``` + * + * @param [decimalPlaces] Decimal places, integer, 0 to 1e+9. + * @param [roundingMode] Rounding mode, integer, 0 to 8. + * @param [format] Formatting options object. See `BigNumber.Format`. + */ + toFormat(decimalPlaces: number, roundingMode: BigNumber.RoundingMode, format?: BigNumber.Format): string; + toFormat(decimalPlaces: number, roundingMode?: BigNumber.RoundingMode): string; + toFormat(decimalPlaces?: number): string; + toFormat(decimalPlaces: number, format: BigNumber.Format): string; + toFormat(format: BigNumber.Format): string; + + /** + * Returns an array of two BigNumbers representing the value of this BigNumber as a simple + * fraction with an integer numerator and an integer denominator. + * The denominator will be a positive non-zero value less than or equal to `max_denominator`. + * If a maximum denominator, `max_denominator`, is not specified, or is `null` or `undefined`, the + * denominator will be the lowest value necessary to represent the number exactly. + * + * Throws if `max_denominator` is invalid. + * + * ```ts + * x = new BigNumber(1.75) + * x.toFraction() // '7, 4' + * + * pi = new BigNumber('3.14159265358') + * pi.toFraction() // '157079632679,50000000000' + * pi.toFraction(100000) // '312689, 99532' + * pi.toFraction(10000) // '355, 113' + * pi.toFraction(100) // '311, 99' + * pi.toFraction(10) // '22, 7' + * pi.toFraction(1) // '3, 1' + * ``` + * + * @param [max_denominator] The maximum denominator, integer > 0, or Infinity. + */ + toFraction(max_denominator?: BigNumber.Value): [BigNumber, BigNumber]; + + /** As `valueOf`. */ + toJSON(): string; + + /** + * Returns the value of this BigNumber as a JavaScript primitive number. + * + * Using the unary plus operator gives the same result. + * + * ```ts + * x = new BigNumber(456.789) + * x.toNumber() // 456.789 + * +x // 456.789 + * + * y = new BigNumber('45987349857634085409857349856430985') + * y.toNumber() // 4.598734985763409e+34 + * + * z = new BigNumber(-0) + * 1 / z.toNumber() // -Infinity + * 1 / +z // -Infinity + * ``` + */ + toNumber(): number; + + /** + * Returns a string representing the value of this BigNumber rounded to `significantDigits` + * significant digits using rounding mode `roundingMode`. + * + * If `significantDigits` is less than the number of digits necessary to represent the integer + * part of the value in normal (fixed-point) notation, then exponential notation is used. + * + * If `significantDigits` is omitted, or is `null` or `undefined`, then the return value is the + * same as `n.toString()`. + * + * If `roundingMode` is omitted or is `null` or `undefined`, `ROUNDING_MODE` is used. + * + * Throws if `significantDigits` or `roundingMode` is invalid. + * + * ```ts + * x = 45.6 + * y = new BigNumber(x) + * x.toPrecision() // '45.6' + * y.toPrecision() // '45.6' + * x.toPrecision(1) // '5e+1' + * y.toPrecision(1) // '5e+1' + * y.toPrecision(2, 0) // '4.6e+1' (ROUND_UP) + * y.toPrecision(2, 1) // '4.5e+1' (ROUND_DOWN) + * x.toPrecision(5) // '45.600' + * y.toPrecision(5) // '45.600' + * ``` + * + * @param [significantDigits] Significant digits, integer, 1 to 1e+9. + * @param [roundingMode] Rounding mode, integer 0 to 8. + */ + toPrecision(significantDigits: number, roundingMode?: BigNumber.RoundingMode): string; + toPrecision(): string; + + /** + * Returns a string representing the value of this BigNumber in base `base`, or base 10 if `base` + * is omitted or is `null` or `undefined`. + * + * For bases above 10, and using the default base conversion alphabet (see `ALPHABET`), values + * from 10 to 35 are represented by a-z (the same as `Number.prototype.toString`). + * + * If a base is specified the value is rounded according to the current `DECIMAL_PLACES` and + * `ROUNDING_MODE` settings, otherwise it is not. + * + * If a base is not specified, and this BigNumber has a positive exponent that is equal to or + * greater than the positive component of the current `EXPONENTIAL_AT` setting, or a negative + * exponent equal to or less than the negative component of the setting, then exponential notation + * is returned. + * + * If `base` is `null` or `undefined` it is ignored. + * + * Throws if `base` is invalid. + * + * ```ts + * x = new BigNumber(750000) + * x.toString() // '750000' + * BigNumber.config({ EXPONENTIAL_AT: 5 }) + * x.toString() // '7.5e+5' + * + * y = new BigNumber(362.875) + * y.toString(2) // '101101010.111' + * y.toString(9) // '442.77777777777777777778' + * y.toString(32) // 'ba.s' + * + * BigNumber.config({ DECIMAL_PLACES: 4 }); + * z = new BigNumber('1.23456789') + * z.toString() // '1.23456789' + * z.toString(10) // '1.2346' + * ``` + * + * @param [base] The base, integer, 2 to 36 (or `ALPHABET.length`, see `ALPHABET`). + */ + toString(base?: number): string; + + /** + * As `toString`, but does not accept a base argument and includes the minus sign for negative + * zero. + * + * ``ts + * x = new BigNumber('-0') + * x.toString() // '0' + * x.valueOf() // '-0' + * y = new BigNumber('1.777e+457') + * y.valueOf() // '1.777e+457' + * ``` + */ + valueOf(): string; + + /** Helps ES6 import. */ + private static readonly default?: BigNumber.Constructor; + + /** Helps ES6 import. */ + private static readonly BigNumber?: BigNumber.Constructor; + + /** Rounds away from zero. */ + static readonly ROUND_UP: 0; + + /** Rounds towards zero. */ + static readonly ROUND_DOWN: 1; + + /** Rounds towards Infinity. */ + static readonly ROUND_CEIL: 2; + + /** Rounds towards -Infinity. */ + static readonly ROUND_FLOOR: 3; + + /** Rounds towards nearest neighbour. If equidistant, rounds away from zero . */ + static readonly ROUND_HALF_UP: 4; + + /** Rounds towards nearest neighbour. If equidistant, rounds towards zero. */ + static readonly ROUND_HALF_DOWN: 5; + + /** Rounds towards nearest neighbour. If equidistant, rounds towards even neighbour. */ + static readonly ROUND_HALF_EVEN: 6; + + /** Rounds towards nearest neighbour. If equidistant, rounds towards Infinity. */ + static readonly ROUND_HALF_CEIL: 7; + + /** Rounds towards nearest neighbour. If equidistant, rounds towards -Infinity. */ + static readonly ROUND_HALF_FLOOR: 8; + + /** See `MODULO_MODE`. */ + static readonly EUCLID: 9; + + /** + * To aid in debugging, if a `BigNumber.DEBUG` property is `true` then an error will be thrown + * if the BigNumber constructor receives an invalid `BigNumber.Value`, or if `BigNumber.isBigNumber` + * receives a BigNumber instance that is malformed. + * + * ```ts + * // No error, and BigNumber NaN is returned. + * new BigNumber('blurgh') // 'NaN' + * new BigNumber(9, 2) // 'NaN' + * BigNumber.DEBUG = true + * new BigNumber('blurgh') // '[BigNumber Error] Not a number' + * new BigNumber(9, 2) // '[BigNumber Error] Not a base 2 number' + * ``` + * + * An error will also be thrown if a `BigNumber.Value` is of type number with more than 15 + * significant digits, as calling `toString` or `valueOf` on such numbers may not result + * in the intended value. + * + * ```ts + * console.log(823456789123456.3) // 823456789123456.2 + * // No error, and the returned BigNumber does not have the same value as the number literal. + * new BigNumber(823456789123456.3) // '823456789123456.2' + * BigNumber.DEBUG = true + * new BigNumber(823456789123456.3) + * // '[BigNumber Error] Number primitive has more than 15 significant digits' + * ``` + * + * Check that a BigNumber instance is well-formed: + * + * ```ts + * x = new BigNumber(10) + * + * BigNumber.DEBUG = false + * // Change x.c to an illegitimate value. + * x.c = NaN + * // No error, as BigNumber.DEBUG is false. + * BigNumber.isBigNumber(x) // true + * + * BigNumber.DEBUG = true + * BigNumber.isBigNumber(x) // '[BigNumber Error] Invalid BigNumber' + * ``` + */ + static DEBUG?: boolean; + + /** + * Returns a new independent BigNumber constructor with configuration as described by `object`, or + * with the default configuration if object is `null` or `undefined`. + * + * Throws if `object` is not an object. + * + * ```ts + * BigNumber.config({ DECIMAL_PLACES: 5 }) + * BN = BigNumber.clone({ DECIMAL_PLACES: 9 }) + * + * x = new BigNumber(1) + * y = new BN(1) + * + * x.div(3) // 0.33333 + * y.div(3) // 0.333333333 + * + * // BN = BigNumber.clone({ DECIMAL_PLACES: 9 }) is equivalent to: + * BN = BigNumber.clone() + * BN.config({ DECIMAL_PLACES: 9 }) + * ``` + * + * @param [object] The configuration object. + */ + static clone(object?: BigNumber.Config): BigNumber.Constructor; + + /** + * Configures the settings that apply to this BigNumber constructor. + * + * The configuration object, `object`, contains any number of the properties shown in the example + * below. + * + * Returns an object with the above properties and their current values. + * + * Throws if `object` is not an object, or if an invalid value is assigned to one or more of the + * properties. + * + * ```ts + * BigNumber.config({ + * DECIMAL_PLACES: 40, + * ROUNDING_MODE: BigNumber.ROUND_HALF_CEIL, + * EXPONENTIAL_AT: [-10, 20], + * RANGE: [-500, 500], + * CRYPTO: true, + * MODULO_MODE: BigNumber.ROUND_FLOOR, + * POW_PRECISION: 80, + * FORMAT: { + * groupSize: 3, + * groupSeparator: ' ', + * decimalSeparator: ',' + * }, + * ALPHABET: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_' + * }); + * + * BigNumber.config().DECIMAL_PLACES // 40 + * ``` + * + * @param object The configuration object. + */ + static config(object: BigNumber.Config): BigNumber.Config; + + /** + * Returns `true` if `value` is a BigNumber instance, otherwise returns `false`. + * + * If `BigNumber.DEBUG` is `true`, throws if a BigNumber instance is not well-formed. + * + * ```ts + * x = 42 + * y = new BigNumber(x) + * + * BigNumber.isBigNumber(x) // false + * y instanceof BigNumber // true + * BigNumber.isBigNumber(y) // true + * + * BN = BigNumber.clone(); + * z = new BN(x) + * z instanceof BigNumber // false + * BigNumber.isBigNumber(z) // true + * ``` + * + * @param value The value to test. + */ + static isBigNumber(value: any): value is BigNumber; + + /** + * Returns a BigNumber whose value is the maximum of the arguments. + * + * The return value is always exact and unrounded. + * + * ```ts + * x = new BigNumber('3257869345.0378653') + * BigNumber.maximum(4e9, x, '123456789.9') // '4000000000' + * + * arr = [12, '13', new BigNumber(14)] + * BigNumber.maximum.apply(null, arr) // '14' + * ``` + * + * @param n A numeric value. + */ + static maximum(...n: BigNumber.Value[]): BigNumber; + + /** + * Returns a BigNumber whose value is the maximum of the arguments. + * + * The return value is always exact and unrounded. + * + * ```ts + * x = new BigNumber('3257869345.0378653') + * BigNumber.max(4e9, x, '123456789.9') // '4000000000' + * + * arr = [12, '13', new BigNumber(14)] + * BigNumber.max.apply(null, arr) // '14' + * ``` + * + * @param n A numeric value. + */ + static max(...n: BigNumber.Value[]): BigNumber; + + /** + * Returns a BigNumber whose value is the minimum of the arguments. + * + * The return value is always exact and unrounded. + * + * ```ts + * x = new BigNumber('3257869345.0378653') + * BigNumber.minimum(4e9, x, '123456789.9') // '123456789.9' + * + * arr = [2, new BigNumber(-14), '-15.9999', -12] + * BigNumber.minimum.apply(null, arr) // '-15.9999' + * ``` + * + * @param n A numeric value. + */ + static minimum(...n: BigNumber.Value[]): BigNumber; + + /** + * Returns a BigNumber whose value is the minimum of the arguments. + * + * The return value is always exact and unrounded. + * + * ```ts + * x = new BigNumber('3257869345.0378653') + * BigNumber.min(4e9, x, '123456789.9') // '123456789.9' + * + * arr = [2, new BigNumber(-14), '-15.9999', -12] + * BigNumber.min.apply(null, arr) // '-15.9999' + * ``` + * + * @param n A numeric value. + */ + static min(...n: BigNumber.Value[]): BigNumber; + + /** + * Returns a new BigNumber with a pseudo-random value equal to or greater than 0 and less than 1. + * + * The return value will have `decimalPlaces` decimal places, or less if trailing zeros are + * produced. If `decimalPlaces` is omitted, the current `DECIMAL_PLACES` setting will be used. + * + * Depending on the value of this BigNumber constructor's `CRYPTO` setting and the support for the + * `crypto` object in the host environment, the random digits of the return value are generated by + * either `Math.random` (fastest), `crypto.getRandomValues` (Web Cryptography API in recent + * browsers) or `crypto.randomBytes` (Node.js). + * + * To be able to set `CRYPTO` to true when using Node.js, the `crypto` object must be available + * globally: + * + * ```ts + * global.crypto = require('crypto') + * ``` + * + * If `CRYPTO` is true, i.e. one of the `crypto` methods is to be used, the value of a returned + * BigNumber should be cryptographically secure and statistically indistinguishable from a random + * value. + * + * Throws if `decimalPlaces` is invalid. + * + * ```ts + * BigNumber.config({ DECIMAL_PLACES: 10 }) + * BigNumber.random() // '0.4117936847' + * BigNumber.random(20) // '0.78193327636914089009' + * ``` + * + * @param [decimalPlaces] Decimal places, integer, 0 to 1e+9. + */ + static random(decimalPlaces?: number): BigNumber; + + /** + * Returns a BigNumber whose value is the sum of the arguments. + * + * The return value is always exact and unrounded. + * + * ```ts + * x = new BigNumber('3257869345.0378653') + * BigNumber.sum(4e9, x, '123456789.9') // '7381326134.9378653' + * + * arr = [2, new BigNumber(14), '15.9999', 12] + * BigNumber.sum.apply(null, arr) // '43.9999' + * ``` + * + * @param n A numeric value. + */ + static sum(...n: BigNumber.Value[]): BigNumber; + + /** + * Configures the settings that apply to this BigNumber constructor. + * + * The configuration object, `object`, contains any number of the properties shown in the example + * below. + * + * Returns an object with the above properties and their current values. + * + * Throws if `object` is not an object, or if an invalid value is assigned to one or more of the + * properties. + * + * ```ts + * BigNumber.set({ + * DECIMAL_PLACES: 40, + * ROUNDING_MODE: BigNumber.ROUND_HALF_CEIL, + * EXPONENTIAL_AT: [-10, 20], + * RANGE: [-500, 500], + * CRYPTO: true, + * MODULO_MODE: BigNumber.ROUND_FLOOR, + * POW_PRECISION: 80, + * FORMAT: { + * groupSize: 3, + * groupSeparator: ' ', + * decimalSeparator: ',' + * }, + * ALPHABET: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_' + * }); + * + * BigNumber.set().DECIMAL_PLACES // 40 + * ``` + * + * @param object The configuration object. + */ + static set(object: BigNumber.Config): BigNumber.Config; +} diff --git a/node_modules/bignumber.js/bignumber.js b/node_modules/bignumber.js/bignumber.js new file mode 100644 index 0000000..f2ea883 --- /dev/null +++ b/node_modules/bignumber.js/bignumber.js @@ -0,0 +1,2902 @@ +;(function (globalObject) { + 'use strict'; + +/* + * bignumber.js v9.0.0 + * A JavaScript library for arbitrary-precision arithmetic. + * https://github.com/MikeMcl/bignumber.js + * Copyright (c) 2019 Michael Mclaughlin + * MIT Licensed. + * + * BigNumber.prototype methods | BigNumber methods + * | + * absoluteValue abs | clone + * comparedTo | config set + * decimalPlaces dp | DECIMAL_PLACES + * dividedBy div | ROUNDING_MODE + * dividedToIntegerBy idiv | EXPONENTIAL_AT + * exponentiatedBy pow | RANGE + * integerValue | CRYPTO + * isEqualTo eq | MODULO_MODE + * isFinite | POW_PRECISION + * isGreaterThan gt | FORMAT + * isGreaterThanOrEqualTo gte | ALPHABET + * isInteger | isBigNumber + * isLessThan lt | maximum max + * isLessThanOrEqualTo lte | minimum min + * isNaN | random + * isNegative | sum + * isPositive | + * isZero | + * minus | + * modulo mod | + * multipliedBy times | + * negated | + * plus | + * precision sd | + * shiftedBy | + * squareRoot sqrt | + * toExponential | + * toFixed | + * toFormat | + * toFraction | + * toJSON | + * toNumber | + * toPrecision | + * toString | + * valueOf | + * + */ + + + var BigNumber, + isNumeric = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, + mathceil = Math.ceil, + mathfloor = Math.floor, + + bignumberError = '[BigNumber Error] ', + tooManyDigits = bignumberError + 'Number primitive has more than 15 significant digits: ', + + BASE = 1e14, + LOG_BASE = 14, + MAX_SAFE_INTEGER = 0x1fffffffffffff, // 2^53 - 1 + // MAX_INT32 = 0x7fffffff, // 2^31 - 1 + POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], + SQRT_BASE = 1e7, + + // EDITABLE + // The limit on the value of DECIMAL_PLACES, TO_EXP_NEG, TO_EXP_POS, MIN_EXP, MAX_EXP, and + // the arguments to toExponential, toFixed, toFormat, and toPrecision. + MAX = 1E9; // 0 to MAX_INT32 + + + /* + * Create and return a BigNumber constructor. + */ + function clone(configObject) { + var div, convertBase, parseNumeric, + P = BigNumber.prototype = { constructor: BigNumber, toString: null, valueOf: null }, + ONE = new BigNumber(1), + + + //----------------------------- EDITABLE CONFIG DEFAULTS ------------------------------- + + + // The default values below must be integers within the inclusive ranges stated. + // The values can also be changed at run-time using BigNumber.set. + + // The maximum number of decimal places for operations involving division. + DECIMAL_PLACES = 20, // 0 to MAX + + // The rounding mode used when rounding to the above decimal places, and when using + // toExponential, toFixed, toFormat and toPrecision, and round (default value). + // UP 0 Away from zero. + // DOWN 1 Towards zero. + // CEIL 2 Towards +Infinity. + // FLOOR 3 Towards -Infinity. + // HALF_UP 4 Towards nearest neighbour. If equidistant, up. + // HALF_DOWN 5 Towards nearest neighbour. If equidistant, down. + // HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour. + // HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity. + // HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity. + ROUNDING_MODE = 4, // 0 to 8 + + // EXPONENTIAL_AT : [TO_EXP_NEG , TO_EXP_POS] + + // The exponent value at and beneath which toString returns exponential notation. + // Number type: -7 + TO_EXP_NEG = -7, // 0 to -MAX + + // The exponent value at and above which toString returns exponential notation. + // Number type: 21 + TO_EXP_POS = 21, // 0 to MAX + + // RANGE : [MIN_EXP, MAX_EXP] + + // The minimum exponent value, beneath which underflow to zero occurs. + // Number type: -324 (5e-324) + MIN_EXP = -1e7, // -1 to -MAX + + // The maximum exponent value, above which overflow to Infinity occurs. + // Number type: 308 (1.7976931348623157e+308) + // For MAX_EXP > 1e7, e.g. new BigNumber('1e100000000').plus(1) may be slow. + MAX_EXP = 1e7, // 1 to MAX + + // Whether to use cryptographically-secure random number generation, if available. + CRYPTO = false, // true or false + + // The modulo mode used when calculating the modulus: a mod n. + // The quotient (q = a / n) is calculated according to the corresponding rounding mode. + // The remainder (r) is calculated as: r = a - n * q. + // + // UP 0 The remainder is positive if the dividend is negative, else is negative. + // DOWN 1 The remainder has the same sign as the dividend. + // This modulo mode is commonly known as 'truncated division' and is + // equivalent to (a % n) in JavaScript. + // FLOOR 3 The remainder has the same sign as the divisor (Python %). + // HALF_EVEN 6 This modulo mode implements the IEEE 754 remainder function. + // EUCLID 9 Euclidian division. q = sign(n) * floor(a / abs(n)). + // The remainder is always positive. + // + // The truncated division, floored division, Euclidian division and IEEE 754 remainder + // modes are commonly used for the modulus operation. + // Although the other rounding modes can also be used, they may not give useful results. + MODULO_MODE = 1, // 0 to 9 + + // The maximum number of significant digits of the result of the exponentiatedBy operation. + // If POW_PRECISION is 0, there will be unlimited significant digits. + POW_PRECISION = 0, // 0 to MAX + + // The format specification used by the BigNumber.prototype.toFormat method. + FORMAT = { + prefix: '', + groupSize: 3, + secondaryGroupSize: 0, + groupSeparator: ',', + decimalSeparator: '.', + fractionGroupSize: 0, + fractionGroupSeparator: '\xA0', // non-breaking space + suffix: '' + }, + + // The alphabet used for base conversion. It must be at least 2 characters long, with no '+', + // '-', '.', whitespace, or repeated character. + // '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_' + ALPHABET = '0123456789abcdefghijklmnopqrstuvwxyz'; + + + //------------------------------------------------------------------------------------------ + + + // CONSTRUCTOR + + + /* + * The BigNumber constructor and exported function. + * Create and return a new instance of a BigNumber object. + * + * v {number|string|BigNumber} A numeric value. + * [b] {number} The base of v. Integer, 2 to ALPHABET.length inclusive. + */ + function BigNumber(v, b) { + var alphabet, c, caseChanged, e, i, isNum, len, str, + x = this; + + // Enable constructor call without `new`. + if (!(x instanceof BigNumber)) return new BigNumber(v, b); + + if (b == null) { + + if (v && v._isBigNumber === true) { + x.s = v.s; + + if (!v.c || v.e > MAX_EXP) { + x.c = x.e = null; + } else if (v.e < MIN_EXP) { + x.c = [x.e = 0]; + } else { + x.e = v.e; + x.c = v.c.slice(); + } + + return; + } + + if ((isNum = typeof v == 'number') && v * 0 == 0) { + + // Use `1 / n` to handle minus zero also. + x.s = 1 / v < 0 ? (v = -v, -1) : 1; + + // Fast path for integers, where n < 2147483648 (2**31). + if (v === ~~v) { + for (e = 0, i = v; i >= 10; i /= 10, e++); + + if (e > MAX_EXP) { + x.c = x.e = null; + } else { + x.e = e; + x.c = [v]; + } + + return; + } + + str = String(v); + } else { + + if (!isNumeric.test(str = String(v))) return parseNumeric(x, str, isNum); + + x.s = str.charCodeAt(0) == 45 ? (str = str.slice(1), -1) : 1; + } + + // Decimal point? + if ((e = str.indexOf('.')) > -1) str = str.replace('.', ''); + + // Exponential form? + if ((i = str.search(/e/i)) > 0) { + + // Determine exponent. + if (e < 0) e = i; + e += +str.slice(i + 1); + str = str.substring(0, i); + } else if (e < 0) { + + // Integer. + e = str.length; + } + + } else { + + // '[BigNumber Error] Base {not a primitive number|not an integer|out of range}: {b}' + intCheck(b, 2, ALPHABET.length, 'Base'); + + // Allow exponential notation to be used with base 10 argument, while + // also rounding to DECIMAL_PLACES as with other bases. + if (b == 10) { + x = new BigNumber(v); + return round(x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE); + } + + str = String(v); + + if (isNum = typeof v == 'number') { + + // Avoid potential interpretation of Infinity and NaN as base 44+ values. + if (v * 0 != 0) return parseNumeric(x, str, isNum, b); + + x.s = 1 / v < 0 ? (str = str.slice(1), -1) : 1; + + // '[BigNumber Error] Number primitive has more than 15 significant digits: {n}' + if (BigNumber.DEBUG && str.replace(/^0\.0*|\./, '').length > 15) { + throw Error + (tooManyDigits + v); + } + } else { + x.s = str.charCodeAt(0) === 45 ? (str = str.slice(1), -1) : 1; + } + + alphabet = ALPHABET.slice(0, b); + e = i = 0; + + // Check that str is a valid base b number. + // Don't use RegExp, so alphabet can contain special characters. + for (len = str.length; i < len; i++) { + if (alphabet.indexOf(c = str.charAt(i)) < 0) { + if (c == '.') { + + // If '.' is not the first character and it has not be found before. + if (i > e) { + e = len; + continue; + } + } else if (!caseChanged) { + + // Allow e.g. hexadecimal 'FF' as well as 'ff'. + if (str == str.toUpperCase() && (str = str.toLowerCase()) || + str == str.toLowerCase() && (str = str.toUpperCase())) { + caseChanged = true; + i = -1; + e = 0; + continue; + } + } + + return parseNumeric(x, String(v), isNum, b); + } + } + + // Prevent later check for length on converted number. + isNum = false; + str = convertBase(str, b, 10, x.s); + + // Decimal point? + if ((e = str.indexOf('.')) > -1) str = str.replace('.', ''); + else e = str.length; + } + + // Determine leading zeros. + for (i = 0; str.charCodeAt(i) === 48; i++); + + // Determine trailing zeros. + for (len = str.length; str.charCodeAt(--len) === 48;); + + if (str = str.slice(i, ++len)) { + len -= i; + + // '[BigNumber Error] Number primitive has more than 15 significant digits: {n}' + if (isNum && BigNumber.DEBUG && + len > 15 && (v > MAX_SAFE_INTEGER || v !== mathfloor(v))) { + throw Error + (tooManyDigits + (x.s * v)); + } + + // Overflow? + if ((e = e - i - 1) > MAX_EXP) { + + // Infinity. + x.c = x.e = null; + + // Underflow? + } else if (e < MIN_EXP) { + + // Zero. + x.c = [x.e = 0]; + } else { + x.e = e; + x.c = []; + + // Transform base + + // e is the base 10 exponent. + // i is where to slice str to get the first element of the coefficient array. + i = (e + 1) % LOG_BASE; + if (e < 0) i += LOG_BASE; // i < 1 + + if (i < len) { + if (i) x.c.push(+str.slice(0, i)); + + for (len -= LOG_BASE; i < len;) { + x.c.push(+str.slice(i, i += LOG_BASE)); + } + + i = LOG_BASE - (str = str.slice(i)).length; + } else { + i -= len; + } + + for (; i--; str += '0'); + x.c.push(+str); + } + } else { + + // Zero. + x.c = [x.e = 0]; + } + } + + + // CONSTRUCTOR PROPERTIES + + + BigNumber.clone = clone; + + BigNumber.ROUND_UP = 0; + BigNumber.ROUND_DOWN = 1; + BigNumber.ROUND_CEIL = 2; + BigNumber.ROUND_FLOOR = 3; + BigNumber.ROUND_HALF_UP = 4; + BigNumber.ROUND_HALF_DOWN = 5; + BigNumber.ROUND_HALF_EVEN = 6; + BigNumber.ROUND_HALF_CEIL = 7; + BigNumber.ROUND_HALF_FLOOR = 8; + BigNumber.EUCLID = 9; + + + /* + * Configure infrequently-changing library-wide settings. + * + * Accept an object with the following optional properties (if the value of a property is + * a number, it must be an integer within the inclusive range stated): + * + * DECIMAL_PLACES {number} 0 to MAX + * ROUNDING_MODE {number} 0 to 8 + * EXPONENTIAL_AT {number|number[]} -MAX to MAX or [-MAX to 0, 0 to MAX] + * RANGE {number|number[]} -MAX to MAX (not zero) or [-MAX to -1, 1 to MAX] + * CRYPTO {boolean} true or false + * MODULO_MODE {number} 0 to 9 + * POW_PRECISION {number} 0 to MAX + * ALPHABET {string} A string of two or more unique characters which does + * not contain '.'. + * FORMAT {object} An object with some of the following properties: + * prefix {string} + * groupSize {number} + * secondaryGroupSize {number} + * groupSeparator {string} + * decimalSeparator {string} + * fractionGroupSize {number} + * fractionGroupSeparator {string} + * suffix {string} + * + * (The values assigned to the above FORMAT object properties are not checked for validity.) + * + * E.g. + * BigNumber.config({ DECIMAL_PLACES : 20, ROUNDING_MODE : 4 }) + * + * Ignore properties/parameters set to null or undefined, except for ALPHABET. + * + * Return an object with the properties current values. + */ + BigNumber.config = BigNumber.set = function (obj) { + var p, v; + + if (obj != null) { + + if (typeof obj == 'object') { + + // DECIMAL_PLACES {number} Integer, 0 to MAX inclusive. + // '[BigNumber Error] DECIMAL_PLACES {not a primitive number|not an integer|out of range}: {v}' + if (obj.hasOwnProperty(p = 'DECIMAL_PLACES')) { + v = obj[p]; + intCheck(v, 0, MAX, p); + DECIMAL_PLACES = v; + } + + // ROUNDING_MODE {number} Integer, 0 to 8 inclusive. + // '[BigNumber Error] ROUNDING_MODE {not a primitive number|not an integer|out of range}: {v}' + if (obj.hasOwnProperty(p = 'ROUNDING_MODE')) { + v = obj[p]; + intCheck(v, 0, 8, p); + ROUNDING_MODE = v; + } + + // EXPONENTIAL_AT {number|number[]} + // Integer, -MAX to MAX inclusive or + // [integer -MAX to 0 inclusive, 0 to MAX inclusive]. + // '[BigNumber Error] EXPONENTIAL_AT {not a primitive number|not an integer|out of range}: {v}' + if (obj.hasOwnProperty(p = 'EXPONENTIAL_AT')) { + v = obj[p]; + if (v && v.pop) { + intCheck(v[0], -MAX, 0, p); + intCheck(v[1], 0, MAX, p); + TO_EXP_NEG = v[0]; + TO_EXP_POS = v[1]; + } else { + intCheck(v, -MAX, MAX, p); + TO_EXP_NEG = -(TO_EXP_POS = v < 0 ? -v : v); + } + } + + // RANGE {number|number[]} Non-zero integer, -MAX to MAX inclusive or + // [integer -MAX to -1 inclusive, integer 1 to MAX inclusive]. + // '[BigNumber Error] RANGE {not a primitive number|not an integer|out of range|cannot be zero}: {v}' + if (obj.hasOwnProperty(p = 'RANGE')) { + v = obj[p]; + if (v && v.pop) { + intCheck(v[0], -MAX, -1, p); + intCheck(v[1], 1, MAX, p); + MIN_EXP = v[0]; + MAX_EXP = v[1]; + } else { + intCheck(v, -MAX, MAX, p); + if (v) { + MIN_EXP = -(MAX_EXP = v < 0 ? -v : v); + } else { + throw Error + (bignumberError + p + ' cannot be zero: ' + v); + } + } + } + + // CRYPTO {boolean} true or false. + // '[BigNumber Error] CRYPTO not true or false: {v}' + // '[BigNumber Error] crypto unavailable' + if (obj.hasOwnProperty(p = 'CRYPTO')) { + v = obj[p]; + if (v === !!v) { + if (v) { + if (typeof crypto != 'undefined' && crypto && + (crypto.getRandomValues || crypto.randomBytes)) { + CRYPTO = v; + } else { + CRYPTO = !v; + throw Error + (bignumberError + 'crypto unavailable'); + } + } else { + CRYPTO = v; + } + } else { + throw Error + (bignumberError + p + ' not true or false: ' + v); + } + } + + // MODULO_MODE {number} Integer, 0 to 9 inclusive. + // '[BigNumber Error] MODULO_MODE {not a primitive number|not an integer|out of range}: {v}' + if (obj.hasOwnProperty(p = 'MODULO_MODE')) { + v = obj[p]; + intCheck(v, 0, 9, p); + MODULO_MODE = v; + } + + // POW_PRECISION {number} Integer, 0 to MAX inclusive. + // '[BigNumber Error] POW_PRECISION {not a primitive number|not an integer|out of range}: {v}' + if (obj.hasOwnProperty(p = 'POW_PRECISION')) { + v = obj[p]; + intCheck(v, 0, MAX, p); + POW_PRECISION = v; + } + + // FORMAT {object} + // '[BigNumber Error] FORMAT not an object: {v}' + if (obj.hasOwnProperty(p = 'FORMAT')) { + v = obj[p]; + if (typeof v == 'object') FORMAT = v; + else throw Error + (bignumberError + p + ' not an object: ' + v); + } + + // ALPHABET {string} + // '[BigNumber Error] ALPHABET invalid: {v}' + if (obj.hasOwnProperty(p = 'ALPHABET')) { + v = obj[p]; + + // Disallow if only one character, + // or if it contains '+', '-', '.', whitespace, or a repeated character. + if (typeof v == 'string' && !/^.$|[+-.\s]|(.).*\1/.test(v)) { + ALPHABET = v; + } else { + throw Error + (bignumberError + p + ' invalid: ' + v); + } + } + + } else { + + // '[BigNumber Error] Object expected: {v}' + throw Error + (bignumberError + 'Object expected: ' + obj); + } + } + + return { + DECIMAL_PLACES: DECIMAL_PLACES, + ROUNDING_MODE: ROUNDING_MODE, + EXPONENTIAL_AT: [TO_EXP_NEG, TO_EXP_POS], + RANGE: [MIN_EXP, MAX_EXP], + CRYPTO: CRYPTO, + MODULO_MODE: MODULO_MODE, + POW_PRECISION: POW_PRECISION, + FORMAT: FORMAT, + ALPHABET: ALPHABET + }; + }; + + + /* + * Return true if v is a BigNumber instance, otherwise return false. + * + * If BigNumber.DEBUG is true, throw if a BigNumber instance is not well-formed. + * + * v {any} + * + * '[BigNumber Error] Invalid BigNumber: {v}' + */ + BigNumber.isBigNumber = function (v) { + if (!v || v._isBigNumber !== true) return false; + if (!BigNumber.DEBUG) return true; + + var i, n, + c = v.c, + e = v.e, + s = v.s; + + out: if ({}.toString.call(c) == '[object Array]') { + + if ((s === 1 || s === -1) && e >= -MAX && e <= MAX && e === mathfloor(e)) { + + // If the first element is zero, the BigNumber value must be zero. + if (c[0] === 0) { + if (e === 0 && c.length === 1) return true; + break out; + } + + // Calculate number of digits that c[0] should have, based on the exponent. + i = (e + 1) % LOG_BASE; + if (i < 1) i += LOG_BASE; + + // Calculate number of digits of c[0]. + //if (Math.ceil(Math.log(c[0] + 1) / Math.LN10) == i) { + if (String(c[0]).length == i) { + + for (i = 0; i < c.length; i++) { + n = c[i]; + if (n < 0 || n >= BASE || n !== mathfloor(n)) break out; + } + + // Last element cannot be zero, unless it is the only element. + if (n !== 0) return true; + } + } + + // Infinity/NaN + } else if (c === null && e === null && (s === null || s === 1 || s === -1)) { + return true; + } + + throw Error + (bignumberError + 'Invalid BigNumber: ' + v); + }; + + + /* + * Return a new BigNumber whose value is the maximum of the arguments. + * + * arguments {number|string|BigNumber} + */ + BigNumber.maximum = BigNumber.max = function () { + return maxOrMin(arguments, P.lt); + }; + + + /* + * Return a new BigNumber whose value is the minimum of the arguments. + * + * arguments {number|string|BigNumber} + */ + BigNumber.minimum = BigNumber.min = function () { + return maxOrMin(arguments, P.gt); + }; + + + /* + * Return a new BigNumber with a random value equal to or greater than 0 and less than 1, + * and with dp, or DECIMAL_PLACES if dp is omitted, decimal places (or less if trailing + * zeros are produced). + * + * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp}' + * '[BigNumber Error] crypto unavailable' + */ + BigNumber.random = (function () { + var pow2_53 = 0x20000000000000; + + // Return a 53 bit integer n, where 0 <= n < 9007199254740992. + // Check if Math.random() produces more than 32 bits of randomness. + // If it does, assume at least 53 bits are produced, otherwise assume at least 30 bits. + // 0x40000000 is 2^30, 0x800000 is 2^23, 0x1fffff is 2^21 - 1. + var random53bitInt = (Math.random() * pow2_53) & 0x1fffff + ? function () { return mathfloor(Math.random() * pow2_53); } + : function () { return ((Math.random() * 0x40000000 | 0) * 0x800000) + + (Math.random() * 0x800000 | 0); }; + + return function (dp) { + var a, b, e, k, v, + i = 0, + c = [], + rand = new BigNumber(ONE); + + if (dp == null) dp = DECIMAL_PLACES; + else intCheck(dp, 0, MAX); + + k = mathceil(dp / LOG_BASE); + + if (CRYPTO) { + + // Browsers supporting crypto.getRandomValues. + if (crypto.getRandomValues) { + + a = crypto.getRandomValues(new Uint32Array(k *= 2)); + + for (; i < k;) { + + // 53 bits: + // ((Math.pow(2, 32) - 1) * Math.pow(2, 21)).toString(2) + // 11111 11111111 11111111 11111111 11100000 00000000 00000000 + // ((Math.pow(2, 32) - 1) >>> 11).toString(2) + // 11111 11111111 11111111 + // 0x20000 is 2^21. + v = a[i] * 0x20000 + (a[i + 1] >>> 11); + + // Rejection sampling: + // 0 <= v < 9007199254740992 + // Probability that v >= 9e15, is + // 7199254740992 / 9007199254740992 ~= 0.0008, i.e. 1 in 1251 + if (v >= 9e15) { + b = crypto.getRandomValues(new Uint32Array(2)); + a[i] = b[0]; + a[i + 1] = b[1]; + } else { + + // 0 <= v <= 8999999999999999 + // 0 <= (v % 1e14) <= 99999999999999 + c.push(v % 1e14); + i += 2; + } + } + i = k / 2; + + // Node.js supporting crypto.randomBytes. + } else if (crypto.randomBytes) { + + // buffer + a = crypto.randomBytes(k *= 7); + + for (; i < k;) { + + // 0x1000000000000 is 2^48, 0x10000000000 is 2^40 + // 0x100000000 is 2^32, 0x1000000 is 2^24 + // 11111 11111111 11111111 11111111 11111111 11111111 11111111 + // 0 <= v < 9007199254740992 + v = ((a[i] & 31) * 0x1000000000000) + (a[i + 1] * 0x10000000000) + + (a[i + 2] * 0x100000000) + (a[i + 3] * 0x1000000) + + (a[i + 4] << 16) + (a[i + 5] << 8) + a[i + 6]; + + if (v >= 9e15) { + crypto.randomBytes(7).copy(a, i); + } else { + + // 0 <= (v % 1e14) <= 99999999999999 + c.push(v % 1e14); + i += 7; + } + } + i = k / 7; + } else { + CRYPTO = false; + throw Error + (bignumberError + 'crypto unavailable'); + } + } + + // Use Math.random. + if (!CRYPTO) { + + for (; i < k;) { + v = random53bitInt(); + if (v < 9e15) c[i++] = v % 1e14; + } + } + + k = c[--i]; + dp %= LOG_BASE; + + // Convert trailing digits to zeros according to dp. + if (k && dp) { + v = POWS_TEN[LOG_BASE - dp]; + c[i] = mathfloor(k / v) * v; + } + + // Remove trailing elements which are zero. + for (; c[i] === 0; c.pop(), i--); + + // Zero? + if (i < 0) { + c = [e = 0]; + } else { + + // Remove leading elements which are zero and adjust exponent accordingly. + for (e = -1 ; c[0] === 0; c.splice(0, 1), e -= LOG_BASE); + + // Count the digits of the first element of c to determine leading zeros, and... + for (i = 1, v = c[0]; v >= 10; v /= 10, i++); + + // adjust the exponent accordingly. + if (i < LOG_BASE) e -= LOG_BASE - i; + } + + rand.e = e; + rand.c = c; + return rand; + }; + })(); + + + /* + * Return a BigNumber whose value is the sum of the arguments. + * + * arguments {number|string|BigNumber} + */ + BigNumber.sum = function () { + var i = 1, + args = arguments, + sum = new BigNumber(args[0]); + for (; i < args.length;) sum = sum.plus(args[i++]); + return sum; + }; + + + // PRIVATE FUNCTIONS + + + // Called by BigNumber and BigNumber.prototype.toString. + convertBase = (function () { + var decimal = '0123456789'; + + /* + * Convert string of baseIn to an array of numbers of baseOut. + * Eg. toBaseOut('255', 10, 16) returns [15, 15]. + * Eg. toBaseOut('ff', 16, 10) returns [2, 5, 5]. + */ + function toBaseOut(str, baseIn, baseOut, alphabet) { + var j, + arr = [0], + arrL, + i = 0, + len = str.length; + + for (; i < len;) { + for (arrL = arr.length; arrL--; arr[arrL] *= baseIn); + + arr[0] += alphabet.indexOf(str.charAt(i++)); + + for (j = 0; j < arr.length; j++) { + + if (arr[j] > baseOut - 1) { + if (arr[j + 1] == null) arr[j + 1] = 0; + arr[j + 1] += arr[j] / baseOut | 0; + arr[j] %= baseOut; + } + } + } + + return arr.reverse(); + } + + // Convert a numeric string of baseIn to a numeric string of baseOut. + // If the caller is toString, we are converting from base 10 to baseOut. + // If the caller is BigNumber, we are converting from baseIn to base 10. + return function (str, baseIn, baseOut, sign, callerIsToString) { + var alphabet, d, e, k, r, x, xc, y, + i = str.indexOf('.'), + dp = DECIMAL_PLACES, + rm = ROUNDING_MODE; + + // Non-integer. + if (i >= 0) { + k = POW_PRECISION; + + // Unlimited precision. + POW_PRECISION = 0; + str = str.replace('.', ''); + y = new BigNumber(baseIn); + x = y.pow(str.length - i); + POW_PRECISION = k; + + // Convert str as if an integer, then restore the fraction part by dividing the + // result by its base raised to a power. + + y.c = toBaseOut(toFixedPoint(coeffToString(x.c), x.e, '0'), + 10, baseOut, decimal); + y.e = y.c.length; + } + + // Convert the number as integer. + + xc = toBaseOut(str, baseIn, baseOut, callerIsToString + ? (alphabet = ALPHABET, decimal) + : (alphabet = decimal, ALPHABET)); + + // xc now represents str as an integer and converted to baseOut. e is the exponent. + e = k = xc.length; + + // Remove trailing zeros. + for (; xc[--k] == 0; xc.pop()); + + // Zero? + if (!xc[0]) return alphabet.charAt(0); + + // Does str represent an integer? If so, no need for the division. + if (i < 0) { + --e; + } else { + x.c = xc; + x.e = e; + + // The sign is needed for correct rounding. + x.s = sign; + x = div(x, y, dp, rm, baseOut); + xc = x.c; + r = x.r; + e = x.e; + } + + // xc now represents str converted to baseOut. + + // THe index of the rounding digit. + d = e + dp + 1; + + // The rounding digit: the digit to the right of the digit that may be rounded up. + i = xc[d]; + + // Look at the rounding digits and mode to determine whether to round up. + + k = baseOut / 2; + r = r || d < 0 || xc[d + 1] != null; + + r = rm < 4 ? (i != null || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) + : i > k || i == k &&(rm == 4 || r || rm == 6 && xc[d - 1] & 1 || + rm == (x.s < 0 ? 8 : 7)); + + // If the index of the rounding digit is not greater than zero, or xc represents + // zero, then the result of the base conversion is zero or, if rounding up, a value + // such as 0.00001. + if (d < 1 || !xc[0]) { + + // 1^-dp or 0 + str = r ? toFixedPoint(alphabet.charAt(1), -dp, alphabet.charAt(0)) : alphabet.charAt(0); + } else { + + // Truncate xc to the required number of decimal places. + xc.length = d; + + // Round up? + if (r) { + + // Rounding up may mean the previous digit has to be rounded up and so on. + for (--baseOut; ++xc[--d] > baseOut;) { + xc[d] = 0; + + if (!d) { + ++e; + xc = [1].concat(xc); + } + } + } + + // Determine trailing zeros. + for (k = xc.length; !xc[--k];); + + // E.g. [4, 11, 15] becomes 4bf. + for (i = 0, str = ''; i <= k; str += alphabet.charAt(xc[i++])); + + // Add leading zeros, decimal point and trailing zeros as required. + str = toFixedPoint(str, e, alphabet.charAt(0)); + } + + // The caller will add the sign. + return str; + }; + })(); + + + // Perform division in the specified base. Called by div and convertBase. + div = (function () { + + // Assume non-zero x and k. + function multiply(x, k, base) { + var m, temp, xlo, xhi, + carry = 0, + i = x.length, + klo = k % SQRT_BASE, + khi = k / SQRT_BASE | 0; + + for (x = x.slice(); i--;) { + xlo = x[i] % SQRT_BASE; + xhi = x[i] / SQRT_BASE | 0; + m = khi * xlo + xhi * klo; + temp = klo * xlo + ((m % SQRT_BASE) * SQRT_BASE) + carry; + carry = (temp / base | 0) + (m / SQRT_BASE | 0) + khi * xhi; + x[i] = temp % base; + } + + if (carry) x = [carry].concat(x); + + return x; + } + + function compare(a, b, aL, bL) { + var i, cmp; + + if (aL != bL) { + cmp = aL > bL ? 1 : -1; + } else { + + for (i = cmp = 0; i < aL; i++) { + + if (a[i] != b[i]) { + cmp = a[i] > b[i] ? 1 : -1; + break; + } + } + } + + return cmp; + } + + function subtract(a, b, aL, base) { + var i = 0; + + // Subtract b from a. + for (; aL--;) { + a[aL] -= i; + i = a[aL] < b[aL] ? 1 : 0; + a[aL] = i * base + a[aL] - b[aL]; + } + + // Remove leading zeros. + for (; !a[0] && a.length > 1; a.splice(0, 1)); + } + + // x: dividend, y: divisor. + return function (x, y, dp, rm, base) { + var cmp, e, i, more, n, prod, prodL, q, qc, rem, remL, rem0, xi, xL, yc0, + yL, yz, + s = x.s == y.s ? 1 : -1, + xc = x.c, + yc = y.c; + + // Either NaN, Infinity or 0? + if (!xc || !xc[0] || !yc || !yc[0]) { + + return new BigNumber( + + // Return NaN if either NaN, or both Infinity or 0. + !x.s || !y.s || (xc ? yc && xc[0] == yc[0] : !yc) ? NaN : + + // Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0. + xc && xc[0] == 0 || !yc ? s * 0 : s / 0 + ); + } + + q = new BigNumber(s); + qc = q.c = []; + e = x.e - y.e; + s = dp + e + 1; + + if (!base) { + base = BASE; + e = bitFloor(x.e / LOG_BASE) - bitFloor(y.e / LOG_BASE); + s = s / LOG_BASE | 0; + } + + // Result exponent may be one less then the current value of e. + // The coefficients of the BigNumbers from convertBase may have trailing zeros. + for (i = 0; yc[i] == (xc[i] || 0); i++); + + if (yc[i] > (xc[i] || 0)) e--; + + if (s < 0) { + qc.push(1); + more = true; + } else { + xL = xc.length; + yL = yc.length; + i = 0; + s += 2; + + // Normalise xc and yc so highest order digit of yc is >= base / 2. + + n = mathfloor(base / (yc[0] + 1)); + + // Not necessary, but to handle odd bases where yc[0] == (base / 2) - 1. + // if (n > 1 || n++ == 1 && yc[0] < base / 2) { + if (n > 1) { + yc = multiply(yc, n, base); + xc = multiply(xc, n, base); + yL = yc.length; + xL = xc.length; + } + + xi = yL; + rem = xc.slice(0, yL); + remL = rem.length; + + // Add zeros to make remainder as long as divisor. + for (; remL < yL; rem[remL++] = 0); + yz = yc.slice(); + yz = [0].concat(yz); + yc0 = yc[0]; + if (yc[1] >= base / 2) yc0++; + // Not necessary, but to prevent trial digit n > base, when using base 3. + // else if (base == 3 && yc0 == 1) yc0 = 1 + 1e-15; + + do { + n = 0; + + // Compare divisor and remainder. + cmp = compare(yc, rem, yL, remL); + + // If divisor < remainder. + if (cmp < 0) { + + // Calculate trial digit, n. + + rem0 = rem[0]; + if (yL != remL) rem0 = rem0 * base + (rem[1] || 0); + + // n is how many times the divisor goes into the current remainder. + n = mathfloor(rem0 / yc0); + + // Algorithm: + // product = divisor multiplied by trial digit (n). + // Compare product and remainder. + // If product is greater than remainder: + // Subtract divisor from product, decrement trial digit. + // Subtract product from remainder. + // If product was less than remainder at the last compare: + // Compare new remainder and divisor. + // If remainder is greater than divisor: + // Subtract divisor from remainder, increment trial digit. + + if (n > 1) { + + // n may be > base only when base is 3. + if (n >= base) n = base - 1; + + // product = divisor * trial digit. + prod = multiply(yc, n, base); + prodL = prod.length; + remL = rem.length; + + // Compare product and remainder. + // If product > remainder then trial digit n too high. + // n is 1 too high about 5% of the time, and is not known to have + // ever been more than 1 too high. + while (compare(prod, rem, prodL, remL) == 1) { + n--; + + // Subtract divisor from product. + subtract(prod, yL < prodL ? yz : yc, prodL, base); + prodL = prod.length; + cmp = 1; + } + } else { + + // n is 0 or 1, cmp is -1. + // If n is 0, there is no need to compare yc and rem again below, + // so change cmp to 1 to avoid it. + // If n is 1, leave cmp as -1, so yc and rem are compared again. + if (n == 0) { + + // divisor < remainder, so n must be at least 1. + cmp = n = 1; + } + + // product = divisor + prod = yc.slice(); + prodL = prod.length; + } + + if (prodL < remL) prod = [0].concat(prod); + + // Subtract product from remainder. + subtract(rem, prod, remL, base); + remL = rem.length; + + // If product was < remainder. + if (cmp == -1) { + + // Compare divisor and new remainder. + // If divisor < new remainder, subtract divisor from remainder. + // Trial digit n too low. + // n is 1 too low about 5% of the time, and very rarely 2 too low. + while (compare(yc, rem, yL, remL) < 1) { + n++; + + // Subtract divisor from remainder. + subtract(rem, yL < remL ? yz : yc, remL, base); + remL = rem.length; + } + } + } else if (cmp === 0) { + n++; + rem = [0]; + } // else cmp === 1 and n will be 0 + + // Add the next digit, n, to the result array. + qc[i++] = n; + + // Update the remainder. + if (rem[0]) { + rem[remL++] = xc[xi] || 0; + } else { + rem = [xc[xi]]; + remL = 1; + } + } while ((xi++ < xL || rem[0] != null) && s--); + + more = rem[0] != null; + + // Leading zero? + if (!qc[0]) qc.splice(0, 1); + } + + if (base == BASE) { + + // To calculate q.e, first get the number of digits of qc[0]. + for (i = 1, s = qc[0]; s >= 10; s /= 10, i++); + + round(q, dp + (q.e = i + e * LOG_BASE - 1) + 1, rm, more); + + // Caller is convertBase. + } else { + q.e = e; + q.r = +more; + } + + return q; + }; + })(); + + + /* + * Return a string representing the value of BigNumber n in fixed-point or exponential + * notation rounded to the specified decimal places or significant digits. + * + * n: a BigNumber. + * i: the index of the last digit required (i.e. the digit that may be rounded up). + * rm: the rounding mode. + * id: 1 (toExponential) or 2 (toPrecision). + */ + function format(n, i, rm, id) { + var c0, e, ne, len, str; + + if (rm == null) rm = ROUNDING_MODE; + else intCheck(rm, 0, 8); + + if (!n.c) return n.toString(); + + c0 = n.c[0]; + ne = n.e; + + if (i == null) { + str = coeffToString(n.c); + str = id == 1 || id == 2 && (ne <= TO_EXP_NEG || ne >= TO_EXP_POS) + ? toExponential(str, ne) + : toFixedPoint(str, ne, '0'); + } else { + n = round(new BigNumber(n), i, rm); + + // n.e may have changed if the value was rounded up. + e = n.e; + + str = coeffToString(n.c); + len = str.length; + + // toPrecision returns exponential notation if the number of significant digits + // specified is less than the number of digits necessary to represent the integer + // part of the value in fixed-point notation. + + // Exponential notation. + if (id == 1 || id == 2 && (i <= e || e <= TO_EXP_NEG)) { + + // Append zeros? + for (; len < i; str += '0', len++); + str = toExponential(str, e); + + // Fixed-point notation. + } else { + i -= ne; + str = toFixedPoint(str, e, '0'); + + // Append zeros? + if (e + 1 > len) { + if (--i > 0) for (str += '.'; i--; str += '0'); + } else { + i += e - len; + if (i > 0) { + if (e + 1 == len) str += '.'; + for (; i--; str += '0'); + } + } + } + } + + return n.s < 0 && c0 ? '-' + str : str; + } + + + // Handle BigNumber.max and BigNumber.min. + function maxOrMin(args, method) { + var n, + i = 1, + m = new BigNumber(args[0]); + + for (; i < args.length; i++) { + n = new BigNumber(args[i]); + + // If any number is NaN, return NaN. + if (!n.s) { + m = n; + break; + } else if (method.call(m, n)) { + m = n; + } + } + + return m; + } + + + /* + * Strip trailing zeros, calculate base 10 exponent and check against MIN_EXP and MAX_EXP. + * Called by minus, plus and times. + */ + function normalise(n, c, e) { + var i = 1, + j = c.length; + + // Remove trailing zeros. + for (; !c[--j]; c.pop()); + + // Calculate the base 10 exponent. First get the number of digits of c[0]. + for (j = c[0]; j >= 10; j /= 10, i++); + + // Overflow? + if ((e = i + e * LOG_BASE - 1) > MAX_EXP) { + + // Infinity. + n.c = n.e = null; + + // Underflow? + } else if (e < MIN_EXP) { + + // Zero. + n.c = [n.e = 0]; + } else { + n.e = e; + n.c = c; + } + + return n; + } + + + // Handle values that fail the validity test in BigNumber. + parseNumeric = (function () { + var basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i, + dotAfter = /^([^.]+)\.$/, + dotBefore = /^\.([^.]+)$/, + isInfinityOrNaN = /^-?(Infinity|NaN)$/, + whitespaceOrPlus = /^\s*\+(?=[\w.])|^\s+|\s+$/g; + + return function (x, str, isNum, b) { + var base, + s = isNum ? str : str.replace(whitespaceOrPlus, ''); + + // No exception on ±Infinity or NaN. + if (isInfinityOrNaN.test(s)) { + x.s = isNaN(s) ? null : s < 0 ? -1 : 1; + } else { + if (!isNum) { + + // basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i + s = s.replace(basePrefix, function (m, p1, p2) { + base = (p2 = p2.toLowerCase()) == 'x' ? 16 : p2 == 'b' ? 2 : 8; + return !b || b == base ? p1 : m; + }); + + if (b) { + base = b; + + // E.g. '1.' to '1', '.1' to '0.1' + s = s.replace(dotAfter, '$1').replace(dotBefore, '0.$1'); + } + + if (str != s) return new BigNumber(s, base); + } + + // '[BigNumber Error] Not a number: {n}' + // '[BigNumber Error] Not a base {b} number: {n}' + if (BigNumber.DEBUG) { + throw Error + (bignumberError + 'Not a' + (b ? ' base ' + b : '') + ' number: ' + str); + } + + // NaN + x.s = null; + } + + x.c = x.e = null; + } + })(); + + + /* + * Round x to sd significant digits using rounding mode rm. Check for over/under-flow. + * If r is truthy, it is known that there are more digits after the rounding digit. + */ + function round(x, sd, rm, r) { + var d, i, j, k, n, ni, rd, + xc = x.c, + pows10 = POWS_TEN; + + // if x is not Infinity or NaN... + if (xc) { + + // rd is the rounding digit, i.e. the digit after the digit that may be rounded up. + // n is a base 1e14 number, the value of the element of array x.c containing rd. + // ni is the index of n within x.c. + // d is the number of digits of n. + // i is the index of rd within n including leading zeros. + // j is the actual index of rd within n (if < 0, rd is a leading zero). + out: { + + // Get the number of digits of the first element of xc. + for (d = 1, k = xc[0]; k >= 10; k /= 10, d++); + i = sd - d; + + // If the rounding digit is in the first element of xc... + if (i < 0) { + i += LOG_BASE; + j = sd; + n = xc[ni = 0]; + + // Get the rounding digit at index j of n. + rd = n / pows10[d - j - 1] % 10 | 0; + } else { + ni = mathceil((i + 1) / LOG_BASE); + + if (ni >= xc.length) { + + if (r) { + + // Needed by sqrt. + for (; xc.length <= ni; xc.push(0)); + n = rd = 0; + d = 1; + i %= LOG_BASE; + j = i - LOG_BASE + 1; + } else { + break out; + } + } else { + n = k = xc[ni]; + + // Get the number of digits of n. + for (d = 1; k >= 10; k /= 10, d++); + + // Get the index of rd within n. + i %= LOG_BASE; + + // Get the index of rd within n, adjusted for leading zeros. + // The number of leading zeros of n is given by LOG_BASE - d. + j = i - LOG_BASE + d; + + // Get the rounding digit at index j of n. + rd = j < 0 ? 0 : n / pows10[d - j - 1] % 10 | 0; + } + } + + r = r || sd < 0 || + + // Are there any non-zero digits after the rounding digit? + // The expression n % pows10[d - j - 1] returns all digits of n to the right + // of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714. + xc[ni + 1] != null || (j < 0 ? n : n % pows10[d - j - 1]); + + r = rm < 4 + ? (rd || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) + : rd > 5 || rd == 5 && (rm == 4 || r || rm == 6 && + + // Check whether the digit to the left of the rounding digit is odd. + ((i > 0 ? j > 0 ? n / pows10[d - j] : 0 : xc[ni - 1]) % 10) & 1 || + rm == (x.s < 0 ? 8 : 7)); + + if (sd < 1 || !xc[0]) { + xc.length = 0; + + if (r) { + + // Convert sd to decimal places. + sd -= x.e + 1; + + // 1, 0.1, 0.01, 0.001, 0.0001 etc. + xc[0] = pows10[(LOG_BASE - sd % LOG_BASE) % LOG_BASE]; + x.e = -sd || 0; + } else { + + // Zero. + xc[0] = x.e = 0; + } + + return x; + } + + // Remove excess digits. + if (i == 0) { + xc.length = ni; + k = 1; + ni--; + } else { + xc.length = ni + 1; + k = pows10[LOG_BASE - i]; + + // E.g. 56700 becomes 56000 if 7 is the rounding digit. + // j > 0 means i > number of leading zeros of n. + xc[ni] = j > 0 ? mathfloor(n / pows10[d - j] % pows10[j]) * k : 0; + } + + // Round up? + if (r) { + + for (; ;) { + + // If the digit to be rounded up is in the first element of xc... + if (ni == 0) { + + // i will be the length of xc[0] before k is added. + for (i = 1, j = xc[0]; j >= 10; j /= 10, i++); + j = xc[0] += k; + for (k = 1; j >= 10; j /= 10, k++); + + // if i != k the length has increased. + if (i != k) { + x.e++; + if (xc[0] == BASE) xc[0] = 1; + } + + break; + } else { + xc[ni] += k; + if (xc[ni] != BASE) break; + xc[ni--] = 0; + k = 1; + } + } + } + + // Remove trailing zeros. + for (i = xc.length; xc[--i] === 0; xc.pop()); + } + + // Overflow? Infinity. + if (x.e > MAX_EXP) { + x.c = x.e = null; + + // Underflow? Zero. + } else if (x.e < MIN_EXP) { + x.c = [x.e = 0]; + } + } + + return x; + } + + + function valueOf(n) { + var str, + e = n.e; + + if (e === null) return n.toString(); + + str = coeffToString(n.c); + + str = e <= TO_EXP_NEG || e >= TO_EXP_POS + ? toExponential(str, e) + : toFixedPoint(str, e, '0'); + + return n.s < 0 ? '-' + str : str; + } + + + // PROTOTYPE/INSTANCE METHODS + + + /* + * Return a new BigNumber whose value is the absolute value of this BigNumber. + */ + P.absoluteValue = P.abs = function () { + var x = new BigNumber(this); + if (x.s < 0) x.s = 1; + return x; + }; + + + /* + * Return + * 1 if the value of this BigNumber is greater than the value of BigNumber(y, b), + * -1 if the value of this BigNumber is less than the value of BigNumber(y, b), + * 0 if they have the same value, + * or null if the value of either is NaN. + */ + P.comparedTo = function (y, b) { + return compare(this, new BigNumber(y, b)); + }; + + + /* + * If dp is undefined or null or true or false, return the number of decimal places of the + * value of this BigNumber, or null if the value of this BigNumber is ±Infinity or NaN. + * + * Otherwise, if dp is a number, return a new BigNumber whose value is the value of this + * BigNumber rounded to a maximum of dp decimal places using rounding mode rm, or + * ROUNDING_MODE if rm is omitted. + * + * [dp] {number} Decimal places: integer, 0 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}' + */ + P.decimalPlaces = P.dp = function (dp, rm) { + var c, n, v, + x = this; + + if (dp != null) { + intCheck(dp, 0, MAX); + if (rm == null) rm = ROUNDING_MODE; + else intCheck(rm, 0, 8); + + return round(new BigNumber(x), dp + x.e + 1, rm); + } + + if (!(c = x.c)) return null; + n = ((v = c.length - 1) - bitFloor(this.e / LOG_BASE)) * LOG_BASE; + + // Subtract the number of trailing zeros of the last number. + if (v = c[v]) for (; v % 10 == 0; v /= 10, n--); + if (n < 0) n = 0; + + return n; + }; + + + /* + * n / 0 = I + * n / N = N + * n / I = 0 + * 0 / n = 0 + * 0 / 0 = N + * 0 / N = N + * 0 / I = 0 + * N / n = N + * N / 0 = N + * N / N = N + * N / I = N + * I / n = I + * I / 0 = I + * I / N = N + * I / I = N + * + * Return a new BigNumber whose value is the value of this BigNumber divided by the value of + * BigNumber(y, b), rounded according to DECIMAL_PLACES and ROUNDING_MODE. + */ + P.dividedBy = P.div = function (y, b) { + return div(this, new BigNumber(y, b), DECIMAL_PLACES, ROUNDING_MODE); + }; + + + /* + * Return a new BigNumber whose value is the integer part of dividing the value of this + * BigNumber by the value of BigNumber(y, b). + */ + P.dividedToIntegerBy = P.idiv = function (y, b) { + return div(this, new BigNumber(y, b), 0, 1); + }; + + + /* + * Return a BigNumber whose value is the value of this BigNumber exponentiated by n. + * + * If m is present, return the result modulo m. + * If n is negative round according to DECIMAL_PLACES and ROUNDING_MODE. + * If POW_PRECISION is non-zero and m is not present, round to POW_PRECISION using ROUNDING_MODE. + * + * The modular power operation works efficiently when x, n, and m are integers, otherwise it + * is equivalent to calculating x.exponentiatedBy(n).modulo(m) with a POW_PRECISION of 0. + * + * n {number|string|BigNumber} The exponent. An integer. + * [m] {number|string|BigNumber} The modulus. + * + * '[BigNumber Error] Exponent not an integer: {n}' + */ + P.exponentiatedBy = P.pow = function (n, m) { + var half, isModExp, i, k, more, nIsBig, nIsNeg, nIsOdd, y, + x = this; + + n = new BigNumber(n); + + // Allow NaN and ±Infinity, but not other non-integers. + if (n.c && !n.isInteger()) { + throw Error + (bignumberError + 'Exponent not an integer: ' + valueOf(n)); + } + + if (m != null) m = new BigNumber(m); + + // Exponent of MAX_SAFE_INTEGER is 15. + nIsBig = n.e > 14; + + // If x is NaN, ±Infinity, ±0 or ±1, or n is ±Infinity, NaN or ±0. + if (!x.c || !x.c[0] || x.c[0] == 1 && !x.e && x.c.length == 1 || !n.c || !n.c[0]) { + + // The sign of the result of pow when x is negative depends on the evenness of n. + // If +n overflows to ±Infinity, the evenness of n would be not be known. + y = new BigNumber(Math.pow(+valueOf(x), nIsBig ? 2 - isOdd(n) : +valueOf(n))); + return m ? y.mod(m) : y; + } + + nIsNeg = n.s < 0; + + if (m) { + + // x % m returns NaN if abs(m) is zero, or m is NaN. + if (m.c ? !m.c[0] : !m.s) return new BigNumber(NaN); + + isModExp = !nIsNeg && x.isInteger() && m.isInteger(); + + if (isModExp) x = x.mod(m); + + // Overflow to ±Infinity: >=2**1e10 or >=1.0000024**1e15. + // Underflow to ±0: <=0.79**1e10 or <=0.9999975**1e15. + } else if (n.e > 9 && (x.e > 0 || x.e < -1 || (x.e == 0 + // [1, 240000000] + ? x.c[0] > 1 || nIsBig && x.c[1] >= 24e7 + // [80000000000000] [99999750000000] + : x.c[0] < 8e13 || nIsBig && x.c[0] <= 9999975e7))) { + + // If x is negative and n is odd, k = -0, else k = 0. + k = x.s < 0 && isOdd(n) ? -0 : 0; + + // If x >= 1, k = ±Infinity. + if (x.e > -1) k = 1 / k; + + // If n is negative return ±0, else return ±Infinity. + return new BigNumber(nIsNeg ? 1 / k : k); + + } else if (POW_PRECISION) { + + // Truncating each coefficient array to a length of k after each multiplication + // equates to truncating significant digits to POW_PRECISION + [28, 41], + // i.e. there will be a minimum of 28 guard digits retained. + k = mathceil(POW_PRECISION / LOG_BASE + 2); + } + + if (nIsBig) { + half = new BigNumber(0.5); + if (nIsNeg) n.s = 1; + nIsOdd = isOdd(n); + } else { + i = Math.abs(+valueOf(n)); + nIsOdd = i % 2; + } + + y = new BigNumber(ONE); + + // Performs 54 loop iterations for n of 9007199254740991. + for (; ;) { + + if (nIsOdd) { + y = y.times(x); + if (!y.c) break; + + if (k) { + if (y.c.length > k) y.c.length = k; + } else if (isModExp) { + y = y.mod(m); //y = y.minus(div(y, m, 0, MODULO_MODE).times(m)); + } + } + + if (i) { + i = mathfloor(i / 2); + if (i === 0) break; + nIsOdd = i % 2; + } else { + n = n.times(half); + round(n, n.e + 1, 1); + + if (n.e > 14) { + nIsOdd = isOdd(n); + } else { + i = +valueOf(n); + if (i === 0) break; + nIsOdd = i % 2; + } + } + + x = x.times(x); + + if (k) { + if (x.c && x.c.length > k) x.c.length = k; + } else if (isModExp) { + x = x.mod(m); //x = x.minus(div(x, m, 0, MODULO_MODE).times(m)); + } + } + + if (isModExp) return y; + if (nIsNeg) y = ONE.div(y); + + return m ? y.mod(m) : k ? round(y, POW_PRECISION, ROUNDING_MODE, more) : y; + }; + + + /* + * Return a new BigNumber whose value is the value of this BigNumber rounded to an integer + * using rounding mode rm, or ROUNDING_MODE if rm is omitted. + * + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {rm}' + */ + P.integerValue = function (rm) { + var n = new BigNumber(this); + if (rm == null) rm = ROUNDING_MODE; + else intCheck(rm, 0, 8); + return round(n, n.e + 1, rm); + }; + + + /* + * Return true if the value of this BigNumber is equal to the value of BigNumber(y, b), + * otherwise return false. + */ + P.isEqualTo = P.eq = function (y, b) { + return compare(this, new BigNumber(y, b)) === 0; + }; + + + /* + * Return true if the value of this BigNumber is a finite number, otherwise return false. + */ + P.isFinite = function () { + return !!this.c; + }; + + + /* + * Return true if the value of this BigNumber is greater than the value of BigNumber(y, b), + * otherwise return false. + */ + P.isGreaterThan = P.gt = function (y, b) { + return compare(this, new BigNumber(y, b)) > 0; + }; + + + /* + * Return true if the value of this BigNumber is greater than or equal to the value of + * BigNumber(y, b), otherwise return false. + */ + P.isGreaterThanOrEqualTo = P.gte = function (y, b) { + return (b = compare(this, new BigNumber(y, b))) === 1 || b === 0; + + }; + + + /* + * Return true if the value of this BigNumber is an integer, otherwise return false. + */ + P.isInteger = function () { + return !!this.c && bitFloor(this.e / LOG_BASE) > this.c.length - 2; + }; + + + /* + * Return true if the value of this BigNumber is less than the value of BigNumber(y, b), + * otherwise return false. + */ + P.isLessThan = P.lt = function (y, b) { + return compare(this, new BigNumber(y, b)) < 0; + }; + + + /* + * Return true if the value of this BigNumber is less than or equal to the value of + * BigNumber(y, b), otherwise return false. + */ + P.isLessThanOrEqualTo = P.lte = function (y, b) { + return (b = compare(this, new BigNumber(y, b))) === -1 || b === 0; + }; + + + /* + * Return true if the value of this BigNumber is NaN, otherwise return false. + */ + P.isNaN = function () { + return !this.s; + }; + + + /* + * Return true if the value of this BigNumber is negative, otherwise return false. + */ + P.isNegative = function () { + return this.s < 0; + }; + + + /* + * Return true if the value of this BigNumber is positive, otherwise return false. + */ + P.isPositive = function () { + return this.s > 0; + }; + + + /* + * Return true if the value of this BigNumber is 0 or -0, otherwise return false. + */ + P.isZero = function () { + return !!this.c && this.c[0] == 0; + }; + + + /* + * n - 0 = n + * n - N = N + * n - I = -I + * 0 - n = -n + * 0 - 0 = 0 + * 0 - N = N + * 0 - I = -I + * N - n = N + * N - 0 = N + * N - N = N + * N - I = N + * I - n = I + * I - 0 = I + * I - N = N + * I - I = N + * + * Return a new BigNumber whose value is the value of this BigNumber minus the value of + * BigNumber(y, b). + */ + P.minus = function (y, b) { + var i, j, t, xLTy, + x = this, + a = x.s; + + y = new BigNumber(y, b); + b = y.s; + + // Either NaN? + if (!a || !b) return new BigNumber(NaN); + + // Signs differ? + if (a != b) { + y.s = -b; + return x.plus(y); + } + + var xe = x.e / LOG_BASE, + ye = y.e / LOG_BASE, + xc = x.c, + yc = y.c; + + if (!xe || !ye) { + + // Either Infinity? + if (!xc || !yc) return xc ? (y.s = -b, y) : new BigNumber(yc ? x : NaN); + + // Either zero? + if (!xc[0] || !yc[0]) { + + // Return y if y is non-zero, x if x is non-zero, or zero if both are zero. + return yc[0] ? (y.s = -b, y) : new BigNumber(xc[0] ? x : + + // IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity + ROUNDING_MODE == 3 ? -0 : 0); + } + } + + xe = bitFloor(xe); + ye = bitFloor(ye); + xc = xc.slice(); + + // Determine which is the bigger number. + if (a = xe - ye) { + + if (xLTy = a < 0) { + a = -a; + t = xc; + } else { + ye = xe; + t = yc; + } + + t.reverse(); + + // Prepend zeros to equalise exponents. + for (b = a; b--; t.push(0)); + t.reverse(); + } else { + + // Exponents equal. Check digit by digit. + j = (xLTy = (a = xc.length) < (b = yc.length)) ? a : b; + + for (a = b = 0; b < j; b++) { + + if (xc[b] != yc[b]) { + xLTy = xc[b] < yc[b]; + break; + } + } + } + + // x < y? Point xc to the array of the bigger number. + if (xLTy) t = xc, xc = yc, yc = t, y.s = -y.s; + + b = (j = yc.length) - (i = xc.length); + + // Append zeros to xc if shorter. + // No need to add zeros to yc if shorter as subtract only needs to start at yc.length. + if (b > 0) for (; b--; xc[i++] = 0); + b = BASE - 1; + + // Subtract yc from xc. + for (; j > a;) { + + if (xc[--j] < yc[j]) { + for (i = j; i && !xc[--i]; xc[i] = b); + --xc[i]; + xc[j] += BASE; + } + + xc[j] -= yc[j]; + } + + // Remove leading zeros and adjust exponent accordingly. + for (; xc[0] == 0; xc.splice(0, 1), --ye); + + // Zero? + if (!xc[0]) { + + // Following IEEE 754 (2008) 6.3, + // n - n = +0 but n - n = -0 when rounding towards -Infinity. + y.s = ROUNDING_MODE == 3 ? -1 : 1; + y.c = [y.e = 0]; + return y; + } + + // No need to check for Infinity as +x - +y != Infinity && -x - -y != Infinity + // for finite x and y. + return normalise(y, xc, ye); + }; + + + /* + * n % 0 = N + * n % N = N + * n % I = n + * 0 % n = 0 + * -0 % n = -0 + * 0 % 0 = N + * 0 % N = N + * 0 % I = 0 + * N % n = N + * N % 0 = N + * N % N = N + * N % I = N + * I % n = N + * I % 0 = N + * I % N = N + * I % I = N + * + * Return a new BigNumber whose value is the value of this BigNumber modulo the value of + * BigNumber(y, b). The result depends on the value of MODULO_MODE. + */ + P.modulo = P.mod = function (y, b) { + var q, s, + x = this; + + y = new BigNumber(y, b); + + // Return NaN if x is Infinity or NaN, or y is NaN or zero. + if (!x.c || !y.s || y.c && !y.c[0]) { + return new BigNumber(NaN); + + // Return x if y is Infinity or x is zero. + } else if (!y.c || x.c && !x.c[0]) { + return new BigNumber(x); + } + + if (MODULO_MODE == 9) { + + // Euclidian division: q = sign(y) * floor(x / abs(y)) + // r = x - qy where 0 <= r < abs(y) + s = y.s; + y.s = 1; + q = div(x, y, 0, 3); + y.s = s; + q.s *= s; + } else { + q = div(x, y, 0, MODULO_MODE); + } + + y = x.minus(q.times(y)); + + // To match JavaScript %, ensure sign of zero is sign of dividend. + if (!y.c[0] && MODULO_MODE == 1) y.s = x.s; + + return y; + }; + + + /* + * n * 0 = 0 + * n * N = N + * n * I = I + * 0 * n = 0 + * 0 * 0 = 0 + * 0 * N = N + * 0 * I = N + * N * n = N + * N * 0 = N + * N * N = N + * N * I = N + * I * n = I + * I * 0 = N + * I * N = N + * I * I = I + * + * Return a new BigNumber whose value is the value of this BigNumber multiplied by the value + * of BigNumber(y, b). + */ + P.multipliedBy = P.times = function (y, b) { + var c, e, i, j, k, m, xcL, xlo, xhi, ycL, ylo, yhi, zc, + base, sqrtBase, + x = this, + xc = x.c, + yc = (y = new BigNumber(y, b)).c; + + // Either NaN, ±Infinity or ±0? + if (!xc || !yc || !xc[0] || !yc[0]) { + + // Return NaN if either is NaN, or one is 0 and the other is Infinity. + if (!x.s || !y.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc) { + y.c = y.e = y.s = null; + } else { + y.s *= x.s; + + // Return ±Infinity if either is ±Infinity. + if (!xc || !yc) { + y.c = y.e = null; + + // Return ±0 if either is ±0. + } else { + y.c = [0]; + y.e = 0; + } + } + + return y; + } + + e = bitFloor(x.e / LOG_BASE) + bitFloor(y.e / LOG_BASE); + y.s *= x.s; + xcL = xc.length; + ycL = yc.length; + + // Ensure xc points to longer array and xcL to its length. + if (xcL < ycL) zc = xc, xc = yc, yc = zc, i = xcL, xcL = ycL, ycL = i; + + // Initialise the result array with zeros. + for (i = xcL + ycL, zc = []; i--; zc.push(0)); + + base = BASE; + sqrtBase = SQRT_BASE; + + for (i = ycL; --i >= 0;) { + c = 0; + ylo = yc[i] % sqrtBase; + yhi = yc[i] / sqrtBase | 0; + + for (k = xcL, j = i + k; j > i;) { + xlo = xc[--k] % sqrtBase; + xhi = xc[k] / sqrtBase | 0; + m = yhi * xlo + xhi * ylo; + xlo = ylo * xlo + ((m % sqrtBase) * sqrtBase) + zc[j] + c; + c = (xlo / base | 0) + (m / sqrtBase | 0) + yhi * xhi; + zc[j--] = xlo % base; + } + + zc[j] = c; + } + + if (c) { + ++e; + } else { + zc.splice(0, 1); + } + + return normalise(y, zc, e); + }; + + + /* + * Return a new BigNumber whose value is the value of this BigNumber negated, + * i.e. multiplied by -1. + */ + P.negated = function () { + var x = new BigNumber(this); + x.s = -x.s || null; + return x; + }; + + + /* + * n + 0 = n + * n + N = N + * n + I = I + * 0 + n = n + * 0 + 0 = 0 + * 0 + N = N + * 0 + I = I + * N + n = N + * N + 0 = N + * N + N = N + * N + I = N + * I + n = I + * I + 0 = I + * I + N = N + * I + I = I + * + * Return a new BigNumber whose value is the value of this BigNumber plus the value of + * BigNumber(y, b). + */ + P.plus = function (y, b) { + var t, + x = this, + a = x.s; + + y = new BigNumber(y, b); + b = y.s; + + // Either NaN? + if (!a || !b) return new BigNumber(NaN); + + // Signs differ? + if (a != b) { + y.s = -b; + return x.minus(y); + } + + var xe = x.e / LOG_BASE, + ye = y.e / LOG_BASE, + xc = x.c, + yc = y.c; + + if (!xe || !ye) { + + // Return ±Infinity if either ±Infinity. + if (!xc || !yc) return new BigNumber(a / 0); + + // Either zero? + // Return y if y is non-zero, x if x is non-zero, or zero if both are zero. + if (!xc[0] || !yc[0]) return yc[0] ? y : new BigNumber(xc[0] ? x : a * 0); + } + + xe = bitFloor(xe); + ye = bitFloor(ye); + xc = xc.slice(); + + // Prepend zeros to equalise exponents. Faster to use reverse then do unshifts. + if (a = xe - ye) { + if (a > 0) { + ye = xe; + t = yc; + } else { + a = -a; + t = xc; + } + + t.reverse(); + for (; a--; t.push(0)); + t.reverse(); + } + + a = xc.length; + b = yc.length; + + // Point xc to the longer array, and b to the shorter length. + if (a - b < 0) t = yc, yc = xc, xc = t, b = a; + + // Only start adding at yc.length - 1 as the further digits of xc can be ignored. + for (a = 0; b;) { + a = (xc[--b] = xc[b] + yc[b] + a) / BASE | 0; + xc[b] = BASE === xc[b] ? 0 : xc[b] % BASE; + } + + if (a) { + xc = [a].concat(xc); + ++ye; + } + + // No need to check for zero, as +x + +y != 0 && -x + -y != 0 + // ye = MAX_EXP + 1 possible + return normalise(y, xc, ye); + }; + + + /* + * If sd is undefined or null or true or false, return the number of significant digits of + * the value of this BigNumber, or null if the value of this BigNumber is ±Infinity or NaN. + * If sd is true include integer-part trailing zeros in the count. + * + * Otherwise, if sd is a number, return a new BigNumber whose value is the value of this + * BigNumber rounded to a maximum of sd significant digits using rounding mode rm, or + * ROUNDING_MODE if rm is omitted. + * + * sd {number|boolean} number: significant digits: integer, 1 to MAX inclusive. + * boolean: whether to count integer-part trailing zeros: true or false. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {sd|rm}' + */ + P.precision = P.sd = function (sd, rm) { + var c, n, v, + x = this; + + if (sd != null && sd !== !!sd) { + intCheck(sd, 1, MAX); + if (rm == null) rm = ROUNDING_MODE; + else intCheck(rm, 0, 8); + + return round(new BigNumber(x), sd, rm); + } + + if (!(c = x.c)) return null; + v = c.length - 1; + n = v * LOG_BASE + 1; + + if (v = c[v]) { + + // Subtract the number of trailing zeros of the last element. + for (; v % 10 == 0; v /= 10, n--); + + // Add the number of digits of the first element. + for (v = c[0]; v >= 10; v /= 10, n++); + } + + if (sd && x.e + 1 > n) n = x.e + 1; + + return n; + }; + + + /* + * Return a new BigNumber whose value is the value of this BigNumber shifted by k places + * (powers of 10). Shift to the right if n > 0, and to the left if n < 0. + * + * k {number} Integer, -MAX_SAFE_INTEGER to MAX_SAFE_INTEGER inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {k}' + */ + P.shiftedBy = function (k) { + intCheck(k, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER); + return this.times('1e' + k); + }; + + + /* + * sqrt(-n) = N + * sqrt(N) = N + * sqrt(-I) = N + * sqrt(I) = I + * sqrt(0) = 0 + * sqrt(-0) = -0 + * + * Return a new BigNumber whose value is the square root of the value of this BigNumber, + * rounded according to DECIMAL_PLACES and ROUNDING_MODE. + */ + P.squareRoot = P.sqrt = function () { + var m, n, r, rep, t, + x = this, + c = x.c, + s = x.s, + e = x.e, + dp = DECIMAL_PLACES + 4, + half = new BigNumber('0.5'); + + // Negative/NaN/Infinity/zero? + if (s !== 1 || !c || !c[0]) { + return new BigNumber(!s || s < 0 && (!c || c[0]) ? NaN : c ? x : 1 / 0); + } + + // Initial estimate. + s = Math.sqrt(+valueOf(x)); + + // Math.sqrt underflow/overflow? + // Pass x to Math.sqrt as integer, then adjust the exponent of the result. + if (s == 0 || s == 1 / 0) { + n = coeffToString(c); + if ((n.length + e) % 2 == 0) n += '0'; + s = Math.sqrt(+n); + e = bitFloor((e + 1) / 2) - (e < 0 || e % 2); + + if (s == 1 / 0) { + n = '1e' + e; + } else { + n = s.toExponential(); + n = n.slice(0, n.indexOf('e') + 1) + e; + } + + r = new BigNumber(n); + } else { + r = new BigNumber(s + ''); + } + + // Check for zero. + // r could be zero if MIN_EXP is changed after the this value was created. + // This would cause a division by zero (x/t) and hence Infinity below, which would cause + // coeffToString to throw. + if (r.c[0]) { + e = r.e; + s = e + dp; + if (s < 3) s = 0; + + // Newton-Raphson iteration. + for (; ;) { + t = r; + r = half.times(t.plus(div(x, t, dp, 1))); + + if (coeffToString(t.c).slice(0, s) === (n = coeffToString(r.c)).slice(0, s)) { + + // The exponent of r may here be one less than the final result exponent, + // e.g 0.0009999 (e-4) --> 0.001 (e-3), so adjust s so the rounding digits + // are indexed correctly. + if (r.e < e) --s; + n = n.slice(s - 3, s + 1); + + // The 4th rounding digit may be in error by -1 so if the 4 rounding digits + // are 9999 or 4999 (i.e. approaching a rounding boundary) continue the + // iteration. + if (n == '9999' || !rep && n == '4999') { + + // On the first iteration only, check to see if rounding up gives the + // exact result as the nines may infinitely repeat. + if (!rep) { + round(t, t.e + DECIMAL_PLACES + 2, 0); + + if (t.times(t).eq(x)) { + r = t; + break; + } + } + + dp += 4; + s += 4; + rep = 1; + } else { + + // If rounding digits are null, 0{0,4} or 50{0,3}, check for exact + // result. If not, then there are further digits and m will be truthy. + if (!+n || !+n.slice(1) && n.charAt(0) == '5') { + + // Truncate to the first rounding digit. + round(r, r.e + DECIMAL_PLACES + 2, 1); + m = !r.times(r).eq(x); + } + + break; + } + } + } + } + + return round(r, r.e + DECIMAL_PLACES + 1, ROUNDING_MODE, m); + }; + + + /* + * Return a string representing the value of this BigNumber in exponential notation and + * rounded using ROUNDING_MODE to dp fixed decimal places. + * + * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}' + */ + P.toExponential = function (dp, rm) { + if (dp != null) { + intCheck(dp, 0, MAX); + dp++; + } + return format(this, dp, rm, 1); + }; + + + /* + * Return a string representing the value of this BigNumber in fixed-point notation rounding + * to dp fixed decimal places using rounding mode rm, or ROUNDING_MODE if rm is omitted. + * + * Note: as with JavaScript's number type, (-0).toFixed(0) is '0', + * but e.g. (-0.00001).toFixed(0) is '-0'. + * + * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}' + */ + P.toFixed = function (dp, rm) { + if (dp != null) { + intCheck(dp, 0, MAX); + dp = dp + this.e + 1; + } + return format(this, dp, rm); + }; + + + /* + * Return a string representing the value of this BigNumber in fixed-point notation rounded + * using rm or ROUNDING_MODE to dp decimal places, and formatted according to the properties + * of the format or FORMAT object (see BigNumber.set). + * + * The formatting object may contain some or all of the properties shown below. + * + * FORMAT = { + * prefix: '', + * groupSize: 3, + * secondaryGroupSize: 0, + * groupSeparator: ',', + * decimalSeparator: '.', + * fractionGroupSize: 0, + * fractionGroupSeparator: '\xA0', // non-breaking space + * suffix: '' + * }; + * + * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * [format] {object} Formatting options. See FORMAT pbject above. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}' + * '[BigNumber Error] Argument not an object: {format}' + */ + P.toFormat = function (dp, rm, format) { + var str, + x = this; + + if (format == null) { + if (dp != null && rm && typeof rm == 'object') { + format = rm; + rm = null; + } else if (dp && typeof dp == 'object') { + format = dp; + dp = rm = null; + } else { + format = FORMAT; + } + } else if (typeof format != 'object') { + throw Error + (bignumberError + 'Argument not an object: ' + format); + } + + str = x.toFixed(dp, rm); + + if (x.c) { + var i, + arr = str.split('.'), + g1 = +format.groupSize, + g2 = +format.secondaryGroupSize, + groupSeparator = format.groupSeparator || '', + intPart = arr[0], + fractionPart = arr[1], + isNeg = x.s < 0, + intDigits = isNeg ? intPart.slice(1) : intPart, + len = intDigits.length; + + if (g2) i = g1, g1 = g2, g2 = i, len -= i; + + if (g1 > 0 && len > 0) { + i = len % g1 || g1; + intPart = intDigits.substr(0, i); + for (; i < len; i += g1) intPart += groupSeparator + intDigits.substr(i, g1); + if (g2 > 0) intPart += groupSeparator + intDigits.slice(i); + if (isNeg) intPart = '-' + intPart; + } + + str = fractionPart + ? intPart + (format.decimalSeparator || '') + ((g2 = +format.fractionGroupSize) + ? fractionPart.replace(new RegExp('\\d{' + g2 + '}\\B', 'g'), + '$&' + (format.fractionGroupSeparator || '')) + : fractionPart) + : intPart; + } + + return (format.prefix || '') + str + (format.suffix || ''); + }; + + + /* + * Return an array of two BigNumbers representing the value of this BigNumber as a simple + * fraction with an integer numerator and an integer denominator. + * The denominator will be a positive non-zero value less than or equal to the specified + * maximum denominator. If a maximum denominator is not specified, the denominator will be + * the lowest value necessary to represent the number exactly. + * + * [md] {number|string|BigNumber} Integer >= 1, or Infinity. The maximum denominator. + * + * '[BigNumber Error] Argument {not an integer|out of range} : {md}' + */ + P.toFraction = function (md) { + var d, d0, d1, d2, e, exp, n, n0, n1, q, r, s, + x = this, + xc = x.c; + + if (md != null) { + n = new BigNumber(md); + + // Throw if md is less than one or is not an integer, unless it is Infinity. + if (!n.isInteger() && (n.c || n.s !== 1) || n.lt(ONE)) { + throw Error + (bignumberError + 'Argument ' + + (n.isInteger() ? 'out of range: ' : 'not an integer: ') + valueOf(n)); + } + } + + if (!xc) return new BigNumber(x); + + d = new BigNumber(ONE); + n1 = d0 = new BigNumber(ONE); + d1 = n0 = new BigNumber(ONE); + s = coeffToString(xc); + + // Determine initial denominator. + // d is a power of 10 and the minimum max denominator that specifies the value exactly. + e = d.e = s.length - x.e - 1; + d.c[0] = POWS_TEN[(exp = e % LOG_BASE) < 0 ? LOG_BASE + exp : exp]; + md = !md || n.comparedTo(d) > 0 ? (e > 0 ? d : n1) : n; + + exp = MAX_EXP; + MAX_EXP = 1 / 0; + n = new BigNumber(s); + + // n0 = d1 = 0 + n0.c[0] = 0; + + for (; ;) { + q = div(n, d, 0, 1); + d2 = d0.plus(q.times(d1)); + if (d2.comparedTo(md) == 1) break; + d0 = d1; + d1 = d2; + n1 = n0.plus(q.times(d2 = n1)); + n0 = d2; + d = n.minus(q.times(d2 = d)); + n = d2; + } + + d2 = div(md.minus(d0), d1, 0, 1); + n0 = n0.plus(d2.times(n1)); + d0 = d0.plus(d2.times(d1)); + n0.s = n1.s = x.s; + e = e * 2; + + // Determine which fraction is closer to x, n0/d0 or n1/d1 + r = div(n1, d1, e, ROUNDING_MODE).minus(x).abs().comparedTo( + div(n0, d0, e, ROUNDING_MODE).minus(x).abs()) < 1 ? [n1, d1] : [n0, d0]; + + MAX_EXP = exp; + + return r; + }; + + + /* + * Return the value of this BigNumber converted to a number primitive. + */ + P.toNumber = function () { + return +valueOf(this); + }; + + + /* + * Return a string representing the value of this BigNumber rounded to sd significant digits + * using rounding mode rm or ROUNDING_MODE. If sd is less than the number of digits + * necessary to represent the integer part of the value in fixed-point notation, then use + * exponential notation. + * + * [sd] {number} Significant digits. Integer, 1 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {sd|rm}' + */ + P.toPrecision = function (sd, rm) { + if (sd != null) intCheck(sd, 1, MAX); + return format(this, sd, rm, 2); + }; + + + /* + * Return a string representing the value of this BigNumber in base b, or base 10 if b is + * omitted. If a base is specified, including base 10, round according to DECIMAL_PLACES and + * ROUNDING_MODE. If a base is not specified, and this BigNumber has a positive exponent + * that is equal to or greater than TO_EXP_POS, or a negative exponent equal to or less than + * TO_EXP_NEG, return exponential notation. + * + * [b] {number} Integer, 2 to ALPHABET.length inclusive. + * + * '[BigNumber Error] Base {not a primitive number|not an integer|out of range}: {b}' + */ + P.toString = function (b) { + var str, + n = this, + s = n.s, + e = n.e; + + // Infinity or NaN? + if (e === null) { + if (s) { + str = 'Infinity'; + if (s < 0) str = '-' + str; + } else { + str = 'NaN'; + } + } else { + if (b == null) { + str = e <= TO_EXP_NEG || e >= TO_EXP_POS + ? toExponential(coeffToString(n.c), e) + : toFixedPoint(coeffToString(n.c), e, '0'); + } else if (b === 10) { + n = round(new BigNumber(n), DECIMAL_PLACES + e + 1, ROUNDING_MODE); + str = toFixedPoint(coeffToString(n.c), n.e, '0'); + } else { + intCheck(b, 2, ALPHABET.length, 'Base'); + str = convertBase(toFixedPoint(coeffToString(n.c), e, '0'), 10, b, s, true); + } + + if (s < 0 && n.c[0]) str = '-' + str; + } + + return str; + }; + + + /* + * Return as toString, but do not accept a base argument, and include the minus sign for + * negative zero. + */ + P.valueOf = P.toJSON = function () { + return valueOf(this); + }; + + + P._isBigNumber = true; + + if (configObject != null) BigNumber.set(configObject); + + return BigNumber; + } + + + // PRIVATE HELPER FUNCTIONS + + // These functions don't need access to variables, + // e.g. DECIMAL_PLACES, in the scope of the `clone` function above. + + + function bitFloor(n) { + var i = n | 0; + return n > 0 || n === i ? i : i - 1; + } + + + // Return a coefficient array as a string of base 10 digits. + function coeffToString(a) { + var s, z, + i = 1, + j = a.length, + r = a[0] + ''; + + for (; i < j;) { + s = a[i++] + ''; + z = LOG_BASE - s.length; + for (; z--; s = '0' + s); + r += s; + } + + // Determine trailing zeros. + for (j = r.length; r.charCodeAt(--j) === 48;); + + return r.slice(0, j + 1 || 1); + } + + + // Compare the value of BigNumbers x and y. + function compare(x, y) { + var a, b, + xc = x.c, + yc = y.c, + i = x.s, + j = y.s, + k = x.e, + l = y.e; + + // Either NaN? + if (!i || !j) return null; + + a = xc && !xc[0]; + b = yc && !yc[0]; + + // Either zero? + if (a || b) return a ? b ? 0 : -j : i; + + // Signs differ? + if (i != j) return i; + + a = i < 0; + b = k == l; + + // Either Infinity? + if (!xc || !yc) return b ? 0 : !xc ^ a ? 1 : -1; + + // Compare exponents. + if (!b) return k > l ^ a ? 1 : -1; + + j = (k = xc.length) < (l = yc.length) ? k : l; + + // Compare digit by digit. + for (i = 0; i < j; i++) if (xc[i] != yc[i]) return xc[i] > yc[i] ^ a ? 1 : -1; + + // Compare lengths. + return k == l ? 0 : k > l ^ a ? 1 : -1; + } + + + /* + * Check that n is a primitive number, an integer, and in range, otherwise throw. + */ + function intCheck(n, min, max, name) { + if (n < min || n > max || n !== mathfloor(n)) { + throw Error + (bignumberError + (name || 'Argument') + (typeof n == 'number' + ? n < min || n > max ? ' out of range: ' : ' not an integer: ' + : ' not a primitive number: ') + String(n)); + } + } + + + // Assumes finite n. + function isOdd(n) { + var k = n.c.length - 1; + return bitFloor(n.e / LOG_BASE) == k && n.c[k] % 2 != 0; + } + + + function toExponential(str, e) { + return (str.length > 1 ? str.charAt(0) + '.' + str.slice(1) : str) + + (e < 0 ? 'e' : 'e+') + e; + } + + + function toFixedPoint(str, e, z) { + var len, zs; + + // Negative exponent? + if (e < 0) { + + // Prepend zeros. + for (zs = z + '.'; ++e; zs += z); + str = zs + str; + + // Positive exponent + } else { + len = str.length; + + // Append zeros. + if (++e > len) { + for (zs = z, e -= len; --e; zs += z); + str += zs; + } else if (e < len) { + str = str.slice(0, e) + '.' + str.slice(e); + } + } + + return str; + } + + + // EXPORT + + + BigNumber = clone(); + BigNumber['default'] = BigNumber.BigNumber = BigNumber; + + // AMD. + if (typeof define == 'function' && define.amd) { + define(function () { return BigNumber; }); + + // Node.js and other environments that support module.exports. + } else if (typeof module != 'undefined' && module.exports) { + module.exports = BigNumber; + + // Browser. + } else { + if (!globalObject) { + globalObject = typeof self != 'undefined' && self ? self : window; + } + + globalObject.BigNumber = BigNumber; + } +})(this); diff --git a/node_modules/bignumber.js/bignumber.min.js b/node_modules/bignumber.js/bignumber.min.js new file mode 100644 index 0000000..2610072 --- /dev/null +++ b/node_modules/bignumber.js/bignumber.min.js @@ -0,0 +1 @@ +/* bignumber.js v9.0.0 https://github.com/MikeMcl/bignumber.js/LICENCE */!function(e){"use strict";var r,x=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,L=Math.ceil,U=Math.floor,I="[BigNumber Error] ",T=I+"Number primitive has more than 15 significant digits: ",C=1e14,M=14,G=9007199254740991,k=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],F=1e7,q=1e9;function j(e){var r=0|e;return 0o[s]^n?1:-1;return u==l?0:l(t=e.length)){for(i=n,r-=t;--r;i+=n);e+=i}else ry?c.c=c.e=null:e.ey)c.c=c.e=null;else if(oy?e.c=e.e=null:e.c=n=a.length){if(!t)break e;for(;a.length<=l;a.push(0));u=c=0,s=(o%=M)-M+(i=1)}else{for(u=f=a[l],i=1;10<=f;f/=10,i++);c=(s=(o%=M)-M+i)<0?0:u/h[i-s-1]%10|0}if(t=t||r<0||null!=a[l+1]||(s<0?u:u%h[i-s-1]),t=n<4?(c||t)&&(0==n||n==(e.s<0?3:2)):5y?e.c=e.e=null:e.e>>11))?(n=crypto.getRandomValues(new Uint32Array(2)),r[s]=n[0],r[s+1]=n[1]):(f.push(o%1e14),s+=2);s=i/2}else{if(!crypto.randomBytes)throw b=!1,Error(I+"crypto unavailable");for(r=crypto.randomBytes(i*=7);sn-1&&(null==s[i+1]&&(s[i+1]=0),s[i+1]+=s[i]/n|0,s[i]%=n)}return s.reverse()}return function(e,r,n,t,i){var o,s,f,u,l,c,a,h,g=e.indexOf("."),p=N,w=O;for(0<=g&&(u=E,E=0,e=e.replace(".",""),c=(h=new B(r)).pow(e.length-g),E=u,h.c=m(X($(c.c),c.e,"0"),10,n,d),h.e=h.c.length),f=u=(a=m(e,r,n,i?(o=S,d):(o=d,S))).length;0==a[--u];a.pop());if(!a[0])return o.charAt(0);if(g<0?--f:(c.c=a,c.e=f,c.s=t,a=(c=v(c,h,p,w,n)).c,l=c.r,f=c.e),g=a[s=f+p+1],u=n/2,l=l||s<0||null!=a[s+1],l=w<4?(null!=g||l)&&(0==w||w==(c.s<0?3:2)):un;)a[s]=0,s||(++f,a=[1].concat(a));for(u=a.length;!a[--u];);for(g=0,e="";g<=u;e+=o.charAt(a[g++]));e=X(e,f,o.charAt(0))}return e}}(),v=function(){function S(e,r,n){var t,i,o,s,f=0,u=e.length,l=r%F,c=r/F|0;for(e=e.slice();u--;)f=((i=l*(o=e[u]%F)+(t=c*o+(s=e[u]/F|0)*l)%F*F+f)/n|0)+(t/F|0)+c*s,e[u]=i%n;return f&&(e=[f].concat(e)),e}function R(e,r,n,t){var i,o;if(n!=t)o=tr[i]?1:-1;break}return o}function _(e,r,n,t){for(var i=0;n--;)e[n]-=i,i=e[n](E[f]||0)&&s--,b<0)g.push(1),u=!0;else{for(v=E.length,O=A.length,b+=2,1<(l=U(i/(A[f=0]+1)))&&(A=S(A,l,i),E=S(E,l,i),O=A.length,v=E.length),m=O,w=(p=E.slice(0,O)).length;w=i/2&&N++;do{if(l=0,(o=R(A,p,O,w))<0){if(d=p[0],O!=w&&(d=d*i+(p[1]||0)),1<(l=U(d/N)))for(i<=l&&(l=i-1),a=(c=S(A,l,i)).length,w=p.length;1==R(c,p,a,w);)l--,_(c,Oo&&(l.c.length=o):t&&(l=l.mod(r))}if(i){if(0===(i=U(i/2)))break;u=i%2}else if(D(e=e.times(n),e.e+1,1),14o&&(c.c.length=o):t&&(c=c.mod(r))}return t?l:(f&&(l=w.div(l)),r?l.mod(r):o?D(l,E,O,void 0):l)},t.integerValue=function(e){var r=new B(this);return null==e?e=O:H(e,0,8),D(r,r.e+1,e)},t.isEqualTo=t.eq=function(e,r){return 0===z(this,new B(e,r))},t.isFinite=function(){return!!this.c},t.isGreaterThan=t.gt=function(e,r){return 0this.c.length-2},t.isLessThan=t.lt=function(e,r){return z(this,new B(e,r))<0},t.isLessThanOrEqualTo=t.lte=function(e,r){return-1===(r=z(this,new B(e,r)))||0===r},t.isNaN=function(){return!this.s},t.isNegative=function(){return this.s<0},t.isPositive=function(){return 0t&&(t=this.e+1),t},t.shiftedBy=function(e){return H(e,-G,G),this.times("1e"+e)},t.squareRoot=t.sqrt=function(){var e,r,n,t,i,o=this,s=o.c,f=o.s,u=o.e,l=N+4,c=new B("0.5");if(1!==f||!s||!s[0])return new B(!f||f<0&&(!s||s[0])?NaN:s?o:1/0);if((n=0==(f=Math.sqrt(+P(o)))||f==1/0?(((r=$(s)).length+u)%2==0&&(r+="0"),f=Math.sqrt(+r),u=j((u+1)/2)-(u<0||u%2),new B(r=f==1/0?"1e"+u:(r=f.toExponential()).slice(0,r.indexOf("e")+1)+u)):new B(f+"")).c[0])for((f=(u=n.e)+l)<3&&(f=0);;)if(i=n,n=c.times(i.plus(v(o,i,l,1))),$(i.c).slice(0,f)===(r=$(n.c)).slice(0,f)){if(n.e + * MIT Licensed. + * + * BigNumber.prototype methods | BigNumber methods + * | + * absoluteValue abs | clone + * comparedTo | config set + * decimalPlaces dp | DECIMAL_PLACES + * dividedBy div | ROUNDING_MODE + * dividedToIntegerBy idiv | EXPONENTIAL_AT + * exponentiatedBy pow | RANGE + * integerValue | CRYPTO + * isEqualTo eq | MODULO_MODE + * isFinite | POW_PRECISION + * isGreaterThan gt | FORMAT + * isGreaterThanOrEqualTo gte | ALPHABET + * isInteger | isBigNumber + * isLessThan lt | maximum max + * isLessThanOrEqualTo lte | minimum min + * isNaN | random + * isNegative | sum + * isPositive | + * isZero | + * minus | + * modulo mod | + * multipliedBy times | + * negated | + * plus | + * precision sd | + * shiftedBy | + * squareRoot sqrt | + * toExponential | + * toFixed | + * toFormat | + * toFraction | + * toJSON | + * toNumber | + * toPrecision | + * toString | + * valueOf | + * + */ + + +var + isNumeric = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, + + mathceil = Math.ceil, + mathfloor = Math.floor, + + bignumberError = '[BigNumber Error] ', + tooManyDigits = bignumberError + 'Number primitive has more than 15 significant digits: ', + + BASE = 1e14, + LOG_BASE = 14, + MAX_SAFE_INTEGER = 0x1fffffffffffff, // 2^53 - 1 + // MAX_INT32 = 0x7fffffff, // 2^31 - 1 + POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], + SQRT_BASE = 1e7, + + // EDITABLE + // The limit on the value of DECIMAL_PLACES, TO_EXP_NEG, TO_EXP_POS, MIN_EXP, MAX_EXP, and + // the arguments to toExponential, toFixed, toFormat, and toPrecision. + MAX = 1E9; // 0 to MAX_INT32 + + +/* + * Create and return a BigNumber constructor. + */ +function clone(configObject) { + var div, convertBase, parseNumeric, + P = BigNumber.prototype = { constructor: BigNumber, toString: null, valueOf: null }, + ONE = new BigNumber(1), + + + //----------------------------- EDITABLE CONFIG DEFAULTS ------------------------------- + + + // The default values below must be integers within the inclusive ranges stated. + // The values can also be changed at run-time using BigNumber.set. + + // The maximum number of decimal places for operations involving division. + DECIMAL_PLACES = 20, // 0 to MAX + + // The rounding mode used when rounding to the above decimal places, and when using + // toExponential, toFixed, toFormat and toPrecision, and round (default value). + // UP 0 Away from zero. + // DOWN 1 Towards zero. + // CEIL 2 Towards +Infinity. + // FLOOR 3 Towards -Infinity. + // HALF_UP 4 Towards nearest neighbour. If equidistant, up. + // HALF_DOWN 5 Towards nearest neighbour. If equidistant, down. + // HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour. + // HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity. + // HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity. + ROUNDING_MODE = 4, // 0 to 8 + + // EXPONENTIAL_AT : [TO_EXP_NEG , TO_EXP_POS] + + // The exponent value at and beneath which toString returns exponential notation. + // Number type: -7 + TO_EXP_NEG = -7, // 0 to -MAX + + // The exponent value at and above which toString returns exponential notation. + // Number type: 21 + TO_EXP_POS = 21, // 0 to MAX + + // RANGE : [MIN_EXP, MAX_EXP] + + // The minimum exponent value, beneath which underflow to zero occurs. + // Number type: -324 (5e-324) + MIN_EXP = -1e7, // -1 to -MAX + + // The maximum exponent value, above which overflow to Infinity occurs. + // Number type: 308 (1.7976931348623157e+308) + // For MAX_EXP > 1e7, e.g. new BigNumber('1e100000000').plus(1) may be slow. + MAX_EXP = 1e7, // 1 to MAX + + // Whether to use cryptographically-secure random number generation, if available. + CRYPTO = false, // true or false + + // The modulo mode used when calculating the modulus: a mod n. + // The quotient (q = a / n) is calculated according to the corresponding rounding mode. + // The remainder (r) is calculated as: r = a - n * q. + // + // UP 0 The remainder is positive if the dividend is negative, else is negative. + // DOWN 1 The remainder has the same sign as the dividend. + // This modulo mode is commonly known as 'truncated division' and is + // equivalent to (a % n) in JavaScript. + // FLOOR 3 The remainder has the same sign as the divisor (Python %). + // HALF_EVEN 6 This modulo mode implements the IEEE 754 remainder function. + // EUCLID 9 Euclidian division. q = sign(n) * floor(a / abs(n)). + // The remainder is always positive. + // + // The truncated division, floored division, Euclidian division and IEEE 754 remainder + // modes are commonly used for the modulus operation. + // Although the other rounding modes can also be used, they may not give useful results. + MODULO_MODE = 1, // 0 to 9 + + // The maximum number of significant digits of the result of the exponentiatedBy operation. + // If POW_PRECISION is 0, there will be unlimited significant digits. + POW_PRECISION = 0, // 0 to MAX + + // The format specification used by the BigNumber.prototype.toFormat method. + FORMAT = { + prefix: '', + groupSize: 3, + secondaryGroupSize: 0, + groupSeparator: ',', + decimalSeparator: '.', + fractionGroupSize: 0, + fractionGroupSeparator: '\xA0', // non-breaking space + suffix: '' + }, + + // The alphabet used for base conversion. It must be at least 2 characters long, with no '+', + // '-', '.', whitespace, or repeated character. + // '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_' + ALPHABET = '0123456789abcdefghijklmnopqrstuvwxyz'; + + + //------------------------------------------------------------------------------------------ + + + // CONSTRUCTOR + + + /* + * The BigNumber constructor and exported function. + * Create and return a new instance of a BigNumber object. + * + * v {number|string|BigNumber} A numeric value. + * [b] {number} The base of v. Integer, 2 to ALPHABET.length inclusive. + */ + function BigNumber(v, b) { + var alphabet, c, caseChanged, e, i, isNum, len, str, + x = this; + + // Enable constructor call without `new`. + if (!(x instanceof BigNumber)) return new BigNumber(v, b); + + if (b == null) { + + if (v && v._isBigNumber === true) { + x.s = v.s; + + if (!v.c || v.e > MAX_EXP) { + x.c = x.e = null; + } else if (v.e < MIN_EXP) { + x.c = [x.e = 0]; + } else { + x.e = v.e; + x.c = v.c.slice(); + } + + return; + } + + if ((isNum = typeof v == 'number') && v * 0 == 0) { + + // Use `1 / n` to handle minus zero also. + x.s = 1 / v < 0 ? (v = -v, -1) : 1; + + // Fast path for integers, where n < 2147483648 (2**31). + if (v === ~~v) { + for (e = 0, i = v; i >= 10; i /= 10, e++); + + if (e > MAX_EXP) { + x.c = x.e = null; + } else { + x.e = e; + x.c = [v]; + } + + return; + } + + str = String(v); + } else { + + if (!isNumeric.test(str = String(v))) return parseNumeric(x, str, isNum); + + x.s = str.charCodeAt(0) == 45 ? (str = str.slice(1), -1) : 1; + } + + // Decimal point? + if ((e = str.indexOf('.')) > -1) str = str.replace('.', ''); + + // Exponential form? + if ((i = str.search(/e/i)) > 0) { + + // Determine exponent. + if (e < 0) e = i; + e += +str.slice(i + 1); + str = str.substring(0, i); + } else if (e < 0) { + + // Integer. + e = str.length; + } + + } else { + + // '[BigNumber Error] Base {not a primitive number|not an integer|out of range}: {b}' + intCheck(b, 2, ALPHABET.length, 'Base'); + + // Allow exponential notation to be used with base 10 argument, while + // also rounding to DECIMAL_PLACES as with other bases. + if (b == 10) { + x = new BigNumber(v); + return round(x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE); + } + + str = String(v); + + if (isNum = typeof v == 'number') { + + // Avoid potential interpretation of Infinity and NaN as base 44+ values. + if (v * 0 != 0) return parseNumeric(x, str, isNum, b); + + x.s = 1 / v < 0 ? (str = str.slice(1), -1) : 1; + + // '[BigNumber Error] Number primitive has more than 15 significant digits: {n}' + if (BigNumber.DEBUG && str.replace(/^0\.0*|\./, '').length > 15) { + throw Error + (tooManyDigits + v); + } + } else { + x.s = str.charCodeAt(0) === 45 ? (str = str.slice(1), -1) : 1; + } + + alphabet = ALPHABET.slice(0, b); + e = i = 0; + + // Check that str is a valid base b number. + // Don't use RegExp, so alphabet can contain special characters. + for (len = str.length; i < len; i++) { + if (alphabet.indexOf(c = str.charAt(i)) < 0) { + if (c == '.') { + + // If '.' is not the first character and it has not be found before. + if (i > e) { + e = len; + continue; + } + } else if (!caseChanged) { + + // Allow e.g. hexadecimal 'FF' as well as 'ff'. + if (str == str.toUpperCase() && (str = str.toLowerCase()) || + str == str.toLowerCase() && (str = str.toUpperCase())) { + caseChanged = true; + i = -1; + e = 0; + continue; + } + } + + return parseNumeric(x, String(v), isNum, b); + } + } + + // Prevent later check for length on converted number. + isNum = false; + str = convertBase(str, b, 10, x.s); + + // Decimal point? + if ((e = str.indexOf('.')) > -1) str = str.replace('.', ''); + else e = str.length; + } + + // Determine leading zeros. + for (i = 0; str.charCodeAt(i) === 48; i++); + + // Determine trailing zeros. + for (len = str.length; str.charCodeAt(--len) === 48;); + + if (str = str.slice(i, ++len)) { + len -= i; + + // '[BigNumber Error] Number primitive has more than 15 significant digits: {n}' + if (isNum && BigNumber.DEBUG && + len > 15 && (v > MAX_SAFE_INTEGER || v !== mathfloor(v))) { + throw Error + (tooManyDigits + (x.s * v)); + } + + // Overflow? + if ((e = e - i - 1) > MAX_EXP) { + + // Infinity. + x.c = x.e = null; + + // Underflow? + } else if (e < MIN_EXP) { + + // Zero. + x.c = [x.e = 0]; + } else { + x.e = e; + x.c = []; + + // Transform base + + // e is the base 10 exponent. + // i is where to slice str to get the first element of the coefficient array. + i = (e + 1) % LOG_BASE; + if (e < 0) i += LOG_BASE; // i < 1 + + if (i < len) { + if (i) x.c.push(+str.slice(0, i)); + + for (len -= LOG_BASE; i < len;) { + x.c.push(+str.slice(i, i += LOG_BASE)); + } + + i = LOG_BASE - (str = str.slice(i)).length; + } else { + i -= len; + } + + for (; i--; str += '0'); + x.c.push(+str); + } + } else { + + // Zero. + x.c = [x.e = 0]; + } + } + + + // CONSTRUCTOR PROPERTIES + + + BigNumber.clone = clone; + + BigNumber.ROUND_UP = 0; + BigNumber.ROUND_DOWN = 1; + BigNumber.ROUND_CEIL = 2; + BigNumber.ROUND_FLOOR = 3; + BigNumber.ROUND_HALF_UP = 4; + BigNumber.ROUND_HALF_DOWN = 5; + BigNumber.ROUND_HALF_EVEN = 6; + BigNumber.ROUND_HALF_CEIL = 7; + BigNumber.ROUND_HALF_FLOOR = 8; + BigNumber.EUCLID = 9; + + + /* + * Configure infrequently-changing library-wide settings. + * + * Accept an object with the following optional properties (if the value of a property is + * a number, it must be an integer within the inclusive range stated): + * + * DECIMAL_PLACES {number} 0 to MAX + * ROUNDING_MODE {number} 0 to 8 + * EXPONENTIAL_AT {number|number[]} -MAX to MAX or [-MAX to 0, 0 to MAX] + * RANGE {number|number[]} -MAX to MAX (not zero) or [-MAX to -1, 1 to MAX] + * CRYPTO {boolean} true or false + * MODULO_MODE {number} 0 to 9 + * POW_PRECISION {number} 0 to MAX + * ALPHABET {string} A string of two or more unique characters which does + * not contain '.'. + * FORMAT {object} An object with some of the following properties: + * prefix {string} + * groupSize {number} + * secondaryGroupSize {number} + * groupSeparator {string} + * decimalSeparator {string} + * fractionGroupSize {number} + * fractionGroupSeparator {string} + * suffix {string} + * + * (The values assigned to the above FORMAT object properties are not checked for validity.) + * + * E.g. + * BigNumber.config({ DECIMAL_PLACES : 20, ROUNDING_MODE : 4 }) + * + * Ignore properties/parameters set to null or undefined, except for ALPHABET. + * + * Return an object with the properties current values. + */ + BigNumber.config = BigNumber.set = function (obj) { + var p, v; + + if (obj != null) { + + if (typeof obj == 'object') { + + // DECIMAL_PLACES {number} Integer, 0 to MAX inclusive. + // '[BigNumber Error] DECIMAL_PLACES {not a primitive number|not an integer|out of range}: {v}' + if (obj.hasOwnProperty(p = 'DECIMAL_PLACES')) { + v = obj[p]; + intCheck(v, 0, MAX, p); + DECIMAL_PLACES = v; + } + + // ROUNDING_MODE {number} Integer, 0 to 8 inclusive. + // '[BigNumber Error] ROUNDING_MODE {not a primitive number|not an integer|out of range}: {v}' + if (obj.hasOwnProperty(p = 'ROUNDING_MODE')) { + v = obj[p]; + intCheck(v, 0, 8, p); + ROUNDING_MODE = v; + } + + // EXPONENTIAL_AT {number|number[]} + // Integer, -MAX to MAX inclusive or + // [integer -MAX to 0 inclusive, 0 to MAX inclusive]. + // '[BigNumber Error] EXPONENTIAL_AT {not a primitive number|not an integer|out of range}: {v}' + if (obj.hasOwnProperty(p = 'EXPONENTIAL_AT')) { + v = obj[p]; + if (v && v.pop) { + intCheck(v[0], -MAX, 0, p); + intCheck(v[1], 0, MAX, p); + TO_EXP_NEG = v[0]; + TO_EXP_POS = v[1]; + } else { + intCheck(v, -MAX, MAX, p); + TO_EXP_NEG = -(TO_EXP_POS = v < 0 ? -v : v); + } + } + + // RANGE {number|number[]} Non-zero integer, -MAX to MAX inclusive or + // [integer -MAX to -1 inclusive, integer 1 to MAX inclusive]. + // '[BigNumber Error] RANGE {not a primitive number|not an integer|out of range|cannot be zero}: {v}' + if (obj.hasOwnProperty(p = 'RANGE')) { + v = obj[p]; + if (v && v.pop) { + intCheck(v[0], -MAX, -1, p); + intCheck(v[1], 1, MAX, p); + MIN_EXP = v[0]; + MAX_EXP = v[1]; + } else { + intCheck(v, -MAX, MAX, p); + if (v) { + MIN_EXP = -(MAX_EXP = v < 0 ? -v : v); + } else { + throw Error + (bignumberError + p + ' cannot be zero: ' + v); + } + } + } + + // CRYPTO {boolean} true or false. + // '[BigNumber Error] CRYPTO not true or false: {v}' + // '[BigNumber Error] crypto unavailable' + if (obj.hasOwnProperty(p = 'CRYPTO')) { + v = obj[p]; + if (v === !!v) { + if (v) { + if (typeof crypto != 'undefined' && crypto && + (crypto.getRandomValues || crypto.randomBytes)) { + CRYPTO = v; + } else { + CRYPTO = !v; + throw Error + (bignumberError + 'crypto unavailable'); + } + } else { + CRYPTO = v; + } + } else { + throw Error + (bignumberError + p + ' not true or false: ' + v); + } + } + + // MODULO_MODE {number} Integer, 0 to 9 inclusive. + // '[BigNumber Error] MODULO_MODE {not a primitive number|not an integer|out of range}: {v}' + if (obj.hasOwnProperty(p = 'MODULO_MODE')) { + v = obj[p]; + intCheck(v, 0, 9, p); + MODULO_MODE = v; + } + + // POW_PRECISION {number} Integer, 0 to MAX inclusive. + // '[BigNumber Error] POW_PRECISION {not a primitive number|not an integer|out of range}: {v}' + if (obj.hasOwnProperty(p = 'POW_PRECISION')) { + v = obj[p]; + intCheck(v, 0, MAX, p); + POW_PRECISION = v; + } + + // FORMAT {object} + // '[BigNumber Error] FORMAT not an object: {v}' + if (obj.hasOwnProperty(p = 'FORMAT')) { + v = obj[p]; + if (typeof v == 'object') FORMAT = v; + else throw Error + (bignumberError + p + ' not an object: ' + v); + } + + // ALPHABET {string} + // '[BigNumber Error] ALPHABET invalid: {v}' + if (obj.hasOwnProperty(p = 'ALPHABET')) { + v = obj[p]; + + // Disallow if only one character, + // or if it contains '+', '-', '.', whitespace, or a repeated character. + if (typeof v == 'string' && !/^.$|[+-.\s]|(.).*\1/.test(v)) { + ALPHABET = v; + } else { + throw Error + (bignumberError + p + ' invalid: ' + v); + } + } + + } else { + + // '[BigNumber Error] Object expected: {v}' + throw Error + (bignumberError + 'Object expected: ' + obj); + } + } + + return { + DECIMAL_PLACES: DECIMAL_PLACES, + ROUNDING_MODE: ROUNDING_MODE, + EXPONENTIAL_AT: [TO_EXP_NEG, TO_EXP_POS], + RANGE: [MIN_EXP, MAX_EXP], + CRYPTO: CRYPTO, + MODULO_MODE: MODULO_MODE, + POW_PRECISION: POW_PRECISION, + FORMAT: FORMAT, + ALPHABET: ALPHABET + }; + }; + + + /* + * Return true if v is a BigNumber instance, otherwise return false. + * + * If BigNumber.DEBUG is true, throw if a BigNumber instance is not well-formed. + * + * v {any} + * + * '[BigNumber Error] Invalid BigNumber: {v}' + */ + BigNumber.isBigNumber = function (v) { + if (!v || v._isBigNumber !== true) return false; + if (!BigNumber.DEBUG) return true; + + var i, n, + c = v.c, + e = v.e, + s = v.s; + + out: if ({}.toString.call(c) == '[object Array]') { + + if ((s === 1 || s === -1) && e >= -MAX && e <= MAX && e === mathfloor(e)) { + + // If the first element is zero, the BigNumber value must be zero. + if (c[0] === 0) { + if (e === 0 && c.length === 1) return true; + break out; + } + + // Calculate number of digits that c[0] should have, based on the exponent. + i = (e + 1) % LOG_BASE; + if (i < 1) i += LOG_BASE; + + // Calculate number of digits of c[0]. + //if (Math.ceil(Math.log(c[0] + 1) / Math.LN10) == i) { + if (String(c[0]).length == i) { + + for (i = 0; i < c.length; i++) { + n = c[i]; + if (n < 0 || n >= BASE || n !== mathfloor(n)) break out; + } + + // Last element cannot be zero, unless it is the only element. + if (n !== 0) return true; + } + } + + // Infinity/NaN + } else if (c === null && e === null && (s === null || s === 1 || s === -1)) { + return true; + } + + throw Error + (bignumberError + 'Invalid BigNumber: ' + v); + }; + + + /* + * Return a new BigNumber whose value is the maximum of the arguments. + * + * arguments {number|string|BigNumber} + */ + BigNumber.maximum = BigNumber.max = function () { + return maxOrMin(arguments, P.lt); + }; + + + /* + * Return a new BigNumber whose value is the minimum of the arguments. + * + * arguments {number|string|BigNumber} + */ + BigNumber.minimum = BigNumber.min = function () { + return maxOrMin(arguments, P.gt); + }; + + + /* + * Return a new BigNumber with a random value equal to or greater than 0 and less than 1, + * and with dp, or DECIMAL_PLACES if dp is omitted, decimal places (or less if trailing + * zeros are produced). + * + * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp}' + * '[BigNumber Error] crypto unavailable' + */ + BigNumber.random = (function () { + var pow2_53 = 0x20000000000000; + + // Return a 53 bit integer n, where 0 <= n < 9007199254740992. + // Check if Math.random() produces more than 32 bits of randomness. + // If it does, assume at least 53 bits are produced, otherwise assume at least 30 bits. + // 0x40000000 is 2^30, 0x800000 is 2^23, 0x1fffff is 2^21 - 1. + var random53bitInt = (Math.random() * pow2_53) & 0x1fffff + ? function () { return mathfloor(Math.random() * pow2_53); } + : function () { return ((Math.random() * 0x40000000 | 0) * 0x800000) + + (Math.random() * 0x800000 | 0); }; + + return function (dp) { + var a, b, e, k, v, + i = 0, + c = [], + rand = new BigNumber(ONE); + + if (dp == null) dp = DECIMAL_PLACES; + else intCheck(dp, 0, MAX); + + k = mathceil(dp / LOG_BASE); + + if (CRYPTO) { + + // Browsers supporting crypto.getRandomValues. + if (crypto.getRandomValues) { + + a = crypto.getRandomValues(new Uint32Array(k *= 2)); + + for (; i < k;) { + + // 53 bits: + // ((Math.pow(2, 32) - 1) * Math.pow(2, 21)).toString(2) + // 11111 11111111 11111111 11111111 11100000 00000000 00000000 + // ((Math.pow(2, 32) - 1) >>> 11).toString(2) + // 11111 11111111 11111111 + // 0x20000 is 2^21. + v = a[i] * 0x20000 + (a[i + 1] >>> 11); + + // Rejection sampling: + // 0 <= v < 9007199254740992 + // Probability that v >= 9e15, is + // 7199254740992 / 9007199254740992 ~= 0.0008, i.e. 1 in 1251 + if (v >= 9e15) { + b = crypto.getRandomValues(new Uint32Array(2)); + a[i] = b[0]; + a[i + 1] = b[1]; + } else { + + // 0 <= v <= 8999999999999999 + // 0 <= (v % 1e14) <= 99999999999999 + c.push(v % 1e14); + i += 2; + } + } + i = k / 2; + + // Node.js supporting crypto.randomBytes. + } else if (crypto.randomBytes) { + + // buffer + a = crypto.randomBytes(k *= 7); + + for (; i < k;) { + + // 0x1000000000000 is 2^48, 0x10000000000 is 2^40 + // 0x100000000 is 2^32, 0x1000000 is 2^24 + // 11111 11111111 11111111 11111111 11111111 11111111 11111111 + // 0 <= v < 9007199254740992 + v = ((a[i] & 31) * 0x1000000000000) + (a[i + 1] * 0x10000000000) + + (a[i + 2] * 0x100000000) + (a[i + 3] * 0x1000000) + + (a[i + 4] << 16) + (a[i + 5] << 8) + a[i + 6]; + + if (v >= 9e15) { + crypto.randomBytes(7).copy(a, i); + } else { + + // 0 <= (v % 1e14) <= 99999999999999 + c.push(v % 1e14); + i += 7; + } + } + i = k / 7; + } else { + CRYPTO = false; + throw Error + (bignumberError + 'crypto unavailable'); + } + } + + // Use Math.random. + if (!CRYPTO) { + + for (; i < k;) { + v = random53bitInt(); + if (v < 9e15) c[i++] = v % 1e14; + } + } + + k = c[--i]; + dp %= LOG_BASE; + + // Convert trailing digits to zeros according to dp. + if (k && dp) { + v = POWS_TEN[LOG_BASE - dp]; + c[i] = mathfloor(k / v) * v; + } + + // Remove trailing elements which are zero. + for (; c[i] === 0; c.pop(), i--); + + // Zero? + if (i < 0) { + c = [e = 0]; + } else { + + // Remove leading elements which are zero and adjust exponent accordingly. + for (e = -1 ; c[0] === 0; c.splice(0, 1), e -= LOG_BASE); + + // Count the digits of the first element of c to determine leading zeros, and... + for (i = 1, v = c[0]; v >= 10; v /= 10, i++); + + // adjust the exponent accordingly. + if (i < LOG_BASE) e -= LOG_BASE - i; + } + + rand.e = e; + rand.c = c; + return rand; + }; + })(); + + + /* + * Return a BigNumber whose value is the sum of the arguments. + * + * arguments {number|string|BigNumber} + */ + BigNumber.sum = function () { + var i = 1, + args = arguments, + sum = new BigNumber(args[0]); + for (; i < args.length;) sum = sum.plus(args[i++]); + return sum; + }; + + + // PRIVATE FUNCTIONS + + + // Called by BigNumber and BigNumber.prototype.toString. + convertBase = (function () { + var decimal = '0123456789'; + + /* + * Convert string of baseIn to an array of numbers of baseOut. + * Eg. toBaseOut('255', 10, 16) returns [15, 15]. + * Eg. toBaseOut('ff', 16, 10) returns [2, 5, 5]. + */ + function toBaseOut(str, baseIn, baseOut, alphabet) { + var j, + arr = [0], + arrL, + i = 0, + len = str.length; + + for (; i < len;) { + for (arrL = arr.length; arrL--; arr[arrL] *= baseIn); + + arr[0] += alphabet.indexOf(str.charAt(i++)); + + for (j = 0; j < arr.length; j++) { + + if (arr[j] > baseOut - 1) { + if (arr[j + 1] == null) arr[j + 1] = 0; + arr[j + 1] += arr[j] / baseOut | 0; + arr[j] %= baseOut; + } + } + } + + return arr.reverse(); + } + + // Convert a numeric string of baseIn to a numeric string of baseOut. + // If the caller is toString, we are converting from base 10 to baseOut. + // If the caller is BigNumber, we are converting from baseIn to base 10. + return function (str, baseIn, baseOut, sign, callerIsToString) { + var alphabet, d, e, k, r, x, xc, y, + i = str.indexOf('.'), + dp = DECIMAL_PLACES, + rm = ROUNDING_MODE; + + // Non-integer. + if (i >= 0) { + k = POW_PRECISION; + + // Unlimited precision. + POW_PRECISION = 0; + str = str.replace('.', ''); + y = new BigNumber(baseIn); + x = y.pow(str.length - i); + POW_PRECISION = k; + + // Convert str as if an integer, then restore the fraction part by dividing the + // result by its base raised to a power. + + y.c = toBaseOut(toFixedPoint(coeffToString(x.c), x.e, '0'), + 10, baseOut, decimal); + y.e = y.c.length; + } + + // Convert the number as integer. + + xc = toBaseOut(str, baseIn, baseOut, callerIsToString + ? (alphabet = ALPHABET, decimal) + : (alphabet = decimal, ALPHABET)); + + // xc now represents str as an integer and converted to baseOut. e is the exponent. + e = k = xc.length; + + // Remove trailing zeros. + for (; xc[--k] == 0; xc.pop()); + + // Zero? + if (!xc[0]) return alphabet.charAt(0); + + // Does str represent an integer? If so, no need for the division. + if (i < 0) { + --e; + } else { + x.c = xc; + x.e = e; + + // The sign is needed for correct rounding. + x.s = sign; + x = div(x, y, dp, rm, baseOut); + xc = x.c; + r = x.r; + e = x.e; + } + + // xc now represents str converted to baseOut. + + // THe index of the rounding digit. + d = e + dp + 1; + + // The rounding digit: the digit to the right of the digit that may be rounded up. + i = xc[d]; + + // Look at the rounding digits and mode to determine whether to round up. + + k = baseOut / 2; + r = r || d < 0 || xc[d + 1] != null; + + r = rm < 4 ? (i != null || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) + : i > k || i == k &&(rm == 4 || r || rm == 6 && xc[d - 1] & 1 || + rm == (x.s < 0 ? 8 : 7)); + + // If the index of the rounding digit is not greater than zero, or xc represents + // zero, then the result of the base conversion is zero or, if rounding up, a value + // such as 0.00001. + if (d < 1 || !xc[0]) { + + // 1^-dp or 0 + str = r ? toFixedPoint(alphabet.charAt(1), -dp, alphabet.charAt(0)) : alphabet.charAt(0); + } else { + + // Truncate xc to the required number of decimal places. + xc.length = d; + + // Round up? + if (r) { + + // Rounding up may mean the previous digit has to be rounded up and so on. + for (--baseOut; ++xc[--d] > baseOut;) { + xc[d] = 0; + + if (!d) { + ++e; + xc = [1].concat(xc); + } + } + } + + // Determine trailing zeros. + for (k = xc.length; !xc[--k];); + + // E.g. [4, 11, 15] becomes 4bf. + for (i = 0, str = ''; i <= k; str += alphabet.charAt(xc[i++])); + + // Add leading zeros, decimal point and trailing zeros as required. + str = toFixedPoint(str, e, alphabet.charAt(0)); + } + + // The caller will add the sign. + return str; + }; + })(); + + + // Perform division in the specified base. Called by div and convertBase. + div = (function () { + + // Assume non-zero x and k. + function multiply(x, k, base) { + var m, temp, xlo, xhi, + carry = 0, + i = x.length, + klo = k % SQRT_BASE, + khi = k / SQRT_BASE | 0; + + for (x = x.slice(); i--;) { + xlo = x[i] % SQRT_BASE; + xhi = x[i] / SQRT_BASE | 0; + m = khi * xlo + xhi * klo; + temp = klo * xlo + ((m % SQRT_BASE) * SQRT_BASE) + carry; + carry = (temp / base | 0) + (m / SQRT_BASE | 0) + khi * xhi; + x[i] = temp % base; + } + + if (carry) x = [carry].concat(x); + + return x; + } + + function compare(a, b, aL, bL) { + var i, cmp; + + if (aL != bL) { + cmp = aL > bL ? 1 : -1; + } else { + + for (i = cmp = 0; i < aL; i++) { + + if (a[i] != b[i]) { + cmp = a[i] > b[i] ? 1 : -1; + break; + } + } + } + + return cmp; + } + + function subtract(a, b, aL, base) { + var i = 0; + + // Subtract b from a. + for (; aL--;) { + a[aL] -= i; + i = a[aL] < b[aL] ? 1 : 0; + a[aL] = i * base + a[aL] - b[aL]; + } + + // Remove leading zeros. + for (; !a[0] && a.length > 1; a.splice(0, 1)); + } + + // x: dividend, y: divisor. + return function (x, y, dp, rm, base) { + var cmp, e, i, more, n, prod, prodL, q, qc, rem, remL, rem0, xi, xL, yc0, + yL, yz, + s = x.s == y.s ? 1 : -1, + xc = x.c, + yc = y.c; + + // Either NaN, Infinity or 0? + if (!xc || !xc[0] || !yc || !yc[0]) { + + return new BigNumber( + + // Return NaN if either NaN, or both Infinity or 0. + !x.s || !y.s || (xc ? yc && xc[0] == yc[0] : !yc) ? NaN : + + // Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0. + xc && xc[0] == 0 || !yc ? s * 0 : s / 0 + ); + } + + q = new BigNumber(s); + qc = q.c = []; + e = x.e - y.e; + s = dp + e + 1; + + if (!base) { + base = BASE; + e = bitFloor(x.e / LOG_BASE) - bitFloor(y.e / LOG_BASE); + s = s / LOG_BASE | 0; + } + + // Result exponent may be one less then the current value of e. + // The coefficients of the BigNumbers from convertBase may have trailing zeros. + for (i = 0; yc[i] == (xc[i] || 0); i++); + + if (yc[i] > (xc[i] || 0)) e--; + + if (s < 0) { + qc.push(1); + more = true; + } else { + xL = xc.length; + yL = yc.length; + i = 0; + s += 2; + + // Normalise xc and yc so highest order digit of yc is >= base / 2. + + n = mathfloor(base / (yc[0] + 1)); + + // Not necessary, but to handle odd bases where yc[0] == (base / 2) - 1. + // if (n > 1 || n++ == 1 && yc[0] < base / 2) { + if (n > 1) { + yc = multiply(yc, n, base); + xc = multiply(xc, n, base); + yL = yc.length; + xL = xc.length; + } + + xi = yL; + rem = xc.slice(0, yL); + remL = rem.length; + + // Add zeros to make remainder as long as divisor. + for (; remL < yL; rem[remL++] = 0); + yz = yc.slice(); + yz = [0].concat(yz); + yc0 = yc[0]; + if (yc[1] >= base / 2) yc0++; + // Not necessary, but to prevent trial digit n > base, when using base 3. + // else if (base == 3 && yc0 == 1) yc0 = 1 + 1e-15; + + do { + n = 0; + + // Compare divisor and remainder. + cmp = compare(yc, rem, yL, remL); + + // If divisor < remainder. + if (cmp < 0) { + + // Calculate trial digit, n. + + rem0 = rem[0]; + if (yL != remL) rem0 = rem0 * base + (rem[1] || 0); + + // n is how many times the divisor goes into the current remainder. + n = mathfloor(rem0 / yc0); + + // Algorithm: + // product = divisor multiplied by trial digit (n). + // Compare product and remainder. + // If product is greater than remainder: + // Subtract divisor from product, decrement trial digit. + // Subtract product from remainder. + // If product was less than remainder at the last compare: + // Compare new remainder and divisor. + // If remainder is greater than divisor: + // Subtract divisor from remainder, increment trial digit. + + if (n > 1) { + + // n may be > base only when base is 3. + if (n >= base) n = base - 1; + + // product = divisor * trial digit. + prod = multiply(yc, n, base); + prodL = prod.length; + remL = rem.length; + + // Compare product and remainder. + // If product > remainder then trial digit n too high. + // n is 1 too high about 5% of the time, and is not known to have + // ever been more than 1 too high. + while (compare(prod, rem, prodL, remL) == 1) { + n--; + + // Subtract divisor from product. + subtract(prod, yL < prodL ? yz : yc, prodL, base); + prodL = prod.length; + cmp = 1; + } + } else { + + // n is 0 or 1, cmp is -1. + // If n is 0, there is no need to compare yc and rem again below, + // so change cmp to 1 to avoid it. + // If n is 1, leave cmp as -1, so yc and rem are compared again. + if (n == 0) { + + // divisor < remainder, so n must be at least 1. + cmp = n = 1; + } + + // product = divisor + prod = yc.slice(); + prodL = prod.length; + } + + if (prodL < remL) prod = [0].concat(prod); + + // Subtract product from remainder. + subtract(rem, prod, remL, base); + remL = rem.length; + + // If product was < remainder. + if (cmp == -1) { + + // Compare divisor and new remainder. + // If divisor < new remainder, subtract divisor from remainder. + // Trial digit n too low. + // n is 1 too low about 5% of the time, and very rarely 2 too low. + while (compare(yc, rem, yL, remL) < 1) { + n++; + + // Subtract divisor from remainder. + subtract(rem, yL < remL ? yz : yc, remL, base); + remL = rem.length; + } + } + } else if (cmp === 0) { + n++; + rem = [0]; + } // else cmp === 1 and n will be 0 + + // Add the next digit, n, to the result array. + qc[i++] = n; + + // Update the remainder. + if (rem[0]) { + rem[remL++] = xc[xi] || 0; + } else { + rem = [xc[xi]]; + remL = 1; + } + } while ((xi++ < xL || rem[0] != null) && s--); + + more = rem[0] != null; + + // Leading zero? + if (!qc[0]) qc.splice(0, 1); + } + + if (base == BASE) { + + // To calculate q.e, first get the number of digits of qc[0]. + for (i = 1, s = qc[0]; s >= 10; s /= 10, i++); + + round(q, dp + (q.e = i + e * LOG_BASE - 1) + 1, rm, more); + + // Caller is convertBase. + } else { + q.e = e; + q.r = +more; + } + + return q; + }; + })(); + + + /* + * Return a string representing the value of BigNumber n in fixed-point or exponential + * notation rounded to the specified decimal places or significant digits. + * + * n: a BigNumber. + * i: the index of the last digit required (i.e. the digit that may be rounded up). + * rm: the rounding mode. + * id: 1 (toExponential) or 2 (toPrecision). + */ + function format(n, i, rm, id) { + var c0, e, ne, len, str; + + if (rm == null) rm = ROUNDING_MODE; + else intCheck(rm, 0, 8); + + if (!n.c) return n.toString(); + + c0 = n.c[0]; + ne = n.e; + + if (i == null) { + str = coeffToString(n.c); + str = id == 1 || id == 2 && (ne <= TO_EXP_NEG || ne >= TO_EXP_POS) + ? toExponential(str, ne) + : toFixedPoint(str, ne, '0'); + } else { + n = round(new BigNumber(n), i, rm); + + // n.e may have changed if the value was rounded up. + e = n.e; + + str = coeffToString(n.c); + len = str.length; + + // toPrecision returns exponential notation if the number of significant digits + // specified is less than the number of digits necessary to represent the integer + // part of the value in fixed-point notation. + + // Exponential notation. + if (id == 1 || id == 2 && (i <= e || e <= TO_EXP_NEG)) { + + // Append zeros? + for (; len < i; str += '0', len++); + str = toExponential(str, e); + + // Fixed-point notation. + } else { + i -= ne; + str = toFixedPoint(str, e, '0'); + + // Append zeros? + if (e + 1 > len) { + if (--i > 0) for (str += '.'; i--; str += '0'); + } else { + i += e - len; + if (i > 0) { + if (e + 1 == len) str += '.'; + for (; i--; str += '0'); + } + } + } + } + + return n.s < 0 && c0 ? '-' + str : str; + } + + + // Handle BigNumber.max and BigNumber.min. + function maxOrMin(args, method) { + var n, + i = 1, + m = new BigNumber(args[0]); + + for (; i < args.length; i++) { + n = new BigNumber(args[i]); + + // If any number is NaN, return NaN. + if (!n.s) { + m = n; + break; + } else if (method.call(m, n)) { + m = n; + } + } + + return m; + } + + + /* + * Strip trailing zeros, calculate base 10 exponent and check against MIN_EXP and MAX_EXP. + * Called by minus, plus and times. + */ + function normalise(n, c, e) { + var i = 1, + j = c.length; + + // Remove trailing zeros. + for (; !c[--j]; c.pop()); + + // Calculate the base 10 exponent. First get the number of digits of c[0]. + for (j = c[0]; j >= 10; j /= 10, i++); + + // Overflow? + if ((e = i + e * LOG_BASE - 1) > MAX_EXP) { + + // Infinity. + n.c = n.e = null; + + // Underflow? + } else if (e < MIN_EXP) { + + // Zero. + n.c = [n.e = 0]; + } else { + n.e = e; + n.c = c; + } + + return n; + } + + + // Handle values that fail the validity test in BigNumber. + parseNumeric = (function () { + var basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i, + dotAfter = /^([^.]+)\.$/, + dotBefore = /^\.([^.]+)$/, + isInfinityOrNaN = /^-?(Infinity|NaN)$/, + whitespaceOrPlus = /^\s*\+(?=[\w.])|^\s+|\s+$/g; + + return function (x, str, isNum, b) { + var base, + s = isNum ? str : str.replace(whitespaceOrPlus, ''); + + // No exception on ±Infinity or NaN. + if (isInfinityOrNaN.test(s)) { + x.s = isNaN(s) ? null : s < 0 ? -1 : 1; + } else { + if (!isNum) { + + // basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i + s = s.replace(basePrefix, function (m, p1, p2) { + base = (p2 = p2.toLowerCase()) == 'x' ? 16 : p2 == 'b' ? 2 : 8; + return !b || b == base ? p1 : m; + }); + + if (b) { + base = b; + + // E.g. '1.' to '1', '.1' to '0.1' + s = s.replace(dotAfter, '$1').replace(dotBefore, '0.$1'); + } + + if (str != s) return new BigNumber(s, base); + } + + // '[BigNumber Error] Not a number: {n}' + // '[BigNumber Error] Not a base {b} number: {n}' + if (BigNumber.DEBUG) { + throw Error + (bignumberError + 'Not a' + (b ? ' base ' + b : '') + ' number: ' + str); + } + + // NaN + x.s = null; + } + + x.c = x.e = null; + } + })(); + + + /* + * Round x to sd significant digits using rounding mode rm. Check for over/under-flow. + * If r is truthy, it is known that there are more digits after the rounding digit. + */ + function round(x, sd, rm, r) { + var d, i, j, k, n, ni, rd, + xc = x.c, + pows10 = POWS_TEN; + + // if x is not Infinity or NaN... + if (xc) { + + // rd is the rounding digit, i.e. the digit after the digit that may be rounded up. + // n is a base 1e14 number, the value of the element of array x.c containing rd. + // ni is the index of n within x.c. + // d is the number of digits of n. + // i is the index of rd within n including leading zeros. + // j is the actual index of rd within n (if < 0, rd is a leading zero). + out: { + + // Get the number of digits of the first element of xc. + for (d = 1, k = xc[0]; k >= 10; k /= 10, d++); + i = sd - d; + + // If the rounding digit is in the first element of xc... + if (i < 0) { + i += LOG_BASE; + j = sd; + n = xc[ni = 0]; + + // Get the rounding digit at index j of n. + rd = n / pows10[d - j - 1] % 10 | 0; + } else { + ni = mathceil((i + 1) / LOG_BASE); + + if (ni >= xc.length) { + + if (r) { + + // Needed by sqrt. + for (; xc.length <= ni; xc.push(0)); + n = rd = 0; + d = 1; + i %= LOG_BASE; + j = i - LOG_BASE + 1; + } else { + break out; + } + } else { + n = k = xc[ni]; + + // Get the number of digits of n. + for (d = 1; k >= 10; k /= 10, d++); + + // Get the index of rd within n. + i %= LOG_BASE; + + // Get the index of rd within n, adjusted for leading zeros. + // The number of leading zeros of n is given by LOG_BASE - d. + j = i - LOG_BASE + d; + + // Get the rounding digit at index j of n. + rd = j < 0 ? 0 : n / pows10[d - j - 1] % 10 | 0; + } + } + + r = r || sd < 0 || + + // Are there any non-zero digits after the rounding digit? + // The expression n % pows10[d - j - 1] returns all digits of n to the right + // of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714. + xc[ni + 1] != null || (j < 0 ? n : n % pows10[d - j - 1]); + + r = rm < 4 + ? (rd || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) + : rd > 5 || rd == 5 && (rm == 4 || r || rm == 6 && + + // Check whether the digit to the left of the rounding digit is odd. + ((i > 0 ? j > 0 ? n / pows10[d - j] : 0 : xc[ni - 1]) % 10) & 1 || + rm == (x.s < 0 ? 8 : 7)); + + if (sd < 1 || !xc[0]) { + xc.length = 0; + + if (r) { + + // Convert sd to decimal places. + sd -= x.e + 1; + + // 1, 0.1, 0.01, 0.001, 0.0001 etc. + xc[0] = pows10[(LOG_BASE - sd % LOG_BASE) % LOG_BASE]; + x.e = -sd || 0; + } else { + + // Zero. + xc[0] = x.e = 0; + } + + return x; + } + + // Remove excess digits. + if (i == 0) { + xc.length = ni; + k = 1; + ni--; + } else { + xc.length = ni + 1; + k = pows10[LOG_BASE - i]; + + // E.g. 56700 becomes 56000 if 7 is the rounding digit. + // j > 0 means i > number of leading zeros of n. + xc[ni] = j > 0 ? mathfloor(n / pows10[d - j] % pows10[j]) * k : 0; + } + + // Round up? + if (r) { + + for (; ;) { + + // If the digit to be rounded up is in the first element of xc... + if (ni == 0) { + + // i will be the length of xc[0] before k is added. + for (i = 1, j = xc[0]; j >= 10; j /= 10, i++); + j = xc[0] += k; + for (k = 1; j >= 10; j /= 10, k++); + + // if i != k the length has increased. + if (i != k) { + x.e++; + if (xc[0] == BASE) xc[0] = 1; + } + + break; + } else { + xc[ni] += k; + if (xc[ni] != BASE) break; + xc[ni--] = 0; + k = 1; + } + } + } + + // Remove trailing zeros. + for (i = xc.length; xc[--i] === 0; xc.pop()); + } + + // Overflow? Infinity. + if (x.e > MAX_EXP) { + x.c = x.e = null; + + // Underflow? Zero. + } else if (x.e < MIN_EXP) { + x.c = [x.e = 0]; + } + } + + return x; + } + + + function valueOf(n) { + var str, + e = n.e; + + if (e === null) return n.toString(); + + str = coeffToString(n.c); + + str = e <= TO_EXP_NEG || e >= TO_EXP_POS + ? toExponential(str, e) + : toFixedPoint(str, e, '0'); + + return n.s < 0 ? '-' + str : str; + } + + + // PROTOTYPE/INSTANCE METHODS + + + /* + * Return a new BigNumber whose value is the absolute value of this BigNumber. + */ + P.absoluteValue = P.abs = function () { + var x = new BigNumber(this); + if (x.s < 0) x.s = 1; + return x; + }; + + + /* + * Return + * 1 if the value of this BigNumber is greater than the value of BigNumber(y, b), + * -1 if the value of this BigNumber is less than the value of BigNumber(y, b), + * 0 if they have the same value, + * or null if the value of either is NaN. + */ + P.comparedTo = function (y, b) { + return compare(this, new BigNumber(y, b)); + }; + + + /* + * If dp is undefined or null or true or false, return the number of decimal places of the + * value of this BigNumber, or null if the value of this BigNumber is ±Infinity or NaN. + * + * Otherwise, if dp is a number, return a new BigNumber whose value is the value of this + * BigNumber rounded to a maximum of dp decimal places using rounding mode rm, or + * ROUNDING_MODE if rm is omitted. + * + * [dp] {number} Decimal places: integer, 0 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}' + */ + P.decimalPlaces = P.dp = function (dp, rm) { + var c, n, v, + x = this; + + if (dp != null) { + intCheck(dp, 0, MAX); + if (rm == null) rm = ROUNDING_MODE; + else intCheck(rm, 0, 8); + + return round(new BigNumber(x), dp + x.e + 1, rm); + } + + if (!(c = x.c)) return null; + n = ((v = c.length - 1) - bitFloor(this.e / LOG_BASE)) * LOG_BASE; + + // Subtract the number of trailing zeros of the last number. + if (v = c[v]) for (; v % 10 == 0; v /= 10, n--); + if (n < 0) n = 0; + + return n; + }; + + + /* + * n / 0 = I + * n / N = N + * n / I = 0 + * 0 / n = 0 + * 0 / 0 = N + * 0 / N = N + * 0 / I = 0 + * N / n = N + * N / 0 = N + * N / N = N + * N / I = N + * I / n = I + * I / 0 = I + * I / N = N + * I / I = N + * + * Return a new BigNumber whose value is the value of this BigNumber divided by the value of + * BigNumber(y, b), rounded according to DECIMAL_PLACES and ROUNDING_MODE. + */ + P.dividedBy = P.div = function (y, b) { + return div(this, new BigNumber(y, b), DECIMAL_PLACES, ROUNDING_MODE); + }; + + + /* + * Return a new BigNumber whose value is the integer part of dividing the value of this + * BigNumber by the value of BigNumber(y, b). + */ + P.dividedToIntegerBy = P.idiv = function (y, b) { + return div(this, new BigNumber(y, b), 0, 1); + }; + + + /* + * Return a BigNumber whose value is the value of this BigNumber exponentiated by n. + * + * If m is present, return the result modulo m. + * If n is negative round according to DECIMAL_PLACES and ROUNDING_MODE. + * If POW_PRECISION is non-zero and m is not present, round to POW_PRECISION using ROUNDING_MODE. + * + * The modular power operation works efficiently when x, n, and m are integers, otherwise it + * is equivalent to calculating x.exponentiatedBy(n).modulo(m) with a POW_PRECISION of 0. + * + * n {number|string|BigNumber} The exponent. An integer. + * [m] {number|string|BigNumber} The modulus. + * + * '[BigNumber Error] Exponent not an integer: {n}' + */ + P.exponentiatedBy = P.pow = function (n, m) { + var half, isModExp, i, k, more, nIsBig, nIsNeg, nIsOdd, y, + x = this; + + n = new BigNumber(n); + + // Allow NaN and ±Infinity, but not other non-integers. + if (n.c && !n.isInteger()) { + throw Error + (bignumberError + 'Exponent not an integer: ' + valueOf(n)); + } + + if (m != null) m = new BigNumber(m); + + // Exponent of MAX_SAFE_INTEGER is 15. + nIsBig = n.e > 14; + + // If x is NaN, ±Infinity, ±0 or ±1, or n is ±Infinity, NaN or ±0. + if (!x.c || !x.c[0] || x.c[0] == 1 && !x.e && x.c.length == 1 || !n.c || !n.c[0]) { + + // The sign of the result of pow when x is negative depends on the evenness of n. + // If +n overflows to ±Infinity, the evenness of n would be not be known. + y = new BigNumber(Math.pow(+valueOf(x), nIsBig ? 2 - isOdd(n) : +valueOf(n))); + return m ? y.mod(m) : y; + } + + nIsNeg = n.s < 0; + + if (m) { + + // x % m returns NaN if abs(m) is zero, or m is NaN. + if (m.c ? !m.c[0] : !m.s) return new BigNumber(NaN); + + isModExp = !nIsNeg && x.isInteger() && m.isInteger(); + + if (isModExp) x = x.mod(m); + + // Overflow to ±Infinity: >=2**1e10 or >=1.0000024**1e15. + // Underflow to ±0: <=0.79**1e10 or <=0.9999975**1e15. + } else if (n.e > 9 && (x.e > 0 || x.e < -1 || (x.e == 0 + // [1, 240000000] + ? x.c[0] > 1 || nIsBig && x.c[1] >= 24e7 + // [80000000000000] [99999750000000] + : x.c[0] < 8e13 || nIsBig && x.c[0] <= 9999975e7))) { + + // If x is negative and n is odd, k = -0, else k = 0. + k = x.s < 0 && isOdd(n) ? -0 : 0; + + // If x >= 1, k = ±Infinity. + if (x.e > -1) k = 1 / k; + + // If n is negative return ±0, else return ±Infinity. + return new BigNumber(nIsNeg ? 1 / k : k); + + } else if (POW_PRECISION) { + + // Truncating each coefficient array to a length of k after each multiplication + // equates to truncating significant digits to POW_PRECISION + [28, 41], + // i.e. there will be a minimum of 28 guard digits retained. + k = mathceil(POW_PRECISION / LOG_BASE + 2); + } + + if (nIsBig) { + half = new BigNumber(0.5); + if (nIsNeg) n.s = 1; + nIsOdd = isOdd(n); + } else { + i = Math.abs(+valueOf(n)); + nIsOdd = i % 2; + } + + y = new BigNumber(ONE); + + // Performs 54 loop iterations for n of 9007199254740991. + for (; ;) { + + if (nIsOdd) { + y = y.times(x); + if (!y.c) break; + + if (k) { + if (y.c.length > k) y.c.length = k; + } else if (isModExp) { + y = y.mod(m); //y = y.minus(div(y, m, 0, MODULO_MODE).times(m)); + } + } + + if (i) { + i = mathfloor(i / 2); + if (i === 0) break; + nIsOdd = i % 2; + } else { + n = n.times(half); + round(n, n.e + 1, 1); + + if (n.e > 14) { + nIsOdd = isOdd(n); + } else { + i = +valueOf(n); + if (i === 0) break; + nIsOdd = i % 2; + } + } + + x = x.times(x); + + if (k) { + if (x.c && x.c.length > k) x.c.length = k; + } else if (isModExp) { + x = x.mod(m); //x = x.minus(div(x, m, 0, MODULO_MODE).times(m)); + } + } + + if (isModExp) return y; + if (nIsNeg) y = ONE.div(y); + + return m ? y.mod(m) : k ? round(y, POW_PRECISION, ROUNDING_MODE, more) : y; + }; + + + /* + * Return a new BigNumber whose value is the value of this BigNumber rounded to an integer + * using rounding mode rm, or ROUNDING_MODE if rm is omitted. + * + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {rm}' + */ + P.integerValue = function (rm) { + var n = new BigNumber(this); + if (rm == null) rm = ROUNDING_MODE; + else intCheck(rm, 0, 8); + return round(n, n.e + 1, rm); + }; + + + /* + * Return true if the value of this BigNumber is equal to the value of BigNumber(y, b), + * otherwise return false. + */ + P.isEqualTo = P.eq = function (y, b) { + return compare(this, new BigNumber(y, b)) === 0; + }; + + + /* + * Return true if the value of this BigNumber is a finite number, otherwise return false. + */ + P.isFinite = function () { + return !!this.c; + }; + + + /* + * Return true if the value of this BigNumber is greater than the value of BigNumber(y, b), + * otherwise return false. + */ + P.isGreaterThan = P.gt = function (y, b) { + return compare(this, new BigNumber(y, b)) > 0; + }; + + + /* + * Return true if the value of this BigNumber is greater than or equal to the value of + * BigNumber(y, b), otherwise return false. + */ + P.isGreaterThanOrEqualTo = P.gte = function (y, b) { + return (b = compare(this, new BigNumber(y, b))) === 1 || b === 0; + + }; + + + /* + * Return true if the value of this BigNumber is an integer, otherwise return false. + */ + P.isInteger = function () { + return !!this.c && bitFloor(this.e / LOG_BASE) > this.c.length - 2; + }; + + + /* + * Return true if the value of this BigNumber is less than the value of BigNumber(y, b), + * otherwise return false. + */ + P.isLessThan = P.lt = function (y, b) { + return compare(this, new BigNumber(y, b)) < 0; + }; + + + /* + * Return true if the value of this BigNumber is less than or equal to the value of + * BigNumber(y, b), otherwise return false. + */ + P.isLessThanOrEqualTo = P.lte = function (y, b) { + return (b = compare(this, new BigNumber(y, b))) === -1 || b === 0; + }; + + + /* + * Return true if the value of this BigNumber is NaN, otherwise return false. + */ + P.isNaN = function () { + return !this.s; + }; + + + /* + * Return true if the value of this BigNumber is negative, otherwise return false. + */ + P.isNegative = function () { + return this.s < 0; + }; + + + /* + * Return true if the value of this BigNumber is positive, otherwise return false. + */ + P.isPositive = function () { + return this.s > 0; + }; + + + /* + * Return true if the value of this BigNumber is 0 or -0, otherwise return false. + */ + P.isZero = function () { + return !!this.c && this.c[0] == 0; + }; + + + /* + * n - 0 = n + * n - N = N + * n - I = -I + * 0 - n = -n + * 0 - 0 = 0 + * 0 - N = N + * 0 - I = -I + * N - n = N + * N - 0 = N + * N - N = N + * N - I = N + * I - n = I + * I - 0 = I + * I - N = N + * I - I = N + * + * Return a new BigNumber whose value is the value of this BigNumber minus the value of + * BigNumber(y, b). + */ + P.minus = function (y, b) { + var i, j, t, xLTy, + x = this, + a = x.s; + + y = new BigNumber(y, b); + b = y.s; + + // Either NaN? + if (!a || !b) return new BigNumber(NaN); + + // Signs differ? + if (a != b) { + y.s = -b; + return x.plus(y); + } + + var xe = x.e / LOG_BASE, + ye = y.e / LOG_BASE, + xc = x.c, + yc = y.c; + + if (!xe || !ye) { + + // Either Infinity? + if (!xc || !yc) return xc ? (y.s = -b, y) : new BigNumber(yc ? x : NaN); + + // Either zero? + if (!xc[0] || !yc[0]) { + + // Return y if y is non-zero, x if x is non-zero, or zero if both are zero. + return yc[0] ? (y.s = -b, y) : new BigNumber(xc[0] ? x : + + // IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity + ROUNDING_MODE == 3 ? -0 : 0); + } + } + + xe = bitFloor(xe); + ye = bitFloor(ye); + xc = xc.slice(); + + // Determine which is the bigger number. + if (a = xe - ye) { + + if (xLTy = a < 0) { + a = -a; + t = xc; + } else { + ye = xe; + t = yc; + } + + t.reverse(); + + // Prepend zeros to equalise exponents. + for (b = a; b--; t.push(0)); + t.reverse(); + } else { + + // Exponents equal. Check digit by digit. + j = (xLTy = (a = xc.length) < (b = yc.length)) ? a : b; + + for (a = b = 0; b < j; b++) { + + if (xc[b] != yc[b]) { + xLTy = xc[b] < yc[b]; + break; + } + } + } + + // x < y? Point xc to the array of the bigger number. + if (xLTy) t = xc, xc = yc, yc = t, y.s = -y.s; + + b = (j = yc.length) - (i = xc.length); + + // Append zeros to xc if shorter. + // No need to add zeros to yc if shorter as subtract only needs to start at yc.length. + if (b > 0) for (; b--; xc[i++] = 0); + b = BASE - 1; + + // Subtract yc from xc. + for (; j > a;) { + + if (xc[--j] < yc[j]) { + for (i = j; i && !xc[--i]; xc[i] = b); + --xc[i]; + xc[j] += BASE; + } + + xc[j] -= yc[j]; + } + + // Remove leading zeros and adjust exponent accordingly. + for (; xc[0] == 0; xc.splice(0, 1), --ye); + + // Zero? + if (!xc[0]) { + + // Following IEEE 754 (2008) 6.3, + // n - n = +0 but n - n = -0 when rounding towards -Infinity. + y.s = ROUNDING_MODE == 3 ? -1 : 1; + y.c = [y.e = 0]; + return y; + } + + // No need to check for Infinity as +x - +y != Infinity && -x - -y != Infinity + // for finite x and y. + return normalise(y, xc, ye); + }; + + + /* + * n % 0 = N + * n % N = N + * n % I = n + * 0 % n = 0 + * -0 % n = -0 + * 0 % 0 = N + * 0 % N = N + * 0 % I = 0 + * N % n = N + * N % 0 = N + * N % N = N + * N % I = N + * I % n = N + * I % 0 = N + * I % N = N + * I % I = N + * + * Return a new BigNumber whose value is the value of this BigNumber modulo the value of + * BigNumber(y, b). The result depends on the value of MODULO_MODE. + */ + P.modulo = P.mod = function (y, b) { + var q, s, + x = this; + + y = new BigNumber(y, b); + + // Return NaN if x is Infinity or NaN, or y is NaN or zero. + if (!x.c || !y.s || y.c && !y.c[0]) { + return new BigNumber(NaN); + + // Return x if y is Infinity or x is zero. + } else if (!y.c || x.c && !x.c[0]) { + return new BigNumber(x); + } + + if (MODULO_MODE == 9) { + + // Euclidian division: q = sign(y) * floor(x / abs(y)) + // r = x - qy where 0 <= r < abs(y) + s = y.s; + y.s = 1; + q = div(x, y, 0, 3); + y.s = s; + q.s *= s; + } else { + q = div(x, y, 0, MODULO_MODE); + } + + y = x.minus(q.times(y)); + + // To match JavaScript %, ensure sign of zero is sign of dividend. + if (!y.c[0] && MODULO_MODE == 1) y.s = x.s; + + return y; + }; + + + /* + * n * 0 = 0 + * n * N = N + * n * I = I + * 0 * n = 0 + * 0 * 0 = 0 + * 0 * N = N + * 0 * I = N + * N * n = N + * N * 0 = N + * N * N = N + * N * I = N + * I * n = I + * I * 0 = N + * I * N = N + * I * I = I + * + * Return a new BigNumber whose value is the value of this BigNumber multiplied by the value + * of BigNumber(y, b). + */ + P.multipliedBy = P.times = function (y, b) { + var c, e, i, j, k, m, xcL, xlo, xhi, ycL, ylo, yhi, zc, + base, sqrtBase, + x = this, + xc = x.c, + yc = (y = new BigNumber(y, b)).c; + + // Either NaN, ±Infinity or ±0? + if (!xc || !yc || !xc[0] || !yc[0]) { + + // Return NaN if either is NaN, or one is 0 and the other is Infinity. + if (!x.s || !y.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc) { + y.c = y.e = y.s = null; + } else { + y.s *= x.s; + + // Return ±Infinity if either is ±Infinity. + if (!xc || !yc) { + y.c = y.e = null; + + // Return ±0 if either is ±0. + } else { + y.c = [0]; + y.e = 0; + } + } + + return y; + } + + e = bitFloor(x.e / LOG_BASE) + bitFloor(y.e / LOG_BASE); + y.s *= x.s; + xcL = xc.length; + ycL = yc.length; + + // Ensure xc points to longer array and xcL to its length. + if (xcL < ycL) zc = xc, xc = yc, yc = zc, i = xcL, xcL = ycL, ycL = i; + + // Initialise the result array with zeros. + for (i = xcL + ycL, zc = []; i--; zc.push(0)); + + base = BASE; + sqrtBase = SQRT_BASE; + + for (i = ycL; --i >= 0;) { + c = 0; + ylo = yc[i] % sqrtBase; + yhi = yc[i] / sqrtBase | 0; + + for (k = xcL, j = i + k; j > i;) { + xlo = xc[--k] % sqrtBase; + xhi = xc[k] / sqrtBase | 0; + m = yhi * xlo + xhi * ylo; + xlo = ylo * xlo + ((m % sqrtBase) * sqrtBase) + zc[j] + c; + c = (xlo / base | 0) + (m / sqrtBase | 0) + yhi * xhi; + zc[j--] = xlo % base; + } + + zc[j] = c; + } + + if (c) { + ++e; + } else { + zc.splice(0, 1); + } + + return normalise(y, zc, e); + }; + + + /* + * Return a new BigNumber whose value is the value of this BigNumber negated, + * i.e. multiplied by -1. + */ + P.negated = function () { + var x = new BigNumber(this); + x.s = -x.s || null; + return x; + }; + + + /* + * n + 0 = n + * n + N = N + * n + I = I + * 0 + n = n + * 0 + 0 = 0 + * 0 + N = N + * 0 + I = I + * N + n = N + * N + 0 = N + * N + N = N + * N + I = N + * I + n = I + * I + 0 = I + * I + N = N + * I + I = I + * + * Return a new BigNumber whose value is the value of this BigNumber plus the value of + * BigNumber(y, b). + */ + P.plus = function (y, b) { + var t, + x = this, + a = x.s; + + y = new BigNumber(y, b); + b = y.s; + + // Either NaN? + if (!a || !b) return new BigNumber(NaN); + + // Signs differ? + if (a != b) { + y.s = -b; + return x.minus(y); + } + + var xe = x.e / LOG_BASE, + ye = y.e / LOG_BASE, + xc = x.c, + yc = y.c; + + if (!xe || !ye) { + + // Return ±Infinity if either ±Infinity. + if (!xc || !yc) return new BigNumber(a / 0); + + // Either zero? + // Return y if y is non-zero, x if x is non-zero, or zero if both are zero. + if (!xc[0] || !yc[0]) return yc[0] ? y : new BigNumber(xc[0] ? x : a * 0); + } + + xe = bitFloor(xe); + ye = bitFloor(ye); + xc = xc.slice(); + + // Prepend zeros to equalise exponents. Faster to use reverse then do unshifts. + if (a = xe - ye) { + if (a > 0) { + ye = xe; + t = yc; + } else { + a = -a; + t = xc; + } + + t.reverse(); + for (; a--; t.push(0)); + t.reverse(); + } + + a = xc.length; + b = yc.length; + + // Point xc to the longer array, and b to the shorter length. + if (a - b < 0) t = yc, yc = xc, xc = t, b = a; + + // Only start adding at yc.length - 1 as the further digits of xc can be ignored. + for (a = 0; b;) { + a = (xc[--b] = xc[b] + yc[b] + a) / BASE | 0; + xc[b] = BASE === xc[b] ? 0 : xc[b] % BASE; + } + + if (a) { + xc = [a].concat(xc); + ++ye; + } + + // No need to check for zero, as +x + +y != 0 && -x + -y != 0 + // ye = MAX_EXP + 1 possible + return normalise(y, xc, ye); + }; + + + /* + * If sd is undefined or null or true or false, return the number of significant digits of + * the value of this BigNumber, or null if the value of this BigNumber is ±Infinity or NaN. + * If sd is true include integer-part trailing zeros in the count. + * + * Otherwise, if sd is a number, return a new BigNumber whose value is the value of this + * BigNumber rounded to a maximum of sd significant digits using rounding mode rm, or + * ROUNDING_MODE if rm is omitted. + * + * sd {number|boolean} number: significant digits: integer, 1 to MAX inclusive. + * boolean: whether to count integer-part trailing zeros: true or false. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {sd|rm}' + */ + P.precision = P.sd = function (sd, rm) { + var c, n, v, + x = this; + + if (sd != null && sd !== !!sd) { + intCheck(sd, 1, MAX); + if (rm == null) rm = ROUNDING_MODE; + else intCheck(rm, 0, 8); + + return round(new BigNumber(x), sd, rm); + } + + if (!(c = x.c)) return null; + v = c.length - 1; + n = v * LOG_BASE + 1; + + if (v = c[v]) { + + // Subtract the number of trailing zeros of the last element. + for (; v % 10 == 0; v /= 10, n--); + + // Add the number of digits of the first element. + for (v = c[0]; v >= 10; v /= 10, n++); + } + + if (sd && x.e + 1 > n) n = x.e + 1; + + return n; + }; + + + /* + * Return a new BigNumber whose value is the value of this BigNumber shifted by k places + * (powers of 10). Shift to the right if n > 0, and to the left if n < 0. + * + * k {number} Integer, -MAX_SAFE_INTEGER to MAX_SAFE_INTEGER inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {k}' + */ + P.shiftedBy = function (k) { + intCheck(k, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER); + return this.times('1e' + k); + }; + + + /* + * sqrt(-n) = N + * sqrt(N) = N + * sqrt(-I) = N + * sqrt(I) = I + * sqrt(0) = 0 + * sqrt(-0) = -0 + * + * Return a new BigNumber whose value is the square root of the value of this BigNumber, + * rounded according to DECIMAL_PLACES and ROUNDING_MODE. + */ + P.squareRoot = P.sqrt = function () { + var m, n, r, rep, t, + x = this, + c = x.c, + s = x.s, + e = x.e, + dp = DECIMAL_PLACES + 4, + half = new BigNumber('0.5'); + + // Negative/NaN/Infinity/zero? + if (s !== 1 || !c || !c[0]) { + return new BigNumber(!s || s < 0 && (!c || c[0]) ? NaN : c ? x : 1 / 0); + } + + // Initial estimate. + s = Math.sqrt(+valueOf(x)); + + // Math.sqrt underflow/overflow? + // Pass x to Math.sqrt as integer, then adjust the exponent of the result. + if (s == 0 || s == 1 / 0) { + n = coeffToString(c); + if ((n.length + e) % 2 == 0) n += '0'; + s = Math.sqrt(+n); + e = bitFloor((e + 1) / 2) - (e < 0 || e % 2); + + if (s == 1 / 0) { + n = '1e' + e; + } else { + n = s.toExponential(); + n = n.slice(0, n.indexOf('e') + 1) + e; + } + + r = new BigNumber(n); + } else { + r = new BigNumber(s + ''); + } + + // Check for zero. + // r could be zero if MIN_EXP is changed after the this value was created. + // This would cause a division by zero (x/t) and hence Infinity below, which would cause + // coeffToString to throw. + if (r.c[0]) { + e = r.e; + s = e + dp; + if (s < 3) s = 0; + + // Newton-Raphson iteration. + for (; ;) { + t = r; + r = half.times(t.plus(div(x, t, dp, 1))); + + if (coeffToString(t.c).slice(0, s) === (n = coeffToString(r.c)).slice(0, s)) { + + // The exponent of r may here be one less than the final result exponent, + // e.g 0.0009999 (e-4) --> 0.001 (e-3), so adjust s so the rounding digits + // are indexed correctly. + if (r.e < e) --s; + n = n.slice(s - 3, s + 1); + + // The 4th rounding digit may be in error by -1 so if the 4 rounding digits + // are 9999 or 4999 (i.e. approaching a rounding boundary) continue the + // iteration. + if (n == '9999' || !rep && n == '4999') { + + // On the first iteration only, check to see if rounding up gives the + // exact result as the nines may infinitely repeat. + if (!rep) { + round(t, t.e + DECIMAL_PLACES + 2, 0); + + if (t.times(t).eq(x)) { + r = t; + break; + } + } + + dp += 4; + s += 4; + rep = 1; + } else { + + // If rounding digits are null, 0{0,4} or 50{0,3}, check for exact + // result. If not, then there are further digits and m will be truthy. + if (!+n || !+n.slice(1) && n.charAt(0) == '5') { + + // Truncate to the first rounding digit. + round(r, r.e + DECIMAL_PLACES + 2, 1); + m = !r.times(r).eq(x); + } + + break; + } + } + } + } + + return round(r, r.e + DECIMAL_PLACES + 1, ROUNDING_MODE, m); + }; + + + /* + * Return a string representing the value of this BigNumber in exponential notation and + * rounded using ROUNDING_MODE to dp fixed decimal places. + * + * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}' + */ + P.toExponential = function (dp, rm) { + if (dp != null) { + intCheck(dp, 0, MAX); + dp++; + } + return format(this, dp, rm, 1); + }; + + + /* + * Return a string representing the value of this BigNumber in fixed-point notation rounding + * to dp fixed decimal places using rounding mode rm, or ROUNDING_MODE if rm is omitted. + * + * Note: as with JavaScript's number type, (-0).toFixed(0) is '0', + * but e.g. (-0.00001).toFixed(0) is '-0'. + * + * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}' + */ + P.toFixed = function (dp, rm) { + if (dp != null) { + intCheck(dp, 0, MAX); + dp = dp + this.e + 1; + } + return format(this, dp, rm); + }; + + + /* + * Return a string representing the value of this BigNumber in fixed-point notation rounded + * using rm or ROUNDING_MODE to dp decimal places, and formatted according to the properties + * of the format or FORMAT object (see BigNumber.set). + * + * The formatting object may contain some or all of the properties shown below. + * + * FORMAT = { + * prefix: '', + * groupSize: 3, + * secondaryGroupSize: 0, + * groupSeparator: ',', + * decimalSeparator: '.', + * fractionGroupSize: 0, + * fractionGroupSeparator: '\xA0', // non-breaking space + * suffix: '' + * }; + * + * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * [format] {object} Formatting options. See FORMAT pbject above. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}' + * '[BigNumber Error] Argument not an object: {format}' + */ + P.toFormat = function (dp, rm, format) { + var str, + x = this; + + if (format == null) { + if (dp != null && rm && typeof rm == 'object') { + format = rm; + rm = null; + } else if (dp && typeof dp == 'object') { + format = dp; + dp = rm = null; + } else { + format = FORMAT; + } + } else if (typeof format != 'object') { + throw Error + (bignumberError + 'Argument not an object: ' + format); + } + + str = x.toFixed(dp, rm); + + if (x.c) { + var i, + arr = str.split('.'), + g1 = +format.groupSize, + g2 = +format.secondaryGroupSize, + groupSeparator = format.groupSeparator || '', + intPart = arr[0], + fractionPart = arr[1], + isNeg = x.s < 0, + intDigits = isNeg ? intPart.slice(1) : intPart, + len = intDigits.length; + + if (g2) i = g1, g1 = g2, g2 = i, len -= i; + + if (g1 > 0 && len > 0) { + i = len % g1 || g1; + intPart = intDigits.substr(0, i); + for (; i < len; i += g1) intPart += groupSeparator + intDigits.substr(i, g1); + if (g2 > 0) intPart += groupSeparator + intDigits.slice(i); + if (isNeg) intPart = '-' + intPart; + } + + str = fractionPart + ? intPart + (format.decimalSeparator || '') + ((g2 = +format.fractionGroupSize) + ? fractionPart.replace(new RegExp('\\d{' + g2 + '}\\B', 'g'), + '$&' + (format.fractionGroupSeparator || '')) + : fractionPart) + : intPart; + } + + return (format.prefix || '') + str + (format.suffix || ''); + }; + + + /* + * Return an array of two BigNumbers representing the value of this BigNumber as a simple + * fraction with an integer numerator and an integer denominator. + * The denominator will be a positive non-zero value less than or equal to the specified + * maximum denominator. If a maximum denominator is not specified, the denominator will be + * the lowest value necessary to represent the number exactly. + * + * [md] {number|string|BigNumber} Integer >= 1, or Infinity. The maximum denominator. + * + * '[BigNumber Error] Argument {not an integer|out of range} : {md}' + */ + P.toFraction = function (md) { + var d, d0, d1, d2, e, exp, n, n0, n1, q, r, s, + x = this, + xc = x.c; + + if (md != null) { + n = new BigNumber(md); + + // Throw if md is less than one or is not an integer, unless it is Infinity. + if (!n.isInteger() && (n.c || n.s !== 1) || n.lt(ONE)) { + throw Error + (bignumberError + 'Argument ' + + (n.isInteger() ? 'out of range: ' : 'not an integer: ') + valueOf(n)); + } + } + + if (!xc) return new BigNumber(x); + + d = new BigNumber(ONE); + n1 = d0 = new BigNumber(ONE); + d1 = n0 = new BigNumber(ONE); + s = coeffToString(xc); + + // Determine initial denominator. + // d is a power of 10 and the minimum max denominator that specifies the value exactly. + e = d.e = s.length - x.e - 1; + d.c[0] = POWS_TEN[(exp = e % LOG_BASE) < 0 ? LOG_BASE + exp : exp]; + md = !md || n.comparedTo(d) > 0 ? (e > 0 ? d : n1) : n; + + exp = MAX_EXP; + MAX_EXP = 1 / 0; + n = new BigNumber(s); + + // n0 = d1 = 0 + n0.c[0] = 0; + + for (; ;) { + q = div(n, d, 0, 1); + d2 = d0.plus(q.times(d1)); + if (d2.comparedTo(md) == 1) break; + d0 = d1; + d1 = d2; + n1 = n0.plus(q.times(d2 = n1)); + n0 = d2; + d = n.minus(q.times(d2 = d)); + n = d2; + } + + d2 = div(md.minus(d0), d1, 0, 1); + n0 = n0.plus(d2.times(n1)); + d0 = d0.plus(d2.times(d1)); + n0.s = n1.s = x.s; + e = e * 2; + + // Determine which fraction is closer to x, n0/d0 or n1/d1 + r = div(n1, d1, e, ROUNDING_MODE).minus(x).abs().comparedTo( + div(n0, d0, e, ROUNDING_MODE).minus(x).abs()) < 1 ? [n1, d1] : [n0, d0]; + + MAX_EXP = exp; + + return r; + }; + + + /* + * Return the value of this BigNumber converted to a number primitive. + */ + P.toNumber = function () { + return +valueOf(this); + }; + + + /* + * Return a string representing the value of this BigNumber rounded to sd significant digits + * using rounding mode rm or ROUNDING_MODE. If sd is less than the number of digits + * necessary to represent the integer part of the value in fixed-point notation, then use + * exponential notation. + * + * [sd] {number} Significant digits. Integer, 1 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {sd|rm}' + */ + P.toPrecision = function (sd, rm) { + if (sd != null) intCheck(sd, 1, MAX); + return format(this, sd, rm, 2); + }; + + + /* + * Return a string representing the value of this BigNumber in base b, or base 10 if b is + * omitted. If a base is specified, including base 10, round according to DECIMAL_PLACES and + * ROUNDING_MODE. If a base is not specified, and this BigNumber has a positive exponent + * that is equal to or greater than TO_EXP_POS, or a negative exponent equal to or less than + * TO_EXP_NEG, return exponential notation. + * + * [b] {number} Integer, 2 to ALPHABET.length inclusive. + * + * '[BigNumber Error] Base {not a primitive number|not an integer|out of range}: {b}' + */ + P.toString = function (b) { + var str, + n = this, + s = n.s, + e = n.e; + + // Infinity or NaN? + if (e === null) { + if (s) { + str = 'Infinity'; + if (s < 0) str = '-' + str; + } else { + str = 'NaN'; + } + } else { + if (b == null) { + str = e <= TO_EXP_NEG || e >= TO_EXP_POS + ? toExponential(coeffToString(n.c), e) + : toFixedPoint(coeffToString(n.c), e, '0'); + } else if (b === 10) { + n = round(new BigNumber(n), DECIMAL_PLACES + e + 1, ROUNDING_MODE); + str = toFixedPoint(coeffToString(n.c), n.e, '0'); + } else { + intCheck(b, 2, ALPHABET.length, 'Base'); + str = convertBase(toFixedPoint(coeffToString(n.c), e, '0'), 10, b, s, true); + } + + if (s < 0 && n.c[0]) str = '-' + str; + } + + return str; + }; + + + /* + * Return as toString, but do not accept a base argument, and include the minus sign for + * negative zero. + */ + P.valueOf = P.toJSON = function () { + return valueOf(this); + }; + + + P._isBigNumber = true; + + P[Symbol.toStringTag] = 'BigNumber'; + + // Node.js v10.12.0+ + P[Symbol.for('nodejs.util.inspect.custom')] = P.valueOf; + + if (configObject != null) BigNumber.set(configObject); + + return BigNumber; +} + + +// PRIVATE HELPER FUNCTIONS + +// These functions don't need access to variables, +// e.g. DECIMAL_PLACES, in the scope of the `clone` function above. + + +function bitFloor(n) { + var i = n | 0; + return n > 0 || n === i ? i : i - 1; +} + + +// Return a coefficient array as a string of base 10 digits. +function coeffToString(a) { + var s, z, + i = 1, + j = a.length, + r = a[0] + ''; + + for (; i < j;) { + s = a[i++] + ''; + z = LOG_BASE - s.length; + for (; z--; s = '0' + s); + r += s; + } + + // Determine trailing zeros. + for (j = r.length; r.charCodeAt(--j) === 48;); + + return r.slice(0, j + 1 || 1); +} + + +// Compare the value of BigNumbers x and y. +function compare(x, y) { + var a, b, + xc = x.c, + yc = y.c, + i = x.s, + j = y.s, + k = x.e, + l = y.e; + + // Either NaN? + if (!i || !j) return null; + + a = xc && !xc[0]; + b = yc && !yc[0]; + + // Either zero? + if (a || b) return a ? b ? 0 : -j : i; + + // Signs differ? + if (i != j) return i; + + a = i < 0; + b = k == l; + + // Either Infinity? + if (!xc || !yc) return b ? 0 : !xc ^ a ? 1 : -1; + + // Compare exponents. + if (!b) return k > l ^ a ? 1 : -1; + + j = (k = xc.length) < (l = yc.length) ? k : l; + + // Compare digit by digit. + for (i = 0; i < j; i++) if (xc[i] != yc[i]) return xc[i] > yc[i] ^ a ? 1 : -1; + + // Compare lengths. + return k == l ? 0 : k > l ^ a ? 1 : -1; +} + + +/* + * Check that n is a primitive number, an integer, and in range, otherwise throw. + */ +function intCheck(n, min, max, name) { + if (n < min || n > max || n !== mathfloor(n)) { + throw Error + (bignumberError + (name || 'Argument') + (typeof n == 'number' + ? n < min || n > max ? ' out of range: ' : ' not an integer: ' + : ' not a primitive number: ') + String(n)); + } +} + + +// Assumes finite n. +function isOdd(n) { + var k = n.c.length - 1; + return bitFloor(n.e / LOG_BASE) == k && n.c[k] % 2 != 0; +} + + +function toExponential(str, e) { + return (str.length > 1 ? str.charAt(0) + '.' + str.slice(1) : str) + + (e < 0 ? 'e' : 'e+') + e; +} + + +function toFixedPoint(str, e, z) { + var len, zs; + + // Negative exponent? + if (e < 0) { + + // Prepend zeros. + for (zs = z + '.'; ++e; zs += z); + str = zs + str; + + // Positive exponent + } else { + len = str.length; + + // Append zeros. + if (++e > len) { + for (zs = z, e -= len; --e; zs += z); + str += zs; + } else if (e < len) { + str = str.slice(0, e) + '.' + str.slice(e); + } + } + + return str; +} + + +// EXPORT + + +export var BigNumber = clone(); + +export default BigNumber; diff --git a/node_modules/bignumber.js/doc/API.html b/node_modules/bignumber.js/doc/API.html new file mode 100644 index 0000000..1ed4a87 --- /dev/null +++ b/node_modules/bignumber.js/doc/API.html @@ -0,0 +1,2237 @@ + + + + + + +bignumber.js API + + + + + + +
+ +

bignumber.js

+ +

A JavaScript library for arbitrary-precision arithmetic.

+

Hosted on GitHub.

+ +

API

+ +

+ See the README on GitHub for a + quick-start introduction. +

+

+ In all examples below, var and semicolons are not shown, and if a commented-out + value is in quotes it means toString has been called on the preceding expression. +

+ + +

CONSTRUCTOR

+ + +
+ BigNumberBigNumber(n [, base]) ⇒ BigNumber +
+

+ n: number|string|BigNumber
+ base: number: integer, 2 to 36 inclusive. (See + ALPHABET to extend this range). +

+

+ Returns a new instance of a BigNumber object with value n, where n + is a numeric value in the specified base, or base 10 if + base is omitted or is null or undefined. +

+
+x = new BigNumber(123.4567)                // '123.4567'
+// 'new' is optional
+y = BigNumber(x)                           // '123.4567'
+

+ If n is a base 10 value it can be in normal (fixed-point) or + exponential notation. Values in other bases must be in normal notation. Values in any base can + have fraction digits, i.e. digits after the decimal point. +

+
+new BigNumber(43210)                       // '43210'
+new BigNumber('4.321e+4')                  // '43210'
+new BigNumber('-735.0918e-430')            // '-7.350918e-428'
+new BigNumber('123412421.234324', 5)       // '607236.557696'
+

+ Signed 0, signed Infinity and NaN are supported. +

+
+new BigNumber('-Infinity')                 // '-Infinity'
+new BigNumber(NaN)                         // 'NaN'
+new BigNumber(-0)                          // '0'
+new BigNumber('.5')                        // '0.5'
+new BigNumber('+2')                        // '2'
+

+ String values in hexadecimal literal form, e.g. '0xff', are valid, as are + string values with the octal and binary prefixs '0o' and '0b'. + String values in octal literal form without the prefix will be interpreted as + decimals, e.g. '011' is interpreted as 11, not 9. +

+
+new BigNumber(-10110100.1, 2)              // '-180.5'
+new BigNumber('-0b10110100.1')             // '-180.5'
+new BigNumber('ff.8', 16)                  // '255.5'
+new BigNumber('0xff.8')                    // '255.5'
+

+ If a base is specified, n is rounded according to the current + DECIMAL_PLACES and + ROUNDING_MODE settings. This includes base + 10 so don't include a base parameter for decimal values unless + this behaviour is wanted. +

+
BigNumber.config({ DECIMAL_PLACES: 5 })
+new BigNumber(1.23456789)                  // '1.23456789'
+new BigNumber(1.23456789, 10)              // '1.23457'
+

An error is thrown if base is invalid. See Errors.

+

+ There is no limit to the number of digits of a value of type string (other than + that of JavaScript's maximum array size). See RANGE to set + the maximum and minimum possible exponent value of a BigNumber. +

+
+new BigNumber('5032485723458348569331745.33434346346912144534543')
+new BigNumber('4.321e10000000')
+

BigNumber NaN is returned if n is invalid + (unless BigNumber.DEBUG is true, see below).

+
+new BigNumber('.1*')                       // 'NaN'
+new BigNumber('blurgh')                    // 'NaN'
+new BigNumber(9, 2)                        // 'NaN'
+

+ To aid in debugging, if BigNumber.DEBUG is true then an error will + be thrown on an invalid n. An error will also be thrown if n is of + type number with more than 15 significant digits, as calling + toString or valueOf on + these numbers may not result in the intended value. +

+
+console.log(823456789123456.3)            //  823456789123456.2
+new BigNumber(823456789123456.3)          // '823456789123456.2'
+BigNumber.DEBUG = true
+// '[BigNumber Error] Number primitive has more than 15 significant digits'
+new BigNumber(823456789123456.3)
+// '[BigNumber Error] Not a base 2 number'
+new BigNumber(9, 2)
+

+ A BigNumber can also be created from an object literal. + Use isBigNumber to check that it is well-formed. +

+
new BigNumber({ s: 1, e: 2, c: [ 777, 12300000000000 ], _isBigNumber: true })    // '777.123'
+ + + + +

Methods

+

The static methods of a BigNumber constructor.

+ + + + +
clone + .clone([object]) ⇒ BigNumber constructor +
+

object: object

+

+ Returns a new independent BigNumber constructor with configuration as described by + object (see config), or with the default + configuration if object is null or undefined. +

+

+ Throws if object is not an object. See Errors. +

+
BigNumber.config({ DECIMAL_PLACES: 5 })
+BN = BigNumber.clone({ DECIMAL_PLACES: 9 })
+
+x = new BigNumber(1)
+y = new BN(1)
+
+x.div(3)                        // 0.33333
+y.div(3)                        // 0.333333333
+
+// BN = BigNumber.clone({ DECIMAL_PLACES: 9 }) is equivalent to:
+BN = BigNumber.clone()
+BN.config({ DECIMAL_PLACES: 9 })
+ + + +
configset([object]) ⇒ object
+

+ object: object: an object that contains some or all of the following + properties. +

+

Configures the settings for this particular BigNumber constructor.

+ +
+
DECIMAL_PLACES
+
+ number: integer, 0 to 1e+9 inclusive
+ Default value: 20 +
+
+ The maximum number of decimal places of the results of operations involving + division, i.e. division, square root and base conversion operations, and power + operations with negative exponents.
+
+
+
BigNumber.config({ DECIMAL_PLACES: 5 })
+BigNumber.set({ DECIMAL_PLACES: 5 })    // equivalent
+
+ + + +
ROUNDING_MODE
+
+ number: integer, 0 to 8 inclusive
+ Default value: 4 (ROUND_HALF_UP) +
+
+ The rounding mode used in the above operations and the default rounding mode of + decimalPlaces, + precision, + toExponential, + toFixed, + toFormat and + toPrecision. +
+
The modes are available as enumerated properties of the BigNumber constructor.
+
+
BigNumber.config({ ROUNDING_MODE: 0 })
+BigNumber.set({ ROUNDING_MODE: BigNumber.ROUND_UP })    // equivalent
+
+ + + +
EXPONENTIAL_AT
+
+ number: integer, magnitude 0 to 1e+9 inclusive, or +
+ number[]: [ integer -1e+9 to 0 inclusive, integer + 0 to 1e+9 inclusive ]
+ Default value: [-7, 20] +
+
+ The exponent value(s) at which toString returns exponential notation. +
+
+ If a single number is assigned, the value is the exponent magnitude.
+ If an array of two numbers is assigned then the first number is the negative exponent + value at and beneath which exponential notation is used, and the second number is the + positive exponent value at and above which the same. +
+
+ For example, to emulate JavaScript numbers in terms of the exponent values at which they + begin to use exponential notation, use [-7, 20]. +
+
+
BigNumber.config({ EXPONENTIAL_AT: 2 })
+new BigNumber(12.3)         // '12.3'        e is only 1
+new BigNumber(123)          // '1.23e+2'
+new BigNumber(0.123)        // '0.123'       e is only -1
+new BigNumber(0.0123)       // '1.23e-2'
+
+BigNumber.config({ EXPONENTIAL_AT: [-7, 20] })
+new BigNumber(123456789)    // '123456789'   e is only 8
+new BigNumber(0.000000123)  // '1.23e-7'
+
+// Almost never return exponential notation:
+BigNumber.config({ EXPONENTIAL_AT: 1e+9 })
+
+// Always return exponential notation:
+BigNumber.config({ EXPONENTIAL_AT: 0 })
+
+
+ Regardless of the value of EXPONENTIAL_AT, the toFixed method + will always return a value in normal notation and the toExponential method + will always return a value in exponential form. +
+
+ Calling toString with a base argument, e.g. toString(10), will + also always return normal notation. +
+ + + +
RANGE
+
+ number: integer, magnitude 1 to 1e+9 inclusive, or +
+ number[]: [ integer -1e+9 to -1 inclusive, integer + 1 to 1e+9 inclusive ]
+ Default value: [-1e+9, 1e+9] +
+
+ The exponent value(s) beyond which overflow to Infinity and underflow to + zero occurs. +
+
+ If a single number is assigned, it is the maximum exponent magnitude: values wth a + positive exponent of greater magnitude become Infinity and those with a + negative exponent of greater magnitude become zero. +
+ If an array of two numbers is assigned then the first number is the negative exponent + limit and the second number is the positive exponent limit. +
+
+ For example, to emulate JavaScript numbers in terms of the exponent values at which they + become zero and Infinity, use [-324, 308]. +
+
+
BigNumber.config({ RANGE: 500 })
+BigNumber.config().RANGE     // [ -500, 500 ]
+new BigNumber('9.999e499')   // '9.999e+499'
+new BigNumber('1e500')       // 'Infinity'
+new BigNumber('1e-499')      // '1e-499'
+new BigNumber('1e-500')      // '0'
+
+BigNumber.config({ RANGE: [-3, 4] })
+new BigNumber(99999)         // '99999'      e is only 4
+new BigNumber(100000)        // 'Infinity'   e is 5
+new BigNumber(0.001)         // '0.01'       e is only -3
+new BigNumber(0.0001)        // '0'          e is -4
+
+
+ The largest possible magnitude of a finite BigNumber is + 9.999...e+1000000000.
+ The smallest possible magnitude of a non-zero BigNumber is 1e-1000000000. +
+ + + +
CRYPTO
+
+ boolean: true or false.
+ Default value: false +
+
+ The value that determines whether cryptographically-secure pseudo-random number + generation is used. +
+
+ If CRYPTO is set to true then the + random method will generate random digits using + crypto.getRandomValues in browsers that support it, or + crypto.randomBytes if using Node.js. +
+
+ If neither function is supported by the host environment then attempting to set + CRYPTO to true will fail and an exception will be thrown. +
+
+ If CRYPTO is false then the source of randomness used will be + Math.random (which is assumed to generate at least 30 bits of + randomness). +
+
See random.
+
+
+// Node.js
+global.crypto = require('crypto')
+
+BigNumber.config({ CRYPTO: true })
+BigNumber.config().CRYPTO       // true
+BigNumber.random()              // 0.54340758610486147524
+
+ + + +
MODULO_MODE
+
+ number: integer, 0 to 9 inclusive
+ Default value: 1 (ROUND_DOWN) +
+
The modulo mode used when calculating the modulus: a mod n.
+
+ The quotient, q = a / n, is calculated according to the + ROUNDING_MODE that corresponds to the chosen + MODULO_MODE. +
+
The remainder, r, is calculated as: r = a - n * q.
+
+ The modes that are most commonly used for the modulus/remainder operation are shown in + the following table. Although the other rounding modes can be used, they may not give + useful results. +
+
+ + + + + + + + + + + + + + + + + + + + + + +
PropertyValueDescription
ROUND_UP0 + The remainder is positive if the dividend is negative, otherwise it is negative. +
ROUND_DOWN1 + The remainder has the same sign as the dividend.
+ This uses 'truncating division' and matches the behaviour of JavaScript's + remainder operator %. +
ROUND_FLOOR3 + The remainder has the same sign as the divisor.
+ This matches Python's % operator. +
ROUND_HALF_EVEN6The IEEE 754 remainder function.
EUCLID9 + The remainder is always positive. Euclidian division:
+ q = sign(n) * floor(a / abs(n)) +
+
+
+ The rounding/modulo modes are available as enumerated properties of the BigNumber + constructor. +
+
See modulo.
+
+
BigNumber.config({ MODULO_MODE: BigNumber.EUCLID })
+BigNumber.config({ MODULO_MODE: 9 })          // equivalent
+
+ + + +
POW_PRECISION
+
+ number: integer, 0 to 1e+9 inclusive.
+ Default value: 0 +
+
+ The maximum precision, i.e. number of significant digits, of the result of the power + operation (unless a modulus is specified). +
+
If set to 0, the number of significant digits will not be limited.
+
See exponentiatedBy.
+
BigNumber.config({ POW_PRECISION: 100 })
+ + + +
FORMAT
+
object
+
+ The FORMAT object configures the format of the string returned by the + toFormat method. +
+
+ The example below shows the properties of the FORMAT object that are + recognised, and their default values. +
+
+ Unlike the other configuration properties, the values of the properties of the + FORMAT object will not be checked for validity. The existing + FORMAT object will simply be replaced by the object that is passed in. + The object can include any number of the properties shown below. +
+
See toFormat for examples of usage.
+
+
+BigNumber.config({
+  FORMAT: {
+    // string to prepend
+    prefix: '',
+    // decimal separator
+    decimalSeparator: '.',
+    // grouping separator of the integer part
+    groupSeparator: ',',
+    // primary grouping size of the integer part
+    groupSize: 3,
+    // secondary grouping size of the integer part
+    secondaryGroupSize: 0,
+    // grouping separator of the fraction part
+    fractionGroupSeparator: ' ',
+    // grouping size of the fraction part
+    fractionGroupSize: 0,
+    // string to append
+    suffix: ''
+  }
+});
+
+ + + +
ALPHABET
+
+ string
+ Default value: '0123456789abcdefghijklmnopqrstuvwxyz' +
+
+ The alphabet used for base conversion. The length of the alphabet corresponds to the + maximum value of the base argument that can be passed to the + BigNumber constructor or + toString. +
+
+ There is no maximum length for the alphabet, but it must be at least 2 characters long, and + it must not contain whitespace or a repeated character, or the sign indicators + '+' and '-', or the decimal separator '.'. +
+
+
// duodecimal (base 12)
+BigNumber.config({ ALPHABET: '0123456789TE' })
+x = new BigNumber('T', 12)
+x.toString()                // '10'
+x.toString(12)              // 'T'
+
+ + + +
+

+

Returns an object with the above properties and their current values.

+

+ Throws if object is not an object, or if an invalid value is assigned to + one or more of the above properties. See Errors. +

+
+BigNumber.config({
+  DECIMAL_PLACES: 40,
+  ROUNDING_MODE: BigNumber.ROUND_HALF_CEIL,
+  EXPONENTIAL_AT: [-10, 20],
+  RANGE: [-500, 500],
+  CRYPTO: true,
+  MODULO_MODE: BigNumber.ROUND_FLOOR,
+  POW_PRECISION: 80,
+  FORMAT: {
+    groupSize: 3,
+    groupSeparator: ' ',
+    decimalSeparator: ','
+  },
+  ALPHABET: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_'
+});
+
+obj = BigNumber.config();
+obj.DECIMAL_PLACES        // 40
+obj.RANGE                 // [-500, 500]
+ + + +
+ isBigNumber.isBigNumber(value) ⇒ boolean +
+

value: any

+

+ Returns true if value is a BigNumber instance, otherwise returns + false. +

+
x = 42
+y = new BigNumber(x)
+
+BigNumber.isBigNumber(x)             // false
+y instanceof BigNumber               // true
+BigNumber.isBigNumber(y)             // true
+
+BN = BigNumber.clone();
+z = new BN(x)
+z instanceof BigNumber               // false
+BigNumber.isBigNumber(z)             // true
+

+ If value is a BigNumber instance and BigNumber.DEBUG is true, + then this method will also check if value is well-formed, and throw if it is not. + See Errors. +

+

+ The check can be useful if creating a BigNumber from an object literal. + See BigNumber. +

+
+x = new BigNumber(10)
+
+// Change x.c to an illegitimate value.
+x.c = NaN
+
+BigNumber.DEBUG = false
+
+// No error.
+BigNumber.isBigNumber(x)    // true
+
+BigNumber.DEBUG = true
+
+// Error.
+BigNumber.isBigNumber(x)    // '[BigNumber Error] Invalid BigNumber'
+ + + +
maximum.max(n...) ⇒ BigNumber
+

+ n: number|string|BigNumber
+ See BigNumber for further parameter details. +

+

+ Returns a BigNumber whose value is the maximum of the arguments. +

+

The return value is always exact and unrounded.

+
x = new BigNumber('3257869345.0378653')
+BigNumber.maximum(4e9, x, '123456789.9')      // '4000000000'
+
+arr = [12, '13', new BigNumber(14)]
+BigNumber.max.apply(null, arr)                // '14'
+ + + +
minimum.min(n...) ⇒ BigNumber
+

+ n: number|string|BigNumber
+ See BigNumber for further parameter details. +

+

+ Returns a BigNumber whose value is the minimum of the arguments. +

+

The return value is always exact and unrounded.

+
x = new BigNumber('3257869345.0378653')
+BigNumber.minimum(4e9, x, '123456789.9')      // '123456789.9'
+
+arr = [2, new BigNumber(-14), '-15.9999', -12]
+BigNumber.min.apply(null, arr)                // '-15.9999'
+ + + +
+ random.random([dp]) ⇒ BigNumber +
+

dp: number: integer, 0 to 1e+9 inclusive

+

+ Returns a new BigNumber with a pseudo-random value equal to or greater than 0 and + less than 1. +

+

+ The return value will have dp decimal places (or less if trailing zeros are + produced).
+ If dp is omitted then the number of decimal places will default to the current + DECIMAL_PLACES setting. +

+

+ Depending on the value of this BigNumber constructor's + CRYPTO setting and the support for the + crypto object in the host environment, the random digits of the return value are + generated by either Math.random (fastest), crypto.getRandomValues + (Web Cryptography API in recent browsers) or crypto.randomBytes (Node.js). +

+

+ To be able to set CRYPTO to true when using + Node.js, the crypto object must be available globally: +

+
global.crypto = require('crypto')
+

+ If CRYPTO is true, i.e. one of the + crypto methods is to be used, the value of a returned BigNumber should be + cryptographically-secure and statistically indistinguishable from a random value. +

+

+ Throws if dp is invalid. See Errors. +

+
BigNumber.config({ DECIMAL_PLACES: 10 })
+BigNumber.random()              // '0.4117936847'
+BigNumber.random(20)            // '0.78193327636914089009'
+ + + +
sum.sum(n...) ⇒ BigNumber
+

+ n: number|string|BigNumber
+ See BigNumber for further parameter details. +

+

Returns a BigNumber whose value is the sum of the arguments.

+

The return value is always exact and unrounded.

+
x = new BigNumber('3257869345.0378653')
+BigNumber.sum(4e9, x, '123456789.9')      // '7381326134.9378653'
+
+arr = [2, new BigNumber(14), '15.9999', 12]
+BigNumber.sum.apply(null, arr)            // '43.9999'
+ + + +

Properties

+

+ The library's enumerated rounding modes are stored as properties of the constructor.
+ (They are not referenced internally by the library itself.) +

+

+ Rounding modes 0 to 6 (inclusive) are the same as those of Java's + BigDecimal class. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PropertyValueDescription
ROUND_UP0Rounds away from zero
ROUND_DOWN1Rounds towards zero
ROUND_CEIL2Rounds towards Infinity
ROUND_FLOOR3Rounds towards -Infinity
ROUND_HALF_UP4 + Rounds towards nearest neighbour.
+ If equidistant, rounds away from zero +
ROUND_HALF_DOWN5 + Rounds towards nearest neighbour.
+ If equidistant, rounds towards zero +
ROUND_HALF_EVEN6 + Rounds towards nearest neighbour.
+ If equidistant, rounds towards even neighbour +
ROUND_HALF_CEIL7 + Rounds towards nearest neighbour.
+ If equidistant, rounds towards Infinity +
ROUND_HALF_FLOOR8 + Rounds towards nearest neighbour.
+ If equidistant, rounds towards -Infinity +
+
+BigNumber.config({ ROUNDING_MODE: BigNumber.ROUND_CEIL })
+BigNumber.config({ ROUNDING_MODE: 2 })     // equivalent
+ +
DEBUG
+

undefined|false|true

+

+ If BigNumber.DEBUG is set true then an error will be thrown + if this BigNumber constructor receives an invalid value, such as + a value of type number with more than 15 significant digits. + See BigNumber. +

+

+ An error will also be thrown if the isBigNumber + method receives a BigNumber that is not well-formed. + See isBigNumber. +

+
BigNumber.DEBUG = true
+ + +

INSTANCE

+ + +

Methods

+

The methods inherited by a BigNumber instance from its constructor's prototype object.

+

A BigNumber is immutable in the sense that it is not changed by its methods.

+

+ The treatment of ±0, ±Infinity and NaN is + consistent with how JavaScript treats these values. +

+

Many method names have a shorter alias.

+ + + +
absoluteValue.abs() ⇒ BigNumber
+

+ Returns a BigNumber whose value is the absolute value, i.e. the magnitude, of the value of + this BigNumber. +

+

The return value is always exact and unrounded.

+
+x = new BigNumber(-0.8)
+y = x.absoluteValue()           // '0.8'
+z = y.abs()                     // '0.8'
+ + + +
+ comparedTo.comparedTo(n [, base]) ⇒ number +
+

+ n: number|string|BigNumber
+ base: number
+ See BigNumber for further parameter details. +

+ + + + + + + + + + + + + + + + + + +
Returns 
1If the value of this BigNumber is greater than the value of n
-1If the value of this BigNumber is less than the value of n
0If this BigNumber and n have the same value
nullIf the value of either this BigNumber or n is NaN
+
+x = new BigNumber(Infinity)
+y = new BigNumber(5)
+x.comparedTo(y)                 // 1
+x.comparedTo(x.minus(1))        // 0
+y.comparedTo(NaN)               // null
+y.comparedTo('110', 2)          // -1
+ + + +
+ decimalPlaces.dp([dp [, rm]]) ⇒ BigNumber|number +
+

+ dp: number: integer, 0 to 1e+9 inclusive
+ rm: number: integer, 0 to 8 inclusive +

+

+ If dp is a number, returns a BigNumber whose value is the value of this BigNumber + rounded by rounding mode rm to a maximum of dp decimal places. +

+

+ If dp is omitted, or is null or undefined, the return + value is the number of decimal places of the value of this BigNumber, or null if + the value of this BigNumber is ±Infinity or NaN. +

+

+ If rm is omitted, or is null or undefined, + ROUNDING_MODE is used. +

+

+ Throws if dp or rm is invalid. See Errors. +

+
+x = new BigNumber(1234.56)
+x.decimalPlaces(1)                     // '1234.6'
+x.dp()                                 // 2
+x.decimalPlaces(2)                     // '1234.56'
+x.dp(10)                               // '1234.56'
+x.decimalPlaces(0, 1)                  // '1234'
+x.dp(0, 6)                             // '1235'
+x.decimalPlaces(1, 1)                  // '1234.5'
+x.dp(1, BigNumber.ROUND_HALF_EVEN)     // '1234.6'
+x                                      // '1234.56'
+y = new BigNumber('9.9e-101')
+y.dp()                                 // 102
+ + + +
dividedBy.div(n [, base]) ⇒ BigNumber +
+

+ n: number|string|BigNumber
+ base: number
+ See BigNumber for further parameter details. +

+

+ Returns a BigNumber whose value is the value of this BigNumber divided by + n, rounded according to the current + DECIMAL_PLACES and + ROUNDING_MODE settings. +

+
+x = new BigNumber(355)
+y = new BigNumber(113)
+x.dividedBy(y)                  // '3.14159292035398230088'
+x.div(5)                        // '71'
+x.div(47, 16)                   // '5'
+ + + +
+ dividedToIntegerBy.idiv(n [, base]) ⇒ + BigNumber +
+

+ n: number|string|BigNumber
+ base: number
+ See BigNumber for further parameter details. +

+

+ Returns a BigNumber whose value is the integer part of dividing the value of this BigNumber by + n. +

+
+x = new BigNumber(5)
+y = new BigNumber(3)
+x.dividedToIntegerBy(y)         // '1'
+x.idiv(0.7)                     // '7'
+x.idiv('0.f', 16)               // '5'
+ + + +
+ exponentiatedBy.pow(n [, m]) ⇒ BigNumber +
+

+ n: number|string|BigNumber: integer
+ m: number|string|BigNumber +

+

+ Returns a BigNumber whose value is the value of this BigNumber exponentiated by + n, i.e. raised to the power n, and optionally modulo a modulus + m. +

+

+ Throws if n is not an integer. See Errors. +

+

+ If n is negative the result is rounded according to the current + DECIMAL_PLACES and + ROUNDING_MODE settings. +

+

+ As the number of digits of the result of the power operation can grow so large so quickly, + e.g. 123.45610000 has over 50000 digits, the number of significant + digits calculated is limited to the value of the + POW_PRECISION setting (unless a modulus + m is specified). +

+

+ By default POW_PRECISION is set to 0. + This means that an unlimited number of significant digits will be calculated, and that the + method's performance will decrease dramatically for larger exponents. +

+

+ If m is specified and the value of m, n and this + BigNumber are integers, and n is positive, then a fast modular exponentiation + algorithm is used, otherwise the operation will be performed as + x.exponentiatedBy(n).modulo(m) with a + POW_PRECISION of 0. +

+
+Math.pow(0.7, 2)                // 0.48999999999999994
+x = new BigNumber(0.7)
+x.exponentiatedBy(2)            // '0.49'
+BigNumber(3).pow(-2)            // '0.11111111111111111111'
+ + + +
+ integerValue.integerValue([rm]) ⇒ BigNumber +
+

+ rm: number: integer, 0 to 8 inclusive +

+

+ Returns a BigNumber whose value is the value of this BigNumber rounded to an integer using + rounding mode rm. +

+

+ If rm is omitted, or is null or undefined, + ROUNDING_MODE is used. +

+

+ Throws if rm is invalid. See Errors. +

+
+x = new BigNumber(123.456)
+x.integerValue()                        // '123'
+x.integerValue(BigNumber.ROUND_CEIL)    // '124'
+y = new BigNumber(-12.7)
+y.integerValue()                        // '-13'
+y.integerValue(BigNumber.ROUND_DOWN)    // '-12'
+

+ The following is an example of how to add a prototype method that emulates JavaScript's + Math.round function. Math.ceil, Math.floor and + Math.trunc can be emulated in the same way with + BigNumber.ROUND_CEIL, BigNumber.ROUND_FLOOR and + BigNumber.ROUND_DOWN respectively. +

+
+BigNumber.prototype.round = function (n) {
+  return n.integerValue(BigNumber.ROUND_HALF_CEIL);
+};
+x.round()                               // '123'
+ + + +
isEqualTo.eq(n [, base]) ⇒ boolean
+

+ n: number|string|BigNumber
+ base: number
+ See BigNumber for further parameter details. +

+

+ Returns true if the value of this BigNumber is equal to the value of + n, otherwise returns false.
+ As with JavaScript, NaN does not equal NaN. +

+

Note: This method uses the comparedTo method internally.

+
+0 === 1e-324                    // true
+x = new BigNumber(0)
+x.isEqualTo('1e-324')           // false
+BigNumber(-0).eq(x)             // true  ( -0 === 0 )
+BigNumber(255).eq('ff', 16)     // true
+
+y = new BigNumber(NaN)
+y.isEqualTo(NaN)                // false
+ + + +
isFinite.isFinite() ⇒ boolean
+

+ Returns true if the value of this BigNumber is a finite number, otherwise + returns false. +

+

+ The only possible non-finite values of a BigNumber are NaN, Infinity + and -Infinity. +

+
+x = new BigNumber(1)
+x.isFinite()                    // true
+y = new BigNumber(Infinity)
+y.isFinite()                    // false
+

+ Note: The native method isFinite() can be used if + n <= Number.MAX_VALUE. +

+ + + +
isGreaterThan.gt(n [, base]) ⇒ boolean
+

+ n: number|string|BigNumber
+ base: number
+ See BigNumber for further parameter details. +

+

+ Returns true if the value of this BigNumber is greater than the value of + n, otherwise returns false. +

+

Note: This method uses the comparedTo method internally.

+
+0.1 > (0.3 - 0.2)                             // true
+x = new BigNumber(0.1)
+x.isGreaterThan(BigNumber(0.3).minus(0.2))    // false
+BigNumber(0).gt(x)                            // false
+BigNumber(11, 3).gt(11.1, 2)                  // true
+ + + +
+ isGreaterThanOrEqualTo.gte(n [, base]) ⇒ boolean +
+

+ n: number|string|BigNumber
+ base: number
+ See BigNumber for further parameter details. +

+

+ Returns true if the value of this BigNumber is greater than or equal to the value + of n, otherwise returns false. +

+

Note: This method uses the comparedTo method internally.

+
+(0.3 - 0.2) >= 0.1                     // false
+x = new BigNumber(0.3).minus(0.2)
+x.isGreaterThanOrEqualTo(0.1)          // true
+BigNumber(1).gte(x)                    // true
+BigNumber(10, 18).gte('i', 36)         // true
+ + + +
isInteger.isInteger() ⇒ boolean
+

+ Returns true if the value of this BigNumber is an integer, otherwise returns + false. +

+
+x = new BigNumber(1)
+x.isInteger()                   // true
+y = new BigNumber(123.456)
+y.isInteger()                   // false
+ + + +
isLessThan.lt(n [, base]) ⇒ boolean
+

+ n: number|string|BigNumber
+ base: number
+ See BigNumber for further parameter details. +

+

+ Returns true if the value of this BigNumber is less than the value of + n, otherwise returns false. +

+

Note: This method uses the comparedTo method internally.

+
+(0.3 - 0.2) < 0.1                       // true
+x = new BigNumber(0.3).minus(0.2)
+x.isLessThan(0.1)                       // false
+BigNumber(0).lt(x)                      // true
+BigNumber(11.1, 2).lt(11, 3)            // true
+ + + +
+ isLessThanOrEqualTo.lte(n [, base]) ⇒ boolean +
+

+ n: number|string|BigNumber
+ base: number
+ See BigNumber for further parameter details. +

+

+ Returns true if the value of this BigNumber is less than or equal to the value of + n, otherwise returns false. +

+

Note: This method uses the comparedTo method internally.

+
+0.1 <= (0.3 - 0.2)                                // false
+x = new BigNumber(0.1)
+x.isLessThanOrEqualTo(BigNumber(0.3).minus(0.2))  // true
+BigNumber(-1).lte(x)                              // true
+BigNumber(10, 18).lte('i', 36)                    // true
+ + + +
isNaN.isNaN() ⇒ boolean
+

+ Returns true if the value of this BigNumber is NaN, otherwise + returns false. +

+
+x = new BigNumber(NaN)
+x.isNaN()                       // true
+y = new BigNumber('Infinity')
+y.isNaN()                       // false
+

Note: The native method isNaN() can also be used.

+ + + +
isNegative.isNegative() ⇒ boolean
+

+ Returns true if the sign of this BigNumber is negative, otherwise returns + false. +

+
+x = new BigNumber(-0)
+x.isNegative()                  // true
+y = new BigNumber(2)
+y.isNegative()                  // false
+

Note: n < 0 can be used if n <= -Number.MIN_VALUE.

+ + + +
isPositive.isPositive() ⇒ boolean
+

+ Returns true if the sign of this BigNumber is positive, otherwise returns + false. +

+
+x = new BigNumber(-0)
+x.isPositive()                  // false
+y = new BigNumber(2)
+y.isPositive()                  // true
+ + + +
isZero.isZero() ⇒ boolean
+

+ Returns true if the value of this BigNumber is zero or minus zero, otherwise + returns false. +

+
+x = new BigNumber(-0)
+x.isZero() && x.isNegative()         // true
+y = new BigNumber(Infinity)
+y.isZero()                      // false
+

Note: n == 0 can be used if n >= Number.MIN_VALUE.

+ + + +
+ minus.minus(n [, base]) ⇒ BigNumber +
+

+ n: number|string|BigNumber
+ base: number
+ See BigNumber for further parameter details. +

+

Returns a BigNumber whose value is the value of this BigNumber minus n.

+

The return value is always exact and unrounded.

+
+0.3 - 0.1                       // 0.19999999999999998
+x = new BigNumber(0.3)
+x.minus(0.1)                    // '0.2'
+x.minus(0.6, 20)                // '0'
+ + + +
modulo.mod(n [, base]) ⇒ BigNumber
+

+ n: number|string|BigNumber
+ base: number
+ See BigNumber for further parameter details. +

+

+ Returns a BigNumber whose value is the value of this BigNumber modulo n, i.e. + the integer remainder of dividing this BigNumber by n. +

+

+ The value returned, and in particular its sign, is dependent on the value of the + MODULO_MODE setting of this BigNumber constructor. + If it is 1 (default value), the result will have the same sign as this BigNumber, + and it will match that of Javascript's % operator (within the limits of double + precision) and BigDecimal's remainder method. +

+

The return value is always exact and unrounded.

+

+ See MODULO_MODE for a description of the other + modulo modes. +

+
+1 % 0.9                         // 0.09999999999999998
+x = new BigNumber(1)
+x.modulo(0.9)                   // '0.1'
+y = new BigNumber(33)
+y.mod('a', 33)                  // '3'
+ + + +
+ multipliedBy.times(n [, base]) ⇒ BigNumber +
+

+ n: number|string|BigNumber
+ base: number
+ See BigNumber for further parameter details. +

+

+ Returns a BigNumber whose value is the value of this BigNumber multiplied by n. +

+

The return value is always exact and unrounded.

+
+0.6 * 3                         // 1.7999999999999998
+x = new BigNumber(0.6)
+y = x.multipliedBy(3)           // '1.8'
+BigNumber('7e+500').times(y)    // '1.26e+501'
+x.multipliedBy('-a', 16)        // '-6'
+ + + +
negated.negated() ⇒ BigNumber
+

+ Returns a BigNumber whose value is the value of this BigNumber negated, i.e. multiplied by + -1. +

+
+x = new BigNumber(1.8)
+x.negated()                     // '-1.8'
+y = new BigNumber(-1.3)
+y.negated()                     // '1.3'
+ + + +
plus.plus(n [, base]) ⇒ BigNumber
+

+ n: number|string|BigNumber
+ base: number
+ See BigNumber for further parameter details. +

+

Returns a BigNumber whose value is the value of this BigNumber plus n.

+

The return value is always exact and unrounded.

+
+0.1 + 0.2                       // 0.30000000000000004
+x = new BigNumber(0.1)
+y = x.plus(0.2)                 // '0.3'
+BigNumber(0.7).plus(x).plus(y)  // '1'
+x.plus('0.1', 8)                // '0.225'
+ + + +
+ precision.sd([d [, rm]]) ⇒ BigNumber|number +
+

+ d: number|boolean: integer, 1 to 1e+9 + inclusive, or true or false
+ rm: number: integer, 0 to 8 inclusive. +

+

+ If d is a number, returns a BigNumber whose value is the value of this BigNumber + rounded to a precision of d significant digits using rounding mode + rm. +

+

+ If d is omitted or is null or undefined, the return + value is the number of significant digits of the value of this BigNumber, or null + if the value of this BigNumber is ±Infinity or NaN.

+

+

+ If d is true then any trailing zeros of the integer + part of a number are counted as significant digits, otherwise they are not. +

+

+ If rm is omitted or is null or undefined, + ROUNDING_MODE will be used. +

+

+ Throws if d or rm is invalid. See Errors. +

+
+x = new BigNumber(9876.54321)
+x.precision(6)                         // '9876.54'
+x.sd()                                 // 9
+x.precision(6, BigNumber.ROUND_UP)     // '9876.55'
+x.sd(2)                                // '9900'
+x.precision(2, 1)                      // '9800'
+x                                      // '9876.54321'
+y = new BigNumber(987000)
+y.precision()                          // 3
+y.sd(true)                             // 6
+ + + +
shiftedBy.shiftedBy(n) ⇒ BigNumber
+

+ n: number: integer, + -9007199254740991 to 9007199254740991 inclusive +

+

+ Returns a BigNumber whose value is the value of this BigNumber shifted by n + places. +

+ The shift is of the decimal point, i.e. of powers of ten, and is to the left if n + is negative or to the right if n is positive. +

+

The return value is always exact and unrounded.

+

+ Throws if n is invalid. See Errors. +

+
+x = new BigNumber(1.23)
+x.shiftedBy(3)                      // '1230'
+x.shiftedBy(-3)                     // '0.00123'
+ + + +
squareRoot.sqrt() ⇒ BigNumber
+

+ Returns a BigNumber whose value is the square root of the value of this BigNumber, + rounded according to the current + DECIMAL_PLACES and + ROUNDING_MODE settings. +

+

+ The return value will be correctly rounded, i.e. rounded as if the result was first calculated + to an infinite number of correct digits before rounding. +

+
+x = new BigNumber(16)
+x.squareRoot()                  // '4'
+y = new BigNumber(3)
+y.sqrt()                        // '1.73205080756887729353'
+ + + +
+ toExponential.toExponential([dp [, rm]]) ⇒ string +
+

+ dp: number: integer, 0 to 1e+9 inclusive
+ rm: number: integer, 0 to 8 inclusive +

+

+ Returns a string representing the value of this BigNumber in exponential notation rounded + using rounding mode rm to dp decimal places, i.e with one digit + before the decimal point and dp digits after it. +

+

+ If the value of this BigNumber in exponential notation has fewer than dp fraction + digits, the return value will be appended with zeros accordingly. +

+

+ If dp is omitted, or is null or undefined, the number + of digits after the decimal point defaults to the minimum number of digits necessary to + represent the value exactly.
+ If rm is omitted or is null or undefined, + ROUNDING_MODE is used. +

+

+ Throws if dp or rm is invalid. See Errors. +

+
+x = 45.6
+y = new BigNumber(x)
+x.toExponential()               // '4.56e+1'
+y.toExponential()               // '4.56e+1'
+x.toExponential(0)              // '5e+1'
+y.toExponential(0)              // '5e+1'
+x.toExponential(1)              // '4.6e+1'
+y.toExponential(1)              // '4.6e+1'
+y.toExponential(1, 1)           // '4.5e+1'  (ROUND_DOWN)
+x.toExponential(3)              // '4.560e+1'
+y.toExponential(3)              // '4.560e+1'
+ + + +
+ toFixed.toFixed([dp [, rm]]) ⇒ string +
+

+ dp: number: integer, 0 to 1e+9 inclusive
+ rm: number: integer, 0 to 8 inclusive +

+

+ Returns a string representing the value of this BigNumber in normal (fixed-point) notation + rounded to dp decimal places using rounding mode rm. +

+

+ If the value of this BigNumber in normal notation has fewer than dp fraction + digits, the return value will be appended with zeros accordingly. +

+

+ Unlike Number.prototype.toFixed, which returns exponential notation if a number + is greater or equal to 1021, this method will always return normal + notation. +

+

+ If dp is omitted or is null or undefined, the return + value will be unrounded and in normal notation. This is also unlike + Number.prototype.toFixed, which returns the value to zero decimal places.
+ It is useful when fixed-point notation is required and the current + EXPONENTIAL_AT setting causes + toString to return exponential notation.
+ If rm is omitted or is null or undefined, + ROUNDING_MODE is used. +

+

+ Throws if dp or rm is invalid. See Errors. +

+
+x = 3.456
+y = new BigNumber(x)
+x.toFixed()                     // '3'
+y.toFixed()                     // '3.456'
+y.toFixed(0)                    // '3'
+x.toFixed(2)                    // '3.46'
+y.toFixed(2)                    // '3.46'
+y.toFixed(2, 1)                 // '3.45'  (ROUND_DOWN)
+x.toFixed(5)                    // '3.45600'
+y.toFixed(5)                    // '3.45600'
+ + + +
+ toFormat.toFormat([dp [, rm[, format]]]) ⇒ string +
+

+ dp: number: integer, 0 to 1e+9 inclusive
+ rm: number: integer, 0 to 8 inclusive
+ format: object: see FORMAT +

+

+

+ Returns a string representing the value of this BigNumber in normal (fixed-point) notation + rounded to dp decimal places using rounding mode rm, and formatted + according to the properties of the format object. +

+

+ See FORMAT and the examples below for the properties of the + format object, their types, and their usage. A formatting object may contain + some or all of the recognised properties. +

+

+ If dp is omitted or is null or undefined, then the + return value is not rounded to a fixed number of decimal places.
+ If rm is omitted or is null or undefined, + ROUNDING_MODE is used.
+ If format is omitted or is null or undefined, the + FORMAT object is used. +

+

+ Throws if dp, rm or format is invalid. See + Errors. +

+
+fmt = {
+  prefix = '',
+  decimalSeparator: '.',
+  groupSeparator: ',',
+  groupSize: 3,
+  secondaryGroupSize: 0,
+  fractionGroupSeparator: ' ',
+  fractionGroupSize: 0,
+  suffix = ''
+}
+
+x = new BigNumber('123456789.123456789')
+
+// Set the global formatting options
+BigNumber.config({ FORMAT: fmt })
+
+x.toFormat()                              // '123,456,789.123456789'
+x.toFormat(3)                             // '123,456,789.123'
+
+// If a reference to the object assigned to FORMAT has been retained,
+// the format properties can be changed directly
+fmt.groupSeparator = ' '
+fmt.fractionGroupSize = 5
+x.toFormat()                              // '123 456 789.12345 6789'
+
+// Alternatively, pass the formatting options as an argument
+fmt = {
+  prefix: '=> ',
+  decimalSeparator: ',',
+  groupSeparator: '.',
+  groupSize: 3,
+  secondaryGroupSize: 2
+}
+
+x.toFormat()                              // '123 456 789.12345 6789'
+x.toFormat(fmt)                           // '=> 12.34.56.789,123456789'
+x.toFormat(2, fmt)                        // '=> 12.34.56.789,12'
+x.toFormat(3, BigNumber.ROUND_UP, fmt)    // '=> 12.34.56.789,124'
+ + + +
+ toFraction.toFraction([maximum_denominator]) + ⇒ [BigNumber, BigNumber] +
+

+ maximum_denominator: + number|string|BigNumber: integer >= 1 and <= + Infinity +

+

+ Returns an array of two BigNumbers representing the value of this BigNumber as a simple + fraction with an integer numerator and an integer denominator. The denominator will be a + positive non-zero value less than or equal to maximum_denominator. +

+

+ If a maximum_denominator is not specified, or is null or + undefined, the denominator will be the lowest value necessary to represent the + number exactly. +

+

+ Throws if maximum_denominator is invalid. See Errors. +

+
+x = new BigNumber(1.75)
+x.toFraction()                  // '7, 4'
+
+pi = new BigNumber('3.14159265358')
+pi.toFraction()                 // '157079632679,50000000000'
+pi.toFraction(100000)           // '312689, 99532'
+pi.toFraction(10000)            // '355, 113'
+pi.toFraction(100)              // '311, 99'
+pi.toFraction(10)               // '22, 7'
+pi.toFraction(1)                // '3, 1'
+ + + +
toJSON.toJSON() ⇒ string
+

As valueOf.

+
+x = new BigNumber('177.7e+457')
+y = new BigNumber(235.4325)
+z = new BigNumber('0.0098074')
+
+// Serialize an array of three BigNumbers
+str = JSON.stringify( [x, y, z] )
+// "["1.777e+459","235.4325","0.0098074"]"
+
+// Return an array of three BigNumbers
+JSON.parse(str, function (key, val) {
+    return key === '' ? val : new BigNumber(val)
+})
+ + + +
toNumber.toNumber() ⇒ number
+

Returns the value of this BigNumber as a JavaScript number primitive.

+

+ This method is identical to using type coercion with the unary plus operator. +

+
+x = new BigNumber(456.789)
+x.toNumber()                    // 456.789
++x                              // 456.789
+
+y = new BigNumber('45987349857634085409857349856430985')
+y.toNumber()                    // 4.598734985763409e+34
+
+z = new BigNumber(-0)
+1 / z.toNumber()                // -Infinity
+1 / +z                          // -Infinity
+ + + +
+ toPrecision.toPrecision([sd [, rm]]) ⇒ string +
+

+ sd: number: integer, 1 to 1e+9 inclusive
+ rm: number: integer, 0 to 8 inclusive +

+

+ Returns a string representing the value of this BigNumber rounded to sd + significant digits using rounding mode rm. +

+

+ If sd is less than the number of digits necessary to represent the integer part + of the value in normal (fixed-point) notation, then exponential notation is used. +

+

+ If sd is omitted, or is null or undefined, then the + return value is the same as n.toString().
+ If rm is omitted or is null or undefined, + ROUNDING_MODE is used. +

+

+ Throws if sd or rm is invalid. See Errors. +

+
+x = 45.6
+y = new BigNumber(x)
+x.toPrecision()                 // '45.6'
+y.toPrecision()                 // '45.6'
+x.toPrecision(1)                // '5e+1'
+y.toPrecision(1)                // '5e+1'
+y.toPrecision(2, 0)             // '4.6e+1'  (ROUND_UP)
+y.toPrecision(2, 1)             // '4.5e+1'  (ROUND_DOWN)
+x.toPrecision(5)                // '45.600'
+y.toPrecision(5)                // '45.600'
+ + + +
toString.toString([base]) ⇒ string
+

+ base: number: integer, 2 to ALPHABET.length + inclusive (see ALPHABET). +

+

+ Returns a string representing the value of this BigNumber in the specified base, or base + 10 if base is omitted or is null or + undefined. +

+

+ For bases above 10, and using the default base conversion alphabet + (see ALPHABET), values from 10 to + 35 are represented by a-z + (as with Number.prototype.toString). +

+

+ If a base is specified the value is rounded according to the current + DECIMAL_PLACES + and ROUNDING_MODE settings. +

+

+ If a base is not specified, and this BigNumber has a positive + exponent that is equal to or greater than the positive component of the + current EXPONENTIAL_AT setting, + or a negative exponent equal to or less than the negative component of the + setting, then exponential notation is returned. +

+

If base is null or undefined it is ignored.

+

+ Throws if base is invalid. See Errors. +

+
+x = new BigNumber(750000)
+x.toString()                    // '750000'
+BigNumber.config({ EXPONENTIAL_AT: 5 })
+x.toString()                    // '7.5e+5'
+
+y = new BigNumber(362.875)
+y.toString(2)                   // '101101010.111'
+y.toString(9)                   // '442.77777777777777777778'
+y.toString(32)                  // 'ba.s'
+
+BigNumber.config({ DECIMAL_PLACES: 4 });
+z = new BigNumber('1.23456789')
+z.toString()                    // '1.23456789'
+z.toString(10)                  // '1.2346'
+ + + +
valueOf.valueOf() ⇒ string
+

+ As toString, but does not accept a base argument and includes + the minus sign for negative zero. +

+
+x = new BigNumber('-0')
+x.toString()                    // '0'
+x.valueOf()                     // '-0'
+y = new BigNumber('1.777e+457')
+y.valueOf()                     // '1.777e+457'
+ + + +

Properties

+

The properties of a BigNumber instance:

+ + + + + + + + + + + + + + + + + + + + + + + + + +
PropertyDescriptionTypeValue
ccoefficient*number[] Array of base 1e14 numbers
eexponentnumberInteger, -1000000000 to 1000000000 inclusive
ssignnumber-1 or 1
+

*significand

+

+ The value of any of the c, e and s properties may also + be null. +

+

+ The above properties are best considered to be read-only. In early versions of this library it + was okay to change the exponent of a BigNumber by writing to its exponent property directly, + but this is no longer reliable as the value of the first element of the coefficient array is + now dependent on the exponent. +

+

+ Note that, as with JavaScript numbers, the original exponent and fractional trailing zeros are + not necessarily preserved. +

+
x = new BigNumber(0.123)              // '0.123'
+x.toExponential()                     // '1.23e-1'
+x.c                                   // '1,2,3'
+x.e                                   // -1
+x.s                                   // 1
+
+y = new Number(-123.4567000e+2)       // '-12345.67'
+y.toExponential()                     // '-1.234567e+4'
+z = new BigNumber('-123.4567000e+2')  // '-12345.67'
+z.toExponential()                     // '-1.234567e+4'
+z.c                                   // '1,2,3,4,5,6,7'
+z.e                                   // 4
+z.s                                   // -1
+ + + +

Zero, NaN and Infinity

+

+ The table below shows how ±0, NaN and + ±Infinity are stored. +

+ + + + + + + + + + + + + + + + + + + + + + + + + +
ces
±0[0]0±1
NaNnullnullnull
±Infinitynullnull±1
+
+x = new Number(-0)              // 0
+1 / x == -Infinity              // true
+
+y = new BigNumber(-0)           // '0'
+y.c                             // '0' ( [0].toString() )
+y.e                             // 0
+y.s                             // -1
+ + + +

Errors

+

The table below shows the errors that are thrown.

+

+ The errors are generic Error objects whose message begins + '[BigNumber Error]'. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MethodThrows
+ BigNumber
+ comparedTo
+ dividedBy
+ dividedToIntegerBy
+ isEqualTo
+ isGreaterThan
+ isGreaterThanOrEqualTo
+ isLessThan
+ isLessThanOrEqualTo
+ minus
+ modulo
+ plus
+ multipliedBy +
Base not a primitive number
Base not an integer
Base out of range
Number primitive has more than 15 significant digits*
Not a base... number*
Not a number*
cloneObject expected
configObject expected
DECIMAL_PLACES not a primitive number
DECIMAL_PLACES not an integer
DECIMAL_PLACES out of range
ROUNDING_MODE not a primitive number
ROUNDING_MODE not an integer
ROUNDING_MODE out of range
EXPONENTIAL_AT not a primitive number
EXPONENTIAL_AT not an integer
EXPONENTIAL_AT out of range
RANGE not a primitive number
RANGE not an integer
RANGE cannot be zero
RANGE cannot be zero
CRYPTO not true or false
crypto unavailable
MODULO_MODE not a primitive number
MODULO_MODE not an integer
MODULO_MODE out of range
POW_PRECISION not a primitive number
POW_PRECISION not an integer
POW_PRECISION out of range
FORMAT not an object
ALPHABET invalid
+ decimalPlaces
+ precision
+ random
+ shiftedBy
+ toExponential
+ toFixed
+ toFormat
+ toPrecision +
Argument not a primitive number
Argument not an integer
Argument out of range
+ decimalPlaces
+ precision +
Argument not true or false
exponentiatedByArgument not an integer
isBigNumberInvalid BigNumber*
+ minimum
+ maximum +
Not a number*
+ random + crypto unavailable
+ toFormat + Argument not an object
toFractionArgument not an integer
Argument out of range
toStringBase not a primitive number
Base not an integer
Base out of range
+

*Only thrown if BigNumber.DEBUG is true.

+

To determine if an exception is a BigNumber Error:

+
+try {
+  // ...
+} catch (e) {
+  if (e instanceof Error && e.message.indexOf('[BigNumber Error]') === 0) {
+      // ...
+  }
+}
+ + + +

Type coercion

+

+ To prevent the accidental use of a BigNumber in primitive number operations, or the + accidental addition of a BigNumber to a string, the valueOf method can be safely + overwritten as shown below. +

+

+ The valueOf method is the same as the + toJSON method, and both are the same as the + toString method except they do not take a base + argument and they include the minus sign for negative zero. +

+
+BigNumber.prototype.valueOf = function () {
+  throw Error('valueOf called!')
+}
+
+x = new BigNumber(1)
+x / 2                    // '[BigNumber Error] valueOf called!'
+x + 'abc'                // '[BigNumber Error] valueOf called!'
+
+ + + +

FAQ

+ +
Why are trailing fractional zeros removed from BigNumbers?
+

+ Some arbitrary-precision libraries retain trailing fractional zeros as they can indicate the + precision of a value. This can be useful but the results of arithmetic operations can be + misleading. +

+
+x = new BigDecimal("1.0")
+y = new BigDecimal("1.1000")
+z = x.add(y)                      // 2.1000
+
+x = new BigDecimal("1.20")
+y = new BigDecimal("3.45000")
+z = x.multiply(y)                 // 4.1400000
+

+ To specify the precision of a value is to specify that the value lies + within a certain range. +

+

+ In the first example, x has a value of 1.0. The trailing zero shows + the precision of the value, implying that it is in the range 0.95 to + 1.05. Similarly, the precision indicated by the trailing zeros of y + indicates that the value is in the range 1.09995 to 1.10005. +

+

+ If we add the two lowest values in the ranges we have, 0.95 + 1.09995 = 2.04995, + and if we add the two highest values we have, 1.05 + 1.10005 = 2.15005, so the + range of the result of the addition implied by the precision of its operands is + 2.04995 to 2.15005. +

+

+ The result given by BigDecimal of 2.1000 however, indicates that the value is in + the range 2.09995 to 2.10005 and therefore the precision implied by + its trailing zeros may be misleading. +

+

+ In the second example, the true range is 4.122744 to 4.157256 yet + the BigDecimal answer of 4.1400000 indicates a range of 4.13999995 + to 4.14000005. Again, the precision implied by the trailing zeros may be + misleading. +

+

+ This library, like binary floating point and most calculators, does not retain trailing + fractional zeros. Instead, the toExponential, toFixed and + toPrecision methods enable trailing zeros to be added if and when required.
+

+
+ + + diff --git a/node_modules/bignumber.js/package.json b/node_modules/bignumber.js/package.json new file mode 100644 index 0000000..885136c --- /dev/null +++ b/node_modules/bignumber.js/package.json @@ -0,0 +1,40 @@ +{ + "name": "bignumber.js", + "description": "A library for arbitrary-precision decimal and non-decimal arithmetic", + "version": "9.0.0", + "keywords": [ + "arbitrary", + "precision", + "arithmetic", + "big", + "number", + "decimal", + "float", + "biginteger", + "bigdecimal", + "bignumber", + "bigint", + "bignum" + ], + "repository": { + "type": "git", + "url": "https://github.com/MikeMcl/bignumber.js.git" + }, + "main": "bignumber", + "module": "bignumber.mjs", + "browser": "bignumber.js", + "types": "bignumber.d.ts", + "author": { + "name": "Michael Mclaughlin", + "email": "M8ch88l@gmail.com" + }, + "engines": { + "node": "*" + }, + "license": "MIT", + "scripts": { + "test": "node test/test", + "build": "uglifyjs bignumber.js --source-map -c -m -o bignumber.min.js" + }, + "dependencies": {} +} diff --git a/node_modules/body-parser/HISTORY.md b/node_modules/body-parser/HISTORY.md index b892491..fb212b3 100644 --- a/node_modules/body-parser/HISTORY.md +++ b/node_modules/body-parser/HISTORY.md @@ -1,11 +1,3 @@ -1.20.2 / 2023-02-21 -=================== - - * Fix strict json error message on Node.js 19+ - * deps: content-type@~1.0.5 - - perf: skip value escaping when unnecessary - * deps: raw-body@2.5.2 - 1.20.1 / 2022-10-06 =================== diff --git a/node_modules/body-parser/README.md b/node_modules/body-parser/README.md index 38553bf..c507cbb 100644 --- a/node_modules/body-parser/README.md +++ b/node_modules/body-parser/README.md @@ -1,8 +1,8 @@ # body-parser -[![NPM Version][npm-version-image]][npm-url] -[![NPM Downloads][npm-downloads-image]][npm-url] -[![Build Status][ci-image]][ci-url] +[![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. @@ -454,12 +454,11 @@ app.use(bodyParser.text({ type: 'text/html' })) [MIT](LICENSE) -[ci-image]: https://badgen.net/github/checks/expressjs/body-parser/master?label=ci -[ci-url]: https://github.com/expressjs/body-parser/actions/workflows/ci.yml -[coveralls-image]: https://badgen.net/coveralls/c/github/expressjs/body-parser/master -[coveralls-url]: https://coveralls.io/r/expressjs/body-parser?branch=master -[node-version-image]: https://badgen.net/npm/node/body-parser -[node-version-url]: https://nodejs.org/en/download -[npm-downloads-image]: https://badgen.net/npm/dm/body-parser +[npm-image]: https://img.shields.io/npm/v/body-parser.svg [npm-url]: https://npmjs.org/package/body-parser -[npm-version-image]: https://badgen.net/npm/v/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/lib/types/json.js b/node_modules/body-parser/lib/types/json.js index 59f3f7e..c2745be 100644 --- a/node_modules/body-parser/lib/types/json.js +++ b/node_modules/body-parser/lib/types/json.js @@ -39,9 +39,6 @@ module.exports = json var FIRST_CHAR_REGEXP = /^[\x20\x09\x0a\x0d]*([^\x20\x09\x0a\x0d])/ // eslint-disable-line no-control-regex -var JSON_SYNTAX_CHAR = '#' -var JSON_SYNTAX_REGEXP = /#+/g - /** * Create a middleware to parse JSON bodies. * @@ -155,23 +152,15 @@ function json (options) { function createStrictSyntaxError (str, char) { var index = str.indexOf(char) - var partial = '' - - if (index !== -1) { - partial = str.substring(0, index) + JSON_SYNTAX_CHAR - - for (var i = index + 1; i < str.length; i++) { - partial += JSON_SYNTAX_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(JSON_SYNTAX_REGEXP, function (placeholder) { - return str.substring(index, index + placeholder.length) - }), + message: e.message.replace('#', char), stack: e.stack }) } diff --git a/node_modules/body-parser/package.json b/node_modules/body-parser/package.json index 4637304..9cd2ccb 100644 --- a/node_modules/body-parser/package.json +++ b/node_modules/body-parser/package.json @@ -1,7 +1,7 @@ { "name": "body-parser", "description": "Node.js body parsing middleware", - "version": "1.20.2", + "version": "1.20.1", "contributors": [ "Douglas Christopher Wilson ", "Jonathan Ong (http://jongleberry.com)" @@ -10,7 +10,7 @@ "repository": "expressjs/body-parser", "dependencies": { "bytes": "3.1.2", - "content-type": "~1.0.5", + "content-type": "~1.0.4", "debug": "2.6.9", "depd": "2.0.0", "destroy": "1.2.0", @@ -18,23 +18,23 @@ "iconv-lite": "0.4.24", "on-finished": "2.4.1", "qs": "6.11.0", - "raw-body": "2.5.2", + "raw-body": "2.5.1", "type-is": "~1.6.18", "unpipe": "1.0.0" }, "devDependencies": { - "eslint": "8.34.0", + "eslint": "8.24.0", "eslint-config-standard": "14.1.1", - "eslint-plugin-import": "2.27.5", + "eslint-plugin-import": "2.26.0", "eslint-plugin-markdown": "3.0.0", "eslint-plugin-node": "11.1.0", - "eslint-plugin-promise": "6.1.1", + "eslint-plugin-promise": "6.0.1", "eslint-plugin-standard": "4.1.0", "methods": "1.1.2", - "mocha": "10.2.0", + "mocha": "10.0.0", "nyc": "15.1.0", "safe-buffer": "5.2.1", - "supertest": "6.3.3" + "supertest": "6.3.0" }, "files": [ "lib/", diff --git a/node_modules/content-disposition/HISTORY.md b/node_modules/content-disposition/HISTORY.md index 1192551..488effa 100644 --- a/node_modules/content-disposition/HISTORY.md +++ b/node_modules/content-disposition/HISTORY.md @@ -1,3 +1,23 @@ +0.5.4 / 2021-12-10 +================== + + * deps: safe-buffer@5.2.1 + +0.5.3 / 2018-12-17 +================== + + * Use `safe-buffer` for improved Buffer API + +0.5.2 / 2016-12-08 +================== + + * Fix `parse` to accept any linear whitespace character + +0.5.1 / 2016-01-17 +================== + + * perf: enable strict mode + 0.5.0 / 2014-10-11 ================== diff --git a/node_modules/content-disposition/LICENSE b/node_modules/content-disposition/LICENSE index b7dce6c..84441fb 100644 --- a/node_modules/content-disposition/LICENSE +++ b/node_modules/content-disposition/LICENSE @@ -1,6 +1,6 @@ (The MIT License) -Copyright (c) 2014 Douglas Christopher Wilson +Copyright (c) 2014-2017 Douglas Christopher Wilson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/node_modules/content-disposition/README.md b/node_modules/content-disposition/README.md index d265431..3a0bb05 100644 --- a/node_modules/content-disposition/README.md +++ b/node_modules/content-disposition/README.md @@ -3,7 +3,7 @@ [![NPM Version][npm-image]][npm-url] [![NPM Downloads][downloads-image]][downloads-url] [![Node.js Version][node-version-image]][node-version-url] -[![Build Status][travis-image]][travis-url] +[![Build Status][github-actions-ci-image]][github-actions-ci-url] [![Test Coverage][coveralls-image]][coveralls-url] Create and parse HTTP `Content-Disposition` header @@ -67,7 +67,7 @@ it). The type is normalized to lower-case. ### contentDisposition.parse(string) ```js -var disposition = contentDisposition.parse('attachment; filename="EURO rates.txt"; filename*=UTF-8\'\'%e2%82%ac%20rates.txt"'); +var disposition = contentDisposition.parse('attachment; filename="EURO rates.txt"; filename*=UTF-8\'\'%e2%82%ac%20rates.txt') ``` Parse a `Content-Disposition` header string. This automatically handles extended @@ -88,12 +88,13 @@ are shown for the string `'attachment; filename="EURO rates.txt"; filename*=UTF- ```js var contentDisposition = require('content-disposition') var destroy = require('destroy') +var fs = require('fs') var http = require('http') var onFinished = require('on-finished') var filePath = '/path/to/public/plans.pdf' -http.createServer(function onRequest(req, res) { +http.createServer(function onRequest (req, res) { // set headers res.setHeader('Content-Type', 'application/pdf') res.setHeader('Content-Disposition', contentDisposition(filePath)) @@ -101,7 +102,7 @@ http.createServer(function onRequest(req, res) { // send file var stream = fs.createReadStream(filePath) stream.pipe(res) - onFinished(res, function (err) { + onFinished(res, function () { destroy(stream) }) }) @@ -129,13 +130,13 @@ $ npm test [MIT](LICENSE) -[npm-image]: https://img.shields.io/npm/v/content-disposition.svg?style=flat +[npm-image]: https://img.shields.io/npm/v/content-disposition.svg [npm-url]: https://npmjs.org/package/content-disposition -[node-version-image]: https://img.shields.io/node/v/content-disposition.svg?style=flat -[node-version-url]: http://nodejs.org/download/ -[travis-image]: https://img.shields.io/travis/jshttp/content-disposition.svg?style=flat -[travis-url]: https://travis-ci.org/jshttp/content-disposition -[coveralls-image]: https://img.shields.io/coveralls/jshttp/content-disposition.svg?style=flat +[node-version-image]: https://img.shields.io/node/v/content-disposition.svg +[node-version-url]: https://nodejs.org/en/download +[coveralls-image]: https://img.shields.io/coveralls/jshttp/content-disposition.svg [coveralls-url]: https://coveralls.io/r/jshttp/content-disposition?branch=master -[downloads-image]: https://img.shields.io/npm/dm/content-disposition.svg?style=flat +[downloads-image]: https://img.shields.io/npm/dm/content-disposition.svg [downloads-url]: https://npmjs.org/package/content-disposition +[github-actions-ci-image]: https://img.shields.io/github/workflow/status/jshttp/content-disposition/ci/master?label=ci +[github-actions-ci-url]: https://github.com/jshttp/content-disposition?query=workflow%3Aci diff --git a/node_modules/content-disposition/index.js b/node_modules/content-disposition/index.js index fa3bc74..ecec899 100644 --- a/node_modules/content-disposition/index.js +++ b/node_modules/content-disposition/index.js @@ -1,11 +1,14 @@ /*! * content-disposition - * Copyright(c) 2014 Douglas Christopher Wilson + * Copyright(c) 2014-2017 Douglas Christopher Wilson * MIT Licensed */ +'use strict' + /** * Module exports. + * @public */ module.exports = contentDisposition @@ -13,43 +16,50 @@ module.exports.parse = parse /** * Module dependencies. + * @private */ var basename = require('path').basename +var Buffer = require('safe-buffer').Buffer /** * RegExp to match non attr-char, *after* encodeURIComponent (i.e. not including "%") + * @private */ -var encodeUriAttrCharRegExp = /[\x00-\x20"'\(\)*,\/:;<=>?@\[\\\]\{\}\x7f]/g +var ENCODE_URL_ATTR_CHAR_REGEXP = /[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g // eslint-disable-line no-control-regex /** * RegExp to match percent encoding escape. + * @private */ -var hexEscapeRegExp = /%[0-9A-Fa-f]{2}/ -var hexEscapeReplaceRegExp = /%([0-9A-Fa-f]{2})/g +var HEX_ESCAPE_REGEXP = /%[0-9A-Fa-f]{2}/ +var HEX_ESCAPE_REPLACE_REGEXP = /%([0-9A-Fa-f]{2})/g /** * RegExp to match non-latin1 characters. + * @private */ -var nonLatin1RegExp = /[^\x20-\x7e\xa0-\xff]/g +var NON_LATIN1_REGEXP = /[^\x20-\x7e\xa0-\xff]/g /** * RegExp to match quoted-pair in RFC 2616 * * quoted-pair = "\" CHAR * CHAR = + * @private */ -var qescRegExp = /\\([\u0000-\u007f])/g; +var QESC_REGEXP = /\\([\u0000-\u007f])/g // eslint-disable-line no-control-regex /** * RegExp to match chars that must be quoted-pair in RFC 2616 + * @private */ -var quoteRegExp = /([\\"])/g +var QUOTE_REGEXP = /([\\"])/g /** * RegExp for various RFC 2616 grammar @@ -73,11 +83,12 @@ var quoteRegExp = /([\\"])/g * HT = * CTL = * OCTET = + * @private */ -var paramRegExp = /; *([!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+) *= *("(?:[ !\x23-\x5b\x5d-\x7e\x80-\xff]|\\[\x20-\x7e])*"|[!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+) */g -var textRegExp = /^[\x20-\x7e\x80-\xff]+$/ -var tokenRegExp = /^[!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+$/ +var PARAM_REGEXP = /;[\x09\x20]*([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*=[\x09\x20]*("(?:[\x20!\x23-\x5b\x5d-\x7e\x80-\xff]|\\[\x20-\x7e])*"|[!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*/g // eslint-disable-line no-control-regex +var TEXT_REGEXP = /^[\x20-\x7e\x80-\xff]+$/ +var TOKEN_REGEXP = /^[!#$%&'*+.0-9A-Z^_`a-z|~-]+$/ /** * RegExp for various RFC 5987 grammar @@ -98,9 +109,10 @@ var tokenRegExp = /^[!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+$/ * attr-char = ALPHA / DIGIT * / "!" / "#" / "$" / "&" / "+" / "-" / "." * / "^" / "_" / "`" / "|" / "~" + * @private */ -var extValueRegExp = /^([A-Za-z0-9!#$%&+\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z]{3}){0,3}|[A-Za-z]{4,8}|)'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+\-\.^_`|~])+)$/ +var EXT_VALUE_REGEXP = /^([A-Za-z0-9!#$%&+\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z]{3}){0,3}|[A-Za-z]{4,8}|)'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+.^_`|~-])+)$/ /** * RegExp for various RFC 6266 grammar @@ -113,9 +125,10 @@ var extValueRegExp = /^([A-Za-z0-9!#$%&+\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z] * disp-ext-parm = token "=" value * | ext-token "=" ext-value * ext-token = + * @private */ -var dispositionTypeRegExp = /^([!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+) *(?:$|;)/ +var DISPOSITION_TYPE_REGEXP = /^([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*(?:$|;)/ // eslint-disable-line no-control-regex /** * Create an attachment Content-Disposition header. @@ -125,10 +138,10 @@ var dispositionTypeRegExp = /^([!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+) *(?:$|;)/ * @param {string} [options.type=attachment] * @param {string|boolean} [options.fallback=true] * @return {string} - * @api public + * @public */ -function contentDisposition(filename, options) { +function contentDisposition (filename, options) { var opts = options || {} // get type @@ -147,10 +160,10 @@ function contentDisposition(filename, options) { * @param {string} [filename] * @param {string|boolean} [fallback=true] * @return {object} - * @api private + * @private */ -function createparams(filename, fallback) { +function createparams (filename, fallback) { if (filename === undefined) { return } @@ -170,7 +183,7 @@ function createparams(filename, fallback) { throw new TypeError('fallback must be a string or boolean') } - if (typeof fallback === 'string' && nonLatin1RegExp.test(fallback)) { + if (typeof fallback === 'string' && NON_LATIN1_REGEXP.test(fallback)) { throw new TypeError('fallback must be ISO-8859-1 string') } @@ -178,7 +191,7 @@ function createparams(filename, fallback) { var name = basename(filename) // determine if name is suitable for quoted string - var isQuotedString = textRegExp.test(name) + var isQuotedString = TEXT_REGEXP.test(name) // generate fallback name var fallbackName = typeof fallback !== 'string' @@ -187,7 +200,7 @@ function createparams(filename, fallback) { var hasFallback = typeof fallbackName === 'string' && fallbackName !== name // set extended filename parameter - if (hasFallback || !isQuotedString || hexEscapeRegExp.test(name)) { + if (hasFallback || !isQuotedString || HEX_ESCAPE_REGEXP.test(name)) { params['filename*'] = name } @@ -208,14 +221,14 @@ function createparams(filename, fallback) { * @param {string} obj.type * @param {object} [obj.parameters] * @return {string} - * @api private + * @private */ -function format(obj) { +function format (obj) { var parameters = obj.parameters var type = obj.type - if (!type || typeof type !== 'string' || !tokenRegExp.test(type)) { + if (!type || typeof type !== 'string' || !TOKEN_REGEXP.test(type)) { throw new TypeError('invalid type') } @@ -242,15 +255,15 @@ function format(obj) { } /** - * Decode a RFC 6987 field value (gracefully). + * Decode a RFC 5987 field value (gracefully). * * @param {string} str * @return {string} - * @api private + * @private */ -function decodefield(str) { - var match = extValueRegExp.exec(str) +function decodefield (str) { + var match = EXT_VALUE_REGEXP.exec(str) if (!match) { throw new TypeError('invalid extended field value') @@ -261,14 +274,14 @@ function decodefield(str) { var value // to binary string - var binary = encoded.replace(hexEscapeReplaceRegExp, pdecode) + var binary = encoded.replace(HEX_ESCAPE_REPLACE_REGEXP, pdecode) switch (charset) { case 'iso-8859-1': value = getlatin1(binary) break case 'utf-8': - value = new Buffer(binary, 'binary').toString('utf8') + value = Buffer.from(binary, 'binary').toString('utf8') break default: throw new TypeError('unsupported charset in extended field') @@ -282,12 +295,12 @@ function decodefield(str) { * * @param {string} val * @return {string} - * @api private + * @private */ -function getlatin1(val) { +function getlatin1 (val) { // simple Unicode -> ISO-8859-1 transformation - return String(val).replace(nonLatin1RegExp, '?') + return String(val).replace(NON_LATIN1_REGEXP, '?') } /** @@ -295,15 +308,15 @@ function getlatin1(val) { * * @param {string} string * @return {object} - * @api private + * @public */ -function parse(string) { +function parse (string) { if (!string || typeof string !== 'string') { throw new TypeError('argument string is required') } - var match = dispositionTypeRegExp.exec(string) + var match = DISPOSITION_TYPE_REGEXP.exec(string) if (!match) { throw new TypeError('invalid type format') @@ -319,12 +332,12 @@ function parse(string) { var value // calculate index to start at - index = paramRegExp.lastIndex = match[0].substr(-1) === ';' + index = PARAM_REGEXP.lastIndex = match[0].substr(-1) === ';' ? index - 1 : index // match parameters - while (match = paramRegExp.exec(string)) { + while ((match = PARAM_REGEXP.exec(string))) { if (match.index !== index) { throw new TypeError('invalid parameter format') } @@ -357,7 +370,7 @@ function parse(string) { // remove quotes and escapes value = value .substr(1, value.length - 2) - .replace(qescRegExp, '$1') + .replace(QESC_REGEXP, '$1') } params[key] = value @@ -376,10 +389,10 @@ function parse(string) { * @param {string} str * @param {string} hex * @return {string} - * @api private + * @private */ -function pdecode(str, hex) { +function pdecode (str, hex) { return String.fromCharCode(parseInt(hex, 16)) } @@ -388,17 +401,14 @@ function pdecode(str, hex) { * * @param {string} char * @return {string} - * @api private + * @private */ -function pencode(char) { - var hex = String(char) +function pencode (char) { + return '%' + String(char) .charCodeAt(0) .toString(16) .toUpperCase() - return hex.length === 1 - ? '%0' + hex - : '%' + hex } /** @@ -406,13 +416,13 @@ function pencode(char) { * * @param {string} val * @return {string} - * @api private + * @private */ -function qstring(val) { +function qstring (val) { var str = String(val) - return '"' + str.replace(quoteRegExp, '\\$1') + '"' + return '"' + str.replace(QUOTE_REGEXP, '\\$1') + '"' } /** @@ -420,24 +430,29 @@ function qstring(val) { * * @param {string} val * @return {string} - * @api private + * @private */ -function ustring(val) { +function ustring (val) { var str = String(val) // percent encode as UTF-8 var encoded = encodeURIComponent(str) - .replace(encodeUriAttrCharRegExp, pencode) + .replace(ENCODE_URL_ATTR_CHAR_REGEXP, pencode) return 'UTF-8\'\'' + encoded } /** * Class for parsed Content-Disposition header for v8 optimization + * + * @public + * @param {string} type + * @param {object} parameters + * @constructor */ -function ContentDisposition(type, parameters) { +function ContentDisposition (type, parameters) { this.type = type this.parameters = parameters } diff --git a/node_modules/content-disposition/package.json b/node_modules/content-disposition/package.json index f1423bc..43c70ce 100644 --- a/node_modules/content-disposition/package.json +++ b/node_modules/content-disposition/package.json @@ -1,10 +1,8 @@ { "name": "content-disposition", "description": "Create and parse Content-Disposition header", - "version": "0.5.0", - "contributors": [ - "Douglas Christopher Wilson " - ], + "version": "0.5.4", + "author": "Douglas Christopher Wilson ", "license": "MIT", "keywords": [ "content-disposition", @@ -13,9 +11,20 @@ "res" ], "repository": "jshttp/content-disposition", + "dependencies": { + "safe-buffer": "5.2.1" + }, "devDependencies": { - "istanbul": "0.3.2", - "mocha": "~1.21.4" + "deep-equal": "1.0.1", + "eslint": "7.32.0", + "eslint-config-standard": "13.0.1", + "eslint-plugin-import": "2.25.3", + "eslint-plugin-markdown": "2.2.1", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "5.2.0", + "eslint-plugin-standard": "4.1.0", + "istanbul": "0.4.5", + "mocha": "9.1.3" }, "files": [ "LICENSE", @@ -27,8 +36,9 @@ "node": ">= 0.6" }, "scripts": { + "lint": "eslint .", "test": "mocha --reporter spec --bail --check-leaks test/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/" } } diff --git a/node_modules/cookie/HISTORY.md b/node_modules/cookie/HISTORY.md new file mode 100644 index 0000000..ae9b995 --- /dev/null +++ b/node_modules/cookie/HISTORY.md @@ -0,0 +1,142 @@ +0.5.0 / 2022-04-11 +================== + + * Add `priority` option + * Fix `expires` option to reject invalid dates + * pref: improve default decode speed + * pref: remove slow string split in parse + +0.4.2 / 2022-02-02 +================== + + * pref: read value only when assigning in parse + * pref: remove unnecessary regexp in parse + +0.4.1 / 2020-04-21 +================== + + * Fix `maxAge` option to reject invalid values + +0.4.0 / 2019-05-15 +================== + + * Add `SameSite=None` support + +0.3.1 / 2016-05-26 +================== + + * Fix `sameSite: true` to work with draft-7 clients + - `true` now sends `SameSite=Strict` instead of `SameSite` + +0.3.0 / 2016-05-26 +================== + + * Add `sameSite` option + - Replaces `firstPartyOnly` option, never implemented by browsers + * Improve error message when `encode` is not a function + * Improve error message when `expires` is not a `Date` + +0.2.4 / 2016-05-20 +================== + + * perf: enable strict mode + * perf: use for loop in parse + * perf: use string concatination for serialization + +0.2.3 / 2015-10-25 +================== + + * Fix cookie `Max-Age` to never be a floating point number + +0.2.2 / 2015-09-17 +================== + + * Fix regression when setting empty cookie value + - Ease the new restriction, which is just basic header-level validation + * Fix typo in invalid value errors + +0.2.1 / 2015-09-17 +================== + + * Throw on invalid values provided to `serialize` + - Ensures the resulting string is a valid HTTP header value + +0.2.0 / 2015-08-13 +================== + + * Add `firstPartyOnly` option + * Throw better error for invalid argument to parse + * perf: hoist regular expression + +0.1.5 / 2015-09-17 +================== + + * Fix regression when setting empty cookie value + - Ease the new restriction, which is just basic header-level validation + * Fix typo in invalid value errors + +0.1.4 / 2015-09-17 +================== + + * Throw better error for invalid argument to parse + * Throw on invalid values provided to `serialize` + - Ensures the resulting string is a valid HTTP header value + +0.1.3 / 2015-05-19 +================== + + * Reduce the scope of try-catch deopt + * Remove argument reassignments + +0.1.2 / 2014-04-16 +================== + + * Remove unnecessary files from npm package + +0.1.1 / 2014-02-23 +================== + + * Fix bad parse when cookie value contained a comma + * Fix support for `maxAge` of `0` + +0.1.0 / 2013-05-01 +================== + + * Add `decode` option + * Add `encode` option + +0.0.6 / 2013-04-08 +================== + + * Ignore cookie parts missing `=` + +0.0.5 / 2012-10-29 +================== + + * Return raw cookie value if value unescape errors + +0.0.4 / 2012-06-21 +================== + + * Use encode/decodeURIComponent for cookie encoding/decoding + - Improve server/client interoperability + +0.0.3 / 2012-06-06 +================== + + * Only escape special characters per the cookie RFC + +0.0.2 / 2012-06-01 +================== + + * Fix `maxAge` option to not throw error + +0.0.1 / 2012-05-28 +================== + + * Add more tests + +0.0.0 / 2012-05-28 +================== + + * Initial release diff --git a/node_modules/cookie/LICENSE b/node_modules/cookie/LICENSE index 0855435..058b6b4 100644 --- a/node_modules/cookie/LICENSE +++ b/node_modules/cookie/LICENSE @@ -1,23 +1,24 @@ -(The MIT License) - -Copyright (c) 2012-2014 Roman Shtylman - -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. - +(The MIT License) + +Copyright (c) 2012-2014 Roman Shtylman +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/cookie/README.md b/node_modules/cookie/README.md index acdb5c2..5449c3a 100644 --- a/node_modules/cookie/README.md +++ b/node_modules/cookie/README.md @@ -1,64 +1,302 @@ -# cookie - -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Node.js Version][node-version-image]][node-version-url] -[![Build Status][travis-image]][travis-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -cookie is a basic cookie parser and serializer. It doesn't make assumptions about how you are going to deal with your cookies. It basically just provides a way to read and write the HTTP cookie headers. - -See [RFC6265](http://tools.ietf.org/html/rfc6265) for details about the http header for cookies. - -## how? - -``` -npm install cookie -``` - -```javascript -var cookie = require('cookie'); - -var hdr = cookie.serialize('foo', 'bar'); -// hdr = 'foo=bar'; - -var cookies = cookie.parse('foo=bar; cat=meow; dog=ruff'); -// cookies = { foo: 'bar', cat: 'meow', dog: 'ruff' }; -``` - -## more - -The serialize function takes a third parameter, an object, to set cookie options. See the RFC for valid values. - -### path -> cookie path - -### expires -> absolute expiration date for the cookie (Date object) - -### maxAge -> relative max age of the cookie from when the client receives it (seconds) - -### domain -> domain for the cookie - -### secure -> true or false - -### httpOnly -> true or false - -## License - -[MIT](LICENSE) - -[npm-image]: https://img.shields.io/npm/v/cookie.svg -[npm-url]: https://npmjs.org/package/cookie -[node-version-image]: https://img.shields.io/node/v/cookie.svg -[node-version-url]: http://nodejs.org/download/ -[travis-image]: https://img.shields.io/travis/jshttp/cookie/master.svg -[travis-url]: https://travis-ci.org/jshttp/cookie -[coveralls-image]: https://img.shields.io/coveralls/jshttp/cookie/master.svg -[coveralls-url]: https://coveralls.io/r/jshttp/cookie?branch=master -[downloads-image]: https://img.shields.io/npm/dm/cookie.svg -[downloads-url]: https://npmjs.org/package/cookie +# cookie + +[![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] + +Basic HTTP cookie parser and serializer for HTTP servers. + +## 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 cookie +``` + +## API + +```js +var cookie = require('cookie'); +``` + +### cookie.parse(str, options) + +Parse an HTTP `Cookie` header string and returning an object of all cookie name-value pairs. +The `str` argument is the string representing a `Cookie` header value and `options` is an +optional object containing additional parsing options. + +```js +var cookies = cookie.parse('foo=bar; equation=E%3Dmc%5E2'); +// { foo: 'bar', equation: 'E=mc^2' } +``` + +#### Options + +`cookie.parse` accepts these properties in the options object. + +##### decode + +Specifies a function that will be used to decode a cookie's value. Since the value of a cookie +has a limited character set (and must be a simple string), this function can be used to decode +a previously-encoded cookie value into a JavaScript string or other object. + +The default function is the global `decodeURIComponent`, which will decode any URL-encoded +sequences into their byte representations. + +**note** if an error is thrown from this function, the original, non-decoded cookie value will +be returned as the cookie's value. + +### cookie.serialize(name, value, options) + +Serialize a cookie name-value pair into a `Set-Cookie` header string. The `name` argument is the +name for the cookie, the `value` argument is the value to set the cookie to, and the `options` +argument is an optional object containing additional serialization options. + +```js +var setCookie = cookie.serialize('foo', 'bar'); +// foo=bar +``` + +#### Options + +`cookie.serialize` accepts these properties in the options object. + +##### domain + +Specifies the value for the [`Domain` `Set-Cookie` attribute][rfc-6265-5.2.3]. By default, no +domain is set, and most clients will consider the cookie to apply to only the current domain. + +##### encode + +Specifies a function that will be used to encode a cookie's value. Since value of a cookie +has a limited character set (and must be a simple string), this function can be used to encode +a value into a string suited for a cookie's value. + +The default function is the global `encodeURIComponent`, which will encode a JavaScript string +into UTF-8 byte sequences and then URL-encode any that fall outside of the cookie range. + +##### expires + +Specifies the `Date` object to be the value for the [`Expires` `Set-Cookie` attribute][rfc-6265-5.2.1]. +By default, no expiration is set, and most clients will consider this a "non-persistent cookie" and +will delete it on a condition like exiting a web browser application. + +**note** the [cookie storage model specification][rfc-6265-5.3] states that if both `expires` and +`maxAge` are set, then `maxAge` takes precedence, but it is possible not all clients by obey this, +so if both are set, they should point to the same date and time. + +##### httpOnly + +Specifies the `boolean` value for the [`HttpOnly` `Set-Cookie` attribute][rfc-6265-5.2.6]. When truthy, +the `HttpOnly` attribute is set, otherwise it is not. By default, the `HttpOnly` attribute is not set. + +**note** be careful when setting this to `true`, as compliant clients will not allow client-side +JavaScript to see the cookie in `document.cookie`. + +##### maxAge + +Specifies the `number` (in seconds) to be the value for the [`Max-Age` `Set-Cookie` attribute][rfc-6265-5.2.2]. +The given number will be converted to an integer by rounding down. By default, no maximum age is set. + +**note** the [cookie storage model specification][rfc-6265-5.3] states that if both `expires` and +`maxAge` are set, then `maxAge` takes precedence, but it is possible not all clients by obey this, +so if both are set, they should point to the same date and time. + +##### path + +Specifies the value for the [`Path` `Set-Cookie` attribute][rfc-6265-5.2.4]. By default, the path +is considered the ["default path"][rfc-6265-5.1.4]. + +##### priority + +Specifies the `string` to be the value for the [`Priority` `Set-Cookie` attribute][rfc-west-cookie-priority-00-4.1]. + + - `'low'` will set the `Priority` attribute to `Low`. + - `'medium'` will set the `Priority` attribute to `Medium`, the default priority when not set. + - `'high'` will set the `Priority` attribute to `High`. + +More information about the different priority levels can be found in +[the specification][rfc-west-cookie-priority-00-4.1]. + +**note** This is an attribute that has not yet been fully standardized, and may change in the future. +This also means many clients may ignore this attribute until they understand it. + +##### sameSite + +Specifies the `boolean` or `string` to be the value for the [`SameSite` `Set-Cookie` attribute][rfc-6265bis-09-5.4.7]. + + - `true` will set the `SameSite` attribute to `Strict` for strict same site enforcement. + - `false` will not set the `SameSite` attribute. + - `'lax'` will set the `SameSite` attribute to `Lax` for lax same site enforcement. + - `'none'` will set the `SameSite` attribute to `None` for an explicit cross-site cookie. + - `'strict'` will set the `SameSite` attribute to `Strict` for strict same site enforcement. + +More information about the different enforcement levels can be found in +[the specification][rfc-6265bis-09-5.4.7]. + +**note** This is an attribute that has not yet been fully standardized, and may change in the future. +This also means many clients may ignore this attribute until they understand it. + +##### secure + +Specifies the `boolean` value for the [`Secure` `Set-Cookie` attribute][rfc-6265-5.2.5]. When truthy, +the `Secure` attribute is set, otherwise it is not. By default, the `Secure` attribute is not set. + +**note** be careful when setting this to `true`, as compliant clients will not send the cookie back to +the server in the future if the browser does not have an HTTPS connection. + +## Example + +The following example uses this module in conjunction with the Node.js core HTTP server +to prompt a user for their name and display it back on future visits. + +```js +var cookie = require('cookie'); +var escapeHtml = require('escape-html'); +var http = require('http'); +var url = require('url'); + +function onRequest(req, res) { + // Parse the query string + var query = url.parse(req.url, true, true).query; + + if (query && query.name) { + // Set a new cookie with the name + res.setHeader('Set-Cookie', cookie.serialize('name', String(query.name), { + httpOnly: true, + maxAge: 60 * 60 * 24 * 7 // 1 week + })); + + // Redirect back after setting cookie + res.statusCode = 302; + res.setHeader('Location', req.headers.referer || '/'); + res.end(); + return; + } + + // Parse the cookies on the request + var cookies = cookie.parse(req.headers.cookie || ''); + + // Get the visitor name set in the cookie + var name = cookies.name; + + res.setHeader('Content-Type', 'text/html; charset=UTF-8'); + + if (name) { + res.write('

Welcome back, ' + escapeHtml(name) + '!

'); + } else { + res.write('

Hello, new visitor!

'); + } + + res.write('
'); + res.write(' '); + res.end('
'); +} + +http.createServer(onRequest).listen(3000); +``` + +## Testing + +```sh +$ npm test +``` + +## Benchmark + +``` +$ npm run bench + +> cookie@0.4.2 bench +> node benchmark/index.js + + node@16.14.0 + v8@9.4.146.24-node.20 + uv@1.43.0 + zlib@1.2.11 + brotli@1.0.9 + ares@1.18.1 + modules@93 + nghttp2@1.45.1 + napi@8 + llhttp@6.0.4 + openssl@1.1.1m+quic + cldr@40.0 + icu@70.1 + tz@2021a3 + unicode@14.0 + ngtcp2@0.1.0-DEV + nghttp3@0.1.0-DEV + +> node benchmark/parse-top.js + + cookie.parse - top sites + + 15 tests completed. + + parse accounts.google.com x 2,421,245 ops/sec ±0.80% (188 runs sampled) + parse apple.com x 2,684,710 ops/sec ±0.59% (189 runs sampled) + parse cloudflare.com x 2,231,418 ops/sec ±0.76% (186 runs sampled) + parse docs.google.com x 2,316,357 ops/sec ±1.28% (187 runs sampled) + parse drive.google.com x 2,363,543 ops/sec ±0.49% (189 runs sampled) + parse en.wikipedia.org x 839,414 ops/sec ±0.53% (189 runs sampled) + parse linkedin.com x 553,797 ops/sec ±0.63% (190 runs sampled) + parse maps.google.com x 1,314,779 ops/sec ±0.72% (189 runs sampled) + parse microsoft.com x 153,783 ops/sec ±0.53% (190 runs sampled) + parse play.google.com x 2,249,574 ops/sec ±0.59% (187 runs sampled) + parse plus.google.com x 2,258,682 ops/sec ±0.60% (188 runs sampled) + parse sites.google.com x 2,247,069 ops/sec ±0.68% (189 runs sampled) + parse support.google.com x 1,456,840 ops/sec ±0.70% (187 runs sampled) + parse www.google.com x 1,046,028 ops/sec ±0.58% (188 runs sampled) + parse youtu.be x 937,428 ops/sec ±1.47% (190 runs sampled) + parse youtube.com x 963,878 ops/sec ±0.59% (190 runs sampled) + +> node benchmark/parse.js + + cookie.parse - generic + + 6 tests completed. + + simple x 2,745,604 ops/sec ±0.77% (185 runs sampled) + decode x 557,287 ops/sec ±0.60% (188 runs sampled) + unquote x 2,498,475 ops/sec ±0.55% (189 runs sampled) + duplicates x 868,591 ops/sec ±0.89% (187 runs sampled) + 10 cookies x 306,745 ops/sec ±0.49% (190 runs sampled) + 100 cookies x 22,414 ops/sec ±2.38% (182 runs sampled) +``` + +## References + +- [RFC 6265: HTTP State Management Mechanism][rfc-6265] +- [Same-site Cookies][rfc-6265bis-09-5.4.7] + +[rfc-west-cookie-priority-00-4.1]: https://tools.ietf.org/html/draft-west-cookie-priority-00#section-4.1 +[rfc-6265bis-09-5.4.7]: https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-09#section-5.4.7 +[rfc-6265]: https://tools.ietf.org/html/rfc6265 +[rfc-6265-5.1.4]: https://tools.ietf.org/html/rfc6265#section-5.1.4 +[rfc-6265-5.2.1]: https://tools.ietf.org/html/rfc6265#section-5.2.1 +[rfc-6265-5.2.2]: https://tools.ietf.org/html/rfc6265#section-5.2.2 +[rfc-6265-5.2.3]: https://tools.ietf.org/html/rfc6265#section-5.2.3 +[rfc-6265-5.2.4]: https://tools.ietf.org/html/rfc6265#section-5.2.4 +[rfc-6265-5.2.5]: https://tools.ietf.org/html/rfc6265#section-5.2.5 +[rfc-6265-5.2.6]: https://tools.ietf.org/html/rfc6265#section-5.2.6 +[rfc-6265-5.3]: https://tools.ietf.org/html/rfc6265#section-5.3 + +## License + +[MIT](LICENSE) + +[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/cookie/master +[coveralls-url]: https://coveralls.io/r/jshttp/cookie?branch=master +[github-actions-ci-image]: https://img.shields.io/github/workflow/status/jshttp/cookie/ci/master?label=ci +[github-actions-ci-url]: https://github.com/jshttp/cookie/actions/workflows/ci.yml +[node-version-image]: https://badgen.net/npm/node/cookie +[node-version-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/cookie +[npm-url]: https://npmjs.org/package/cookie +[npm-version-image]: https://badgen.net/npm/v/cookie diff --git a/node_modules/cookie/SECURITY.md b/node_modules/cookie/SECURITY.md new file mode 100644 index 0000000..fd4a6c5 --- /dev/null +++ b/node_modules/cookie/SECURITY.md @@ -0,0 +1,25 @@ +# Security Policies and Procedures + +## Reporting a Bug + +The `cookie` team and community take all security bugs seriously. Thank +you for improving the security of the project. 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 `cookie`. This +information can be found in the npm registry using the command +`npm owner ls cookie`. +If unsure or unable to get the information from the above, open an issue +in the [project issue tracker](https://github.com/jshttp/cookie/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/cookie/index.js b/node_modules/cookie/index.js index 8dea066..9c3d07d 100644 --- a/node_modules/cookie/index.js +++ b/node_modules/cookie/index.js @@ -1,116 +1,270 @@ -/*! - * cookie - * Copyright(c) 2012-2014 Roman Shtylman - * MIT Licensed - */ - -/** - * Module exports. - * @public - */ - -exports.parse = parse; -exports.serialize = serialize; - -/** - * Module variables. - * @private - */ - -var decode = decodeURIComponent; -var encode = encodeURIComponent; - -/** - * Parse a cookie header. - * - * Parse the given cookie header string into an object - * The object has the various cookies as keys(names) => values - * - * @param {string} str - * @param {object} [options] - * @return {string} - * @public - */ - -function parse(str, options) { - var obj = {} - var opt = options || {}; - var pairs = str.split(/; */); - var dec = opt.decode || decode; - - pairs.forEach(function(pair) { - var eq_idx = pair.indexOf('=') - - // skip things that don't look like key=value - if (eq_idx < 0) { - return; - } - - var key = pair.substr(0, eq_idx).trim() - var val = pair.substr(++eq_idx, pair.length).trim(); - - // quoted values - if ('"' == val[0]) { - val = val.slice(1, -1); - } - - // only assign once - if (undefined == obj[key]) { - obj[key] = tryDecode(val, dec); - } - }); - - return obj; -} - -/** - * Serialize data into a cookie header. - * - * Serialize the a name value pair into a cookie string suitable for - * http headers. An optional options object specified cookie parameters. - * - * serialize('foo', 'bar', { httpOnly: true }) - * => "foo=bar; httpOnly" - * - * @param {string} name - * @param {string} val - * @param {object} [options] - * @return {string} - * @public - */ - -function serialize(name, val, options) { - var opt = options || {}; - var enc = opt.encode || encode; - var pairs = [name + '=' + enc(val)]; - - if (null != opt.maxAge) { - var maxAge = opt.maxAge - 0; - if (isNaN(maxAge)) throw new Error('maxAge should be a Number'); - pairs.push('Max-Age=' + maxAge); - } - - if (opt.domain) pairs.push('Domain=' + opt.domain); - if (opt.path) pairs.push('Path=' + opt.path); - if (opt.expires) pairs.push('Expires=' + opt.expires.toUTCString()); - if (opt.httpOnly) pairs.push('HttpOnly'); - if (opt.secure) pairs.push('Secure'); - - return pairs.join('; '); -} - -/** - * Try decoding a string using a decoding function. - * - * @param {string} str - * @param {function} decode - * @private - */ - -function tryDecode(str, decode) { - try { - return decode(str); - } catch (e) { - return str; - } -} +/*! + * cookie + * Copyright(c) 2012-2014 Roman Shtylman + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module exports. + * @public + */ + +exports.parse = parse; +exports.serialize = serialize; + +/** + * Module variables. + * @private + */ + +var __toString = Object.prototype.toString + +/** + * RegExp to match field-content in RFC 7230 sec 3.2 + * + * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ] + * field-vchar = VCHAR / obs-text + * obs-text = %x80-FF + */ + +var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/; + +/** + * Parse a cookie header. + * + * Parse the given cookie header string into an object + * The object has the various cookies as keys(names) => values + * + * @param {string} str + * @param {object} [options] + * @return {object} + * @public + */ + +function parse(str, options) { + if (typeof str !== 'string') { + throw new TypeError('argument str must be a string'); + } + + var obj = {} + var opt = options || {}; + var dec = opt.decode || decode; + + var index = 0 + while (index < str.length) { + var eqIdx = str.indexOf('=', index) + + // no more cookie pairs + if (eqIdx === -1) { + break + } + + var endIdx = str.indexOf(';', index) + + if (endIdx === -1) { + endIdx = str.length + } else if (endIdx < eqIdx) { + // backtrack on prior semicolon + index = str.lastIndexOf(';', eqIdx - 1) + 1 + continue + } + + var key = str.slice(index, eqIdx).trim() + + // only assign once + if (undefined === obj[key]) { + var val = str.slice(eqIdx + 1, endIdx).trim() + + // quoted values + if (val.charCodeAt(0) === 0x22) { + val = val.slice(1, -1) + } + + obj[key] = tryDecode(val, dec); + } + + index = endIdx + 1 + } + + return obj; +} + +/** + * Serialize data into a cookie header. + * + * Serialize the a name value pair into a cookie string suitable for + * http headers. An optional options object specified cookie parameters. + * + * serialize('foo', 'bar', { httpOnly: true }) + * => "foo=bar; httpOnly" + * + * @param {string} name + * @param {string} val + * @param {object} [options] + * @return {string} + * @public + */ + +function serialize(name, val, options) { + var opt = options || {}; + var enc = opt.encode || encode; + + if (typeof enc !== 'function') { + throw new TypeError('option encode is invalid'); + } + + if (!fieldContentRegExp.test(name)) { + throw new TypeError('argument name is invalid'); + } + + var value = enc(val); + + if (value && !fieldContentRegExp.test(value)) { + throw new TypeError('argument val is invalid'); + } + + var str = name + '=' + value; + + if (null != opt.maxAge) { + var maxAge = opt.maxAge - 0; + + if (isNaN(maxAge) || !isFinite(maxAge)) { + throw new TypeError('option maxAge is invalid') + } + + str += '; Max-Age=' + Math.floor(maxAge); + } + + if (opt.domain) { + if (!fieldContentRegExp.test(opt.domain)) { + throw new TypeError('option domain is invalid'); + } + + str += '; Domain=' + opt.domain; + } + + if (opt.path) { + if (!fieldContentRegExp.test(opt.path)) { + throw new TypeError('option path is invalid'); + } + + str += '; Path=' + opt.path; + } + + if (opt.expires) { + var expires = opt.expires + + if (!isDate(expires) || isNaN(expires.valueOf())) { + throw new TypeError('option expires is invalid'); + } + + str += '; Expires=' + expires.toUTCString() + } + + if (opt.httpOnly) { + str += '; HttpOnly'; + } + + if (opt.secure) { + str += '; Secure'; + } + + if (opt.priority) { + var priority = typeof opt.priority === 'string' + ? opt.priority.toLowerCase() + : opt.priority + + switch (priority) { + case 'low': + str += '; Priority=Low' + break + case 'medium': + str += '; Priority=Medium' + break + case 'high': + str += '; Priority=High' + break + default: + throw new TypeError('option priority is invalid') + } + } + + if (opt.sameSite) { + var sameSite = typeof opt.sameSite === 'string' + ? opt.sameSite.toLowerCase() : opt.sameSite; + + switch (sameSite) { + case true: + str += '; SameSite=Strict'; + break; + case 'lax': + str += '; SameSite=Lax'; + break; + case 'strict': + str += '; SameSite=Strict'; + break; + case 'none': + str += '; SameSite=None'; + break; + default: + throw new TypeError('option sameSite is invalid'); + } + } + + return str; +} + +/** + * URL-decode string value. Optimized to skip native call when no %. + * + * @param {string} str + * @returns {string} + */ + +function decode (str) { + return str.indexOf('%') !== -1 + ? decodeURIComponent(str) + : str +} + +/** + * URL-encode value. + * + * @param {string} str + * @returns {string} + */ + +function encode (val) { + return encodeURIComponent(val) +} + +/** + * Determine if value is a Date. + * + * @param {*} val + * @private + */ + +function isDate (val) { + return __toString.call(val) === '[object Date]' || + val instanceof Date +} + +/** + * Try decoding a string using a decoding function. + * + * @param {string} str + * @param {function} decode + * @private + */ + +function tryDecode(str, decode) { + try { + return decode(str); + } catch (e) { + return str; + } +} diff --git a/node_modules/cookie/package.json b/node_modules/cookie/package.json index 09f305f..ed5606a 100644 --- a/node_modules/cookie/package.json +++ b/node_modules/cookie/package.json @@ -1,29 +1,44 @@ -{ - "name": "cookie", - "description": "cookie parsing and serialization", - "version": "0.1.3", - "author": "Roman Shtylman ", - "license": "MIT", - "keywords": [ - "cookie", - "cookies" - ], - "repository": "jshttp/cookie", - "devDependencies": { - "istanbul": "0.3.9", - "mocha": "1.x.x" - }, - "files": [ - "LICENSE", - "README.md", - "index.js" - ], - "engines": { - "node": "*" - }, - "scripts": { - "test": "mocha --reporter spec --bail --check-leaks test/", - "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/" - } -} +{ + "name": "cookie", + "description": "HTTP server cookie parsing and serialization", + "version": "0.5.0", + "author": "Roman Shtylman ", + "contributors": [ + "Douglas Christopher Wilson " + ], + "license": "MIT", + "keywords": [ + "cookie", + "cookies" + ], + "repository": "jshttp/cookie", + "devDependencies": { + "beautify-benchmark": "0.2.4", + "benchmark": "2.1.4", + "eslint": "7.32.0", + "eslint-plugin-markdown": "2.2.1", + "mocha": "9.2.2", + "nyc": "15.1.0", + "safe-buffer": "5.2.1", + "top-sites": "1.1.97" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "README.md", + "SECURITY.md", + "index.js" + ], + "engines": { + "node": ">= 0.6" + }, + "scripts": { + "bench": "node benchmark/index.js", + "lint": "eslint .", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-ci": "nyc --reporter=lcov --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test", + "update-bench": "node scripts/update-benchmark.js", + "version": "node scripts/version-history.js && git add HISTORY.md" + } +} diff --git a/node_modules/send/node_modules/statuses/LICENSE b/node_modules/core-util-is/LICENSE similarity index 62% rename from node_modules/send/node_modules/statuses/LICENSE rename to node_modules/core-util-is/LICENSE index a7ae8ee..d8d7f94 100644 --- a/node_modules/send/node_modules/statuses/LICENSE +++ b/node_modules/core-util-is/LICENSE @@ -1,13 +1,10 @@ - -The MIT License (MIT) - -Copyright (c) 2014 Jonathan Ong me@jongleberry.com +Copyright Node.js contributors. All rights reserved. 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 +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 @@ -17,6 +14,6 @@ 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. +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/core-util-is/README.md b/node_modules/core-util-is/README.md new file mode 100644 index 0000000..5a76b41 --- /dev/null +++ b/node_modules/core-util-is/README.md @@ -0,0 +1,3 @@ +# core-util-is + +The `util.is*` functions introduced in Node v0.12. diff --git a/node_modules/core-util-is/lib/util.js b/node_modules/core-util-is/lib/util.js new file mode 100644 index 0000000..6e5a20d --- /dev/null +++ b/node_modules/core-util-is/lib/util.js @@ -0,0 +1,107 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// 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. + +// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. + +function isArray(arg) { + if (Array.isArray) { + return Array.isArray(arg); + } + return objectToString(arg) === '[object Array]'; +} +exports.isArray = isArray; + +function isBoolean(arg) { + return typeof arg === 'boolean'; +} +exports.isBoolean = isBoolean; + +function isNull(arg) { + return arg === null; +} +exports.isNull = isNull; + +function isNullOrUndefined(arg) { + return arg == null; +} +exports.isNullOrUndefined = isNullOrUndefined; + +function isNumber(arg) { + return typeof arg === 'number'; +} +exports.isNumber = isNumber; + +function isString(arg) { + return typeof arg === 'string'; +} +exports.isString = isString; + +function isSymbol(arg) { + return typeof arg === 'symbol'; +} +exports.isSymbol = isSymbol; + +function isUndefined(arg) { + return arg === void 0; +} +exports.isUndefined = isUndefined; + +function isRegExp(re) { + return objectToString(re) === '[object RegExp]'; +} +exports.isRegExp = isRegExp; + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} +exports.isObject = isObject; + +function isDate(d) { + return objectToString(d) === '[object Date]'; +} +exports.isDate = isDate; + +function isError(e) { + return (objectToString(e) === '[object Error]' || e instanceof Error); +} +exports.isError = isError; + +function isFunction(arg) { + return typeof arg === 'function'; +} +exports.isFunction = isFunction; + +function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; +} +exports.isPrimitive = isPrimitive; + +exports.isBuffer = require('buffer').Buffer.isBuffer; + +function objectToString(o) { + return Object.prototype.toString.call(o); +} diff --git a/node_modules/core-util-is/package.json b/node_modules/core-util-is/package.json new file mode 100644 index 0000000..b0c51f5 --- /dev/null +++ b/node_modules/core-util-is/package.json @@ -0,0 +1,38 @@ +{ + "name": "core-util-is", + "version": "1.0.3", + "description": "The `util.is*` functions introduced in Node v0.12.", + "main": "lib/util.js", + "files": [ + "lib" + ], + "repository": { + "type": "git", + "url": "git://github.com/isaacs/core-util-is" + }, + "keywords": [ + "util", + "isBuffer", + "isArray", + "isNumber", + "isString", + "isRegExp", + "isThis", + "isThat", + "polyfill" + ], + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "MIT", + "bugs": { + "url": "https://github.com/isaacs/core-util-is/issues" + }, + "scripts": { + "test": "tap test.js", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags" + }, + "devDependencies": { + "tap": "^15.0.9" + } +} diff --git a/node_modules/denque/CHANGELOG.md b/node_modules/denque/CHANGELOG.md deleted file mode 100644 index 391a1f5..0000000 --- a/node_modules/denque/CHANGELOG.md +++ /dev/null @@ -1,29 +0,0 @@ -## 2.1.0 - - - fix: issue where `clear()` is still keeping references to the elements (#47) - - refactor: performance optimizations for growth and array copy (#43) - - refactor: performance optimizations for toArray and fromArray (#46) - - test: add additional benchmarks for queue growth and `toArray` (#45) - -## 2.0.1 - - - fix(types): incorrect return type on `size()` - -## 2.0.0 - - - fix!: `push` & `unshift` now accept `undefined` values to match behaviour of `Array` (fixes #25) (#35) - - This is only a **BREAKING** change if you are currently expecting `push(undefined)` and `unshift(undefined)` to do - nothing - the new behaviour now correctly adds undefined values to the queue. - - **Note**: behaviour of `push()` & `unshift()` (no arguments) remains unchanged (nothing gets added to the queue). - - **Note**: If you need to differentiate between `undefined` values in the queue and the return value of `pop()` then - check the queue `.length` before popping. - - fix: incorrect methods in types definition file - -## 1.5.1 - - - perf: minor performance tweak when growing queue size (#29) - -## 1.5.0 - - - feat: adds capacity option for circular buffers (#27) - diff --git a/node_modules/denque/LICENSE b/node_modules/denque/LICENSE deleted file mode 100644 index c9cde92..0000000 --- a/node_modules/denque/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2018-present Invertase Limited - - 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. diff --git a/node_modules/denque/README.md b/node_modules/denque/README.md deleted file mode 100644 index 3c645d3..0000000 --- a/node_modules/denque/README.md +++ /dev/null @@ -1,77 +0,0 @@ -

-

Denque

-

- -

- NPM downloads - NPM version - Tests status - Coverage - License - Follow on Twitter -

- -Denque is a well tested, extremely fast and lightweight [double-ended queue](http://en.wikipedia.org/wiki/Double-ended_queue) -implementation with zero dependencies and includes TypeScript types. - -Double-ended queues can also be used as a: - -- [Stack](http://en.wikipedia.org/wiki/Stack_\(abstract_data_type\)) -- [Queue](http://en.wikipedia.org/wiki/Queue_\(data_structure\)) - -This implementation is currently the fastest available, even faster than `double-ended-queue`, see the [benchmarks](https://docs.page/invertase/denque/benchmarks). - -Every queue operation is done at a constant `O(1)` - including random access from `.peekAt(index)`. - -**Works on all node versions >= v0.10** - -## Quick Start - -Install the package: - -```bash -npm install denque -``` - -Create and consume a queue: - -```js -const Denque = require("denque"); - -const denque = new Denque([1,2,3,4]); -denque.shift(); // 1 -denque.pop(); // 4 -``` - - -See the [API reference documentation](https://docs.page/invertase/denque/api) for more examples. - ---- - -## Who's using it? - -- [Kafka Node.js client](https://www.npmjs.com/package/kafka-node) -- [MariaDB Node.js client](https://www.npmjs.com/package/mariadb) -- [MongoDB Node.js client](https://www.npmjs.com/package/mongodb) -- [MySQL Node.js client](https://www.npmjs.com/package/mysql2) -- [Redis Node.js clients](https://www.npmjs.com/package/redis) - -... and [many more](https://www.npmjs.com/browse/depended/denque). - - ---- - -## License - -- See [LICENSE](/LICENSE) - ---- - -

- - - -

- Built and maintained by Invertase. -

-

diff --git a/node_modules/denque/index.d.ts b/node_modules/denque/index.d.ts deleted file mode 100644 index e125dd4..0000000 --- a/node_modules/denque/index.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -declare class Denque { - length: number; - - constructor(); - - constructor(array: T[]); - - constructor(array: T[], options: IDenqueOptions); - - push(item: T): number; - - unshift(item: T): number; - - pop(): T | undefined; - - shift(): T | undefined; - - peekBack(): T | undefined; - - peekFront(): T | undefined; - - peekAt(index: number): T | undefined; - - get(index: number): T | undefined; - - remove(index: number, count: number): T[]; - - removeOne(index: number): T | undefined; - - splice(index: number, count: number, ...item: T[]): T[] | undefined; - - isEmpty(): boolean; - - clear(): void; - - size(): number; - - toString(): string; - - toArray(): T[]; -} - -interface IDenqueOptions { - capacity?: number -} - -export = Denque; diff --git a/node_modules/denque/index.js b/node_modules/denque/index.js deleted file mode 100644 index 6b2e9d8..0000000 --- a/node_modules/denque/index.js +++ /dev/null @@ -1,481 +0,0 @@ -'use strict'; - -/** - * Custom implementation of a double ended queue. - */ -function Denque(array, options) { - var options = options || {}; - this._capacity = options.capacity; - - this._head = 0; - this._tail = 0; - - if (Array.isArray(array)) { - this._fromArray(array); - } else { - this._capacityMask = 0x3; - this._list = new Array(4); - } -} - -/** - * -------------- - * PUBLIC API - * ------------- - */ - -/** - * Returns the item at the specified index from the list. - * 0 is the first element, 1 is the second, and so on... - * Elements at negative values are that many from the end: -1 is one before the end - * (the last element), -2 is two before the end (one before last), etc. - * @param index - * @returns {*} - */ -Denque.prototype.peekAt = function peekAt(index) { - var i = index; - // expect a number or return undefined - if ((i !== (i | 0))) { - return void 0; - } - var len = this.size(); - if (i >= len || i < -len) return undefined; - if (i < 0) i += len; - i = (this._head + i) & this._capacityMask; - return this._list[i]; -}; - -/** - * Alias for peekAt() - * @param i - * @returns {*} - */ -Denque.prototype.get = function get(i) { - return this.peekAt(i); -}; - -/** - * Returns the first item in the list without removing it. - * @returns {*} - */ -Denque.prototype.peek = function peek() { - if (this._head === this._tail) return undefined; - return this._list[this._head]; -}; - -/** - * Alias for peek() - * @returns {*} - */ -Denque.prototype.peekFront = function peekFront() { - return this.peek(); -}; - -/** - * Returns the item that is at the back of the queue without removing it. - * Uses peekAt(-1) - */ -Denque.prototype.peekBack = function peekBack() { - return this.peekAt(-1); -}; - -/** - * Returns the current length of the queue - * @return {Number} - */ -Object.defineProperty(Denque.prototype, 'length', { - get: function length() { - return this.size(); - } -}); - -/** - * Return the number of items on the list, or 0 if empty. - * @returns {number} - */ -Denque.prototype.size = function size() { - if (this._head === this._tail) return 0; - if (this._head < this._tail) return this._tail - this._head; - else return this._capacityMask + 1 - (this._head - this._tail); -}; - -/** - * Add an item at the beginning of the list. - * @param item - */ -Denque.prototype.unshift = function unshift(item) { - if (arguments.length === 0) return this.size(); - var len = this._list.length; - this._head = (this._head - 1 + len) & this._capacityMask; - this._list[this._head] = item; - if (this._tail === this._head) this._growArray(); - if (this._capacity && this.size() > this._capacity) this.pop(); - if (this._head < this._tail) return this._tail - this._head; - else return this._capacityMask + 1 - (this._head - this._tail); -}; - -/** - * Remove and return the first item on the list, - * Returns undefined if the list is empty. - * @returns {*} - */ -Denque.prototype.shift = function shift() { - var head = this._head; - if (head === this._tail) return undefined; - var item = this._list[head]; - this._list[head] = undefined; - this._head = (head + 1) & this._capacityMask; - if (head < 2 && this._tail > 10000 && this._tail <= this._list.length >>> 2) this._shrinkArray(); - return item; -}; - -/** - * Add an item to the bottom of the list. - * @param item - */ -Denque.prototype.push = function push(item) { - if (arguments.length === 0) return this.size(); - var tail = this._tail; - this._list[tail] = item; - this._tail = (tail + 1) & this._capacityMask; - if (this._tail === this._head) { - this._growArray(); - } - if (this._capacity && this.size() > this._capacity) { - this.shift(); - } - if (this._head < this._tail) return this._tail - this._head; - else return this._capacityMask + 1 - (this._head - this._tail); -}; - -/** - * Remove and return the last item on the list. - * Returns undefined if the list is empty. - * @returns {*} - */ -Denque.prototype.pop = function pop() { - var tail = this._tail; - if (tail === this._head) return undefined; - var len = this._list.length; - this._tail = (tail - 1 + len) & this._capacityMask; - var item = this._list[this._tail]; - this._list[this._tail] = undefined; - if (this._head < 2 && tail > 10000 && tail <= len >>> 2) this._shrinkArray(); - return item; -}; - -/** - * Remove and return the item at the specified index from the list. - * Returns undefined if the list is empty. - * @param index - * @returns {*} - */ -Denque.prototype.removeOne = function removeOne(index) { - var i = index; - // expect a number or return undefined - if ((i !== (i | 0))) { - return void 0; - } - if (this._head === this._tail) return void 0; - var size = this.size(); - var len = this._list.length; - if (i >= size || i < -size) return void 0; - if (i < 0) i += size; - i = (this._head + i) & this._capacityMask; - var item = this._list[i]; - var k; - if (index < size / 2) { - for (k = index; k > 0; k--) { - this._list[i] = this._list[i = (i - 1 + len) & this._capacityMask]; - } - this._list[i] = void 0; - this._head = (this._head + 1 + len) & this._capacityMask; - } else { - for (k = size - 1 - index; k > 0; k--) { - this._list[i] = this._list[i = (i + 1 + len) & this._capacityMask]; - } - this._list[i] = void 0; - this._tail = (this._tail - 1 + len) & this._capacityMask; - } - return item; -}; - -/** - * Remove number of items from the specified index from the list. - * Returns array of removed items. - * Returns undefined if the list is empty. - * @param index - * @param count - * @returns {array} - */ -Denque.prototype.remove = function remove(index, count) { - var i = index; - var removed; - var del_count = count; - // expect a number or return undefined - if ((i !== (i | 0))) { - return void 0; - } - if (this._head === this._tail) return void 0; - var size = this.size(); - var len = this._list.length; - if (i >= size || i < -size || count < 1) return void 0; - if (i < 0) i += size; - if (count === 1 || !count) { - removed = new Array(1); - removed[0] = this.removeOne(i); - return removed; - } - if (i === 0 && i + count >= size) { - removed = this.toArray(); - this.clear(); - return removed; - } - if (i + count > size) count = size - i; - var k; - removed = new Array(count); - for (k = 0; k < count; k++) { - removed[k] = this._list[(this._head + i + k) & this._capacityMask]; - } - i = (this._head + i) & this._capacityMask; - if (index + count === size) { - this._tail = (this._tail - count + len) & this._capacityMask; - for (k = count; k > 0; k--) { - this._list[i = (i + 1 + len) & this._capacityMask] = void 0; - } - return removed; - } - if (index === 0) { - this._head = (this._head + count + len) & this._capacityMask; - for (k = count - 1; k > 0; k--) { - this._list[i = (i + 1 + len) & this._capacityMask] = void 0; - } - return removed; - } - if (i < size / 2) { - this._head = (this._head + index + count + len) & this._capacityMask; - for (k = index; k > 0; k--) { - this.unshift(this._list[i = (i - 1 + len) & this._capacityMask]); - } - i = (this._head - 1 + len) & this._capacityMask; - while (del_count > 0) { - this._list[i = (i - 1 + len) & this._capacityMask] = void 0; - del_count--; - } - if (index < 0) this._tail = i; - } else { - this._tail = i; - i = (i + count + len) & this._capacityMask; - for (k = size - (count + index); k > 0; k--) { - this.push(this._list[i++]); - } - i = this._tail; - while (del_count > 0) { - this._list[i = (i + 1 + len) & this._capacityMask] = void 0; - del_count--; - } - } - if (this._head < 2 && this._tail > 10000 && this._tail <= len >>> 2) this._shrinkArray(); - return removed; -}; - -/** - * Native splice implementation. - * Remove number of items from the specified index from the list and/or add new elements. - * Returns array of removed items or empty array if count == 0. - * Returns undefined if the list is empty. - * - * @param index - * @param count - * @param {...*} [elements] - * @returns {array} - */ -Denque.prototype.splice = function splice(index, count) { - var i = index; - // expect a number or return undefined - if ((i !== (i | 0))) { - return void 0; - } - var size = this.size(); - if (i < 0) i += size; - if (i > size) return void 0; - if (arguments.length > 2) { - var k; - var temp; - var removed; - var arg_len = arguments.length; - var len = this._list.length; - var arguments_index = 2; - if (!size || i < size / 2) { - temp = new Array(i); - for (k = 0; k < i; k++) { - temp[k] = this._list[(this._head + k) & this._capacityMask]; - } - if (count === 0) { - removed = []; - if (i > 0) { - this._head = (this._head + i + len) & this._capacityMask; - } - } else { - removed = this.remove(i, count); - this._head = (this._head + i + len) & this._capacityMask; - } - while (arg_len > arguments_index) { - this.unshift(arguments[--arg_len]); - } - for (k = i; k > 0; k--) { - this.unshift(temp[k - 1]); - } - } else { - temp = new Array(size - (i + count)); - var leng = temp.length; - for (k = 0; k < leng; k++) { - temp[k] = this._list[(this._head + i + count + k) & this._capacityMask]; - } - if (count === 0) { - removed = []; - if (i != size) { - this._tail = (this._head + i + len) & this._capacityMask; - } - } else { - removed = this.remove(i, count); - this._tail = (this._tail - leng + len) & this._capacityMask; - } - while (arguments_index < arg_len) { - this.push(arguments[arguments_index++]); - } - for (k = 0; k < leng; k++) { - this.push(temp[k]); - } - } - return removed; - } else { - return this.remove(i, count); - } -}; - -/** - * Soft clear - does not reset capacity. - */ -Denque.prototype.clear = function clear() { - this._list = new Array(this._list.length); - this._head = 0; - this._tail = 0; -}; - -/** - * Returns true or false whether the list is empty. - * @returns {boolean} - */ -Denque.prototype.isEmpty = function isEmpty() { - return this._head === this._tail; -}; - -/** - * Returns an array of all queue items. - * @returns {Array} - */ -Denque.prototype.toArray = function toArray() { - return this._copyArray(false); -}; - -/** - * ------------- - * INTERNALS - * ------------- - */ - -/** - * Fills the queue with items from an array - * For use in the constructor - * @param array - * @private - */ -Denque.prototype._fromArray = function _fromArray(array) { - var length = array.length; - var capacity = this._nextPowerOf2(length); - - this._list = new Array(capacity); - this._capacityMask = capacity - 1; - this._tail = length; - - for (var i = 0; i < length; i++) this._list[i] = array[i]; -}; - -/** - * - * @param fullCopy - * @param size Initialize the array with a specific size. Will default to the current list size - * @returns {Array} - * @private - */ -Denque.prototype._copyArray = function _copyArray(fullCopy, size) { - var src = this._list; - var capacity = src.length; - var length = this.length; - size = size | length; - - // No prealloc requested and the buffer is contiguous - if (size == length && this._head < this._tail) { - // Simply do a fast slice copy - return this._list.slice(this._head, this._tail); - } - - var dest = new Array(size); - - var k = 0; - var i; - if (fullCopy || this._head > this._tail) { - for (i = this._head; i < capacity; i++) dest[k++] = src[i]; - for (i = 0; i < this._tail; i++) dest[k++] = src[i]; - } else { - for (i = this._head; i < this._tail; i++) dest[k++] = src[i]; - } - - return dest; -} - -/** - * Grows the internal list array. - * @private - */ -Denque.prototype._growArray = function _growArray() { - if (this._head != 0) { - // double array size and copy existing data, head to end, then beginning to tail. - var newList = this._copyArray(true, this._list.length << 1); - - this._tail = this._list.length; - this._head = 0; - - this._list = newList; - } else { - this._tail = this._list.length; - this._list.length <<= 1; - } - - this._capacityMask = (this._capacityMask << 1) | 1; -}; - -/** - * Shrinks the internal list array. - * @private - */ -Denque.prototype._shrinkArray = function _shrinkArray() { - this._list.length >>>= 1; - this._capacityMask >>>= 1; -}; - -/** - * Find the next power of 2, at least 4 - * @private - * @param {number} num - * @returns {number} - */ -Denque.prototype._nextPowerOf2 = function _nextPowerOf2(num) { - var log2 = Math.log(num) / Math.log(2); - var nextPow2 = 1 << (log2 + 1); - - return Math.max(nextPow2, 4); -} - -module.exports = Denque; diff --git a/node_modules/denque/package.json b/node_modules/denque/package.json deleted file mode 100644 index a635910..0000000 --- a/node_modules/denque/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "denque", - "version": "2.1.0", - "description": "The fastest javascript implementation of a double-ended queue. Used by the official Redis, MongoDB, MariaDB & MySQL libraries for Node.js and many other libraries. Maintains compatability with deque.", - "main": "index.js", - "engines": { - "node": ">=0.10" - }, - "keywords": [ - "data-structure", - "data-structures", - "queue", - "double", - "end", - "ended", - "deque", - "denque", - "double-ended-queue" - ], - "scripts": { - "test": "istanbul cover --report lcov _mocha && npm run typescript", - "coveralls": "cat ./coverage/lcov.info | coveralls", - "typescript": "tsc --project ./test/type/tsconfig.json", - "benchmark_thousand": "node benchmark/thousand", - "benchmark_2mil": "node benchmark/two_million", - "benchmark_splice": "node benchmark/splice", - "benchmark_remove": "node benchmark/remove", - "benchmark_removeOne": "node benchmark/removeOne", - "benchmark_growth": "node benchmark/growth", - "benchmark_toArray": "node benchmark/toArray", - "benchmark_fromArray": "node benchmark/fromArray" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/invertase/denque.git" - }, - "license": "Apache-2.0", - "author": { - "name": "Invertase", - "email": "oss@invertase.io", - "url": "http://github.com/invertase/" - }, - "contributors": [ - "Mike Diarmid (Salakar) " - ], - "bugs": { - "url": "https://github.com/invertase/denque/issues" - }, - "homepage": "https://docs.page/invertase/denque", - "devDependencies": { - "benchmark": "^2.1.4", - "codecov": "^3.8.3", - "double-ended-queue": "^2.1.0-0", - "istanbul": "^0.4.5", - "mocha": "^3.5.3", - "typescript": "^3.4.1" - } -} diff --git a/node_modules/encodeurl/HISTORY.md b/node_modules/encodeurl/HISTORY.md new file mode 100644 index 0000000..41313b2 --- /dev/null +++ b/node_modules/encodeurl/HISTORY.md @@ -0,0 +1,14 @@ +1.0.2 / 2018-01-21 +================== + + * Fix encoding `%` as last character + +1.0.1 / 2016-06-09 +================== + + * Fix encoding unpaired surrogates at start/end of string + +1.0.0 / 2016-06-08 +================== + + * Initial release diff --git a/node_modules/send/node_modules/depd/LICENSE b/node_modules/encodeurl/LICENSE similarity index 95% rename from node_modules/send/node_modules/depd/LICENSE rename to node_modules/encodeurl/LICENSE index b7dce6c..8812229 100644 --- a/node_modules/send/node_modules/depd/LICENSE +++ b/node_modules/encodeurl/LICENSE @@ -1,6 +1,6 @@ (The MIT License) -Copyright (c) 2014 Douglas Christopher Wilson +Copyright (c) 2016 Douglas Christopher Wilson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/node_modules/encodeurl/README.md b/node_modules/encodeurl/README.md new file mode 100644 index 0000000..127c5a0 --- /dev/null +++ b/node_modules/encodeurl/README.md @@ -0,0 +1,128 @@ +# encodeurl + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Encode a URL to a percent-encoded form, excluding already-encoded sequences + +## 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 encodeurl +``` + +## API + +```js +var encodeUrl = require('encodeurl') +``` + +### encodeUrl(url) + +Encode a URL to a percent-encoded form, excluding already-encoded sequences. + +This function will take an already-encoded URL and encode all the non-URL +code points (as UTF-8 byte sequences). This function will not encode the +"%" character unless it is not part of a valid sequence (`%20` will be +left as-is, but `%foo` will be encoded as `%25foo`). + +This encode is meant to be "safe" and does not throw errors. It will try as +hard as it can to properly encode the given URL, including replacing any raw, +unpaired surrogate pairs with the Unicode replacement character prior to +encoding. + +This function is _similar_ to the intrinsic function `encodeURI`, except it +will not encode the `%` character if that is part of a valid sequence, will +not encode `[` and `]` (for IPv6 hostnames) and will replace raw, unpaired +surrogate pairs with the Unicode replacement character (instead of throwing). + +## Examples + +### Encode a URL containing user-controled data + +```js +var encodeUrl = require('encodeurl') +var escapeHtml = require('escape-html') + +http.createServer(function onRequest (req, res) { + // get encoded form of inbound url + var url = encodeUrl(req.url) + + // create html message + var body = '

Location ' + escapeHtml(url) + ' not found

' + + // send a 404 + res.statusCode = 404 + res.setHeader('Content-Type', 'text/html; charset=UTF-8') + res.setHeader('Content-Length', String(Buffer.byteLength(body, 'utf-8'))) + res.end(body, 'utf-8') +}) +``` + +### Encode a URL for use in a header field + +```js +var encodeUrl = require('encodeurl') +var escapeHtml = require('escape-html') +var url = require('url') + +http.createServer(function onRequest (req, res) { + // parse inbound url + var href = url.parse(req) + + // set new host for redirect + href.host = 'localhost' + href.protocol = 'https:' + href.slashes = true + + // create location header + var location = encodeUrl(url.format(href)) + + // create html message + var body = '

Redirecting to new site: ' + escapeHtml(location) + '

' + + // send a 301 + res.statusCode = 301 + res.setHeader('Content-Type', 'text/html; charset=UTF-8') + res.setHeader('Content-Length', String(Buffer.byteLength(body, 'utf-8'))) + res.setHeader('Location', location) + res.end(body, 'utf-8') +}) +``` + +## Testing + +```sh +$ npm test +$ npm run lint +``` + +## References + +- [RFC 3986: Uniform Resource Identifier (URI): Generic Syntax][rfc-3986] +- [WHATWG URL Living Standard][whatwg-url] + +[rfc-3986]: https://tools.ietf.org/html/rfc3986 +[whatwg-url]: https://url.spec.whatwg.org/ + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/encodeurl.svg +[npm-url]: https://npmjs.org/package/encodeurl +[node-version-image]: https://img.shields.io/node/v/encodeurl.svg +[node-version-url]: https://nodejs.org/en/download +[travis-image]: https://img.shields.io/travis/pillarjs/encodeurl.svg +[travis-url]: https://travis-ci.org/pillarjs/encodeurl +[coveralls-image]: https://img.shields.io/coveralls/pillarjs/encodeurl.svg +[coveralls-url]: https://coveralls.io/r/pillarjs/encodeurl?branch=master +[downloads-image]: https://img.shields.io/npm/dm/encodeurl.svg +[downloads-url]: https://npmjs.org/package/encodeurl diff --git a/node_modules/encodeurl/index.js b/node_modules/encodeurl/index.js new file mode 100644 index 0000000..fc4906c --- /dev/null +++ b/node_modules/encodeurl/index.js @@ -0,0 +1,60 @@ +/*! + * encodeurl + * Copyright(c) 2016 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = encodeUrl + +/** + * RegExp to match non-URL code points, *after* encoding (i.e. not including "%") + * and including invalid escape sequences. + * @private + */ + +var ENCODE_CHARS_REGEXP = /(?:[^\x21\x25\x26-\x3B\x3D\x3F-\x5B\x5D\x5F\x61-\x7A\x7E]|%(?:[^0-9A-Fa-f]|[0-9A-Fa-f][^0-9A-Fa-f]|$))+/g + +/** + * RegExp to match unmatched surrogate pair. + * @private + */ + +var UNMATCHED_SURROGATE_PAIR_REGEXP = /(^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]|[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/g + +/** + * String to replace unmatched surrogate pair with. + * @private + */ + +var UNMATCHED_SURROGATE_PAIR_REPLACE = '$1\uFFFD$2' + +/** + * Encode a URL to a percent-encoded form, excluding already-encoded sequences. + * + * This function will take an already-encoded URL and encode all the non-URL + * code points. This function will not encode the "%" character unless it is + * not part of a valid sequence (`%20` will be left as-is, but `%foo` will + * be encoded as `%25foo`). + * + * This encode is meant to be "safe" and does not throw errors. It will try as + * hard as it can to properly encode the given URL, including replacing any raw, + * unpaired surrogate pairs with the Unicode replacement character prior to + * encoding. + * + * @param {string} url + * @return {string} + * @public + */ + +function encodeUrl (url) { + return String(url) + .replace(UNMATCHED_SURROGATE_PAIR_REGEXP, UNMATCHED_SURROGATE_PAIR_REPLACE) + .replace(ENCODE_CHARS_REGEXP, encodeURI) +} diff --git a/node_modules/encodeurl/package.json b/node_modules/encodeurl/package.json new file mode 100644 index 0000000..b9f25ef --- /dev/null +++ b/node_modules/encodeurl/package.json @@ -0,0 +1,40 @@ +{ + "name": "encodeurl", + "description": "Encode a URL to a percent-encoded form, excluding already-encoded sequences", + "version": "1.0.2", + "contributors": [ + "Douglas Christopher Wilson " + ], + "license": "MIT", + "keywords": [ + "encode", + "encodeurl", + "url" + ], + "repository": "pillarjs/encodeurl", + "devDependencies": { + "eslint": "3.19.0", + "eslint-config-standard": "10.2.1", + "eslint-plugin-import": "2.8.0", + "eslint-plugin-node": "5.2.1", + "eslint-plugin-promise": "3.6.0", + "eslint-plugin-standard": "3.0.1", + "istanbul": "0.4.5", + "mocha": "2.5.3" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "README.md", + "index.js" + ], + "engines": { + "node": ">= 0.8" + }, + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + } +} diff --git a/node_modules/escape-html/LICENSE b/node_modules/escape-html/LICENSE index a3f0274..2e70de9 100644 --- a/node_modules/escape-html/LICENSE +++ b/node_modules/escape-html/LICENSE @@ -1,6 +1,8 @@ (The MIT License) Copyright (c) 2012-2013 TJ Holowaychuk +Copyright (c) 2015 Andreas Lubbe +Copyright (c) 2015 Tiancheng "Timothy" Gu Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/node_modules/escape-html/Readme.md b/node_modules/escape-html/Readme.md index 2cfcc99..653d9ea 100644 --- a/node_modules/escape-html/Readme.md +++ b/node_modules/escape-html/Readme.md @@ -1,13 +1,41 @@ # escape-html - Escape HTML entities + Escape string for use in HTML ## Example ```js var escape = require('escape-html'); -escape(str); +var html = escape('foo & bar'); +// -> foo & bar +``` + +## Benchmark + +``` +$ npm run-script bench + +> escape-html@1.0.3 bench nodejs-escape-html +> node benchmark/index.js + + + http_parser@1.0 + node@0.10.33 + v8@3.14.5.9 + ares@1.9.0-DEV + uv@0.10.29 + zlib@1.2.3 + modules@11 + openssl@1.0.1j + + 1 test completed. + 2 tests completed. + 3 tests completed. + + no special characters x 19,435,271 ops/sec ±0.85% (187 runs sampled) + single special character x 6,132,421 ops/sec ±0.67% (194 runs sampled) + many special characters x 3,175,826 ops/sec ±0.65% (193 runs sampled) ``` ## License diff --git a/node_modules/escape-html/index.js b/node_modules/escape-html/index.js index d0f9256..bf9e226 100644 --- a/node_modules/escape-html/index.js +++ b/node_modules/escape-html/index.js @@ -1,9 +1,20 @@ /*! * escape-html * Copyright(c) 2012-2013 TJ Holowaychuk + * Copyright(c) 2015 Andreas Lubbe + * Copyright(c) 2015 Tiancheng "Timothy" Gu * MIT Licensed */ +'use strict'; + +/** + * Module variables. + * @private + */ + +var matchHtmlRegExp = /["'&<>]/; + /** * Module exports. * @public @@ -14,16 +25,54 @@ module.exports = escapeHtml; /** * Escape special characters in the given string of html. * - * @param {string} str The string to escape for inserting into HTML + * @param {string} string The string to escape for inserting into HTML * @return {string} * @public */ -function escapeHtml(html) { - return String(html) - .replace(/&/g, '&') - .replace(/"/g, '"') - .replace(/'/g, ''') - .replace(//g, '>'); +function escapeHtml(string) { + var str = '' + string; + var match = matchHtmlRegExp.exec(str); + + if (!match) { + return str; + } + + var escape; + var html = ''; + var index = 0; + var lastIndex = 0; + + for (index = match.index; index < str.length; index++) { + switch (str.charCodeAt(index)) { + case 34: // " + escape = '"'; + break; + case 38: // & + escape = '&'; + break; + case 39: // ' + escape = '''; + break; + case 60: // < + escape = '<'; + break; + case 62: // > + escape = '>'; + break; + default: + continue; + } + + if (lastIndex !== index) { + html += str.substring(lastIndex, index); + } + + lastIndex = index + 1; + html += escape; + } + + return lastIndex !== index + ? html + str.substring(lastIndex, index) + : html; } diff --git a/node_modules/escape-html/package.json b/node_modules/escape-html/package.json index e000755..57ec7bd 100644 --- a/node_modules/escape-html/package.json +++ b/node_modules/escape-html/package.json @@ -1,7 +1,7 @@ { "name": "escape-html", - "description": "Escape HTML entities", - "version": "1.0.2", + "description": "Escape string for use in HTML", + "version": "1.0.3", "license": "MIT", "keywords": [ "escape", @@ -9,9 +9,16 @@ "utility" ], "repository": "component/escape-html", + "devDependencies": { + "benchmark": "1.0.0", + "beautify-benchmark": "0.2.4" + }, "files": [ "LICENSE", "Readme.md", "index.js" - ] + ], + "scripts": { + "bench": "node benchmark/index.js" + } } diff --git a/node_modules/etag/HISTORY.md b/node_modules/etag/HISTORY.md index bd0f26d..222b293 100644 --- a/node_modules/etag/HISTORY.md +++ b/node_modules/etag/HISTORY.md @@ -1,3 +1,15 @@ +1.8.1 / 2017-09-12 +================== + + * perf: replace regular expression with substring + +1.8.0 / 2017-02-18 +================== + + * Use SHA1 instead of MD5 for ETag hashing + - Improves performance for larger entities + - Works with FIPS 140-2 OpenSSL configuration + 1.7.0 / 2015-06-08 ================== diff --git a/node_modules/etag/LICENSE b/node_modules/etag/LICENSE index 142ede3..cab251c 100644 --- a/node_modules/etag/LICENSE +++ b/node_modules/etag/LICENSE @@ -1,6 +1,6 @@ (The MIT License) -Copyright (c) 2014-2015 Douglas Christopher Wilson +Copyright (c) 2014-2016 Douglas Christopher Wilson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/node_modules/etag/README.md b/node_modules/etag/README.md index 8da9e05..09c2169 100644 --- a/node_modules/etag/README.md +++ b/node_modules/etag/README.md @@ -6,16 +6,25 @@ [![Build Status][travis-image]][travis-url] [![Test Coverage][coveralls-image]][coveralls-url] -Create simple ETags +Create simple HTTP ETags + +This module generates HTTP ETags (as defined in RFC 7232) for use in +HTTP responses. ## 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 etag ``` ## API + + ```js var etag = require('etag') ``` @@ -27,6 +36,8 @@ body of the entity. Strings, `Buffer`s, and `fs.Stats` are accepted. By default, a strong ETag is generated except for `fs.Stats`, which will generate a weak ETag (this can be overwritten by `options.weak`). + + ```js res.setHeader('ETag', etag(body)) ``` @@ -52,101 +63,84 @@ $ npm test ```bash $ npm run-script bench -> etag@1.6.0 bench nodejs-etag +> etag@1.8.1 bench nodejs-etag > node benchmark/index.js - http_parser@1.0 - node@0.10.33 - v8@3.14.5.9 - ares@1.9.0-DEV - uv@0.10.29 - zlib@1.2.3 - modules@11 - openssl@1.0.1j + http_parser@2.7.0 + node@6.11.1 + v8@5.1.281.103 + uv@1.11.0 + zlib@1.2.11 + ares@1.10.1-DEV + icu@58.2 + modules@48 + openssl@1.0.2k > node benchmark/body0-100b.js 100B body - 1 test completed. - 2 tests completed. - 3 tests completed. 4 tests completed. -* buffer - strong x 289,198 ops/sec ±1.09% (190 runs sampled) -* buffer - weak x 287,838 ops/sec ±0.91% (189 runs sampled) -* string - strong x 284,586 ops/sec ±1.05% (192 runs sampled) -* string - weak x 287,439 ops/sec ±0.82% (192 runs sampled) + buffer - strong x 258,647 ops/sec ±1.07% (180 runs sampled) + buffer - weak x 263,812 ops/sec ±0.61% (184 runs sampled) + string - strong x 259,955 ops/sec ±1.19% (185 runs sampled) + string - weak x 264,356 ops/sec ±1.09% (184 runs sampled) > node benchmark/body1-1kb.js 1KB body - 1 test completed. - 2 tests completed. - 3 tests completed. 4 tests completed. -* buffer - strong x 212,423 ops/sec ±0.75% (193 runs sampled) -* buffer - weak x 211,871 ops/sec ±0.74% (194 runs sampled) - string - strong x 205,291 ops/sec ±0.86% (194 runs sampled) - string - weak x 208,463 ops/sec ±0.79% (192 runs sampled) + buffer - strong x 189,018 ops/sec ±1.12% (182 runs sampled) + buffer - weak x 190,586 ops/sec ±0.81% (186 runs sampled) + string - strong x 144,272 ops/sec ±0.96% (188 runs sampled) + string - weak x 145,380 ops/sec ±1.43% (187 runs sampled) > node benchmark/body2-5kb.js 5KB body - 1 test completed. - 2 tests completed. - 3 tests completed. 4 tests completed. -* buffer - strong x 92,901 ops/sec ±0.58% (195 runs sampled) -* buffer - weak x 93,045 ops/sec ±0.65% (192 runs sampled) - string - strong x 89,621 ops/sec ±0.68% (194 runs sampled) - string - weak x 90,070 ops/sec ±0.70% (196 runs sampled) + buffer - strong x 92,435 ops/sec ±0.42% (188 runs sampled) + buffer - weak x 92,373 ops/sec ±0.58% (189 runs sampled) + string - strong x 48,850 ops/sec ±0.56% (186 runs sampled) + string - weak x 49,380 ops/sec ±0.56% (190 runs sampled) > node benchmark/body3-10kb.js 10KB body - 1 test completed. - 2 tests completed. - 3 tests completed. 4 tests completed. -* buffer - strong x 54,220 ops/sec ±0.85% (192 runs sampled) -* buffer - weak x 54,069 ops/sec ±0.83% (191 runs sampled) - string - strong x 53,078 ops/sec ±0.53% (194 runs sampled) - string - weak x 53,849 ops/sec ±0.47% (197 runs sampled) + buffer - strong x 55,989 ops/sec ±0.93% (188 runs sampled) + buffer - weak x 56,148 ops/sec ±0.55% (190 runs sampled) + string - strong x 27,345 ops/sec ±0.43% (188 runs sampled) + string - weak x 27,496 ops/sec ±0.45% (190 runs sampled) > node benchmark/body4-100kb.js 100KB body - 1 test completed. - 2 tests completed. - 3 tests completed. 4 tests completed. -* buffer - strong x 6,673 ops/sec ±0.15% (197 runs sampled) -* buffer - weak x 6,716 ops/sec ±0.12% (198 runs sampled) - string - strong x 6,357 ops/sec ±0.14% (197 runs sampled) - string - weak x 6,344 ops/sec ±0.21% (197 runs sampled) + buffer - strong x 7,083 ops/sec ±0.22% (190 runs sampled) + buffer - weak x 7,115 ops/sec ±0.26% (191 runs sampled) + string - strong x 3,068 ops/sec ±0.34% (190 runs sampled) + string - weak x 3,096 ops/sec ±0.35% (190 runs sampled) > node benchmark/stats.js - stats + stat - 1 test completed. - 2 tests completed. - 3 tests completed. 4 tests completed. -* real - strong x 1,671,989 ops/sec ±0.13% (197 runs sampled) -* real - weak x 1,681,297 ops/sec ±0.12% (198 runs sampled) - fake - strong x 927,063 ops/sec ±0.14% (198 runs sampled) - fake - weak x 914,461 ops/sec ±0.41% (191 runs sampled) + real - strong x 871,642 ops/sec ±0.34% (189 runs sampled) + real - weak x 867,613 ops/sec ±0.39% (190 runs sampled) + fake - strong x 401,051 ops/sec ±0.40% (189 runs sampled) + fake - weak x 400,100 ops/sec ±0.47% (188 runs sampled) ``` ## License @@ -156,7 +150,7 @@ $ npm run-script bench [npm-image]: https://img.shields.io/npm/v/etag.svg [npm-url]: https://npmjs.org/package/etag [node-version-image]: https://img.shields.io/node/v/etag.svg -[node-version-url]: http://nodejs.org/download/ +[node-version-url]: https://nodejs.org/en/download/ [travis-image]: https://img.shields.io/travis/jshttp/etag/master.svg [travis-url]: https://travis-ci.org/jshttp/etag [coveralls-image]: https://img.shields.io/coveralls/jshttp/etag/master.svg diff --git a/node_modules/etag/index.js b/node_modules/etag/index.js index b582c84..2a585c9 100644 --- a/node_modules/etag/index.js +++ b/node_modules/etag/index.js @@ -1,6 +1,6 @@ /*! * etag - * Copyright(c) 2014-2015 Douglas Christopher Wilson + * Copyright(c) 2014-2016 Douglas Christopher Wilson * MIT Licensed */ @@ -26,7 +26,6 @@ var Stats = require('fs').Stats * @private */ -var base64PadCharRegExp = /=+$/ var toString = Object.prototype.toString /** @@ -37,18 +36,18 @@ var toString = Object.prototype.toString * @private */ -function entitytag(entity) { +function entitytag (entity) { if (entity.length === 0) { // fast-path empty - return '"0-1B2M2Y8AsgTpgAmY7PhCfg"' + return '"0-2jmj7l5rSw0yVb/vlWAYkK/YBwk"' } // compute hash of entity var hash = crypto - .createHash('md5') + .createHash('sha1') .update(entity, 'utf8') .digest('base64') - .replace(base64PadCharRegExp, '') + .substring(0, 27) // compute length of entity var len = typeof entity === 'string' @@ -68,7 +67,7 @@ function entitytag(entity) { * @public */ -function etag(entity, options) { +function etag (entity, options) { if (entity == null) { throw new TypeError('argument entity is required') } @@ -102,18 +101,18 @@ function etag(entity, options) { * @api private */ -function isstats(obj) { +function isstats (obj) { // genuine fs.Stats if (typeof Stats === 'function' && obj instanceof Stats) { return true } // quack quack - return obj && typeof obj === 'object' - && 'ctime' in obj && toString.call(obj.ctime) === '[object Date]' - && 'mtime' in obj && toString.call(obj.mtime) === '[object Date]' - && 'ino' in obj && typeof obj.ino === 'number' - && 'size' in obj && typeof obj.size === 'number' + return obj && typeof obj === 'object' && + 'ctime' in obj && toString.call(obj.ctime) === '[object Date]' && + 'mtime' in obj && toString.call(obj.mtime) === '[object Date]' && + 'ino' in obj && typeof obj.ino === 'number' && + 'size' in obj && typeof obj.size === 'number' } /** @@ -124,7 +123,7 @@ function isstats(obj) { * @private */ -function stattag(stat) { +function stattag (stat) { var mtime = stat.mtime.getTime().toString(16) var size = stat.size.toString(16) diff --git a/node_modules/etag/package.json b/node_modules/etag/package.json index 50bf248..b06ab80 100644 --- a/node_modules/etag/package.json +++ b/node_modules/etag/package.json @@ -1,7 +1,7 @@ { "name": "etag", - "description": "Create simple ETags", - "version": "1.7.0", + "description": "Create simple HTTP ETags", + "version": "1.8.1", "contributors": [ "Douglas Christopher Wilson ", "David Björklund " @@ -14,11 +14,19 @@ ], "repository": "jshttp/etag", "devDependencies": { - "benchmark": "1.0.0", "beautify-benchmark": "0.2.4", - "istanbul": "0.3.14", - "mocha": "~1.21.4", - "seedrandom": "2.3.11" + "benchmark": "2.1.4", + "eslint": "3.19.0", + "eslint-config-standard": "10.2.1", + "eslint-plugin-import": "2.7.0", + "eslint-plugin-markdown": "1.0.0-beta.6", + "eslint-plugin-node": "5.1.1", + "eslint-plugin-promise": "3.5.0", + "eslint-plugin-standard": "3.0.1", + "istanbul": "0.4.5", + "mocha": "1.21.5", + "safe-buffer": "5.1.1", + "seedrandom": "2.4.3" }, "files": [ "LICENSE", @@ -31,6 +39,7 @@ }, "scripts": { "bench": "node benchmark/index.js", + "lint": "eslint --plugin markdown --ext js,md .", "test": "mocha --reporter spec --bail --check-leaks test/", "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" diff --git a/node_modules/express/History.md b/node_modules/express/History.md index 21d5da3..e49870f 100644 --- a/node_modules/express/History.md +++ b/node_modules/express/History.md @@ -1,39 +1,583 @@ -5.0.0-alpha.2 / 2015-07-06 -========================== +4.18.2 / 2022-10-08 +=================== -This is the second Express 5.0 alpha release, based off 4.13.1 and includes -changes from 5.0.0-alpha.1. + * Fix regression routing a large stack in a single route + * deps: body-parser@1.20.1 + - deps: qs@6.11.0 + - perf: remove unnecessary object clone + * deps: qs@6.11.0 - * remove: - - `app.param(fn)` - - `req.param()` -- use `req.params`, `req.body`, or `req.query` instead - * change: - - `res.render` callback is always async, even for sync view engines - - The leading `:` character in `name` for `app.param(name, fn)` is no longer removed - - Use `router` module for routing - - Use `path-is-absolute` module for absolute path detection +4.18.1 / 2022-04-29 +=================== -5.0.0-alpha.1 / 2014-11-06 -========================== + * Fix hanging on large stack of sync routes -This is the first Express 5.0 alpha release, based off 4.10.1. +4.18.0 / 2022-04-25 +=================== - * remove: - - `app.del` - use `app.delete` - - `req.acceptsCharset` - use `req.acceptsCharsets` - - `req.acceptsEncoding` - use `req.acceptsEncodings` - - `req.acceptsLanguage` - use `req.acceptsLanguages` - - `res.json(obj, status)` signature - use `res.json(status, obj)` - - `res.jsonp(obj, status)` signature - use `res.jsonp(status, obj)` - - `res.send(body, status)` signature - use `res.send(status, body)` - - `res.send(status)` signature - use `res.sendStatus(status)` - - `res.sendfile` - use `res.sendFile` instead - - `express.query` middleware - * change: - - `req.host` now returns host (`hostname:port`) - use `req.hostname` for only hostname - - `req.query` is now a getter instead of a plain property - * add: - - `app.router` is a reference to the base router + * Add "root" option to `res.download` + * Allow `options` without `filename` in `res.download` + * Deprecate string and non-integer arguments to `res.status` + * Fix behavior of `null`/`undefined` as `maxAge` in `res.cookie` + * Fix handling very large stacks of sync middleware + * Ignore `Object.prototype` values in settings through `app.set`/`app.get` + * Invoke `default` with same arguments as types in `res.format` + * Support proper 205 responses using `res.send` + * Use `http-errors` for `res.format` error + * deps: body-parser@1.20.0 + - 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 + - deps: http-errors@2.0.0 + - deps: on-finished@2.4.1 + - deps: qs@6.10.3 + - deps: raw-body@2.5.1 + * deps: cookie@0.5.0 + - Add `priority` option + - Fix `expires` option to reject invalid dates + * deps: depd@2.0.0 + - Replace internal `eval` usage with `Function` constructor + - Use instance methods on `process` to check for listeners + * deps: finalhandler@1.2.0 + - Remove set content headers that break response + - deps: on-finished@2.4.1 + - deps: statuses@2.0.1 + * deps: on-finished@2.4.1 + - Prevent loss of async hooks context + * deps: qs@6.10.3 + * deps: send@0.18.0 + - Fix emitted 416 error missing headers property + - Limit the headers removed for 304 response + - deps: depd@2.0.0 + - deps: destroy@1.2.0 + - deps: http-errors@2.0.0 + - deps: on-finished@2.4.1 + - deps: statuses@2.0.1 + * deps: serve-static@1.15.0 + - deps: send@0.18.0 + * deps: statuses@2.0.1 + - Remove code 306 + - Rename `425 Unordered Collection` to standard `425 Too Early` + +4.17.3 / 2022-02-16 +=================== + + * deps: accepts@~1.3.8 + - deps: mime-types@~2.1.34 + - deps: negotiator@0.6.3 + * deps: body-parser@1.19.2 + - deps: bytes@3.1.2 + - deps: qs@6.9.7 + - deps: raw-body@2.4.3 + * deps: cookie@0.4.2 + * deps: qs@6.9.7 + * Fix handling of `__proto__` keys + * pref: remove unnecessary regexp for trust proxy + +4.17.2 / 2021-12-16 +=================== + + * Fix handling of `undefined` in `res.jsonp` + * Fix handling of `undefined` when `"json escape"` is enabled + * Fix incorrect middleware execution with unanchored `RegExp`s + * Fix `res.jsonp(obj, status)` deprecation message + * Fix typo in `res.is` JSDoc + * deps: body-parser@1.19.1 + - deps: bytes@3.1.1 + - deps: http-errors@1.8.1 + - deps: qs@6.9.6 + - deps: raw-body@2.4.2 + - deps: safe-buffer@5.2.1 + - deps: type-is@~1.6.18 + * deps: content-disposition@0.5.4 + - deps: safe-buffer@5.2.1 + * deps: cookie@0.4.1 + - Fix `maxAge` option to reject invalid values + * deps: proxy-addr@~2.0.7 + - Use `req.socket` over deprecated `req.connection` + - deps: forwarded@0.2.0 + - deps: ipaddr.js@1.9.1 + * deps: qs@6.9.6 + * deps: safe-buffer@5.2.1 + * deps: send@0.17.2 + - deps: http-errors@1.8.1 + - deps: ms@2.1.3 + - pref: ignore empty http tokens + * deps: serve-static@1.14.2 + - deps: send@0.17.2 + * deps: setprototypeof@1.2.0 + +4.17.1 / 2019-05-25 +=================== + + * Revert "Improve error message for `null`/`undefined` to `res.status`" + +4.17.0 / 2019-05-16 +=================== + + * Add `express.raw` to parse bodies into `Buffer` + * Add `express.text` to parse bodies into string + * Improve error message for non-strings to `res.sendFile` + * Improve error message for `null`/`undefined` to `res.status` + * Support multiple hosts in `X-Forwarded-Host` + * deps: accepts@~1.3.7 + * deps: body-parser@1.19.0 + - Add encoding MIK + - Add petabyte (`pb`) support + - Fix parsing array brackets after index + - deps: bytes@3.1.0 + - deps: http-errors@1.7.2 + - deps: iconv-lite@0.4.24 + - deps: qs@6.7.0 + - deps: raw-body@2.4.0 + - deps: type-is@~1.6.17 + * deps: content-disposition@0.5.3 + * deps: cookie@0.4.0 + - Add `SameSite=None` support + * deps: finalhandler@~1.1.2 + - Set stricter `Content-Security-Policy` header + - deps: parseurl@~1.3.3 + - deps: statuses@~1.5.0 + * deps: parseurl@~1.3.3 + * deps: proxy-addr@~2.0.5 + - deps: ipaddr.js@1.9.0 + * deps: qs@6.7.0 + - Fix parsing array brackets after index + * deps: range-parser@~1.2.1 + * deps: send@0.17.1 + - Set stricter CSP header in redirect & error responses + - deps: http-errors@~1.7.2 + - deps: mime@1.6.0 + - deps: ms@2.1.1 + - deps: range-parser@~1.2.1 + - deps: statuses@~1.5.0 + - perf: remove redundant `path.normalize` call + * deps: serve-static@1.14.1 + - Set stricter CSP header in redirect response + - deps: parseurl@~1.3.3 + - deps: send@0.17.1 + * deps: setprototypeof@1.1.1 + * deps: statuses@~1.5.0 + - Add `103 Early Hints` + * deps: type-is@~1.6.18 + - deps: mime-types@~2.1.24 + - perf: prevent internal `throw` on invalid type + +4.16.4 / 2018-10-10 +=================== + + * Fix issue where `"Request aborted"` may be logged in `res.sendfile` + * Fix JSDoc for `Router` constructor + * deps: body-parser@1.18.3 + - Fix deprecation warnings on Node.js 10+ + - Fix stack trace for strict json parse error + - deps: depd@~1.1.2 + - deps: http-errors@~1.6.3 + - deps: iconv-lite@0.4.23 + - deps: qs@6.5.2 + - deps: raw-body@2.3.3 + - deps: type-is@~1.6.16 + * deps: proxy-addr@~2.0.4 + - deps: ipaddr.js@1.8.0 + * deps: qs@6.5.2 + * deps: safe-buffer@5.1.2 + +4.16.3 / 2018-03-12 +=================== + + * deps: accepts@~1.3.5 + - deps: mime-types@~2.1.18 + * deps: depd@~1.1.2 + - perf: remove argument reassignment + * deps: encodeurl@~1.0.2 + - Fix encoding `%` as last character + * deps: finalhandler@1.1.1 + - Fix 404 output for bad / missing pathnames + - deps: encodeurl@~1.0.2 + - deps: statuses@~1.4.0 + * deps: proxy-addr@~2.0.3 + - deps: ipaddr.js@1.6.0 + * deps: send@0.16.2 + - Fix incorrect end tag in default error & redirects + - deps: depd@~1.1.2 + - deps: encodeurl@~1.0.2 + - deps: statuses@~1.4.0 + * deps: serve-static@1.13.2 + - Fix incorrect end tag in redirects + - deps: encodeurl@~1.0.2 + - deps: send@0.16.2 + * deps: statuses@~1.4.0 + * deps: type-is@~1.6.16 + - deps: mime-types@~2.1.18 + +4.16.2 / 2017-10-09 +=================== + + * Fix `TypeError` in `res.send` when given `Buffer` and `ETag` header set + * perf: skip parsing of entire `X-Forwarded-Proto` header + +4.16.1 / 2017-09-29 +=================== + + * deps: send@0.16.1 + * deps: serve-static@1.13.1 + - Fix regression when `root` is incorrectly set to a file + - deps: send@0.16.1 + +4.16.0 / 2017-09-28 +=================== + + * Add `"json escape"` setting for `res.json` and `res.jsonp` + * Add `express.json` and `express.urlencoded` to parse bodies + * Add `options` argument to `res.download` + * Improve error message when autoloading invalid view engine + * Improve error messages when non-function provided as middleware + * Skip `Buffer` encoding when not generating ETag for small response + * Use `safe-buffer` for improved Buffer API + * deps: accepts@~1.3.4 + - deps: mime-types@~2.1.16 + * deps: content-type@~1.0.4 + - perf: remove argument reassignment + - perf: skip parameter parsing when no parameters + * deps: etag@~1.8.1 + - perf: replace regular expression with substring + * deps: finalhandler@1.1.0 + - Use `res.headersSent` when available + * deps: parseurl@~1.3.2 + - perf: reduce overhead for full URLs + - perf: unroll the "fast-path" `RegExp` + * deps: proxy-addr@~2.0.2 + - Fix trimming leading / trailing OWS in `X-Forwarded-For` + - deps: forwarded@~0.1.2 + - deps: ipaddr.js@1.5.2 + - perf: reduce overhead when no `X-Forwarded-For` header + * deps: qs@6.5.1 + - Fix parsing & compacting very deep objects + * deps: send@0.16.0 + - Add 70 new types for file extensions + - Add `immutable` option + - Fix missing `` in default error & redirects + - Set charset as "UTF-8" for .js and .json + - Use instance methods on steam to check for listeners + - deps: mime@1.4.1 + - perf: improve path validation speed + * deps: serve-static@1.13.0 + - Add 70 new types for file extensions + - Add `immutable` option + - Set charset as "UTF-8" for .js and .json + - deps: send@0.16.0 + * deps: setprototypeof@1.1.0 + * deps: utils-merge@1.0.1 + * deps: vary@~1.1.2 + - perf: improve header token parsing speed + * perf: re-use options object when generating ETags + * perf: remove dead `.charset` set in `res.jsonp` + +4.15.5 / 2017-09-24 +=================== + + * deps: debug@2.6.9 + * deps: finalhandler@~1.0.6 + - deps: debug@2.6.9 + - deps: parseurl@~1.3.2 + * deps: fresh@0.5.2 + - Fix handling of modified headers with invalid dates + - perf: improve ETag match loop + - perf: improve `If-None-Match` token parsing + * deps: send@0.15.6 + - Fix handling of modified headers with invalid dates + - deps: debug@2.6.9 + - deps: etag@~1.8.1 + - deps: fresh@0.5.2 + - perf: improve `If-Match` token parsing + * deps: serve-static@1.12.6 + - deps: parseurl@~1.3.2 + - deps: send@0.15.6 + - perf: improve slash collapsing + +4.15.4 / 2017-08-06 +=================== + + * deps: debug@2.6.8 + * deps: depd@~1.1.1 + - Remove unnecessary `Buffer` loading + * deps: finalhandler@~1.0.4 + - deps: debug@2.6.8 + * deps: proxy-addr@~1.1.5 + - Fix array argument being altered + - deps: ipaddr.js@1.4.0 + * deps: qs@6.5.0 + * deps: send@0.15.4 + - deps: debug@2.6.8 + - deps: depd@~1.1.1 + - deps: http-errors@~1.6.2 + * deps: serve-static@1.12.4 + - deps: send@0.15.4 + +4.15.3 / 2017-05-16 +=================== + + * Fix error when `res.set` cannot add charset to `Content-Type` + * deps: debug@2.6.7 + - Fix `DEBUG_MAX_ARRAY_LENGTH` + - deps: ms@2.0.0 + * deps: finalhandler@~1.0.3 + - Fix missing `` in HTML document + - deps: debug@2.6.7 + * deps: proxy-addr@~1.1.4 + - deps: ipaddr.js@1.3.0 + * deps: send@0.15.3 + - deps: debug@2.6.7 + - deps: ms@2.0.0 + * deps: serve-static@1.12.3 + - deps: send@0.15.3 + * deps: type-is@~1.6.15 + - deps: mime-types@~2.1.15 + * deps: vary@~1.1.1 + - perf: hoist regular expression + +4.15.2 / 2017-03-06 +=================== + + * deps: qs@6.4.0 + - Fix regression parsing keys starting with `[` + +4.15.1 / 2017-03-05 +=================== + + * deps: send@0.15.1 + - Fix issue when `Date.parse` does not return `NaN` on invalid date + - Fix strict violation in broken environments + * deps: serve-static@1.12.1 + - Fix issue when `Date.parse` does not return `NaN` on invalid date + - deps: send@0.15.1 + +4.15.0 / 2017-03-01 +=================== + + * Add debug message when loading view engine + * Add `next("router")` to exit from router + * Fix case where `router.use` skipped requests routes did not + * Remove usage of `res._headers` private field + - Improves compatibility with Node.js 8 nightly + * Skip routing when `req.url` is not set + * Use `%o` in path debug to tell types apart + * Use `Object.create` to setup request & response prototypes + * Use `setprototypeof` module to replace `__proto__` setting + * Use `statuses` instead of `http` module for status messages + * deps: debug@2.6.1 + - Allow colors in workers + - Deprecated `DEBUG_FD` environment variable set to `3` or higher + - Fix error when running under React Native + - Use same color for same namespace + - deps: ms@0.7.2 + * deps: etag@~1.8.0 + - Use SHA1 instead of MD5 for ETag hashing + - Works with FIPS 140-2 OpenSSL configuration + * deps: finalhandler@~1.0.0 + - Fix exception when `err` cannot be converted to a string + - Fully URL-encode the pathname in the 404 + - Only include the pathname in the 404 message + - Send complete HTML document + - Set `Content-Security-Policy: default-src 'self'` header + - deps: debug@2.6.1 + * deps: fresh@0.5.0 + - Fix false detection of `no-cache` request directive + - Fix incorrect result when `If-None-Match` has both `*` and ETags + - Fix weak `ETag` matching to match spec + - perf: delay reading header values until needed + - perf: enable strict mode + - perf: hoist regular expressions + - perf: remove duplicate conditional + - perf: remove unnecessary boolean coercions + - perf: skip checking modified time if ETag check failed + - perf: skip parsing `If-None-Match` when no `ETag` header + - perf: use `Date.parse` instead of `new Date` + * deps: qs@6.3.1 + - Fix array parsing from skipping empty values + - Fix compacting nested arrays + * deps: send@0.15.0 + - Fix false detection of `no-cache` request directive + - Fix incorrect result when `If-None-Match` has both `*` and ETags + - Fix weak `ETag` matching to match spec + - Remove usage of `res._headers` private field + - Support `If-Match` and `If-Unmodified-Since` headers + - Use `res.getHeaderNames()` when available + - Use `res.headersSent` when available + - deps: debug@2.6.1 + - deps: etag@~1.8.0 + - deps: fresh@0.5.0 + - deps: http-errors@~1.6.1 + * deps: serve-static@1.12.0 + - Fix false detection of `no-cache` request directive + - Fix incorrect result when `If-None-Match` has both `*` and ETags + - Fix weak `ETag` matching to match spec + - Remove usage of `res._headers` private field + - Send complete HTML document in redirect response + - Set default CSP header in redirect response + - Support `If-Match` and `If-Unmodified-Since` headers + - Use `res.getHeaderNames()` when available + - Use `res.headersSent` when available + - deps: send@0.15.0 + * perf: add fast match path for `*` route + * perf: improve `req.ips` performance + +4.14.1 / 2017-01-28 +=================== + + * deps: content-disposition@0.5.2 + * deps: finalhandler@0.5.1 + - Fix exception when `err.headers` is not an object + - deps: statuses@~1.3.1 + - perf: hoist regular expressions + - perf: remove duplicate validation path + * deps: proxy-addr@~1.1.3 + - deps: ipaddr.js@1.2.0 + * deps: send@0.14.2 + - deps: http-errors@~1.5.1 + - deps: ms@0.7.2 + - deps: statuses@~1.3.1 + * deps: serve-static@~1.11.2 + - deps: send@0.14.2 + * deps: type-is@~1.6.14 + - deps: mime-types@~2.1.13 + +4.14.0 / 2016-06-16 +=================== + + * Add `acceptRanges` option to `res.sendFile`/`res.sendfile` + * Add `cacheControl` option to `res.sendFile`/`res.sendfile` + * Add `options` argument to `req.range` + - Includes the `combine` option + * Encode URL in `res.location`/`res.redirect` if not already encoded + * Fix some redirect handling in `res.sendFile`/`res.sendfile` + * Fix Windows absolute path check using forward slashes + * Improve error with invalid arguments to `req.get()` + * Improve performance for `res.json`/`res.jsonp` in most cases + * Improve `Range` header handling in `res.sendFile`/`res.sendfile` + * deps: accepts@~1.3.3 + - Fix including type extensions in parameters in `Accept` parsing + - Fix parsing `Accept` parameters with quoted equals + - Fix parsing `Accept` parameters with quoted semicolons + - Many performance improvements + - deps: mime-types@~2.1.11 + - deps: negotiator@0.6.1 + * deps: content-type@~1.0.2 + - perf: enable strict mode + * deps: cookie@0.3.1 + - Add `sameSite` option + - Fix cookie `Max-Age` to never be a floating point number + - Improve error message when `encode` is not a function + - Improve error message when `expires` is not a `Date` + - Throw better error for invalid argument to parse + - Throw on invalid values provided to `serialize` + - perf: enable strict mode + - perf: hoist regular expression + - perf: use for loop in parse + - perf: use string concatenation for serialization + * deps: finalhandler@0.5.0 + - Change invalid or non-numeric status code to 500 + - Overwrite status message to match set status code + - Prefer `err.statusCode` if `err.status` is invalid + - Set response headers from `err.headers` object + - Use `statuses` instead of `http` module for status messages + * deps: proxy-addr@~1.1.2 + - Fix accepting various invalid netmasks + - Fix IPv6-mapped IPv4 validation edge cases + - IPv4 netmasks must be contiguous + - IPv6 addresses cannot be used as a netmask + - deps: ipaddr.js@1.1.1 + * deps: qs@6.2.0 + - Add `decoder` option in `parse` function + * deps: range-parser@~1.2.0 + - Add `combine` option to combine overlapping ranges + - Fix incorrectly returning -1 when there is at least one valid range + - perf: remove internal function + * deps: send@0.14.1 + - Add `acceptRanges` option + - Add `cacheControl` option + - Attempt to combine multiple ranges into single range + - Correctly inherit from `Stream` class + - Fix `Content-Range` header in 416 responses when using `start`/`end` options + - Fix `Content-Range` header missing from default 416 responses + - Fix redirect error when `path` contains raw non-URL characters + - Fix redirect when `path` starts with multiple forward slashes + - Ignore non-byte `Range` headers + - deps: http-errors@~1.5.0 + - deps: range-parser@~1.2.0 + - deps: statuses@~1.3.0 + - perf: remove argument reassignment + * deps: serve-static@~1.11.1 + - Add `acceptRanges` option + - Add `cacheControl` option + - Attempt to combine multiple ranges into single range + - Fix redirect error when `req.url` contains raw non-URL characters + - Ignore non-byte `Range` headers + - Use status code 301 for redirects + - deps: send@0.14.1 + * deps: type-is@~1.6.13 + - Fix type error when given invalid type to match against + - deps: mime-types@~2.1.11 + * deps: vary@~1.1.0 + - Only accept valid field names in the `field` argument + * perf: use strict equality when possible + +4.13.4 / 2016-01-21 +=================== + + * deps: content-disposition@0.5.1 + - perf: enable strict mode + * deps: cookie@0.1.5 + - Throw on invalid values provided to `serialize` + * deps: depd@~1.1.0 + - Support web browser loading + - perf: enable strict mode + * deps: escape-html@~1.0.3 + - perf: enable strict mode + - perf: optimize string replacement + - perf: use faster string coercion + * deps: finalhandler@0.4.1 + - deps: escape-html@~1.0.3 + * deps: merge-descriptors@1.0.1 + - perf: enable strict mode + * deps: methods@~1.1.2 + - perf: enable strict mode + * deps: parseurl@~1.3.1 + - perf: enable strict mode + * deps: proxy-addr@~1.0.10 + - deps: ipaddr.js@1.0.5 + - perf: enable strict mode + * deps: range-parser@~1.0.3 + - perf: enable strict mode + * deps: send@0.13.1 + - deps: depd@~1.1.0 + - deps: destroy@~1.0.4 + - deps: escape-html@~1.0.3 + - deps: range-parser@~1.0.3 + * deps: serve-static@~1.10.2 + - deps: escape-html@~1.0.3 + - deps: parseurl@~1.3.0 + - deps: send@0.13.1 + +4.13.3 / 2015-08-02 +=================== + + * Fix infinite loop condition using `mergeParams: true` + * Fix inner numeric indices incorrectly altering parent `req.params` + +4.13.2 / 2015-07-31 +=================== + + * deps: accepts@~1.2.12 + - deps: mime-types@~2.1.4 + * deps: array-flatten@1.1.1 + - perf: enable strict mode + * deps: path-to-regexp@0.1.7 + - Fix regression with escaped round brackets and matching groups + * deps: type-is@~1.6.6 + - deps: mime-types@~2.1.4 4.13.1 / 2015-07-05 =================== @@ -720,13 +1264,13 @@ This is the first Express 5.0 alpha release, based off 4.10.1. - deps: negotiator@0.4.6 * deps: debug@1.0.2 * deps: send@0.4.3 - - Do not throw un-catchable error on file open race condition + - Do not throw uncatchable error on file open race condition - Use `escape-html` for HTML escaping - deps: debug@1.0.2 - deps: finished@1.2.2 - deps: fresh@0.2.2 * deps: serve-static@1.2.3 - - Do not throw un-catchable error on file open race condition + - Do not throw uncatchable error on file open race condition - deps: send@0.4.3 4.4.2 / 2014-06-09 @@ -902,6 +1446,22 @@ This is the first Express 5.0 alpha release, based off 4.10.1. - `app.route()` - Proxy to the app's `Router#route()` method to create a new route - Router & Route - public API +3.21.2 / 2015-07-31 +=================== + + * deps: connect@2.30.2 + - deps: body-parser@~1.13.3 + - deps: compression@~1.5.2 + - deps: errorhandler@~1.4.2 + - deps: method-override@~2.3.5 + - deps: serve-index@~1.7.2 + - deps: type-is@~1.6.6 + - deps: vhost@~3.0.1 + * deps: vary@~1.0.1 + - Fix setting empty header from empty `field` + - perf: enable strict mode + - perf: remove argument reassignments + 3.21.1 / 2015-07-05 =================== @@ -1590,7 +2150,7 @@ This is the first Express 5.0 alpha release, based off 4.10.1. - deps: serve-static@1.2.3 * deps: debug@1.0.2 * deps: send@0.4.3 - - Do not throw un-catchable error on file open race condition + - Do not throw uncatchable error on file open race condition - Use `escape-html` for HTML escaping - deps: debug@1.0.2 - deps: finished@1.2.2 @@ -2775,7 +3335,7 @@ Shaw] * Updated haml submodule * Changed ETag; removed inode, modified time only * Fixed LF to CRLF for setting multiple cookies - * Fixed cookie complation; values are now urlencoded + * Fixed cookie compilation; values are now urlencoded * Fixed cookies parsing; accepts quoted values and url escaped cookies 0.11.0 / 2010-05-06 @@ -2970,7 +3530,7 @@ Shaw] * Added "plot" format option for Profiler (for gnuplot processing) * Added request number to Profiler plugin - * Fixed binary encoding for multi-part file uploads, was previously defaulting to UTF8 + * Fixed binary encoding for multipart file uploads, was previously defaulting to UTF8 * Fixed issue with routes not firing when not files are present. Closes #184 * Fixed process.Promise -> events.Promise @@ -3016,7 +3576,7 @@ Shaw] * Updated sample chat app to show messages on load * Updated libxmljs parseString -> parseHtmlString * Fixed `make init` to work with older versions of git - * Fixed specs can now run independent specs for those who cant build deps. Closes #127 + * Fixed specs can now run independent specs for those who can't build deps. Closes #127 * Fixed issues introduced by the node url module changes. Closes 126. * Fixed two assertions failing due to Collection#keys() returning strings * Fixed faulty Collection#toArray() spec due to keys() returning strings diff --git a/node_modules/express/Readme.md b/node_modules/express/Readme.md index 8da83a5..0936816 100644 --- a/node_modules/express/Readme.md +++ b/node_modules/express/Readme.md @@ -1,16 +1,14 @@ [![Express Logo](https://i.cloudup.com/zfY6lL7eFa-3000x3000.png)](http://expressjs.com/) - Fast, unopinionated, minimalist web framework for [node](http://nodejs.org). + Fast, unopinionated, minimalist web framework for [Node.js](http://nodejs.org). - [![NPM Version][npm-image]][npm-url] - [![NPM Downloads][downloads-image]][downloads-url] - [![Linux Build][travis-image]][travis-url] - [![Windows Build][appveyor-image]][appveyor-url] - [![Test Coverage][coveralls-image]][coveralls-url] + [![NPM Version][npm-version-image]][npm-url] + [![NPM Install Size][npm-install-size-image]][npm-install-size-url] + [![NPM Downloads][npm-downloads-image]][npm-downloads-url] ```js -var express = require('express') -var app = express() +const express = require('express') +const app = express() app.get('/', function (req, res) { res.send('Hello World') @@ -21,10 +19,25 @@ app.listen(3000) ## Installation -```bash +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). + +Before installing, [download and install Node.js](https://nodejs.org/en/download/). +Node.js 0.10 or higher is required. + +If this is a brand new project, make sure to create a `package.json` first with +the [`npm init` command](https://docs.npmjs.com/creating-a-package-json-file). + +Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```console $ npm install express ``` +Follow [our installing guide](http://expressjs.com/en/starter/installing.html) +for more information. + ## Features * Robust routing @@ -37,15 +50,14 @@ $ npm install express ## Docs & Community - * [Website and Documentation](http://expressjs.com/) - [[website repo](https://github.com/strongloop/expressjs.com)] - * [#express](https://webchat.freenode.net/?channels=express) on freenode IRC - * [Github Organization](https://github.com/expressjs) for Official Middleware & Modules - * Visit the [Wiki](https://github.com/strongloop/express/wiki) + * [Website and Documentation](http://expressjs.com/) - [[website repo](https://github.com/expressjs/expressjs.com)] + * [#express](https://web.libera.chat/#express) on [Libera Chat](https://libera.chat) IRC + * [GitHub Organization](https://github.com/expressjs) for Official Middleware & Modules + * Visit the [Wiki](https://github.com/expressjs/express/wiki) * [Google Group](https://groups.google.com/group/express-js) for discussion - * [Русскоязычная документация](http://jsman.ru/express/) - * [한국어 문서](http://expressjs.kr) - [[website repo](https://github.com/Hanul/expressjs.kr)] + * [Gitter](https://gitter.im/expressjs/express) for support and discussion -**PROTIP** Be sure to read [Migrating from 3.x to 4.x](https://github.com/strongloop/express/wiki/Migrating-from-3.x-to-4.x) as well as [New features in 4.x](https://github.com/strongloop/express/wiki/New-features-in-4.x). +**PROTIP** Be sure to read [Migrating from 3.x to 4.x](https://github.com/expressjs/express/wiki/Migrating-from-3.x-to-4.x) as well as [New features in 4.x](https://github.com/expressjs/express/wiki/New-features-in-4.x). ## Quick Start @@ -53,32 +65,34 @@ $ npm install express Install the executable. The executable's major version will match Express's: -```bash +```console $ npm install -g express-generator@4 ``` Create the app: -```bash +```console $ express /tmp/foo && cd /tmp/foo ``` Install dependencies: -```bash +```console $ npm install ``` Start the server: -```bash +```console $ npm start ``` + View the website at: http://localhost:3000 + ## Philosophy The Express philosophy is to provide small, robust tooling for HTTP servers, making - it a great solution for single page applications, web sites, hybrids, or public + it a great solution for single page applications, websites, hybrids, or public HTTP APIs. Express does not force you to use any specific ORM or template engine. With support for over @@ -89,50 +103,64 @@ $ npm start To view the examples, clone the Express repo and install the dependencies: -```bash -$ git clone git://github.com/strongloop/express.git --depth 1 +```console +$ git clone git://github.com/expressjs/express.git --depth 1 $ cd express $ npm install ``` Then run whichever example you want: -```bash +```console $ node examples/content-negotiation ``` -## Tests +## Contributing - To run the test suite, first install the dependencies, then run `npm test`: + [![Linux Build][github-actions-ci-image]][github-actions-ci-url] + [![Windows Build][appveyor-image]][appveyor-url] + [![Test Coverage][coveralls-image]][coveralls-url] -```bash +The Express.js project welcomes all constructive contributions. Contributions take many forms, +from code for bug fixes and enhancements, to additions and fixes to documentation, additional +tests, triaging incoming pull requests and issues, and more! + +See the [Contributing Guide](Contributing.md) for more technical details on contributing. + +### Security Issues + +If you discover a security vulnerability in Express, please see [Security Policies and Procedures](Security.md). + +### Running Tests + +To run the test suite, first install the dependencies, then run `npm test`: + +```console $ npm install $ npm test ``` ## People -The original author of Express is [TJ Holowaychuk](https://github.com/tj) [![TJ's Gratipay][gratipay-image-visionmedia]][gratipay-url-visionmedia] +The original author of Express is [TJ Holowaychuk](https://github.com/tj) -The current lead maintainer is [Douglas Christopher Wilson](https://github.com/dougwilson) [![Doug's Gratipay][gratipay-image-dougwilson]][gratipay-url-dougwilson] +The current lead maintainer is [Douglas Christopher Wilson](https://github.com/dougwilson) -[List of all contributors](https://github.com/strongloop/express/graphs/contributors) +[List of all contributors](https://github.com/expressjs/express/graphs/contributors) ## License [MIT](LICENSE) -[npm-image]: https://img.shields.io/npm/v/express.svg -[npm-url]: https://npmjs.org/package/express -[downloads-image]: https://img.shields.io/npm/dm/express.svg -[downloads-url]: https://npmjs.org/package/express -[travis-image]: https://img.shields.io/travis/strongloop/express/master.svg?label=linux -[travis-url]: https://travis-ci.org/strongloop/express -[appveyor-image]: https://img.shields.io/appveyor/ci/dougwilson/express/master.svg?label=windows +[appveyor-image]: https://badgen.net/appveyor/ci/dougwilson/express/master?label=windows [appveyor-url]: https://ci.appveyor.com/project/dougwilson/express -[coveralls-image]: https://img.shields.io/coveralls/strongloop/express/master.svg -[coveralls-url]: https://coveralls.io/r/strongloop/express?branch=master -[gratipay-image-visionmedia]: https://img.shields.io/gratipay/visionmedia.svg -[gratipay-url-visionmedia]: https://gratipay.com/visionmedia/ -[gratipay-image-dougwilson]: https://img.shields.io/gratipay/dougwilson.svg -[gratipay-url-dougwilson]: https://gratipay.com/dougwilson/ +[coveralls-image]: https://badgen.net/coveralls/c/github/expressjs/express/master +[coveralls-url]: https://coveralls.io/r/expressjs/express?branch=master +[github-actions-ci-image]: https://badgen.net/github/checks/expressjs/express/master?label=linux +[github-actions-ci-url]: https://github.com/expressjs/express/actions/workflows/ci.yml +[npm-downloads-image]: https://badgen.net/npm/dm/express +[npm-downloads-url]: https://npmcharts.com/compare/express?minimal=true +[npm-install-size-image]: https://badgen.net/packagephobia/install/express +[npm-install-size-url]: https://packagephobia.com/result?p=express +[npm-url]: https://npmjs.org/package/express +[npm-version-image]: https://badgen.net/npm/v/express diff --git a/node_modules/express/lib/application.js b/node_modules/express/lib/application.js index bcc5094..ebb30b5 100644 --- a/node_modules/express/lib/application.js +++ b/node_modules/express/lib/application.js @@ -14,17 +14,28 @@ */ var finalhandler = require('finalhandler'); +var Router = require('./router'); var methods = require('methods'); +var middleware = require('./middleware/init'); +var query = require('./middleware/query'); var debug = require('debug')('express:application'); var View = require('./view'); var http = require('http'); var compileETag = require('./utils').compileETag; var compileQueryParser = require('./utils').compileQueryParser; var compileTrust = require('./utils').compileTrust; +var deprecate = require('depd')('express'); var flatten = require('array-flatten'); var merge = require('utils-merge'); var resolve = require('path').resolve; -var Router = require('router'); +var setPrototypeOf = require('setprototypeof') + +/** + * Module variables. + * @private + */ + +var hasOwnProperty = Object.prototype.hasOwnProperty var slice = Array.prototype.slice; /** @@ -51,29 +62,11 @@ var trustProxyDefaultSymbol = '@@symbol:trust_proxy_default'; */ app.init = function init() { - var router = null; - this.cache = {}; this.engines = {}; this.settings = {}; this.defaultConfiguration(); - - // Setup getting to lazily add base router - Object.defineProperty(this, 'router', { - configurable: true, - enumerable: true, - get: function getrouter() { - if (router === null) { - router = new Router({ - caseSensitive: this.enabled('case sensitive routing'), - strict: this.enabled('strict routing') - }); - } - - return router; - } - }); }; /** @@ -109,10 +102,10 @@ app.defaultConfiguration = function defaultConfiguration() { } // inherit protos - this.request.__proto__ = parent.request; - this.response.__proto__ = parent.response; - this.engines.__proto__ = parent.engines; - this.settings.__proto__ = parent.settings; + setPrototypeOf(this.request, parent.request) + setPrototypeOf(this.response, parent.response) + setPrototypeOf(this.engines, parent.engines) + setPrototypeOf(this.settings, parent.settings) }); // setup locals @@ -132,6 +125,32 @@ app.defaultConfiguration = function defaultConfiguration() { if (env === 'production') { this.enable('view cache'); } + + Object.defineProperty(this, 'router', { + get: function() { + throw new Error('\'app.router\' is deprecated!\nPlease see the 3.x to 4.x migration guide for details on how to update your app.'); + } + }); +}; + +/** + * lazily adds the base router if it has not yet been added. + * + * We cannot add the base router in the defaultConfiguration because + * it reads app settings which might be set after that has run. + * + * @private + */ +app.lazyrouter = function lazyrouter() { + if (!this._router) { + this._router = new Router({ + caseSensitive: this.enabled('case sensitive routing'), + strict: this.enabled('strict routing') + }); + + this._router.use(query(this.get('query parser fn'))); + this._router.use(middleware.init(this)); + } }; /** @@ -144,31 +163,22 @@ app.defaultConfiguration = function defaultConfiguration() { */ app.handle = function handle(req, res, callback) { + var router = this._router; + // final handler var done = callback || finalhandler(req, res, { env: this.get('env'), onerror: logerror.bind(this) }); - // set powered by header - if (this.enabled('x-powered-by')) { - res.setHeader('X-Powered-By', 'Express'); + // no routes + if (!router) { + debug('no routes defined on app'); + done(); + return; } - // set circular references - req.res = res; - res.req = req; - - // alter the prototypes - req.__proto__ = this.request; - res.__proto__ = this.response; - - // setup locals - if (!res.locals) { - res.locals = Object.create(null); - } - - this.router.handle(req, res, done); + router.handle(req, res, done); }; /** @@ -204,11 +214,12 @@ app.use = function use(fn) { var fns = flatten(slice.call(arguments, offset)); if (fns.length === 0) { - throw new TypeError('app.use() requires middleware functions'); + throw new TypeError('app.use() requires a middleware function') } - // get router - var router = this.router; + // setup router + this.lazyrouter(); + var router = this._router; fns.forEach(function (fn) { // non-express app @@ -224,8 +235,8 @@ app.use = function use(fn) { router.use(path, function mounted_app(req, res, next) { var orig = req.app; fn.handle(req, res, function (err) { - req.__proto__ = orig.request; - res.__proto__ = orig.response; + setPrototypeOf(req, orig.request) + setPrototypeOf(res, orig.response) next(err); }); }); @@ -248,7 +259,8 @@ app.use = function use(fn) { */ app.route = function route(path) { - return this.router.route(path); + this.lazyrouter(); + return this._router.route(path); }; /** @@ -257,9 +269,9 @@ app.route = function route(path) { * * By default will `require()` the engine based on the * file extension. For example if you try to render - * a "foo.jade" file Express will invoke the following internally: + * a "foo.ejs" file Express will invoke the following internally: * - * app.engine('jade', require('jade').__express); + * app.engine('ejs', require('ejs').__express); * * For engines that do not provide `.__express` out of the box, * or if you wish to "map" a different extension to the template engine @@ -271,7 +283,7 @@ app.route = function route(path) { * In this case EJS provides a `.renderFile()` method with * the same signature that Express expects: `(path, options, callback)`, * though note that it aliases this method as `ejs.__express` internally - * so if you're using ".ejs" extensions you dont need to do anything. + * so if you're using ".ejs" extensions you don't need to do anything. * * Some template engines do not follow this convention, the * [Consolidate.js](https://github.com/tj/consolidate.js) @@ -314,6 +326,8 @@ app.engine = function engine(ext, fn) { */ app.param = function param(name, fn) { + this.lazyrouter(); + if (Array.isArray(name)) { for (var i = 0; i < name.length; i++) { this.param(name[i], fn); @@ -322,7 +336,7 @@ app.param = function param(name, fn) { return this; } - this.router.param(name, fn); + this._router.param(name, fn); return this; }; @@ -331,7 +345,7 @@ app.param = function param(name, fn) { * Assign `setting` to `val`, or return `setting`'s value. * * app.set('foo', 'bar'); - * app.get('foo'); + * app.set('foo'); * // => "bar" * * Mounted servers inherit their parent server's settings. @@ -345,7 +359,17 @@ app.param = function param(name, fn) { app.set = function set(setting, val) { if (arguments.length === 1) { // app.get(setting) - return this.settings[setting]; + var settings = this.settings + + while (settings && settings !== Object.prototype) { + if (hasOwnProperty.call(settings, setting)) { + return settings[setting] + } + + settings = Object.getPrototypeOf(settings) + } + + return undefined } debug('set "%s" to %o', setting, val); @@ -469,7 +493,9 @@ methods.forEach(function(method){ return this.set(path); } - var route = this.route(path); + this.lazyrouter(); + + var route = this._router.route(path); route[method].apply(route, slice.call(arguments, 1)); return this; }; @@ -486,7 +512,9 @@ methods.forEach(function(method){ */ app.all = function all(path) { - var route = this.route(path); + this.lazyrouter(); + + var route = this._router.route(path); var args = slice.call(arguments, 1); for (var i = 0; i < methods.length; i++) { @@ -496,6 +524,10 @@ app.all = function all(path) { return this; }; +// del -> delete alias + +app.del = deprecate.function(app.delete, 'app.del: Use app.delete instead'); + /** * Render the given view `name` name with `options` * and a callback accepting an error and the @@ -508,7 +540,7 @@ app.all = function all(path) { * }) * * @param {String} name - * @param {String|Function} options or fn + * @param {Object|Function} options or fn * @param {Function} callback * @public */ diff --git a/node_modules/express/lib/express.js b/node_modules/express/lib/express.js index ff62644..d188a16 100644 --- a/node_modules/express/lib/express.js +++ b/node_modules/express/lib/express.js @@ -12,10 +12,12 @@ * Module dependencies. */ +var bodyParser = require('body-parser') var EventEmitter = require('events').EventEmitter; var mixin = require('merge-descriptors'); var proto = require('./application'); -var Router = require('router'); +var Route = require('./router/route'); +var Router = require('./router'); var req = require('./request'); var res = require('./response'); @@ -40,8 +42,16 @@ function createApplication() { mixin(app, EventEmitter.prototype, false); mixin(app, proto, false); - app.request = { __proto__: req, app: app }; - app.response = { __proto__: res, app: app }; + // expose the prototype that will get set on requests + app.request = Object.create(req, { + app: { configurable: true, enumerable: true, writable: true, value: app } + }) + + // expose the prototype that will get set on responses + app.response = Object.create(res, { + app: { configurable: true, enumerable: true, writable: true, value: app } + }) + app.init(); return app; } @@ -58,22 +68,25 @@ exports.response = res; * Expose constructors. */ -exports.Route = Router.Route; +exports.Route = Route; exports.Router = Router; /** * Expose middleware */ +exports.json = bodyParser.json +exports.query = require('./middleware/query'); +exports.raw = bodyParser.raw exports.static = require('serve-static'); +exports.text = bodyParser.text +exports.urlencoded = bodyParser.urlencoded /** * Replace removed middleware with an appropriate error message. */ -[ - 'json', - 'urlencoded', +var removedMiddlewares = [ 'bodyParser', 'compress', 'cookieSession', @@ -90,9 +103,10 @@ exports.static = require('serve-static'); 'directory', 'limit', 'multipart', - 'staticCache', - 'query', -].forEach(function (name) { + 'staticCache' +] + +removedMiddlewares.forEach(function (name) { Object.defineProperty(exports, name, { get: function () { throw new Error('Most middleware (like ' + name + ') is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.'); diff --git a/node_modules/express/lib/middleware/init.js b/node_modules/express/lib/middleware/init.js new file mode 100644 index 0000000..dfd0427 --- /dev/null +++ b/node_modules/express/lib/middleware/init.js @@ -0,0 +1,43 @@ +/*! + * express + * Copyright(c) 2009-2013 TJ Holowaychuk + * Copyright(c) 2013 Roman Shtylman + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module dependencies. + * @private + */ + +var setPrototypeOf = require('setprototypeof') + +/** + * Initialization middleware, exposing the + * request and response to each other, as well + * as defaulting the X-Powered-By header field. + * + * @param {Function} app + * @return {Function} + * @api private + */ + +exports.init = function(app){ + return function expressInit(req, res, next){ + if (app.enabled('x-powered-by')) res.setHeader('X-Powered-By', 'Express'); + req.res = res; + res.req = req; + req.next = next; + + setPrototypeOf(req, app.request) + setPrototypeOf(res, app.response) + + res.locals = res.locals || Object.create(null); + + next(); + }; +}; + diff --git a/node_modules/express/lib/middleware/query.js b/node_modules/express/lib/middleware/query.js new file mode 100644 index 0000000..7e91669 --- /dev/null +++ b/node_modules/express/lib/middleware/query.js @@ -0,0 +1,47 @@ +/*! + * express + * Copyright(c) 2009-2013 TJ Holowaychuk + * Copyright(c) 2013 Roman Shtylman + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module dependencies. + */ + +var merge = require('utils-merge') +var parseUrl = require('parseurl'); +var qs = require('qs'); + +/** + * @param {Object} options + * @return {Function} + * @api public + */ + +module.exports = function query(options) { + var opts = merge({}, options) + var queryparse = qs.parse; + + if (typeof options === 'function') { + queryparse = options; + opts = undefined; + } + + if (opts !== undefined && opts.allowPrototypes === undefined) { + // back-compat for qs module + opts.allowPrototypes = true; + } + + return function query(req, res, next){ + if (!req.query) { + var val = parseUrl(req).query; + req.query = queryparse(val, opts); + } + + next(); + }; +}; diff --git a/node_modules/express/lib/request.js b/node_modules/express/lib/request.js index b881df8..3f1eeca 100644 --- a/node_modules/express/lib/request.js +++ b/node_modules/express/lib/request.js @@ -14,6 +14,7 @@ */ var accepts = require('accepts'); +var deprecate = require('depd')('express'); var isIP = require('net').isIP; var typeis = require('type-is'); var http = require('http'); @@ -24,11 +25,17 @@ var proxyaddr = require('proxy-addr'); /** * Request prototype. + * @public */ -var req = exports = module.exports = { - __proto__: http.IncomingMessage.prototype -}; +var req = Object.create(http.IncomingMessage.prototype) + +/** + * Module exports. + * @public + */ + +module.exports = req /** * Return request header. @@ -56,6 +63,14 @@ var req = exports = module.exports = { req.get = req.header = function header(name) { + if (!name) { + throw new TypeError('name argument is required to req.get'); + } + + if (typeof name !== 'string') { + throw new TypeError('name must be a string to req.get'); + } + var lc = name.toLowerCase(); switch (lc) { @@ -132,6 +147,9 @@ req.acceptsEncodings = function(){ return accept.encodings.apply(accept, arguments); }; +req.acceptsEncoding = deprecate.function(req.acceptsEncodings, + 'req.acceptsEncoding: Use acceptsEncodings instead'); + /** * Check if the given `charset`s are acceptable, * otherwise you should respond with 406 "Not Acceptable". @@ -146,6 +164,9 @@ req.acceptsCharsets = function(){ return accept.charsets.apply(accept, arguments); }; +req.acceptsCharset = deprecate.function(req.acceptsCharsets, + 'req.acceptsCharset: Use acceptsCharsets instead'); + /** * Check if the given `lang`s are acceptable, * otherwise you should respond with 406 "Not Acceptable". @@ -160,58 +181,77 @@ req.acceptsLanguages = function(){ return accept.languages.apply(accept, arguments); }; +req.acceptsLanguage = deprecate.function(req.acceptsLanguages, + 'req.acceptsLanguage: Use acceptsLanguages instead'); + /** - * Parse Range header field, - * capping to the given `size`. + * Parse Range header field, capping to the given `size`. * - * Unspecified ranges such as "0-" require - * knowledge of your resource length. In - * the case of a byte range this is of course - * the total number of bytes. If the Range - * header field is not given `null` is returned, - * `-1` when unsatisfiable, `-2` when syntactically invalid. + * Unspecified ranges such as "0-" require knowledge of your resource length. In + * the case of a byte range this is of course the total number of bytes. If the + * Range header field is not given `undefined` is returned, `-1` when unsatisfiable, + * and `-2` when syntactically invalid. * - * NOTE: remember that ranges are inclusive, so - * for example "Range: users=0-3" should respond - * with 4 users when available, not 3. + * When ranges are returned, the array has a "type" property which is the type of + * range that is required (most commonly, "bytes"). Each array element is an object + * with a "start" and "end" property for the portion of the range. * - * @param {Number} size - * @return {Array} + * The "combine" option can be set to `true` and overlapping & adjacent ranges + * will be combined into a single range. + * + * NOTE: remember that ranges are inclusive, so for example "Range: users=0-3" + * should respond with 4 users when available, not 3. + * + * @param {number} size + * @param {object} [options] + * @param {boolean} [options.combine=false] + * @return {number|array} * @public */ -req.range = function(size){ +req.range = function range(size, options) { var range = this.get('Range'); if (!range) return; - return parseRange(size, range); + return parseRange(size, range, options); }; /** - * Parse the query string of `req.url`. + * Return the value of param `name` when present or `defaultValue`. * - * This uses the "query parser" setting to parse the raw - * string into an object. + * - Checks route placeholders, ex: _/user/:id_ + * - Checks body params, ex: id=12, {"id":12} + * - Checks query string params, ex: ?id=12 * + * To utilize request bodies, `req.body` + * should be an object. This can be done by using + * the `bodyParser()` middleware. + * + * @param {String} name + * @param {Mixed} [defaultValue] * @return {String} - * @api public + * @public */ -defineGetter(req, 'query', function query(){ - var queryparse = this.app.get('query parser fn'); +req.param = function param(name, defaultValue) { + var params = this.params || {}; + var body = this.body || {}; + var query = this.query || {}; - if (!queryparse) { - // parsing is disabled - return Object.create(null); - } + var args = arguments.length === 1 + ? 'name' + : 'name, default'; + deprecate('req.param(' + args + '): Use req.params, req.body, or req.query instead'); - var querystring = parse(this).query; + if (null != params[name] && params.hasOwnProperty(name)) return params[name]; + if (null != body[name]) return body[name]; + if (null != query[name]) return query[name]; - return queryparse(querystring); -}); + return defaultValue; +}; /** * Check if the incoming request contains the "Content-Type" - * header field, and it contains the give mime `type`. + * header field, and it contains the given mime `type`. * * Examples: * @@ -275,14 +315,18 @@ defineGetter(req, 'protocol', function protocol(){ // Note: X-Forwarded-Proto is normally only ever a // single value, but this is to be safe. - proto = this.get('X-Forwarded-Proto') || proto; - return proto.split(/\s*,\s*/)[0]; + var header = this.get('X-Forwarded-Proto') || proto + var index = header.indexOf(',') + + return index !== -1 + ? header.substring(0, index).trim() + : header.trim() }); /** * Short-hand for: * - * req.protocol == 'https' + * req.protocol === 'https' * * @return {Boolean} * @public @@ -322,7 +366,12 @@ defineGetter(req, 'ip', function ip(){ defineGetter(req, 'ips', function ips() { var trust = this.app.get('trust proxy fn'); var addrs = proxyaddr.all(this, trust); - return addrs.slice(1).reverse(); + + // reverse the order (to farthest -> closest) + // and remove socket address + addrs.reverse().pop() + + return addrs }); /** @@ -365,7 +414,7 @@ defineGetter(req, 'path', function path() { }); /** - * Parse the "Host" header field to a host. + * Parse the "Host" header field to a hostname. * * When the "trust proxy" setting trusts the socket * address, the "X-Forwarded-Host" header field will @@ -375,30 +424,17 @@ defineGetter(req, 'path', function path() { * @public */ -defineGetter(req, 'host', function host(){ - var trust = this.app.get('trust proxy fn'); - var val = this.get('X-Forwarded-Host'); - - if (!val || !trust(this.connection.remoteAddress, 0)) { - val = this.get('Host'); - } - - return val || undefined; -}); - -/** - * Parse the "Host" header field to a hostname. - * - * When the "trust proxy" setting trusts the socket - * address, the "X-Forwarded-Host" header field will - * be trusted. - * - * @return {String} - * @api public - */ - defineGetter(req, 'hostname', function hostname(){ - var host = this.host; + var trust = this.app.get('trust proxy fn'); + var host = this.get('X-Forwarded-Host'); + + if (!host || !trust(this.connection.remoteAddress, 0)) { + host = this.get('Host'); + } else if (host.indexOf(',') !== -1) { + // Note: X-Forwarded-Host is normally only ever a + // single value, but this is to be safe. + host = host.substring(0, host.indexOf(',')).trimRight() + } if (!host) return; @@ -413,6 +449,12 @@ defineGetter(req, 'hostname', function hostname(){ : host; }); +// TODO: change req.host to return host in next major + +defineGetter(req, 'host', deprecate.function(function host(){ + return this.hostname; +}, 'req.host: Use req.hostname instead')); + /** * Check if the request is fresh, aka * Last-Modified and/or the ETag @@ -424,14 +466,18 @@ defineGetter(req, 'hostname', function hostname(){ defineGetter(req, 'fresh', function(){ var method = this.method; - var s = this.res.statusCode; + var res = this.res + var status = res.statusCode // GET or HEAD for weak freshness validation only - if ('GET' != method && 'HEAD' != method) return false; + if ('GET' !== method && 'HEAD' !== method) return false; // 2xx or 304 as per rfc2616 14.26 - if ((s >= 200 && s < 300) || 304 == s) { - return fresh(this.headers, (this.res._headers || {})); + if ((status >= 200 && status < 300) || 304 === status) { + return fresh(this.headers, { + 'etag': res.get('ETag'), + 'last-modified': res.get('Last-Modified') + }) } return false; @@ -476,4 +522,4 @@ function defineGetter(obj, name, getter) { enumerable: true, get: getter }); -}; +} diff --git a/node_modules/express/lib/response.js b/node_modules/express/lib/response.js index d10d63e..fede486 100644 --- a/node_modules/express/lib/response.js +++ b/node_modules/express/lib/response.js @@ -12,19 +12,22 @@ * @private */ +var Buffer = require('safe-buffer').Buffer var contentDisposition = require('content-disposition'); +var createError = require('http-errors') var deprecate = require('depd')('express'); +var encodeUrl = require('encodeurl'); var escapeHtml = require('escape-html'); var http = require('http'); +var isAbsolute = require('./utils').isAbsolute; var onFinished = require('on-finished'); var path = require('path'); -var pathIsAbsolute = require('path-is-absolute'); +var statuses = require('statuses') var merge = require('utils-merge'); var sign = require('cookie-signature').sign; var normalizeType = require('./utils').normalizeType; var normalizeTypes = require('./utils').normalizeTypes; var setCharset = require('./utils').setCharset; -var statusCodes = http.STATUS_CODES; var cookie = require('cookie'); var send = require('send'); var extname = path.extname; @@ -34,11 +37,17 @@ var vary = require('vary'); /** * Response prototype. + * @public */ -var res = module.exports = { - __proto__: http.ServerResponse.prototype -}; +var res = Object.create(http.ServerResponse.prototype) + +/** + * Module exports. + * @public + */ + +module.exports = res /** * Module variables. @@ -56,6 +65,9 @@ var charsetRegExp = /;\s*charset\s*=/; */ res.status = function status(code) { + if ((typeof code === 'string' || Math.floor(code) !== code) && code > 99 && code < 1000) { + deprecate('res.status(' + JSON.stringify(code) + '): use res.status(' + Math.floor(code) + ') instead') + } this.statusCode = code; return this; }; @@ -88,7 +100,7 @@ res.links = function(links){ * * Examples: * - * res.send(new Buffer('wahoo')); + * res.send(Buffer.from('wahoo')); * res.send({ some: 'json' }); * res.send('

some html

'); * @@ -99,18 +111,35 @@ res.links = function(links){ res.send = function send(body) { var chunk = body; var encoding; - var len; var req = this.req; var type; // settings var app = this.app; - // support res.send(status, body) + // allow status / body if (arguments.length === 2) { - deprecate('res.send(status, body): Use res.status(status).send(body) instead'); - this.statusCode = arguments[0]; - chunk = arguments[1]; + // res.send(body, status) backwards compat + if (typeof arguments[0] !== 'number' && typeof arguments[1] === 'number') { + deprecate('res.send(body, status): Use res.status(status).send(body) instead'); + this.statusCode = arguments[1]; + } else { + deprecate('res.send(status, body): Use res.status(status).send(body) instead'); + this.statusCode = arguments[0]; + chunk = arguments[1]; + } + } + + // disambiguate res.send(status) and res.send(status, num) + if (typeof chunk === 'number' && arguments.length === 1) { + // res.send(status) will set status message as text string + if (!this.get('Content-Type')) { + this.type('txt'); + } + + deprecate('res.send(status): Use res.sendStatus(status) instead'); + this.statusCode = chunk; + chunk = statuses.message[chunk] } switch (typeof chunk) { @@ -146,23 +175,33 @@ res.send = function send(body) { } } + // determine if ETag should be generated + var etagFn = app.get('etag fn') + var generateETag = !this.get('ETag') && typeof etagFn === 'function' + // populate Content-Length + var len if (chunk !== undefined) { - if (!Buffer.isBuffer(chunk)) { - // convert chunk to Buffer; saves later double conversions - chunk = new Buffer(chunk, encoding); + if (Buffer.isBuffer(chunk)) { + // get length of Buffer + len = chunk.length + } else if (!generateETag && chunk.length < 1000) { + // just calculate length when no ETag + small chunk + len = Buffer.byteLength(chunk, encoding) + } else { + // convert chunk to Buffer and calculate + chunk = Buffer.from(chunk, encoding) encoding = undefined; + len = chunk.length } - len = chunk.length; this.set('Content-Length', len); } // populate ETag var etag; - var generateETag = len !== undefined && app.get('etag fn'); - if (typeof generateETag === 'function' && !this.get('ETag')) { - if ((etag = generateETag(chunk, encoding))) { + if (generateETag && len !== undefined) { + if ((etag = etagFn(chunk, encoding))) { this.set('ETag', etag); } } @@ -171,13 +210,20 @@ res.send = function send(body) { if (req.fresh) this.statusCode = 304; // strip irrelevant headers - if (204 == this.statusCode || 304 == this.statusCode) { + if (204 === this.statusCode || 304 === this.statusCode) { this.removeHeader('Content-Type'); this.removeHeader('Content-Length'); this.removeHeader('Transfer-Encoding'); chunk = ''; } + // alter headers for 205 + if (this.statusCode === 205) { + this.set('Content-Length', '0') + this.removeHeader('Transfer-Encoding') + chunk = '' + } + if (req.method === 'HEAD') { // skip body for HEAD this.end(); @@ -204,18 +250,25 @@ res.send = function send(body) { res.json = function json(obj) { var val = obj; - // support res.json(status, obj) + // allow status / body if (arguments.length === 2) { - deprecate('res.json(status, obj): Use res.status(status).json(obj) instead'); - this.statusCode = arguments[0]; - val = arguments[1]; + // res.json(body, status) backwards compat + if (typeof arguments[1] === 'number') { + deprecate('res.json(obj, status): Use res.status(status).json(obj) instead'); + this.statusCode = arguments[1]; + } else { + deprecate('res.json(status, obj): Use res.status(status).json(obj) instead'); + this.statusCode = arguments[0]; + val = arguments[1]; + } } // settings var app = this.app; + var escape = app.get('json escape') var replacer = app.get('json replacer'); var spaces = app.get('json spaces'); - var body = JSON.stringify(val, replacer, spaces); + var body = stringify(val, replacer, spaces, escape) // content-type if (!this.get('Content-Type')) { @@ -240,18 +293,25 @@ res.json = function json(obj) { res.jsonp = function jsonp(obj) { var val = obj; - // support res.jsonp(status, obj) + // allow status / body if (arguments.length === 2) { - deprecate('res.jsonp(status, obj): Use res.status(status).jsonp(obj) instead'); - this.statusCode = arguments[0]; - val = arguments[1]; + // res.jsonp(body, status) backwards compat + if (typeof arguments[1] === 'number') { + deprecate('res.jsonp(obj, status): Use res.status(status).jsonp(obj) instead'); + this.statusCode = arguments[1]; + } else { + deprecate('res.jsonp(status, obj): Use res.status(status).jsonp(obj) instead'); + this.statusCode = arguments[0]; + val = arguments[1]; + } } // settings var app = this.app; + var escape = app.get('json escape') var replacer = app.get('json replacer'); var spaces = app.get('json spaces'); - var body = JSON.stringify(val, replacer, spaces); + var body = stringify(val, replacer, spaces, escape) var callback = this.req.query[app.get('jsonp callback name')]; // content-type @@ -267,17 +327,21 @@ res.jsonp = function jsonp(obj) { // jsonp if (typeof callback === 'string' && callback.length !== 0) { - this.charset = 'utf-8'; this.set('X-Content-Type-Options', 'nosniff'); this.set('Content-Type', 'text/javascript'); // restrict callback charset callback = callback.replace(/[^\[\]\w$.]/g, ''); - // replace chars not allowed in JavaScript that are in JSON - body = body - .replace(/\u2028/g, '\\u2028') - .replace(/\u2029/g, '\\u2029'); + if (body === undefined) { + // empty argument + body = '' + } else if (typeof body === 'string') { + // replace chars not allowed in JavaScript that are in JSON + body = body + .replace(/\u2028/g, '\\u2028') + .replace(/\u2029/g, '\\u2029') + } // the /**/ is a specific security mitigation for "Rosetta Flash JSONP abuse" // the typeof check is just to reduce client error noise @@ -303,7 +367,7 @@ res.jsonp = function jsonp(obj) { */ res.sendStatus = function sendStatus(statusCode) { - var body = statusCodes[statusCode] || String(statusCode); + var body = statuses.message[statusCode] || String(statusCode) this.statusCode = statusCode; this.type('txt'); @@ -316,7 +380,7 @@ res.sendStatus = function sendStatus(statusCode) { * * Automatically sets the _Content-Type_ response header field. * The callback `callback(err)` is invoked when the transfer is complete - * or when an error occurs. Be sure to check `res.sentHeader` + * or when an error occurs. Be sure to check `res.headersSent` * if you wish to attempt responding, as the header and some data * may have already been transferred. * @@ -363,13 +427,17 @@ res.sendFile = function sendFile(path, options, callback) { throw new TypeError('path argument is required to res.sendFile'); } + if (typeof path !== 'string') { + throw new TypeError('path must be a string to res.sendFile') + } + // support function as second arg if (typeof options === 'function') { done = options; opts = {}; } - if (!opts.root && !pathIsAbsolute(path)) { + if (!opts.root && !isAbsolute(path)) { throw new TypeError('path must be absolute or specify root to res.sendFile'); } @@ -389,27 +457,116 @@ res.sendFile = function sendFile(path, options, callback) { }); }; +/** + * Transfer the file at the given `path`. + * + * Automatically sets the _Content-Type_ response header field. + * The callback `callback(err)` is invoked when the transfer is complete + * or when an error occurs. Be sure to check `res.headersSent` + * if you wish to attempt responding, as the header and some data + * may have already been transferred. + * + * Options: + * + * - `maxAge` defaulting to 0 (can be string converted by `ms`) + * - `root` root directory for relative filenames + * - `headers` object of headers to serve with file + * - `dotfiles` serve dotfiles, defaulting to false; can be `"allow"` to send them + * + * Other options are passed along to `send`. + * + * Examples: + * + * The following example illustrates how `res.sendfile()` may + * be used as an alternative for the `static()` middleware for + * dynamic situations. The code backing `res.sendfile()` is actually + * the same code, so HTTP cache support etc is identical. + * + * app.get('/user/:uid/photos/:file', function(req, res){ + * var uid = req.params.uid + * , file = req.params.file; + * + * req.user.mayViewFilesFrom(uid, function(yes){ + * if (yes) { + * res.sendfile('/uploads/' + uid + '/' + file); + * } else { + * res.send(403, 'Sorry! you cant see that.'); + * } + * }); + * }); + * + * @public + */ + +res.sendfile = function (path, options, callback) { + var done = callback; + var req = this.req; + var res = this; + var next = req.next; + var opts = options || {}; + + // support function as second arg + if (typeof options === 'function') { + done = options; + opts = {}; + } + + // create file stream + var file = send(req, path, opts); + + // transfer + sendfile(res, file, opts, function (err) { + if (done) return done(err); + if (err && err.code === 'EISDIR') return next(); + + // next() all but write errors + if (err && err.code !== 'ECONNABORTED' && err.syscall !== 'write') { + next(err); + } + }); +}; + +res.sendfile = deprecate.function(res.sendfile, + 'res.sendfile: Use res.sendFile instead'); + /** * Transfer the file at the given `path` as an attachment. * * Optionally providing an alternate attachment `filename`, * and optional callback `callback(err)`. The callback is invoked * when the data transfer is complete, or when an error has - * ocurred. Be sure to check `res.headersSent` if you plan to respond. + * occurred. Be sure to check `res.headersSent` if you plan to respond. + * + * Optionally providing an `options` object to use with `res.sendFile()`. + * This function will set the `Content-Disposition` header, overriding + * any `Content-Disposition` header passed as header options in order + * to set the attachment and filename. * * This method uses `res.sendFile()`. * * @public */ -res.download = function download(path, filename, callback) { +res.download = function download (path, filename, options, callback) { var done = callback; var name = filename; + var opts = options || null - // support function as second arg + // support function as second or third arg if (typeof filename === 'function') { done = filename; name = null; + opts = null + } else if (typeof options === 'function') { + done = options + opts = null + } + + // support optional filename, where options may be in it's place + if (typeof filename === 'object' && + (typeof options === 'function' || options === undefined)) { + name = null + opts = filename } // set Content-Disposition when file is sent @@ -417,10 +574,28 @@ res.download = function download(path, filename, callback) { 'Content-Disposition': contentDisposition(name || path) }; - // Resolve the full path for sendFile - var fullPath = resolve(path); + // merge user-provided headers + if (opts && opts.headers) { + var keys = Object.keys(opts.headers) + for (var i = 0; i < keys.length; i++) { + var key = keys[i] + if (key.toLowerCase() !== 'content-disposition') { + headers[key] = opts.headers[key] + } + } + } - return this.sendFile(fullPath, { headers: headers }, done); + // merge user-provided options + opts = Object.create(opts) + opts.headers = headers + + // Resolve the full path for sendFile + var fullPath = !opts.root + ? resolve(path) + : path + + // send file + return this.sendFile(fullPath, opts, done) }; /** @@ -473,7 +648,7 @@ res.type = function contentType(type) { * res.send('

hey

'); * }, * - * 'appliation/json': function(){ + * 'application/json': function () { * res.send({ message: 'hey' }); * } * }); @@ -510,9 +685,8 @@ res.format = function(obj){ var req = this.req; var next = req.next; - var fn = obj.default; - if (fn) delete obj.default; - var keys = Object.keys(obj); + var keys = Object.keys(obj) + .filter(function (v) { return v !== 'default' }) var key = keys.length > 0 ? req.accepts(keys) @@ -523,13 +697,12 @@ res.format = function(obj){ if (key) { this.set('Content-Type', normalizeType(key).value); obj[key](req, this, next); - } else if (fn) { - fn(); + } else if (obj.default) { + obj.default(req, this, next) } else { - var err = new Error('Not Acceptable'); - err.status = err.statusCode = 406; - err.types = normalizeTypes(keys).map(function(o){ return o.value }); - next(err); + next(createError(406, { + types: normalizeTypes(keys).map(function (o) { return o.value }) + })) } return this; @@ -576,7 +749,7 @@ res.append = function append(field, val) { // concat the new and prev vals value = Array.isArray(prev) ? prev.concat(val) : Array.isArray(val) ? [prev].concat(val) - : [prev, val]; + : [prev, val] } return this.set(field, value); @@ -608,9 +781,14 @@ res.header = function header(field, val) { : String(val); // add charset to content-type - if (field.toLowerCase() === 'content-type' && !charsetRegExp.test(value)) { - var charset = mime.charsets.lookup(value.split(';')[0]); - if (charset) value += '; charset=' + charset.toLowerCase(); + if (field.toLowerCase() === 'content-type') { + if (Array.isArray(value)) { + throw new TypeError('Content-Type cannot be set to an Array'); + } + if (!charsetRegExp.test(value)) { + var charset = mime.charsets.lookup(value.split(';')[0]); + if (charset) value += '; charset=' + charset.toLowerCase(); + } } this.setHeader(field, value); @@ -638,7 +816,7 @@ res.get = function(field){ * Clear cookie `name`. * * @param {String} name - * @param {Object} options + * @param {Object} [options] * @return {ServerResponse} for chaining * @public */ @@ -663,12 +841,12 @@ res.clearCookie = function clearCookie(name, options) { * // "Remember Me" for 15 minutes * res.cookie('rememberme', '1', { expires: new Date(Date.now() + 900000), httpOnly: true }); * - * // save as above + * // same as above * res.cookie('rememberme', '1', { maxAge: 900000, httpOnly: true }) * * @param {String} name * @param {String|Object} value - * @param {Options} options + * @param {Object} [options] * @return {ServerResponse} for chaining * @public */ @@ -690,9 +868,13 @@ res.cookie = function (name, value, options) { val = 's:' + sign(val, secret); } - if ('maxAge' in opts) { - opts.expires = new Date(Date.now() + opts.maxAge); - opts.maxAge /= 1000; + if (opts.maxAge != null) { + var maxAge = opts.maxAge - 0 + + if (!isNaN(maxAge)) { + opts.expires = new Date(Date.now() + maxAge) + opts.maxAge = Math.floor(maxAge / 1000) + } } if (opts.path == null) { @@ -730,8 +912,7 @@ res.location = function location(url) { } // set location - this.set('Location', loc); - return this; + return this.set('Location', encodeUrl(loc)); }; /** @@ -769,18 +950,17 @@ res.redirect = function redirect(url) { } // Set location header - this.location(address); - address = this.get('Location'); + address = this.location(address).get('Location'); // Support text/{plain,html} by default this.format({ text: function(){ - body = statusCodes[status] + '. Redirecting to ' + encodeURI(address); + body = statuses.message[status] + '. Redirecting to ' + address }, html: function(){ var u = escapeHtml(address); - body = '

' + statusCodes[status] + '. Redirecting to ' + u + '

'; + body = '

' + statuses.message[status] + '. Redirecting to ' + u + '

' }, default: function(){ @@ -949,3 +1129,41 @@ function sendfile(res, file, options, callback) { // pipe file.pipe(res); } + +/** + * Stringify JSON, like JSON.stringify, but v8 optimized, with the + * ability to escape characters that can trigger HTML sniffing. + * + * @param {*} value + * @param {function} replacer + * @param {number} spaces + * @param {boolean} escape + * @returns {string} + * @private + */ + +function stringify (value, replacer, spaces, escape) { + // v8 checks arguments.length for optimizing simple call + // https://bugs.chromium.org/p/v8/issues/detail?id=4730 + var json = replacer || spaces + ? JSON.stringify(value, replacer, spaces) + : JSON.stringify(value); + + if (escape && typeof json === 'string') { + json = json.replace(/[<>&]/g, function (c) { + switch (c.charCodeAt(0)) { + case 0x3c: + return '\\u003c' + case 0x3e: + return '\\u003e' + case 0x26: + return '\\u0026' + /* istanbul ignore next: unreachable default */ + default: + return c + } + }) + } + + return json +} diff --git a/node_modules/express/lib/router/index.js b/node_modules/express/lib/router/index.js new file mode 100644 index 0000000..5174c34 --- /dev/null +++ b/node_modules/express/lib/router/index.js @@ -0,0 +1,673 @@ +/*! + * express + * Copyright(c) 2009-2013 TJ Holowaychuk + * Copyright(c) 2013 Roman Shtylman + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module dependencies. + * @private + */ + +var Route = require('./route'); +var Layer = require('./layer'); +var methods = require('methods'); +var mixin = require('utils-merge'); +var debug = require('debug')('express:router'); +var deprecate = require('depd')('express'); +var flatten = require('array-flatten'); +var parseUrl = require('parseurl'); +var setPrototypeOf = require('setprototypeof') + +/** + * Module variables. + * @private + */ + +var objectRegExp = /^\[object (\S+)\]$/; +var slice = Array.prototype.slice; +var toString = Object.prototype.toString; + +/** + * Initialize a new `Router` with the given `options`. + * + * @param {Object} [options] + * @return {Router} which is an callable function + * @public + */ + +var proto = module.exports = function(options) { + var opts = options || {}; + + function router(req, res, next) { + router.handle(req, res, next); + } + + // mixin Router class functions + setPrototypeOf(router, proto) + + router.params = {}; + router._params = []; + router.caseSensitive = opts.caseSensitive; + router.mergeParams = opts.mergeParams; + router.strict = opts.strict; + router.stack = []; + + return router; +}; + +/** + * Map the given param placeholder `name`(s) to the given callback. + * + * Parameter mapping is used to provide pre-conditions to routes + * which use normalized placeholders. For example a _:user_id_ parameter + * could automatically load a user's information from the database without + * any additional code, + * + * The callback uses the same signature as middleware, the only difference + * being that the value of the placeholder is passed, in this case the _id_ + * of the user. Once the `next()` function is invoked, just like middleware + * it will continue on to execute the route, or subsequent parameter functions. + * + * Just like in middleware, you must either respond to the request or call next + * to avoid stalling the request. + * + * app.param('user_id', function(req, res, next, id){ + * User.find(id, function(err, user){ + * if (err) { + * return next(err); + * } else if (!user) { + * return next(new Error('failed to load user')); + * } + * req.user = user; + * next(); + * }); + * }); + * + * @param {String} name + * @param {Function} fn + * @return {app} for chaining + * @public + */ + +proto.param = function param(name, fn) { + // param logic + if (typeof name === 'function') { + deprecate('router.param(fn): Refactor to use path params'); + this._params.push(name); + return; + } + + // apply param functions + var params = this._params; + var len = params.length; + var ret; + + if (name[0] === ':') { + deprecate('router.param(' + JSON.stringify(name) + ', fn): Use router.param(' + JSON.stringify(name.slice(1)) + ', fn) instead') + name = name.slice(1) + } + + for (var i = 0; i < len; ++i) { + if (ret = params[i](name, fn)) { + fn = ret; + } + } + + // ensure we end up with a + // middleware function + if ('function' !== typeof fn) { + throw new Error('invalid param() call for ' + name + ', got ' + fn); + } + + (this.params[name] = this.params[name] || []).push(fn); + return this; +}; + +/** + * Dispatch a req, res into the router. + * @private + */ + +proto.handle = function handle(req, res, out) { + var self = this; + + debug('dispatching %s %s', req.method, req.url); + + var idx = 0; + var protohost = getProtohost(req.url) || '' + var removed = ''; + var slashAdded = false; + var sync = 0 + var paramcalled = {}; + + // store options for OPTIONS request + // only used if OPTIONS request + var options = []; + + // middleware and routes + var stack = self.stack; + + // manage inter-router variables + var parentParams = req.params; + var parentUrl = req.baseUrl || ''; + var done = restore(out, req, 'baseUrl', 'next', 'params'); + + // setup next layer + req.next = next; + + // for options requests, respond with a default if nothing else responds + if (req.method === 'OPTIONS') { + done = wrap(done, function(old, err) { + if (err || options.length === 0) return old(err); + sendOptionsResponse(res, options, old); + }); + } + + // setup basic req values + req.baseUrl = parentUrl; + req.originalUrl = req.originalUrl || req.url; + + next(); + + function next(err) { + var layerError = err === 'route' + ? null + : err; + + // remove added slash + if (slashAdded) { + req.url = req.url.slice(1) + slashAdded = false; + } + + // restore altered req.url + if (removed.length !== 0) { + req.baseUrl = parentUrl; + req.url = protohost + removed + req.url.slice(protohost.length) + removed = ''; + } + + // signal to exit router + if (layerError === 'router') { + setImmediate(done, null) + return + } + + // no more matching layers + if (idx >= stack.length) { + setImmediate(done, layerError); + return; + } + + // max sync stack + if (++sync > 100) { + return setImmediate(next, err) + } + + // get pathname of request + var path = getPathname(req); + + if (path == null) { + return done(layerError); + } + + // find next matching layer + var layer; + var match; + var route; + + while (match !== true && idx < stack.length) { + layer = stack[idx++]; + match = matchLayer(layer, path); + route = layer.route; + + if (typeof match !== 'boolean') { + // hold on to layerError + layerError = layerError || match; + } + + if (match !== true) { + continue; + } + + if (!route) { + // process non-route handlers normally + continue; + } + + if (layerError) { + // routes do not match with a pending error + match = false; + continue; + } + + var method = req.method; + var has_method = route._handles_method(method); + + // build up automatic options response + if (!has_method && method === 'OPTIONS') { + appendMethods(options, route._options()); + } + + // don't even bother matching route + if (!has_method && method !== 'HEAD') { + match = false; + } + } + + // no match + if (match !== true) { + return done(layerError); + } + + // store route for dispatch on change + if (route) { + req.route = route; + } + + // Capture one-time layer values + req.params = self.mergeParams + ? mergeParams(layer.params, parentParams) + : layer.params; + var layerPath = layer.path; + + // this should be done for the layer + self.process_params(layer, paramcalled, req, res, function (err) { + if (err) { + next(layerError || err) + } else if (route) { + layer.handle_request(req, res, next) + } else { + trim_prefix(layer, layerError, layerPath, path) + } + + sync = 0 + }); + } + + function trim_prefix(layer, layerError, layerPath, path) { + if (layerPath.length !== 0) { + // Validate path is a prefix match + if (layerPath !== path.slice(0, layerPath.length)) { + next(layerError) + return + } + + // Validate path breaks on a path separator + var c = path[layerPath.length] + if (c && c !== '/' && c !== '.') return next(layerError) + + // Trim off the part of the url that matches the route + // middleware (.use stuff) needs to have the path stripped + debug('trim prefix (%s) from url %s', layerPath, req.url); + removed = layerPath; + req.url = protohost + req.url.slice(protohost.length + removed.length) + + // Ensure leading slash + if (!protohost && req.url[0] !== '/') { + req.url = '/' + req.url; + slashAdded = true; + } + + // Setup base URL (no trailing slash) + req.baseUrl = parentUrl + (removed[removed.length - 1] === '/' + ? removed.substring(0, removed.length - 1) + : removed); + } + + debug('%s %s : %s', layer.name, layerPath, req.originalUrl); + + if (layerError) { + layer.handle_error(layerError, req, res, next); + } else { + layer.handle_request(req, res, next); + } + } +}; + +/** + * Process any parameters for the layer. + * @private + */ + +proto.process_params = function process_params(layer, called, req, res, done) { + var params = this.params; + + // captured parameters from the layer, keys and values + var keys = layer.keys; + + // fast track + if (!keys || keys.length === 0) { + return done(); + } + + var i = 0; + var name; + var paramIndex = 0; + var key; + var paramVal; + var paramCallbacks; + var paramCalled; + + // process params in order + // param callbacks can be async + function param(err) { + if (err) { + return done(err); + } + + if (i >= keys.length ) { + return done(); + } + + paramIndex = 0; + key = keys[i++]; + name = key.name; + paramVal = req.params[name]; + paramCallbacks = params[name]; + paramCalled = called[name]; + + if (paramVal === undefined || !paramCallbacks) { + return param(); + } + + // param previously called with same value or error occurred + if (paramCalled && (paramCalled.match === paramVal + || (paramCalled.error && paramCalled.error !== 'route'))) { + // restore value + req.params[name] = paramCalled.value; + + // next param + return param(paramCalled.error); + } + + called[name] = paramCalled = { + error: null, + match: paramVal, + value: paramVal + }; + + paramCallback(); + } + + // single param callbacks + function paramCallback(err) { + var fn = paramCallbacks[paramIndex++]; + + // store updated value + paramCalled.value = req.params[key.name]; + + if (err) { + // store error + paramCalled.error = err; + param(err); + return; + } + + if (!fn) return param(); + + try { + fn(req, res, paramCallback, paramVal, key.name); + } catch (e) { + paramCallback(e); + } + } + + param(); +}; + +/** + * Use the given middleware function, with optional path, defaulting to "/". + * + * Use (like `.all`) will run for any http METHOD, but it will not add + * handlers for those methods so OPTIONS requests will not consider `.use` + * functions even if they could respond. + * + * The other difference is that _route_ path is stripped and not visible + * to the handler function. The main effect of this feature is that mounted + * handlers can operate without any code changes regardless of the "prefix" + * pathname. + * + * @public + */ + +proto.use = function use(fn) { + var offset = 0; + var path = '/'; + + // default path to '/' + // disambiguate router.use([fn]) + if (typeof fn !== 'function') { + var arg = fn; + + while (Array.isArray(arg) && arg.length !== 0) { + arg = arg[0]; + } + + // first arg is the path + if (typeof arg !== 'function') { + offset = 1; + path = fn; + } + } + + var callbacks = flatten(slice.call(arguments, offset)); + + if (callbacks.length === 0) { + throw new TypeError('Router.use() requires a middleware function') + } + + for (var i = 0; i < callbacks.length; i++) { + var fn = callbacks[i]; + + if (typeof fn !== 'function') { + throw new TypeError('Router.use() requires a middleware function but got a ' + gettype(fn)) + } + + // add the middleware + debug('use %o %s', path, fn.name || '') + + var layer = new Layer(path, { + sensitive: this.caseSensitive, + strict: false, + end: false + }, fn); + + layer.route = undefined; + + this.stack.push(layer); + } + + return this; +}; + +/** + * Create a new Route for the given path. + * + * Each route contains a separate middleware stack and VERB handlers. + * + * See the Route api documentation for details on adding handlers + * and middleware to routes. + * + * @param {String} path + * @return {Route} + * @public + */ + +proto.route = function route(path) { + var route = new Route(path); + + var layer = new Layer(path, { + sensitive: this.caseSensitive, + strict: this.strict, + end: true + }, route.dispatch.bind(route)); + + layer.route = route; + + this.stack.push(layer); + return route; +}; + +// create Router#VERB functions +methods.concat('all').forEach(function(method){ + proto[method] = function(path){ + var route = this.route(path) + route[method].apply(route, slice.call(arguments, 1)); + return this; + }; +}); + +// append methods to a list of methods +function appendMethods(list, addition) { + for (var i = 0; i < addition.length; i++) { + var method = addition[i]; + if (list.indexOf(method) === -1) { + list.push(method); + } + } +} + +// get pathname of request +function getPathname(req) { + try { + return parseUrl(req).pathname; + } catch (err) { + return undefined; + } +} + +// Get get protocol + host for a URL +function getProtohost(url) { + if (typeof url !== 'string' || url.length === 0 || url[0] === '/') { + return undefined + } + + var searchIndex = url.indexOf('?') + var pathLength = searchIndex !== -1 + ? searchIndex + : url.length + var fqdnIndex = url.slice(0, pathLength).indexOf('://') + + return fqdnIndex !== -1 + ? url.substring(0, url.indexOf('/', 3 + fqdnIndex)) + : undefined +} + +// get type for error message +function gettype(obj) { + var type = typeof obj; + + if (type !== 'object') { + return type; + } + + // inspect [[Class]] for objects + return toString.call(obj) + .replace(objectRegExp, '$1'); +} + +/** + * Match path to a layer. + * + * @param {Layer} layer + * @param {string} path + * @private + */ + +function matchLayer(layer, path) { + try { + return layer.match(path); + } catch (err) { + return err; + } +} + +// merge params with parent params +function mergeParams(params, parent) { + if (typeof parent !== 'object' || !parent) { + return params; + } + + // make copy of parent for base + var obj = mixin({}, parent); + + // simple non-numeric merging + if (!(0 in params) || !(0 in parent)) { + return mixin(obj, params); + } + + var i = 0; + var o = 0; + + // determine numeric gaps + while (i in params) { + i++; + } + + while (o in parent) { + o++; + } + + // offset numeric indices in params before merge + for (i--; i >= 0; i--) { + params[i + o] = params[i]; + + // create holes for the merge when necessary + if (i < o) { + delete params[i]; + } + } + + return mixin(obj, params); +} + +// restore obj props after function +function restore(fn, obj) { + var props = new Array(arguments.length - 2); + var vals = new Array(arguments.length - 2); + + for (var i = 0; i < props.length; i++) { + props[i] = arguments[i + 2]; + vals[i] = obj[props[i]]; + } + + return function () { + // restore vals + for (var i = 0; i < props.length; i++) { + obj[props[i]] = vals[i]; + } + + return fn.apply(this, arguments); + }; +} + +// send an OPTIONS response +function sendOptionsResponse(res, options, next) { + try { + var body = options.join(','); + res.set('Allow', body); + res.send(body); + } catch (err) { + next(err); + } +} + +// wrap a function +function wrap(old, fn) { + return function proxy() { + var args = new Array(arguments.length + 1); + + args[0] = old; + for (var i = 0, len = arguments.length; i < len; i++) { + args[i + 1] = arguments[i]; + } + + fn.apply(this, args); + }; +} diff --git a/node_modules/express/lib/router/layer.js b/node_modules/express/lib/router/layer.js new file mode 100644 index 0000000..4dc8e86 --- /dev/null +++ b/node_modules/express/lib/router/layer.js @@ -0,0 +1,181 @@ +/*! + * express + * Copyright(c) 2009-2013 TJ Holowaychuk + * Copyright(c) 2013 Roman Shtylman + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module dependencies. + * @private + */ + +var pathRegexp = require('path-to-regexp'); +var debug = require('debug')('express:router:layer'); + +/** + * Module variables. + * @private + */ + +var hasOwnProperty = Object.prototype.hasOwnProperty; + +/** + * Module exports. + * @public + */ + +module.exports = Layer; + +function Layer(path, options, fn) { + if (!(this instanceof Layer)) { + return new Layer(path, options, fn); + } + + debug('new %o', path) + var opts = options || {}; + + this.handle = fn; + this.name = fn.name || ''; + this.params = undefined; + this.path = undefined; + this.regexp = pathRegexp(path, this.keys = [], opts); + + // set fast path flags + this.regexp.fast_star = path === '*' + this.regexp.fast_slash = path === '/' && opts.end === false +} + +/** + * Handle the error for the layer. + * + * @param {Error} error + * @param {Request} req + * @param {Response} res + * @param {function} next + * @api private + */ + +Layer.prototype.handle_error = function handle_error(error, req, res, next) { + var fn = this.handle; + + if (fn.length !== 4) { + // not a standard error handler + return next(error); + } + + try { + fn(error, req, res, next); + } catch (err) { + next(err); + } +}; + +/** + * Handle the request for the layer. + * + * @param {Request} req + * @param {Response} res + * @param {function} next + * @api private + */ + +Layer.prototype.handle_request = function handle(req, res, next) { + var fn = this.handle; + + if (fn.length > 3) { + // not a standard request handler + return next(); + } + + try { + fn(req, res, next); + } catch (err) { + next(err); + } +}; + +/** + * Check if this route matches `path`, if so + * populate `.params`. + * + * @param {String} path + * @return {Boolean} + * @api private + */ + +Layer.prototype.match = function match(path) { + var match + + if (path != null) { + // fast path non-ending match for / (any path matches) + if (this.regexp.fast_slash) { + this.params = {} + this.path = '' + return true + } + + // fast path for * (everything matched in a param) + if (this.regexp.fast_star) { + this.params = {'0': decode_param(path)} + this.path = path + return true + } + + // match the path + match = this.regexp.exec(path) + } + + if (!match) { + this.params = undefined; + this.path = undefined; + return false; + } + + // store values + this.params = {}; + this.path = match[0] + + var keys = this.keys; + var params = this.params; + + for (var i = 1; i < match.length; i++) { + var key = keys[i - 1]; + var prop = key.name; + var val = decode_param(match[i]) + + if (val !== undefined || !(hasOwnProperty.call(params, prop))) { + params[prop] = val; + } + } + + return true; +}; + +/** + * Decode param value. + * + * @param {string} val + * @return {string} + * @private + */ + +function decode_param(val) { + if (typeof val !== 'string' || val.length === 0) { + return val; + } + + try { + return decodeURIComponent(val); + } catch (err) { + if (err instanceof URIError) { + err.message = 'Failed to decode param \'' + val + '\''; + err.status = err.statusCode = 400; + } + + throw err; + } +} diff --git a/node_modules/express/lib/router/route.js b/node_modules/express/lib/router/route.js new file mode 100644 index 0000000..cc643ac --- /dev/null +++ b/node_modules/express/lib/router/route.js @@ -0,0 +1,225 @@ +/*! + * express + * Copyright(c) 2009-2013 TJ Holowaychuk + * Copyright(c) 2013 Roman Shtylman + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module dependencies. + * @private + */ + +var debug = require('debug')('express:router:route'); +var flatten = require('array-flatten'); +var Layer = require('./layer'); +var methods = require('methods'); + +/** + * Module variables. + * @private + */ + +var slice = Array.prototype.slice; +var toString = Object.prototype.toString; + +/** + * Module exports. + * @public + */ + +module.exports = Route; + +/** + * Initialize `Route` with the given `path`, + * + * @param {String} path + * @public + */ + +function Route(path) { + this.path = path; + this.stack = []; + + debug('new %o', path) + + // route handlers for various http methods + this.methods = {}; +} + +/** + * Determine if the route handles a given method. + * @private + */ + +Route.prototype._handles_method = function _handles_method(method) { + if (this.methods._all) { + return true; + } + + var name = method.toLowerCase(); + + if (name === 'head' && !this.methods['head']) { + name = 'get'; + } + + return Boolean(this.methods[name]); +}; + +/** + * @return {Array} supported HTTP methods + * @private + */ + +Route.prototype._options = function _options() { + var methods = Object.keys(this.methods); + + // append automatic head + if (this.methods.get && !this.methods.head) { + methods.push('head'); + } + + for (var i = 0; i < methods.length; i++) { + // make upper case + methods[i] = methods[i].toUpperCase(); + } + + return methods; +}; + +/** + * dispatch req, res into this route + * @private + */ + +Route.prototype.dispatch = function dispatch(req, res, done) { + var idx = 0; + var stack = this.stack; + var sync = 0 + + if (stack.length === 0) { + return done(); + } + + var method = req.method.toLowerCase(); + if (method === 'head' && !this.methods['head']) { + method = 'get'; + } + + req.route = this; + + next(); + + function next(err) { + // signal to exit route + if (err && err === 'route') { + return done(); + } + + // signal to exit router + if (err && err === 'router') { + return done(err) + } + + // max sync stack + if (++sync > 100) { + return setImmediate(next, err) + } + + var layer = stack[idx++] + + // end of layers + if (!layer) { + return done(err) + } + + if (layer.method && layer.method !== method) { + next(err) + } else if (err) { + layer.handle_error(err, req, res, next); + } else { + layer.handle_request(req, res, next); + } + + sync = 0 + } +}; + +/** + * Add a handler for all HTTP verbs to this route. + * + * Behaves just like middleware and can respond or call `next` + * to continue processing. + * + * You can use multiple `.all` call to add multiple handlers. + * + * function check_something(req, res, next){ + * next(); + * }; + * + * function validate_user(req, res, next){ + * next(); + * }; + * + * route + * .all(validate_user) + * .all(check_something) + * .get(function(req, res, next){ + * res.send('hello world'); + * }); + * + * @param {function} handler + * @return {Route} for chaining + * @api public + */ + +Route.prototype.all = function all() { + var handles = flatten(slice.call(arguments)); + + for (var i = 0; i < handles.length; i++) { + var handle = handles[i]; + + if (typeof handle !== 'function') { + var type = toString.call(handle); + var msg = 'Route.all() requires a callback function but got a ' + type + throw new TypeError(msg); + } + + var layer = Layer('/', {}, handle); + layer.method = undefined; + + this.methods._all = true; + this.stack.push(layer); + } + + return this; +}; + +methods.forEach(function(method){ + Route.prototype[method] = function(){ + var handles = flatten(slice.call(arguments)); + + for (var i = 0; i < handles.length; i++) { + var handle = handles[i]; + + if (typeof handle !== 'function') { + var type = toString.call(handle); + var msg = 'Route.' + method + '() requires a callback function but got a ' + type + throw new Error(msg); + } + + debug('%s %o', method, this.path) + + var layer = Layer('/', {}, handle); + layer.method = method; + + this.methods[method] = true; + this.stack.push(layer); + } + + return this; + }; +}); diff --git a/node_modules/express/lib/utils.js b/node_modules/express/lib/utils.js index 8c111eb..799a6a2 100644 --- a/node_modules/express/lib/utils.js +++ b/node_modules/express/lib/utils.js @@ -12,10 +12,13 @@ * @api private */ -var mime = require('send').mime; +var Buffer = require('safe-buffer').Buffer +var contentDisposition = require('content-disposition'); var contentType = require('content-type'); -var etag = require('etag'); +var deprecate = require('depd')('express'); var flatten = require('array-flatten'); +var mime = require('send').mime; +var etag = require('etag'); var proxyaddr = require('proxy-addr'); var qs = require('qs'); var querystring = require('querystring'); @@ -29,13 +32,7 @@ var querystring = require('querystring'); * @api private */ -exports.etag = function (body, encoding) { - var buf = !Buffer.isBuffer(body) - ? new Buffer(body, encoding) - : body; - - return etag(buf, {weak: false}); -}; +exports.etag = createETagGenerator({ weak: false }) /** * Return weak ETag for `body`. @@ -46,14 +43,33 @@ exports.etag = function (body, encoding) { * @api private */ -exports.wetag = function wetag(body, encoding){ - var buf = !Buffer.isBuffer(body) - ? new Buffer(body, encoding) - : body; +exports.wetag = createETagGenerator({ weak: true }) - return etag(buf, {weak: true}); +/** + * Check if `path` looks absolute. + * + * @param {String} path + * @return {Boolean} + * @api private + */ + +exports.isAbsolute = function(path){ + if ('/' === path[0]) return true; + if (':' === path[1] && ('\\' === path[2] || '/' === path[2])) return true; // Windows device path + if ('\\\\' === path.substring(0, 2)) return true; // Microsoft Azure absolute path }; +/** + * Flatten the given `arr`. + * + * @param {Array} arr + * @return {Array} + * @api private + */ + +exports.flatten = deprecate.function(flatten, + 'utils.flatten: use array-flatten npm module instead'); + /** * Normalize the given `type`, for example "html" becomes "text/html". * @@ -86,12 +102,25 @@ exports.normalizeTypes = function(types){ return ret; }; +/** + * Generate Content-Disposition header appropriate for the filename. + * non-ascii filenames are urlencoded and a filename* parameter is added + * + * @param {String} filename + * @return {String} + * @api private + */ + +exports.contentDisposition = deprecate.function(contentDisposition, + 'utils.contentDisposition: use content-disposition npm module instead'); + /** * Parse accept params `str` returning an * object with `.value`, `.quality` and `.params`. * also includes `.originalIndex` for stable sorting * * @param {String} str + * @param {Number} index * @return {Object} * @api private */ @@ -102,7 +131,7 @@ function acceptParams(str, index) { for (var i = 1; i < parts.length; ++i) { var pms = parts[i].split(/ *= */); - if ('q' == pms[0]) { + if ('q' === pms[0]) { ret.quality = parseFloat(pms[1]); } else { ret.params[pms[0]] = pms[1]; @@ -129,6 +158,7 @@ exports.compileETag = function(val) { switch (val) { case true: + case 'weak': fn = exports.wetag; break; case false: @@ -136,9 +166,6 @@ exports.compileETag = function(val) { case 'strong': fn = exports.etag; break; - case 'weak': - fn = exports.wetag; - break; default: throw new TypeError('unknown value for etag function: ' + val); } @@ -163,16 +190,15 @@ exports.compileQueryParser = function compileQueryParser(val) { switch (val) { case true: + case 'simple': fn = querystring.parse; break; case false: + fn = newObject; break; case 'extended': fn = parseExtendedQueryString; break; - case 'simple': - fn = querystring.parse; - break; default: throw new TypeError('unknown value for query parser function: ' + val); } @@ -203,7 +229,8 @@ exports.compileTrust = function(val) { if (typeof val === 'string') { // Support comma-separated values - val = val.split(/ *, */); + val = val.split(',') + .map(function (v) { return v.trim() }) } return proxyaddr.compile(val || []); @@ -233,6 +260,25 @@ exports.setCharset = function setCharset(type, charset) { return contentType.format(parsed); }; +/** + * Create an ETag generator function, generating ETags with + * the given options. + * + * @param {object} options + * @return {function} + * @private + */ + +function createETagGenerator (options) { + return function generateETag (body, encoding) { + var buf = !Buffer.isBuffer(body) + ? Buffer.from(body, encoding) + : body + + return etag(buf, options) + } +} + /** * Parse an extended query string with qs. * @@ -242,7 +288,17 @@ exports.setCharset = function setCharset(type, charset) { function parseExtendedQueryString(str) { return qs.parse(str, { - allowDots: false, allowPrototypes: true }); } + +/** + * Return new empty object. + * + * @return {Object} + * @api private + */ + +function newObject() { + return {}; +} diff --git a/node_modules/express/lib/view.js b/node_modules/express/lib/view.js index 759ecc4..c08ab4d 100644 --- a/node_modules/express/lib/view.js +++ b/node_modules/express/lib/view.js @@ -16,7 +16,6 @@ var debug = require('debug')('express:view'); var path = require('path'); var fs = require('fs'); -var utils = require('./utils'); /** * Module variables. @@ -75,7 +74,17 @@ function View(name, options) { if (!opts.engines[this.ext]) { // load engine - opts.engines[this.ext] = require(this.ext.substr(1)).__express; + var mod = this.ext.slice(1) + debug('require "%s"', mod) + + // default engine export + var fn = require(mod).__express + + if (typeof fn !== 'function') { + throw new Error('Module "' + mod + '" does not provide a view engine.') + } + + opts.engines[this.ext] = fn } // store loaded engine @@ -122,31 +131,8 @@ View.prototype.lookup = function lookup(name) { */ View.prototype.render = function render(options, callback) { - var sync = true; - debug('render "%s"', this.path); - - // render, normalizing sync callbacks - this.engine(this.path, options, function onRender() { - if (!sync) { - return callback.apply(this, arguments); - } - - // copy arguments - var args = new Array(arguments.length); - var cntx = this; - - for (var i = 0; i < arguments.length; i++) { - args[i] = arguments[i]; - } - - // force callback to be async - return process.nextTick(function renderTick() { - return callback.apply(cntx, args); - }); - }); - - sync = false; + this.engine(this.path, options, callback); }; /** diff --git a/node_modules/express/node_modules/debug/.jshintrc b/node_modules/express/node_modules/debug/.jshintrc deleted file mode 100644 index 299877f..0000000 --- a/node_modules/express/node_modules/debug/.jshintrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "laxbreak": true -} diff --git a/node_modules/express/node_modules/debug/.npmignore b/node_modules/express/node_modules/debug/.npmignore deleted file mode 100644 index 7e6163d..0000000 --- a/node_modules/express/node_modules/debug/.npmignore +++ /dev/null @@ -1,6 +0,0 @@ -support -test -examples -example -*.sock -dist diff --git a/node_modules/express/node_modules/debug/History.md b/node_modules/express/node_modules/debug/History.md deleted file mode 100644 index 854c971..0000000 --- a/node_modules/express/node_modules/debug/History.md +++ /dev/null @@ -1,195 +0,0 @@ - -2.2.0 / 2015-05-09 -================== - - * package: update "ms" to v0.7.1 (#202, @dougwilson) - * README: add logging to file example (#193, @DanielOchoa) - * README: fixed a typo (#191, @amir-s) - * browser: expose `storage` (#190, @stephenmathieson) - * Makefile: add a `distclean` target (#189, @stephenmathieson) - -2.1.3 / 2015-03-13 -================== - - * Updated stdout/stderr example (#186) - * Updated example/stdout.js to match debug current behaviour - * Renamed example/stderr.js to stdout.js - * Update Readme.md (#184) - * replace high intensity foreground color for bold (#182, #183) - -2.1.2 / 2015-03-01 -================== - - * dist: recompile - * update "ms" to v0.7.0 - * package: update "browserify" to v9.0.3 - * component: fix "ms.js" repo location - * changed bower package name - * updated documentation about using debug in a browser - * fix: security error on safari (#167, #168, @yields) - -2.1.1 / 2014-12-29 -================== - - * browser: use `typeof` to check for `console` existence - * browser: check for `console.log` truthiness (fix IE 8/9) - * browser: add support for Chrome apps - * Readme: added Windows usage remarks - * Add `bower.json` to properly support bower install - -2.1.0 / 2014-10-15 -================== - - * node: implement `DEBUG_FD` env variable support - * package: update "browserify" to v6.1.0 - * package: add "license" field to package.json (#135, @panuhorsmalahti) - -2.0.0 / 2014-09-01 -================== - - * package: update "browserify" to v5.11.0 - * node: use stderr rather than stdout for logging (#29, @stephenmathieson) - -1.0.4 / 2014-07-15 -================== - - * dist: recompile - * example: remove `console.info()` log usage - * example: add "Content-Type" UTF-8 header to browser example - * browser: place %c marker after the space character - * browser: reset the "content" color via `color: inherit` - * browser: add colors support for Firefox >= v31 - * debug: prefer an instance `log()` function over the global one (#119) - * Readme: update documentation about styled console logs for FF v31 (#116, @wryk) - -1.0.3 / 2014-07-09 -================== - - * Add support for multiple wildcards in namespaces (#122, @seegno) - * browser: fix lint - -1.0.2 / 2014-06-10 -================== - - * browser: update color palette (#113, @gscottolson) - * common: make console logging function configurable (#108, @timoxley) - * node: fix %o colors on old node <= 0.8.x - * Makefile: find node path using shell/which (#109, @timoxley) - -1.0.1 / 2014-06-06 -================== - - * browser: use `removeItem()` to clear localStorage - * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777) - * package: add "contributors" section - * node: fix comment typo - * README: list authors - -1.0.0 / 2014-06-04 -================== - - * make ms diff be global, not be scope - * debug: ignore empty strings in enable() - * node: make DEBUG_COLORS able to disable coloring - * *: export the `colors` array - * npmignore: don't publish the `dist` dir - * Makefile: refactor to use browserify - * package: add "browserify" as a dev dependency - * Readme: add Web Inspector Colors section - * node: reset terminal color for the debug content - * node: map "%o" to `util.inspect()` - * browser: map "%j" to `JSON.stringify()` - * debug: add custom "formatters" - * debug: use "ms" module for humanizing the diff - * Readme: add "bash" syntax highlighting - * browser: add Firebug color support - * browser: add colors for WebKit browsers - * node: apply log to `console` - * rewrite: abstract common logic for Node & browsers - * add .jshintrc file - -0.8.1 / 2014-04-14 -================== - - * package: re-add the "component" section - -0.8.0 / 2014-03-30 -================== - - * add `enable()` method for nodejs. Closes #27 - * change from stderr to stdout - * remove unnecessary index.js file - -0.7.4 / 2013-11-13 -================== - - * remove "browserify" key from package.json (fixes something in browserify) - -0.7.3 / 2013-10-30 -================== - - * fix: catch localStorage security error when cookies are blocked (Chrome) - * add debug(err) support. Closes #46 - * add .browser prop to package.json. Closes #42 - -0.7.2 / 2013-02-06 -================== - - * fix package.json - * fix: Mobile Safari (private mode) is broken with debug - * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript - -0.7.1 / 2013-02-05 -================== - - * add repository URL to package.json - * add DEBUG_COLORED to force colored output - * add browserify support - * fix component. Closes #24 - -0.7.0 / 2012-05-04 -================== - - * Added .component to package.json - * Added debug.component.js build - -0.6.0 / 2012-03-16 -================== - - * Added support for "-" prefix in DEBUG [Vinay Pulim] - * Added `.enabled` flag to the node version [TooTallNate] - -0.5.0 / 2012-02-02 -================== - - * Added: humanize diffs. Closes #8 - * Added `debug.disable()` to the CS variant - * Removed padding. Closes #10 - * Fixed: persist client-side variant again. Closes #9 - -0.4.0 / 2012-02-01 -================== - - * Added browser variant support for older browsers [TooTallNate] - * Added `debug.enable('project:*')` to browser variant [TooTallNate] - * Added padding to diff (moved it to the right) - -0.3.0 / 2012-01-26 -================== - - * Added millisecond diff when isatty, otherwise UTC string - -0.2.0 / 2012-01-22 -================== - - * Added wildcard support - -0.1.0 / 2011-12-02 -================== - - * Added: remove colors unless stderr isatty [TooTallNate] - -0.0.1 / 2010-01-03 -================== - - * Initial release diff --git a/node_modules/express/node_modules/debug/Makefile b/node_modules/express/node_modules/debug/Makefile deleted file mode 100644 index 5cf4a59..0000000 --- a/node_modules/express/node_modules/debug/Makefile +++ /dev/null @@ -1,36 +0,0 @@ - -# get Makefile directory name: http://stackoverflow.com/a/5982798/376773 -THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) -THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd) - -# BIN directory -BIN := $(THIS_DIR)/node_modules/.bin - -# applications -NODE ?= $(shell which node) -NPM ?= $(NODE) $(shell which npm) -BROWSERIFY ?= $(NODE) $(BIN)/browserify - -all: dist/debug.js - -install: node_modules - -clean: - @rm -rf dist - -dist: - @mkdir -p $@ - -dist/debug.js: node_modules browser.js debug.js dist - @$(BROWSERIFY) \ - --standalone debug \ - . > $@ - -distclean: clean - @rm -rf node_modules - -node_modules: package.json - @NODE_ENV= $(NPM) install - @touch node_modules - -.PHONY: all install clean distclean diff --git a/node_modules/express/node_modules/debug/Readme.md b/node_modules/express/node_modules/debug/Readme.md deleted file mode 100644 index b4f45e3..0000000 --- a/node_modules/express/node_modules/debug/Readme.md +++ /dev/null @@ -1,188 +0,0 @@ -# debug - - tiny node.js debugging utility modelled after node core's debugging technique. - -## Installation - -```bash -$ npm install debug -``` - -## Usage - - With `debug` you simply invoke the exported function to generate your debug function, passing it a name which will determine if a noop function is returned, or a decorated `console.error`, so all of the `console` format string goodies you're used to work fine. A unique color is selected per-function for visibility. - -Example _app.js_: - -```js -var debug = require('debug')('http') - , http = require('http') - , name = 'My App'; - -// fake app - -debug('booting %s', name); - -http.createServer(function(req, res){ - debug(req.method + ' ' + req.url); - res.end('hello\n'); -}).listen(3000, function(){ - debug('listening'); -}); - -// fake worker of some kind - -require('./worker'); -``` - -Example _worker.js_: - -```js -var debug = require('debug')('worker'); - -setInterval(function(){ - debug('doing some work'); -}, 1000); -``` - - The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples: - - ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png) - - ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png) - -#### Windows note - - On Windows the environment variable is set using the `set` command. - - ```cmd - set DEBUG=*,-not_this - ``` - -Then, run the program to be debugged as usual. - -## Millisecond diff - - When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. - - ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png) - - When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below: - - ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png) - -## Conventions - - If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". - -## Wildcards - - The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. - - You can also exclude specific debuggers by prefixing them with a "-" character. For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:". - -## Browser support - - Debug works in the browser as well, currently persisted by `localStorage`. Consider the situation shown below where you have `worker:a` and `worker:b`, and wish to debug both. Somewhere in the code on your page, include: - -```js -window.myDebug = require("debug"); -``` - - ("debug" is a global object in the browser so we give this object a different name.) When your page is open in the browser, type the following in the console: - -```js -myDebug.enable("worker:*") -``` - - Refresh the page. Debug output will continue to be sent to the console until it is disabled by typing `myDebug.disable()` in the console. - -```js -a = debug('worker:a'); -b = debug('worker:b'); - -setInterval(function(){ - a('doing some work'); -}, 1000); - -setInterval(function(){ - b('doing some work'); -}, 1200); -``` - -#### Web Inspector Colors - - Colors are also enabled on "Web Inspectors" that understand the `%c` formatting - option. These are WebKit web inspectors, Firefox ([since version - 31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) - and the Firebug plugin for Firefox (any version). - - Colored output looks something like: - - ![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png) - -### stderr vs stdout - -You can set an alternative logging method per-namespace by overriding the `log` method on a per-namespace or globally: - -Example _stdout.js_: - -```js -var debug = require('debug'); -var error = debug('app:error'); - -// by default stderr is used -error('goes to stderr!'); - -var log = debug('app:log'); -// set this namespace to log via console.log -log.log = console.log.bind(console); // don't forget to bind to console! -log('goes to stdout'); -error('still goes to stderr!'); - -// set all output to go via console.info -// overrides all per-namespace log settings -debug.log = console.info.bind(console); -error('now goes to stdout via console.info'); -log('still goes to stdout, but via console.info now'); -``` - -### Save debug output to a file - -You can save all debug statements to a file by piping them. - -Example: - -```bash -$ DEBUG_FD=3 node your-app.js 3> whatever.log -``` - -## Authors - - - TJ Holowaychuk - - Nathan Rajlich - -## License - -(The MIT License) - -Copyright (c) 2014 TJ Holowaychuk <tj@vision-media.ca> - -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/express/node_modules/debug/bower.json b/node_modules/express/node_modules/debug/bower.json deleted file mode 100644 index 6af573f..0000000 --- a/node_modules/express/node_modules/debug/bower.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "visionmedia-debug", - "main": "dist/debug.js", - "version": "2.2.0", - "homepage": "https://github.com/visionmedia/debug", - "authors": [ - "TJ Holowaychuk " - ], - "description": "visionmedia-debug", - "moduleType": [ - "amd", - "es6", - "globals", - "node" - ], - "keywords": [ - "visionmedia", - "debug" - ], - "license": "MIT", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ] -} diff --git a/node_modules/express/node_modules/debug/browser.js b/node_modules/express/node_modules/debug/browser.js deleted file mode 100644 index 7c76452..0000000 --- a/node_modules/express/node_modules/debug/browser.js +++ /dev/null @@ -1,168 +0,0 @@ - -/** - * This is the web browser implementation of `debug()`. - * - * Expose `debug()` as the module. - */ - -exports = module.exports = require('./debug'); -exports.log = log; -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; -exports.storage = 'undefined' != typeof chrome - && 'undefined' != typeof chrome.storage - ? chrome.storage.local - : localstorage(); - -/** - * Colors. - */ - -exports.colors = [ - 'lightseagreen', - 'forestgreen', - 'goldenrod', - 'dodgerblue', - 'darkorchid', - 'crimson' -]; - -/** - * Currently only WebKit-based Web Inspectors, Firefox >= v31, - * and the Firebug extension (any Firefox version) are known - * to support "%c" CSS customizations. - * - * TODO: add a `localStorage` variable to explicitly enable/disable colors - */ - -function useColors() { - // is webkit? http://stackoverflow.com/a/16459606/376773 - return ('WebkitAppearance' in document.documentElement.style) || - // is firebug? http://stackoverflow.com/a/398120/376773 - (window.console && (console.firebug || (console.exception && console.table))) || - // is firefox >= v31? - // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages - (navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31); -} - -/** - * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. - */ - -exports.formatters.j = function(v) { - return JSON.stringify(v); -}; - - -/** - * Colorize log arguments if enabled. - * - * @api public - */ - -function formatArgs() { - var args = arguments; - var useColors = this.useColors; - - args[0] = (useColors ? '%c' : '') - + this.namespace - + (useColors ? ' %c' : ' ') - + args[0] - + (useColors ? '%c ' : ' ') - + '+' + exports.humanize(this.diff); - - if (!useColors) return args; - - var c = 'color: ' + this.color; - args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1)); - - // the final "%c" is somewhat tricky, because there could be other - // arguments passed either before or after the %c, so we need to - // figure out the correct index to insert the CSS into - var index = 0; - var lastC = 0; - args[0].replace(/%[a-z%]/g, function(match) { - if ('%%' === match) return; - index++; - if ('%c' === match) { - // we only are interested in the *last* %c - // (the user may have provided their own) - lastC = index; - } - }); - - args.splice(lastC, 0, c); - return args; -} - -/** - * Invokes `console.log()` when available. - * No-op when `console.log` is not a "function". - * - * @api public - */ - -function log() { - // this hackery is required for IE8/9, where - // the `console.log` function doesn't have 'apply' - return 'object' === typeof console - && console.log - && Function.prototype.apply.call(console.log, console, arguments); -} - -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ - -function save(namespaces) { - try { - if (null == namespaces) { - exports.storage.removeItem('debug'); - } else { - exports.storage.debug = namespaces; - } - } catch(e) {} -} - -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ - -function load() { - var r; - try { - r = exports.storage.debug; - } catch(e) {} - return r; -} - -/** - * Enable namespaces listed in `localStorage.debug` initially. - */ - -exports.enable(load()); - -/** - * Localstorage attempts to return the localstorage. - * - * This is necessary because safari throws - * when a user disables cookies/localstorage - * and you attempt to access it. - * - * @return {LocalStorage} - * @api private - */ - -function localstorage(){ - try { - return window.localStorage; - } catch (e) {} -} diff --git a/node_modules/express/node_modules/debug/component.json b/node_modules/express/node_modules/debug/component.json deleted file mode 100644 index ca10637..0000000 --- a/node_modules/express/node_modules/debug/component.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "debug", - "repo": "visionmedia/debug", - "description": "small debugging utility", - "version": "2.2.0", - "keywords": [ - "debug", - "log", - "debugger" - ], - "main": "browser.js", - "scripts": [ - "browser.js", - "debug.js" - ], - "dependencies": { - "rauchg/ms.js": "0.7.1" - } -} diff --git a/node_modules/express/node_modules/debug/debug.js b/node_modules/express/node_modules/debug/debug.js deleted file mode 100644 index 7571a86..0000000 --- a/node_modules/express/node_modules/debug/debug.js +++ /dev/null @@ -1,197 +0,0 @@ - -/** - * This is the common logic for both the Node.js and web browser - * implementations of `debug()`. - * - * Expose `debug()` as the module. - */ - -exports = module.exports = debug; -exports.coerce = coerce; -exports.disable = disable; -exports.enable = enable; -exports.enabled = enabled; -exports.humanize = require('ms'); - -/** - * The currently active debug mode names, and names to skip. - */ - -exports.names = []; -exports.skips = []; - -/** - * Map of special "%n" handling functions, for the debug "format" argument. - * - * Valid key names are a single, lowercased letter, i.e. "n". - */ - -exports.formatters = {}; - -/** - * Previously assigned color. - */ - -var prevColor = 0; - -/** - * Previous log timestamp. - */ - -var prevTime; - -/** - * Select a color. - * - * @return {Number} - * @api private - */ - -function selectColor() { - return exports.colors[prevColor++ % exports.colors.length]; -} - -/** - * Create a debugger with the given `namespace`. - * - * @param {String} namespace - * @return {Function} - * @api public - */ - -function debug(namespace) { - - // define the `disabled` version - function disabled() { - } - disabled.enabled = false; - - // define the `enabled` version - function enabled() { - - var self = enabled; - - // set `diff` timestamp - var curr = +new Date(); - var ms = curr - (prevTime || curr); - self.diff = ms; - self.prev = prevTime; - self.curr = curr; - prevTime = curr; - - // add the `color` if not set - if (null == self.useColors) self.useColors = exports.useColors(); - if (null == self.color && self.useColors) self.color = selectColor(); - - var args = Array.prototype.slice.call(arguments); - - args[0] = exports.coerce(args[0]); - - if ('string' !== typeof args[0]) { - // anything else let's inspect with %o - args = ['%o'].concat(args); - } - - // apply any `formatters` transformations - var index = 0; - args[0] = args[0].replace(/%([a-z%])/g, function(match, format) { - // if we encounter an escaped % then don't increase the array index - if (match === '%%') return match; - index++; - var formatter = exports.formatters[format]; - if ('function' === typeof formatter) { - var val = args[index]; - match = formatter.call(self, val); - - // now we need to remove `args[index]` since it's inlined in the `format` - args.splice(index, 1); - index--; - } - return match; - }); - - if ('function' === typeof exports.formatArgs) { - args = exports.formatArgs.apply(self, args); - } - var logFn = enabled.log || exports.log || console.log.bind(console); - logFn.apply(self, args); - } - enabled.enabled = true; - - var fn = exports.enabled(namespace) ? enabled : disabled; - - fn.namespace = namespace; - - return fn; -} - -/** - * Enables a debug mode by namespaces. This can include modes - * separated by a colon and wildcards. - * - * @param {String} namespaces - * @api public - */ - -function enable(namespaces) { - exports.save(namespaces); - - var split = (namespaces || '').split(/[\s,]+/); - var len = split.length; - - for (var i = 0; i < len; i++) { - if (!split[i]) continue; // ignore empty strings - namespaces = split[i].replace(/\*/g, '.*?'); - if (namespaces[0] === '-') { - exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); - } else { - exports.names.push(new RegExp('^' + namespaces + '$')); - } - } -} - -/** - * Disable debug output. - * - * @api public - */ - -function disable() { - exports.enable(''); -} - -/** - * Returns true if the given mode name is enabled, false otherwise. - * - * @param {String} name - * @return {Boolean} - * @api public - */ - -function enabled(name) { - var i, len; - for (i = 0, len = exports.skips.length; i < len; i++) { - if (exports.skips[i].test(name)) { - return false; - } - } - for (i = 0, len = exports.names.length; i < len; i++) { - if (exports.names[i].test(name)) { - return true; - } - } - return false; -} - -/** - * Coerce `val`. - * - * @param {Mixed} val - * @return {Mixed} - * @api private - */ - -function coerce(val) { - if (val instanceof Error) return val.stack || val.message; - return val; -} diff --git a/node_modules/express/node_modules/debug/node.js b/node_modules/express/node_modules/debug/node.js deleted file mode 100644 index 1d392a8..0000000 --- a/node_modules/express/node_modules/debug/node.js +++ /dev/null @@ -1,209 +0,0 @@ - -/** - * Module dependencies. - */ - -var tty = require('tty'); -var util = require('util'); - -/** - * This is the Node.js implementation of `debug()`. - * - * Expose `debug()` as the module. - */ - -exports = module.exports = require('./debug'); -exports.log = log; -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; - -/** - * Colors. - */ - -exports.colors = [6, 2, 3, 4, 5, 1]; - -/** - * The file descriptor to write the `debug()` calls to. - * Set the `DEBUG_FD` env variable to override with another value. i.e.: - * - * $ DEBUG_FD=3 node script.js 3>debug.log - */ - -var fd = parseInt(process.env.DEBUG_FD, 10) || 2; -var stream = 1 === fd ? process.stdout : - 2 === fd ? process.stderr : - createWritableStdioStream(fd); - -/** - * Is stdout a TTY? Colored output is enabled when `true`. - */ - -function useColors() { - var debugColors = (process.env.DEBUG_COLORS || '').trim().toLowerCase(); - if (0 === debugColors.length) { - return tty.isatty(fd); - } else { - return '0' !== debugColors - && 'no' !== debugColors - && 'false' !== debugColors - && 'disabled' !== debugColors; - } -} - -/** - * Map %o to `util.inspect()`, since Node doesn't do that out of the box. - */ - -var inspect = (4 === util.inspect.length ? - // node <= 0.8.x - function (v, colors) { - return util.inspect(v, void 0, void 0, colors); - } : - // node > 0.8.x - function (v, colors) { - return util.inspect(v, { colors: colors }); - } -); - -exports.formatters.o = function(v) { - return inspect(v, this.useColors) - .replace(/\s*\n\s*/g, ' '); -}; - -/** - * Adds ANSI color escape codes if enabled. - * - * @api public - */ - -function formatArgs() { - var args = arguments; - var useColors = this.useColors; - var name = this.namespace; - - if (useColors) { - var c = this.color; - - args[0] = ' \u001b[3' + c + ';1m' + name + ' ' - + '\u001b[0m' - + args[0] + '\u001b[3' + c + 'm' - + ' +' + exports.humanize(this.diff) + '\u001b[0m'; - } else { - args[0] = new Date().toUTCString() - + ' ' + name + ' ' + args[0]; - } - return args; -} - -/** - * Invokes `console.error()` with the specified arguments. - */ - -function log() { - return stream.write(util.format.apply(this, arguments) + '\n'); -} - -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ - -function save(namespaces) { - if (null == namespaces) { - // If you set a process.env field to null or undefined, it gets cast to the - // string 'null' or 'undefined'. Just delete instead. - delete process.env.DEBUG; - } else { - process.env.DEBUG = namespaces; - } -} - -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ - -function load() { - return process.env.DEBUG; -} - -/** - * Copied from `node/src/node.js`. - * - * XXX: It's lame that node doesn't expose this API out-of-the-box. It also - * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame. - */ - -function createWritableStdioStream (fd) { - var stream; - var tty_wrap = process.binding('tty_wrap'); - - // Note stream._type is used for test-module-load-list.js - - switch (tty_wrap.guessHandleType(fd)) { - case 'TTY': - stream = new tty.WriteStream(fd); - stream._type = 'tty'; - - // Hack to have stream not keep the event loop alive. - // See https://github.com/joyent/node/issues/1726 - if (stream._handle && stream._handle.unref) { - stream._handle.unref(); - } - break; - - case 'FILE': - var fs = require('fs'); - stream = new fs.SyncWriteStream(fd, { autoClose: false }); - stream._type = 'fs'; - break; - - case 'PIPE': - case 'TCP': - var net = require('net'); - stream = new net.Socket({ - fd: fd, - readable: false, - writable: true - }); - - // FIXME Should probably have an option in net.Socket to create a - // stream from an existing fd which is writable only. But for now - // we'll just add this hack and set the `readable` member to false. - // Test: ./node test/fixtures/echo.js < /etc/passwd - stream.readable = false; - stream.read = null; - stream._type = 'pipe'; - - // FIXME Hack to have stream not keep the event loop alive. - // See https://github.com/joyent/node/issues/1726 - if (stream._handle && stream._handle.unref) { - stream._handle.unref(); - } - break; - - default: - // Probably an error on in uv_guess_handle() - throw new Error('Implement me. Unknown stream file type!'); - } - - // For supporting legacy API we put the FD here. - stream.fd = fd; - - stream._isStdio = true; - - return stream; -} - -/** - * Enable namespaces listed in `process.env.DEBUG` initially. - */ - -exports.enable(load()); diff --git a/node_modules/express/node_modules/debug/package.json b/node_modules/express/node_modules/debug/package.json deleted file mode 100644 index b9f033a..0000000 --- a/node_modules/express/node_modules/debug/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "debug", - "version": "2.2.0", - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/debug.git" - }, - "description": "small debugging utility", - "keywords": [ - "debug", - "log", - "debugger" - ], - "author": "TJ Holowaychuk ", - "contributors": [ - "Nathan Rajlich (http://n8.io)" - ], - "license": "MIT", - "dependencies": { - "ms": "0.7.1" - }, - "devDependencies": { - "browserify": "9.0.3", - "mocha": "*" - }, - "main": "./node.js", - "browser": "./browser.js", - "component": { - "scripts": { - "debug/index.js": "browser.js", - "debug/debug.js": "debug.js" - } - } -} diff --git a/node_modules/express/node_modules/depd/History.md b/node_modules/express/node_modules/depd/History.md deleted file mode 100644 index 4a36a6c..0000000 --- a/node_modules/express/node_modules/depd/History.md +++ /dev/null @@ -1,75 +0,0 @@ -1.0.1 / 2015-04-07 -================== - - * Fix `TypeError`s when under `'use strict'` code - * Fix useless type name on auto-generated messages - * Support io.js 1.x - * Support Node.js 0.12 - -1.0.0 / 2014-09-17 -================== - - * No changes - -0.4.5 / 2014-09-09 -================== - - * Improve call speed to functions using the function wrapper - * Support Node.js 0.6 - -0.4.4 / 2014-07-27 -================== - - * Work-around v8 generating empty stack traces - -0.4.3 / 2014-07-26 -================== - - * Fix exception when global `Error.stackTraceLimit` is too low - -0.4.2 / 2014-07-19 -================== - - * Correct call site for wrapped functions and properties - -0.4.1 / 2014-07-19 -================== - - * Improve automatic message generation for function properties - -0.4.0 / 2014-07-19 -================== - - * Add `TRACE_DEPRECATION` environment variable - * Remove non-standard grey color from color output - * Support `--no-deprecation` argument - * Support `--trace-deprecation` argument - * Support `deprecate.property(fn, prop, message)` - -0.3.0 / 2014-06-16 -================== - - * Add `NO_DEPRECATION` environment variable - -0.2.0 / 2014-06-15 -================== - - * Add `deprecate.property(obj, prop, message)` - * Remove `supports-color` dependency for node.js 0.8 - -0.1.0 / 2014-06-15 -================== - - * Add `deprecate.function(fn, message)` - * Add `process.on('deprecation', fn)` emitter - * Automatically generate message when omitted from `deprecate()` - -0.0.1 / 2014-06-15 -================== - - * Fix warning for dynamic calls at singe call site - -0.0.0 / 2014-06-15 -================== - - * Initial implementation diff --git a/node_modules/express/node_modules/depd/Readme.md b/node_modules/express/node_modules/depd/Readme.md deleted file mode 100644 index 5ead5da..0000000 --- a/node_modules/express/node_modules/depd/Readme.md +++ /dev/null @@ -1,274 +0,0 @@ -# depd - -[![NPM Version][npm-version-image]][npm-url] -[![NPM Downloads][npm-downloads-image]][npm-url] -[![Node.js Version][node-image]][node-url] -[![Linux Build][travis-image]][travis-url] -[![Windows Build][appveyor-image]][appveyor-url] -[![Coverage Status][coveralls-image]][coveralls-url] -[![Gratipay][gratipay-image]][gratipay-url] - -Deprecate all the things - -> With great modules comes great responsibility; mark things deprecated! - -## Install - -```sh -$ npm install depd -``` - -## API - -```js -var deprecate = require('depd')('my-module') -``` - -This library allows you to display deprecation messages to your users. -This library goes above and beyond with deprecation warnings by -introspection of the call stack (but only the bits that it is interested -in). - -Instead of just warning on the first invocation of a deprecated -function and never again, this module will warn on the first invocation -of a deprecated function per unique call site, making it ideal to alert -users of all deprecated uses across the code base, rather than just -whatever happens to execute first. - -The deprecation warnings from this module also include the file and line -information for the call into the module that the deprecated function was -in. - -**NOTE** this library has a similar interface to the `debug` module, and -this module uses the calling file to get the boundary for the call stacks, -so you should always create a new `deprecate` object in each file and not -within some central file. - -### depd(namespace) - -Create a new deprecate function that uses the given namespace name in the -messages and will display the call site prior to the stack entering the -file this function was called from. It is highly suggested you use the -name of your module as the namespace. - -### deprecate(message) - -Call this function from deprecated code to display a deprecation message. -This message will appear once per unique caller site. Caller site is the -first call site in the stack in a different file from the caller of this -function. - -If the message is omitted, a message is generated for you based on the site -of the `deprecate()` call and will display the name of the function called, -similar to the name displayed in a stack trace. - -### deprecate.function(fn, message) - -Call this function to wrap a given function in a deprecation message on any -call to the function. An optional message can be supplied to provide a custom -message. - -### deprecate.property(obj, prop, message) - -Call this function to wrap a given property on object in a deprecation message -on any accessing or setting of the property. An optional message can be supplied -to provide a custom message. - -The method must be called on the object where the property belongs (not -inherited from the prototype). - -If the property is a data descriptor, it will be converted to an accessor -descriptor in order to display the deprecation message. - -### process.on('deprecation', fn) - -This module will allow easy capturing of deprecation errors by emitting the -errors as the type "deprecation" on the global `process`. If there are no -listeners for this type, the errors are written to STDERR as normal, but if -there are any listeners, nothing will be written to STDERR and instead only -emitted. From there, you can write the errors in a different format or to a -logging source. - -The error represents the deprecation and is emitted only once with the same -rules as writing to STDERR. The error has the following properties: - - - `message` - This is the message given by the library - - `name` - This is always `'DeprecationError'` - - `namespace` - This is the namespace the deprecation came from - - `stack` - This is the stack of the call to the deprecated thing - -Example `error.stack` output: - -``` -DeprecationError: my-cool-module deprecated oldfunction - at Object. ([eval]-wrapper:6:22) - at Module._compile (module.js:456:26) - at evalScript (node.js:532:25) - at startup (node.js:80:7) - at node.js:902:3 -``` - -### process.env.NO_DEPRECATION - -As a user of modules that are deprecated, the environment variable `NO_DEPRECATION` -is provided as a quick solution to silencing deprecation warnings from being -output. The format of this is similar to that of `DEBUG`: - -```sh -$ NO_DEPRECATION=my-module,othermod node app.js -``` - -This will suppress deprecations from being output for "my-module" and "othermod". -The value is a list of comma-separated namespaces. To suppress every warning -across all namespaces, use the value `*` for a namespace. - -Providing the argument `--no-deprecation` to the `node` executable will suppress -all deprecations (only available in Node.js 0.8 or higher). - -**NOTE** This will not suppress the deperecations given to any "deprecation" -event listeners, just the output to STDERR. - -### process.env.TRACE_DEPRECATION - -As a user of modules that are deprecated, the environment variable `TRACE_DEPRECATION` -is provided as a solution to getting more detailed location information in deprecation -warnings by including the entire stack trace. The format of this is the same as -`NO_DEPRECATION`: - -```sh -$ TRACE_DEPRECATION=my-module,othermod node app.js -``` - -This will include stack traces for deprecations being output for "my-module" and -"othermod". The value is a list of comma-separated namespaces. To trace every -warning across all namespaces, use the value `*` for a namespace. - -Providing the argument `--trace-deprecation` to the `node` executable will trace -all deprecations (only available in Node.js 0.8 or higher). - -**NOTE** This will not trace the deperecations silenced by `NO_DEPRECATION`. - -## Display - -![message](files/message.png) - -When a user calls a function in your library that you mark deprecated, they -will see the following written to STDERR (in the given colors, similar colors -and layout to the `debug` module): - -``` -bright cyan bright yellow -| | reset cyan -| | | | -▼ ▼ ▼ ▼ -my-cool-module deprecated oldfunction [eval]-wrapper:6:22 -▲ ▲ ▲ ▲ -| | | | -namespace | | location of mycoolmod.oldfunction() call - | deprecation message - the word "deprecated" -``` - -If the user redirects their STDERR to a file or somewhere that does not support -colors, they see (similar layout to the `debug` module): - -``` -Sun, 15 Jun 2014 05:21:37 GMT my-cool-module deprecated oldfunction at [eval]-wrapper:6:22 -▲ ▲ ▲ ▲ ▲ -| | | | | -timestamp of message namespace | | location of mycoolmod.oldfunction() call - | deprecation message - the word "deprecated" -``` - -## Examples - -### Deprecating all calls to a function - -This will display a deprecated message about "oldfunction" being deprecated -from "my-module" on STDERR. - -```js -var deprecate = require('depd')('my-cool-module') - -// message automatically derived from function name -// Object.oldfunction -exports.oldfunction = deprecate.function(function oldfunction() { - // all calls to function are deprecated -}) - -// specific message -exports.oldfunction = deprecate.function(function () { - // all calls to function are deprecated -}, 'oldfunction') -``` - -### Conditionally deprecating a function call - -This will display a deprecated message about "weirdfunction" being deprecated -from "my-module" on STDERR when called with less than 2 arguments. - -```js -var deprecate = require('depd')('my-cool-module') - -exports.weirdfunction = function () { - if (arguments.length < 2) { - // calls with 0 or 1 args are deprecated - deprecate('weirdfunction args < 2') - } -} -``` - -When calling `deprecate` as a function, the warning is counted per call site -within your own module, so you can display different deprecations depending -on different situations and the users will still get all the warnings: - -```js -var deprecate = require('depd')('my-cool-module') - -exports.weirdfunction = function () { - if (arguments.length < 2) { - // calls with 0 or 1 args are deprecated - deprecate('weirdfunction args < 2') - } else if (typeof arguments[0] !== 'string') { - // calls with non-string first argument are deprecated - deprecate('weirdfunction non-string first arg') - } -} -``` - -### Deprecating property access - -This will display a deprecated message about "oldprop" being deprecated -from "my-module" on STDERR when accessed. A deprecation will be displayed -when setting the value and when getting the value. - -```js -var deprecate = require('depd')('my-cool-module') - -exports.oldprop = 'something' - -// message automatically derives from property name -deprecate.property(exports, 'oldprop') - -// explicit message -deprecate.property(exports, 'oldprop', 'oldprop >= 0.10') -``` - -## License - -[MIT](LICENSE) - -[npm-version-image]: https://img.shields.io/npm/v/depd.svg -[npm-downloads-image]: https://img.shields.io/npm/dm/depd.svg -[npm-url]: https://npmjs.org/package/depd -[travis-image]: https://img.shields.io/travis/dougwilson/nodejs-depd/master.svg?label=linux -[travis-url]: https://travis-ci.org/dougwilson/nodejs-depd -[appveyor-image]: https://img.shields.io/appveyor/ci/dougwilson/nodejs-depd/master.svg?label=windows -[appveyor-url]: https://ci.appveyor.com/project/dougwilson/nodejs-depd -[coveralls-image]: https://img.shields.io/coveralls/dougwilson/nodejs-depd/master.svg -[coveralls-url]: https://coveralls.io/r/dougwilson/nodejs-depd?branch=master -[node-image]: https://img.shields.io/node/v/depd.svg -[node-url]: http://nodejs.org/download/ -[gratipay-image]: https://img.shields.io/gratipay/dougwilson.svg -[gratipay-url]: https://www.gratipay.com/dougwilson/ diff --git a/node_modules/express/node_modules/depd/index.js b/node_modules/express/node_modules/depd/index.js deleted file mode 100644 index d183b0a..0000000 --- a/node_modules/express/node_modules/depd/index.js +++ /dev/null @@ -1,529 +0,0 @@ -/*! - * depd - * Copyright(c) 2014 Douglas Christopher Wilson - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var callSiteToString = require('./lib/compat').callSiteToString -var EventEmitter = require('events').EventEmitter -var relative = require('path').relative - -/** - * Module exports. - */ - -module.exports = depd - -/** - * Get the path to base files on. - */ - -var basePath = process.cwd() - -/** - * Get listener count on event emitter. - */ - -/*istanbul ignore next*/ -var eventListenerCount = EventEmitter.listenerCount - || function (emitter, type) { return emitter.listeners(type).length } - -/** - * Determine if namespace is contained in the string. - */ - -function containsNamespace(str, namespace) { - var val = str.split(/[ ,]+/) - - namespace = String(namespace).toLowerCase() - - for (var i = 0 ; i < val.length; i++) { - if (!(str = val[i])) continue; - - // namespace contained - if (str === '*' || str.toLowerCase() === namespace) { - return true - } - } - - return false -} - -/** - * Convert a data descriptor to accessor descriptor. - */ - -function convertDataDescriptorToAccessor(obj, prop, message) { - var descriptor = Object.getOwnPropertyDescriptor(obj, prop) - var value = descriptor.value - - descriptor.get = function getter() { return value } - - if (descriptor.writable) { - descriptor.set = function setter(val) { return value = val } - } - - delete descriptor.value - delete descriptor.writable - - Object.defineProperty(obj, prop, descriptor) - - return descriptor -} - -/** - * Create arguments string to keep arity. - */ - -function createArgumentsString(arity) { - var str = '' - - for (var i = 0; i < arity; i++) { - str += ', arg' + i - } - - return str.substr(2) -} - -/** - * Create stack string from stack. - */ - -function createStackString(stack) { - var str = this.name + ': ' + this.namespace - - if (this.message) { - str += ' deprecated ' + this.message - } - - for (var i = 0; i < stack.length; i++) { - str += '\n at ' + callSiteToString(stack[i]) - } - - return str -} - -/** - * Create deprecate for namespace in caller. - */ - -function depd(namespace) { - if (!namespace) { - throw new TypeError('argument namespace is required') - } - - var stack = getStack() - var site = callSiteLocation(stack[1]) - var file = site[0] - - function deprecate(message) { - // call to self as log - log.call(deprecate, message) - } - - deprecate._file = file - deprecate._ignored = isignored(namespace) - deprecate._namespace = namespace - deprecate._traced = istraced(namespace) - deprecate._warned = Object.create(null) - - deprecate.function = wrapfunction - deprecate.property = wrapproperty - - return deprecate -} - -/** - * Determine if namespace is ignored. - */ - -function isignored(namespace) { - /* istanbul ignore next: tested in a child processs */ - if (process.noDeprecation) { - // --no-deprecation support - return true - } - - var str = process.env.NO_DEPRECATION || '' - - // namespace ignored - return containsNamespace(str, namespace) -} - -/** - * Determine if namespace is traced. - */ - -function istraced(namespace) { - /* istanbul ignore next: tested in a child processs */ - if (process.traceDeprecation) { - // --trace-deprecation support - return true - } - - var str = process.env.TRACE_DEPRECATION || '' - - // namespace traced - return containsNamespace(str, namespace) -} - -/** - * Display deprecation message. - */ - -function log(message, site) { - var haslisteners = eventListenerCount(process, 'deprecation') !== 0 - - // abort early if no destination - if (!haslisteners && this._ignored) { - return - } - - var caller - var callFile - var callSite - var i = 0 - var seen = false - var stack = getStack() - var file = this._file - - if (site) { - // provided site - callSite = callSiteLocation(stack[1]) - callSite.name = site.name - file = callSite[0] - } else { - // get call site - i = 2 - site = callSiteLocation(stack[i]) - callSite = site - } - - // get caller of deprecated thing in relation to file - for (; i < stack.length; i++) { - caller = callSiteLocation(stack[i]) - callFile = caller[0] - - if (callFile === file) { - seen = true - } else if (callFile === this._file) { - file = this._file - } else if (seen) { - break - } - } - - var key = caller - ? site.join(':') + '__' + caller.join(':') - : undefined - - if (key !== undefined && key in this._warned) { - // already warned - return - } - - this._warned[key] = true - - // generate automatic message from call site - if (!message) { - message = callSite === site || !callSite.name - ? defaultMessage(site) - : defaultMessage(callSite) - } - - // emit deprecation if listeners exist - if (haslisteners) { - var err = DeprecationError(this._namespace, message, stack.slice(i)) - process.emit('deprecation', err) - return - } - - // format and write message - var format = process.stderr.isTTY - ? formatColor - : formatPlain - var msg = format.call(this, message, caller, stack.slice(i)) - process.stderr.write(msg + '\n', 'utf8') - - return -} - -/** - * Get call site location as array. - */ - -function callSiteLocation(callSite) { - var file = callSite.getFileName() || '' - var line = callSite.getLineNumber() - var colm = callSite.getColumnNumber() - - if (callSite.isEval()) { - file = callSite.getEvalOrigin() + ', ' + file - } - - var site = [file, line, colm] - - site.callSite = callSite - site.name = callSite.getFunctionName() - - return site -} - -/** - * Generate a default message from the site. - */ - -function defaultMessage(site) { - var callSite = site.callSite - var funcName = site.name - - // make useful anonymous name - if (!funcName) { - funcName = '' - } - - var context = callSite.getThis() - var typeName = context && callSite.getTypeName() - - // ignore useless type name - if (typeName === 'Object') { - typeName = undefined - } - - // make useful type name - if (typeName === 'Function') { - typeName = context.name || typeName - } - - return typeName && callSite.getMethodName() - ? typeName + '.' + funcName - : funcName -} - -/** - * Format deprecation message without color. - */ - -function formatPlain(msg, caller, stack) { - var timestamp = new Date().toUTCString() - - var formatted = timestamp - + ' ' + this._namespace - + ' deprecated ' + msg - - // add stack trace - if (this._traced) { - for (var i = 0; i < stack.length; i++) { - formatted += '\n at ' + callSiteToString(stack[i]) - } - - return formatted - } - - if (caller) { - formatted += ' at ' + formatLocation(caller) - } - - return formatted -} - -/** - * Format deprecation message with color. - */ - -function formatColor(msg, caller, stack) { - var formatted = '\x1b[36;1m' + this._namespace + '\x1b[22;39m' // bold cyan - + ' \x1b[33;1mdeprecated\x1b[22;39m' // bold yellow - + ' \x1b[0m' + msg + '\x1b[39m' // reset - - // add stack trace - if (this._traced) { - for (var i = 0; i < stack.length; i++) { - formatted += '\n \x1b[36mat ' + callSiteToString(stack[i]) + '\x1b[39m' // cyan - } - - return formatted - } - - if (caller) { - formatted += ' \x1b[36m' + formatLocation(caller) + '\x1b[39m' // cyan - } - - return formatted -} - -/** - * Format call site location. - */ - -function formatLocation(callSite) { - return relative(basePath, callSite[0]) - + ':' + callSite[1] - + ':' + callSite[2] -} - -/** - * Get the stack as array of call sites. - */ - -function getStack() { - var limit = Error.stackTraceLimit - var obj = {} - var prep = Error.prepareStackTrace - - Error.prepareStackTrace = prepareObjectStackTrace - Error.stackTraceLimit = Math.max(10, limit) - - // capture the stack - Error.captureStackTrace(obj) - - // slice this function off the top - var stack = obj.stack.slice(1) - - Error.prepareStackTrace = prep - Error.stackTraceLimit = limit - - return stack -} - -/** - * Capture call site stack from v8. - */ - -function prepareObjectStackTrace(obj, stack) { - return stack -} - -/** - * Return a wrapped function in a deprecation message. - */ - -function wrapfunction(fn, message) { - if (typeof fn !== 'function') { - throw new TypeError('argument fn must be a function') - } - - var args = createArgumentsString(fn.length) - var deprecate = this - var stack = getStack() - var site = callSiteLocation(stack[1]) - - site.name = fn.name - - var deprecatedfn = eval('(function (' + args + ') {\n' - + '"use strict"\n' - + 'log.call(deprecate, message, site)\n' - + 'return fn.apply(this, arguments)\n' - + '})') - - return deprecatedfn -} - -/** - * Wrap property in a deprecation message. - */ - -function wrapproperty(obj, prop, message) { - if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) { - throw new TypeError('argument obj must be object') - } - - var descriptor = Object.getOwnPropertyDescriptor(obj, prop) - - if (!descriptor) { - throw new TypeError('must call property on owner object') - } - - if (!descriptor.configurable) { - throw new TypeError('property must be configurable') - } - - var deprecate = this - var stack = getStack() - var site = callSiteLocation(stack[1]) - - // set site name - site.name = prop - - // convert data descriptor - if ('value' in descriptor) { - descriptor = convertDataDescriptorToAccessor(obj, prop, message) - } - - var get = descriptor.get - var set = descriptor.set - - // wrap getter - if (typeof get === 'function') { - descriptor.get = function getter() { - log.call(deprecate, message, site) - return get.apply(this, arguments) - } - } - - // wrap setter - if (typeof set === 'function') { - descriptor.set = function setter() { - log.call(deprecate, message, site) - return set.apply(this, arguments) - } - } - - Object.defineProperty(obj, prop, descriptor) -} - -/** - * Create DeprecationError for deprecation - */ - -function DeprecationError(namespace, message, stack) { - var error = new Error() - var stackString - - Object.defineProperty(error, 'constructor', { - value: DeprecationError - }) - - Object.defineProperty(error, 'message', { - configurable: true, - enumerable: false, - value: message, - writable: true - }) - - Object.defineProperty(error, 'name', { - enumerable: false, - configurable: true, - value: 'DeprecationError', - writable: true - }) - - Object.defineProperty(error, 'namespace', { - configurable: true, - enumerable: false, - value: namespace, - writable: true - }) - - Object.defineProperty(error, 'stack', { - configurable: true, - enumerable: false, - get: function () { - if (stackString !== undefined) { - return stackString - } - - // prepare stack trace - return stackString = createStackString.call(this, stack) - }, - set: function setter(val) { - stackString = val - } - }) - - return error -} diff --git a/node_modules/express/node_modules/depd/lib/compat/buffer-concat.js b/node_modules/express/node_modules/depd/lib/compat/buffer-concat.js deleted file mode 100644 index 09d9721..0000000 --- a/node_modules/express/node_modules/depd/lib/compat/buffer-concat.js +++ /dev/null @@ -1,33 +0,0 @@ -/*! - * depd - * Copyright(c) 2014 Douglas Christopher Wilson - * MIT Licensed - */ - -/** - * Module exports. - */ - -module.exports = bufferConcat - -/** - * Concatenate an array of Buffers. - */ - -function bufferConcat(bufs) { - var length = 0 - - for (var i = 0, len = bufs.length; i < len; i++) { - length += bufs[i].length - } - - var buf = new Buffer(length) - var pos = 0 - - for (var i = 0, len = bufs.length; i < len; i++) { - bufs[i].copy(buf, pos) - pos += bufs[i].length - } - - return buf -} diff --git a/node_modules/express/node_modules/depd/lib/compat/callsite-tostring.js b/node_modules/express/node_modules/depd/lib/compat/callsite-tostring.js deleted file mode 100644 index 17cf7ed..0000000 --- a/node_modules/express/node_modules/depd/lib/compat/callsite-tostring.js +++ /dev/null @@ -1,101 +0,0 @@ -/*! - * depd - * Copyright(c) 2014 Douglas Christopher Wilson - * MIT Licensed - */ - -/** - * Module exports. - */ - -module.exports = callSiteToString - -/** - * Format a CallSite file location to a string. - */ - -function callSiteFileLocation(callSite) { - var fileName - var fileLocation = '' - - if (callSite.isNative()) { - fileLocation = 'native' - } else if (callSite.isEval()) { - fileName = callSite.getScriptNameOrSourceURL() - if (!fileName) { - fileLocation = callSite.getEvalOrigin() - } - } else { - fileName = callSite.getFileName() - } - - if (fileName) { - fileLocation += fileName - - var lineNumber = callSite.getLineNumber() - if (lineNumber != null) { - fileLocation += ':' + lineNumber - - var columnNumber = callSite.getColumnNumber() - if (columnNumber) { - fileLocation += ':' + columnNumber - } - } - } - - return fileLocation || 'unknown source' -} - -/** - * Format a CallSite to a string. - */ - -function callSiteToString(callSite) { - var addSuffix = true - var fileLocation = callSiteFileLocation(callSite) - var functionName = callSite.getFunctionName() - var isConstructor = callSite.isConstructor() - var isMethodCall = !(callSite.isToplevel() || isConstructor) - var line = '' - - if (isMethodCall) { - var methodName = callSite.getMethodName() - var typeName = getConstructorName(callSite) - - if (functionName) { - if (typeName && functionName.indexOf(typeName) !== 0) { - line += typeName + '.' - } - - line += functionName - - if (methodName && functionName.lastIndexOf('.' + methodName) !== functionName.length - methodName.length - 1) { - line += ' [as ' + methodName + ']' - } - } else { - line += typeName + '.' + (methodName || '') - } - } else if (isConstructor) { - line += 'new ' + (functionName || '') - } else if (functionName) { - line += functionName - } else { - addSuffix = false - line += fileLocation - } - - if (addSuffix) { - line += ' (' + fileLocation + ')' - } - - return line -} - -/** - * Get constructor name of reviver. - */ - -function getConstructorName(obj) { - var receiver = obj.receiver - return (receiver.constructor && receiver.constructor.name) || null -} diff --git a/node_modules/express/node_modules/depd/lib/compat/index.js b/node_modules/express/node_modules/depd/lib/compat/index.js deleted file mode 100644 index 7fee026..0000000 --- a/node_modules/express/node_modules/depd/lib/compat/index.js +++ /dev/null @@ -1,69 +0,0 @@ -/*! - * depd - * Copyright(c) 2014 Douglas Christopher Wilson - * MIT Licensed - */ - -/** - * Module exports. - */ - -lazyProperty(module.exports, 'bufferConcat', function bufferConcat() { - return Buffer.concat || require('./buffer-concat') -}) - -lazyProperty(module.exports, 'callSiteToString', function callSiteToString() { - var limit = Error.stackTraceLimit - var obj = {} - var prep = Error.prepareStackTrace - - function prepareObjectStackTrace(obj, stack) { - return stack - } - - Error.prepareStackTrace = prepareObjectStackTrace - Error.stackTraceLimit = 2 - - // capture the stack - Error.captureStackTrace(obj) - - // slice the stack - var stack = obj.stack.slice() - - Error.prepareStackTrace = prep - Error.stackTraceLimit = limit - - return stack[0].toString ? toString : require('./callsite-tostring') -}) - -/** - * Define a lazy property. - */ - -function lazyProperty(obj, prop, getter) { - function get() { - var val = getter() - - Object.defineProperty(obj, prop, { - configurable: true, - enumerable: true, - value: val - }) - - return val - } - - Object.defineProperty(obj, prop, { - configurable: true, - enumerable: true, - get: get - }) -} - -/** - * Call toString() on the obj - */ - -function toString(obj) { - return obj.toString() -} diff --git a/node_modules/express/node_modules/depd/package.json b/node_modules/express/node_modules/depd/package.json deleted file mode 100644 index 9e9e402..0000000 --- a/node_modules/express/node_modules/depd/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "depd", - "description": "Deprecate all the things", - "version": "1.0.1", - "author": "Douglas Christopher Wilson ", - "license": "MIT", - "keywords": [ - "deprecate", - "deprecated" - ], - "repository": "dougwilson/nodejs-depd", - "devDependencies": { - "benchmark": "1.0.0", - "beautify-benchmark": "0.2.4", - "istanbul": "0.3.5", - "mocha": "~1.21.5" - }, - "files": [ - "lib/", - "History.md", - "LICENSE", - "index.js", - "Readme.md" - ], - "engines": { - "node": ">= 0.6" - }, - "scripts": { - "bench": "node benchmark/index.js", - "test": "mocha --reporter spec --bail test/", - "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --no-exit test/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/" - } -} diff --git a/node_modules/express/node_modules/ms/.npmignore b/node_modules/express/node_modules/ms/.npmignore deleted file mode 100644 index d1aa0ce..0000000 --- a/node_modules/express/node_modules/ms/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -node_modules -test -History.md -Makefile -component.json diff --git a/node_modules/express/node_modules/ms/History.md b/node_modules/express/node_modules/ms/History.md deleted file mode 100644 index 32fdfc1..0000000 --- a/node_modules/express/node_modules/ms/History.md +++ /dev/null @@ -1,66 +0,0 @@ - -0.7.1 / 2015-04-20 -================== - - * prevent extraordinary long inputs (@evilpacket) - * Fixed broken readme link - -0.7.0 / 2014-11-24 -================== - - * add time abbreviations, updated tests and readme for the new units - * fix example in the readme. - * add LICENSE file - -0.6.2 / 2013-12-05 -================== - - * Adding repository section to package.json to suppress warning from NPM. - -0.6.1 / 2013-05-10 -================== - - * fix singularization [visionmedia] - -0.6.0 / 2013-03-15 -================== - - * fix minutes - -0.5.1 / 2013-02-24 -================== - - * add component namespace - -0.5.0 / 2012-11-09 -================== - - * add short formatting as default and .long option - * add .license property to component.json - * add version to component.json - -0.4.0 / 2012-10-22 -================== - - * add rounding to fix crazy decimals - -0.3.0 / 2012-09-07 -================== - - * fix `ms()` [visionmedia] - -0.2.0 / 2012-09-03 -================== - - * add component.json [visionmedia] - * add days support [visionmedia] - * add hours support [visionmedia] - * add minutes support [visionmedia] - * add seconds support [visionmedia] - * add ms string support [visionmedia] - * refactor tests to facilitate ms(number) [visionmedia] - -0.1.0 / 2012-03-07 -================== - - * Initial release diff --git a/node_modules/express/node_modules/ms/LICENSE b/node_modules/express/node_modules/ms/LICENSE deleted file mode 100644 index 6c07561..0000000 --- a/node_modules/express/node_modules/ms/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -(The MIT License) - -Copyright (c) 2014 Guillermo Rauch - -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/express/node_modules/ms/README.md b/node_modules/express/node_modules/ms/README.md deleted file mode 100644 index 9b4fd03..0000000 --- a/node_modules/express/node_modules/ms/README.md +++ /dev/null @@ -1,35 +0,0 @@ -# ms.js: miliseconds conversion utility - -```js -ms('2 days') // 172800000 -ms('1d') // 86400000 -ms('10h') // 36000000 -ms('2.5 hrs') // 9000000 -ms('2h') // 7200000 -ms('1m') // 60000 -ms('5s') // 5000 -ms('100') // 100 -``` - -```js -ms(60000) // "1m" -ms(2 * 60000) // "2m" -ms(ms('10 hours')) // "10h" -``` - -```js -ms(60000, { long: true }) // "1 minute" -ms(2 * 60000, { long: true }) // "2 minutes" -ms(ms('10 hours'), { long: true }) // "10 hours" -``` - -- Node/Browser compatible. Published as [`ms`](https://www.npmjs.org/package/ms) in [NPM](http://nodejs.org/download). -- If a number is supplied to `ms`, a string with a unit is returned. -- If a string that contains the number is supplied, it returns it as -a number (e.g: it returns `100` for `'100'`). -- If you pass a string with a number and a valid unit, the number of -equivalent ms is returned. - -## License - -MIT diff --git a/node_modules/express/node_modules/ms/index.js b/node_modules/express/node_modules/ms/index.js deleted file mode 100644 index 4f92771..0000000 --- a/node_modules/express/node_modules/ms/index.js +++ /dev/null @@ -1,125 +0,0 @@ -/** - * Helpers. - */ - -var s = 1000; -var m = s * 60; -var h = m * 60; -var d = h * 24; -var y = d * 365.25; - -/** - * Parse or format the given `val`. - * - * Options: - * - * - `long` verbose formatting [false] - * - * @param {String|Number} val - * @param {Object} options - * @return {String|Number} - * @api public - */ - -module.exports = function(val, options){ - options = options || {}; - if ('string' == typeof val) return parse(val); - return options.long - ? long(val) - : short(val); -}; - -/** - * Parse the given `str` and return milliseconds. - * - * @param {String} str - * @return {Number} - * @api private - */ - -function parse(str) { - str = '' + str; - if (str.length > 10000) return; - var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str); - if (!match) return; - var n = parseFloat(match[1]); - var type = (match[2] || 'ms').toLowerCase(); - switch (type) { - case 'years': - case 'year': - case 'yrs': - case 'yr': - case 'y': - return n * y; - case 'days': - case 'day': - case 'd': - return n * d; - case 'hours': - case 'hour': - case 'hrs': - case 'hr': - case 'h': - return n * h; - case 'minutes': - case 'minute': - case 'mins': - case 'min': - case 'm': - return n * m; - case 'seconds': - case 'second': - case 'secs': - case 'sec': - case 's': - return n * s; - case 'milliseconds': - case 'millisecond': - case 'msecs': - case 'msec': - case 'ms': - return n; - } -} - -/** - * Short format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function short(ms) { - if (ms >= d) return Math.round(ms / d) + 'd'; - if (ms >= h) return Math.round(ms / h) + 'h'; - if (ms >= m) return Math.round(ms / m) + 'm'; - if (ms >= s) return Math.round(ms / s) + 's'; - return ms + 'ms'; -} - -/** - * Long format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function long(ms) { - return plural(ms, d, 'day') - || plural(ms, h, 'hour') - || plural(ms, m, 'minute') - || plural(ms, s, 'second') - || ms + ' ms'; -} - -/** - * Pluralization helper. - */ - -function plural(ms, n, name) { - if (ms < n) return; - if (ms < n * 1.5) return Math.floor(ms / n) + ' ' + name; - return Math.ceil(ms / n) + ' ' + name + 's'; -} diff --git a/node_modules/express/node_modules/ms/package.json b/node_modules/express/node_modules/ms/package.json deleted file mode 100644 index a4e5bb6..0000000 --- a/node_modules/express/node_modules/ms/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "ms", - "version": "0.7.1", - "description": "Tiny ms conversion utility", - "repository": { - "type": "git", - "url": "git://github.com/guille/ms.js.git" - }, - "main": "./index", - "devDependencies": { - "mocha": "*", - "expect.js": "*", - "serve": "*" - }, - "component": { - "scripts": { - "ms/index.js": "index.js" - } - } -} diff --git a/node_modules/express/node_modules/on-finished/HISTORY.md b/node_modules/express/node_modules/on-finished/HISTORY.md deleted file mode 100644 index 98ff0e9..0000000 --- a/node_modules/express/node_modules/on-finished/HISTORY.md +++ /dev/null @@ -1,88 +0,0 @@ -2.3.0 / 2015-05-26 -================== - - * Add defined behavior for HTTP `CONNECT` requests - * Add defined behavior for HTTP `Upgrade` requests - * deps: ee-first@1.1.1 - -2.2.1 / 2015-04-22 -================== - - * Fix `isFinished(req)` when data buffered - -2.2.0 / 2014-12-22 -================== - - * Add message object to callback arguments - -2.1.1 / 2014-10-22 -================== - - * Fix handling of pipelined requests - -2.1.0 / 2014-08-16 -================== - - * Check if `socket` is detached - * Return `undefined` for `isFinished` if state unknown - -2.0.0 / 2014-08-16 -================== - - * Add `isFinished` function - * Move to `jshttp` organization - * Remove support for plain socket argument - * Rename to `on-finished` - * Support both `req` and `res` as arguments - * deps: ee-first@1.0.5 - -1.2.2 / 2014-06-10 -================== - - * Reduce listeners added to emitters - - avoids "event emitter leak" warnings when used multiple times on same request - -1.2.1 / 2014-06-08 -================== - - * Fix returned value when already finished - -1.2.0 / 2014-06-05 -================== - - * Call callback when called on already-finished socket - -1.1.4 / 2014-05-27 -================== - - * Support node.js 0.8 - -1.1.3 / 2014-04-30 -================== - - * Make sure errors passed as instanceof `Error` - -1.1.2 / 2014-04-18 -================== - - * Default the `socket` to passed-in object - -1.1.1 / 2014-01-16 -================== - - * Rename module to `finished` - -1.1.0 / 2013-12-25 -================== - - * Call callback when called on already-errored socket - -1.0.1 / 2013-12-20 -================== - - * Actually pass the error to the callback - -1.0.0 / 2013-12-20 -================== - - * Initial release diff --git a/node_modules/express/node_modules/on-finished/LICENSE b/node_modules/express/node_modules/on-finished/LICENSE deleted file mode 100644 index 5931fd2..0000000 --- a/node_modules/express/node_modules/on-finished/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -(The MIT License) - -Copyright (c) 2013 Jonathan Ong -Copyright (c) 2014 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/express/node_modules/on-finished/README.md b/node_modules/express/node_modules/on-finished/README.md deleted file mode 100644 index a0e1157..0000000 --- a/node_modules/express/node_modules/on-finished/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# on-finished - -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Node.js Version][node-version-image]][node-version-url] -[![Build Status][travis-image]][travis-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -Execute a callback when a HTTP request closes, finishes, or errors. - -## Install - -```sh -$ npm install on-finished -``` - -## API - -```js -var onFinished = require('on-finished') -``` - -### onFinished(res, listener) - -Attach a listener to listen for the response to finish. The listener will -be invoked only once when the response finished. If the response finished -to an error, the first argument will contain the error. If the response -has already finished, the listener will be invoked. - -Listening to the end of a response would be used to close things associated -with the response, like open files. - -Listener is invoked as `listener(err, res)`. - -```js -onFinished(res, function (err, res) { - // clean up open fds, etc. - // err contains the error is request error'd -}) -``` - -### onFinished(req, listener) - -Attach a listener to listen for the request to finish. The listener will -be invoked only once when the request finished. If the request finished -to an error, the first argument will contain the error. If the request -has already finished, the listener will be invoked. - -Listening to the end of a request would be used to know when to continue -after reading the data. - -Listener is invoked as `listener(err, req)`. - -```js -var data = '' - -req.setEncoding('utf8') -res.on('data', function (str) { - data += str -}) - -onFinished(req, function (err, req) { - // data is read unless there is err -}) -``` - -### onFinished.isFinished(res) - -Determine if `res` is already finished. This would be useful to check and -not even start certain operations if the response has already finished. - -### onFinished.isFinished(req) - -Determine if `req` is already finished. This would be useful to check and -not even start certain operations if the request has already finished. - -## Special Node.js requests - -### HTTP CONNECT method - -The meaning of the `CONNECT` method from RFC 7231, section 4.3.6: - -> The CONNECT method requests that the recipient establish a tunnel to -> the destination origin server identified by the request-target and, -> if successful, thereafter restrict its behavior to blind forwarding -> of packets, in both directions, until the tunnel is closed. Tunnels -> are commonly used to create an end-to-end virtual connection, through -> one or more proxies, which can then be secured using TLS (Transport -> Layer Security, [RFC5246]). - -In Node.js, these request objects come from the `'connect'` event on -the HTTP server. - -When this module is used on a HTTP `CONNECT` request, the request is -considered "finished" immediately, **due to limitations in the Node.js -interface**. This means if the `CONNECT` request contains a request entity, -the request will be considered "finished" even before it has been read. - -There is no such thing as a response object to a `CONNECT` request in -Node.js, so there is no support for for one. - -### HTTP Upgrade request - -The meaning of the `Upgrade` header from RFC 7230, section 6.1: - -> The "Upgrade" header field is intended to provide a simple mechanism -> for transitioning from HTTP/1.1 to some other protocol on the same -> connection. - -In Node.js, these request objects come from the `'upgrade'` event on -the HTTP server. - -When this module is used on a HTTP request with an `Upgrade` header, the -request is considered "finished" immediately, **due to limitations in the -Node.js interface**. This means if the `Upgrade` request contains a request -entity, the request will be considered "finished" even before it has been -read. - -There is no such thing as a response object to a `Upgrade` request in -Node.js, so there is no support for for one. - -## Example - -The following code ensures that file descriptors are always closed -once the response finishes. - -```js -var destroy = require('destroy') -var http = require('http') -var onFinished = require('on-finished') - -http.createServer(function onRequest(req, res) { - var stream = fs.createReadStream('package.json') - stream.pipe(res) - onFinished(res, function (err) { - destroy(stream) - }) -}) -``` - -## License - -[MIT](LICENSE) - -[npm-image]: https://img.shields.io/npm/v/on-finished.svg -[npm-url]: https://npmjs.org/package/on-finished -[node-version-image]: https://img.shields.io/node/v/on-finished.svg -[node-version-url]: http://nodejs.org/download/ -[travis-image]: https://img.shields.io/travis/jshttp/on-finished/master.svg -[travis-url]: https://travis-ci.org/jshttp/on-finished -[coveralls-image]: https://img.shields.io/coveralls/jshttp/on-finished/master.svg -[coveralls-url]: https://coveralls.io/r/jshttp/on-finished?branch=master -[downloads-image]: https://img.shields.io/npm/dm/on-finished.svg -[downloads-url]: https://npmjs.org/package/on-finished diff --git a/node_modules/express/node_modules/on-finished/index.js b/node_modules/express/node_modules/on-finished/index.js deleted file mode 100644 index 9abd98f..0000000 --- a/node_modules/express/node_modules/on-finished/index.js +++ /dev/null @@ -1,196 +0,0 @@ -/*! - * on-finished - * Copyright(c) 2013 Jonathan Ong - * Copyright(c) 2014 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module exports. - * @public - */ - -module.exports = onFinished -module.exports.isFinished = isFinished - -/** - * Module dependencies. - * @private - */ - -var first = require('ee-first') - -/** - * Variables. - * @private - */ - -/* istanbul ignore next */ -var defer = typeof setImmediate === 'function' - ? setImmediate - : function(fn){ process.nextTick(fn.bind.apply(fn, arguments)) } - -/** - * Invoke callback when the response has finished, useful for - * cleaning up resources afterwards. - * - * @param {object} msg - * @param {function} listener - * @return {object} - * @public - */ - -function onFinished(msg, listener) { - if (isFinished(msg) !== false) { - defer(listener, null, msg) - return msg - } - - // attach the listener to the message - attachListener(msg, listener) - - return msg -} - -/** - * Determine if message is already finished. - * - * @param {object} msg - * @return {boolean} - * @public - */ - -function isFinished(msg) { - var socket = msg.socket - - if (typeof msg.finished === 'boolean') { - // OutgoingMessage - return Boolean(msg.finished || (socket && !socket.writable)) - } - - if (typeof msg.complete === 'boolean') { - // IncomingMessage - return Boolean(msg.upgrade || !socket || !socket.readable || (msg.complete && !msg.readable)) - } - - // don't know - return undefined -} - -/** - * Attach a finished listener to the message. - * - * @param {object} msg - * @param {function} callback - * @private - */ - -function attachFinishedListener(msg, callback) { - var eeMsg - var eeSocket - var finished = false - - function onFinish(error) { - eeMsg.cancel() - eeSocket.cancel() - - finished = true - callback(error) - } - - // finished on first message event - eeMsg = eeSocket = first([[msg, 'end', 'finish']], onFinish) - - function onSocket(socket) { - // remove listener - msg.removeListener('socket', onSocket) - - if (finished) return - if (eeMsg !== eeSocket) return - - // finished on first socket event - eeSocket = first([[socket, 'error', 'close']], onFinish) - } - - if (msg.socket) { - // socket already assigned - onSocket(msg.socket) - return - } - - // wait for socket to be assigned - msg.on('socket', onSocket) - - if (msg.socket === undefined) { - // node.js 0.8 patch - patchAssignSocket(msg, onSocket) - } -} - -/** - * Attach the listener to the message. - * - * @param {object} msg - * @return {function} - * @private - */ - -function attachListener(msg, listener) { - var attached = msg.__onFinished - - // create a private single listener with queue - if (!attached || !attached.queue) { - attached = msg.__onFinished = createListener(msg) - attachFinishedListener(msg, attached) - } - - attached.queue.push(listener) -} - -/** - * Create listener on message. - * - * @param {object} msg - * @return {function} - * @private - */ - -function createListener(msg) { - function listener(err) { - if (msg.__onFinished === listener) msg.__onFinished = null - if (!listener.queue) return - - var queue = listener.queue - listener.queue = null - - for (var i = 0; i < queue.length; i++) { - queue[i](err, msg) - } - } - - listener.queue = [] - - return listener -} - -/** - * Patch ServerResponse.prototype.assignSocket for node.js 0.8. - * - * @param {ServerResponse} res - * @param {function} callback - * @private - */ - -function patchAssignSocket(res, callback) { - var assignSocket = res.assignSocket - - if (typeof assignSocket !== 'function') return - - // res.on('socket', callback) is broken in 0.8 - res.assignSocket = function _assignSocket(socket) { - assignSocket.call(this, socket) - callback(socket) - } -} diff --git a/node_modules/express/node_modules/on-finished/package.json b/node_modules/express/node_modules/on-finished/package.json deleted file mode 100644 index b9df1bd..0000000 --- a/node_modules/express/node_modules/on-finished/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "on-finished", - "description": "Execute a callback when a request closes, finishes, or errors", - "version": "2.3.0", - "contributors": [ - "Douglas Christopher Wilson ", - "Jonathan Ong (http://jongleberry.com)" - ], - "license": "MIT", - "repository": "jshttp/on-finished", - "dependencies": { - "ee-first": "1.1.1" - }, - "devDependencies": { - "istanbul": "0.3.9", - "mocha": "2.2.5" - }, - "engines": { - "node": ">= 0.8" - }, - "files": [ - "HISTORY.md", - "LICENSE", - "index.js" - ], - "scripts": { - "test": "mocha --reporter spec --bail --check-leaks test/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" - } -} diff --git a/node_modules/express/node_modules/path-is-absolute/index.js b/node_modules/express/node_modules/path-is-absolute/index.js deleted file mode 100644 index 19f103f..0000000 --- a/node_modules/express/node_modules/path-is-absolute/index.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -function posix(path) { - return path.charAt(0) === '/'; -}; - -function win32(path) { - // https://github.com/joyent/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56 - var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; - var result = splitDeviceRe.exec(path); - var device = result[1] || ''; - var isUnc = !!device && device.charAt(1) !== ':'; - - // UNC paths are always absolute - return !!result[2] || isUnc; -}; - -module.exports = process.platform === 'win32' ? win32 : posix; -module.exports.posix = posix; -module.exports.win32 = win32; diff --git a/node_modules/express/node_modules/path-is-absolute/license b/node_modules/express/node_modules/path-is-absolute/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/express/node_modules/path-is-absolute/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -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/express/node_modules/path-is-absolute/package.json b/node_modules/express/node_modules/path-is-absolute/package.json deleted file mode 100644 index ddc0127..0000000 --- a/node_modules/express/node_modules/path-is-absolute/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "path-is-absolute", - "version": "1.0.0", - "description": "Node.js 0.12 path.isAbsolute() ponyfill", - "license": "MIT", - "repository": "sindresorhus/path-is-absolute", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "node test.js" - }, - "files": [ - "index.js" - ], - "keywords": [ - "path", - "paths", - "file", - "dir", - "absolute", - "isabsolute", - "is-absolute", - "built-in", - "util", - "utils", - "core", - "ponyfill", - "polyfill", - "shim", - "is", - "detect", - "check" - ] -} diff --git a/node_modules/express/node_modules/path-is-absolute/readme.md b/node_modules/express/node_modules/path-is-absolute/readme.md deleted file mode 100644 index cdf94f4..0000000 --- a/node_modules/express/node_modules/path-is-absolute/readme.md +++ /dev/null @@ -1,51 +0,0 @@ -# path-is-absolute [![Build Status](https://travis-ci.org/sindresorhus/path-is-absolute.svg?branch=master)](https://travis-ci.org/sindresorhus/path-is-absolute) - -> Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) ponyfill - -> Ponyfill: A polyfill that doesn't overwrite the native method - - -## Install - -``` -$ npm install --save path-is-absolute -``` - - -## Usage - -```js -var pathIsAbsolute = require('path-is-absolute'); - -// Linux -pathIsAbsolute('/home/foo'); -//=> true - -// Windows -pathIsAbsolute('C:/Users/'); -//=> true - -// Any OS -pathIsAbsolute.posix('/home/foo'); -//=> true -``` - - -## API - -See the [`path.isAbsolute()` docs](http://nodejs.org/api/path.html#path_path_isabsolute_path). - -### pathIsAbsolute(path) - -### pathIsAbsolute.posix(path) - -The Posix specific version. - -### pathIsAbsolute.win32(path) - -The Windows specific version. - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/express/node_modules/qs/.eslintignore b/node_modules/express/node_modules/qs/.eslintignore deleted file mode 100644 index 1521c8b..0000000 --- a/node_modules/express/node_modules/qs/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -dist diff --git a/node_modules/express/node_modules/qs/.npmignore b/node_modules/express/node_modules/qs/.npmignore deleted file mode 100644 index 2abba8d..0000000 --- a/node_modules/express/node_modules/qs/.npmignore +++ /dev/null @@ -1,19 +0,0 @@ -.idea -*.iml -npm-debug.log -dump.rdb -node_modules -results.tap -results.xml -npm-shrinkwrap.json -config.json -.DS_Store -*/.DS_Store -*/*/.DS_Store -._* -*/._* -*/*/._* -coverage.* -lib-cov -complexity.md -dist diff --git a/node_modules/express/node_modules/qs/.travis.yml b/node_modules/express/node_modules/qs/.travis.yml deleted file mode 100644 index f502178..0000000 --- a/node_modules/express/node_modules/qs/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js - -node_js: - - 0.10 - - 0.12 - - iojs diff --git a/node_modules/express/node_modules/qs/CHANGELOG.md b/node_modules/express/node_modules/qs/CHANGELOG.md deleted file mode 100644 index 1fadc78..0000000 --- a/node_modules/express/node_modules/qs/CHANGELOG.md +++ /dev/null @@ -1,88 +0,0 @@ - -## [**3.1.0**](https://github.com/hapijs/qs/issues?milestone=24&state=open) -- [**#89**](https://github.com/hapijs/qs/issues/89) Add option to disable "Transform dot notation to bracket notation" - -## [**3.0.0**](https://github.com/hapijs/qs/issues?milestone=23&state=closed) -- [**#77**](https://github.com/hapijs/qs/issues/77) Perf boost -- [**#60**](https://github.com/hapijs/qs/issues/60) Add explicit option to disable array parsing -- [**#80**](https://github.com/hapijs/qs/issues/80) qs.parse silently drops properties -- [**#74**](https://github.com/hapijs/qs/issues/74) Bad parse when turning array into object -- [**#81**](https://github.com/hapijs/qs/issues/81) Add a `filter` option -- [**#68**](https://github.com/hapijs/qs/issues/68) Fixed issue with recursion and passing strings into objects. -- [**#66**](https://github.com/hapijs/qs/issues/66) Add mixed array and object dot notation support Closes: #47 -- [**#76**](https://github.com/hapijs/qs/issues/76) RFC 3986 -- [**#85**](https://github.com/hapijs/qs/issues/85) No equal sign -- [**#84**](https://github.com/hapijs/qs/issues/84) update license attribute - -## [**2.4.1**](https://github.com/hapijs/qs/issues?milestone=20&state=closed) -- [**#73**](https://github.com/hapijs/qs/issues/73) Property 'hasOwnProperty' of object # is not a function - -## [**2.4.0**](https://github.com/hapijs/qs/issues?milestone=19&state=closed) -- [**#70**](https://github.com/hapijs/qs/issues/70) Add arrayFormat option - -## [**2.3.3**](https://github.com/hapijs/qs/issues?milestone=18&state=closed) -- [**#59**](https://github.com/hapijs/qs/issues/59) make sure array indexes are >= 0, closes #57 -- [**#58**](https://github.com/hapijs/qs/issues/58) make qs usable for browser loader - -## [**2.3.2**](https://github.com/hapijs/qs/issues?milestone=17&state=closed) -- [**#55**](https://github.com/hapijs/qs/issues/55) allow merging a string into an object - -## [**2.3.1**](https://github.com/hapijs/qs/issues?milestone=16&state=closed) -- [**#52**](https://github.com/hapijs/qs/issues/52) Return "undefined" and "false" instead of throwing "TypeError". - -## [**2.3.0**](https://github.com/hapijs/qs/issues?milestone=15&state=closed) -- [**#50**](https://github.com/hapijs/qs/issues/50) add option to omit array indices, closes #46 - -## [**2.2.5**](https://github.com/hapijs/qs/issues?milestone=14&state=closed) -- [**#39**](https://github.com/hapijs/qs/issues/39) Is there an alternative to Buffer.isBuffer? -- [**#49**](https://github.com/hapijs/qs/issues/49) refactor utils.merge, fixes #45 -- [**#41**](https://github.com/hapijs/qs/issues/41) avoid browserifying Buffer, for #39 - -## [**2.2.4**](https://github.com/hapijs/qs/issues?milestone=13&state=closed) -- [**#38**](https://github.com/hapijs/qs/issues/38) how to handle object keys beginning with a number - -## [**2.2.3**](https://github.com/hapijs/qs/issues?milestone=12&state=closed) -- [**#37**](https://github.com/hapijs/qs/issues/37) parser discards first empty value in array -- [**#36**](https://github.com/hapijs/qs/issues/36) Update to lab 4.x - -## [**2.2.2**](https://github.com/hapijs/qs/issues?milestone=11&state=closed) -- [**#33**](https://github.com/hapijs/qs/issues/33) Error when plain object in a value -- [**#34**](https://github.com/hapijs/qs/issues/34) use Object.prototype.hasOwnProperty.call instead of obj.hasOwnProperty -- [**#24**](https://github.com/hapijs/qs/issues/24) Changelog? Semver? - -## [**2.2.1**](https://github.com/hapijs/qs/issues?milestone=10&state=closed) -- [**#32**](https://github.com/hapijs/qs/issues/32) account for circular references properly, closes #31 -- [**#31**](https://github.com/hapijs/qs/issues/31) qs.parse stackoverflow on circular objects - -## [**2.2.0**](https://github.com/hapijs/qs/issues?milestone=9&state=closed) -- [**#26**](https://github.com/hapijs/qs/issues/26) Don't use Buffer global if it's not present -- [**#30**](https://github.com/hapijs/qs/issues/30) Bug when merging non-object values into arrays -- [**#29**](https://github.com/hapijs/qs/issues/29) Don't call Utils.clone at the top of Utils.merge -- [**#23**](https://github.com/hapijs/qs/issues/23) Ability to not limit parameters? - -## [**2.1.0**](https://github.com/hapijs/qs/issues?milestone=8&state=closed) -- [**#22**](https://github.com/hapijs/qs/issues/22) Enable using a RegExp as delimiter - -## [**2.0.0**](https://github.com/hapijs/qs/issues?milestone=7&state=closed) -- [**#18**](https://github.com/hapijs/qs/issues/18) Why is there arrayLimit? -- [**#20**](https://github.com/hapijs/qs/issues/20) Configurable parametersLimit -- [**#21**](https://github.com/hapijs/qs/issues/21) make all limits optional, for #18, for #20 - -## [**1.2.2**](https://github.com/hapijs/qs/issues?milestone=6&state=closed) -- [**#19**](https://github.com/hapijs/qs/issues/19) Don't overwrite null values - -## [**1.2.1**](https://github.com/hapijs/qs/issues?milestone=5&state=closed) -- [**#16**](https://github.com/hapijs/qs/issues/16) ignore non-string delimiters -- [**#15**](https://github.com/hapijs/qs/issues/15) Close code block - -## [**1.2.0**](https://github.com/hapijs/qs/issues?milestone=4&state=closed) -- [**#12**](https://github.com/hapijs/qs/issues/12) Add optional delim argument -- [**#13**](https://github.com/hapijs/qs/issues/13) fix #11: flattened keys in array are now correctly parsed - -## [**1.1.0**](https://github.com/hapijs/qs/issues?milestone=3&state=closed) -- [**#7**](https://github.com/hapijs/qs/issues/7) Empty values of a POST array disappear after being submitted -- [**#9**](https://github.com/hapijs/qs/issues/9) Should not omit equals signs (=) when value is null -- [**#6**](https://github.com/hapijs/qs/issues/6) Minor grammar fix in README - -## [**1.0.2**](https://github.com/hapijs/qs/issues?milestone=2&state=closed) -- [**#5**](https://github.com/hapijs/qs/issues/5) array holes incorrectly copied into object on large index diff --git a/node_modules/express/node_modules/qs/CONTRIBUTING.md b/node_modules/express/node_modules/qs/CONTRIBUTING.md deleted file mode 100644 index 8928361..0000000 --- a/node_modules/express/node_modules/qs/CONTRIBUTING.md +++ /dev/null @@ -1 +0,0 @@ -Please view our [hapijs contributing guide](https://github.com/hapijs/hapi/blob/master/CONTRIBUTING.md). diff --git a/node_modules/express/node_modules/qs/LICENSE b/node_modules/express/node_modules/qs/LICENSE deleted file mode 100644 index d456948..0000000 --- a/node_modules/express/node_modules/qs/LICENSE +++ /dev/null @@ -1,28 +0,0 @@ -Copyright (c) 2014 Nathan LaFreniere and other contributors. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * 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. - * The names of any contributors may not be used to endorse or promote - products derived from this software without specific prior written - permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 COPYRIGHT HOLDERS AND CONTRIBUTORS 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. - - * * * - -The complete list of contributors can be found at: https://github.com/hapijs/qs/graphs/contributors diff --git a/node_modules/express/node_modules/qs/README.md b/node_modules/express/node_modules/qs/README.md deleted file mode 100644 index 48a0de9..0000000 --- a/node_modules/express/node_modules/qs/README.md +++ /dev/null @@ -1,317 +0,0 @@ -# qs - -A querystring parsing and stringifying library with some added security. - -[![Build Status](https://secure.travis-ci.org/hapijs/qs.svg)](http://travis-ci.org/hapijs/qs) - -Lead Maintainer: [Nathan LaFreniere](https://github.com/nlf) - -The **qs** module was originally created and maintained by [TJ Holowaychuk](https://github.com/visionmedia/node-querystring). - -## Usage - -```javascript -var Qs = require('qs'); - -var obj = Qs.parse('a=c'); // { a: 'c' } -var str = Qs.stringify(obj); // 'a=c' -``` - -### Parsing Objects - -```javascript -Qs.parse(string, [options]); -``` - -**qs** allows you to create nested objects within your query strings, by surrounding the name of sub-keys with square brackets `[]`, or prefixing the sub-key with a dot `.`. -For example, the string `'foo[bar]=baz'` converts to: - -```javascript -{ - foo: { - bar: 'baz' - } -} -``` - -When using the `plainObjects` option the parsed value is returned as a plain object, created via `Object.create(null)` and as such you should be aware that prototype methods will not exist on it and a user may set those names to whatever value they like: - -```javascript -Qs.parse('a.hasOwnProperty=b', { plainObjects: true }); -// { a: { hasOwnProperty: 'b' } } -``` - -By default parameters that would overwrite properties on the object prototype are ignored, if you wish to keep the data from those fields either use `plainObjects` as mentioned above, or set `allowPrototypes` to `true` which will allow user input to overwrite those properties. *WARNING* It is generally a bad idea to enable this option as it can cause problems when attempting to use the properties that have been overwritten. Always be careful with this option. - -```javascript -Qs.parse('a.hasOwnProperty=b', { allowPrototypes: true }); -// { a: { hasOwnProperty: 'b' } } -``` - -URI encoded strings work too: - -```javascript -Qs.parse('a%5Bb%5D=c'); -// { a: { b: 'c' } } -``` - -You can also nest your objects, like `'foo[bar][baz]=foobarbaz'`: - -```javascript -{ - foo: { - bar: { - baz: 'foobarbaz' - } - } -} -``` - -By default, when nesting objects **qs** will only parse up to 5 children deep. This means if you attempt to parse a string like -`'a[b][c][d][e][f][g][h][i]=j'` your resulting object will be: - -```javascript -{ - a: { - b: { - c: { - d: { - e: { - f: { - '[g][h][i]': 'j' - } - } - } - } - } - } -} -``` - -This depth can be overridden by passing a `depth` option to `Qs.parse(string, [options])`: - -```javascript -Qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 }); -// { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } } -``` - -The depth limit helps mitigate abuse when **qs** is used to parse user input, and it is recommended to keep it a reasonably small number. - -For similar reasons, by default **qs** will only parse up to 1000 parameters. This can be overridden by passing a `parameterLimit` option: - -```javascript -Qs.parse('a=b&c=d', { parameterLimit: 1 }); -// { a: 'b' } -``` - -An optional delimiter can also be passed: - -```javascript -Qs.parse('a=b;c=d', { delimiter: ';' }); -// { a: 'b', c: 'd' } -``` - -Delimiters can be a regular expression too: - -```javascript -Qs.parse('a=b;c=d,e=f', { delimiter: /[;,]/ }); -// { a: 'b', c: 'd', e: 'f' } -``` - -Option `allowDots` can be used to disable dot notation: - -```javascript -Qs.parse('a.b=c', { allowDots: false }); -// { 'a.b': 'c' } } -``` - -### Parsing Arrays - -**qs** can also parse arrays using a similar `[]` notation: - -```javascript -Qs.parse('a[]=b&a[]=c'); -// { a: ['b', 'c'] } -``` - -You may specify an index as well: - -```javascript -Qs.parse('a[1]=c&a[0]=b'); -// { a: ['b', 'c'] } -``` - -Note that the only difference between an index in an array and a key in an object is that the value between the brackets must be a number -to create an array. When creating arrays with specific indices, **qs** will compact a sparse array to only the existing values preserving -their order: - -```javascript -Qs.parse('a[1]=b&a[15]=c'); -// { a: ['b', 'c'] } -``` - -Note that an empty string is also a value, and will be preserved: - -```javascript -Qs.parse('a[]=&a[]=b'); -// { a: ['', 'b'] } -Qs.parse('a[0]=b&a[1]=&a[2]=c'); -// { a: ['b', '', 'c'] } -``` - -**qs** will also limit specifying indices in an array to a maximum index of `20`. Any array members with an index of greater than `20` will -instead be converted to an object with the index as the key: - -```javascript -Qs.parse('a[100]=b'); -// { a: { '100': 'b' } } -``` - -This limit can be overridden by passing an `arrayLimit` option: - -```javascript -Qs.parse('a[1]=b', { arrayLimit: 0 }); -// { a: { '1': 'b' } } -``` - -To disable array parsing entirely, set `parseArrays` to `false`. - -```javascript -Qs.parse('a[]=b', { parseArrays: false }); -// { a: { '0': 'b' } } -``` - -If you mix notations, **qs** will merge the two items into an object: - -```javascript -Qs.parse('a[0]=b&a[b]=c'); -// { a: { '0': 'b', b: 'c' } } -``` - -You can also create arrays of objects: - -```javascript -Qs.parse('a[][b]=c'); -// { a: [{ b: 'c' }] } -``` - -### Stringifying - -```javascript -Qs.stringify(object, [options]); -``` - -When stringifying, **qs** always URI encodes output. Objects are stringified as you would expect: - -```javascript -Qs.stringify({ a: 'b' }); -// 'a=b' -Qs.stringify({ a: { b: 'c' } }); -// 'a%5Bb%5D=c' -``` - -Examples beyond this point will be shown as though the output is not URI encoded for clarity. Please note that the return values in these cases *will* be URI encoded during real usage. - -When arrays are stringified, by default they are given explicit indices: - -```javascript -Qs.stringify({ a: ['b', 'c', 'd'] }); -// 'a[0]=b&a[1]=c&a[2]=d' -``` - -You may override this by setting the `indices` option to `false`: - -```javascript -Qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false }); -// 'a=b&a=c&a=d' -``` - -You may use the `arrayFormat` option to specify the format of the output array - -```javascript -Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' }) -// 'a[0]=b&a[1]=c' -Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' }) -// 'a[]=b&a[]=c' -Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' }) -// 'a=b&a=c' -``` - -Empty strings and null values will omit the value, but the equals sign (=) remains in place: - -```javascript -Qs.stringify({ a: '' }); -// 'a=' -``` - -Properties that are set to `undefined` will be omitted entirely: - -```javascript -Qs.stringify({ a: null, b: undefined }); -// 'a=' -``` - -The delimiter may be overridden with stringify as well: - -```javascript -Qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }); -// 'a=b;c=d' -``` - -Finally, you can use the `filter` option to restrict which keys will be included in the stringified output. -If you pass a function, it will be called for each key to obtain the replacement value. Otherwise, if you -pass an array, it will be used to select properties and array indices for stringification: - -```javascript -function filterFunc(prefix, value) { - if (prefix == 'b') { - // Return an `undefined` value to omit a property. - return; - } - if (prefix == 'e[f]') { - return value.getTime(); - } - if (prefix == 'e[g][0]') { - return value * 2; - } - return value; -} -Qs.stringify({ a: 'b', c: 'd', e: { f: new Date(123), g: [2] } }, { filter: filterFunc }) -// 'a=b&c=d&e[f]=123&e[g][0]=4' -Qs.stringify({ a: 'b', c: 'd', e: 'f' }, { filter: ['a', 'e'] }) -// 'a=b&e=f' -Qs.stringify({ a: ['b', 'c', 'd'], e: 'f' }, { filter: ['a', 0, 2] }) -// 'a[0]=b&a[2]=d' -``` - -### Handling of `null` values - -By default, `null` values are treated like empty strings: - -```javascript -Qs.stringify({ a: null, b: '' }); -// 'a=&b=' -``` - -Parsing does not distinguish between parameters with and without equal signs. Both are converted to empty strings. - -```javascript -Qs.parse('a&b=') -// { a: '', b: '' } -``` - -To distinguish between `null` values and empty strings use the `strictNullHandling` flag. In the result string the `null` -values have no `=` sign: - -```javascript -Qs.stringify({ a: null, b: '' }, { strictNullHandling: true }); -// 'a&b=' -``` - -To parse values without `=` back to `null` use the `strictNullHandling` flag: - -```javascript -Qs.parse('a&b=', { strictNullHandling: true }); -// { a: null, b: '' } - -``` diff --git a/node_modules/express/node_modules/qs/bower.json b/node_modules/express/node_modules/qs/bower.json deleted file mode 100644 index ffd0641..0000000 --- a/node_modules/express/node_modules/qs/bower.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "qs", - "main": "dist/qs.js", - "version": "3.0.0", - "homepage": "https://github.com/hapijs/qs", - "authors": [ - "Nathan LaFreniere " - ], - "description": "A querystring parser that supports nesting and arrays, with a depth limit", - "keywords": [ - "querystring", - "qs" - ], - "license": "BSD-3-Clause", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ] -} diff --git a/node_modules/express/node_modules/qs/lib/index.js b/node_modules/express/node_modules/qs/lib/index.js deleted file mode 100644 index 0e09493..0000000 --- a/node_modules/express/node_modules/qs/lib/index.js +++ /dev/null @@ -1,15 +0,0 @@ -// Load modules - -var Stringify = require('./stringify'); -var Parse = require('./parse'); - - -// Declare internals - -var internals = {}; - - -module.exports = { - stringify: Stringify, - parse: Parse -}; diff --git a/node_modules/express/node_modules/qs/lib/parse.js b/node_modules/express/node_modules/qs/lib/parse.js deleted file mode 100644 index e7c56c5..0000000 --- a/node_modules/express/node_modules/qs/lib/parse.js +++ /dev/null @@ -1,186 +0,0 @@ -// Load modules - -var Utils = require('./utils'); - - -// Declare internals - -var internals = { - delimiter: '&', - depth: 5, - arrayLimit: 20, - parameterLimit: 1000, - strictNullHandling: false, - plainObjects: false, - allowPrototypes: false -}; - - -internals.parseValues = function (str, options) { - - var obj = {}; - var parts = str.split(options.delimiter, options.parameterLimit === Infinity ? undefined : options.parameterLimit); - - for (var i = 0, il = parts.length; i < il; ++i) { - var part = parts[i]; - var pos = part.indexOf(']=') === -1 ? part.indexOf('=') : part.indexOf(']=') + 1; - - if (pos === -1) { - obj[Utils.decode(part)] = ''; - - if (options.strictNullHandling) { - obj[Utils.decode(part)] = null; - } - } - else { - var key = Utils.decode(part.slice(0, pos)); - var val = Utils.decode(part.slice(pos + 1)); - - if (!Object.prototype.hasOwnProperty.call(obj, key)) { - obj[key] = val; - } - else { - obj[key] = [].concat(obj[key]).concat(val); - } - } - } - - return obj; -}; - - -internals.parseObject = function (chain, val, options) { - - if (!chain.length) { - return val; - } - - var root = chain.shift(); - - var obj; - if (root === '[]') { - obj = []; - obj = obj.concat(internals.parseObject(chain, val, options)); - } - else { - obj = options.plainObjects ? Object.create(null) : {}; - var cleanRoot = root[0] === '[' && root[root.length - 1] === ']' ? root.slice(1, root.length - 1) : root; - var index = parseInt(cleanRoot, 10); - var indexString = '' + index; - if (!isNaN(index) && - root !== cleanRoot && - indexString === cleanRoot && - index >= 0 && - (options.parseArrays && - index <= options.arrayLimit)) { - - obj = []; - obj[index] = internals.parseObject(chain, val, options); - } - else { - obj[cleanRoot] = internals.parseObject(chain, val, options); - } - } - - return obj; -}; - - -internals.parseKeys = function (key, val, options) { - - if (!key) { - return; - } - - // Transform dot notation to bracket notation - - if (options.allowDots) { - key = key.replace(/\.([^\.\[]+)/g, '[$1]'); - } - - // The regex chunks - - var parent = /^([^\[\]]*)/; - var child = /(\[[^\[\]]*\])/g; - - // Get the parent - - var segment = parent.exec(key); - - // Stash the parent if it exists - - var keys = []; - if (segment[1]) { - // If we aren't using plain objects, optionally prefix keys - // that would overwrite object prototype properties - if (!options.plainObjects && - Object.prototype.hasOwnProperty(segment[1])) { - - if (!options.allowPrototypes) { - return; - } - } - - keys.push(segment[1]); - } - - // Loop through children appending to the array until we hit depth - - var i = 0; - while ((segment = child.exec(key)) !== null && i < options.depth) { - - ++i; - if (!options.plainObjects && - Object.prototype.hasOwnProperty(segment[1].replace(/\[|\]/g, ''))) { - - if (!options.allowPrototypes) { - continue; - } - } - keys.push(segment[1]); - } - - // If there's a remainder, just add whatever is left - - if (segment) { - keys.push('[' + key.slice(segment.index) + ']'); - } - - return internals.parseObject(keys, val, options); -}; - - -module.exports = function (str, options) { - - options = options || {}; - options.delimiter = typeof options.delimiter === 'string' || Utils.isRegExp(options.delimiter) ? options.delimiter : internals.delimiter; - options.depth = typeof options.depth === 'number' ? options.depth : internals.depth; - options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : internals.arrayLimit; - options.parseArrays = options.parseArrays !== false; - options.allowDots = options.allowDots !== false; - options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : internals.plainObjects; - options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : internals.allowPrototypes; - options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : internals.parameterLimit; - options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : internals.strictNullHandling; - - if (str === '' || - str === null || - typeof str === 'undefined') { - - return options.plainObjects ? Object.create(null) : {}; - } - - var tempObj = typeof str === 'string' ? internals.parseValues(str, options) : str; - var obj = options.plainObjects ? Object.create(null) : {}; - - // Iterate over the keys and setup the new object - - var keys = Object.keys(tempObj); - for (var i = 0, il = keys.length; i < il; ++i) { - var key = keys[i]; - var newObj = internals.parseKeys(key, tempObj[key], options); - obj = Utils.merge(obj, newObj, options); - } - - return Utils.compact(obj); -}; diff --git a/node_modules/express/node_modules/qs/lib/stringify.js b/node_modules/express/node_modules/qs/lib/stringify.js deleted file mode 100644 index 7414284..0000000 --- a/node_modules/express/node_modules/qs/lib/stringify.js +++ /dev/null @@ -1,121 +0,0 @@ -// Load modules - -var Utils = require('./utils'); - - -// Declare internals - -var internals = { - delimiter: '&', - arrayPrefixGenerators: { - brackets: function (prefix, key) { - - return prefix + '[]'; - }, - indices: function (prefix, key) { - - return prefix + '[' + key + ']'; - }, - repeat: function (prefix, key) { - - return prefix; - } - }, - strictNullHandling: false -}; - - -internals.stringify = function (obj, prefix, generateArrayPrefix, strictNullHandling, filter) { - - if (typeof filter === 'function') { - obj = filter(prefix, obj); - } - else if (Utils.isBuffer(obj)) { - obj = obj.toString(); - } - else if (obj instanceof Date) { - obj = obj.toISOString(); - } - else if (obj === null) { - if (strictNullHandling) { - return Utils.encode(prefix); - } - - obj = ''; - } - - if (typeof obj === 'string' || - typeof obj === 'number' || - typeof obj === 'boolean') { - - return [Utils.encode(prefix) + '=' + Utils.encode(obj)]; - } - - var values = []; - - if (typeof obj === 'undefined') { - return values; - } - - var objKeys = Array.isArray(filter) ? filter : Object.keys(obj); - for (var i = 0, il = objKeys.length; i < il; ++i) { - var key = objKeys[i]; - - if (Array.isArray(obj)) { - values = values.concat(internals.stringify(obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, filter)); - } - else { - values = values.concat(internals.stringify(obj[key], prefix + '[' + key + ']', generateArrayPrefix, strictNullHandling, filter)); - } - } - - return values; -}; - - -module.exports = function (obj, options) { - - options = options || {}; - var delimiter = typeof options.delimiter === 'undefined' ? internals.delimiter : options.delimiter; - var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : internals.strictNullHandling; - var objKeys; - var filter; - if (typeof options.filter === 'function') { - filter = options.filter; - obj = filter('', obj); - } - else if (Array.isArray(options.filter)) { - objKeys = filter = options.filter; - } - - var keys = []; - - if (typeof obj !== 'object' || - obj === null) { - - return ''; - } - - var arrayFormat; - if (options.arrayFormat in internals.arrayPrefixGenerators) { - arrayFormat = options.arrayFormat; - } - else if ('indices' in options) { - arrayFormat = options.indices ? 'indices' : 'repeat'; - } - else { - arrayFormat = 'indices'; - } - - var generateArrayPrefix = internals.arrayPrefixGenerators[arrayFormat]; - - if (!objKeys) { - objKeys = Object.keys(obj); - } - for (var i = 0, il = objKeys.length; i < il; ++i) { - var key = objKeys[i]; - keys = keys.concat(internals.stringify(obj[key], key, generateArrayPrefix, strictNullHandling, filter)); - } - - return keys.join(delimiter); -}; diff --git a/node_modules/express/node_modules/qs/lib/utils.js b/node_modules/express/node_modules/qs/lib/utils.js deleted file mode 100644 index 88f3147..0000000 --- a/node_modules/express/node_modules/qs/lib/utils.js +++ /dev/null @@ -1,190 +0,0 @@ -// Load modules - - -// Declare internals - -var internals = {}; -internals.hexTable = new Array(256); -for (var h = 0; h < 256; ++h) { - internals.hexTable[h] = '%' + ((h < 16 ? '0' : '') + h.toString(16)).toUpperCase(); -} - - -exports.arrayToObject = function (source, options) { - - var obj = options.plainObjects ? Object.create(null) : {}; - for (var i = 0, il = source.length; i < il; ++i) { - if (typeof source[i] !== 'undefined') { - - obj[i] = source[i]; - } - } - - return obj; -}; - - -exports.merge = function (target, source, options) { - - if (!source) { - return target; - } - - if (typeof source !== 'object') { - if (Array.isArray(target)) { - target.push(source); - } - else if (typeof target === 'object') { - target[source] = true; - } - else { - target = [target, source]; - } - - return target; - } - - if (typeof target !== 'object') { - target = [target].concat(source); - return target; - } - - if (Array.isArray(target) && - !Array.isArray(source)) { - - target = exports.arrayToObject(target, options); - } - - var keys = Object.keys(source); - for (var k = 0, kl = keys.length; k < kl; ++k) { - var key = keys[k]; - var value = source[key]; - - if (!Object.prototype.hasOwnProperty.call(target, key)) { - target[key] = value; - } - else { - target[key] = exports.merge(target[key], value, options); - } - } - - return target; -}; - - -exports.decode = function (str) { - - try { - return decodeURIComponent(str.replace(/\+/g, ' ')); - } catch (e) { - return str; - } -}; - -exports.encode = function (str) { - - // This code was originally written by Brian White (mscdex) for the io.js core querystring library. - // It has been adapted here for stricter adherence to RFC 3986 - if (str.length === 0) { - return str; - } - - if (typeof str !== 'string') { - str = '' + str; - } - - var out = ''; - for (var i = 0, il = str.length; i < il; ++i) { - var c = str.charCodeAt(i); - - if (c === 0x2D || // - - c === 0x2E || // . - c === 0x5F || // _ - c === 0x7E || // ~ - (c >= 0x30 && c <= 0x39) || // 0-9 - (c >= 0x41 && c <= 0x5A) || // a-z - (c >= 0x61 && c <= 0x7A)) { // A-Z - - out += str[i]; - continue; - } - - if (c < 0x80) { - out += internals.hexTable[c]; - continue; - } - - if (c < 0x800) { - out += internals.hexTable[0xC0 | (c >> 6)] + internals.hexTable[0x80 | (c & 0x3F)]; - continue; - } - - if (c < 0xD800 || c >= 0xE000) { - out += internals.hexTable[0xE0 | (c >> 12)] + internals.hexTable[0x80 | ((c >> 6) & 0x3F)] + internals.hexTable[0x80 | (c & 0x3F)]; - continue; - } - - ++i; - c = 0x10000 + (((c & 0x3FF) << 10) | (str.charCodeAt(i) & 0x3FF)); - out += internals.hexTable[0xF0 | (c >> 18)] + internals.hexTable[0x80 | ((c >> 12) & 0x3F)] + internals.hexTable[0x80 | ((c >> 6) & 0x3F)] + internals.hexTable[0x80 | (c & 0x3F)]; - } - - return out; -}; - -exports.compact = function (obj, refs) { - - if (typeof obj !== 'object' || - obj === null) { - - return obj; - } - - refs = refs || []; - var lookup = refs.indexOf(obj); - if (lookup !== -1) { - return refs[lookup]; - } - - refs.push(obj); - - if (Array.isArray(obj)) { - var compacted = []; - - for (var i = 0, il = obj.length; i < il; ++i) { - if (typeof obj[i] !== 'undefined') { - compacted.push(obj[i]); - } - } - - return compacted; - } - - var keys = Object.keys(obj); - for (i = 0, il = keys.length; i < il; ++i) { - var key = keys[i]; - obj[key] = exports.compact(obj[key], refs); - } - - return obj; -}; - - -exports.isRegExp = function (obj) { - - return Object.prototype.toString.call(obj) === '[object RegExp]'; -}; - - -exports.isBuffer = function (obj) { - - if (obj === null || - typeof obj === 'undefined') { - - return false; - } - - return !!(obj.constructor && - obj.constructor.isBuffer && - obj.constructor.isBuffer(obj)); -}; diff --git a/node_modules/express/node_modules/qs/package.json b/node_modules/express/node_modules/qs/package.json deleted file mode 100644 index 30184a0..0000000 --- a/node_modules/express/node_modules/qs/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "qs", - "version": "4.0.0", - "description": "A querystring parser that supports nesting and arrays, with a depth limit", - "homepage": "https://github.com/hapijs/qs", - "main": "lib/index.js", - "dependencies": {}, - "devDependencies": { - "browserify": "^10.2.1", - "code": "1.x.x", - "lab": "5.x.x" - }, - "scripts": { - "test": "lab -a code -t 100 -L", - "test-cov-html": "lab -a code -r html -o coverage.html", - "dist": "browserify --standalone Qs lib/index.js > dist/qs.js" - }, - "repository": { - "type": "git", - "url": "https://github.com/hapijs/qs.git" - }, - "keywords": [ - "querystring", - "qs" - ], - "license": "BSD-3-Clause" -} diff --git a/node_modules/express/node_modules/qs/test/parse.js b/node_modules/express/node_modules/qs/test/parse.js deleted file mode 100644 index a19d764..0000000 --- a/node_modules/express/node_modules/qs/test/parse.js +++ /dev/null @@ -1,478 +0,0 @@ -/* eslint no-extend-native:0 */ -// Load modules - -var Code = require('code'); -var Lab = require('lab'); -var Qs = require('../'); - - -// Declare internals - -var internals = {}; - - -// Test shortcuts - -var lab = exports.lab = Lab.script(); -var expect = Code.expect; -var describe = lab.experiment; -var it = lab.test; - - -describe('parse()', function () { - - it('parses a simple string', function (done) { - - expect(Qs.parse('0=foo')).to.deep.equal({ '0': 'foo' }); - expect(Qs.parse('foo=c++')).to.deep.equal({ foo: 'c ' }); - expect(Qs.parse('a[>=]=23')).to.deep.equal({ a: { '>=': '23' } }); - expect(Qs.parse('a[<=>]==23')).to.deep.equal({ a: { '<=>': '=23' } }); - expect(Qs.parse('a[==]=23')).to.deep.equal({ a: { '==': '23' } }); - expect(Qs.parse('foo', { strictNullHandling: true })).to.deep.equal({ foo: null }); - expect(Qs.parse('foo' )).to.deep.equal({ foo: '' }); - expect(Qs.parse('foo=')).to.deep.equal({ foo: '' }); - expect(Qs.parse('foo=bar')).to.deep.equal({ foo: 'bar' }); - expect(Qs.parse(' foo = bar = baz ')).to.deep.equal({ ' foo ': ' bar = baz ' }); - expect(Qs.parse('foo=bar=baz')).to.deep.equal({ foo: 'bar=baz' }); - expect(Qs.parse('foo=bar&bar=baz')).to.deep.equal({ foo: 'bar', bar: 'baz' }); - expect(Qs.parse('foo2=bar2&baz2=')).to.deep.equal({ foo2: 'bar2', baz2: '' }); - expect(Qs.parse('foo=bar&baz', { strictNullHandling: true })).to.deep.equal({ foo: 'bar', baz: null }); - expect(Qs.parse('foo=bar&baz')).to.deep.equal({ foo: 'bar', baz: '' }); - expect(Qs.parse('cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World')).to.deep.equal({ - cht: 'p3', - chd: 't:60,40', - chs: '250x100', - chl: 'Hello|World' - }); - done(); - }); - - it('allows disabling dot notation', function (done) { - - expect(Qs.parse('a.b=c')).to.deep.equal({ a: { b: 'c' } }); - expect(Qs.parse('a.b=c', { allowDots: false })).to.deep.equal({ 'a.b': 'c' }); - done(); - }); - - it('parses a single nested string', function (done) { - - expect(Qs.parse('a[b]=c')).to.deep.equal({ a: { b: 'c' } }); - done(); - }); - - it('parses a double nested string', function (done) { - - expect(Qs.parse('a[b][c]=d')).to.deep.equal({ a: { b: { c: 'd' } } }); - done(); - }); - - it('defaults to a depth of 5', function (done) { - - expect(Qs.parse('a[b][c][d][e][f][g][h]=i')).to.deep.equal({ a: { b: { c: { d: { e: { f: { '[g][h]': 'i' } } } } } } }); - done(); - }); - - it('only parses one level when depth = 1', function (done) { - - expect(Qs.parse('a[b][c]=d', { depth: 1 })).to.deep.equal({ a: { b: { '[c]': 'd' } } }); - expect(Qs.parse('a[b][c][d]=e', { depth: 1 })).to.deep.equal({ a: { b: { '[c][d]': 'e' } } }); - done(); - }); - - it('parses a simple array', function (done) { - - expect(Qs.parse('a=b&a=c')).to.deep.equal({ a: ['b', 'c'] }); - done(); - }); - - it('parses an explicit array', function (done) { - - expect(Qs.parse('a[]=b')).to.deep.equal({ a: ['b'] }); - expect(Qs.parse('a[]=b&a[]=c')).to.deep.equal({ a: ['b', 'c'] }); - expect(Qs.parse('a[]=b&a[]=c&a[]=d')).to.deep.equal({ a: ['b', 'c', 'd'] }); - done(); - }); - - it('parses a mix of simple and explicit arrays', function (done) { - - expect(Qs.parse('a=b&a[]=c')).to.deep.equal({ a: ['b', 'c'] }); - expect(Qs.parse('a[]=b&a=c')).to.deep.equal({ a: ['b', 'c'] }); - expect(Qs.parse('a[0]=b&a=c')).to.deep.equal({ a: ['b', 'c'] }); - expect(Qs.parse('a=b&a[0]=c')).to.deep.equal({ a: ['b', 'c'] }); - expect(Qs.parse('a[1]=b&a=c')).to.deep.equal({ a: ['b', 'c'] }); - expect(Qs.parse('a=b&a[1]=c')).to.deep.equal({ a: ['b', 'c'] }); - done(); - }); - - it('parses a nested array', function (done) { - - expect(Qs.parse('a[b][]=c&a[b][]=d')).to.deep.equal({ a: { b: ['c', 'd'] } }); - expect(Qs.parse('a[>=]=25')).to.deep.equal({ a: { '>=': '25' } }); - done(); - }); - - it('allows to specify array indices', function (done) { - - expect(Qs.parse('a[1]=c&a[0]=b&a[2]=d')).to.deep.equal({ a: ['b', 'c', 'd'] }); - expect(Qs.parse('a[1]=c&a[0]=b')).to.deep.equal({ a: ['b', 'c'] }); - expect(Qs.parse('a[1]=c')).to.deep.equal({ a: ['c'] }); - done(); - }); - - it('limits specific array indices to 20', function (done) { - - expect(Qs.parse('a[20]=a')).to.deep.equal({ a: ['a'] }); - expect(Qs.parse('a[21]=a')).to.deep.equal({ a: { '21': 'a' } }); - done(); - }); - - it('supports keys that begin with a number', function (done) { - - expect(Qs.parse('a[12b]=c')).to.deep.equal({ a: { '12b': 'c' } }); - done(); - }); - - it('supports encoded = signs', function (done) { - - expect(Qs.parse('he%3Dllo=th%3Dere')).to.deep.equal({ 'he=llo': 'th=ere' }); - done(); - }); - - it('is ok with url encoded strings', function (done) { - - expect(Qs.parse('a[b%20c]=d')).to.deep.equal({ a: { 'b c': 'd' } }); - expect(Qs.parse('a[b]=c%20d')).to.deep.equal({ a: { b: 'c d' } }); - done(); - }); - - it('allows brackets in the value', function (done) { - - expect(Qs.parse('pets=["tobi"]')).to.deep.equal({ pets: '["tobi"]' }); - expect(Qs.parse('operators=[">=", "<="]')).to.deep.equal({ operators: '[">=", "<="]' }); - done(); - }); - - it('allows empty values', function (done) { - - expect(Qs.parse('')).to.deep.equal({}); - expect(Qs.parse(null)).to.deep.equal({}); - expect(Qs.parse(undefined)).to.deep.equal({}); - done(); - }); - - it('transforms arrays to objects', function (done) { - - expect(Qs.parse('foo[0]=bar&foo[bad]=baz')).to.deep.equal({ foo: { '0': 'bar', bad: 'baz' } }); - expect(Qs.parse('foo[bad]=baz&foo[0]=bar')).to.deep.equal({ foo: { bad: 'baz', '0': 'bar' } }); - expect(Qs.parse('foo[bad]=baz&foo[]=bar')).to.deep.equal({ foo: { bad: 'baz', '0': 'bar' } }); - expect(Qs.parse('foo[]=bar&foo[bad]=baz')).to.deep.equal({ foo: { '0': 'bar', bad: 'baz' } }); - expect(Qs.parse('foo[bad]=baz&foo[]=bar&foo[]=foo')).to.deep.equal({ foo: { bad: 'baz', '0': 'bar', '1': 'foo' } }); - expect(Qs.parse('foo[0][a]=a&foo[0][b]=b&foo[1][a]=aa&foo[1][b]=bb')).to.deep.equal({ foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] }); - expect(Qs.parse('a[]=b&a[t]=u&a[hasOwnProperty]=c')).to.deep.equal({ a: { '0': 'b', t: 'u', c: true } }); - expect(Qs.parse('a[]=b&a[hasOwnProperty]=c&a[x]=y')).to.deep.equal({ a: { '0': 'b', '1': 'c', x: 'y' } }); - done(); - }); - - it('transforms arrays to objects (dot notation)', function (done) { - - expect(Qs.parse('foo[0].baz=bar&fool.bad=baz')).to.deep.equal({ foo: [{ baz: 'bar' }], fool: { bad: 'baz' } }); - expect(Qs.parse('foo[0].baz=bar&fool.bad.boo=baz')).to.deep.equal({ foo: [{ baz: 'bar' }], fool: { bad: { boo: 'baz' } } }); - expect(Qs.parse('foo[0][0].baz=bar&fool.bad=baz')).to.deep.equal({ foo: [[{ baz: 'bar' }]], fool: { bad: 'baz' } }); - expect(Qs.parse('foo[0].baz[0]=15&foo[0].bar=2')).to.deep.equal({ foo: [{ baz: ['15'], bar: '2' }] }); - expect(Qs.parse('foo[0].baz[0]=15&foo[0].baz[1]=16&foo[0].bar=2')).to.deep.equal({ foo: [{ baz: ['15', '16'], bar: '2' }] }); - expect(Qs.parse('foo.bad=baz&foo[0]=bar')).to.deep.equal({ foo: { bad: 'baz', '0': 'bar' } }); - expect(Qs.parse('foo.bad=baz&foo[]=bar')).to.deep.equal({ foo: { bad: 'baz', '0': 'bar' } }); - expect(Qs.parse('foo[]=bar&foo.bad=baz')).to.deep.equal({ foo: { '0': 'bar', bad: 'baz' } }); - expect(Qs.parse('foo.bad=baz&foo[]=bar&foo[]=foo')).to.deep.equal({ foo: { bad: 'baz', '0': 'bar', '1': 'foo' } }); - expect(Qs.parse('foo[0].a=a&foo[0].b=b&foo[1].a=aa&foo[1].b=bb')).to.deep.equal({ foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] }); - done(); - }); - - it('can add keys to objects', function (done) { - - expect(Qs.parse('a[b]=c&a=d')).to.deep.equal({ a: { b: 'c', d: true } }); - done(); - }); - - it('correctly prunes undefined values when converting an array to an object', function (done) { - - expect(Qs.parse('a[2]=b&a[99999999]=c')).to.deep.equal({ a: { '2': 'b', '99999999': 'c' } }); - done(); - }); - - it('supports malformed uri characters', function (done) { - - expect(Qs.parse('{%:%}', { strictNullHandling: true })).to.deep.equal({ '{%:%}': null }); - expect(Qs.parse('{%:%}=')).to.deep.equal({ '{%:%}': '' }); - expect(Qs.parse('foo=%:%}')).to.deep.equal({ foo: '%:%}' }); - done(); - }); - - it('doesn\'t produce empty keys', function (done) { - - expect(Qs.parse('_r=1&')).to.deep.equal({ '_r': '1' }); - done(); - }); - - it('cannot access Object prototype', function (done) { - - Qs.parse('constructor[prototype][bad]=bad'); - Qs.parse('bad[constructor][prototype][bad]=bad'); - expect(typeof Object.prototype.bad).to.equal('undefined'); - done(); - }); - - it('parses arrays of objects', function (done) { - - expect(Qs.parse('a[][b]=c')).to.deep.equal({ a: [{ b: 'c' }] }); - expect(Qs.parse('a[0][b]=c')).to.deep.equal({ a: [{ b: 'c' }] }); - done(); - }); - - it('allows for empty strings in arrays', function (done) { - - expect(Qs.parse('a[]=b&a[]=&a[]=c')).to.deep.equal({ a: ['b', '', 'c'] }); - expect(Qs.parse('a[0]=b&a[1]&a[2]=c&a[19]=', { strictNullHandling: true })).to.deep.equal({ a: ['b', null, 'c', ''] }); - expect(Qs.parse('a[0]=b&a[1]=&a[2]=c&a[19]', { strictNullHandling: true })).to.deep.equal({ a: ['b', '', 'c', null] }); - expect(Qs.parse('a[]=&a[]=b&a[]=c')).to.deep.equal({ a: ['', 'b', 'c'] }); - done(); - }); - - it('compacts sparse arrays', function (done) { - - expect(Qs.parse('a[10]=1&a[2]=2')).to.deep.equal({ a: ['2', '1'] }); - done(); - }); - - it('parses semi-parsed strings', function (done) { - - expect(Qs.parse({ 'a[b]': 'c' })).to.deep.equal({ a: { b: 'c' } }); - expect(Qs.parse({ 'a[b]': 'c', 'a[d]': 'e' })).to.deep.equal({ a: { b: 'c', d: 'e' } }); - done(); - }); - - it('parses buffers correctly', function (done) { - - var b = new Buffer('test'); - expect(Qs.parse({ a: b })).to.deep.equal({ a: b }); - done(); - }); - - it('continues parsing when no parent is found', function (done) { - - expect(Qs.parse('[]=&a=b')).to.deep.equal({ '0': '', a: 'b' }); - expect(Qs.parse('[]&a=b', { strictNullHandling: true })).to.deep.equal({ '0': null, a: 'b' }); - expect(Qs.parse('[foo]=bar')).to.deep.equal({ foo: 'bar' }); - done(); - }); - - it('does not error when parsing a very long array', function (done) { - - var str = 'a[]=a'; - while (Buffer.byteLength(str) < 128 * 1024) { - str += '&' + str; - } - - expect(function () { - - Qs.parse(str); - }).to.not.throw(); - - done(); - }); - - it('should not throw when a native prototype has an enumerable property', { parallel: false }, function (done) { - - Object.prototype.crash = ''; - Array.prototype.crash = ''; - expect(Qs.parse.bind(null, 'a=b')).to.not.throw(); - expect(Qs.parse('a=b')).to.deep.equal({ a: 'b' }); - expect(Qs.parse.bind(null, 'a[][b]=c')).to.not.throw(); - expect(Qs.parse('a[][b]=c')).to.deep.equal({ a: [{ b: 'c' }] }); - delete Object.prototype.crash; - delete Array.prototype.crash; - done(); - }); - - it('parses a string with an alternative string delimiter', function (done) { - - expect(Qs.parse('a=b;c=d', { delimiter: ';' })).to.deep.equal({ a: 'b', c: 'd' }); - done(); - }); - - it('parses a string with an alternative RegExp delimiter', function (done) { - - expect(Qs.parse('a=b; c=d', { delimiter: /[;,] */ })).to.deep.equal({ a: 'b', c: 'd' }); - done(); - }); - - it('does not use non-splittable objects as delimiters', function (done) { - - expect(Qs.parse('a=b&c=d', { delimiter: true })).to.deep.equal({ a: 'b', c: 'd' }); - done(); - }); - - it('allows overriding parameter limit', function (done) { - - expect(Qs.parse('a=b&c=d', { parameterLimit: 1 })).to.deep.equal({ a: 'b' }); - done(); - }); - - it('allows setting the parameter limit to Infinity', function (done) { - - expect(Qs.parse('a=b&c=d', { parameterLimit: Infinity })).to.deep.equal({ a: 'b', c: 'd' }); - done(); - }); - - it('allows overriding array limit', function (done) { - - expect(Qs.parse('a[0]=b', { arrayLimit: -1 })).to.deep.equal({ a: { '0': 'b' } }); - expect(Qs.parse('a[-1]=b', { arrayLimit: -1 })).to.deep.equal({ a: { '-1': 'b' } }); - expect(Qs.parse('a[0]=b&a[1]=c', { arrayLimit: 0 })).to.deep.equal({ a: { '0': 'b', '1': 'c' } }); - done(); - }); - - it('allows disabling array parsing', function (done) { - - expect(Qs.parse('a[0]=b&a[1]=c', { parseArrays: false })).to.deep.equal({ a: { '0': 'b', '1': 'c' } }); - done(); - }); - - it('parses an object', function (done) { - - var input = { - 'user[name]': { 'pop[bob]': 3 }, - 'user[email]': null - }; - - var expected = { - 'user': { - 'name': { 'pop[bob]': 3 }, - 'email': null - } - }; - - var result = Qs.parse(input); - - expect(result).to.deep.equal(expected); - done(); - }); - - it('parses an object in dot notation', function (done) { - - var input = { - 'user.name': { 'pop[bob]': 3 }, - 'user.email.': null - }; - - var expected = { - 'user': { - 'name': { 'pop[bob]': 3 }, - 'email': null - } - }; - - var result = Qs.parse(input); - - expect(result).to.deep.equal(expected); - done(); - }); - - it('parses an object and not child values', function (done) { - - var input = { - 'user[name]': { 'pop[bob]': { 'test': 3 } }, - 'user[email]': null - }; - - var expected = { - 'user': { - 'name': { 'pop[bob]': { 'test': 3 } }, - 'email': null - } - }; - - var result = Qs.parse(input); - - expect(result).to.deep.equal(expected); - done(); - }); - - it('does not blow up when Buffer global is missing', function (done) { - - var tempBuffer = global.Buffer; - delete global.Buffer; - var result = Qs.parse('a=b&c=d'); - global.Buffer = tempBuffer; - expect(result).to.deep.equal({ a: 'b', c: 'd' }); - done(); - }); - - it('does not crash when parsing circular references', function (done) { - - var a = {}; - a.b = a; - - var parsed; - - expect(function () { - - parsed = Qs.parse({ 'foo[bar]': 'baz', 'foo[baz]': a }); - }).to.not.throw(); - - expect(parsed).to.contain('foo'); - expect(parsed.foo).to.contain('bar', 'baz'); - expect(parsed.foo.bar).to.equal('baz'); - expect(parsed.foo.baz).to.deep.equal(a); - done(); - }); - - it('parses plain objects correctly', function (done) { - - var a = Object.create(null); - a.b = 'c'; - - expect(Qs.parse(a)).to.deep.equal({ b: 'c' }); - var result = Qs.parse({ a: a }); - expect(result).to.contain('a'); - expect(result.a).to.deep.equal(a); - done(); - }); - - it('parses dates correctly', function (done) { - - var now = new Date(); - expect(Qs.parse({ a: now })).to.deep.equal({ a: now }); - done(); - }); - - it('parses regular expressions correctly', function (done) { - - var re = /^test$/; - expect(Qs.parse({ a: re })).to.deep.equal({ a: re }); - done(); - }); - - it('can allow overwriting prototype properties', function (done) { - - expect(Qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true })).to.deep.equal({ a: { hasOwnProperty: 'b' } }, { prototype: false }); - expect(Qs.parse('hasOwnProperty=b', { allowPrototypes: true })).to.deep.equal({ hasOwnProperty: 'b' }, { prototype: false }); - done(); - }); - - it('can return plain objects', function (done) { - - var expected = Object.create(null); - expected.a = Object.create(null); - expected.a.b = 'c'; - expected.a.hasOwnProperty = 'd'; - expect(Qs.parse('a[b]=c&a[hasOwnProperty]=d', { plainObjects: true })).to.deep.equal(expected); - expect(Qs.parse(null, { plainObjects: true })).to.deep.equal(Object.create(null)); - var expectedArray = Object.create(null); - expectedArray.a = Object.create(null); - expectedArray.a['0'] = 'b'; - expectedArray.a.c = 'd'; - expect(Qs.parse('a[]=b&a[c]=d', { plainObjects: true })).to.deep.equal(expectedArray); - done(); - }); -}); diff --git a/node_modules/express/node_modules/qs/test/stringify.js b/node_modules/express/node_modules/qs/test/stringify.js deleted file mode 100644 index 48b7803..0000000 --- a/node_modules/express/node_modules/qs/test/stringify.js +++ /dev/null @@ -1,259 +0,0 @@ -/* eslint no-extend-native:0 */ -// Load modules - -var Code = require('code'); -var Lab = require('lab'); -var Qs = require('../'); - - -// Declare internals - -var internals = {}; - - -// Test shortcuts - -var lab = exports.lab = Lab.script(); -var expect = Code.expect; -var describe = lab.experiment; -var it = lab.test; - - -describe('stringify()', function () { - - it('stringifies a querystring object', function (done) { - - expect(Qs.stringify({ a: 'b' })).to.equal('a=b'); - expect(Qs.stringify({ a: 1 })).to.equal('a=1'); - expect(Qs.stringify({ a: 1, b: 2 })).to.equal('a=1&b=2'); - expect(Qs.stringify({ a: 'A_Z' })).to.equal('a=A_Z'); - expect(Qs.stringify({ a: '€' })).to.equal('a=%E2%82%AC'); - expect(Qs.stringify({ a: '' })).to.equal('a=%EE%80%80'); - expect(Qs.stringify({ a: 'א' })).to.equal('a=%D7%90'); - expect(Qs.stringify({ a: '𐐷' })).to.equal('a=%F0%90%90%B7'); - done(); - }); - - it('stringifies a nested object', function (done) { - - expect(Qs.stringify({ a: { b: 'c' } })).to.equal('a%5Bb%5D=c'); - expect(Qs.stringify({ a: { b: { c: { d: 'e' } } } })).to.equal('a%5Bb%5D%5Bc%5D%5Bd%5D=e'); - done(); - }); - - it('stringifies an array value', function (done) { - - expect(Qs.stringify({ a: ['b', 'c', 'd'] })).to.equal('a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d'); - done(); - }); - - it('omits array indices when asked', function (done) { - - expect(Qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false })).to.equal('a=b&a=c&a=d'); - done(); - }); - - it('stringifies a nested array value', function (done) { - - expect(Qs.stringify({ a: { b: ['c', 'd'] } })).to.equal('a%5Bb%5D%5B0%5D=c&a%5Bb%5D%5B1%5D=d'); - done(); - }); - - it('stringifies an object inside an array', function (done) { - - expect(Qs.stringify({ a: [{ b: 'c' }] })).to.equal('a%5B0%5D%5Bb%5D=c'); - expect(Qs.stringify({ a: [{ b: { c: [1] } }] })).to.equal('a%5B0%5D%5Bb%5D%5Bc%5D%5B0%5D=1'); - done(); - }); - - it('does not omit object keys when indices = false', function (done) { - - expect(Qs.stringify({ a: [{ b: 'c' }] }, { indices: false })).to.equal('a%5Bb%5D=c'); - done(); - }); - - it('uses indices notation for arrays when indices=true', function (done) { - - expect(Qs.stringify({ a: ['b', 'c'] }, { indices: true })).to.equal('a%5B0%5D=b&a%5B1%5D=c'); - done(); - }); - - it('uses indices notation for arrays when no arrayFormat is specified', function (done) { - - expect(Qs.stringify({ a: ['b', 'c'] })).to.equal('a%5B0%5D=b&a%5B1%5D=c'); - done(); - }); - - it('uses indices notation for arrays when no arrayFormat=indices', function (done) { - - expect(Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' })).to.equal('a%5B0%5D=b&a%5B1%5D=c'); - done(); - }); - - it('uses repeat notation for arrays when no arrayFormat=repeat', function (done) { - - expect(Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' })).to.equal('a=b&a=c'); - done(); - }); - - it('uses brackets notation for arrays when no arrayFormat=brackets', function (done) { - - expect(Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' })).to.equal('a%5B%5D=b&a%5B%5D=c'); - done(); - }); - - it('stringifies a complicated object', function (done) { - - expect(Qs.stringify({ a: { b: 'c', d: 'e' } })).to.equal('a%5Bb%5D=c&a%5Bd%5D=e'); - done(); - }); - - it('stringifies an empty value', function (done) { - - expect(Qs.stringify({ a: '' })).to.equal('a='); - expect(Qs.stringify({ a: null }, { strictNullHandling: true })).to.equal('a'); - - expect(Qs.stringify({ a: '', b: '' })).to.equal('a=&b='); - expect(Qs.stringify({ a: null, b: '' }, { strictNullHandling: true })).to.equal('a&b='); - - expect(Qs.stringify({ a: { b: '' } })).to.equal('a%5Bb%5D='); - expect(Qs.stringify({ a: { b: null } }, { strictNullHandling: true })).to.equal('a%5Bb%5D'); - expect(Qs.stringify({ a: { b: null } }, { strictNullHandling: false })).to.equal('a%5Bb%5D='); - - done(); - }); - - it('stringifies an empty object', function (done) { - - var obj = Object.create(null); - obj.a = 'b'; - expect(Qs.stringify(obj)).to.equal('a=b'); - done(); - }); - - it('returns an empty string for invalid input', function (done) { - - expect(Qs.stringify(undefined)).to.equal(''); - expect(Qs.stringify(false)).to.equal(''); - expect(Qs.stringify(null)).to.equal(''); - expect(Qs.stringify('')).to.equal(''); - done(); - }); - - it('stringifies an object with an empty object as a child', function (done) { - - var obj = { - a: Object.create(null) - }; - - obj.a.b = 'c'; - expect(Qs.stringify(obj)).to.equal('a%5Bb%5D=c'); - done(); - }); - - it('drops keys with a value of undefined', function (done) { - - expect(Qs.stringify({ a: undefined })).to.equal(''); - - expect(Qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: true })).to.equal('a%5Bc%5D'); - expect(Qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: false })).to.equal('a%5Bc%5D='); - expect(Qs.stringify({ a: { b: undefined, c: '' } })).to.equal('a%5Bc%5D='); - done(); - }); - - it('url encodes values', function (done) { - - expect(Qs.stringify({ a: 'b c' })).to.equal('a=b%20c'); - done(); - }); - - it('stringifies a date', function (done) { - - var now = new Date(); - var str = 'a=' + encodeURIComponent(now.toISOString()); - expect(Qs.stringify({ a: now })).to.equal(str); - done(); - }); - - it('stringifies the weird object from qs', function (done) { - - expect(Qs.stringify({ 'my weird field': '~q1!2"\'w$5&7/z8)?' })).to.equal('my%20weird%20field=~q1%212%22%27w%245%267%2Fz8%29%3F'); - done(); - }); - - it('skips properties that are part of the object prototype', function (done) { - - Object.prototype.crash = 'test'; - expect(Qs.stringify({ a: 'b' })).to.equal('a=b'); - expect(Qs.stringify({ a: { b: 'c' } })).to.equal('a%5Bb%5D=c'); - delete Object.prototype.crash; - done(); - }); - - it('stringifies boolean values', function (done) { - - expect(Qs.stringify({ a: true })).to.equal('a=true'); - expect(Qs.stringify({ a: { b: true } })).to.equal('a%5Bb%5D=true'); - expect(Qs.stringify({ b: false })).to.equal('b=false'); - expect(Qs.stringify({ b: { c: false } })).to.equal('b%5Bc%5D=false'); - done(); - }); - - it('stringifies buffer values', function (done) { - - expect(Qs.stringify({ a: new Buffer('test') })).to.equal('a=test'); - expect(Qs.stringify({ a: { b: new Buffer('test') } })).to.equal('a%5Bb%5D=test'); - done(); - }); - - it('stringifies an object using an alternative delimiter', function (done) { - - expect(Qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' })).to.equal('a=b;c=d'); - done(); - }); - - it('doesn\'t blow up when Buffer global is missing', function (done) { - - var tempBuffer = global.Buffer; - delete global.Buffer; - expect(Qs.stringify({ a: 'b', c: 'd' })).to.equal('a=b&c=d'); - global.Buffer = tempBuffer; - done(); - }); - - it('selects properties when filter=array', function (done) { - - expect(Qs.stringify({ a: 'b' }, { filter: ['a'] })).to.equal('a=b'); - expect(Qs.stringify({ a: 1 }, { filter: [] })).to.equal(''); - expect(Qs.stringify({ a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, { filter: ['a', 'b', 0, 2] })).to.equal('a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3'); - done(); - - }); - - it('supports custom representations when filter=function', function (done) { - - var calls = 0; - var obj = { a: 'b', c: 'd', e: { f: new Date(1257894000000) } }; - var filterFunc = function (prefix, value) { - - calls++; - if (calls === 1) { - expect(prefix).to.be.empty(); - expect(value).to.equal(obj); - } - else if (prefix === 'c') { - return; - } - else if (value instanceof Date) { - expect(prefix).to.equal('e[f]'); - return value.getTime(); - } - return value; - }; - - expect(Qs.stringify(obj, { filter: filterFunc })).to.equal('a=b&e%5Bf%5D=1257894000000'); - expect(calls).to.equal(5); - done(); - - }); -}); diff --git a/node_modules/express/node_modules/qs/test/utils.js b/node_modules/express/node_modules/qs/test/utils.js deleted file mode 100644 index a9a6b52..0000000 --- a/node_modules/express/node_modules/qs/test/utils.js +++ /dev/null @@ -1,28 +0,0 @@ -// Load modules - -var Code = require('code'); -var Lab = require('lab'); -var Utils = require('../lib/utils'); - - -// Declare internals - -var internals = {}; - - -// Test shortcuts - -var lab = exports.lab = Lab.script(); -var expect = Code.expect; -var describe = lab.experiment; -var it = lab.test; - - -describe('merge()', function () { - - it('can merge two objects with the same key', function (done) { - - expect(Utils.merge({ a: 'b' }, { a: 'c' })).to.deep.equal({ a: ['b', 'c'] }); - done(); - }); -}); diff --git a/node_modules/express/package.json b/node_modules/express/package.json index ab4c50b..0996637 100644 --- a/node_modules/express/package.json +++ b/node_modules/express/package.json @@ -1,7 +1,7 @@ { "name": "express", "description": "Fast, unopinionated, minimalist web framework", - "version": "5.0.0-alpha.2", + "version": "4.18.2", "author": "TJ Holowaychuk ", "contributors": [ "Aaron Heckmann ", @@ -13,13 +13,14 @@ "Young Jae Sim " ], "license": "MIT", - "repository": "strongloop/express", + "repository": "expressjs/express", "homepage": "http://expressjs.com/", "keywords": [ "express", "framework", "sinatra", "web", + "http", "rest", "restful", "router", @@ -27,52 +28,56 @@ "api" ], "dependencies": { - "accepts": "~1.2.10", - "array-flatten": "1.1.0", - "content-disposition": "0.5.0", - "content-type": "~1.0.1", - "cookie": "0.1.3", + "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.2.0", - "depd": "~1.0.1", - "escape-html": "1.0.2", - "etag": "~1.7.0", - "finalhandler": "0.4.0", - "fresh": "0.3.0", - "merge-descriptors": "1.0.0", - "methods": "~1.1.1", - "on-finished": "~2.3.0", - "parseurl": "~1.3.0", - "path-is-absolute": "1.0.0", - "path-to-regexp": "0.1.6", - "proxy-addr": "~1.0.8", - "qs": "4.0.0", - "range-parser": "~1.0.2", - "router": "~1.1.2", - "send": "0.13.0", - "serve-static": "~1.10.0", - "type-is": "~1.6.4", - "vary": "~1.0.0", - "utils-merge": "1.0.0" + "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" }, "devDependencies": { - "after": "0.8.1", - "ejs": "2.3.2", - "istanbul": "0.3.9", - "marked": "0.3.3", - "mocha": "2.2.5", - "should": "7.0.1", - "supertest": "1.0.1", - "body-parser": "~1.13.2", - "connect-redis": "~2.3.0", - "cookie-parser": "~1.3.5", - "cookie-session": "~1.2.0", - "express-session": "~1.11.3", - "jade": "~1.11.0", - "method-override": "~2.3.3", - "morgan": "~1.6.1", - "multiparty": "~4.1.2", - "vhost": "~3.0.0" + "after": "0.8.2", + "connect-redis": "3.4.2", + "cookie-parser": "1.4.6", + "cookie-session": "2.0.0", + "ejs": "3.1.8", + "eslint": "8.24.0", + "express-session": "1.17.2", + "hbs": "4.2.0", + "marked": "0.7.0", + "method-override": "3.0.0", + "mocha": "10.0.0", + "morgan": "1.10.0", + "multiparty": "4.2.3", + "nyc": "15.1.0", + "pbkdf2-password": "1.2.1", + "supertest": "6.3.0", + "vhost": "~3.0.2" }, "engines": { "node": ">= 0.10.0" @@ -85,9 +90,10 @@ "lib/" ], "scripts": { + "lint": "eslint .", "test": "mocha --require test/support/env --reporter spec --bail --check-leaks test/ test/acceptance/", - "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --require test/support/env --reporter spec --check-leaks test/ test/acceptance/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --require test/support/env --reporter dot --check-leaks test/ test/acceptance/", + "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test", "test-tap": "mocha --require test/support/env --reporter tap --check-leaks test/ test/acceptance/" } } diff --git a/node_modules/finalhandler/HISTORY.md b/node_modules/finalhandler/HISTORY.md index 26a9435..ec2d38b 100644 --- a/node_modules/finalhandler/HISTORY.md +++ b/node_modules/finalhandler/HISTORY.md @@ -1,3 +1,108 @@ +1.2.0 / 2022-03-22 +================== + + * Remove set content headers that break response + * deps: on-finished@2.4.1 + * deps: statuses@2.0.1 + - Rename `425 Unordered Collection` to standard `425 Too Early` + +1.1.2 / 2019-05-09 +================== + + * Set stricter `Content-Security-Policy` header + * deps: parseurl@~1.3.3 + * deps: statuses@~1.5.0 + +1.1.1 / 2018-03-06 +================== + + * Fix 404 output for bad / missing pathnames + * deps: encodeurl@~1.0.2 + - Fix encoding `%` as last character + * deps: statuses@~1.4.0 + +1.1.0 / 2017-09-24 +================== + + * Use `res.headersSent` when available + +1.0.6 / 2017-09-22 +================== + + * deps: debug@2.6.9 + +1.0.5 / 2017-09-15 +================== + + * deps: parseurl@~1.3.2 + - perf: reduce overhead for full URLs + - perf: unroll the "fast-path" `RegExp` + +1.0.4 / 2017-08-03 +================== + + * deps: debug@2.6.8 + +1.0.3 / 2017-05-16 +================== + + * deps: debug@2.6.7 + - deps: ms@2.0.0 + +1.0.2 / 2017-04-22 +================== + + * deps: debug@2.6.4 + - deps: ms@0.7.3 + +1.0.1 / 2017-03-21 +================== + + * Fix missing `` in HTML document + * deps: debug@2.6.3 + - Fix: `DEBUG_MAX_ARRAY_LENGTH` + +1.0.0 / 2017-02-15 +================== + + * Fix exception when `err` cannot be converted to a string + * Fully URL-encode the pathname in the 404 message + * Only include the pathname in the 404 message + * Send complete HTML document + * Set `Content-Security-Policy: default-src 'self'` header + * deps: debug@2.6.1 + - Allow colors in workers + - Deprecated `DEBUG_FD` environment variable set to `3` or higher + - Fix error when running under React Native + - Use same color for same namespace + - deps: ms@0.7.2 + +0.5.1 / 2016-11-12 +================== + + * Fix exception when `err.headers` is not an object + * deps: statuses@~1.3.1 + * perf: hoist regular expressions + * perf: remove duplicate validation path + +0.5.0 / 2016-06-15 +================== + + * Change invalid or non-numeric status code to 500 + * Overwrite status message to match set status code + * Prefer `err.statusCode` if `err.status` is invalid + * Set response headers from `err.headers` object + * Use `statuses` instead of `http` module for status messages + - Includes all defined status messages + +0.4.1 / 2015-12-02 +================== + + * deps: escape-html@~1.0.3 + - perf: enable strict mode + - perf: optimize string replacement + - perf: use faster string coercion + 0.4.0 / 2015-06-14 ================== diff --git a/node_modules/finalhandler/LICENSE b/node_modules/finalhandler/LICENSE index b60a5ad..6022106 100644 --- a/node_modules/finalhandler/LICENSE +++ b/node_modules/finalhandler/LICENSE @@ -1,6 +1,6 @@ (The MIT License) -Copyright (c) 2014-2015 Douglas Christopher Wilson +Copyright (c) 2014-2022 Douglas Christopher Wilson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/node_modules/finalhandler/README.md b/node_modules/finalhandler/README.md index 6b171d4..81f10ef 100644 --- a/node_modules/finalhandler/README.md +++ b/node_modules/finalhandler/README.md @@ -3,13 +3,17 @@ [![NPM Version][npm-image]][npm-url] [![NPM Downloads][downloads-image]][downloads-url] [![Node.js Version][node-image]][node-url] -[![Build Status][travis-image]][travis-url] +[![Build Status][github-actions-ci-image]][github-actions-ci-url] [![Test Coverage][coveralls-image]][coveralls-url] Node.js function to invoke as the final step to respond to HTTP request. ## 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 finalhandler ``` @@ -25,7 +29,17 @@ var finalhandler = require('finalhandler') Returns function to be invoked as the final step for the given `req` and `res`. This function is to be invoked as `fn(err)`. If `err` is falsy, the handler will write out a 404 response to the `res`. If it is truthy, an error response will -be written out to the `res`, and `res.statusCode` is set from `err.status`. +be written out to the `res` or `res` will be terminated if a response has already +started. + +When an error is written, the following information is added to the response: + + * The `res.statusCode` is set from `err.status` (or `err.statusCode`). If + this value is outside the 4xx or 5xx range, it will be set to 500. + * The `res.statusMessage` is set according to the status code. + * The body will be the HTML of the status code message if `env` is + `'production'`, otherwise will be `err.stack`. + * Any headers specified in an `err.headers` object. The final handler will also unpipe anything from `req` when it is invoked. @@ -101,7 +115,7 @@ var fs = require('fs') var http = require('http') var server = http.createServer(function (req, res) { - var done = finalhandler(req, res, {onerror: logerror}) + var done = finalhandler(req, res, { onerror: logerror }) fs.readFile('index.html', function (err, buf) { if (err) return done(err) @@ -112,7 +126,7 @@ var server = http.createServer(function (req, res) { server.listen(3000) -function logerror(err) { +function logerror (err) { console.error(err.stack || err.toString()) } ``` @@ -124,10 +138,10 @@ function logerror(err) { [npm-image]: https://img.shields.io/npm/v/finalhandler.svg [npm-url]: https://npmjs.org/package/finalhandler [node-image]: https://img.shields.io/node/v/finalhandler.svg -[node-url]: http://nodejs.org/download/ -[travis-image]: https://img.shields.io/travis/pillarjs/finalhandler.svg -[travis-url]: https://travis-ci.org/pillarjs/finalhandler +[node-url]: https://nodejs.org/en/download [coveralls-image]: https://img.shields.io/coveralls/pillarjs/finalhandler.svg [coveralls-url]: https://coveralls.io/r/pillarjs/finalhandler?branch=master [downloads-image]: https://img.shields.io/npm/dm/finalhandler.svg [downloads-url]: https://npmjs.org/package/finalhandler +[github-actions-ci-image]: https://img.shields.io/github/workflow/status/pillarjs/finalhandler/ci/master?label=ci +[github-actions-ci-url]: https://github.com/jshttp/pillarjs/finalhandler?query=workflow%3Aci diff --git a/node_modules/finalhandler/SECURITY.md b/node_modules/finalhandler/SECURITY.md new file mode 100644 index 0000000..6e23249 --- /dev/null +++ b/node_modules/finalhandler/SECURITY.md @@ -0,0 +1,25 @@ +# Security Policies and Procedures + +## Reporting a Bug + +The `finalhandler` 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 `finalhandler`. This +information can be found in the npm registry using the command +`npm owner ls finalhandler`. +If unsure or unable to get the information from the above, open an issue +in the [project issue tracker](https://github.com/pillarjs/finalhandler/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/finalhandler/index.js b/node_modules/finalhandler/index.js index 0de7c6b..f628e42 100644 --- a/node_modules/finalhandler/index.js +++ b/node_modules/finalhandler/index.js @@ -1,6 +1,6 @@ /*! * finalhandler - * Copyright(c) 2014-2015 Douglas Christopher Wilson + * Copyright(c) 2014-2022 Douglas Christopher Wilson * MIT Licensed */ @@ -12,9 +12,11 @@ */ var debug = require('debug')('finalhandler') +var encodeUrl = require('encodeurl') var escapeHtml = require('escape-html') -var http = require('http') var onFinished = require('on-finished') +var parseUrl = require('parseurl') +var statuses = require('statuses') var unpipe = require('unpipe') /** @@ -22,12 +24,39 @@ var unpipe = require('unpipe') * @private */ +var DOUBLE_SPACE_REGEXP = /\x20{2}/g +var NEWLINE_REGEXP = /\n/g + /* istanbul ignore next */ var defer = typeof setImmediate === 'function' ? setImmediate - : function(fn){ process.nextTick(fn.bind.apply(fn, arguments)) } + : function (fn) { process.nextTick(fn.bind.apply(fn, arguments)) } var isFinished = onFinished.isFinished +/** + * Create a minimal HTML document. + * + * @param {string} message + * @private + */ + +function createHtmlDocument (message) { + var body = escapeHtml(message) + .replace(NEWLINE_REGEXP, '
') + .replace(DOUBLE_SPACE_REGEXP, '  ') + + return '\n' + + '\n' + + '\n' + + '\n' + + 'Error\n' + + '\n' + + '\n' + + '
' + body + '
\n' + + '\n' + + '\n' +} + /** * Module exports. * @public @@ -45,7 +74,7 @@ module.exports = finalhandler * @public */ -function finalhandler(req, res, options) { +function finalhandler (req, res, options) { var opts = options || {} // get environment @@ -55,41 +84,35 @@ function finalhandler(req, res, options) { var onerror = opts.onerror return function (err) { - var status = res.statusCode + var headers + var msg + var status // ignore 404 on in-flight response - if (!err && res._header) { + if (!err && headersSent(res)) { debug('cannot 404 after headers sent') return } // unhandled error if (err) { - // respect err.statusCode - if (err.statusCode) { - status = err.statusCode + // respect status code from error + status = getErrorStatusCode(err) + + if (status === undefined) { + // fallback to status code on response + status = getResponseStatusCode(res) + } else { + // respect headers from error + headers = getErrorHeaders(err) } - // respect err.status - if (err.status) { - status = err.status - } - - // default status code to 500 - if (!status || status < 400) { - status = 500 - } - - // production gets a basic error message - var msg = env === 'production' - ? http.STATUS_CODES[status] - : err.stack || err.toString() - msg = escapeHtml(msg) - .replace(/\n/g, '
') - .replace(/ /g, '  ') + '\n' + // get error message + msg = getErrorMessage(err, status, env) } else { + // not found status = 404 - msg = 'Cannot ' + escapeHtml(req.method) + ' ' + escapeHtml(req.originalUrl || req.url) + '\n' + msg = 'Cannot ' + req.method + ' ' + encodeUrl(getResourceName(req)) } debug('default %s', status) @@ -100,29 +123,171 @@ function finalhandler(req, res, options) { } // cannot actually respond - if (res._header) { - return req.socket.destroy() + if (headersSent(res)) { + debug('cannot %d after headers sent', status) + req.socket.destroy() + return } - send(req, res, status, msg) + // send response + send(req, res, status, headers, msg) } } +/** + * Get headers from Error object. + * + * @param {Error} err + * @return {object} + * @private + */ + +function getErrorHeaders (err) { + if (!err.headers || typeof err.headers !== 'object') { + return undefined + } + + var headers = Object.create(null) + var keys = Object.keys(err.headers) + + for (var i = 0; i < keys.length; i++) { + var key = keys[i] + headers[key] = err.headers[key] + } + + return headers +} + +/** + * Get message from Error object, fallback to status message. + * + * @param {Error} err + * @param {number} status + * @param {string} env + * @return {string} + * @private + */ + +function getErrorMessage (err, status, env) { + var msg + + if (env !== 'production') { + // use err.stack, which typically includes err.message + msg = err.stack + + // fallback to err.toString() when possible + if (!msg && typeof err.toString === 'function') { + msg = err.toString() + } + } + + return msg || statuses.message[status] +} + +/** + * Get status code from Error object. + * + * @param {Error} err + * @return {number} + * @private + */ + +function getErrorStatusCode (err) { + // check err.status + if (typeof err.status === 'number' && err.status >= 400 && err.status < 600) { + return err.status + } + + // check err.statusCode + if (typeof err.statusCode === 'number' && err.statusCode >= 400 && err.statusCode < 600) { + return err.statusCode + } + + return undefined +} + +/** + * Get resource name for the request. + * + * This is typically just the original pathname of the request + * but will fallback to "resource" is that cannot be determined. + * + * @param {IncomingMessage} req + * @return {string} + * @private + */ + +function getResourceName (req) { + try { + return parseUrl.original(req).pathname + } catch (e) { + return 'resource' + } +} + +/** + * Get status code from response. + * + * @param {OutgoingMessage} res + * @return {number} + * @private + */ + +function getResponseStatusCode (res) { + var status = res.statusCode + + // default status code to 500 if outside valid range + if (typeof status !== 'number' || status < 400 || status > 599) { + status = 500 + } + + return status +} + +/** + * Determine if the response headers have been sent. + * + * @param {object} res + * @returns {boolean} + * @private + */ + +function headersSent (res) { + return typeof res.headersSent !== 'boolean' + ? Boolean(res._header) + : res.headersSent +} + /** * Send response. * * @param {IncomingMessage} req * @param {OutgoingMessage} res * @param {number} status - * @param {string} body + * @param {object} headers + * @param {string} message * @private */ -function send(req, res, status, body) { - function write() { - res.statusCode = status +function send (req, res, status, headers, message) { + function write () { + // response body + var body = createHtmlDocument(message) - // security header for content sniffing + // response status + res.statusCode = status + res.statusMessage = statuses.message[status] + + // remove any content headers + res.removeHeader('Content-Encoding') + res.removeHeader('Content-Language') + res.removeHeader('Content-Range') + + // response headers + setHeaders(res, headers) + + // security headers + res.setHeader('Content-Security-Policy', "default-src 'none'") res.setHeader('X-Content-Type-Options', 'nosniff') // standard headers @@ -149,3 +314,23 @@ function send(req, res, status, body) { onFinished(req, write) req.resume() } + +/** + * Set response headers from an object. + * + * @param {OutgoingMessage} res + * @param {object} headers + * @private + */ + +function setHeaders (res, headers) { + if (!headers) { + return + } + + var keys = Object.keys(headers) + for (var i = 0; i < keys.length; i++) { + var key = keys[i] + res.setHeader(key, headers[key]) + } +} diff --git a/node_modules/finalhandler/node_modules/debug/.jshintrc b/node_modules/finalhandler/node_modules/debug/.jshintrc deleted file mode 100644 index 299877f..0000000 --- a/node_modules/finalhandler/node_modules/debug/.jshintrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "laxbreak": true -} diff --git a/node_modules/finalhandler/node_modules/debug/.npmignore b/node_modules/finalhandler/node_modules/debug/.npmignore deleted file mode 100644 index 7e6163d..0000000 --- a/node_modules/finalhandler/node_modules/debug/.npmignore +++ /dev/null @@ -1,6 +0,0 @@ -support -test -examples -example -*.sock -dist diff --git a/node_modules/finalhandler/node_modules/debug/History.md b/node_modules/finalhandler/node_modules/debug/History.md deleted file mode 100644 index 854c971..0000000 --- a/node_modules/finalhandler/node_modules/debug/History.md +++ /dev/null @@ -1,195 +0,0 @@ - -2.2.0 / 2015-05-09 -================== - - * package: update "ms" to v0.7.1 (#202, @dougwilson) - * README: add logging to file example (#193, @DanielOchoa) - * README: fixed a typo (#191, @amir-s) - * browser: expose `storage` (#190, @stephenmathieson) - * Makefile: add a `distclean` target (#189, @stephenmathieson) - -2.1.3 / 2015-03-13 -================== - - * Updated stdout/stderr example (#186) - * Updated example/stdout.js to match debug current behaviour - * Renamed example/stderr.js to stdout.js - * Update Readme.md (#184) - * replace high intensity foreground color for bold (#182, #183) - -2.1.2 / 2015-03-01 -================== - - * dist: recompile - * update "ms" to v0.7.0 - * package: update "browserify" to v9.0.3 - * component: fix "ms.js" repo location - * changed bower package name - * updated documentation about using debug in a browser - * fix: security error on safari (#167, #168, @yields) - -2.1.1 / 2014-12-29 -================== - - * browser: use `typeof` to check for `console` existence - * browser: check for `console.log` truthiness (fix IE 8/9) - * browser: add support for Chrome apps - * Readme: added Windows usage remarks - * Add `bower.json` to properly support bower install - -2.1.0 / 2014-10-15 -================== - - * node: implement `DEBUG_FD` env variable support - * package: update "browserify" to v6.1.0 - * package: add "license" field to package.json (#135, @panuhorsmalahti) - -2.0.0 / 2014-09-01 -================== - - * package: update "browserify" to v5.11.0 - * node: use stderr rather than stdout for logging (#29, @stephenmathieson) - -1.0.4 / 2014-07-15 -================== - - * dist: recompile - * example: remove `console.info()` log usage - * example: add "Content-Type" UTF-8 header to browser example - * browser: place %c marker after the space character - * browser: reset the "content" color via `color: inherit` - * browser: add colors support for Firefox >= v31 - * debug: prefer an instance `log()` function over the global one (#119) - * Readme: update documentation about styled console logs for FF v31 (#116, @wryk) - -1.0.3 / 2014-07-09 -================== - - * Add support for multiple wildcards in namespaces (#122, @seegno) - * browser: fix lint - -1.0.2 / 2014-06-10 -================== - - * browser: update color palette (#113, @gscottolson) - * common: make console logging function configurable (#108, @timoxley) - * node: fix %o colors on old node <= 0.8.x - * Makefile: find node path using shell/which (#109, @timoxley) - -1.0.1 / 2014-06-06 -================== - - * browser: use `removeItem()` to clear localStorage - * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777) - * package: add "contributors" section - * node: fix comment typo - * README: list authors - -1.0.0 / 2014-06-04 -================== - - * make ms diff be global, not be scope - * debug: ignore empty strings in enable() - * node: make DEBUG_COLORS able to disable coloring - * *: export the `colors` array - * npmignore: don't publish the `dist` dir - * Makefile: refactor to use browserify - * package: add "browserify" as a dev dependency - * Readme: add Web Inspector Colors section - * node: reset terminal color for the debug content - * node: map "%o" to `util.inspect()` - * browser: map "%j" to `JSON.stringify()` - * debug: add custom "formatters" - * debug: use "ms" module for humanizing the diff - * Readme: add "bash" syntax highlighting - * browser: add Firebug color support - * browser: add colors for WebKit browsers - * node: apply log to `console` - * rewrite: abstract common logic for Node & browsers - * add .jshintrc file - -0.8.1 / 2014-04-14 -================== - - * package: re-add the "component" section - -0.8.0 / 2014-03-30 -================== - - * add `enable()` method for nodejs. Closes #27 - * change from stderr to stdout - * remove unnecessary index.js file - -0.7.4 / 2013-11-13 -================== - - * remove "browserify" key from package.json (fixes something in browserify) - -0.7.3 / 2013-10-30 -================== - - * fix: catch localStorage security error when cookies are blocked (Chrome) - * add debug(err) support. Closes #46 - * add .browser prop to package.json. Closes #42 - -0.7.2 / 2013-02-06 -================== - - * fix package.json - * fix: Mobile Safari (private mode) is broken with debug - * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript - -0.7.1 / 2013-02-05 -================== - - * add repository URL to package.json - * add DEBUG_COLORED to force colored output - * add browserify support - * fix component. Closes #24 - -0.7.0 / 2012-05-04 -================== - - * Added .component to package.json - * Added debug.component.js build - -0.6.0 / 2012-03-16 -================== - - * Added support for "-" prefix in DEBUG [Vinay Pulim] - * Added `.enabled` flag to the node version [TooTallNate] - -0.5.0 / 2012-02-02 -================== - - * Added: humanize diffs. Closes #8 - * Added `debug.disable()` to the CS variant - * Removed padding. Closes #10 - * Fixed: persist client-side variant again. Closes #9 - -0.4.0 / 2012-02-01 -================== - - * Added browser variant support for older browsers [TooTallNate] - * Added `debug.enable('project:*')` to browser variant [TooTallNate] - * Added padding to diff (moved it to the right) - -0.3.0 / 2012-01-26 -================== - - * Added millisecond diff when isatty, otherwise UTC string - -0.2.0 / 2012-01-22 -================== - - * Added wildcard support - -0.1.0 / 2011-12-02 -================== - - * Added: remove colors unless stderr isatty [TooTallNate] - -0.0.1 / 2010-01-03 -================== - - * Initial release diff --git a/node_modules/finalhandler/node_modules/debug/Makefile b/node_modules/finalhandler/node_modules/debug/Makefile deleted file mode 100644 index 5cf4a59..0000000 --- a/node_modules/finalhandler/node_modules/debug/Makefile +++ /dev/null @@ -1,36 +0,0 @@ - -# get Makefile directory name: http://stackoverflow.com/a/5982798/376773 -THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) -THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd) - -# BIN directory -BIN := $(THIS_DIR)/node_modules/.bin - -# applications -NODE ?= $(shell which node) -NPM ?= $(NODE) $(shell which npm) -BROWSERIFY ?= $(NODE) $(BIN)/browserify - -all: dist/debug.js - -install: node_modules - -clean: - @rm -rf dist - -dist: - @mkdir -p $@ - -dist/debug.js: node_modules browser.js debug.js dist - @$(BROWSERIFY) \ - --standalone debug \ - . > $@ - -distclean: clean - @rm -rf node_modules - -node_modules: package.json - @NODE_ENV= $(NPM) install - @touch node_modules - -.PHONY: all install clean distclean diff --git a/node_modules/finalhandler/node_modules/debug/Readme.md b/node_modules/finalhandler/node_modules/debug/Readme.md deleted file mode 100644 index b4f45e3..0000000 --- a/node_modules/finalhandler/node_modules/debug/Readme.md +++ /dev/null @@ -1,188 +0,0 @@ -# debug - - tiny node.js debugging utility modelled after node core's debugging technique. - -## Installation - -```bash -$ npm install debug -``` - -## Usage - - With `debug` you simply invoke the exported function to generate your debug function, passing it a name which will determine if a noop function is returned, or a decorated `console.error`, so all of the `console` format string goodies you're used to work fine. A unique color is selected per-function for visibility. - -Example _app.js_: - -```js -var debug = require('debug')('http') - , http = require('http') - , name = 'My App'; - -// fake app - -debug('booting %s', name); - -http.createServer(function(req, res){ - debug(req.method + ' ' + req.url); - res.end('hello\n'); -}).listen(3000, function(){ - debug('listening'); -}); - -// fake worker of some kind - -require('./worker'); -``` - -Example _worker.js_: - -```js -var debug = require('debug')('worker'); - -setInterval(function(){ - debug('doing some work'); -}, 1000); -``` - - The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples: - - ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png) - - ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png) - -#### Windows note - - On Windows the environment variable is set using the `set` command. - - ```cmd - set DEBUG=*,-not_this - ``` - -Then, run the program to be debugged as usual. - -## Millisecond diff - - When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. - - ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png) - - When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below: - - ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png) - -## Conventions - - If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". - -## Wildcards - - The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. - - You can also exclude specific debuggers by prefixing them with a "-" character. For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:". - -## Browser support - - Debug works in the browser as well, currently persisted by `localStorage`. Consider the situation shown below where you have `worker:a` and `worker:b`, and wish to debug both. Somewhere in the code on your page, include: - -```js -window.myDebug = require("debug"); -``` - - ("debug" is a global object in the browser so we give this object a different name.) When your page is open in the browser, type the following in the console: - -```js -myDebug.enable("worker:*") -``` - - Refresh the page. Debug output will continue to be sent to the console until it is disabled by typing `myDebug.disable()` in the console. - -```js -a = debug('worker:a'); -b = debug('worker:b'); - -setInterval(function(){ - a('doing some work'); -}, 1000); - -setInterval(function(){ - b('doing some work'); -}, 1200); -``` - -#### Web Inspector Colors - - Colors are also enabled on "Web Inspectors" that understand the `%c` formatting - option. These are WebKit web inspectors, Firefox ([since version - 31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) - and the Firebug plugin for Firefox (any version). - - Colored output looks something like: - - ![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png) - -### stderr vs stdout - -You can set an alternative logging method per-namespace by overriding the `log` method on a per-namespace or globally: - -Example _stdout.js_: - -```js -var debug = require('debug'); -var error = debug('app:error'); - -// by default stderr is used -error('goes to stderr!'); - -var log = debug('app:log'); -// set this namespace to log via console.log -log.log = console.log.bind(console); // don't forget to bind to console! -log('goes to stdout'); -error('still goes to stderr!'); - -// set all output to go via console.info -// overrides all per-namespace log settings -debug.log = console.info.bind(console); -error('now goes to stdout via console.info'); -log('still goes to stdout, but via console.info now'); -``` - -### Save debug output to a file - -You can save all debug statements to a file by piping them. - -Example: - -```bash -$ DEBUG_FD=3 node your-app.js 3> whatever.log -``` - -## Authors - - - TJ Holowaychuk - - Nathan Rajlich - -## License - -(The MIT License) - -Copyright (c) 2014 TJ Holowaychuk <tj@vision-media.ca> - -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/finalhandler/node_modules/debug/bower.json b/node_modules/finalhandler/node_modules/debug/bower.json deleted file mode 100644 index 6af573f..0000000 --- a/node_modules/finalhandler/node_modules/debug/bower.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "visionmedia-debug", - "main": "dist/debug.js", - "version": "2.2.0", - "homepage": "https://github.com/visionmedia/debug", - "authors": [ - "TJ Holowaychuk " - ], - "description": "visionmedia-debug", - "moduleType": [ - "amd", - "es6", - "globals", - "node" - ], - "keywords": [ - "visionmedia", - "debug" - ], - "license": "MIT", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ] -} diff --git a/node_modules/finalhandler/node_modules/debug/browser.js b/node_modules/finalhandler/node_modules/debug/browser.js deleted file mode 100644 index 7c76452..0000000 --- a/node_modules/finalhandler/node_modules/debug/browser.js +++ /dev/null @@ -1,168 +0,0 @@ - -/** - * This is the web browser implementation of `debug()`. - * - * Expose `debug()` as the module. - */ - -exports = module.exports = require('./debug'); -exports.log = log; -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; -exports.storage = 'undefined' != typeof chrome - && 'undefined' != typeof chrome.storage - ? chrome.storage.local - : localstorage(); - -/** - * Colors. - */ - -exports.colors = [ - 'lightseagreen', - 'forestgreen', - 'goldenrod', - 'dodgerblue', - 'darkorchid', - 'crimson' -]; - -/** - * Currently only WebKit-based Web Inspectors, Firefox >= v31, - * and the Firebug extension (any Firefox version) are known - * to support "%c" CSS customizations. - * - * TODO: add a `localStorage` variable to explicitly enable/disable colors - */ - -function useColors() { - // is webkit? http://stackoverflow.com/a/16459606/376773 - return ('WebkitAppearance' in document.documentElement.style) || - // is firebug? http://stackoverflow.com/a/398120/376773 - (window.console && (console.firebug || (console.exception && console.table))) || - // is firefox >= v31? - // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages - (navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31); -} - -/** - * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. - */ - -exports.formatters.j = function(v) { - return JSON.stringify(v); -}; - - -/** - * Colorize log arguments if enabled. - * - * @api public - */ - -function formatArgs() { - var args = arguments; - var useColors = this.useColors; - - args[0] = (useColors ? '%c' : '') - + this.namespace - + (useColors ? ' %c' : ' ') - + args[0] - + (useColors ? '%c ' : ' ') - + '+' + exports.humanize(this.diff); - - if (!useColors) return args; - - var c = 'color: ' + this.color; - args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1)); - - // the final "%c" is somewhat tricky, because there could be other - // arguments passed either before or after the %c, so we need to - // figure out the correct index to insert the CSS into - var index = 0; - var lastC = 0; - args[0].replace(/%[a-z%]/g, function(match) { - if ('%%' === match) return; - index++; - if ('%c' === match) { - // we only are interested in the *last* %c - // (the user may have provided their own) - lastC = index; - } - }); - - args.splice(lastC, 0, c); - return args; -} - -/** - * Invokes `console.log()` when available. - * No-op when `console.log` is not a "function". - * - * @api public - */ - -function log() { - // this hackery is required for IE8/9, where - // the `console.log` function doesn't have 'apply' - return 'object' === typeof console - && console.log - && Function.prototype.apply.call(console.log, console, arguments); -} - -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ - -function save(namespaces) { - try { - if (null == namespaces) { - exports.storage.removeItem('debug'); - } else { - exports.storage.debug = namespaces; - } - } catch(e) {} -} - -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ - -function load() { - var r; - try { - r = exports.storage.debug; - } catch(e) {} - return r; -} - -/** - * Enable namespaces listed in `localStorage.debug` initially. - */ - -exports.enable(load()); - -/** - * Localstorage attempts to return the localstorage. - * - * This is necessary because safari throws - * when a user disables cookies/localstorage - * and you attempt to access it. - * - * @return {LocalStorage} - * @api private - */ - -function localstorage(){ - try { - return window.localStorage; - } catch (e) {} -} diff --git a/node_modules/finalhandler/node_modules/debug/component.json b/node_modules/finalhandler/node_modules/debug/component.json deleted file mode 100644 index ca10637..0000000 --- a/node_modules/finalhandler/node_modules/debug/component.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "debug", - "repo": "visionmedia/debug", - "description": "small debugging utility", - "version": "2.2.0", - "keywords": [ - "debug", - "log", - "debugger" - ], - "main": "browser.js", - "scripts": [ - "browser.js", - "debug.js" - ], - "dependencies": { - "rauchg/ms.js": "0.7.1" - } -} diff --git a/node_modules/finalhandler/node_modules/debug/debug.js b/node_modules/finalhandler/node_modules/debug/debug.js deleted file mode 100644 index 7571a86..0000000 --- a/node_modules/finalhandler/node_modules/debug/debug.js +++ /dev/null @@ -1,197 +0,0 @@ - -/** - * This is the common logic for both the Node.js and web browser - * implementations of `debug()`. - * - * Expose `debug()` as the module. - */ - -exports = module.exports = debug; -exports.coerce = coerce; -exports.disable = disable; -exports.enable = enable; -exports.enabled = enabled; -exports.humanize = require('ms'); - -/** - * The currently active debug mode names, and names to skip. - */ - -exports.names = []; -exports.skips = []; - -/** - * Map of special "%n" handling functions, for the debug "format" argument. - * - * Valid key names are a single, lowercased letter, i.e. "n". - */ - -exports.formatters = {}; - -/** - * Previously assigned color. - */ - -var prevColor = 0; - -/** - * Previous log timestamp. - */ - -var prevTime; - -/** - * Select a color. - * - * @return {Number} - * @api private - */ - -function selectColor() { - return exports.colors[prevColor++ % exports.colors.length]; -} - -/** - * Create a debugger with the given `namespace`. - * - * @param {String} namespace - * @return {Function} - * @api public - */ - -function debug(namespace) { - - // define the `disabled` version - function disabled() { - } - disabled.enabled = false; - - // define the `enabled` version - function enabled() { - - var self = enabled; - - // set `diff` timestamp - var curr = +new Date(); - var ms = curr - (prevTime || curr); - self.diff = ms; - self.prev = prevTime; - self.curr = curr; - prevTime = curr; - - // add the `color` if not set - if (null == self.useColors) self.useColors = exports.useColors(); - if (null == self.color && self.useColors) self.color = selectColor(); - - var args = Array.prototype.slice.call(arguments); - - args[0] = exports.coerce(args[0]); - - if ('string' !== typeof args[0]) { - // anything else let's inspect with %o - args = ['%o'].concat(args); - } - - // apply any `formatters` transformations - var index = 0; - args[0] = args[0].replace(/%([a-z%])/g, function(match, format) { - // if we encounter an escaped % then don't increase the array index - if (match === '%%') return match; - index++; - var formatter = exports.formatters[format]; - if ('function' === typeof formatter) { - var val = args[index]; - match = formatter.call(self, val); - - // now we need to remove `args[index]` since it's inlined in the `format` - args.splice(index, 1); - index--; - } - return match; - }); - - if ('function' === typeof exports.formatArgs) { - args = exports.formatArgs.apply(self, args); - } - var logFn = enabled.log || exports.log || console.log.bind(console); - logFn.apply(self, args); - } - enabled.enabled = true; - - var fn = exports.enabled(namespace) ? enabled : disabled; - - fn.namespace = namespace; - - return fn; -} - -/** - * Enables a debug mode by namespaces. This can include modes - * separated by a colon and wildcards. - * - * @param {String} namespaces - * @api public - */ - -function enable(namespaces) { - exports.save(namespaces); - - var split = (namespaces || '').split(/[\s,]+/); - var len = split.length; - - for (var i = 0; i < len; i++) { - if (!split[i]) continue; // ignore empty strings - namespaces = split[i].replace(/\*/g, '.*?'); - if (namespaces[0] === '-') { - exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); - } else { - exports.names.push(new RegExp('^' + namespaces + '$')); - } - } -} - -/** - * Disable debug output. - * - * @api public - */ - -function disable() { - exports.enable(''); -} - -/** - * Returns true if the given mode name is enabled, false otherwise. - * - * @param {String} name - * @return {Boolean} - * @api public - */ - -function enabled(name) { - var i, len; - for (i = 0, len = exports.skips.length; i < len; i++) { - if (exports.skips[i].test(name)) { - return false; - } - } - for (i = 0, len = exports.names.length; i < len; i++) { - if (exports.names[i].test(name)) { - return true; - } - } - return false; -} - -/** - * Coerce `val`. - * - * @param {Mixed} val - * @return {Mixed} - * @api private - */ - -function coerce(val) { - if (val instanceof Error) return val.stack || val.message; - return val; -} diff --git a/node_modules/finalhandler/node_modules/debug/node.js b/node_modules/finalhandler/node_modules/debug/node.js deleted file mode 100644 index 1d392a8..0000000 --- a/node_modules/finalhandler/node_modules/debug/node.js +++ /dev/null @@ -1,209 +0,0 @@ - -/** - * Module dependencies. - */ - -var tty = require('tty'); -var util = require('util'); - -/** - * This is the Node.js implementation of `debug()`. - * - * Expose `debug()` as the module. - */ - -exports = module.exports = require('./debug'); -exports.log = log; -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; - -/** - * Colors. - */ - -exports.colors = [6, 2, 3, 4, 5, 1]; - -/** - * The file descriptor to write the `debug()` calls to. - * Set the `DEBUG_FD` env variable to override with another value. i.e.: - * - * $ DEBUG_FD=3 node script.js 3>debug.log - */ - -var fd = parseInt(process.env.DEBUG_FD, 10) || 2; -var stream = 1 === fd ? process.stdout : - 2 === fd ? process.stderr : - createWritableStdioStream(fd); - -/** - * Is stdout a TTY? Colored output is enabled when `true`. - */ - -function useColors() { - var debugColors = (process.env.DEBUG_COLORS || '').trim().toLowerCase(); - if (0 === debugColors.length) { - return tty.isatty(fd); - } else { - return '0' !== debugColors - && 'no' !== debugColors - && 'false' !== debugColors - && 'disabled' !== debugColors; - } -} - -/** - * Map %o to `util.inspect()`, since Node doesn't do that out of the box. - */ - -var inspect = (4 === util.inspect.length ? - // node <= 0.8.x - function (v, colors) { - return util.inspect(v, void 0, void 0, colors); - } : - // node > 0.8.x - function (v, colors) { - return util.inspect(v, { colors: colors }); - } -); - -exports.formatters.o = function(v) { - return inspect(v, this.useColors) - .replace(/\s*\n\s*/g, ' '); -}; - -/** - * Adds ANSI color escape codes if enabled. - * - * @api public - */ - -function formatArgs() { - var args = arguments; - var useColors = this.useColors; - var name = this.namespace; - - if (useColors) { - var c = this.color; - - args[0] = ' \u001b[3' + c + ';1m' + name + ' ' - + '\u001b[0m' - + args[0] + '\u001b[3' + c + 'm' - + ' +' + exports.humanize(this.diff) + '\u001b[0m'; - } else { - args[0] = new Date().toUTCString() - + ' ' + name + ' ' + args[0]; - } - return args; -} - -/** - * Invokes `console.error()` with the specified arguments. - */ - -function log() { - return stream.write(util.format.apply(this, arguments) + '\n'); -} - -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ - -function save(namespaces) { - if (null == namespaces) { - // If you set a process.env field to null or undefined, it gets cast to the - // string 'null' or 'undefined'. Just delete instead. - delete process.env.DEBUG; - } else { - process.env.DEBUG = namespaces; - } -} - -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ - -function load() { - return process.env.DEBUG; -} - -/** - * Copied from `node/src/node.js`. - * - * XXX: It's lame that node doesn't expose this API out-of-the-box. It also - * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame. - */ - -function createWritableStdioStream (fd) { - var stream; - var tty_wrap = process.binding('tty_wrap'); - - // Note stream._type is used for test-module-load-list.js - - switch (tty_wrap.guessHandleType(fd)) { - case 'TTY': - stream = new tty.WriteStream(fd); - stream._type = 'tty'; - - // Hack to have stream not keep the event loop alive. - // See https://github.com/joyent/node/issues/1726 - if (stream._handle && stream._handle.unref) { - stream._handle.unref(); - } - break; - - case 'FILE': - var fs = require('fs'); - stream = new fs.SyncWriteStream(fd, { autoClose: false }); - stream._type = 'fs'; - break; - - case 'PIPE': - case 'TCP': - var net = require('net'); - stream = new net.Socket({ - fd: fd, - readable: false, - writable: true - }); - - // FIXME Should probably have an option in net.Socket to create a - // stream from an existing fd which is writable only. But for now - // we'll just add this hack and set the `readable` member to false. - // Test: ./node test/fixtures/echo.js < /etc/passwd - stream.readable = false; - stream.read = null; - stream._type = 'pipe'; - - // FIXME Hack to have stream not keep the event loop alive. - // See https://github.com/joyent/node/issues/1726 - if (stream._handle && stream._handle.unref) { - stream._handle.unref(); - } - break; - - default: - // Probably an error on in uv_guess_handle() - throw new Error('Implement me. Unknown stream file type!'); - } - - // For supporting legacy API we put the FD here. - stream.fd = fd; - - stream._isStdio = true; - - return stream; -} - -/** - * Enable namespaces listed in `process.env.DEBUG` initially. - */ - -exports.enable(load()); diff --git a/node_modules/finalhandler/node_modules/debug/package.json b/node_modules/finalhandler/node_modules/debug/package.json deleted file mode 100644 index b9f033a..0000000 --- a/node_modules/finalhandler/node_modules/debug/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "debug", - "version": "2.2.0", - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/debug.git" - }, - "description": "small debugging utility", - "keywords": [ - "debug", - "log", - "debugger" - ], - "author": "TJ Holowaychuk ", - "contributors": [ - "Nathan Rajlich (http://n8.io)" - ], - "license": "MIT", - "dependencies": { - "ms": "0.7.1" - }, - "devDependencies": { - "browserify": "9.0.3", - "mocha": "*" - }, - "main": "./node.js", - "browser": "./browser.js", - "component": { - "scripts": { - "debug/index.js": "browser.js", - "debug/debug.js": "debug.js" - } - } -} diff --git a/node_modules/finalhandler/node_modules/ms/.npmignore b/node_modules/finalhandler/node_modules/ms/.npmignore deleted file mode 100644 index d1aa0ce..0000000 --- a/node_modules/finalhandler/node_modules/ms/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -node_modules -test -History.md -Makefile -component.json diff --git a/node_modules/finalhandler/node_modules/ms/History.md b/node_modules/finalhandler/node_modules/ms/History.md deleted file mode 100644 index 32fdfc1..0000000 --- a/node_modules/finalhandler/node_modules/ms/History.md +++ /dev/null @@ -1,66 +0,0 @@ - -0.7.1 / 2015-04-20 -================== - - * prevent extraordinary long inputs (@evilpacket) - * Fixed broken readme link - -0.7.0 / 2014-11-24 -================== - - * add time abbreviations, updated tests and readme for the new units - * fix example in the readme. - * add LICENSE file - -0.6.2 / 2013-12-05 -================== - - * Adding repository section to package.json to suppress warning from NPM. - -0.6.1 / 2013-05-10 -================== - - * fix singularization [visionmedia] - -0.6.0 / 2013-03-15 -================== - - * fix minutes - -0.5.1 / 2013-02-24 -================== - - * add component namespace - -0.5.0 / 2012-11-09 -================== - - * add short formatting as default and .long option - * add .license property to component.json - * add version to component.json - -0.4.0 / 2012-10-22 -================== - - * add rounding to fix crazy decimals - -0.3.0 / 2012-09-07 -================== - - * fix `ms()` [visionmedia] - -0.2.0 / 2012-09-03 -================== - - * add component.json [visionmedia] - * add days support [visionmedia] - * add hours support [visionmedia] - * add minutes support [visionmedia] - * add seconds support [visionmedia] - * add ms string support [visionmedia] - * refactor tests to facilitate ms(number) [visionmedia] - -0.1.0 / 2012-03-07 -================== - - * Initial release diff --git a/node_modules/finalhandler/node_modules/ms/LICENSE b/node_modules/finalhandler/node_modules/ms/LICENSE deleted file mode 100644 index 6c07561..0000000 --- a/node_modules/finalhandler/node_modules/ms/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -(The MIT License) - -Copyright (c) 2014 Guillermo Rauch - -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/finalhandler/node_modules/ms/README.md b/node_modules/finalhandler/node_modules/ms/README.md deleted file mode 100644 index 9b4fd03..0000000 --- a/node_modules/finalhandler/node_modules/ms/README.md +++ /dev/null @@ -1,35 +0,0 @@ -# ms.js: miliseconds conversion utility - -```js -ms('2 days') // 172800000 -ms('1d') // 86400000 -ms('10h') // 36000000 -ms('2.5 hrs') // 9000000 -ms('2h') // 7200000 -ms('1m') // 60000 -ms('5s') // 5000 -ms('100') // 100 -``` - -```js -ms(60000) // "1m" -ms(2 * 60000) // "2m" -ms(ms('10 hours')) // "10h" -``` - -```js -ms(60000, { long: true }) // "1 minute" -ms(2 * 60000, { long: true }) // "2 minutes" -ms(ms('10 hours'), { long: true }) // "10 hours" -``` - -- Node/Browser compatible. Published as [`ms`](https://www.npmjs.org/package/ms) in [NPM](http://nodejs.org/download). -- If a number is supplied to `ms`, a string with a unit is returned. -- If a string that contains the number is supplied, it returns it as -a number (e.g: it returns `100` for `'100'`). -- If you pass a string with a number and a valid unit, the number of -equivalent ms is returned. - -## License - -MIT diff --git a/node_modules/finalhandler/node_modules/ms/index.js b/node_modules/finalhandler/node_modules/ms/index.js deleted file mode 100644 index 4f92771..0000000 --- a/node_modules/finalhandler/node_modules/ms/index.js +++ /dev/null @@ -1,125 +0,0 @@ -/** - * Helpers. - */ - -var s = 1000; -var m = s * 60; -var h = m * 60; -var d = h * 24; -var y = d * 365.25; - -/** - * Parse or format the given `val`. - * - * Options: - * - * - `long` verbose formatting [false] - * - * @param {String|Number} val - * @param {Object} options - * @return {String|Number} - * @api public - */ - -module.exports = function(val, options){ - options = options || {}; - if ('string' == typeof val) return parse(val); - return options.long - ? long(val) - : short(val); -}; - -/** - * Parse the given `str` and return milliseconds. - * - * @param {String} str - * @return {Number} - * @api private - */ - -function parse(str) { - str = '' + str; - if (str.length > 10000) return; - var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str); - if (!match) return; - var n = parseFloat(match[1]); - var type = (match[2] || 'ms').toLowerCase(); - switch (type) { - case 'years': - case 'year': - case 'yrs': - case 'yr': - case 'y': - return n * y; - case 'days': - case 'day': - case 'd': - return n * d; - case 'hours': - case 'hour': - case 'hrs': - case 'hr': - case 'h': - return n * h; - case 'minutes': - case 'minute': - case 'mins': - case 'min': - case 'm': - return n * m; - case 'seconds': - case 'second': - case 'secs': - case 'sec': - case 's': - return n * s; - case 'milliseconds': - case 'millisecond': - case 'msecs': - case 'msec': - case 'ms': - return n; - } -} - -/** - * Short format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function short(ms) { - if (ms >= d) return Math.round(ms / d) + 'd'; - if (ms >= h) return Math.round(ms / h) + 'h'; - if (ms >= m) return Math.round(ms / m) + 'm'; - if (ms >= s) return Math.round(ms / s) + 's'; - return ms + 'ms'; -} - -/** - * Long format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function long(ms) { - return plural(ms, d, 'day') - || plural(ms, h, 'hour') - || plural(ms, m, 'minute') - || plural(ms, s, 'second') - || ms + ' ms'; -} - -/** - * Pluralization helper. - */ - -function plural(ms, n, name) { - if (ms < n) return; - if (ms < n * 1.5) return Math.floor(ms / n) + ' ' + name; - return Math.ceil(ms / n) + ' ' + name + 's'; -} diff --git a/node_modules/finalhandler/node_modules/ms/package.json b/node_modules/finalhandler/node_modules/ms/package.json deleted file mode 100644 index a4e5bb6..0000000 --- a/node_modules/finalhandler/node_modules/ms/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "ms", - "version": "0.7.1", - "description": "Tiny ms conversion utility", - "repository": { - "type": "git", - "url": "git://github.com/guille/ms.js.git" - }, - "main": "./index", - "devDependencies": { - "mocha": "*", - "expect.js": "*", - "serve": "*" - }, - "component": { - "scripts": { - "ms/index.js": "index.js" - } - } -} diff --git a/node_modules/finalhandler/node_modules/on-finished/HISTORY.md b/node_modules/finalhandler/node_modules/on-finished/HISTORY.md deleted file mode 100644 index 98ff0e9..0000000 --- a/node_modules/finalhandler/node_modules/on-finished/HISTORY.md +++ /dev/null @@ -1,88 +0,0 @@ -2.3.0 / 2015-05-26 -================== - - * Add defined behavior for HTTP `CONNECT` requests - * Add defined behavior for HTTP `Upgrade` requests - * deps: ee-first@1.1.1 - -2.2.1 / 2015-04-22 -================== - - * Fix `isFinished(req)` when data buffered - -2.2.0 / 2014-12-22 -================== - - * Add message object to callback arguments - -2.1.1 / 2014-10-22 -================== - - * Fix handling of pipelined requests - -2.1.0 / 2014-08-16 -================== - - * Check if `socket` is detached - * Return `undefined` for `isFinished` if state unknown - -2.0.0 / 2014-08-16 -================== - - * Add `isFinished` function - * Move to `jshttp` organization - * Remove support for plain socket argument - * Rename to `on-finished` - * Support both `req` and `res` as arguments - * deps: ee-first@1.0.5 - -1.2.2 / 2014-06-10 -================== - - * Reduce listeners added to emitters - - avoids "event emitter leak" warnings when used multiple times on same request - -1.2.1 / 2014-06-08 -================== - - * Fix returned value when already finished - -1.2.0 / 2014-06-05 -================== - - * Call callback when called on already-finished socket - -1.1.4 / 2014-05-27 -================== - - * Support node.js 0.8 - -1.1.3 / 2014-04-30 -================== - - * Make sure errors passed as instanceof `Error` - -1.1.2 / 2014-04-18 -================== - - * Default the `socket` to passed-in object - -1.1.1 / 2014-01-16 -================== - - * Rename module to `finished` - -1.1.0 / 2013-12-25 -================== - - * Call callback when called on already-errored socket - -1.0.1 / 2013-12-20 -================== - - * Actually pass the error to the callback - -1.0.0 / 2013-12-20 -================== - - * Initial release diff --git a/node_modules/finalhandler/node_modules/on-finished/LICENSE b/node_modules/finalhandler/node_modules/on-finished/LICENSE deleted file mode 100644 index 5931fd2..0000000 --- a/node_modules/finalhandler/node_modules/on-finished/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -(The MIT License) - -Copyright (c) 2013 Jonathan Ong -Copyright (c) 2014 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/finalhandler/node_modules/on-finished/README.md b/node_modules/finalhandler/node_modules/on-finished/README.md deleted file mode 100644 index a0e1157..0000000 --- a/node_modules/finalhandler/node_modules/on-finished/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# on-finished - -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Node.js Version][node-version-image]][node-version-url] -[![Build Status][travis-image]][travis-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -Execute a callback when a HTTP request closes, finishes, or errors. - -## Install - -```sh -$ npm install on-finished -``` - -## API - -```js -var onFinished = require('on-finished') -``` - -### onFinished(res, listener) - -Attach a listener to listen for the response to finish. The listener will -be invoked only once when the response finished. If the response finished -to an error, the first argument will contain the error. If the response -has already finished, the listener will be invoked. - -Listening to the end of a response would be used to close things associated -with the response, like open files. - -Listener is invoked as `listener(err, res)`. - -```js -onFinished(res, function (err, res) { - // clean up open fds, etc. - // err contains the error is request error'd -}) -``` - -### onFinished(req, listener) - -Attach a listener to listen for the request to finish. The listener will -be invoked only once when the request finished. If the request finished -to an error, the first argument will contain the error. If the request -has already finished, the listener will be invoked. - -Listening to the end of a request would be used to know when to continue -after reading the data. - -Listener is invoked as `listener(err, req)`. - -```js -var data = '' - -req.setEncoding('utf8') -res.on('data', function (str) { - data += str -}) - -onFinished(req, function (err, req) { - // data is read unless there is err -}) -``` - -### onFinished.isFinished(res) - -Determine if `res` is already finished. This would be useful to check and -not even start certain operations if the response has already finished. - -### onFinished.isFinished(req) - -Determine if `req` is already finished. This would be useful to check and -not even start certain operations if the request has already finished. - -## Special Node.js requests - -### HTTP CONNECT method - -The meaning of the `CONNECT` method from RFC 7231, section 4.3.6: - -> The CONNECT method requests that the recipient establish a tunnel to -> the destination origin server identified by the request-target and, -> if successful, thereafter restrict its behavior to blind forwarding -> of packets, in both directions, until the tunnel is closed. Tunnels -> are commonly used to create an end-to-end virtual connection, through -> one or more proxies, which can then be secured using TLS (Transport -> Layer Security, [RFC5246]). - -In Node.js, these request objects come from the `'connect'` event on -the HTTP server. - -When this module is used on a HTTP `CONNECT` request, the request is -considered "finished" immediately, **due to limitations in the Node.js -interface**. This means if the `CONNECT` request contains a request entity, -the request will be considered "finished" even before it has been read. - -There is no such thing as a response object to a `CONNECT` request in -Node.js, so there is no support for for one. - -### HTTP Upgrade request - -The meaning of the `Upgrade` header from RFC 7230, section 6.1: - -> The "Upgrade" header field is intended to provide a simple mechanism -> for transitioning from HTTP/1.1 to some other protocol on the same -> connection. - -In Node.js, these request objects come from the `'upgrade'` event on -the HTTP server. - -When this module is used on a HTTP request with an `Upgrade` header, the -request is considered "finished" immediately, **due to limitations in the -Node.js interface**. This means if the `Upgrade` request contains a request -entity, the request will be considered "finished" even before it has been -read. - -There is no such thing as a response object to a `Upgrade` request in -Node.js, so there is no support for for one. - -## Example - -The following code ensures that file descriptors are always closed -once the response finishes. - -```js -var destroy = require('destroy') -var http = require('http') -var onFinished = require('on-finished') - -http.createServer(function onRequest(req, res) { - var stream = fs.createReadStream('package.json') - stream.pipe(res) - onFinished(res, function (err) { - destroy(stream) - }) -}) -``` - -## License - -[MIT](LICENSE) - -[npm-image]: https://img.shields.io/npm/v/on-finished.svg -[npm-url]: https://npmjs.org/package/on-finished -[node-version-image]: https://img.shields.io/node/v/on-finished.svg -[node-version-url]: http://nodejs.org/download/ -[travis-image]: https://img.shields.io/travis/jshttp/on-finished/master.svg -[travis-url]: https://travis-ci.org/jshttp/on-finished -[coveralls-image]: https://img.shields.io/coveralls/jshttp/on-finished/master.svg -[coveralls-url]: https://coveralls.io/r/jshttp/on-finished?branch=master -[downloads-image]: https://img.shields.io/npm/dm/on-finished.svg -[downloads-url]: https://npmjs.org/package/on-finished diff --git a/node_modules/finalhandler/node_modules/on-finished/index.js b/node_modules/finalhandler/node_modules/on-finished/index.js deleted file mode 100644 index 9abd98f..0000000 --- a/node_modules/finalhandler/node_modules/on-finished/index.js +++ /dev/null @@ -1,196 +0,0 @@ -/*! - * on-finished - * Copyright(c) 2013 Jonathan Ong - * Copyright(c) 2014 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module exports. - * @public - */ - -module.exports = onFinished -module.exports.isFinished = isFinished - -/** - * Module dependencies. - * @private - */ - -var first = require('ee-first') - -/** - * Variables. - * @private - */ - -/* istanbul ignore next */ -var defer = typeof setImmediate === 'function' - ? setImmediate - : function(fn){ process.nextTick(fn.bind.apply(fn, arguments)) } - -/** - * Invoke callback when the response has finished, useful for - * cleaning up resources afterwards. - * - * @param {object} msg - * @param {function} listener - * @return {object} - * @public - */ - -function onFinished(msg, listener) { - if (isFinished(msg) !== false) { - defer(listener, null, msg) - return msg - } - - // attach the listener to the message - attachListener(msg, listener) - - return msg -} - -/** - * Determine if message is already finished. - * - * @param {object} msg - * @return {boolean} - * @public - */ - -function isFinished(msg) { - var socket = msg.socket - - if (typeof msg.finished === 'boolean') { - // OutgoingMessage - return Boolean(msg.finished || (socket && !socket.writable)) - } - - if (typeof msg.complete === 'boolean') { - // IncomingMessage - return Boolean(msg.upgrade || !socket || !socket.readable || (msg.complete && !msg.readable)) - } - - // don't know - return undefined -} - -/** - * Attach a finished listener to the message. - * - * @param {object} msg - * @param {function} callback - * @private - */ - -function attachFinishedListener(msg, callback) { - var eeMsg - var eeSocket - var finished = false - - function onFinish(error) { - eeMsg.cancel() - eeSocket.cancel() - - finished = true - callback(error) - } - - // finished on first message event - eeMsg = eeSocket = first([[msg, 'end', 'finish']], onFinish) - - function onSocket(socket) { - // remove listener - msg.removeListener('socket', onSocket) - - if (finished) return - if (eeMsg !== eeSocket) return - - // finished on first socket event - eeSocket = first([[socket, 'error', 'close']], onFinish) - } - - if (msg.socket) { - // socket already assigned - onSocket(msg.socket) - return - } - - // wait for socket to be assigned - msg.on('socket', onSocket) - - if (msg.socket === undefined) { - // node.js 0.8 patch - patchAssignSocket(msg, onSocket) - } -} - -/** - * Attach the listener to the message. - * - * @param {object} msg - * @return {function} - * @private - */ - -function attachListener(msg, listener) { - var attached = msg.__onFinished - - // create a private single listener with queue - if (!attached || !attached.queue) { - attached = msg.__onFinished = createListener(msg) - attachFinishedListener(msg, attached) - } - - attached.queue.push(listener) -} - -/** - * Create listener on message. - * - * @param {object} msg - * @return {function} - * @private - */ - -function createListener(msg) { - function listener(err) { - if (msg.__onFinished === listener) msg.__onFinished = null - if (!listener.queue) return - - var queue = listener.queue - listener.queue = null - - for (var i = 0; i < queue.length; i++) { - queue[i](err, msg) - } - } - - listener.queue = [] - - return listener -} - -/** - * Patch ServerResponse.prototype.assignSocket for node.js 0.8. - * - * @param {ServerResponse} res - * @param {function} callback - * @private - */ - -function patchAssignSocket(res, callback) { - var assignSocket = res.assignSocket - - if (typeof assignSocket !== 'function') return - - // res.on('socket', callback) is broken in 0.8 - res.assignSocket = function _assignSocket(socket) { - assignSocket.call(this, socket) - callback(socket) - } -} diff --git a/node_modules/finalhandler/node_modules/on-finished/package.json b/node_modules/finalhandler/node_modules/on-finished/package.json deleted file mode 100644 index b9df1bd..0000000 --- a/node_modules/finalhandler/node_modules/on-finished/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "on-finished", - "description": "Execute a callback when a request closes, finishes, or errors", - "version": "2.3.0", - "contributors": [ - "Douglas Christopher Wilson ", - "Jonathan Ong (http://jongleberry.com)" - ], - "license": "MIT", - "repository": "jshttp/on-finished", - "dependencies": { - "ee-first": "1.1.1" - }, - "devDependencies": { - "istanbul": "0.3.9", - "mocha": "2.2.5" - }, - "engines": { - "node": ">= 0.8" - }, - "files": [ - "HISTORY.md", - "LICENSE", - "index.js" - ], - "scripts": { - "test": "mocha --reporter spec --bail --check-leaks test/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" - } -} diff --git a/node_modules/finalhandler/package.json b/node_modules/finalhandler/package.json index 244a1ac..16bf11e 100644 --- a/node_modules/finalhandler/package.json +++ b/node_modules/finalhandler/package.json @@ -1,33 +1,46 @@ { "name": "finalhandler", "description": "Node.js final http responder", - "version": "0.4.0", + "version": "1.2.0", "author": "Douglas Christopher Wilson ", "license": "MIT", "repository": "pillarjs/finalhandler", "dependencies": { - "debug": "~2.2.0", - "escape-html": "1.0.2", - "on-finished": "~2.3.0", + "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" }, "devDependencies": { - "istanbul": "0.3.15", - "mocha": "2.2.5", - "readable-stream": "2.0.0", - "supertest": "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": "5.2.0", + "eslint-plugin-standard": "4.1.0", + "mocha": "9.2.2", + "nyc": "15.1.0", + "readable-stream": "2.3.6", + "safe-buffer": "5.2.1", + "supertest": "6.2.2" }, "files": [ "LICENSE", "HISTORY.md", + "SECURITY.md", "index.js" ], "engines": { "node": ">= 0.8" }, "scripts": { + "lint": "eslint .", "test": "mocha --reporter spec --bail --check-leaks test/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" } } diff --git a/node_modules/forwarded/HISTORY.md b/node_modules/forwarded/HISTORY.md index 2599a55..381e6aa 100644 --- a/node_modules/forwarded/HISTORY.md +++ b/node_modules/forwarded/HISTORY.md @@ -1,3 +1,8 @@ +0.2.0 / 2021-05-31 +================== + + * Use `req.socket` over deprecated `req.connection` + 0.1.2 / 2017-09-14 ================== diff --git a/node_modules/forwarded/README.md b/node_modules/forwarded/README.md index c776ee5..fdd220b 100644 --- a/node_modules/forwarded/README.md +++ b/node_modules/forwarded/README.md @@ -3,7 +3,7 @@ [![NPM Version][npm-image]][npm-url] [![NPM Downloads][downloads-image]][downloads-url] [![Node.js Version][node-version-image]][node-version-url] -[![Build Status][travis-image]][travis-url] +[![Build Status][ci-image]][ci-url] [![Test Coverage][coveralls-image]][coveralls-url] Parse HTTP X-Forwarded-For header @@ -45,12 +45,12 @@ $ npm test [MIT](LICENSE) +[ci-image]: https://badgen.net/github/checks/jshttp/forwarded/master?label=ci +[ci-url]: https://github.com/jshttp/forwarded/actions?query=workflow%3Aci [npm-image]: https://img.shields.io/npm/v/forwarded.svg [npm-url]: https://npmjs.org/package/forwarded [node-version-image]: https://img.shields.io/node/v/forwarded.svg [node-version-url]: https://nodejs.org/en/download/ -[travis-image]: https://img.shields.io/travis/jshttp/forwarded/master.svg -[travis-url]: https://travis-ci.org/jshttp/forwarded [coveralls-image]: https://img.shields.io/coveralls/jshttp/forwarded/master.svg [coveralls-url]: https://coveralls.io/r/jshttp/forwarded?branch=master [downloads-image]: https://img.shields.io/npm/dm/forwarded.svg diff --git a/node_modules/forwarded/index.js b/node_modules/forwarded/index.js index 7833b3d..b2b6bdd 100644 --- a/node_modules/forwarded/index.js +++ b/node_modules/forwarded/index.js @@ -28,13 +28,27 @@ function forwarded (req) { // simple header parsing var proxyAddrs = parse(req.headers['x-forwarded-for'] || '') - var socketAddr = req.connection.remoteAddress + var socketAddr = getSocketAddr(req) var addrs = [socketAddr].concat(proxyAddrs) // return all addresses return addrs } +/** + * Get the socket address for a request. + * + * @param {object} req + * @return {string} + * @private + */ + +function getSocketAddr (req) { + return req.socket + ? req.socket.remoteAddress + : req.connection.remoteAddress +} + /** * Parse the X-Forwarded-For header. * diff --git a/node_modules/forwarded/package.json b/node_modules/forwarded/package.json index 501f6d2..bf9c7d6 100644 --- a/node_modules/forwarded/package.json +++ b/node_modules/forwarded/package.json @@ -1,7 +1,7 @@ { "name": "forwarded", "description": "Parse HTTP X-Forwarded-For header", - "version": "0.1.2", + "version": "0.2.0", "contributors": [ "Douglas Christopher Wilson " ], @@ -15,14 +15,15 @@ "devDependencies": { "beautify-benchmark": "0.2.4", "benchmark": "2.1.4", - "eslint": "3.19.0", - "eslint-config-standard": "10.2.1", - "eslint-plugin-import": "2.7.0", - "eslint-plugin-node": "5.1.1", - "eslint-plugin-promise": "3.5.0", - "eslint-plugin-standard": "3.0.1", - "istanbul": "0.4.5", - "mocha": "1.21.5" + "deep-equal": "1.0.1", + "eslint": "7.27.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.23.4", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "4.3.1", + "eslint-plugin-standard": "4.1.0", + "mocha": "8.4.0", + "nyc": "15.1.0" }, "files": [ "LICENSE", @@ -37,7 +38,8 @@ "bench": "node benchmark/index.js", "lint": "eslint .", "test": "mocha --reporter spec --bail --check-leaks test/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + "test-ci": "nyc --reporter=lcov --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test", + "version": "node scripts/version-history.js && git add HISTORY.md" } } diff --git a/node_modules/fresh/HISTORY.md b/node_modules/fresh/HISTORY.md index 3c95fbb..4586996 100644 --- a/node_modules/fresh/HISTORY.md +++ b/node_modules/fresh/HISTORY.md @@ -1,3 +1,34 @@ +0.5.2 / 2017-09-13 +================== + + * Fix regression matching multiple ETags in `If-None-Match` + * perf: improve `If-None-Match` token parsing + +0.5.1 / 2017-09-11 +================== + + * Fix handling of modified headers with invalid dates + * perf: improve ETag match loop + +0.5.0 / 2017-02-21 +================== + + * Fix incorrect result when `If-None-Match` has both `*` and ETags + * Fix weak `ETag` matching to match spec + * perf: delay reading header values until needed + * perf: skip checking modified time if ETag check failed + * perf: skip parsing `If-None-Match` when no `ETag` header + * perf: use `Date.parse` instead of `new Date` + +0.4.0 / 2017-02-05 +================== + + * Fix false detection of `no-cache` request directive + * perf: enable strict mode + * perf: hoist regular expressions + * perf: remove duplicate conditional + * perf: remove unnecessary boolean coercions + 0.3.0 / 2015-05-12 ================== @@ -30,6 +61,7 @@ 0.1.0 / 2012-06-15 ================== + * Add `If-None-Match: *` support 0.0.1 / 2012-06-10 diff --git a/node_modules/fresh/LICENSE b/node_modules/fresh/LICENSE index f527394..1434ade 100644 --- a/node_modules/fresh/LICENSE +++ b/node_modules/fresh/LICENSE @@ -1,6 +1,7 @@ (The MIT License) Copyright (c) 2012 TJ Holowaychuk +Copyright (c) 2016-2017 Douglas Christopher Wilson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/node_modules/fresh/README.md b/node_modules/fresh/README.md index 0813e30..1c1c680 100644 --- a/node_modules/fresh/README.md +++ b/node_modules/fresh/README.md @@ -10,38 +10,99 @@ HTTP response freshness testing ## 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): + ``` $ npm install fresh ``` ## API + + ```js var fresh = require('fresh') ``` -### fresh(req, res) +### fresh(reqHeaders, resHeaders) - Check freshness of `req` and `res` headers. +Check freshness of the response using request and response headers. - When the cache is "fresh" __true__ is returned, - otherwise __false__ is returned to indicate that - the cache is now stale. +When the response is still "fresh" in the client's cache `true` is +returned, otherwise `false` is returned to indicate that the client +cache is now stale and the full response should be sent. + +When a client sends the `Cache-Control: no-cache` request header to +indicate an end-to-end reload request, this module will return `false` +to make handling these requests transparent. + +## Known Issues + +This module is designed to only follow the HTTP specifications, not +to work-around all kinda of client bugs (especially since this module +typically does not recieve enough information to understand what the +client actually is). + +There is a known issue that in certain versions of Safari, Safari +will incorrectly make a request that allows this module to validate +freshness of the resource even when Safari does not have a +representation of the resource in the cache. The module +[jumanji](https://www.npmjs.com/package/jumanji) can be used in +an Express application to work-around this issue and also provides +links to further reading on this Safari bug. ## Example +### API usage + + + ```js -var req = { 'if-none-match': 'tobi' }; -var res = { 'etag': 'luna' }; -fresh(req, res); +var reqHeaders = { 'if-none-match': '"foo"' } +var resHeaders = { 'etag': '"bar"' } +fresh(reqHeaders, resHeaders) // => false -var req = { 'if-none-match': 'tobi' }; -var res = { 'etag': 'tobi' }; -fresh(req, res); +var reqHeaders = { 'if-none-match': '"foo"' } +var resHeaders = { 'etag': '"foo"' } +fresh(reqHeaders, resHeaders) // => true ``` +### Using with Node.js http server + +```js +var fresh = require('fresh') +var http = require('http') + +var server = http.createServer(function (req, res) { + // perform server logic + // ... including adding ETag / Last-Modified response headers + + if (isFresh(req, res)) { + // client has a fresh copy of resource + res.statusCode = 304 + res.end() + return + } + + // send the resource + res.statusCode = 200 + res.end('hello, world!') +}) + +function isFresh (req, res) { + return fresh(req.headers, { + 'etag': res.getHeader('ETag'), + 'last-modified': res.getHeader('Last-Modified') + }) +} + +server.listen(3000) +``` + ## License [MIT](LICENSE) @@ -49,7 +110,7 @@ fresh(req, res); [npm-image]: https://img.shields.io/npm/v/fresh.svg [npm-url]: https://npmjs.org/package/fresh [node-version-image]: https://img.shields.io/node/v/fresh.svg -[node-version-url]: http://nodejs.org/download/ +[node-version-url]: https://nodejs.org/en/ [travis-image]: https://img.shields.io/travis/jshttp/fresh/master.svg [travis-url]: https://travis-ci.org/jshttp/fresh [coveralls-image]: https://img.shields.io/coveralls/jshttp/fresh/master.svg diff --git a/node_modules/fresh/index.js b/node_modules/fresh/index.js index a900873..d154f5a 100644 --- a/node_modules/fresh/index.js +++ b/node_modules/fresh/index.js @@ -1,57 +1,137 @@ - -/** - * Expose `fresh()`. +/*! + * fresh + * Copyright(c) 2012 TJ Holowaychuk + * Copyright(c) 2016-2017 Douglas Christopher Wilson + * MIT Licensed */ -module.exports = fresh; +'use strict' /** - * Check freshness of `req` and `res` headers. + * RegExp to check for no-cache token in Cache-Control. + * @private + */ + +var CACHE_CONTROL_NO_CACHE_REGEXP = /(?:^|,)\s*?no-cache\s*?(?:,|$)/ + +/** + * Module exports. + * @public + */ + +module.exports = fresh + +/** + * Check freshness of the response using request and response headers. * - * When the cache is "fresh" __true__ is returned, - * otherwise __false__ is returned to indicate that - * the cache is now stale. - * - * @param {Object} req - * @param {Object} res + * @param {Object} reqHeaders + * @param {Object} resHeaders * @return {Boolean} - * @api public + * @public */ -function fresh(req, res) { - // defaults - var etagMatches = true; - var notModified = true; - +function fresh (reqHeaders, resHeaders) { // fields - var modifiedSince = req['if-modified-since']; - var noneMatch = req['if-none-match']; - var lastModified = res['last-modified']; - var etag = res['etag']; - var cc = req['cache-control']; + var modifiedSince = reqHeaders['if-modified-since'] + var noneMatch = reqHeaders['if-none-match'] // unconditional request - if (!modifiedSince && !noneMatch) return false; + if (!modifiedSince && !noneMatch) { + return false + } - // check for no-cache cache request directive - if (cc && cc.indexOf('no-cache') !== -1) return false; - - // parse if-none-match - if (noneMatch) noneMatch = noneMatch.split(/ *, */); + // Always return stale when Cache-Control: no-cache + // to support end-to-end reload requests + // https://tools.ietf.org/html/rfc2616#section-14.9.4 + var cacheControl = reqHeaders['cache-control'] + if (cacheControl && CACHE_CONTROL_NO_CACHE_REGEXP.test(cacheControl)) { + return false + } // if-none-match - if (noneMatch) { - etagMatches = noneMatch.some(function (match) { - return match === '*' || match === etag || match === 'W/' + etag; - }); + if (noneMatch && noneMatch !== '*') { + var etag = resHeaders['etag'] + + if (!etag) { + return false + } + + var etagStale = true + var matches = parseTokenList(noneMatch) + for (var i = 0; i < matches.length; i++) { + var match = matches[i] + if (match === etag || match === 'W/' + etag || 'W/' + match === etag) { + etagStale = false + break + } + } + + if (etagStale) { + return false + } } // if-modified-since if (modifiedSince) { - modifiedSince = new Date(modifiedSince); - lastModified = new Date(lastModified); - notModified = lastModified <= modifiedSince; + var lastModified = resHeaders['last-modified'] + var modifiedStale = !lastModified || !(parseHttpDate(lastModified) <= parseHttpDate(modifiedSince)) + + if (modifiedStale) { + return false + } } - return !! (etagMatches && notModified); + return true +} + +/** + * Parse an HTTP Date into a number. + * + * @param {string} date + * @private + */ + +function parseHttpDate (date) { + var timestamp = date && Date.parse(date) + + // istanbul ignore next: guard against date.js Date.parse patching + return typeof timestamp === 'number' + ? timestamp + : NaN +} + +/** + * Parse a HTTP token list. + * + * @param {string} str + * @private + */ + +function parseTokenList (str) { + var end = 0 + var list = [] + var start = 0 + + // gather tokens + for (var i = 0, len = str.length; i < len; i++) { + switch (str.charCodeAt(i)) { + case 0x20: /* */ + if (start === end) { + start = end = i + 1 + } + break + case 0x2c: /* , */ + list.push(str.substring(start, end)) + start = end = i + 1 + break + default: + end = i + 1 + break + } + } + + // final token + list.push(str.substring(start, end)) + + return list } diff --git a/node_modules/fresh/package.json b/node_modules/fresh/package.json index 714f54c..c2fa0f4 100644 --- a/node_modules/fresh/package.json +++ b/node_modules/fresh/package.json @@ -1,7 +1,7 @@ { "name": "fresh", "description": "HTTP response freshness testing", - "version": "0.3.0", + "version": "0.5.2", "author": "TJ Holowaychuk (http://tjholowaychuk.com)", "contributors": [ "Douglas Christopher Wilson ", @@ -16,7 +16,16 @@ ], "repository": "jshttp/fresh", "devDependencies": { - "istanbul": "0.3.9", + "beautify-benchmark": "0.2.4", + "benchmark": "2.1.4", + "eslint": "3.19.0", + "eslint-config-standard": "10.2.1", + "eslint-plugin-import": "2.7.0", + "eslint-plugin-markdown": "1.0.0-beta.6", + "eslint-plugin-node": "5.1.1", + "eslint-plugin-promise": "3.5.0", + "eslint-plugin-standard": "3.0.1", + "istanbul": "0.4.5", "mocha": "1.21.5" }, "files": [ @@ -28,6 +37,8 @@ "node": ">= 0.6" }, "scripts": { + "bench": "node benchmark/index.js", + "lint": "eslint --plugin markdown --ext js,md .", "test": "mocha --reporter spec --bail --check-leaks test/", "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" diff --git a/node_modules/generate-function/README.md b/node_modules/generate-function/README.md deleted file mode 100644 index 97419e9..0000000 --- a/node_modules/generate-function/README.md +++ /dev/null @@ -1,89 +0,0 @@ -# generate-function - -Module that helps you write generated functions in Node - -``` -npm install generate-function -``` - -[![build status](http://img.shields.io/travis/mafintosh/generate-function.svg?style=flat)](http://travis-ci.org/mafintosh/generate-function) - -## Disclamer - -Writing code that generates code is hard. -You should only use this if you really, really, really need this for performance reasons (like schema validators / parsers etc). - -## Usage - -``` js -const genfun = require('generate-function') -const { d } = genfun.formats - -function addNumber (val) { - const gen = genfun() - - gen(` - function add (n) {') - return n + ${d(val)}) // supports format strings to insert values - } - `) - - return gen.toFunction() // will compile the function -} - -const add2 = addNumber(2) - -console.log('1 + 2 =', add2(1)) -console.log(add2.toString()) // prints the generated function -``` - -If you need to close over variables in your generated function pass them to `toFunction(scope)` - -``` js -function multiply (a, b) { - return a * b -} - -function addAndMultiplyNumber (val) { - const gen = genfun() - - gen(` - function (n) { - if (typeof n !== 'number') { - throw new Error('argument should be a number') - } - const result = multiply(${d(val)}, n + ${d(val)}) - return result - } - `) - - // use gen.toString() if you want to see the generated source - - return gen.toFunction({multiply}) -} - -const addAndMultiply2 = addAndMultiplyNumber(2) - -console.log(addAndMultiply2.toString()) -console.log('(3 + 2) * 2 =', addAndMultiply2(3)) -``` - -You can call `gen(src)` as many times as you want to append more source code to the function. - -## Variables - -If you need a unique safe identifier for the scope of the generated function call `str = gen.sym('friendlyName')`. -These are safe to use for variable names etc. - -## Object properties - -If you need to access an object property use the `str = gen.property('objectName', 'propertyName')`. - -This returns `'objectName.propertyName'` if `propertyName` is safe to use as a variable. Otherwise -it returns `objectName[propertyNameAsString]`. - -If you only pass `gen.property('propertyName')` it will only return the `propertyName` part safely - -## License - -MIT diff --git a/node_modules/generate-function/example.js b/node_modules/generate-function/example.js deleted file mode 100644 index 7c36c76..0000000 --- a/node_modules/generate-function/example.js +++ /dev/null @@ -1,27 +0,0 @@ -const genfun = require('./') -const { d } = genfun.formats - -function multiply (a, b) { - return a * b -} - -function addAndMultiplyNumber (val) { - const fn = genfun(` - function (n) { - if (typeof n !== 'number') { - throw new Error('argument should be a number') - } - const result = multiply(${d(val)}, n + ${d(val)}) - return result - } - `) - - // use fn.toString() if you want to see the generated source - - return fn.toFunction({multiply}) -} - -const addAndMultiply2 = addAndMultiplyNumber(2) - -console.log(addAndMultiply2.toString()) -console.log('(3 + 2) * 2 =', addAndMultiply2(3)) diff --git a/node_modules/generate-function/index.js b/node_modules/generate-function/index.js deleted file mode 100644 index 8105dc0..0000000 --- a/node_modules/generate-function/index.js +++ /dev/null @@ -1,181 +0,0 @@ -var util = require('util') -var isProperty = require('is-property') - -var INDENT_START = /[\{\[]/ -var INDENT_END = /[\}\]]/ - -// from https://mathiasbynens.be/notes/reserved-keywords -var RESERVED = [ - 'do', - 'if', - 'in', - 'for', - 'let', - 'new', - 'try', - 'var', - 'case', - 'else', - 'enum', - 'eval', - 'null', - 'this', - 'true', - 'void', - 'with', - 'await', - 'break', - 'catch', - 'class', - 'const', - 'false', - 'super', - 'throw', - 'while', - 'yield', - 'delete', - 'export', - 'import', - 'public', - 'return', - 'static', - 'switch', - 'typeof', - 'default', - 'extends', - 'finally', - 'package', - 'private', - 'continue', - 'debugger', - 'function', - 'arguments', - 'interface', - 'protected', - 'implements', - 'instanceof', - 'NaN', - 'undefined' -] - -var RESERVED_MAP = {} - -for (var i = 0; i < RESERVED.length; i++) { - RESERVED_MAP[RESERVED[i]] = true -} - -var isVariable = function (name) { - return isProperty(name) && !RESERVED_MAP.hasOwnProperty(name) -} - -var formats = { - s: function(s) { - return '' + s - }, - d: function(d) { - return '' + Number(d) - }, - o: function(o) { - return JSON.stringify(o) - } -} - -var genfun = function() { - var lines = [] - var indent = 0 - var vars = {} - - var push = function(str) { - var spaces = '' - while (spaces.length < indent*2) spaces += ' ' - lines.push(spaces+str) - } - - var pushLine = function(line) { - if (INDENT_END.test(line.trim()[0]) && INDENT_START.test(line[line.length-1])) { - indent-- - push(line) - indent++ - return - } - if (INDENT_START.test(line[line.length-1])) { - push(line) - indent++ - return - } - if (INDENT_END.test(line.trim()[0])) { - indent-- - push(line) - return - } - - push(line) - } - - var line = function(fmt) { - if (!fmt) return line - - if (arguments.length === 1 && fmt.indexOf('\n') > -1) { - var lines = fmt.trim().split('\n') - for (var i = 0; i < lines.length; i++) { - pushLine(lines[i].trim()) - } - } else { - pushLine(util.format.apply(util, arguments)) - } - - return line - } - - line.scope = {} - line.formats = formats - - line.sym = function(name) { - if (!name || !isVariable(name)) name = 'tmp' - if (!vars[name]) vars[name] = 0 - return name + (vars[name]++ || '') - } - - line.property = function(obj, name) { - if (arguments.length === 1) { - name = obj - obj = '' - } - - name = name + '' - - if (isProperty(name)) return (obj ? obj + '.' + name : name) - return obj ? obj + '[' + JSON.stringify(name) + ']' : JSON.stringify(name) - } - - line.toString = function() { - return lines.join('\n') - } - - line.toFunction = function(scope) { - if (!scope) scope = {} - - var src = 'return ('+line.toString()+')' - - Object.keys(line.scope).forEach(function (key) { - if (!scope[key]) scope[key] = line.scope[key] - }) - - var keys = Object.keys(scope).map(function(key) { - return key - }) - - var vals = keys.map(function(key) { - return scope[key] - }) - - return Function.apply(null, keys.concat(src)).apply(null, vals) - } - - if (arguments.length) line.apply(null, arguments) - - return line -} - -genfun.formats = formats -module.exports = genfun diff --git a/node_modules/generate-function/package.json b/node_modules/generate-function/package.json deleted file mode 100644 index be2ac04..0000000 --- a/node_modules/generate-function/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "generate-function", - "version": "2.3.1", - "description": "Module that helps you write generated functions in Node", - "main": "index.js", - "scripts": { - "test": "tape test.js" - }, - "repository": { - "type": "git", - "url": "https://github.com/mafintosh/generate-function" - }, - "keywords": [ - "generate", - "code", - "generation", - "function", - "performance" - ], - "author": "Mathias Buus", - "license": "MIT", - "bugs": { - "url": "https://github.com/mafintosh/generate-function/issues" - }, - "homepage": "https://github.com/mafintosh/generate-function", - "devDependencies": { - "tape": "^4.9.1" - }, - "dependencies": { - "is-property": "^1.0.2" - } -} diff --git a/node_modules/generate-function/test.js b/node_modules/generate-function/test.js deleted file mode 100644 index 9337b71..0000000 --- a/node_modules/generate-function/test.js +++ /dev/null @@ -1,49 +0,0 @@ -var tape = require('tape') -var genfun = require('./') - -tape('generate add function', function(t) { - var fn = genfun() - ('function add(n) {') - ('return n + %d', 42) - ('}') - - t.same(fn.toString(), 'function add(n) {\n return n + 42\n}', 'code is indented') - t.same(fn.toFunction()(10), 52, 'function works') - t.end() -}) - -tape('generate function + closed variables', function(t) { - var fn = genfun() - ('function add(n) {') - ('return n + %d + number', 42) - ('}') - - var notGood = fn.toFunction() - var good = fn.toFunction({number:10}) - - try { - notGood(10) - t.ok(false, 'function should not work') - } catch (err) { - t.same(err.message, 'number is not defined', 'throws reference error') - } - - t.same(good(11), 63, 'function with closed var works') - t.end() -}) - -tape('generate property', function(t) { - var gen = genfun() - - t.same(gen.property('a'), 'a') - t.same(gen.property('42'), '"42"') - t.same(gen.property('b', 'a'), 'b.a') - t.same(gen.property('b', '42'), 'b["42"]') - t.same(gen.sym(42), 'tmp') - t.same(gen.sym('a'), 'a') - t.same(gen.sym('a'), 'a1') - t.same(gen.sym(42), 'tmp1') - t.same(gen.sym('const'), 'tmp2') - - t.end() -}) diff --git a/node_modules/ipaddr.js/.travis.yml b/node_modules/ipaddr.js/.travis.yml deleted file mode 100644 index aa3d14a..0000000 --- a/node_modules/ipaddr.js/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: node_js - -node_js: - - "0.10" - - "0.11" - - "0.12" - - "4.0" - - "4.1" - - "4.2" - - "5" diff --git a/node_modules/ipaddr.js/Cakefile b/node_modules/ipaddr.js/Cakefile deleted file mode 100644 index 7fd355a..0000000 --- a/node_modules/ipaddr.js/Cakefile +++ /dev/null @@ -1,18 +0,0 @@ -fs = require 'fs' -CoffeeScript = require 'coffee-script' -nodeunit = require 'nodeunit' -UglifyJS = require 'uglify-js' - -task 'build', 'build the JavaScript files from CoffeeScript source', build = (cb) -> - source = fs.readFileSync 'src/ipaddr.coffee' - fs.writeFileSync 'lib/ipaddr.js', CoffeeScript.compile source.toString() - - invoke 'test' - invoke 'compress' - -task 'test', 'run the bundled tests', (cb) -> - nodeunit.reporters.default.run ['test'] - -task 'compress', 'uglify the resulting javascript', (cb) -> - result = UglifyJS.minify('lib/ipaddr.js') - fs.writeFileSync('ipaddr.min.js', result.code) diff --git a/node_modules/ipaddr.js/LICENSE b/node_modules/ipaddr.js/LICENSE index 3493f0d..f6b37b5 100644 --- a/node_modules/ipaddr.js/LICENSE +++ b/node_modules/ipaddr.js/LICENSE @@ -1,4 +1,4 @@ -Copyright (C) 2011 Peter Zotov +Copyright (C) 2011-2017 whitequark Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -16,4 +16,4 @@ 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. \ No newline at end of file +THE SOFTWARE. diff --git a/node_modules/ipaddr.js/README.md b/node_modules/ipaddr.js/README.md index f4f8776..f57725b 100644 --- a/node_modules/ipaddr.js/README.md +++ b/node_modules/ipaddr.js/README.md @@ -15,6 +15,10 @@ and convert between IPv4 and IPv4-mapped IPv6 addresses. `npm install ipaddr.js` +or + +`bower install ipaddr.js` + ## API ipaddr.js defines one object in the global scope: `ipaddr`. In CommonJS, @@ -39,7 +43,7 @@ or throws an `Error` if the passed string is not a valid representation of an IP address. The `ipaddr.process` method works just like the `ipaddr.parse` one, but it -automatically converts IPv4-mapped IPv6 addresses to their IPv4 couterparts +automatically converts IPv4-mapped IPv6 addresses to their IPv4 counterparts before returning. It is useful when you have a Node.js instance listening on an IPv6 socket, and the `net.ivp6.bindv6only` sysctl parameter (or its equivalent on non-Linux OS) is set to 0. In this case, you can accept IPv4 @@ -93,8 +97,7 @@ in the source: [IPv6 ranges] and [IPv4 ranges]. Some common ones include `"unica (the default one) and `"reserved"`. You can match against your own range list by using -`ipaddr.subnetMatch(address, rangeList, defaultName)` method. It can work with both -IPv6 and IPv4 addresses, and accepts a name-to-subnet map as the range list. For example: +`ipaddr.subnetMatch(address, rangeList, defaultName)` method. It can work with a mix of IPv6 or IPv4 addresses, and accepts a name-to-subnet map as the range list. For example: ```js var rangeList = { @@ -104,7 +107,7 @@ var rangeList = { [ ipaddr.parse('2001:5c0::'), 32 ] // freenet6 ] }; -ipaddr.subnetMatch(ipaddr.parse('2001:470:8:66::1'), rangeList, 'unknown'); // => "he.net" +ipaddr.subnetMatch(ipaddr.parse('2001:470:8:66::1'), rangeList, 'unknown'); // => "tunnelProviders" ``` The addresses can be converted to their byte representation with `toByteArray()`. @@ -122,6 +125,8 @@ have the same interface for both protocols, and are similar to global methods. `ipaddr.IPvX.isValid(string)` can be used to check if the string is a valid address for particular protocol, and `ipaddr.IPvX.parse(string)` is the error-throwing parser. +`ipaddr.IPvX.isValid(string)` uses the same format for parsing as the POSIX `inet_ntoa` function, which accepts unusual formats like `0xc0.168.1.1` or `0x10000000`. The function `ipaddr.IPv4.isValidFourPartDecimal(string)` validates the IPv4 address and also ensures that it is written in four-part decimal format. + [IPv6 ranges]: https://github.com/whitequark/ipaddr.js/blob/master/src/ipaddr.coffee#L186 [IPv4 ranges]: https://github.com/whitequark/ipaddr.js/blob/master/src/ipaddr.coffee#L71 @@ -149,6 +154,13 @@ var addr = ipaddr.parse("2001:db8:10::1234:DEAD"); addr.parts // => [0x2001, 0xdb8, 0x10, 0, 0, 0, 0x1234, 0xdead] ``` +A IPv6 zone index can be accessed via `addr.zoneId`: + +```js +var addr = ipaddr.parse("2001:db8::%eth0"); +addr.zoneId // => 'eth0' +``` + #### IPv4 properties `toIPv4MappedAddress()` will return a corresponding IPv4-mapped IPv6 address. @@ -159,3 +171,63 @@ To access the underlying representation of the address, use `addr.octets`. var addr = ipaddr.parse("192.168.1.1"); addr.octets // => [192, 168, 1, 1] ``` + +`prefixLengthFromSubnetMask()` will return a CIDR prefix length for a valid IPv4 netmask or +null if the netmask is not valid. + +```js +ipaddr.IPv4.parse('255.255.255.240').prefixLengthFromSubnetMask() == 28 +ipaddr.IPv4.parse('255.192.164.0').prefixLengthFromSubnetMask() == null +``` + +`subnetMaskFromPrefixLength()` will return an IPv4 netmask for a valid CIDR prefix length. + +```js +ipaddr.IPv4.subnetMaskFromPrefixLength(24) == "255.255.255.0" +ipaddr.IPv4.subnetMaskFromPrefixLength(29) == "255.255.255.248" +``` + +`broadcastAddressFromCIDR()` will return the broadcast address for a given IPv4 interface and netmask in CIDR notation. +```js +ipaddr.IPv4.broadcastAddressFromCIDR("172.0.0.1/24") == "172.0.0.255" +``` +`networkAddressFromCIDR()` will return the network address for a given IPv4 interface and netmask in CIDR notation. +```js +ipaddr.IPv4.networkAddressFromCIDR("172.0.0.1/24") == "172.0.0.0" +``` + +#### Conversion + +IPv4 and IPv6 can be converted bidirectionally to and from network byte order (MSB) byte arrays. + +The `fromByteArray()` method will take an array and create an appropriate IPv4 or IPv6 object +if the input satisfies the requirements. For IPv4 it has to be an array of four 8-bit values, +while for IPv6 it has to be an array of sixteen 8-bit values. + +For example: +```js +var addr = ipaddr.fromByteArray([0x7f, 0, 0, 1]); +addr.toString(); // => "127.0.0.1" +``` + +or + +```js +var addr = ipaddr.fromByteArray([0x20, 1, 0xd, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]) +addr.toString(); // => "2001:db8::1" +``` + +Both objects also offer a `toByteArray()` method, which returns an array in network byte order (MSB). + +For example: +```js +var addr = ipaddr.parse("127.0.0.1"); +addr.toByteArray(); // => [0x7f, 0, 0, 1] +``` + +or + +```js +var addr = ipaddr.parse("2001:db8::1"); +addr.toByteArray(); // => [0x20, 1, 0xd, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1] +``` diff --git a/node_modules/ipaddr.js/bower.json b/node_modules/ipaddr.js/bower.json deleted file mode 100644 index bc04ffe..0000000 --- a/node_modules/ipaddr.js/bower.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "ipaddr.js", - "version": "1.0.5", - "homepage": "https://github.com/whitequark/ipaddr.js", - "authors": [ - "whitequark " - ], - "description": "IP address manipulation library in JavaScript (CoffeeScript, actually)", - "main": "lib/ipaddr.js", - "moduleType": [ - "globals", - "node" - ], - "keywords": [ - "javscript", - "ip", - "address", - "ipv4", - "ipv6" - ], - "license": "MIT", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ] -} diff --git a/node_modules/ipaddr.js/ipaddr.min.js b/node_modules/ipaddr.js/ipaddr.min.js index ee5179d..b54a7cc 100644 --- a/node_modules/ipaddr.js/ipaddr.min.js +++ b/node_modules/ipaddr.js/ipaddr.min.js @@ -1 +1 @@ -(function(){var r,t,n,e,i,o,a,s;t={},s=this,"undefined"!=typeof module&&null!==module&&module.exports?module.exports=t:s.ipaddr=t,a=function(r,t,n,e){var i,o;if(r.length!==t.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");for(i=0;e>0;){if(o=n-e,0>o&&(o=0),r[i]>>o!==t[i]>>o)return!1;e-=n,i+=1}return!0},t.subnetMatch=function(r,t,n){var e,i,o,a,s;null==n&&(n="unicast");for(e in t)for(i=t[e],!i[0]||i[0]instanceof Array||(i=[i]),a=0,s=i.length;s>a;a++)if(o=i[a],r.match.apply(r,o))return e;return n},t.IPv4=function(){function r(r){var t,n,e;if(4!==r.length)throw new Error("ipaddr: ipv4 octet count should be 4");for(n=0,e=r.length;e>n;n++)if(t=r[n],!(t>=0&&255>=t))throw new Error("ipaddr: ipv4 octet is a byte");this.octets=r}return r.prototype.kind=function(){return"ipv4"},r.prototype.toString=function(){return this.octets.join(".")},r.prototype.toByteArray=function(){return this.octets.slice(0)},r.prototype.match=function(r,t){var n;if(void 0===t&&(n=r,r=n[0],t=n[1]),"ipv4"!==r.kind())throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return a(this.octets,r.octets,8,t)},r.prototype.SpecialRanges={unspecified:[[new r([0,0,0,0]),8]],broadcast:[[new r([255,255,255,255]),32]],multicast:[[new r([224,0,0,0]),4]],linkLocal:[[new r([169,254,0,0]),16]],loopback:[[new r([127,0,0,0]),8]],"private":[[new r([10,0,0,0]),8],[new r([172,16,0,0]),12],[new r([192,168,0,0]),16]],reserved:[[new r([192,0,0,0]),24],[new r([192,0,2,0]),24],[new r([192,88,99,0]),24],[new r([198,51,100,0]),24],[new r([203,0,113,0]),24],[new r([240,0,0,0]),4]]},r.prototype.range=function(){return t.subnetMatch(this,this.SpecialRanges)},r.prototype.toIPv4MappedAddress=function(){return t.IPv6.parse("::ffff:"+this.toString())},r}(),n="(0?\\d+|0x[a-f0-9]+)",e={fourOctet:new RegExp("^"+n+"\\."+n+"\\."+n+"\\."+n+"$","i"),longValue:new RegExp("^"+n+"$","i")},t.IPv4.parser=function(r){var t,n,i,o,a;if(n=function(r){return"0"===r[0]&&"x"!==r[1]?parseInt(r,8):parseInt(r)},t=r.match(e.fourOctet))return function(){var r,e,o,a;for(o=t.slice(1,6),a=[],r=0,e=o.length;e>r;r++)i=o[r],a.push(n(i));return a}();if(t=r.match(e.longValue)){if(a=n(t[1]),a>4294967295||0>a)throw new Error("ipaddr: address outside defined range");return function(){var r,t;for(t=[],o=r=0;24>=r;o=r+=8)t.push(a>>o&255);return t}().reverse()}return null},t.IPv6=function(){function r(r){var t,n,e;if(8!==r.length)throw new Error("ipaddr: ipv6 part count should be 8");for(n=0,e=r.length;e>n;n++)if(t=r[n],!(t>=0&&65535>=t))throw new Error("ipaddr: ipv6 part should fit to two octets");this.parts=r}return r.prototype.kind=function(){return"ipv6"},r.prototype.toString=function(){var r,t,n,e,i,o,a;for(i=function(){var r,n,e,i;for(e=this.parts,i=[],r=0,n=e.length;n>r;r++)t=e[r],i.push(t.toString(16));return i}.call(this),r=[],n=function(t){return r.push(t)},e=0,o=0,a=i.length;a>o;o++)switch(t=i[o],e){case 0:n("0"===t?"":t),e=1;break;case 1:"0"===t?e=2:n(t);break;case 2:"0"!==t&&(n(""),n(t),e=3);break;case 3:n(t)}return 2===e&&(n(""),n("")),r.join(":")},r.prototype.toByteArray=function(){var r,t,n,e,i;for(r=[],i=this.parts,n=0,e=i.length;e>n;n++)t=i[n],r.push(t>>8),r.push(255&t);return r},r.prototype.toNormalizedString=function(){var r;return function(){var t,n,e,i;for(e=this.parts,i=[],t=0,n=e.length;n>t;t++)r=e[t],i.push(r.toString(16));return i}.call(this).join(":")},r.prototype.match=function(r,t){var n;if(void 0===t&&(n=r,r=n[0],t=n[1]),"ipv6"!==r.kind())throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return a(this.parts,r.parts,16,t)},r.prototype.SpecialRanges={unspecified:[new r([0,0,0,0,0,0,0,0]),128],linkLocal:[new r([65152,0,0,0,0,0,0,0]),10],multicast:[new r([65280,0,0,0,0,0,0,0]),8],loopback:[new r([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new r([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new r([0,0,0,0,0,65535,0,0]),96],rfc6145:[new r([0,0,0,0,65535,0,0,0]),96],rfc6052:[new r([100,65435,0,0,0,0,0,0]),96],"6to4":[new r([8194,0,0,0,0,0,0,0]),16],teredo:[new r([8193,0,0,0,0,0,0,0]),32],reserved:[[new r([8193,3512,0,0,0,0,0,0]),32]]},r.prototype.range=function(){return t.subnetMatch(this,this.SpecialRanges)},r.prototype.isIPv4MappedAddress=function(){return"ipv4Mapped"===this.range()},r.prototype.toIPv4Address=function(){var r,n,e;if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");return e=this.parts.slice(-2),r=e[0],n=e[1],new t.IPv4([r>>8,255&r,n>>8,255&n])},r}(),i="(?:[0-9a-f]+::?)+",o={"native":new RegExp("^(::)?("+i+")?([0-9a-f]+)?(::)?$","i"),transitional:new RegExp("^((?:"+i+")|(?:::)(?:"+i+")?)"+(""+n+"\\."+n+"\\."+n+"\\."+n+"$"),"i")},r=function(r,t){var n,e,i,o,a;if(r.indexOf("::")!==r.lastIndexOf("::"))return null;for(n=0,e=-1;(e=r.indexOf(":",e+1))>=0;)n++;if("::"===r.substr(0,2)&&n--,"::"===r.substr(-2,2)&&n--,n>t)return null;for(a=t-n,o=":";a--;)o+="0:";return r=r.replace("::",o),":"===r[0]&&(r=r.slice(1)),":"===r[r.length-1]&&(r=r.slice(0,-1)),function(){var t,n,e,o;for(e=r.split(":"),o=[],t=0,n=e.length;n>t;t++)i=e[t],o.push(parseInt(i,16));return o}()},t.IPv6.parser=function(t){var n,e;return t.match(o["native"])?r(t,8):(n=t.match(o.transitional))&&(e=r(n[1].slice(0,-1),6))?(e.push(parseInt(n[2])<<8|parseInt(n[3])),e.push(parseInt(n[4])<<8|parseInt(n[5])),e):null},t.IPv4.isIPv4=t.IPv6.isIPv6=function(r){return null!==this.parser(r)},t.IPv4.isValid=function(r){var t;try{return new this(this.parser(r)),!0}catch(n){return t=n,!1}},t.IPv6.isValid=function(r){var t;if("string"==typeof r&&-1===r.indexOf(":"))return!1;try{return new this(this.parser(r)),!0}catch(n){return t=n,!1}},t.IPv4.parse=t.IPv6.parse=function(r){var t;if(t=this.parser(r),null===t)throw new Error("ipaddr: string is not formatted like ip address");return new this(t)},t.IPv4.parseCIDR=function(r){var t,n;if((n=r.match(/^(.+)\/(\d+)$/))&&(t=parseInt(n[2]),t>=0&&32>=t))return[this.parse(n[1]),t];throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},t.IPv6.parseCIDR=function(r){var t,n;if((n=r.match(/^(.+)\/(\d+)$/))&&(t=parseInt(n[2]),t>=0&&128>=t))return[this.parse(n[1]),t];throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},t.isValid=function(r){return t.IPv6.isValid(r)||t.IPv4.isValid(r)},t.parse=function(r){if(t.IPv6.isValid(r))return t.IPv6.parse(r);if(t.IPv4.isValid(r))return t.IPv4.parse(r);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},t.parseCIDR=function(r){var n;try{return t.IPv6.parseCIDR(r)}catch(e){n=e;try{return t.IPv4.parseCIDR(r)}catch(e){throw n=e,new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},t.process=function(r){var t;return t=this.parse(r),"ipv6"===t.kind()&&t.isIPv4MappedAddress()?t.toIPv4Address():t}}).call(this); \ No newline at end of file +(function(){var r,t,n,e,i,o,a,s;t={},s=this,"undefined"!=typeof module&&null!==module&&module.exports?module.exports=t:s.ipaddr=t,a=function(r,t,n,e){var i,o;if(r.length!==t.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");for(i=0;e>0;){if((o=n-e)<0&&(o=0),r[i]>>o!=t[i]>>o)return!1;e-=n,i+=1}return!0},t.subnetMatch=function(r,t,n){var e,i,o,a,s;null==n&&(n="unicast");for(o in t)for(!(a=t[o])[0]||a[0]instanceof Array||(a=[a]),e=0,i=a.length;e=0;t=n+=-1){if(!((e=this.octets[t])in a))return null;if(o=a[e],i&&0!==o)return null;8!==o&&(i=!0),r+=o}return 32-r},r}(),n="(0?\\d+|0x[a-f0-9]+)",e={fourOctet:new RegExp("^"+n+"\\."+n+"\\."+n+"\\."+n+"$","i"),longValue:new RegExp("^"+n+"$","i")},t.IPv4.parser=function(r){var t,n,i,o,a;if(n=function(r){return"0"===r[0]&&"x"!==r[1]?parseInt(r,8):parseInt(r)},t=r.match(e.fourOctet))return function(){var r,e,o,a;for(a=[],r=0,e=(o=t.slice(1,6)).length;r4294967295||a<0)throw new Error("ipaddr: address outside defined range");return function(){var r,t;for(t=[],o=r=0;r<=24;o=r+=8)t.push(a>>o&255);return t}().reverse()}return null},t.IPv6=function(){function r(r,t){var n,e,i,o,a,s;if(16===r.length)for(this.parts=[],n=e=0;e<=14;n=e+=2)this.parts.push(r[n]<<8|r[n+1]);else{if(8!==r.length)throw new Error("ipaddr: ipv6 part count should be 8 or 16");this.parts=r}for(i=0,o=(s=this.parts).length;it&&(r=n.index,t=n[0].length);return t<0?i:i.substring(0,r)+"::"+i.substring(r+t)},r.prototype.toByteArray=function(){var r,t,n,e,i;for(r=[],t=0,n=(i=this.parts).length;t>8),r.push(255&e);return r},r.prototype.toNormalizedString=function(){var r,t,n;return r=function(){var r,n,e,i;for(i=[],r=0,n=(e=this.parts).length;r>8,255&r,n>>8,255&n])},r.prototype.prefixLengthFromSubnetMask=function(){var r,t,n,e,i,o,a;for(a={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},r=0,i=!1,t=n=7;n>=0;t=n+=-1){if(!((e=this.parts[t])in a))return null;if(o=a[e],i&&0!==o)return null;16!==o&&(i=!0),r+=o}return 128-r},r}(),i="(?:[0-9a-f]+::?)+",o={zoneIndex:new RegExp("%[0-9a-z]{1,}","i"),native:new RegExp("^(::)?("+i+")?([0-9a-f]+)?(::)?(%[0-9a-z]{1,})?$","i"),transitional:new RegExp("^((?:"+i+")|(?:::)(?:"+i+")?)"+n+"\\."+n+"\\."+n+"\\."+n+"(%[0-9a-z]{1,})?$","i")},r=function(r,t){var n,e,i,a,s,p;if(r.indexOf("::")!==r.lastIndexOf("::"))return null;for((p=(r.match(o.zoneIndex)||[])[0])&&(p=p.substring(1),r=r.replace(/%.+$/,"")),n=0,e=-1;(e=r.indexOf(":",e+1))>=0;)n++;if("::"===r.substr(0,2)&&n--,"::"===r.substr(-2,2)&&n--,n>t)return null;for(s=t-n,a=":";s--;)a+="0:";return":"===(r=r.replace("::",a))[0]&&(r=r.slice(1)),":"===r[r.length-1]&&(r=r.slice(0,-1)),t=function(){var t,n,e,o;for(o=[],t=0,n=(e=r.split(":")).length;t=0&&t<=32)return e=[this.parse(n[1]),t],Object.defineProperty(e,"toString",{value:function(){return this.join("/")}}),e;throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},t.IPv4.subnetMaskFromPrefixLength=function(r){var t,n,e;if((r=parseInt(r))<0||r>32)throw new Error("ipaddr: invalid IPv4 prefix length");for(e=[0,0,0,0],n=0,t=Math.floor(r/8);n=0&&t<=128)return e=[this.parse(n[1]),t],Object.defineProperty(e,"toString",{value:function(){return this.join("/")}}),e;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},t.isValid=function(r){return t.IPv6.isValid(r)||t.IPv4.isValid(r)},t.parse=function(r){if(t.IPv6.isValid(r))return t.IPv6.parse(r);if(t.IPv4.isValid(r))return t.IPv4.parse(r);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},t.parseCIDR=function(r){try{return t.IPv6.parseCIDR(r)}catch(n){n;try{return t.IPv4.parseCIDR(r)}catch(r){throw r,new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},t.fromByteArray=function(r){var n;if(4===(n=r.length))return new t.IPv4(r);if(16===n)return new t.IPv6(r);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},t.process=function(r){var t;return t=this.parse(r),"ipv6"===t.kind()&&t.isIPv4MappedAddress()?t.toIPv4Address():t}}).call(this); \ No newline at end of file diff --git a/node_modules/ipaddr.js/lib/ipaddr.js b/node_modules/ipaddr.js/lib/ipaddr.js index ef179b4..18bd93b 100644 --- a/node_modules/ipaddr.js/lib/ipaddr.js +++ b/node_modules/ipaddr.js/lib/ipaddr.js @@ -1,5 +1,5 @@ (function() { - var expandIPv6, ipaddr, ipv4Part, ipv4Regexes, ipv6Part, ipv6Regexes, matchCIDR, root; + var expandIPv6, ipaddr, ipv4Part, ipv4Regexes, ipv6Part, ipv6Regexes, matchCIDR, root, zoneIndex; ipaddr = {}; @@ -32,7 +32,7 @@ }; ipaddr.subnetMatch = function(address, rangeList, defaultName) { - var rangeName, rangeSubnets, subnet, _i, _len; + var k, len, rangeName, rangeSubnets, subnet; if (defaultName == null) { defaultName = 'unicast'; } @@ -41,10 +41,12 @@ if (rangeSubnets[0] && !(rangeSubnets[0] instanceof Array)) { rangeSubnets = [rangeSubnets]; } - for (_i = 0, _len = rangeSubnets.length; _i < _len; _i++) { - subnet = rangeSubnets[_i]; - if (address.match.apply(address, subnet)) { - return rangeName; + for (k = 0, len = rangeSubnets.length; k < len; k++) { + subnet = rangeSubnets[k]; + if (address.kind() === subnet[0].kind()) { + if (address.match.apply(address, subnet)) { + return rangeName; + } } } } @@ -53,14 +55,14 @@ ipaddr.IPv4 = (function() { function IPv4(octets) { - var octet, _i, _len; + var k, len, octet; if (octets.length !== 4) { throw new Error("ipaddr: ipv4 octet count should be 4"); } - for (_i = 0, _len = octets.length; _i < _len; _i++) { - octet = octets[_i]; + for (k = 0, len = octets.length; k < len; k++) { + octet = octets[k]; if (!((0 <= octet && octet <= 255))) { - throw new Error("ipaddr: ipv4 octet is a byte"); + throw new Error("ipaddr: ipv4 octet should fit in 8 bits"); } } this.octets = octets; @@ -74,14 +76,18 @@ return this.octets.join("."); }; + IPv4.prototype.toNormalizedString = function() { + return this.toString(); + }; + IPv4.prototype.toByteArray = function() { return this.octets.slice(0); }; IPv4.prototype.match = function(other, cidrRange) { - var _ref; + var ref; if (cidrRange === void 0) { - _ref = other, other = _ref[0], cidrRange = _ref[1]; + ref = other, other = ref[0], cidrRange = ref[1]; } if (other.kind() !== 'ipv4') { throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one"); @@ -95,6 +101,7 @@ multicast: [[new IPv4([224, 0, 0, 0]), 4]], linkLocal: [[new IPv4([169, 254, 0, 0]), 16]], loopback: [[new IPv4([127, 0, 0, 0]), 8]], + carrierGradeNat: [[new IPv4([100, 64, 0, 0]), 10]], "private": [[new IPv4([10, 0, 0, 0]), 8], [new IPv4([172, 16, 0, 0]), 12], [new IPv4([192, 168, 0, 0]), 16]], reserved: [[new IPv4([192, 0, 0, 0]), 24], [new IPv4([192, 0, 2, 0]), 24], [new IPv4([192, 88, 99, 0]), 24], [new IPv4([198, 51, 100, 0]), 24], [new IPv4([203, 0, 113, 0]), 24], [new IPv4([240, 0, 0, 0]), 4]] }; @@ -107,6 +114,39 @@ return ipaddr.IPv6.parse("::ffff:" + (this.toString())); }; + IPv4.prototype.prefixLengthFromSubnetMask = function() { + var cidr, i, k, octet, stop, zeros, zerotable; + zerotable = { + 0: 8, + 128: 7, + 192: 6, + 224: 5, + 240: 4, + 248: 3, + 252: 2, + 254: 1, + 255: 0 + }; + cidr = 0; + stop = false; + for (i = k = 3; k >= 0; i = k += -1) { + octet = this.octets[i]; + if (octet in zerotable) { + zeros = zerotable[octet]; + if (stop && zeros !== 0) { + return null; + } + if (zeros !== 8) { + stop = true; + } + cidr += zeros; + } else { + return null; + } + } + return 32 - cidr; + }; + return IPv4; })(); @@ -129,14 +169,14 @@ }; if (match = string.match(ipv4Regexes.fourOctet)) { return (function() { - var _i, _len, _ref, _results; - _ref = match.slice(1, 6); - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - part = _ref[_i]; - _results.push(parseIntAuto(part)); + var k, len, ref, results; + ref = match.slice(1, 6); + results = []; + for (k = 0, len = ref.length; k < len; k++) { + part = ref[k]; + results.push(parseIntAuto(part)); } - return _results; + return results; })(); } else if (match = string.match(ipv4Regexes.longValue)) { value = parseIntAuto(match[1]); @@ -144,12 +184,12 @@ throw new Error("ipaddr: address outside defined range"); } return ((function() { - var _i, _results; - _results = []; - for (shift = _i = 0; _i <= 24; shift = _i += 8) { - _results.push((value >> shift) & 0xff); + var k, results; + results = []; + for (shift = k = 0; k <= 24; shift = k += 8) { + results.push((value >> shift) & 0xff); } - return _results; + return results; })()).reverse(); } else { return null; @@ -157,18 +197,28 @@ }; ipaddr.IPv6 = (function() { - function IPv6(parts) { - var part, _i, _len; - if (parts.length !== 8) { - throw new Error("ipaddr: ipv6 part count should be 8"); + function IPv6(parts, zoneId) { + var i, k, l, len, part, ref; + if (parts.length === 16) { + this.parts = []; + for (i = k = 0; k <= 14; i = k += 2) { + this.parts.push((parts[i] << 8) | parts[i + 1]); + } + } else if (parts.length === 8) { + this.parts = parts; + } else { + throw new Error("ipaddr: ipv6 part count should be 8 or 16"); } - for (_i = 0, _len = parts.length; _i < _len; _i++) { - part = parts[_i]; + ref = this.parts; + for (l = 0, len = ref.length; l < len; l++) { + part = ref[l]; if (!((0 <= part && part <= 0xffff))) { - throw new Error("ipaddr: ipv6 part should fit to two octets"); + throw new Error("ipaddr: ipv6 part should fit in 16 bits"); } } - this.parts = parts; + if (zoneId) { + this.zoneId = zoneId; + } } IPv6.prototype.kind = function() { @@ -176,64 +226,33 @@ }; IPv6.prototype.toString = function() { - var compactStringParts, part, pushPart, state, stringParts, _i, _len; - stringParts = (function() { - var _i, _len, _ref, _results; - _ref = this.parts; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - part = _ref[_i]; - _results.push(part.toString(16)); - } - return _results; - }).call(this); - compactStringParts = []; - pushPart = function(part) { - return compactStringParts.push(part); - }; - state = 0; - for (_i = 0, _len = stringParts.length; _i < _len; _i++) { - part = stringParts[_i]; - switch (state) { - case 0: - if (part === '0') { - pushPart(''); - } else { - pushPart(part); - } - state = 1; - break; - case 1: - if (part === '0') { - state = 2; - } else { - pushPart(part); - } - break; - case 2: - if (part !== '0') { - pushPart(''); - pushPart(part); - state = 3; - } - break; - case 3: - pushPart(part); + return this.toNormalizedString().replace(/((^|:)(0(:|$))+)/, '::'); + }; + + IPv6.prototype.toRFC5952String = function() { + var bestMatchIndex, bestMatchLength, match, regex, string; + regex = /((^|:)(0(:|$)){2,})/g; + string = this.toNormalizedString(); + bestMatchIndex = 0; + bestMatchLength = -1; + while ((match = regex.exec(string))) { + if (match[0].length > bestMatchLength) { + bestMatchIndex = match.index; + bestMatchLength = match[0].length; } } - if (state === 2) { - pushPart(''); - pushPart(''); + if (bestMatchLength < 0) { + return string; } - return compactStringParts.join(":"); + return string.substring(0, bestMatchIndex) + '::' + string.substring(bestMatchIndex + bestMatchLength); }; IPv6.prototype.toByteArray = function() { - var bytes, part, _i, _len, _ref; + var bytes, k, len, part, ref; bytes = []; - _ref = this.parts; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - part = _ref[_i]; + ref = this.parts; + for (k = 0, len = ref.length; k < len; k++) { + part = ref[k]; bytes.push(part >> 8); bytes.push(part & 0xff); } @@ -241,23 +260,47 @@ }; IPv6.prototype.toNormalizedString = function() { - var part; - return ((function() { - var _i, _len, _ref, _results; - _ref = this.parts; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - part = _ref[_i]; - _results.push(part.toString(16)); + var addr, part, suffix; + addr = ((function() { + var k, len, ref, results; + ref = this.parts; + results = []; + for (k = 0, len = ref.length; k < len; k++) { + part = ref[k]; + results.push(part.toString(16)); } - return _results; + return results; }).call(this)).join(":"); + suffix = ''; + if (this.zoneId) { + suffix = '%' + this.zoneId; + } + return addr + suffix; + }; + + IPv6.prototype.toFixedLengthString = function() { + var addr, part, suffix; + addr = ((function() { + var k, len, ref, results; + ref = this.parts; + results = []; + for (k = 0, len = ref.length; k < len; k++) { + part = ref[k]; + results.push(part.toString(16).padStart(4, '0')); + } + return results; + }).call(this)).join(":"); + suffix = ''; + if (this.zoneId) { + suffix = '%' + this.zoneId; + } + return addr + suffix; }; IPv6.prototype.match = function(other, cidrRange) { - var _ref; + var ref; if (cidrRange === void 0) { - _ref = other, other = _ref[0], cidrRange = _ref[1]; + ref = other, other = ref[0], cidrRange = ref[1]; } if (other.kind() !== 'ipv6') { throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one"); @@ -288,30 +331,79 @@ }; IPv6.prototype.toIPv4Address = function() { - var high, low, _ref; + var high, low, ref; if (!this.isIPv4MappedAddress()) { throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4"); } - _ref = this.parts.slice(-2), high = _ref[0], low = _ref[1]; + ref = this.parts.slice(-2), high = ref[0], low = ref[1]; return new ipaddr.IPv4([high >> 8, high & 0xff, low >> 8, low & 0xff]); }; + IPv6.prototype.prefixLengthFromSubnetMask = function() { + var cidr, i, k, part, stop, zeros, zerotable; + zerotable = { + 0: 16, + 32768: 15, + 49152: 14, + 57344: 13, + 61440: 12, + 63488: 11, + 64512: 10, + 65024: 9, + 65280: 8, + 65408: 7, + 65472: 6, + 65504: 5, + 65520: 4, + 65528: 3, + 65532: 2, + 65534: 1, + 65535: 0 + }; + cidr = 0; + stop = false; + for (i = k = 7; k >= 0; i = k += -1) { + part = this.parts[i]; + if (part in zerotable) { + zeros = zerotable[part]; + if (stop && zeros !== 0) { + return null; + } + if (zeros !== 16) { + stop = true; + } + cidr += zeros; + } else { + return null; + } + } + return 128 - cidr; + }; + return IPv6; })(); ipv6Part = "(?:[0-9a-f]+::?)+"; + zoneIndex = "%[0-9a-z]{1,}"; + ipv6Regexes = { - "native": new RegExp("^(::)?(" + ipv6Part + ")?([0-9a-f]+)?(::)?$", 'i'), - transitional: new RegExp(("^((?:" + ipv6Part + ")|(?:::)(?:" + ipv6Part + ")?)") + ("" + ipv4Part + "\\." + ipv4Part + "\\." + ipv4Part + "\\." + ipv4Part + "$"), 'i') + zoneIndex: new RegExp(zoneIndex, 'i'), + "native": new RegExp("^(::)?(" + ipv6Part + ")?([0-9a-f]+)?(::)?(" + zoneIndex + ")?$", 'i'), + transitional: new RegExp(("^((?:" + ipv6Part + ")|(?:::)(?:" + ipv6Part + ")?)") + (ipv4Part + "\\." + ipv4Part + "\\." + ipv4Part + "\\." + ipv4Part) + ("(" + zoneIndex + ")?$"), 'i') }; expandIPv6 = function(string, parts) { - var colonCount, lastColon, part, replacement, replacementCount; + var colonCount, lastColon, part, replacement, replacementCount, zoneId; if (string.indexOf('::') !== string.lastIndexOf('::')) { return null; } + zoneId = (string.match(ipv6Regexes['zoneIndex']) || [])[0]; + if (zoneId) { + zoneId = zoneId.substring(1); + string = string.replace(/%.+$/, ''); + } colonCount = 0; lastColon = -1; while ((lastColon = string.indexOf(':', lastColon + 1)) >= 0) { @@ -338,28 +430,43 @@ if (string[string.length - 1] === ':') { string = string.slice(0, -1); } - return (function() { - var _i, _len, _ref, _results; - _ref = string.split(":"); - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - part = _ref[_i]; - _results.push(parseInt(part, 16)); + parts = (function() { + var k, len, ref, results; + ref = string.split(":"); + results = []; + for (k = 0, len = ref.length; k < len; k++) { + part = ref[k]; + results.push(parseInt(part, 16)); } - return _results; + return results; })(); + return { + parts: parts, + zoneId: zoneId + }; }; ipaddr.IPv6.parser = function(string) { - var match, parts; - if (string.match(ipv6Regexes['native'])) { + var addr, k, len, match, octet, octets, zoneId; + if (ipv6Regexes['native'].test(string)) { return expandIPv6(string, 8); } else if (match = string.match(ipv6Regexes['transitional'])) { - parts = expandIPv6(match[1].slice(0, -1), 6); - if (parts) { - parts.push(parseInt(match[2]) << 8 | parseInt(match[3])); - parts.push(parseInt(match[4]) << 8 | parseInt(match[5])); - return parts; + zoneId = match[6] || ''; + addr = expandIPv6(match[1].slice(0, -1) + zoneId, 6); + if (addr.parts) { + octets = [parseInt(match[2]), parseInt(match[3]), parseInt(match[4]), parseInt(match[5])]; + for (k = 0, len = octets.length; k < len; k++) { + octet = octets[k]; + if (!((0 <= octet && octet <= 255))) { + return null; + } + } + addr.parts.push(octets[0] << 8 | octets[1]); + addr.parts.push(octets[2] << 8 | octets[3]); + return { + parts: addr.parts, + zoneId: addr.zoneId + }; } } return null; @@ -374,27 +481,36 @@ try { new this(this.parser(string)); return true; - } catch (_error) { - e = _error; + } catch (error1) { + e = error1; + return false; + } + }; + + ipaddr.IPv4.isValidFourPartDecimal = function(string) { + if (ipaddr.IPv4.isValid(string) && string.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/)) { + return true; + } else { return false; } }; ipaddr.IPv6.isValid = function(string) { - var e; + var addr, e; if (typeof string === "string" && string.indexOf(":") === -1) { return false; } try { - new this(this.parser(string)); + addr = this.parser(string); + new this(addr.parts, addr.zoneId); return true; - } catch (_error) { - e = _error; + } catch (error1) { + e = error1; return false; } }; - ipaddr.IPv4.parse = ipaddr.IPv6.parse = function(string) { + ipaddr.IPv4.parse = function(string) { var parts; parts = this.parser(string); if (parts === null) { @@ -403,23 +519,101 @@ return new this(parts); }; + ipaddr.IPv6.parse = function(string) { + var addr; + addr = this.parser(string); + if (addr.parts === null) { + throw new Error("ipaddr: string is not formatted like ip address"); + } + return new this(addr.parts, addr.zoneId); + }; + ipaddr.IPv4.parseCIDR = function(string) { - var maskLength, match; + var maskLength, match, parsed; if (match = string.match(/^(.+)\/(\d+)$/)) { maskLength = parseInt(match[2]); if (maskLength >= 0 && maskLength <= 32) { - return [this.parse(match[1]), maskLength]; + parsed = [this.parse(match[1]), maskLength]; + Object.defineProperty(parsed, 'toString', { + value: function() { + return this.join('/'); + } + }); + return parsed; } } throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range"); }; + ipaddr.IPv4.subnetMaskFromPrefixLength = function(prefix) { + var filledOctetCount, j, octets; + prefix = parseInt(prefix); + if (prefix < 0 || prefix > 32) { + throw new Error('ipaddr: invalid IPv4 prefix length'); + } + octets = [0, 0, 0, 0]; + j = 0; + filledOctetCount = Math.floor(prefix / 8); + while (j < filledOctetCount) { + octets[j] = 255; + j++; + } + if (filledOctetCount < 4) { + octets[filledOctetCount] = Math.pow(2, prefix % 8) - 1 << 8 - (prefix % 8); + } + return new this(octets); + }; + + ipaddr.IPv4.broadcastAddressFromCIDR = function(string) { + var cidr, error, i, ipInterfaceOctets, octets, subnetMaskOctets; + try { + cidr = this.parseCIDR(string); + ipInterfaceOctets = cidr[0].toByteArray(); + subnetMaskOctets = this.subnetMaskFromPrefixLength(cidr[1]).toByteArray(); + octets = []; + i = 0; + while (i < 4) { + octets.push(parseInt(ipInterfaceOctets[i], 10) | parseInt(subnetMaskOctets[i], 10) ^ 255); + i++; + } + return new this(octets); + } catch (error1) { + error = error1; + throw new Error('ipaddr: the address does not have IPv4 CIDR format'); + } + }; + + ipaddr.IPv4.networkAddressFromCIDR = function(string) { + var cidr, error, i, ipInterfaceOctets, octets, subnetMaskOctets; + try { + cidr = this.parseCIDR(string); + ipInterfaceOctets = cidr[0].toByteArray(); + subnetMaskOctets = this.subnetMaskFromPrefixLength(cidr[1]).toByteArray(); + octets = []; + i = 0; + while (i < 4) { + octets.push(parseInt(ipInterfaceOctets[i], 10) & parseInt(subnetMaskOctets[i], 10)); + i++; + } + return new this(octets); + } catch (error1) { + error = error1; + throw new Error('ipaddr: the address does not have IPv4 CIDR format'); + } + }; + ipaddr.IPv6.parseCIDR = function(string) { - var maskLength, match; + var maskLength, match, parsed; if (match = string.match(/^(.+)\/(\d+)$/)) { maskLength = parseInt(match[2]); if (maskLength >= 0 && maskLength <= 128) { - return [this.parse(match[1]), maskLength]; + parsed = [this.parse(match[1]), maskLength]; + Object.defineProperty(parsed, 'toString', { + value: function() { + return this.join('/'); + } + }); + return parsed; } } throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range"); @@ -443,17 +637,29 @@ var e; try { return ipaddr.IPv6.parseCIDR(string); - } catch (_error) { - e = _error; + } catch (error1) { + e = error1; try { return ipaddr.IPv4.parseCIDR(string); - } catch (_error) { - e = _error; + } catch (error1) { + e = error1; throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format"); } } }; + ipaddr.fromByteArray = function(bytes) { + var length; + length = bytes.length; + if (length === 4) { + return new ipaddr.IPv4(bytes); + } else if (length === 16) { + return new ipaddr.IPv6(bytes); + } else { + throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address"); + } + }; + ipaddr.process = function(string) { var addr; addr = this.parse(string); diff --git a/node_modules/ipaddr.js/lib/ipaddr.js.d.ts b/node_modules/ipaddr.js/lib/ipaddr.js.d.ts new file mode 100644 index 0000000..52174b6 --- /dev/null +++ b/node_modules/ipaddr.js/lib/ipaddr.js.d.ts @@ -0,0 +1,68 @@ +declare module "ipaddr.js" { + type IPv4Range = 'unicast' | 'unspecified' | 'broadcast' | 'multicast' | 'linkLocal' | 'loopback' | 'carrierGradeNat' | 'private' | 'reserved'; + type IPv6Range = 'unicast' | 'unspecified' | 'linkLocal' | 'multicast' | 'loopback' | 'uniqueLocal' | 'ipv4Mapped' | 'rfc6145' | 'rfc6052' | '6to4' | 'teredo' | 'reserved'; + + interface RangeList { + [name: string]: [T, number] | [T, number][]; + } + + // Common methods/properties for IPv4 and IPv6 classes. + class IP { + prefixLengthFromSubnetMask(): number | null; + toByteArray(): number[]; + toNormalizedString(): string; + toString(): string; + } + + namespace Address { + export function isValid(addr: string): boolean; + export function fromByteArray(bytes: number[]): IPv4 | IPv6; + export function parse(addr: string): IPv4 | IPv6; + export function parseCIDR(mask: string): [IPv4 | IPv6, number]; + export function process(addr: string): IPv4 | IPv6; + export function subnetMatch(addr: IPv4, rangeList: RangeList, defaultName?: string): string; + export function subnetMatch(addr: IPv6, rangeList: RangeList, defaultName?: string): string; + + export class IPv4 extends IP { + static broadcastAddressFromCIDR(addr: string): IPv4; + static isIPv4(addr: string): boolean; + static isValidFourPartDecimal(addr: string): boolean; + static isValid(addr: string): boolean; + static networkAddressFromCIDR(addr: string): IPv4; + static parse(addr: string): IPv4; + static parseCIDR(addr: string): [IPv4, number]; + static subnetMaskFromPrefixLength(prefix: number): IPv4; + constructor(octets: number[]); + octets: number[] + + kind(): 'ipv4'; + match(addr: IPv4, bits: number): boolean; + match(mask: [IPv4, number]): boolean; + range(): IPv4Range; + subnetMatch(rangeList: RangeList, defaultName?: string): string; + toIPv4MappedAddress(): IPv6; + } + + export class IPv6 extends IP { + static broadcastAddressFromCIDR(addr: string): IPv6; + static isIPv6(addr: string): boolean; + static isValid(addr: string): boolean; + static parse(addr: string): IPv6; + static parseCIDR(addr: string): [IPv6, number]; + static subnetMaskFromPrefixLength(prefix: number): IPv6; + constructor(parts: number[]); + parts: number[] + zoneId?: string + + isIPv4MappedAddress(): boolean; + kind(): 'ipv6'; + match(addr: IPv6, bits: number): boolean; + match(mask: [IPv6, number]): boolean; + range(): IPv6Range; + subnetMatch(rangeList: RangeList, defaultName?: string): string; + toIPv4Address(): IPv4; + } + } + + export = Address; +} diff --git a/node_modules/ipaddr.js/package.json b/node_modules/ipaddr.js/package.json index cbf2b69..f4d3547 100644 --- a/node_modules/ipaddr.js/package.json +++ b/node_modules/ipaddr.js/package.json @@ -1,23 +1,35 @@ { "name": "ipaddr.js", "description": "A library for manipulating IPv4 and IPv6 addresses in JavaScript.", - "version": "1.0.5", + "version": "1.9.1", "author": "whitequark ", "directories": { "lib": "./lib" }, "dependencies": {}, "devDependencies": { - "coffee-script": "~1.6", - "nodeunit": ">=0.8.2 <0.8.7", - "uglify-js": "latest" + "coffee-script": "~1.12.6", + "nodeunit": "^0.11.3", + "uglify-js": "~3.0.19" }, "scripts": { "test": "cake build test" }, - "keywords": ["ip", "ipv4", "ipv6"], + "files": [ + "lib/", + "LICENSE", + "ipaddr.min.js" + ], + "keywords": [ + "ip", + "ipv4", + "ipv6" + ], "repository": "git://github.com/whitequark/ipaddr.js", - "main": "./lib/ipaddr", - "engines": { "node": ">= 0.10" }, - "license": "MIT" + "main": "./lib/ipaddr.js", + "engines": { + "node": ">= 0.10" + }, + "license": "MIT", + "types": "./lib/ipaddr.js.d.ts" } diff --git a/node_modules/ipaddr.js/src/ipaddr.coffee b/node_modules/ipaddr.js/src/ipaddr.coffee deleted file mode 100644 index 550174f..0000000 --- a/node_modules/ipaddr.js/src/ipaddr.coffee +++ /dev/null @@ -1,396 +0,0 @@ -# Define the main object -ipaddr = {} - -root = this - -# Export for both the CommonJS and browser-like environment -if module? && module.exports - module.exports = ipaddr -else - root['ipaddr'] = ipaddr - -# A generic CIDR (Classless Inter-Domain Routing) RFC1518 range matcher. -matchCIDR = (first, second, partSize, cidrBits) -> - if first.length != second.length - throw new Error "ipaddr: cannot match CIDR for objects with different lengths" - - part = 0 - while cidrBits > 0 - shift = partSize - cidrBits - shift = 0 if shift < 0 - - if first[part] >> shift != second[part] >> shift - return false - - cidrBits -= partSize - part += 1 - - return true - -# An utility function to ease named range matching. See examples below. -ipaddr.subnetMatch = (address, rangeList, defaultName='unicast') -> - for rangeName, rangeSubnets of rangeList - # ECMA5 Array.isArray isn't available everywhere - if rangeSubnets[0] && !(rangeSubnets[0] instanceof Array) - rangeSubnets = [ rangeSubnets ] - - for subnet in rangeSubnets - return rangeName if address.match.apply(address, subnet) - - return defaultName - -# An IPv4 address (RFC791). -class ipaddr.IPv4 - # Constructs a new IPv4 address from an array of four octets. - # Verifies the input. - constructor: (octets) -> - if octets.length != 4 - throw new Error "ipaddr: ipv4 octet count should be 4" - - for octet in octets - if !(0 <= octet <= 255) - throw new Error "ipaddr: ipv4 octet is a byte" - - @octets = octets - - # The 'kind' method exists on both IPv4 and IPv6 classes. - kind: -> - return 'ipv4' - - # Returns the address in convenient, decimal-dotted format. - toString: -> - return @octets.join "." - - # Returns an array of byte-sized values in network order - toByteArray: -> - return @octets.slice(0) # octets.clone - - # Checks if this address matches other one within given CIDR range. - match: (other, cidrRange) -> - if cidrRange == undefined - [other, cidrRange] = other - - if other.kind() != 'ipv4' - throw new Error "ipaddr: cannot match ipv4 address with non-ipv4 one" - - return matchCIDR(this.octets, other.octets, 8, cidrRange) - - # Special IPv4 address ranges. - SpecialRanges: - unspecified: [ - [ new IPv4([0, 0, 0, 0]), 8 ] - ] - broadcast: [ - [ new IPv4([255, 255, 255, 255]), 32 ] - ] - multicast: [ # RFC3171 - [ new IPv4([224, 0, 0, 0]), 4 ] - ] - linkLocal: [ # RFC3927 - [ new IPv4([169, 254, 0, 0]), 16 ] - ] - loopback: [ # RFC5735 - [ new IPv4([127, 0, 0, 0]), 8 ] - ] - private: [ # RFC1918 - [ new IPv4([10, 0, 0, 0]), 8 ] - [ new IPv4([172, 16, 0, 0]), 12 ] - [ new IPv4([192, 168, 0, 0]), 16 ] - ] - reserved: [ # Reserved and testing-only ranges; RFCs 5735, 5737, 2544, 1700 - [ new IPv4([192, 0, 0, 0]), 24 ] - [ new IPv4([192, 0, 2, 0]), 24 ] - [ new IPv4([192, 88, 99, 0]), 24 ] - [ new IPv4([198, 51, 100, 0]), 24 ] - [ new IPv4([203, 0, 113, 0]), 24 ] - [ new IPv4([240, 0, 0, 0]), 4 ] - ] - - # Checks if the address corresponds to one of the special ranges. - range: -> - return ipaddr.subnetMatch(this, @SpecialRanges) - - # Convrets this IPv4 address to an IPv4-mapped IPv6 address. - toIPv4MappedAddress: -> - return ipaddr.IPv6.parse "::ffff:#{@toString()}" - -# A list of regular expressions that match arbitrary IPv4 addresses, -# for which a number of weird notations exist. -# Note that an address like 0010.0xa5.1.1 is considered legal. -ipv4Part = "(0?\\d+|0x[a-f0-9]+)" -ipv4Regexes = - fourOctet: new RegExp "^#{ipv4Part}\\.#{ipv4Part}\\.#{ipv4Part}\\.#{ipv4Part}$", 'i' - longValue: new RegExp "^#{ipv4Part}$", 'i' - -# Classful variants (like a.b, where a is an octet, and b is a 24-bit -# value representing last three octets; this corresponds to a class C -# address) are omitted due to classless nature of modern Internet. -ipaddr.IPv4.parser = (string) -> - parseIntAuto = (string) -> - if string[0] == "0" && string[1] != "x" - parseInt(string, 8) - else - parseInt(string) - - # parseInt recognizes all that octal & hexadecimal weirdness for us - if match = string.match(ipv4Regexes.fourOctet) - return (parseIntAuto(part) for part in match[1..5]) - else if match = string.match(ipv4Regexes.longValue) - value = parseIntAuto(match[1]) - if value > 0xffffffff || value < 0 - throw new Error "ipaddr: address outside defined range" - return ((value >> shift) & 0xff for shift in [0..24] by 8).reverse() - else - return null - -# An IPv6 address (RFC2460) -class ipaddr.IPv6 - # Constructs an IPv6 address from an array of eight 16-bit parts. - # Throws an error if the input is invalid. - constructor: (parts) -> - if parts.length != 8 - throw new Error "ipaddr: ipv6 part count should be 8" - - for part in parts - if !(0 <= part <= 0xffff) - throw new Error "ipaddr: ipv6 part should fit to two octets" - - @parts = parts - - # The 'kind' method exists on both IPv4 and IPv6 classes. - kind: -> - return 'ipv6' - - # Returns the address in compact, human-readable format like - # 2001:db8:8:66::1 - toString: -> - stringParts = (part.toString(16) for part in @parts) - - compactStringParts = [] - pushPart = (part) -> compactStringParts.push part - - state = 0 - for part in stringParts - switch state - when 0 - if part == '0' - pushPart('') - else - pushPart(part) - - state = 1 - when 1 - if part == '0' - state = 2 - else - pushPart(part) - when 2 - unless part == '0' - pushPart('') - pushPart(part) - state = 3 - when 3 - pushPart(part) - - if state == 2 - pushPart('') - pushPart('') - - return compactStringParts.join ":" - - # Returns an array of byte-sized values in network order - toByteArray: -> - bytes = [] - for part in @parts - bytes.push(part >> 8) - bytes.push(part & 0xff) - - return bytes - - # Returns the address in expanded format with all zeroes included, like - # 2001:db8:8:66:0:0:0:1 - toNormalizedString: -> - return (part.toString(16) for part in @parts).join ":" - - # Checks if this address matches other one within given CIDR range. - match: (other, cidrRange) -> - if cidrRange == undefined - [other, cidrRange] = other - - if other.kind() != 'ipv6' - throw new Error "ipaddr: cannot match ipv6 address with non-ipv6 one" - - return matchCIDR(this.parts, other.parts, 16, cidrRange) - - # Special IPv6 ranges - SpecialRanges: - unspecified: [ new IPv6([0, 0, 0, 0, 0, 0, 0, 0]), 128 ] # RFC4291, here and after - linkLocal: [ new IPv6([0xfe80, 0, 0, 0, 0, 0, 0, 0]), 10 ] - multicast: [ new IPv6([0xff00, 0, 0, 0, 0, 0, 0, 0]), 8 ] - loopback: [ new IPv6([0, 0, 0, 0, 0, 0, 0, 1]), 128 ] - uniqueLocal: [ new IPv6([0xfc00, 0, 0, 0, 0, 0, 0, 0]), 7 ] - ipv4Mapped: [ new IPv6([0, 0, 0, 0, 0, 0xffff, 0, 0]), 96 ] - rfc6145: [ new IPv6([0, 0, 0, 0, 0xffff, 0, 0, 0]), 96 ] # RFC6145 - rfc6052: [ new IPv6([0x64, 0xff9b, 0, 0, 0, 0, 0, 0]), 96 ] # RFC6052 - '6to4': [ new IPv6([0x2002, 0, 0, 0, 0, 0, 0, 0]), 16 ] # RFC3056 - teredo: [ new IPv6([0x2001, 0, 0, 0, 0, 0, 0, 0]), 32 ] # RFC6052, RFC6146 - reserved: [ - [ new IPv6([ 0x2001, 0xdb8, 0, 0, 0, 0, 0, 0]), 32 ] # RFC4291 - ] - - # Checks if the address corresponds to one of the special ranges. - range: -> - return ipaddr.subnetMatch(this, @SpecialRanges) - - # Checks if this address is an IPv4-mapped IPv6 address. - isIPv4MappedAddress: -> - return @range() == 'ipv4Mapped' - - # Converts this address to IPv4 address if it is an IPv4-mapped IPv6 address. - # Throws an error otherwise. - toIPv4Address: -> - unless @isIPv4MappedAddress() - throw new Error "ipaddr: trying to convert a generic ipv6 address to ipv4" - - [high, low] = @parts[-2..-1] - - return new ipaddr.IPv4([high >> 8, high & 0xff, low >> 8, low & 0xff]) - -# IPv6-matching regular expressions. -# For IPv6, the task is simpler: it is enough to match the colon-delimited -# hexadecimal IPv6 and a transitional variant with dotted-decimal IPv4 at -# the end. -ipv6Part = "(?:[0-9a-f]+::?)+" -ipv6Regexes = - native: new RegExp "^(::)?(#{ipv6Part})?([0-9a-f]+)?(::)?$", 'i' - transitional: new RegExp "^((?:#{ipv6Part})|(?:::)(?:#{ipv6Part})?)" + - "#{ipv4Part}\\.#{ipv4Part}\\.#{ipv4Part}\\.#{ipv4Part}$", 'i' - -# Expand :: in an IPv6 address or address part consisting of `parts` groups. -expandIPv6 = (string, parts) -> - # More than one '::' means invalid adddress - if string.indexOf('::') != string.lastIndexOf('::') - return null - - # How many parts do we already have? - colonCount = 0 - lastColon = -1 - while (lastColon = string.indexOf(':', lastColon + 1)) >= 0 - colonCount++ - - # 0::0 is two parts more than :: - colonCount-- if string.substr(0, 2) == '::' - colonCount-- if string.substr(-2, 2) == '::' - - # The following loop would hang if colonCount > parts - if colonCount > parts - return null - - # replacement = ':' + '0:' * (parts - colonCount) - replacementCount = parts - colonCount - replacement = ':' - while replacementCount-- - replacement += '0:' - - # Insert the missing zeroes - string = string.replace('::', replacement) - - # Trim any garbage which may be hanging around if :: was at the edge in - # the source string - string = string[1..-1] if string[0] == ':' - string = string[0..-2] if string[string.length-1] == ':' - - return (parseInt(part, 16) for part in string.split(":")) - -# Parse an IPv6 address. -ipaddr.IPv6.parser = (string) -> - if string.match(ipv6Regexes['native']) - return expandIPv6(string, 8) - - else if match = string.match(ipv6Regexes['transitional']) - parts = expandIPv6(match[1][0..-2], 6) - if parts - parts.push(parseInt(match[2]) << 8 | parseInt(match[3])) - parts.push(parseInt(match[4]) << 8 | parseInt(match[5])) - return parts - - return null - -# Checks if a given string is formatted like IPv4/IPv6 address. -ipaddr.IPv4.isIPv4 = ipaddr.IPv6.isIPv6 = (string) -> - return @parser(string) != null - -# Checks if a given string is a valid IPv4/IPv6 address. -ipaddr.IPv4.isValid = (string) -> - try - new this(@parser(string)) - return true - catch e - return false - -ipaddr.IPv6.isValid = (string) -> - # Since IPv6.isValid is always called first, this shortcut - # provides a substantial performance gain. - if typeof string == "string" and string.indexOf(":") == -1 - return false - - try - new this(@parser(string)) - return true - catch e - return false - -# Tries to parse and validate a string with IPv4/IPv6 address. -# Throws an error if it fails. -ipaddr.IPv4.parse = ipaddr.IPv6.parse = (string) -> - parts = @parser(string) - if parts == null - throw new Error "ipaddr: string is not formatted like ip address" - - return new this(parts) - -ipaddr.IPv4.parseCIDR = (string) -> - if match = string.match(/^(.+)\/(\d+)$/) - maskLength = parseInt(match[2]) - if maskLength >= 0 and maskLength <= 32 - return [@parse(match[1]), maskLength] - - throw new Error "ipaddr: string is not formatted like an IPv4 CIDR range" - -ipaddr.IPv6.parseCIDR = (string) -> - if match = string.match(/^(.+)\/(\d+)$/) - maskLength = parseInt(match[2]) - if maskLength >= 0 and maskLength <= 128 - return [@parse(match[1]), maskLength] - - throw new Error "ipaddr: string is not formatted like an IPv6 CIDR range" - -# Checks if the address is valid IP address -ipaddr.isValid = (string) -> - return ipaddr.IPv6.isValid(string) || ipaddr.IPv4.isValid(string) - -# Try to parse an address and throw an error if it is impossible -ipaddr.parse = (string) -> - if ipaddr.IPv6.isValid(string) - return ipaddr.IPv6.parse(string) - else if ipaddr.IPv4.isValid(string) - return ipaddr.IPv4.parse(string) - else - throw new Error "ipaddr: the address has neither IPv6 nor IPv4 format" - -ipaddr.parseCIDR = (string) -> - try - return ipaddr.IPv6.parseCIDR(string) - catch e - try - return ipaddr.IPv4.parseCIDR(string) - catch e - throw new Error "ipaddr: the address has neither IPv6 nor IPv4 CIDR format" - -# Parse an address and return plain IPv4 address if it is an IPv4-mapped address -ipaddr.process = (string) -> - addr = @parse(string) - if addr.kind() == 'ipv6' && addr.isIPv4MappedAddress() - return addr.toIPv4Address() - else - return addr diff --git a/node_modules/ipaddr.js/test/ipaddr.test.coffee b/node_modules/ipaddr.js/test/ipaddr.test.coffee deleted file mode 100644 index 17739e2..0000000 --- a/node_modules/ipaddr.js/test/ipaddr.test.coffee +++ /dev/null @@ -1,282 +0,0 @@ -ipaddr = require '../lib/ipaddr' - -module.exports = - 'should define main classes': (test) -> - test.ok(ipaddr.IPv4?, 'defines IPv4 class') - test.ok(ipaddr.IPv6?, 'defines IPv6 class') - test.done() - - 'can construct IPv4 from octets': (test) -> - test.doesNotThrow -> - new ipaddr.IPv4([192, 168, 1, 2]) - test.done() - - 'refuses to construct invalid IPv4': (test) -> - test.throws -> - new ipaddr.IPv4([300, 1, 2, 3]) - test.throws -> - new ipaddr.IPv4([8, 8, 8]) - test.done() - - 'converts IPv4 to string correctly': (test) -> - addr = new ipaddr.IPv4([192, 168, 1, 1]) - test.equal(addr.toString(), '192.168.1.1') - test.done() - - 'returns correct kind for IPv4': (test) -> - addr = new ipaddr.IPv4([1, 2, 3, 4]) - test.equal(addr.kind(), 'ipv4') - test.done() - - 'allows to access IPv4 octets': (test) -> - addr = new ipaddr.IPv4([42, 0, 0, 0]) - test.equal(addr.octets[0], 42) - test.done() - - 'checks IPv4 address format': (test) -> - test.equal(ipaddr.IPv4.isIPv4('192.168.007.0xa'), true) - test.equal(ipaddr.IPv4.isIPv4('1024.0.0.1'), true) - test.equal(ipaddr.IPv4.isIPv4('8.0xa.wtf.6'), false) - test.done() - - 'validates IPv4 addresses': (test) -> - test.equal(ipaddr.IPv4.isValid('192.168.007.0xa'), true) - test.equal(ipaddr.IPv4.isValid('1024.0.0.1'), false) - test.equal(ipaddr.IPv4.isValid('8.0xa.wtf.6'), false) - test.done() - - 'parses IPv4 in several weird formats': (test) -> - test.deepEqual(ipaddr.IPv4.parse('192.168.1.1').octets, [192, 168, 1, 1]) - test.deepEqual(ipaddr.IPv4.parse('0xc0.168.1.1').octets, [192, 168, 1, 1]) - test.deepEqual(ipaddr.IPv4.parse('192.0250.1.1').octets, [192, 168, 1, 1]) - test.deepEqual(ipaddr.IPv4.parse('0xc0a80101').octets, [192, 168, 1, 1]) - test.deepEqual(ipaddr.IPv4.parse('030052000401').octets, [192, 168, 1, 1]) - test.deepEqual(ipaddr.IPv4.parse('3232235777').octets, [192, 168, 1, 1]) - test.done() - - 'barfs at invalid IPv4': (test) -> - test.throws -> - ipaddr.IPv4.parse('10.0.0.wtf') - test.done() - - 'matches IPv4 CIDR correctly': (test) -> - addr = new ipaddr.IPv4([10, 5, 0, 1]) - test.equal(addr.match(ipaddr.IPv4.parse('0.0.0.0'), 0), true) - test.equal(addr.match(ipaddr.IPv4.parse('11.0.0.0'), 8), false) - test.equal(addr.match(ipaddr.IPv4.parse('10.0.0.0'), 8), true) - test.equal(addr.match(ipaddr.IPv4.parse('10.0.0.1'), 8), true) - test.equal(addr.match(ipaddr.IPv4.parse('10.0.0.10'), 8), true) - test.equal(addr.match(ipaddr.IPv4.parse('10.5.5.0'), 16), true) - test.equal(addr.match(ipaddr.IPv4.parse('10.4.5.0'), 16), false) - test.equal(addr.match(ipaddr.IPv4.parse('10.4.5.0'), 15), true) - test.equal(addr.match(ipaddr.IPv4.parse('10.5.0.2'), 32), false) - test.equal(addr.match(addr, 32), true) - test.done() - - 'parses IPv4 CIDR correctly': (test) -> - addr = new ipaddr.IPv4([10, 5, 0, 1]) - test.equal(addr.match(ipaddr.IPv4.parseCIDR('0.0.0.0/0')), true) - test.equal(addr.match(ipaddr.IPv4.parseCIDR('11.0.0.0/8')), false) - test.equal(addr.match(ipaddr.IPv4.parseCIDR('10.0.0.0/8')), true) - test.equal(addr.match(ipaddr.IPv4.parseCIDR('10.0.0.1/8')), true) - test.equal(addr.match(ipaddr.IPv4.parseCIDR('10.0.0.10/8')), true) - test.equal(addr.match(ipaddr.IPv4.parseCIDR('10.5.5.0/16')), true) - test.equal(addr.match(ipaddr.IPv4.parseCIDR('10.4.5.0/16')), false) - test.equal(addr.match(ipaddr.IPv4.parseCIDR('10.4.5.0/15')), true) - test.equal(addr.match(ipaddr.IPv4.parseCIDR('10.5.0.2/32')), false) - test.equal(addr.match(ipaddr.IPv4.parseCIDR('10.5.0.1/32')), true) - test.throws -> - ipaddr.IPv4.parseCIDR('10.5.0.1') - test.throws -> - ipaddr.IPv4.parseCIDR('0.0.0.0/-1') - test.throws -> - ipaddr.IPv4.parseCIDR('0.0.0.0/33') - test.done() - - 'detects reserved IPv4 networks': (test) -> - test.equal(ipaddr.IPv4.parse('0.0.0.0').range(), 'unspecified') - test.equal(ipaddr.IPv4.parse('0.1.0.0').range(), 'unspecified') - test.equal(ipaddr.IPv4.parse('10.1.0.1').range(), 'private') - test.equal(ipaddr.IPv4.parse('192.168.2.1').range(), 'private') - test.equal(ipaddr.IPv4.parse('224.100.0.1').range(), 'multicast') - test.equal(ipaddr.IPv4.parse('169.254.15.0').range(), 'linkLocal') - test.equal(ipaddr.IPv4.parse('127.1.1.1').range(), 'loopback') - test.equal(ipaddr.IPv4.parse('255.255.255.255').range(), 'broadcast') - test.equal(ipaddr.IPv4.parse('240.1.2.3').range(), 'reserved') - test.equal(ipaddr.IPv4.parse('8.8.8.8').range(), 'unicast') - test.done() - - 'can construct IPv6 from parts': (test) -> - test.doesNotThrow -> - new ipaddr.IPv6([0x2001, 0xdb8, 0xf53a, 0, 0, 0, 0, 1]) - test.done() - - 'refuses to construct invalid IPv6': (test) -> - test.throws -> - new ipaddr.IPv6([0xfffff, 0, 0, 0, 0, 0, 0, 1]) - test.throws -> - new ipaddr.IPv6([0xfffff, 0, 0, 0, 0, 0, 1]) - test.done() - - 'converts IPv6 to string correctly': (test) -> - addr = new ipaddr.IPv6([0x2001, 0xdb8, 0xf53a, 0, 0, 0, 0, 1]) - test.equal(addr.toNormalizedString(), '2001:db8:f53a:0:0:0:0:1') - test.equal(addr.toString(), '2001:db8:f53a::1') - test.equal(new ipaddr.IPv6([0, 0, 0, 0, 0, 0, 0, 1]).toString(), '::1') - test.equal(new ipaddr.IPv6([0x2001, 0xdb8, 0, 0, 0, 0, 0, 0]).toString(), '2001:db8::') - test.done() - - 'returns correct kind for IPv6': (test) -> - addr = new ipaddr.IPv6([0x2001, 0xdb8, 0xf53a, 0, 0, 0, 0, 1]) - test.equal(addr.kind(), 'ipv6') - test.done() - - 'allows to access IPv6 address parts': (test) -> - addr = new ipaddr.IPv6([0x2001, 0xdb8, 0xf53a, 0, 0, 42, 0, 1]) - test.equal(addr.parts[5], 42) - test.done() - - 'checks IPv6 address format': (test) -> - test.equal(ipaddr.IPv6.isIPv6('2001:db8:F53A::1'), true) - test.equal(ipaddr.IPv6.isIPv6('200001::1'), true) - test.equal(ipaddr.IPv6.isIPv6('::ffff:192.168.1.1'), true) - test.equal(ipaddr.IPv6.isIPv6('::ffff:300.168.1.1'), true) - test.equal(ipaddr.IPv6.isIPv6('::ffff:300.168.1.1:0'), false) - test.equal(ipaddr.IPv6.isIPv6('fe80::wtf'), false) - test.done() - - 'validates IPv6 addresses': (test) -> - test.equal(ipaddr.IPv6.isValid('2001:db8:F53A::1'), true) - test.equal(ipaddr.IPv6.isValid('200001::1'), false) - test.equal(ipaddr.IPv6.isValid('::ffff:192.168.1.1'), true) - test.equal(ipaddr.IPv6.isValid('::ffff:300.168.1.1'), false) - test.equal(ipaddr.IPv6.isValid('::ffff:300.168.1.1:0'), false) - test.equal(ipaddr.IPv6.isValid('2001:db8::F53A::1'), false) - test.equal(ipaddr.IPv6.isValid('fe80::wtf'), false) - test.equal(ipaddr.IPv6.isValid('2002::2:'), false) - test.equal(ipaddr.IPv6.isValid(undefined), false) - test.done() - - 'parses IPv6 in different formats': (test) -> - test.deepEqual(ipaddr.IPv6.parse('2001:db8:F53A:0:0:0:0:1').parts, [0x2001, 0xdb8, 0xf53a, 0, 0, 0, 0, 1]) - test.deepEqual(ipaddr.IPv6.parse('fe80::10').parts, [0xfe80, 0, 0, 0, 0, 0, 0, 0x10]) - test.deepEqual(ipaddr.IPv6.parse('2001:db8:F53A::').parts, [0x2001, 0xdb8, 0xf53a, 0, 0, 0, 0, 0]) - test.deepEqual(ipaddr.IPv6.parse('::1').parts, [0, 0, 0, 0, 0, 0, 0, 1]) - test.deepEqual(ipaddr.IPv6.parse('::').parts, [0, 0, 0, 0, 0, 0, 0, 0]) - test.done() - - 'barfs at invalid IPv6': (test) -> - test.throws -> - ipaddr.IPv6.parse('fe80::0::1') - test.done() - - 'matches IPv6 CIDR correctly': (test) -> - addr = ipaddr.IPv6.parse('2001:db8:f53a::1') - test.equal(addr.match(ipaddr.IPv6.parse('::'), 0), true) - test.equal(addr.match(ipaddr.IPv6.parse('2001:db8:f53a::1:1'), 64), true) - test.equal(addr.match(ipaddr.IPv6.parse('2001:db8:f53b::1:1'), 48), false) - test.equal(addr.match(ipaddr.IPv6.parse('2001:db8:f531::1:1'), 44), true) - test.equal(addr.match(ipaddr.IPv6.parse('2001:db8:f500::1'), 40), true) - test.equal(addr.match(ipaddr.IPv6.parse('2001:db9:f500::1'), 40), false) - test.equal(addr.match(addr, 128), true) - test.done() - - 'parses IPv6 CIDR correctly': (test) -> - addr = ipaddr.IPv6.parse('2001:db8:f53a::1') - test.equal(addr.match(ipaddr.IPv6.parseCIDR('::/0')), true) - test.equal(addr.match(ipaddr.IPv6.parseCIDR('2001:db8:f53a::1:1/64')), true) - test.equal(addr.match(ipaddr.IPv6.parseCIDR('2001:db8:f53b::1:1/48')), false) - test.equal(addr.match(ipaddr.IPv6.parseCIDR('2001:db8:f531::1:1/44')), true) - test.equal(addr.match(ipaddr.IPv6.parseCIDR('2001:db8:f500::1/40')), true) - test.equal(addr.match(ipaddr.IPv6.parseCIDR('2001:db9:f500::1/40')), false) - test.equal(addr.match(ipaddr.IPv6.parseCIDR('2001:db8:f53a::1/128')), true) - test.throws -> - ipaddr.IPv6.parseCIDR('2001:db8:f53a::1') - test.throws -> - ipaddr.IPv6.parseCIDR('2001:db8:f53a::1/-1') - test.throws -> - ipaddr.IPv6.parseCIDR('2001:db8:f53a::1/129') - test.done() - - 'converts between IPv4-mapped IPv6 addresses and IPv4 addresses': (test) -> - addr = ipaddr.IPv4.parse('77.88.21.11') - mapped = addr.toIPv4MappedAddress() - test.deepEqual(mapped.parts, [0, 0, 0, 0, 0, 0xffff, 0x4d58, 0x150b]) - test.deepEqual(mapped.toIPv4Address().octets, addr.octets) - test.done() - - 'refuses to convert non-IPv4-mapped IPv6 address to IPv4 address': (test) -> - test.throws -> - ipaddr.IPv6.parse('2001:db8::1').toIPv4Address() - test.done() - - 'detects reserved IPv6 networks': (test) -> - test.equal(ipaddr.IPv6.parse('::').range(), 'unspecified') - test.equal(ipaddr.IPv6.parse('fe80::1234:5678:abcd:0123').range(), 'linkLocal') - test.equal(ipaddr.IPv6.parse('ff00::1234').range(), 'multicast') - test.equal(ipaddr.IPv6.parse('::1').range(), 'loopback') - test.equal(ipaddr.IPv6.parse('fc00::').range(), 'uniqueLocal') - test.equal(ipaddr.IPv6.parse('::ffff:192.168.1.10').range(), 'ipv4Mapped') - test.equal(ipaddr.IPv6.parse('::ffff:0:192.168.1.10').range(), 'rfc6145') - test.equal(ipaddr.IPv6.parse('64:ff9b::1234').range(), 'rfc6052') - test.equal(ipaddr.IPv6.parse('2002:1f63:45e8::1').range(), '6to4') - test.equal(ipaddr.IPv6.parse('2001::4242').range(), 'teredo') - test.equal(ipaddr.IPv6.parse('2001:db8::3210').range(), 'reserved') - test.equal(ipaddr.IPv6.parse('2001:470:8:66::1').range(), 'unicast') - test.done() - - 'is able to determine IP address type': (test) -> - test.equal(ipaddr.parse('8.8.8.8').kind(), 'ipv4') - test.equal(ipaddr.parse('2001:db8:3312::1').kind(), 'ipv6') - test.done() - - 'throws an error if tried to parse an invalid address': (test) -> - test.throws -> - ipaddr.parse('::some.nonsense') - test.done() - - 'correctly processes IPv4-mapped addresses': (test) -> - test.equal(ipaddr.process('8.8.8.8').kind(), 'ipv4') - test.equal(ipaddr.process('2001:db8:3312::1').kind(), 'ipv6') - test.equal(ipaddr.process('::ffff:192.168.1.1').kind(), 'ipv4') - test.done() - - 'correctly converts IPv6 and IPv4 addresses to byte arrays': (test) -> - test.deepEqual(ipaddr.parse('1.2.3.4').toByteArray(), - [0x1, 0x2, 0x3, 0x4]); - # Fuck yeah. The first byte of Google's IPv6 address is 42. 42! - test.deepEqual(ipaddr.parse('2a00:1450:8007::68').toByteArray(), - [42, 0x00, 0x14, 0x50, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68 ]) - test.done() - - 'correctly parses 1 as an IPv4 address': (test) -> - test.equal(ipaddr.IPv6.isValid('1'), false) - test.equal(ipaddr.IPv4.isValid('1'), true) - test.deepEqual(new ipaddr.IPv4([0, 0, 0, 1]), ipaddr.parse('1')) - test.done() - - 'correctly detects IPv4 and IPv6 CIDR addresses': (test) -> - test.deepEqual([ipaddr.IPv6.parse('fc00::'), 64], - ipaddr.parseCIDR('fc00::/64')) - test.deepEqual([ipaddr.IPv4.parse('1.2.3.4'), 5], - ipaddr.parseCIDR('1.2.3.4/5')) - test.done() - - 'does not consider a very large or very small number a valid IP address': (test) -> - test.equal(ipaddr.isValid('4999999999'), false) - test.equal(ipaddr.isValid('-1'), false) - test.done() - - 'does not hang on ::8:8:8:8:8:8:8:8:8': (test) -> - test.equal(ipaddr.IPv6.isValid('::8:8:8:8:8:8:8:8:8'), false) - test.done() - - 'subnetMatch does not fail on empty range': (test) -> - ipaddr.subnetMatch(new ipaddr.IPv4([1,2,3,4]), {}, false) - ipaddr.subnetMatch(new ipaddr.IPv4([1,2,3,4]), {subnet: []}, false) - test.done() - - 'subnetMatch returns default subnet on empty range': (test) -> - test.equal(ipaddr.subnetMatch(new ipaddr.IPv4([1,2,3,4]), {}, false), false) - test.equal(ipaddr.subnetMatch(new ipaddr.IPv4([1,2,3,4]), {subnet: []}, false), false) - test.done() diff --git a/node_modules/is-property/.npmignore b/node_modules/is-property/.npmignore deleted file mode 100644 index 8ecfa25..0000000 --- a/node_modules/is-property/.npmignore +++ /dev/null @@ -1,17 +0,0 @@ -lib-cov -*.seed -*.log -*.csv -*.dat -*.out -*.pid -*.gz - -pids -logs -results - -npm-debug.log -node_modules/* -*.DS_Store -test/* \ No newline at end of file diff --git a/node_modules/is-property/README.md b/node_modules/is-property/README.md deleted file mode 100644 index ef1d00b..0000000 --- a/node_modules/is-property/README.md +++ /dev/null @@ -1,28 +0,0 @@ -is-property -=========== -Tests if a property of a JavaScript object can be accessed using the dot (.) notation or if it must be enclosed in brackets, (ie use x[" ... "]) - -Example -------- - -```javascript -var isProperty = require("is-property") - -console.log(isProperty("foo")) //Prints true -console.log(isProperty("0")) //Prints false -``` - -Install -------- - - npm install is-property - -### `require("is-property")(str)` -Checks if str is a property - -* `str` is a string which we will test if it is a property or not - -**Returns** true or false depending if str is a property - -## Credits -(c) 2013 Mikola Lysenko. MIT License \ No newline at end of file diff --git a/node_modules/is-property/is-property.js b/node_modules/is-property/is-property.js deleted file mode 100644 index db58b47..0000000 --- a/node_modules/is-property/is-property.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict" -function isProperty(str) { - return /^[$A-Z\_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc][$A-Z\_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc0-9\u0300-\u036f\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e4-\u08fe\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d02\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19b0-\u19c0\u19c8\u19c9\u19d0-\u19d9\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2-\u1cf4\u1dc0-\u1de6\u1dfc-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f1\ua900-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f]*$/.test(str) -} -module.exports = isProperty \ No newline at end of file diff --git a/node_modules/is-property/package.json b/node_modules/is-property/package.json deleted file mode 100644 index 2105f7b..0000000 --- a/node_modules/is-property/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "is-property", - "version": "1.0.2", - "description": "Tests if a JSON property can be accessed using . syntax", - "main": "is-property.js", - "directories": { - "test": "test" - }, - "dependencies": {}, - "devDependencies": { - "tape": "~1.0.4" - }, - "scripts": { - "test": "tap test/*.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/mikolalysenko/is-property.git" - }, - "keywords": [ - "is", - "property", - "json", - "dot", - "bracket", - ".", - "[]" - ], - "author": "Mikola Lysenko", - "license": "MIT", - "readmeFilename": "README.md", - "gitHead": "0a85ea5b6b1264ea1cdecc6e5cf186adbb3ffc50", - "bugs": { - "url": "https://github.com/mikolalysenko/is-property/issues" - } -} diff --git a/node_modules/ipaddr.js/.npmignore b/node_modules/isarray/.npmignore similarity index 68% rename from node_modules/ipaddr.js/.npmignore rename to node_modules/isarray/.npmignore index 7a1537b..3c3629e 100644 --- a/node_modules/ipaddr.js/.npmignore +++ b/node_modules/isarray/.npmignore @@ -1,2 +1 @@ -.idea node_modules diff --git a/node_modules/generate-function/.travis.yml b/node_modules/isarray/.travis.yml similarity index 79% rename from node_modules/generate-function/.travis.yml rename to node_modules/isarray/.travis.yml index 6e5919d..cc4dba2 100644 --- a/node_modules/generate-function/.travis.yml +++ b/node_modules/isarray/.travis.yml @@ -1,3 +1,4 @@ language: node_js node_js: + - "0.8" - "0.10" diff --git a/node_modules/isarray/Makefile b/node_modules/isarray/Makefile new file mode 100644 index 0000000..787d56e --- /dev/null +++ b/node_modules/isarray/Makefile @@ -0,0 +1,6 @@ + +test: + @node_modules/.bin/tape test.js + +.PHONY: test + diff --git a/node_modules/isarray/README.md b/node_modules/isarray/README.md new file mode 100644 index 0000000..16d2c59 --- /dev/null +++ b/node_modules/isarray/README.md @@ -0,0 +1,60 @@ + +# isarray + +`Array#isArray` for older browsers. + +[![build status](https://secure.travis-ci.org/juliangruber/isarray.svg)](http://travis-ci.org/juliangruber/isarray) +[![downloads](https://img.shields.io/npm/dm/isarray.svg)](https://www.npmjs.org/package/isarray) + +[![browser support](https://ci.testling.com/juliangruber/isarray.png) +](https://ci.testling.com/juliangruber/isarray) + +## Usage + +```js +var isArray = require('isarray'); + +console.log(isArray([])); // => true +console.log(isArray({})); // => false +``` + +## Installation + +With [npm](http://npmjs.org) do + +```bash +$ npm install isarray +``` + +Then bundle for the browser with +[browserify](https://github.com/substack/browserify). + +With [component](http://component.io) do + +```bash +$ component install juliangruber/isarray +``` + +## 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/isarray/component.json b/node_modules/isarray/component.json new file mode 100644 index 0000000..9e31b68 --- /dev/null +++ b/node_modules/isarray/component.json @@ -0,0 +1,19 @@ +{ + "name" : "isarray", + "description" : "Array#isArray for older browsers", + "version" : "0.0.1", + "repository" : "juliangruber/isarray", + "homepage": "https://github.com/juliangruber/isarray", + "main" : "index.js", + "scripts" : [ + "index.js" + ], + "dependencies" : {}, + "keywords": ["browser","isarray","array"], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT" +} diff --git a/node_modules/isarray/index.js b/node_modules/isarray/index.js new file mode 100644 index 0000000..a57f634 --- /dev/null +++ b/node_modules/isarray/index.js @@ -0,0 +1,5 @@ +var toString = {}.toString; + +module.exports = Array.isArray || function (arr) { + return toString.call(arr) == '[object Array]'; +}; diff --git a/node_modules/isarray/package.json b/node_modules/isarray/package.json new file mode 100644 index 0000000..1a4317a --- /dev/null +++ b/node_modules/isarray/package.json @@ -0,0 +1,45 @@ +{ + "name": "isarray", + "description": "Array#isArray for older browsers", + "version": "1.0.0", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/isarray.git" + }, + "homepage": "https://github.com/juliangruber/isarray", + "main": "index.js", + "dependencies": {}, + "devDependencies": { + "tape": "~2.13.4" + }, + "keywords": [ + "browser", + "isarray", + "array" + ], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT", + "testling": { + "files": "test.js", + "browsers": [ + "ie/8..latest", + "firefox/17..latest", + "firefox/nightly", + "chrome/22..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" + ] + }, + "scripts": { + "test": "tape test.js" + } +} diff --git a/node_modules/isarray/test.js b/node_modules/isarray/test.js new file mode 100644 index 0000000..e0c3444 --- /dev/null +++ b/node_modules/isarray/test.js @@ -0,0 +1,20 @@ +var isArray = require('./'); +var test = require('tape'); + +test('is array', function(t){ + t.ok(isArray([])); + t.notOk(isArray({})); + t.notOk(isArray(null)); + t.notOk(isArray(false)); + + var obj = {}; + obj[0] = true; + t.notOk(isArray(obj)); + + var arr = []; + arr.foo = 'bar'; + t.ok(isArray(arr)); + + t.end(); +}); + diff --git a/node_modules/long/LICENSE b/node_modules/long/LICENSE deleted file mode 100644 index d645695..0000000 --- a/node_modules/long/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/node_modules/long/README.md b/node_modules/long/README.md deleted file mode 100644 index ab168f1..0000000 --- a/node_modules/long/README.md +++ /dev/null @@ -1,280 +0,0 @@ -long.js -======= - -A Long class for representing a 64 bit two's-complement integer value derived from the [Closure Library](https://github.com/google/closure-library) -for stand-alone use and extended with unsigned support. - -[![Build Status](https://img.shields.io/github/workflow/status/dcodeIO/long.js/Test/main?label=test&logo=github)](https://github.com/dcodeIO/long.js/actions?query=workflow%3ATest) [![Publish Status](https://img.shields.io/github/workflow/status/dcodeIO/long.js/Publish/main?label=publish&logo=github)](https://github.com/dcodeIO/long.js/actions?query=workflow%3APublish) [![npm](https://img.shields.io/npm/v/long.svg?label=npm&color=007acc&logo=npm)](https://www.npmjs.com/package/long) - -Background ----------- - -As of [ECMA-262 5th Edition](http://ecma262-5.com/ELS5_HTML.htm#Section_8.5), "all the positive and negative integers -whose magnitude is no greater than 253 are representable in the Number type", which is "representing the -doubleprecision 64-bit format IEEE 754 values as specified in the IEEE Standard for Binary Floating-Point Arithmetic". -The [maximum safe integer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER) -in JavaScript is 253-1. - -Example: 264-1 is 1844674407370955**1615** but in JavaScript it evaluates to 1844674407370955**2000**. - -Furthermore, bitwise operators in JavaScript "deal only with integers in the range −231 through -231−1, inclusive, or in the range 0 through 232−1, inclusive. These operators accept any value of -the Number type but first convert each such value to one of 232 integer values." - -In some use cases, however, it is required to be able to reliably work with and perform bitwise operations on the full -64 bits. This is where long.js comes into play. - -Usage ------ - -The package exports an ECMAScript module with an UMD fallback. - -``` -$> npm install long -``` - -```js -import Long from "long"; - -var value = new Long(0xFFFFFFFF, 0x7FFFFFFF); -console.log(value.toString()); -... -``` - -Note that mixing ESM and CommonJS is not recommended as it yields different classes, albeit with the same functionality. - -### Usage with a CDN - - * From GitHub via [jsDelivr](https://www.jsdelivr.com):
- `https://cdn.jsdelivr.net/gh/dcodeIO/long.js@TAG/index.js` (ESM) - * From npm via [jsDelivr](https://www.jsdelivr.com):
- `https://cdn.jsdelivr.net/npm/long@VERSION/index.js` (ESM)
- `https://cdn.jsdelivr.net/npm/long@VERSION/umd/index.js` (UMD) - * From npm via [unpkg](https://unpkg.com):
- `https://unpkg.com/long@VERSION/index.js` (ESM)
- `https://unpkg.com/long@VERSION/umd/index.js` (UMD) - - Replace `TAG` respectively `VERSION` with a [specific version](https://github.com/dcodeIO/long.js/releases) or omit it (not recommended in production) to use main/latest. - -API ---- - -### Constructor - -* new **Long**(low: `number`, high?: `number`, unsigned?: `boolean`)
- Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers. See the from* functions below for more convenient ways of constructing Longs. - -### Fields - -* Long#**low**: `number`
- The low 32 bits as a signed value. - -* Long#**high**: `number`
- The high 32 bits as a signed value. - -* Long#**unsigned**: `boolean`
- Whether unsigned or not. - -### Constants - -* Long.**ZERO**: `Long`
- Signed zero. - -* Long.**ONE**: `Long`
- Signed one. - -* Long.**NEG_ONE**: `Long`
- Signed negative one. - -* Long.**UZERO**: `Long`
- Unsigned zero. - -* Long.**UONE**: `Long`
- Unsigned one. - -* Long.**MAX_VALUE**: `Long`
- Maximum signed value. - -* Long.**MIN_VALUE**: `Long`
- Minimum signed value. - -* Long.**MAX_UNSIGNED_VALUE**: `Long`
- Maximum unsigned value. - -### Utility - -* Long.**isLong**(obj: `*`): `boolean`
- Tests if the specified object is a Long. - -* Long.**fromBits**(lowBits: `number`, highBits: `number`, unsigned?: `boolean`): `Long`
- Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is assumed to use 32 bits. - -* Long.**fromBytes**(bytes: `number[]`, unsigned?: `boolean`, le?: `boolean`): `Long`
- Creates a Long from its byte representation. - -* Long.**fromBytesLE**(bytes: `number[]`, unsigned?: `boolean`): `Long`
- Creates a Long from its little endian byte representation. - -* Long.**fromBytesBE**(bytes: `number[]`, unsigned?: `boolean`): `Long`
- Creates a Long from its big endian byte representation. - -* Long.**fromInt**(value: `number`, unsigned?: `boolean`): `Long`
- Returns a Long representing the given 32 bit integer value. - -* Long.**fromNumber**(value: `number`, unsigned?: `boolean`): `Long`
- Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. - -* Long.**fromString**(str: `string`, unsigned?: `boolean`, radix?: `number`)
- Long.**fromString**(str: `string`, radix: `number`)
- Returns a Long representation of the given string, written using the specified radix. - -* Long.**fromValue**(val: `*`, unsigned?: `boolean`): `Long`
- Converts the specified value to a Long using the appropriate from* function for its type. - -### Methods - -* Long#**add**(addend: `Long | number | string`): `Long`
- Returns the sum of this and the specified Long. - -* Long#**and**(other: `Long | number | string`): `Long`
- Returns the bitwise AND of this Long and the specified. - -* Long#**compare**/**comp**(other: `Long | number | string`): `number`
- Compares this Long's value with the specified's. Returns `0` if they are the same, `1` if the this is greater and `-1` if the given one is greater. - -* Long#**divide**/**div**(divisor: `Long | number | string`): `Long`
- Returns this Long divided by the specified. - -* Long#**equals**/**eq**(other: `Long | number | string`): `boolean`
- Tests if this Long's value equals the specified's. - -* Long#**getHighBits**(): `number`
- Gets the high 32 bits as a signed integer. - -* Long#**getHighBitsUnsigned**(): `number`
- Gets the high 32 bits as an unsigned integer. - -* Long#**getLowBits**(): `number`
- Gets the low 32 bits as a signed integer. - -* Long#**getLowBitsUnsigned**(): `number`
- Gets the low 32 bits as an unsigned integer. - -* Long#**getNumBitsAbs**(): `number`
- Gets the number of bits needed to represent the absolute value of this Long. - -* Long#**greaterThan**/**gt**(other: `Long | number | string`): `boolean`
- Tests if this Long's value is greater than the specified's. - -* Long#**greaterThanOrEqual**/**gte**/**ge**(other: `Long | number | string`): `boolean`
- Tests if this Long's value is greater than or equal the specified's. - -* Long#**isEven**(): `boolean`
- Tests if this Long's value is even. - -* Long#**isNegative**(): `boolean`
- Tests if this Long's value is negative. - -* Long#**isOdd**(): `boolean`
- Tests if this Long's value is odd. - -* Long#**isPositive**(): `boolean`
- Tests if this Long's value is positive or zero. - -* Long#**isZero**/**eqz**(): `boolean`
- Tests if this Long's value equals zero. - -* Long#**lessThan**/**lt**(other: `Long | number | string`): `boolean`
- Tests if this Long's value is less than the specified's. - -* Long#**lessThanOrEqual**/**lte**/**le**(other: `Long | number | string`): `boolean`
- Tests if this Long's value is less than or equal the specified's. - -* Long#**modulo**/**mod**/**rem**(divisor: `Long | number | string`): `Long`
- Returns this Long modulo the specified. - -* Long#**multiply**/**mul**(multiplier: `Long | number | string`): `Long`
- Returns the product of this and the specified Long. - -* Long#**negate**/**neg**(): `Long`
- Negates this Long's value. - -* Long#**not**(): `Long`
- Returns the bitwise NOT of this Long. - -* Long#**countLeadingZeros**/**clz**(): `number`
- Returns count leading zeros of this Long. - -* Long#**countTrailingZeros**/**ctz**(): `number`
- Returns count trailing zeros of this Long. - -* Long#**notEquals**/**neq**/**ne**(other: `Long | number | string`): `boolean`
- Tests if this Long's value differs from the specified's. - -* Long#**or**(other: `Long | number | string`): `Long`
- Returns the bitwise OR of this Long and the specified. - -* Long#**shiftLeft**/**shl**(numBits: `Long | number | string`): `Long`
- Returns this Long with bits shifted to the left by the given amount. - -* Long#**shiftRight**/**shr**(numBits: `Long | number | string`): `Long`
- Returns this Long with bits arithmetically shifted to the right by the given amount. - -* Long#**shiftRightUnsigned**/**shru**/**shr_u**(numBits: `Long | number | string`): `Long`
- Returns this Long with bits logically shifted to the right by the given amount. - -* Long#**rotateLeft**/**rotl**(numBits: `Long | number | string`): `Long`
- Returns this Long with bits rotated to the left by the given amount. - -* Long#**rotateRight**/**rotr**(numBits: `Long | number | string`): `Long`
- Returns this Long with bits rotated to the right by the given amount. - -* Long#**subtract**/**sub**(subtrahend: `Long | number | string`): `Long`
- Returns the difference of this and the specified Long. - -* Long#**toBytes**(le?: `boolean`): `number[]`
- Converts this Long to its byte representation. - -* Long#**toBytesLE**(): `number[]`
- Converts this Long to its little endian byte representation. - -* Long#**toBytesBE**(): `number[]`
- Converts this Long to its big endian byte representation. - -* Long#**toInt**(): `number`
- Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. - -* Long#**toNumber**(): `number`
- Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). - -* Long#**toSigned**(): `Long`
- Converts this Long to signed. - -* Long#**toString**(radix?: `number`): `string`
- Converts the Long to a string written in the specified radix. - -* Long#**toUnsigned**(): `Long`
- Converts this Long to unsigned. - -* Long#**xor**(other: `Long | number | string`): `Long`
- Returns the bitwise XOR of this Long and the given one. - -WebAssembly support -------------------- - -[WebAssembly](http://webassembly.org) supports 64-bit integer arithmetic out of the box, hence a [tiny WebAssembly module](./wasm.wat) is used to compute operations like multiplication, division and remainder more efficiently (slow operations like division are around twice as fast), falling back to floating point based computations in JavaScript where WebAssembly is not yet supported, e.g., in older versions of node. - -Building --------- - -Building the UMD fallback: - -``` -$> npm run build -``` - -Running the [tests](./tests): - -``` -$> npm test -``` diff --git a/node_modules/long/index.d.ts b/node_modules/long/index.d.ts deleted file mode 100644 index 521533d..0000000 --- a/node_modules/long/index.d.ts +++ /dev/null @@ -1,457 +0,0 @@ -declare class Long { - /** - * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as signed integers. See the from* functions below for more convenient ways of constructing Longs. - */ - constructor(low: number, high?: number, unsigned?: boolean); - - /** - * Maximum unsigned value. - */ - static MAX_UNSIGNED_VALUE: Long; - - /** - * Maximum signed value. - */ - static MAX_VALUE: Long; - - /** - * Minimum signed value. - */ - static MIN_VALUE: Long; - - /** - * Signed negative one. - */ - static NEG_ONE: Long; - - /** - * Signed one. - */ - static ONE: Long; - - /** - * Unsigned one. - */ - static UONE: Long; - - /** - * Unsigned zero. - */ - static UZERO: Long; - - /** - * Signed zero - */ - static ZERO: Long; - - /** - * The high 32 bits as a signed value. - */ - high: number; - - /** - * The low 32 bits as a signed value. - */ - low: number; - - /** - * Whether unsigned or not. - */ - unsigned: boolean; - - /** - * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is assumed to use 32 bits. - */ - static fromBits(lowBits: number, highBits: number, unsigned?: boolean): Long; - - /** - * Returns a Long representing the given 32 bit integer value. - */ - static fromInt(value: number, unsigned?: boolean): Long; - - /** - * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. - */ - static fromNumber(value: number, unsigned?: boolean): Long; - - /** - * Returns a Long representation of the given string, written using the specified radix. - */ - static fromString( - str: string, - unsigned?: boolean | number, - radix?: number - ): Long; - - /** - * Creates a Long from its byte representation. - */ - static fromBytes(bytes: number[], unsigned?: boolean, le?: boolean): Long; - - /** - * Creates a Long from its little endian byte representation. - */ - static fromBytesLE(bytes: number[], unsigned?: boolean): Long; - - /** - * Creates a Long from its big endian byte representation. - */ - static fromBytesBE(bytes: number[], unsigned?: boolean): Long; - - /** - * Tests if the specified object is a Long. - */ - static isLong(obj: any): obj is Long; - - /** - * Converts the specified value to a Long. - */ - static fromValue( - val: - | Long - | number - | string - | { low: number; high: number; unsigned: boolean }, - unsigned?: boolean - ): Long; - - /** - * Returns the sum of this and the specified Long. - */ - add(addend: number | Long | string): Long; - - /** - * Returns the bitwise AND of this Long and the specified. - */ - and(other: Long | number | string): Long; - - /** - * Compares this Long's value with the specified's. - */ - compare(other: Long | number | string): number; - - /** - * Compares this Long's value with the specified's. - */ - comp(other: Long | number | string): number; - - /** - * Returns this Long divided by the specified. - */ - divide(divisor: Long | number | string): Long; - - /** - * Returns this Long divided by the specified. - */ - div(divisor: Long | number | string): Long; - - /** - * Tests if this Long's value equals the specified's. - */ - equals(other: Long | number | string): boolean; - - /** - * Tests if this Long's value equals the specified's. - */ - eq(other: Long | number | string): boolean; - - /** - * Gets the high 32 bits as a signed integer. - */ - getHighBits(): number; - - /** - * Gets the high 32 bits as an unsigned integer. - */ - getHighBitsUnsigned(): number; - - /** - * Gets the low 32 bits as a signed integer. - */ - getLowBits(): number; - - /** - * Gets the low 32 bits as an unsigned integer. - */ - getLowBitsUnsigned(): number; - - /** - * Gets the number of bits needed to represent the absolute value of this Long. - */ - getNumBitsAbs(): number; - - /** - * Tests if this Long's value is greater than the specified's. - */ - greaterThan(other: Long | number | string): boolean; - - /** - * Tests if this Long's value is greater than the specified's. - */ - gt(other: Long | number | string): boolean; - - /** - * Tests if this Long's value is greater than or equal the specified's. - */ - greaterThanOrEqual(other: Long | number | string): boolean; - - /** - * Tests if this Long's value is greater than or equal the specified's. - */ - gte(other: Long | number | string): boolean; - - /** - * Tests if this Long's value is greater than or equal the specified's. - */ - ge(other: Long | number | string): boolean; - - /** - * Tests if this Long's value is even. - */ - isEven(): boolean; - - /** - * Tests if this Long's value is negative. - */ - isNegative(): boolean; - - /** - * Tests if this Long's value is odd. - */ - isOdd(): boolean; - - /** - * Tests if this Long's value is positive or zero. - */ - isPositive(): boolean; - - /** - * Tests if this Long's value equals zero. - */ - isZero(): boolean; - - /** - * Tests if this Long's value equals zero. - */ - eqz(): boolean; - - /** - * Tests if this Long's value is less than the specified's. - */ - lessThan(other: Long | number | string): boolean; - - /** - * Tests if this Long's value is less than the specified's. - */ - lt(other: Long | number | string): boolean; - - /** - * Tests if this Long's value is less than or equal the specified's. - */ - lessThanOrEqual(other: Long | number | string): boolean; - - /** - * Tests if this Long's value is less than or equal the specified's. - */ - lte(other: Long | number | string): boolean; - - /** - * Tests if this Long's value is less than or equal the specified's. - */ - le(other: Long | number | string): boolean; - - /** - * Returns this Long modulo the specified. - */ - modulo(other: Long | number | string): Long; - - /** - * Returns this Long modulo the specified. - */ - mod(other: Long | number | string): Long; - - /** - * Returns this Long modulo the specified. - */ - rem(other: Long | number | string): Long; - - /** - * Returns the product of this and the specified Long. - */ - multiply(multiplier: Long | number | string): Long; - - /** - * Returns the product of this and the specified Long. - */ - mul(multiplier: Long | number | string): Long; - - /** - * Negates this Long's value. - */ - negate(): Long; - - /** - * Negates this Long's value. - */ - neg(): Long; - - /** - * Returns the bitwise NOT of this Long. - */ - not(): Long; - - /** - * Returns count leading zeros of this Long. - */ - countLeadingZeros(): number; - - /** - * Returns count leading zeros of this Long. - */ - clz(): number; - - /** - * Returns count trailing zeros of this Long. - */ - countTrailingZeros(): number; - - /** - * Returns count trailing zeros of this Long. - */ - ctz(): number; - - /** - * Tests if this Long's value differs from the specified's. - */ - notEquals(other: Long | number | string): boolean; - - /** - * Tests if this Long's value differs from the specified's. - */ - neq(other: Long | number | string): boolean; - - /** - * Tests if this Long's value differs from the specified's. - */ - ne(other: Long | number | string): boolean; - - /** - * Returns the bitwise OR of this Long and the specified. - */ - or(other: Long | number | string): Long; - - /** - * Returns this Long with bits shifted to the left by the given amount. - */ - shiftLeft(numBits: number | Long): Long; - - /** - * Returns this Long with bits shifted to the left by the given amount. - */ - shl(numBits: number | Long): Long; - - /** - * Returns this Long with bits arithmetically shifted to the right by the given amount. - */ - shiftRight(numBits: number | Long): Long; - - /** - * Returns this Long with bits arithmetically shifted to the right by the given amount. - */ - shr(numBits: number | Long): Long; - - /** - * Returns this Long with bits logically shifted to the right by the given amount. - */ - shiftRightUnsigned(numBits: number | Long): Long; - - /** - * Returns this Long with bits logically shifted to the right by the given amount. - */ - shru(numBits: number | Long): Long; - - /** - * Returns this Long with bits logically shifted to the right by the given amount. - */ - shr_u(numBits: number | Long): Long; - - /** - * Returns this Long with bits rotated to the left by the given amount. - */ - rotateLeft(numBits: number | Long): Long; - - /** - * Returns this Long with bits rotated to the left by the given amount. - */ - rotl(numBits: number | Long): Long; - - /** - * Returns this Long with bits rotated to the right by the given amount. - */ - rotateRight(numBits: number | Long): Long; - - /** - * Returns this Long with bits rotated to the right by the given amount. - */ - rotr(numBits: number | Long): Long; - - /** - * Returns the difference of this and the specified Long. - */ - subtract(subtrahend: number | Long | string): Long; - - /** - * Returns the difference of this and the specified Long. - */ - sub(subtrahend: number | Long | string): Long; - - /** - * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. - */ - toInt(): number; - - /** - * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). - */ - toNumber(): number; - - /** - * Converts this Long to its byte representation. - */ - - toBytes(le?: boolean): number[]; - - /** - * Converts this Long to its little endian byte representation. - */ - - toBytesLE(): number[]; - - /** - * Converts this Long to its big endian byte representation. - */ - - toBytesBE(): number[]; - - /** - * Converts this Long to signed. - */ - toSigned(): Long; - - /** - * Converts the Long to a string written in the specified radix. - */ - toString(radix?: number): string; - - /** - * Converts this Long to unsigned. - */ - toUnsigned(): Long; - - /** - * Returns the bitwise XOR of this Long and the given one. - */ - xor(other: Long | number | string): Long; -} - -export default Long; // compatible with `import Long from "long"` diff --git a/node_modules/long/index.js b/node_modules/long/index.js deleted file mode 100644 index f04775e..0000000 --- a/node_modules/long/index.js +++ /dev/null @@ -1,1467 +0,0 @@ -/** - * @license - * Copyright 2009 The Closure Library Authors - * Copyright 2020 Daniel Wirtz / The long.js 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. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -// WebAssembly optimizations to do native i64 multiplication and divide -var wasm = null; -try { - wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([ - 0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11 - ])), {}).exports; -} catch (e) { - // no wasm support :( -} - -/** - * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers. - * See the from* functions below for more convenient ways of constructing Longs. - * @exports Long - * @class A Long class for representing a 64 bit two's-complement integer value. - * @param {number} low The low (signed) 32 bits of the long - * @param {number} high The high (signed) 32 bits of the long - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @constructor - */ -function Long(low, high, unsigned) { - - /** - * The low 32 bits as a signed value. - * @type {number} - */ - this.low = low | 0; - - /** - * The high 32 bits as a signed value. - * @type {number} - */ - this.high = high | 0; - - /** - * Whether unsigned or not. - * @type {boolean} - */ - this.unsigned = !!unsigned; -} - -// The internal representation of a long is the two given signed, 32-bit values. -// We use 32-bit pieces because these are the size of integers on which -// Javascript performs bit-operations. For operations like addition and -// multiplication, we split each number into 16 bit pieces, which can easily be -// multiplied within Javascript's floating-point representation without overflow -// or change in sign. -// -// In the algorithms below, we frequently reduce the negative case to the -// positive case by negating the input(s) and then post-processing the result. -// Note that we must ALWAYS check specially whether those values are MIN_VALUE -// (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as -// a positive number, it overflows back into a negative). Not handling this -// case would often result in infinite recursion. -// -// Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the from* -// methods on which they depend. - -/** - * An indicator used to reliably determine if an object is a Long or not. - * @type {boolean} - * @const - * @private - */ -Long.prototype.__isLong__; - -Object.defineProperty(Long.prototype, "__isLong__", { value: true }); - -/** - * @function - * @param {*} obj Object - * @returns {boolean} - * @inner - */ -function isLong(obj) { - return (obj && obj["__isLong__"]) === true; -} - -/** - * @function - * @param {*} value number - * @returns {number} - * @inner - */ -function ctz32(value) { - var c = Math.clz32(value & -value); - return value ? 31 - c : c; -} - -/** - * Tests if the specified object is a Long. - * @function - * @param {*} obj Object - * @returns {boolean} - */ -Long.isLong = isLong; - -/** - * A cache of the Long representations of small integer values. - * @type {!Object} - * @inner - */ -var INT_CACHE = {}; - -/** - * A cache of the Long representations of small unsigned integer values. - * @type {!Object} - * @inner - */ -var UINT_CACHE = {}; - -/** - * @param {number} value - * @param {boolean=} unsigned - * @returns {!Long} - * @inner - */ -function fromInt(value, unsigned) { - var obj, cachedObj, cache; - if (unsigned) { - value >>>= 0; - if (cache = (0 <= value && value < 256)) { - cachedObj = UINT_CACHE[value]; - if (cachedObj) - return cachedObj; - } - obj = fromBits(value, 0, true); - if (cache) - UINT_CACHE[value] = obj; - return obj; - } else { - value |= 0; - if (cache = (-128 <= value && value < 128)) { - cachedObj = INT_CACHE[value]; - if (cachedObj) - return cachedObj; - } - obj = fromBits(value, value < 0 ? -1 : 0, false); - if (cache) - INT_CACHE[value] = obj; - return obj; - } -} - -/** - * Returns a Long representing the given 32 bit integer value. - * @function - * @param {number} value The 32 bit integer in question - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @returns {!Long} The corresponding Long value - */ -Long.fromInt = fromInt; - -/** - * @param {number} value - * @param {boolean=} unsigned - * @returns {!Long} - * @inner - */ -function fromNumber(value, unsigned) { - if (isNaN(value)) - return unsigned ? UZERO : ZERO; - if (unsigned) { - if (value < 0) - return UZERO; - if (value >= TWO_PWR_64_DBL) - return MAX_UNSIGNED_VALUE; - } else { - if (value <= -TWO_PWR_63_DBL) - return MIN_VALUE; - if (value + 1 >= TWO_PWR_63_DBL) - return MAX_VALUE; - } - if (value < 0) - return fromNumber(-value, unsigned).neg(); - return fromBits((value % TWO_PWR_32_DBL) | 0, (value / TWO_PWR_32_DBL) | 0, unsigned); -} - -/** - * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. - * @function - * @param {number} value The number in question - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @returns {!Long} The corresponding Long value - */ -Long.fromNumber = fromNumber; - -/** - * @param {number} lowBits - * @param {number} highBits - * @param {boolean=} unsigned - * @returns {!Long} - * @inner - */ -function fromBits(lowBits, highBits, unsigned) { - return new Long(lowBits, highBits, unsigned); -} - -/** - * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is - * assumed to use 32 bits. - * @function - * @param {number} lowBits The low 32 bits - * @param {number} highBits The high 32 bits - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @returns {!Long} The corresponding Long value - */ -Long.fromBits = fromBits; - -/** - * @function - * @param {number} base - * @param {number} exponent - * @returns {number} - * @inner - */ -var pow_dbl = Math.pow; // Used 4 times (4*8 to 15+4) - -/** - * @param {string} str - * @param {(boolean|number)=} unsigned - * @param {number=} radix - * @returns {!Long} - * @inner - */ -function fromString(str, unsigned, radix) { - if (str.length === 0) - throw Error('empty string'); - if (typeof unsigned === 'number') { - // For goog.math.long compatibility - radix = unsigned; - unsigned = false; - } else { - unsigned = !!unsigned; - } - if (str === "NaN" || str === "Infinity" || str === "+Infinity" || str === "-Infinity") - return unsigned ? UZERO : ZERO; - radix = radix || 10; - if (radix < 2 || 36 < radix) - throw RangeError('radix'); - - var p; - if ((p = str.indexOf('-')) > 0) - throw Error('interior hyphen'); - else if (p === 0) { - return fromString(str.substring(1), unsigned, radix).neg(); - } - - // Do several (8) digits each time through the loop, so as to - // minimize the calls to the very expensive emulated div. - var radixToPower = fromNumber(pow_dbl(radix, 8)); - - var result = ZERO; - for (var i = 0; i < str.length; i += 8) { - var size = Math.min(8, str.length - i), - value = parseInt(str.substring(i, i + size), radix); - if (size < 8) { - var power = fromNumber(pow_dbl(radix, size)); - result = result.mul(power).add(fromNumber(value)); - } else { - result = result.mul(radixToPower); - result = result.add(fromNumber(value)); - } - } - result.unsigned = unsigned; - return result; -} - -/** - * Returns a Long representation of the given string, written using the specified radix. - * @function - * @param {string} str The textual representation of the Long - * @param {(boolean|number)=} unsigned Whether unsigned or not, defaults to signed - * @param {number=} radix The radix in which the text is written (2-36), defaults to 10 - * @returns {!Long} The corresponding Long value - */ -Long.fromString = fromString; - -/** - * @function - * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val - * @param {boolean=} unsigned - * @returns {!Long} - * @inner - */ -function fromValue(val, unsigned) { - if (typeof val === 'number') - return fromNumber(val, unsigned); - if (typeof val === 'string') - return fromString(val, unsigned); - // Throws for non-objects, converts non-instanceof Long: - return fromBits(val.low, val.high, typeof unsigned === 'boolean' ? unsigned : val.unsigned); -} - -/** - * Converts the specified value to a Long using the appropriate from* function for its type. - * @function - * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val Value - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @returns {!Long} - */ -Long.fromValue = fromValue; - -// NOTE: the compiler should inline these constant values below and then remove these variables, so there should be -// no runtime penalty for these. - -/** - * @type {number} - * @const - * @inner - */ -var TWO_PWR_16_DBL = 1 << 16; - -/** - * @type {number} - * @const - * @inner - */ -var TWO_PWR_24_DBL = 1 << 24; - -/** - * @type {number} - * @const - * @inner - */ -var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; - -/** - * @type {number} - * @const - * @inner - */ -var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL; - -/** - * @type {number} - * @const - * @inner - */ -var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; - -/** - * @type {!Long} - * @const - * @inner - */ -var TWO_PWR_24 = fromInt(TWO_PWR_24_DBL); - -/** - * @type {!Long} - * @inner - */ -var ZERO = fromInt(0); - -/** - * Signed zero. - * @type {!Long} - */ -Long.ZERO = ZERO; - -/** - * @type {!Long} - * @inner - */ -var UZERO = fromInt(0, true); - -/** - * Unsigned zero. - * @type {!Long} - */ -Long.UZERO = UZERO; - -/** - * @type {!Long} - * @inner - */ -var ONE = fromInt(1); - -/** - * Signed one. - * @type {!Long} - */ -Long.ONE = ONE; - -/** - * @type {!Long} - * @inner - */ -var UONE = fromInt(1, true); - -/** - * Unsigned one. - * @type {!Long} - */ -Long.UONE = UONE; - -/** - * @type {!Long} - * @inner - */ -var NEG_ONE = fromInt(-1); - -/** - * Signed negative one. - * @type {!Long} - */ -Long.NEG_ONE = NEG_ONE; - -/** - * @type {!Long} - * @inner - */ -var MAX_VALUE = fromBits(0xFFFFFFFF | 0, 0x7FFFFFFF | 0, false); - -/** - * Maximum signed value. - * @type {!Long} - */ -Long.MAX_VALUE = MAX_VALUE; - -/** - * @type {!Long} - * @inner - */ -var MAX_UNSIGNED_VALUE = fromBits(0xFFFFFFFF | 0, 0xFFFFFFFF | 0, true); - -/** - * Maximum unsigned value. - * @type {!Long} - */ -Long.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE; - -/** - * @type {!Long} - * @inner - */ -var MIN_VALUE = fromBits(0, 0x80000000 | 0, false); - -/** - * Minimum signed value. - * @type {!Long} - */ -Long.MIN_VALUE = MIN_VALUE; - -/** - * @alias Long.prototype - * @inner - */ -var LongPrototype = Long.prototype; - -/** - * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. - * @this {!Long} - * @returns {number} - */ -LongPrototype.toInt = function toInt() { - return this.unsigned ? this.low >>> 0 : this.low; -}; - -/** - * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). - * @this {!Long} - * @returns {number} - */ -LongPrototype.toNumber = function toNumber() { - if (this.unsigned) - return ((this.high >>> 0) * TWO_PWR_32_DBL) + (this.low >>> 0); - return this.high * TWO_PWR_32_DBL + (this.low >>> 0); -}; - -/** - * Converts the Long to a string written in the specified radix. - * @this {!Long} - * @param {number=} radix Radix (2-36), defaults to 10 - * @returns {string} - * @override - * @throws {RangeError} If `radix` is out of range - */ -LongPrototype.toString = function toString(radix) { - radix = radix || 10; - if (radix < 2 || 36 < radix) - throw RangeError('radix'); - if (this.isZero()) - return '0'; - if (this.isNegative()) { // Unsigned Longs are never negative - if (this.eq(MIN_VALUE)) { - // We need to change the Long value before it can be negated, so we remove - // the bottom-most digit in this base and then recurse to do the rest. - var radixLong = fromNumber(radix), - div = this.div(radixLong), - rem1 = div.mul(radixLong).sub(this); - return div.toString(radix) + rem1.toInt().toString(radix); - } else - return '-' + this.neg().toString(radix); - } - - // Do several (6) digits each time through the loop, so as to - // minimize the calls to the very expensive emulated div. - var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned), - rem = this; - var result = ''; - while (true) { - var remDiv = rem.div(radixToPower), - intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0, - digits = intval.toString(radix); - rem = remDiv; - if (rem.isZero()) - return digits + result; - else { - while (digits.length < 6) - digits = '0' + digits; - result = '' + digits + result; - } - } -}; - -/** - * Gets the high 32 bits as a signed integer. - * @this {!Long} - * @returns {number} Signed high bits - */ -LongPrototype.getHighBits = function getHighBits() { - return this.high; -}; - -/** - * Gets the high 32 bits as an unsigned integer. - * @this {!Long} - * @returns {number} Unsigned high bits - */ -LongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() { - return this.high >>> 0; -}; - -/** - * Gets the low 32 bits as a signed integer. - * @this {!Long} - * @returns {number} Signed low bits - */ -LongPrototype.getLowBits = function getLowBits() { - return this.low; -}; - -/** - * Gets the low 32 bits as an unsigned integer. - * @this {!Long} - * @returns {number} Unsigned low bits - */ -LongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() { - return this.low >>> 0; -}; - -/** - * Gets the number of bits needed to represent the absolute value of this Long. - * @this {!Long} - * @returns {number} - */ -LongPrototype.getNumBitsAbs = function getNumBitsAbs() { - if (this.isNegative()) // Unsigned Longs are never negative - return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); - var val = this.high != 0 ? this.high : this.low; - for (var bit = 31; bit > 0; bit--) - if ((val & (1 << bit)) != 0) - break; - return this.high != 0 ? bit + 33 : bit + 1; -}; - -/** - * Tests if this Long's value equals zero. - * @this {!Long} - * @returns {boolean} - */ -LongPrototype.isZero = function isZero() { - return this.high === 0 && this.low === 0; -}; - -/** - * Tests if this Long's value equals zero. This is an alias of {@link Long#isZero}. - * @returns {boolean} - */ -LongPrototype.eqz = LongPrototype.isZero; - -/** - * Tests if this Long's value is negative. - * @this {!Long} - * @returns {boolean} - */ -LongPrototype.isNegative = function isNegative() { - return !this.unsigned && this.high < 0; -}; - -/** - * Tests if this Long's value is positive or zero. - * @this {!Long} - * @returns {boolean} - */ -LongPrototype.isPositive = function isPositive() { - return this.unsigned || this.high >= 0; -}; - -/** - * Tests if this Long's value is odd. - * @this {!Long} - * @returns {boolean} - */ -LongPrototype.isOdd = function isOdd() { - return (this.low & 1) === 1; -}; - -/** - * Tests if this Long's value is even. - * @this {!Long} - * @returns {boolean} - */ -LongPrototype.isEven = function isEven() { - return (this.low & 1) === 0; -}; - -/** - * Tests if this Long's value equals the specified's. - * @this {!Long} - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ -LongPrototype.equals = function equals(other) { - if (!isLong(other)) - other = fromValue(other); - if (this.unsigned !== other.unsigned && (this.high >>> 31) === 1 && (other.high >>> 31) === 1) - return false; - return this.high === other.high && this.low === other.low; -}; - -/** - * Tests if this Long's value equals the specified's. This is an alias of {@link Long#equals}. - * @function - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ -LongPrototype.eq = LongPrototype.equals; - -/** - * Tests if this Long's value differs from the specified's. - * @this {!Long} - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ -LongPrototype.notEquals = function notEquals(other) { - return !this.eq(/* validates */ other); -}; - -/** - * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}. - * @function - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ -LongPrototype.neq = LongPrototype.notEquals; - -/** - * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}. - * @function - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ -LongPrototype.ne = LongPrototype.notEquals; - -/** - * Tests if this Long's value is less than the specified's. - * @this {!Long} - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ -LongPrototype.lessThan = function lessThan(other) { - return this.comp(/* validates */ other) < 0; -}; - -/** - * Tests if this Long's value is less than the specified's. This is an alias of {@link Long#lessThan}. - * @function - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ -LongPrototype.lt = LongPrototype.lessThan; - -/** - * Tests if this Long's value is less than or equal the specified's. - * @this {!Long} - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ -LongPrototype.lessThanOrEqual = function lessThanOrEqual(other) { - return this.comp(/* validates */ other) <= 0; -}; - -/** - * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}. - * @function - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ -LongPrototype.lte = LongPrototype.lessThanOrEqual; - -/** - * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}. - * @function - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ -LongPrototype.le = LongPrototype.lessThanOrEqual; - -/** - * Tests if this Long's value is greater than the specified's. - * @this {!Long} - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ -LongPrototype.greaterThan = function greaterThan(other) { - return this.comp(/* validates */ other) > 0; -}; - -/** - * Tests if this Long's value is greater than the specified's. This is an alias of {@link Long#greaterThan}. - * @function - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ -LongPrototype.gt = LongPrototype.greaterThan; - -/** - * Tests if this Long's value is greater than or equal the specified's. - * @this {!Long} - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ -LongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) { - return this.comp(/* validates */ other) >= 0; -}; - -/** - * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}. - * @function - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ -LongPrototype.gte = LongPrototype.greaterThanOrEqual; - -/** - * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}. - * @function - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ -LongPrototype.ge = LongPrototype.greaterThanOrEqual; - -/** - * Compares this Long's value with the specified's. - * @this {!Long} - * @param {!Long|number|string} other Other value - * @returns {number} 0 if they are the same, 1 if the this is greater and -1 - * if the given one is greater - */ -LongPrototype.compare = function compare(other) { - if (!isLong(other)) - other = fromValue(other); - if (this.eq(other)) - return 0; - var thisNeg = this.isNegative(), - otherNeg = other.isNegative(); - if (thisNeg && !otherNeg) - return -1; - if (!thisNeg && otherNeg) - return 1; - // At this point the sign bits are the same - if (!this.unsigned) - return this.sub(other).isNegative() ? -1 : 1; - // Both are positive if at least one is unsigned - return (other.high >>> 0) > (this.high >>> 0) || (other.high === this.high && (other.low >>> 0) > (this.low >>> 0)) ? -1 : 1; -}; - -/** - * Compares this Long's value with the specified's. This is an alias of {@link Long#compare}. - * @function - * @param {!Long|number|string} other Other value - * @returns {number} 0 if they are the same, 1 if the this is greater and -1 - * if the given one is greater - */ -LongPrototype.comp = LongPrototype.compare; - -/** - * Negates this Long's value. - * @this {!Long} - * @returns {!Long} Negated Long - */ -LongPrototype.negate = function negate() { - if (!this.unsigned && this.eq(MIN_VALUE)) - return MIN_VALUE; - return this.not().add(ONE); -}; - -/** - * Negates this Long's value. This is an alias of {@link Long#negate}. - * @function - * @returns {!Long} Negated Long - */ -LongPrototype.neg = LongPrototype.negate; - -/** - * Returns the sum of this and the specified Long. - * @this {!Long} - * @param {!Long|number|string} addend Addend - * @returns {!Long} Sum - */ -LongPrototype.add = function add(addend) { - if (!isLong(addend)) - addend = fromValue(addend); - - // Divide each number into 4 chunks of 16 bits, and then sum the chunks. - - var a48 = this.high >>> 16; - var a32 = this.high & 0xFFFF; - var a16 = this.low >>> 16; - var a00 = this.low & 0xFFFF; - - var b48 = addend.high >>> 16; - var b32 = addend.high & 0xFFFF; - var b16 = addend.low >>> 16; - var b00 = addend.low & 0xFFFF; - - var c48 = 0, c32 = 0, c16 = 0, c00 = 0; - c00 += a00 + b00; - c16 += c00 >>> 16; - c00 &= 0xFFFF; - c16 += a16 + b16; - c32 += c16 >>> 16; - c16 &= 0xFFFF; - c32 += a32 + b32; - c48 += c32 >>> 16; - c32 &= 0xFFFF; - c48 += a48 + b48; - c48 &= 0xFFFF; - return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); -}; - -/** - * Returns the difference of this and the specified Long. - * @this {!Long} - * @param {!Long|number|string} subtrahend Subtrahend - * @returns {!Long} Difference - */ -LongPrototype.subtract = function subtract(subtrahend) { - if (!isLong(subtrahend)) - subtrahend = fromValue(subtrahend); - return this.add(subtrahend.neg()); -}; - -/** - * Returns the difference of this and the specified Long. This is an alias of {@link Long#subtract}. - * @function - * @param {!Long|number|string} subtrahend Subtrahend - * @returns {!Long} Difference - */ -LongPrototype.sub = LongPrototype.subtract; - -/** - * Returns the product of this and the specified Long. - * @this {!Long} - * @param {!Long|number|string} multiplier Multiplier - * @returns {!Long} Product - */ -LongPrototype.multiply = function multiply(multiplier) { - if (this.isZero()) - return this; - if (!isLong(multiplier)) - multiplier = fromValue(multiplier); - - // use wasm support if present - if (wasm) { - var low = wasm["mul"](this.low, - this.high, - multiplier.low, - multiplier.high); - return fromBits(low, wasm["get_high"](), this.unsigned); - } - - if (multiplier.isZero()) - return this.unsigned ? UZERO : ZERO; - if (this.eq(MIN_VALUE)) - return multiplier.isOdd() ? MIN_VALUE : ZERO; - if (multiplier.eq(MIN_VALUE)) - return this.isOdd() ? MIN_VALUE : ZERO; - - if (this.isNegative()) { - if (multiplier.isNegative()) - return this.neg().mul(multiplier.neg()); - else - return this.neg().mul(multiplier).neg(); - } else if (multiplier.isNegative()) - return this.mul(multiplier.neg()).neg(); - - // If both longs are small, use float multiplication - if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24)) - return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned); - - // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products. - // We can skip products that would overflow. - - var a48 = this.high >>> 16; - var a32 = this.high & 0xFFFF; - var a16 = this.low >>> 16; - var a00 = this.low & 0xFFFF; - - var b48 = multiplier.high >>> 16; - var b32 = multiplier.high & 0xFFFF; - var b16 = multiplier.low >>> 16; - var b00 = multiplier.low & 0xFFFF; - - var c48 = 0, c32 = 0, c16 = 0, c00 = 0; - c00 += a00 * b00; - c16 += c00 >>> 16; - c00 &= 0xFFFF; - c16 += a16 * b00; - c32 += c16 >>> 16; - c16 &= 0xFFFF; - c16 += a00 * b16; - c32 += c16 >>> 16; - c16 &= 0xFFFF; - c32 += a32 * b00; - c48 += c32 >>> 16; - c32 &= 0xFFFF; - c32 += a16 * b16; - c48 += c32 >>> 16; - c32 &= 0xFFFF; - c32 += a00 * b32; - c48 += c32 >>> 16; - c32 &= 0xFFFF; - c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48; - c48 &= 0xFFFF; - return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); -}; - -/** - * Returns the product of this and the specified Long. This is an alias of {@link Long#multiply}. - * @function - * @param {!Long|number|string} multiplier Multiplier - * @returns {!Long} Product - */ -LongPrototype.mul = LongPrototype.multiply; - -/** - * Returns this Long divided by the specified. The result is signed if this Long is signed or - * unsigned if this Long is unsigned. - * @this {!Long} - * @param {!Long|number|string} divisor Divisor - * @returns {!Long} Quotient - */ -LongPrototype.divide = function divide(divisor) { - if (!isLong(divisor)) - divisor = fromValue(divisor); - if (divisor.isZero()) - throw Error('division by zero'); - - // use wasm support if present - if (wasm) { - // guard against signed division overflow: the largest - // negative number / -1 would be 1 larger than the largest - // positive number, due to two's complement. - if (!this.unsigned && - this.high === -0x80000000 && - divisor.low === -1 && divisor.high === -1) { - // be consistent with non-wasm code path - return this; - } - var low = (this.unsigned ? wasm["div_u"] : wasm["div_s"])( - this.low, - this.high, - divisor.low, - divisor.high - ); - return fromBits(low, wasm["get_high"](), this.unsigned); - } - - if (this.isZero()) - return this.unsigned ? UZERO : ZERO; - var approx, rem, res; - if (!this.unsigned) { - // This section is only relevant for signed longs and is derived from the - // closure library as a whole. - if (this.eq(MIN_VALUE)) { - if (divisor.eq(ONE) || divisor.eq(NEG_ONE)) - return MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE - else if (divisor.eq(MIN_VALUE)) - return ONE; - else { - // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|. - var halfThis = this.shr(1); - approx = halfThis.div(divisor).shl(1); - if (approx.eq(ZERO)) { - return divisor.isNegative() ? ONE : NEG_ONE; - } else { - rem = this.sub(divisor.mul(approx)); - res = approx.add(rem.div(divisor)); - return res; - } - } - } else if (divisor.eq(MIN_VALUE)) - return this.unsigned ? UZERO : ZERO; - if (this.isNegative()) { - if (divisor.isNegative()) - return this.neg().div(divisor.neg()); - return this.neg().div(divisor).neg(); - } else if (divisor.isNegative()) - return this.div(divisor.neg()).neg(); - res = ZERO; - } else { - // The algorithm below has not been made for unsigned longs. It's therefore - // required to take special care of the MSB prior to running it. - if (!divisor.unsigned) - divisor = divisor.toUnsigned(); - if (divisor.gt(this)) - return UZERO; - if (divisor.gt(this.shru(1))) // 15 >>> 1 = 7 ; with divisor = 8 ; true - return UONE; - res = UZERO; - } - - // Repeat the following until the remainder is less than other: find a - // floating-point that approximates remainder / other *from below*, add this - // into the result, and subtract it from the remainder. It is critical that - // the approximate value is less than or equal to the real value so that the - // remainder never becomes negative. - rem = this; - while (rem.gte(divisor)) { - // Approximate the result of division. This may be a little greater or - // smaller than the actual value. - approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber())); - - // We will tweak the approximate result by changing it in the 48-th digit or - // the smallest non-fractional digit, whichever is larger. - var log2 = Math.ceil(Math.log(approx) / Math.LN2), - delta = (log2 <= 48) ? 1 : pow_dbl(2, log2 - 48), - - // Decrease the approximation until it is smaller than the remainder. Note - // that if it is too large, the product overflows and is negative. - approxRes = fromNumber(approx), - approxRem = approxRes.mul(divisor); - while (approxRem.isNegative() || approxRem.gt(rem)) { - approx -= delta; - approxRes = fromNumber(approx, this.unsigned); - approxRem = approxRes.mul(divisor); - } - - // We know the answer can't be zero... and actually, zero would cause - // infinite recursion since we would make no progress. - if (approxRes.isZero()) - approxRes = ONE; - - res = res.add(approxRes); - rem = rem.sub(approxRem); - } - return res; -}; - -/** - * Returns this Long divided by the specified. This is an alias of {@link Long#divide}. - * @function - * @param {!Long|number|string} divisor Divisor - * @returns {!Long} Quotient - */ -LongPrototype.div = LongPrototype.divide; - -/** - * Returns this Long modulo the specified. - * @this {!Long} - * @param {!Long|number|string} divisor Divisor - * @returns {!Long} Remainder - */ -LongPrototype.modulo = function modulo(divisor) { - if (!isLong(divisor)) - divisor = fromValue(divisor); - - // use wasm support if present - if (wasm) { - var low = (this.unsigned ? wasm["rem_u"] : wasm["rem_s"])( - this.low, - this.high, - divisor.low, - divisor.high - ); - return fromBits(low, wasm["get_high"](), this.unsigned); - } - - return this.sub(this.div(divisor).mul(divisor)); -}; - -/** - * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}. - * @function - * @param {!Long|number|string} divisor Divisor - * @returns {!Long} Remainder - */ -LongPrototype.mod = LongPrototype.modulo; - -/** - * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}. - * @function - * @param {!Long|number|string} divisor Divisor - * @returns {!Long} Remainder - */ -LongPrototype.rem = LongPrototype.modulo; - -/** - * Returns the bitwise NOT of this Long. - * @this {!Long} - * @returns {!Long} - */ -LongPrototype.not = function not() { - return fromBits(~this.low, ~this.high, this.unsigned); -}; - -/** - * Returns count leading zeros of this Long. - * @this {!Long} - * @returns {!number} - */ -LongPrototype.countLeadingZeros = function countLeadingZeros() { - return this.high ? Math.clz32(this.high) : Math.clz32(this.low) + 32; -}; - -/** - * Returns count leading zeros. This is an alias of {@link Long#countLeadingZeros}. - * @function - * @param {!Long} - * @returns {!number} - */ -LongPrototype.clz = LongPrototype.countLeadingZeros; - -/** - * Returns count trailing zeros of this Long. - * @this {!Long} - * @returns {!number} - */ -LongPrototype.countTrailingZeros = function countTrailingZeros() { - return this.low ? ctz32(this.low) : ctz32(this.high) + 32; -}; - -/** - * Returns count trailing zeros. This is an alias of {@link Long#countTrailingZeros}. - * @function - * @param {!Long} - * @returns {!number} - */ -LongPrototype.ctz = LongPrototype.countTrailingZeros; - -/** - * Returns the bitwise AND of this Long and the specified. - * @this {!Long} - * @param {!Long|number|string} other Other Long - * @returns {!Long} - */ -LongPrototype.and = function and(other) { - if (!isLong(other)) - other = fromValue(other); - return fromBits(this.low & other.low, this.high & other.high, this.unsigned); -}; - -/** - * Returns the bitwise OR of this Long and the specified. - * @this {!Long} - * @param {!Long|number|string} other Other Long - * @returns {!Long} - */ -LongPrototype.or = function or(other) { - if (!isLong(other)) - other = fromValue(other); - return fromBits(this.low | other.low, this.high | other.high, this.unsigned); -}; - -/** - * Returns the bitwise XOR of this Long and the given one. - * @this {!Long} - * @param {!Long|number|string} other Other Long - * @returns {!Long} - */ -LongPrototype.xor = function xor(other) { - if (!isLong(other)) - other = fromValue(other); - return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned); -}; - -/** - * Returns this Long with bits shifted to the left by the given amount. - * @this {!Long} - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Shifted Long - */ -LongPrototype.shiftLeft = function shiftLeft(numBits) { - if (isLong(numBits)) - numBits = numBits.toInt(); - if ((numBits &= 63) === 0) - return this; - else if (numBits < 32) - return fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned); - else - return fromBits(0, this.low << (numBits - 32), this.unsigned); -}; - -/** - * Returns this Long with bits shifted to the left by the given amount. This is an alias of {@link Long#shiftLeft}. - * @function - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Shifted Long - */ -LongPrototype.shl = LongPrototype.shiftLeft; - -/** - * Returns this Long with bits arithmetically shifted to the right by the given amount. - * @this {!Long} - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Shifted Long - */ -LongPrototype.shiftRight = function shiftRight(numBits) { - if (isLong(numBits)) - numBits = numBits.toInt(); - if ((numBits &= 63) === 0) - return this; - else if (numBits < 32) - return fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned); - else - return fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned); -}; - -/** - * Returns this Long with bits arithmetically shifted to the right by the given amount. This is an alias of {@link Long#shiftRight}. - * @function - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Shifted Long - */ -LongPrototype.shr = LongPrototype.shiftRight; - -/** - * Returns this Long with bits logically shifted to the right by the given amount. - * @this {!Long} - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Shifted Long - */ -LongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) { - if (isLong(numBits)) numBits = numBits.toInt(); - if ((numBits &= 63) === 0) return this; - if (numBits < 32) return fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >>> numBits, this.unsigned); - if (numBits === 32) return fromBits(this.high, 0, this.unsigned); - return fromBits(this.high >>> (numBits - 32), 0, this.unsigned); -}; - -/** - * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}. - * @function - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Shifted Long - */ -LongPrototype.shru = LongPrototype.shiftRightUnsigned; - -/** - * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}. - * @function - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Shifted Long - */ -LongPrototype.shr_u = LongPrototype.shiftRightUnsigned; - -/** - * Returns this Long with bits rotated to the left by the given amount. - * @this {!Long} - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Rotated Long - */ -LongPrototype.rotateLeft = function rotateLeft(numBits) { - var b; - if (isLong(numBits)) numBits = numBits.toInt(); - if ((numBits &= 63) === 0) return this; - if (numBits === 32) return fromBits(this.high, this.low, this.unsigned); - if (numBits < 32) { - b = (32 - numBits); - return fromBits(((this.low << numBits) | (this.high >>> b)), ((this.high << numBits) | (this.low >>> b)), this.unsigned); - } - numBits -= 32; - b = (32 - numBits); - return fromBits(((this.high << numBits) | (this.low >>> b)), ((this.low << numBits) | (this.high >>> b)), this.unsigned); -} -/** - * Returns this Long with bits rotated to the left by the given amount. This is an alias of {@link Long#rotateLeft}. - * @function - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Rotated Long - */ -LongPrototype.rotl = LongPrototype.rotateLeft; - -/** - * Returns this Long with bits rotated to the right by the given amount. - * @this {!Long} - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Rotated Long - */ -LongPrototype.rotateRight = function rotateRight(numBits) { - var b; - if (isLong(numBits)) numBits = numBits.toInt(); - if ((numBits &= 63) === 0) return this; - if (numBits === 32) return fromBits(this.high, this.low, this.unsigned); - if (numBits < 32) { - b = (32 - numBits); - return fromBits(((this.high << b) | (this.low >>> numBits)), ((this.low << b) | (this.high >>> numBits)), this.unsigned); - } - numBits -= 32; - b = (32 - numBits); - return fromBits(((this.low << b) | (this.high >>> numBits)), ((this.high << b) | (this.low >>> numBits)), this.unsigned); -} -/** - * Returns this Long with bits rotated to the right by the given amount. This is an alias of {@link Long#rotateRight}. - * @function - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Rotated Long - */ -LongPrototype.rotr = LongPrototype.rotateRight; - -/** - * Converts this Long to signed. - * @this {!Long} - * @returns {!Long} Signed long - */ -LongPrototype.toSigned = function toSigned() { - if (!this.unsigned) - return this; - return fromBits(this.low, this.high, false); -}; - -/** - * Converts this Long to unsigned. - * @this {!Long} - * @returns {!Long} Unsigned long - */ -LongPrototype.toUnsigned = function toUnsigned() { - if (this.unsigned) - return this; - return fromBits(this.low, this.high, true); -}; - -/** - * Converts this Long to its byte representation. - * @param {boolean=} le Whether little or big endian, defaults to big endian - * @this {!Long} - * @returns {!Array.} Byte representation - */ -LongPrototype.toBytes = function toBytes(le) { - return le ? this.toBytesLE() : this.toBytesBE(); -}; - -/** - * Converts this Long to its little endian byte representation. - * @this {!Long} - * @returns {!Array.} Little endian byte representation - */ -LongPrototype.toBytesLE = function toBytesLE() { - var hi = this.high, - lo = this.low; - return [ - lo & 0xff, - lo >>> 8 & 0xff, - lo >>> 16 & 0xff, - lo >>> 24, - hi & 0xff, - hi >>> 8 & 0xff, - hi >>> 16 & 0xff, - hi >>> 24 - ]; -}; - -/** - * Converts this Long to its big endian byte representation. - * @this {!Long} - * @returns {!Array.} Big endian byte representation - */ -LongPrototype.toBytesBE = function toBytesBE() { - var hi = this.high, - lo = this.low; - return [ - hi >>> 24, - hi >>> 16 & 0xff, - hi >>> 8 & 0xff, - hi & 0xff, - lo >>> 24, - lo >>> 16 & 0xff, - lo >>> 8 & 0xff, - lo & 0xff - ]; -}; - -/** - * Creates a Long from its byte representation. - * @param {!Array.} bytes Byte representation - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @param {boolean=} le Whether little or big endian, defaults to big endian - * @returns {Long} The corresponding Long value - */ -Long.fromBytes = function fromBytes(bytes, unsigned, le) { - return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned); -}; - -/** - * Creates a Long from its little endian byte representation. - * @param {!Array.} bytes Little endian byte representation - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @returns {Long} The corresponding Long value - */ -Long.fromBytesLE = function fromBytesLE(bytes, unsigned) { - return new Long( - bytes[0] | - bytes[1] << 8 | - bytes[2] << 16 | - bytes[3] << 24, - bytes[4] | - bytes[5] << 8 | - bytes[6] << 16 | - bytes[7] << 24, - unsigned - ); -}; - -/** - * Creates a Long from its big endian byte representation. - * @param {!Array.} bytes Big endian byte representation - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @returns {Long} The corresponding Long value - */ -Long.fromBytesBE = function fromBytesBE(bytes, unsigned) { - return new Long( - bytes[4] << 24 | - bytes[5] << 16 | - bytes[6] << 8 | - bytes[7], - bytes[0] << 24 | - bytes[1] << 16 | - bytes[2] << 8 | - bytes[3], - unsigned - ); -}; - -export default Long; diff --git a/node_modules/long/package.json b/node_modules/long/package.json deleted file mode 100644 index 3a06362..0000000 --- a/node_modules/long/package.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "long", - "version": "5.2.3", - "author": "Daniel Wirtz ", - "description": "A Long class for representing a 64-bit two's-complement integer value.", - "repository": { - "type": "git", - "url": "https://github.com/dcodeIO/long.js.git" - }, - "bugs": { - "url": "https://github.com/dcodeIO/long.js/issues" - }, - "keywords": [ - "math", - "long", - "int64" - ], - "license": "Apache-2.0", - "type": "module", - "main": "umd/index.js", - "types": "umd/index.d.ts", - "exports": { - ".": { - "import": { - "types": "./index.d.ts", - "default": "./index.js" - }, - "require": { - "types": "./umd/index.d.ts", - "default": "./umd/index.js" - } - } - }, - "scripts": { - "build": "esm2umd Long index.js > umd/index.js", - "test": "node tests" - }, - "files": [ - "index.js", - "index.d.ts", - "umd/index.js", - "umd/index.d.ts", - "umd/package.json", - "LICENSE", - "README.md" - ], - "devDependencies": { - "esm2umd": "^0.2.1" - } -} diff --git a/node_modules/long/umd/index.d.ts b/node_modules/long/umd/index.d.ts deleted file mode 100644 index c623535..0000000 --- a/node_modules/long/umd/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import Long from "../index.js"; -export = Long; diff --git a/node_modules/long/umd/index.js b/node_modules/long/umd/index.js deleted file mode 100644 index a6ccd9c..0000000 --- a/node_modules/long/umd/index.js +++ /dev/null @@ -1,1432 +0,0 @@ -// GENERATED FILE. DO NOT EDIT. -var Long = (function(exports) { - "use strict"; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = void 0; - - /** - * @license - * Copyright 2009 The Closure Library Authors - * Copyright 2020 Daniel Wirtz / The long.js 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. - * - * SPDX-License-Identifier: Apache-2.0 - */ - // WebAssembly optimizations to do native i64 multiplication and divide - var wasm = null; - - try { - wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11])), {}).exports; - } catch (e) {// no wasm support :( - } - /** - * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers. - * See the from* functions below for more convenient ways of constructing Longs. - * @exports Long - * @class A Long class for representing a 64 bit two's-complement integer value. - * @param {number} low The low (signed) 32 bits of the long - * @param {number} high The high (signed) 32 bits of the long - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @constructor - */ - - - function Long(low, high, unsigned) { - /** - * The low 32 bits as a signed value. - * @type {number} - */ - this.low = low | 0; - /** - * The high 32 bits as a signed value. - * @type {number} - */ - - this.high = high | 0; - /** - * Whether unsigned or not. - * @type {boolean} - */ - - this.unsigned = !!unsigned; - } // The internal representation of a long is the two given signed, 32-bit values. - // We use 32-bit pieces because these are the size of integers on which - // Javascript performs bit-operations. For operations like addition and - // multiplication, we split each number into 16 bit pieces, which can easily be - // multiplied within Javascript's floating-point representation without overflow - // or change in sign. - // - // In the algorithms below, we frequently reduce the negative case to the - // positive case by negating the input(s) and then post-processing the result. - // Note that we must ALWAYS check specially whether those values are MIN_VALUE - // (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as - // a positive number, it overflows back into a negative). Not handling this - // case would often result in infinite recursion. - // - // Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the from* - // methods on which they depend. - - /** - * An indicator used to reliably determine if an object is a Long or not. - * @type {boolean} - * @const - * @private - */ - - - Long.prototype.__isLong__; - Object.defineProperty(Long.prototype, "__isLong__", { - value: true - }); - /** - * @function - * @param {*} obj Object - * @returns {boolean} - * @inner - */ - - function isLong(obj) { - return (obj && obj["__isLong__"]) === true; - } - /** - * @function - * @param {*} value number - * @returns {number} - * @inner - */ - - - function ctz32(value) { - var c = Math.clz32(value & -value); - return value ? 31 - c : c; - } - /** - * Tests if the specified object is a Long. - * @function - * @param {*} obj Object - * @returns {boolean} - */ - - - Long.isLong = isLong; - /** - * A cache of the Long representations of small integer values. - * @type {!Object} - * @inner - */ - - var INT_CACHE = {}; - /** - * A cache of the Long representations of small unsigned integer values. - * @type {!Object} - * @inner - */ - - var UINT_CACHE = {}; - /** - * @param {number} value - * @param {boolean=} unsigned - * @returns {!Long} - * @inner - */ - - function fromInt(value, unsigned) { - var obj, cachedObj, cache; - - if (unsigned) { - value >>>= 0; - - if (cache = 0 <= value && value < 256) { - cachedObj = UINT_CACHE[value]; - if (cachedObj) return cachedObj; - } - - obj = fromBits(value, 0, true); - if (cache) UINT_CACHE[value] = obj; - return obj; - } else { - value |= 0; - - if (cache = -128 <= value && value < 128) { - cachedObj = INT_CACHE[value]; - if (cachedObj) return cachedObj; - } - - obj = fromBits(value, value < 0 ? -1 : 0, false); - if (cache) INT_CACHE[value] = obj; - return obj; - } - } - /** - * Returns a Long representing the given 32 bit integer value. - * @function - * @param {number} value The 32 bit integer in question - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @returns {!Long} The corresponding Long value - */ - - - Long.fromInt = fromInt; - /** - * @param {number} value - * @param {boolean=} unsigned - * @returns {!Long} - * @inner - */ - - function fromNumber(value, unsigned) { - if (isNaN(value)) return unsigned ? UZERO : ZERO; - - if (unsigned) { - if (value < 0) return UZERO; - if (value >= TWO_PWR_64_DBL) return MAX_UNSIGNED_VALUE; - } else { - if (value <= -TWO_PWR_63_DBL) return MIN_VALUE; - if (value + 1 >= TWO_PWR_63_DBL) return MAX_VALUE; - } - - if (value < 0) return fromNumber(-value, unsigned).neg(); - return fromBits(value % TWO_PWR_32_DBL | 0, value / TWO_PWR_32_DBL | 0, unsigned); - } - /** - * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. - * @function - * @param {number} value The number in question - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @returns {!Long} The corresponding Long value - */ - - - Long.fromNumber = fromNumber; - /** - * @param {number} lowBits - * @param {number} highBits - * @param {boolean=} unsigned - * @returns {!Long} - * @inner - */ - - function fromBits(lowBits, highBits, unsigned) { - return new Long(lowBits, highBits, unsigned); - } - /** - * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is - * assumed to use 32 bits. - * @function - * @param {number} lowBits The low 32 bits - * @param {number} highBits The high 32 bits - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @returns {!Long} The corresponding Long value - */ - - - Long.fromBits = fromBits; - /** - * @function - * @param {number} base - * @param {number} exponent - * @returns {number} - * @inner - */ - - var pow_dbl = Math.pow; // Used 4 times (4*8 to 15+4) - - /** - * @param {string} str - * @param {(boolean|number)=} unsigned - * @param {number=} radix - * @returns {!Long} - * @inner - */ - - function fromString(str, unsigned, radix) { - if (str.length === 0) throw Error('empty string'); - - if (typeof unsigned === 'number') { - // For goog.math.long compatibility - radix = unsigned; - unsigned = false; - } else { - unsigned = !!unsigned; - } - - if (str === "NaN" || str === "Infinity" || str === "+Infinity" || str === "-Infinity") return unsigned ? UZERO : ZERO; - radix = radix || 10; - if (radix < 2 || 36 < radix) throw RangeError('radix'); - var p; - if ((p = str.indexOf('-')) > 0) throw Error('interior hyphen');else if (p === 0) { - return fromString(str.substring(1), unsigned, radix).neg(); - } // Do several (8) digits each time through the loop, so as to - // minimize the calls to the very expensive emulated div. - - var radixToPower = fromNumber(pow_dbl(radix, 8)); - var result = ZERO; - - for (var i = 0; i < str.length; i += 8) { - var size = Math.min(8, str.length - i), - value = parseInt(str.substring(i, i + size), radix); - - if (size < 8) { - var power = fromNumber(pow_dbl(radix, size)); - result = result.mul(power).add(fromNumber(value)); - } else { - result = result.mul(radixToPower); - result = result.add(fromNumber(value)); - } - } - - result.unsigned = unsigned; - return result; - } - /** - * Returns a Long representation of the given string, written using the specified radix. - * @function - * @param {string} str The textual representation of the Long - * @param {(boolean|number)=} unsigned Whether unsigned or not, defaults to signed - * @param {number=} radix The radix in which the text is written (2-36), defaults to 10 - * @returns {!Long} The corresponding Long value - */ - - - Long.fromString = fromString; - /** - * @function - * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val - * @param {boolean=} unsigned - * @returns {!Long} - * @inner - */ - - function fromValue(val, unsigned) { - if (typeof val === 'number') return fromNumber(val, unsigned); - if (typeof val === 'string') return fromString(val, unsigned); // Throws for non-objects, converts non-instanceof Long: - - return fromBits(val.low, val.high, typeof unsigned === 'boolean' ? unsigned : val.unsigned); - } - /** - * Converts the specified value to a Long using the appropriate from* function for its type. - * @function - * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val Value - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @returns {!Long} - */ - - - Long.fromValue = fromValue; // NOTE: the compiler should inline these constant values below and then remove these variables, so there should be - // no runtime penalty for these. - - /** - * @type {number} - * @const - * @inner - */ - - var TWO_PWR_16_DBL = 1 << 16; - /** - * @type {number} - * @const - * @inner - */ - - var TWO_PWR_24_DBL = 1 << 24; - /** - * @type {number} - * @const - * @inner - */ - - var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; - /** - * @type {number} - * @const - * @inner - */ - - var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL; - /** - * @type {number} - * @const - * @inner - */ - - var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; - /** - * @type {!Long} - * @const - * @inner - */ - - var TWO_PWR_24 = fromInt(TWO_PWR_24_DBL); - /** - * @type {!Long} - * @inner - */ - - var ZERO = fromInt(0); - /** - * Signed zero. - * @type {!Long} - */ - - Long.ZERO = ZERO; - /** - * @type {!Long} - * @inner - */ - - var UZERO = fromInt(0, true); - /** - * Unsigned zero. - * @type {!Long} - */ - - Long.UZERO = UZERO; - /** - * @type {!Long} - * @inner - */ - - var ONE = fromInt(1); - /** - * Signed one. - * @type {!Long} - */ - - Long.ONE = ONE; - /** - * @type {!Long} - * @inner - */ - - var UONE = fromInt(1, true); - /** - * Unsigned one. - * @type {!Long} - */ - - Long.UONE = UONE; - /** - * @type {!Long} - * @inner - */ - - var NEG_ONE = fromInt(-1); - /** - * Signed negative one. - * @type {!Long} - */ - - Long.NEG_ONE = NEG_ONE; - /** - * @type {!Long} - * @inner - */ - - var MAX_VALUE = fromBits(0xFFFFFFFF | 0, 0x7FFFFFFF | 0, false); - /** - * Maximum signed value. - * @type {!Long} - */ - - Long.MAX_VALUE = MAX_VALUE; - /** - * @type {!Long} - * @inner - */ - - var MAX_UNSIGNED_VALUE = fromBits(0xFFFFFFFF | 0, 0xFFFFFFFF | 0, true); - /** - * Maximum unsigned value. - * @type {!Long} - */ - - Long.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE; - /** - * @type {!Long} - * @inner - */ - - var MIN_VALUE = fromBits(0, 0x80000000 | 0, false); - /** - * Minimum signed value. - * @type {!Long} - */ - - Long.MIN_VALUE = MIN_VALUE; - /** - * @alias Long.prototype - * @inner - */ - - var LongPrototype = Long.prototype; - /** - * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. - * @this {!Long} - * @returns {number} - */ - - LongPrototype.toInt = function toInt() { - return this.unsigned ? this.low >>> 0 : this.low; - }; - /** - * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). - * @this {!Long} - * @returns {number} - */ - - - LongPrototype.toNumber = function toNumber() { - if (this.unsigned) return (this.high >>> 0) * TWO_PWR_32_DBL + (this.low >>> 0); - return this.high * TWO_PWR_32_DBL + (this.low >>> 0); - }; - /** - * Converts the Long to a string written in the specified radix. - * @this {!Long} - * @param {number=} radix Radix (2-36), defaults to 10 - * @returns {string} - * @override - * @throws {RangeError} If `radix` is out of range - */ - - - LongPrototype.toString = function toString(radix) { - radix = radix || 10; - if (radix < 2 || 36 < radix) throw RangeError('radix'); - if (this.isZero()) return '0'; - - if (this.isNegative()) { - // Unsigned Longs are never negative - if (this.eq(MIN_VALUE)) { - // We need to change the Long value before it can be negated, so we remove - // the bottom-most digit in this base and then recurse to do the rest. - var radixLong = fromNumber(radix), - div = this.div(radixLong), - rem1 = div.mul(radixLong).sub(this); - return div.toString(radix) + rem1.toInt().toString(radix); - } else return '-' + this.neg().toString(radix); - } // Do several (6) digits each time through the loop, so as to - // minimize the calls to the very expensive emulated div. - - - var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned), - rem = this; - var result = ''; - - while (true) { - var remDiv = rem.div(radixToPower), - intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0, - digits = intval.toString(radix); - rem = remDiv; - if (rem.isZero()) return digits + result;else { - while (digits.length < 6) digits = '0' + digits; - - result = '' + digits + result; - } - } - }; - /** - * Gets the high 32 bits as a signed integer. - * @this {!Long} - * @returns {number} Signed high bits - */ - - - LongPrototype.getHighBits = function getHighBits() { - return this.high; - }; - /** - * Gets the high 32 bits as an unsigned integer. - * @this {!Long} - * @returns {number} Unsigned high bits - */ - - - LongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() { - return this.high >>> 0; - }; - /** - * Gets the low 32 bits as a signed integer. - * @this {!Long} - * @returns {number} Signed low bits - */ - - - LongPrototype.getLowBits = function getLowBits() { - return this.low; - }; - /** - * Gets the low 32 bits as an unsigned integer. - * @this {!Long} - * @returns {number} Unsigned low bits - */ - - - LongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() { - return this.low >>> 0; - }; - /** - * Gets the number of bits needed to represent the absolute value of this Long. - * @this {!Long} - * @returns {number} - */ - - - LongPrototype.getNumBitsAbs = function getNumBitsAbs() { - if (this.isNegative()) // Unsigned Longs are never negative - return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); - var val = this.high != 0 ? this.high : this.low; - - for (var bit = 31; bit > 0; bit--) if ((val & 1 << bit) != 0) break; - - return this.high != 0 ? bit + 33 : bit + 1; - }; - /** - * Tests if this Long's value equals zero. - * @this {!Long} - * @returns {boolean} - */ - - - LongPrototype.isZero = function isZero() { - return this.high === 0 && this.low === 0; - }; - /** - * Tests if this Long's value equals zero. This is an alias of {@link Long#isZero}. - * @returns {boolean} - */ - - - LongPrototype.eqz = LongPrototype.isZero; - /** - * Tests if this Long's value is negative. - * @this {!Long} - * @returns {boolean} - */ - - LongPrototype.isNegative = function isNegative() { - return !this.unsigned && this.high < 0; - }; - /** - * Tests if this Long's value is positive or zero. - * @this {!Long} - * @returns {boolean} - */ - - - LongPrototype.isPositive = function isPositive() { - return this.unsigned || this.high >= 0; - }; - /** - * Tests if this Long's value is odd. - * @this {!Long} - * @returns {boolean} - */ - - - LongPrototype.isOdd = function isOdd() { - return (this.low & 1) === 1; - }; - /** - * Tests if this Long's value is even. - * @this {!Long} - * @returns {boolean} - */ - - - LongPrototype.isEven = function isEven() { - return (this.low & 1) === 0; - }; - /** - * Tests if this Long's value equals the specified's. - * @this {!Long} - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ - - - LongPrototype.equals = function equals(other) { - if (!isLong(other)) other = fromValue(other); - if (this.unsigned !== other.unsigned && this.high >>> 31 === 1 && other.high >>> 31 === 1) return false; - return this.high === other.high && this.low === other.low; - }; - /** - * Tests if this Long's value equals the specified's. This is an alias of {@link Long#equals}. - * @function - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ - - - LongPrototype.eq = LongPrototype.equals; - /** - * Tests if this Long's value differs from the specified's. - * @this {!Long} - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ - - LongPrototype.notEquals = function notEquals(other) { - return !this.eq( - /* validates */ - other); - }; - /** - * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}. - * @function - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ - - - LongPrototype.neq = LongPrototype.notEquals; - /** - * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}. - * @function - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ - - LongPrototype.ne = LongPrototype.notEquals; - /** - * Tests if this Long's value is less than the specified's. - * @this {!Long} - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ - - LongPrototype.lessThan = function lessThan(other) { - return this.comp( - /* validates */ - other) < 0; - }; - /** - * Tests if this Long's value is less than the specified's. This is an alias of {@link Long#lessThan}. - * @function - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ - - - LongPrototype.lt = LongPrototype.lessThan; - /** - * Tests if this Long's value is less than or equal the specified's. - * @this {!Long} - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ - - LongPrototype.lessThanOrEqual = function lessThanOrEqual(other) { - return this.comp( - /* validates */ - other) <= 0; - }; - /** - * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}. - * @function - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ - - - LongPrototype.lte = LongPrototype.lessThanOrEqual; - /** - * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}. - * @function - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ - - LongPrototype.le = LongPrototype.lessThanOrEqual; - /** - * Tests if this Long's value is greater than the specified's. - * @this {!Long} - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ - - LongPrototype.greaterThan = function greaterThan(other) { - return this.comp( - /* validates */ - other) > 0; - }; - /** - * Tests if this Long's value is greater than the specified's. This is an alias of {@link Long#greaterThan}. - * @function - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ - - - LongPrototype.gt = LongPrototype.greaterThan; - /** - * Tests if this Long's value is greater than or equal the specified's. - * @this {!Long} - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ - - LongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) { - return this.comp( - /* validates */ - other) >= 0; - }; - /** - * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}. - * @function - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ - - - LongPrototype.gte = LongPrototype.greaterThanOrEqual; - /** - * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}. - * @function - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ - - LongPrototype.ge = LongPrototype.greaterThanOrEqual; - /** - * Compares this Long's value with the specified's. - * @this {!Long} - * @param {!Long|number|string} other Other value - * @returns {number} 0 if they are the same, 1 if the this is greater and -1 - * if the given one is greater - */ - - LongPrototype.compare = function compare(other) { - if (!isLong(other)) other = fromValue(other); - if (this.eq(other)) return 0; - var thisNeg = this.isNegative(), - otherNeg = other.isNegative(); - if (thisNeg && !otherNeg) return -1; - if (!thisNeg && otherNeg) return 1; // At this point the sign bits are the same - - if (!this.unsigned) return this.sub(other).isNegative() ? -1 : 1; // Both are positive if at least one is unsigned - - return other.high >>> 0 > this.high >>> 0 || other.high === this.high && other.low >>> 0 > this.low >>> 0 ? -1 : 1; - }; - /** - * Compares this Long's value with the specified's. This is an alias of {@link Long#compare}. - * @function - * @param {!Long|number|string} other Other value - * @returns {number} 0 if they are the same, 1 if the this is greater and -1 - * if the given one is greater - */ - - - LongPrototype.comp = LongPrototype.compare; - /** - * Negates this Long's value. - * @this {!Long} - * @returns {!Long} Negated Long - */ - - LongPrototype.negate = function negate() { - if (!this.unsigned && this.eq(MIN_VALUE)) return MIN_VALUE; - return this.not().add(ONE); - }; - /** - * Negates this Long's value. This is an alias of {@link Long#negate}. - * @function - * @returns {!Long} Negated Long - */ - - - LongPrototype.neg = LongPrototype.negate; - /** - * Returns the sum of this and the specified Long. - * @this {!Long} - * @param {!Long|number|string} addend Addend - * @returns {!Long} Sum - */ - - LongPrototype.add = function add(addend) { - if (!isLong(addend)) addend = fromValue(addend); // Divide each number into 4 chunks of 16 bits, and then sum the chunks. - - var a48 = this.high >>> 16; - var a32 = this.high & 0xFFFF; - var a16 = this.low >>> 16; - var a00 = this.low & 0xFFFF; - var b48 = addend.high >>> 16; - var b32 = addend.high & 0xFFFF; - var b16 = addend.low >>> 16; - var b00 = addend.low & 0xFFFF; - var c48 = 0, - c32 = 0, - c16 = 0, - c00 = 0; - c00 += a00 + b00; - c16 += c00 >>> 16; - c00 &= 0xFFFF; - c16 += a16 + b16; - c32 += c16 >>> 16; - c16 &= 0xFFFF; - c32 += a32 + b32; - c48 += c32 >>> 16; - c32 &= 0xFFFF; - c48 += a48 + b48; - c48 &= 0xFFFF; - return fromBits(c16 << 16 | c00, c48 << 16 | c32, this.unsigned); - }; - /** - * Returns the difference of this and the specified Long. - * @this {!Long} - * @param {!Long|number|string} subtrahend Subtrahend - * @returns {!Long} Difference - */ - - - LongPrototype.subtract = function subtract(subtrahend) { - if (!isLong(subtrahend)) subtrahend = fromValue(subtrahend); - return this.add(subtrahend.neg()); - }; - /** - * Returns the difference of this and the specified Long. This is an alias of {@link Long#subtract}. - * @function - * @param {!Long|number|string} subtrahend Subtrahend - * @returns {!Long} Difference - */ - - - LongPrototype.sub = LongPrototype.subtract; - /** - * Returns the product of this and the specified Long. - * @this {!Long} - * @param {!Long|number|string} multiplier Multiplier - * @returns {!Long} Product - */ - - LongPrototype.multiply = function multiply(multiplier) { - if (this.isZero()) return this; - if (!isLong(multiplier)) multiplier = fromValue(multiplier); // use wasm support if present - - if (wasm) { - var low = wasm["mul"](this.low, this.high, multiplier.low, multiplier.high); - return fromBits(low, wasm["get_high"](), this.unsigned); - } - - if (multiplier.isZero()) return this.unsigned ? UZERO : ZERO; - if (this.eq(MIN_VALUE)) return multiplier.isOdd() ? MIN_VALUE : ZERO; - if (multiplier.eq(MIN_VALUE)) return this.isOdd() ? MIN_VALUE : ZERO; - - if (this.isNegative()) { - if (multiplier.isNegative()) return this.neg().mul(multiplier.neg());else return this.neg().mul(multiplier).neg(); - } else if (multiplier.isNegative()) return this.mul(multiplier.neg()).neg(); // If both longs are small, use float multiplication - - - if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24)) return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned); // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products. - // We can skip products that would overflow. - - var a48 = this.high >>> 16; - var a32 = this.high & 0xFFFF; - var a16 = this.low >>> 16; - var a00 = this.low & 0xFFFF; - var b48 = multiplier.high >>> 16; - var b32 = multiplier.high & 0xFFFF; - var b16 = multiplier.low >>> 16; - var b00 = multiplier.low & 0xFFFF; - var c48 = 0, - c32 = 0, - c16 = 0, - c00 = 0; - c00 += a00 * b00; - c16 += c00 >>> 16; - c00 &= 0xFFFF; - c16 += a16 * b00; - c32 += c16 >>> 16; - c16 &= 0xFFFF; - c16 += a00 * b16; - c32 += c16 >>> 16; - c16 &= 0xFFFF; - c32 += a32 * b00; - c48 += c32 >>> 16; - c32 &= 0xFFFF; - c32 += a16 * b16; - c48 += c32 >>> 16; - c32 &= 0xFFFF; - c32 += a00 * b32; - c48 += c32 >>> 16; - c32 &= 0xFFFF; - c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48; - c48 &= 0xFFFF; - return fromBits(c16 << 16 | c00, c48 << 16 | c32, this.unsigned); - }; - /** - * Returns the product of this and the specified Long. This is an alias of {@link Long#multiply}. - * @function - * @param {!Long|number|string} multiplier Multiplier - * @returns {!Long} Product - */ - - - LongPrototype.mul = LongPrototype.multiply; - /** - * Returns this Long divided by the specified. The result is signed if this Long is signed or - * unsigned if this Long is unsigned. - * @this {!Long} - * @param {!Long|number|string} divisor Divisor - * @returns {!Long} Quotient - */ - - LongPrototype.divide = function divide(divisor) { - if (!isLong(divisor)) divisor = fromValue(divisor); - if (divisor.isZero()) throw Error('division by zero'); // use wasm support if present - - if (wasm) { - // guard against signed division overflow: the largest - // negative number / -1 would be 1 larger than the largest - // positive number, due to two's complement. - if (!this.unsigned && this.high === -0x80000000 && divisor.low === -1 && divisor.high === -1) { - // be consistent with non-wasm code path - return this; - } - - var low = (this.unsigned ? wasm["div_u"] : wasm["div_s"])(this.low, this.high, divisor.low, divisor.high); - return fromBits(low, wasm["get_high"](), this.unsigned); - } - - if (this.isZero()) return this.unsigned ? UZERO : ZERO; - var approx, rem, res; - - if (!this.unsigned) { - // This section is only relevant for signed longs and is derived from the - // closure library as a whole. - if (this.eq(MIN_VALUE)) { - if (divisor.eq(ONE) || divisor.eq(NEG_ONE)) return MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE - else if (divisor.eq(MIN_VALUE)) return ONE;else { - // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|. - var halfThis = this.shr(1); - approx = halfThis.div(divisor).shl(1); - - if (approx.eq(ZERO)) { - return divisor.isNegative() ? ONE : NEG_ONE; - } else { - rem = this.sub(divisor.mul(approx)); - res = approx.add(rem.div(divisor)); - return res; - } - } - } else if (divisor.eq(MIN_VALUE)) return this.unsigned ? UZERO : ZERO; - - if (this.isNegative()) { - if (divisor.isNegative()) return this.neg().div(divisor.neg()); - return this.neg().div(divisor).neg(); - } else if (divisor.isNegative()) return this.div(divisor.neg()).neg(); - - res = ZERO; - } else { - // The algorithm below has not been made for unsigned longs. It's therefore - // required to take special care of the MSB prior to running it. - if (!divisor.unsigned) divisor = divisor.toUnsigned(); - if (divisor.gt(this)) return UZERO; - if (divisor.gt(this.shru(1))) // 15 >>> 1 = 7 ; with divisor = 8 ; true - return UONE; - res = UZERO; - } // Repeat the following until the remainder is less than other: find a - // floating-point that approximates remainder / other *from below*, add this - // into the result, and subtract it from the remainder. It is critical that - // the approximate value is less than or equal to the real value so that the - // remainder never becomes negative. - - - rem = this; - - while (rem.gte(divisor)) { - // Approximate the result of division. This may be a little greater or - // smaller than the actual value. - approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber())); // We will tweak the approximate result by changing it in the 48-th digit or - // the smallest non-fractional digit, whichever is larger. - - var log2 = Math.ceil(Math.log(approx) / Math.LN2), - delta = log2 <= 48 ? 1 : pow_dbl(2, log2 - 48), - // Decrease the approximation until it is smaller than the remainder. Note - // that if it is too large, the product overflows and is negative. - approxRes = fromNumber(approx), - approxRem = approxRes.mul(divisor); - - while (approxRem.isNegative() || approxRem.gt(rem)) { - approx -= delta; - approxRes = fromNumber(approx, this.unsigned); - approxRem = approxRes.mul(divisor); - } // We know the answer can't be zero... and actually, zero would cause - // infinite recursion since we would make no progress. - - - if (approxRes.isZero()) approxRes = ONE; - res = res.add(approxRes); - rem = rem.sub(approxRem); - } - - return res; - }; - /** - * Returns this Long divided by the specified. This is an alias of {@link Long#divide}. - * @function - * @param {!Long|number|string} divisor Divisor - * @returns {!Long} Quotient - */ - - - LongPrototype.div = LongPrototype.divide; - /** - * Returns this Long modulo the specified. - * @this {!Long} - * @param {!Long|number|string} divisor Divisor - * @returns {!Long} Remainder - */ - - LongPrototype.modulo = function modulo(divisor) { - if (!isLong(divisor)) divisor = fromValue(divisor); // use wasm support if present - - if (wasm) { - var low = (this.unsigned ? wasm["rem_u"] : wasm["rem_s"])(this.low, this.high, divisor.low, divisor.high); - return fromBits(low, wasm["get_high"](), this.unsigned); - } - - return this.sub(this.div(divisor).mul(divisor)); - }; - /** - * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}. - * @function - * @param {!Long|number|string} divisor Divisor - * @returns {!Long} Remainder - */ - - - LongPrototype.mod = LongPrototype.modulo; - /** - * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}. - * @function - * @param {!Long|number|string} divisor Divisor - * @returns {!Long} Remainder - */ - - LongPrototype.rem = LongPrototype.modulo; - /** - * Returns the bitwise NOT of this Long. - * @this {!Long} - * @returns {!Long} - */ - - LongPrototype.not = function not() { - return fromBits(~this.low, ~this.high, this.unsigned); - }; - /** - * Returns count leading zeros of this Long. - * @this {!Long} - * @returns {!number} - */ - - - LongPrototype.countLeadingZeros = function countLeadingZeros() { - return this.high ? Math.clz32(this.high) : Math.clz32(this.low) + 32; - }; - /** - * Returns count leading zeros. This is an alias of {@link Long#countLeadingZeros}. - * @function - * @param {!Long} - * @returns {!number} - */ - - - LongPrototype.clz = LongPrototype.countLeadingZeros; - /** - * Returns count trailing zeros of this Long. - * @this {!Long} - * @returns {!number} - */ - - LongPrototype.countTrailingZeros = function countTrailingZeros() { - return this.low ? ctz32(this.low) : ctz32(this.high) + 32; - }; - /** - * Returns count trailing zeros. This is an alias of {@link Long#countTrailingZeros}. - * @function - * @param {!Long} - * @returns {!number} - */ - - - LongPrototype.ctz = LongPrototype.countTrailingZeros; - /** - * Returns the bitwise AND of this Long and the specified. - * @this {!Long} - * @param {!Long|number|string} other Other Long - * @returns {!Long} - */ - - LongPrototype.and = function and(other) { - if (!isLong(other)) other = fromValue(other); - return fromBits(this.low & other.low, this.high & other.high, this.unsigned); - }; - /** - * Returns the bitwise OR of this Long and the specified. - * @this {!Long} - * @param {!Long|number|string} other Other Long - * @returns {!Long} - */ - - - LongPrototype.or = function or(other) { - if (!isLong(other)) other = fromValue(other); - return fromBits(this.low | other.low, this.high | other.high, this.unsigned); - }; - /** - * Returns the bitwise XOR of this Long and the given one. - * @this {!Long} - * @param {!Long|number|string} other Other Long - * @returns {!Long} - */ - - - LongPrototype.xor = function xor(other) { - if (!isLong(other)) other = fromValue(other); - return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned); - }; - /** - * Returns this Long with bits shifted to the left by the given amount. - * @this {!Long} - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Shifted Long - */ - - - LongPrototype.shiftLeft = function shiftLeft(numBits) { - if (isLong(numBits)) numBits = numBits.toInt(); - if ((numBits &= 63) === 0) return this;else if (numBits < 32) return fromBits(this.low << numBits, this.high << numBits | this.low >>> 32 - numBits, this.unsigned);else return fromBits(0, this.low << numBits - 32, this.unsigned); - }; - /** - * Returns this Long with bits shifted to the left by the given amount. This is an alias of {@link Long#shiftLeft}. - * @function - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Shifted Long - */ - - - LongPrototype.shl = LongPrototype.shiftLeft; - /** - * Returns this Long with bits arithmetically shifted to the right by the given amount. - * @this {!Long} - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Shifted Long - */ - - LongPrototype.shiftRight = function shiftRight(numBits) { - if (isLong(numBits)) numBits = numBits.toInt(); - if ((numBits &= 63) === 0) return this;else if (numBits < 32) return fromBits(this.low >>> numBits | this.high << 32 - numBits, this.high >> numBits, this.unsigned);else return fromBits(this.high >> numBits - 32, this.high >= 0 ? 0 : -1, this.unsigned); - }; - /** - * Returns this Long with bits arithmetically shifted to the right by the given amount. This is an alias of {@link Long#shiftRight}. - * @function - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Shifted Long - */ - - - LongPrototype.shr = LongPrototype.shiftRight; - /** - * Returns this Long with bits logically shifted to the right by the given amount. - * @this {!Long} - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Shifted Long - */ - - LongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) { - if (isLong(numBits)) numBits = numBits.toInt(); - if ((numBits &= 63) === 0) return this; - if (numBits < 32) return fromBits(this.low >>> numBits | this.high << 32 - numBits, this.high >>> numBits, this.unsigned); - if (numBits === 32) return fromBits(this.high, 0, this.unsigned); - return fromBits(this.high >>> numBits - 32, 0, this.unsigned); - }; - /** - * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}. - * @function - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Shifted Long - */ - - - LongPrototype.shru = LongPrototype.shiftRightUnsigned; - /** - * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}. - * @function - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Shifted Long - */ - - LongPrototype.shr_u = LongPrototype.shiftRightUnsigned; - /** - * Returns this Long with bits rotated to the left by the given amount. - * @this {!Long} - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Rotated Long - */ - - LongPrototype.rotateLeft = function rotateLeft(numBits) { - var b; - if (isLong(numBits)) numBits = numBits.toInt(); - if ((numBits &= 63) === 0) return this; - if (numBits === 32) return fromBits(this.high, this.low, this.unsigned); - - if (numBits < 32) { - b = 32 - numBits; - return fromBits(this.low << numBits | this.high >>> b, this.high << numBits | this.low >>> b, this.unsigned); - } - - numBits -= 32; - b = 32 - numBits; - return fromBits(this.high << numBits | this.low >>> b, this.low << numBits | this.high >>> b, this.unsigned); - }; - /** - * Returns this Long with bits rotated to the left by the given amount. This is an alias of {@link Long#rotateLeft}. - * @function - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Rotated Long - */ - - - LongPrototype.rotl = LongPrototype.rotateLeft; - /** - * Returns this Long with bits rotated to the right by the given amount. - * @this {!Long} - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Rotated Long - */ - - LongPrototype.rotateRight = function rotateRight(numBits) { - var b; - if (isLong(numBits)) numBits = numBits.toInt(); - if ((numBits &= 63) === 0) return this; - if (numBits === 32) return fromBits(this.high, this.low, this.unsigned); - - if (numBits < 32) { - b = 32 - numBits; - return fromBits(this.high << b | this.low >>> numBits, this.low << b | this.high >>> numBits, this.unsigned); - } - - numBits -= 32; - b = 32 - numBits; - return fromBits(this.low << b | this.high >>> numBits, this.high << b | this.low >>> numBits, this.unsigned); - }; - /** - * Returns this Long with bits rotated to the right by the given amount. This is an alias of {@link Long#rotateRight}. - * @function - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Rotated Long - */ - - - LongPrototype.rotr = LongPrototype.rotateRight; - /** - * Converts this Long to signed. - * @this {!Long} - * @returns {!Long} Signed long - */ - - LongPrototype.toSigned = function toSigned() { - if (!this.unsigned) return this; - return fromBits(this.low, this.high, false); - }; - /** - * Converts this Long to unsigned. - * @this {!Long} - * @returns {!Long} Unsigned long - */ - - - LongPrototype.toUnsigned = function toUnsigned() { - if (this.unsigned) return this; - return fromBits(this.low, this.high, true); - }; - /** - * Converts this Long to its byte representation. - * @param {boolean=} le Whether little or big endian, defaults to big endian - * @this {!Long} - * @returns {!Array.} Byte representation - */ - - - LongPrototype.toBytes = function toBytes(le) { - return le ? this.toBytesLE() : this.toBytesBE(); - }; - /** - * Converts this Long to its little endian byte representation. - * @this {!Long} - * @returns {!Array.} Little endian byte representation - */ - - - LongPrototype.toBytesLE = function toBytesLE() { - var hi = this.high, - lo = this.low; - return [lo & 0xff, lo >>> 8 & 0xff, lo >>> 16 & 0xff, lo >>> 24, hi & 0xff, hi >>> 8 & 0xff, hi >>> 16 & 0xff, hi >>> 24]; - }; - /** - * Converts this Long to its big endian byte representation. - * @this {!Long} - * @returns {!Array.} Big endian byte representation - */ - - - LongPrototype.toBytesBE = function toBytesBE() { - var hi = this.high, - lo = this.low; - return [hi >>> 24, hi >>> 16 & 0xff, hi >>> 8 & 0xff, hi & 0xff, lo >>> 24, lo >>> 16 & 0xff, lo >>> 8 & 0xff, lo & 0xff]; - }; - /** - * Creates a Long from its byte representation. - * @param {!Array.} bytes Byte representation - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @param {boolean=} le Whether little or big endian, defaults to big endian - * @returns {Long} The corresponding Long value - */ - - - Long.fromBytes = function fromBytes(bytes, unsigned, le) { - return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned); - }; - /** - * Creates a Long from its little endian byte representation. - * @param {!Array.} bytes Little endian byte representation - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @returns {Long} The corresponding Long value - */ - - - Long.fromBytesLE = function fromBytesLE(bytes, unsigned) { - return new Long(bytes[0] | bytes[1] << 8 | bytes[2] << 16 | bytes[3] << 24, bytes[4] | bytes[5] << 8 | bytes[6] << 16 | bytes[7] << 24, unsigned); - }; - /** - * Creates a Long from its big endian byte representation. - * @param {!Array.} bytes Big endian byte representation - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @returns {Long} The corresponding Long value - */ - - - Long.fromBytesBE = function fromBytesBE(bytes, unsigned) { - return new Long(bytes[4] << 24 | bytes[5] << 16 | bytes[6] << 8 | bytes[7], bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], unsigned); - }; - - var _default = Long; - exports.default = _default; - return "default" in exports ? exports.default : exports; -})({}); -if (typeof define === 'function' && define.amd) define([], function() { return Long; }); -else if (typeof module === 'object' && typeof exports === 'object') module.exports = Long; diff --git a/node_modules/long/umd/package.json b/node_modules/long/umd/package.json deleted file mode 100644 index 5bbefff..0000000 --- a/node_modules/long/umd/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "commonjs" -} diff --git a/node_modules/merge-descriptors/HISTORY.md b/node_modules/merge-descriptors/HISTORY.md new file mode 100644 index 0000000..486771f --- /dev/null +++ b/node_modules/merge-descriptors/HISTORY.md @@ -0,0 +1,21 @@ +1.0.1 / 2016-01-17 +================== + + * perf: enable strict mode + +1.0.0 / 2015-03-01 +================== + + * Add option to only add new descriptors + * Add simple argument validation + * Add jsdoc to source file + +0.0.2 / 2013-12-14 +================== + + * Move repository to `component` organization + +0.0.1 / 2013-10-29 +================== + + * Initial release diff --git a/node_modules/merge-descriptors/LICENSE b/node_modules/merge-descriptors/LICENSE index a53a533..274bfd8 100644 --- a/node_modules/merge-descriptors/LICENSE +++ b/node_modules/merge-descriptors/LICENSE @@ -1,6 +1,7 @@ (The MIT License) Copyright (c) 2013 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 diff --git a/node_modules/merge-descriptors/README.md b/node_modules/merge-descriptors/README.md index ca4cf24..d593c0e 100644 --- a/node_modules/merge-descriptors/README.md +++ b/node_modules/merge-descriptors/README.md @@ -1,5 +1,10 @@ # Merge Descriptors +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + Merge objects using descriptors. ```js @@ -32,3 +37,12 @@ a descriptor by the same name. ## License [MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/merge-descriptors.svg +[npm-url]: https://npmjs.org/package/merge-descriptors +[travis-image]: https://img.shields.io/travis/component/merge-descriptors/master.svg +[travis-url]: https://travis-ci.org/component/merge-descriptors +[coveralls-image]: https://img.shields.io/coveralls/component/merge-descriptors/master.svg +[coveralls-url]: https://coveralls.io/r/component/merge-descriptors?branch=master +[downloads-image]: https://img.shields.io/npm/dm/merge-descriptors.svg +[downloads-url]: https://npmjs.org/package/merge-descriptors diff --git a/node_modules/merge-descriptors/index.js b/node_modules/merge-descriptors/index.js index 5d0af3a..573b132 100644 --- a/node_modules/merge-descriptors/index.js +++ b/node_modules/merge-descriptors/index.js @@ -1,9 +1,12 @@ /*! * merge-descriptors * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed */ +'use strict' + /** * Module exports. * @public diff --git a/node_modules/merge-descriptors/package.json b/node_modules/merge-descriptors/package.json index 857d4f7..514cdbd 100644 --- a/node_modules/merge-descriptors/package.json +++ b/node_modules/merge-descriptors/package.json @@ -1,7 +1,7 @@ { "name": "merge-descriptors", "description": "Merge objects using descriptors", - "version": "1.0.0", + "version": "1.0.1", "author": { "name": "Jonathan Ong", "email": "me@jongleberry.com", @@ -9,20 +9,24 @@ "twitter": "https://twitter.com/jongleberry" }, "contributors": [ - "Douglas Christopher Wilson " + "Douglas Christopher Wilson ", + "Mike Grabowski " ], "license": "MIT", - "repository": { - "type": "git", - "url": "https://github.com/component/merge-descriptors.git" - }, - "bugs": { - "mail": "me@jongleberry.com", - "url": "https://github.com/component/merge-descriptors/issues" + "repository": "component/merge-descriptors", + "devDependencies": { + "istanbul": "0.4.1", + "mocha": "1.21.5" }, "files": [ + "HISTORY.md", "LICENSE", "README.md", "index.js" - ] + ], + "scripts": { + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/" + } } diff --git a/node_modules/mime/CHANGELOG.md b/node_modules/mime/CHANGELOG.md new file mode 100644 index 0000000..f127535 --- /dev/null +++ b/node_modules/mime/CHANGELOG.md @@ -0,0 +1,164 @@ +# Changelog + +## v1.6.0 (24/11/2017) +*No changelog for this release.* + +--- + +## v2.0.4 (24/11/2017) +- [**closed**] Switch to mime-score module for resolving extension contention issues. [#182](https://github.com/broofa/node-mime/issues/182) +- [**closed**] Update mime-db to 1.31.0 in v1.x branch [#181](https://github.com/broofa/node-mime/issues/181) + +--- + +## v1.5.0 (22/11/2017) +- [**closed**] need ES5 version ready in npm package [#179](https://github.com/broofa/node-mime/issues/179) +- [**closed**] mime-db no trace of iWork - pages / numbers / etc. [#178](https://github.com/broofa/node-mime/issues/178) +- [**closed**] How it works in brownser ? [#176](https://github.com/broofa/node-mime/issues/176) +- [**closed**] Missing `./Mime` [#175](https://github.com/broofa/node-mime/issues/175) +- [**closed**] Vulnerable Regular Expression [#167](https://github.com/broofa/node-mime/issues/167) + +--- + +## v2.0.3 (25/09/2017) +*No changelog for this release.* + +--- + +## v1.4.1 (25/09/2017) +- [**closed**] Issue when bundling with webpack [#172](https://github.com/broofa/node-mime/issues/172) + +--- + +## v2.0.2 (15/09/2017) +- [**V2**] fs.readFileSync is not a function [#165](https://github.com/broofa/node-mime/issues/165) +- [**closed**] The extension for video/quicktime should map to .mov, not .qt [#164](https://github.com/broofa/node-mime/issues/164) +- [**V2**] [v2 Feedback request] Mime class API [#163](https://github.com/broofa/node-mime/issues/163) +- [**V2**] [v2 Feedback request] Resolving conflicts over extensions [#162](https://github.com/broofa/node-mime/issues/162) +- [**V2**] Allow callers to load module with official, full, or no defined types. [#161](https://github.com/broofa/node-mime/issues/161) +- [**V2**] Use "facets" to resolve extension conflicts [#160](https://github.com/broofa/node-mime/issues/160) +- [**V2**] Remove fs and path dependencies [#152](https://github.com/broofa/node-mime/issues/152) +- [**V2**] Default content-type should not be application/octet-stream [#139](https://github.com/broofa/node-mime/issues/139) +- [**V2**] reset mime-types [#124](https://github.com/broofa/node-mime/issues/124) +- [**V2**] Extensionless paths should return null or false [#113](https://github.com/broofa/node-mime/issues/113) + +--- + +## v2.0.1 (14/09/2017) +- [**closed**] Changelog for v2.0 does not mention breaking changes [#171](https://github.com/broofa/node-mime/issues/171) +- [**closed**] MIME breaking with 'class' declaration as it is without 'use strict mode' [#170](https://github.com/broofa/node-mime/issues/170) + +--- + +## v2.0.0 (12/09/2017) +- [**closed**] woff and woff2 [#168](https://github.com/broofa/node-mime/issues/168) + +--- + +## v1.4.0 (28/08/2017) +- [**closed**] support for ac3 voc files [#159](https://github.com/broofa/node-mime/issues/159) +- [**closed**] Help understanding change from application/xml to text/xml [#158](https://github.com/broofa/node-mime/issues/158) +- [**closed**] no longer able to override mimetype [#157](https://github.com/broofa/node-mime/issues/157) +- [**closed**] application/vnd.adobe.photoshop [#147](https://github.com/broofa/node-mime/issues/147) +- [**closed**] Directories should appear as something other than application/octet-stream [#135](https://github.com/broofa/node-mime/issues/135) +- [**closed**] requested features [#131](https://github.com/broofa/node-mime/issues/131) +- [**closed**] Make types.json loading optional? [#129](https://github.com/broofa/node-mime/issues/129) +- [**closed**] Cannot find module './types.json' [#120](https://github.com/broofa/node-mime/issues/120) +- [**V2**] .wav files show up as "audio/x-wav" instead of "audio/x-wave" [#118](https://github.com/broofa/node-mime/issues/118) +- [**closed**] Don't be a pain in the ass for node community [#108](https://github.com/broofa/node-mime/issues/108) +- [**closed**] don't make default_type global [#78](https://github.com/broofa/node-mime/issues/78) +- [**closed**] mime.extension() fails if the content-type is parameterized [#74](https://github.com/broofa/node-mime/issues/74) + +--- + +## v1.3.6 (11/05/2017) +- [**closed**] .md should be text/markdown as of March 2016 [#154](https://github.com/broofa/node-mime/issues/154) +- [**closed**] Error while installing mime [#153](https://github.com/broofa/node-mime/issues/153) +- [**closed**] application/manifest+json [#149](https://github.com/broofa/node-mime/issues/149) +- [**closed**] Dynamic adaptive streaming over HTTP (DASH) file extension typo [#141](https://github.com/broofa/node-mime/issues/141) +- [**closed**] charsets image/png undefined [#140](https://github.com/broofa/node-mime/issues/140) +- [**closed**] Mime-db dependency out of date [#130](https://github.com/broofa/node-mime/issues/130) +- [**closed**] how to support plist? [#126](https://github.com/broofa/node-mime/issues/126) +- [**closed**] how does .types file format look like? [#123](https://github.com/broofa/node-mime/issues/123) +- [**closed**] Feature: support for expanding MIME patterns [#121](https://github.com/broofa/node-mime/issues/121) +- [**closed**] DEBUG_MIME doesn't work [#117](https://github.com/broofa/node-mime/issues/117) + +--- + +## v1.3.4 (06/02/2015) +*No changelog for this release.* + +--- + +## v1.3.3 (06/02/2015) +*No changelog for this release.* + +--- + +## v1.3.1 (05/02/2015) +- [**closed**] Consider adding support for Handlebars .hbs file ending [#111](https://github.com/broofa/node-mime/issues/111) +- [**closed**] Consider adding support for hjson. [#110](https://github.com/broofa/node-mime/issues/110) +- [**closed**] Add mime type for Opus audio files [#94](https://github.com/broofa/node-mime/issues/94) +- [**closed**] Consider making the `Requesting New Types` information more visible [#77](https://github.com/broofa/node-mime/issues/77) + +--- + +## v1.3.0 (05/02/2015) +- [**closed**] Add common name? [#114](https://github.com/broofa/node-mime/issues/114) +- [**closed**] application/x-yaml [#104](https://github.com/broofa/node-mime/issues/104) +- [**closed**] Add mime type for WOFF file format 2.0 [#102](https://github.com/broofa/node-mime/issues/102) +- [**closed**] application/x-msi for .msi [#99](https://github.com/broofa/node-mime/issues/99) +- [**closed**] Add mimetype for gettext translation files [#98](https://github.com/broofa/node-mime/issues/98) +- [**closed**] collaborators [#88](https://github.com/broofa/node-mime/issues/88) +- [**closed**] getting errot in installation of mime module...any1 can help? [#87](https://github.com/broofa/node-mime/issues/87) +- [**closed**] should application/json's charset be utf8? [#86](https://github.com/broofa/node-mime/issues/86) +- [**closed**] Add "license" and "licenses" to package.json [#81](https://github.com/broofa/node-mime/issues/81) +- [**closed**] lookup with extension-less file on Windows returns wrong type [#68](https://github.com/broofa/node-mime/issues/68) + +--- + +## v1.2.11 (15/08/2013) +- [**closed**] Update mime.types [#65](https://github.com/broofa/node-mime/issues/65) +- [**closed**] Publish a new version [#63](https://github.com/broofa/node-mime/issues/63) +- [**closed**] README should state upfront that "application/octet-stream" is default for unknown extension [#55](https://github.com/broofa/node-mime/issues/55) +- [**closed**] Suggested improvement to the charset API [#52](https://github.com/broofa/node-mime/issues/52) + +--- + +## v1.2.10 (25/07/2013) +- [**closed**] Mime type for woff files should be application/font-woff and not application/x-font-woff [#62](https://github.com/broofa/node-mime/issues/62) +- [**closed**] node.types in conflict with mime.types [#51](https://github.com/broofa/node-mime/issues/51) + +--- + +## v1.2.9 (17/01/2013) +- [**closed**] Please update "mime" NPM [#49](https://github.com/broofa/node-mime/issues/49) +- [**closed**] Please add semicolon [#46](https://github.com/broofa/node-mime/issues/46) +- [**closed**] parse full mime types [#43](https://github.com/broofa/node-mime/issues/43) + +--- + +## v1.2.8 (10/01/2013) +- [**closed**] /js directory mime is application/javascript. Is it correct? [#47](https://github.com/broofa/node-mime/issues/47) +- [**closed**] Add mime types for lua code. [#45](https://github.com/broofa/node-mime/issues/45) + +--- + +## v1.2.7 (19/10/2012) +- [**closed**] cannot install 1.2.7 via npm [#41](https://github.com/broofa/node-mime/issues/41) +- [**closed**] Transfer ownership to @broofa [#36](https://github.com/broofa/node-mime/issues/36) +- [**closed**] it's wrong to set charset to UTF-8 for text [#30](https://github.com/broofa/node-mime/issues/30) +- [**closed**] Allow multiple instances of MIME types container [#27](https://github.com/broofa/node-mime/issues/27) + +--- + +## v1.2.5 (16/02/2012) +- [**closed**] When looking up a types, check hasOwnProperty [#23](https://github.com/broofa/node-mime/issues/23) +- [**closed**] Bump version to 1.2.2 [#18](https://github.com/broofa/node-mime/issues/18) +- [**closed**] No license [#16](https://github.com/broofa/node-mime/issues/16) +- [**closed**] Some types missing that are used by html5/css3 [#13](https://github.com/broofa/node-mime/issues/13) +- [**closed**] npm install fails for 1.2.1 [#12](https://github.com/broofa/node-mime/issues/12) +- [**closed**] image/pjpeg + image/x-png [#10](https://github.com/broofa/node-mime/issues/10) +- [**closed**] symlink [#8](https://github.com/broofa/node-mime/issues/8) +- [**closed**] gzip [#2](https://github.com/broofa/node-mime/issues/2) +- [**closed**] ALL CAPS filenames return incorrect mime type [#1](https://github.com/broofa/node-mime/issues/1) diff --git a/node_modules/mime/LICENSE b/node_modules/mime/LICENSE index 451fc45..d3f46f7 100644 --- a/node_modules/mime/LICENSE +++ b/node_modules/mime/LICENSE @@ -1,3 +1,5 @@ +The MIT License (MIT) + Copyright (c) 2010 Benjamin Thomas, Robert Kieffer Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/node_modules/mime/build/build.js b/node_modules/mime/build/build.js deleted file mode 100644 index ed5313e..0000000 --- a/node_modules/mime/build/build.js +++ /dev/null @@ -1,11 +0,0 @@ -var db = require('mime-db'); - -var mapByType = {}; -Object.keys(db).forEach(function(key) { - var extensions = db[key].extensions; - if (extensions) { - mapByType[key] = extensions; - } -}); - -console.log(JSON.stringify(mapByType)); diff --git a/node_modules/mime/mime.js b/node_modules/mime/mime.js index 341b6a5..d7efbde 100644 --- a/node_modules/mime/mime.js +++ b/node_modules/mime/mime.js @@ -22,9 +22,9 @@ Mime.prototype.define = function (map) { for (var type in map) { var exts = map[type]; for (var i = 0; i < exts.length; i++) { - if (process.env.DEBUG_MIME && this.types[exts]) { - console.warn(this._loading.replace(/.*\//, ''), 'changes "' + exts[i] + '" extension type from ' + - this.types[exts] + ' to ' + type); + if (process.env.DEBUG_MIME && this.types[exts[i]]) { + console.warn((this._loading || "define()").replace(/.*\//, ''), 'changes "' + exts[i] + '" extension type from ' + + this.types[exts[i]] + ' to ' + type); } this.types[exts[i]] = type; @@ -67,7 +67,7 @@ Mime.prototype.load = function(file) { * Lookup a mime type based on extension */ Mime.prototype.lookup = function(path, fallback) { - var ext = path.replace(/.*[\.\/\\]/, '').toLowerCase(); + var ext = path.replace(/^.*[\.\/\\]/, '').toLowerCase(); return this.types[ext] || fallback || this.default_type; }; @@ -101,7 +101,7 @@ mime.Mime = Mime; mime.charsets = { lookup: function(mimeType, fallback) { // Assume text types are utf8 - return (/^text\//).test(mimeType) ? 'UTF-8' : fallback; + return (/^text\/|^application\/(javascript|json)/).test(mimeType) ? 'UTF-8' : fallback; } }; diff --git a/node_modules/mime/package.json b/node_modules/mime/package.json index df917ce..6bd24bc 100644 --- a/node_modules/mime/package.json +++ b/node_modules/mime/package.json @@ -4,12 +4,12 @@ "url": "http://github.com/broofa", "email": "robert@broofa.com" }, - "scripts": { - "test": "node test.js" - }, "bin": { "mime": "cli.js" }, + "engines": { + "node": ">=4" + }, "contributors": [ { "name": "Benjamin Thomas", @@ -18,19 +18,17 @@ } ], "description": "A comprehensive library for mime-type mapping", - "licenses": [ - { - "type": "MIT", - "url": "https://raw.github.com/broofa/node-mime/master/LICENSE" - } - ], + "license": "MIT", "dependencies": {}, "devDependencies": { - "mime-db": "^1.2.0" + "github-release-notes": "0.13.1", + "mime-db": "1.31.0", + "mime-score": "1.1.0" }, "scripts": { - "prepublish": "node build/build.js > types.json", - "test": "node build/test.js" + "prepare": "node src/build.js", + "changelog": "gren changelog --tags=all --generate --override", + "test": "node src/test.js" }, "keywords": [ "util", @@ -42,5 +40,5 @@ "url": "https://github.com/broofa/node-mime", "type": "git" }, - "version": "1.3.4" + "version": "1.6.0" } diff --git a/node_modules/mime/src/build.js b/node_modules/mime/src/build.js new file mode 100755 index 0000000..4928e48 --- /dev/null +++ b/node_modules/mime/src/build.js @@ -0,0 +1,53 @@ +#!/usr/bin/env node + +'use strict'; + +const fs = require('fs'); +const path = require('path'); +const mimeScore = require('mime-score'); + +let db = require('mime-db'); +let chalk = require('chalk'); + +const STANDARD_FACET_SCORE = 900; + +const byExtension = {}; + +// Clear out any conflict extensions in mime-db +for (let type in db) { + let entry = db[type]; + entry.type = type; + + if (!entry.extensions) continue; + + entry.extensions.forEach(ext => { + if (ext in byExtension) { + const e0 = entry; + const e1 = byExtension[ext]; + e0.pri = mimeScore(e0.type, e0.source); + e1.pri = mimeScore(e1.type, e1.source); + + let drop = e0.pri < e1.pri ? e0 : e1; + let keep = e0.pri >= e1.pri ? e0 : e1; + drop.extensions = drop.extensions.filter(e => e !== ext); + + console.log(`${ext}: Keeping ${chalk.green(keep.type)} (${keep.pri}), dropping ${chalk.red(drop.type)} (${drop.pri})`); + } + byExtension[ext] = entry; + }); +} + +function writeTypesFile(types, path) { + fs.writeFileSync(path, JSON.stringify(types)); +} + +// Segregate into standard and non-standard types based on facet per +// https://tools.ietf.org/html/rfc6838#section-3.1 +const types = {}; + +Object.keys(db).sort().forEach(k => { + const entry = db[k]; + types[entry.type] = entry.extensions; +}); + +writeTypesFile(types, path.join(__dirname, '..', 'types.json')); diff --git a/node_modules/mime/build/test.js b/node_modules/mime/src/test.js similarity index 83% rename from node_modules/mime/build/test.js rename to node_modules/mime/src/test.js index 58b9ba7..42958a2 100644 --- a/node_modules/mime/build/test.js +++ b/node_modules/mime/src/test.js @@ -41,17 +41,20 @@ assert.equal(undefined, mime.extension('unrecognized')); // Test node.types lookups // -assert.equal('application/font-woff', mime.lookup('file.woff')); +assert.equal('font/woff', mime.lookup('file.woff')); assert.equal('application/octet-stream', mime.lookup('file.buffer')); -assert.equal('audio/mp4', mime.lookup('file.m4a')); -assert.equal('font/opentype', mime.lookup('file.otf')); +// TODO: Uncomment once #157 is resolved +// assert.equal('audio/mp4', mime.lookup('file.m4a')); +assert.equal('font/otf', mime.lookup('file.otf')); // // Test charsets // assert.equal('UTF-8', mime.charsets.lookup('text/plain')); -assert.equal(undefined, mime.charsets.lookup(mime.types.js)); +assert.equal('UTF-8', mime.charsets.lookup(mime.types.js)); +assert.equal('UTF-8', mime.charsets.lookup(mime.types.json)); +assert.equal(undefined, mime.charsets.lookup(mime.types.bin)); assert.equal('fallback', mime.charsets.lookup('application/octet-stream', 'fallback')); console.log('\nAll tests passed'); diff --git a/node_modules/mime/types.json b/node_modules/mime/types.json index c674b1c..bec78ab 100644 --- a/node_modules/mime/types.json +++ b/node_modules/mime/types.json @@ -1 +1 @@ -{"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomsvc+xml":["atomsvc"],"application/ccxml+xml":["ccxml"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mdp"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/font-tdpfr":["pfr"],"application/font-woff":["woff"],"application/font-woff2":["woff2"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/java-archive":["jar"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/prs.cww":["cww"],"application/pskc+xml":["pskcxml"],"application/rdf+xml":["rdf"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/voicexml+xml":["vxml"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":["dmg"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["deb","udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-otf":["otf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-ttf":["ttf","ttc"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-install-instructions":["install"],"application/x-iso9660-image":["iso"],"application/x-java-jnlp-file":["jnlp"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdownload":["exe","dll","com","bat","msi"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["wmf","wmz","emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-nzb":["nzb"],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["rar"],"application/x-research-info-systems":["ris"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["obj"],"application/x-ustar":["ustar"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt"],"application/x-xfig":["fig"],"application/x-xliff+xml":["xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"application/xaml+xml":["xaml"],"application/xcap-diff+xml":["xdf"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xml":["xml","xsl","xsd"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/adpcm":["adp"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mp4":["mp4a","m4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/webm":["weba"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-wav":["wav"],"audio/xm":["xm"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"font/opentype":["otf"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/g3fax":["g3"],"image/gif":["gif"],"image/ief":["ief"],"image/jpeg":["jpeg","jpg","jpe"],"image/ktx":["ktx"],"image/png":["png"],"image/prs.btif":["btif"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/tiff":["tiff","tif"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":["sub"],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/webp":["webp"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["ico"],"image/x-mrsid-image":["sid"],"image/x-pcx":["pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/rfc822":["eml","mime"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.vtu":["vtu"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["x3db","x3dbz"],"model/x3d+vrml":["x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee"],"text/css":["css"],"text/csv":["csv"],"text/hjson":["hjson"],"text/html":["html","htm"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/prs.lines.tag":["dsc"],"text/richtext":["rtx"],"text/sgml":["sgml","sgm"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/vtt":["vtt"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["markdown","md","mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-pascal":["p","pas"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/jpeg":["jpgv"],"video/jpm":["jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/webm":["webm"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]} +{"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomsvc+xml":["atomsvc"],"application/bdoc":["bdoc"],"application/ccxml+xml":["ccxml"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/font-tdpfr":["pfr"],"application/font-woff":[],"application/font-woff2":[],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/prs.cww":["cww"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":[],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":[],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":[],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":[],"application/x-msdownload":["com","bat"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["wmf","emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":[],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"application/xaml+xml":["xaml"],"application/xcap-diff+xml":["xdf"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":[],"audio/adpcm":["adp"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mp3":[],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/wav":["wav"],"audio/wave":[],"audio/webm":["weba"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":[],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":[],"audio/x-wav":[],"audio/xm":["xm"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/apng":["apng"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/g3fax":["g3"],"image/gif":["gif"],"image/ief":["ief"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/ktx":["ktx"],"image/png":["png"],"image/prs.btif":["btif"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/tiff":["tiff","tif"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":[],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/webp":["webp"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":[],"image/x-pcx":["pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/rfc822":["eml","mime"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.vtu":["vtu"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["x3db","x3dbz"],"model/x3d+vrml":["x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/hjson":["hjson"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/prs.lines.tag":["dsc"],"text/richtext":["rtx"],"text/rtf":[],"text/sgml":["sgml","sgm"],"text/slim":["slim","slm"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/vtt":["vtt"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":[],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"text/xml":[],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/jpeg":["jpgv"],"video/jpm":["jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/webm":["webm"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]} \ No newline at end of file diff --git a/node_modules/mysql/Changes.md b/node_modules/mysql/Changes.md new file mode 100644 index 0000000..73e549c --- /dev/null +++ b/node_modules/mysql/Changes.md @@ -0,0 +1,569 @@ +# Changes + +This file is a manually maintained list of changes for each release. Feel free +to add your changes here when sending pull requests. Also send corrections if +you spot any mistakes. + +## v2.18.1 (2020-01-23) + +* Fix Amazon RDS profile for yaSSL MySQL servers with 2019 CA #2292 + +## v2.18.0 (2020-01-21) + +* Add `localInfile` option to control `LOAD DATA LOCAL INFILE` +* Add new Amazon RDS Root 2019 CA to Amazon RDS SSL profile #2280 +* Add new error codes up to MySQL 5.7.29 +* Fix early detection of bad callback to `connection.query` +* Support Node.js 12.x #2211 +* Support Node.js 13.x +* Support non-enumerable properties in object argument to `connection.query` #2253 +* Update `bignumber.js` to 9.0.0 +* Update `readable-stream` to 2.3.7 + +## v2.17.1 (2019-04-18) + +* Update `bignumber.js` to 7.2.1 #2206 + - Fix npm deprecation warning + +## v2.17.0 (2019-04-17) + +* Add reverse type lookup for small performance gain #2170 +* Fix `connection.threadId` missing on handshake failure +* Fix duplicate packet name in debug output +* Fix no password support for old password protocol +* Remove special case for handshake in determine packet code +* Small performance improvement starting command sequence +* Support auth switch in change user flow #1776 +* Support Node.js 11.x +* Update `bignumber.js` to 6.0.0 + +## v2.16.0 (2018-07-17) + +* Add Amazon RDS GovCloud SSL certificates #1876 +* Add new error codes up to MySQL 5.7.21 +* Include connection ID in debug output +* Support Node.js 9.x +* Support Node.js 10.x #2003 #2024 #2026 #2034 +* Update Amazon RDS SSL certificates +* Update `bignumber.js` to 4.1.0 +* Update `readable-stream` to 2.3.6 +* Update `sqlstring` to 2.3.1 + - Fix incorrectly replacing non-placeholders in SQL + +## v2.15.0 (2017-10-05) + +* Add new Amazon RDS ca-central-1 certificate CA to Amazon RDS SSL profile #1809 +* Add new error codes up to MySQL 5.7.19 +* Add `mysql.raw()` to generate pre-escaped values #877 #1821 +* Fix "changedRows" to work on non-English servers #1819 +* Fix error when server sends RST on `QUIT` #1811 +* Fix typo in insecure auth error message +* Support `mysql_native_password` auth switch request for Azure #1396 #1729 #1730 +* Update `sqlstring` to 2.3.0 + - Add `.toSqlString()` escape overriding + - Small performance improvement on `escapeId` +* Update `bignumber.js` to 4.0.4 + +## v2.14.1 (2017-08-01) + +* Fix holding first closure for lifetime of connection #1785 + +## v2.14.0 (2017-07-25) + +* Add new Amazon RDS ap-south-1 certificate CA to Amazon RDS SSL profile #1780 +* Add new Amazon RDS eu-west-2 certificate CA to Amazon RDS SSL profile #1770 +* Add `sql` property to query `Error` objects #1462 #1628 #1629 +* Add `sqlMessage` property to `Error` objects #1714 +* Fix the MySQL 5.7.17 error codes +* Support Node.js 8.x +* Update `bignumber.js` to 4.0.2 +* Update `readable-stream` to 2.3.3 +* Use `safe-buffer` for improved Buffer API + +## v2.13.0 (2017-01-24) + +* Accept regular expression as pool cluster pattern #1572 +* Accept wildcard anywhere in pool cluster pattern #1570 +* Add `acquire` and `release` events to `Pool` for tracking #1366 #1449 #1528 #1625 +* Add new error codes up to MySQL 5.7.17 +* Fix edge cases when determing Query result packets #1547 +* Fix memory leak when using long-running domains #1619 #1620 +* Remove unnecessary buffer copies when receiving large packets +* Update `bignumber.js` to 3.1.2 +* Use a simple buffer list to improve performance #566 #1590 + +## v2.12.0 (2016-11-02) + +* Accept array of type names to `dateStrings` option #605 #1481 +* Add `query` method to `PoolNamespace` #1256 #1505 #1506 + - Used as `cluster.of(...).query(...)` +* Add new error codes up to MySQL 5.7.16 +* Fix edge cases writing certain length coded values +* Fix typo in `HANDSHAKE_NO_SSL_SUPPORT` error message #1534 +* Support Node.js 7.x +* Update `bignumber.js` to 2.4.0 +* Update `sqlstring` to 2.2.0 + - Accept numbers and other value types in `escapeId` + - Escape invalid `Date` objects as `NULL` + - Run `buffer.toString()` through escaping + +## v2.11.1 (2016-06-07) + +* Fix writing truncated packets starting with large string/buffer #1438 + +## v2.11.0 (2016-06-06) + +* Add `POOL_CLOSED` code to "Pool is closed." error +* Add `POOL_CONNLIMIT` code to "No connections available." error #1332 +* Bind underlying connections in pool to same domain as pool #1242 +* Bind underlying socket to same domain as connection #1243 +* Fix allocation errors receiving many result rows #918 #1265 #1324 #1415 +* Fix edge cases constructing long stack traces #1387 +* Fix handshake inactivity timeout on Node.js v4.2.0 #1223 #1236 #1239 #1240 #1241 #1252 +* Fix Query stream to emit close after ending #1349 #1350 +* Fix type cast for BIGINT columns when number is negative #1376 +* Performance improvements for array/object escaping in SqlString #1331 +* Performance improvements for formatting in SqlString #1431 +* Performance improvements for string escaping in SqlString #1390 +* Performance improvements for writing packets to network +* Support Node.js 6.x +* Update `bignumber.js` to 2.3.0 +* Update `readable-stream` to 1.1.14 +* Use the `sqlstring` module for SQL escaping and formatting + +## v2.10.2 (2016-01-12) + +* Fix exception/hang from certain SSL connection errors #1153 +* Update `bignumber.js` to 2.1.4 + +## v2.10.1 (2016-01-11) + +* Add new Amazon RDS ap-northeast-2 certificate CA to Amazon RDS SSL profile #1329 + +## v2.10.0 (2015-12-15) + +* Add new error codes up to MySQL 5.7.9 #1294 +* Add new JSON type constant #1295 +* Add types for fractional seconds support +* Fix `connection.destroy()` on pool connection creating sequences #1291 +* Fix error code 139 `HA_ERR_TO_BIG_ROW` to be `HA_ERR_TOO_BIG_ROW` +* Fix error when call site error is missing stack #1179 +* Fix reading password from MySQL URL that has bare colon #1278 +* Handle MySQL servers not closing TCP connection after QUIT -> OK exchange #1277 +* Minor SqlString Date to string performance improvement #1233 +* Support Node.js 4.x +* Support Node.js 5.x +* Update `bignumber.js` to 2.1.2 + +## v2.9.0 (2015-08-19) + +* Accept the `ciphers` property in connection `ssl` option #1185 +* Fix bad timezone conversion from `Date` to string for certain times #1045 #1155 + +## v2.8.0 (2015-07-13) + +* Add `connect` event to `Connection` #1129 +* Default `timeout` for `connection.end` to 30 seconds #1057 +* Fix a sync callback when sequence enqueue fails #1147 +* Provide static require analysis +* Re-use connection from pool after `conn.changeUser` is used #837 #1088 + +## v2.7.0 (2015-05-27) + +* Destroy/end connections removed from the pool on error +* Delay implied connect until after `.query` argument validation +* Do not remove connections with non-fatal errors from the pool +* Error early if `callback` argument to `.query` is not a function #1060 +* Lazy-load modules from many entry point; reduced memory use + +## v2.6.2 (2015-04-14) + +* Fix `Connection.createQuery` for no SQL #1058 +* Update `bignumber.js` to 2.0.7 + +## v2.6.1 (2015-03-26) + +* Update `bignumber.js` to 2.0.5 #1037 #1038 + +## v2.6.0 (2015-03-24) + +* Add `poolCluster.remove` to remove pools from the cluster #1006 #1007 +* Add optional callback to `poolCluster.end` +* Add `restoreNodeTimeout` option to `PoolCluster` #880 #906 +* Fix LOAD DATA INFILE handling in multiple statements #1036 +* Fix `poolCluster.add` to throw if `PoolCluster` has been closed +* Fix `poolCluster.add` to throw if `id` already defined +* Fix un-catchable error from `PoolCluster` when MySQL server offline #1033 +* Improve speed formatting SQL #1019 +* Support io.js + +## v2.5.5 (2015-02-23) + +* Store SSL presets in JS instead of JSON #959 +* Support Node.js 0.12 +* Update Amazon RDS SSL certificates #1001 + +## v2.5.4 (2014-12-16) + +* Fix error if falsy error thrown in callback handler #960 +* Fix various error code strings #954 + +## v2.5.3 (2014-11-06) + +* Fix `pool.query` streaming interface not emitting connection errors #941 + +## v2.5.2 (2014-10-10) + +* Fix receiving large text fields #922 + +## v2.5.1 (2014-09-22) + +* Fix `pool.end` race conditions #915 +* Fix `pool.getConnection` race conditions + +## v2.5.0 (2014-09-07) + +* Add code `POOL_ENQUEUELIMIT` to error reaching `queueLimit` +* Add `enqueue` event to pool #716 +* Add `enqueue` event to protocol and connection #381 +* Blacklist unsupported connection flags #881 +* Make only column names enumerable in `RowDataPacket` #549 #895 +* Support Node.js 0.6 #718 + +## v2.4.3 (2014-08-25) + +* Fix `pool.query` to use `typeCast` configuration + +## v2.4.2 (2014-08-03) + +* Fix incorrect sequence packet errors to be catchable #867 +* Fix stray protocol packet errors to be catchable #867 +* Fix timing of fatal protocol errors bubbling to user #879 + +## v2.4.1 (2014-07-17) + +* Fix `pool.query` not invoking callback on connection error #872 + +## v2.4.0 (2014-07-13) + +* Add code `POOL_NOEXIST` in PoolCluster error #846 +* Add `acquireTimeout` pool option to specify a timeout for acquiring a connection #821 #854 +* Add `connection.escapeId` +* Add `pool.escapeId` +* Add `timeout` option to all sequences #855 #863 +* Default `connectTimeout` to 10 seconds +* Fix domain binding with `conn.connect` +* Fix `packet.default` to actually be a string +* Fix `PARSER_*` errors to be catchable +* Fix `PROTOCOL_PACKETS_OUT_OF_ORDER` error to be catchable #844 +* Include packets that failed parsing under `debug` +* Return `Query` object from `pool.query` like `conn.query` #830 +* Use `EventEmitter.listenerCount` when possible for faster counting + +## v2.3.2 (2014-05-29) + +* Fix pool leaking connections after `conn.changeUser` #833 + +## v2.3.1 (2014-05-26) + +* Add database errors to error constants +* Add global errors to error constants +* Throw when calling `conn.release` multiple times #824 #827 +* Update known error codes + +## v2.3.0 (2014-05-16) + +* Accept MySQL charset (like `UTF8` or `UTF8MB4`) in `charset` option #808 +* Accept pool options in connection string to `mysql.createPool` #811 +* Clone connection config for new pool connections +* Default `connectTimeout` to 2 minutes +* Reject unauthorized SSL connections (use `ssl.rejectUnauthorized` to override) #816 +* Return last error when PoolCluster exhausts connection retries #818 +* Remove connection from pool after `conn.changeUser` is released #806 +* Throw on unknown SSL profile name #817 +* User newer TLS functions when available #809 + +## v2.2.0 (2014-04-27) + +* Use indexOf instead of for loops removing conn from pool #611 +* Make callback to `pool.query` optional like `conn.query` #585 +* Prevent enqueuing sequences after fatal error #400 +* Fix geometry parser for empty fields #742 +* Accept lower-case charset option +* Throw on unknown charset option #789 +* Update known charsets +* Remove console.warn from PoolCluster #744 +* Fix `pool.end` to handle queued connections #797 +* Fix `pool.releaseConnection` to keep connection queue flowing #797 +* Fix SSL handshake error to be catchable #800 +* Add `connection.threadId` to get MySQL connection ID #602 +* Ensure `pool.getConnection` retrieves good connections #434 #557 #778 +* Fix pool cluster wildcard matching #627 +* Pass query values through to `SqlString.format` #590 + +## v2.1.1 (2014-03-13) + +* fix authentication w/password failure for node.js 0.10.5 #746 #752 +* fix authentication w/password TypeError exception for node.js 0.10.0-0.10.4 #747 +* fix specifying `values` in `conn.query({...}).on(...)` pattern #755 +* fix long stack trace to include the `pool.query(...)` call #715 + +## v2.1.0 (2014-02-20) + +* crypto.createHash fix for node.js < 11 #735 +* Add `connectTimeout` option to specify a timeout for establishing a connection #726 +* SSL support #481 + +## v2.0.1 + +* internal parser speed improvement #702 +* domains support +* 'trace' connection option to control if long stack traces are generated #713 #710 #439 + +## v2.0.0 (2014-01-09) + +* stream improvements: + - node 0.8 support #692 + - Emit 'close' events from query streams #688 +* encoding fix in streaming LOAD DATA LOCAL INFILE #670 +* Doc improvements + +## v2.0.0-rc2 (2013-12-07) + +* Streaming LOAD DATA LOCAL INFILE #668 +* Doc improvements + +## v2.0.0-rc1 (2013-11-30) + +* Transaction support +* Expose SqlString.format as mysql.format() +* Many bug fixes +* Better support for dates in local time zone +* Doc improvements + +## v2.0.0-alpha9 (2013-08-27) + +* Add query to pool to execute queries directly using the pool +* Add `sqlState` property to `Error` objects #556 +* Pool option to set queue limit +* Pool sends 'connection' event when it opens a new connection +* Added stringifyObjects option to treat input as strings rather than objects (#501) +* Support for poolClusters +* Datetime improvements +* Bug fixes + +## v2.0.0-alpha8 (2013-04-30) + +* Switch to old mode for Streams 2 (Node.js v 0.10.x) +* Add stream method to Query Wraps events from the query object into a node v0.10.x Readable stream +* DECIMAL should also be treated as big number +* Removed slow unnecessary stack access +* Added charsets +* Added bigNumberStrings option for forcing BIGINT columns as strings +* Changes date parsing to return String if not a valid JS Date +* Adds support for ?? escape sequence to escape identifiers +* Changes Auth.token() to force password to be in binary, not utf8 (#378) +* Restrict debugging by packet types +* Add 'multipleStatements' option tracking to ConnectionConfig. Fixes GH-408 +* Changes Pool to handle 'error' events and dispose connection +* Allows db.query({ sql: "..." }, [ val1, ... ], cb); (#390) +* Improved documentation +* Bug fixes + +## v2.0.0-alpha7 (2013-02-03) + +* Add connection pooling (#351) + +## v2.0.0-alpha6 (2013-01-31) + +* Add supportBigNumbers option (#381, #382) +* Accept prebuilt Query object in connection.query +* Bug fixes + +## v2.0.0-alpha5 (2012-12-03) + +* Add mysql.escapeId to escape identifiers (closes #342) +* Allow custom escaping mode (config.queryFormat) +* Convert DATE columns to configured timezone instead of UTC (#332) +* Convert LONGLONG and NEWDECIMAL to numbers (#333) +* Fix Connection.escape() (fixes #330) +* Changed Readme ambiguity about custom type cast fallback +* Change typeCast to receive Connection instead of Connection.config.timezone +* Fix drain event having useless err parameter +* Add Connection.statistics() back from v0.9 +* Add Connection.ping() back from v0.9 + +## v2.0.0-alpha4 (2012-10-03) + +* Fix some OOB errors on resume() +* Fix quick pause() / resume() usage +* Properly parse host denied / similar errors +* Add Connection.ChangeUser functionality +* Make sure changeUser errors are fatal +* Enable formatting nested arrays for bulk inserts +* Add Connection.escape functionality +* Renamed 'close' to 'end' event +* Return parsed object instead of Buffer for GEOMETRY types +* Allow nestTables inline (using a string instead of a boolean) +* Check for ZEROFILL_FLAG and format number accordingly +* Add timezone support (default: local) +* Add custom typeCast functionality +* Export mysql column types +* Add connection flags functionality (#237) +* Exports drain event when queue finishes processing (#272, #271, #306) + +## v2.0.0-alpha3 (2012-06-12) + +* Implement support for `LOAD DATA LOCAL INFILE` queries (#182). +* Support OLD\_PASSWORD() accounts like 0.9.x did. You should still upgrade any + user accounts in your your MySQL user table that has short (16 byte) Password + values. Connecting to those accounts is not secure. (#204) +* Ignore function values when escaping objects, allows to use RowDataPacket + objects as query arguments. (Alex Gorbatchev, #213) +* Handle initial error packets from server such as `ER_HOST_NOT_PRIVILEGED`. +* Treat `utf8\_bin` as a String, not Buffer. (#214) +* Handle empty strings in first row column value. (#222) +* Honor Connection#nestTables setting for queries. (#221) +* Remove `CLIENT_INTERACTIVE` flag from config. Improves #225. +* Improve docs for connections settings. +* Implement url string support for Connection configs. + +## v2.0.0-alpha2 (2012-05-31) + +* Specify escaping before for NaN / Infinity (they are as unquoted constants). +* Support for unix domain socket connections (use: {socketPath: '...'}). +* Fix type casting for NULL values for Date/Number fields +* Add `fields` argument to `query()` as well as `'fields'` event. This is + similar to what was available in 0.9.x. +* Support connecting to the sphinx searchd daemon as well as MariaDB (#199). +* Implement long stack trace support, will be removed / disabled if the node + core ever supports it natively. +* Implement `nestTables` option for queries, allows fetching JOIN result sets + with overlapping column names. +* Fix ? placeholder mechanism for values containing '?' characters (#205). +* Detect when `connect()` is called more than once on a connection and provide + the user with a good error message for it (#204). +* Switch to `UTF8_GENERAL_CI` (previously `UTF8_UNICODE_CI`) as the default + charset for all connections to avoid strange MySQL performance issues (#200), + and also make the charset user configurable. +* Fix BLOB type casting for `TINY_BLOB`, `MEDIUM_BLOB` and `LONG_BLOB`. +* Add support for sending and receiving large (> 16 MB) packets. + +## v2.0.0-alpha (2012-05-15) + +This release is a rewrite. You should carefully test your application after +upgrading to avoid problems. This release features many improvements, most +importantly: + +* ~5x faster than v0.9.x for parsing query results +* Support for pause() / resume() (for streaming rows) +* Support for multiple statement queries +* Support for stored procedures +* Support for transactions +* Support for binary columns (as blobs) +* Consistent & well documented error handling +* A new Connection class that has well defined semantics (unlike the old Client class). +* Convenient escaping of objects / arrays that allows for simpler query construction +* A significantly simpler code base +* Many bug fixes & other small improvements (Closed 62 out of 66 GitHub issues) + +Below are a few notes on the upgrade process itself: + +The first thing you will run into is that the old `Client` class is gone and +has been replaced with a less ambitious `Connection` class. So instead of +`mysql.createClient()`, you now have to: + +```js +var mysql = require('mysql'); +var connection = mysql.createConnection({ + host : 'localhost', + user : 'me', + password : 'secret', +}); + +connection.query('SELECT 1', function(err, rows) { + if (err) throw err; + + console.log('Query result: ', rows); +}); + +connection.end(); +``` + +The new `Connection` class does not try to handle re-connects, please study the +`Server disconnects` section in the new Readme. + +Other than that, the interface has stayed very similar. Here are a few things +to check out so: + +* BIGINT's are now cast into strings +* Binary data is now cast to buffers +* The `'row'` event on the `Query` object is now called `'result'` and will + also be emitted for queries that produce an OK/Error response. +* Error handling is consistently defined now, check the Readme +* Escaping has become more powerful which may break your code if you are + currently using objects to fill query placeholders. +* Connections can now be established explicitly again, so you may wish to do so + if you want to handle connection errors specifically. + +That should be most of it, if you run into anything else, please send a patch +or open an issue to improve this document. + +## v0.9.6 (2012-03-12) + +* Escape array values so they produce sql arrays (Roger Castells, Colin Smith) +* docs: mention mysql transaction stop gap solution (Blake Miner) +* docs: Mention affectedRows in FAQ (Michael Baldwin) + +## v0.9.5 (2011-11-26) + +* Fix #142 Driver stalls upon reconnect attempt that's immediately closed +* Add travis build +* Switch to urun as a test runner +* Switch to utest for unit tests +* Remove fast-or-slow dependency for tests +* Split integration tests into individual files again + +## v0.9.4 (2011-08-31) + +* Expose package.json as `mysql.PACKAGE` (#104) + +## v0.9.3 (2011-08-22) + +* Set default `client.user` to root +* Fix #91: Client#format should not mutate params array +* Fix #94: TypeError in client.js +* Parse decimals as string (vadimg) + +## v0.9.2 (2011-08-07) + +* The underlaying socket connection is now managed implicitly rather than explicitly. +* Check the [upgrading guide][] for a full list of changes. + +## v0.9.1 (2011-02-20) + +* Fix issue #49 / `client.escape()` throwing exceptions on objects. (Nick Payne) +* Drop < v0.4.x compatibility. From now on you need node v0.4.x to use this module. + +## Older releases + +These releases were done before maintaining this file: + +* [v0.9.0](https://github.com/mysqljs/mysql/compare/v0.8.0...v0.9.0) + (2011-01-04) +* [v0.8.0](https://github.com/mysqljs/mysql/compare/v0.7.0...v0.8.0) + (2010-10-30) +* [v0.7.0](https://github.com/mysqljs/mysql/compare/v0.6.0...v0.7.0) + (2010-10-14) +* [v0.6.0](https://github.com/mysqljs/mysql/compare/v0.5.0...v0.6.0) + (2010-09-28) +* [v0.5.0](https://github.com/mysqljs/mysql/compare/v0.4.0...v0.5.0) + (2010-09-17) +* [v0.4.0](https://github.com/mysqljs/mysql/compare/v0.3.0...v0.4.0) + (2010-09-02) +* [v0.3.0](https://github.com/mysqljs/mysql/compare/v0.2.0...v0.3.0) + (2010-08-25) +* [v0.2.0](https://github.com/mysqljs/mysql/compare/v0.1.0...v0.2.0) + (2010-08-22) +* [v0.1.0](https://github.com/mysqljs/mysql/commits/v0.1.0) + (2010-08-22) diff --git a/node_modules/mysql2/License b/node_modules/mysql/License similarity index 92% rename from node_modules/mysql2/License rename to node_modules/mysql/License index c9348b9..c7ff12a 100644 --- a/node_modules/mysql2/License +++ b/node_modules/mysql/License @@ -1,4 +1,4 @@ -Copyright (c) 2016 Andrey Sidorov (sidorares@yandex.ru) and contributors +Copyright (c) 2012 Felix Geisendörfer (felix@debuggable.com) and contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/node_modules/mysql/Readme.md b/node_modules/mysql/Readme.md new file mode 100644 index 0000000..d7c9aa2 --- /dev/null +++ b/node_modules/mysql/Readme.md @@ -0,0 +1,1548 @@ +# mysql + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Node.js Version][node-image]][node-url] +[![Linux Build][travis-image]][travis-url] +[![Windows Build][appveyor-image]][appveyor-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +## Table of Contents + +- [Install](#install) +- [Introduction](#introduction) +- [Contributors](#contributors) +- [Sponsors](#sponsors) +- [Community](#community) +- [Establishing connections](#establishing-connections) +- [Connection options](#connection-options) + - [SSL options](#ssl-options) + - [Connection flags](#connection-flags) +- [Terminating connections](#terminating-connections) +- [Pooling connections](#pooling-connections) +- [Pool options](#pool-options) +- [Pool events](#pool-events) + - [acquire](#acquire) + - [connection](#connection) + - [enqueue](#enqueue) + - [release](#release) +- [Closing all the connections in a pool](#closing-all-the-connections-in-a-pool) +- [PoolCluster](#poolcluster) + - [PoolCluster options](#poolcluster-options) +- [Switching users and altering connection state](#switching-users-and-altering-connection-state) +- [Server disconnects](#server-disconnects) +- [Performing queries](#performing-queries) +- [Escaping query values](#escaping-query-values) +- [Escaping query identifiers](#escaping-query-identifiers) + - [Preparing Queries](#preparing-queries) + - [Custom format](#custom-format) +- [Getting the id of an inserted row](#getting-the-id-of-an-inserted-row) +- [Getting the number of affected rows](#getting-the-number-of-affected-rows) +- [Getting the number of changed rows](#getting-the-number-of-changed-rows) +- [Getting the connection ID](#getting-the-connection-id) +- [Executing queries in parallel](#executing-queries-in-parallel) +- [Streaming query rows](#streaming-query-rows) + - [Piping results with Streams](#piping-results-with-streams) +- [Multiple statement queries](#multiple-statement-queries) +- [Stored procedures](#stored-procedures) +- [Joins with overlapping column names](#joins-with-overlapping-column-names) +- [Transactions](#transactions) +- [Ping](#ping) +- [Timeouts](#timeouts) +- [Error handling](#error-handling) +- [Exception Safety](#exception-safety) +- [Type casting](#type-casting) + - [Number](#number) + - [Date](#date) + - [Buffer](#buffer) + - [String](#string) + - [Custom type casting](#custom-type-casting) +- [Debugging and reporting problems](#debugging-and-reporting-problems) +- [Security issues](#security-issues) +- [Contributing](#contributing) +- [Running tests](#running-tests) + - [Running unit tests](#running-unit-tests) + - [Running integration tests](#running-integration-tests) +- [Todo](#todo) + +## Install + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). + +Before installing, [download and install Node.js](https://nodejs.org/en/download/). +Node.js 0.6 or higher is required. + +Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install mysql +``` + +For information about the previous 0.9.x releases, visit the [v0.9 branch][]. + +Sometimes I may also ask you to install the latest version from Github to check +if a bugfix is working. In this case, please do: + +```sh +$ npm install mysqljs/mysql +``` + +[v0.9 branch]: https://github.com/mysqljs/mysql/tree/v0.9 + +## Introduction + +This is a node.js driver for mysql. It is written in JavaScript, does not +require compiling, and is 100% MIT licensed. + +Here is an example on how to use it: + +```js +var mysql = require('mysql'); +var connection = mysql.createConnection({ + host : 'localhost', + user : 'me', + password : 'secret', + database : 'my_db' +}); + +connection.connect(); + +connection.query('SELECT 1 + 1 AS solution', function (error, results, fields) { + if (error) throw error; + console.log('The solution is: ', results[0].solution); +}); + +connection.end(); +``` + +From this example, you can learn the following: + +* Every method you invoke on a connection is queued and executed in sequence. +* Closing the connection is done using `end()` which makes sure all remaining + queries are executed before sending a quit packet to the mysql server. + +## Contributors + +Thanks goes to the people who have contributed code to this module, see the +[GitHub Contributors page][]. + +[GitHub Contributors page]: https://github.com/mysqljs/mysql/graphs/contributors + +Additionally I'd like to thank the following people: + +* [Andrey Hristov][] (Oracle) - for helping me with protocol questions. +* [Ulf Wendel][] (Oracle) - for helping me with protocol questions. + +[Ulf Wendel]: http://blog.ulf-wendel.de/ +[Andrey Hristov]: http://andrey.hristov.com/ + +## Sponsors + +The following companies have supported this project financially, allowing me to +spend more time on it (ordered by time of contribution): + +* [Transloadit](http://transloadit.com) (my startup, we do file uploading & + video encoding as a service, check it out) +* [Joyent](http://www.joyent.com/) +* [pinkbike.com](http://pinkbike.com/) +* [Holiday Extras](http://www.holidayextras.co.uk/) (they are [hiring](http://join.holidayextras.co.uk/)) +* [Newscope](http://newscope.com/) (they are [hiring](https://newscope.com/unternehmen/jobs/)) + +## Community + +If you'd like to discuss this module, or ask questions about it, please use one +of the following: + +* **Mailing list**: https://groups.google.com/forum/#!forum/node-mysql +* **IRC Channel**: #node.js (on freenode.net, I pay attention to any message + including the term `mysql`) + +## Establishing connections + +The recommended way to establish a connection is this: + +```js +var mysql = require('mysql'); +var connection = mysql.createConnection({ + host : 'example.org', + user : 'bob', + password : 'secret' +}); + +connection.connect(function(err) { + if (err) { + console.error('error connecting: ' + err.stack); + return; + } + + console.log('connected as id ' + connection.threadId); +}); +``` + +However, a connection can also be implicitly established by invoking a query: + +```js +var mysql = require('mysql'); +var connection = mysql.createConnection(...); + +connection.query('SELECT 1', function (error, results, fields) { + if (error) throw error; + // connected! +}); +``` + +Depending on how you like to handle your errors, either method may be +appropriate. Any type of connection error (handshake or network) is considered +a fatal error, see the [Error Handling](#error-handling) section for more +information. + +## Connection options + +When establishing a connection, you can set the following options: + +* `host`: The hostname of the database you are connecting to. (Default: + `localhost`) +* `port`: The port number to connect to. (Default: `3306`) +* `localAddress`: The source IP address to use for TCP connection. (Optional) +* `socketPath`: The path to a unix domain socket to connect to. When used `host` + and `port` are ignored. +* `user`: The MySQL user to authenticate as. +* `password`: The password of that MySQL user. +* `database`: Name of the database to use for this connection (Optional). +* `charset`: The charset for the connection. This is called "collation" in the SQL-level + of MySQL (like `utf8_general_ci`). If a SQL-level charset is specified (like `utf8mb4`) + then the default collation for that charset is used. (Default: `'UTF8_GENERAL_CI'`) +* `timezone`: The timezone configured on the MySQL server. This is used to type cast server date/time values to JavaScript `Date` object and vice versa. This can be `'local'`, `'Z'`, or an offset in the form `+HH:MM` or `-HH:MM`. (Default: `'local'`) +* `connectTimeout`: The milliseconds before a timeout occurs during the initial connection + to the MySQL server. (Default: `10000`) +* `stringifyObjects`: Stringify objects instead of converting to values. See +issue [#501](https://github.com/mysqljs/mysql/issues/501). (Default: `false`) +* `insecureAuth`: Allow connecting to MySQL instances that ask for the old + (insecure) authentication method. (Default: `false`) +* `typeCast`: Determines if column values should be converted to native + JavaScript types. (Default: `true`) +* `queryFormat`: A custom query format function. See [Custom format](#custom-format). +* `supportBigNumbers`: When dealing with big numbers (BIGINT and DECIMAL columns) in the database, + you should enable this option (Default: `false`). +* `bigNumberStrings`: Enabling both `supportBigNumbers` and `bigNumberStrings` forces big numbers + (BIGINT and DECIMAL columns) to be always returned as JavaScript String objects (Default: `false`). + Enabling `supportBigNumbers` but leaving `bigNumberStrings` disabled will return big numbers as String + objects only when they cannot be accurately represented with [JavaScript Number objects] (http://ecma262-5.com/ELS5_HTML.htm#Section_8.5) + (which happens when they exceed the [-2^53, +2^53] range), otherwise they will be returned as + Number objects. This option is ignored if `supportBigNumbers` is disabled. +* `dateStrings`: Force date types (TIMESTAMP, DATETIME, DATE) to be returned as strings rather than + inflated into JavaScript Date objects. Can be `true`/`false` or an array of type names to keep as + strings. (Default: `false`) +* `debug`: Prints protocol details to stdout. Can be `true`/`false` or an array of packet type names + that should be printed. (Default: `false`) +* `trace`: Generates stack traces on `Error` to include call site of library + entrance ("long stack traces"). Slight performance penalty for most calls. + (Default: `true`) +* `localInfile`: Allow `LOAD DATA INFILE` to use the `LOCAL` modifier. (Default: `true`) +* `multipleStatements`: Allow multiple mysql statements per query. Be careful + with this, it could increase the scope of SQL injection attacks. (Default: `false`) +* `flags`: List of connection flags to use other than the default ones. It is + also possible to blacklist default ones. For more information, check + [Connection Flags](#connection-flags). +* `ssl`: object with ssl parameters or a string containing name of ssl profile. See [SSL options](#ssl-options). + + +In addition to passing these options as an object, you can also use a url +string. For example: + +```js +var connection = mysql.createConnection('mysql://user:pass@host/db?debug=true&charset=BIG5_CHINESE_CI&timezone=-0700'); +``` + +Note: The query values are first attempted to be parsed as JSON, and if that +fails assumed to be plaintext strings. + +### SSL options + +The `ssl` option in the connection options takes a string or an object. When given a string, +it uses one of the predefined SSL profiles included. The following profiles are included: + +* `"Amazon RDS"`: this profile is for connecting to an Amazon RDS server and contains the + certificates from https://rds.amazonaws.com/doc/rds-ssl-ca-cert.pem and + https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem + +When connecting to other servers, you will need to provide an object of options, in the +same format as [tls.createSecureContext](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options). +Please note the arguments expect a string of the certificate, not a file name to the +certificate. Here is a simple example: + +```js +var connection = mysql.createConnection({ + host : 'localhost', + ssl : { + ca : fs.readFileSync(__dirname + '/mysql-ca.crt') + } +}); +``` + +You can also connect to a MySQL server without properly providing the appropriate +CA to trust. _You should not do this_. + +```js +var connection = mysql.createConnection({ + host : 'localhost', + ssl : { + // DO NOT DO THIS + // set up your ca correctly to trust the connection + rejectUnauthorized: false + } +}); +``` + +### Connection flags + +If, for any reason, you would like to change the default connection flags, you +can use the connection option `flags`. Pass a string with a comma separated list +of items to add to the default flags. If you don't want a default flag to be used +prepend the flag with a minus sign. To add a flag that is not in the default list, +just write the flag name, or prefix it with a plus (case insensitive). + +```js +var connection = mysql.createConnection({ + // disable FOUND_ROWS flag, enable IGNORE_SPACE flag + flags: '-FOUND_ROWS,IGNORE_SPACE' +}); +``` + +The following flags are available: + +- `COMPRESS` - Enable protocol compression. This feature is not currently supported + by the Node.js implementation so cannot be turned on. (Default off) +- `CONNECT_WITH_DB` - Ability to specify the database on connection. (Default on) +- `FOUND_ROWS` - Send the found rows instead of the affected rows as `affectedRows`. + (Default on) +- `IGNORE_SIGPIPE` - Don't issue SIGPIPE if network failures. This flag has no effect + on this Node.js implementation. (Default on) +- `IGNORE_SPACE` - Let the parser ignore spaces before the `(` in queries. (Default on) +- `INTERACTIVE` - Indicates to the MySQL server this is an "interactive" client. This + will use the interactive timeouts on the MySQL server and report as interactive in + the process list. (Default off) +- `LOCAL_FILES` - Can use `LOAD DATA LOCAL`. This flag is controlled by the connection + option `localInfile`. (Default on) +- `LONG_FLAG` - Longer flags in Protocol::ColumnDefinition320. (Default on) +- `LONG_PASSWORD` - Use the improved version of Old Password Authentication. + (Default on) +- `MULTI_RESULTS` - Can handle multiple resultsets for queries. (Default on) +- `MULTI_STATEMENTS` - The client may send multiple statement per query or + statement prepare (separated by `;`). This flag is controlled by the connection + option `multipleStatements`. (Default off) +- `NO_SCHEMA` +- `ODBC` Special handling of ODBC behaviour. This flag has no effect on this Node.js + implementation. (Default on) +- `PLUGIN_AUTH` - Uses the plugin authentication mechanism when connecting to the + MySQL server. This feature is not currently supported by the Node.js implementation + so cannot be turned on. (Default off) +- `PROTOCOL_41` - Uses the 4.1 protocol. (Default on) +- `PS_MULTI_RESULTS` - Can handle multiple resultsets for execute. (Default on) +- `REMEMBER_OPTIONS` - This is specific to the C client, and has no effect on this + Node.js implementation. (Default off) +- `RESERVED` - Old flag for the 4.1 protocol. (Default on) +- `SECURE_CONNECTION` - Support native 4.1 authentication. (Default on) +- `SSL` - Use SSL after handshake to encrypt data in transport. This feature is + controlled though the `ssl` connection option, so the flag has no effect. + (Default off) +- `SSL_VERIFY_SERVER_CERT` - Verify the server certificate during SSL set up. This + feature is controlled though the `ssl.rejectUnauthorized` connection option, so + the flag has no effect. (Default off) +- `TRANSACTIONS` - Asks for the transaction status flags. (Default on) + +## Terminating connections + +There are two ways to end a connection. Terminating a connection gracefully is +done by calling the `end()` method: + +```js +connection.end(function(err) { + // The connection is terminated now +}); +``` + +This will make sure all previously enqueued queries are still before sending a +`COM_QUIT` packet to the MySQL server. If a fatal error occurs before the +`COM_QUIT` packet can be sent, an `err` argument will be provided to the +callback, but the connection will be terminated regardless of that. + +An alternative way to end the connection is to call the `destroy()` method. +This will cause an immediate termination of the underlying socket. +Additionally `destroy()` guarantees that no more events or callbacks will be +triggered for the connection. + +```js +connection.destroy(); +``` + +Unlike `end()` the `destroy()` method does not take a callback argument. + +## Pooling connections + +Rather than creating and managing connections one-by-one, this module also +provides built-in connection pooling using `mysql.createPool(config)`. +[Read more about connection pooling](https://en.wikipedia.org/wiki/Connection_pool). + +Create a pool and use it directly: + +```js +var mysql = require('mysql'); +var pool = mysql.createPool({ + connectionLimit : 10, + host : 'example.org', + user : 'bob', + password : 'secret', + database : 'my_db' +}); + +pool.query('SELECT 1 + 1 AS solution', function (error, results, fields) { + if (error) throw error; + console.log('The solution is: ', results[0].solution); +}); +``` + +This is a shortcut for the `pool.getConnection()` -> `connection.query()` -> +`connection.release()` code flow. Using `pool.getConnection()` is useful to +share connection state for subsequent queries. This is because two calls to +`pool.query()` may use two different connections and run in parallel. This is +the basic structure: + +```js +var mysql = require('mysql'); +var pool = mysql.createPool(...); + +pool.getConnection(function(err, connection) { + if (err) throw err; // not connected! + + // Use the connection + connection.query('SELECT something FROM sometable', function (error, results, fields) { + // When done with the connection, release it. + connection.release(); + + // Handle error after the release. + if (error) throw error; + + // Don't use the connection here, it has been returned to the pool. + }); +}); +``` + +If you would like to close the connection and remove it from the pool, use +`connection.destroy()` instead. The pool will create a new connection the next +time one is needed. + +Connections are lazily created by the pool. If you configure the pool to allow +up to 100 connections, but only ever use 5 simultaneously, only 5 connections +will be made. Connections are also cycled round-robin style, with connections +being taken from the top of the pool and returning to the bottom. + +When a previous connection is retrieved from the pool, a ping packet is sent +to the server to check if the connection is still good. + +## Pool options + +Pools accept all the same [options as a connection](#connection-options). +When creating a new connection, the options are simply passed to the connection +constructor. In addition to those options pools accept a few extras: + +* `acquireTimeout`: The milliseconds before a timeout occurs during the connection + acquisition. This is slightly different from `connectTimeout`, because acquiring + a pool connection does not always involve making a connection. If a connection + request is queued, the time the request spends in the queue does not count + towards this timeout. (Default: `10000`) +* `waitForConnections`: Determines the pool's action when no connections are + available and the limit has been reached. If `true`, the pool will queue the + connection request and call it when one becomes available. If `false`, the + pool will immediately call back with an error. (Default: `true`) +* `connectionLimit`: The maximum number of connections to create at once. + (Default: `10`) +* `queueLimit`: The maximum number of connection requests the pool will queue + before returning an error from `getConnection`. If set to `0`, there is no + limit to the number of queued connection requests. (Default: `0`) + +## Pool events + +### acquire + +The pool will emit an `acquire` event when a connection is acquired from the pool. +This is called after all acquiring activity has been performed on the connection, +right before the connection is handed to the callback of the acquiring code. + +```js +pool.on('acquire', function (connection) { + console.log('Connection %d acquired', connection.threadId); +}); +``` + +### connection + +The pool will emit a `connection` event when a new connection is made within the pool. +If you need to set session variables on the connection before it gets used, you can +listen to the `connection` event. + +```js +pool.on('connection', function (connection) { + connection.query('SET SESSION auto_increment_increment=1') +}); +``` + +### enqueue + +The pool will emit an `enqueue` event when a callback has been queued to wait for +an available connection. + +```js +pool.on('enqueue', function () { + console.log('Waiting for available connection slot'); +}); +``` + +### release + +The pool will emit a `release` event when a connection is released back to the +pool. This is called after all release activity has been performed on the connection, +so the connection will be listed as free at the time of the event. + +```js +pool.on('release', function (connection) { + console.log('Connection %d released', connection.threadId); +}); +``` + +## Closing all the connections in a pool + +When you are done using the pool, you have to end all the connections or the +Node.js event loop will stay active until the connections are closed by the +MySQL server. This is typically done if the pool is used in a script or when +trying to gracefully shutdown a server. To end all the connections in the +pool, use the `end` method on the pool: + +```js +pool.end(function (err) { + // all connections in the pool have ended +}); +``` + +The `end` method takes an _optional_ callback that you can use to know when +all the connections are ended. + +**Once `pool.end` is called, `pool.getConnection` and other operations +can no longer be performed.** Wait until all connections in the pool are +released before calling `pool.end`. If you use the shortcut method +`pool.query`, in place of `pool.getConnection` → `connection.query` → +`connection.release`, wait until it completes. + +`pool.end` calls `connection.end` on every active connection in the pool. +This queues a `QUIT` packet on the connection and sets a flag to prevent +`pool.getConnection` from creating new connections. All commands / queries +already in progress will complete, but new commands won't execute. + +## PoolCluster + +PoolCluster provides multiple hosts connection. (group & retry & selector) + +```js +// create +var poolCluster = mysql.createPoolCluster(); + +// add configurations (the config is a pool config object) +poolCluster.add(config); // add configuration with automatic name +poolCluster.add('MASTER', masterConfig); // add a named configuration +poolCluster.add('SLAVE1', slave1Config); +poolCluster.add('SLAVE2', slave2Config); + +// remove configurations +poolCluster.remove('SLAVE2'); // By nodeId +poolCluster.remove('SLAVE*'); // By target group : SLAVE1-2 + +// Target Group : ALL(anonymous, MASTER, SLAVE1-2), Selector : round-robin(default) +poolCluster.getConnection(function (err, connection) {}); + +// Target Group : MASTER, Selector : round-robin +poolCluster.getConnection('MASTER', function (err, connection) {}); + +// Target Group : SLAVE1-2, Selector : order +// If can't connect to SLAVE1, return SLAVE2. (remove SLAVE1 in the cluster) +poolCluster.on('remove', function (nodeId) { + console.log('REMOVED NODE : ' + nodeId); // nodeId = SLAVE1 +}); + +// A pattern can be passed with * as wildcard +poolCluster.getConnection('SLAVE*', 'ORDER', function (err, connection) {}); + +// The pattern can also be a regular expression +poolCluster.getConnection(/^SLAVE[12]$/, function (err, connection) {}); + +// of namespace : of(pattern, selector) +poolCluster.of('*').getConnection(function (err, connection) {}); + +var pool = poolCluster.of('SLAVE*', 'RANDOM'); +pool.getConnection(function (err, connection) {}); +pool.getConnection(function (err, connection) {}); +pool.query(function (error, results, fields) {}); + +// close all connections +poolCluster.end(function (err) { + // all connections in the pool cluster have ended +}); +``` + +### PoolCluster options + +* `canRetry`: If `true`, `PoolCluster` will attempt to reconnect when connection fails. (Default: `true`) +* `removeNodeErrorCount`: If connection fails, node's `errorCount` increases. + When `errorCount` is greater than `removeNodeErrorCount`, remove a node in the `PoolCluster`. (Default: `5`) +* `restoreNodeTimeout`: If connection fails, specifies the number of milliseconds + before another connection attempt will be made. If set to `0`, then node will be + removed instead and never re-used. (Default: `0`) +* `defaultSelector`: The default selector. (Default: `RR`) + * `RR`: Select one alternately. (Round-Robin) + * `RANDOM`: Select the node by random function. + * `ORDER`: Select the first node available unconditionally. + +```js +var clusterConfig = { + removeNodeErrorCount: 1, // Remove the node immediately when connection fails. + defaultSelector: 'ORDER' +}; + +var poolCluster = mysql.createPoolCluster(clusterConfig); +``` + +## Switching users and altering connection state + +MySQL offers a changeUser command that allows you to alter the current user and +other aspects of the connection without shutting down the underlying socket: + +```js +connection.changeUser({user : 'john'}, function(err) { + if (err) throw err; +}); +``` + +The available options for this feature are: + +* `user`: The name of the new user (defaults to the previous one). +* `password`: The password of the new user (defaults to the previous one). +* `charset`: The new charset (defaults to the previous one). +* `database`: The new database (defaults to the previous one). + +A sometimes useful side effect of this functionality is that this function also +resets any connection state (variables, transactions, etc.). + +Errors encountered during this operation are treated as fatal connection errors +by this module. + +## Server disconnects + +You may lose the connection to a MySQL server due to network problems, the +server timing you out, the server being restarted, or crashing. All of these +events are considered fatal errors, and will have the `err.code = +'PROTOCOL_CONNECTION_LOST'`. See the [Error Handling](#error-handling) section +for more information. + +Re-connecting a connection is done by establishing a new connection. Once +terminated, an existing connection object cannot be re-connected by design. + +With Pool, disconnected connections will be removed from the pool freeing up +space for a new connection to be created on the next getConnection call. + +With PoolCluster, disconnected connections will count as errors against the +related node, incrementing the error code for that node. Once there are more than +`removeNodeErrorCount` errors on a given node, it is removed from the cluster. +When this occurs, the PoolCluster may emit a `POOL_NONEONLINE` error if there are +no longer any matching nodes for the pattern. The `restoreNodeTimeout` config can +be set to restore offline nodes after a given timeout. + +## Performing queries + +The most basic way to perform a query is to call the `.query()` method on an object +(like a `Connection`, `Pool`, or `PoolNamespace` instance). + +The simplest form of .`query()` is `.query(sqlString, callback)`, where a SQL string +is the first argument and the second is a callback: + +```js +connection.query('SELECT * FROM `books` WHERE `author` = "David"', function (error, results, fields) { + // error will be an Error if one occurred during the query + // results will contain the results of the query + // fields will contain information about the returned results fields (if any) +}); +``` + +The second form `.query(sqlString, values, callback)` comes when using +placeholder values (see [escaping query values](#escaping-query-values)): + +```js +connection.query('SELECT * FROM `books` WHERE `author` = ?', ['David'], function (error, results, fields) { + // error will be an Error if one occurred during the query + // results will contain the results of the query + // fields will contain information about the returned results fields (if any) +}); +``` + +The third form `.query(options, callback)` comes when using various advanced +options on the query, like [escaping query values](#escaping-query-values), +[joins with overlapping column names](#joins-with-overlapping-column-names), +[timeouts](#timeout), and [type casting](#type-casting). + +```js +connection.query({ + sql: 'SELECT * FROM `books` WHERE `author` = ?', + timeout: 40000, // 40s + values: ['David'] +}, function (error, results, fields) { + // error will be an Error if one occurred during the query + // results will contain the results of the query + // fields will contain information about the returned results fields (if any) +}); +``` + +Note that a combination of the second and third forms can be used where the +placeholder values are passed as an argument and not in the options object. +The `values` argument will override the `values` in the option object. + +```js +connection.query({ + sql: 'SELECT * FROM `books` WHERE `author` = ?', + timeout: 40000, // 40s + }, + ['David'], + function (error, results, fields) { + // error will be an Error if one occurred during the query + // results will contain the results of the query + // fields will contain information about the returned results fields (if any) + } +); +``` + +If the query only has a single replacement character (`?`), and the value is +not `null`, `undefined`, or an array, it can be passed directly as the second +argument to `.query`: + +```js +connection.query( + 'SELECT * FROM `books` WHERE `author` = ?', + 'David', + function (error, results, fields) { + // error will be an Error if one occurred during the query + // results will contain the results of the query + // fields will contain information about the returned results fields (if any) + } +); +``` + +## Escaping query values + +**Caution** These methods of escaping values only works when the +[NO_BACKSLASH_ESCAPES](https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sqlmode_no_backslash_escapes) +SQL mode is disabled (which is the default state for MySQL servers). + +In order to avoid SQL Injection attacks, you should always escape any user +provided data before using it inside a SQL query. You can do so using the +`mysql.escape()`, `connection.escape()` or `pool.escape()` methods: + +```js +var userId = 'some user provided value'; +var sql = 'SELECT * FROM users WHERE id = ' + connection.escape(userId); +connection.query(sql, function (error, results, fields) { + if (error) throw error; + // ... +}); +``` + +Alternatively, you can use `?` characters as placeholders for values you would +like to have escaped like this: + +```js +connection.query('SELECT * FROM users WHERE id = ?', [userId], function (error, results, fields) { + if (error) throw error; + // ... +}); +``` + +Multiple placeholders are mapped to values in the same order as passed. For example, +in the following query `foo` equals `a`, `bar` equals `b`, `baz` equals `c`, and +`id` will be `userId`: + +```js +connection.query('UPDATE users SET foo = ?, bar = ?, baz = ? WHERE id = ?', ['a', 'b', 'c', userId], function (error, results, fields) { + if (error) throw error; + // ... +}); +``` + +This looks similar to prepared statements in MySQL, however it really just uses +the same `connection.escape()` method internally. + +**Caution** This also differs from prepared statements in that all `?` are +replaced, even those contained in comments and strings. + +Different value types are escaped differently, here is how: + +* Numbers are left untouched +* Booleans are converted to `true` / `false` +* Date objects are converted to `'YYYY-mm-dd HH:ii:ss'` strings +* Buffers are converted to hex strings, e.g. `X'0fa5'` +* Strings are safely escaped +* Arrays are turned into list, e.g. `['a', 'b']` turns into `'a', 'b'` +* Nested arrays are turned into grouped lists (for bulk inserts), e.g. `[['a', + 'b'], ['c', 'd']]` turns into `('a', 'b'), ('c', 'd')` +* Objects that have a `toSqlString` method will have `.toSqlString()` called + and the returned value is used as the raw SQL. +* Objects are turned into `key = 'val'` pairs for each enumerable property on + the object. If the property's value is a function, it is skipped; if the + property's value is an object, toString() is called on it and the returned + value is used. +* `undefined` / `null` are converted to `NULL` +* `NaN` / `Infinity` are left as-is. MySQL does not support these, and trying + to insert them as values will trigger MySQL errors until they implement + support. + +This escaping allows you to do neat things like this: + +```js +var post = {id: 1, title: 'Hello MySQL'}; +var query = connection.query('INSERT INTO posts SET ?', post, function (error, results, fields) { + if (error) throw error; + // Neat! +}); +console.log(query.sql); // INSERT INTO posts SET `id` = 1, `title` = 'Hello MySQL' +``` + +And the `toSqlString` method allows you to form complex queries with functions: + +```js +var CURRENT_TIMESTAMP = { toSqlString: function() { return 'CURRENT_TIMESTAMP()'; } }; +var sql = mysql.format('UPDATE posts SET modified = ? WHERE id = ?', [CURRENT_TIMESTAMP, 42]); +console.log(sql); // UPDATE posts SET modified = CURRENT_TIMESTAMP() WHERE id = 42 +``` + +To generate objects with a `toSqlString` method, the `mysql.raw()` method can +be used. This creates an object that will be left un-touched when using in a `?` +placeholder, useful for using functions as dynamic values: + +**Caution** The string provided to `mysql.raw()` will skip all escaping +functions when used, so be careful when passing in unvalidated input. + +```js +var CURRENT_TIMESTAMP = mysql.raw('CURRENT_TIMESTAMP()'); +var sql = mysql.format('UPDATE posts SET modified = ? WHERE id = ?', [CURRENT_TIMESTAMP, 42]); +console.log(sql); // UPDATE posts SET modified = CURRENT_TIMESTAMP() WHERE id = 42 +``` + +If you feel the need to escape queries by yourself, you can also use the escaping +function directly: + +```js +var query = "SELECT * FROM posts WHERE title=" + mysql.escape("Hello MySQL"); + +console.log(query); // SELECT * FROM posts WHERE title='Hello MySQL' +``` + +## Escaping query identifiers + +If you can't trust an SQL identifier (database / table / column name) because it is +provided by a user, you should escape it with `mysql.escapeId(identifier)`, +`connection.escapeId(identifier)` or `pool.escapeId(identifier)` like this: + +```js +var sorter = 'date'; +var sql = 'SELECT * FROM posts ORDER BY ' + connection.escapeId(sorter); +connection.query(sql, function (error, results, fields) { + if (error) throw error; + // ... +}); +``` + +It also supports adding qualified identifiers. It will escape both parts. + +```js +var sorter = 'date'; +var sql = 'SELECT * FROM posts ORDER BY ' + connection.escapeId('posts.' + sorter); +// -> SELECT * FROM posts ORDER BY `posts`.`date` +``` + +If you do not want to treat `.` as qualified identifiers, you can set the second +argument to `true` in order to keep the string as a literal identifier: + +```js +var sorter = 'date.2'; +var sql = 'SELECT * FROM posts ORDER BY ' + connection.escapeId(sorter, true); +// -> SELECT * FROM posts ORDER BY `date.2` +``` + +Alternatively, you can use `??` characters as placeholders for identifiers you would +like to have escaped like this: + +```js +var userId = 1; +var columns = ['username', 'email']; +var query = connection.query('SELECT ?? FROM ?? WHERE id = ?', [columns, 'users', userId], function (error, results, fields) { + if (error) throw error; + // ... +}); + +console.log(query.sql); // SELECT `username`, `email` FROM `users` WHERE id = 1 +``` +**Please note that this last character sequence is experimental and syntax might change** + +When you pass an Object to `.escape()` or `.query()`, `.escapeId()` is used to avoid SQL injection in object keys. + +### Preparing Queries + +You can use mysql.format to prepare a query with multiple insertion points, utilizing the proper escaping for ids and values. A simple example of this follows: + +```js +var sql = "SELECT * FROM ?? WHERE ?? = ?"; +var inserts = ['users', 'id', userId]; +sql = mysql.format(sql, inserts); +``` + +Following this you then have a valid, escaped query that you can then send to the database safely. This is useful if you are looking to prepare the query before actually sending it to the database. As mysql.format is exposed from SqlString.format you also have the option (but are not required) to pass in stringifyObject and timezone, allowing you provide a custom means of turning objects into strings, as well as a location-specific/timezone-aware Date. + +### Custom format + +If you prefer to have another type of query escape format, there's a connection configuration option you can use to define a custom format function. You can access the connection object if you want to use the built-in `.escape()` or any other connection function. + +Here's an example of how to implement another format: + +```js +connection.config.queryFormat = function (query, values) { + if (!values) return query; + return query.replace(/\:(\w+)/g, function (txt, key) { + if (values.hasOwnProperty(key)) { + return this.escape(values[key]); + } + return txt; + }.bind(this)); +}; + +connection.query("UPDATE posts SET title = :title", { title: "Hello MySQL" }); +``` + +## Getting the id of an inserted row + +If you are inserting a row into a table with an auto increment primary key, you +can retrieve the insert id like this: + +```js +connection.query('INSERT INTO posts SET ?', {title: 'test'}, function (error, results, fields) { + if (error) throw error; + console.log(results.insertId); +}); +``` + +When dealing with big numbers (above JavaScript Number precision limit), you should +consider enabling `supportBigNumbers` option to be able to read the insert id as a +string, otherwise it will throw an error. + +This option is also required when fetching big numbers from the database, otherwise +you will get values rounded to hundreds or thousands due to the precision limit. + +## Getting the number of affected rows + +You can get the number of affected rows from an insert, update or delete statement. + +```js +connection.query('DELETE FROM posts WHERE title = "wrong"', function (error, results, fields) { + if (error) throw error; + console.log('deleted ' + results.affectedRows + ' rows'); +}) +``` + +## Getting the number of changed rows + +You can get the number of changed rows from an update statement. + +"changedRows" differs from "affectedRows" in that it does not count updated rows +whose values were not changed. + +```js +connection.query('UPDATE posts SET ...', function (error, results, fields) { + if (error) throw error; + console.log('changed ' + results.changedRows + ' rows'); +}) +``` + +## Getting the connection ID + +You can get the MySQL connection ID ("thread ID") of a given connection using the `threadId` +property. + +```js +connection.connect(function(err) { + if (err) throw err; + console.log('connected as id ' + connection.threadId); +}); +``` + +## Executing queries in parallel + +The MySQL protocol is sequential, this means that you need multiple connections +to execute queries in parallel. You can use a Pool to manage connections, one +simple approach is to create one connection per incoming http request. + +## Streaming query rows + +Sometimes you may want to select large quantities of rows and process each of +them as they are received. This can be done like this: + +```js +var query = connection.query('SELECT * FROM posts'); +query + .on('error', function(err) { + // Handle error, an 'end' event will be emitted after this as well + }) + .on('fields', function(fields) { + // the field packets for the rows to follow + }) + .on('result', function(row) { + // Pausing the connnection is useful if your processing involves I/O + connection.pause(); + + processRow(row, function() { + connection.resume(); + }); + }) + .on('end', function() { + // all rows have been received + }); +``` + +Please note a few things about the example above: + +* Usually you will want to receive a certain amount of rows before starting to + throttle the connection using `pause()`. This number will depend on the + amount and size of your rows. +* `pause()` / `resume()` operate on the underlying socket and parser. You are + guaranteed that no more `'result'` events will fire after calling `pause()`. +* You MUST NOT provide a callback to the `query()` method when streaming rows. +* The `'result'` event will fire for both rows as well as OK packets + confirming the success of a INSERT/UPDATE query. +* It is very important not to leave the result paused too long, or you may + encounter `Error: Connection lost: The server closed the connection.` + The time limit for this is determined by the + [net_write_timeout setting](https://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_net_write_timeout) + on your MySQL server. + +Additionally you may be interested to know that it is currently not possible to +stream individual row columns, they will always be buffered up entirely. If you +have a good use case for streaming large fields to and from MySQL, I'd love to +get your thoughts and contributions on this. + +### Piping results with Streams + +The query object provides a convenience method `.stream([options])` that wraps +query events into a [Readable Stream](http://nodejs.org/api/stream.html#stream_class_stream_readable) +object. This stream can easily be piped downstream and provides automatic +pause/resume, based on downstream congestion and the optional `highWaterMark`. +The `objectMode` parameter of the stream is set to `true` and cannot be changed +(if you need a byte stream, you will need to use a transform stream, like +[objstream](https://www.npmjs.com/package/objstream) for example). + +For example, piping query results into another stream (with a max buffer of 5 +objects) is simply: + +```js +connection.query('SELECT * FROM posts') + .stream({highWaterMark: 5}) + .pipe(...); +``` + +## Multiple statement queries + +Support for multiple statements is disabled for security reasons (it allows for +SQL injection attacks if values are not properly escaped). To use this feature +you have to enable it for your connection: + +```js +var connection = mysql.createConnection({multipleStatements: true}); +``` + +Once enabled, you can execute multiple statement queries like any other query: + +```js +connection.query('SELECT 1; SELECT 2', function (error, results, fields) { + if (error) throw error; + // `results` is an array with one element for every statement in the query: + console.log(results[0]); // [{1: 1}] + console.log(results[1]); // [{2: 2}] +}); +``` + +Additionally you can also stream the results of multiple statement queries: + +```js +var query = connection.query('SELECT 1; SELECT 2'); + +query + .on('fields', function(fields, index) { + // the fields for the result rows that follow + }) + .on('result', function(row, index) { + // index refers to the statement this result belongs to (starts at 0) + }); +``` + +If one of the statements in your query causes an error, the resulting Error +object contains a `err.index` property which tells you which statement caused +it. MySQL will also stop executing any remaining statements when an error +occurs. + +Please note that the interface for streaming multiple statement queries is +experimental and I am looking forward to feedback on it. + +## Stored procedures + +You can call stored procedures from your queries as with any other mysql driver. +If the stored procedure produces several result sets, they are exposed to you +the same way as the results for multiple statement queries. + +## Joins with overlapping column names + +When executing joins, you are likely to get result sets with overlapping column +names. + +By default, node-mysql will overwrite colliding column names in the +order the columns are received from MySQL, causing some of the received values +to be unavailable. + +However, you can also specify that you want your columns to be nested below +the table name like this: + +```js +var options = {sql: '...', nestTables: true}; +connection.query(options, function (error, results, fields) { + if (error) throw error; + /* results will be an array like this now: + [{ + table1: { + fieldA: '...', + fieldB: '...', + }, + table2: { + fieldA: '...', + fieldB: '...', + }, + }, ...] + */ +}); +``` + +Or use a string separator to have your results merged. + +```js +var options = {sql: '...', nestTables: '_'}; +connection.query(options, function (error, results, fields) { + if (error) throw error; + /* results will be an array like this now: + [{ + table1_fieldA: '...', + table1_fieldB: '...', + table2_fieldA: '...', + table2_fieldB: '...', + }, ...] + */ +}); +``` + +## Transactions + +Simple transaction support is available at the connection level: + +```js +connection.beginTransaction(function(err) { + if (err) { throw err; } + connection.query('INSERT INTO posts SET title=?', title, function (error, results, fields) { + if (error) { + return connection.rollback(function() { + throw error; + }); + } + + var log = 'Post ' + results.insertId + ' added'; + + connection.query('INSERT INTO log SET data=?', log, function (error, results, fields) { + if (error) { + return connection.rollback(function() { + throw error; + }); + } + connection.commit(function(err) { + if (err) { + return connection.rollback(function() { + throw err; + }); + } + console.log('success!'); + }); + }); + }); +}); +``` +Please note that beginTransaction(), commit() and rollback() are simply convenience +functions that execute the START TRANSACTION, COMMIT, and ROLLBACK commands respectively. +It is important to understand that many commands in MySQL can cause an implicit commit, +as described [in the MySQL documentation](http://dev.mysql.com/doc/refman/5.5/en/implicit-commit.html) + +## Ping + +A ping packet can be sent over a connection using the `connection.ping` method. This +method will send a ping packet to the server and when the server responds, the callback +will fire. If an error occurred, the callback will fire with an error argument. + +```js +connection.ping(function (err) { + if (err) throw err; + console.log('Server responded to ping'); +}) +``` + +## Timeouts + +Every operation takes an optional inactivity timeout option. This allows you to +specify appropriate timeouts for operations. It is important to note that these +timeouts are not part of the MySQL protocol, and rather timeout operations through +the client. This means that when a timeout is reached, the connection it occurred +on will be destroyed and no further operations can be performed. + +```js +// Kill query after 60s +connection.query({sql: 'SELECT COUNT(*) AS count FROM big_table', timeout: 60000}, function (error, results, fields) { + if (error && error.code === 'PROTOCOL_SEQUENCE_TIMEOUT') { + throw new Error('too long to count table rows!'); + } + + if (error) { + throw error; + } + + console.log(results[0].count + ' rows'); +}); +``` + +## Error handling + +This module comes with a consistent approach to error handling that you should +review carefully in order to write solid applications. + +Most errors created by this module are instances of the JavaScript [Error][] +object. Additionally they typically come with two extra properties: + +* `err.code`: String, contains the MySQL server error symbol if the error is + a [MySQL server error][] (e.g. `'ER_ACCESS_DENIED_ERROR'`), a Node.js error + code if it is a Node.js error (e.g. `'ECONNREFUSED'`), or an internal error + code (e.g. `'PROTOCOL_CONNECTION_LOST'`). +* `err.errno`: Number, contains the MySQL server error number. Only populated + from [MySQL server error][]. +* `err.fatal`: Boolean, indicating if this error is terminal to the connection + object. If the error is not from a MySQL protocol operation, this property + will not be defined. +* `err.sql`: String, contains the full SQL of the failed query. This can be + useful when using a higher level interface like an ORM that is generating + the queries. +* `err.sqlState`: String, contains the five-character SQLSTATE value. Only populated from [MySQL server error][]. +* `err.sqlMessage`: String, contains the message string that provides a + textual description of the error. Only populated from [MySQL server error][]. + +[Error]: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error +[MySQL server error]: https://dev.mysql.com/doc/refman/5.5/en/server-error-reference.html + +Fatal errors are propagated to *all* pending callbacks. In the example below, a +fatal error is triggered by trying to connect to an invalid port. Therefore the +error object is propagated to both pending callbacks: + +```js +var connection = require('mysql').createConnection({ + port: 84943, // WRONG PORT +}); + +connection.connect(function(err) { + console.log(err.code); // 'ECONNREFUSED' + console.log(err.fatal); // true +}); + +connection.query('SELECT 1', function (error, results, fields) { + console.log(error.code); // 'ECONNREFUSED' + console.log(error.fatal); // true +}); +``` + +Normal errors however are only delegated to the callback they belong to. So in +the example below, only the first callback receives an error, the second query +works as expected: + +```js +connection.query('USE name_of_db_that_does_not_exist', function (error, results, fields) { + console.log(error.code); // 'ER_BAD_DB_ERROR' +}); + +connection.query('SELECT 1', function (error, results, fields) { + console.log(error); // null + console.log(results.length); // 1 +}); +``` + +Last but not least: If a fatal errors occurs and there are no pending +callbacks, or a normal error occurs which has no callback belonging to it, the +error is emitted as an `'error'` event on the connection object. This is +demonstrated in the example below: + +```js +connection.on('error', function(err) { + console.log(err.code); // 'ER_BAD_DB_ERROR' +}); + +connection.query('USE name_of_db_that_does_not_exist'); +``` + +Note: `'error'` events are special in node. If they occur without an attached +listener, a stack trace is printed and your process is killed. + +**tl;dr:** This module does not want you to deal with silent failures. You +should always provide callbacks to your method calls. If you want to ignore +this advice and suppress unhandled errors, you can do this: + +```js +// I am Chuck Norris: +connection.on('error', function() {}); +``` + +## Exception Safety + +This module is exception safe. That means you can continue to use it, even if +one of your callback functions throws an error which you're catching using +'uncaughtException' or a domain. + +## Type casting + +For your convenience, this driver will cast mysql types into native JavaScript +types by default. The following mappings exist: + +### Number + +* TINYINT +* SMALLINT +* INT +* MEDIUMINT +* YEAR +* FLOAT +* DOUBLE + +### Date + +* TIMESTAMP +* DATE +* DATETIME + +### Buffer + +* TINYBLOB +* MEDIUMBLOB +* LONGBLOB +* BLOB +* BINARY +* VARBINARY +* BIT (last byte will be filled with 0 bits as necessary) + +### String + +**Note** text in the binary character set is returned as `Buffer`, rather +than a string. + +* CHAR +* VARCHAR +* TINYTEXT +* MEDIUMTEXT +* LONGTEXT +* TEXT +* ENUM +* SET +* DECIMAL (may exceed float precision) +* BIGINT (may exceed float precision) +* TIME (could be mapped to Date, but what date would be set?) +* GEOMETRY (never used those, get in touch if you do) + +It is not recommended (and may go away / change in the future) to disable type +casting, but you can currently do so on either the connection: + +```js +var connection = require('mysql').createConnection({typeCast: false}); +``` + +Or on the query level: + +```js +var options = {sql: '...', typeCast: false}; +var query = connection.query(options, function (error, results, fields) { + if (error) throw error; + // ... +}); +``` + +### Custom type casting + +You can also pass a function and handle type casting yourself. You're given some +column information like database, table and name and also type and length. If you +just want to apply a custom type casting to a specific type you can do it and then +fallback to the default. + +The function is provided two arguments `field` and `next` and is expected to +return the value for the given field by invoking the parser functions through +the `field` object. + +The `field` argument is a `Field` object and contains data about the field that +need to be parsed. The following are some of the properties on a `Field` object: + + * `db` - a string of the database the field came from. + * `table` - a string of the table the field came from. + * `name` - a string of the field name. + * `type` - a string of the field type in all caps. + * `length` - a number of the field length, as given by the database. + +The `next` argument is a `function` that, when called, will return the default +type conversion for the given field. + +When getting the field data, the following helper methods are present on the +`field` object: + + * `.string()` - parse the field into a string. + * `.buffer()` - parse the field into a `Buffer`. + * `.geometry()` - parse the field as a geometry value. + +The MySQL protocol is a text-based protocol. This means that over the wire, all +field types are represented as a string, which is why only string-like functions +are available on the `field` object. Based on the type information (like `INT`), +the type cast should convert the string field into a different JavaScript type +(like a `number`). + +Here's an example of converting `TINYINT(1)` to boolean: + +```js +connection = mysql.createConnection({ + typeCast: function (field, next) { + if (field.type === 'TINY' && field.length === 1) { + return (field.string() === '1'); // 1 = true, 0 = false + } else { + return next(); + } + } +}); +``` + +__WARNING: YOU MUST INVOKE the parser using one of these three field functions +in your custom typeCast callback. They can only be called once.__ + +## Debugging and reporting problems + +If you are running into problems, one thing that may help is enabling the +`debug` mode for the connection: + +```js +var connection = mysql.createConnection({debug: true}); +``` + +This will print all incoming and outgoing packets on stdout. You can also restrict debugging to +packet types by passing an array of types to debug: + +```js +var connection = mysql.createConnection({debug: ['ComQueryPacket', 'RowDataPacket']}); +``` + +to restrict debugging to the query and data packets. + +If that does not help, feel free to open a GitHub issue. A good GitHub issue +will have: + +* The minimal amount of code required to reproduce the problem (if possible) +* As much debugging output and information about your environment (mysql + version, node version, os, etc.) as you can gather. + +## Security issues + +Security issues should not be first reported through GitHub or another public +forum, but kept private in order for the collaborators to assess the report +and either (a) devise a fix and plan a release date or (b) assert that it is +not a security issue (in which case it can be posted in a public forum, like +a GitHub issue). + +The primary private forum is email, either by emailing the module's author or +opening a GitHub issue simply asking to whom a security issues should be +addressed to without disclosing the issue or type of issue. + +An ideal report would include a clear indication of what the security issue is +and how it would be exploited, ideally with an accompanying proof of concept +("PoC") for collaborators to work against and validate potentional fixes against. + +## Contributing + +This project welcomes contributions from the community. Contributions are +accepted using GitHub pull requests. If you're not familiar with making +GitHub pull requests, please refer to the +[GitHub documentation "Creating a pull request"](https://help.github.com/articles/creating-a-pull-request/). + +For a good pull request, we ask you provide the following: + +1. Try to include a clear description of your pull request in the description. + It should include the basic "what" and "why"s for the request. +2. The tests should pass as best as you can. See the [Running tests](#running-tests) + section on how to run the different tests. GitHub will automatically run + the tests as well, to act as a safety net. +3. The pull request should include tests for the change. A new feature should + have tests for the new feature and bug fixes should include a test that fails + without the corresponding code change and passes after they are applied. + The command `npm run test-cov` will generate a `coverage/` folder that + contains HTML pages of the code coverage, to better understand if everything + you're adding is being tested. +4. If the pull request is a new feature, please be sure to include all + appropriate documentation additions in the `Readme.md` file as well. +5. To help ensure that your code is similar in style to the existing code, + run the command `npm run lint` and fix any displayed issues. + +## Running tests + +The test suite is split into two parts: unit tests and integration tests. +The unit tests run on any machine while the integration tests require a +MySQL server instance to be setup. + +### Running unit tests + +```sh +$ FILTER=unit npm test +``` + +### Running integration tests + +Set the environment variables `MYSQL_DATABASE`, `MYSQL_HOST`, `MYSQL_PORT`, +`MYSQL_USER` and `MYSQL_PASSWORD`. `MYSQL_SOCKET` can also be used in place +of `MYSQL_HOST` and `MYSQL_PORT` to connect over a UNIX socket. Then run +`npm test`. + +For example, if you have an installation of mysql running on localhost:3306 +and no password set for the `root` user, run: + +```sh +$ mysql -u root -e "CREATE DATABASE IF NOT EXISTS node_mysql_test" +$ MYSQL_HOST=localhost MYSQL_PORT=3306 MYSQL_DATABASE=node_mysql_test MYSQL_USER=root MYSQL_PASSWORD= FILTER=integration npm test +``` + +## Todo + +* Prepared statements +* Support for encodings other than UTF-8 / ASCII + +[appveyor-image]: https://badgen.net/appveyor/ci/dougwilson/node-mysql/master?label=windows +[appveyor-url]: https://ci.appveyor.com/project/dougwilson/node-mysql +[coveralls-image]: https://badgen.net/coveralls/c/github/mysqljs/mysql/master +[coveralls-url]: https://coveralls.io/r/mysqljs/mysql?branch=master +[node-image]: https://badgen.net/npm/node/mysql +[node-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/mysql +[npm-url]: https://npmjs.org/package/mysql +[npm-version-image]: https://badgen.net/npm/v/mysql +[travis-image]: https://badgen.net/travis/mysqljs/mysql/master +[travis-url]: https://travis-ci.org/mysqljs/mysql diff --git a/node_modules/mysql/index.js b/node_modules/mysql/index.js new file mode 100644 index 0000000..7262407 --- /dev/null +++ b/node_modules/mysql/index.js @@ -0,0 +1,161 @@ +var Classes = Object.create(null); + +/** + * Create a new Connection instance. + * @param {object|string} config Configuration or connection string for new MySQL connection + * @return {Connection} A new MySQL connection + * @public + */ +exports.createConnection = function createConnection(config) { + var Connection = loadClass('Connection'); + var ConnectionConfig = loadClass('ConnectionConfig'); + + return new Connection({config: new ConnectionConfig(config)}); +}; + +/** + * Create a new Pool instance. + * @param {object|string} config Configuration or connection string for new MySQL connections + * @return {Pool} A new MySQL pool + * @public + */ +exports.createPool = function createPool(config) { + var Pool = loadClass('Pool'); + var PoolConfig = loadClass('PoolConfig'); + + return new Pool({config: new PoolConfig(config)}); +}; + +/** + * Create a new PoolCluster instance. + * @param {object} [config] Configuration for pool cluster + * @return {PoolCluster} New MySQL pool cluster + * @public + */ +exports.createPoolCluster = function createPoolCluster(config) { + var PoolCluster = loadClass('PoolCluster'); + + return new PoolCluster(config); +}; + +/** + * Create a new Query instance. + * @param {string} sql The SQL for the query + * @param {array} [values] Any values to insert into placeholders in sql + * @param {function} [callback] The callback to use when query is complete + * @return {Query} New query object + * @public + */ +exports.createQuery = function createQuery(sql, values, callback) { + var Connection = loadClass('Connection'); + + return Connection.createQuery(sql, values, callback); +}; + +/** + * Escape a value for SQL. + * @param {*} value The value to escape + * @param {boolean} [stringifyObjects=false] Setting if objects should be stringified + * @param {string} [timeZone=local] Setting for time zone to use for Date conversion + * @return {string} Escaped string value + * @public + */ +exports.escape = function escape(value, stringifyObjects, timeZone) { + var SqlString = loadClass('SqlString'); + + return SqlString.escape(value, stringifyObjects, timeZone); +}; + +/** + * Escape an identifier for SQL. + * @param {*} value The value to escape + * @param {boolean} [forbidQualified=false] Setting to treat '.' as part of identifier + * @return {string} Escaped string value + * @public + */ +exports.escapeId = function escapeId(value, forbidQualified) { + var SqlString = loadClass('SqlString'); + + return SqlString.escapeId(value, forbidQualified); +}; + +/** + * Format SQL and replacement values into a SQL string. + * @param {string} sql The SQL for the query + * @param {array} [values] Any values to insert into placeholders in sql + * @param {boolean} [stringifyObjects=false] Setting if objects should be stringified + * @param {string} [timeZone=local] Setting for time zone to use for Date conversion + * @return {string} Formatted SQL string + * @public + */ +exports.format = function format(sql, values, stringifyObjects, timeZone) { + var SqlString = loadClass('SqlString'); + + return SqlString.format(sql, values, stringifyObjects, timeZone); +}; + +/** + * Wrap raw SQL strings from escape overriding. + * @param {string} sql The raw SQL + * @return {object} Wrapped object + * @public + */ +exports.raw = function raw(sql) { + var SqlString = loadClass('SqlString'); + + return SqlString.raw(sql); +}; + +/** + * The type constants. + * @public + */ +Object.defineProperty(exports, 'Types', { + get: loadClass.bind(null, 'Types') +}); + +/** + * Load the given class. + * @param {string} className Name of class to default + * @return {function|object} Class constructor or exports + * @private + */ +function loadClass(className) { + var Class = Classes[className]; + + if (Class !== undefined) { + return Class; + } + + // This uses a switch for static require analysis + switch (className) { + case 'Connection': + Class = require('./lib/Connection'); + break; + case 'ConnectionConfig': + Class = require('./lib/ConnectionConfig'); + break; + case 'Pool': + Class = require('./lib/Pool'); + break; + case 'PoolCluster': + Class = require('./lib/PoolCluster'); + break; + case 'PoolConfig': + Class = require('./lib/PoolConfig'); + break; + case 'SqlString': + Class = require('./lib/protocol/SqlString'); + break; + case 'Types': + Class = require('./lib/protocol/constants/types'); + break; + default: + throw new Error('Cannot find class \'' + className + '\''); + } + + // Store to prevent invoking require() + Classes[className] = Class; + + return Class; +} diff --git a/node_modules/mysql/lib/Connection.js b/node_modules/mysql/lib/Connection.js new file mode 100644 index 0000000..6802255 --- /dev/null +++ b/node_modules/mysql/lib/Connection.js @@ -0,0 +1,529 @@ +var Crypto = require('crypto'); +var Events = require('events'); +var Net = require('net'); +var tls = require('tls'); +var ConnectionConfig = require('./ConnectionConfig'); +var Protocol = require('./protocol/Protocol'); +var SqlString = require('./protocol/SqlString'); +var Query = require('./protocol/sequences/Query'); +var Util = require('util'); + +module.exports = Connection; +Util.inherits(Connection, Events.EventEmitter); +function Connection(options) { + Events.EventEmitter.call(this); + + this.config = options.config; + + this._socket = options.socket; + this._protocol = new Protocol({config: this.config, connection: this}); + this._connectCalled = false; + this.state = 'disconnected'; + this.threadId = null; +} + +Connection.createQuery = function createQuery(sql, values, callback) { + if (sql instanceof Query) { + return sql; + } + + var cb = callback; + var options = {}; + + if (typeof sql === 'function') { + cb = sql; + } else if (typeof sql === 'object') { + options = Object.create(sql); + + if (typeof values === 'function') { + cb = values; + } else if (values !== undefined) { + Object.defineProperty(options, 'values', { value: values }); + } + } else { + options.sql = sql; + + if (typeof values === 'function') { + cb = values; + } else if (values !== undefined) { + options.values = values; + } + } + + if (cb !== undefined) { + cb = wrapCallbackInDomain(null, cb); + + if (cb === undefined) { + throw new TypeError('argument callback must be a function when provided'); + } + } + + return new Query(options, cb); +}; + +Connection.prototype.connect = function connect(options, callback) { + if (!callback && typeof options === 'function') { + callback = options; + options = {}; + } + + if (!this._connectCalled) { + this._connectCalled = true; + + // Connect either via a UNIX domain socket or a TCP socket. + this._socket = (this.config.socketPath) + ? Net.createConnection(this.config.socketPath) + : Net.createConnection(this.config.port, this.config.host); + + // Connect socket to connection domain + if (Events.usingDomains) { + this._socket.domain = this.domain; + } + + var connection = this; + this._protocol.on('data', function(data) { + connection._socket.write(data); + }); + this._socket.on('data', wrapToDomain(connection, function (data) { + connection._protocol.write(data); + })); + this._protocol.on('end', function() { + connection._socket.end(); + }); + this._socket.on('end', wrapToDomain(connection, function () { + connection._protocol.end(); + })); + + this._socket.on('error', this._handleNetworkError.bind(this)); + this._socket.on('connect', this._handleProtocolConnect.bind(this)); + this._protocol.on('handshake', this._handleProtocolHandshake.bind(this)); + this._protocol.on('initialize', this._handleProtocolInitialize.bind(this)); + this._protocol.on('unhandledError', this._handleProtocolError.bind(this)); + this._protocol.on('drain', this._handleProtocolDrain.bind(this)); + this._protocol.on('end', this._handleProtocolEnd.bind(this)); + this._protocol.on('enqueue', this._handleProtocolEnqueue.bind(this)); + + if (this.config.connectTimeout) { + var handleConnectTimeout = this._handleConnectTimeout.bind(this); + + this._socket.setTimeout(this.config.connectTimeout, handleConnectTimeout); + this._socket.once('connect', function() { + this.setTimeout(0, handleConnectTimeout); + }); + } + } + + this._protocol.handshake(options, wrapCallbackInDomain(this, callback)); +}; + +Connection.prototype.changeUser = function changeUser(options, callback) { + if (!callback && typeof options === 'function') { + callback = options; + options = {}; + } + + this._implyConnect(); + + var charsetNumber = (options.charset) + ? ConnectionConfig.getCharsetNumber(options.charset) + : this.config.charsetNumber; + + return this._protocol.changeUser({ + user : options.user || this.config.user, + password : options.password || this.config.password, + database : options.database || this.config.database, + timeout : options.timeout, + charsetNumber : charsetNumber, + currentConfig : this.config + }, wrapCallbackInDomain(this, callback)); +}; + +Connection.prototype.beginTransaction = function beginTransaction(options, callback) { + if (!callback && typeof options === 'function') { + callback = options; + options = {}; + } + + options = options || {}; + options.sql = 'START TRANSACTION'; + options.values = null; + + return this.query(options, callback); +}; + +Connection.prototype.commit = function commit(options, callback) { + if (!callback && typeof options === 'function') { + callback = options; + options = {}; + } + + options = options || {}; + options.sql = 'COMMIT'; + options.values = null; + + return this.query(options, callback); +}; + +Connection.prototype.rollback = function rollback(options, callback) { + if (!callback && typeof options === 'function') { + callback = options; + options = {}; + } + + options = options || {}; + options.sql = 'ROLLBACK'; + options.values = null; + + return this.query(options, callback); +}; + +Connection.prototype.query = function query(sql, values, cb) { + var query = Connection.createQuery(sql, values, cb); + query._connection = this; + + if (!(typeof sql === 'object' && 'typeCast' in sql)) { + query.typeCast = this.config.typeCast; + } + + if (query.sql) { + query.sql = this.format(query.sql, query.values); + } + + if (query._callback) { + query._callback = wrapCallbackInDomain(this, query._callback); + } + + this._implyConnect(); + + return this._protocol._enqueue(query); +}; + +Connection.prototype.ping = function ping(options, callback) { + if (!callback && typeof options === 'function') { + callback = options; + options = {}; + } + + this._implyConnect(); + this._protocol.ping(options, wrapCallbackInDomain(this, callback)); +}; + +Connection.prototype.statistics = function statistics(options, callback) { + if (!callback && typeof options === 'function') { + callback = options; + options = {}; + } + + this._implyConnect(); + this._protocol.stats(options, wrapCallbackInDomain(this, callback)); +}; + +Connection.prototype.end = function end(options, callback) { + var cb = callback; + var opts = options; + + if (!callback && typeof options === 'function') { + cb = options; + opts = null; + } + + // create custom options reference + opts = Object.create(opts || null); + + if (opts.timeout === undefined) { + // default timeout of 30 seconds + opts.timeout = 30000; + } + + this._implyConnect(); + this._protocol.quit(opts, wrapCallbackInDomain(this, cb)); +}; + +Connection.prototype.destroy = function() { + this.state = 'disconnected'; + this._implyConnect(); + this._socket.destroy(); + this._protocol.destroy(); +}; + +Connection.prototype.pause = function() { + this._socket.pause(); + this._protocol.pause(); +}; + +Connection.prototype.resume = function() { + this._socket.resume(); + this._protocol.resume(); +}; + +Connection.prototype.escape = function(value) { + return SqlString.escape(value, false, this.config.timezone); +}; + +Connection.prototype.escapeId = function escapeId(value) { + return SqlString.escapeId(value, false); +}; + +Connection.prototype.format = function(sql, values) { + if (typeof this.config.queryFormat === 'function') { + return this.config.queryFormat.call(this, sql, values, this.config.timezone); + } + return SqlString.format(sql, values, this.config.stringifyObjects, this.config.timezone); +}; + +if (tls.TLSSocket) { + // 0.11+ environment + Connection.prototype._startTLS = function _startTLS(onSecure) { + var connection = this; + + createSecureContext(this.config, function (err, secureContext) { + if (err) { + onSecure(err); + return; + } + + // "unpipe" + connection._socket.removeAllListeners('data'); + connection._protocol.removeAllListeners('data'); + + // socket <-> encrypted + var rejectUnauthorized = connection.config.ssl.rejectUnauthorized; + var secureEstablished = false; + var secureSocket = new tls.TLSSocket(connection._socket, { + rejectUnauthorized : rejectUnauthorized, + requestCert : true, + secureContext : secureContext, + isServer : false + }); + + // error handler for secure socket + secureSocket.on('_tlsError', function(err) { + if (secureEstablished) { + connection._handleNetworkError(err); + } else { + onSecure(err); + } + }); + + // cleartext <-> protocol + secureSocket.pipe(connection._protocol); + connection._protocol.on('data', function(data) { + secureSocket.write(data); + }); + + secureSocket.on('secure', function() { + secureEstablished = true; + + onSecure(rejectUnauthorized ? this.ssl.verifyError() : null); + }); + + // start TLS communications + secureSocket._start(); + }); + }; +} else { + // pre-0.11 environment + Connection.prototype._startTLS = function _startTLS(onSecure) { + // before TLS: + // _socket <-> _protocol + // after: + // _socket <-> securePair.encrypted <-> securePair.cleartext <-> _protocol + + var connection = this; + var credentials = Crypto.createCredentials({ + ca : this.config.ssl.ca, + cert : this.config.ssl.cert, + ciphers : this.config.ssl.ciphers, + key : this.config.ssl.key, + passphrase : this.config.ssl.passphrase + }); + + var rejectUnauthorized = this.config.ssl.rejectUnauthorized; + var secureEstablished = false; + var securePair = tls.createSecurePair(credentials, false, true, rejectUnauthorized); + + // error handler for secure pair + securePair.on('error', function(err) { + if (secureEstablished) { + connection._handleNetworkError(err); + } else { + onSecure(err); + } + }); + + // "unpipe" + this._socket.removeAllListeners('data'); + this._protocol.removeAllListeners('data'); + + // socket <-> encrypted + securePair.encrypted.pipe(this._socket); + this._socket.on('data', function(data) { + securePair.encrypted.write(data); + }); + + // cleartext <-> protocol + securePair.cleartext.pipe(this._protocol); + this._protocol.on('data', function(data) { + securePair.cleartext.write(data); + }); + + // secure established + securePair.on('secure', function() { + secureEstablished = true; + + if (!rejectUnauthorized) { + onSecure(); + return; + } + + var verifyError = this.ssl.verifyError(); + var err = verifyError; + + // node.js 0.6 support + if (typeof err === 'string') { + err = new Error(verifyError); + err.code = verifyError; + } + + onSecure(err); + }); + + // node.js 0.8 bug + securePair._cycle = securePair.cycle; + securePair.cycle = function cycle() { + if (this.ssl && this.ssl.error) { + this.error(); + } + + return this._cycle.apply(this, arguments); + }; + }; +} + +Connection.prototype._handleConnectTimeout = function() { + if (this._socket) { + this._socket.setTimeout(0); + this._socket.destroy(); + } + + var err = new Error('connect ETIMEDOUT'); + err.errorno = 'ETIMEDOUT'; + err.code = 'ETIMEDOUT'; + err.syscall = 'connect'; + + this._handleNetworkError(err); +}; + +Connection.prototype._handleNetworkError = function(err) { + this._protocol.handleNetworkError(err); +}; + +Connection.prototype._handleProtocolError = function(err) { + this.state = 'protocol_error'; + this.emit('error', err); +}; + +Connection.prototype._handleProtocolDrain = function() { + this.emit('drain'); +}; + +Connection.prototype._handleProtocolConnect = function() { + this.state = 'connected'; + this.emit('connect'); +}; + +Connection.prototype._handleProtocolHandshake = function _handleProtocolHandshake() { + this.state = 'authenticated'; +}; + +Connection.prototype._handleProtocolInitialize = function _handleProtocolInitialize(packet) { + this.threadId = packet.threadId; +}; + +Connection.prototype._handleProtocolEnd = function(err) { + this.state = 'disconnected'; + this.emit('end', err); +}; + +Connection.prototype._handleProtocolEnqueue = function _handleProtocolEnqueue(sequence) { + this.emit('enqueue', sequence); +}; + +Connection.prototype._implyConnect = function() { + if (!this._connectCalled) { + this.connect(); + } +}; + +function createSecureContext (config, cb) { + var context = null; + var error = null; + + try { + context = tls.createSecureContext({ + ca : config.ssl.ca, + cert : config.ssl.cert, + ciphers : config.ssl.ciphers, + key : config.ssl.key, + passphrase : config.ssl.passphrase + }); + } catch (err) { + error = err; + } + + cb(error, context); +} + +function unwrapFromDomain(fn) { + return function () { + var domains = []; + var ret; + + while (process.domain) { + domains.shift(process.domain); + process.domain.exit(); + } + + try { + ret = fn.apply(this, arguments); + } finally { + for (var i = 0; i < domains.length; i++) { + domains[i].enter(); + } + } + + return ret; + }; +} + +function wrapCallbackInDomain(ee, fn) { + if (typeof fn !== 'function') { + return undefined; + } + + if (fn.domain) { + return fn; + } + + var domain = process.domain; + + if (domain) { + return domain.bind(fn); + } else if (ee) { + return unwrapFromDomain(wrapToDomain(ee, fn)); + } else { + return fn; + } +} + +function wrapToDomain(ee, fn) { + return function () { + if (Events.usingDomains && ee.domain) { + ee.domain.enter(); + fn.apply(this, arguments); + ee.domain.exit(); + } else { + fn.apply(this, arguments); + } + }; +} diff --git a/node_modules/mysql/lib/ConnectionConfig.js b/node_modules/mysql/lib/ConnectionConfig.js new file mode 100644 index 0000000..06f4399 --- /dev/null +++ b/node_modules/mysql/lib/ConnectionConfig.js @@ -0,0 +1,209 @@ +var urlParse = require('url').parse; +var ClientConstants = require('./protocol/constants/client'); +var Charsets = require('./protocol/constants/charsets'); +var SSLProfiles = null; + +module.exports = ConnectionConfig; +function ConnectionConfig(options) { + if (typeof options === 'string') { + options = ConnectionConfig.parseUrl(options); + } + + this.host = options.host || 'localhost'; + this.port = options.port || 3306; + this.localAddress = options.localAddress; + this.socketPath = options.socketPath; + this.user = options.user || undefined; + this.password = options.password || undefined; + this.database = options.database; + this.connectTimeout = (options.connectTimeout === undefined) + ? (10 * 1000) + : options.connectTimeout; + this.insecureAuth = options.insecureAuth || false; + this.supportBigNumbers = options.supportBigNumbers || false; + this.bigNumberStrings = options.bigNumberStrings || false; + this.dateStrings = options.dateStrings || false; + this.debug = options.debug; + this.trace = options.trace !== false; + this.stringifyObjects = options.stringifyObjects || false; + this.timezone = options.timezone || 'local'; + this.flags = options.flags || ''; + this.queryFormat = options.queryFormat; + this.pool = options.pool || undefined; + this.ssl = (typeof options.ssl === 'string') + ? ConnectionConfig.getSSLProfile(options.ssl) + : (options.ssl || false); + this.localInfile = (options.localInfile === undefined) + ? true + : options.localInfile; + this.multipleStatements = options.multipleStatements || false; + this.typeCast = (options.typeCast === undefined) + ? true + : options.typeCast; + + if (this.timezone[0] === ' ') { + // "+" is a url encoded char for space so it + // gets translated to space when giving a + // connection string.. + this.timezone = '+' + this.timezone.substr(1); + } + + if (this.ssl) { + // Default rejectUnauthorized to true + this.ssl.rejectUnauthorized = this.ssl.rejectUnauthorized !== false; + } + + this.maxPacketSize = 0; + this.charsetNumber = (options.charset) + ? ConnectionConfig.getCharsetNumber(options.charset) + : options.charsetNumber || Charsets.UTF8_GENERAL_CI; + + // Set the client flags + var defaultFlags = ConnectionConfig.getDefaultFlags(options); + this.clientFlags = ConnectionConfig.mergeFlags(defaultFlags, options.flags); +} + +ConnectionConfig.mergeFlags = function mergeFlags(defaultFlags, userFlags) { + var allFlags = ConnectionConfig.parseFlagList(defaultFlags); + var newFlags = ConnectionConfig.parseFlagList(userFlags); + + // Merge the new flags + for (var flag in newFlags) { + if (allFlags[flag] !== false) { + allFlags[flag] = newFlags[flag]; + } + } + + // Build flags + var flags = 0x0; + for (var flag in allFlags) { + if (allFlags[flag]) { + // TODO: Throw here on some future release + flags |= ClientConstants['CLIENT_' + flag] || 0x0; + } + } + + return flags; +}; + +ConnectionConfig.getCharsetNumber = function getCharsetNumber(charset) { + var num = Charsets[charset.toUpperCase()]; + + if (num === undefined) { + throw new TypeError('Unknown charset \'' + charset + '\''); + } + + return num; +}; + +ConnectionConfig.getDefaultFlags = function getDefaultFlags(options) { + var defaultFlags = [ + '-COMPRESS', // Compression protocol *NOT* supported + '-CONNECT_ATTRS', // Does *NOT* send connection attributes in Protocol::HandshakeResponse41 + '+CONNECT_WITH_DB', // One can specify db on connect in Handshake Response Packet + '+FOUND_ROWS', // Send found rows instead of affected rows + '+IGNORE_SIGPIPE', // Don't issue SIGPIPE if network failures + '+IGNORE_SPACE', // Let the parser ignore spaces before '(' + '+LOCAL_FILES', // Can use LOAD DATA LOCAL + '+LONG_FLAG', // Longer flags in Protocol::ColumnDefinition320 + '+LONG_PASSWORD', // Use the improved version of Old Password Authentication + '+MULTI_RESULTS', // Can handle multiple resultsets for COM_QUERY + '+ODBC', // Special handling of ODBC behaviour + '-PLUGIN_AUTH', // Does *NOT* support auth plugins + '+PROTOCOL_41', // Uses the 4.1 protocol + '+PS_MULTI_RESULTS', // Can handle multiple resultsets for COM_STMT_EXECUTE + '+RESERVED', // Unused + '+SECURE_CONNECTION', // Supports Authentication::Native41 + '+TRANSACTIONS' // Expects status flags + ]; + + if (options && options.localInfile !== undefined && !options.localInfile) { + // Disable LOCAL modifier for LOAD DATA INFILE + defaultFlags.push('-LOCAL_FILES'); + } + + if (options && options.multipleStatements) { + // May send multiple statements per COM_QUERY and COM_STMT_PREPARE + defaultFlags.push('+MULTI_STATEMENTS'); + } + + return defaultFlags; +}; + +ConnectionConfig.getSSLProfile = function getSSLProfile(name) { + if (!SSLProfiles) { + SSLProfiles = require('./protocol/constants/ssl_profiles'); + } + + var ssl = SSLProfiles[name]; + + if (ssl === undefined) { + throw new TypeError('Unknown SSL profile \'' + name + '\''); + } + + return ssl; +}; + +ConnectionConfig.parseFlagList = function parseFlagList(flagList) { + var allFlags = Object.create(null); + + if (!flagList) { + return allFlags; + } + + var flags = !Array.isArray(flagList) + ? String(flagList || '').toUpperCase().split(/\s*,+\s*/) + : flagList; + + for (var i = 0; i < flags.length; i++) { + var flag = flags[i]; + var offset = 1; + var state = flag[0]; + + if (state === undefined) { + // TODO: throw here on some future release + continue; + } + + if (state !== '-' && state !== '+') { + offset = 0; + state = '+'; + } + + allFlags[flag.substr(offset)] = state === '+'; + } + + return allFlags; +}; + +ConnectionConfig.parseUrl = function(url) { + url = urlParse(url, true); + + var options = { + host : url.hostname, + port : url.port, + database : url.pathname.substr(1) + }; + + if (url.auth) { + var auth = url.auth.split(':'); + options.user = auth.shift(); + options.password = auth.join(':'); + } + + if (url.query) { + for (var key in url.query) { + var value = url.query[key]; + + try { + // Try to parse this as a JSON expression first + options[key] = JSON.parse(value); + } catch (err) { + // Otherwise assume it is a plain string + options[key] = value; + } + } + } + + return options; +}; diff --git a/node_modules/mysql/lib/Pool.js b/node_modules/mysql/lib/Pool.js new file mode 100644 index 0000000..87a4011 --- /dev/null +++ b/node_modules/mysql/lib/Pool.js @@ -0,0 +1,294 @@ +var mysql = require('../'); +var Connection = require('./Connection'); +var EventEmitter = require('events').EventEmitter; +var Util = require('util'); +var PoolConnection = require('./PoolConnection'); + +module.exports = Pool; + +Util.inherits(Pool, EventEmitter); +function Pool(options) { + EventEmitter.call(this); + this.config = options.config; + this.config.connectionConfig.pool = this; + + this._acquiringConnections = []; + this._allConnections = []; + this._freeConnections = []; + this._connectionQueue = []; + this._closed = false; +} + +Pool.prototype.getConnection = function (cb) { + + if (this._closed) { + var err = new Error('Pool is closed.'); + err.code = 'POOL_CLOSED'; + process.nextTick(function () { + cb(err); + }); + return; + } + + var connection; + var pool = this; + + if (this._freeConnections.length > 0) { + connection = this._freeConnections.shift(); + this.acquireConnection(connection, cb); + return; + } + + if (this.config.connectionLimit === 0 || this._allConnections.length < this.config.connectionLimit) { + connection = new PoolConnection(this, { config: this.config.newConnectionConfig() }); + + this._acquiringConnections.push(connection); + this._allConnections.push(connection); + + connection.connect({timeout: this.config.acquireTimeout}, function onConnect(err) { + spliceConnection(pool._acquiringConnections, connection); + + if (pool._closed) { + err = new Error('Pool is closed.'); + err.code = 'POOL_CLOSED'; + } + + if (err) { + pool._purgeConnection(connection); + cb(err); + return; + } + + pool.emit('connection', connection); + pool.emit('acquire', connection); + cb(null, connection); + }); + return; + } + + if (!this.config.waitForConnections) { + process.nextTick(function(){ + var err = new Error('No connections available.'); + err.code = 'POOL_CONNLIMIT'; + cb(err); + }); + return; + } + + this._enqueueCallback(cb); +}; + +Pool.prototype.acquireConnection = function acquireConnection(connection, cb) { + if (connection._pool !== this) { + throw new Error('Connection acquired from wrong pool.'); + } + + var changeUser = this._needsChangeUser(connection); + var pool = this; + + this._acquiringConnections.push(connection); + + function onOperationComplete(err) { + spliceConnection(pool._acquiringConnections, connection); + + if (pool._closed) { + err = new Error('Pool is closed.'); + err.code = 'POOL_CLOSED'; + } + + if (err) { + pool._connectionQueue.unshift(cb); + pool._purgeConnection(connection); + return; + } + + if (changeUser) { + pool.emit('connection', connection); + } + + pool.emit('acquire', connection); + cb(null, connection); + } + + if (changeUser) { + // restore user back to pool configuration + connection.config = this.config.newConnectionConfig(); + connection.changeUser({timeout: this.config.acquireTimeout}, onOperationComplete); + } else { + // ping connection + connection.ping({timeout: this.config.acquireTimeout}, onOperationComplete); + } +}; + +Pool.prototype.releaseConnection = function releaseConnection(connection) { + + if (this._acquiringConnections.indexOf(connection) !== -1) { + // connection is being acquired + return; + } + + if (connection._pool) { + if (connection._pool !== this) { + throw new Error('Connection released to wrong pool'); + } + + if (this._freeConnections.indexOf(connection) !== -1) { + // connection already in free connection pool + // this won't catch all double-release cases + throw new Error('Connection already released'); + } else { + // add connection to end of free queue + this._freeConnections.push(connection); + this.emit('release', connection); + } + } + + if (this._closed) { + // empty the connection queue + this._connectionQueue.splice(0).forEach(function (cb) { + var err = new Error('Pool is closed.'); + err.code = 'POOL_CLOSED'; + process.nextTick(function () { + cb(err); + }); + }); + } else if (this._connectionQueue.length) { + // get connection with next waiting callback + this.getConnection(this._connectionQueue.shift()); + } +}; + +Pool.prototype.end = function (cb) { + this._closed = true; + + if (typeof cb !== 'function') { + cb = function (err) { + if (err) throw err; + }; + } + + var calledBack = false; + var waitingClose = 0; + + function onEnd(err) { + if (!calledBack && (err || --waitingClose <= 0)) { + calledBack = true; + cb(err); + } + } + + while (this._allConnections.length !== 0) { + waitingClose++; + this._purgeConnection(this._allConnections[0], onEnd); + } + + if (waitingClose === 0) { + process.nextTick(onEnd); + } +}; + +Pool.prototype.query = function (sql, values, cb) { + var query = Connection.createQuery(sql, values, cb); + + if (!(typeof sql === 'object' && 'typeCast' in sql)) { + query.typeCast = this.config.connectionConfig.typeCast; + } + + if (this.config.connectionConfig.trace) { + // Long stack trace support + query._callSite = new Error(); + } + + this.getConnection(function (err, conn) { + if (err) { + query.on('error', function () {}); + query.end(err); + return; + } + + // Release connection based off event + query.once('end', function() { + conn.release(); + }); + + conn.query(query); + }); + + return query; +}; + +Pool.prototype._enqueueCallback = function _enqueueCallback(callback) { + + if (this.config.queueLimit && this._connectionQueue.length >= this.config.queueLimit) { + process.nextTick(function () { + var err = new Error('Queue limit reached.'); + err.code = 'POOL_ENQUEUELIMIT'; + callback(err); + }); + return; + } + + // Bind to domain, as dequeue will likely occur in a different domain + var cb = process.domain + ? process.domain.bind(callback) + : callback; + + this._connectionQueue.push(cb); + this.emit('enqueue'); +}; + +Pool.prototype._needsChangeUser = function _needsChangeUser(connection) { + var connConfig = connection.config; + var poolConfig = this.config.connectionConfig; + + // check if changeUser values are different + return connConfig.user !== poolConfig.user + || connConfig.database !== poolConfig.database + || connConfig.password !== poolConfig.password + || connConfig.charsetNumber !== poolConfig.charsetNumber; +}; + +Pool.prototype._purgeConnection = function _purgeConnection(connection, callback) { + var cb = callback || function () {}; + + if (connection.state === 'disconnected') { + connection.destroy(); + } + + this._removeConnection(connection); + + if (connection.state !== 'disconnected' && !connection._protocol._quitSequence) { + connection._realEnd(cb); + return; + } + + process.nextTick(cb); +}; + +Pool.prototype._removeConnection = function(connection) { + connection._pool = null; + + // Remove connection from all connections + spliceConnection(this._allConnections, connection); + + // Remove connection from free connections + spliceConnection(this._freeConnections, connection); + + this.releaseConnection(connection); +}; + +Pool.prototype.escape = function(value) { + return mysql.escape(value, this.config.connectionConfig.stringifyObjects, this.config.connectionConfig.timezone); +}; + +Pool.prototype.escapeId = function escapeId(value) { + return mysql.escapeId(value, false); +}; + +function spliceConnection(array, connection) { + var index; + if ((index = array.indexOf(connection)) !== -1) { + // Remove connection from all connections + array.splice(index, 1); + } +} diff --git a/node_modules/mysql/lib/PoolCluster.js b/node_modules/mysql/lib/PoolCluster.js new file mode 100644 index 0000000..d0aed2c --- /dev/null +++ b/node_modules/mysql/lib/PoolCluster.js @@ -0,0 +1,288 @@ +var Pool = require('./Pool'); +var PoolConfig = require('./PoolConfig'); +var PoolNamespace = require('./PoolNamespace'); +var PoolSelector = require('./PoolSelector'); +var Util = require('util'); +var EventEmitter = require('events').EventEmitter; + +module.exports = PoolCluster; + +/** + * PoolCluster + * @constructor + * @param {object} [config] The pool cluster configuration + * @public + */ +function PoolCluster(config) { + EventEmitter.call(this); + + config = config || {}; + this._canRetry = typeof config.canRetry === 'undefined' ? true : config.canRetry; + this._defaultSelector = config.defaultSelector || 'RR'; + this._removeNodeErrorCount = config.removeNodeErrorCount || 5; + this._restoreNodeTimeout = config.restoreNodeTimeout || 0; + + this._closed = false; + this._findCaches = Object.create(null); + this._lastId = 0; + this._namespaces = Object.create(null); + this._nodes = Object.create(null); +} + +Util.inherits(PoolCluster, EventEmitter); + +PoolCluster.prototype.add = function add(id, config) { + if (this._closed) { + throw new Error('PoolCluster is closed.'); + } + + var nodeId = typeof id === 'object' + ? 'CLUSTER::' + (++this._lastId) + : String(id); + + if (this._nodes[nodeId] !== undefined) { + throw new Error('Node ID "' + nodeId + '" is already defined in PoolCluster.'); + } + + var poolConfig = typeof id !== 'object' + ? new PoolConfig(config) + : new PoolConfig(id); + + this._nodes[nodeId] = { + id : nodeId, + errorCount : 0, + pool : new Pool({config: poolConfig}), + _offlineUntil : 0 + }; + + this._clearFindCaches(); +}; + +PoolCluster.prototype.end = function end(callback) { + var cb = callback !== undefined + ? callback + : _cb; + + if (typeof cb !== 'function') { + throw TypeError('callback argument must be a function'); + } + + if (this._closed) { + process.nextTick(cb); + return; + } + + this._closed = true; + + var calledBack = false; + var nodeIds = Object.keys(this._nodes); + var waitingClose = 0; + + function onEnd(err) { + if (!calledBack && (err || --waitingClose <= 0)) { + calledBack = true; + cb(err); + } + } + + for (var i = 0; i < nodeIds.length; i++) { + var nodeId = nodeIds[i]; + var node = this._nodes[nodeId]; + + waitingClose++; + node.pool.end(onEnd); + } + + if (waitingClose === 0) { + process.nextTick(onEnd); + } +}; + +PoolCluster.prototype.of = function(pattern, selector) { + pattern = pattern || '*'; + + selector = selector || this._defaultSelector; + selector = selector.toUpperCase(); + if (typeof PoolSelector[selector] === 'undefined') { + selector = this._defaultSelector; + } + + var key = pattern + selector; + + if (typeof this._namespaces[key] === 'undefined') { + this._namespaces[key] = new PoolNamespace(this, pattern, selector); + } + + return this._namespaces[key]; +}; + +PoolCluster.prototype.remove = function remove(pattern) { + var foundNodeIds = this._findNodeIds(pattern, true); + + for (var i = 0; i < foundNodeIds.length; i++) { + var node = this._getNode(foundNodeIds[i]); + + if (node) { + this._removeNode(node); + } + } +}; + +PoolCluster.prototype.getConnection = function(pattern, selector, cb) { + var namespace; + if (typeof pattern === 'function') { + cb = pattern; + namespace = this.of(); + } else { + if (typeof selector === 'function') { + cb = selector; + selector = this._defaultSelector; + } + + namespace = this.of(pattern, selector); + } + + namespace.getConnection(cb); +}; + +PoolCluster.prototype._clearFindCaches = function _clearFindCaches() { + this._findCaches = Object.create(null); +}; + +PoolCluster.prototype._decreaseErrorCount = function _decreaseErrorCount(node) { + var errorCount = node.errorCount; + + if (errorCount > this._removeNodeErrorCount) { + errorCount = this._removeNodeErrorCount; + } + + if (errorCount < 1) { + errorCount = 1; + } + + node.errorCount = errorCount - 1; + + if (node._offlineUntil) { + node._offlineUntil = 0; + this.emit('online', node.id); + } +}; + +PoolCluster.prototype._findNodeIds = function _findNodeIds(pattern, includeOffline) { + var currentTime = 0; + var foundNodeIds = this._findCaches[pattern]; + + if (foundNodeIds === undefined) { + var expression = patternRegExp(pattern); + var nodeIds = Object.keys(this._nodes); + + foundNodeIds = nodeIds.filter(function (id) { + return id.match(expression); + }); + + this._findCaches[pattern] = foundNodeIds; + } + + if (includeOffline) { + return foundNodeIds; + } + + return foundNodeIds.filter(function (nodeId) { + var node = this._getNode(nodeId); + + if (!node._offlineUntil) { + return true; + } + + if (!currentTime) { + currentTime = getMonotonicMilliseconds(); + } + + return node._offlineUntil <= currentTime; + }, this); +}; + +PoolCluster.prototype._getNode = function _getNode(id) { + return this._nodes[id] || null; +}; + +PoolCluster.prototype._increaseErrorCount = function _increaseErrorCount(node) { + var errorCount = ++node.errorCount; + + if (this._removeNodeErrorCount > errorCount) { + return; + } + + if (this._restoreNodeTimeout > 0) { + node._offlineUntil = getMonotonicMilliseconds() + this._restoreNodeTimeout; + this.emit('offline', node.id); + return; + } + + this._removeNode(node); + this.emit('remove', node.id); +}; + +PoolCluster.prototype._getConnection = function(node, cb) { + var self = this; + + node.pool.getConnection(function (err, connection) { + if (err) { + self._increaseErrorCount(node); + cb(err); + return; + } else { + self._decreaseErrorCount(node); + } + + connection._clusterId = node.id; + + cb(null, connection); + }); +}; + +PoolCluster.prototype._removeNode = function _removeNode(node) { + delete this._nodes[node.id]; + + this._clearFindCaches(); + + node.pool.end(_noop); +}; + +function getMonotonicMilliseconds() { + var ms; + + if (typeof process.hrtime === 'function') { + ms = process.hrtime(); + ms = ms[0] * 1e3 + ms[1] * 1e-6; + } else { + ms = process.uptime() * 1000; + } + + return Math.floor(ms); +} + +function isRegExp(val) { + return typeof val === 'object' + && Object.prototype.toString.call(val) === '[object RegExp]'; +} + +function patternRegExp(pattern) { + if (isRegExp(pattern)) { + return pattern; + } + + var source = pattern + .replace(/([.+?^=!:${}()|\[\]\/\\])/g, '\\$1') + .replace(/\*/g, '.*'); + + return new RegExp('^' + source + '$'); +} + +function _cb(err) { + if (err) { + throw err; + } +} + +function _noop() {} diff --git a/node_modules/mysql/lib/PoolConfig.js b/node_modules/mysql/lib/PoolConfig.js new file mode 100644 index 0000000..8c5017a --- /dev/null +++ b/node_modules/mysql/lib/PoolConfig.js @@ -0,0 +1,32 @@ + +var ConnectionConfig = require('./ConnectionConfig'); + +module.exports = PoolConfig; +function PoolConfig(options) { + if (typeof options === 'string') { + options = ConnectionConfig.parseUrl(options); + } + + this.acquireTimeout = (options.acquireTimeout === undefined) + ? 10 * 1000 + : Number(options.acquireTimeout); + this.connectionConfig = new ConnectionConfig(options); + this.waitForConnections = (options.waitForConnections === undefined) + ? true + : Boolean(options.waitForConnections); + this.connectionLimit = (options.connectionLimit === undefined) + ? 10 + : Number(options.connectionLimit); + this.queueLimit = (options.queueLimit === undefined) + ? 0 + : Number(options.queueLimit); +} + +PoolConfig.prototype.newConnectionConfig = function newConnectionConfig() { + var connectionConfig = new ConnectionConfig(this.connectionConfig); + + connectionConfig.clientFlags = this.connectionConfig.clientFlags; + connectionConfig.maxPacketSize = this.connectionConfig.maxPacketSize; + + return connectionConfig; +}; diff --git a/node_modules/mysql/lib/PoolConnection.js b/node_modules/mysql/lib/PoolConnection.js new file mode 100644 index 0000000..064c99d --- /dev/null +++ b/node_modules/mysql/lib/PoolConnection.js @@ -0,0 +1,65 @@ +var inherits = require('util').inherits; +var Connection = require('./Connection'); +var Events = require('events'); + +module.exports = PoolConnection; +inherits(PoolConnection, Connection); + +function PoolConnection(pool, options) { + Connection.call(this, options); + this._pool = pool; + + // Bind connection to pool domain + if (Events.usingDomains) { + this.domain = pool.domain; + } + + // When a fatal error occurs the connection's protocol ends, which will cause + // the connection to end as well, thus we only need to watch for the end event + // and we will be notified of disconnects. + this.on('end', this._removeFromPool); + this.on('error', function (err) { + if (err.fatal) { + this._removeFromPool(); + } + }); +} + +PoolConnection.prototype.release = function release() { + var pool = this._pool; + + if (!pool || pool._closed) { + return undefined; + } + + return pool.releaseConnection(this); +}; + +// TODO: Remove this when we are removing PoolConnection#end +PoolConnection.prototype._realEnd = Connection.prototype.end; + +PoolConnection.prototype.end = function () { + console.warn( + 'Calling conn.end() to release a pooled connection is ' + + 'deprecated. In next version calling conn.end() will be ' + + 'restored to default conn.end() behavior. Use ' + + 'conn.release() instead.' + ); + this.release(); +}; + +PoolConnection.prototype.destroy = function () { + Connection.prototype.destroy.apply(this, arguments); + this._removeFromPool(this); +}; + +PoolConnection.prototype._removeFromPool = function _removeFromPool() { + if (!this._pool || this._pool._closed) { + return; + } + + var pool = this._pool; + this._pool = null; + + pool._purgeConnection(this); +}; diff --git a/node_modules/mysql/lib/PoolNamespace.js b/node_modules/mysql/lib/PoolNamespace.js new file mode 100644 index 0000000..d3ea786 --- /dev/null +++ b/node_modules/mysql/lib/PoolNamespace.js @@ -0,0 +1,136 @@ +var Connection = require('./Connection'); +var PoolSelector = require('./PoolSelector'); + +module.exports = PoolNamespace; + +/** + * PoolNamespace + * @constructor + * @param {PoolCluster} cluster The parent cluster for the namespace + * @param {string} pattern The selection pattern to use + * @param {string} selector The selector name to use + * @public + */ +function PoolNamespace(cluster, pattern, selector) { + this._cluster = cluster; + this._pattern = pattern; + this._selector = new PoolSelector[selector](); +} + +PoolNamespace.prototype.getConnection = function(cb) { + var clusterNode = this._getClusterNode(); + var cluster = this._cluster; + var namespace = this; + + if (clusterNode === null) { + var err = null; + + if (this._cluster._findNodeIds(this._pattern, true).length !== 0) { + err = new Error('Pool does not have online node.'); + err.code = 'POOL_NONEONLINE'; + } else { + err = new Error('Pool does not exist.'); + err.code = 'POOL_NOEXIST'; + } + + cb(err); + return; + } + + cluster._getConnection(clusterNode, function(err, connection) { + var retry = err && cluster._canRetry + && cluster._findNodeIds(namespace._pattern).length !== 0; + + if (retry) { + namespace.getConnection(cb); + return; + } + + if (err) { + cb(err); + return; + } + + cb(null, connection); + }); +}; + +PoolNamespace.prototype.query = function (sql, values, cb) { + var cluster = this._cluster; + var clusterNode = this._getClusterNode(); + var query = Connection.createQuery(sql, values, cb); + var namespace = this; + + if (clusterNode === null) { + var err = null; + + if (this._cluster._findNodeIds(this._pattern, true).length !== 0) { + err = new Error('Pool does not have online node.'); + err.code = 'POOL_NONEONLINE'; + } else { + err = new Error('Pool does not exist.'); + err.code = 'POOL_NOEXIST'; + } + + process.nextTick(function () { + query.on('error', function () {}); + query.end(err); + }); + return query; + } + + if (!(typeof sql === 'object' && 'typeCast' in sql)) { + query.typeCast = clusterNode.pool.config.connectionConfig.typeCast; + } + + if (clusterNode.pool.config.connectionConfig.trace) { + // Long stack trace support + query._callSite = new Error(); + } + + cluster._getConnection(clusterNode, function (err, conn) { + var retry = err && cluster._canRetry + && cluster._findNodeIds(namespace._pattern).length !== 0; + + if (retry) { + namespace.query(query); + return; + } + + if (err) { + query.on('error', function () {}); + query.end(err); + return; + } + + // Release connection based off event + query.once('end', function() { + conn.release(); + }); + + conn.query(query); + }); + + return query; +}; + +PoolNamespace.prototype._getClusterNode = function _getClusterNode() { + var foundNodeIds = this._cluster._findNodeIds(this._pattern); + var nodeId; + + switch (foundNodeIds.length) { + case 0: + nodeId = null; + break; + case 1: + nodeId = foundNodeIds[0]; + break; + default: + nodeId = this._selector(foundNodeIds); + break; + } + + return nodeId !== null + ? this._cluster._getNode(nodeId) + : null; +}; diff --git a/node_modules/mysql/lib/PoolSelector.js b/node_modules/mysql/lib/PoolSelector.js new file mode 100644 index 0000000..9a3c455 --- /dev/null +++ b/node_modules/mysql/lib/PoolSelector.js @@ -0,0 +1,31 @@ + +/** + * PoolSelector + */ +var PoolSelector = module.exports = {}; + +PoolSelector.RR = function PoolSelectorRoundRobin() { + var index = 0; + + return function(clusterIds) { + if (index >= clusterIds.length) { + index = 0; + } + + var clusterId = clusterIds[index++]; + + return clusterId; + }; +}; + +PoolSelector.RANDOM = function PoolSelectorRandom() { + return function(clusterIds) { + return clusterIds[Math.floor(Math.random() * clusterIds.length)]; + }; +}; + +PoolSelector.ORDER = function PoolSelectorOrder() { + return function(clusterIds) { + return clusterIds[0]; + }; +}; diff --git a/node_modules/mysql/lib/protocol/Auth.js b/node_modules/mysql/lib/protocol/Auth.js new file mode 100644 index 0000000..a1033d1 --- /dev/null +++ b/node_modules/mysql/lib/protocol/Auth.js @@ -0,0 +1,168 @@ +var Buffer = require('safe-buffer').Buffer; +var Crypto = require('crypto'); +var Auth = exports; + +function auth(name, data, options) { + options = options || {}; + + switch (name) { + case 'mysql_native_password': + return Auth.token(options.password, data.slice(0, 20)); + default: + return undefined; + } +} +Auth.auth = auth; + +function sha1(msg) { + var hash = Crypto.createHash('sha1'); + hash.update(msg, 'binary'); + return hash.digest('binary'); +} +Auth.sha1 = sha1; + +function xor(a, b) { + a = Buffer.from(a, 'binary'); + b = Buffer.from(b, 'binary'); + var result = Buffer.allocUnsafe(a.length); + for (var i = 0; i < a.length; i++) { + result[i] = (a[i] ^ b[i]); + } + return result; +} +Auth.xor = xor; + +Auth.token = function(password, scramble) { + if (!password) { + return Buffer.alloc(0); + } + + // password must be in binary format, not utf8 + var stage1 = sha1((Buffer.from(password, 'utf8')).toString('binary')); + var stage2 = sha1(stage1); + var stage3 = sha1(scramble.toString('binary') + stage2); + return xor(stage3, stage1); +}; + +// This is a port of sql/password.c:hash_password which needs to be used for +// pre-4.1 passwords. +Auth.hashPassword = function(password) { + var nr = [0x5030, 0x5735]; + var add = 7; + var nr2 = [0x1234, 0x5671]; + var result = Buffer.alloc(8); + + if (typeof password === 'string'){ + password = Buffer.from(password); + } + + for (var i = 0; i < password.length; i++) { + var c = password[i]; + if (c === 32 || c === 9) { + // skip space in password + continue; + } + + // nr^= (((nr & 63)+add)*c)+ (nr << 8); + // nr = xor(nr, add(mul(add(and(nr, 63), add), c), shl(nr, 8))) + nr = this.xor32(nr, this.add32(this.mul32(this.add32(this.and32(nr, [0, 63]), [0, add]), [0, c]), this.shl32(nr, 8))); + + // nr2+=(nr2 << 8) ^ nr; + // nr2 = add(nr2, xor(shl(nr2, 8), nr)) + nr2 = this.add32(nr2, this.xor32(this.shl32(nr2, 8), nr)); + + // add+=tmp; + add += c; + } + + this.int31Write(result, nr, 0); + this.int31Write(result, nr2, 4); + + return result; +}; + +Auth.randomInit = function(seed1, seed2) { + return { + max_value : 0x3FFFFFFF, + max_value_dbl : 0x3FFFFFFF, + seed1 : seed1 % 0x3FFFFFFF, + seed2 : seed2 % 0x3FFFFFFF + }; +}; + +Auth.myRnd = function(r){ + r.seed1 = (r.seed1 * 3 + r.seed2) % r.max_value; + r.seed2 = (r.seed1 + r.seed2 + 33) % r.max_value; + + return r.seed1 / r.max_value_dbl; +}; + +Auth.scramble323 = function(message, password) { + if (!password) { + return Buffer.alloc(0); + } + + var to = Buffer.allocUnsafe(8); + var hashPass = this.hashPassword(password); + var hashMessage = this.hashPassword(message.slice(0, 8)); + var seed1 = this.int32Read(hashPass, 0) ^ this.int32Read(hashMessage, 0); + var seed2 = this.int32Read(hashPass, 4) ^ this.int32Read(hashMessage, 4); + var r = this.randomInit(seed1, seed2); + + for (var i = 0; i < 8; i++){ + to[i] = Math.floor(this.myRnd(r) * 31) + 64; + } + var extra = (Math.floor(this.myRnd(r) * 31)); + + for (var i = 0; i < 8; i++){ + to[i] ^= extra; + } + + return to; +}; + +Auth.xor32 = function(a, b){ + return [a[0] ^ b[0], a[1] ^ b[1]]; +}; + +Auth.add32 = function(a, b){ + var w1 = a[1] + b[1]; + var w2 = a[0] + b[0] + ((w1 & 0xFFFF0000) >> 16); + + return [w2 & 0xFFFF, w1 & 0xFFFF]; +}; + +Auth.mul32 = function(a, b){ + // based on this example of multiplying 32b ints using 16b + // http://www.dsprelated.com/showmessage/89790/1.php + var w1 = a[1] * b[1]; + var w2 = (((a[1] * b[1]) >> 16) & 0xFFFF) + ((a[0] * b[1]) & 0xFFFF) + (a[1] * b[0] & 0xFFFF); + + return [w2 & 0xFFFF, w1 & 0xFFFF]; +}; + +Auth.and32 = function(a, b){ + return [a[0] & b[0], a[1] & b[1]]; +}; + +Auth.shl32 = function(a, b){ + // assume b is 16 or less + var w1 = a[1] << b; + var w2 = (a[0] << b) | ((w1 & 0xFFFF0000) >> 16); + + return [w2 & 0xFFFF, w1 & 0xFFFF]; +}; + +Auth.int31Write = function(buffer, number, offset) { + buffer[offset] = (number[0] >> 8) & 0x7F; + buffer[offset + 1] = (number[0]) & 0xFF; + buffer[offset + 2] = (number[1] >> 8) & 0xFF; + buffer[offset + 3] = (number[1]) & 0xFF; +}; + +Auth.int32Read = function(buffer, offset){ + return (buffer[offset] << 24) + + (buffer[offset + 1] << 16) + + (buffer[offset + 2] << 8) + + (buffer[offset + 3]); +}; diff --git a/node_modules/mysql/lib/protocol/BufferList.js b/node_modules/mysql/lib/protocol/BufferList.js new file mode 100644 index 0000000..3cd0192 --- /dev/null +++ b/node_modules/mysql/lib/protocol/BufferList.js @@ -0,0 +1,25 @@ + +module.exports = BufferList; +function BufferList() { + this.bufs = []; + this.size = 0; +} + +BufferList.prototype.shift = function shift() { + var buf = this.bufs.shift(); + + if (buf) { + this.size -= buf.length; + } + + return buf; +}; + +BufferList.prototype.push = function push(buf) { + if (!buf || !buf.length) { + return; + } + + this.bufs.push(buf); + this.size += buf.length; +}; diff --git a/node_modules/mysql/lib/protocol/PacketHeader.js b/node_modules/mysql/lib/protocol/PacketHeader.js new file mode 100644 index 0000000..1bb282e --- /dev/null +++ b/node_modules/mysql/lib/protocol/PacketHeader.js @@ -0,0 +1,5 @@ +module.exports = PacketHeader; +function PacketHeader(length, number) { + this.length = length; + this.number = number; +} diff --git a/node_modules/mysql/lib/protocol/PacketWriter.js b/node_modules/mysql/lib/protocol/PacketWriter.js new file mode 100644 index 0000000..4d0afd2 --- /dev/null +++ b/node_modules/mysql/lib/protocol/PacketWriter.js @@ -0,0 +1,211 @@ +var BIT_16 = Math.pow(2, 16); +var BIT_24 = Math.pow(2, 24); +var BUFFER_ALLOC_SIZE = Math.pow(2, 8); +// The maximum precision JS Numbers can hold precisely +// Don't panic: Good enough to represent byte values up to 8192 TB +var IEEE_754_BINARY_64_PRECISION = Math.pow(2, 53); +var MAX_PACKET_LENGTH = Math.pow(2, 24) - 1; +var Buffer = require('safe-buffer').Buffer; + +module.exports = PacketWriter; +function PacketWriter() { + this._buffer = null; + this._offset = 0; +} + +PacketWriter.prototype.toBuffer = function toBuffer(parser) { + if (!this._buffer) { + this._buffer = Buffer.alloc(0); + this._offset = 0; + } + + var buffer = this._buffer; + var length = this._offset; + var packets = Math.floor(length / MAX_PACKET_LENGTH) + 1; + + this._buffer = Buffer.allocUnsafe(length + packets * 4); + this._offset = 0; + + for (var packet = 0; packet < packets; packet++) { + var isLast = (packet + 1 === packets); + var packetLength = (isLast) + ? length % MAX_PACKET_LENGTH + : MAX_PACKET_LENGTH; + + var packetNumber = parser.incrementPacketNumber(); + + this.writeUnsignedNumber(3, packetLength); + this.writeUnsignedNumber(1, packetNumber); + + var start = packet * MAX_PACKET_LENGTH; + var end = start + packetLength; + + this.writeBuffer(buffer.slice(start, end)); + } + + return this._buffer; +}; + +PacketWriter.prototype.writeUnsignedNumber = function(bytes, value) { + this._allocate(bytes); + + for (var i = 0; i < bytes; i++) { + this._buffer[this._offset++] = (value >> (i * 8)) & 0xff; + } +}; + +PacketWriter.prototype.writeFiller = function(bytes) { + this._allocate(bytes); + + for (var i = 0; i < bytes; i++) { + this._buffer[this._offset++] = 0x00; + } +}; + +PacketWriter.prototype.writeNullTerminatedString = function(value, encoding) { + // Typecast undefined into '' and numbers into strings + value = value || ''; + value = value + ''; + + var bytes = Buffer.byteLength(value, encoding || 'utf-8') + 1; + this._allocate(bytes); + + this._buffer.write(value, this._offset, encoding); + this._buffer[this._offset + bytes - 1] = 0x00; + + this._offset += bytes; +}; + +PacketWriter.prototype.writeString = function(value) { + // Typecast undefined into '' and numbers into strings + value = value || ''; + value = value + ''; + + var bytes = Buffer.byteLength(value, 'utf-8'); + this._allocate(bytes); + + this._buffer.write(value, this._offset, 'utf-8'); + + this._offset += bytes; +}; + +PacketWriter.prototype.writeBuffer = function(value) { + var bytes = value.length; + + this._allocate(bytes); + value.copy(this._buffer, this._offset); + this._offset += bytes; +}; + +PacketWriter.prototype.writeLengthCodedNumber = function(value) { + if (value === null) { + this._allocate(1); + this._buffer[this._offset++] = 251; + return; + } + + if (value <= 250) { + this._allocate(1); + this._buffer[this._offset++] = value; + return; + } + + if (value > IEEE_754_BINARY_64_PRECISION) { + throw new Error( + 'writeLengthCodedNumber: JS precision range exceeded, your ' + + 'number is > 53 bit: "' + value + '"' + ); + } + + if (value < BIT_16) { + this._allocate(3); + this._buffer[this._offset++] = 252; + } else if (value < BIT_24) { + this._allocate(4); + this._buffer[this._offset++] = 253; + } else { + this._allocate(9); + this._buffer[this._offset++] = 254; + } + + // 16 Bit + this._buffer[this._offset++] = value & 0xff; + this._buffer[this._offset++] = (value >> 8) & 0xff; + + if (value < BIT_16) { + return; + } + + // 24 Bit + this._buffer[this._offset++] = (value >> 16) & 0xff; + + if (value < BIT_24) { + return; + } + + this._buffer[this._offset++] = (value >> 24) & 0xff; + + // Hack: Get the most significant 32 bit (JS bitwise operators are 32 bit) + value = value.toString(2); + value = value.substr(0, value.length - 32); + value = parseInt(value, 2); + + this._buffer[this._offset++] = value & 0xff; + this._buffer[this._offset++] = (value >> 8) & 0xff; + this._buffer[this._offset++] = (value >> 16) & 0xff; + + // Set last byte to 0, as we can only support 53 bits in JS (see above) + this._buffer[this._offset++] = 0; +}; + +PacketWriter.prototype.writeLengthCodedBuffer = function(value) { + var bytes = value.length; + this.writeLengthCodedNumber(bytes); + this.writeBuffer(value); +}; + +PacketWriter.prototype.writeNullTerminatedBuffer = function(value) { + this.writeBuffer(value); + this.writeFiller(1); // 0x00 terminator +}; + +PacketWriter.prototype.writeLengthCodedString = function(value) { + if (value === null) { + this.writeLengthCodedNumber(null); + return; + } + + value = (value === undefined) + ? '' + : String(value); + + var bytes = Buffer.byteLength(value, 'utf-8'); + this.writeLengthCodedNumber(bytes); + + if (!bytes) { + return; + } + + this._allocate(bytes); + this._buffer.write(value, this._offset, 'utf-8'); + this._offset += bytes; +}; + +PacketWriter.prototype._allocate = function _allocate(bytes) { + if (!this._buffer) { + this._buffer = Buffer.alloc(Math.max(BUFFER_ALLOC_SIZE, bytes)); + this._offset = 0; + return; + } + + var bytesRemaining = this._buffer.length - this._offset; + if (bytesRemaining >= bytes) { + return; + } + + var newSize = this._buffer.length + Math.max(BUFFER_ALLOC_SIZE, bytes); + var oldBuffer = this._buffer; + + this._buffer = Buffer.alloc(newSize); + oldBuffer.copy(this._buffer); +}; diff --git a/node_modules/mysql/lib/protocol/Parser.js b/node_modules/mysql/lib/protocol/Parser.js new file mode 100644 index 0000000..e72555f --- /dev/null +++ b/node_modules/mysql/lib/protocol/Parser.js @@ -0,0 +1,491 @@ +var PacketHeader = require('./PacketHeader'); +var BigNumber = require('bignumber.js'); +var Buffer = require('safe-buffer').Buffer; +var BufferList = require('./BufferList'); + +var MAX_PACKET_LENGTH = Math.pow(2, 24) - 1; +var MUL_32BIT = Math.pow(2, 32); +var PACKET_HEADER_LENGTH = 4; + +module.exports = Parser; +function Parser(options) { + options = options || {}; + + this._supportBigNumbers = options.config && options.config.supportBigNumbers; + this._buffer = Buffer.alloc(0); + this._nextBuffers = new BufferList(); + this._longPacketBuffers = new BufferList(); + this._offset = 0; + this._packetEnd = null; + this._packetHeader = null; + this._packetOffset = null; + this._onError = options.onError || function(err) { throw err; }; + this._onPacket = options.onPacket || function() {}; + this._nextPacketNumber = 0; + this._encoding = 'utf-8'; + this._paused = false; +} + +Parser.prototype.write = function write(chunk) { + this._nextBuffers.push(chunk); + + while (!this._paused) { + var packetHeader = this._tryReadPacketHeader(); + + if (!packetHeader) { + break; + } + + if (!this._combineNextBuffers(packetHeader.length)) { + break; + } + + this._parsePacket(packetHeader); + } +}; + +Parser.prototype.append = function append(chunk) { + if (!chunk || chunk.length === 0) { + return; + } + + // Calculate slice ranges + var sliceEnd = this._buffer.length; + var sliceStart = this._packetOffset === null + ? this._offset + : this._packetOffset; + var sliceLength = sliceEnd - sliceStart; + + // Get chunk data + var buffer = null; + var chunks = !(chunk instanceof Array || Array.isArray(chunk)) ? [chunk] : chunk; + var length = 0; + var offset = 0; + + for (var i = 0; i < chunks.length; i++) { + length += chunks[i].length; + } + + if (sliceLength !== 0) { + // Create a new Buffer + buffer = Buffer.allocUnsafe(sliceLength + length); + offset = 0; + + // Copy data slice + offset += this._buffer.copy(buffer, 0, sliceStart, sliceEnd); + + // Copy chunks + for (var i = 0; i < chunks.length; i++) { + offset += chunks[i].copy(buffer, offset); + } + } else if (chunks.length > 1) { + // Create a new Buffer + buffer = Buffer.allocUnsafe(length); + offset = 0; + + // Copy chunks + for (var i = 0; i < chunks.length; i++) { + offset += chunks[i].copy(buffer, offset); + } + } else { + // Buffer is the only chunk + buffer = chunks[0]; + } + + // Adjust data-tracking pointers + this._buffer = buffer; + this._offset = this._offset - sliceStart; + this._packetEnd = this._packetEnd !== null + ? this._packetEnd - sliceStart + : null; + this._packetOffset = this._packetOffset !== null + ? this._packetOffset - sliceStart + : null; +}; + +Parser.prototype.pause = function() { + this._paused = true; +}; + +Parser.prototype.resume = function() { + this._paused = false; + + // nextTick() to avoid entering write() multiple times within the same stack + // which would cause problems as write manipulates the state of the object. + process.nextTick(this.write.bind(this)); +}; + +Parser.prototype.peak = function peak(offset) { + return this._buffer[this._offset + (offset >>> 0)]; +}; + +Parser.prototype.parseUnsignedNumber = function parseUnsignedNumber(bytes) { + if (bytes === 1) { + return this._buffer[this._offset++]; + } + + var buffer = this._buffer; + var offset = this._offset + bytes - 1; + var value = 0; + + if (bytes > 4) { + var err = new Error('parseUnsignedNumber: Supports only up to 4 bytes'); + err.offset = (this._offset - this._packetOffset - 1); + err.code = 'PARSER_UNSIGNED_TOO_LONG'; + throw err; + } + + while (offset >= this._offset) { + value = ((value << 8) | buffer[offset]) >>> 0; + offset--; + } + + this._offset += bytes; + + return value; +}; + +Parser.prototype.parseLengthCodedString = function() { + var length = this.parseLengthCodedNumber(); + + if (length === null) { + return null; + } + + return this.parseString(length); +}; + +Parser.prototype.parseLengthCodedBuffer = function() { + var length = this.parseLengthCodedNumber(); + + if (length === null) { + return null; + } + + return this.parseBuffer(length); +}; + +Parser.prototype.parseLengthCodedNumber = function parseLengthCodedNumber() { + if (this._offset >= this._buffer.length) { + var err = new Error('Parser: read past end'); + err.offset = (this._offset - this._packetOffset); + err.code = 'PARSER_READ_PAST_END'; + throw err; + } + + var bits = this._buffer[this._offset++]; + + if (bits <= 250) { + return bits; + } + + switch (bits) { + case 251: + return null; + case 252: + return this.parseUnsignedNumber(2); + case 253: + return this.parseUnsignedNumber(3); + case 254: + break; + default: + var err = new Error('Unexpected first byte' + (bits ? ': 0x' + bits.toString(16) : '')); + err.offset = (this._offset - this._packetOffset - 1); + err.code = 'PARSER_BAD_LENGTH_BYTE'; + throw err; + } + + var low = this.parseUnsignedNumber(4); + var high = this.parseUnsignedNumber(4); + var value; + + if (high >>> 21) { + value = BigNumber(MUL_32BIT).times(high).plus(low).toString(); + + if (this._supportBigNumbers) { + return value; + } + + var err = new Error( + 'parseLengthCodedNumber: JS precision range exceeded, ' + + 'number is >= 53 bit: "' + value + '"' + ); + err.offset = (this._offset - this._packetOffset - 8); + err.code = 'PARSER_JS_PRECISION_RANGE_EXCEEDED'; + throw err; + } + + value = low + (MUL_32BIT * high); + + return value; +}; + +Parser.prototype.parseFiller = function(length) { + return this.parseBuffer(length); +}; + +Parser.prototype.parseNullTerminatedBuffer = function() { + var end = this._nullByteOffset(); + var value = this._buffer.slice(this._offset, end); + this._offset = end + 1; + + return value; +}; + +Parser.prototype.parseNullTerminatedString = function() { + var end = this._nullByteOffset(); + var value = this._buffer.toString(this._encoding, this._offset, end); + this._offset = end + 1; + + return value; +}; + +Parser.prototype._nullByteOffset = function() { + var offset = this._offset; + + while (this._buffer[offset] !== 0x00) { + offset++; + + if (offset >= this._buffer.length) { + var err = new Error('Offset of null terminated string not found.'); + err.offset = (this._offset - this._packetOffset); + err.code = 'PARSER_MISSING_NULL_BYTE'; + throw err; + } + } + + return offset; +}; + +Parser.prototype.parsePacketTerminatedBuffer = function parsePacketTerminatedBuffer() { + var length = this._packetEnd - this._offset; + return this.parseBuffer(length); +}; + +Parser.prototype.parsePacketTerminatedString = function() { + var length = this._packetEnd - this._offset; + return this.parseString(length); +}; + +Parser.prototype.parseBuffer = function(length) { + var response = Buffer.alloc(length); + this._buffer.copy(response, 0, this._offset, this._offset + length); + + this._offset += length; + return response; +}; + +Parser.prototype.parseString = function(length) { + var offset = this._offset; + var end = offset + length; + var value = this._buffer.toString(this._encoding, offset, end); + + this._offset = end; + return value; +}; + +Parser.prototype.parseGeometryValue = function() { + var buffer = this.parseLengthCodedBuffer(); + var offset = 4; + + if (buffer === null || !buffer.length) { + return null; + } + + function parseGeometry() { + var result = null; + var byteOrder = buffer.readUInt8(offset); offset += 1; + var wkbType = byteOrder ? buffer.readUInt32LE(offset) : buffer.readUInt32BE(offset); offset += 4; + switch (wkbType) { + case 1: // WKBPoint + var x = byteOrder ? buffer.readDoubleLE(offset) : buffer.readDoubleBE(offset); offset += 8; + var y = byteOrder ? buffer.readDoubleLE(offset) : buffer.readDoubleBE(offset); offset += 8; + result = {x: x, y: y}; + break; + case 2: // WKBLineString + var numPoints = byteOrder ? buffer.readUInt32LE(offset) : buffer.readUInt32BE(offset); offset += 4; + result = []; + for (var i = numPoints; i > 0; i--) { + var x = byteOrder ? buffer.readDoubleLE(offset) : buffer.readDoubleBE(offset); offset += 8; + var y = byteOrder ? buffer.readDoubleLE(offset) : buffer.readDoubleBE(offset); offset += 8; + result.push({x: x, y: y}); + } + break; + case 3: // WKBPolygon + var numRings = byteOrder ? buffer.readUInt32LE(offset) : buffer.readUInt32BE(offset); offset += 4; + result = []; + for (var i = numRings; i > 0; i--) { + var numPoints = byteOrder ? buffer.readUInt32LE(offset) : buffer.readUInt32BE(offset); offset += 4; + var line = []; + for (var j = numPoints; j > 0; j--) { + var x = byteOrder ? buffer.readDoubleLE(offset) : buffer.readDoubleBE(offset); offset += 8; + var y = byteOrder ? buffer.readDoubleLE(offset) : buffer.readDoubleBE(offset); offset += 8; + line.push({x: x, y: y}); + } + result.push(line); + } + break; + case 4: // WKBMultiPoint + case 5: // WKBMultiLineString + case 6: // WKBMultiPolygon + case 7: // WKBGeometryCollection + var num = byteOrder ? buffer.readUInt32LE(offset) : buffer.readUInt32BE(offset); offset += 4; + var result = []; + for (var i = num; i > 0; i--) { + result.push(parseGeometry()); + } + break; + } + return result; + } + return parseGeometry(); +}; + +Parser.prototype.reachedPacketEnd = function() { + return this._offset === this._packetEnd; +}; + +Parser.prototype.incrementPacketNumber = function() { + var currentPacketNumber = this._nextPacketNumber; + this._nextPacketNumber = (this._nextPacketNumber + 1) % 256; + + return currentPacketNumber; +}; + +Parser.prototype.resetPacketNumber = function() { + this._nextPacketNumber = 0; +}; + +Parser.prototype.packetLength = function packetLength() { + if (!this._packetHeader) { + return null; + } + + return this._packetHeader.length + this._longPacketBuffers.size; +}; + +Parser.prototype._combineNextBuffers = function _combineNextBuffers(bytes) { + var length = this._buffer.length - this._offset; + + if (length >= bytes) { + return true; + } + + if ((length + this._nextBuffers.size) < bytes) { + return false; + } + + var buffers = []; + var bytesNeeded = bytes - length; + + while (bytesNeeded > 0) { + var buffer = this._nextBuffers.shift(); + buffers.push(buffer); + bytesNeeded -= buffer.length; + } + + this.append(buffers); + return true; +}; + +Parser.prototype._combineLongPacketBuffers = function _combineLongPacketBuffers() { + if (!this._longPacketBuffers.size) { + return; + } + + // Calculate bytes + var remainingBytes = this._buffer.length - this._offset; + var trailingPacketBytes = this._buffer.length - this._packetEnd; + + // Create buffer + var buf = null; + var buffer = Buffer.allocUnsafe(remainingBytes + this._longPacketBuffers.size); + var offset = 0; + + // Copy long buffers + while ((buf = this._longPacketBuffers.shift())) { + offset += buf.copy(buffer, offset); + } + + // Copy remaining bytes + this._buffer.copy(buffer, offset, this._offset); + + this._buffer = buffer; + this._offset = 0; + this._packetEnd = this._buffer.length - trailingPacketBytes; + this._packetOffset = 0; +}; + +Parser.prototype._parsePacket = function _parsePacket(packetHeader) { + this._packetEnd = this._offset + packetHeader.length; + this._packetOffset = this._offset; + + if (packetHeader.length === MAX_PACKET_LENGTH) { + this._longPacketBuffers.push(this._buffer.slice(this._packetOffset, this._packetEnd)); + this._advanceToNextPacket(); + return; + } + + this._combineLongPacketBuffers(); + + var hadException = true; + try { + this._onPacket(packetHeader); + hadException = false; + } catch (err) { + if (!err || typeof err.code !== 'string' || err.code.substr(0, 7) !== 'PARSER_') { + throw err; // Rethrow non-MySQL errors + } + + // Pass down parser errors + this._onError(err); + hadException = false; + } finally { + this._advanceToNextPacket(); + + // If there was an exception, the parser while loop will be broken out + // of after the finally block. So schedule a blank write to re-enter it + // to continue parsing any bytes that may already have been received. + if (hadException) { + process.nextTick(this.write.bind(this)); + } + } +}; + +Parser.prototype._tryReadPacketHeader = function _tryReadPacketHeader() { + if (this._packetHeader) { + return this._packetHeader; + } + + if (!this._combineNextBuffers(PACKET_HEADER_LENGTH)) { + return null; + } + + this._packetHeader = new PacketHeader( + this.parseUnsignedNumber(3), + this.parseUnsignedNumber(1) + ); + + if (this._packetHeader.number !== this._nextPacketNumber) { + var err = new Error( + 'Packets out of order. Got: ' + this._packetHeader.number + ' ' + + 'Expected: ' + this._nextPacketNumber + ); + + err.code = 'PROTOCOL_PACKETS_OUT_OF_ORDER'; + err.fatal = true; + + this._onError(err); + } + + this.incrementPacketNumber(); + + return this._packetHeader; +}; + +Parser.prototype._advanceToNextPacket = function() { + this._offset = this._packetEnd; + this._packetHeader = null; + this._packetEnd = null; + this._packetOffset = null; +}; diff --git a/node_modules/mysql/lib/protocol/Protocol.js b/node_modules/mysql/lib/protocol/Protocol.js new file mode 100644 index 0000000..ab37105 --- /dev/null +++ b/node_modules/mysql/lib/protocol/Protocol.js @@ -0,0 +1,463 @@ +var Parser = require('./Parser'); +var Sequences = require('./sequences'); +var Packets = require('./packets'); +var Stream = require('stream').Stream; +var Util = require('util'); +var PacketWriter = require('./PacketWriter'); + +module.exports = Protocol; +Util.inherits(Protocol, Stream); +function Protocol(options) { + Stream.call(this); + + options = options || {}; + + this.readable = true; + this.writable = true; + + this._config = options.config || {}; + this._connection = options.connection; + this._callback = null; + this._fatalError = null; + this._quitSequence = null; + this._handshake = false; + this._handshaked = false; + this._ended = false; + this._destroyed = false; + this._queue = []; + this._handshakeInitializationPacket = null; + + this._parser = new Parser({ + onError : this.handleParserError.bind(this), + onPacket : this._parsePacket.bind(this), + config : this._config + }); +} + +Protocol.prototype.write = function(buffer) { + this._parser.write(buffer); + return true; +}; + +Protocol.prototype.handshake = function handshake(options, callback) { + if (typeof options === 'function') { + callback = options; + options = {}; + } + + options = options || {}; + options.config = this._config; + + var sequence = this._enqueue(new Sequences.Handshake(options, callback)); + + this._handshake = true; + + return sequence; +}; + +Protocol.prototype.query = function query(options, callback) { + return this._enqueue(new Sequences.Query(options, callback)); +}; + +Protocol.prototype.changeUser = function changeUser(options, callback) { + return this._enqueue(new Sequences.ChangeUser(options, callback)); +}; + +Protocol.prototype.ping = function ping(options, callback) { + if (typeof options === 'function') { + callback = options; + options = {}; + } + + return this._enqueue(new Sequences.Ping(options, callback)); +}; + +Protocol.prototype.stats = function stats(options, callback) { + if (typeof options === 'function') { + callback = options; + options = {}; + } + + return this._enqueue(new Sequences.Statistics(options, callback)); +}; + +Protocol.prototype.quit = function quit(options, callback) { + if (typeof options === 'function') { + callback = options; + options = {}; + } + + var self = this; + var sequence = this._enqueue(new Sequences.Quit(options, callback)); + + sequence.on('end', function () { + self.end(); + }); + + return this._quitSequence = sequence; +}; + +Protocol.prototype.end = function() { + if (this._ended) { + return; + } + this._ended = true; + + if (this._quitSequence && (this._quitSequence._ended || this._queue[0] === this._quitSequence)) { + this._quitSequence.end(); + this.emit('end'); + return; + } + + var err = new Error('Connection lost: The server closed the connection.'); + err.fatal = true; + err.code = 'PROTOCOL_CONNECTION_LOST'; + + this._delegateError(err); +}; + +Protocol.prototype.pause = function() { + this._parser.pause(); + // Since there is a file stream in query, we must transmit pause/resume event to current sequence. + var seq = this._queue[0]; + if (seq && seq.emit) { + seq.emit('pause'); + } +}; + +Protocol.prototype.resume = function() { + this._parser.resume(); + // Since there is a file stream in query, we must transmit pause/resume event to current sequence. + var seq = this._queue[0]; + if (seq && seq.emit) { + seq.emit('resume'); + } +}; + +Protocol.prototype._enqueue = function(sequence) { + if (!this._validateEnqueue(sequence)) { + return sequence; + } + + if (this._config.trace) { + // Long stack trace support + sequence._callSite = sequence._callSite || new Error(); + } + + this._queue.push(sequence); + this.emit('enqueue', sequence); + + var self = this; + sequence + .on('error', function(err) { + self._delegateError(err, sequence); + }) + .on('packet', function(packet) { + sequence._timer.active(); + self._emitPacket(packet); + }) + .on('timeout', function() { + var err = new Error(sequence.constructor.name + ' inactivity timeout'); + + err.code = 'PROTOCOL_SEQUENCE_TIMEOUT'; + err.fatal = true; + err.timeout = sequence._timeout; + + self._delegateError(err, sequence); + }); + + if (sequence.constructor === Sequences.Handshake) { + sequence.on('start-tls', function () { + sequence._timer.active(); + self._connection._startTLS(function(err) { + if (err) { + // SSL negotiation error are fatal + err.code = 'HANDSHAKE_SSL_ERROR'; + err.fatal = true; + sequence.end(err); + return; + } + + sequence._timer.active(); + sequence._tlsUpgradeCompleteHandler(); + }); + }); + + sequence.on('end', function () { + self._handshaked = true; + + if (!self._fatalError) { + self.emit('handshake', self._handshakeInitializationPacket); + } + }); + } + + sequence.on('end', function () { + self._dequeue(sequence); + }); + + if (this._queue.length === 1) { + this._parser.resetPacketNumber(); + this._startSequence(sequence); + } + + return sequence; +}; + +Protocol.prototype._validateEnqueue = function _validateEnqueue(sequence) { + var err; + var prefix = 'Cannot enqueue ' + sequence.constructor.name; + + if (this._fatalError) { + err = new Error(prefix + ' after fatal error.'); + err.code = 'PROTOCOL_ENQUEUE_AFTER_FATAL_ERROR'; + } else if (this._quitSequence) { + err = new Error(prefix + ' after invoking quit.'); + err.code = 'PROTOCOL_ENQUEUE_AFTER_QUIT'; + } else if (this._destroyed) { + err = new Error(prefix + ' after being destroyed.'); + err.code = 'PROTOCOL_ENQUEUE_AFTER_DESTROY'; + } else if ((this._handshake || this._handshaked) && sequence.constructor === Sequences.Handshake) { + err = new Error(prefix + ' after already enqueuing a Handshake.'); + err.code = 'PROTOCOL_ENQUEUE_HANDSHAKE_TWICE'; + } else { + return true; + } + + var self = this; + err.fatal = false; + + // add error handler + sequence.on('error', function (err) { + self._delegateError(err, sequence); + }); + + process.nextTick(function () { + sequence.end(err); + }); + + return false; +}; + +Protocol.prototype._parsePacket = function() { + var sequence = this._queue[0]; + + if (!sequence) { + var err = new Error('Received packet with no active sequence.'); + err.code = 'PROTOCOL_STRAY_PACKET'; + err.fatal = true; + + this._delegateError(err); + return; + } + + var Packet = this._determinePacket(sequence); + var packet = new Packet({protocol41: this._config.protocol41}); + var packetName = Packet.name; + + // Special case: Faster dispatch, and parsing done inside sequence + if (Packet === Packets.RowDataPacket) { + sequence.RowDataPacket(packet, this._parser, this._connection); + + if (this._config.debug) { + this._debugPacket(true, packet); + } + + return; + } + + if (this._config.debug) { + this._parsePacketDebug(packet); + } else { + packet.parse(this._parser); + } + + if (Packet === Packets.HandshakeInitializationPacket) { + this._handshakeInitializationPacket = packet; + this.emit('initialize', packet); + } + + sequence._timer.active(); + + if (!sequence[packetName]) { + var err = new Error('Received packet in the wrong sequence.'); + err.code = 'PROTOCOL_INCORRECT_PACKET_SEQUENCE'; + err.fatal = true; + + this._delegateError(err); + return; + } + + sequence[packetName](packet); +}; + +Protocol.prototype._parsePacketDebug = function _parsePacketDebug(packet) { + try { + packet.parse(this._parser); + } finally { + this._debugPacket(true, packet); + } +}; + +Protocol.prototype._emitPacket = function(packet) { + var packetWriter = new PacketWriter(); + packet.write(packetWriter); + this.emit('data', packetWriter.toBuffer(this._parser)); + + if (this._config.debug) { + this._debugPacket(false, packet); + } +}; + +Protocol.prototype._determinePacket = function(sequence) { + var firstByte = this._parser.peak(); + + if (sequence.determinePacket) { + var Packet = sequence.determinePacket(firstByte, this._parser); + if (Packet) { + return Packet; + } + } + + switch (firstByte) { + case 0x00: return Packets.OkPacket; + case 0xfe: return Packets.EofPacket; + case 0xff: return Packets.ErrorPacket; + } + + throw new Error('Could not determine packet, firstByte = ' + firstByte); +}; + +Protocol.prototype._dequeue = function(sequence) { + sequence._timer.stop(); + + // No point in advancing the queue, we are dead + if (this._fatalError) { + return; + } + + this._queue.shift(); + + var sequence = this._queue[0]; + if (!sequence) { + this.emit('drain'); + return; + } + + this._parser.resetPacketNumber(); + + this._startSequence(sequence); +}; + +Protocol.prototype._startSequence = function(sequence) { + if (sequence._timeout > 0 && isFinite(sequence._timeout)) { + sequence._timer.start(sequence._timeout); + } + + if (sequence.constructor === Sequences.ChangeUser) { + sequence.start(this._handshakeInitializationPacket); + } else { + sequence.start(); + } +}; + +Protocol.prototype.handleNetworkError = function(err) { + err.fatal = true; + + var sequence = this._queue[0]; + if (sequence) { + sequence.end(err); + } else { + this._delegateError(err); + } +}; + +Protocol.prototype.handleParserError = function handleParserError(err) { + var sequence = this._queue[0]; + if (sequence) { + sequence.end(err); + } else { + this._delegateError(err); + } +}; + +Protocol.prototype._delegateError = function(err, sequence) { + // Stop delegating errors after the first fatal error + if (this._fatalError) { + return; + } + + if (err.fatal) { + this._fatalError = err; + } + + if (this._shouldErrorBubbleUp(err, sequence)) { + // Can't use regular 'error' event here as that always destroys the pipe + // between socket and protocol which is not what we want (unless the + // exception was fatal). + this.emit('unhandledError', err); + } else if (err.fatal) { + // Send fatal error to all sequences in the queue + var queue = this._queue; + process.nextTick(function () { + queue.forEach(function (sequence) { + sequence.end(err); + }); + queue.length = 0; + }); + } + + // Make sure the stream we are piping to is getting closed + if (err.fatal) { + this.emit('end', err); + } +}; + +Protocol.prototype._shouldErrorBubbleUp = function(err, sequence) { + if (sequence) { + if (sequence.hasErrorHandler()) { + return false; + } else if (!err.fatal) { + return true; + } + } + + return (err.fatal && !this._hasPendingErrorHandlers()); +}; + +Protocol.prototype._hasPendingErrorHandlers = function() { + return this._queue.some(function(sequence) { + return sequence.hasErrorHandler(); + }); +}; + +Protocol.prototype.destroy = function() { + this._destroyed = true; + this._parser.pause(); + + if (this._connection.state !== 'disconnected') { + if (!this._ended) { + this.end(); + } + } +}; + +Protocol.prototype._debugPacket = function(incoming, packet) { + var connection = this._connection; + var direction = incoming + ? '<--' + : '-->'; + var packetName = packet.constructor.name; + var threadId = connection && connection.threadId !== null + ? ' (' + connection.threadId + ')' + : ''; + + // check for debug packet restriction + if (Array.isArray(this._config.debug) && this._config.debug.indexOf(packetName) === -1) { + return; + } + + var packetPayload = Util.inspect(packet).replace(/^[^{]+/, ''); + + console.log('%s%s %s %s\n', direction, threadId, packetName, packetPayload); +}; diff --git a/node_modules/mysql/lib/protocol/ResultSet.js b/node_modules/mysql/lib/protocol/ResultSet.js new file mode 100644 index 0000000..f58d74f --- /dev/null +++ b/node_modules/mysql/lib/protocol/ResultSet.js @@ -0,0 +1,7 @@ +module.exports = ResultSet; +function ResultSet(resultSetHeaderPacket) { + this.resultSetHeaderPacket = resultSetHeaderPacket; + this.fieldPackets = []; + this.eofPackets = []; + this.rows = []; +} diff --git a/node_modules/mysql/lib/protocol/SqlString.js b/node_modules/mysql/lib/protocol/SqlString.js new file mode 100644 index 0000000..30c63d8 --- /dev/null +++ b/node_modules/mysql/lib/protocol/SqlString.js @@ -0,0 +1 @@ +module.exports = require('sqlstring'); diff --git a/node_modules/mysql/lib/protocol/Timer.js b/node_modules/mysql/lib/protocol/Timer.js new file mode 100644 index 0000000..45ed029 --- /dev/null +++ b/node_modules/mysql/lib/protocol/Timer.js @@ -0,0 +1,33 @@ +var Timers = require('timers'); + +module.exports = Timer; +function Timer(object) { + this._object = object; + this._timeout = null; +} + +Timer.prototype.active = function active() { + if (this._timeout) { + if (this._timeout.refresh) { + this._timeout.refresh(); + } else { + Timers.active(this._timeout); + } + } +}; + +Timer.prototype.start = function start(msecs) { + this.stop(); + this._timeout = Timers.setTimeout(this._onTimeout.bind(this), msecs); +}; + +Timer.prototype.stop = function stop() { + if (this._timeout) { + Timers.clearTimeout(this._timeout); + this._timeout = null; + } +}; + +Timer.prototype._onTimeout = function _onTimeout() { + return this._object._onTimeout(); +}; diff --git a/node_modules/mysql/lib/protocol/constants/charsets.js b/node_modules/mysql/lib/protocol/constants/charsets.js new file mode 100644 index 0000000..98b88ea --- /dev/null +++ b/node_modules/mysql/lib/protocol/constants/charsets.js @@ -0,0 +1,262 @@ +exports.BIG5_CHINESE_CI = 1; +exports.LATIN2_CZECH_CS = 2; +exports.DEC8_SWEDISH_CI = 3; +exports.CP850_GENERAL_CI = 4; +exports.LATIN1_GERMAN1_CI = 5; +exports.HP8_ENGLISH_CI = 6; +exports.KOI8R_GENERAL_CI = 7; +exports.LATIN1_SWEDISH_CI = 8; +exports.LATIN2_GENERAL_CI = 9; +exports.SWE7_SWEDISH_CI = 10; +exports.ASCII_GENERAL_CI = 11; +exports.UJIS_JAPANESE_CI = 12; +exports.SJIS_JAPANESE_CI = 13; +exports.CP1251_BULGARIAN_CI = 14; +exports.LATIN1_DANISH_CI = 15; +exports.HEBREW_GENERAL_CI = 16; +exports.TIS620_THAI_CI = 18; +exports.EUCKR_KOREAN_CI = 19; +exports.LATIN7_ESTONIAN_CS = 20; +exports.LATIN2_HUNGARIAN_CI = 21; +exports.KOI8U_GENERAL_CI = 22; +exports.CP1251_UKRAINIAN_CI = 23; +exports.GB2312_CHINESE_CI = 24; +exports.GREEK_GENERAL_CI = 25; +exports.CP1250_GENERAL_CI = 26; +exports.LATIN2_CROATIAN_CI = 27; +exports.GBK_CHINESE_CI = 28; +exports.CP1257_LITHUANIAN_CI = 29; +exports.LATIN5_TURKISH_CI = 30; +exports.LATIN1_GERMAN2_CI = 31; +exports.ARMSCII8_GENERAL_CI = 32; +exports.UTF8_GENERAL_CI = 33; +exports.CP1250_CZECH_CS = 34; +exports.UCS2_GENERAL_CI = 35; +exports.CP866_GENERAL_CI = 36; +exports.KEYBCS2_GENERAL_CI = 37; +exports.MACCE_GENERAL_CI = 38; +exports.MACROMAN_GENERAL_CI = 39; +exports.CP852_GENERAL_CI = 40; +exports.LATIN7_GENERAL_CI = 41; +exports.LATIN7_GENERAL_CS = 42; +exports.MACCE_BIN = 43; +exports.CP1250_CROATIAN_CI = 44; +exports.UTF8MB4_GENERAL_CI = 45; +exports.UTF8MB4_BIN = 46; +exports.LATIN1_BIN = 47; +exports.LATIN1_GENERAL_CI = 48; +exports.LATIN1_GENERAL_CS = 49; +exports.CP1251_BIN = 50; +exports.CP1251_GENERAL_CI = 51; +exports.CP1251_GENERAL_CS = 52; +exports.MACROMAN_BIN = 53; +exports.UTF16_GENERAL_CI = 54; +exports.UTF16_BIN = 55; +exports.UTF16LE_GENERAL_CI = 56; +exports.CP1256_GENERAL_CI = 57; +exports.CP1257_BIN = 58; +exports.CP1257_GENERAL_CI = 59; +exports.UTF32_GENERAL_CI = 60; +exports.UTF32_BIN = 61; +exports.UTF16LE_BIN = 62; +exports.BINARY = 63; +exports.ARMSCII8_BIN = 64; +exports.ASCII_BIN = 65; +exports.CP1250_BIN = 66; +exports.CP1256_BIN = 67; +exports.CP866_BIN = 68; +exports.DEC8_BIN = 69; +exports.GREEK_BIN = 70; +exports.HEBREW_BIN = 71; +exports.HP8_BIN = 72; +exports.KEYBCS2_BIN = 73; +exports.KOI8R_BIN = 74; +exports.KOI8U_BIN = 75; +exports.LATIN2_BIN = 77; +exports.LATIN5_BIN = 78; +exports.LATIN7_BIN = 79; +exports.CP850_BIN = 80; +exports.CP852_BIN = 81; +exports.SWE7_BIN = 82; +exports.UTF8_BIN = 83; +exports.BIG5_BIN = 84; +exports.EUCKR_BIN = 85; +exports.GB2312_BIN = 86; +exports.GBK_BIN = 87; +exports.SJIS_BIN = 88; +exports.TIS620_BIN = 89; +exports.UCS2_BIN = 90; +exports.UJIS_BIN = 91; +exports.GEOSTD8_GENERAL_CI = 92; +exports.GEOSTD8_BIN = 93; +exports.LATIN1_SPANISH_CI = 94; +exports.CP932_JAPANESE_CI = 95; +exports.CP932_BIN = 96; +exports.EUCJPMS_JAPANESE_CI = 97; +exports.EUCJPMS_BIN = 98; +exports.CP1250_POLISH_CI = 99; +exports.UTF16_UNICODE_CI = 101; +exports.UTF16_ICELANDIC_CI = 102; +exports.UTF16_LATVIAN_CI = 103; +exports.UTF16_ROMANIAN_CI = 104; +exports.UTF16_SLOVENIAN_CI = 105; +exports.UTF16_POLISH_CI = 106; +exports.UTF16_ESTONIAN_CI = 107; +exports.UTF16_SPANISH_CI = 108; +exports.UTF16_SWEDISH_CI = 109; +exports.UTF16_TURKISH_CI = 110; +exports.UTF16_CZECH_CI = 111; +exports.UTF16_DANISH_CI = 112; +exports.UTF16_LITHUANIAN_CI = 113; +exports.UTF16_SLOVAK_CI = 114; +exports.UTF16_SPANISH2_CI = 115; +exports.UTF16_ROMAN_CI = 116; +exports.UTF16_PERSIAN_CI = 117; +exports.UTF16_ESPERANTO_CI = 118; +exports.UTF16_HUNGARIAN_CI = 119; +exports.UTF16_SINHALA_CI = 120; +exports.UTF16_GERMAN2_CI = 121; +exports.UTF16_CROATIAN_MYSQL561_CI = 122; +exports.UTF16_UNICODE_520_CI = 123; +exports.UTF16_VIETNAMESE_CI = 124; +exports.UCS2_UNICODE_CI = 128; +exports.UCS2_ICELANDIC_CI = 129; +exports.UCS2_LATVIAN_CI = 130; +exports.UCS2_ROMANIAN_CI = 131; +exports.UCS2_SLOVENIAN_CI = 132; +exports.UCS2_POLISH_CI = 133; +exports.UCS2_ESTONIAN_CI = 134; +exports.UCS2_SPANISH_CI = 135; +exports.UCS2_SWEDISH_CI = 136; +exports.UCS2_TURKISH_CI = 137; +exports.UCS2_CZECH_CI = 138; +exports.UCS2_DANISH_CI = 139; +exports.UCS2_LITHUANIAN_CI = 140; +exports.UCS2_SLOVAK_CI = 141; +exports.UCS2_SPANISH2_CI = 142; +exports.UCS2_ROMAN_CI = 143; +exports.UCS2_PERSIAN_CI = 144; +exports.UCS2_ESPERANTO_CI = 145; +exports.UCS2_HUNGARIAN_CI = 146; +exports.UCS2_SINHALA_CI = 147; +exports.UCS2_GERMAN2_CI = 148; +exports.UCS2_CROATIAN_MYSQL561_CI = 149; +exports.UCS2_UNICODE_520_CI = 150; +exports.UCS2_VIETNAMESE_CI = 151; +exports.UCS2_GENERAL_MYSQL500_CI = 159; +exports.UTF32_UNICODE_CI = 160; +exports.UTF32_ICELANDIC_CI = 161; +exports.UTF32_LATVIAN_CI = 162; +exports.UTF32_ROMANIAN_CI = 163; +exports.UTF32_SLOVENIAN_CI = 164; +exports.UTF32_POLISH_CI = 165; +exports.UTF32_ESTONIAN_CI = 166; +exports.UTF32_SPANISH_CI = 167; +exports.UTF32_SWEDISH_CI = 168; +exports.UTF32_TURKISH_CI = 169; +exports.UTF32_CZECH_CI = 170; +exports.UTF32_DANISH_CI = 171; +exports.UTF32_LITHUANIAN_CI = 172; +exports.UTF32_SLOVAK_CI = 173; +exports.UTF32_SPANISH2_CI = 174; +exports.UTF32_ROMAN_CI = 175; +exports.UTF32_PERSIAN_CI = 176; +exports.UTF32_ESPERANTO_CI = 177; +exports.UTF32_HUNGARIAN_CI = 178; +exports.UTF32_SINHALA_CI = 179; +exports.UTF32_GERMAN2_CI = 180; +exports.UTF32_CROATIAN_MYSQL561_CI = 181; +exports.UTF32_UNICODE_520_CI = 182; +exports.UTF32_VIETNAMESE_CI = 183; +exports.UTF8_UNICODE_CI = 192; +exports.UTF8_ICELANDIC_CI = 193; +exports.UTF8_LATVIAN_CI = 194; +exports.UTF8_ROMANIAN_CI = 195; +exports.UTF8_SLOVENIAN_CI = 196; +exports.UTF8_POLISH_CI = 197; +exports.UTF8_ESTONIAN_CI = 198; +exports.UTF8_SPANISH_CI = 199; +exports.UTF8_SWEDISH_CI = 200; +exports.UTF8_TURKISH_CI = 201; +exports.UTF8_CZECH_CI = 202; +exports.UTF8_DANISH_CI = 203; +exports.UTF8_LITHUANIAN_CI = 204; +exports.UTF8_SLOVAK_CI = 205; +exports.UTF8_SPANISH2_CI = 206; +exports.UTF8_ROMAN_CI = 207; +exports.UTF8_PERSIAN_CI = 208; +exports.UTF8_ESPERANTO_CI = 209; +exports.UTF8_HUNGARIAN_CI = 210; +exports.UTF8_SINHALA_CI = 211; +exports.UTF8_GERMAN2_CI = 212; +exports.UTF8_CROATIAN_MYSQL561_CI = 213; +exports.UTF8_UNICODE_520_CI = 214; +exports.UTF8_VIETNAMESE_CI = 215; +exports.UTF8_GENERAL_MYSQL500_CI = 223; +exports.UTF8MB4_UNICODE_CI = 224; +exports.UTF8MB4_ICELANDIC_CI = 225; +exports.UTF8MB4_LATVIAN_CI = 226; +exports.UTF8MB4_ROMANIAN_CI = 227; +exports.UTF8MB4_SLOVENIAN_CI = 228; +exports.UTF8MB4_POLISH_CI = 229; +exports.UTF8MB4_ESTONIAN_CI = 230; +exports.UTF8MB4_SPANISH_CI = 231; +exports.UTF8MB4_SWEDISH_CI = 232; +exports.UTF8MB4_TURKISH_CI = 233; +exports.UTF8MB4_CZECH_CI = 234; +exports.UTF8MB4_DANISH_CI = 235; +exports.UTF8MB4_LITHUANIAN_CI = 236; +exports.UTF8MB4_SLOVAK_CI = 237; +exports.UTF8MB4_SPANISH2_CI = 238; +exports.UTF8MB4_ROMAN_CI = 239; +exports.UTF8MB4_PERSIAN_CI = 240; +exports.UTF8MB4_ESPERANTO_CI = 241; +exports.UTF8MB4_HUNGARIAN_CI = 242; +exports.UTF8MB4_SINHALA_CI = 243; +exports.UTF8MB4_GERMAN2_CI = 244; +exports.UTF8MB4_CROATIAN_MYSQL561_CI = 245; +exports.UTF8MB4_UNICODE_520_CI = 246; +exports.UTF8MB4_VIETNAMESE_CI = 247; +exports.UTF8_GENERAL50_CI = 253; + +// short aliases +exports.ARMSCII8 = exports.ARMSCII8_GENERAL_CI; +exports.ASCII = exports.ASCII_GENERAL_CI; +exports.BIG5 = exports.BIG5_CHINESE_CI; +exports.BINARY = exports.BINARY; +exports.CP1250 = exports.CP1250_GENERAL_CI; +exports.CP1251 = exports.CP1251_GENERAL_CI; +exports.CP1256 = exports.CP1256_GENERAL_CI; +exports.CP1257 = exports.CP1257_GENERAL_CI; +exports.CP866 = exports.CP866_GENERAL_CI; +exports.CP850 = exports.CP850_GENERAL_CI; +exports.CP852 = exports.CP852_GENERAL_CI; +exports.CP932 = exports.CP932_JAPANESE_CI; +exports.DEC8 = exports.DEC8_SWEDISH_CI; +exports.EUCJPMS = exports.EUCJPMS_JAPANESE_CI; +exports.EUCKR = exports.EUCKR_KOREAN_CI; +exports.GB2312 = exports.GB2312_CHINESE_CI; +exports.GBK = exports.GBK_CHINESE_CI; +exports.GEOSTD8 = exports.GEOSTD8_GENERAL_CI; +exports.GREEK = exports.GREEK_GENERAL_CI; +exports.HEBREW = exports.HEBREW_GENERAL_CI; +exports.HP8 = exports.HP8_ENGLISH_CI; +exports.KEYBCS2 = exports.KEYBCS2_GENERAL_CI; +exports.KOI8R = exports.KOI8R_GENERAL_CI; +exports.KOI8U = exports.KOI8U_GENERAL_CI; +exports.LATIN1 = exports.LATIN1_SWEDISH_CI; +exports.LATIN2 = exports.LATIN2_GENERAL_CI; +exports.LATIN5 = exports.LATIN5_TURKISH_CI; +exports.LATIN7 = exports.LATIN7_GENERAL_CI; +exports.MACCE = exports.MACCE_GENERAL_CI; +exports.MACROMAN = exports.MACROMAN_GENERAL_CI; +exports.SJIS = exports.SJIS_JAPANESE_CI; +exports.SWE7 = exports.SWE7_SWEDISH_CI; +exports.TIS620 = exports.TIS620_THAI_CI; +exports.UCS2 = exports.UCS2_GENERAL_CI; +exports.UJIS = exports.UJIS_JAPANESE_CI; +exports.UTF16 = exports.UTF16_GENERAL_CI; +exports.UTF16LE = exports.UTF16LE_GENERAL_CI; +exports.UTF8 = exports.UTF8_GENERAL_CI; +exports.UTF8MB4 = exports.UTF8MB4_GENERAL_CI; +exports.UTF32 = exports.UTF32_GENERAL_CI; diff --git a/node_modules/mysql/lib/protocol/constants/client.js b/node_modules/mysql/lib/protocol/constants/client.js new file mode 100644 index 0000000..59aadc6 --- /dev/null +++ b/node_modules/mysql/lib/protocol/constants/client.js @@ -0,0 +1,26 @@ +// Manually extracted from mysql-5.5.23/include/mysql_com.h +exports.CLIENT_LONG_PASSWORD = 1; /* new more secure passwords */ +exports.CLIENT_FOUND_ROWS = 2; /* Found instead of affected rows */ +exports.CLIENT_LONG_FLAG = 4; /* Get all column flags */ +exports.CLIENT_CONNECT_WITH_DB = 8; /* One can specify db on connect */ +exports.CLIENT_NO_SCHEMA = 16; /* Don't allow database.table.column */ +exports.CLIENT_COMPRESS = 32; /* Can use compression protocol */ +exports.CLIENT_ODBC = 64; /* Odbc client */ +exports.CLIENT_LOCAL_FILES = 128; /* Can use LOAD DATA LOCAL */ +exports.CLIENT_IGNORE_SPACE = 256; /* Ignore spaces before '(' */ +exports.CLIENT_PROTOCOL_41 = 512; /* New 4.1 protocol */ +exports.CLIENT_INTERACTIVE = 1024; /* This is an interactive client */ +exports.CLIENT_SSL = 2048; /* Switch to SSL after handshake */ +exports.CLIENT_IGNORE_SIGPIPE = 4096; /* IGNORE sigpipes */ +exports.CLIENT_TRANSACTIONS = 8192; /* Client knows about transactions */ +exports.CLIENT_RESERVED = 16384; /* Old flag for 4.1 protocol */ +exports.CLIENT_SECURE_CONNECTION = 32768; /* New 4.1 authentication */ + +exports.CLIENT_MULTI_STATEMENTS = 65536; /* Enable/disable multi-stmt support */ +exports.CLIENT_MULTI_RESULTS = 131072; /* Enable/disable multi-results */ +exports.CLIENT_PS_MULTI_RESULTS = 262144; /* Multi-results in PS-protocol */ + +exports.CLIENT_PLUGIN_AUTH = 524288; /* Client supports plugin authentication */ + +exports.CLIENT_SSL_VERIFY_SERVER_CERT = 1073741824; +exports.CLIENT_REMEMBER_OPTIONS = 2147483648; diff --git a/node_modules/mysql/lib/protocol/constants/errors.js b/node_modules/mysql/lib/protocol/constants/errors.js new file mode 100644 index 0000000..e757741 --- /dev/null +++ b/node_modules/mysql/lib/protocol/constants/errors.js @@ -0,0 +1,2476 @@ +/** + * MySQL error constants + * + * Extracted from version 5.7.29 + * + * !! Generated by generate-error-constants.js, do not modify by hand !! + */ + +exports.EE_CANTCREATEFILE = 1; +exports.EE_READ = 2; +exports.EE_WRITE = 3; +exports.EE_BADCLOSE = 4; +exports.EE_OUTOFMEMORY = 5; +exports.EE_DELETE = 6; +exports.EE_LINK = 7; +exports.EE_EOFERR = 9; +exports.EE_CANTLOCK = 10; +exports.EE_CANTUNLOCK = 11; +exports.EE_DIR = 12; +exports.EE_STAT = 13; +exports.EE_CANT_CHSIZE = 14; +exports.EE_CANT_OPEN_STREAM = 15; +exports.EE_GETWD = 16; +exports.EE_SETWD = 17; +exports.EE_LINK_WARNING = 18; +exports.EE_OPEN_WARNING = 19; +exports.EE_DISK_FULL = 20; +exports.EE_CANT_MKDIR = 21; +exports.EE_UNKNOWN_CHARSET = 22; +exports.EE_OUT_OF_FILERESOURCES = 23; +exports.EE_CANT_READLINK = 24; +exports.EE_CANT_SYMLINK = 25; +exports.EE_REALPATH = 26; +exports.EE_SYNC = 27; +exports.EE_UNKNOWN_COLLATION = 28; +exports.EE_FILENOTFOUND = 29; +exports.EE_FILE_NOT_CLOSED = 30; +exports.EE_CHANGE_OWNERSHIP = 31; +exports.EE_CHANGE_PERMISSIONS = 32; +exports.EE_CANT_SEEK = 33; +exports.EE_CAPACITY_EXCEEDED = 34; +exports.HA_ERR_KEY_NOT_FOUND = 120; +exports.HA_ERR_FOUND_DUPP_KEY = 121; +exports.HA_ERR_INTERNAL_ERROR = 122; +exports.HA_ERR_RECORD_CHANGED = 123; +exports.HA_ERR_WRONG_INDEX = 124; +exports.HA_ERR_CRASHED = 126; +exports.HA_ERR_WRONG_IN_RECORD = 127; +exports.HA_ERR_OUT_OF_MEM = 128; +exports.HA_ERR_NOT_A_TABLE = 130; +exports.HA_ERR_WRONG_COMMAND = 131; +exports.HA_ERR_OLD_FILE = 132; +exports.HA_ERR_NO_ACTIVE_RECORD = 133; +exports.HA_ERR_RECORD_DELETED = 134; +exports.HA_ERR_RECORD_FILE_FULL = 135; +exports.HA_ERR_INDEX_FILE_FULL = 136; +exports.HA_ERR_END_OF_FILE = 137; +exports.HA_ERR_UNSUPPORTED = 138; +exports.HA_ERR_TOO_BIG_ROW = 139; +exports.HA_WRONG_CREATE_OPTION = 140; +exports.HA_ERR_FOUND_DUPP_UNIQUE = 141; +exports.HA_ERR_UNKNOWN_CHARSET = 142; +exports.HA_ERR_WRONG_MRG_TABLE_DEF = 143; +exports.HA_ERR_CRASHED_ON_REPAIR = 144; +exports.HA_ERR_CRASHED_ON_USAGE = 145; +exports.HA_ERR_LOCK_WAIT_TIMEOUT = 146; +exports.HA_ERR_LOCK_TABLE_FULL = 147; +exports.HA_ERR_READ_ONLY_TRANSACTION = 148; +exports.HA_ERR_LOCK_DEADLOCK = 149; +exports.HA_ERR_CANNOT_ADD_FOREIGN = 150; +exports.HA_ERR_NO_REFERENCED_ROW = 151; +exports.HA_ERR_ROW_IS_REFERENCED = 152; +exports.HA_ERR_NO_SAVEPOINT = 153; +exports.HA_ERR_NON_UNIQUE_BLOCK_SIZE = 154; +exports.HA_ERR_NO_SUCH_TABLE = 155; +exports.HA_ERR_TABLE_EXIST = 156; +exports.HA_ERR_NO_CONNECTION = 157; +exports.HA_ERR_NULL_IN_SPATIAL = 158; +exports.HA_ERR_TABLE_DEF_CHANGED = 159; +exports.HA_ERR_NO_PARTITION_FOUND = 160; +exports.HA_ERR_RBR_LOGGING_FAILED = 161; +exports.HA_ERR_DROP_INDEX_FK = 162; +exports.HA_ERR_FOREIGN_DUPLICATE_KEY = 163; +exports.HA_ERR_TABLE_NEEDS_UPGRADE = 164; +exports.HA_ERR_TABLE_READONLY = 165; +exports.HA_ERR_AUTOINC_READ_FAILED = 166; +exports.HA_ERR_AUTOINC_ERANGE = 167; +exports.HA_ERR_GENERIC = 168; +exports.HA_ERR_RECORD_IS_THE_SAME = 169; +exports.HA_ERR_LOGGING_IMPOSSIBLE = 170; +exports.HA_ERR_CORRUPT_EVENT = 171; +exports.HA_ERR_NEW_FILE = 172; +exports.HA_ERR_ROWS_EVENT_APPLY = 173; +exports.HA_ERR_INITIALIZATION = 174; +exports.HA_ERR_FILE_TOO_SHORT = 175; +exports.HA_ERR_WRONG_CRC = 176; +exports.HA_ERR_TOO_MANY_CONCURRENT_TRXS = 177; +exports.HA_ERR_NOT_IN_LOCK_PARTITIONS = 178; +exports.HA_ERR_INDEX_COL_TOO_LONG = 179; +exports.HA_ERR_INDEX_CORRUPT = 180; +exports.HA_ERR_UNDO_REC_TOO_BIG = 181; +exports.HA_FTS_INVALID_DOCID = 182; +exports.HA_ERR_TABLE_IN_FK_CHECK = 183; +exports.HA_ERR_TABLESPACE_EXISTS = 184; +exports.HA_ERR_TOO_MANY_FIELDS = 185; +exports.HA_ERR_ROW_IN_WRONG_PARTITION = 186; +exports.HA_ERR_INNODB_READ_ONLY = 187; +exports.HA_ERR_FTS_EXCEED_RESULT_CACHE_LIMIT = 188; +exports.HA_ERR_TEMP_FILE_WRITE_FAILURE = 189; +exports.HA_ERR_INNODB_FORCED_RECOVERY = 190; +exports.HA_ERR_FTS_TOO_MANY_WORDS_IN_PHRASE = 191; +exports.HA_ERR_FK_DEPTH_EXCEEDED = 192; +exports.HA_MISSING_CREATE_OPTION = 193; +exports.HA_ERR_SE_OUT_OF_MEMORY = 194; +exports.HA_ERR_TABLE_CORRUPT = 195; +exports.HA_ERR_QUERY_INTERRUPTED = 196; +exports.HA_ERR_TABLESPACE_MISSING = 197; +exports.HA_ERR_TABLESPACE_IS_NOT_EMPTY = 198; +exports.HA_ERR_WRONG_FILE_NAME = 199; +exports.HA_ERR_NOT_ALLOWED_COMMAND = 200; +exports.HA_ERR_COMPUTE_FAILED = 201; +exports.ER_HASHCHK = 1000; +exports.ER_NISAMCHK = 1001; +exports.ER_NO = 1002; +exports.ER_YES = 1003; +exports.ER_CANT_CREATE_FILE = 1004; +exports.ER_CANT_CREATE_TABLE = 1005; +exports.ER_CANT_CREATE_DB = 1006; +exports.ER_DB_CREATE_EXISTS = 1007; +exports.ER_DB_DROP_EXISTS = 1008; +exports.ER_DB_DROP_DELETE = 1009; +exports.ER_DB_DROP_RMDIR = 1010; +exports.ER_CANT_DELETE_FILE = 1011; +exports.ER_CANT_FIND_SYSTEM_REC = 1012; +exports.ER_CANT_GET_STAT = 1013; +exports.ER_CANT_GET_WD = 1014; +exports.ER_CANT_LOCK = 1015; +exports.ER_CANT_OPEN_FILE = 1016; +exports.ER_FILE_NOT_FOUND = 1017; +exports.ER_CANT_READ_DIR = 1018; +exports.ER_CANT_SET_WD = 1019; +exports.ER_CHECKREAD = 1020; +exports.ER_DISK_FULL = 1021; +exports.ER_DUP_KEY = 1022; +exports.ER_ERROR_ON_CLOSE = 1023; +exports.ER_ERROR_ON_READ = 1024; +exports.ER_ERROR_ON_RENAME = 1025; +exports.ER_ERROR_ON_WRITE = 1026; +exports.ER_FILE_USED = 1027; +exports.ER_FILSORT_ABORT = 1028; +exports.ER_FORM_NOT_FOUND = 1029; +exports.ER_GET_ERRNO = 1030; +exports.ER_ILLEGAL_HA = 1031; +exports.ER_KEY_NOT_FOUND = 1032; +exports.ER_NOT_FORM_FILE = 1033; +exports.ER_NOT_KEYFILE = 1034; +exports.ER_OLD_KEYFILE = 1035; +exports.ER_OPEN_AS_READONLY = 1036; +exports.ER_OUTOFMEMORY = 1037; +exports.ER_OUT_OF_SORTMEMORY = 1038; +exports.ER_UNEXPECTED_EOF = 1039; +exports.ER_CON_COUNT_ERROR = 1040; +exports.ER_OUT_OF_RESOURCES = 1041; +exports.ER_BAD_HOST_ERROR = 1042; +exports.ER_HANDSHAKE_ERROR = 1043; +exports.ER_DBACCESS_DENIED_ERROR = 1044; +exports.ER_ACCESS_DENIED_ERROR = 1045; +exports.ER_NO_DB_ERROR = 1046; +exports.ER_UNKNOWN_COM_ERROR = 1047; +exports.ER_BAD_NULL_ERROR = 1048; +exports.ER_BAD_DB_ERROR = 1049; +exports.ER_TABLE_EXISTS_ERROR = 1050; +exports.ER_BAD_TABLE_ERROR = 1051; +exports.ER_NON_UNIQ_ERROR = 1052; +exports.ER_SERVER_SHUTDOWN = 1053; +exports.ER_BAD_FIELD_ERROR = 1054; +exports.ER_WRONG_FIELD_WITH_GROUP = 1055; +exports.ER_WRONG_GROUP_FIELD = 1056; +exports.ER_WRONG_SUM_SELECT = 1057; +exports.ER_WRONG_VALUE_COUNT = 1058; +exports.ER_TOO_LONG_IDENT = 1059; +exports.ER_DUP_FIELDNAME = 1060; +exports.ER_DUP_KEYNAME = 1061; +exports.ER_DUP_ENTRY = 1062; +exports.ER_WRONG_FIELD_SPEC = 1063; +exports.ER_PARSE_ERROR = 1064; +exports.ER_EMPTY_QUERY = 1065; +exports.ER_NONUNIQ_TABLE = 1066; +exports.ER_INVALID_DEFAULT = 1067; +exports.ER_MULTIPLE_PRI_KEY = 1068; +exports.ER_TOO_MANY_KEYS = 1069; +exports.ER_TOO_MANY_KEY_PARTS = 1070; +exports.ER_TOO_LONG_KEY = 1071; +exports.ER_KEY_COLUMN_DOES_NOT_EXITS = 1072; +exports.ER_BLOB_USED_AS_KEY = 1073; +exports.ER_TOO_BIG_FIELDLENGTH = 1074; +exports.ER_WRONG_AUTO_KEY = 1075; +exports.ER_READY = 1076; +exports.ER_NORMAL_SHUTDOWN = 1077; +exports.ER_GOT_SIGNAL = 1078; +exports.ER_SHUTDOWN_COMPLETE = 1079; +exports.ER_FORCING_CLOSE = 1080; +exports.ER_IPSOCK_ERROR = 1081; +exports.ER_NO_SUCH_INDEX = 1082; +exports.ER_WRONG_FIELD_TERMINATORS = 1083; +exports.ER_BLOBS_AND_NO_TERMINATED = 1084; +exports.ER_TEXTFILE_NOT_READABLE = 1085; +exports.ER_FILE_EXISTS_ERROR = 1086; +exports.ER_LOAD_INFO = 1087; +exports.ER_ALTER_INFO = 1088; +exports.ER_WRONG_SUB_KEY = 1089; +exports.ER_CANT_REMOVE_ALL_FIELDS = 1090; +exports.ER_CANT_DROP_FIELD_OR_KEY = 1091; +exports.ER_INSERT_INFO = 1092; +exports.ER_UPDATE_TABLE_USED = 1093; +exports.ER_NO_SUCH_THREAD = 1094; +exports.ER_KILL_DENIED_ERROR = 1095; +exports.ER_NO_TABLES_USED = 1096; +exports.ER_TOO_BIG_SET = 1097; +exports.ER_NO_UNIQUE_LOGFILE = 1098; +exports.ER_TABLE_NOT_LOCKED_FOR_WRITE = 1099; +exports.ER_TABLE_NOT_LOCKED = 1100; +exports.ER_BLOB_CANT_HAVE_DEFAULT = 1101; +exports.ER_WRONG_DB_NAME = 1102; +exports.ER_WRONG_TABLE_NAME = 1103; +exports.ER_TOO_BIG_SELECT = 1104; +exports.ER_UNKNOWN_ERROR = 1105; +exports.ER_UNKNOWN_PROCEDURE = 1106; +exports.ER_WRONG_PARAMCOUNT_TO_PROCEDURE = 1107; +exports.ER_WRONG_PARAMETERS_TO_PROCEDURE = 1108; +exports.ER_UNKNOWN_TABLE = 1109; +exports.ER_FIELD_SPECIFIED_TWICE = 1110; +exports.ER_INVALID_GROUP_FUNC_USE = 1111; +exports.ER_UNSUPPORTED_EXTENSION = 1112; +exports.ER_TABLE_MUST_HAVE_COLUMNS = 1113; +exports.ER_RECORD_FILE_FULL = 1114; +exports.ER_UNKNOWN_CHARACTER_SET = 1115; +exports.ER_TOO_MANY_TABLES = 1116; +exports.ER_TOO_MANY_FIELDS = 1117; +exports.ER_TOO_BIG_ROWSIZE = 1118; +exports.ER_STACK_OVERRUN = 1119; +exports.ER_WRONG_OUTER_JOIN = 1120; +exports.ER_NULL_COLUMN_IN_INDEX = 1121; +exports.ER_CANT_FIND_UDF = 1122; +exports.ER_CANT_INITIALIZE_UDF = 1123; +exports.ER_UDF_NO_PATHS = 1124; +exports.ER_UDF_EXISTS = 1125; +exports.ER_CANT_OPEN_LIBRARY = 1126; +exports.ER_CANT_FIND_DL_ENTRY = 1127; +exports.ER_FUNCTION_NOT_DEFINED = 1128; +exports.ER_HOST_IS_BLOCKED = 1129; +exports.ER_HOST_NOT_PRIVILEGED = 1130; +exports.ER_PASSWORD_ANONYMOUS_USER = 1131; +exports.ER_PASSWORD_NOT_ALLOWED = 1132; +exports.ER_PASSWORD_NO_MATCH = 1133; +exports.ER_UPDATE_INFO = 1134; +exports.ER_CANT_CREATE_THREAD = 1135; +exports.ER_WRONG_VALUE_COUNT_ON_ROW = 1136; +exports.ER_CANT_REOPEN_TABLE = 1137; +exports.ER_INVALID_USE_OF_NULL = 1138; +exports.ER_REGEXP_ERROR = 1139; +exports.ER_MIX_OF_GROUP_FUNC_AND_FIELDS = 1140; +exports.ER_NONEXISTING_GRANT = 1141; +exports.ER_TABLEACCESS_DENIED_ERROR = 1142; +exports.ER_COLUMNACCESS_DENIED_ERROR = 1143; +exports.ER_ILLEGAL_GRANT_FOR_TABLE = 1144; +exports.ER_GRANT_WRONG_HOST_OR_USER = 1145; +exports.ER_NO_SUCH_TABLE = 1146; +exports.ER_NONEXISTING_TABLE_GRANT = 1147; +exports.ER_NOT_ALLOWED_COMMAND = 1148; +exports.ER_SYNTAX_ERROR = 1149; +exports.ER_DELAYED_CANT_CHANGE_LOCK = 1150; +exports.ER_TOO_MANY_DELAYED_THREADS = 1151; +exports.ER_ABORTING_CONNECTION = 1152; +exports.ER_NET_PACKET_TOO_LARGE = 1153; +exports.ER_NET_READ_ERROR_FROM_PIPE = 1154; +exports.ER_NET_FCNTL_ERROR = 1155; +exports.ER_NET_PACKETS_OUT_OF_ORDER = 1156; +exports.ER_NET_UNCOMPRESS_ERROR = 1157; +exports.ER_NET_READ_ERROR = 1158; +exports.ER_NET_READ_INTERRUPTED = 1159; +exports.ER_NET_ERROR_ON_WRITE = 1160; +exports.ER_NET_WRITE_INTERRUPTED = 1161; +exports.ER_TOO_LONG_STRING = 1162; +exports.ER_TABLE_CANT_HANDLE_BLOB = 1163; +exports.ER_TABLE_CANT_HANDLE_AUTO_INCREMENT = 1164; +exports.ER_DELAYED_INSERT_TABLE_LOCKED = 1165; +exports.ER_WRONG_COLUMN_NAME = 1166; +exports.ER_WRONG_KEY_COLUMN = 1167; +exports.ER_WRONG_MRG_TABLE = 1168; +exports.ER_DUP_UNIQUE = 1169; +exports.ER_BLOB_KEY_WITHOUT_LENGTH = 1170; +exports.ER_PRIMARY_CANT_HAVE_NULL = 1171; +exports.ER_TOO_MANY_ROWS = 1172; +exports.ER_REQUIRES_PRIMARY_KEY = 1173; +exports.ER_NO_RAID_COMPILED = 1174; +exports.ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE = 1175; +exports.ER_KEY_DOES_NOT_EXITS = 1176; +exports.ER_CHECK_NO_SUCH_TABLE = 1177; +exports.ER_CHECK_NOT_IMPLEMENTED = 1178; +exports.ER_CANT_DO_THIS_DURING_AN_TRANSACTION = 1179; +exports.ER_ERROR_DURING_COMMIT = 1180; +exports.ER_ERROR_DURING_ROLLBACK = 1181; +exports.ER_ERROR_DURING_FLUSH_LOGS = 1182; +exports.ER_ERROR_DURING_CHECKPOINT = 1183; +exports.ER_NEW_ABORTING_CONNECTION = 1184; +exports.ER_DUMP_NOT_IMPLEMENTED = 1185; +exports.ER_FLUSH_MASTER_BINLOG_CLOSED = 1186; +exports.ER_INDEX_REBUILD = 1187; +exports.ER_MASTER = 1188; +exports.ER_MASTER_NET_READ = 1189; +exports.ER_MASTER_NET_WRITE = 1190; +exports.ER_FT_MATCHING_KEY_NOT_FOUND = 1191; +exports.ER_LOCK_OR_ACTIVE_TRANSACTION = 1192; +exports.ER_UNKNOWN_SYSTEM_VARIABLE = 1193; +exports.ER_CRASHED_ON_USAGE = 1194; +exports.ER_CRASHED_ON_REPAIR = 1195; +exports.ER_WARNING_NOT_COMPLETE_ROLLBACK = 1196; +exports.ER_TRANS_CACHE_FULL = 1197; +exports.ER_SLAVE_MUST_STOP = 1198; +exports.ER_SLAVE_NOT_RUNNING = 1199; +exports.ER_BAD_SLAVE = 1200; +exports.ER_MASTER_INFO = 1201; +exports.ER_SLAVE_THREAD = 1202; +exports.ER_TOO_MANY_USER_CONNECTIONS = 1203; +exports.ER_SET_CONSTANTS_ONLY = 1204; +exports.ER_LOCK_WAIT_TIMEOUT = 1205; +exports.ER_LOCK_TABLE_FULL = 1206; +exports.ER_READ_ONLY_TRANSACTION = 1207; +exports.ER_DROP_DB_WITH_READ_LOCK = 1208; +exports.ER_CREATE_DB_WITH_READ_LOCK = 1209; +exports.ER_WRONG_ARGUMENTS = 1210; +exports.ER_NO_PERMISSION_TO_CREATE_USER = 1211; +exports.ER_UNION_TABLES_IN_DIFFERENT_DIR = 1212; +exports.ER_LOCK_DEADLOCK = 1213; +exports.ER_TABLE_CANT_HANDLE_FT = 1214; +exports.ER_CANNOT_ADD_FOREIGN = 1215; +exports.ER_NO_REFERENCED_ROW = 1216; +exports.ER_ROW_IS_REFERENCED = 1217; +exports.ER_CONNECT_TO_MASTER = 1218; +exports.ER_QUERY_ON_MASTER = 1219; +exports.ER_ERROR_WHEN_EXECUTING_COMMAND = 1220; +exports.ER_WRONG_USAGE = 1221; +exports.ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT = 1222; +exports.ER_CANT_UPDATE_WITH_READLOCK = 1223; +exports.ER_MIXING_NOT_ALLOWED = 1224; +exports.ER_DUP_ARGUMENT = 1225; +exports.ER_USER_LIMIT_REACHED = 1226; +exports.ER_SPECIFIC_ACCESS_DENIED_ERROR = 1227; +exports.ER_LOCAL_VARIABLE = 1228; +exports.ER_GLOBAL_VARIABLE = 1229; +exports.ER_NO_DEFAULT = 1230; +exports.ER_WRONG_VALUE_FOR_VAR = 1231; +exports.ER_WRONG_TYPE_FOR_VAR = 1232; +exports.ER_VAR_CANT_BE_READ = 1233; +exports.ER_CANT_USE_OPTION_HERE = 1234; +exports.ER_NOT_SUPPORTED_YET = 1235; +exports.ER_MASTER_FATAL_ERROR_READING_BINLOG = 1236; +exports.ER_SLAVE_IGNORED_TABLE = 1237; +exports.ER_INCORRECT_GLOBAL_LOCAL_VAR = 1238; +exports.ER_WRONG_FK_DEF = 1239; +exports.ER_KEY_REF_DO_NOT_MATCH_TABLE_REF = 1240; +exports.ER_OPERAND_COLUMNS = 1241; +exports.ER_SUBQUERY_NO_1_ROW = 1242; +exports.ER_UNKNOWN_STMT_HANDLER = 1243; +exports.ER_CORRUPT_HELP_DB = 1244; +exports.ER_CYCLIC_REFERENCE = 1245; +exports.ER_AUTO_CONVERT = 1246; +exports.ER_ILLEGAL_REFERENCE = 1247; +exports.ER_DERIVED_MUST_HAVE_ALIAS = 1248; +exports.ER_SELECT_REDUCED = 1249; +exports.ER_TABLENAME_NOT_ALLOWED_HERE = 1250; +exports.ER_NOT_SUPPORTED_AUTH_MODE = 1251; +exports.ER_SPATIAL_CANT_HAVE_NULL = 1252; +exports.ER_COLLATION_CHARSET_MISMATCH = 1253; +exports.ER_SLAVE_WAS_RUNNING = 1254; +exports.ER_SLAVE_WAS_NOT_RUNNING = 1255; +exports.ER_TOO_BIG_FOR_UNCOMPRESS = 1256; +exports.ER_ZLIB_Z_MEM_ERROR = 1257; +exports.ER_ZLIB_Z_BUF_ERROR = 1258; +exports.ER_ZLIB_Z_DATA_ERROR = 1259; +exports.ER_CUT_VALUE_GROUP_CONCAT = 1260; +exports.ER_WARN_TOO_FEW_RECORDS = 1261; +exports.ER_WARN_TOO_MANY_RECORDS = 1262; +exports.ER_WARN_NULL_TO_NOTNULL = 1263; +exports.ER_WARN_DATA_OUT_OF_RANGE = 1264; +exports.WARN_DATA_TRUNCATED = 1265; +exports.ER_WARN_USING_OTHER_HANDLER = 1266; +exports.ER_CANT_AGGREGATE_2COLLATIONS = 1267; +exports.ER_DROP_USER = 1268; +exports.ER_REVOKE_GRANTS = 1269; +exports.ER_CANT_AGGREGATE_3COLLATIONS = 1270; +exports.ER_CANT_AGGREGATE_NCOLLATIONS = 1271; +exports.ER_VARIABLE_IS_NOT_STRUCT = 1272; +exports.ER_UNKNOWN_COLLATION = 1273; +exports.ER_SLAVE_IGNORED_SSL_PARAMS = 1274; +exports.ER_SERVER_IS_IN_SECURE_AUTH_MODE = 1275; +exports.ER_WARN_FIELD_RESOLVED = 1276; +exports.ER_BAD_SLAVE_UNTIL_COND = 1277; +exports.ER_MISSING_SKIP_SLAVE = 1278; +exports.ER_UNTIL_COND_IGNORED = 1279; +exports.ER_WRONG_NAME_FOR_INDEX = 1280; +exports.ER_WRONG_NAME_FOR_CATALOG = 1281; +exports.ER_WARN_QC_RESIZE = 1282; +exports.ER_BAD_FT_COLUMN = 1283; +exports.ER_UNKNOWN_KEY_CACHE = 1284; +exports.ER_WARN_HOSTNAME_WONT_WORK = 1285; +exports.ER_UNKNOWN_STORAGE_ENGINE = 1286; +exports.ER_WARN_DEPRECATED_SYNTAX = 1287; +exports.ER_NON_UPDATABLE_TABLE = 1288; +exports.ER_FEATURE_DISABLED = 1289; +exports.ER_OPTION_PREVENTS_STATEMENT = 1290; +exports.ER_DUPLICATED_VALUE_IN_TYPE = 1291; +exports.ER_TRUNCATED_WRONG_VALUE = 1292; +exports.ER_TOO_MUCH_AUTO_TIMESTAMP_COLS = 1293; +exports.ER_INVALID_ON_UPDATE = 1294; +exports.ER_UNSUPPORTED_PS = 1295; +exports.ER_GET_ERRMSG = 1296; +exports.ER_GET_TEMPORARY_ERRMSG = 1297; +exports.ER_UNKNOWN_TIME_ZONE = 1298; +exports.ER_WARN_INVALID_TIMESTAMP = 1299; +exports.ER_INVALID_CHARACTER_STRING = 1300; +exports.ER_WARN_ALLOWED_PACKET_OVERFLOWED = 1301; +exports.ER_CONFLICTING_DECLARATIONS = 1302; +exports.ER_SP_NO_RECURSIVE_CREATE = 1303; +exports.ER_SP_ALREADY_EXISTS = 1304; +exports.ER_SP_DOES_NOT_EXIST = 1305; +exports.ER_SP_DROP_FAILED = 1306; +exports.ER_SP_STORE_FAILED = 1307; +exports.ER_SP_LILABEL_MISMATCH = 1308; +exports.ER_SP_LABEL_REDEFINE = 1309; +exports.ER_SP_LABEL_MISMATCH = 1310; +exports.ER_SP_UNINIT_VAR = 1311; +exports.ER_SP_BADSELECT = 1312; +exports.ER_SP_BADRETURN = 1313; +exports.ER_SP_BADSTATEMENT = 1314; +exports.ER_UPDATE_LOG_DEPRECATED_IGNORED = 1315; +exports.ER_UPDATE_LOG_DEPRECATED_TRANSLATED = 1316; +exports.ER_QUERY_INTERRUPTED = 1317; +exports.ER_SP_WRONG_NO_OF_ARGS = 1318; +exports.ER_SP_COND_MISMATCH = 1319; +exports.ER_SP_NORETURN = 1320; +exports.ER_SP_NORETURNEND = 1321; +exports.ER_SP_BAD_CURSOR_QUERY = 1322; +exports.ER_SP_BAD_CURSOR_SELECT = 1323; +exports.ER_SP_CURSOR_MISMATCH = 1324; +exports.ER_SP_CURSOR_ALREADY_OPEN = 1325; +exports.ER_SP_CURSOR_NOT_OPEN = 1326; +exports.ER_SP_UNDECLARED_VAR = 1327; +exports.ER_SP_WRONG_NO_OF_FETCH_ARGS = 1328; +exports.ER_SP_FETCH_NO_DATA = 1329; +exports.ER_SP_DUP_PARAM = 1330; +exports.ER_SP_DUP_VAR = 1331; +exports.ER_SP_DUP_COND = 1332; +exports.ER_SP_DUP_CURS = 1333; +exports.ER_SP_CANT_ALTER = 1334; +exports.ER_SP_SUBSELECT_NYI = 1335; +exports.ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG = 1336; +exports.ER_SP_VARCOND_AFTER_CURSHNDLR = 1337; +exports.ER_SP_CURSOR_AFTER_HANDLER = 1338; +exports.ER_SP_CASE_NOT_FOUND = 1339; +exports.ER_FPARSER_TOO_BIG_FILE = 1340; +exports.ER_FPARSER_BAD_HEADER = 1341; +exports.ER_FPARSER_EOF_IN_COMMENT = 1342; +exports.ER_FPARSER_ERROR_IN_PARAMETER = 1343; +exports.ER_FPARSER_EOF_IN_UNKNOWN_PARAMETER = 1344; +exports.ER_VIEW_NO_EXPLAIN = 1345; +exports.ER_FRM_UNKNOWN_TYPE = 1346; +exports.ER_WRONG_OBJECT = 1347; +exports.ER_NONUPDATEABLE_COLUMN = 1348; +exports.ER_VIEW_SELECT_DERIVED = 1349; +exports.ER_VIEW_SELECT_CLAUSE = 1350; +exports.ER_VIEW_SELECT_VARIABLE = 1351; +exports.ER_VIEW_SELECT_TMPTABLE = 1352; +exports.ER_VIEW_WRONG_LIST = 1353; +exports.ER_WARN_VIEW_MERGE = 1354; +exports.ER_WARN_VIEW_WITHOUT_KEY = 1355; +exports.ER_VIEW_INVALID = 1356; +exports.ER_SP_NO_DROP_SP = 1357; +exports.ER_SP_GOTO_IN_HNDLR = 1358; +exports.ER_TRG_ALREADY_EXISTS = 1359; +exports.ER_TRG_DOES_NOT_EXIST = 1360; +exports.ER_TRG_ON_VIEW_OR_TEMP_TABLE = 1361; +exports.ER_TRG_CANT_CHANGE_ROW = 1362; +exports.ER_TRG_NO_SUCH_ROW_IN_TRG = 1363; +exports.ER_NO_DEFAULT_FOR_FIELD = 1364; +exports.ER_DIVISION_BY_ZERO = 1365; +exports.ER_TRUNCATED_WRONG_VALUE_FOR_FIELD = 1366; +exports.ER_ILLEGAL_VALUE_FOR_TYPE = 1367; +exports.ER_VIEW_NONUPD_CHECK = 1368; +exports.ER_VIEW_CHECK_FAILED = 1369; +exports.ER_PROCACCESS_DENIED_ERROR = 1370; +exports.ER_RELAY_LOG_FAIL = 1371; +exports.ER_PASSWD_LENGTH = 1372; +exports.ER_UNKNOWN_TARGET_BINLOG = 1373; +exports.ER_IO_ERR_LOG_INDEX_READ = 1374; +exports.ER_BINLOG_PURGE_PROHIBITED = 1375; +exports.ER_FSEEK_FAIL = 1376; +exports.ER_BINLOG_PURGE_FATAL_ERR = 1377; +exports.ER_LOG_IN_USE = 1378; +exports.ER_LOG_PURGE_UNKNOWN_ERR = 1379; +exports.ER_RELAY_LOG_INIT = 1380; +exports.ER_NO_BINARY_LOGGING = 1381; +exports.ER_RESERVED_SYNTAX = 1382; +exports.ER_WSAS_FAILED = 1383; +exports.ER_DIFF_GROUPS_PROC = 1384; +exports.ER_NO_GROUP_FOR_PROC = 1385; +exports.ER_ORDER_WITH_PROC = 1386; +exports.ER_LOGGING_PROHIBIT_CHANGING_OF = 1387; +exports.ER_NO_FILE_MAPPING = 1388; +exports.ER_WRONG_MAGIC = 1389; +exports.ER_PS_MANY_PARAM = 1390; +exports.ER_KEY_PART_0 = 1391; +exports.ER_VIEW_CHECKSUM = 1392; +exports.ER_VIEW_MULTIUPDATE = 1393; +exports.ER_VIEW_NO_INSERT_FIELD_LIST = 1394; +exports.ER_VIEW_DELETE_MERGE_VIEW = 1395; +exports.ER_CANNOT_USER = 1396; +exports.ER_XAER_NOTA = 1397; +exports.ER_XAER_INVAL = 1398; +exports.ER_XAER_RMFAIL = 1399; +exports.ER_XAER_OUTSIDE = 1400; +exports.ER_XAER_RMERR = 1401; +exports.ER_XA_RBROLLBACK = 1402; +exports.ER_NONEXISTING_PROC_GRANT = 1403; +exports.ER_PROC_AUTO_GRANT_FAIL = 1404; +exports.ER_PROC_AUTO_REVOKE_FAIL = 1405; +exports.ER_DATA_TOO_LONG = 1406; +exports.ER_SP_BAD_SQLSTATE = 1407; +exports.ER_STARTUP = 1408; +exports.ER_LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR = 1409; +exports.ER_CANT_CREATE_USER_WITH_GRANT = 1410; +exports.ER_WRONG_VALUE_FOR_TYPE = 1411; +exports.ER_TABLE_DEF_CHANGED = 1412; +exports.ER_SP_DUP_HANDLER = 1413; +exports.ER_SP_NOT_VAR_ARG = 1414; +exports.ER_SP_NO_RETSET = 1415; +exports.ER_CANT_CREATE_GEOMETRY_OBJECT = 1416; +exports.ER_FAILED_ROUTINE_BREAK_BINLOG = 1417; +exports.ER_BINLOG_UNSAFE_ROUTINE = 1418; +exports.ER_BINLOG_CREATE_ROUTINE_NEED_SUPER = 1419; +exports.ER_EXEC_STMT_WITH_OPEN_CURSOR = 1420; +exports.ER_STMT_HAS_NO_OPEN_CURSOR = 1421; +exports.ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG = 1422; +exports.ER_NO_DEFAULT_FOR_VIEW_FIELD = 1423; +exports.ER_SP_NO_RECURSION = 1424; +exports.ER_TOO_BIG_SCALE = 1425; +exports.ER_TOO_BIG_PRECISION = 1426; +exports.ER_M_BIGGER_THAN_D = 1427; +exports.ER_WRONG_LOCK_OF_SYSTEM_TABLE = 1428; +exports.ER_CONNECT_TO_FOREIGN_DATA_SOURCE = 1429; +exports.ER_QUERY_ON_FOREIGN_DATA_SOURCE = 1430; +exports.ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST = 1431; +exports.ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE = 1432; +exports.ER_FOREIGN_DATA_STRING_INVALID = 1433; +exports.ER_CANT_CREATE_FEDERATED_TABLE = 1434; +exports.ER_TRG_IN_WRONG_SCHEMA = 1435; +exports.ER_STACK_OVERRUN_NEED_MORE = 1436; +exports.ER_TOO_LONG_BODY = 1437; +exports.ER_WARN_CANT_DROP_DEFAULT_KEYCACHE = 1438; +exports.ER_TOO_BIG_DISPLAYWIDTH = 1439; +exports.ER_XAER_DUPID = 1440; +exports.ER_DATETIME_FUNCTION_OVERFLOW = 1441; +exports.ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG = 1442; +exports.ER_VIEW_PREVENT_UPDATE = 1443; +exports.ER_PS_NO_RECURSION = 1444; +exports.ER_SP_CANT_SET_AUTOCOMMIT = 1445; +exports.ER_MALFORMED_DEFINER = 1446; +exports.ER_VIEW_FRM_NO_USER = 1447; +exports.ER_VIEW_OTHER_USER = 1448; +exports.ER_NO_SUCH_USER = 1449; +exports.ER_FORBID_SCHEMA_CHANGE = 1450; +exports.ER_ROW_IS_REFERENCED_2 = 1451; +exports.ER_NO_REFERENCED_ROW_2 = 1452; +exports.ER_SP_BAD_VAR_SHADOW = 1453; +exports.ER_TRG_NO_DEFINER = 1454; +exports.ER_OLD_FILE_FORMAT = 1455; +exports.ER_SP_RECURSION_LIMIT = 1456; +exports.ER_SP_PROC_TABLE_CORRUPT = 1457; +exports.ER_SP_WRONG_NAME = 1458; +exports.ER_TABLE_NEEDS_UPGRADE = 1459; +exports.ER_SP_NO_AGGREGATE = 1460; +exports.ER_MAX_PREPARED_STMT_COUNT_REACHED = 1461; +exports.ER_VIEW_RECURSIVE = 1462; +exports.ER_NON_GROUPING_FIELD_USED = 1463; +exports.ER_TABLE_CANT_HANDLE_SPKEYS = 1464; +exports.ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA = 1465; +exports.ER_REMOVED_SPACES = 1466; +exports.ER_AUTOINC_READ_FAILED = 1467; +exports.ER_USERNAME = 1468; +exports.ER_HOSTNAME = 1469; +exports.ER_WRONG_STRING_LENGTH = 1470; +exports.ER_NON_INSERTABLE_TABLE = 1471; +exports.ER_ADMIN_WRONG_MRG_TABLE = 1472; +exports.ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT = 1473; +exports.ER_NAME_BECOMES_EMPTY = 1474; +exports.ER_AMBIGUOUS_FIELD_TERM = 1475; +exports.ER_FOREIGN_SERVER_EXISTS = 1476; +exports.ER_FOREIGN_SERVER_DOESNT_EXIST = 1477; +exports.ER_ILLEGAL_HA_CREATE_OPTION = 1478; +exports.ER_PARTITION_REQUIRES_VALUES_ERROR = 1479; +exports.ER_PARTITION_WRONG_VALUES_ERROR = 1480; +exports.ER_PARTITION_MAXVALUE_ERROR = 1481; +exports.ER_PARTITION_SUBPARTITION_ERROR = 1482; +exports.ER_PARTITION_SUBPART_MIX_ERROR = 1483; +exports.ER_PARTITION_WRONG_NO_PART_ERROR = 1484; +exports.ER_PARTITION_WRONG_NO_SUBPART_ERROR = 1485; +exports.ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR = 1486; +exports.ER_NO_CONST_EXPR_IN_RANGE_OR_LIST_ERROR = 1487; +exports.ER_FIELD_NOT_FOUND_PART_ERROR = 1488; +exports.ER_LIST_OF_FIELDS_ONLY_IN_HASH_ERROR = 1489; +exports.ER_INCONSISTENT_PARTITION_INFO_ERROR = 1490; +exports.ER_PARTITION_FUNC_NOT_ALLOWED_ERROR = 1491; +exports.ER_PARTITIONS_MUST_BE_DEFINED_ERROR = 1492; +exports.ER_RANGE_NOT_INCREASING_ERROR = 1493; +exports.ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR = 1494; +exports.ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR = 1495; +exports.ER_PARTITION_ENTRY_ERROR = 1496; +exports.ER_MIX_HANDLER_ERROR = 1497; +exports.ER_PARTITION_NOT_DEFINED_ERROR = 1498; +exports.ER_TOO_MANY_PARTITIONS_ERROR = 1499; +exports.ER_SUBPARTITION_ERROR = 1500; +exports.ER_CANT_CREATE_HANDLER_FILE = 1501; +exports.ER_BLOB_FIELD_IN_PART_FUNC_ERROR = 1502; +exports.ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF = 1503; +exports.ER_NO_PARTS_ERROR = 1504; +exports.ER_PARTITION_MGMT_ON_NONPARTITIONED = 1505; +exports.ER_FOREIGN_KEY_ON_PARTITIONED = 1506; +exports.ER_DROP_PARTITION_NON_EXISTENT = 1507; +exports.ER_DROP_LAST_PARTITION = 1508; +exports.ER_COALESCE_ONLY_ON_HASH_PARTITION = 1509; +exports.ER_REORG_HASH_ONLY_ON_SAME_NO = 1510; +exports.ER_REORG_NO_PARAM_ERROR = 1511; +exports.ER_ONLY_ON_RANGE_LIST_PARTITION = 1512; +exports.ER_ADD_PARTITION_SUBPART_ERROR = 1513; +exports.ER_ADD_PARTITION_NO_NEW_PARTITION = 1514; +exports.ER_COALESCE_PARTITION_NO_PARTITION = 1515; +exports.ER_REORG_PARTITION_NOT_EXIST = 1516; +exports.ER_SAME_NAME_PARTITION = 1517; +exports.ER_NO_BINLOG_ERROR = 1518; +exports.ER_CONSECUTIVE_REORG_PARTITIONS = 1519; +exports.ER_REORG_OUTSIDE_RANGE = 1520; +exports.ER_PARTITION_FUNCTION_FAILURE = 1521; +exports.ER_PART_STATE_ERROR = 1522; +exports.ER_LIMITED_PART_RANGE = 1523; +exports.ER_PLUGIN_IS_NOT_LOADED = 1524; +exports.ER_WRONG_VALUE = 1525; +exports.ER_NO_PARTITION_FOR_GIVEN_VALUE = 1526; +exports.ER_FILEGROUP_OPTION_ONLY_ONCE = 1527; +exports.ER_CREATE_FILEGROUP_FAILED = 1528; +exports.ER_DROP_FILEGROUP_FAILED = 1529; +exports.ER_TABLESPACE_AUTO_EXTEND_ERROR = 1530; +exports.ER_WRONG_SIZE_NUMBER = 1531; +exports.ER_SIZE_OVERFLOW_ERROR = 1532; +exports.ER_ALTER_FILEGROUP_FAILED = 1533; +exports.ER_BINLOG_ROW_LOGGING_FAILED = 1534; +exports.ER_BINLOG_ROW_WRONG_TABLE_DEF = 1535; +exports.ER_BINLOG_ROW_RBR_TO_SBR = 1536; +exports.ER_EVENT_ALREADY_EXISTS = 1537; +exports.ER_EVENT_STORE_FAILED = 1538; +exports.ER_EVENT_DOES_NOT_EXIST = 1539; +exports.ER_EVENT_CANT_ALTER = 1540; +exports.ER_EVENT_DROP_FAILED = 1541; +exports.ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG = 1542; +exports.ER_EVENT_ENDS_BEFORE_STARTS = 1543; +exports.ER_EVENT_EXEC_TIME_IN_THE_PAST = 1544; +exports.ER_EVENT_OPEN_TABLE_FAILED = 1545; +exports.ER_EVENT_NEITHER_M_EXPR_NOR_M_AT = 1546; +exports.ER_COL_COUNT_DOESNT_MATCH_CORRUPTED = 1547; +exports.ER_CANNOT_LOAD_FROM_TABLE = 1548; +exports.ER_EVENT_CANNOT_DELETE = 1549; +exports.ER_EVENT_COMPILE_ERROR = 1550; +exports.ER_EVENT_SAME_NAME = 1551; +exports.ER_EVENT_DATA_TOO_LONG = 1552; +exports.ER_DROP_INDEX_FK = 1553; +exports.ER_WARN_DEPRECATED_SYNTAX_WITH_VER = 1554; +exports.ER_CANT_WRITE_LOCK_LOG_TABLE = 1555; +exports.ER_CANT_LOCK_LOG_TABLE = 1556; +exports.ER_FOREIGN_DUPLICATE_KEY = 1557; +exports.ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE = 1558; +exports.ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR = 1559; +exports.ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT = 1560; +exports.ER_NDB_CANT_SWITCH_BINLOG_FORMAT = 1561; +exports.ER_PARTITION_NO_TEMPORARY = 1562; +exports.ER_PARTITION_CONST_DOMAIN_ERROR = 1563; +exports.ER_PARTITION_FUNCTION_IS_NOT_ALLOWED = 1564; +exports.ER_DDL_LOG_ERROR = 1565; +exports.ER_NULL_IN_VALUES_LESS_THAN = 1566; +exports.ER_WRONG_PARTITION_NAME = 1567; +exports.ER_CANT_CHANGE_TX_CHARACTERISTICS = 1568; +exports.ER_DUP_ENTRY_AUTOINCREMENT_CASE = 1569; +exports.ER_EVENT_MODIFY_QUEUE_ERROR = 1570; +exports.ER_EVENT_SET_VAR_ERROR = 1571; +exports.ER_PARTITION_MERGE_ERROR = 1572; +exports.ER_CANT_ACTIVATE_LOG = 1573; +exports.ER_RBR_NOT_AVAILABLE = 1574; +exports.ER_BASE64_DECODE_ERROR = 1575; +exports.ER_EVENT_RECURSION_FORBIDDEN = 1576; +exports.ER_EVENTS_DB_ERROR = 1577; +exports.ER_ONLY_INTEGERS_ALLOWED = 1578; +exports.ER_UNSUPORTED_LOG_ENGINE = 1579; +exports.ER_BAD_LOG_STATEMENT = 1580; +exports.ER_CANT_RENAME_LOG_TABLE = 1581; +exports.ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT = 1582; +exports.ER_WRONG_PARAMETERS_TO_NATIVE_FCT = 1583; +exports.ER_WRONG_PARAMETERS_TO_STORED_FCT = 1584; +exports.ER_NATIVE_FCT_NAME_COLLISION = 1585; +exports.ER_DUP_ENTRY_WITH_KEY_NAME = 1586; +exports.ER_BINLOG_PURGE_EMFILE = 1587; +exports.ER_EVENT_CANNOT_CREATE_IN_THE_PAST = 1588; +exports.ER_EVENT_CANNOT_ALTER_IN_THE_PAST = 1589; +exports.ER_SLAVE_INCIDENT = 1590; +exports.ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT = 1591; +exports.ER_BINLOG_UNSAFE_STATEMENT = 1592; +exports.ER_SLAVE_FATAL_ERROR = 1593; +exports.ER_SLAVE_RELAY_LOG_READ_FAILURE = 1594; +exports.ER_SLAVE_RELAY_LOG_WRITE_FAILURE = 1595; +exports.ER_SLAVE_CREATE_EVENT_FAILURE = 1596; +exports.ER_SLAVE_MASTER_COM_FAILURE = 1597; +exports.ER_BINLOG_LOGGING_IMPOSSIBLE = 1598; +exports.ER_VIEW_NO_CREATION_CTX = 1599; +exports.ER_VIEW_INVALID_CREATION_CTX = 1600; +exports.ER_SR_INVALID_CREATION_CTX = 1601; +exports.ER_TRG_CORRUPTED_FILE = 1602; +exports.ER_TRG_NO_CREATION_CTX = 1603; +exports.ER_TRG_INVALID_CREATION_CTX = 1604; +exports.ER_EVENT_INVALID_CREATION_CTX = 1605; +exports.ER_TRG_CANT_OPEN_TABLE = 1606; +exports.ER_CANT_CREATE_SROUTINE = 1607; +exports.ER_NEVER_USED = 1608; +exports.ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT = 1609; +exports.ER_SLAVE_CORRUPT_EVENT = 1610; +exports.ER_LOAD_DATA_INVALID_COLUMN = 1611; +exports.ER_LOG_PURGE_NO_FILE = 1612; +exports.ER_XA_RBTIMEOUT = 1613; +exports.ER_XA_RBDEADLOCK = 1614; +exports.ER_NEED_REPREPARE = 1615; +exports.ER_DELAYED_NOT_SUPPORTED = 1616; +exports.WARN_NO_MASTER_INFO = 1617; +exports.WARN_OPTION_IGNORED = 1618; +exports.ER_PLUGIN_DELETE_BUILTIN = 1619; +exports.WARN_PLUGIN_BUSY = 1620; +exports.ER_VARIABLE_IS_READONLY = 1621; +exports.ER_WARN_ENGINE_TRANSACTION_ROLLBACK = 1622; +exports.ER_SLAVE_HEARTBEAT_FAILURE = 1623; +exports.ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE = 1624; +exports.ER_NDB_REPLICATION_SCHEMA_ERROR = 1625; +exports.ER_CONFLICT_FN_PARSE_ERROR = 1626; +exports.ER_EXCEPTIONS_WRITE_ERROR = 1627; +exports.ER_TOO_LONG_TABLE_COMMENT = 1628; +exports.ER_TOO_LONG_FIELD_COMMENT = 1629; +exports.ER_FUNC_INEXISTENT_NAME_COLLISION = 1630; +exports.ER_DATABASE_NAME = 1631; +exports.ER_TABLE_NAME = 1632; +exports.ER_PARTITION_NAME = 1633; +exports.ER_SUBPARTITION_NAME = 1634; +exports.ER_TEMPORARY_NAME = 1635; +exports.ER_RENAMED_NAME = 1636; +exports.ER_TOO_MANY_CONCURRENT_TRXS = 1637; +exports.WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED = 1638; +exports.ER_DEBUG_SYNC_TIMEOUT = 1639; +exports.ER_DEBUG_SYNC_HIT_LIMIT = 1640; +exports.ER_DUP_SIGNAL_SET = 1641; +exports.ER_SIGNAL_WARN = 1642; +exports.ER_SIGNAL_NOT_FOUND = 1643; +exports.ER_SIGNAL_EXCEPTION = 1644; +exports.ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER = 1645; +exports.ER_SIGNAL_BAD_CONDITION_TYPE = 1646; +exports.WARN_COND_ITEM_TRUNCATED = 1647; +exports.ER_COND_ITEM_TOO_LONG = 1648; +exports.ER_UNKNOWN_LOCALE = 1649; +exports.ER_SLAVE_IGNORE_SERVER_IDS = 1650; +exports.ER_QUERY_CACHE_DISABLED = 1651; +exports.ER_SAME_NAME_PARTITION_FIELD = 1652; +exports.ER_PARTITION_COLUMN_LIST_ERROR = 1653; +exports.ER_WRONG_TYPE_COLUMN_VALUE_ERROR = 1654; +exports.ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR = 1655; +exports.ER_MAXVALUE_IN_VALUES_IN = 1656; +exports.ER_TOO_MANY_VALUES_ERROR = 1657; +exports.ER_ROW_SINGLE_PARTITION_FIELD_ERROR = 1658; +exports.ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD = 1659; +exports.ER_PARTITION_FIELDS_TOO_LONG = 1660; +exports.ER_BINLOG_ROW_ENGINE_AND_STMT_ENGINE = 1661; +exports.ER_BINLOG_ROW_MODE_AND_STMT_ENGINE = 1662; +exports.ER_BINLOG_UNSAFE_AND_STMT_ENGINE = 1663; +exports.ER_BINLOG_ROW_INJECTION_AND_STMT_ENGINE = 1664; +exports.ER_BINLOG_STMT_MODE_AND_ROW_ENGINE = 1665; +exports.ER_BINLOG_ROW_INJECTION_AND_STMT_MODE = 1666; +exports.ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE = 1667; +exports.ER_BINLOG_UNSAFE_LIMIT = 1668; +exports.ER_BINLOG_UNSAFE_INSERT_DELAYED = 1669; +exports.ER_BINLOG_UNSAFE_SYSTEM_TABLE = 1670; +exports.ER_BINLOG_UNSAFE_AUTOINC_COLUMNS = 1671; +exports.ER_BINLOG_UNSAFE_UDF = 1672; +exports.ER_BINLOG_UNSAFE_SYSTEM_VARIABLE = 1673; +exports.ER_BINLOG_UNSAFE_SYSTEM_FUNCTION = 1674; +exports.ER_BINLOG_UNSAFE_NONTRANS_AFTER_TRANS = 1675; +exports.ER_MESSAGE_AND_STATEMENT = 1676; +exports.ER_SLAVE_CONVERSION_FAILED = 1677; +exports.ER_SLAVE_CANT_CREATE_CONVERSION = 1678; +exports.ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT = 1679; +exports.ER_PATH_LENGTH = 1680; +exports.ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT = 1681; +exports.ER_WRONG_NATIVE_TABLE_STRUCTURE = 1682; +exports.ER_WRONG_PERFSCHEMA_USAGE = 1683; +exports.ER_WARN_I_S_SKIPPED_TABLE = 1684; +exports.ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT = 1685; +exports.ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_DIRECT = 1686; +exports.ER_SPATIAL_MUST_HAVE_GEOM_COL = 1687; +exports.ER_TOO_LONG_INDEX_COMMENT = 1688; +exports.ER_LOCK_ABORTED = 1689; +exports.ER_DATA_OUT_OF_RANGE = 1690; +exports.ER_WRONG_SPVAR_TYPE_IN_LIMIT = 1691; +exports.ER_BINLOG_UNSAFE_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE = 1692; +exports.ER_BINLOG_UNSAFE_MIXED_STATEMENT = 1693; +exports.ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SQL_LOG_BIN = 1694; +exports.ER_STORED_FUNCTION_PREVENTS_SWITCH_SQL_LOG_BIN = 1695; +exports.ER_FAILED_READ_FROM_PAR_FILE = 1696; +exports.ER_VALUES_IS_NOT_INT_TYPE_ERROR = 1697; +exports.ER_ACCESS_DENIED_NO_PASSWORD_ERROR = 1698; +exports.ER_SET_PASSWORD_AUTH_PLUGIN = 1699; +exports.ER_GRANT_PLUGIN_USER_EXISTS = 1700; +exports.ER_TRUNCATE_ILLEGAL_FK = 1701; +exports.ER_PLUGIN_IS_PERMANENT = 1702; +exports.ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN = 1703; +exports.ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX = 1704; +exports.ER_STMT_CACHE_FULL = 1705; +exports.ER_MULTI_UPDATE_KEY_CONFLICT = 1706; +exports.ER_TABLE_NEEDS_REBUILD = 1707; +exports.WARN_OPTION_BELOW_LIMIT = 1708; +exports.ER_INDEX_COLUMN_TOO_LONG = 1709; +exports.ER_ERROR_IN_TRIGGER_BODY = 1710; +exports.ER_ERROR_IN_UNKNOWN_TRIGGER_BODY = 1711; +exports.ER_INDEX_CORRUPT = 1712; +exports.ER_UNDO_RECORD_TOO_BIG = 1713; +exports.ER_BINLOG_UNSAFE_INSERT_IGNORE_SELECT = 1714; +exports.ER_BINLOG_UNSAFE_INSERT_SELECT_UPDATE = 1715; +exports.ER_BINLOG_UNSAFE_REPLACE_SELECT = 1716; +exports.ER_BINLOG_UNSAFE_CREATE_IGNORE_SELECT = 1717; +exports.ER_BINLOG_UNSAFE_CREATE_REPLACE_SELECT = 1718; +exports.ER_BINLOG_UNSAFE_UPDATE_IGNORE = 1719; +exports.ER_PLUGIN_NO_UNINSTALL = 1720; +exports.ER_PLUGIN_NO_INSTALL = 1721; +exports.ER_BINLOG_UNSAFE_WRITE_AUTOINC_SELECT = 1722; +exports.ER_BINLOG_UNSAFE_CREATE_SELECT_AUTOINC = 1723; +exports.ER_BINLOG_UNSAFE_INSERT_TWO_KEYS = 1724; +exports.ER_TABLE_IN_FK_CHECK = 1725; +exports.ER_UNSUPPORTED_ENGINE = 1726; +exports.ER_BINLOG_UNSAFE_AUTOINC_NOT_FIRST = 1727; +exports.ER_CANNOT_LOAD_FROM_TABLE_V2 = 1728; +exports.ER_MASTER_DELAY_VALUE_OUT_OF_RANGE = 1729; +exports.ER_ONLY_FD_AND_RBR_EVENTS_ALLOWED_IN_BINLOG_STATEMENT = 1730; +exports.ER_PARTITION_EXCHANGE_DIFFERENT_OPTION = 1731; +exports.ER_PARTITION_EXCHANGE_PART_TABLE = 1732; +exports.ER_PARTITION_EXCHANGE_TEMP_TABLE = 1733; +exports.ER_PARTITION_INSTEAD_OF_SUBPARTITION = 1734; +exports.ER_UNKNOWN_PARTITION = 1735; +exports.ER_TABLES_DIFFERENT_METADATA = 1736; +exports.ER_ROW_DOES_NOT_MATCH_PARTITION = 1737; +exports.ER_BINLOG_CACHE_SIZE_GREATER_THAN_MAX = 1738; +exports.ER_WARN_INDEX_NOT_APPLICABLE = 1739; +exports.ER_PARTITION_EXCHANGE_FOREIGN_KEY = 1740; +exports.ER_NO_SUCH_KEY_VALUE = 1741; +exports.ER_RPL_INFO_DATA_TOO_LONG = 1742; +exports.ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE = 1743; +exports.ER_BINLOG_READ_EVENT_CHECKSUM_FAILURE = 1744; +exports.ER_BINLOG_STMT_CACHE_SIZE_GREATER_THAN_MAX = 1745; +exports.ER_CANT_UPDATE_TABLE_IN_CREATE_TABLE_SELECT = 1746; +exports.ER_PARTITION_CLAUSE_ON_NONPARTITIONED = 1747; +exports.ER_ROW_DOES_NOT_MATCH_GIVEN_PARTITION_SET = 1748; +exports.ER_NO_SUCH_PARTITION = 1749; +exports.ER_CHANGE_RPL_INFO_REPOSITORY_FAILURE = 1750; +exports.ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_CREATED_TEMP_TABLE = 1751; +exports.ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_DROPPED_TEMP_TABLE = 1752; +exports.ER_MTS_FEATURE_IS_NOT_SUPPORTED = 1753; +exports.ER_MTS_UPDATED_DBS_GREATER_MAX = 1754; +exports.ER_MTS_CANT_PARALLEL = 1755; +exports.ER_MTS_INCONSISTENT_DATA = 1756; +exports.ER_FULLTEXT_NOT_SUPPORTED_WITH_PARTITIONING = 1757; +exports.ER_DA_INVALID_CONDITION_NUMBER = 1758; +exports.ER_INSECURE_PLAIN_TEXT = 1759; +exports.ER_INSECURE_CHANGE_MASTER = 1760; +exports.ER_FOREIGN_DUPLICATE_KEY_WITH_CHILD_INFO = 1761; +exports.ER_FOREIGN_DUPLICATE_KEY_WITHOUT_CHILD_INFO = 1762; +exports.ER_SQLTHREAD_WITH_SECURE_SLAVE = 1763; +exports.ER_TABLE_HAS_NO_FT = 1764; +exports.ER_VARIABLE_NOT_SETTABLE_IN_SF_OR_TRIGGER = 1765; +exports.ER_VARIABLE_NOT_SETTABLE_IN_TRANSACTION = 1766; +exports.ER_GTID_NEXT_IS_NOT_IN_GTID_NEXT_LIST = 1767; +exports.ER_CANT_CHANGE_GTID_NEXT_IN_TRANSACTION = 1768; +exports.ER_SET_STATEMENT_CANNOT_INVOKE_FUNCTION = 1769; +exports.ER_GTID_NEXT_CANT_BE_AUTOMATIC_IF_GTID_NEXT_LIST_IS_NON_NULL = 1770; +exports.ER_SKIPPING_LOGGED_TRANSACTION = 1771; +exports.ER_MALFORMED_GTID_SET_SPECIFICATION = 1772; +exports.ER_MALFORMED_GTID_SET_ENCODING = 1773; +exports.ER_MALFORMED_GTID_SPECIFICATION = 1774; +exports.ER_GNO_EXHAUSTED = 1775; +exports.ER_BAD_SLAVE_AUTO_POSITION = 1776; +exports.ER_AUTO_POSITION_REQUIRES_GTID_MODE_NOT_OFF = 1777; +exports.ER_CANT_DO_IMPLICIT_COMMIT_IN_TRX_WHEN_GTID_NEXT_IS_SET = 1778; +exports.ER_GTID_MODE_ON_REQUIRES_ENFORCE_GTID_CONSISTENCY_ON = 1779; +exports.ER_GTID_MODE_REQUIRES_BINLOG = 1780; +exports.ER_CANT_SET_GTID_NEXT_TO_GTID_WHEN_GTID_MODE_IS_OFF = 1781; +exports.ER_CANT_SET_GTID_NEXT_TO_ANONYMOUS_WHEN_GTID_MODE_IS_ON = 1782; +exports.ER_CANT_SET_GTID_NEXT_LIST_TO_NON_NULL_WHEN_GTID_MODE_IS_OFF = 1783; +exports.ER_FOUND_GTID_EVENT_WHEN_GTID_MODE_IS_OFF = 1784; +exports.ER_GTID_UNSAFE_NON_TRANSACTIONAL_TABLE = 1785; +exports.ER_GTID_UNSAFE_CREATE_SELECT = 1786; +exports.ER_GTID_UNSAFE_CREATE_DROP_TEMPORARY_TABLE_IN_TRANSACTION = 1787; +exports.ER_GTID_MODE_CAN_ONLY_CHANGE_ONE_STEP_AT_A_TIME = 1788; +exports.ER_MASTER_HAS_PURGED_REQUIRED_GTIDS = 1789; +exports.ER_CANT_SET_GTID_NEXT_WHEN_OWNING_GTID = 1790; +exports.ER_UNKNOWN_EXPLAIN_FORMAT = 1791; +exports.ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION = 1792; +exports.ER_TOO_LONG_TABLE_PARTITION_COMMENT = 1793; +exports.ER_SLAVE_CONFIGURATION = 1794; +exports.ER_INNODB_FT_LIMIT = 1795; +exports.ER_INNODB_NO_FT_TEMP_TABLE = 1796; +exports.ER_INNODB_FT_WRONG_DOCID_COLUMN = 1797; +exports.ER_INNODB_FT_WRONG_DOCID_INDEX = 1798; +exports.ER_INNODB_ONLINE_LOG_TOO_BIG = 1799; +exports.ER_UNKNOWN_ALTER_ALGORITHM = 1800; +exports.ER_UNKNOWN_ALTER_LOCK = 1801; +exports.ER_MTS_CHANGE_MASTER_CANT_RUN_WITH_GAPS = 1802; +exports.ER_MTS_RECOVERY_FAILURE = 1803; +exports.ER_MTS_RESET_WORKERS = 1804; +exports.ER_COL_COUNT_DOESNT_MATCH_CORRUPTED_V2 = 1805; +exports.ER_SLAVE_SILENT_RETRY_TRANSACTION = 1806; +exports.ER_DISCARD_FK_CHECKS_RUNNING = 1807; +exports.ER_TABLE_SCHEMA_MISMATCH = 1808; +exports.ER_TABLE_IN_SYSTEM_TABLESPACE = 1809; +exports.ER_IO_READ_ERROR = 1810; +exports.ER_IO_WRITE_ERROR = 1811; +exports.ER_TABLESPACE_MISSING = 1812; +exports.ER_TABLESPACE_EXISTS = 1813; +exports.ER_TABLESPACE_DISCARDED = 1814; +exports.ER_INTERNAL_ERROR = 1815; +exports.ER_INNODB_IMPORT_ERROR = 1816; +exports.ER_INNODB_INDEX_CORRUPT = 1817; +exports.ER_INVALID_YEAR_COLUMN_LENGTH = 1818; +exports.ER_NOT_VALID_PASSWORD = 1819; +exports.ER_MUST_CHANGE_PASSWORD = 1820; +exports.ER_FK_NO_INDEX_CHILD = 1821; +exports.ER_FK_NO_INDEX_PARENT = 1822; +exports.ER_FK_FAIL_ADD_SYSTEM = 1823; +exports.ER_FK_CANNOT_OPEN_PARENT = 1824; +exports.ER_FK_INCORRECT_OPTION = 1825; +exports.ER_FK_DUP_NAME = 1826; +exports.ER_PASSWORD_FORMAT = 1827; +exports.ER_FK_COLUMN_CANNOT_DROP = 1828; +exports.ER_FK_COLUMN_CANNOT_DROP_CHILD = 1829; +exports.ER_FK_COLUMN_NOT_NULL = 1830; +exports.ER_DUP_INDEX = 1831; +exports.ER_FK_COLUMN_CANNOT_CHANGE = 1832; +exports.ER_FK_COLUMN_CANNOT_CHANGE_CHILD = 1833; +exports.ER_FK_CANNOT_DELETE_PARENT = 1834; +exports.ER_MALFORMED_PACKET = 1835; +exports.ER_READ_ONLY_MODE = 1836; +exports.ER_GTID_NEXT_TYPE_UNDEFINED_GROUP = 1837; +exports.ER_VARIABLE_NOT_SETTABLE_IN_SP = 1838; +exports.ER_CANT_SET_GTID_PURGED_WHEN_GTID_MODE_IS_OFF = 1839; +exports.ER_CANT_SET_GTID_PURGED_WHEN_GTID_EXECUTED_IS_NOT_EMPTY = 1840; +exports.ER_CANT_SET_GTID_PURGED_WHEN_OWNED_GTIDS_IS_NOT_EMPTY = 1841; +exports.ER_GTID_PURGED_WAS_CHANGED = 1842; +exports.ER_GTID_EXECUTED_WAS_CHANGED = 1843; +exports.ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES = 1844; +exports.ER_ALTER_OPERATION_NOT_SUPPORTED = 1845; +exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON = 1846; +exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COPY = 1847; +exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_PARTITION = 1848; +exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_RENAME = 1849; +exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COLUMN_TYPE = 1850; +exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_CHECK = 1851; +exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_IGNORE = 1852; +exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOPK = 1853; +exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_AUTOINC = 1854; +exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_HIDDEN_FTS = 1855; +exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_CHANGE_FTS = 1856; +exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FTS = 1857; +exports.ER_SQL_SLAVE_SKIP_COUNTER_NOT_SETTABLE_IN_GTID_MODE = 1858; +exports.ER_DUP_UNKNOWN_IN_INDEX = 1859; +exports.ER_IDENT_CAUSES_TOO_LONG_PATH = 1860; +exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOT_NULL = 1861; +exports.ER_MUST_CHANGE_PASSWORD_LOGIN = 1862; +exports.ER_ROW_IN_WRONG_PARTITION = 1863; +exports.ER_MTS_EVENT_BIGGER_PENDING_JOBS_SIZE_MAX = 1864; +exports.ER_INNODB_NO_FT_USES_PARSER = 1865; +exports.ER_BINLOG_LOGICAL_CORRUPTION = 1866; +exports.ER_WARN_PURGE_LOG_IN_USE = 1867; +exports.ER_WARN_PURGE_LOG_IS_ACTIVE = 1868; +exports.ER_AUTO_INCREMENT_CONFLICT = 1869; +exports.WARN_ON_BLOCKHOLE_IN_RBR = 1870; +exports.ER_SLAVE_MI_INIT_REPOSITORY = 1871; +exports.ER_SLAVE_RLI_INIT_REPOSITORY = 1872; +exports.ER_ACCESS_DENIED_CHANGE_USER_ERROR = 1873; +exports.ER_INNODB_READ_ONLY = 1874; +exports.ER_STOP_SLAVE_SQL_THREAD_TIMEOUT = 1875; +exports.ER_STOP_SLAVE_IO_THREAD_TIMEOUT = 1876; +exports.ER_TABLE_CORRUPT = 1877; +exports.ER_TEMP_FILE_WRITE_FAILURE = 1878; +exports.ER_INNODB_FT_AUX_NOT_HEX_ID = 1879; +exports.ER_OLD_TEMPORALS_UPGRADED = 1880; +exports.ER_INNODB_FORCED_RECOVERY = 1881; +exports.ER_AES_INVALID_IV = 1882; +exports.ER_PLUGIN_CANNOT_BE_UNINSTALLED = 1883; +exports.ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_GTID_GROUP = 1884; +exports.ER_SLAVE_HAS_MORE_GTIDS_THAN_MASTER = 1885; +exports.ER_MISSING_KEY = 1886; +exports.WARN_NAMED_PIPE_ACCESS_EVERYONE = 1887; +exports.ER_FOUND_MISSING_GTIDS = 1888; +exports.ER_FILE_CORRUPT = 3000; +exports.ER_ERROR_ON_MASTER = 3001; +exports.ER_INCONSISTENT_ERROR = 3002; +exports.ER_STORAGE_ENGINE_NOT_LOADED = 3003; +exports.ER_GET_STACKED_DA_WITHOUT_ACTIVE_HANDLER = 3004; +exports.ER_WARN_LEGACY_SYNTAX_CONVERTED = 3005; +exports.ER_BINLOG_UNSAFE_FULLTEXT_PLUGIN = 3006; +exports.ER_CANNOT_DISCARD_TEMPORARY_TABLE = 3007; +exports.ER_FK_DEPTH_EXCEEDED = 3008; +exports.ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE_V2 = 3009; +exports.ER_WARN_TRIGGER_DOESNT_HAVE_CREATED = 3010; +exports.ER_REFERENCED_TRG_DOES_NOT_EXIST = 3011; +exports.ER_EXPLAIN_NOT_SUPPORTED = 3012; +exports.ER_INVALID_FIELD_SIZE = 3013; +exports.ER_MISSING_HA_CREATE_OPTION = 3014; +exports.ER_ENGINE_OUT_OF_MEMORY = 3015; +exports.ER_PASSWORD_EXPIRE_ANONYMOUS_USER = 3016; +exports.ER_SLAVE_SQL_THREAD_MUST_STOP = 3017; +exports.ER_NO_FT_MATERIALIZED_SUBQUERY = 3018; +exports.ER_INNODB_UNDO_LOG_FULL = 3019; +exports.ER_INVALID_ARGUMENT_FOR_LOGARITHM = 3020; +exports.ER_SLAVE_CHANNEL_IO_THREAD_MUST_STOP = 3021; +exports.ER_WARN_OPEN_TEMP_TABLES_MUST_BE_ZERO = 3022; +exports.ER_WARN_ONLY_MASTER_LOG_FILE_NO_POS = 3023; +exports.ER_QUERY_TIMEOUT = 3024; +exports.ER_NON_RO_SELECT_DISABLE_TIMER = 3025; +exports.ER_DUP_LIST_ENTRY = 3026; +exports.ER_SQL_MODE_NO_EFFECT = 3027; +exports.ER_AGGREGATE_ORDER_FOR_UNION = 3028; +exports.ER_AGGREGATE_ORDER_NON_AGG_QUERY = 3029; +exports.ER_SLAVE_WORKER_STOPPED_PREVIOUS_THD_ERROR = 3030; +exports.ER_DONT_SUPPORT_SLAVE_PRESERVE_COMMIT_ORDER = 3031; +exports.ER_SERVER_OFFLINE_MODE = 3032; +exports.ER_GIS_DIFFERENT_SRIDS = 3033; +exports.ER_GIS_UNSUPPORTED_ARGUMENT = 3034; +exports.ER_GIS_UNKNOWN_ERROR = 3035; +exports.ER_GIS_UNKNOWN_EXCEPTION = 3036; +exports.ER_GIS_INVALID_DATA = 3037; +exports.ER_BOOST_GEOMETRY_EMPTY_INPUT_EXCEPTION = 3038; +exports.ER_BOOST_GEOMETRY_CENTROID_EXCEPTION = 3039; +exports.ER_BOOST_GEOMETRY_OVERLAY_INVALID_INPUT_EXCEPTION = 3040; +exports.ER_BOOST_GEOMETRY_TURN_INFO_EXCEPTION = 3041; +exports.ER_BOOST_GEOMETRY_SELF_INTERSECTION_POINT_EXCEPTION = 3042; +exports.ER_BOOST_GEOMETRY_UNKNOWN_EXCEPTION = 3043; +exports.ER_STD_BAD_ALLOC_ERROR = 3044; +exports.ER_STD_DOMAIN_ERROR = 3045; +exports.ER_STD_LENGTH_ERROR = 3046; +exports.ER_STD_INVALID_ARGUMENT = 3047; +exports.ER_STD_OUT_OF_RANGE_ERROR = 3048; +exports.ER_STD_OVERFLOW_ERROR = 3049; +exports.ER_STD_RANGE_ERROR = 3050; +exports.ER_STD_UNDERFLOW_ERROR = 3051; +exports.ER_STD_LOGIC_ERROR = 3052; +exports.ER_STD_RUNTIME_ERROR = 3053; +exports.ER_STD_UNKNOWN_EXCEPTION = 3054; +exports.ER_GIS_DATA_WRONG_ENDIANESS = 3055; +exports.ER_CHANGE_MASTER_PASSWORD_LENGTH = 3056; +exports.ER_USER_LOCK_WRONG_NAME = 3057; +exports.ER_USER_LOCK_DEADLOCK = 3058; +exports.ER_REPLACE_INACCESSIBLE_ROWS = 3059; +exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_GIS = 3060; +exports.ER_ILLEGAL_USER_VAR = 3061; +exports.ER_GTID_MODE_OFF = 3062; +exports.ER_UNSUPPORTED_BY_REPLICATION_THREAD = 3063; +exports.ER_INCORRECT_TYPE = 3064; +exports.ER_FIELD_IN_ORDER_NOT_SELECT = 3065; +exports.ER_AGGREGATE_IN_ORDER_NOT_SELECT = 3066; +exports.ER_INVALID_RPL_WILD_TABLE_FILTER_PATTERN = 3067; +exports.ER_NET_OK_PACKET_TOO_LARGE = 3068; +exports.ER_INVALID_JSON_DATA = 3069; +exports.ER_INVALID_GEOJSON_MISSING_MEMBER = 3070; +exports.ER_INVALID_GEOJSON_WRONG_TYPE = 3071; +exports.ER_INVALID_GEOJSON_UNSPECIFIED = 3072; +exports.ER_DIMENSION_UNSUPPORTED = 3073; +exports.ER_SLAVE_CHANNEL_DOES_NOT_EXIST = 3074; +exports.ER_SLAVE_MULTIPLE_CHANNELS_HOST_PORT = 3075; +exports.ER_SLAVE_CHANNEL_NAME_INVALID_OR_TOO_LONG = 3076; +exports.ER_SLAVE_NEW_CHANNEL_WRONG_REPOSITORY = 3077; +exports.ER_SLAVE_CHANNEL_DELETE = 3078; +exports.ER_SLAVE_MULTIPLE_CHANNELS_CMD = 3079; +exports.ER_SLAVE_MAX_CHANNELS_EXCEEDED = 3080; +exports.ER_SLAVE_CHANNEL_MUST_STOP = 3081; +exports.ER_SLAVE_CHANNEL_NOT_RUNNING = 3082; +exports.ER_SLAVE_CHANNEL_WAS_RUNNING = 3083; +exports.ER_SLAVE_CHANNEL_WAS_NOT_RUNNING = 3084; +exports.ER_SLAVE_CHANNEL_SQL_THREAD_MUST_STOP = 3085; +exports.ER_SLAVE_CHANNEL_SQL_SKIP_COUNTER = 3086; +exports.ER_WRONG_FIELD_WITH_GROUP_V2 = 3087; +exports.ER_MIX_OF_GROUP_FUNC_AND_FIELDS_V2 = 3088; +exports.ER_WARN_DEPRECATED_SYSVAR_UPDATE = 3089; +exports.ER_WARN_DEPRECATED_SQLMODE = 3090; +exports.ER_CANNOT_LOG_PARTIAL_DROP_DATABASE_WITH_GTID = 3091; +exports.ER_GROUP_REPLICATION_CONFIGURATION = 3092; +exports.ER_GROUP_REPLICATION_RUNNING = 3093; +exports.ER_GROUP_REPLICATION_APPLIER_INIT_ERROR = 3094; +exports.ER_GROUP_REPLICATION_STOP_APPLIER_THREAD_TIMEOUT = 3095; +exports.ER_GROUP_REPLICATION_COMMUNICATION_LAYER_SESSION_ERROR = 3096; +exports.ER_GROUP_REPLICATION_COMMUNICATION_LAYER_JOIN_ERROR = 3097; +exports.ER_BEFORE_DML_VALIDATION_ERROR = 3098; +exports.ER_PREVENTS_VARIABLE_WITHOUT_RBR = 3099; +exports.ER_RUN_HOOK_ERROR = 3100; +exports.ER_TRANSACTION_ROLLBACK_DURING_COMMIT = 3101; +exports.ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED = 3102; +exports.ER_UNSUPPORTED_ALTER_INPLACE_ON_VIRTUAL_COLUMN = 3103; +exports.ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN = 3104; +exports.ER_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN = 3105; +exports.ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN = 3106; +exports.ER_GENERATED_COLUMN_NON_PRIOR = 3107; +exports.ER_DEPENDENT_BY_GENERATED_COLUMN = 3108; +exports.ER_GENERATED_COLUMN_REF_AUTO_INC = 3109; +exports.ER_FEATURE_NOT_AVAILABLE = 3110; +exports.ER_CANT_SET_GTID_MODE = 3111; +exports.ER_CANT_USE_AUTO_POSITION_WITH_GTID_MODE_OFF = 3112; +exports.ER_CANT_REPLICATE_ANONYMOUS_WITH_AUTO_POSITION = 3113; +exports.ER_CANT_REPLICATE_ANONYMOUS_WITH_GTID_MODE_ON = 3114; +exports.ER_CANT_REPLICATE_GTID_WITH_GTID_MODE_OFF = 3115; +exports.ER_CANT_SET_ENFORCE_GTID_CONSISTENCY_ON_WITH_ONGOING_GTID_VIOLATING_TRANSACTIONS = 3116; +exports.ER_SET_ENFORCE_GTID_CONSISTENCY_WARN_WITH_ONGOING_GTID_VIOLATING_TRANSACTIONS = 3117; +exports.ER_ACCOUNT_HAS_BEEN_LOCKED = 3118; +exports.ER_WRONG_TABLESPACE_NAME = 3119; +exports.ER_TABLESPACE_IS_NOT_EMPTY = 3120; +exports.ER_WRONG_FILE_NAME = 3121; +exports.ER_BOOST_GEOMETRY_INCONSISTENT_TURNS_EXCEPTION = 3122; +exports.ER_WARN_OPTIMIZER_HINT_SYNTAX_ERROR = 3123; +exports.ER_WARN_BAD_MAX_EXECUTION_TIME = 3124; +exports.ER_WARN_UNSUPPORTED_MAX_EXECUTION_TIME = 3125; +exports.ER_WARN_CONFLICTING_HINT = 3126; +exports.ER_WARN_UNKNOWN_QB_NAME = 3127; +exports.ER_UNRESOLVED_HINT_NAME = 3128; +exports.ER_WARN_ON_MODIFYING_GTID_EXECUTED_TABLE = 3129; +exports.ER_PLUGGABLE_PROTOCOL_COMMAND_NOT_SUPPORTED = 3130; +exports.ER_LOCKING_SERVICE_WRONG_NAME = 3131; +exports.ER_LOCKING_SERVICE_DEADLOCK = 3132; +exports.ER_LOCKING_SERVICE_TIMEOUT = 3133; +exports.ER_GIS_MAX_POINTS_IN_GEOMETRY_OVERFLOWED = 3134; +exports.ER_SQL_MODE_MERGED = 3135; +exports.ER_VTOKEN_PLUGIN_TOKEN_MISMATCH = 3136; +exports.ER_VTOKEN_PLUGIN_TOKEN_NOT_FOUND = 3137; +exports.ER_CANT_SET_VARIABLE_WHEN_OWNING_GTID = 3138; +exports.ER_SLAVE_CHANNEL_OPERATION_NOT_ALLOWED = 3139; +exports.ER_INVALID_JSON_TEXT = 3140; +exports.ER_INVALID_JSON_TEXT_IN_PARAM = 3141; +exports.ER_INVALID_JSON_BINARY_DATA = 3142; +exports.ER_INVALID_JSON_PATH = 3143; +exports.ER_INVALID_JSON_CHARSET = 3144; +exports.ER_INVALID_JSON_CHARSET_IN_FUNCTION = 3145; +exports.ER_INVALID_TYPE_FOR_JSON = 3146; +exports.ER_INVALID_CAST_TO_JSON = 3147; +exports.ER_INVALID_JSON_PATH_CHARSET = 3148; +exports.ER_INVALID_JSON_PATH_WILDCARD = 3149; +exports.ER_JSON_VALUE_TOO_BIG = 3150; +exports.ER_JSON_KEY_TOO_BIG = 3151; +exports.ER_JSON_USED_AS_KEY = 3152; +exports.ER_JSON_VACUOUS_PATH = 3153; +exports.ER_JSON_BAD_ONE_OR_ALL_ARG = 3154; +exports.ER_NUMERIC_JSON_VALUE_OUT_OF_RANGE = 3155; +exports.ER_INVALID_JSON_VALUE_FOR_CAST = 3156; +exports.ER_JSON_DOCUMENT_TOO_DEEP = 3157; +exports.ER_JSON_DOCUMENT_NULL_KEY = 3158; +exports.ER_SECURE_TRANSPORT_REQUIRED = 3159; +exports.ER_NO_SECURE_TRANSPORTS_CONFIGURED = 3160; +exports.ER_DISABLED_STORAGE_ENGINE = 3161; +exports.ER_USER_DOES_NOT_EXIST = 3162; +exports.ER_USER_ALREADY_EXISTS = 3163; +exports.ER_AUDIT_API_ABORT = 3164; +exports.ER_INVALID_JSON_PATH_ARRAY_CELL = 3165; +exports.ER_BUFPOOL_RESIZE_INPROGRESS = 3166; +exports.ER_FEATURE_DISABLED_SEE_DOC = 3167; +exports.ER_SERVER_ISNT_AVAILABLE = 3168; +exports.ER_SESSION_WAS_KILLED = 3169; +exports.ER_CAPACITY_EXCEEDED = 3170; +exports.ER_CAPACITY_EXCEEDED_IN_RANGE_OPTIMIZER = 3171; +exports.ER_TABLE_NEEDS_UPG_PART = 3172; +exports.ER_CANT_WAIT_FOR_EXECUTED_GTID_SET_WHILE_OWNING_A_GTID = 3173; +exports.ER_CANNOT_ADD_FOREIGN_BASE_COL_VIRTUAL = 3174; +exports.ER_CANNOT_CREATE_VIRTUAL_INDEX_CONSTRAINT = 3175; +exports.ER_ERROR_ON_MODIFYING_GTID_EXECUTED_TABLE = 3176; +exports.ER_LOCK_REFUSED_BY_ENGINE = 3177; +exports.ER_UNSUPPORTED_ALTER_ONLINE_ON_VIRTUAL_COLUMN = 3178; +exports.ER_MASTER_KEY_ROTATION_NOT_SUPPORTED_BY_SE = 3179; +exports.ER_MASTER_KEY_ROTATION_ERROR_BY_SE = 3180; +exports.ER_MASTER_KEY_ROTATION_BINLOG_FAILED = 3181; +exports.ER_MASTER_KEY_ROTATION_SE_UNAVAILABLE = 3182; +exports.ER_TABLESPACE_CANNOT_ENCRYPT = 3183; +exports.ER_INVALID_ENCRYPTION_OPTION = 3184; +exports.ER_CANNOT_FIND_KEY_IN_KEYRING = 3185; +exports.ER_CAPACITY_EXCEEDED_IN_PARSER = 3186; +exports.ER_UNSUPPORTED_ALTER_ENCRYPTION_INPLACE = 3187; +exports.ER_KEYRING_UDF_KEYRING_SERVICE_ERROR = 3188; +exports.ER_USER_COLUMN_OLD_LENGTH = 3189; +exports.ER_CANT_RESET_MASTER = 3190; +exports.ER_GROUP_REPLICATION_MAX_GROUP_SIZE = 3191; +exports.ER_CANNOT_ADD_FOREIGN_BASE_COL_STORED = 3192; +exports.ER_TABLE_REFERENCED = 3193; +exports.ER_PARTITION_ENGINE_DEPRECATED_FOR_TABLE = 3194; +exports.ER_WARN_USING_GEOMFROMWKB_TO_SET_SRID_ZERO = 3195; +exports.ER_WARN_USING_GEOMFROMWKB_TO_SET_SRID = 3196; +exports.ER_XA_RETRY = 3197; +exports.ER_KEYRING_AWS_UDF_AWS_KMS_ERROR = 3198; +exports.ER_BINLOG_UNSAFE_XA = 3199; +exports.ER_UDF_ERROR = 3200; +exports.ER_KEYRING_MIGRATION_FAILURE = 3201; +exports.ER_KEYRING_ACCESS_DENIED_ERROR = 3202; +exports.ER_KEYRING_MIGRATION_STATUS = 3203; +exports.ER_PLUGIN_FAILED_TO_OPEN_TABLES = 3204; +exports.ER_PLUGIN_FAILED_TO_OPEN_TABLE = 3205; +exports.ER_AUDIT_LOG_NO_KEYRING_PLUGIN_INSTALLED = 3206; +exports.ER_AUDIT_LOG_ENCRYPTION_PASSWORD_HAS_NOT_BEEN_SET = 3207; +exports.ER_AUDIT_LOG_COULD_NOT_CREATE_AES_KEY = 3208; +exports.ER_AUDIT_LOG_ENCRYPTION_PASSWORD_CANNOT_BE_FETCHED = 3209; +exports.ER_AUDIT_LOG_JSON_FILTERING_NOT_ENABLED = 3210; +exports.ER_AUDIT_LOG_UDF_INSUFFICIENT_PRIVILEGE = 3211; +exports.ER_AUDIT_LOG_SUPER_PRIVILEGE_REQUIRED = 3212; +exports.ER_COULD_NOT_REINITIALIZE_AUDIT_LOG_FILTERS = 3213; +exports.ER_AUDIT_LOG_UDF_INVALID_ARGUMENT_TYPE = 3214; +exports.ER_AUDIT_LOG_UDF_INVALID_ARGUMENT_COUNT = 3215; +exports.ER_AUDIT_LOG_HAS_NOT_BEEN_INSTALLED = 3216; +exports.ER_AUDIT_LOG_UDF_READ_INVALID_MAX_ARRAY_LENGTH_ARG_TYPE = 3217; +exports.ER_AUDIT_LOG_UDF_READ_INVALID_MAX_ARRAY_LENGTH_ARG_VALUE = 3218; +exports.ER_AUDIT_LOG_JSON_FILTER_PARSING_ERROR = 3219; +exports.ER_AUDIT_LOG_JSON_FILTER_NAME_CANNOT_BE_EMPTY = 3220; +exports.ER_AUDIT_LOG_JSON_USER_NAME_CANNOT_BE_EMPTY = 3221; +exports.ER_AUDIT_LOG_JSON_FILTER_DOES_NOT_EXISTS = 3222; +exports.ER_AUDIT_LOG_USER_FIRST_CHARACTER_MUST_BE_ALPHANUMERIC = 3223; +exports.ER_AUDIT_LOG_USER_NAME_INVALID_CHARACTER = 3224; +exports.ER_AUDIT_LOG_HOST_NAME_INVALID_CHARACTER = 3225; +exports.WARN_DEPRECATED_MAXDB_SQL_MODE_FOR_TIMESTAMP = 3226; +exports.ER_XA_REPLICATION_FILTERS = 3227; +exports.ER_CANT_OPEN_ERROR_LOG = 3228; +exports.ER_GROUPING_ON_TIMESTAMP_IN_DST = 3229; +exports.ER_CANT_START_SERVER_NAMED_PIPE = 3230; + +// Lookup-by-number table +exports[1] = 'EE_CANTCREATEFILE'; +exports[2] = 'EE_READ'; +exports[3] = 'EE_WRITE'; +exports[4] = 'EE_BADCLOSE'; +exports[5] = 'EE_OUTOFMEMORY'; +exports[6] = 'EE_DELETE'; +exports[7] = 'EE_LINK'; +exports[9] = 'EE_EOFERR'; +exports[10] = 'EE_CANTLOCK'; +exports[11] = 'EE_CANTUNLOCK'; +exports[12] = 'EE_DIR'; +exports[13] = 'EE_STAT'; +exports[14] = 'EE_CANT_CHSIZE'; +exports[15] = 'EE_CANT_OPEN_STREAM'; +exports[16] = 'EE_GETWD'; +exports[17] = 'EE_SETWD'; +exports[18] = 'EE_LINK_WARNING'; +exports[19] = 'EE_OPEN_WARNING'; +exports[20] = 'EE_DISK_FULL'; +exports[21] = 'EE_CANT_MKDIR'; +exports[22] = 'EE_UNKNOWN_CHARSET'; +exports[23] = 'EE_OUT_OF_FILERESOURCES'; +exports[24] = 'EE_CANT_READLINK'; +exports[25] = 'EE_CANT_SYMLINK'; +exports[26] = 'EE_REALPATH'; +exports[27] = 'EE_SYNC'; +exports[28] = 'EE_UNKNOWN_COLLATION'; +exports[29] = 'EE_FILENOTFOUND'; +exports[30] = 'EE_FILE_NOT_CLOSED'; +exports[31] = 'EE_CHANGE_OWNERSHIP'; +exports[32] = 'EE_CHANGE_PERMISSIONS'; +exports[33] = 'EE_CANT_SEEK'; +exports[34] = 'EE_CAPACITY_EXCEEDED'; +exports[120] = 'HA_ERR_KEY_NOT_FOUND'; +exports[121] = 'HA_ERR_FOUND_DUPP_KEY'; +exports[122] = 'HA_ERR_INTERNAL_ERROR'; +exports[123] = 'HA_ERR_RECORD_CHANGED'; +exports[124] = 'HA_ERR_WRONG_INDEX'; +exports[126] = 'HA_ERR_CRASHED'; +exports[127] = 'HA_ERR_WRONG_IN_RECORD'; +exports[128] = 'HA_ERR_OUT_OF_MEM'; +exports[130] = 'HA_ERR_NOT_A_TABLE'; +exports[131] = 'HA_ERR_WRONG_COMMAND'; +exports[132] = 'HA_ERR_OLD_FILE'; +exports[133] = 'HA_ERR_NO_ACTIVE_RECORD'; +exports[134] = 'HA_ERR_RECORD_DELETED'; +exports[135] = 'HA_ERR_RECORD_FILE_FULL'; +exports[136] = 'HA_ERR_INDEX_FILE_FULL'; +exports[137] = 'HA_ERR_END_OF_FILE'; +exports[138] = 'HA_ERR_UNSUPPORTED'; +exports[139] = 'HA_ERR_TOO_BIG_ROW'; +exports[140] = 'HA_WRONG_CREATE_OPTION'; +exports[141] = 'HA_ERR_FOUND_DUPP_UNIQUE'; +exports[142] = 'HA_ERR_UNKNOWN_CHARSET'; +exports[143] = 'HA_ERR_WRONG_MRG_TABLE_DEF'; +exports[144] = 'HA_ERR_CRASHED_ON_REPAIR'; +exports[145] = 'HA_ERR_CRASHED_ON_USAGE'; +exports[146] = 'HA_ERR_LOCK_WAIT_TIMEOUT'; +exports[147] = 'HA_ERR_LOCK_TABLE_FULL'; +exports[148] = 'HA_ERR_READ_ONLY_TRANSACTION'; +exports[149] = 'HA_ERR_LOCK_DEADLOCK'; +exports[150] = 'HA_ERR_CANNOT_ADD_FOREIGN'; +exports[151] = 'HA_ERR_NO_REFERENCED_ROW'; +exports[152] = 'HA_ERR_ROW_IS_REFERENCED'; +exports[153] = 'HA_ERR_NO_SAVEPOINT'; +exports[154] = 'HA_ERR_NON_UNIQUE_BLOCK_SIZE'; +exports[155] = 'HA_ERR_NO_SUCH_TABLE'; +exports[156] = 'HA_ERR_TABLE_EXIST'; +exports[157] = 'HA_ERR_NO_CONNECTION'; +exports[158] = 'HA_ERR_NULL_IN_SPATIAL'; +exports[159] = 'HA_ERR_TABLE_DEF_CHANGED'; +exports[160] = 'HA_ERR_NO_PARTITION_FOUND'; +exports[161] = 'HA_ERR_RBR_LOGGING_FAILED'; +exports[162] = 'HA_ERR_DROP_INDEX_FK'; +exports[163] = 'HA_ERR_FOREIGN_DUPLICATE_KEY'; +exports[164] = 'HA_ERR_TABLE_NEEDS_UPGRADE'; +exports[165] = 'HA_ERR_TABLE_READONLY'; +exports[166] = 'HA_ERR_AUTOINC_READ_FAILED'; +exports[167] = 'HA_ERR_AUTOINC_ERANGE'; +exports[168] = 'HA_ERR_GENERIC'; +exports[169] = 'HA_ERR_RECORD_IS_THE_SAME'; +exports[170] = 'HA_ERR_LOGGING_IMPOSSIBLE'; +exports[171] = 'HA_ERR_CORRUPT_EVENT'; +exports[172] = 'HA_ERR_NEW_FILE'; +exports[173] = 'HA_ERR_ROWS_EVENT_APPLY'; +exports[174] = 'HA_ERR_INITIALIZATION'; +exports[175] = 'HA_ERR_FILE_TOO_SHORT'; +exports[176] = 'HA_ERR_WRONG_CRC'; +exports[177] = 'HA_ERR_TOO_MANY_CONCURRENT_TRXS'; +exports[178] = 'HA_ERR_NOT_IN_LOCK_PARTITIONS'; +exports[179] = 'HA_ERR_INDEX_COL_TOO_LONG'; +exports[180] = 'HA_ERR_INDEX_CORRUPT'; +exports[181] = 'HA_ERR_UNDO_REC_TOO_BIG'; +exports[182] = 'HA_FTS_INVALID_DOCID'; +exports[183] = 'HA_ERR_TABLE_IN_FK_CHECK'; +exports[184] = 'HA_ERR_TABLESPACE_EXISTS'; +exports[185] = 'HA_ERR_TOO_MANY_FIELDS'; +exports[186] = 'HA_ERR_ROW_IN_WRONG_PARTITION'; +exports[187] = 'HA_ERR_INNODB_READ_ONLY'; +exports[188] = 'HA_ERR_FTS_EXCEED_RESULT_CACHE_LIMIT'; +exports[189] = 'HA_ERR_TEMP_FILE_WRITE_FAILURE'; +exports[190] = 'HA_ERR_INNODB_FORCED_RECOVERY'; +exports[191] = 'HA_ERR_FTS_TOO_MANY_WORDS_IN_PHRASE'; +exports[192] = 'HA_ERR_FK_DEPTH_EXCEEDED'; +exports[193] = 'HA_MISSING_CREATE_OPTION'; +exports[194] = 'HA_ERR_SE_OUT_OF_MEMORY'; +exports[195] = 'HA_ERR_TABLE_CORRUPT'; +exports[196] = 'HA_ERR_QUERY_INTERRUPTED'; +exports[197] = 'HA_ERR_TABLESPACE_MISSING'; +exports[198] = 'HA_ERR_TABLESPACE_IS_NOT_EMPTY'; +exports[199] = 'HA_ERR_WRONG_FILE_NAME'; +exports[200] = 'HA_ERR_NOT_ALLOWED_COMMAND'; +exports[201] = 'HA_ERR_COMPUTE_FAILED'; +exports[1000] = 'ER_HASHCHK'; +exports[1001] = 'ER_NISAMCHK'; +exports[1002] = 'ER_NO'; +exports[1003] = 'ER_YES'; +exports[1004] = 'ER_CANT_CREATE_FILE'; +exports[1005] = 'ER_CANT_CREATE_TABLE'; +exports[1006] = 'ER_CANT_CREATE_DB'; +exports[1007] = 'ER_DB_CREATE_EXISTS'; +exports[1008] = 'ER_DB_DROP_EXISTS'; +exports[1009] = 'ER_DB_DROP_DELETE'; +exports[1010] = 'ER_DB_DROP_RMDIR'; +exports[1011] = 'ER_CANT_DELETE_FILE'; +exports[1012] = 'ER_CANT_FIND_SYSTEM_REC'; +exports[1013] = 'ER_CANT_GET_STAT'; +exports[1014] = 'ER_CANT_GET_WD'; +exports[1015] = 'ER_CANT_LOCK'; +exports[1016] = 'ER_CANT_OPEN_FILE'; +exports[1017] = 'ER_FILE_NOT_FOUND'; +exports[1018] = 'ER_CANT_READ_DIR'; +exports[1019] = 'ER_CANT_SET_WD'; +exports[1020] = 'ER_CHECKREAD'; +exports[1021] = 'ER_DISK_FULL'; +exports[1022] = 'ER_DUP_KEY'; +exports[1023] = 'ER_ERROR_ON_CLOSE'; +exports[1024] = 'ER_ERROR_ON_READ'; +exports[1025] = 'ER_ERROR_ON_RENAME'; +exports[1026] = 'ER_ERROR_ON_WRITE'; +exports[1027] = 'ER_FILE_USED'; +exports[1028] = 'ER_FILSORT_ABORT'; +exports[1029] = 'ER_FORM_NOT_FOUND'; +exports[1030] = 'ER_GET_ERRNO'; +exports[1031] = 'ER_ILLEGAL_HA'; +exports[1032] = 'ER_KEY_NOT_FOUND'; +exports[1033] = 'ER_NOT_FORM_FILE'; +exports[1034] = 'ER_NOT_KEYFILE'; +exports[1035] = 'ER_OLD_KEYFILE'; +exports[1036] = 'ER_OPEN_AS_READONLY'; +exports[1037] = 'ER_OUTOFMEMORY'; +exports[1038] = 'ER_OUT_OF_SORTMEMORY'; +exports[1039] = 'ER_UNEXPECTED_EOF'; +exports[1040] = 'ER_CON_COUNT_ERROR'; +exports[1041] = 'ER_OUT_OF_RESOURCES'; +exports[1042] = 'ER_BAD_HOST_ERROR'; +exports[1043] = 'ER_HANDSHAKE_ERROR'; +exports[1044] = 'ER_DBACCESS_DENIED_ERROR'; +exports[1045] = 'ER_ACCESS_DENIED_ERROR'; +exports[1046] = 'ER_NO_DB_ERROR'; +exports[1047] = 'ER_UNKNOWN_COM_ERROR'; +exports[1048] = 'ER_BAD_NULL_ERROR'; +exports[1049] = 'ER_BAD_DB_ERROR'; +exports[1050] = 'ER_TABLE_EXISTS_ERROR'; +exports[1051] = 'ER_BAD_TABLE_ERROR'; +exports[1052] = 'ER_NON_UNIQ_ERROR'; +exports[1053] = 'ER_SERVER_SHUTDOWN'; +exports[1054] = 'ER_BAD_FIELD_ERROR'; +exports[1055] = 'ER_WRONG_FIELD_WITH_GROUP'; +exports[1056] = 'ER_WRONG_GROUP_FIELD'; +exports[1057] = 'ER_WRONG_SUM_SELECT'; +exports[1058] = 'ER_WRONG_VALUE_COUNT'; +exports[1059] = 'ER_TOO_LONG_IDENT'; +exports[1060] = 'ER_DUP_FIELDNAME'; +exports[1061] = 'ER_DUP_KEYNAME'; +exports[1062] = 'ER_DUP_ENTRY'; +exports[1063] = 'ER_WRONG_FIELD_SPEC'; +exports[1064] = 'ER_PARSE_ERROR'; +exports[1065] = 'ER_EMPTY_QUERY'; +exports[1066] = 'ER_NONUNIQ_TABLE'; +exports[1067] = 'ER_INVALID_DEFAULT'; +exports[1068] = 'ER_MULTIPLE_PRI_KEY'; +exports[1069] = 'ER_TOO_MANY_KEYS'; +exports[1070] = 'ER_TOO_MANY_KEY_PARTS'; +exports[1071] = 'ER_TOO_LONG_KEY'; +exports[1072] = 'ER_KEY_COLUMN_DOES_NOT_EXITS'; +exports[1073] = 'ER_BLOB_USED_AS_KEY'; +exports[1074] = 'ER_TOO_BIG_FIELDLENGTH'; +exports[1075] = 'ER_WRONG_AUTO_KEY'; +exports[1076] = 'ER_READY'; +exports[1077] = 'ER_NORMAL_SHUTDOWN'; +exports[1078] = 'ER_GOT_SIGNAL'; +exports[1079] = 'ER_SHUTDOWN_COMPLETE'; +exports[1080] = 'ER_FORCING_CLOSE'; +exports[1081] = 'ER_IPSOCK_ERROR'; +exports[1082] = 'ER_NO_SUCH_INDEX'; +exports[1083] = 'ER_WRONG_FIELD_TERMINATORS'; +exports[1084] = 'ER_BLOBS_AND_NO_TERMINATED'; +exports[1085] = 'ER_TEXTFILE_NOT_READABLE'; +exports[1086] = 'ER_FILE_EXISTS_ERROR'; +exports[1087] = 'ER_LOAD_INFO'; +exports[1088] = 'ER_ALTER_INFO'; +exports[1089] = 'ER_WRONG_SUB_KEY'; +exports[1090] = 'ER_CANT_REMOVE_ALL_FIELDS'; +exports[1091] = 'ER_CANT_DROP_FIELD_OR_KEY'; +exports[1092] = 'ER_INSERT_INFO'; +exports[1093] = 'ER_UPDATE_TABLE_USED'; +exports[1094] = 'ER_NO_SUCH_THREAD'; +exports[1095] = 'ER_KILL_DENIED_ERROR'; +exports[1096] = 'ER_NO_TABLES_USED'; +exports[1097] = 'ER_TOO_BIG_SET'; +exports[1098] = 'ER_NO_UNIQUE_LOGFILE'; +exports[1099] = 'ER_TABLE_NOT_LOCKED_FOR_WRITE'; +exports[1100] = 'ER_TABLE_NOT_LOCKED'; +exports[1101] = 'ER_BLOB_CANT_HAVE_DEFAULT'; +exports[1102] = 'ER_WRONG_DB_NAME'; +exports[1103] = 'ER_WRONG_TABLE_NAME'; +exports[1104] = 'ER_TOO_BIG_SELECT'; +exports[1105] = 'ER_UNKNOWN_ERROR'; +exports[1106] = 'ER_UNKNOWN_PROCEDURE'; +exports[1107] = 'ER_WRONG_PARAMCOUNT_TO_PROCEDURE'; +exports[1108] = 'ER_WRONG_PARAMETERS_TO_PROCEDURE'; +exports[1109] = 'ER_UNKNOWN_TABLE'; +exports[1110] = 'ER_FIELD_SPECIFIED_TWICE'; +exports[1111] = 'ER_INVALID_GROUP_FUNC_USE'; +exports[1112] = 'ER_UNSUPPORTED_EXTENSION'; +exports[1113] = 'ER_TABLE_MUST_HAVE_COLUMNS'; +exports[1114] = 'ER_RECORD_FILE_FULL'; +exports[1115] = 'ER_UNKNOWN_CHARACTER_SET'; +exports[1116] = 'ER_TOO_MANY_TABLES'; +exports[1117] = 'ER_TOO_MANY_FIELDS'; +exports[1118] = 'ER_TOO_BIG_ROWSIZE'; +exports[1119] = 'ER_STACK_OVERRUN'; +exports[1120] = 'ER_WRONG_OUTER_JOIN'; +exports[1121] = 'ER_NULL_COLUMN_IN_INDEX'; +exports[1122] = 'ER_CANT_FIND_UDF'; +exports[1123] = 'ER_CANT_INITIALIZE_UDF'; +exports[1124] = 'ER_UDF_NO_PATHS'; +exports[1125] = 'ER_UDF_EXISTS'; +exports[1126] = 'ER_CANT_OPEN_LIBRARY'; +exports[1127] = 'ER_CANT_FIND_DL_ENTRY'; +exports[1128] = 'ER_FUNCTION_NOT_DEFINED'; +exports[1129] = 'ER_HOST_IS_BLOCKED'; +exports[1130] = 'ER_HOST_NOT_PRIVILEGED'; +exports[1131] = 'ER_PASSWORD_ANONYMOUS_USER'; +exports[1132] = 'ER_PASSWORD_NOT_ALLOWED'; +exports[1133] = 'ER_PASSWORD_NO_MATCH'; +exports[1134] = 'ER_UPDATE_INFO'; +exports[1135] = 'ER_CANT_CREATE_THREAD'; +exports[1136] = 'ER_WRONG_VALUE_COUNT_ON_ROW'; +exports[1137] = 'ER_CANT_REOPEN_TABLE'; +exports[1138] = 'ER_INVALID_USE_OF_NULL'; +exports[1139] = 'ER_REGEXP_ERROR'; +exports[1140] = 'ER_MIX_OF_GROUP_FUNC_AND_FIELDS'; +exports[1141] = 'ER_NONEXISTING_GRANT'; +exports[1142] = 'ER_TABLEACCESS_DENIED_ERROR'; +exports[1143] = 'ER_COLUMNACCESS_DENIED_ERROR'; +exports[1144] = 'ER_ILLEGAL_GRANT_FOR_TABLE'; +exports[1145] = 'ER_GRANT_WRONG_HOST_OR_USER'; +exports[1146] = 'ER_NO_SUCH_TABLE'; +exports[1147] = 'ER_NONEXISTING_TABLE_GRANT'; +exports[1148] = 'ER_NOT_ALLOWED_COMMAND'; +exports[1149] = 'ER_SYNTAX_ERROR'; +exports[1150] = 'ER_DELAYED_CANT_CHANGE_LOCK'; +exports[1151] = 'ER_TOO_MANY_DELAYED_THREADS'; +exports[1152] = 'ER_ABORTING_CONNECTION'; +exports[1153] = 'ER_NET_PACKET_TOO_LARGE'; +exports[1154] = 'ER_NET_READ_ERROR_FROM_PIPE'; +exports[1155] = 'ER_NET_FCNTL_ERROR'; +exports[1156] = 'ER_NET_PACKETS_OUT_OF_ORDER'; +exports[1157] = 'ER_NET_UNCOMPRESS_ERROR'; +exports[1158] = 'ER_NET_READ_ERROR'; +exports[1159] = 'ER_NET_READ_INTERRUPTED'; +exports[1160] = 'ER_NET_ERROR_ON_WRITE'; +exports[1161] = 'ER_NET_WRITE_INTERRUPTED'; +exports[1162] = 'ER_TOO_LONG_STRING'; +exports[1163] = 'ER_TABLE_CANT_HANDLE_BLOB'; +exports[1164] = 'ER_TABLE_CANT_HANDLE_AUTO_INCREMENT'; +exports[1165] = 'ER_DELAYED_INSERT_TABLE_LOCKED'; +exports[1166] = 'ER_WRONG_COLUMN_NAME'; +exports[1167] = 'ER_WRONG_KEY_COLUMN'; +exports[1168] = 'ER_WRONG_MRG_TABLE'; +exports[1169] = 'ER_DUP_UNIQUE'; +exports[1170] = 'ER_BLOB_KEY_WITHOUT_LENGTH'; +exports[1171] = 'ER_PRIMARY_CANT_HAVE_NULL'; +exports[1172] = 'ER_TOO_MANY_ROWS'; +exports[1173] = 'ER_REQUIRES_PRIMARY_KEY'; +exports[1174] = 'ER_NO_RAID_COMPILED'; +exports[1175] = 'ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE'; +exports[1176] = 'ER_KEY_DOES_NOT_EXITS'; +exports[1177] = 'ER_CHECK_NO_SUCH_TABLE'; +exports[1178] = 'ER_CHECK_NOT_IMPLEMENTED'; +exports[1179] = 'ER_CANT_DO_THIS_DURING_AN_TRANSACTION'; +exports[1180] = 'ER_ERROR_DURING_COMMIT'; +exports[1181] = 'ER_ERROR_DURING_ROLLBACK'; +exports[1182] = 'ER_ERROR_DURING_FLUSH_LOGS'; +exports[1183] = 'ER_ERROR_DURING_CHECKPOINT'; +exports[1184] = 'ER_NEW_ABORTING_CONNECTION'; +exports[1185] = 'ER_DUMP_NOT_IMPLEMENTED'; +exports[1186] = 'ER_FLUSH_MASTER_BINLOG_CLOSED'; +exports[1187] = 'ER_INDEX_REBUILD'; +exports[1188] = 'ER_MASTER'; +exports[1189] = 'ER_MASTER_NET_READ'; +exports[1190] = 'ER_MASTER_NET_WRITE'; +exports[1191] = 'ER_FT_MATCHING_KEY_NOT_FOUND'; +exports[1192] = 'ER_LOCK_OR_ACTIVE_TRANSACTION'; +exports[1193] = 'ER_UNKNOWN_SYSTEM_VARIABLE'; +exports[1194] = 'ER_CRASHED_ON_USAGE'; +exports[1195] = 'ER_CRASHED_ON_REPAIR'; +exports[1196] = 'ER_WARNING_NOT_COMPLETE_ROLLBACK'; +exports[1197] = 'ER_TRANS_CACHE_FULL'; +exports[1198] = 'ER_SLAVE_MUST_STOP'; +exports[1199] = 'ER_SLAVE_NOT_RUNNING'; +exports[1200] = 'ER_BAD_SLAVE'; +exports[1201] = 'ER_MASTER_INFO'; +exports[1202] = 'ER_SLAVE_THREAD'; +exports[1203] = 'ER_TOO_MANY_USER_CONNECTIONS'; +exports[1204] = 'ER_SET_CONSTANTS_ONLY'; +exports[1205] = 'ER_LOCK_WAIT_TIMEOUT'; +exports[1206] = 'ER_LOCK_TABLE_FULL'; +exports[1207] = 'ER_READ_ONLY_TRANSACTION'; +exports[1208] = 'ER_DROP_DB_WITH_READ_LOCK'; +exports[1209] = 'ER_CREATE_DB_WITH_READ_LOCK'; +exports[1210] = 'ER_WRONG_ARGUMENTS'; +exports[1211] = 'ER_NO_PERMISSION_TO_CREATE_USER'; +exports[1212] = 'ER_UNION_TABLES_IN_DIFFERENT_DIR'; +exports[1213] = 'ER_LOCK_DEADLOCK'; +exports[1214] = 'ER_TABLE_CANT_HANDLE_FT'; +exports[1215] = 'ER_CANNOT_ADD_FOREIGN'; +exports[1216] = 'ER_NO_REFERENCED_ROW'; +exports[1217] = 'ER_ROW_IS_REFERENCED'; +exports[1218] = 'ER_CONNECT_TO_MASTER'; +exports[1219] = 'ER_QUERY_ON_MASTER'; +exports[1220] = 'ER_ERROR_WHEN_EXECUTING_COMMAND'; +exports[1221] = 'ER_WRONG_USAGE'; +exports[1222] = 'ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT'; +exports[1223] = 'ER_CANT_UPDATE_WITH_READLOCK'; +exports[1224] = 'ER_MIXING_NOT_ALLOWED'; +exports[1225] = 'ER_DUP_ARGUMENT'; +exports[1226] = 'ER_USER_LIMIT_REACHED'; +exports[1227] = 'ER_SPECIFIC_ACCESS_DENIED_ERROR'; +exports[1228] = 'ER_LOCAL_VARIABLE'; +exports[1229] = 'ER_GLOBAL_VARIABLE'; +exports[1230] = 'ER_NO_DEFAULT'; +exports[1231] = 'ER_WRONG_VALUE_FOR_VAR'; +exports[1232] = 'ER_WRONG_TYPE_FOR_VAR'; +exports[1233] = 'ER_VAR_CANT_BE_READ'; +exports[1234] = 'ER_CANT_USE_OPTION_HERE'; +exports[1235] = 'ER_NOT_SUPPORTED_YET'; +exports[1236] = 'ER_MASTER_FATAL_ERROR_READING_BINLOG'; +exports[1237] = 'ER_SLAVE_IGNORED_TABLE'; +exports[1238] = 'ER_INCORRECT_GLOBAL_LOCAL_VAR'; +exports[1239] = 'ER_WRONG_FK_DEF'; +exports[1240] = 'ER_KEY_REF_DO_NOT_MATCH_TABLE_REF'; +exports[1241] = 'ER_OPERAND_COLUMNS'; +exports[1242] = 'ER_SUBQUERY_NO_1_ROW'; +exports[1243] = 'ER_UNKNOWN_STMT_HANDLER'; +exports[1244] = 'ER_CORRUPT_HELP_DB'; +exports[1245] = 'ER_CYCLIC_REFERENCE'; +exports[1246] = 'ER_AUTO_CONVERT'; +exports[1247] = 'ER_ILLEGAL_REFERENCE'; +exports[1248] = 'ER_DERIVED_MUST_HAVE_ALIAS'; +exports[1249] = 'ER_SELECT_REDUCED'; +exports[1250] = 'ER_TABLENAME_NOT_ALLOWED_HERE'; +exports[1251] = 'ER_NOT_SUPPORTED_AUTH_MODE'; +exports[1252] = 'ER_SPATIAL_CANT_HAVE_NULL'; +exports[1253] = 'ER_COLLATION_CHARSET_MISMATCH'; +exports[1254] = 'ER_SLAVE_WAS_RUNNING'; +exports[1255] = 'ER_SLAVE_WAS_NOT_RUNNING'; +exports[1256] = 'ER_TOO_BIG_FOR_UNCOMPRESS'; +exports[1257] = 'ER_ZLIB_Z_MEM_ERROR'; +exports[1258] = 'ER_ZLIB_Z_BUF_ERROR'; +exports[1259] = 'ER_ZLIB_Z_DATA_ERROR'; +exports[1260] = 'ER_CUT_VALUE_GROUP_CONCAT'; +exports[1261] = 'ER_WARN_TOO_FEW_RECORDS'; +exports[1262] = 'ER_WARN_TOO_MANY_RECORDS'; +exports[1263] = 'ER_WARN_NULL_TO_NOTNULL'; +exports[1264] = 'ER_WARN_DATA_OUT_OF_RANGE'; +exports[1265] = 'WARN_DATA_TRUNCATED'; +exports[1266] = 'ER_WARN_USING_OTHER_HANDLER'; +exports[1267] = 'ER_CANT_AGGREGATE_2COLLATIONS'; +exports[1268] = 'ER_DROP_USER'; +exports[1269] = 'ER_REVOKE_GRANTS'; +exports[1270] = 'ER_CANT_AGGREGATE_3COLLATIONS'; +exports[1271] = 'ER_CANT_AGGREGATE_NCOLLATIONS'; +exports[1272] = 'ER_VARIABLE_IS_NOT_STRUCT'; +exports[1273] = 'ER_UNKNOWN_COLLATION'; +exports[1274] = 'ER_SLAVE_IGNORED_SSL_PARAMS'; +exports[1275] = 'ER_SERVER_IS_IN_SECURE_AUTH_MODE'; +exports[1276] = 'ER_WARN_FIELD_RESOLVED'; +exports[1277] = 'ER_BAD_SLAVE_UNTIL_COND'; +exports[1278] = 'ER_MISSING_SKIP_SLAVE'; +exports[1279] = 'ER_UNTIL_COND_IGNORED'; +exports[1280] = 'ER_WRONG_NAME_FOR_INDEX'; +exports[1281] = 'ER_WRONG_NAME_FOR_CATALOG'; +exports[1282] = 'ER_WARN_QC_RESIZE'; +exports[1283] = 'ER_BAD_FT_COLUMN'; +exports[1284] = 'ER_UNKNOWN_KEY_CACHE'; +exports[1285] = 'ER_WARN_HOSTNAME_WONT_WORK'; +exports[1286] = 'ER_UNKNOWN_STORAGE_ENGINE'; +exports[1287] = 'ER_WARN_DEPRECATED_SYNTAX'; +exports[1288] = 'ER_NON_UPDATABLE_TABLE'; +exports[1289] = 'ER_FEATURE_DISABLED'; +exports[1290] = 'ER_OPTION_PREVENTS_STATEMENT'; +exports[1291] = 'ER_DUPLICATED_VALUE_IN_TYPE'; +exports[1292] = 'ER_TRUNCATED_WRONG_VALUE'; +exports[1293] = 'ER_TOO_MUCH_AUTO_TIMESTAMP_COLS'; +exports[1294] = 'ER_INVALID_ON_UPDATE'; +exports[1295] = 'ER_UNSUPPORTED_PS'; +exports[1296] = 'ER_GET_ERRMSG'; +exports[1297] = 'ER_GET_TEMPORARY_ERRMSG'; +exports[1298] = 'ER_UNKNOWN_TIME_ZONE'; +exports[1299] = 'ER_WARN_INVALID_TIMESTAMP'; +exports[1300] = 'ER_INVALID_CHARACTER_STRING'; +exports[1301] = 'ER_WARN_ALLOWED_PACKET_OVERFLOWED'; +exports[1302] = 'ER_CONFLICTING_DECLARATIONS'; +exports[1303] = 'ER_SP_NO_RECURSIVE_CREATE'; +exports[1304] = 'ER_SP_ALREADY_EXISTS'; +exports[1305] = 'ER_SP_DOES_NOT_EXIST'; +exports[1306] = 'ER_SP_DROP_FAILED'; +exports[1307] = 'ER_SP_STORE_FAILED'; +exports[1308] = 'ER_SP_LILABEL_MISMATCH'; +exports[1309] = 'ER_SP_LABEL_REDEFINE'; +exports[1310] = 'ER_SP_LABEL_MISMATCH'; +exports[1311] = 'ER_SP_UNINIT_VAR'; +exports[1312] = 'ER_SP_BADSELECT'; +exports[1313] = 'ER_SP_BADRETURN'; +exports[1314] = 'ER_SP_BADSTATEMENT'; +exports[1315] = 'ER_UPDATE_LOG_DEPRECATED_IGNORED'; +exports[1316] = 'ER_UPDATE_LOG_DEPRECATED_TRANSLATED'; +exports[1317] = 'ER_QUERY_INTERRUPTED'; +exports[1318] = 'ER_SP_WRONG_NO_OF_ARGS'; +exports[1319] = 'ER_SP_COND_MISMATCH'; +exports[1320] = 'ER_SP_NORETURN'; +exports[1321] = 'ER_SP_NORETURNEND'; +exports[1322] = 'ER_SP_BAD_CURSOR_QUERY'; +exports[1323] = 'ER_SP_BAD_CURSOR_SELECT'; +exports[1324] = 'ER_SP_CURSOR_MISMATCH'; +exports[1325] = 'ER_SP_CURSOR_ALREADY_OPEN'; +exports[1326] = 'ER_SP_CURSOR_NOT_OPEN'; +exports[1327] = 'ER_SP_UNDECLARED_VAR'; +exports[1328] = 'ER_SP_WRONG_NO_OF_FETCH_ARGS'; +exports[1329] = 'ER_SP_FETCH_NO_DATA'; +exports[1330] = 'ER_SP_DUP_PARAM'; +exports[1331] = 'ER_SP_DUP_VAR'; +exports[1332] = 'ER_SP_DUP_COND'; +exports[1333] = 'ER_SP_DUP_CURS'; +exports[1334] = 'ER_SP_CANT_ALTER'; +exports[1335] = 'ER_SP_SUBSELECT_NYI'; +exports[1336] = 'ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG'; +exports[1337] = 'ER_SP_VARCOND_AFTER_CURSHNDLR'; +exports[1338] = 'ER_SP_CURSOR_AFTER_HANDLER'; +exports[1339] = 'ER_SP_CASE_NOT_FOUND'; +exports[1340] = 'ER_FPARSER_TOO_BIG_FILE'; +exports[1341] = 'ER_FPARSER_BAD_HEADER'; +exports[1342] = 'ER_FPARSER_EOF_IN_COMMENT'; +exports[1343] = 'ER_FPARSER_ERROR_IN_PARAMETER'; +exports[1344] = 'ER_FPARSER_EOF_IN_UNKNOWN_PARAMETER'; +exports[1345] = 'ER_VIEW_NO_EXPLAIN'; +exports[1346] = 'ER_FRM_UNKNOWN_TYPE'; +exports[1347] = 'ER_WRONG_OBJECT'; +exports[1348] = 'ER_NONUPDATEABLE_COLUMN'; +exports[1349] = 'ER_VIEW_SELECT_DERIVED'; +exports[1350] = 'ER_VIEW_SELECT_CLAUSE'; +exports[1351] = 'ER_VIEW_SELECT_VARIABLE'; +exports[1352] = 'ER_VIEW_SELECT_TMPTABLE'; +exports[1353] = 'ER_VIEW_WRONG_LIST'; +exports[1354] = 'ER_WARN_VIEW_MERGE'; +exports[1355] = 'ER_WARN_VIEW_WITHOUT_KEY'; +exports[1356] = 'ER_VIEW_INVALID'; +exports[1357] = 'ER_SP_NO_DROP_SP'; +exports[1358] = 'ER_SP_GOTO_IN_HNDLR'; +exports[1359] = 'ER_TRG_ALREADY_EXISTS'; +exports[1360] = 'ER_TRG_DOES_NOT_EXIST'; +exports[1361] = 'ER_TRG_ON_VIEW_OR_TEMP_TABLE'; +exports[1362] = 'ER_TRG_CANT_CHANGE_ROW'; +exports[1363] = 'ER_TRG_NO_SUCH_ROW_IN_TRG'; +exports[1364] = 'ER_NO_DEFAULT_FOR_FIELD'; +exports[1365] = 'ER_DIVISION_BY_ZERO'; +exports[1366] = 'ER_TRUNCATED_WRONG_VALUE_FOR_FIELD'; +exports[1367] = 'ER_ILLEGAL_VALUE_FOR_TYPE'; +exports[1368] = 'ER_VIEW_NONUPD_CHECK'; +exports[1369] = 'ER_VIEW_CHECK_FAILED'; +exports[1370] = 'ER_PROCACCESS_DENIED_ERROR'; +exports[1371] = 'ER_RELAY_LOG_FAIL'; +exports[1372] = 'ER_PASSWD_LENGTH'; +exports[1373] = 'ER_UNKNOWN_TARGET_BINLOG'; +exports[1374] = 'ER_IO_ERR_LOG_INDEX_READ'; +exports[1375] = 'ER_BINLOG_PURGE_PROHIBITED'; +exports[1376] = 'ER_FSEEK_FAIL'; +exports[1377] = 'ER_BINLOG_PURGE_FATAL_ERR'; +exports[1378] = 'ER_LOG_IN_USE'; +exports[1379] = 'ER_LOG_PURGE_UNKNOWN_ERR'; +exports[1380] = 'ER_RELAY_LOG_INIT'; +exports[1381] = 'ER_NO_BINARY_LOGGING'; +exports[1382] = 'ER_RESERVED_SYNTAX'; +exports[1383] = 'ER_WSAS_FAILED'; +exports[1384] = 'ER_DIFF_GROUPS_PROC'; +exports[1385] = 'ER_NO_GROUP_FOR_PROC'; +exports[1386] = 'ER_ORDER_WITH_PROC'; +exports[1387] = 'ER_LOGGING_PROHIBIT_CHANGING_OF'; +exports[1388] = 'ER_NO_FILE_MAPPING'; +exports[1389] = 'ER_WRONG_MAGIC'; +exports[1390] = 'ER_PS_MANY_PARAM'; +exports[1391] = 'ER_KEY_PART_0'; +exports[1392] = 'ER_VIEW_CHECKSUM'; +exports[1393] = 'ER_VIEW_MULTIUPDATE'; +exports[1394] = 'ER_VIEW_NO_INSERT_FIELD_LIST'; +exports[1395] = 'ER_VIEW_DELETE_MERGE_VIEW'; +exports[1396] = 'ER_CANNOT_USER'; +exports[1397] = 'ER_XAER_NOTA'; +exports[1398] = 'ER_XAER_INVAL'; +exports[1399] = 'ER_XAER_RMFAIL'; +exports[1400] = 'ER_XAER_OUTSIDE'; +exports[1401] = 'ER_XAER_RMERR'; +exports[1402] = 'ER_XA_RBROLLBACK'; +exports[1403] = 'ER_NONEXISTING_PROC_GRANT'; +exports[1404] = 'ER_PROC_AUTO_GRANT_FAIL'; +exports[1405] = 'ER_PROC_AUTO_REVOKE_FAIL'; +exports[1406] = 'ER_DATA_TOO_LONG'; +exports[1407] = 'ER_SP_BAD_SQLSTATE'; +exports[1408] = 'ER_STARTUP'; +exports[1409] = 'ER_LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR'; +exports[1410] = 'ER_CANT_CREATE_USER_WITH_GRANT'; +exports[1411] = 'ER_WRONG_VALUE_FOR_TYPE'; +exports[1412] = 'ER_TABLE_DEF_CHANGED'; +exports[1413] = 'ER_SP_DUP_HANDLER'; +exports[1414] = 'ER_SP_NOT_VAR_ARG'; +exports[1415] = 'ER_SP_NO_RETSET'; +exports[1416] = 'ER_CANT_CREATE_GEOMETRY_OBJECT'; +exports[1417] = 'ER_FAILED_ROUTINE_BREAK_BINLOG'; +exports[1418] = 'ER_BINLOG_UNSAFE_ROUTINE'; +exports[1419] = 'ER_BINLOG_CREATE_ROUTINE_NEED_SUPER'; +exports[1420] = 'ER_EXEC_STMT_WITH_OPEN_CURSOR'; +exports[1421] = 'ER_STMT_HAS_NO_OPEN_CURSOR'; +exports[1422] = 'ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG'; +exports[1423] = 'ER_NO_DEFAULT_FOR_VIEW_FIELD'; +exports[1424] = 'ER_SP_NO_RECURSION'; +exports[1425] = 'ER_TOO_BIG_SCALE'; +exports[1426] = 'ER_TOO_BIG_PRECISION'; +exports[1427] = 'ER_M_BIGGER_THAN_D'; +exports[1428] = 'ER_WRONG_LOCK_OF_SYSTEM_TABLE'; +exports[1429] = 'ER_CONNECT_TO_FOREIGN_DATA_SOURCE'; +exports[1430] = 'ER_QUERY_ON_FOREIGN_DATA_SOURCE'; +exports[1431] = 'ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST'; +exports[1432] = 'ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE'; +exports[1433] = 'ER_FOREIGN_DATA_STRING_INVALID'; +exports[1434] = 'ER_CANT_CREATE_FEDERATED_TABLE'; +exports[1435] = 'ER_TRG_IN_WRONG_SCHEMA'; +exports[1436] = 'ER_STACK_OVERRUN_NEED_MORE'; +exports[1437] = 'ER_TOO_LONG_BODY'; +exports[1438] = 'ER_WARN_CANT_DROP_DEFAULT_KEYCACHE'; +exports[1439] = 'ER_TOO_BIG_DISPLAYWIDTH'; +exports[1440] = 'ER_XAER_DUPID'; +exports[1441] = 'ER_DATETIME_FUNCTION_OVERFLOW'; +exports[1442] = 'ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG'; +exports[1443] = 'ER_VIEW_PREVENT_UPDATE'; +exports[1444] = 'ER_PS_NO_RECURSION'; +exports[1445] = 'ER_SP_CANT_SET_AUTOCOMMIT'; +exports[1446] = 'ER_MALFORMED_DEFINER'; +exports[1447] = 'ER_VIEW_FRM_NO_USER'; +exports[1448] = 'ER_VIEW_OTHER_USER'; +exports[1449] = 'ER_NO_SUCH_USER'; +exports[1450] = 'ER_FORBID_SCHEMA_CHANGE'; +exports[1451] = 'ER_ROW_IS_REFERENCED_2'; +exports[1452] = 'ER_NO_REFERENCED_ROW_2'; +exports[1453] = 'ER_SP_BAD_VAR_SHADOW'; +exports[1454] = 'ER_TRG_NO_DEFINER'; +exports[1455] = 'ER_OLD_FILE_FORMAT'; +exports[1456] = 'ER_SP_RECURSION_LIMIT'; +exports[1457] = 'ER_SP_PROC_TABLE_CORRUPT'; +exports[1458] = 'ER_SP_WRONG_NAME'; +exports[1459] = 'ER_TABLE_NEEDS_UPGRADE'; +exports[1460] = 'ER_SP_NO_AGGREGATE'; +exports[1461] = 'ER_MAX_PREPARED_STMT_COUNT_REACHED'; +exports[1462] = 'ER_VIEW_RECURSIVE'; +exports[1463] = 'ER_NON_GROUPING_FIELD_USED'; +exports[1464] = 'ER_TABLE_CANT_HANDLE_SPKEYS'; +exports[1465] = 'ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA'; +exports[1466] = 'ER_REMOVED_SPACES'; +exports[1467] = 'ER_AUTOINC_READ_FAILED'; +exports[1468] = 'ER_USERNAME'; +exports[1469] = 'ER_HOSTNAME'; +exports[1470] = 'ER_WRONG_STRING_LENGTH'; +exports[1471] = 'ER_NON_INSERTABLE_TABLE'; +exports[1472] = 'ER_ADMIN_WRONG_MRG_TABLE'; +exports[1473] = 'ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT'; +exports[1474] = 'ER_NAME_BECOMES_EMPTY'; +exports[1475] = 'ER_AMBIGUOUS_FIELD_TERM'; +exports[1476] = 'ER_FOREIGN_SERVER_EXISTS'; +exports[1477] = 'ER_FOREIGN_SERVER_DOESNT_EXIST'; +exports[1478] = 'ER_ILLEGAL_HA_CREATE_OPTION'; +exports[1479] = 'ER_PARTITION_REQUIRES_VALUES_ERROR'; +exports[1480] = 'ER_PARTITION_WRONG_VALUES_ERROR'; +exports[1481] = 'ER_PARTITION_MAXVALUE_ERROR'; +exports[1482] = 'ER_PARTITION_SUBPARTITION_ERROR'; +exports[1483] = 'ER_PARTITION_SUBPART_MIX_ERROR'; +exports[1484] = 'ER_PARTITION_WRONG_NO_PART_ERROR'; +exports[1485] = 'ER_PARTITION_WRONG_NO_SUBPART_ERROR'; +exports[1486] = 'ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR'; +exports[1487] = 'ER_NO_CONST_EXPR_IN_RANGE_OR_LIST_ERROR'; +exports[1488] = 'ER_FIELD_NOT_FOUND_PART_ERROR'; +exports[1489] = 'ER_LIST_OF_FIELDS_ONLY_IN_HASH_ERROR'; +exports[1490] = 'ER_INCONSISTENT_PARTITION_INFO_ERROR'; +exports[1491] = 'ER_PARTITION_FUNC_NOT_ALLOWED_ERROR'; +exports[1492] = 'ER_PARTITIONS_MUST_BE_DEFINED_ERROR'; +exports[1493] = 'ER_RANGE_NOT_INCREASING_ERROR'; +exports[1494] = 'ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR'; +exports[1495] = 'ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR'; +exports[1496] = 'ER_PARTITION_ENTRY_ERROR'; +exports[1497] = 'ER_MIX_HANDLER_ERROR'; +exports[1498] = 'ER_PARTITION_NOT_DEFINED_ERROR'; +exports[1499] = 'ER_TOO_MANY_PARTITIONS_ERROR'; +exports[1500] = 'ER_SUBPARTITION_ERROR'; +exports[1501] = 'ER_CANT_CREATE_HANDLER_FILE'; +exports[1502] = 'ER_BLOB_FIELD_IN_PART_FUNC_ERROR'; +exports[1503] = 'ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF'; +exports[1504] = 'ER_NO_PARTS_ERROR'; +exports[1505] = 'ER_PARTITION_MGMT_ON_NONPARTITIONED'; +exports[1506] = 'ER_FOREIGN_KEY_ON_PARTITIONED'; +exports[1507] = 'ER_DROP_PARTITION_NON_EXISTENT'; +exports[1508] = 'ER_DROP_LAST_PARTITION'; +exports[1509] = 'ER_COALESCE_ONLY_ON_HASH_PARTITION'; +exports[1510] = 'ER_REORG_HASH_ONLY_ON_SAME_NO'; +exports[1511] = 'ER_REORG_NO_PARAM_ERROR'; +exports[1512] = 'ER_ONLY_ON_RANGE_LIST_PARTITION'; +exports[1513] = 'ER_ADD_PARTITION_SUBPART_ERROR'; +exports[1514] = 'ER_ADD_PARTITION_NO_NEW_PARTITION'; +exports[1515] = 'ER_COALESCE_PARTITION_NO_PARTITION'; +exports[1516] = 'ER_REORG_PARTITION_NOT_EXIST'; +exports[1517] = 'ER_SAME_NAME_PARTITION'; +exports[1518] = 'ER_NO_BINLOG_ERROR'; +exports[1519] = 'ER_CONSECUTIVE_REORG_PARTITIONS'; +exports[1520] = 'ER_REORG_OUTSIDE_RANGE'; +exports[1521] = 'ER_PARTITION_FUNCTION_FAILURE'; +exports[1522] = 'ER_PART_STATE_ERROR'; +exports[1523] = 'ER_LIMITED_PART_RANGE'; +exports[1524] = 'ER_PLUGIN_IS_NOT_LOADED'; +exports[1525] = 'ER_WRONG_VALUE'; +exports[1526] = 'ER_NO_PARTITION_FOR_GIVEN_VALUE'; +exports[1527] = 'ER_FILEGROUP_OPTION_ONLY_ONCE'; +exports[1528] = 'ER_CREATE_FILEGROUP_FAILED'; +exports[1529] = 'ER_DROP_FILEGROUP_FAILED'; +exports[1530] = 'ER_TABLESPACE_AUTO_EXTEND_ERROR'; +exports[1531] = 'ER_WRONG_SIZE_NUMBER'; +exports[1532] = 'ER_SIZE_OVERFLOW_ERROR'; +exports[1533] = 'ER_ALTER_FILEGROUP_FAILED'; +exports[1534] = 'ER_BINLOG_ROW_LOGGING_FAILED'; +exports[1535] = 'ER_BINLOG_ROW_WRONG_TABLE_DEF'; +exports[1536] = 'ER_BINLOG_ROW_RBR_TO_SBR'; +exports[1537] = 'ER_EVENT_ALREADY_EXISTS'; +exports[1538] = 'ER_EVENT_STORE_FAILED'; +exports[1539] = 'ER_EVENT_DOES_NOT_EXIST'; +exports[1540] = 'ER_EVENT_CANT_ALTER'; +exports[1541] = 'ER_EVENT_DROP_FAILED'; +exports[1542] = 'ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG'; +exports[1543] = 'ER_EVENT_ENDS_BEFORE_STARTS'; +exports[1544] = 'ER_EVENT_EXEC_TIME_IN_THE_PAST'; +exports[1545] = 'ER_EVENT_OPEN_TABLE_FAILED'; +exports[1546] = 'ER_EVENT_NEITHER_M_EXPR_NOR_M_AT'; +exports[1547] = 'ER_COL_COUNT_DOESNT_MATCH_CORRUPTED'; +exports[1548] = 'ER_CANNOT_LOAD_FROM_TABLE'; +exports[1549] = 'ER_EVENT_CANNOT_DELETE'; +exports[1550] = 'ER_EVENT_COMPILE_ERROR'; +exports[1551] = 'ER_EVENT_SAME_NAME'; +exports[1552] = 'ER_EVENT_DATA_TOO_LONG'; +exports[1553] = 'ER_DROP_INDEX_FK'; +exports[1554] = 'ER_WARN_DEPRECATED_SYNTAX_WITH_VER'; +exports[1555] = 'ER_CANT_WRITE_LOCK_LOG_TABLE'; +exports[1556] = 'ER_CANT_LOCK_LOG_TABLE'; +exports[1557] = 'ER_FOREIGN_DUPLICATE_KEY'; +exports[1558] = 'ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE'; +exports[1559] = 'ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR'; +exports[1560] = 'ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT'; +exports[1561] = 'ER_NDB_CANT_SWITCH_BINLOG_FORMAT'; +exports[1562] = 'ER_PARTITION_NO_TEMPORARY'; +exports[1563] = 'ER_PARTITION_CONST_DOMAIN_ERROR'; +exports[1564] = 'ER_PARTITION_FUNCTION_IS_NOT_ALLOWED'; +exports[1565] = 'ER_DDL_LOG_ERROR'; +exports[1566] = 'ER_NULL_IN_VALUES_LESS_THAN'; +exports[1567] = 'ER_WRONG_PARTITION_NAME'; +exports[1568] = 'ER_CANT_CHANGE_TX_CHARACTERISTICS'; +exports[1569] = 'ER_DUP_ENTRY_AUTOINCREMENT_CASE'; +exports[1570] = 'ER_EVENT_MODIFY_QUEUE_ERROR'; +exports[1571] = 'ER_EVENT_SET_VAR_ERROR'; +exports[1572] = 'ER_PARTITION_MERGE_ERROR'; +exports[1573] = 'ER_CANT_ACTIVATE_LOG'; +exports[1574] = 'ER_RBR_NOT_AVAILABLE'; +exports[1575] = 'ER_BASE64_DECODE_ERROR'; +exports[1576] = 'ER_EVENT_RECURSION_FORBIDDEN'; +exports[1577] = 'ER_EVENTS_DB_ERROR'; +exports[1578] = 'ER_ONLY_INTEGERS_ALLOWED'; +exports[1579] = 'ER_UNSUPORTED_LOG_ENGINE'; +exports[1580] = 'ER_BAD_LOG_STATEMENT'; +exports[1581] = 'ER_CANT_RENAME_LOG_TABLE'; +exports[1582] = 'ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT'; +exports[1583] = 'ER_WRONG_PARAMETERS_TO_NATIVE_FCT'; +exports[1584] = 'ER_WRONG_PARAMETERS_TO_STORED_FCT'; +exports[1585] = 'ER_NATIVE_FCT_NAME_COLLISION'; +exports[1586] = 'ER_DUP_ENTRY_WITH_KEY_NAME'; +exports[1587] = 'ER_BINLOG_PURGE_EMFILE'; +exports[1588] = 'ER_EVENT_CANNOT_CREATE_IN_THE_PAST'; +exports[1589] = 'ER_EVENT_CANNOT_ALTER_IN_THE_PAST'; +exports[1590] = 'ER_SLAVE_INCIDENT'; +exports[1591] = 'ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT'; +exports[1592] = 'ER_BINLOG_UNSAFE_STATEMENT'; +exports[1593] = 'ER_SLAVE_FATAL_ERROR'; +exports[1594] = 'ER_SLAVE_RELAY_LOG_READ_FAILURE'; +exports[1595] = 'ER_SLAVE_RELAY_LOG_WRITE_FAILURE'; +exports[1596] = 'ER_SLAVE_CREATE_EVENT_FAILURE'; +exports[1597] = 'ER_SLAVE_MASTER_COM_FAILURE'; +exports[1598] = 'ER_BINLOG_LOGGING_IMPOSSIBLE'; +exports[1599] = 'ER_VIEW_NO_CREATION_CTX'; +exports[1600] = 'ER_VIEW_INVALID_CREATION_CTX'; +exports[1601] = 'ER_SR_INVALID_CREATION_CTX'; +exports[1602] = 'ER_TRG_CORRUPTED_FILE'; +exports[1603] = 'ER_TRG_NO_CREATION_CTX'; +exports[1604] = 'ER_TRG_INVALID_CREATION_CTX'; +exports[1605] = 'ER_EVENT_INVALID_CREATION_CTX'; +exports[1606] = 'ER_TRG_CANT_OPEN_TABLE'; +exports[1607] = 'ER_CANT_CREATE_SROUTINE'; +exports[1608] = 'ER_NEVER_USED'; +exports[1609] = 'ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT'; +exports[1610] = 'ER_SLAVE_CORRUPT_EVENT'; +exports[1611] = 'ER_LOAD_DATA_INVALID_COLUMN'; +exports[1612] = 'ER_LOG_PURGE_NO_FILE'; +exports[1613] = 'ER_XA_RBTIMEOUT'; +exports[1614] = 'ER_XA_RBDEADLOCK'; +exports[1615] = 'ER_NEED_REPREPARE'; +exports[1616] = 'ER_DELAYED_NOT_SUPPORTED'; +exports[1617] = 'WARN_NO_MASTER_INFO'; +exports[1618] = 'WARN_OPTION_IGNORED'; +exports[1619] = 'ER_PLUGIN_DELETE_BUILTIN'; +exports[1620] = 'WARN_PLUGIN_BUSY'; +exports[1621] = 'ER_VARIABLE_IS_READONLY'; +exports[1622] = 'ER_WARN_ENGINE_TRANSACTION_ROLLBACK'; +exports[1623] = 'ER_SLAVE_HEARTBEAT_FAILURE'; +exports[1624] = 'ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE'; +exports[1625] = 'ER_NDB_REPLICATION_SCHEMA_ERROR'; +exports[1626] = 'ER_CONFLICT_FN_PARSE_ERROR'; +exports[1627] = 'ER_EXCEPTIONS_WRITE_ERROR'; +exports[1628] = 'ER_TOO_LONG_TABLE_COMMENT'; +exports[1629] = 'ER_TOO_LONG_FIELD_COMMENT'; +exports[1630] = 'ER_FUNC_INEXISTENT_NAME_COLLISION'; +exports[1631] = 'ER_DATABASE_NAME'; +exports[1632] = 'ER_TABLE_NAME'; +exports[1633] = 'ER_PARTITION_NAME'; +exports[1634] = 'ER_SUBPARTITION_NAME'; +exports[1635] = 'ER_TEMPORARY_NAME'; +exports[1636] = 'ER_RENAMED_NAME'; +exports[1637] = 'ER_TOO_MANY_CONCURRENT_TRXS'; +exports[1638] = 'WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED'; +exports[1639] = 'ER_DEBUG_SYNC_TIMEOUT'; +exports[1640] = 'ER_DEBUG_SYNC_HIT_LIMIT'; +exports[1641] = 'ER_DUP_SIGNAL_SET'; +exports[1642] = 'ER_SIGNAL_WARN'; +exports[1643] = 'ER_SIGNAL_NOT_FOUND'; +exports[1644] = 'ER_SIGNAL_EXCEPTION'; +exports[1645] = 'ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER'; +exports[1646] = 'ER_SIGNAL_BAD_CONDITION_TYPE'; +exports[1647] = 'WARN_COND_ITEM_TRUNCATED'; +exports[1648] = 'ER_COND_ITEM_TOO_LONG'; +exports[1649] = 'ER_UNKNOWN_LOCALE'; +exports[1650] = 'ER_SLAVE_IGNORE_SERVER_IDS'; +exports[1651] = 'ER_QUERY_CACHE_DISABLED'; +exports[1652] = 'ER_SAME_NAME_PARTITION_FIELD'; +exports[1653] = 'ER_PARTITION_COLUMN_LIST_ERROR'; +exports[1654] = 'ER_WRONG_TYPE_COLUMN_VALUE_ERROR'; +exports[1655] = 'ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR'; +exports[1656] = 'ER_MAXVALUE_IN_VALUES_IN'; +exports[1657] = 'ER_TOO_MANY_VALUES_ERROR'; +exports[1658] = 'ER_ROW_SINGLE_PARTITION_FIELD_ERROR'; +exports[1659] = 'ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD'; +exports[1660] = 'ER_PARTITION_FIELDS_TOO_LONG'; +exports[1661] = 'ER_BINLOG_ROW_ENGINE_AND_STMT_ENGINE'; +exports[1662] = 'ER_BINLOG_ROW_MODE_AND_STMT_ENGINE'; +exports[1663] = 'ER_BINLOG_UNSAFE_AND_STMT_ENGINE'; +exports[1664] = 'ER_BINLOG_ROW_INJECTION_AND_STMT_ENGINE'; +exports[1665] = 'ER_BINLOG_STMT_MODE_AND_ROW_ENGINE'; +exports[1666] = 'ER_BINLOG_ROW_INJECTION_AND_STMT_MODE'; +exports[1667] = 'ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE'; +exports[1668] = 'ER_BINLOG_UNSAFE_LIMIT'; +exports[1669] = 'ER_BINLOG_UNSAFE_INSERT_DELAYED'; +exports[1670] = 'ER_BINLOG_UNSAFE_SYSTEM_TABLE'; +exports[1671] = 'ER_BINLOG_UNSAFE_AUTOINC_COLUMNS'; +exports[1672] = 'ER_BINLOG_UNSAFE_UDF'; +exports[1673] = 'ER_BINLOG_UNSAFE_SYSTEM_VARIABLE'; +exports[1674] = 'ER_BINLOG_UNSAFE_SYSTEM_FUNCTION'; +exports[1675] = 'ER_BINLOG_UNSAFE_NONTRANS_AFTER_TRANS'; +exports[1676] = 'ER_MESSAGE_AND_STATEMENT'; +exports[1677] = 'ER_SLAVE_CONVERSION_FAILED'; +exports[1678] = 'ER_SLAVE_CANT_CREATE_CONVERSION'; +exports[1679] = 'ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT'; +exports[1680] = 'ER_PATH_LENGTH'; +exports[1681] = 'ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT'; +exports[1682] = 'ER_WRONG_NATIVE_TABLE_STRUCTURE'; +exports[1683] = 'ER_WRONG_PERFSCHEMA_USAGE'; +exports[1684] = 'ER_WARN_I_S_SKIPPED_TABLE'; +exports[1685] = 'ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT'; +exports[1686] = 'ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_DIRECT'; +exports[1687] = 'ER_SPATIAL_MUST_HAVE_GEOM_COL'; +exports[1688] = 'ER_TOO_LONG_INDEX_COMMENT'; +exports[1689] = 'ER_LOCK_ABORTED'; +exports[1690] = 'ER_DATA_OUT_OF_RANGE'; +exports[1691] = 'ER_WRONG_SPVAR_TYPE_IN_LIMIT'; +exports[1692] = 'ER_BINLOG_UNSAFE_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE'; +exports[1693] = 'ER_BINLOG_UNSAFE_MIXED_STATEMENT'; +exports[1694] = 'ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SQL_LOG_BIN'; +exports[1695] = 'ER_STORED_FUNCTION_PREVENTS_SWITCH_SQL_LOG_BIN'; +exports[1696] = 'ER_FAILED_READ_FROM_PAR_FILE'; +exports[1697] = 'ER_VALUES_IS_NOT_INT_TYPE_ERROR'; +exports[1698] = 'ER_ACCESS_DENIED_NO_PASSWORD_ERROR'; +exports[1699] = 'ER_SET_PASSWORD_AUTH_PLUGIN'; +exports[1700] = 'ER_GRANT_PLUGIN_USER_EXISTS'; +exports[1701] = 'ER_TRUNCATE_ILLEGAL_FK'; +exports[1702] = 'ER_PLUGIN_IS_PERMANENT'; +exports[1703] = 'ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN'; +exports[1704] = 'ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX'; +exports[1705] = 'ER_STMT_CACHE_FULL'; +exports[1706] = 'ER_MULTI_UPDATE_KEY_CONFLICT'; +exports[1707] = 'ER_TABLE_NEEDS_REBUILD'; +exports[1708] = 'WARN_OPTION_BELOW_LIMIT'; +exports[1709] = 'ER_INDEX_COLUMN_TOO_LONG'; +exports[1710] = 'ER_ERROR_IN_TRIGGER_BODY'; +exports[1711] = 'ER_ERROR_IN_UNKNOWN_TRIGGER_BODY'; +exports[1712] = 'ER_INDEX_CORRUPT'; +exports[1713] = 'ER_UNDO_RECORD_TOO_BIG'; +exports[1714] = 'ER_BINLOG_UNSAFE_INSERT_IGNORE_SELECT'; +exports[1715] = 'ER_BINLOG_UNSAFE_INSERT_SELECT_UPDATE'; +exports[1716] = 'ER_BINLOG_UNSAFE_REPLACE_SELECT'; +exports[1717] = 'ER_BINLOG_UNSAFE_CREATE_IGNORE_SELECT'; +exports[1718] = 'ER_BINLOG_UNSAFE_CREATE_REPLACE_SELECT'; +exports[1719] = 'ER_BINLOG_UNSAFE_UPDATE_IGNORE'; +exports[1720] = 'ER_PLUGIN_NO_UNINSTALL'; +exports[1721] = 'ER_PLUGIN_NO_INSTALL'; +exports[1722] = 'ER_BINLOG_UNSAFE_WRITE_AUTOINC_SELECT'; +exports[1723] = 'ER_BINLOG_UNSAFE_CREATE_SELECT_AUTOINC'; +exports[1724] = 'ER_BINLOG_UNSAFE_INSERT_TWO_KEYS'; +exports[1725] = 'ER_TABLE_IN_FK_CHECK'; +exports[1726] = 'ER_UNSUPPORTED_ENGINE'; +exports[1727] = 'ER_BINLOG_UNSAFE_AUTOINC_NOT_FIRST'; +exports[1728] = 'ER_CANNOT_LOAD_FROM_TABLE_V2'; +exports[1729] = 'ER_MASTER_DELAY_VALUE_OUT_OF_RANGE'; +exports[1730] = 'ER_ONLY_FD_AND_RBR_EVENTS_ALLOWED_IN_BINLOG_STATEMENT'; +exports[1731] = 'ER_PARTITION_EXCHANGE_DIFFERENT_OPTION'; +exports[1732] = 'ER_PARTITION_EXCHANGE_PART_TABLE'; +exports[1733] = 'ER_PARTITION_EXCHANGE_TEMP_TABLE'; +exports[1734] = 'ER_PARTITION_INSTEAD_OF_SUBPARTITION'; +exports[1735] = 'ER_UNKNOWN_PARTITION'; +exports[1736] = 'ER_TABLES_DIFFERENT_METADATA'; +exports[1737] = 'ER_ROW_DOES_NOT_MATCH_PARTITION'; +exports[1738] = 'ER_BINLOG_CACHE_SIZE_GREATER_THAN_MAX'; +exports[1739] = 'ER_WARN_INDEX_NOT_APPLICABLE'; +exports[1740] = 'ER_PARTITION_EXCHANGE_FOREIGN_KEY'; +exports[1741] = 'ER_NO_SUCH_KEY_VALUE'; +exports[1742] = 'ER_RPL_INFO_DATA_TOO_LONG'; +exports[1743] = 'ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE'; +exports[1744] = 'ER_BINLOG_READ_EVENT_CHECKSUM_FAILURE'; +exports[1745] = 'ER_BINLOG_STMT_CACHE_SIZE_GREATER_THAN_MAX'; +exports[1746] = 'ER_CANT_UPDATE_TABLE_IN_CREATE_TABLE_SELECT'; +exports[1747] = 'ER_PARTITION_CLAUSE_ON_NONPARTITIONED'; +exports[1748] = 'ER_ROW_DOES_NOT_MATCH_GIVEN_PARTITION_SET'; +exports[1749] = 'ER_NO_SUCH_PARTITION'; +exports[1750] = 'ER_CHANGE_RPL_INFO_REPOSITORY_FAILURE'; +exports[1751] = 'ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_CREATED_TEMP_TABLE'; +exports[1752] = 'ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_DROPPED_TEMP_TABLE'; +exports[1753] = 'ER_MTS_FEATURE_IS_NOT_SUPPORTED'; +exports[1754] = 'ER_MTS_UPDATED_DBS_GREATER_MAX'; +exports[1755] = 'ER_MTS_CANT_PARALLEL'; +exports[1756] = 'ER_MTS_INCONSISTENT_DATA'; +exports[1757] = 'ER_FULLTEXT_NOT_SUPPORTED_WITH_PARTITIONING'; +exports[1758] = 'ER_DA_INVALID_CONDITION_NUMBER'; +exports[1759] = 'ER_INSECURE_PLAIN_TEXT'; +exports[1760] = 'ER_INSECURE_CHANGE_MASTER'; +exports[1761] = 'ER_FOREIGN_DUPLICATE_KEY_WITH_CHILD_INFO'; +exports[1762] = 'ER_FOREIGN_DUPLICATE_KEY_WITHOUT_CHILD_INFO'; +exports[1763] = 'ER_SQLTHREAD_WITH_SECURE_SLAVE'; +exports[1764] = 'ER_TABLE_HAS_NO_FT'; +exports[1765] = 'ER_VARIABLE_NOT_SETTABLE_IN_SF_OR_TRIGGER'; +exports[1766] = 'ER_VARIABLE_NOT_SETTABLE_IN_TRANSACTION'; +exports[1767] = 'ER_GTID_NEXT_IS_NOT_IN_GTID_NEXT_LIST'; +exports[1768] = 'ER_CANT_CHANGE_GTID_NEXT_IN_TRANSACTION'; +exports[1769] = 'ER_SET_STATEMENT_CANNOT_INVOKE_FUNCTION'; +exports[1770] = 'ER_GTID_NEXT_CANT_BE_AUTOMATIC_IF_GTID_NEXT_LIST_IS_NON_NULL'; +exports[1771] = 'ER_SKIPPING_LOGGED_TRANSACTION'; +exports[1772] = 'ER_MALFORMED_GTID_SET_SPECIFICATION'; +exports[1773] = 'ER_MALFORMED_GTID_SET_ENCODING'; +exports[1774] = 'ER_MALFORMED_GTID_SPECIFICATION'; +exports[1775] = 'ER_GNO_EXHAUSTED'; +exports[1776] = 'ER_BAD_SLAVE_AUTO_POSITION'; +exports[1777] = 'ER_AUTO_POSITION_REQUIRES_GTID_MODE_NOT_OFF'; +exports[1778] = 'ER_CANT_DO_IMPLICIT_COMMIT_IN_TRX_WHEN_GTID_NEXT_IS_SET'; +exports[1779] = 'ER_GTID_MODE_ON_REQUIRES_ENFORCE_GTID_CONSISTENCY_ON'; +exports[1780] = 'ER_GTID_MODE_REQUIRES_BINLOG'; +exports[1781] = 'ER_CANT_SET_GTID_NEXT_TO_GTID_WHEN_GTID_MODE_IS_OFF'; +exports[1782] = 'ER_CANT_SET_GTID_NEXT_TO_ANONYMOUS_WHEN_GTID_MODE_IS_ON'; +exports[1783] = 'ER_CANT_SET_GTID_NEXT_LIST_TO_NON_NULL_WHEN_GTID_MODE_IS_OFF'; +exports[1784] = 'ER_FOUND_GTID_EVENT_WHEN_GTID_MODE_IS_OFF'; +exports[1785] = 'ER_GTID_UNSAFE_NON_TRANSACTIONAL_TABLE'; +exports[1786] = 'ER_GTID_UNSAFE_CREATE_SELECT'; +exports[1787] = 'ER_GTID_UNSAFE_CREATE_DROP_TEMPORARY_TABLE_IN_TRANSACTION'; +exports[1788] = 'ER_GTID_MODE_CAN_ONLY_CHANGE_ONE_STEP_AT_A_TIME'; +exports[1789] = 'ER_MASTER_HAS_PURGED_REQUIRED_GTIDS'; +exports[1790] = 'ER_CANT_SET_GTID_NEXT_WHEN_OWNING_GTID'; +exports[1791] = 'ER_UNKNOWN_EXPLAIN_FORMAT'; +exports[1792] = 'ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION'; +exports[1793] = 'ER_TOO_LONG_TABLE_PARTITION_COMMENT'; +exports[1794] = 'ER_SLAVE_CONFIGURATION'; +exports[1795] = 'ER_INNODB_FT_LIMIT'; +exports[1796] = 'ER_INNODB_NO_FT_TEMP_TABLE'; +exports[1797] = 'ER_INNODB_FT_WRONG_DOCID_COLUMN'; +exports[1798] = 'ER_INNODB_FT_WRONG_DOCID_INDEX'; +exports[1799] = 'ER_INNODB_ONLINE_LOG_TOO_BIG'; +exports[1800] = 'ER_UNKNOWN_ALTER_ALGORITHM'; +exports[1801] = 'ER_UNKNOWN_ALTER_LOCK'; +exports[1802] = 'ER_MTS_CHANGE_MASTER_CANT_RUN_WITH_GAPS'; +exports[1803] = 'ER_MTS_RECOVERY_FAILURE'; +exports[1804] = 'ER_MTS_RESET_WORKERS'; +exports[1805] = 'ER_COL_COUNT_DOESNT_MATCH_CORRUPTED_V2'; +exports[1806] = 'ER_SLAVE_SILENT_RETRY_TRANSACTION'; +exports[1807] = 'ER_DISCARD_FK_CHECKS_RUNNING'; +exports[1808] = 'ER_TABLE_SCHEMA_MISMATCH'; +exports[1809] = 'ER_TABLE_IN_SYSTEM_TABLESPACE'; +exports[1810] = 'ER_IO_READ_ERROR'; +exports[1811] = 'ER_IO_WRITE_ERROR'; +exports[1812] = 'ER_TABLESPACE_MISSING'; +exports[1813] = 'ER_TABLESPACE_EXISTS'; +exports[1814] = 'ER_TABLESPACE_DISCARDED'; +exports[1815] = 'ER_INTERNAL_ERROR'; +exports[1816] = 'ER_INNODB_IMPORT_ERROR'; +exports[1817] = 'ER_INNODB_INDEX_CORRUPT'; +exports[1818] = 'ER_INVALID_YEAR_COLUMN_LENGTH'; +exports[1819] = 'ER_NOT_VALID_PASSWORD'; +exports[1820] = 'ER_MUST_CHANGE_PASSWORD'; +exports[1821] = 'ER_FK_NO_INDEX_CHILD'; +exports[1822] = 'ER_FK_NO_INDEX_PARENT'; +exports[1823] = 'ER_FK_FAIL_ADD_SYSTEM'; +exports[1824] = 'ER_FK_CANNOT_OPEN_PARENT'; +exports[1825] = 'ER_FK_INCORRECT_OPTION'; +exports[1826] = 'ER_FK_DUP_NAME'; +exports[1827] = 'ER_PASSWORD_FORMAT'; +exports[1828] = 'ER_FK_COLUMN_CANNOT_DROP'; +exports[1829] = 'ER_FK_COLUMN_CANNOT_DROP_CHILD'; +exports[1830] = 'ER_FK_COLUMN_NOT_NULL'; +exports[1831] = 'ER_DUP_INDEX'; +exports[1832] = 'ER_FK_COLUMN_CANNOT_CHANGE'; +exports[1833] = 'ER_FK_COLUMN_CANNOT_CHANGE_CHILD'; +exports[1834] = 'ER_FK_CANNOT_DELETE_PARENT'; +exports[1835] = 'ER_MALFORMED_PACKET'; +exports[1836] = 'ER_READ_ONLY_MODE'; +exports[1837] = 'ER_GTID_NEXT_TYPE_UNDEFINED_GROUP'; +exports[1838] = 'ER_VARIABLE_NOT_SETTABLE_IN_SP'; +exports[1839] = 'ER_CANT_SET_GTID_PURGED_WHEN_GTID_MODE_IS_OFF'; +exports[1840] = 'ER_CANT_SET_GTID_PURGED_WHEN_GTID_EXECUTED_IS_NOT_EMPTY'; +exports[1841] = 'ER_CANT_SET_GTID_PURGED_WHEN_OWNED_GTIDS_IS_NOT_EMPTY'; +exports[1842] = 'ER_GTID_PURGED_WAS_CHANGED'; +exports[1843] = 'ER_GTID_EXECUTED_WAS_CHANGED'; +exports[1844] = 'ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES'; +exports[1845] = 'ER_ALTER_OPERATION_NOT_SUPPORTED'; +exports[1846] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON'; +exports[1847] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COPY'; +exports[1848] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_PARTITION'; +exports[1849] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_RENAME'; +exports[1850] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COLUMN_TYPE'; +exports[1851] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_CHECK'; +exports[1852] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_IGNORE'; +exports[1853] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOPK'; +exports[1854] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_AUTOINC'; +exports[1855] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_HIDDEN_FTS'; +exports[1856] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_CHANGE_FTS'; +exports[1857] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FTS'; +exports[1858] = 'ER_SQL_SLAVE_SKIP_COUNTER_NOT_SETTABLE_IN_GTID_MODE'; +exports[1859] = 'ER_DUP_UNKNOWN_IN_INDEX'; +exports[1860] = 'ER_IDENT_CAUSES_TOO_LONG_PATH'; +exports[1861] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOT_NULL'; +exports[1862] = 'ER_MUST_CHANGE_PASSWORD_LOGIN'; +exports[1863] = 'ER_ROW_IN_WRONG_PARTITION'; +exports[1864] = 'ER_MTS_EVENT_BIGGER_PENDING_JOBS_SIZE_MAX'; +exports[1865] = 'ER_INNODB_NO_FT_USES_PARSER'; +exports[1866] = 'ER_BINLOG_LOGICAL_CORRUPTION'; +exports[1867] = 'ER_WARN_PURGE_LOG_IN_USE'; +exports[1868] = 'ER_WARN_PURGE_LOG_IS_ACTIVE'; +exports[1869] = 'ER_AUTO_INCREMENT_CONFLICT'; +exports[1870] = 'WARN_ON_BLOCKHOLE_IN_RBR'; +exports[1871] = 'ER_SLAVE_MI_INIT_REPOSITORY'; +exports[1872] = 'ER_SLAVE_RLI_INIT_REPOSITORY'; +exports[1873] = 'ER_ACCESS_DENIED_CHANGE_USER_ERROR'; +exports[1874] = 'ER_INNODB_READ_ONLY'; +exports[1875] = 'ER_STOP_SLAVE_SQL_THREAD_TIMEOUT'; +exports[1876] = 'ER_STOP_SLAVE_IO_THREAD_TIMEOUT'; +exports[1877] = 'ER_TABLE_CORRUPT'; +exports[1878] = 'ER_TEMP_FILE_WRITE_FAILURE'; +exports[1879] = 'ER_INNODB_FT_AUX_NOT_HEX_ID'; +exports[1880] = 'ER_OLD_TEMPORALS_UPGRADED'; +exports[1881] = 'ER_INNODB_FORCED_RECOVERY'; +exports[1882] = 'ER_AES_INVALID_IV'; +exports[1883] = 'ER_PLUGIN_CANNOT_BE_UNINSTALLED'; +exports[1884] = 'ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_GTID_GROUP'; +exports[1885] = 'ER_SLAVE_HAS_MORE_GTIDS_THAN_MASTER'; +exports[1886] = 'ER_MISSING_KEY'; +exports[1887] = 'WARN_NAMED_PIPE_ACCESS_EVERYONE'; +exports[1888] = 'ER_FOUND_MISSING_GTIDS'; +exports[3000] = 'ER_FILE_CORRUPT'; +exports[3001] = 'ER_ERROR_ON_MASTER'; +exports[3002] = 'ER_INCONSISTENT_ERROR'; +exports[3003] = 'ER_STORAGE_ENGINE_NOT_LOADED'; +exports[3004] = 'ER_GET_STACKED_DA_WITHOUT_ACTIVE_HANDLER'; +exports[3005] = 'ER_WARN_LEGACY_SYNTAX_CONVERTED'; +exports[3006] = 'ER_BINLOG_UNSAFE_FULLTEXT_PLUGIN'; +exports[3007] = 'ER_CANNOT_DISCARD_TEMPORARY_TABLE'; +exports[3008] = 'ER_FK_DEPTH_EXCEEDED'; +exports[3009] = 'ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE_V2'; +exports[3010] = 'ER_WARN_TRIGGER_DOESNT_HAVE_CREATED'; +exports[3011] = 'ER_REFERENCED_TRG_DOES_NOT_EXIST'; +exports[3012] = 'ER_EXPLAIN_NOT_SUPPORTED'; +exports[3013] = 'ER_INVALID_FIELD_SIZE'; +exports[3014] = 'ER_MISSING_HA_CREATE_OPTION'; +exports[3015] = 'ER_ENGINE_OUT_OF_MEMORY'; +exports[3016] = 'ER_PASSWORD_EXPIRE_ANONYMOUS_USER'; +exports[3017] = 'ER_SLAVE_SQL_THREAD_MUST_STOP'; +exports[3018] = 'ER_NO_FT_MATERIALIZED_SUBQUERY'; +exports[3019] = 'ER_INNODB_UNDO_LOG_FULL'; +exports[3020] = 'ER_INVALID_ARGUMENT_FOR_LOGARITHM'; +exports[3021] = 'ER_SLAVE_CHANNEL_IO_THREAD_MUST_STOP'; +exports[3022] = 'ER_WARN_OPEN_TEMP_TABLES_MUST_BE_ZERO'; +exports[3023] = 'ER_WARN_ONLY_MASTER_LOG_FILE_NO_POS'; +exports[3024] = 'ER_QUERY_TIMEOUT'; +exports[3025] = 'ER_NON_RO_SELECT_DISABLE_TIMER'; +exports[3026] = 'ER_DUP_LIST_ENTRY'; +exports[3027] = 'ER_SQL_MODE_NO_EFFECT'; +exports[3028] = 'ER_AGGREGATE_ORDER_FOR_UNION'; +exports[3029] = 'ER_AGGREGATE_ORDER_NON_AGG_QUERY'; +exports[3030] = 'ER_SLAVE_WORKER_STOPPED_PREVIOUS_THD_ERROR'; +exports[3031] = 'ER_DONT_SUPPORT_SLAVE_PRESERVE_COMMIT_ORDER'; +exports[3032] = 'ER_SERVER_OFFLINE_MODE'; +exports[3033] = 'ER_GIS_DIFFERENT_SRIDS'; +exports[3034] = 'ER_GIS_UNSUPPORTED_ARGUMENT'; +exports[3035] = 'ER_GIS_UNKNOWN_ERROR'; +exports[3036] = 'ER_GIS_UNKNOWN_EXCEPTION'; +exports[3037] = 'ER_GIS_INVALID_DATA'; +exports[3038] = 'ER_BOOST_GEOMETRY_EMPTY_INPUT_EXCEPTION'; +exports[3039] = 'ER_BOOST_GEOMETRY_CENTROID_EXCEPTION'; +exports[3040] = 'ER_BOOST_GEOMETRY_OVERLAY_INVALID_INPUT_EXCEPTION'; +exports[3041] = 'ER_BOOST_GEOMETRY_TURN_INFO_EXCEPTION'; +exports[3042] = 'ER_BOOST_GEOMETRY_SELF_INTERSECTION_POINT_EXCEPTION'; +exports[3043] = 'ER_BOOST_GEOMETRY_UNKNOWN_EXCEPTION'; +exports[3044] = 'ER_STD_BAD_ALLOC_ERROR'; +exports[3045] = 'ER_STD_DOMAIN_ERROR'; +exports[3046] = 'ER_STD_LENGTH_ERROR'; +exports[3047] = 'ER_STD_INVALID_ARGUMENT'; +exports[3048] = 'ER_STD_OUT_OF_RANGE_ERROR'; +exports[3049] = 'ER_STD_OVERFLOW_ERROR'; +exports[3050] = 'ER_STD_RANGE_ERROR'; +exports[3051] = 'ER_STD_UNDERFLOW_ERROR'; +exports[3052] = 'ER_STD_LOGIC_ERROR'; +exports[3053] = 'ER_STD_RUNTIME_ERROR'; +exports[3054] = 'ER_STD_UNKNOWN_EXCEPTION'; +exports[3055] = 'ER_GIS_DATA_WRONG_ENDIANESS'; +exports[3056] = 'ER_CHANGE_MASTER_PASSWORD_LENGTH'; +exports[3057] = 'ER_USER_LOCK_WRONG_NAME'; +exports[3058] = 'ER_USER_LOCK_DEADLOCK'; +exports[3059] = 'ER_REPLACE_INACCESSIBLE_ROWS'; +exports[3060] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_GIS'; +exports[3061] = 'ER_ILLEGAL_USER_VAR'; +exports[3062] = 'ER_GTID_MODE_OFF'; +exports[3063] = 'ER_UNSUPPORTED_BY_REPLICATION_THREAD'; +exports[3064] = 'ER_INCORRECT_TYPE'; +exports[3065] = 'ER_FIELD_IN_ORDER_NOT_SELECT'; +exports[3066] = 'ER_AGGREGATE_IN_ORDER_NOT_SELECT'; +exports[3067] = 'ER_INVALID_RPL_WILD_TABLE_FILTER_PATTERN'; +exports[3068] = 'ER_NET_OK_PACKET_TOO_LARGE'; +exports[3069] = 'ER_INVALID_JSON_DATA'; +exports[3070] = 'ER_INVALID_GEOJSON_MISSING_MEMBER'; +exports[3071] = 'ER_INVALID_GEOJSON_WRONG_TYPE'; +exports[3072] = 'ER_INVALID_GEOJSON_UNSPECIFIED'; +exports[3073] = 'ER_DIMENSION_UNSUPPORTED'; +exports[3074] = 'ER_SLAVE_CHANNEL_DOES_NOT_EXIST'; +exports[3075] = 'ER_SLAVE_MULTIPLE_CHANNELS_HOST_PORT'; +exports[3076] = 'ER_SLAVE_CHANNEL_NAME_INVALID_OR_TOO_LONG'; +exports[3077] = 'ER_SLAVE_NEW_CHANNEL_WRONG_REPOSITORY'; +exports[3078] = 'ER_SLAVE_CHANNEL_DELETE'; +exports[3079] = 'ER_SLAVE_MULTIPLE_CHANNELS_CMD'; +exports[3080] = 'ER_SLAVE_MAX_CHANNELS_EXCEEDED'; +exports[3081] = 'ER_SLAVE_CHANNEL_MUST_STOP'; +exports[3082] = 'ER_SLAVE_CHANNEL_NOT_RUNNING'; +exports[3083] = 'ER_SLAVE_CHANNEL_WAS_RUNNING'; +exports[3084] = 'ER_SLAVE_CHANNEL_WAS_NOT_RUNNING'; +exports[3085] = 'ER_SLAVE_CHANNEL_SQL_THREAD_MUST_STOP'; +exports[3086] = 'ER_SLAVE_CHANNEL_SQL_SKIP_COUNTER'; +exports[3087] = 'ER_WRONG_FIELD_WITH_GROUP_V2'; +exports[3088] = 'ER_MIX_OF_GROUP_FUNC_AND_FIELDS_V2'; +exports[3089] = 'ER_WARN_DEPRECATED_SYSVAR_UPDATE'; +exports[3090] = 'ER_WARN_DEPRECATED_SQLMODE'; +exports[3091] = 'ER_CANNOT_LOG_PARTIAL_DROP_DATABASE_WITH_GTID'; +exports[3092] = 'ER_GROUP_REPLICATION_CONFIGURATION'; +exports[3093] = 'ER_GROUP_REPLICATION_RUNNING'; +exports[3094] = 'ER_GROUP_REPLICATION_APPLIER_INIT_ERROR'; +exports[3095] = 'ER_GROUP_REPLICATION_STOP_APPLIER_THREAD_TIMEOUT'; +exports[3096] = 'ER_GROUP_REPLICATION_COMMUNICATION_LAYER_SESSION_ERROR'; +exports[3097] = 'ER_GROUP_REPLICATION_COMMUNICATION_LAYER_JOIN_ERROR'; +exports[3098] = 'ER_BEFORE_DML_VALIDATION_ERROR'; +exports[3099] = 'ER_PREVENTS_VARIABLE_WITHOUT_RBR'; +exports[3100] = 'ER_RUN_HOOK_ERROR'; +exports[3101] = 'ER_TRANSACTION_ROLLBACK_DURING_COMMIT'; +exports[3102] = 'ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED'; +exports[3103] = 'ER_UNSUPPORTED_ALTER_INPLACE_ON_VIRTUAL_COLUMN'; +exports[3104] = 'ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN'; +exports[3105] = 'ER_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN'; +exports[3106] = 'ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN'; +exports[3107] = 'ER_GENERATED_COLUMN_NON_PRIOR'; +exports[3108] = 'ER_DEPENDENT_BY_GENERATED_COLUMN'; +exports[3109] = 'ER_GENERATED_COLUMN_REF_AUTO_INC'; +exports[3110] = 'ER_FEATURE_NOT_AVAILABLE'; +exports[3111] = 'ER_CANT_SET_GTID_MODE'; +exports[3112] = 'ER_CANT_USE_AUTO_POSITION_WITH_GTID_MODE_OFF'; +exports[3113] = 'ER_CANT_REPLICATE_ANONYMOUS_WITH_AUTO_POSITION'; +exports[3114] = 'ER_CANT_REPLICATE_ANONYMOUS_WITH_GTID_MODE_ON'; +exports[3115] = 'ER_CANT_REPLICATE_GTID_WITH_GTID_MODE_OFF'; +exports[3116] = 'ER_CANT_SET_ENFORCE_GTID_CONSISTENCY_ON_WITH_ONGOING_GTID_VIOLATING_TRANSACTIONS'; +exports[3117] = 'ER_SET_ENFORCE_GTID_CONSISTENCY_WARN_WITH_ONGOING_GTID_VIOLATING_TRANSACTIONS'; +exports[3118] = 'ER_ACCOUNT_HAS_BEEN_LOCKED'; +exports[3119] = 'ER_WRONG_TABLESPACE_NAME'; +exports[3120] = 'ER_TABLESPACE_IS_NOT_EMPTY'; +exports[3121] = 'ER_WRONG_FILE_NAME'; +exports[3122] = 'ER_BOOST_GEOMETRY_INCONSISTENT_TURNS_EXCEPTION'; +exports[3123] = 'ER_WARN_OPTIMIZER_HINT_SYNTAX_ERROR'; +exports[3124] = 'ER_WARN_BAD_MAX_EXECUTION_TIME'; +exports[3125] = 'ER_WARN_UNSUPPORTED_MAX_EXECUTION_TIME'; +exports[3126] = 'ER_WARN_CONFLICTING_HINT'; +exports[3127] = 'ER_WARN_UNKNOWN_QB_NAME'; +exports[3128] = 'ER_UNRESOLVED_HINT_NAME'; +exports[3129] = 'ER_WARN_ON_MODIFYING_GTID_EXECUTED_TABLE'; +exports[3130] = 'ER_PLUGGABLE_PROTOCOL_COMMAND_NOT_SUPPORTED'; +exports[3131] = 'ER_LOCKING_SERVICE_WRONG_NAME'; +exports[3132] = 'ER_LOCKING_SERVICE_DEADLOCK'; +exports[3133] = 'ER_LOCKING_SERVICE_TIMEOUT'; +exports[3134] = 'ER_GIS_MAX_POINTS_IN_GEOMETRY_OVERFLOWED'; +exports[3135] = 'ER_SQL_MODE_MERGED'; +exports[3136] = 'ER_VTOKEN_PLUGIN_TOKEN_MISMATCH'; +exports[3137] = 'ER_VTOKEN_PLUGIN_TOKEN_NOT_FOUND'; +exports[3138] = 'ER_CANT_SET_VARIABLE_WHEN_OWNING_GTID'; +exports[3139] = 'ER_SLAVE_CHANNEL_OPERATION_NOT_ALLOWED'; +exports[3140] = 'ER_INVALID_JSON_TEXT'; +exports[3141] = 'ER_INVALID_JSON_TEXT_IN_PARAM'; +exports[3142] = 'ER_INVALID_JSON_BINARY_DATA'; +exports[3143] = 'ER_INVALID_JSON_PATH'; +exports[3144] = 'ER_INVALID_JSON_CHARSET'; +exports[3145] = 'ER_INVALID_JSON_CHARSET_IN_FUNCTION'; +exports[3146] = 'ER_INVALID_TYPE_FOR_JSON'; +exports[3147] = 'ER_INVALID_CAST_TO_JSON'; +exports[3148] = 'ER_INVALID_JSON_PATH_CHARSET'; +exports[3149] = 'ER_INVALID_JSON_PATH_WILDCARD'; +exports[3150] = 'ER_JSON_VALUE_TOO_BIG'; +exports[3151] = 'ER_JSON_KEY_TOO_BIG'; +exports[3152] = 'ER_JSON_USED_AS_KEY'; +exports[3153] = 'ER_JSON_VACUOUS_PATH'; +exports[3154] = 'ER_JSON_BAD_ONE_OR_ALL_ARG'; +exports[3155] = 'ER_NUMERIC_JSON_VALUE_OUT_OF_RANGE'; +exports[3156] = 'ER_INVALID_JSON_VALUE_FOR_CAST'; +exports[3157] = 'ER_JSON_DOCUMENT_TOO_DEEP'; +exports[3158] = 'ER_JSON_DOCUMENT_NULL_KEY'; +exports[3159] = 'ER_SECURE_TRANSPORT_REQUIRED'; +exports[3160] = 'ER_NO_SECURE_TRANSPORTS_CONFIGURED'; +exports[3161] = 'ER_DISABLED_STORAGE_ENGINE'; +exports[3162] = 'ER_USER_DOES_NOT_EXIST'; +exports[3163] = 'ER_USER_ALREADY_EXISTS'; +exports[3164] = 'ER_AUDIT_API_ABORT'; +exports[3165] = 'ER_INVALID_JSON_PATH_ARRAY_CELL'; +exports[3166] = 'ER_BUFPOOL_RESIZE_INPROGRESS'; +exports[3167] = 'ER_FEATURE_DISABLED_SEE_DOC'; +exports[3168] = 'ER_SERVER_ISNT_AVAILABLE'; +exports[3169] = 'ER_SESSION_WAS_KILLED'; +exports[3170] = 'ER_CAPACITY_EXCEEDED'; +exports[3171] = 'ER_CAPACITY_EXCEEDED_IN_RANGE_OPTIMIZER'; +exports[3172] = 'ER_TABLE_NEEDS_UPG_PART'; +exports[3173] = 'ER_CANT_WAIT_FOR_EXECUTED_GTID_SET_WHILE_OWNING_A_GTID'; +exports[3174] = 'ER_CANNOT_ADD_FOREIGN_BASE_COL_VIRTUAL'; +exports[3175] = 'ER_CANNOT_CREATE_VIRTUAL_INDEX_CONSTRAINT'; +exports[3176] = 'ER_ERROR_ON_MODIFYING_GTID_EXECUTED_TABLE'; +exports[3177] = 'ER_LOCK_REFUSED_BY_ENGINE'; +exports[3178] = 'ER_UNSUPPORTED_ALTER_ONLINE_ON_VIRTUAL_COLUMN'; +exports[3179] = 'ER_MASTER_KEY_ROTATION_NOT_SUPPORTED_BY_SE'; +exports[3180] = 'ER_MASTER_KEY_ROTATION_ERROR_BY_SE'; +exports[3181] = 'ER_MASTER_KEY_ROTATION_BINLOG_FAILED'; +exports[3182] = 'ER_MASTER_KEY_ROTATION_SE_UNAVAILABLE'; +exports[3183] = 'ER_TABLESPACE_CANNOT_ENCRYPT'; +exports[3184] = 'ER_INVALID_ENCRYPTION_OPTION'; +exports[3185] = 'ER_CANNOT_FIND_KEY_IN_KEYRING'; +exports[3186] = 'ER_CAPACITY_EXCEEDED_IN_PARSER'; +exports[3187] = 'ER_UNSUPPORTED_ALTER_ENCRYPTION_INPLACE'; +exports[3188] = 'ER_KEYRING_UDF_KEYRING_SERVICE_ERROR'; +exports[3189] = 'ER_USER_COLUMN_OLD_LENGTH'; +exports[3190] = 'ER_CANT_RESET_MASTER'; +exports[3191] = 'ER_GROUP_REPLICATION_MAX_GROUP_SIZE'; +exports[3192] = 'ER_CANNOT_ADD_FOREIGN_BASE_COL_STORED'; +exports[3193] = 'ER_TABLE_REFERENCED'; +exports[3194] = 'ER_PARTITION_ENGINE_DEPRECATED_FOR_TABLE'; +exports[3195] = 'ER_WARN_USING_GEOMFROMWKB_TO_SET_SRID_ZERO'; +exports[3196] = 'ER_WARN_USING_GEOMFROMWKB_TO_SET_SRID'; +exports[3197] = 'ER_XA_RETRY'; +exports[3198] = 'ER_KEYRING_AWS_UDF_AWS_KMS_ERROR'; +exports[3199] = 'ER_BINLOG_UNSAFE_XA'; +exports[3200] = 'ER_UDF_ERROR'; +exports[3201] = 'ER_KEYRING_MIGRATION_FAILURE'; +exports[3202] = 'ER_KEYRING_ACCESS_DENIED_ERROR'; +exports[3203] = 'ER_KEYRING_MIGRATION_STATUS'; +exports[3204] = 'ER_PLUGIN_FAILED_TO_OPEN_TABLES'; +exports[3205] = 'ER_PLUGIN_FAILED_TO_OPEN_TABLE'; +exports[3206] = 'ER_AUDIT_LOG_NO_KEYRING_PLUGIN_INSTALLED'; +exports[3207] = 'ER_AUDIT_LOG_ENCRYPTION_PASSWORD_HAS_NOT_BEEN_SET'; +exports[3208] = 'ER_AUDIT_LOG_COULD_NOT_CREATE_AES_KEY'; +exports[3209] = 'ER_AUDIT_LOG_ENCRYPTION_PASSWORD_CANNOT_BE_FETCHED'; +exports[3210] = 'ER_AUDIT_LOG_JSON_FILTERING_NOT_ENABLED'; +exports[3211] = 'ER_AUDIT_LOG_UDF_INSUFFICIENT_PRIVILEGE'; +exports[3212] = 'ER_AUDIT_LOG_SUPER_PRIVILEGE_REQUIRED'; +exports[3213] = 'ER_COULD_NOT_REINITIALIZE_AUDIT_LOG_FILTERS'; +exports[3214] = 'ER_AUDIT_LOG_UDF_INVALID_ARGUMENT_TYPE'; +exports[3215] = 'ER_AUDIT_LOG_UDF_INVALID_ARGUMENT_COUNT'; +exports[3216] = 'ER_AUDIT_LOG_HAS_NOT_BEEN_INSTALLED'; +exports[3217] = 'ER_AUDIT_LOG_UDF_READ_INVALID_MAX_ARRAY_LENGTH_ARG_TYPE'; +exports[3218] = 'ER_AUDIT_LOG_UDF_READ_INVALID_MAX_ARRAY_LENGTH_ARG_VALUE'; +exports[3219] = 'ER_AUDIT_LOG_JSON_FILTER_PARSING_ERROR'; +exports[3220] = 'ER_AUDIT_LOG_JSON_FILTER_NAME_CANNOT_BE_EMPTY'; +exports[3221] = 'ER_AUDIT_LOG_JSON_USER_NAME_CANNOT_BE_EMPTY'; +exports[3222] = 'ER_AUDIT_LOG_JSON_FILTER_DOES_NOT_EXISTS'; +exports[3223] = 'ER_AUDIT_LOG_USER_FIRST_CHARACTER_MUST_BE_ALPHANUMERIC'; +exports[3224] = 'ER_AUDIT_LOG_USER_NAME_INVALID_CHARACTER'; +exports[3225] = 'ER_AUDIT_LOG_HOST_NAME_INVALID_CHARACTER'; +exports[3226] = 'WARN_DEPRECATED_MAXDB_SQL_MODE_FOR_TIMESTAMP'; +exports[3227] = 'ER_XA_REPLICATION_FILTERS'; +exports[3228] = 'ER_CANT_OPEN_ERROR_LOG'; +exports[3229] = 'ER_GROUPING_ON_TIMESTAMP_IN_DST'; +exports[3230] = 'ER_CANT_START_SERVER_NAMED_PIPE'; diff --git a/node_modules/mysql/lib/protocol/constants/field_flags.js b/node_modules/mysql/lib/protocol/constants/field_flags.js new file mode 100644 index 0000000..c698da5 --- /dev/null +++ b/node_modules/mysql/lib/protocol/constants/field_flags.js @@ -0,0 +1,18 @@ +// Manually extracted from mysql-5.5.23/include/mysql_com.h +exports.NOT_NULL_FLAG = 1; /* Field can't be NULL */ +exports.PRI_KEY_FLAG = 2; /* Field is part of a primary key */ +exports.UNIQUE_KEY_FLAG = 4; /* Field is part of a unique key */ +exports.MULTIPLE_KEY_FLAG = 8; /* Field is part of a key */ +exports.BLOB_FLAG = 16; /* Field is a blob */ +exports.UNSIGNED_FLAG = 32; /* Field is unsigned */ +exports.ZEROFILL_FLAG = 64; /* Field is zerofill */ +exports.BINARY_FLAG = 128; /* Field is binary */ + +/* The following are only sent to new clients */ +exports.ENUM_FLAG = 256; /* field is an enum */ +exports.AUTO_INCREMENT_FLAG = 512; /* field is a autoincrement field */ +exports.TIMESTAMP_FLAG = 1024; /* Field is a timestamp */ +exports.SET_FLAG = 2048; /* field is a set */ +exports.NO_DEFAULT_VALUE_FLAG = 4096; /* Field doesn't have default value */ +exports.ON_UPDATE_NOW_FLAG = 8192; /* Field is set to NOW on UPDATE */ +exports.NUM_FLAG = 32768; /* Field is num (for clients) */ diff --git a/node_modules/mysql2/lib/constants/server_status.js b/node_modules/mysql/lib/protocol/constants/server_status.js similarity index 66% rename from node_modules/mysql2/lib/constants/server_status.js rename to node_modules/mysql/lib/protocol/constants/server_status.js index 828c851..48880c3 100644 --- a/node_modules/mysql2/lib/constants/server_status.js +++ b/node_modules/mysql/lib/protocol/constants/server_status.js @@ -1,5 +1,3 @@ -'use strict'; - // Manually extracted from mysql-5.5.23/include/mysql_com.h /** @@ -9,11 +7,11 @@ implicitly, by the first transactional statement, when autocommit=off. */ -exports.SERVER_STATUS_IN_TRANS = 1; -exports.SERVER_STATUS_AUTOCOMMIT = 2; /* Server in auto_commit mode */ -exports.SERVER_MORE_RESULTS_EXISTS = 8; /* Multi query - next query exists */ +exports.SERVER_STATUS_IN_TRANS = 1; +exports.SERVER_STATUS_AUTOCOMMIT = 2; /* Server in auto_commit mode */ +exports.SERVER_MORE_RESULTS_EXISTS = 8; /* Multi query - next query exists */ exports.SERVER_QUERY_NO_GOOD_INDEX_USED = 16; -exports.SERVER_QUERY_NO_INDEX_USED = 32; +exports.SERVER_QUERY_NO_INDEX_USED = 32; /** The server was able to fulfill the clients request and opened a read-only non-scrollable cursor for a query. This flag comes @@ -24,8 +22,8 @@ exports.SERVER_STATUS_CURSOR_EXISTS = 64; This flag is sent when a read-only cursor is exhausted, in reply to COM_STMT_FETCH command. */ -exports.SERVER_STATUS_LAST_ROW_SENT = 128; -exports.SERVER_STATUS_DB_DROPPED = 256; /* A database was dropped */ +exports.SERVER_STATUS_LAST_ROW_SENT = 128; +exports.SERVER_STATUS_DB_DROPPED = 256; /* A database was dropped */ exports.SERVER_STATUS_NO_BACKSLASH_ESCAPES = 512; /** Sent to the client if after a prepared statement reprepare @@ -33,12 +31,9 @@ exports.SERVER_STATUS_NO_BACKSLASH_ESCAPES = 512; number of result set columns. */ exports.SERVER_STATUS_METADATA_CHANGED = 1024; -exports.SERVER_QUERY_WAS_SLOW = 2048; +exports.SERVER_QUERY_WAS_SLOW = 2048; /** To mark ResultSet containing output parameter values. */ exports.SERVER_PS_OUT_PARAMS = 4096; - -exports.SERVER_STATUS_IN_TRANS_READONLY = 0x2000; // in a read-only transaction -exports.SERVER_SESSION_STATE_CHANGED = 0x4000; diff --git a/node_modules/mysql/lib/protocol/constants/ssl_profiles.js b/node_modules/mysql/lib/protocol/constants/ssl_profiles.js new file mode 100644 index 0000000..bec1864 --- /dev/null +++ b/node_modules/mysql/lib/protocol/constants/ssl_profiles.js @@ -0,0 +1,1480 @@ +// Certificates for Amazon RDS +exports['Amazon RDS'] = { + ca: [ + /** + * Amazon RDS global certificate 2010 to 2015 + * + * CN = aws.amazon.com/rds/ + * OU = RDS + * O = Amazon.com + * L = Seattle + * ST = Washington + * C = US + * P = 2010-04-05T22:44:31Z/2015-04-04T22:41:31Z + * F = 7F:09:8D:A5:7D:BB:A6:EF:7C:70:D8:CA:4E:49:11:55:7E:89:A7:D3 + */ + '-----BEGIN CERTIFICATE-----\n' + + 'MIIDQzCCAqygAwIBAgIJAOd1tlfiGoEoMA0GCSqGSIb3DQEBBQUAMHUxCzAJBgNV\n' + + 'BAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdTZWF0dGxlMRMw\n' + + 'EQYDVQQKEwpBbWF6b24uY29tMQwwCgYDVQQLEwNSRFMxHDAaBgNVBAMTE2F3cy5h\n' + + 'bWF6b24uY29tL3Jkcy8wHhcNMTAwNDA1MjI0NDMxWhcNMTUwNDA0MjI0NDMxWjB1\n' + + 'MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHU2Vh\n' + + 'dHRsZTETMBEGA1UEChMKQW1hem9uLmNvbTEMMAoGA1UECxMDUkRTMRwwGgYDVQQD\n' + + 'ExNhd3MuYW1hem9uLmNvbS9yZHMvMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB\n' + + 'gQDKhXGU7tizxUR5WaFoMTFcxNxa05PEjZaIOEN5ctkWrqYSRov0/nOMoZjqk8bC\n' + + 'med9vPFoQGD0OTakPs0jVe3wwmR735hyVwmKIPPsGlaBYj1O6llIpZeQVyupNx56\n' + + 'UzqtiLaDzh1KcmfqP3qP2dInzBfJQKjiRudo1FWnpPt33QIDAQABo4HaMIHXMB0G\n' + + 'A1UdDgQWBBT/H3x+cqSkR/ePSIinPtc4yWKe3DCBpwYDVR0jBIGfMIGcgBT/H3x+\n' + + 'cqSkR/ePSIinPtc4yWKe3KF5pHcwdTELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldh\n' + + 'c2hpbmd0b24xEDAOBgNVBAcTB1NlYXR0bGUxEzARBgNVBAoTCkFtYXpvbi5jb20x\n' + + 'DDAKBgNVBAsTA1JEUzEcMBoGA1UEAxMTYXdzLmFtYXpvbi5jb20vcmRzL4IJAOd1\n' + + 'tlfiGoEoMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAvguZy/BDT66x\n' + + 'GfgnJlyQwnFSeVLQm9u/FIvz4huGjbq9dqnD6h/Gm56QPFdyMEyDiZWaqY6V08lY\n' + + 'LTBNb4kcIc9/6pc0/ojKciP5QJRm6OiZ4vgG05nF4fYjhU7WClUx7cxq1fKjNc2J\n' + + 'UCmmYqgiVkAGWRETVo+byOSDZ4swb10=\n' + + '-----END CERTIFICATE-----\n', + + /** + * Amazon RDS global root CA 2015 to 2020 + * + * CN = Amazon RDS Root CA + * OU = Amazon RDS + * O = Amazon Web Services, Inc. + * L = Seattle + * ST = Washington + * C = US + * P = 2015-02-05T09:11:31Z/2020-03-05T09:11:31Z + * F = E8:11:88:56:E7:A7:CE:3E:5E:DC:9A:31:25:1B:93:AC:DC:43:CE:B0 + */ + '-----BEGIN CERTIFICATE-----\n' + + 'MIID9DCCAtygAwIBAgIBQjANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx\n' + + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n' + + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n' + + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNTAyMDUwOTExMzFaFw0y\n' + + 'MDAzMDUwOTExMzFaMIGKMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n' + + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n' + + 'cywgSW5jLjETMBEGA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----\n', + + /** + * Amazon RDS global root CA 2019 to 2024 + * + * CN = Amazon RDS Root 2019 CA + * OU = Amazon RDS + * O = Amazon Web Services, Inc. + * L = Seattle + * ST = Washington + * C = US + * P = 2019-08-22T17:08:50Z/2024-08-22T17:08:50Z + * F = D4:0D:DB:29:E3:75:0D:FF:A6:71:C3:14:0B:BF:5F:47:8D:1C:80:96 + */ + '-----BEGIN CERTIFICATE-----\n' + + 'MIIEBjCCAu6gAwIBAgIJAMc0ZzaSUK51MA0GCSqGSIb3DQEBCwUAMIGPMQswCQYD\n' + + 'VQQGEwJVUzEQMA4GA1UEBwwHU2VhdHRsZTETMBEGA1UECAwKV2FzaGluZ3RvbjEi\n' + + 'MCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1h\n' + + 'em9uIFJEUzEgMB4GA1UEAwwXQW1hem9uIFJEUyBSb290IDIwMTkgQ0EwHhcNMTkw\n' + + 'ODIyMTcwODUwWhcNMjQwODIyMTcwODUwWjCBjzELMAkGA1UEBhMCVVMxEDAOBgNV\n' + + 'BAcMB1NlYXR0bGUxEzARBgNVBAgMCldhc2hpbmd0b24xIjAgBgNVBAoMGUFtYXpv\n' + + 'biBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMxIDAeBgNV\n' + + 'BAMMF0FtYXpvbiBSRFMgUm9vdCAyMDE5IENBMIIBIjANBgkqhkiG9w0BAQEFAAOC\n' + + 'AQ8AMIIBCgKCAQEArXnF/E6/Qh+ku3hQTSKPMhQQlCpoWvnIthzX6MK3p5a0eXKZ\n' + + 'oWIjYcNNG6UwJjp4fUXl6glp53Jobn+tWNX88dNH2n8DVbppSwScVE2LpuL+94vY\n' + + '0EYE/XxN7svKea8YvlrqkUBKyxLxTjh+U/KrGOaHxz9v0l6ZNlDbuaZw3qIWdD/I\n' + + '6aNbGeRUVtpM6P+bWIoxVl/caQylQS6CEYUk+CpVyJSkopwJlzXT07tMoDL5WgX9\n' + + 'O08KVgDNz9qP/IGtAcRduRcNioH3E9v981QO1zt/Gpb2f8NqAjUUCUZzOnij6mx9\n' + + 'McZ+9cWX88CRzR0vQODWuZscgI08NvM69Fn2SQIDAQABo2MwYTAOBgNVHQ8BAf8E\n' + + 'BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUc19g2LzLA5j0Kxc0LjZa\n' + + 'pmD/vB8wHwYDVR0jBBgwFoAUc19g2LzLA5j0Kxc0LjZapmD/vB8wDQYJKoZIhvcN\n' + + 'AQELBQADggEBAHAG7WTmyjzPRIM85rVj+fWHsLIvqpw6DObIjMWokpliCeMINZFV\n' + + 'ynfgBKsf1ExwbvJNzYFXW6dihnguDG9VMPpi2up/ctQTN8tm9nDKOy08uNZoofMc\n' + + 'NUZxKCEkVKZv+IL4oHoeayt8egtv3ujJM6V14AstMQ6SwvwvA93EP/Ug2e4WAXHu\n' + + 'cbI1NAbUgVDqp+DRdfvZkgYKryjTWd/0+1fS8X1bBZVWzl7eirNVnHbSH2ZDpNuY\n' + + '0SBd8dj5F6ld3t58ydZbrTHze7JJOd8ijySAp4/kiu9UfZWuTPABzDa/DSdz9Dk/\n' + + 'zPW4CXXvhLmE02TA9/HeCw3KEHIwicNuEfw=\n' + + '-----END CERTIFICATE-----\n', + + /** + * Amazon RDS ap-northeast-1 certificate CA 2015 to 2020 + * + * CN = Amazon RDS ap-northeast-1 CA + * OU = Amazon RDS + * O = Amazon Web Services, Inc. + * L = Seattle + * ST = Washington + * C = US + * P = 2015-02-05T22:03:06Z/2020-03-05T22:03:06Z + * F = 4B:2D:8A:E0:C1:A3:A9:AF:A7:BB:65:0C:5A:16:8A:39:3C:03:F2:C5 + */ + '-----BEGIN CERTIFICATE-----\n' + + 'MIIEATCCAumgAwIBAgIBRDANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx\n' + + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0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txqAKasXHgKX8I9Tw\n' + + 'JkBiGWiuzqn7gO5MJ0nMMro1+gq29qjZnYX1pDHPgsRjUX8R+juRhgJ3JSHijRbf\n' + + '4qNJrnwga7pj94MhcLq9u0f6dxH6dXbyMv21T4TZMTmcFduf1KgaiVx1PEyJjC6r\n' + + 'M+Ru+A0eM+jJ7uCjUoZKcpX8xkj4nmSnz9NMPog3wdOSB9cAW7XIc5mHa656wr7I\n' + + 'WJxVcYNHTXIjCcng2zMKd1aCcl2KSFfy56sRfT7J5Wp69QSr+jq8KM55gw8uqAwi\n' + + 'VPrXn2899T1rcTtFYFP16WXjGuc0\n' + + '-----END CERTIFICATE-----\n', + + /** + * Amazon RDS ap-northeast-2 certificate CA 2015 to 2020 + * + * CN = Amazon RDS ap-northeast-2 CA + * OU = Amazon RDS + * O = Amazon Web Services, Inc. + * L = Seattle + * ST = Washington + * C = US + * P = 2015-11-06T00:05:46Z/2020-03-05T00:05:46Z + * F = 77:D9:33:4E:CE:56:FC:42:7B:29:57:8D:67:59:ED:29:4E:18:CB:6B + */ + '-----BEGIN CERTIFICATE-----\n' + + 'MIIEATCCAumgAwIBAgIBTDANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx\n' + + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n' + + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n' + + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNTExMDYwMDA1NDZaFw0y\n' + + 'MDAzMDUwMDA1NDZaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n' + + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n' + + 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzElMCMGA1UE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', + + /** + * Amazon RDS ap-southeast-1 certificate CA 2015 to 2020 + * + * CN = Amazon RDS ap-southeast-1 CA + * OU = Amazon RDS + * O = Amazon Web Services, Inc. + * L = Seattle + * ST = Washington + * C = US + * P = 2015-02-05T22:03:19Z/2020-03-05T22:03:19Z + * F = 0E:EC:5D:BD:F9:80:EE:A9:A0:8D:81:AC:37:D9:8D:34:1C:CD:27:D1 + */ + '-----BEGIN CERTIFICATE-----\n' + + 'MIIEATCCAumgAwIBAgIBRTANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx\n' + + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n' + + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n' + + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNTAyMDUyMjAzMTlaFw0y\n' + + 'MDAzMDUyMjAzMTlaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n' + + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n' + + 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzElMCMGA1UEAwwcQW1hem9uIFJE\n' + + 'UyBhcC1zb3V0aGVhc3QtMSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC\n' + + 'ggEBANaXElmSEYt/UtxHFsARFhSUahTf1KNJzR0Dmay6hqOXQuRVbKRwPd19u5vx\n' + + 'DdF1sLT7D69IK3VDnUiQScaCv2Dpu9foZt+rLx+cpx1qiQd1UHrvqq8xPzQOqCdC\n' + + 'RFStq6yVYZ69yfpfoI67AjclMOjl2Vph3ftVnqP0IgVKZdzeC7fd+umGgR9xY0Qr\n' + + 'Ubhd/lWdsbNvzK3f1TPWcfIKQnpvSt85PIEDJir6/nuJUKMtmJRwTymJf0i+JZ4x\n' + + '7dJa341p2kHKcHMgOPW7nJQklGBA70ytjUV6/qebS3yIugr/28mwReflg3TJzVDl\n' + + 'EOvi6pqbqNbkMuEwGDCmEQIVqgkCAwEAAaNmMGQwDgYDVR0PAQH/BAQDAgEGMBIG\n' + + 'A1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFAu93/4k5xbWOsgdCdn+/KdiRuit\n' + + 'MB8GA1UdIwQYMBaAFE4C7qw+9hXITO0s9QXBj5yECEmDMA0GCSqGSIb3DQEBBQUA\n' + + 'A4IBAQBlcjSyscpPjf5+MgzMuAsCxByqUt+WFspwcMCpwdaBeHOPSQrXNqX2Sk6P\n' + + 'kth6oCivA64trWo8tFMvPYlUA1FYVD5WpN0kCK+P5pD4KHlaDsXhuhClJzp/OP8t\n' + + 'pOyUr5109RHLxqoKB5J5m1XA7rgcFjnMxwBSWFe3/4uMk/+4T53YfCVXuc6QV3i7\n' + + 'I/2LAJwFf//pTtt6fZenYfCsahnr2nvrNRNyAxcfvGZ/4Opn/mJtR6R/AjvQZHiR\n' + + 'bkRNKF2GW0ueK5W4FkZVZVhhX9xh1Aj2Ollb+lbOqADaVj+AT3PoJPZ3MPQHKCXm\n' + + 'xwG0LOLlRr/TfD6li1AfOVTAJXv9\n' + + '-----END CERTIFICATE-----\n', + + /** + * Amazon RDS ap-southeast-2 certificate CA 2015 to 2020 + * + * CN = Amazon RDS ap-southeast-2 CA + * OU = Amazon RDS + * O = Amazon Web Services, Inc. + * L = Seattle + * ST = Washington + * C = US + * P = 2015-02-05T22:03:24Z/2020-03-05T22:03:24Z + * F = 20:D9:A8:82:23:AB:B9:E5:C5:24:10:D3:4D:0F:3D:B1:31:DF:E5:14 + */ + '-----BEGIN CERTIFICATE-----\n' + + 'MIIEATCCAumgAwIBAgIBRjANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx\n' + + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB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SgToYfCJ/5Cfi0NT/Y\n' + + 'PRnk3GchychCJgoPA/k9d0//IhYEAIiIDjyFVgjbTkKV3sh4RbdldKVOUB9kumz/\n' + + 'ZpShplsGt3z4QQiVnKfrAgqxWDjR0I0pQKkxXa6Sjkicos9LQxVtJ0XA4ieG1E7z\n' + + 'zJr+6t80wmzxvkInSaWP3xNJK9azVRTrgQZQlvkbpDbExl4mNTG66VD3bAp6t3Wa\n' + + 'B49//uDdfZmPkqqbX+hsxp160OH0rxJppwO3Bh869PkDnaPEd/Pxw7PawC+li0gi\n' + + 'NRV8iCEx85aFxcyOhqn0WZOasxee\n' + + '-----END CERTIFICATE-----\n', + + /** + * Amazon RDS eu-central-1 certificate CA 2015 to 2020 + * + * CN = Amazon RDS eu-central-1 CA + * OU = Amazon RDS + * O = Amazon Web Services, Inc. + * L = Seattle + * ST = Washington + * C = US + * P = 2015-02-05T22:03:31Z/2020-03-05T22:03:31Z + * F = 94:B4:DF:B9:6D:7E:F7:C3:B7:BF:51:E9:A6:B7:44:A0:D0:82:11:84 + */ + '-----BEGIN CERTIFICATE-----\n' + + 'MIID/zCCAuegAwIBAgIBRzANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx\n' + + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n' + + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n' + + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNTAyMDUyMjAzMzFaFw0y\n' + + 'MDAzMDUyMjAzMzFaMIGSMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n' + + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n' + + 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEjMCEGA1UEA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-----\n', + + /** + * Amazon RDS eu-west-1 certificate CA 2015 to 2020 + * + * CN = Amazon RDS eu-west-1 CA + * OU = Amazon RDS + * O = Amazon Web Services, Inc. + * L = Seattle + * ST = Washington + * C = US + * P = 2015-02-05T22:03:35Z/2020-03-05T22:03:35Z + * F = 1A:95:F0:43:82:D2:5D:A6:AD:F5:13:27:0B:40:8A:72:D9:92:F3:E0 + */ + '-----BEGIN CERTIFICATE-----\n' + + 'MIID/DCCAuSgAwIBAgIBSDANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx\n' + + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n' + + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n' + + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNTAyMDUyMjAzMzVaFw0y\n' + + 'MDAzMDUyMjAzMzVaMIGPMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n' + + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n' + + 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEgMB4GA1UEAwwXQW1hem9uIFJE\n' + + 'UyBldS13ZXN0LTEgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCx\n' + + 'PdbqQ0HKRj79Pmocxvjc+P6i4Ux24kgFIl+ckiir1vzkmesc3a58gjrMlCksEObt\n' + + 'Yihs5IhzEq1ePT0gbfS9GYFp34Uj/MtPwlrfCBWG4d2TcrsKRHr1/EXUYhWqmdrb\n' + + 'RhX8XqoRhVkbF/auzFSBhTzcGGvZpQ2KIaxRcQfcXlMVhj/pxxAjh8U4F350Fb0h\n' + + 'nX1jw4/KvEreBL0Xb2lnlGTkwVxaKGSgXEnOgIyOFdOQc61vdome0+eeZsP4jqeR\n' + + 'TGYJA9izJsRbe2YJxHuazD+548hsPlM3vFzKKEVURCha466rAaYAHy3rKur3HYQx\n' + + 'Yt+SoKcEz9PXuSGj96ejAgMBAAGjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMB\n' + + 'Af8ECDAGAQH/AgEAMB0GA1UdDgQWBBTebg//h2oeXbZjQ4uuoiuLYzuiPDAfBgNV\n' + + 'HSMEGDAWgBROAu6sPvYVyEztLPUFwY+chAhJgzANBgkqhkiG9w0BAQUFAAOCAQEA\n' + + 'TikPaGeZasTPw+4RBemlsyPAjtFFQLo7ddaFdORLgdEysVf8aBqndvbA6MT/v4lj\n' + + 'GtEtUdF59ZcbWOrVm+fBZ2h/jYJ59dYF/xzb09nyRbdMSzB9+mkSsnOMqluq5y8o\n' + + 'DY/PfP2vGhEg/2ZncRC7nlQU1Dm8F4lFWEiQ2fi7O1cW852Vmbq61RIfcYsH/9Ma\n' + + 'kpgk10VZ75b8m3UhmpZ/2uRY+JEHImH5WpcTJ7wNiPNJsciZMznGtrgOnPzYco8L\n' + + 'cDleOASIZifNMQi9PKOJKvi0ITz0B/imr8KBsW0YjZVJ54HMa7W1lwugSM7aMAs+\n' + + 'E3Sd5lS+SHwWaOCHwhOEVA==\n' + + '-----END CERTIFICATE-----\n', + + /** + * Amazon RDS sa-east-1 certificate CA 2015 to 2020 + * + * CN = Amazon RDS sa-east-1 CA + * OU = Amazon RDS + * O = Amazon Web Services, Inc. + * L = Seattle + * ST = Washington + * C = US + * P = 2015-02-05T22:03:40Z/2020-03-05T22:03:40Z + * F = 32:10:3D:FA:6D:42:F5:35:98:40:15:F4:4C:74:74:27:CB:CE:D4:B5 + */ + '-----BEGIN CERTIFICATE-----\n' + + 'MIID/DCCAuSgAwIBAgIBSTANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx\n' + + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGU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PtBAKs6KPY7Guvw\n' + + 'DpJoZSehDiOfsgMirjOWjvfkeWSNvKfjWTVneX7pZD9W5WPnsDBvTbCGezm+v87z\n' + + 'b+ZM2ZMo98m/wkMcIEAgdSKilR2fuw8rLkAjhYFfs0A7tDgZ9noKwgHvoE4dsrI0\n' + + 'KZYco6DlP/brASfHTPa2puBLN9McK3v+h0JaSqqm5Ro2Bh56tZkQh8AWy/miuDuK\n' + + '3+hNEVdxosxlkM1TPa1DGj0EzzK0yoeerXuH2HX7LlCrrxf6/wdKnjR12PMrLQ4A\n' + + 'pCqkcWw894z6bV9MAvKe6A==\n' + + '-----END CERTIFICATE-----\n', + + /** + * Amazon RDS us-east-1 certificate CA 2015 to 2020 + * + * CN = Amazon RDS us-east-1 CA + * OU = Amazon RDS + * O = Amazon Web Services, Inc. + * L = Seattle + * ST = Washington + * C = US + * P = 2015-02-05T21:54:04Z/2020-03-05T21:54:04Z + * F = 34:47:8A:90:8A:83:AE:45:DC:B6:16:76:D2:35:EC:E9:75:C6:2C:63 + */ + '-----BEGIN CERTIFICATE-----\n' + + 'MIID/DCCAuSgAwIBAgIBQzANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx\n' + + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n' + + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n' + + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNTAyMDUyMTU0MDRaFw0y\n' + + 'MDAzMDUyMTU0MDRaMIGPMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n' + + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n' + + 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEgMB4GA1UEAwwXQW1hem9uIFJE\n' + + 'UyB1cy1lYXN0LTEgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDI\n' + + 'UIuwh8NusKHk1SqPXcP7OqxY3S/M2ZyQWD3w7Bfihpyyy/fc1w0/suIpX3kbMhAV\n' + + '2ESwged2/2zSx4pVnjp/493r4luhSqQYzru78TuPt9bhJIJ51WXunZW2SWkisSaf\n' + + 'USYUzVN9ezR/bjXTumSUQaLIouJt3OHLX49s+3NAbUyOI8EdvgBQWD68H1epsC0n\n' + + 'CI5s+pIktyOZ59c4DCDLQcXErQ+tNbDC++oct1ANd/q8p9URonYwGCGOBy7sbCYq\n' + + '9eVHh1Iy2M+SNXddVOGw5EuruvHoCIQyOz5Lz4zSuZA9dRbrfztNOpezCNYu6NKM\n' + + 'n+hzcvdiyxv77uNm8EaxAgMBAAGjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMB\n' + + 'Af8ECDAGAQH/AgEAMB0GA1UdDgQWBBQSQG3TmMe6Sa3KufaPBa72v4QFDzAfBgNV\n' + + 'HSMEGDAWgBROAu6sPvYVyEztLPUFwY+chAhJgzANBgkqhkiG9w0BAQUFAAOCAQEA\n' + + 'L/mOZfB3187xTmjOHMqN2G2oSKHBKiQLM9uv8+97qT+XR+TVsBT6b3yoPpMAGhHA\n' + + 'Pc7nxAF5gPpuzatx0OTLPcmYucFmfqT/1qA5WlgCnMNtczyNMH97lKFTNV7Njtek\n' + + 'jWEzAEQSyEWrkNpNlC4j6kMYyPzVXQeXUeZTgJ9FNnVZqmvfjip2N22tawMjrCn5\n' + + '7KN/zN65EwY2oO9XsaTwwWmBu3NrDdMbzJnbxoWcFWj4RBwanR1XjQOVNhDwmCOl\n' + + '/1Et13b8CPyj69PC8BOVU6cfTSx8WUVy0qvYOKHNY9Bqa5BDnIL3IVmUkeTlM1mt\n' + + 'enRpyBj+Bk9rh/ICdiRKmA==\n' + + '-----END CERTIFICATE-----\n', + + /** + * Amazon RDS us-west-1 certificate CA 2015 to 2020 + * + * CN = Amazon RDS us-west-1 CA + * OU = Amazon RDS + * O = Amazon Web Services, Inc. + * L = Seattle + * ST = Washington + * C = US + * P = 2015-02-05T22:03:45Z/2020-03-05T22:03:45Z + * F = EF:94:2F:E3:58:0E:09:D6:79:C2:16:97:91:FB:37:EA:D7:70:A8:4B + */ + '-----BEGIN CERTIFICATE-----\n' + + 'MIID/DCCAuSgAwIBAgIBSjANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx\n' + + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n' + + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n' + + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNTAyMDUyMjAzNDVaFw0y\n' + + 'MDAzMDUyMjAzNDVaMIGPMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n' + + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n' + + 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEgMB4GA1UEAwwXQW1hem9uIFJE\n' + + 'UyB1cy13ZXN0LTEgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDE\n' + + 'Dhw+uw/ycaiIhhyu2pXFRimq0DlB8cNtIe8hdqndH8TV/TFrljNgR8QdzOgZtZ9C\n' + + 'zzQ2GRpInN/qJF6slEd6wO+6TaDBQkPY+07TXNt52POFUhdVkhJXHpE2BS7Xn6J7\n' + + '7RFAOeG1IZmc2DDt+sR1BgXzUqHslQGfFYNS0/MBO4P+ya6W7IhruB1qfa4HiYQS\n' + + 'dbe4MvGWnv0UzwAqdR7OF8+8/5c58YXZIXCO9riYF2ql6KNSL5cyDPcYK5VK0+Q9\n' + + 'VI6vuJHSMYcF7wLePw8jtBktqAFE/wbdZiIHhZvNyiNWPPNTGUmQbaJ+TzQEHDs5\n' + + '8en+/W7JKnPyBOkxxENbAgMBAAGjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMB\n' + + 'Af8ECDAGAQH/AgEAMB0GA1UdDgQWBBS0nw/tFR9bCjgqWTPJkyy4oOD8bzAfBgNV\n' + + 'HSMEGDAWgBROAu6sPvYVyEztLPUFwY+chAhJgzANBgkqhkiG9w0BAQUFAAOCAQEA\n' + + 'CXGAY3feAak6lHdqj6+YWjy6yyUnLK37bRxZDsyDVXrPRQaXRzPTzx79jvDwEb/H\n' + + 'Q/bdQ7zQRWqJcbivQlwhuPJ4kWPUZgSt3JUUuqkMsDzsvj/bwIjlrEFDOdHGh0mi\n' + + 'eVIngFEjUXjMh+5aHPEF9BlQnB8LfVtKj18e15UDTXFa+xJPFxUR7wDzCfo4WI1m\n' + + 'sUMG4q1FkGAZgsoyFPZfF8IVvgCuGdR8z30VWKklFxttlK0eGLlPAyIO0CQxPQlo\n' + + 'saNJrHf4tLOgZIWk+LpDhNd9Et5EzvJ3aURUsKY4pISPPF5WdvM9OE59bERwUErd\n' + + 'nuOuQWQeeadMceZnauRzJQ==\n' + + '-----END CERTIFICATE-----\n', + + /** + * Amazon RDS us-west-2 certificate CA 2015 to 2020 + * + * CN = Amazon RDS us-west-2 CA + * OU = Amazon RDS + * O = Amazon Web Services, Inc. + * L = Seattle + * ST = Washington + * C = US + * P = 2015-02-05T22:03:50Z/2020-03-05T22:03:50Z + * F = 94:2C:A8:B0:23:48:17:F0:CD:2F:19:7F:C1:E0:21:7C:65:79:13:3A + */ + '-----BEGIN CERTIFICATE-----\n' + + 'MIID/DCCAuSgAwIBAgIBSzANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx\n' + + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n' + + 'GUFtYX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0CVfKaeLYNsOBVW3X4ZPmffYfWBheZiaiEflq/P6t7/Eg81gaKYnZ/x1Dfa\n' + + 'sUYkzPvCkXe9wEz5zdUTOCptDt89rBR9CstL9vE7WYUgiVVmBJffWbHQLtfjv6OF\n' + + 'NMb0QME981kGRzc2WhgP71YS2hHd1kXtsoYP1yTu4vThSKsoN4bkiHsaC1cRkLoy\n' + + '0fFA4wpB3WloMEvCDaUvvH1LZlBXTNlwi9KtcwD4tDxkkBt4tQczKLGpQ/nF/W9n\n' + + '8YDWk3IIc1sd0bkZqoau2Q==\n' + + '-----END CERTIFICATE-----\n', + + /** + * Amazon RDS ap-south-1 certificate CA 2016 to 2020 + * + * CN = Amazon RDS ap-south-1 CA + * OU = Amazon RDS + * O = Amazon Web Services, Inc. + * L = Seattle + * ST = Washington + * C = US + * P = 2016-05-03T21:29:22Z/2020-03-05T21:29:22Z + * F = F3:A3:C2:52:D9:82:20:AC:8C:62:31:2A:8C:AD:5D:7B:1C:31:F1:DD + */ + '-----BEGIN CERTIFICATE-----\n' + + 'MIID/TCCAuWgAwIBAgIBTTANBgkqhkiG9w0BAQsFADCBijELMAkGA1UEBhMCVVMx\n' + + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n' + + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n' + + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNjA1MDMyMTI5MjJaFw0y\n' + + 'MDAzMDUyMTI5MjJaMIGQMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n' + + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n' + + 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEhMB8GA1UEAwwYQW1hem9uIFJE\n' + + 'UyBhcC1zb3V0aC0xIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA\n' + + '06eWGLE0TeqL9kyWOLkS8q0fXO97z+xyBV3DKSB2lg2GkgBz3B98MkmkeB0SZy3G\n' + + 'Ce4uCpCPbFKiFEdiUclOlhZsrBuCeaimxLM3Ig2wuenElO/7TqgaYHYUbT3d+VQW\n' + + 'GUbLn5GRZJZe1OAClYdOWm7A1CKpuo+cVV1vxbY2nGUQSJPpVn2sT9gnwvjdE60U\n' + + 'JGYU/RLCTm8zmZBvlWaNIeKDnreIc4rKn6gUnJ2cQn1ryCVleEeyc3xjYDSrjgdn\n' + + 'FLYGcp9mphqVT0byeQMOk0c7RHpxrCSA0V5V6/CreFV2LteK50qcDQzDSM18vWP/\n' + + 'p09FoN8O7QrtOeZJzH/lmwIDAQABo2YwZDAOBgNVHQ8BAf8EBAMCAQYwEgYDVR0T\n' + + 'AQH/BAgwBgEB/wIBADAdBgNVHQ4EFgQU2i83QHuEl/d0keXF+69HNJph7cMwHwYD\n' + + 'VR0jBBgwFoAUTgLurD72FchM7Sz1BcGPnIQISYMwDQYJKoZIhvcNAQELBQADggEB\n' + + 'ACqnH2VjApoDqoSQOky52QBwsGaj+xWYHW5Gm7EvCqvQuhWMkeBuD6YJmMvNyA9G\n' + + 'I2lh6/o+sUk/RIsbYbxPRdhNPTOgDR9zsNRw6qxaHztq/CEC+mxDCLa3O1hHBaDV\n' + + 'BmB3nCZb93BvO0EQSEk7aytKq/f+sjyxqOcs385gintdHGU9uM7gTZHnU9vByJsm\n' + + '/TL07Miq67X0NlhIoo3jAk+xHaeKJdxdKATQp0448P5cY20q4b8aMk1twcNaMvCP\n' + + 'dG4M5doaoUA8OQ/0ukLLae/LBxLeTw04q1/a2SyFaVUX2Twbb1S3xVWwLA8vsyGr\n' + + 'igXx7B5GgP+IHb6DTjPJAi0=\n' + + '-----END CERTIFICATE-----\n', + + /** + * Amazon RDS us-east-2 certificate CA 2016 to 2020 + * + * CN = Amazon RDS us-east-2 CA + * OU = Amazon RDS + * O = Amazon Web Services, Inc. + * L = Seattle + * ST = Washington + * C = US + * P = 2016-08-11T19:58:45Z/2020-03-05T19:58:45Z + * F = 9B:78:E3:64:7F:74:BC:B2:52:18:CF:13:C3:62:B8:35:9D:3D:5F:B6 + */ + '-----BEGIN CERTIFICATE-----\n' + + 'MIID/DCCAuSgAwIBAgIBTjANBgkqhkiG9w0BAQsFADCBijELMAkGA1UEBhMCVVMx\n' + + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n' + + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n' + + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNjA4MTExOTU4NDVaFw0y\n' + + 'MDAzMDUxOTU4NDVaMIGPMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n' + + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n' + + 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEgMB4GA1UEAwwXQW1hem9uIFJE\n' + + 'UyB1cy1lYXN0LTIgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCp\n' + + 'WnnUX7wM0zzstccX+4iXKJa9GR0a2PpvB1paEX4QRCgfhEdQWDaSqyrWNgdVCKkt\n' + + '1aQkWu5j6VAC2XIG7kKoonm1ZdBVyBLqW5lXNywlaiU9yhJkwo8BR+/OqgE+PLt/\n' + + 'EO1mlN0PQudja/XkExCXTO29TG2j7F/O7hox6vTyHNHc0H88zS21uPuBE+jivViS\n' + + 'yzj/BkyoQ85hnkues3f9R6gCGdc+J51JbZnmgzUkvXjAEuKhAm9JksVOxcOKUYe5\n' + + 'ERhn0U9zjzpfbAITIkul97VVa5IxskFFTHIPJbvRKHJkiF6wTJww/tc9wm+fSCJ1\n' + + '+DbQTGZgkQ3bJrqRN29/AgMBAAGjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMB\n' + + 'Af8ECDAGAQH/AgEAMB0GA1UdDgQWBBSAHQzUYYZbepwKEMvGdHp8wzHnfDAfBgNV\n' + + 'HSMEGDAWgBROAu6sPvYVyEztLPUFwY+chAhJgzANBgkqhkiG9w0BAQsFAAOCAQEA\n' + + 'MbaEzSYZ+aZeTBxf8yi0ta8K4RdwEJsEmP6IhFFQHYUtva2Cynl4Q9tZg3RMsybT\n' + + '9mlnSQQlbN/wqIIXbkrcgFcHoXG9Odm/bDtUwwwDaiEhXVfeQom3G77QHOWMTCGK\n' + + 'qadwuh5msrb17JdXZoXr4PYHDKP7j0ONfAyFNER2+uecblHfRSpVq5UeF3L6ZJb8\n' + + 'fSw/GtAV6an+/0r+Qm+PiI2H5XuZ4GmRJYnGMhqWhBYrY7p3jtVnKcsh39wgfUnW\n' + + 'AvZEZG/yhFyAZW0Essa39LiL5VSq14Y1DOj0wgnhSY/9WHxaAo1HB1T9OeZknYbD\n' + + 'fl/EGSZ0TEvZkENrXcPlVA==\n' + + '-----END CERTIFICATE-----\n', + + /** + * Amazon RDS ca-central-1 certificate CA 2016 to 2020 + * + * CN = Amazon RDS ca-central-1 CA + * OU = Amazon RDS + * O = Amazon Web Services, Inc. + * L = Seattle + * ST = Washington + * C = US + * P = 2016-09-15T00:10:11Z/2020-03-05T00:10:11Z + * F = D7:E0:16:AB:8A:0B:63:9F:67:1F:16:87:42:F4:0A:EE:73:A6:FC:04 + */ + '-----BEGIN CERTIFICATE-----\n' + + 'MIID/zCCAuegAwIBAgIBTzANBgkqhkiG9w0BAQsFADCBijELMAkGA1UEBhMCVVMx\n' + + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n' + + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluY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WYL1nz63axieUUFIxqxl1KmwfhsmLgZ0Hd2mnTPIl2Hw3uj5+wdgGBg\n' + + 'agnAZ0bajsBYgD2VGQbqjdk2Qn7Fjy3LEWIvGZx4KyZ99OJ2QxB7JOPdauURAtWA\n' + + 'DKYkP4LLJxtj07DSzG8kuRWb9B47uqUD+eKDIyjfjbnzGtd9HqqzYFau7EX3HVD9\n' + + '9Qhnjl7bTZ6YfAEZ3nH2t3Vc0z76XfGh47rd0pNRhMV+xpok75asKf/lNh5mcUrr\n' + + 'VKwflyMkQpSbDCmcdJ90N2xEXQ==\n' + + '-----END CERTIFICATE-----\n', + + /** + * Amazon RDS eu-west-2 certificate CA 2016 to 2020 + * + * CN = Amazon RDS eu-west-2 CA + * OU = Amazon RDS + * O = Amazon Web Services, Inc. + * L = Seattle + * ST = Washington + * C = US + * P = 2016-10-10T17:44:42Z/2020-03-05T17:44:42Z + * F = 47:79:51:9F:FF:07:D3:F4:27:D3:AB:64:56:7F:00:45:BB:84:C1:71 + */ + '-----BEGIN CERTIFICATE-----\n' + + 'MIID/DCCAuSgAwIBAgIBUDANBgkqhkiG9w0BAQsFADCBijELMAkGA1UEBhMCVVMx\n' + + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n' + + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n' + + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNjEwMTAxNzQ0NDJaFw0y\n' + + 'MDAzMDUxNzQ0NDJaMIGPMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n' + + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n' + + 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEgMB4GA1UEAwwXQW1hem9uIFJE\n' + + 'UyBldS13ZXN0LTIgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDO\n' + + 'cttLJfubB4XMMIGWNfJISkIdCMGJyOzLiMJaiWB5GYoXKhEl7YGotpy0qklwW3BQ\n' + + 'a0fmVdcCLX+dIuVQ9iFK+ZcK7zwm7HtdDTCHOCKeOh2IcnU4c/VIokFi6Gn8udM6\n' + + 'N/Zi5M5OGpVwLVALQU7Yctsn3c95el6MdVx6mJiIPVu7tCVZn88Z2koBQ2gq9P4O\n' + + 'Sb249SHFqOb03lYDsaqy1NDsznEOhaRBw7DPJFpvmw1lA3/Y6qrExRI06H2VYR2i\n' + + '7qxwDV50N58fs10n7Ye1IOxTVJsgEA7X6EkRRXqYaM39Z76R894548WHfwXWjUsi\n' + + 'MEX0RS0/t1GmnUQjvevDAgMBAAGjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMB\n' + + 'Af8ECDAGAQH/AgEAMB0GA1UdDgQWBBQBxmcuRSxERYCtNnSr5xNfySokHjAfBgNV\n' + + 'HSMEGDAWgBROAu6sPvYVyEztLPUFwY+chAhJgzANBgkqhkiG9w0BAQsFAAOCAQEA\n' + + 'UyCUQjsF3nUAABjfEZmpksTuUo07aT3KGYt+EMMFdejnBQ0+2lJJFGtT+CDAk1SD\n' + + 'RSgfEBon5vvKEtlnTf9a3pv8WXOAkhfxnryr9FH6NiB8obISHNQNPHn0ljT2/T+I\n' + + 'Y6ytfRvKHa0cu3V0NXbJm2B4KEOt4QCDiFxUIX9z6eB4Kditwu05OgQh6KcogOiP\n' + + 'JesWxBMXXGoDC1rIYTFO7szwDyOHlCcVXJDNsTJhc32oDWYdeIbW7o/5I+aQsrXZ\n' + + 'C96HykZcgWzz6sElrQxUaT3IoMw/5nmw4uWKKnZnxgI9bY4fpQwMeBZ96iHfFxvH\n' + + 'mqfEEuC7uUoPofXdBp2ObQ==\n' + + '-----END CERTIFICATE-----\n', + + /** + * Amazon RDS us-gov-west-1 CA 2017 to 2022 + * + * CN = Amazon RDS us-gov-west-1 CA + * OU = Amazon RDS + * O = Amazon Web Services, Inc. + * L = Seattle + * ST = Washington + * C = US + * P = 2017-05-19T22:31:19Z/2022-05-18T12:00:00Z + * F = 77:55:8C:C4:5E:71:1F:1B:57:E3:DA:6E:5B:74:27:12:4E:E8:69:E8 + */ + '-----BEGIN CERTIFICATE-----\n' + + 'MIIECjCCAvKgAwIBAgICEAAwDQYJKoZIhvcNAQELBQAwgZMxCzAJBgNVBAYTAlVT\n' + + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n' + + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n' + + 'MSQwIgYDVQQDDBtBbWF6b24gUkRTIEdvdkNsb3VkIFJvb3QgQ0EwHhcNMTcwNTE5\n' + + 'MjIzMTE5WhcNMjIwNTE4MTIwMDAwWjCBkzELMAkGA1UEBhMCVVMxEzARBgNVBAgM\n' + + 'Cldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoMGUFtYXpvbiBX\n' + + 'ZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMxJDAiBgNVBAMM\n' + + 'G0FtYXpvbiBSRFMgdXMtZ292LXdlc3QtMSBDQTCCASIwDQYJKoZIhvcNAQEBBQAD\n' + + 'ggEPADCCAQoCggEBAM8YZLKAzzOdNnoi7Klih26Zkj+OCpDfwx4ZYB6f8L8UoQi5\n' + + '8z9ZtIwMjiJ/kO08P1yl4gfc7YZcNFvhGruQZNat3YNpxwUpQcr4mszjuffbL4uz\n' + + '+/8FBxALdqCVOJ5Q0EVSfz3d9Bd1pUPL7ARtSpy7bn/tUPyQeI+lODYO906C0TQ3\n' + + 'b9bjOsgAdBKkHfjLdsknsOZYYIzYWOJyFJJa0B11XjDUNBy/3IuC0KvDl6At0V5b\n' + + '8M6cWcKhte2hgjwTYepV+/GTadeube1z5z6mWsN5arOAQUtYDLH6Aztq9mCJzLHm\n' + + 'RccBugnGl3fRLJ2VjioN8PoGoN9l9hFBy5fnFgsCAwEAAaNmMGQwDgYDVR0PAQH/\n' + + 'BAQDAgEGMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFEG7+br8KkvwPd5g\n' + + '71Rvh2stclJbMB8GA1UdIwQYMBaAFEkQz6S4NS5lOYKcDjBSuCcVpdzjMA0GCSqG\n' + + 'SIb3DQEBCwUAA4IBAQBMA327u5ABmhX+aPxljoIbxnydmAFWxW6wNp5+rZrvPig8\n' + + 'zDRqGQWWr7wWOIjfcWugSElYtf/m9KZHG/Z6+NG7nAoUrdcd1h/IQhb+lFQ2b5g9\n' + + 'sVzQv/H2JNkfZA8fL/Ko/Tm/f9tcqe0zrGCtT+5u0Nvz35Wl8CEUKLloS5xEb3k5\n' + + '7D9IhG3fsE3vHWlWrGCk1cKry3j12wdPG5cUsug0vt34u6rdhP+FsM0tHI15Kjch\n' + + 'RuUCvyQecy2ZFNAa3jmd5ycNdL63RWe8oayRBpQBxPPCbHfILxGZEdJbCH9aJ2D/\n' + + 'l8oHIDnvOLdv7/cBjyYuvmprgPtu3QEkbre5Hln/\n' + + '-----END CERTIFICATE-----\n', + + /** + * Amazon RDS eu-west-3 certificate CA 2017 to 2020 + * + * CN = Amazon RDS eu-west-3 CA + * OU = Amazon RDS + * O = Amazon Web Services, Inc. + * L = Seattle + * ST = Washington + * C = US + * P = 2017-08-25T21:39:26Z/2020-03-05T21:39:26Z + * F = FD:35:A7:84:60:68:98:00:12:54:ED:34:26:8C:66:0F:72:DD:B2:F4 + */ + '-----BEGIN CERTIFICATE-----\n' + + 'MIID/DCCAuSgAwIBAgIBUTANBgkqhkiG9w0BAQsFADCBijELMAkGA1UEBhMCVVMx\n' + + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBA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mrIspA3n3Dqxq\n' + + 'sMhAJD88s9Em7337t+naar2VyLO63MGwjj+vA4mtvQRKq8ScIpiEc7xN6g8HUMsd\n' + + 'gPG9lBGfNjuAZsrGJflrko4HyuSM7zHExMjXLH+CXcv/m3lWOZwnIvlVMa4x0Tz0\n' + + 'A4fklaawryngzeEjuW6zOiYCzjZtPlP8Fw0SpzppJ8VpQfrZ751RDo4yudmPqoPK\n' + + '5EUe36L8U+oYBXnC5TlYs9bpVv9o5wJQI5qA9oQE2eFWxF1E0AyZ4V5sgGUBStaX\n' + + 'BjDDWul0wSo7rt1Tq7XpnA==\n' + + '-----END CERTIFICATE-----\n', + + /** + * Amazon RDS ap-northeast-3 certificate CA 2017 to 2020 + * + * CN = Amazon RDS ap-northeast-3 CA + * OU = Amazon RDS + * O = Amazon Web Services, Inc. + * L = Seattle + * ST = Washington + * C = US + * P = 2017-12-01T00:55:42Z/2020-03-05T00:55:42Z + * F = C0:C7:D4:B3:91:40:A0:77:43:28:BF:AF:77:57:DF:FD:98:FB:10:3F + */ + '-----BEGIN CERTIFICATE-----\n' + + 'MIIEATCCAumgAwIBAgIBTjANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx\n' + + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n' + + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n' + + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNzEyMDEwMDU1NDJaFw0y\n' + + 'MDAzMDUwMDU1NDJaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n' + + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n' + + 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzElMCMGA1UEAwwcQW1hem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n', + + /** + * Amazon RDS GovCloud Root CA 2017 to 2022 + * + * CN = Amazon RDS GovCloud Root CA + * OU = Amazon RDS + * O = Amazon Web Services, Inc. + * L = Seattle + * ST = Washington + * C = US + * P = 2017-05-19T22:29:11Z/2022-05-18T22:29:11Z + * F = A3:61:F9:C9:A2:5B:91:FE:73:A6:52:E3:59:14:8E:CE:35:12:0F:FD + */ + '-----BEGIN CERTIFICATE-----\n' + + 'MIIEDjCCAvagAwIBAgIJAMM61RQn3/kdMA0GCSqGSIb3DQEBCwUAMIGTMQswCQYD\n' + + 'VQQGEwJVUzEQMA4GA1UEBwwHU2VhdHRsZTETMBEGA1UECAwKV2FzaGluZ3RvbjEi\n' + + 'MCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1h\n' + + 'em9uIFJEUzEkMCIGA1UEAwwbQW1hem9uIFJEUyBHb3ZDbG91ZCBSb290IENBMB4X\n' + + 'DTE3MDUxOTIyMjkxMVoXDTIyMDUxODIyMjkxMVowgZMxCzAJBgNVBAYTAlVTMRAw\n' + + 'DgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQKDBlB\n' + + 'bWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRTMSQw\n' + + 'IgYDVQQDDBtBbWF6b24gUkRTIEdvdkNsb3VkIFJvb3QgQ0EwggEiMA0GCSqGSIb3\n' + + 'DQEBAQUAA4IBDwAwggEKAoIBAQDGS9bh1FGiJPT+GRb3C5aKypJVDC1H2gbh6n3u\n' + + 'j8cUiyMXfmm+ak402zdLpSYMaxiQ7oL/B3wEmumIpRDAsQrSp3B/qEeY7ipQGOfh\n' + + 'q2TXjXGIUjiJ/FaoGqkymHRLG+XkNNBtb7MRItsjlMVNELXECwSiMa3nJL2/YyHW\n' + + 'nTr1+11/weeZEKgVbCUrOugFkMXnfZIBSn40j6EnRlO2u/NFU5ksK5ak2+j8raZ7\n' + + 'xW7VXp9S1Tgf1IsWHjGZZZguwCkkh1tHOlHC9gVA3p63WecjrIzcrR/V27atul4m\n' + + 'tn56s5NwFvYPUIx1dbC8IajLUrepVm6XOwdQCfd02DmOyjWJAgMBAAGjYzBhMA4G\n' + + 'A1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRJEM+kuDUu\n' + + 'ZTmCnA4wUrgnFaXc4zAfBgNVHSMEGDAWgBRJEM+kuDUuZTmCnA4wUrgnFaXc4zAN\n' + + 'BgkqhkiG9w0BAQsFAAOCAQEAcfA7uirXsNZyI2j4AJFVtOTKOZlQwqbyNducnmlg\n' + + '/5nug9fAkwM4AgvF5bBOD1Hw6khdsccMwIj+1S7wpL+EYb/nSc8G0qe1p/9lZ/mZ\n' + + 'ff5g4JOa26lLuCrZDqAk4TzYnt6sQKfa5ZXVUUn0BK3okhiXS0i+NloMyaBCL7vk\n' + + 'kDwkHwEqflRKfZ9/oFTcCfoiHPA7AdBtaPVr0/Kj9L7k+ouz122huqG5KqX0Zpo8\n' + + 'S0IGvcd2FZjNSNPttNAK7YuBVsZ0m2nIH1SLp//00v7yAHIgytQwwB17PBcp4NXD\n' + + 'pCfTa27ng9mMMC2YLqWQpW4TkqjDin2ZC+5X/mbrjzTvVg==\n' + + '-----END CERTIFICATE-----\n', + + /** + * Amazon RDS ap-east-1 certificate CA 2019 to 2022 + * + * CN = Amazon RDS ap-east-1 CA + * OU = Amazon RDS + * O = Amazon Web Services, Inc. + * L = Seattle + * ST = Washington + * C = US + * P = 2019-02-17T02:47:00Z/2022-06-01T12:00:00Z + * F = BC:F8:70:75:1F:93:3F:A7:82:86:67:63:A8:86:1F:A4:E8:07:CE:06 + */ + '-----BEGIN CERTIFICATE-----\n' + + 'MIIEBzCCAu+gAwIBAgICEAAwDQYJKoZIhvcNAQELBQAwgZQxCzAJBgNVBAYTAlVT\n' + + 'MRAwDgYDVQQHDAdTZWF0dGx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QDeXiS3v1z4jWAo1UvVyKDeHjtrtEH1Rida1eOXauFuEQa5tuOk\n' + + 'E53Os4haZCW4mOlKjigWs4LN+uLIAe1aFXGo92nGIqyJISHJ1L+bopx/JmIbHMCZ\n' + + '0lTNJfR12yBma5VQy7vzeFku/SisKwX0Lov1oHD4MVhJoHbUJYkmAjxorcIHORvh\n' + + 'I3Vj5XrgDWtLDPL8/Id/roul/L+WX5ir+PGScKBfQIIN2lWdZoqdsx8YWqhm/ikL\n' + + 'C6qNieSwcvWL7C03ri0DefTQMY54r5wP33QU5hJ71JoaZI3YTeT0Nf+NRL4hM++w\n' + + 'Q0veeNzBQXg1f/JxfeA39IDIX1kiCf71tGlT\n' + + '-----END CERTIFICATE-----\n', + + /** + * Amazon RDS ap-northeast-1 certificate CA 2019 to 2024 + * + * CN = Amazon RDS ap-northeast-1 2019 CA + * OU = Amazon RDS + * O = Amazon Web Services, Inc. + * L = Seattle + * ST = Washington + * C = US + * P = 2019-09-18T16:56:20Z/2024-08-22T17:08:50Z + * F = 47:A3:F9:20:64:5C:9F:9D:48:8C:7D:E6:0B:86:D6:05:13:00:16:A1 + */ + '-----BEGIN CERTIFICATE-----\n' + + 'MIIEDDCCAvSgAwIBAgICcEUwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT\n' + + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n' + + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n' + + 'MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTgxNjU2\n' + + 'MjBaFw0yNDA4MjIxNzA4NTBaMIGZMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz\n' + + 'aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT\n' + +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+ + '2sGWyuPZPCk3gq+5pCjbD0c6DkhcMGI6WwxvM5V/zSM=\n' + + '-----END CERTIFICATE-----\n', + + /** + * Amazon RDS ap-northeast-2 certificate CA 2019 to 2024 + * + * CN = Amazon RDS ap-northeast-2 2019 CA + * OU = Amazon RDS + * O = Amazon Web Services, Inc. + * L = Seattle + * ST = Washington + * C = US + * P = 2019-09-10T17:46:21Z/2024-08-22T17:08:50Z + * F = 8E:1C:70:C1:64:BD:FC:F9:93:9B:A2:67:CA:CF:52:F0:E1:F7:B4:F0 + */ + '-----BEGIN CERTIFICATE-----\n' + + 'MIIEDDCCAvSgAwIBAgICOFAwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT\n' + + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n' + + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n' + + 'MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTAxNzQ2\n' + + 'MjFaFw0yNDA4MjIxNzA4NTBaMIGZMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz\n' + + 'aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT\n' + + 'ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEqMCgGA1UEAwwhQW1h\n' + + 'em9uIFJEUyBhcC1ub3J0aGVhc3QtMiAyMDE5IENBMIIBIjANBgkqhkiG9w0BAQEF\n' + + 'AAOCAQ8AMIIBCgKCAQEAzU72e6XbaJbi4HjJoRNjKxzUEuChKQIt7k3CWzNnmjc5\n' + + '8I1MjCpa2W1iw1BYVysXSNSsLOtUsfvBZxi/1uyMn5ZCaf9aeoA9UsSkFSZBjOCN\n' + + 'DpKPCmfV1zcEOvJz26+1m8WDg+8Oa60QV0ou2AU1tYcw98fOQjcAES0JXXB80P2s\n' + + '3UfkNcnDz+l4k7j4SllhFPhH6BQ4lD2NiFAP4HwoG6FeJUn45EPjzrydxjq6v5Fc\n' + + 'cQ8rGuHADVXotDbEhaYhNjIrsPL+puhjWfhJjheEw8c4whRZNp6gJ/b6WEes/ZhZ\n' + + 'h32DwsDsZw0BfRDUMgUn8TdecNexHUw8vQWeC181hwIDAQABo2YwZDAOBgNVHQ8B\n' + + 'Af8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBADAdBgNVHQ4EFgQUwW9bWgkWkr0U\n' + + 'lrOsq2kvIdrECDgwHwYDVR0jBBgwFoAUc19g2LzLA5j0Kxc0LjZapmD/vB8wDQYJ\n' + + 'KoZIhvcNAQELBQADggEBAEugF0Gj7HVhX0ehPZoGRYRt3PBuI2YjfrrJRTZ9X5wc\n' + + '9T8oHmw07mHmNy1qqWvooNJg09bDGfB0k5goC2emDiIiGfc/kvMLI7u+eQOoMKj6\n' + + 'mkfCncyRN3ty08Po45vTLBFZGUvtQmjM6yKewc4sXiASSBmQUpsMbiHRCL72M5qV\n' + + 'obcJOjGcIdDTmV1BHdWT+XcjynsGjUqOvQWWhhLPrn4jWe6Xuxll75qlrpn3IrIx\n' + + 'CRBv/5r7qbcQJPOgwQsyK4kv9Ly8g7YT1/vYBlR3cRsYQjccw5ceWUj2DrMVWhJ4\n' + + 'prf+E3Aa4vYmLLOUUvKnDQ1k3RGNu56V0tonsQbfsaM=\n' + + '-----END CERTIFICATE-----\n', + + /** + * Amazon RDS ap-northeast-3 certificate CA 2019 to 2024 + * + * CN = Amazon RDS ap-northeast-3 2019 CA + * OU = Amazon RDS + * O = Amazon Web Services, Inc. + * L = Seattle + * ST = Washington + * C = US + * P = 2019-09-17T20:05:29Z/2024-08-22T17:08:50Z + * F = D1:08:B1:40:6D:6C:80:8E:F4:C1:2C:8A:1F:66:17:01:54:CD:1A:4E + */ + '-----BEGIN CERTIFICATE-----\n' + + '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+\n' + + 'gv1YLN/ABPMdxSAwHwYDVR0jBBgwFoAUc19g2LzLA5j0Kxc0LjZapmD/vB8wDQYJ\n' + + 'KoZIhvcNAQELBQADggEBAJAF3E9PM1uzVL8YNdzb6fwJrxxqI2shvaMVmC1mXS+w\n' + + 'G0zh4v2hBZOf91l1EO0rwFD7+fxoI6hzQfMxIczh875T6vUXePKVOCOKI5wCrDad\n' + + 'zQbVqbFbdhsBjF4aUilOdtw2qjjs9JwPuB0VXN4/jY7m21oKEOcnpe36+7OiSPjN\n' + + 'xngYewCXKrSRqoj3mw+0w/+exYj3Wsush7uFssX18av78G+ehKPIVDXptOCP/N7W\n' + + '8iKVNeQ2QGTnu2fzWsGUSvMGyM7yqT+h1ILaT//yQS8er511aHMLc142bD4D9VSy\n' + + 'DgactwPDTShK/PXqhvNey9v/sKXm4XatZvwcc8KYlW4=\n' + + '-----END CERTIFICATE-----\n', + + /** + * Amazon RDS ap-south-1 certificate CA 2019 to 2024 + * + * CN = Amazon RDS ap-south-1 2019 CA + * OU = Amazon RDS + * O = Amazon Web Services, Inc. + * L = Seattle + * ST = Washington + * C = US + * P = 2019-09-04T17:13:04Z/2024-08-22T17:08:50Z + * F = D6:AD:45:A9:54:36:E4:BA:9C:B7:9B:06:8C:0C:CD:CC:1E:81:B5:00 + */ + '-----BEGIN CERTIFICATE-----\n' + + 'MIIECDCCAvCgAwIBAgICVIYwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT\n' + + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n' + + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n' + + 'MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MDQxNzEz\n' + + 'MDRaFw0yNDA4MjIxNzA4NTBaMIGVMQswCQYDVQQGEwJVUzETMBEG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LkHM7ycc1/ZOwRq9aaTe\n' + + 'iOghbQQyAEe03MWCyDGtSmDfr0qEk+CHN+6hPiaL8qKt4s+V9P7DeK4iW08ny8Ox\n' + + 'AVS7u0OK/5+jKMAMrKwpYrBydOjTUTHScocyNw==\n' + + '-----END CERTIFICATE-----\n', + + /** + * Amazon RDS ap-southeast-1 certificate CA 2019 to 2024 + * + * CN = Amazon RDS ap-southeast-1 2019 CA + * OU = Amazon RDS + * O = Amazon Web Services, Inc. + * L = Seattle + * ST = Washington + * C = US + * P = 2019-09-13T20:11:42Z/2024-08-22T17:08:50Z + * F = 0D:20:FB:91:DE:BE:D2:CF:F3:F8:F8:43:AF:68:C6:03:76:F3:DD:B8 + */ + '-----BEGIN CERTIFICATE-----\n' + + 'MIIEDDCCAvSgAwIBAgICY4kwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT\n' + + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n' + + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n' + + 'MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTMyMDEx\n' + + 'NDJaFw0yNDA4MjIxNzA4NTBaMIGZMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz\n' + + 'aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT\n' + + 'ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEqMCgGA1UEAwwhQW1h\n' + + 'em9uIFJEUyBhcC1zb3V0aGVhc3QtMSAyMDE5IENBMIIBIjANBgkqhkiG9w0BAQEF\n' + + 'AAOCAQ8AMIIBCgKCAQEAr5u9OuLL/OF/fBNUX2kINJLzFl4DnmrhnLuSeSnBPgbb\n' + + 'qddjf5EFFJBfv7IYiIWEFPDbDG5hoBwgMup5bZDbas+ZTJTotnnxVJTQ6wlhTmns\n' + + 'eHECcg2pqGIKGrxZfbQhlj08/4nNAPvyYCTS0bEcmQ1emuDPyvJBYDDLDU6AbCB5\n' + + '6Z7YKFQPTiCBblvvNzchjLWF9IpkqiTsPHiEt21sAdABxj9ityStV3ja/W9BfgxH\n' + + 'wzABSTAQT6FbDwmQMo7dcFOPRX+hewQSic2Rn1XYjmNYzgEHisdUsH7eeXREAcTw\n' + + '61TRvaLH8AiOWBnTEJXPAe6wYfrcSd1pD0MXpoB62wIDAQABo2YwZDAOBgNVHQ8B\n' + + 'Af8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBADAdBgNVHQ4EFgQUytwMiomQOgX5\n' + + 'Ichd+2lDWRUhkikwHwYDVR0jBBgwFoAUc19g2LzLA5j0Kxc0LjZapmD/vB8wDQYJ\n' + + 'KoZIhvcNAQELBQADggEBACf6lRDpfCD7BFRqiWM45hqIzffIaysmVfr+Jr+fBTjP\n' + + 'uYe/ba1omSrNGG23bOcT9LJ8hkQJ9d+FxUwYyICQNWOy6ejicm4z0C3VhphbTPqj\n' + + 'yjpt9nG56IAcV8BcRJh4o/2IfLNzC/dVuYJV8wj7XzwlvjysenwdrJCoLadkTr1h\n' + + 'eIdG6Le07sB9IxrGJL9e04afk37h7c8ESGSE4E+oS4JQEi3ATq8ne1B9DQ9SasXi\n' + + 'IRmhNAaISDzOPdyLXi9N9V9Lwe/DHcja7hgLGYx3UqfjhLhOKwp8HtoZORixAmOI\n' + + 'HfILgNmwyugAbuZoCazSKKBhQ0wgO0WZ66ZKTMG8Oho=\n' + + '-----END CERTIFICATE-----\n', + + /** + * Amazon RDS ap-southeast-2 certificate CA 2019 to 2024 + * + * CN = Amazon RDS ap-southeast-2 2019 CA + * OU = Amazon RDS + * O = Amazon Web Services, Inc. + * L = Seattle + * ST = Washington + * C = US + * P = 2019-09-16T19:53:47Z/2024-08-22T17:08:50Z + * F = D5:D4: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8B\n' + + 'Af8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBADAdBgNVHQ4EFgQUwaZpaCme+EiV\n' + + 'M5gcjeHZSTgOn4owHwYDVR0jBBgwFoAUc19g2LzLA5j0Kxc0LjZapmD/vB8wDQYJ\n' + + 'KoZIhvcNAQELBQADggEBAAR6a2meCZuXO2TF9bGqKGtZmaah4pH2ETcEVUjkvXVz\n' + + 'sl+ZKbYjrun+VkcMGGKLUjS812e7eDF726ptoku9/PZZIxlJB0isC/0OyixI8N4M\n' + + 'NsEyvp52XN9QundTjkl362bomPnHAApeU0mRbMDRR2JdT70u6yAzGLGsUwMkoNnw\n' + + '1VR4XKhXHYGWo7KMvFrZ1KcjWhubxLHxZWXRulPVtGmyWg/MvE6KF+2XMLhojhUL\n' + + '+9jB3Fpn53s6KMx5tVq1x8PukHmowcZuAF8k+W4gk8Y68wIwynrdZrKRyRv6CVtR\n' + + 'FZ8DeJgoNZT3y/GT254VqMxxfuy2Ccb/RInd16tEvVk=\n' + + '-----END CERTIFICATE-----\n', + + /** + * Amazon RDS ca-central-1 certificate CA 2019 to 2024 + * + * CN = Amazon RDS ca-central-1 2019 CA + * OU = Amazon RDS + * O = Amazon Web Services, Inc. + * L = Seattle + * ST = Washington + * C = US + * P = 2019-09-10T20:52:25Z/2024-08-22T17:08:50Z + * F = A1:03:46:F2:BB:29:BF:4F:EC:04:7E:82:9A:A6:C0:11:4D:AB:82:25 + */ + '-----BEGIN CERTIFICATE-----\n' + + 'MIIECjCCAvKgAwIBAgICEzUwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT\n' + + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n' + + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n' + + 'MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeF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8WOx2M7IuC0ANEetIZURYhSp\n' + + 'xl9XOPRCJxOhj7JdelhpweX0BJDNHeUFi0ClnFOws8oKQ7sQEv66d5ddxqqZ3NVv\n' + + 'RbCvCtEutQMOUMIuaygDlMn1anSM8N7Wndx8G6+Uy67AnhjGx7jw/0YPPxopEj6x\n' + + 'JXP8j0sJbcT9K/9/fPVLNT25RvQ/93T2+IQL4Ca2\n' + + '-----END CERTIFICATE-----\n', + + /** + * Amazon RDS eu-central-1 certificate CA 2019 to 2024 + * + * CN = Amazon RDS eu-central-1 2019 CA + * OU = Amazon RDS + * O = Amazon Web Services, Inc. + * L = Seattle + * ST = Washington + * C = US + * P = 2019-09-11T19:36:20Z/2024-08-22T17:08:50Z + * F = 53:46:18:4A:42:65:A2:8C:5F:5B:0A:AD:E2:2C:80:E5:E6:8A:6D:2F + */ + '-----BEGIN CERTIFICATE-----\n' + + 'MIIECjCCAvKgAwIBAgICV2YwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT\n' + + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n' + + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n' + + 'MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTExOTM2\n' + + 'MjBaFw0yNDA4MjIxNzA4NTBaMIGXMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz\n' + + 'aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT\n' + + 'ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEoMCYGA1UEAwwfQW1h\n' + + 'em9uIFJEUyBldS1jZW50cmFsLTEgMjAxOSBDQTCCASIwDQYJKoZIhvcNAQEBBQAD\n' + + 'ggEPADCCAQoCggEBAMEx54X2pHVv86APA0RWqxxRNmdkhAyp2R1cFWumKQRofoFv\n' + + 'n+SPXdkpIINpMuEIGJANozdiEz7SPsrAf8WHyD93j/ZxrdQftRcIGH41xasetKGl\n' + + 'I67uans8d+pgJgBKGb/Z+B5m+UsIuEVekpvgpwKtmmaLFC/NCGuSsJoFsRqoa6Gh\n' + + 'm34W6yJoY87UatddCqLY4IIXaBFsgK9Q/wYzYLbnWM6ZZvhJ52VMtdhcdzeTHNW0\n' + + '5LGuXJOF7Ahb4JkEhoo6TS2c0NxB4l4MBfBPgti+O7WjR3FfZHpt18A6Zkq6A2u6\n' + + 'D/oTSL6c9/3sAaFTFgMyL3wHb2YlW0BPiljZIqECAwEAAaNmMGQwDgYDVR0PAQH/\n' + + 'BAQDAgEGMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFOcAToAc6skWffJa\n' + + 'TnreaswAfrbcMB8GA1UdIwQYMBaAFHNfYNi8ywOY9CsXNC42WqZg/7wfMA0GCSqG\n' + + 'SIb3DQEBCwUAA4IBAQA1d0Whc1QtspK496mFWfFEQNegLh0a9GWYlJm+Htcj5Nxt\n' + + 'DAIGXb+8xrtOZFHmYP7VLCT5Zd2C+XytqseK/+s07iAr0/EPF+O2qcyQWMN5KhgE\n' + + 'cXw2SwuP9FPV3i+YAm11PBVeenrmzuk9NrdHQ7TxU4v7VGhcsd2C++0EisrmquWH\n' + + 'mgIfmVDGxphwoES52cY6t3fbnXmTkvENvR+h3rj+fUiSz0aSo+XZUGHPgvuEKM/W\n' + + 'CBD9Smc9CBoBgvy7BgHRgRUmwtABZHFUIEjHI5rIr7ZvYn+6A0O6sogRfvVYtWFc\n' + + 'qpyrW1YX8mD0VlJ8fGKM3G+aCOsiiPKDV/Uafrm+\n' + + '-----END CERTIFICATE-----\n', + + /** + * Amazon RDS eu-north-1 certificate CA 2019 to 2024 + * + * CN = Amazon RDS eu-north-1 2019 CA + * OU = Amazon RDS + * O = Amazon Web Services, Inc. + * L = Seattle + * ST = Washington + * C = US + * P = 2019-09-12T18:19:44Z/2024-08-22T17:08:50Z + * F = D0:CA:9C:6E:47:4C:4F:DB:85:28:03:4A:60:AC:14:E0:E6:DF:D4:42 + */ + '-----BEGIN CERTIFICATE-----\n' + + 'MIIECDCCAvCgAwIBAgICGAcwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT\n' + + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n' + + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n' + + 'MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTIxODE5\n' + + 'NDRaFw0yNDA4MjIxNzA4NTBaMIGVMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz\n' + + 'aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT\n' + + 'ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEmMCQGA1UEAwwdQW1h\n' + + 'em9uIFJEUyBldS1ub3J0aC0xIDIwMTkgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IB\n' + + 'DwAwggEKAoIBAQCiIYnhe4UNBbdBb/nQxl5giM0XoVHWNrYV5nB0YukA98+TPn9v\n' + + 'Aoj1RGYmtryjhrf01Kuv8SWO+Eom95L3zquoTFcE2gmxCfk7bp6qJJ3eHOJB+QUO\n' + + 'XsNRh76fwDzEF1yTeZWH49oeL2xO13EAx4PbZuZpZBttBM5zAxgZkqu4uWQczFEs\n' + + 'JXfla7z2fvWmGcTagX10O5C18XaFroV0ubvSyIi75ue9ykg/nlFAeB7O0Wxae88e\n' + + 'uhiBEFAuLYdqWnsg3459NfV8Yi1GnaitTym6VI3tHKIFiUvkSiy0DAlAGV2iiyJE\n' + + 'q+DsVEO4/hSINJEtII4TMtysOsYPpINqeEzRAgMBAAGjZjBkMA4GA1UdDwEB/wQE\n' + + 'AwIBBjASBgNVHRMBAf8ECDAGAQH/AgEAMB0GA1UdDgQWBBRR0UpnbQyjnHChgmOc\n' + + 'hnlc0PogzTAfBgNVHSMEGDAWgBRzX2DYvMsDmPQrFzQuNlqmYP+8HzANBgkqhkiG\n' + + '9w0BAQsFAAOCAQEAKJD4xVzSf4zSGTBJrmamo86jl1NHQxXUApAZuBZEc8tqC6TI\n' + + 'T5CeoSr9CMuVC8grYyBjXblC4OsM5NMvmsrXl/u5C9dEwtBFjo8mm53rOOIm1fxl\n' + + 'I1oYB/9mtO9ANWjkykuLzWeBlqDT/i7ckaKwalhLODsRDO73vRhYNjsIUGloNsKe\n' + + 'pxw3dzHwAZx4upSdEVG4RGCZ1D0LJ4Gw40OfD69hfkDfRVVxKGrbEzqxXRvovmDc\n' + + 'tKLdYZO/6REoca36v4BlgIs1CbUXJGLSXUwtg7YXGLSVBJ/U0+22iGJmBSNcoyUN\n' + + 'cjPFD9JQEhDDIYYKSGzIYpvslvGc4T5ISXFiuQ==\n' + + '-----END CERTIFICATE-----\n', + + /** + * Amazon RDS eu-west-1 certificate CA 2019 to 2024 + * + * CN = Amazon RDS eu-west-1 2019 CA + * OU = Amazon RDS + * O = Amazon Web Services, Inc. + * L = Seattle + * ST = Washington + * C = US + * P = 2019-09-11T17:31:48Z/2024-08-22T17:08:50Z + * F = 2D:1A:A6:3E:0D:EB:D6:26:03:3E:A1:8A:0A:DF:14:80:78:EC:B6:63 + */ + '-----BEGIN CERTIFICATE-----\n' + + 'MIIEBzCCAu+gAwIBAgICYpgwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT\n' + + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n' + + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbW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ngNHy\n' + + 'lGJ2hse1fvSRNbmg8Sc9GBv8oqNIBPVuw+AJzHTacZ1OkyLZrz1c1QvwvwN2a+Jd\n' + + 'vH0V0YIhv66llKcYDMUQJAQi4+8nbRxXWv6Gq3pvrFoorzsnkr42V3JpbhnYiK+9\n' + + 'nRKd4uWl62KRZjGkfMbmsqZpj2fdSWMY1UGyN1k+kDmCSWYdrTRDP0xjtIocwg+A\n' + + 'J116n4hV/5mbA0BaPiS2krtv17YAeHABZcvz\n' + + '-----END CERTIFICATE-----\n', + + /** + * Amazon RDS eu-west-2 certificate CA 2019 to 2024 + * + * CN = Amazon RDS eu-west-2 2019 CA + * OU = Amazon RDS + * O = Amazon Web Services, Inc. + * L = Seattle + * ST = Washington + * C = US + * P = 2019-09-12T21:32:32Z/2024-08-22T17:08:50Z + * F = 60:65:44:F4:74:6E:2E:29:50:19:38:7C:4B:BE:18:B9:5B:D4:CD:23 + */ + '-----BEGIN CERTIFICATE-----\n' + + 'MIIEBzCCAu+gAwIBAgICZIEwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT\n' + + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n' + + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n' + + 'MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTIyMTMy\n' + + 'MzJaFw0yNDA4MjIxNzA4NTBaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz\n' + + 'aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT\n' + + 'ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzElMCMGA1UEAwwcQW1h\n' + + 'em9uIFJEUyBldS13ZXN0LTIgMjAxOSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP\n' + + 'ADCCAQoCggEBALGiwqjiF7xIjT0Sx7zB3764K2T2a1DHnAxEOr+/EIftWKxWzT3u\n' + + 'PFwS2eEZcnKqSdRQ+vRzonLBeNLO4z8aLjQnNbkizZMBuXGm4BqRm1Kgq3nlLDQn\n' + + '7YqdijOq54SpShvR/8zsO4sgMDMmHIYAJJOJqBdaus2smRt0NobIKc0liy7759KB\n' + + '6kmQ47Gg+kfIwxrQA5zlvPLeQImxSoPi9LdbRoKvu7Iot7SOa+jGhVBh3VdqndJX\n' + + '7tm/saj4NE375csmMETFLAOXjat7zViMRwVorX4V6AzEg1vkzxXpA9N7qywWIT5Y\n' + + 'fYaq5M8i6vvLg0CzrH9fHORtnkdjdu1y+0MCAwEAAaNmMGQwDgYDVR0PAQH/BAQD\n' + + 'AgEGMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFFOhOx1yt3Z7mvGB9jBv\n' + + '2ymdZwiOMB8GA1UdIwQYMBaAFHNfYNi8ywOY9CsXNC42WqZg/7wfMA0GCSqGSIb3\n' + + 'DQEBCwUAA4IBAQBehqY36UGDvPVU9+vtaYGr38dBbp+LzkjZzHwKT1XJSSUc2wqM\n' + + 'hnCIQKilonrTIvP1vmkQi8qHPvDRtBZKqvz/AErW/ZwQdZzqYNFd+BmOXaeZWV0Q\n' + + 'oHtDzXmcwtP8aUQpxN0e1xkWb1E80qoy+0uuRqb/50b/R4Q5qqSfJhkn6z8nwB10\n' + + '7RjLtJPrK8igxdpr3tGUzfAOyiPrIDncY7UJaL84GFp7WWAkH0WG3H8Y8DRcRXOU\n' + + 'mqDxDLUP3rNuow3jnGxiUY+gGX5OqaZg4f4P6QzOSmeQYs6nLpH0PiN00+oS1BbD\n' + + 'bpWdZEttILPI+vAYkU4QuBKKDjJL6HbSd+cn\n' + + '-----END CERTIFICATE-----\n', + + /** + * Amazon RDS eu-west-3 certificate CA 2019 to 2024 + * + * CN = Amazon RDS eu-west-3 2019 CA + * OU = Amazon RDS + * O = Amazon Web Services, Inc. + * L = Seattle + * ST = Washington + * C = US + * P = 2019-09-18T17:03:15Z/2024-08-22T17:08:50Z + * F = 6F:79:56:B0:74:9C:C6:3E:3B:50:26:C8:51:55:08:F0:BB:7E:32:04 + */ + '-----BEGIN CERTIFICATE-----\n' + + 'MIIEBzCCAu+gAwIBAgICJDQwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT\n' + + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n' + + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n' + + 'MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTgxNzAz\n' + + 'MTVaFw0yNDA4MjIxNzA4NTBaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz\n' + + 'aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT\n' + + 'ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzElMCMGA1UEAwwcQW1h\n' + + 'em9uIFJEUyBldS13ZXN0LTMgMjAxOSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP\n' + + 'ADCCAQoCggEBAL9bL7KE0n02DLVtlZ2PL+g/BuHpMYFq2JnE2RgompGurDIZdjmh\n' + + '1pxfL3nT+QIVMubuAOy8InRfkRxfpxyjKYdfLJTPJG+jDVL+wDcPpACFVqoV7Prg\n' + + 'pVYEV0lc5aoYw4bSeYFhdzgim6F8iyjoPnObjll9mo4XsHzSoqJLCd0QC+VG9Fw2\n' + + 'q+GDRZrLRmVM2oNGDRbGpGIFg77aRxRapFZa8SnUgs2AqzuzKiprVH5i0S0M6dWr\n' + + 'i+kk5epmTtkiDHceX+dP/0R1NcnkCPoQ9TglyXyPdUdTPPRfKCq12dftqll+u4mV\n' + + 'ARdN6WFjovxax8EAP2OAUTi1afY+1JFMj+sCAwEAAaNmMGQwDgYDVR0PAQH/BAQD\n' + + 'AgEGMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFLfhrbrO5exkCVgxW0x3\n' + + 'Y2mAi8lNMB8GA1UdIwQYMBaAFHNfYNi8ywOY9CsXNC42WqZg/7wfMA0GCSqGSIb3\n' + + 'DQEBCwUAA4IBAQAigQ5VBNGyw+OZFXwxeJEAUYaXVoP/qrhTOJ6mCE2DXUVEoJeV\n' + + 'SxScy/TlFA9tJXqmit8JH8VQ/xDL4ubBfeMFAIAo4WzNWDVoeVMqphVEcDWBHsI1\n' + + 'AETWzfsapRS9yQekOMmxg63d/nV8xewIl8aNVTHdHYXMqhhik47VrmaVEok1UQb3\n' + + 'O971RadLXIEbVd9tjY5bMEHm89JsZDnDEw1hQXBb67Elu64OOxoKaHBgUH8AZn/2\n' + + 'zFsL1ynNUjOhCSAA15pgd1vjwc0YsBbAEBPcHBWYBEyME6NLNarjOzBl4FMtATSF\n' + + 'wWCKRGkvqN8oxYhwR2jf2rR5Mu4DWkK5Q8Ep\n' + + '-----END CERTIFICATE-----\n', + + /** + * Amazon RDS me-south-1 certificate CA 2019 to 2024 + * + * CN = Amazon RDS me-south-1 Root CA + * OU = Amazon RDS + * O = Amazon Web Services, Inc. + * L = Seattle + * ST = Washington + * C = US + * P = 2019-05-10T21:48:27Z/2024-05-08T21:48:27Z + * F = 8A:69:D7:00:FB:5D:62:9C:B0:D1:75:6F:B7:B6:38:AA:76:C4:BD:1F + */ + '-----BEGIN CERTIFICATE-----\n' + + 'MIIEEjCCAvqgAwIBAgIJANew34ehz5l8MA0GCSqGSIb3DQEBCwUAMIGVMQswCQYD\n' + + 'VQQGEwJVUzEQMA4GA1UEBwwHU2VhdHRsZTETMBEGA1UECAwKV2FzaGluZ3RvbjEi\n' + + 'MCAGA1UECgwZQW1hem9uIF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8a9s46eR0uiwV4AGLabcu0iKYfXjPkIprVCqeXV7\n' + + 'ny9oDtrbflyj7NcGdZLvuzSwgl9SYTJp7PVCZtZutsPYlbJrBPHwFABvAkMvRtDB\n' + + 'hitIg4AESDGPoCl94sYHpfDfjpUDMSrAMDUyO6DyBdZH5ryRMAs3lGtsmkkNUrso\n' + + 'aTW6R05681Z0mvkRdb+cdXtKOSuDZPoe2wJJIaz3IlNQNSrB5TImMYgmt6iAsFhv\n' + + '3vfTSTKrZDNTJn4ybG6pq1zWExoXsktZPylJly6R3RBwV6nwqBM=\n' + + '-----END CERTIFICATE-----\n', + + /** + * Amazon RDS sa-east-1 certificate CA 2019 to 2024 + * + * CN = Amazon RDS sa-east-1 2019 CA + * OU = Amazon RDS + * O = Amazon Web Services, Inc. + * L = Seattle + * ST = Washington + * C = US + * P = 2019-09-05T18:46:29Z/2024-08-22T17:08:50Z + * F = 8C:34:0F:AA:FB:10:80:9C:05:CE:D7:BF:0B:12:4D:07:42:39:74:7A + */ + '-----BEGIN CERTIFICATE-----\n' + + 'MIIEBzCCAu+gAwIBAgICQ2QwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT\n' + + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n' + + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n' + + 'MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MDUxODQ2\n' + + 'MjlaFw0yNDA4MjIxNzA4NTBaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz\n' + + 'aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT\n' + + 'ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzElMCMGA1UEAwwcQW1h\n'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* Amazon RDS us-east-1 certificate CA 2019 to 2024 + * + * CN = Amazon RDS us-east-1 2019 CA + * OU = Amazon RDS + * O = Amazon Web Services, Inc. + * L = Seattle + * ST = Washington + * C = US + * P = 2019-09-19T18:16:53Z/2024-08-22T17:08:50Z + * F = F0:ED:82:3E:D1:44:47:BA:B5:57:FD:F3:E4:92:74:66:98:8C:1C:78 + */ + '-----BEGIN CERTIFICATE-----\n' + + 'MIIEBzCCAu+gAwIBAgICJVUwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT\n' + + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n' + + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n' + + 'MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTkxODE2\n' + + 'NTNaFw0yNDA4MjIxNzA4NTBaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz\n' + + 'aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT\n' + + 'ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzElMCMGA1UEAwwcQW1h\n' + + 'em9uIFJEUyB1cy1lYXN0LTEgMjAxOSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP\n' + + 'ADCCAQoCggEBAM3i/k2u6cqbMdcISGRvh+m+L0yaSIoOXjtpNEoIftAipTUYoMhL\n' + + 'InXGlQBVA4shkekxp1N7HXe1Y/iMaPEyb3n+16pf3vdjKl7kaSkIhjdUz3oVUEYt\n' + + 'i8Z/XeJJ9H2aEGuiZh3kHixQcZczn8cg3dA9aeeyLSEnTkl/npzLf//669Ammyhs\n' + + 'XcAo58yvT0D4E0D/EEHf2N7HRX7j/TlyWvw/39SW0usiCrHPKDLxByLojxLdHzso\n' + + 'QIp/S04m+eWn6rmD+uUiRteN1hI5ncQiA3wo4G37mHnUEKo6TtTUh+sd/ku6a8HK\n' + + 'glMBcgqudDI90s1OpuIAWmuWpY//8xEG2YECAwEAAaNmMGQwDgYDVR0PAQH/BAQD\n' + + 'AgEGMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFPqhoWZcrVY9mU7tuemR\n' + + 'RBnQIj1jMB8GA1UdIwQYMBaAFHNfYNi8ywOY9CsXNC42WqZg/7wfMA0GCSqGSIb3\n' + + 'DQEBCwUAA4IBAQB6zOLZ+YINEs72heHIWlPZ8c6WY8MDU+Be5w1M+BK2kpcVhCUK\n' + + 'PJO4nMXpgamEX8DIiaO7emsunwJzMSvavSPRnxXXTKIc0i/g1EbiDjnYX9d85DkC\n' + + 'E1LaAUCmCZBVi9fIe0H2r9whIh4uLWZA41oMnJx/MOmo3XyMfQoWcqaSFlMqfZM4\n' + + '0rNoB/tdHLNuV4eIdaw2mlHxdWDtF4oH+HFm+2cVBUVC1jXKrFv/euRVtsTT+A6i\n' + + 'h2XBHKxQ1Y4HgAn0jACP2QSPEmuoQEIa57bEKEcZsBR8SDY6ZdTd2HLRIApcCOSF\n' + + 'MRM8CKLeF658I0XgF8D5EsYoKPsA+74Z+jDH\n' + + '-----END CERTIFICATE-----\n', + + /** + * Amazon RDS us-east-2 certificate CA 2019 to 2024 + * + * CN = Amazon RDS us-east-2 2019 CA + * OU = Amazon RDS + * O = Amazon Web Services, Inc. + * L = Seattle + * ST = Washington + * C = US + * P = 2019-09-13T17:06:41Z/2024-08-22T17:08:50Z + * F = E9:FE:27:2A:A0:0F:CE:DF:AD:51:03:A6:94:F7:1F:6F:BD:1E:28:D3 + */ + '-----BEGIN CERTIFICATE-----\n' + + 'MIIECDCCAvCgAwIBAgIDAIVCMA0GCSqGSIb3DQEBCwUAMIGPMQswCQYDVQQGEwJV\n' + + 'UzEQMA4GA1UEBwwHU2VhdHRsZTETMBEGA1UECAw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SwjImVQPtknzpajNE5jOJAh8\n' + + 'quvQnU9nlnMO85fVDU1Dz3lLHGJ/YG1pt1Cqq2QQ200JcWCvBRgdvH6MjHoDQpqZ\n' + + 'HvQ3vLgOGqCLNQKFuet9BdpsHzsctKvCVaeBqbGpeCtt3Hh/26tgx0rorPLw90A2\n' + + 'V8QSkZJjlcKkLa58N5CMM8Xz8KLWg3MZeT4DmlUXVCukqK2RGuP2L+aME8dOxqNv\n' + + 'OnOz1zrL5mR2iJoDpk8+VE/eBDmJX40IJk6jBjWoxAO/RXq+vBozuF5YHN1ujE92\n' + + 'tO8HItgTp37XT8bJBAiAnt5mxw+NLSqtxk2QdQ==\n' + + '-----END CERTIFICATE-----\n', + + /** + * Amazon RDS us-west-1 certificate CA 2019 to 2024 + * + * CN = Amazon RDS us-west-1 2019 CA + * OU = Amazon RDS + * O = Amazon Web Services, Inc. + * L = Seattle + * ST = Washington + * C = US + * P = 2019-09-06T17:40:21Z/2024-08-22T17:08:50Z + * F = 1C:9F:DF:84:E6:13:32:F3:91:12:2D:0D:A5:9A:16:5D:AC:DC:E8:93 + */ + '-----BEGIN CERTIFICATE-----\n' + + 'MIIECDCCAvCgAwIBAgIDAIkHMA0GCSqGSIb3DQEBCwUAMIGPMQswCQYDVQQGEwJV\n' + + 'UzEQMA4GA1UEBwwHU2VhdHRsZTETMBEGA1UECAwKV2FzaGluZ3RvbjEiMCAGA1UE\n' + + 'CgwZQW1hem9uIFdlYiBTZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJE\n' + + 'UzEgMB4GA1UEAwwXQW1hem9uIFJEUyBSb290IDIwMTkgQ0EwHhcNMTkwOTA2MTc0\n' + + 'MDIxWhcNMjQwODIyMTcwODUwWjCBlDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldh\n' + + 'c2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoMGUFtYXpvbiBXZWIg\n' + + 'U2VydmljZXMsIEluYy4xEzAR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L1MJSsxydtsLjOBro5eK0Vw==\n' + + '-----END CERTIFICATE-----\n', + + /** + * Amazon RDS us-west-2 certificate CA 2019 to 2024 + * + * CN = Amazon RDS us-west-2 2019 CA + * OU = Amazon RDS + * O = Amazon Web Services, Inc. + * L = Seattle + * ST = Washington + * C = US + * P = 2019-09-16T18:21:15Z/2024-08-22T17:08:50Z + * F = C8:DE:1D:13:AD:35:9B:3D:EA:18:2A:DC:B4:79:6D:22:47:75:3C:4A + */ + '-----BEGIN CERTIFICATE-----\n' + + 'MIIEBzCCAu+gAwIBAgICUYkwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT\n' + + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n' + + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n' + + 'MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTYxODIx\n' + + 'MTVaFw0yNDA4MjIxNzA4NTBaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz\n' + + 'aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT\n' + + 'ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzElMCMGA1UEAwwcQW1h\n' + + 'em9uIFJEUyB1cy13ZXN0LTIgMjAxOSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP\n' + + 'ADCCAQoCggEBANCEZBZyu6yJQFZBJmSUZfSZd3Ui2gitczMKC4FLr0QzkbxY+cLa\n' + + 'uVONIOrPt4Rwi+3h/UdnUg917xao3S53XDf1TDMFEYp4U8EFPXqCn/GXBIWlU86P\n' + + 'PvBN+gzw3nS+aco7WXb+woTouvFVkk8FGU7J532llW8o/9ydQyDIMtdIkKTuMfho\n' + + 'OiNHSaNc+QXQ32TgvM9A/6q7ksUoNXGCP8hDOkSZ/YOLiI5TcdLh/aWj00ziL5bj\n' + + 'pvytiMZkilnc9dLY9QhRNr0vGqL0xjmWdoEXz9/OwjmCihHqJq+20MJPsvFm7D6a\n' + + '2NKybR9U+ddrjb8/iyLOjURUZnj5O+2+OPcCAwEAAaNmMGQwDgYDVR0PAQH/BAQD\n' + + 'AgEGMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFEBxMBdv81xuzqcK5TVu\n' + + 'pHj+Aor8MB8GA1UdIwQYMBaAFHNfYNi8ywOY9CsXNC42WqZg/7wfMA0GCSqGSIb3\n' + + 'DQEBCwUAA4IBAQBZkfiVqGoJjBI37aTlLOSjLcjI75L5wBrwO39q+B4cwcmpj58P\n' + + '3sivv+jhYfAGEbQnGRzjuFoyPzWnZ1DesRExX+wrmHsLLQbF2kVjLZhEJMHF9eB7\n' + + 'GZlTPdTzHErcnuXkwA/OqyXMpj9aghcQFuhCNguEfnROY9sAoK2PTfnTz9NJHL+Q\n' + + 'UpDLEJEUfc0GZMVWYhahc0x38ZnSY2SKacIPECQrTI0KpqZv/P+ijCEcMD9xmYEb\n' + + 'jL4en+XKS1uJpw5fIU5Sj0MxhdGstH6S84iAE5J3GM3XHklGSFwwqPYvuTXvANH6\n' + + 'uboynxRgSae59jIlAK6Jrr6GWMwQRbgcaAlW\n' + + '-----END CERTIFICATE-----\n' + ] +}; diff --git a/node_modules/mysql/lib/protocol/constants/types.js b/node_modules/mysql/lib/protocol/constants/types.js new file mode 100644 index 0000000..a33cd50 --- /dev/null +++ b/node_modules/mysql/lib/protocol/constants/types.js @@ -0,0 +1,72 @@ +/** + * MySQL type constants + * + * Extracted from version 5.7.29 + * + * !! Generated by generate-type-constants.js, do not modify by hand !! + */ + +exports.DECIMAL = 0; +exports.TINY = 1; +exports.SHORT = 2; +exports.LONG = 3; +exports.FLOAT = 4; +exports.DOUBLE = 5; +exports.NULL = 6; +exports.TIMESTAMP = 7; +exports.LONGLONG = 8; +exports.INT24 = 9; +exports.DATE = 10; +exports.TIME = 11; +exports.DATETIME = 12; +exports.YEAR = 13; +exports.NEWDATE = 14; +exports.VARCHAR = 15; +exports.BIT = 16; +exports.TIMESTAMP2 = 17; +exports.DATETIME2 = 18; +exports.TIME2 = 19; +exports.JSON = 245; +exports.NEWDECIMAL = 246; +exports.ENUM = 247; +exports.SET = 248; +exports.TINY_BLOB = 249; +exports.MEDIUM_BLOB = 250; +exports.LONG_BLOB = 251; +exports.BLOB = 252; +exports.VAR_STRING = 253; +exports.STRING = 254; +exports.GEOMETRY = 255; + +// Lookup-by-number table +exports[0] = 'DECIMAL'; +exports[1] = 'TINY'; +exports[2] = 'SHORT'; +exports[3] = 'LONG'; +exports[4] = 'FLOAT'; +exports[5] = 'DOUBLE'; +exports[6] = 'NULL'; +exports[7] = 'TIMESTAMP'; +exports[8] = 'LONGLONG'; +exports[9] = 'INT24'; +exports[10] = 'DATE'; +exports[11] = 'TIME'; +exports[12] = 'DATETIME'; +exports[13] = 'YEAR'; +exports[14] = 'NEWDATE'; +exports[15] = 'VARCHAR'; +exports[16] = 'BIT'; +exports[17] = 'TIMESTAMP2'; +exports[18] = 'DATETIME2'; +exports[19] = 'TIME2'; +exports[245] = 'JSON'; +exports[246] = 'NEWDECIMAL'; +exports[247] = 'ENUM'; +exports[248] = 'SET'; +exports[249] = 'TINY_BLOB'; +exports[250] = 'MEDIUM_BLOB'; +exports[251] = 'LONG_BLOB'; +exports[252] = 'BLOB'; +exports[253] = 'VAR_STRING'; +exports[254] = 'STRING'; +exports[255] = 'GEOMETRY'; diff --git a/node_modules/mysql/lib/protocol/packets/AuthSwitchRequestPacket.js b/node_modules/mysql/lib/protocol/packets/AuthSwitchRequestPacket.js new file mode 100644 index 0000000..c74e6ec --- /dev/null +++ b/node_modules/mysql/lib/protocol/packets/AuthSwitchRequestPacket.js @@ -0,0 +1,20 @@ +module.exports = AuthSwitchRequestPacket; +function AuthSwitchRequestPacket(options) { + options = options || {}; + + this.status = 0xfe; + this.authMethodName = options.authMethodName; + this.authMethodData = options.authMethodData; +} + +AuthSwitchRequestPacket.prototype.parse = function parse(parser) { + this.status = parser.parseUnsignedNumber(1); + this.authMethodName = parser.parseNullTerminatedString(); + this.authMethodData = parser.parsePacketTerminatedBuffer(); +}; + +AuthSwitchRequestPacket.prototype.write = function write(writer) { + writer.writeUnsignedNumber(1, this.status); + writer.writeNullTerminatedString(this.authMethodName); + writer.writeBuffer(this.authMethodData); +}; diff --git a/node_modules/mysql/lib/protocol/packets/AuthSwitchResponsePacket.js b/node_modules/mysql/lib/protocol/packets/AuthSwitchResponsePacket.js new file mode 100644 index 0000000..488abbd --- /dev/null +++ b/node_modules/mysql/lib/protocol/packets/AuthSwitchResponsePacket.js @@ -0,0 +1,14 @@ +module.exports = AuthSwitchResponsePacket; +function AuthSwitchResponsePacket(options) { + options = options || {}; + + this.data = options.data; +} + +AuthSwitchResponsePacket.prototype.parse = function parse(parser) { + this.data = parser.parsePacketTerminatedBuffer(); +}; + +AuthSwitchResponsePacket.prototype.write = function write(writer) { + writer.writeBuffer(this.data); +}; diff --git a/node_modules/mysql/lib/protocol/packets/ClientAuthenticationPacket.js b/node_modules/mysql/lib/protocol/packets/ClientAuthenticationPacket.js new file mode 100644 index 0000000..595db77 --- /dev/null +++ b/node_modules/mysql/lib/protocol/packets/ClientAuthenticationPacket.js @@ -0,0 +1,54 @@ +var Buffer = require('safe-buffer').Buffer; + +module.exports = ClientAuthenticationPacket; +function ClientAuthenticationPacket(options) { + options = options || {}; + + this.clientFlags = options.clientFlags; + this.maxPacketSize = options.maxPacketSize; + this.charsetNumber = options.charsetNumber; + this.filler = undefined; + this.user = options.user; + this.scrambleBuff = options.scrambleBuff; + this.database = options.database; + this.protocol41 = options.protocol41; +} + +ClientAuthenticationPacket.prototype.parse = function(parser) { + if (this.protocol41) { + this.clientFlags = parser.parseUnsignedNumber(4); + this.maxPacketSize = parser.parseUnsignedNumber(4); + this.charsetNumber = parser.parseUnsignedNumber(1); + this.filler = parser.parseFiller(23); + this.user = parser.parseNullTerminatedString(); + this.scrambleBuff = parser.parseLengthCodedBuffer(); + this.database = parser.parseNullTerminatedString(); + } else { + this.clientFlags = parser.parseUnsignedNumber(2); + this.maxPacketSize = parser.parseUnsignedNumber(3); + this.user = parser.parseNullTerminatedString(); + this.scrambleBuff = parser.parseBuffer(8); + this.database = parser.parseLengthCodedBuffer(); + } +}; + +ClientAuthenticationPacket.prototype.write = function(writer) { + if (this.protocol41) { + writer.writeUnsignedNumber(4, this.clientFlags); + writer.writeUnsignedNumber(4, this.maxPacketSize); + writer.writeUnsignedNumber(1, this.charsetNumber); + writer.writeFiller(23); + writer.writeNullTerminatedString(this.user); + writer.writeLengthCodedBuffer(this.scrambleBuff); + writer.writeNullTerminatedString(this.database); + } else { + writer.writeUnsignedNumber(2, this.clientFlags); + writer.writeUnsignedNumber(3, this.maxPacketSize); + writer.writeNullTerminatedString(this.user); + writer.writeBuffer(this.scrambleBuff); + if (this.database && this.database.length) { + writer.writeFiller(1); + writer.writeBuffer(Buffer.from(this.database)); + } + } +}; diff --git a/node_modules/mysql/lib/protocol/packets/ComChangeUserPacket.js b/node_modules/mysql/lib/protocol/packets/ComChangeUserPacket.js new file mode 100644 index 0000000..3278842 --- /dev/null +++ b/node_modules/mysql/lib/protocol/packets/ComChangeUserPacket.js @@ -0,0 +1,26 @@ +module.exports = ComChangeUserPacket; +function ComChangeUserPacket(options) { + options = options || {}; + + this.command = 0x11; + this.user = options.user; + this.scrambleBuff = options.scrambleBuff; + this.database = options.database; + this.charsetNumber = options.charsetNumber; +} + +ComChangeUserPacket.prototype.parse = function(parser) { + this.command = parser.parseUnsignedNumber(1); + this.user = parser.parseNullTerminatedString(); + this.scrambleBuff = parser.parseLengthCodedBuffer(); + this.database = parser.parseNullTerminatedString(); + this.charsetNumber = parser.parseUnsignedNumber(1); +}; + +ComChangeUserPacket.prototype.write = function(writer) { + writer.writeUnsignedNumber(1, this.command); + writer.writeNullTerminatedString(this.user); + writer.writeLengthCodedBuffer(this.scrambleBuff); + writer.writeNullTerminatedString(this.database); + writer.writeUnsignedNumber(2, this.charsetNumber); +}; diff --git a/node_modules/mysql/lib/protocol/packets/ComPingPacket.js b/node_modules/mysql/lib/protocol/packets/ComPingPacket.js new file mode 100644 index 0000000..dd332c9 --- /dev/null +++ b/node_modules/mysql/lib/protocol/packets/ComPingPacket.js @@ -0,0 +1,12 @@ +module.exports = ComPingPacket; +function ComPingPacket() { + this.command = 0x0e; +} + +ComPingPacket.prototype.write = function(writer) { + writer.writeUnsignedNumber(1, this.command); +}; + +ComPingPacket.prototype.parse = function(parser) { + this.command = parser.parseUnsignedNumber(1); +}; diff --git a/node_modules/mysql/lib/protocol/packets/ComQueryPacket.js b/node_modules/mysql/lib/protocol/packets/ComQueryPacket.js new file mode 100644 index 0000000..7ac191f --- /dev/null +++ b/node_modules/mysql/lib/protocol/packets/ComQueryPacket.js @@ -0,0 +1,15 @@ +module.exports = ComQueryPacket; +function ComQueryPacket(sql) { + this.command = 0x03; + this.sql = sql; +} + +ComQueryPacket.prototype.write = function(writer) { + writer.writeUnsignedNumber(1, this.command); + writer.writeString(this.sql); +}; + +ComQueryPacket.prototype.parse = function(parser) { + this.command = parser.parseUnsignedNumber(1); + this.sql = parser.parsePacketTerminatedString(); +}; diff --git a/node_modules/mysql/lib/protocol/packets/ComQuitPacket.js b/node_modules/mysql/lib/protocol/packets/ComQuitPacket.js new file mode 100644 index 0000000..1104061 --- /dev/null +++ b/node_modules/mysql/lib/protocol/packets/ComQuitPacket.js @@ -0,0 +1,12 @@ +module.exports = ComQuitPacket; +function ComQuitPacket() { + this.command = 0x01; +} + +ComQuitPacket.prototype.parse = function parse(parser) { + this.command = parser.parseUnsignedNumber(1); +}; + +ComQuitPacket.prototype.write = function write(writer) { + writer.writeUnsignedNumber(1, this.command); +}; diff --git a/node_modules/mysql/lib/protocol/packets/ComStatisticsPacket.js b/node_modules/mysql/lib/protocol/packets/ComStatisticsPacket.js new file mode 100644 index 0000000..5e3913e --- /dev/null +++ b/node_modules/mysql/lib/protocol/packets/ComStatisticsPacket.js @@ -0,0 +1,12 @@ +module.exports = ComStatisticsPacket; +function ComStatisticsPacket() { + this.command = 0x09; +} + +ComStatisticsPacket.prototype.write = function(writer) { + writer.writeUnsignedNumber(1, this.command); +}; + +ComStatisticsPacket.prototype.parse = function(parser) { + this.command = parser.parseUnsignedNumber(1); +}; diff --git a/node_modules/mysql/lib/protocol/packets/EmptyPacket.js b/node_modules/mysql/lib/protocol/packets/EmptyPacket.js new file mode 100644 index 0000000..27dd686 --- /dev/null +++ b/node_modules/mysql/lib/protocol/packets/EmptyPacket.js @@ -0,0 +1,9 @@ +module.exports = EmptyPacket; +function EmptyPacket() { +} + +EmptyPacket.prototype.parse = function parse() { +}; + +EmptyPacket.prototype.write = function write() { +}; diff --git a/node_modules/mysql/lib/protocol/packets/EofPacket.js b/node_modules/mysql/lib/protocol/packets/EofPacket.js new file mode 100644 index 0000000..b80ca5e --- /dev/null +++ b/node_modules/mysql/lib/protocol/packets/EofPacket.js @@ -0,0 +1,25 @@ +module.exports = EofPacket; +function EofPacket(options) { + options = options || {}; + + this.fieldCount = undefined; + this.warningCount = options.warningCount; + this.serverStatus = options.serverStatus; + this.protocol41 = options.protocol41; +} + +EofPacket.prototype.parse = function(parser) { + this.fieldCount = parser.parseUnsignedNumber(1); + if (this.protocol41) { + this.warningCount = parser.parseUnsignedNumber(2); + this.serverStatus = parser.parseUnsignedNumber(2); + } +}; + +EofPacket.prototype.write = function(writer) { + writer.writeUnsignedNumber(1, 0xfe); + if (this.protocol41) { + writer.writeUnsignedNumber(2, this.warningCount); + writer.writeUnsignedNumber(2, this.serverStatus); + } +}; diff --git a/node_modules/mysql/lib/protocol/packets/ErrorPacket.js b/node_modules/mysql/lib/protocol/packets/ErrorPacket.js new file mode 100644 index 0000000..e03de00 --- /dev/null +++ b/node_modules/mysql/lib/protocol/packets/ErrorPacket.js @@ -0,0 +1,35 @@ +module.exports = ErrorPacket; +function ErrorPacket(options) { + options = options || {}; + + this.fieldCount = options.fieldCount; + this.errno = options.errno; + this.sqlStateMarker = options.sqlStateMarker; + this.sqlState = options.sqlState; + this.message = options.message; +} + +ErrorPacket.prototype.parse = function(parser) { + this.fieldCount = parser.parseUnsignedNumber(1); + this.errno = parser.parseUnsignedNumber(2); + + // sqlStateMarker ('#' = 0x23) indicates error packet format + if (parser.peak() === 0x23) { + this.sqlStateMarker = parser.parseString(1); + this.sqlState = parser.parseString(5); + } + + this.message = parser.parsePacketTerminatedString(); +}; + +ErrorPacket.prototype.write = function(writer) { + writer.writeUnsignedNumber(1, 0xff); + writer.writeUnsignedNumber(2, this.errno); + + if (this.sqlStateMarker) { + writer.writeString(this.sqlStateMarker); + writer.writeString(this.sqlState); + } + + writer.writeString(this.message); +}; diff --git a/node_modules/mysql/lib/protocol/packets/Field.js b/node_modules/mysql/lib/protocol/packets/Field.js new file mode 100644 index 0000000..a5d58ed --- /dev/null +++ b/node_modules/mysql/lib/protocol/packets/Field.js @@ -0,0 +1,26 @@ +var Types = require('../constants/types'); + +module.exports = Field; +function Field(options) { + options = options || {}; + + this.parser = options.parser; + this.packet = options.packet; + this.db = options.packet.db; + this.table = options.packet.table; + this.name = options.packet.name; + this.type = Types[options.packet.type]; + this.length = options.packet.length; +} + +Field.prototype.string = function () { + return this.parser.parseLengthCodedString(); +}; + +Field.prototype.buffer = function () { + return this.parser.parseLengthCodedBuffer(); +}; + +Field.prototype.geometry = function () { + return this.parser.parseGeometryValue(); +}; diff --git a/node_modules/mysql/lib/protocol/packets/FieldPacket.js b/node_modules/mysql/lib/protocol/packets/FieldPacket.js new file mode 100644 index 0000000..12cfed1 --- /dev/null +++ b/node_modules/mysql/lib/protocol/packets/FieldPacket.js @@ -0,0 +1,93 @@ +module.exports = FieldPacket; +function FieldPacket(options) { + options = options || {}; + + this.catalog = options.catalog; + this.db = options.db; + this.table = options.table; + this.orgTable = options.orgTable; + this.name = options.name; + this.orgName = options.orgName; + this.charsetNr = options.charsetNr; + this.length = options.length; + this.type = options.type; + this.flags = options.flags; + this.decimals = options.decimals; + this.default = options.default; + this.zeroFill = options.zeroFill; + this.protocol41 = options.protocol41; +} + +FieldPacket.prototype.parse = function(parser) { + if (this.protocol41) { + this.catalog = parser.parseLengthCodedString(); + this.db = parser.parseLengthCodedString(); + this.table = parser.parseLengthCodedString(); + this.orgTable = parser.parseLengthCodedString(); + this.name = parser.parseLengthCodedString(); + this.orgName = parser.parseLengthCodedString(); + + if (parser.parseLengthCodedNumber() !== 0x0c) { + var err = new TypeError('Received invalid field length'); + err.code = 'PARSER_INVALID_FIELD_LENGTH'; + throw err; + } + + this.charsetNr = parser.parseUnsignedNumber(2); + this.length = parser.parseUnsignedNumber(4); + this.type = parser.parseUnsignedNumber(1); + this.flags = parser.parseUnsignedNumber(2); + this.decimals = parser.parseUnsignedNumber(1); + + var filler = parser.parseBuffer(2); + if (filler[0] !== 0x0 || filler[1] !== 0x0) { + var err = new TypeError('Received invalid filler'); + err.code = 'PARSER_INVALID_FILLER'; + throw err; + } + + // parsed flags + this.zeroFill = (this.flags & 0x0040 ? true : false); + + if (parser.reachedPacketEnd()) { + return; + } + + this.default = parser.parseLengthCodedString(); + } else { + this.table = parser.parseLengthCodedString(); + this.name = parser.parseLengthCodedString(); + this.length = parser.parseUnsignedNumber(parser.parseUnsignedNumber(1)); + this.type = parser.parseUnsignedNumber(parser.parseUnsignedNumber(1)); + } +}; + +FieldPacket.prototype.write = function(writer) { + if (this.protocol41) { + writer.writeLengthCodedString(this.catalog); + writer.writeLengthCodedString(this.db); + writer.writeLengthCodedString(this.table); + writer.writeLengthCodedString(this.orgTable); + writer.writeLengthCodedString(this.name); + writer.writeLengthCodedString(this.orgName); + + writer.writeLengthCodedNumber(0x0c); + writer.writeUnsignedNumber(2, this.charsetNr || 0); + writer.writeUnsignedNumber(4, this.length || 0); + writer.writeUnsignedNumber(1, this.type || 0); + writer.writeUnsignedNumber(2, this.flags || 0); + writer.writeUnsignedNumber(1, this.decimals || 0); + writer.writeFiller(2); + + if (this.default !== undefined) { + writer.writeLengthCodedString(this.default); + } + } else { + writer.writeLengthCodedString(this.table); + writer.writeLengthCodedString(this.name); + writer.writeUnsignedNumber(1, 0x01); + writer.writeUnsignedNumber(1, this.length); + writer.writeUnsignedNumber(1, 0x01); + writer.writeUnsignedNumber(1, this.type); + } +}; diff --git a/node_modules/mysql/lib/protocol/packets/HandshakeInitializationPacket.js b/node_modules/mysql/lib/protocol/packets/HandshakeInitializationPacket.js new file mode 100644 index 0000000..b251063 --- /dev/null +++ b/node_modules/mysql/lib/protocol/packets/HandshakeInitializationPacket.js @@ -0,0 +1,103 @@ +var Buffer = require('safe-buffer').Buffer; +var Client = require('../constants/client'); + +module.exports = HandshakeInitializationPacket; +function HandshakeInitializationPacket(options) { + options = options || {}; + + this.protocolVersion = options.protocolVersion; + this.serverVersion = options.serverVersion; + this.threadId = options.threadId; + this.scrambleBuff1 = options.scrambleBuff1; + this.filler1 = options.filler1; + this.serverCapabilities1 = options.serverCapabilities1; + this.serverLanguage = options.serverLanguage; + this.serverStatus = options.serverStatus; + this.serverCapabilities2 = options.serverCapabilities2; + this.scrambleLength = options.scrambleLength; + this.filler2 = options.filler2; + this.scrambleBuff2 = options.scrambleBuff2; + this.filler3 = options.filler3; + this.pluginData = options.pluginData; + this.protocol41 = options.protocol41; + + if (this.protocol41) { + // force set the bit in serverCapabilities1 + this.serverCapabilities1 |= Client.CLIENT_PROTOCOL_41; + } +} + +HandshakeInitializationPacket.prototype.parse = function(parser) { + this.protocolVersion = parser.parseUnsignedNumber(1); + this.serverVersion = parser.parseNullTerminatedString(); + this.threadId = parser.parseUnsignedNumber(4); + this.scrambleBuff1 = parser.parseBuffer(8); + this.filler1 = parser.parseFiller(1); + this.serverCapabilities1 = parser.parseUnsignedNumber(2); + this.serverLanguage = parser.parseUnsignedNumber(1); + this.serverStatus = parser.parseUnsignedNumber(2); + + this.protocol41 = (this.serverCapabilities1 & (1 << 9)) > 0; + + if (this.protocol41) { + this.serverCapabilities2 = parser.parseUnsignedNumber(2); + this.scrambleLength = parser.parseUnsignedNumber(1); + this.filler2 = parser.parseFiller(10); + // scrambleBuff2 should be 0x00 terminated, but sphinx does not do this + // so we assume scrambleBuff2 to be 12 byte and treat the next byte as a + // filler byte. + this.scrambleBuff2 = parser.parseBuffer(12); + this.filler3 = parser.parseFiller(1); + } else { + this.filler2 = parser.parseFiller(13); + } + + if (parser.reachedPacketEnd()) { + return; + } + + // According to the docs this should be 0x00 terminated, but MariaDB does + // not do this, so we assume this string to be packet terminated. + this.pluginData = parser.parsePacketTerminatedString(); + + // However, if there is a trailing '\0', strip it + var lastChar = this.pluginData.length - 1; + if (this.pluginData[lastChar] === '\0') { + this.pluginData = this.pluginData.substr(0, lastChar); + } +}; + +HandshakeInitializationPacket.prototype.write = function(writer) { + writer.writeUnsignedNumber(1, this.protocolVersion); + writer.writeNullTerminatedString(this.serverVersion); + writer.writeUnsignedNumber(4, this.threadId); + writer.writeBuffer(this.scrambleBuff1); + writer.writeFiller(1); + writer.writeUnsignedNumber(2, this.serverCapabilities1); + writer.writeUnsignedNumber(1, this.serverLanguage); + writer.writeUnsignedNumber(2, this.serverStatus); + if (this.protocol41) { + writer.writeUnsignedNumber(2, this.serverCapabilities2); + writer.writeUnsignedNumber(1, this.scrambleLength); + writer.writeFiller(10); + } + writer.writeNullTerminatedBuffer(this.scrambleBuff2); + + if (this.pluginData !== undefined) { + writer.writeNullTerminatedString(this.pluginData); + } +}; + +HandshakeInitializationPacket.prototype.scrambleBuff = function() { + var buffer = null; + + if (typeof this.scrambleBuff2 === 'undefined') { + buffer = Buffer.from(this.scrambleBuff1); + } else { + buffer = Buffer.allocUnsafe(this.scrambleBuff1.length + this.scrambleBuff2.length); + this.scrambleBuff1.copy(buffer, 0); + this.scrambleBuff2.copy(buffer, this.scrambleBuff1.length); + } + + return buffer; +}; diff --git a/node_modules/mysql/lib/protocol/packets/LocalDataFilePacket.js b/node_modules/mysql/lib/protocol/packets/LocalDataFilePacket.js new file mode 100644 index 0000000..af7aaa0 --- /dev/null +++ b/node_modules/mysql/lib/protocol/packets/LocalDataFilePacket.js @@ -0,0 +1,15 @@ +module.exports = LocalDataFilePacket; + +/** + * Create a new LocalDataFilePacket + * @constructor + * @param {Buffer} data The data contents of the packet + * @public + */ +function LocalDataFilePacket(data) { + this.data = data; +} + +LocalDataFilePacket.prototype.write = function(writer) { + writer.writeBuffer(this.data); +}; diff --git a/node_modules/mysql/lib/protocol/packets/LocalInfileRequestPacket.js b/node_modules/mysql/lib/protocol/packets/LocalInfileRequestPacket.js new file mode 100644 index 0000000..b1f68ba --- /dev/null +++ b/node_modules/mysql/lib/protocol/packets/LocalInfileRequestPacket.js @@ -0,0 +1,21 @@ +module.exports = LocalInfileRequestPacket; +function LocalInfileRequestPacket(options) { + options = options || {}; + + this.filename = options.filename; +} + +LocalInfileRequestPacket.prototype.parse = function parse(parser) { + if (parser.parseLengthCodedNumber() !== null) { + var err = new TypeError('Received invalid field length'); + err.code = 'PARSER_INVALID_FIELD_LENGTH'; + throw err; + } + + this.filename = parser.parsePacketTerminatedString(); +}; + +LocalInfileRequestPacket.prototype.write = function write(writer) { + writer.writeLengthCodedNumber(null); + writer.writeString(this.filename); +}; diff --git a/node_modules/mysql/lib/protocol/packets/OkPacket.js b/node_modules/mysql/lib/protocol/packets/OkPacket.js new file mode 100644 index 0000000..7caf3b0 --- /dev/null +++ b/node_modules/mysql/lib/protocol/packets/OkPacket.js @@ -0,0 +1,44 @@ + +// Language-neutral expression to match ER_UPDATE_INFO +var ER_UPDATE_INFO_REGEXP = /^[^:0-9]+: [0-9]+[^:0-9]+: ([0-9]+)[^:0-9]+: [0-9]+[^:0-9]*$/; + +module.exports = OkPacket; +function OkPacket(options) { + options = options || {}; + + this.fieldCount = undefined; + this.affectedRows = undefined; + this.insertId = undefined; + this.serverStatus = undefined; + this.warningCount = undefined; + this.message = undefined; + this.protocol41 = options.protocol41; +} + +OkPacket.prototype.parse = function(parser) { + this.fieldCount = parser.parseUnsignedNumber(1); + this.affectedRows = parser.parseLengthCodedNumber(); + this.insertId = parser.parseLengthCodedNumber(); + if (this.protocol41) { + this.serverStatus = parser.parseUnsignedNumber(2); + this.warningCount = parser.parseUnsignedNumber(2); + } + this.message = parser.parsePacketTerminatedString(); + this.changedRows = 0; + + var m = ER_UPDATE_INFO_REGEXP.exec(this.message); + if (m !== null) { + this.changedRows = parseInt(m[1], 10); + } +}; + +OkPacket.prototype.write = function(writer) { + writer.writeUnsignedNumber(1, 0x00); + writer.writeLengthCodedNumber(this.affectedRows || 0); + writer.writeLengthCodedNumber(this.insertId || 0); + if (this.protocol41) { + writer.writeUnsignedNumber(2, this.serverStatus || 0); + writer.writeUnsignedNumber(2, this.warningCount || 0); + } + writer.writeString(this.message); +}; diff --git a/node_modules/mysql/lib/protocol/packets/OldPasswordPacket.js b/node_modules/mysql/lib/protocol/packets/OldPasswordPacket.js new file mode 100644 index 0000000..a729510 --- /dev/null +++ b/node_modules/mysql/lib/protocol/packets/OldPasswordPacket.js @@ -0,0 +1,14 @@ +module.exports = OldPasswordPacket; +function OldPasswordPacket(options) { + options = options || {}; + + this.scrambleBuff = options.scrambleBuff; +} + +OldPasswordPacket.prototype.parse = function(parser) { + this.scrambleBuff = parser.parsePacketTerminatedBuffer(); +}; + +OldPasswordPacket.prototype.write = function(writer) { + writer.writeBuffer(this.scrambleBuff); +}; diff --git a/node_modules/mysql/lib/protocol/packets/ResultSetHeaderPacket.js b/node_modules/mysql/lib/protocol/packets/ResultSetHeaderPacket.js new file mode 100644 index 0000000..a097ea1 --- /dev/null +++ b/node_modules/mysql/lib/protocol/packets/ResultSetHeaderPacket.js @@ -0,0 +1,14 @@ +module.exports = ResultSetHeaderPacket; +function ResultSetHeaderPacket(options) { + options = options || {}; + + this.fieldCount = options.fieldCount; +} + +ResultSetHeaderPacket.prototype.parse = function(parser) { + this.fieldCount = parser.parseLengthCodedNumber(); +}; + +ResultSetHeaderPacket.prototype.write = function(writer) { + writer.writeLengthCodedNumber(this.fieldCount); +}; diff --git a/node_modules/mysql/lib/protocol/packets/RowDataPacket.js b/node_modules/mysql/lib/protocol/packets/RowDataPacket.js new file mode 100644 index 0000000..b8ec4b8 --- /dev/null +++ b/node_modules/mysql/lib/protocol/packets/RowDataPacket.js @@ -0,0 +1,130 @@ +var Types = require('../constants/types'); +var Charsets = require('../constants/charsets'); +var Field = require('./Field'); +var IEEE_754_BINARY_64_PRECISION = Math.pow(2, 53); + +module.exports = RowDataPacket; +function RowDataPacket() { +} + +Object.defineProperty(RowDataPacket.prototype, 'parse', { + configurable : true, + enumerable : false, + value : parse +}); + +Object.defineProperty(RowDataPacket.prototype, '_typeCast', { + configurable : true, + enumerable : false, + value : typeCast +}); + +function parse(parser, fieldPackets, typeCast, nestTables, connection) { + var self = this; + var next = function () { + return self._typeCast(fieldPacket, parser, connection.config.timezone, connection.config.supportBigNumbers, connection.config.bigNumberStrings, connection.config.dateStrings); + }; + + for (var i = 0; i < fieldPackets.length; i++) { + var fieldPacket = fieldPackets[i]; + var value; + + if (typeof typeCast === 'function') { + value = typeCast.apply(connection, [ new Field({ packet: fieldPacket, parser: parser }), next ]); + } else { + value = (typeCast) + ? this._typeCast(fieldPacket, parser, connection.config.timezone, connection.config.supportBigNumbers, connection.config.bigNumberStrings, connection.config.dateStrings) + : ( (fieldPacket.charsetNr === Charsets.BINARY) + ? parser.parseLengthCodedBuffer() + : parser.parseLengthCodedString() ); + } + + if (typeof nestTables === 'string' && nestTables.length) { + this[fieldPacket.table + nestTables + fieldPacket.name] = value; + } else if (nestTables) { + this[fieldPacket.table] = this[fieldPacket.table] || {}; + this[fieldPacket.table][fieldPacket.name] = value; + } else { + this[fieldPacket.name] = value; + } + } +} + +function typeCast(field, parser, timeZone, supportBigNumbers, bigNumberStrings, dateStrings) { + var numberString; + + switch (field.type) { + case Types.TIMESTAMP: + case Types.TIMESTAMP2: + case Types.DATE: + case Types.DATETIME: + case Types.DATETIME2: + case Types.NEWDATE: + var dateString = parser.parseLengthCodedString(); + + if (typeMatch(field.type, dateStrings)) { + return dateString; + } + + if (dateString === null) { + return null; + } + + var originalString = dateString; + if (field.type === Types.DATE) { + dateString += ' 00:00:00'; + } + + if (timeZone !== 'local') { + dateString += ' ' + timeZone; + } + + var dt = new Date(dateString); + if (isNaN(dt.getTime())) { + return originalString; + } + + return dt; + case Types.TINY: + case Types.SHORT: + case Types.LONG: + case Types.INT24: + case Types.YEAR: + case Types.FLOAT: + case Types.DOUBLE: + numberString = parser.parseLengthCodedString(); + return (numberString === null || (field.zeroFill && numberString[0] === '0')) + ? numberString : Number(numberString); + case Types.NEWDECIMAL: + case Types.LONGLONG: + numberString = parser.parseLengthCodedString(); + return (numberString === null || (field.zeroFill && numberString[0] === '0')) + ? numberString + : ((supportBigNumbers && (bigNumberStrings || (Number(numberString) >= IEEE_754_BINARY_64_PRECISION) || Number(numberString) <= -IEEE_754_BINARY_64_PRECISION)) + ? numberString + : Number(numberString)); + case Types.BIT: + return parser.parseLengthCodedBuffer(); + case Types.STRING: + case Types.VAR_STRING: + case Types.TINY_BLOB: + case Types.MEDIUM_BLOB: + case Types.LONG_BLOB: + case Types.BLOB: + return (field.charsetNr === Charsets.BINARY) + ? parser.parseLengthCodedBuffer() + : parser.parseLengthCodedString(); + case Types.GEOMETRY: + return parser.parseGeometryValue(); + default: + return parser.parseLengthCodedString(); + } +} + +function typeMatch(type, list) { + if (Array.isArray(list)) { + return list.indexOf(Types[type]) !== -1; + } else { + return Boolean(list); + } +} diff --git a/node_modules/mysql/lib/protocol/packets/SSLRequestPacket.js b/node_modules/mysql/lib/protocol/packets/SSLRequestPacket.js new file mode 100644 index 0000000..a57cfc1 --- /dev/null +++ b/node_modules/mysql/lib/protocol/packets/SSLRequestPacket.js @@ -0,0 +1,27 @@ +// http://dev.mysql.com/doc/internals/en/ssl.html +// http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::SSLRequest + +var ClientConstants = require('../constants/client'); + +module.exports = SSLRequestPacket; + +function SSLRequestPacket(options) { + options = options || {}; + this.clientFlags = options.clientFlags | ClientConstants.CLIENT_SSL; + this.maxPacketSize = options.maxPacketSize; + this.charsetNumber = options.charsetNumber; +} + +SSLRequestPacket.prototype.parse = function(parser) { + // TODO: check SSLRequest packet v41 vs pre v41 + this.clientFlags = parser.parseUnsignedNumber(4); + this.maxPacketSize = parser.parseUnsignedNumber(4); + this.charsetNumber = parser.parseUnsignedNumber(1); +}; + +SSLRequestPacket.prototype.write = function(writer) { + writer.writeUnsignedNumber(4, this.clientFlags); + writer.writeUnsignedNumber(4, this.maxPacketSize); + writer.writeUnsignedNumber(1, this.charsetNumber); + writer.writeFiller(23); +}; diff --git a/node_modules/mysql/lib/protocol/packets/StatisticsPacket.js b/node_modules/mysql/lib/protocol/packets/StatisticsPacket.js new file mode 100644 index 0000000..5f70b3b --- /dev/null +++ b/node_modules/mysql/lib/protocol/packets/StatisticsPacket.js @@ -0,0 +1,20 @@ +module.exports = StatisticsPacket; +function StatisticsPacket() { + this.message = undefined; +} + +StatisticsPacket.prototype.parse = function(parser) { + this.message = parser.parsePacketTerminatedString(); + + var items = this.message.split(/\s\s/); + for (var i = 0; i < items.length; i++) { + var m = items[i].match(/^(.+)\:\s+(.+)$/); + if (m !== null) { + this[m[1].toLowerCase().replace(/\s/g, '_')] = Number(m[2]); + } + } +}; + +StatisticsPacket.prototype.write = function(writer) { + writer.writeString(this.message); +}; diff --git a/node_modules/mysql/lib/protocol/packets/UseOldPasswordPacket.js b/node_modules/mysql/lib/protocol/packets/UseOldPasswordPacket.js new file mode 100644 index 0000000..d73bf44 --- /dev/null +++ b/node_modules/mysql/lib/protocol/packets/UseOldPasswordPacket.js @@ -0,0 +1,14 @@ +module.exports = UseOldPasswordPacket; +function UseOldPasswordPacket(options) { + options = options || {}; + + this.firstByte = options.firstByte || 0xfe; +} + +UseOldPasswordPacket.prototype.parse = function(parser) { + this.firstByte = parser.parseUnsignedNumber(1); +}; + +UseOldPasswordPacket.prototype.write = function(writer) { + writer.writeUnsignedNumber(1, this.firstByte); +}; diff --git a/node_modules/mysql/lib/protocol/packets/index.js b/node_modules/mysql/lib/protocol/packets/index.js new file mode 100644 index 0000000..5e93524 --- /dev/null +++ b/node_modules/mysql/lib/protocol/packets/index.js @@ -0,0 +1,23 @@ +exports.AuthSwitchRequestPacket = require('./AuthSwitchRequestPacket'); +exports.AuthSwitchResponsePacket = require('./AuthSwitchResponsePacket'); +exports.ClientAuthenticationPacket = require('./ClientAuthenticationPacket'); +exports.ComChangeUserPacket = require('./ComChangeUserPacket'); +exports.ComPingPacket = require('./ComPingPacket'); +exports.ComQueryPacket = require('./ComQueryPacket'); +exports.ComQuitPacket = require('./ComQuitPacket'); +exports.ComStatisticsPacket = require('./ComStatisticsPacket'); +exports.EmptyPacket = require('./EmptyPacket'); +exports.EofPacket = require('./EofPacket'); +exports.ErrorPacket = require('./ErrorPacket'); +exports.Field = require('./Field'); +exports.FieldPacket = require('./FieldPacket'); +exports.HandshakeInitializationPacket = require('./HandshakeInitializationPacket'); +exports.LocalDataFilePacket = require('./LocalDataFilePacket'); +exports.LocalInfileRequestPacket = require('./LocalInfileRequestPacket'); +exports.OkPacket = require('./OkPacket'); +exports.OldPasswordPacket = require('./OldPasswordPacket'); +exports.ResultSetHeaderPacket = require('./ResultSetHeaderPacket'); +exports.RowDataPacket = require('./RowDataPacket'); +exports.SSLRequestPacket = require('./SSLRequestPacket'); +exports.StatisticsPacket = require('./StatisticsPacket'); +exports.UseOldPasswordPacket = require('./UseOldPasswordPacket'); diff --git a/node_modules/mysql/lib/protocol/sequences/ChangeUser.js b/node_modules/mysql/lib/protocol/sequences/ChangeUser.js new file mode 100644 index 0000000..e1cc1fb --- /dev/null +++ b/node_modules/mysql/lib/protocol/sequences/ChangeUser.js @@ -0,0 +1,67 @@ +var Sequence = require('./Sequence'); +var Util = require('util'); +var Packets = require('../packets'); +var Auth = require('../Auth'); + +module.exports = ChangeUser; +Util.inherits(ChangeUser, Sequence); +function ChangeUser(options, callback) { + Sequence.call(this, options, callback); + + this._user = options.user; + this._password = options.password; + this._database = options.database; + this._charsetNumber = options.charsetNumber; + this._currentConfig = options.currentConfig; +} + +ChangeUser.prototype.determinePacket = function determinePacket(firstByte) { + switch (firstByte) { + case 0xfe: return Packets.AuthSwitchRequestPacket; + case 0xff: return Packets.ErrorPacket; + default: return undefined; + } +}; + +ChangeUser.prototype.start = function(handshakeInitializationPacket) { + var scrambleBuff = handshakeInitializationPacket.scrambleBuff(); + scrambleBuff = Auth.token(this._password, scrambleBuff); + + var packet = new Packets.ComChangeUserPacket({ + user : this._user, + scrambleBuff : scrambleBuff, + database : this._database, + charsetNumber : this._charsetNumber + }); + + this._currentConfig.user = this._user; + this._currentConfig.password = this._password; + this._currentConfig.database = this._database; + this._currentConfig.charsetNumber = this._charsetNumber; + + this.emit('packet', packet); +}; + +ChangeUser.prototype['AuthSwitchRequestPacket'] = function (packet) { + var name = packet.authMethodName; + var data = Auth.auth(name, packet.authMethodData, { + password: this._password + }); + + if (data !== undefined) { + this.emit('packet', new Packets.AuthSwitchResponsePacket({ + data: data + })); + } else { + var err = new Error('MySQL is requesting the ' + name + ' authentication method, which is not supported.'); + err.code = 'UNSUPPORTED_AUTH_METHOD'; + err.fatal = true; + this.end(err); + } +}; + +ChangeUser.prototype['ErrorPacket'] = function(packet) { + var err = this._packetToError(packet); + err.fatal = true; + this.end(err); +}; diff --git a/node_modules/mysql/lib/protocol/sequences/Handshake.js b/node_modules/mysql/lib/protocol/sequences/Handshake.js new file mode 100644 index 0000000..8fad0fc --- /dev/null +++ b/node_modules/mysql/lib/protocol/sequences/Handshake.js @@ -0,0 +1,126 @@ +var Sequence = require('./Sequence'); +var Util = require('util'); +var Packets = require('../packets'); +var Auth = require('../Auth'); +var ClientConstants = require('../constants/client'); + +module.exports = Handshake; +Util.inherits(Handshake, Sequence); +function Handshake(options, callback) { + Sequence.call(this, options, callback); + + options = options || {}; + + this._config = options.config; + this._handshakeInitializationPacket = null; +} + +Handshake.prototype.determinePacket = function determinePacket(firstByte, parser) { + if (firstByte === 0xff) { + return Packets.ErrorPacket; + } + + if (!this._handshakeInitializationPacket) { + return Packets.HandshakeInitializationPacket; + } + + if (firstByte === 0xfe) { + return (parser.packetLength() === 1) + ? Packets.UseOldPasswordPacket + : Packets.AuthSwitchRequestPacket; + } + + return undefined; +}; + +Handshake.prototype['AuthSwitchRequestPacket'] = function (packet) { + var name = packet.authMethodName; + var data = Auth.auth(name, packet.authMethodData, { + password: this._config.password + }); + + if (data !== undefined) { + this.emit('packet', new Packets.AuthSwitchResponsePacket({ + data: data + })); + } else { + var err = new Error('MySQL is requesting the ' + name + ' authentication method, which is not supported.'); + err.code = 'UNSUPPORTED_AUTH_METHOD'; + err.fatal = true; + this.end(err); + } +}; + +Handshake.prototype['HandshakeInitializationPacket'] = function(packet) { + this._handshakeInitializationPacket = packet; + + this._config.protocol41 = packet.protocol41; + + var serverSSLSupport = packet.serverCapabilities1 & ClientConstants.CLIENT_SSL; + + if (this._config.ssl) { + if (!serverSSLSupport) { + var err = new Error('Server does not support secure connection'); + + err.code = 'HANDSHAKE_NO_SSL_SUPPORT'; + err.fatal = true; + + this.end(err); + return; + } + + this._config.clientFlags |= ClientConstants.CLIENT_SSL; + this.emit('packet', new Packets.SSLRequestPacket({ + clientFlags : this._config.clientFlags, + maxPacketSize : this._config.maxPacketSize, + charsetNumber : this._config.charsetNumber + })); + this.emit('start-tls'); + } else { + this._sendCredentials(); + } +}; + +Handshake.prototype._tlsUpgradeCompleteHandler = function() { + this._sendCredentials(); +}; + +Handshake.prototype._sendCredentials = function() { + var packet = this._handshakeInitializationPacket; + this.emit('packet', new Packets.ClientAuthenticationPacket({ + clientFlags : this._config.clientFlags, + maxPacketSize : this._config.maxPacketSize, + charsetNumber : this._config.charsetNumber, + user : this._config.user, + database : this._config.database, + protocol41 : packet.protocol41, + scrambleBuff : (packet.protocol41) + ? Auth.token(this._config.password, packet.scrambleBuff()) + : Auth.scramble323(packet.scrambleBuff(), this._config.password) + })); +}; + +Handshake.prototype['UseOldPasswordPacket'] = function() { + if (!this._config.insecureAuth) { + var err = new Error( + 'MySQL server is requesting the old and insecure pre-4.1 auth mechanism. ' + + 'Upgrade the user password or use the {insecureAuth: true} option.' + ); + + err.code = 'HANDSHAKE_INSECURE_AUTH'; + err.fatal = true; + + this.end(err); + return; + } + + this.emit('packet', new Packets.OldPasswordPacket({ + scrambleBuff: Auth.scramble323(this._handshakeInitializationPacket.scrambleBuff(), this._config.password) + })); +}; + +Handshake.prototype['ErrorPacket'] = function(packet) { + var err = this._packetToError(packet, true); + err.fatal = true; + this.end(err); +}; diff --git a/node_modules/mysql/lib/protocol/sequences/Ping.js b/node_modules/mysql/lib/protocol/sequences/Ping.js new file mode 100644 index 0000000..230f3c1 --- /dev/null +++ b/node_modules/mysql/lib/protocol/sequences/Ping.js @@ -0,0 +1,19 @@ +var Sequence = require('./Sequence'); +var Util = require('util'); +var Packets = require('../packets'); + +module.exports = Ping; +Util.inherits(Ping, Sequence); + +function Ping(options, callback) { + if (!callback && typeof options === 'function') { + callback = options; + options = {}; + } + + Sequence.call(this, options, callback); +} + +Ping.prototype.start = function() { + this.emit('packet', new Packets.ComPingPacket()); +}; diff --git a/node_modules/mysql/lib/protocol/sequences/Query.js b/node_modules/mysql/lib/protocol/sequences/Query.js new file mode 100644 index 0000000..b763295 --- /dev/null +++ b/node_modules/mysql/lib/protocol/sequences/Query.js @@ -0,0 +1,228 @@ +var ClientConstants = require('../constants/client'); +var fs = require('fs'); +var Packets = require('../packets'); +var ResultSet = require('../ResultSet'); +var Sequence = require('./Sequence'); +var ServerStatus = require('../constants/server_status'); +var Readable = require('readable-stream'); +var Util = require('util'); + +module.exports = Query; +Util.inherits(Query, Sequence); +function Query(options, callback) { + Sequence.call(this, options, callback); + + this.sql = options.sql; + this.values = options.values; + this.typeCast = (options.typeCast === undefined) + ? true + : options.typeCast; + this.nestTables = options.nestTables || false; + + this._resultSet = null; + this._results = []; + this._fields = []; + this._index = 0; + this._loadError = null; +} + +Query.prototype.start = function() { + this.emit('packet', new Packets.ComQueryPacket(this.sql)); +}; + +Query.prototype.determinePacket = function determinePacket(byte, parser) { + var resultSet = this._resultSet; + + if (!resultSet) { + switch (byte) { + case 0x00: return Packets.OkPacket; + case 0xfb: return Packets.LocalInfileRequestPacket; + case 0xff: return Packets.ErrorPacket; + default: return Packets.ResultSetHeaderPacket; + } + } + + if (resultSet.eofPackets.length === 0) { + return (resultSet.fieldPackets.length < resultSet.resultSetHeaderPacket.fieldCount) + ? Packets.FieldPacket + : Packets.EofPacket; + } + + if (byte === 0xff) { + return Packets.ErrorPacket; + } + + if (byte === 0xfe && parser.packetLength() < 9) { + return Packets.EofPacket; + } + + return Packets.RowDataPacket; +}; + +Query.prototype['OkPacket'] = function(packet) { + // try...finally for exception safety + try { + if (!this._callback) { + this.emit('result', packet, this._index); + } else { + this._results.push(packet); + this._fields.push(undefined); + } + } finally { + this._index++; + this._resultSet = null; + this._handleFinalResultPacket(packet); + } +}; + +Query.prototype['ErrorPacket'] = function(packet) { + var err = this._packetToError(packet); + + var results = (this._results.length > 0) + ? this._results + : undefined; + + var fields = (this._fields.length > 0) + ? this._fields + : undefined; + + err.index = this._index; + err.sql = this.sql; + + this.end(err, results, fields); +}; + +Query.prototype['LocalInfileRequestPacket'] = function(packet) { + if (this._connection.config.clientFlags & ClientConstants.CLIENT_LOCAL_FILES) { + this._sendLocalDataFile(packet.filename); + } else { + this._loadError = new Error('Load local files command is disabled'); + this._loadError.code = 'LOCAL_FILES_DISABLED'; + this._loadError.fatal = false; + + this.emit('packet', new Packets.EmptyPacket()); + } +}; + +Query.prototype['ResultSetHeaderPacket'] = function(packet) { + this._resultSet = new ResultSet(packet); +}; + +Query.prototype['FieldPacket'] = function(packet) { + this._resultSet.fieldPackets.push(packet); +}; + +Query.prototype['EofPacket'] = function(packet) { + this._resultSet.eofPackets.push(packet); + + if (this._resultSet.eofPackets.length === 1 && !this._callback) { + this.emit('fields', this._resultSet.fieldPackets, this._index); + } + + if (this._resultSet.eofPackets.length !== 2) { + return; + } + + if (this._callback) { + this._results.push(this._resultSet.rows); + this._fields.push(this._resultSet.fieldPackets); + } + + this._index++; + this._resultSet = null; + this._handleFinalResultPacket(packet); +}; + +Query.prototype._handleFinalResultPacket = function(packet) { + if (packet.serverStatus & ServerStatus.SERVER_MORE_RESULTS_EXISTS) { + return; + } + + var results = (this._results.length > 1) + ? this._results + : this._results[0]; + + var fields = (this._fields.length > 1) + ? this._fields + : this._fields[0]; + + this.end(this._loadError, results, fields); +}; + +Query.prototype['RowDataPacket'] = function(packet, parser, connection) { + packet.parse(parser, this._resultSet.fieldPackets, this.typeCast, this.nestTables, connection); + + if (this._callback) { + this._resultSet.rows.push(packet); + } else { + this.emit('result', packet, this._index); + } +}; + +Query.prototype._sendLocalDataFile = function(path) { + var self = this; + var localStream = fs.createReadStream(path, { + flag : 'r', + encoding : null, + autoClose : true + }); + + this.on('pause', function () { + localStream.pause(); + }); + + this.on('resume', function () { + localStream.resume(); + }); + + localStream.on('data', function (data) { + self.emit('packet', new Packets.LocalDataFilePacket(data)); + }); + + localStream.on('error', function (err) { + self._loadError = err; + localStream.emit('end'); + }); + + localStream.on('end', function () { + self.emit('packet', new Packets.EmptyPacket()); + }); +}; + +Query.prototype.stream = function(options) { + var self = this; + + options = options || {}; + options.objectMode = true; + + var stream = new Readable(options); + + stream._read = function() { + self._connection && self._connection.resume(); + }; + + stream.once('end', function() { + process.nextTick(function () { + stream.emit('close'); + }); + }); + + this.on('result', function(row, i) { + if (!stream.push(row)) self._connection.pause(); + stream.emit('result', row, i); // replicate old emitter + }); + + this.on('error', function(err) { + stream.emit('error', err); // Pass on any errors + }); + + this.on('end', function() { + stream.push(null); // pushing null, indicating EOF + }); + + this.on('fields', function(fields, i) { + stream.emit('fields', fields, i); // replicate old emitter + }); + + return stream; +}; diff --git a/node_modules/mysql/lib/protocol/sequences/Quit.js b/node_modules/mysql/lib/protocol/sequences/Quit.js new file mode 100644 index 0000000..3c34c58 --- /dev/null +++ b/node_modules/mysql/lib/protocol/sequences/Quit.js @@ -0,0 +1,40 @@ +var Sequence = require('./Sequence'); +var Util = require('util'); +var Packets = require('../packets'); + +module.exports = Quit; +Util.inherits(Quit, Sequence); +function Quit(options, callback) { + if (!callback && typeof options === 'function') { + callback = options; + options = {}; + } + + Sequence.call(this, options, callback); + + this._started = false; +} + +Quit.prototype.end = function end(err) { + if (this._ended) { + return; + } + + if (!this._started) { + Sequence.prototype.end.call(this, err); + return; + } + + if (err && err.code === 'ECONNRESET' && err.syscall === 'read') { + // Ignore read errors after packet sent + Sequence.prototype.end.call(this); + return; + } + + Sequence.prototype.end.call(this, err); +}; + +Quit.prototype.start = function() { + this._started = true; + this.emit('packet', new Packets.ComQuitPacket()); +}; diff --git a/node_modules/mysql/lib/protocol/sequences/Sequence.js b/node_modules/mysql/lib/protocol/sequences/Sequence.js new file mode 100644 index 0000000..de82dc2 --- /dev/null +++ b/node_modules/mysql/lib/protocol/sequences/Sequence.js @@ -0,0 +1,125 @@ +var Util = require('util'); +var EventEmitter = require('events').EventEmitter; +var Packets = require('../packets'); +var ErrorConstants = require('../constants/errors'); +var Timer = require('../Timer'); + +// istanbul ignore next: Node.js < 0.10 not covered +var listenerCount = EventEmitter.listenerCount + || function(emitter, type){ return emitter.listeners(type).length; }; + +var LONG_STACK_DELIMITER = '\n --------------------\n'; + +module.exports = Sequence; +Util.inherits(Sequence, EventEmitter); +function Sequence(options, callback) { + if (typeof options === 'function') { + callback = options; + options = {}; + } + + EventEmitter.call(this); + + options = options || {}; + + this._callback = callback; + this._callSite = null; + this._ended = false; + this._timeout = options.timeout; + this._timer = new Timer(this); +} + +Sequence.determinePacket = function(byte) { + switch (byte) { + case 0x00: return Packets.OkPacket; + case 0xfe: return Packets.EofPacket; + case 0xff: return Packets.ErrorPacket; + default: return undefined; + } +}; + +Sequence.prototype.hasErrorHandler = function() { + return Boolean(this._callback) || listenerCount(this, 'error') > 1; +}; + +Sequence.prototype._packetToError = function(packet) { + var code = ErrorConstants[packet.errno] || 'UNKNOWN_CODE_PLEASE_REPORT'; + var err = new Error(code + ': ' + packet.message); + err.code = code; + err.errno = packet.errno; + + err.sqlMessage = packet.message; + err.sqlState = packet.sqlState; + + return err; +}; + +Sequence.prototype.end = function(err) { + if (this._ended) { + return; + } + + this._ended = true; + + if (err) { + this._addLongStackTrace(err); + } + + // Without this we are leaking memory. This problem was introduced in + // 8189925374e7ce3819bbe88b64c7b15abac96b16. I suspect that the error object + // causes a cyclic reference that the GC does not detect properly, but I was + // unable to produce a standalone version of this leak. This would be a great + // challenge for somebody interested in difficult problems : )! + this._callSite = null; + + // try...finally for exception safety + try { + if (err) { + this.emit('error', err); + } + } finally { + try { + if (this._callback) { + this._callback.apply(this, arguments); + } + } finally { + this.emit('end'); + } + } +}; + +Sequence.prototype['OkPacket'] = function(packet) { + this.end(null, packet); +}; + +Sequence.prototype['ErrorPacket'] = function(packet) { + this.end(this._packetToError(packet)); +}; + +// Implemented by child classes +Sequence.prototype.start = function() {}; + +Sequence.prototype._addLongStackTrace = function _addLongStackTrace(err) { + var callSiteStack = this._callSite && this._callSite.stack; + + if (!callSiteStack || typeof callSiteStack !== 'string') { + // No recorded call site + return; + } + + if (err.stack.indexOf(LONG_STACK_DELIMITER) !== -1) { + // Error stack already looks long + return; + } + + var index = callSiteStack.indexOf('\n'); + + if (index !== -1) { + // Append recorded call site + err.stack += LONG_STACK_DELIMITER + callSiteStack.substr(index + 1); + } +}; + +Sequence.prototype._onTimeout = function _onTimeout() { + this.emit('timeout'); +}; diff --git a/node_modules/mysql/lib/protocol/sequences/Statistics.js b/node_modules/mysql/lib/protocol/sequences/Statistics.js new file mode 100644 index 0000000..c75b5d9 --- /dev/null +++ b/node_modules/mysql/lib/protocol/sequences/Statistics.js @@ -0,0 +1,30 @@ +var Sequence = require('./Sequence'); +var Util = require('util'); +var Packets = require('../packets'); + +module.exports = Statistics; +Util.inherits(Statistics, Sequence); +function Statistics(options, callback) { + if (!callback && typeof options === 'function') { + callback = options; + options = {}; + } + + Sequence.call(this, options, callback); +} + +Statistics.prototype.start = function() { + this.emit('packet', new Packets.ComStatisticsPacket()); +}; + +Statistics.prototype['StatisticsPacket'] = function (packet) { + this.end(null, packet); +}; + +Statistics.prototype.determinePacket = function determinePacket(firstByte) { + if (firstByte === 0x55) { + return Packets.StatisticsPacket; + } + + return undefined; +}; diff --git a/node_modules/mysql/lib/protocol/sequences/index.js b/node_modules/mysql/lib/protocol/sequences/index.js new file mode 100644 index 0000000..0eae5ce --- /dev/null +++ b/node_modules/mysql/lib/protocol/sequences/index.js @@ -0,0 +1,7 @@ +exports.ChangeUser = require('./ChangeUser'); +exports.Handshake = require('./Handshake'); +exports.Ping = require('./Ping'); +exports.Query = require('./Query'); +exports.Quit = require('./Quit'); +exports.Sequence = require('./Sequence'); +exports.Statistics = require('./Statistics'); diff --git a/node_modules/is-property/LICENSE b/node_modules/mysql/node_modules/safe-buffer/LICENSE similarity index 96% rename from node_modules/is-property/LICENSE rename to node_modules/mysql/node_modules/safe-buffer/LICENSE index 8ce206a..0c068ce 100644 --- a/node_modules/is-property/LICENSE +++ b/node_modules/mysql/node_modules/safe-buffer/LICENSE @@ -1,7 +1,6 @@ - The MIT License (MIT) -Copyright (c) 2013 Mikola Lysenko +Copyright (c) Feross Aboukhadijeh Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/node_modules/mysql/node_modules/safe-buffer/README.md b/node_modules/mysql/node_modules/safe-buffer/README.md new file mode 100644 index 0000000..e9a81af --- /dev/null +++ b/node_modules/mysql/node_modules/safe-buffer/README.md @@ -0,0 +1,584 @@ +# safe-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] + +[travis-image]: https://img.shields.io/travis/feross/safe-buffer/master.svg +[travis-url]: https://travis-ci.org/feross/safe-buffer +[npm-image]: https://img.shields.io/npm/v/safe-buffer.svg +[npm-url]: https://npmjs.org/package/safe-buffer +[downloads-image]: https://img.shields.io/npm/dm/safe-buffer.svg +[downloads-url]: https://npmjs.org/package/safe-buffer +[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg +[standard-url]: https://standardjs.com + +#### Safer Node.js Buffer API + +**Use the new Node.js Buffer APIs (`Buffer.from`, `Buffer.alloc`, +`Buffer.allocUnsafe`, `Buffer.allocUnsafeSlow`) in all versions of Node.js.** + +**Uses the built-in implementation when available.** + +## install + +``` +npm install safe-buffer +``` + +## usage + +The goal of this package is to provide a safe replacement for the node.js `Buffer`. + +It's a drop-in replacement for `Buffer`. You can use it by adding one `require` line to +the top of your node.js modules: + +```js +var Buffer = require('safe-buffer').Buffer + +// Existing buffer code will continue to work without issues: + +new Buffer('hey', 'utf8') +new Buffer([1, 2, 3], 'utf8') +new Buffer(obj) +new Buffer(16) // create an uninitialized buffer (potentially unsafe) + +// But you can use these new explicit APIs to make clear what you want: + +Buffer.from('hey', 'utf8') // convert from many types to a Buffer +Buffer.alloc(16) // create a zero-filled buffer (safe) +Buffer.allocUnsafe(16) // create an uninitialized buffer (potentially unsafe) +``` + +## api + +### Class Method: Buffer.from(array) + + +* `array` {Array} + +Allocates a new `Buffer` using an `array` of octets. + +```js +const buf = Buffer.from([0x62,0x75,0x66,0x66,0x65,0x72]); + // creates a new Buffer containing ASCII bytes + // ['b','u','f','f','e','r'] +``` + +A `TypeError` will be thrown if `array` is not an `Array`. + +### Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]]) + + +* `arrayBuffer` {ArrayBuffer} The `.buffer` property of a `TypedArray` or + a `new ArrayBuffer()` +* `byteOffset` {Number} Default: `0` +* `length` {Number} Default: `arrayBuffer.length - byteOffset` + +When passed a reference to the `.buffer` property of a `TypedArray` instance, +the newly created `Buffer` will share the same allocated memory as the +TypedArray. + +```js +const arr = new Uint16Array(2); +arr[0] = 5000; +arr[1] = 4000; + +const buf = Buffer.from(arr.buffer); // shares the memory with arr; + +console.log(buf); + // Prints: + +// changing the TypedArray changes the Buffer also +arr[1] = 6000; + +console.log(buf); + // Prints: +``` + +The optional `byteOffset` and `length` arguments specify a memory range within +the `arrayBuffer` that will be shared by the `Buffer`. + +```js +const ab = new ArrayBuffer(10); +const buf = Buffer.from(ab, 0, 2); +console.log(buf.length); + // Prints: 2 +``` + +A `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer`. + +### Class Method: Buffer.from(buffer) + + +* `buffer` {Buffer} + +Copies the passed `buffer` data onto a new `Buffer` instance. + +```js +const buf1 = Buffer.from('buffer'); +const buf2 = Buffer.from(buf1); + +buf1[0] = 0x61; +console.log(buf1.toString()); + // 'auffer' +console.log(buf2.toString()); + // 'buffer' (copy is not changed) +``` + +A `TypeError` will be thrown if `buffer` is not a `Buffer`. + +### Class Method: Buffer.from(str[, encoding]) + + +* `str` {String} String to encode. +* `encoding` {String} Encoding to use, Default: `'utf8'` + +Creates a new `Buffer` containing the given JavaScript string `str`. If +provided, the `encoding` parameter identifies the character encoding. +If not provided, `encoding` defaults to `'utf8'`. + +```js +const buf1 = Buffer.from('this is a tést'); +console.log(buf1.toString()); + // prints: this is a tést +console.log(buf1.toString('ascii')); + // prints: this is a tC)st + +const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex'); +console.log(buf2.toString()); + // prints: this is a tést +``` + +A `TypeError` will be thrown if `str` is not a string. + +### Class Method: Buffer.alloc(size[, fill[, encoding]]) + + +* `size` {Number} +* `fill` {Value} Default: `undefined` +* `encoding` {String} Default: `utf8` + +Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the +`Buffer` will be *zero-filled*. + +```js +const buf = Buffer.alloc(5); +console.log(buf); + // +``` + +The `size` must be less than or equal to the value of +`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is +`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will +be created if a `size` less than or equal to 0 is specified. + +If `fill` is specified, the allocated `Buffer` will be initialized by calling +`buf.fill(fill)`. See [`buf.fill()`][] for more information. + +```js +const buf = Buffer.alloc(5, 'a'); +console.log(buf); + // +``` + +If both `fill` and `encoding` are specified, the allocated `Buffer` will be +initialized by calling `buf.fill(fill, encoding)`. For example: + +```js +const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64'); +console.log(buf); + // +``` + +Calling `Buffer.alloc(size)` can be significantly slower than the alternative +`Buffer.allocUnsafe(size)` but ensures that the newly created `Buffer` instance +contents will *never contain sensitive data*. + +A `TypeError` will be thrown if `size` is not a number. + +### Class Method: Buffer.allocUnsafe(size) + + +* `size` {Number} + +Allocates a new *non-zero-filled* `Buffer` of `size` bytes. The `size` must +be less than or equal to the value of `require('buffer').kMaxLength` (on 64-bit +architectures, `kMaxLength` is `(2^31)-1`). Otherwise, a [`RangeError`][] is +thrown. A zero-length Buffer will be created if a `size` less than or equal to +0 is specified. + +The underlying memory for `Buffer` instances created in this way is *not +initialized*. The contents of the newly created `Buffer` are unknown and +*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such +`Buffer` instances to zeroes. + +```js +const buf = Buffer.allocUnsafe(5); +console.log(buf); + // + // (octets will be different, every time) +buf.fill(0); +console.log(buf); + // +``` + +A `TypeError` will be thrown if `size` is not a number. + +Note that the `Buffer` module pre-allocates an internal `Buffer` instance of +size `Buffer.poolSize` that is used as a pool for the fast allocation of new +`Buffer` instances created using `Buffer.allocUnsafe(size)` (and the deprecated +`new Buffer(size)` constructor) only when `size` is less than or equal to +`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). The default +value of `Buffer.poolSize` is `8192` but can be modified. + +Use of this pre-allocated internal memory pool is a key difference between +calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. +Specifically, `Buffer.alloc(size, fill)` will *never* use the internal Buffer +pool, while `Buffer.allocUnsafe(size).fill(fill)` *will* use the internal +Buffer pool if `size` is less than or equal to half `Buffer.poolSize`. The +difference is subtle but can be important when an application requires the +additional performance that `Buffer.allocUnsafe(size)` provides. + +### Class Method: Buffer.allocUnsafeSlow(size) + + +* `size` {Number} + +Allocates a new *non-zero-filled* and non-pooled `Buffer` of `size` bytes. The +`size` must be less than or equal to the value of +`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is +`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will +be created if a `size` less than or equal to 0 is specified. + +The underlying memory for `Buffer` instances created in this way is *not +initialized*. The contents of the newly created `Buffer` are unknown and +*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such +`Buffer` instances to zeroes. + +When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances, +allocations under 4KB are, by default, sliced from a single pre-allocated +`Buffer`. This allows applications to avoid the garbage collection overhead of +creating many individually allocated Buffers. This approach improves both +performance and memory usage by eliminating the need to track and cleanup as +many `Persistent` objects. + +However, in the case where a developer may need to retain a small chunk of +memory from a pool for an indeterminate amount of time, it may be appropriate +to create an un-pooled Buffer instance using `Buffer.allocUnsafeSlow()` then +copy out the relevant bits. + +```js +// need to keep around a few small chunks of memory +const store = []; + +socket.on('readable', () => { + const data = socket.read(); + // allocate for retained data + const sb = Buffer.allocUnsafeSlow(10); + // copy the data into the new allocation + data.copy(sb, 0, 0, 10); + store.push(sb); +}); +``` + +Use of `Buffer.allocUnsafeSlow()` should be used only as a last resort *after* +a developer has observed undue memory retention in their applications. + +A `TypeError` will be thrown if `size` is not a number. + +### All the Rest + +The rest of the `Buffer` API is exactly the same as in node.js. +[See the docs](https://nodejs.org/api/buffer.html). + + +## Related links + +- [Node.js issue: Buffer(number) is unsafe](https://github.com/nodejs/node/issues/4660) +- [Node.js Enhancement Proposal: Buffer.from/Buffer.alloc/Buffer.zalloc/Buffer() soft-deprecate](https://github.com/nodejs/node-eps/pull/4) + +## Why is `Buffer` unsafe? + +Today, the node.js `Buffer` constructor is overloaded to handle many different argument +types like `String`, `Array`, `Object`, `TypedArrayView` (`Uint8Array`, etc.), +`ArrayBuffer`, and also `Number`. + +The API is optimized for convenience: you can throw any type at it, and it will try to do +what you want. + +Because the Buffer constructor is so powerful, you often see code like this: + +```js +// Convert UTF-8 strings to hex +function toHex (str) { + return new Buffer(str).toString('hex') +} +``` + +***But what happens if `toHex` is called with a `Number` argument?*** + +### Remote Memory Disclosure + +If an attacker can make your program call the `Buffer` constructor with a `Number` +argument, then they can make it allocate uninitialized memory from the node.js process. +This could potentially disclose TLS private keys, user data, or database passwords. + +When the `Buffer` constructor is passed a `Number` argument, it returns an +**UNINITIALIZED** block of memory of the specified `size`. When you create a `Buffer` like +this, you **MUST** overwrite the contents before returning it to the user. + +From the [node.js docs](https://nodejs.org/api/buffer.html#buffer_new_buffer_size): + +> `new Buffer(size)` +> +> - `size` Number +> +> The underlying memory for `Buffer` instances created in this way is not initialized. +> **The contents of a newly created `Buffer` are unknown and could contain sensitive +> data.** Use `buf.fill(0)` to initialize a Buffer to zeroes. + +(Emphasis our own.) + +Whenever the programmer intended to create an uninitialized `Buffer` you often see code +like this: + +```js +var buf = new Buffer(16) + +// Immediately overwrite the uninitialized buffer with data from another buffer +for (var i = 0; i < buf.length; i++) { + buf[i] = otherBuf[i] +} +``` + + +### Would this ever be a problem in real code? + +Yes. It's surprisingly common to forget to check the type of your variables in a +dynamically-typed language like JavaScript. + +Usually the consequences of assuming the wrong type is that your program crashes with an +uncaught exception. But the failure mode for forgetting to check the type of arguments to +the `Buffer` constructor is more catastrophic. + +Here's an example of a vulnerable service that takes a JSON payload and converts it to +hex: + +```js +// Take a JSON payload {str: "some string"} and convert it to hex +var server = http.createServer(function (req, res) { + var data = '' + req.setEncoding('utf8') + req.on('data', function (chunk) { + data += chunk + }) + req.on('end', function () { + var body = JSON.parse(data) + res.end(new Buffer(body.str).toString('hex')) + }) +}) + +server.listen(8080) +``` + +In this example, an http client just has to send: + +```json +{ + "str": 1000 +} +``` + +and it will get back 1,000 bytes of uninitialized memory from the server. + +This is a very serious bug. It's similar in severity to the +[the Heartbleed bug](http://heartbleed.com/) that allowed disclosure of OpenSSL process +memory by remote attackers. + + +### Which real-world packages were vulnerable? + +#### [`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht) + +[Mathias Buus](https://github.com/mafintosh) and I +([Feross Aboukhadijeh](http://feross.org/)) found this issue in one of our own packages, +[`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht). The bug would allow +anyone on the internet to send a series of messages to a user of `bittorrent-dht` and get +them to reveal 20 bytes at a time of uninitialized memory from the node.js process. + +Here's +[the commit](https://github.com/feross/bittorrent-dht/commit/6c7da04025d5633699800a99ec3fbadf70ad35b8) +that fixed it. We released a new fixed version, created a +[Node Security Project disclosure](https://nodesecurity.io/advisories/68), and deprecated all +vulnerable versions on npm so users will get a warning to upgrade to a newer version. + +#### [`ws`](https://www.npmjs.com/package/ws) + +That got us wondering if there were other vulnerable packages. Sure enough, within a short +period of time, we found the same issue in [`ws`](https://www.npmjs.com/package/ws), the +most popular WebSocket implementation in node.js. + +If certain APIs were called with `Number` parameters instead of `String` or `Buffer` as +expected, then uninitialized server memory would be disclosed to the remote peer. + +These were the vulnerable methods: + +```js +socket.send(number) +socket.ping(number) +socket.pong(number) +``` + +Here's a vulnerable socket server with some echo functionality: + +```js +server.on('connection', function (socket) { + socket.on('message', function (message) { + message = JSON.parse(message) + if (message.type === 'echo') { + socket.send(message.data) // send back the user's message + } + }) +}) +``` + +`socket.send(number)` called on the server, will disclose server memory. + +Here's [the release](https://github.com/websockets/ws/releases/tag/1.0.1) where the issue +was fixed, with a more detailed explanation. Props to +[Arnout Kazemier](https://github.com/3rd-Eden) for the quick fix. Here's the +[Node Security Project disclosure](https://nodesecurity.io/advisories/67). + + +### What's the solution? + +It's important that node.js offers a fast way to get memory otherwise performance-critical +applications would needlessly get a lot slower. + +But we need a better way to *signal our intent* as programmers. **When we want +uninitialized memory, we should request it explicitly.** + +Sensitive functionality should not be packed into a developer-friendly API that loosely +accepts many different types. This type of API encourages the lazy practice of passing +variables in without checking the type very carefully. + +#### A new API: `Buffer.allocUnsafe(number)` + +The functionality of creating buffers with uninitialized memory should be part of another +API. We propose `Buffer.allocUnsafe(number)`. This way, it's not part of an API that +frequently gets user input of all sorts of different types passed into it. + +```js +var buf = Buffer.allocUnsafe(16) // careful, uninitialized memory! + +// Immediately overwrite the uninitialized buffer with data from another buffer +for (var i = 0; i < buf.length; i++) { + buf[i] = otherBuf[i] +} +``` + + +### How do we fix node.js core? + +We sent [a PR to node.js core](https://github.com/nodejs/node/pull/4514) (merged as +`semver-major`) which defends against one case: + +```js +var str = 16 +new Buffer(str, 'utf8') +``` + +In this situation, it's implied that the programmer intended the first argument to be a +string, since they passed an encoding as a second argument. Today, node.js will allocate +uninitialized memory in the case of `new Buffer(number, encoding)`, which is probably not +what the programmer intended. + +But this is only a partial solution, since if the programmer does `new Buffer(variable)` +(without an `encoding` parameter) there's no way to know what they intended. If `variable` +is sometimes a number, then uninitialized memory will sometimes be returned. + +### What's the real long-term fix? + +We could deprecate and remove `new Buffer(number)` and use `Buffer.allocUnsafe(number)` when +we need uninitialized memory. But that would break 1000s of packages. + +~~We believe the best solution is to:~~ + +~~1. Change `new Buffer(number)` to return safe, zeroed-out memory~~ + +~~2. Create a new API for creating uninitialized Buffers. We propose: `Buffer.allocUnsafe(number)`~~ + +#### Update + +We now support adding three new APIs: + +- `Buffer.from(value)` - convert from any type to a buffer +- `Buffer.alloc(size)` - create a zero-filled buffer +- `Buffer.allocUnsafe(size)` - create an uninitialized buffer with given size + +This solves the core problem that affected `ws` and `bittorrent-dht` which is +`Buffer(variable)` getting tricked into taking a number argument. + +This way, existing code continues working and the impact on the npm ecosystem will be +minimal. Over time, npm maintainers can migrate performance-critical code to use +`Buffer.allocUnsafe(number)` instead of `new Buffer(number)`. + + +### Conclusion + +We think there's a serious design issue with the `Buffer` API as it exists today. It +promotes insecure software by putting high-risk functionality into a convenient API +with friendly "developer ergonomics". + +This wasn't merely a theoretical exercise because we found the issue in some of the +most popular npm packages. + +Fortunately, there's an easy fix that can be applied today. Use `safe-buffer` in place of +`buffer`. + +```js +var Buffer = require('safe-buffer').Buffer +``` + +Eventually, we hope that node.js core can switch to this new, safer behavior. We believe +the impact on the ecosystem would be minimal since it's not a breaking change. +Well-maintained, popular packages would be updated to use `Buffer.alloc` quickly, while +older, insecure packages would magically become safe from this attack vector. + + +## links + +- [Node.js PR: buffer: throw if both length and enc are passed](https://github.com/nodejs/node/pull/4514) +- [Node Security Project disclosure for `ws`](https://nodesecurity.io/advisories/67) +- [Node Security Project disclosure for`bittorrent-dht`](https://nodesecurity.io/advisories/68) + + +## credit + +The original issues in `bittorrent-dht` +([disclosure](https://nodesecurity.io/advisories/68)) and +`ws` ([disclosure](https://nodesecurity.io/advisories/67)) were discovered by +[Mathias Buus](https://github.com/mafintosh) and +[Feross Aboukhadijeh](http://feross.org/). + +Thanks to [Adam Baldwin](https://github.com/evilpacket) for helping disclose these issues +and for his work running the [Node Security Project](https://nodesecurity.io/). + +Thanks to [John Hiesey](https://github.com/jhiesey) for proofreading this README and +auditing the code. + + +## license + +MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org) diff --git a/node_modules/mysql/node_modules/safe-buffer/index.d.ts b/node_modules/mysql/node_modules/safe-buffer/index.d.ts new file mode 100644 index 0000000..e9fed80 --- /dev/null +++ b/node_modules/mysql/node_modules/safe-buffer/index.d.ts @@ -0,0 +1,187 @@ +declare module "safe-buffer" { + export class Buffer { + length: number + write(string: string, offset?: number, length?: number, encoding?: string): number; + toString(encoding?: string, start?: number, end?: number): string; + toJSON(): { type: 'Buffer', data: any[] }; + equals(otherBuffer: Buffer): boolean; + compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number; + copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; + slice(start?: number, end?: number): Buffer; + writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readUInt8(offset: number, noAssert?: boolean): number; + readUInt16LE(offset: number, noAssert?: boolean): number; + readUInt16BE(offset: number, noAssert?: boolean): number; + readUInt32LE(offset: number, noAssert?: boolean): number; + readUInt32BE(offset: number, noAssert?: boolean): number; + readInt8(offset: number, noAssert?: boolean): number; + readInt16LE(offset: number, noAssert?: boolean): number; + readInt16BE(offset: number, noAssert?: boolean): number; + readInt32LE(offset: number, noAssert?: boolean): number; + readInt32BE(offset: number, noAssert?: boolean): number; + readFloatLE(offset: number, noAssert?: boolean): number; + readFloatBE(offset: number, noAssert?: boolean): number; + readDoubleLE(offset: number, noAssert?: boolean): number; + readDoubleBE(offset: number, noAssert?: boolean): number; + swap16(): Buffer; + swap32(): Buffer; + swap64(): Buffer; + writeUInt8(value: number, offset: number, noAssert?: boolean): number; + writeUInt16LE(value: number, offset: number, noAssert?: boolean): number; + writeUInt16BE(value: number, offset: number, noAssert?: boolean): number; + writeUInt32LE(value: number, offset: number, noAssert?: boolean): number; + writeUInt32BE(value: number, offset: number, noAssert?: boolean): number; + writeInt8(value: number, offset: number, noAssert?: boolean): number; + writeInt16LE(value: number, offset: number, noAssert?: boolean): number; + writeInt16BE(value: number, offset: number, noAssert?: boolean): number; + writeInt32LE(value: number, offset: number, noAssert?: boolean): number; + writeInt32BE(value: number, offset: number, noAssert?: boolean): number; + writeFloatLE(value: number, offset: number, noAssert?: boolean): number; + writeFloatBE(value: number, offset: number, noAssert?: boolean): number; + writeDoubleLE(value: number, offset: number, noAssert?: boolean): number; + writeDoubleBE(value: number, offset: number, noAssert?: boolean): number; + fill(value: any, offset?: number, end?: number): this; + indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; + lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; + includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean; + + /** + * Allocates a new buffer containing the given {str}. + * + * @param str String to store in buffer. + * @param encoding encoding to use, optional. Default is 'utf8' + */ + constructor (str: string, encoding?: string); + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + */ + constructor (size: number); + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + */ + constructor (array: Uint8Array); + /** + * Produces a Buffer backed by the same allocated memory as + * the given {ArrayBuffer}. + * + * + * @param arrayBuffer The ArrayBuffer with which to share memory. + */ + constructor (arrayBuffer: ArrayBuffer); + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + */ + constructor (array: any[]); + /** + * Copies the passed {buffer} data onto a new {Buffer} instance. + * + * @param buffer The buffer to copy. + */ + constructor (buffer: Buffer); + prototype: Buffer; + /** + * Allocates a new Buffer using an {array} of octets. + * + * @param array + */ + static from(array: any[]): Buffer; + /** + * When passed a reference to the .buffer property of a TypedArray instance, + * the newly created Buffer will share the same allocated memory as the TypedArray. + * The optional {byteOffset} and {length} arguments specify a memory range + * within the {arrayBuffer} that will be shared by the Buffer. + * + * @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer() + * @param byteOffset + * @param length + */ + static from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer; + /** + * Copies the passed {buffer} data onto a new Buffer instance. + * + * @param buffer + */ + static from(buffer: Buffer): Buffer; + /** + * Creates a new Buffer containing the given JavaScript string {str}. + * If provided, the {encoding} parameter identifies the character encoding. + * If not provided, {encoding} defaults to 'utf8'. + * + * @param str + */ + static from(str: string, encoding?: string): Buffer; + /** + * Returns true if {obj} is a Buffer + * + * @param obj object to test. + */ + static isBuffer(obj: any): obj is Buffer; + /** + * Returns true if {encoding} is a valid encoding argument. + * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex' + * + * @param encoding string to test. + */ + static isEncoding(encoding: string): boolean; + /** + * Gives the actual byte length of a string. encoding defaults to 'utf8'. + * This is not the same as String.prototype.length since that returns the number of characters in a string. + * + * @param string string to test. + * @param encoding encoding used to evaluate (defaults to 'utf8') + */ + static byteLength(string: string, encoding?: string): number; + /** + * Returns a buffer which is the result of concatenating all the buffers in the list together. + * + * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer. + * If the list has exactly one item, then the first item of the list is returned. + * If the list has more than one item, then a new Buffer is created. + * + * @param list An array of Buffer objects to concatenate + * @param totalLength Total length of the buffers when concatenated. + * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly. + */ + static concat(list: Buffer[], totalLength?: number): Buffer; + /** + * The same as buf1.compare(buf2). + */ + static compare(buf1: Buffer, buf2: Buffer): number; + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + * @param fill if specified, buffer will be initialized by calling buf.fill(fill). + * If parameter is omitted, buffer will be filled with zeros. + * @param encoding encoding used for call to buf.fill while initalizing + */ + static alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer; + /** + * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents + * of the newly created Buffer are unknown and may contain sensitive data. + * + * @param size count of octets to allocate + */ + static allocUnsafe(size: number): Buffer; + /** + * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents + * of the newly created Buffer are unknown and may contain sensitive data. + * + * @param size count of octets to allocate + */ + static allocUnsafeSlow(size: number): Buffer; + } +} \ No newline at end of file diff --git a/node_modules/mysql/node_modules/safe-buffer/index.js b/node_modules/mysql/node_modules/safe-buffer/index.js new file mode 100644 index 0000000..22438da --- /dev/null +++ b/node_modules/mysql/node_modules/safe-buffer/index.js @@ -0,0 +1,62 @@ +/* eslint-disable node/no-deprecated-api */ +var buffer = require('buffer') +var Buffer = buffer.Buffer + +// alternative to using Object.keys for old browsers +function copyProps (src, dst) { + for (var key in src) { + dst[key] = src[key] + } +} +if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { + module.exports = buffer +} else { + // Copy properties from require('buffer') + copyProps(buffer, exports) + exports.Buffer = SafeBuffer +} + +function SafeBuffer (arg, encodingOrOffset, length) { + return Buffer(arg, encodingOrOffset, length) +} + +// Copy static methods from Buffer +copyProps(Buffer, SafeBuffer) + +SafeBuffer.from = function (arg, encodingOrOffset, length) { + if (typeof arg === 'number') { + throw new TypeError('Argument must not be a number') + } + return Buffer(arg, encodingOrOffset, length) +} + +SafeBuffer.alloc = function (size, fill, encoding) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + var buf = Buffer(size) + if (fill !== undefined) { + if (typeof encoding === 'string') { + buf.fill(fill, encoding) + } else { + buf.fill(fill) + } + } else { + buf.fill(0) + } + return buf +} + +SafeBuffer.allocUnsafe = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return Buffer(size) +} + +SafeBuffer.allocUnsafeSlow = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return buffer.SlowBuffer(size) +} diff --git a/node_modules/mysql/node_modules/safe-buffer/package.json b/node_modules/mysql/node_modules/safe-buffer/package.json new file mode 100644 index 0000000..623fbc3 --- /dev/null +++ b/node_modules/mysql/node_modules/safe-buffer/package.json @@ -0,0 +1,37 @@ +{ + "name": "safe-buffer", + "description": "Safer Node.js Buffer API", + "version": "5.1.2", + "author": { + "name": "Feross Aboukhadijeh", + "email": "feross@feross.org", + "url": "http://feross.org" + }, + "bugs": { + "url": "https://github.com/feross/safe-buffer/issues" + }, + "devDependencies": { + "standard": "*", + "tape": "^4.0.0" + }, + "homepage": "https://github.com/feross/safe-buffer", + "keywords": [ + "buffer", + "buffer allocate", + "node security", + "safe", + "safe-buffer", + "security", + "uninitialized" + ], + "license": "MIT", + "main": "index.js", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "git://github.com/feross/safe-buffer.git" + }, + "scripts": { + "test": "standard && tape test/*.js" + } +} diff --git a/node_modules/mysql/package.json b/node_modules/mysql/package.json new file mode 100644 index 0000000..7ed9d55 --- /dev/null +++ b/node_modules/mysql/package.json @@ -0,0 +1,46 @@ +{ + "name": "mysql", + "description": "A node.js driver for mysql. It is written in JavaScript, does not require compiling, and is 100% MIT licensed.", + "version": "2.18.1", + "license": "MIT", + "author": "Felix Geisendörfer (http://debuggable.com/)", + "contributors": [ + "Andrey Sidorov ", + "Bradley Grainger ", + "Douglas Christopher Wilson ", + "Diogo Resende ", + "Nathan Woltman " + ], + "repository": "mysqljs/mysql", + "dependencies": { + "bignumber.js": "9.0.0", + "readable-stream": "2.3.7", + "safe-buffer": "5.1.2", + "sqlstring": "2.3.1" + }, + "devDependencies": { + "after": "0.8.2", + "eslint": "5.16.0", + "seedrandom": "3.0.5", + "timezone-mock": "0.0.7", + "urun": "0.0.8", + "utest": "0.0.8" + }, + "files": [ + "lib/", + "Changes.md", + "License", + "Readme.md", + "index.js" + ], + "engines": { + "node": ">= 0.6" + }, + "scripts": { + "lint": "eslint . && node tool/lint-readme.js", + "test": "node test/run.js", + "test-ci": "node tool/install-nyc.js --nyc-optional --reporter=text -- npm test", + "test-cov": "node tool/install-nyc.js --reporter=html --reporter=text -- npm test", + "version": "node tool/version-changes.js && git add Changes.md" + } +} diff --git a/node_modules/mysql2/README.md b/node_modules/mysql2/README.md deleted file mode 100644 index 0a1e62f..0000000 --- a/node_modules/mysql2/README.md +++ /dev/null @@ -1,293 +0,0 @@ -## MySQL 2 - -[![Greenkeeper badge](https://badges.greenkeeper.io/sidorares/node-mysql2.svg)](https://greenkeeper.io/) -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Node.js Version][node-version-image]][node-version-url] -[![Linux Build][travis-image]][travis-url] -[![Windows Build][appveyor-image]][appveyor-url] -[![License][license-image]][license-url] - -English | [简体中文](./documentation/zh-cn/) | [Português (BR)](./documentation/pt-br/) - -> MySQL client for Node.js with focus on performance. Supports prepared statements, non-utf8 encodings, binary log protocol, compression, ssl [much more](./documentation/en). - -__Table of contents__ - - - [History and Why MySQL2](#history-and-why-mysql2) - - [Installation](#installation) - - [First Query](#first-query) - - [Using Prepared Statements](#using-prepared-statements) - - [Using connection pools](#using-connection-pools) - - [Using Promise Wrapper](#using-promise-wrapper) - - [Array Results](#array-results) - - [Connection Level](#connection-level) - - [Query Level](#query-level) - - [API and Configuration](#api-and-configuration) - - [Documentation](#documentation) - - [Acknowledgements](#acknowledgements) - - [Contributing](#contributing) - -## History and Why MySQL2 - -MySQL2 project is a continuation of [MySQL-Native][mysql-native]. Protocol parser code was rewritten from scratch and api changed to match popular [mysqljs/mysql][node-mysql]. MySQL2 team is working together with [mysqljs/mysql][node-mysql] team to factor out shared code and move it under [mysqljs][node-mysql] organisation. - -MySQL2 is mostly API compatible with [mysqljs][node-mysql] and supports majority of features. MySQL2 also offers these additional features: - - - Faster / Better Performance - - [Prepared Statements](./documentation/en/Prepared-Statements.md) - - MySQL Binary Log Protocol - - [MySQL Server](./documentation/en/MySQL-Server.md) - - Extended support for Encoding and Collation - - [Promise Wrapper](./documentation/en/Promise-Wrapper.md) - - Compression - - SSL and [Authentication Switch](./documentation/en/Authentication-Switch.md) - - [Custom Streams](./documentation/en/Extras.md) - - [Pooling](#using-connection-pools) - -## Installation - -MySQL2 is free from native bindings and can be installed on Linux, Mac OS or Windows without any issues. - -```bash -npm install --save mysql2 -``` - -If you are using TypeScript, you will need to install `@types/node`. - -```bash -npm install --save-dev @types/node -``` - -> For TypeScript documentation and examples, see [here](./documentation/en/TypeScript-Examples.md). - -## First Query -```js -// get the client -const mysql = require('mysql2'); - -// create the connection to database -const connection = mysql.createConnection({ - host: 'localhost', - user: 'root', - database: 'test' -}); - -// simple query -connection.query( - 'SELECT * FROM `table` WHERE `name` = "Page" AND `age` > 45', - function(err, results, fields) { - console.log(results); // results contains rows returned by server - console.log(fields); // fields contains extra meta data about results, if available - } -); - -// with placeholder -connection.query( - 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?', - ['Page', 45], - function(err, results) { - console.log(results); - } -); -``` - -## Using Prepared Statements - -With MySQL2 you also get the prepared statements. With prepared statements MySQL doesn't have to prepare plan for same query every time, this results in better performance. If you don't know why they are important, please check these discussions: - -- [How prepared statements can protect from SQL Injection attacks](http://stackoverflow.com/questions/8263371/how-can-prepared-statements-protect-from-sql-injection-attacks) - -MySQL2 provides `execute` helper which will prepare and query the statement. You can also manually prepare / unprepare statement with `prepare` / `unprepare` methods. - -```js -// get the client -const mysql = require('mysql2'); - -// create the connection to database -const connection = mysql.createConnection({ - host: 'localhost', - user: 'root', - database: 'test' -}); - -// execute will internally call prepare and query -connection.execute( - 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?', - ['Rick C-137', 53], - function(err, results, fields) { - console.log(results); // results contains rows returned by server - console.log(fields); // fields contains extra meta data about results, if available - - // If you execute same statement again, it will be picked from a LRU cache - // which will save query preparation time and give better performance - } -); -``` - -## Using connection pools - -Connection pools help reduce the time spent connecting to the MySQL server by reusing a previous connection, leaving them open instead of closing when you are done with them. - -This improves the latency of queries as you avoid all of the overhead that comes with establishing a new connection. - -```js -// get the client -const mysql = require('mysql2'); - -// Create the connection pool. The pool-specific settings are the defaults -const pool = mysql.createPool({ - host: 'localhost', - user: 'root', - database: 'test', - waitForConnections: true, - connectionLimit: 10, - maxIdle: 10, // max idle connections, the default value is the same as `connectionLimit` - idleTimeout: 60000, // idle connections timeout, in milliseconds, the default value 60000 - queueLimit: 0, - enableKeepAlive: true, - keepAliveInitialDelay: 0 -}); -``` -The pool does not create all connections upfront but creates them on demand until the connection limit is reached. - -You can use the pool in the same way as connections (using `pool.query()` and `pool.execute()`): -```js -// For pool initialization, see above -pool.query("SELECT `field` FROM `table`", function(err, rows, fields) { - // Connection is automatically released when query resolves -}); -``` - -Alternatively, there is also the possibility of manually acquiring a connection from the pool and returning it later: -```js -// For pool initialization, see above -pool.getConnection(function(err, conn) { - // Do something with the connection - conn.query(/* ... */); - // Don't forget to release the connection when finished! - pool.releaseConnection(conn); -}); -``` - -## Using Promise Wrapper - -MySQL2 also support Promise API. Which works very well with ES7 async await. -```js -async function main() { - // get the client - const mysql = require('mysql2/promise'); - // create the connection - const connection = await mysql.createConnection({host:'localhost', user: 'root', database: 'test'}); - // query database - const [rows, fields] = await connection.execute('SELECT * FROM `table` WHERE `name` = ? AND `age` > ?', ['Morty', 14]); -} -``` - -MySQL2 use default `Promise` object available in scope. But you can choose which `Promise` implementation you want to use. -```js -// get the client -const mysql = require('mysql2/promise'); - -// get the promise implementation, we will use bluebird -const bluebird = require('bluebird'); - -// create the connection, specify bluebird as Promise -const connection = await mysql.createConnection({host:'localhost', user: 'root', database: 'test', Promise: bluebird}); - -// query database -const [rows, fields] = await connection.execute('SELECT * FROM `table` WHERE `name` = ? AND `age` > ?', ['Morty', 14]); -``` - -MySQL2 also exposes a .promise() function on Pools, so you can create a promise/non-promise connections from the same pool. -```js -async function main() { - // get the client - const mysql = require('mysql2'); - // create the pool - const pool = mysql.createPool({host:'localhost', user: 'root', database: 'test'}); - // now get a Promise wrapped instance of that pool - const promisePool = pool.promise(); - // query database using promises - const [rows,fields] = await promisePool.query("SELECT 1"); -} -``` - -MySQL2 exposes a .promise() function on Connections, to "upgrade" an existing non-promise connection to use promise. -```js -// get the client -const mysql = require('mysql2'); -// create the connection -const con = mysql.createConnection( - {host:'localhost', user: 'root', database: 'test'} -); -con.promise().query("SELECT 1") - .then( ([rows,fields]) => { - console.log(rows); - }) - .catch(console.log) - .then( () => con.end()); -``` - -## Array Results - -If you have two columns with the same name, you might want to get results as an array rather than an object to prevent them from clashing. This is a deviation from the [Node MySQL][node-mysql] library. - -For example: `select 1 as foo, 2 as foo`. - -You can enable this setting at either the connection level (applies to all queries), or at the query level (applies only to that specific query). - -### Connection Level -```js -const con = mysql.createConnection( - { host: 'localhost', database: 'test', user: 'root', rowsAsArray: true } -); -``` - -### Query Level -```js -con.query({ sql: 'select 1 as foo, 2 as foo', rowsAsArray: true }, function(err, results, fields) { - console.log(results); // in this query, results will be an array of arrays rather than an array of objects - console.log(fields); // fields are unchanged -}); -``` - -## API and Configuration - -MySQL2 is mostly API compatible with [Node MySQL][node-mysql]. You should check their API documentation to see all available API options. - -One known incompatibility is that `DECIMAL` values are returned as strings whereas in [Node MySQL][node-mysql] they are returned as numbers. This includes the result of `SUM()` and `AVG()` functions when applied to `INTEGER` arguments. This is done deliberately to avoid loss of precision - see https://github.com/sidorares/node-mysql2/issues/935. - -If you find any other incompatibility with [Node MySQL][node-mysql], Please report via Issue tracker. We will fix reported incompatibility on priority basis. - -## Documentation - -You can find more detailed documentation [here](./documentation/en). You should also check various code [examples](./examples) to understand advanced concepts. - -## Acknowledgements - - - Internal protocol is written by @sidorares [MySQL-Native](https://github.com/sidorares/nodejs-mysql-native) - - Constants, SQL parameters interpolation, Pooling, `ConnectionConfig` class taken from [node-mysql](https://github.com/mysqljs/mysql) - - SSL upgrade code based on @TooTallNate [code](https://gist.github.com/TooTallNate/848444) - - Secure connection / compressed connection api flags compatible to [MariaSQL](https://github.com/mscdex/node-mariasql/) client. - - [Contributors](https://github.com/sidorares/node-mysql2/graphs/contributors) - -## Contributing - -Want to improve something in `node-mysql2`. Please check [Contributing.md](https://github.com/sidorares/node-mysql2/blob/master/Contributing.md) for detailed instruction on how to get started. - - -[npm-image]: https://img.shields.io/npm/v/mysql2.svg -[npm-url]: https://npmjs.org/package/mysql2 -[node-version-image]: http://img.shields.io/node/v/mysql2.svg -[node-version-url]: http://nodejs.org/download/ -[travis-image]: https://img.shields.io/travis/sidorares/node-mysql2/master.svg?label=linux -[travis-url]: https://travis-ci.org/sidorares/node-mysql2 -[appveyor-image]: https://img.shields.io/appveyor/ci/sidorares/node-mysql2/master.svg?label=windows -[appveyor-url]: https://ci.appveyor.com/project/sidorares/node-mysql2 -[downloads-image]: https://img.shields.io/npm/dm/mysql2.svg -[downloads-url]: https://npmjs.org/package/mysql2 -[license-url]: https://github.com/sidorares/node-mysql2/blob/master/License -[license-image]: https://img.shields.io/npm/l/mysql2.svg?maxAge=2592000 -[node-mysql]: https://github.com/mysqljs/mysql -[mysql-native]: https://github.com/sidorares/nodejs-mysql-native diff --git a/node_modules/mysql2/index.d.ts b/node_modules/mysql2/index.d.ts deleted file mode 100644 index 35e7952..0000000 --- a/node_modules/mysql2/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './typings/mysql/index.js'; diff --git a/node_modules/mysql2/index.js b/node_modules/mysql2/index.js deleted file mode 100644 index f33455e..0000000 --- a/node_modules/mysql2/index.js +++ /dev/null @@ -1,83 +0,0 @@ -'use strict'; - -const SqlString = require('sqlstring'); - -const Connection = require('./lib/connection.js'); -const ConnectionConfig = require('./lib/connection_config.js'); -const parserCache = require('./lib/parsers/parser_cache'); - -exports.createConnection = function(opts) { - return new Connection({ config: new ConnectionConfig(opts) }); -}; - -exports.connect = exports.createConnection; -exports.Connection = Connection; -exports.ConnectionConfig = ConnectionConfig; - -const Pool = require('./lib/pool.js'); -const PoolCluster = require('./lib/pool_cluster.js'); - -exports.createPool = function(config) { - const PoolConfig = require('./lib/pool_config.js'); - return new Pool({ config: new PoolConfig(config) }); -}; - -exports.createPoolCluster = function(config) { - const PoolCluster = require('./lib/pool_cluster.js'); - return new PoolCluster(config); -}; - -exports.createQuery = Connection.createQuery; - -exports.Pool = Pool; - -exports.PoolCluster = PoolCluster; - -exports.createServer = function(handler) { - const Server = require('./lib/server.js'); - const s = new Server(); - if (handler) { - s.on('connection', handler); - } - return s; -}; - -exports.PoolConnection = require('./lib/pool_connection'); -exports.authPlugins = require('./lib/auth_plugins'); -exports.escape = SqlString.escape; -exports.escapeId = SqlString.escapeId; -exports.format = SqlString.format; -exports.raw = SqlString.raw; - -exports.__defineGetter__( - 'createConnectionPromise', - () => require('./promise.js').createConnection -); - -exports.__defineGetter__( - 'createPoolPromise', - () => require('./promise.js').createPool -); - -exports.__defineGetter__( - 'createPoolClusterPromise', - () => require('./promise.js').createPoolCluster -); - -exports.__defineGetter__('Types', () => require('./lib/constants/types.js')); - -exports.__defineGetter__('Charsets', () => - require('./lib/constants/charsets.js') -); - -exports.__defineGetter__('CharsetToEncoding', () => - require('./lib/constants/charset_encodings.js') -); - -exports.setMaxParserCache = function(max) { - parserCache.setMaxCache(max); -}; - -exports.clearParserCache = function() { - parserCache.clearCache(); -}; diff --git a/node_modules/mysql2/lib/auth_41.js b/node_modules/mysql2/lib/auth_41.js deleted file mode 100644 index 15d6d03..0000000 --- a/node_modules/mysql2/lib/auth_41.js +++ /dev/null @@ -1,95 +0,0 @@ -'use strict'; - -/* -4.1 authentication: (http://bazaar.launchpad.net/~mysql/mysql-server/5.5/view/head:/sql/password.c) - - SERVER: public_seed=create_random_string() - send(public_seed) - - CLIENT: recv(public_seed) - hash_stage1=sha1("password") - hash_stage2=sha1(hash_stage1) - reply=xor(hash_stage1, sha1(public_seed,hash_stage2) - - // this three steps are done in scramble() - - send(reply) - - - SERVER: recv(reply) - hash_stage1=xor(reply, sha1(public_seed,hash_stage2)) - candidate_hash2=sha1(hash_stage1) - check(candidate_hash2==hash_stage2) - -server stores sha1(sha1(password)) ( hash_stag2) -*/ - -const crypto = require('crypto'); - -function sha1(msg, msg1, msg2) { - const hash = crypto.createHash('sha1'); - hash.update(msg); - if (msg1) { - hash.update(msg1); - } - - if (msg2) { - hash.update(msg2); - } - - return hash.digest(); -} - -function xor(a, b) { - const result = Buffer.allocUnsafe(a.length); - for (let i = 0; i < a.length; i++) { - result[i] = a[i] ^ b[i]; - } - return result; -} - -exports.xor = xor; - -function token(password, scramble1, scramble2) { - if (!password) { - return Buffer.alloc(0); - } - const stage1 = sha1(password); - return exports.calculateTokenFromPasswordSha(stage1, scramble1, scramble2); -} - -exports.calculateTokenFromPasswordSha = function( - passwordSha, - scramble1, - scramble2 -) { - // we use AUTH 41 here, and we need only the bytes we just need. - const authPluginData1 = scramble1.slice(0, 8); - const authPluginData2 = scramble2.slice(0, 12); - const stage2 = sha1(passwordSha); - const stage3 = sha1(authPluginData1, authPluginData2, stage2); - return xor(stage3, passwordSha); -}; - -exports.calculateToken = token; - -exports.verifyToken = function(publicSeed1, publicSeed2, token, doubleSha) { - const hashStage1 = xor(token, sha1(publicSeed1, publicSeed2, doubleSha)); - const candidateHash2 = sha1(hashStage1); - return candidateHash2.compare(doubleSha) === 0; -}; - -exports.doubleSha1 = function(password) { - return sha1(sha1(password)); -}; - -function xorRotating(a, seed) { - const result = Buffer.allocUnsafe(a.length); - const seedLen = seed.length; - - for (let i = 0; i < a.length; i++) { - result[i] = a[i] ^ seed[i % seedLen]; - } - return result; -} -exports.xorRotating = xorRotating; diff --git a/node_modules/mysql2/lib/auth_plugins/caching_sha2_password.js b/node_modules/mysql2/lib/auth_plugins/caching_sha2_password.js deleted file mode 100644 index 4245f93..0000000 --- a/node_modules/mysql2/lib/auth_plugins/caching_sha2_password.js +++ /dev/null @@ -1,103 +0,0 @@ -'use strict'; - -// https://mysqlserverteam.com/mysql-8-0-4-new-default-authentication-plugin-caching_sha2_password/ - -const PLUGIN_NAME = 'caching_sha2_password'; -const crypto = require('crypto'); -const { xor, xorRotating } = require('../auth_41'); - -const REQUEST_SERVER_KEY_PACKET = Buffer.from([2]); -const FAST_AUTH_SUCCESS_PACKET = Buffer.from([3]); -const PERFORM_FULL_AUTHENTICATION_PACKET = Buffer.from([4]); - -const STATE_INITIAL = 0; -const STATE_TOKEN_SENT = 1; -const STATE_WAIT_SERVER_KEY = 2; -const STATE_FINAL = -1; - -function sha256(msg) { - const hash = crypto.createHash('sha256'); - hash.update(msg); - return hash.digest(); -} - -function calculateToken(password, scramble) { - if (!password) { - return Buffer.alloc(0); - } - const stage1 = sha256(Buffer.from(password)); - const stage2 = sha256(stage1); - const stage3 = sha256(Buffer.concat([stage2, scramble])); - return xor(stage1, stage3); -} - -function encrypt(password, scramble, key) { - const stage1 = xorRotating( - Buffer.from(`${password}\0`, 'utf8'), - scramble - ); - return crypto.publicEncrypt(key, stage1); -} - -module.exports = (pluginOptions = {}) => ({ connection }) => { - let state = 0; - let scramble = null; - - const password = connection.config.password; - - const authWithKey = serverKey => { - const _password = encrypt(password, scramble, serverKey); - state = STATE_FINAL; - return _password; - }; - - return data => { - switch (state) { - case STATE_INITIAL: - scramble = data.slice(0, 20); - state = STATE_TOKEN_SENT; - return calculateToken(password, scramble); - - case STATE_TOKEN_SENT: - if (FAST_AUTH_SUCCESS_PACKET.equals(data)) { - state = STATE_FINAL; - return null; - } - - if (PERFORM_FULL_AUTHENTICATION_PACKET.equals(data)) { - const isSecureConnection = - typeof pluginOptions.overrideIsSecure === 'undefined' - ? connection.config.ssl || connection.config.socketPath - : pluginOptions.overrideIsSecure; - if (isSecureConnection) { - state = STATE_FINAL; - return Buffer.from(`${password}\0`, 'utf8'); - } - - // if client provides key we can save one extra roundrip on first connection - if (pluginOptions.serverPublicKey) { - return authWithKey(pluginOptions.serverPublicKey); - } - - state = STATE_WAIT_SERVER_KEY; - return REQUEST_SERVER_KEY_PACKET; - } - throw new Error( - `Invalid AuthMoreData packet received by ${PLUGIN_NAME} plugin in STATE_TOKEN_SENT state.` - ); - case STATE_WAIT_SERVER_KEY: - if (pluginOptions.onServerPublicKey) { - pluginOptions.onServerPublicKey(data); - } - return authWithKey(data); - case STATE_FINAL: - throw new Error( - `Unexpected data in AuthMoreData packet received by ${PLUGIN_NAME} plugin in STATE_FINAL state.` - ); - } - - throw new Error( - `Unexpected data in AuthMoreData packet received by ${PLUGIN_NAME} plugin in state ${state}` - ); - }; -}; diff --git a/node_modules/mysql2/lib/auth_plugins/caching_sha2_password.md b/node_modules/mysql2/lib/auth_plugins/caching_sha2_password.md deleted file mode 100644 index 8560e26..0000000 --- a/node_modules/mysql2/lib/auth_plugins/caching_sha2_password.md +++ /dev/null @@ -1,18 +0,0 @@ -## - -https://mysqlserverteam.com/mysql-8-0-4-new-default-authentication-plugin-caching_sha2_password/ - -```js -const mysql = require('mysql'); -mysql.createConnection({ - authPlugins: { - caching_sha2_password: mysql.authPlugins.caching_sha2_password({ - onServerPublikKey: function(key) { - console.log(key); - }, - serverPublicKey: 'xxxyyy', - overrideIsSecure: true // - }) - } -}); -``` diff --git a/node_modules/mysql2/lib/auth_plugins/index.js b/node_modules/mysql2/lib/auth_plugins/index.js deleted file mode 100644 index dd4dc98..0000000 --- a/node_modules/mysql2/lib/auth_plugins/index.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -module.exports = { - caching_sha2_password: require('./caching_sha2_password'), - mysql_clear_password: require('./mysql_clear_password'), - mysql_native_password: require('./mysql_native_password'), - sha256_password: require('./sha256_password'), -}; diff --git a/node_modules/mysql2/lib/auth_plugins/mysql_clear_password.js b/node_modules/mysql2/lib/auth_plugins/mysql_clear_password.js deleted file mode 100644 index 0833a60..0000000 --- a/node_modules/mysql2/lib/auth_plugins/mysql_clear_password.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; - -function bufferFromStr(str) { - return Buffer.from(`${str}\0`); -} - -const create_mysql_clear_password_plugin = pluginOptions => - function mysql_clear_password_plugin({ connection, command }) { - const password = - command.password || pluginOptions.password || connection.config.password; - - return function (/* pluginData */) { - return bufferFromStr(password); - }; - }; - -module.exports = create_mysql_clear_password_plugin; diff --git a/node_modules/mysql2/lib/auth_plugins/mysql_native_password.js b/node_modules/mysql2/lib/auth_plugins/mysql_native_password.js deleted file mode 100644 index 83d2618..0000000 --- a/node_modules/mysql2/lib/auth_plugins/mysql_native_password.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict'; - -//const PLUGIN_NAME = 'mysql_native_password'; -const auth41 = require('../auth_41.js'); - -module.exports = pluginOptions => ({ connection, command }) => { - const password = - command.password || pluginOptions.password || connection.config.password; - const passwordSha1 = - command.passwordSha1 || - pluginOptions.passwordSha1 || - connection.config.passwordSha1; - return data => { - const authPluginData1 = data.slice(0, 8); - const authPluginData2 = data.slice(8, 20); - let authToken; - if (passwordSha1) { - authToken = auth41.calculateTokenFromPasswordSha( - passwordSha1, - authPluginData1, - authPluginData2 - ); - } else { - authToken = auth41.calculateToken( - password, - authPluginData1, - authPluginData2 - ); - } - return authToken; - }; -}; diff --git a/node_modules/mysql2/lib/auth_plugins/sha256_password.js b/node_modules/mysql2/lib/auth_plugins/sha256_password.js deleted file mode 100644 index 9c104a0..0000000 --- a/node_modules/mysql2/lib/auth_plugins/sha256_password.js +++ /dev/null @@ -1,60 +0,0 @@ -'use strict'; - -const PLUGIN_NAME = 'sha256_password'; -const crypto = require('crypto'); -const { xorRotating } = require('../auth_41'); - -const REQUEST_SERVER_KEY_PACKET = Buffer.from([1]); - -const STATE_INITIAL = 0; -const STATE_WAIT_SERVER_KEY = 1; -const STATE_FINAL = -1; - -function encrypt(password, scramble, key) { - const stage1 = xorRotating( - Buffer.from(`${password}\0`, 'utf8'), - scramble - ); - return crypto.publicEncrypt(key, stage1); -} - -module.exports = (pluginOptions = {}) => ({ connection }) => { - let state = 0; - let scramble = null; - - const password = connection.config.password; - - const authWithKey = serverKey => { - const _password = encrypt(password, scramble, serverKey); - state = STATE_FINAL; - return _password; - }; - - return data => { - switch (state) { - case STATE_INITIAL: - scramble = data.slice(0, 20); - // if client provides key we can save one extra roundrip on first connection - if (pluginOptions.serverPublicKey) { - return authWithKey(pluginOptions.serverPublicKey); - } - - state = STATE_WAIT_SERVER_KEY; - return REQUEST_SERVER_KEY_PACKET; - - case STATE_WAIT_SERVER_KEY: - if (pluginOptions.onServerPublicKey) { - pluginOptions.onServerPublicKey(data); - } - return authWithKey(data); - case STATE_FINAL: - throw new Error( - `Unexpected data in AuthMoreData packet received by ${PLUGIN_NAME} plugin in STATE_FINAL state.` - ); - } - - throw new Error( - `Unexpected data in AuthMoreData packet received by ${PLUGIN_NAME} plugin in state ${state}` - ); - }; -}; diff --git a/node_modules/mysql2/lib/commands/auth_switch.js b/node_modules/mysql2/lib/commands/auth_switch.js deleted file mode 100644 index 1236c03..0000000 --- a/node_modules/mysql2/lib/commands/auth_switch.js +++ /dev/null @@ -1,108 +0,0 @@ -// This file was modified by Oracle on July 5, 2021. -// Errors generated by asynchronous authentication plugins are now being -// handled and subsequently emitted at the command level. -// Modifications copyright (c) 2021, Oracle and/or its affiliates. - -'use strict'; - -const Packets = require('../packets/index.js'); -const sha256_password = require('../auth_plugins/sha256_password'); -const caching_sha2_password = require('../auth_plugins/caching_sha2_password.js'); -const mysql_native_password = require('../auth_plugins/mysql_native_password.js'); -const mysql_clear_password = require('../auth_plugins/mysql_clear_password.js'); - -const standardAuthPlugins = { - sha256_password: sha256_password({}), - caching_sha2_password: caching_sha2_password({}), - mysql_native_password: mysql_native_password({}), - mysql_clear_password: mysql_clear_password({}) -}; - -function warnLegacyAuthSwitch() { - console.warn( - 'WARNING! authSwitchHandler api is deprecated, please use new authPlugins api' - ); -} - -function authSwitchPluginError(error, command) { - // Authentication errors are fatal - error.code = 'AUTH_SWITCH_PLUGIN_ERROR'; - error.fatal = true; - - command.emit('error', error); -} - -function authSwitchRequest(packet, connection, command) { - const { pluginName, pluginData } = Packets.AuthSwitchRequest.fromPacket( - packet - ); - let authPlugin = - connection.config.authPlugins && connection.config.authPlugins[pluginName]; - - // legacy plugin api don't allow to override mysql_native_password - // if pluginName is mysql_native_password it's using standard auth4.1 auth - if ( - connection.config.authSwitchHandler && - pluginName !== 'mysql_native_password' - ) { - const legacySwitchHandler = connection.config.authSwitchHandler; - warnLegacyAuthSwitch(); - legacySwitchHandler({ pluginName, pluginData }, (err, data) => { - if (err) { - return authSwitchPluginError(err, command); - } - connection.writePacket(new Packets.AuthSwitchResponse(data).toPacket()); - }); - return; - } - if (!authPlugin) { - authPlugin = standardAuthPlugins[pluginName]; - } - if (!authPlugin) { - throw new Error( - `Server requests authentication using unknown plugin ${pluginName}. See ${'TODO: add plugins doco here'} on how to configure or author authentication plugins.` - ); - } - connection._authPlugin = authPlugin({ connection, command }); - Promise.resolve(connection._authPlugin(pluginData)).then(data => { - if (data) { - connection.writePacket(new Packets.AuthSwitchResponse(data).toPacket()); - } - }).catch(err => { - authSwitchPluginError(err, command); - }); -} - -function authSwitchRequestMoreData(packet, connection, command) { - const { data } = Packets.AuthSwitchRequestMoreData.fromPacket(packet); - - if (connection.config.authSwitchHandler) { - const legacySwitchHandler = connection.config.authSwitchHandler; - warnLegacyAuthSwitch(); - legacySwitchHandler({ pluginData: data }, (err, data) => { - if (err) { - return authSwitchPluginError(err, command); - } - connection.writePacket(new Packets.AuthSwitchResponse(data).toPacket()); - }); - return; - } - - if (!connection._authPlugin) { - throw new Error( - 'AuthPluginMoreData received but no auth plugin instance found' - ); - } - Promise.resolve(connection._authPlugin(data)).then(data => { - if (data) { - connection.writePacket(new Packets.AuthSwitchResponse(data).toPacket()); - } - }).catch(err => { - authSwitchPluginError(err, command); - }); -} - -module.exports = { - authSwitchRequest, - authSwitchRequestMoreData -}; diff --git a/node_modules/mysql2/lib/commands/binlog_dump.js b/node_modules/mysql2/lib/commands/binlog_dump.js deleted file mode 100644 index be00031..0000000 --- a/node_modules/mysql2/lib/commands/binlog_dump.js +++ /dev/null @@ -1,109 +0,0 @@ -'use strict'; - -const Command = require('./command'); -const Packets = require('../packets'); - -const eventParsers = []; - -class BinlogEventHeader { - constructor(packet) { - this.timestamp = packet.readInt32(); - this.eventType = packet.readInt8(); - this.serverId = packet.readInt32(); - this.eventSize = packet.readInt32(); - this.logPos = packet.readInt32(); - this.flags = packet.readInt16(); - } -} - -class BinlogDump extends Command { - constructor(opts) { - super(); - // this.onResult = callback; - this.opts = opts; - } - - start(packet, connection) { - const newPacket = new Packets.BinlogDump(this.opts); - connection.writePacket(newPacket.toPacket(1)); - return BinlogDump.prototype.binlogData; - } - - binlogData(packet) { - // ok - continue consuming events - // error - error - // eof - end of binlog - if (packet.isEOF()) { - this.emit('eof'); - return null; - } - // binlog event header - packet.readInt8(); - const header = new BinlogEventHeader(packet); - const EventParser = eventParsers[header.eventType]; - let event; - if (EventParser) { - event = new EventParser(packet); - } else { - event = { - name: 'UNKNOWN' - }; - } - event.header = header; - this.emit('event', event); - return BinlogDump.prototype.binlogData; - } -} - -class RotateEvent { - constructor(packet) { - this.pposition = packet.readInt32(); - // TODO: read uint64 here - packet.readInt32(); // positionDword2 - this.nextBinlog = packet.readString(); - this.name = 'RotateEvent'; - } -} - -class FormatDescriptionEvent { - constructor(packet) { - this.binlogVersion = packet.readInt16(); - this.serverVersion = packet.readString(50).replace(/\u0000.*/, ''); // eslint-disable-line no-control-regex - this.createTimestamp = packet.readInt32(); - this.eventHeaderLength = packet.readInt8(); // should be 19 - this.eventsLength = packet.readBuffer(); - this.name = 'FormatDescriptionEvent'; - } -} - -class QueryEvent { - constructor(packet) { - const parseStatusVars = require('../packets/binlog_query_statusvars.js'); - this.slaveProxyId = packet.readInt32(); - this.executionTime = packet.readInt32(); - const schemaLength = packet.readInt8(); - this.errorCode = packet.readInt16(); - const statusVarsLength = packet.readInt16(); - const statusVars = packet.readBuffer(statusVarsLength); - this.schema = packet.readString(schemaLength); - packet.readInt8(); // should be zero - this.statusVars = parseStatusVars(statusVars); - this.query = packet.readString(); - this.name = 'QueryEvent'; - } -} - -class XidEvent { - constructor(packet) { - this.binlogVersion = packet.readInt16(); - this.xid = packet.readInt64(); - this.name = 'XidEvent'; - } -} - -eventParsers[2] = QueryEvent; -eventParsers[4] = RotateEvent; -eventParsers[15] = FormatDescriptionEvent; -eventParsers[16] = XidEvent; - -module.exports = BinlogDump; diff --git a/node_modules/mysql2/lib/commands/change_user.js b/node_modules/mysql2/lib/commands/change_user.js deleted file mode 100644 index 0e8715b..0000000 --- a/node_modules/mysql2/lib/commands/change_user.js +++ /dev/null @@ -1,66 +0,0 @@ -// This file was modified by Oracle on September 21, 2021. -// The changes involve saving additional authentication factor passwords -// in the command scope and enabling multi-factor authentication in the -// client-side when the server supports it. -// Modifications copyright (c) 2021, Oracle and/or its affiliates. - -'use strict'; - -const Command = require('./command.js'); -const Packets = require('../packets/index.js'); -const ClientConstants = require('../constants/client'); -const ClientHandshake = require('./client_handshake.js'); -const CharsetToEncoding = require('../constants/charset_encodings.js'); - -class ChangeUser extends Command { - constructor(options, callback) { - super(); - this.onResult = callback; - this.user = options.user; - this.password = options.password; - // "password1" is an alias of "password" - this.password1 = options.password; - this.password2 = options.password2; - this.password3 = options.password3; - this.database = options.database; - this.passwordSha1 = options.passwordSha1; - this.charsetNumber = options.charsetNumber; - this.currentConfig = options.currentConfig; - this.authenticationFactor = 0; - } - start(packet, connection) { - const newPacket = new Packets.ChangeUser({ - flags: connection.config.clientFlags, - user: this.user, - database: this.database, - charsetNumber: this.charsetNumber, - password: this.password, - passwordSha1: this.passwordSha1, - authPluginData1: connection._handshakePacket.authPluginData1, - authPluginData2: connection._handshakePacket.authPluginData2 - }); - this.currentConfig.user = this.user; - this.currentConfig.password = this.password; - this.currentConfig.database = this.database; - this.currentConfig.charsetNumber = this.charsetNumber; - connection.clientEncoding = CharsetToEncoding[this.charsetNumber]; - // clear prepared statements cache as all statements become invalid after changeUser - connection._statements.clear(); - connection.writePacket(newPacket.toPacket()); - // check if the server supports multi-factor authentication - const multiFactorAuthentication = connection.serverCapabilityFlags & ClientConstants.MULTI_FACTOR_AUTHENTICATION; - if (multiFactorAuthentication) { - // if the server supports multi-factor authentication, we enable it in - // the client - this.authenticationFactor = 1; - } - return ChangeUser.prototype.handshakeResult; - } -} - -ChangeUser.prototype.handshakeResult = - ClientHandshake.prototype.handshakeResult; -ChangeUser.prototype.calculateNativePasswordAuthToken = - ClientHandshake.prototype.calculateNativePasswordAuthToken; - -module.exports = ChangeUser; diff --git a/node_modules/mysql2/lib/commands/client_handshake.js b/node_modules/mysql2/lib/commands/client_handshake.js deleted file mode 100644 index f6cd56c..0000000 --- a/node_modules/mysql2/lib/commands/client_handshake.js +++ /dev/null @@ -1,239 +0,0 @@ -// This file was modified by Oracle on June 17, 2021. -// Handshake errors are now maked as fatal and the corresponding events are -// emitted in the command instance itself. -// Modifications copyright (c) 2021, Oracle and/or its affiliates. - -// This file was modified by Oracle on September 21, 2021. -// Handshake workflow now supports additional authentication factors requested -// by the server. -// Modifications copyright (c) 2021, Oracle and/or its affiliates. - -'use strict'; - -const Command = require('./command.js'); -const Packets = require('../packets/index.js'); -const ClientConstants = require('../constants/client.js'); -const CharsetToEncoding = require('../constants/charset_encodings.js'); -const auth41 = require('../auth_41.js'); - -function flagNames(flags) { - const res = []; - for (const c in ClientConstants) { - if (flags & ClientConstants[c]) { - res.push(c.replace(/_/g, ' ').toLowerCase()); - } - } - return res; -} - -class ClientHandshake extends Command { - constructor(clientFlags) { - super(); - this.handshake = null; - this.clientFlags = clientFlags; - this.authenticationFactor = 0; - } - - start() { - return ClientHandshake.prototype.handshakeInit; - } - - sendSSLRequest(connection) { - const sslRequest = new Packets.SSLRequest( - this.clientFlags, - connection.config.charsetNumber - ); - connection.writePacket(sslRequest.toPacket()); - } - - sendCredentials(connection) { - if (connection.config.debug) { - // eslint-disable-next-line - console.log( - 'Sending handshake packet: flags:%d=(%s)', - this.clientFlags, - flagNames(this.clientFlags).join(', ') - ); - } - this.user = connection.config.user; - this.password = connection.config.password; - // "password1" is an alias to the original "password" value - // to make it easier to integrate multi-factor authentication - this.password1 = connection.config.password; - // "password2" and "password3" are the 2nd and 3rd factor authentication - // passwords, which can be undefined depending on the authentication - // plugin being used - this.password2 = connection.config.password2; - this.password3 = connection.config.password3; - this.passwordSha1 = connection.config.passwordSha1; - this.database = connection.config.database; - this.autPluginName = this.handshake.autPluginName; - const handshakeResponse = new Packets.HandshakeResponse({ - flags: this.clientFlags, - user: this.user, - database: this.database, - password: this.password, - passwordSha1: this.passwordSha1, - charsetNumber: connection.config.charsetNumber, - authPluginData1: this.handshake.authPluginData1, - authPluginData2: this.handshake.authPluginData2, - compress: connection.config.compress, - connectAttributes: connection.config.connectAttributes - }); - connection.writePacket(handshakeResponse.toPacket()); - } - - calculateNativePasswordAuthToken(authPluginData) { - // TODO: dont split into authPluginData1 and authPluginData2, instead join when 1 & 2 received - const authPluginData1 = authPluginData.slice(0, 8); - const authPluginData2 = authPluginData.slice(8, 20); - let authToken; - if (this.passwordSha1) { - authToken = auth41.calculateTokenFromPasswordSha( - this.passwordSha1, - authPluginData1, - authPluginData2 - ); - } else { - authToken = auth41.calculateToken( - this.password, - authPluginData1, - authPluginData2 - ); - } - return authToken; - } - - handshakeInit(helloPacket, connection) { - this.on('error', e => { - connection._fatalError = e; - connection._protocolError = e; - }); - this.handshake = Packets.Handshake.fromPacket(helloPacket); - if (connection.config.debug) { - // eslint-disable-next-line - console.log( - 'Server hello packet: capability flags:%d=(%s)', - this.handshake.capabilityFlags, - flagNames(this.handshake.capabilityFlags).join(', ') - ); - } - connection.serverCapabilityFlags = this.handshake.capabilityFlags; - connection.serverEncoding = CharsetToEncoding[this.handshake.characterSet]; - connection.connectionId = this.handshake.connectionId; - const serverSSLSupport = - this.handshake.capabilityFlags & ClientConstants.SSL; - // multi factor authentication is enabled with the - // "MULTI_FACTOR_AUTHENTICATION" capability and should only be used if it - // is supported by the server - const multiFactorAuthentication = - this.handshake.capabilityFlags & ClientConstants.MULTI_FACTOR_AUTHENTICATION; - this.clientFlags = this.clientFlags | multiFactorAuthentication; - // use compression only if requested by client and supported by server - connection.config.compress = - connection.config.compress && - this.handshake.capabilityFlags & ClientConstants.COMPRESS; - this.clientFlags = this.clientFlags | connection.config.compress; - if (connection.config.ssl) { - // client requires SSL but server does not support it - if (!serverSSLSupport) { - const err = new Error('Server does not support secure connection'); - err.code = 'HANDSHAKE_NO_SSL_SUPPORT'; - err.fatal = true; - this.emit('error', err); - return false; - } - // send ssl upgrade request and immediately upgrade connection to secure - this.clientFlags |= ClientConstants.SSL; - this.sendSSLRequest(connection); - connection.startTLS(err => { - // after connection is secure - if (err) { - // SSL negotiation error are fatal - err.code = 'HANDSHAKE_SSL_ERROR'; - err.fatal = true; - this.emit('error', err); - return; - } - // rest of communication is encrypted - this.sendCredentials(connection); - }); - } else { - this.sendCredentials(connection); - } - if (multiFactorAuthentication) { - // if the server supports multi-factor authentication, we enable it in - // the client - this.authenticationFactor = 1; - } - return ClientHandshake.prototype.handshakeResult; - } - - handshakeResult(packet, connection) { - const marker = packet.peekByte(); - // packet can be OK_Packet, ERR_Packet, AuthSwitchRequest, AuthNextFactor - // or AuthMoreData - if (marker === 0xfe || marker === 1 || marker === 0x02) { - const authSwitch = require('./auth_switch'); - try { - if (marker === 1) { - authSwitch.authSwitchRequestMoreData(packet, connection, this); - } else { - // if authenticationFactor === 0, it means the server does not support - // the multi-factor authentication capability - if (this.authenticationFactor !== 0) { - // if we are past the first authentication factor, we should use the - // corresponding password (if there is one) - connection.config.password = this[`password${this.authenticationFactor}`]; - // update the current authentication factor - this.authenticationFactor += 1; - } - // if marker === 0x02, it means it is an AuthNextFactor packet, - // which is similar in structure to an AuthSwitchRequest packet, - // so, we can use it directly - authSwitch.authSwitchRequest(packet, connection, this); - } - return ClientHandshake.prototype.handshakeResult; - } catch (err) { - // Authentication errors are fatal - err.code = 'AUTH_SWITCH_PLUGIN_ERROR'; - err.fatal = true; - - if (this.onResult) { - this.onResult(err); - } else { - this.emit('error', err); - } - return null; - } - } - if (marker !== 0) { - const err = new Error('Unexpected packet during handshake phase'); - // Unknown handshake errors are fatal - err.code = 'HANDSHAKE_UNKNOWN_ERROR'; - err.fatal = true; - - if (this.onResult) { - this.onResult(err); - } else { - this.emit('error', err); - } - return null; - } - // this should be called from ClientHandshake command only - // and skipped when called from ChangeUser command - if (!connection.authorized) { - connection.authorized = true; - if (connection.config.compress) { - const enableCompression = require('../compressed_protocol.js') - .enableCompression; - enableCompression(connection); - } - } - if (this.onResult) { - this.onResult(null); - } - return null; - } -} -module.exports = ClientHandshake; diff --git a/node_modules/mysql2/lib/commands/close_statement.js b/node_modules/mysql2/lib/commands/close_statement.js deleted file mode 100644 index 15919c1..0000000 --- a/node_modules/mysql2/lib/commands/close_statement.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; - -const Command = require('./command'); -const Packets = require('../packets/index.js'); - -class CloseStatement extends Command { - constructor(id) { - super(); - this.id = id; - } - - start(packet, connection) { - connection.writePacket(new Packets.CloseStatement(this.id).toPacket(1)); - return null; - } -} - -module.exports = CloseStatement; diff --git a/node_modules/mysql2/lib/commands/command.js b/node_modules/mysql2/lib/commands/command.js deleted file mode 100644 index 659086f..0000000 --- a/node_modules/mysql2/lib/commands/command.js +++ /dev/null @@ -1,55 +0,0 @@ -'use strict'; - -const EventEmitter = require('events').EventEmitter; -const Timers = require('timers'); - -class Command extends EventEmitter { - constructor() { - super(); - this.next = null; - } - - // slow. debug only - stateName() { - const state = this.next; - for (const i in this) { - if (this[i] === state && i !== 'next') { - return i; - } - } - return 'unknown name'; - } - - execute(packet, connection) { - if (!this.next) { - this.next = this.start; - connection._resetSequenceId(); - } - if (packet && packet.isError()) { - const err = packet.asError(connection.clientEncoding); - err.sql = this.sql || this.query; - if (this.queryTimeout) { - Timers.clearTimeout(this.queryTimeout); - this.queryTimeout = null; - } - if (this.onResult) { - this.onResult(err); - this.emit('end'); - } else { - this.emit('error', err); - this.emit('end'); - } - return true; - } - // TODO: don't return anything from execute, it's ugly and error-prone. Listen for 'end' event in connection - this.next = this.next(packet, connection); - if (this.next) { - return false; - } - this.emit('end'); - return true; - - } -} - -module.exports = Command; diff --git a/node_modules/mysql2/lib/commands/execute.js b/node_modules/mysql2/lib/commands/execute.js deleted file mode 100644 index 8ab7304..0000000 --- a/node_modules/mysql2/lib/commands/execute.js +++ /dev/null @@ -1,107 +0,0 @@ -'use strict'; - -const Command = require('./command.js'); -const Query = require('./query.js'); -const Packets = require('../packets/index.js'); - -const getBinaryParser = require('../parsers/binary_parser.js'); - -class Execute extends Command { - constructor(options, callback) { - super(); - this.statement = options.statement; - this.sql = options.sql; - this.values = options.values; - this.onResult = callback; - this.parameters = options.values; - this.insertId = 0; - this.timeout = options.timeout; - this.queryTimeout = null; - this._rows = []; - this._fields = []; - this._result = []; - this._fieldCount = 0; - this._rowParser = null; - this._executeOptions = options; - this._resultIndex = 0; - this._localStream = null; - this._unpipeStream = function() {}; - this._streamFactory = options.infileStreamFactory; - this._connection = null; - } - - buildParserFromFields(fields, connection) { - return getBinaryParser(fields, this.options, connection.config); - } - - start(packet, connection) { - this._connection = connection; - this.options = Object.assign({}, connection.config, this._executeOptions); - this._setTimeout(); - const executePacket = new Packets.Execute( - this.statement.id, - this.parameters, - connection.config.charsetNumber, - connection.config.timezone - ); - //For reasons why this try-catch is here, please see - // https://github.com/sidorares/node-mysql2/pull/689 - //For additional discussion, see - // 1. https://github.com/sidorares/node-mysql2/issues/493 - // 2. https://github.com/sidorares/node-mysql2/issues/187 - // 3. https://github.com/sidorares/node-mysql2/issues/480 - try { - connection.writePacket(executePacket.toPacket(1)); - } catch (error) { - this.onResult(error); - } - return Execute.prototype.resultsetHeader; - } - - readField(packet, connection) { - let fields; - // disabling for now, but would be great to find reliable way to parse fields only once - // fields reported by prepare can be empty at all or just incorrect - see #169 - // - // perfomance optimisation: if we already have this field parsed in statement header, use one from header - // const field = this.statement.columns.length == this._fieldCount ? - // this.statement.columns[this._receivedFieldsCount] : new Packets.ColumnDefinition(packet); - const field = new Packets.ColumnDefinition( - packet, - connection.clientEncoding - ); - this._receivedFieldsCount++; - this._fields[this._resultIndex].push(field); - if (this._receivedFieldsCount === this._fieldCount) { - fields = this._fields[this._resultIndex]; - this.emit('fields', fields, this._resultIndex); - return Execute.prototype.fieldsEOF; - } - return Execute.prototype.readField; - } - - fieldsEOF(packet, connection) { - // check EOF - if (!packet.isEOF()) { - return connection.protocolError('Expected EOF packet'); - } - this._rowParser = new (this.buildParserFromFields( - this._fields[this._resultIndex], - connection - ))(); - return Execute.prototype.row; - } -} - -Execute.prototype.done = Query.prototype.done; -Execute.prototype.doneInsert = Query.prototype.doneInsert; -Execute.prototype.resultsetHeader = Query.prototype.resultsetHeader; -Execute.prototype._findOrCreateReadStream = - Query.prototype._findOrCreateReadStream; -Execute.prototype._streamLocalInfile = Query.prototype._streamLocalInfile; -Execute.prototype._setTimeout = Query.prototype._setTimeout; -Execute.prototype._handleTimeoutError = Query.prototype._handleTimeoutError; -Execute.prototype.row = Query.prototype.row; -Execute.prototype.stream = Query.prototype.stream; - -module.exports = Execute; diff --git a/node_modules/mysql2/lib/commands/index.js b/node_modules/mysql2/lib/commands/index.js deleted file mode 100644 index 74a32ae..0000000 --- a/node_modules/mysql2/lib/commands/index.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict'; - -const ClientHandshake = require('./client_handshake.js'); -const ServerHandshake = require('./server_handshake.js'); -const Query = require('./query.js'); -const Prepare = require('./prepare.js'); -const CloseStatement = require('./close_statement.js'); -const Execute = require('./execute.js'); -const Ping = require('./ping.js'); -const RegisterSlave = require('./register_slave.js'); -const BinlogDump = require('./binlog_dump.js'); -const ChangeUser = require('./change_user.js'); -const Quit = require('./quit.js'); - -module.exports = { - ClientHandshake, - ServerHandshake, - Query, - Prepare, - CloseStatement, - Execute, - Ping, - RegisterSlave, - BinlogDump, - ChangeUser, - Quit -}; diff --git a/node_modules/mysql2/lib/commands/ping.js b/node_modules/mysql2/lib/commands/ping.js deleted file mode 100644 index dc820ef..0000000 --- a/node_modules/mysql2/lib/commands/ping.js +++ /dev/null @@ -1,36 +0,0 @@ -'use strict'; - -const Command = require('./command'); -const CommandCode = require('../constants/commands'); -const Packet = require('../packets/packet'); - -// TODO: time statistics? -// usefull for queue size and network latency monitoring -// store created,sent,reply timestamps -class Ping extends Command { - constructor(callback) { - super(); - this.onResult = callback; - } - - start(packet, connection) { - const ping = new Packet( - 0, - Buffer.from([1, 0, 0, 0, CommandCode.PING]), - 0, - 5 - ); - connection.writePacket(ping); - return Ping.prototype.pingResponse; - } - - pingResponse() { - // TODO: check it's OK packet. error check already done in caller - if (this.onResult) { - process.nextTick(this.onResult.bind(this)); - } - return null; - } -} - -module.exports = Ping; diff --git a/node_modules/mysql2/lib/commands/prepare.js b/node_modules/mysql2/lib/commands/prepare.js deleted file mode 100644 index 03cb308..0000000 --- a/node_modules/mysql2/lib/commands/prepare.js +++ /dev/null @@ -1,143 +0,0 @@ -'use strict'; - -const Packets = require('../packets/index.js'); -const Command = require('./command.js'); -const CloseStatement = require('./close_statement.js'); -const Execute = require('./execute.js'); - -class PreparedStatementInfo { - constructor(query, id, columns, parameters, connection) { - this.query = query; - this.id = id; - this.columns = columns; - this.parameters = parameters; - this.rowParser = null; - this._connection = connection; - } - - close() { - return this._connection.addCommand(new CloseStatement(this.id)); - } - - execute(parameters, callback) { - if (typeof parameters === 'function') { - callback = parameters; - parameters = []; - } - return this._connection.addCommand( - new Execute({ statement: this, values: parameters }, callback) - ); - } -} - -class Prepare extends Command { - constructor(options, callback) { - super(); - this.query = options.sql; - this.onResult = callback; - this.id = 0; - this.fieldCount = 0; - this.parameterCount = 0; - this.fields = []; - this.parameterDefinitions = []; - this.options = options; - } - - start(packet, connection) { - const Connection = connection.constructor; - this.key = Connection.statementKey(this.options); - const statement = connection._statements.get(this.key); - if (statement) { - if (this.onResult) { - this.onResult(null, statement); - } - return null; - } - const cmdPacket = new Packets.PrepareStatement( - this.query, - connection.config.charsetNumber, - this.options.values - ); - connection.writePacket(cmdPacket.toPacket(1)); - return Prepare.prototype.prepareHeader; - } - - prepareHeader(packet, connection) { - const header = new Packets.PreparedStatementHeader(packet); - this.id = header.id; - this.fieldCount = header.fieldCount; - this.parameterCount = header.parameterCount; - if (this.parameterCount > 0) { - return Prepare.prototype.readParameter; - } if (this.fieldCount > 0) { - return Prepare.prototype.readField; - } - return this.prepareDone(connection); - } - - readParameter(packet, connection) { - // there might be scenarios when mysql server reports more parameters than - // are actually present in the array of parameter definitions. - // if EOF packet is received we switch to "read fields" state if there are - // any fields reported by the server, otherwise we finish the command. - if (packet.isEOF()) { - if (this.fieldCount > 0) { - return Prepare.prototype.readField; - } - return this.prepareDone(connection); - } - const def = new Packets.ColumnDefinition(packet, connection.clientEncoding); - this.parameterDefinitions.push(def); - if (this.parameterDefinitions.length === this.parameterCount) { - return Prepare.prototype.parametersEOF; - } - return this.readParameter; - } - - readField(packet, connection) { - if (packet.isEOF()) { - return this.prepareDone(connection); - } - const def = new Packets.ColumnDefinition(packet, connection.clientEncoding); - this.fields.push(def); - if (this.fields.length === this.fieldCount) { - return Prepare.prototype.fieldsEOF; - } - return Prepare.prototype.readField; - } - - parametersEOF(packet, connection) { - if (!packet.isEOF()) { - return connection.protocolError('Expected EOF packet after parameters'); - } - if (this.fieldCount > 0) { - return Prepare.prototype.readField; - } - return this.prepareDone(connection); - - } - - fieldsEOF(packet, connection) { - if (!packet.isEOF()) { - return connection.protocolError('Expected EOF packet after fields'); - } - return this.prepareDone(connection); - } - - prepareDone(connection) { - const statement = new PreparedStatementInfo( - this.query, - this.id, - this.fields, - this.parameterDefinitions, - connection - ); - connection._statements.set(this.key, statement); - if (this.onResult) { - this.onResult(null, statement); - } - return null; - } -} - -module.exports = Prepare; diff --git a/node_modules/mysql2/lib/commands/query.js b/node_modules/mysql2/lib/commands/query.js deleted file mode 100644 index 8d643bd..0000000 --- a/node_modules/mysql2/lib/commands/query.js +++ /dev/null @@ -1,321 +0,0 @@ -'use strict'; - -const process = require('process'); -const Timers = require('timers'); - -const Readable = require('stream').Readable; - -const Command = require('./command.js'); -const Packets = require('../packets/index.js'); -const getTextParser = require('../parsers/text_parser.js'); -const ServerStatus = require('../constants/server_status.js'); - -const EmptyPacket = new Packets.Packet(0, Buffer.allocUnsafe(4), 0, 4); - -// http://dev.mysql.com/doc/internals/en/com-query.html -class Query extends Command { - constructor(options, callback) { - super(); - this.sql = options.sql; - this.values = options.values; - this._queryOptions = options; - this.namedPlaceholders = options.namedPlaceholders || false; - this.onResult = callback; - this.timeout = options.timeout; - this.queryTimeout = null; - this._fieldCount = 0; - this._rowParser = null; - this._fields = []; - this._rows = []; - this._receivedFieldsCount = 0; - this._resultIndex = 0; - this._localStream = null; - this._unpipeStream = function() {}; - this._streamFactory = options.infileStreamFactory; - this._connection = null; - } - - then() { - const err = - "You have tried to call .then(), .catch(), or invoked await on the result of query that is not a promise, which is a programming error. Try calling con.promise().query(), or require('mysql2/promise') instead of 'mysql2' for a promise-compatible version of the query interface. To learn how to use async/await or Promises check out documentation at https://www.npmjs.com/package/mysql2#using-promise-wrapper, or the mysql2 documentation at https://github.com/sidorares/node-mysql2/tree/master/documentation/en/Promise-Wrapper.md"; - // eslint-disable-next-line - console.log(err); - throw new Error(err); - } - - /* eslint no-unused-vars: ["error", { "argsIgnorePattern": "^_" }] */ - start(_packet, connection) { - if (connection.config.debug) { - // eslint-disable-next-line - console.log(' Sending query command: %s', this.sql); - } - this._connection = connection; - this.options = Object.assign({}, connection.config, this._queryOptions); - this._setTimeout(); - - const cmdPacket = new Packets.Query( - this.sql, - connection.config.charsetNumber - ); - connection.writePacket(cmdPacket.toPacket(1)); - return Query.prototype.resultsetHeader; - } - - done() { - this._unpipeStream(); - // if all ready timeout, return null directly - if (this.timeout && !this.queryTimeout) { - return null; - } - // else clear timer - if (this.queryTimeout) { - Timers.clearTimeout(this.queryTimeout); - this.queryTimeout = null; - } - if (this.onResult) { - let rows, fields; - if (this._resultIndex === 0) { - rows = this._rows[0]; - fields = this._fields[0]; - } else { - rows = this._rows; - fields = this._fields; - } - if (fields) { - process.nextTick(() => { - this.onResult(null, rows, fields); - }); - } else { - process.nextTick(() => { - this.onResult(null, rows); - }); - } - } - return null; - } - - doneInsert(rs) { - if (this._localStreamError) { - if (this.onResult) { - this.onResult(this._localStreamError, rs); - } else { - this.emit('error', this._localStreamError); - } - return null; - } - this._rows.push(rs); - this._fields.push(void 0); - this.emit('fields', void 0); - this.emit('result', rs); - if (rs.serverStatus & ServerStatus.SERVER_MORE_RESULTS_EXISTS) { - this._resultIndex++; - return this.resultsetHeader; - } - return this.done(); - } - - resultsetHeader(packet, connection) { - const rs = new Packets.ResultSetHeader(packet, connection); - this._fieldCount = rs.fieldCount; - if (connection.config.debug) { - // eslint-disable-next-line - console.log( - ` Resultset header received, expecting ${rs.fieldCount} column definition packets` - ); - } - if (this._fieldCount === 0) { - return this.doneInsert(rs); - } - if (this._fieldCount === null) { - return this._streamLocalInfile(connection, rs.infileName); - } - this._receivedFieldsCount = 0; - this._rows.push([]); - this._fields.push([]); - return this.readField; - } - - _streamLocalInfile(connection, path) { - if (this._streamFactory) { - this._localStream = this._streamFactory(path); - } else { - this._localStreamError = new Error( - `As a result of LOCAL INFILE command server wants to read ${path} file, but as of v2.0 you must provide streamFactory option returning ReadStream.` - ); - connection.writePacket(EmptyPacket); - return this.infileOk; - } - - const onConnectionError = () => { - this._unpipeStream(); - }; - const onDrain = () => { - this._localStream.resume(); - }; - const onPause = () => { - this._localStream.pause(); - }; - const onData = function(data) { - const dataWithHeader = Buffer.allocUnsafe(data.length + 4); - data.copy(dataWithHeader, 4); - connection.writePacket( - new Packets.Packet(0, dataWithHeader, 0, dataWithHeader.length) - ); - }; - const onEnd = () => { - connection.removeListener('error', onConnectionError); - connection.writePacket(EmptyPacket); - }; - const onError = err => { - this._localStreamError = err; - connection.removeListener('error', onConnectionError); - connection.writePacket(EmptyPacket); - }; - this._unpipeStream = () => { - connection.stream.removeListener('pause', onPause); - connection.stream.removeListener('drain', onDrain); - this._localStream.removeListener('data', onData); - this._localStream.removeListener('end', onEnd); - this._localStream.removeListener('error', onError); - }; - connection.stream.on('pause', onPause); - connection.stream.on('drain', onDrain); - this._localStream.on('data', onData); - this._localStream.on('end', onEnd); - this._localStream.on('error', onError); - connection.once('error', onConnectionError); - return this.infileOk; - } - - readField(packet, connection) { - this._receivedFieldsCount++; - // Often there is much more data in the column definition than in the row itself - // If you set manually _fields[0] to array of ColumnDefinition's (from previous call) - // you can 'cache' result of parsing. Field packets still received, but ignored in that case - // this is the reason _receivedFieldsCount exist (otherwise we could just use current length of fields array) - if (this._fields[this._resultIndex].length !== this._fieldCount) { - const field = new Packets.ColumnDefinition( - packet, - connection.clientEncoding - ); - this._fields[this._resultIndex].push(field); - if (connection.config.debug) { - /* eslint-disable no-console */ - console.log(' Column definition:'); - console.log(` name: ${field.name}`); - console.log(` type: ${field.columnType}`); - console.log(` flags: ${field.flags}`); - /* eslint-enable no-console */ - } - } - // last field received - if (this._receivedFieldsCount === this._fieldCount) { - const fields = this._fields[this._resultIndex]; - this.emit('fields', fields); - this._rowParser = new (getTextParser(fields, this.options, connection.config))(fields); - return Query.prototype.fieldsEOF; - } - return Query.prototype.readField; - } - - fieldsEOF(packet, connection) { - // check EOF - if (!packet.isEOF()) { - return connection.protocolError('Expected EOF packet'); - } - return this.row; - } - - /* eslint no-unused-vars: ["error", { "argsIgnorePattern": "^_" }] */ - row(packet, _connection) { - if (packet.isEOF()) { - const status = packet.eofStatusFlags(); - const moreResults = status & ServerStatus.SERVER_MORE_RESULTS_EXISTS; - if (moreResults) { - this._resultIndex++; - return Query.prototype.resultsetHeader; - } - return this.done(); - } - let row; - try { - row = this._rowParser.next( - packet, - this._fields[this._resultIndex], - this.options - ); - } catch (err) { - this._localStreamError = err; - return this.doneInsert(null); - } - if (this.onResult) { - this._rows[this._resultIndex].push(row); - } else { - this.emit('result', row); - } - return Query.prototype.row; - } - - infileOk(packet, connection) { - const rs = new Packets.ResultSetHeader(packet, connection); - return this.doneInsert(rs); - } - - stream(options) { - options = options || {}; - options.objectMode = true; - const stream = new Readable(options); - stream._read = () => { - this._connection && this._connection.resume(); - }; - this.on('result', row => { - if (!stream.push(row)) { - this._connection.pause(); - } - stream.emit('result', row); // replicate old emitter - }); - this.on('error', err => { - stream.emit('error', err); // Pass on any errors - }); - this.on('end', () => { - stream.push(null); // pushing null, indicating EOF - stream.emit('close'); // notify readers that query has completed - }); - this.on('fields', fields => { - stream.emit('fields', fields); // replicate old emitter - }); - return stream; - } - - _setTimeout() { - if (this.timeout) { - const timeoutHandler = this._handleTimeoutError.bind(this); - this.queryTimeout = Timers.setTimeout( - timeoutHandler, - this.timeout - ); - } - } - - _handleTimeoutError() { - if (this.queryTimeout) { - Timers.clearTimeout(this.queryTimeout); - this.queryTimeout = null; - } - - const err = new Error('Query inactivity timeout'); - err.errorno = 'PROTOCOL_SEQUENCE_TIMEOUT'; - err.code = 'PROTOCOL_SEQUENCE_TIMEOUT'; - err.syscall = 'query'; - - if (this.onResult) { - this.onResult(err); - } else { - this.emit('error', err); - } - } -} - -Query.prototype.catch = Query.prototype.then; - -module.exports = Query; diff --git a/node_modules/mysql2/lib/commands/quit.js b/node_modules/mysql2/lib/commands/quit.js deleted file mode 100644 index 02ed763..0000000 --- a/node_modules/mysql2/lib/commands/quit.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict'; - -const Command = require('./command.js'); -const CommandCode = require('../constants/commands.js'); -const Packet = require('../packets/packet.js'); - -class Quit extends Command { - constructor(callback) { - super(); - this.onResult = callback; - } - - start(packet, connection) { - connection._closing = true; - const quit = new Packet( - 0, - Buffer.from([1, 0, 0, 0, CommandCode.QUIT]), - 0, - 5 - ); - if (this.onResult) { - this.onResult(); - } - connection.writePacket(quit); - return null; - } -} - -module.exports = Quit; diff --git a/node_modules/mysql2/lib/commands/register_slave.js b/node_modules/mysql2/lib/commands/register_slave.js deleted file mode 100644 index 4ebfe61..0000000 --- a/node_modules/mysql2/lib/commands/register_slave.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict'; - -const Command = require('./command'); -const Packets = require('../packets'); - -class RegisterSlave extends Command { - constructor(opts, callback) { - super(); - this.onResult = callback; - this.opts = opts; - } - - start(packet, connection) { - const newPacket = new Packets.RegisterSlave(this.opts); - connection.writePacket(newPacket.toPacket(1)); - return RegisterSlave.prototype.registerResponse; - } - - registerResponse() { - if (this.onResult) { - process.nextTick(this.onResult.bind(this)); - } - return null; - } -} - -module.exports = RegisterSlave; diff --git a/node_modules/mysql2/lib/commands/server_handshake.js b/node_modules/mysql2/lib/commands/server_handshake.js deleted file mode 100644 index d93462e..0000000 --- a/node_modules/mysql2/lib/commands/server_handshake.js +++ /dev/null @@ -1,197 +0,0 @@ -'use strict'; - -const CommandCode = require('../constants/commands.js'); -const Errors = require('../constants/errors.js'); - -const Command = require('./command.js'); -const Packets = require('../packets/index.js'); - -class ServerHandshake extends Command { - constructor(args) { - super(); - this.args = args; - /* - this.protocolVersion = args.protocolVersion || 10; - this.serverVersion = args.serverVersion; - this.connectionId = args.connectionId, - this.statusFlags = args.statusFlags, - this.characterSet = args.characterSet, - this.capabilityFlags = args.capabilityFlags || 512; - */ - } - - start(packet, connection) { - const serverHelloPacket = new Packets.Handshake(this.args); - this.serverHello = serverHelloPacket; - serverHelloPacket.setScrambleData(err => { - if (err) { - connection.emit('error', new Error('Error generating random bytes')); - return; - } - connection.writePacket(serverHelloPacket.toPacket(0)); - }); - return ServerHandshake.prototype.readClientReply; - } - - readClientReply(packet, connection) { - // check auth here - const clientHelloReply = Packets.HandshakeResponse.fromPacket(packet); - // TODO check we don't have something similar already - connection.clientHelloReply = clientHelloReply; - if (this.args.authCallback) { - this.args.authCallback( - { - user: clientHelloReply.user, - database: clientHelloReply.database, - address: connection.stream.remoteAddress, - authPluginData1: this.serverHello.authPluginData1, - authPluginData2: this.serverHello.authPluginData2, - authToken: clientHelloReply.authToken - }, - (err, mysqlError) => { - // if (err) - if (!mysqlError) { - connection.writeOk(); - } else { - // TODO create constants / errorToCode - // 1045 = ER_ACCESS_DENIED_ERROR - connection.writeError({ - message: mysqlError.message || '', - code: mysqlError.code || 1045 - }); - connection.close(); - } - } - ); - } else { - connection.writeOk(); - } - return ServerHandshake.prototype.dispatchCommands; - } - - _isStatement(query, name) { - const firstWord = query.split(' ')[0].toUpperCase(); - return firstWord === name; - } - - dispatchCommands(packet, connection) { - // command from client to server - let knownCommand = true; - const encoding = connection.clientHelloReply.encoding; - const commandCode = packet.readInt8(); - switch (commandCode) { - case CommandCode.STMT_PREPARE: - if (connection.listeners('stmt_prepare').length) { - const query = packet.readString(undefined, encoding); - connection.emit('stmt_prepare', query); - } else { - connection.writeError({ - code: Errors.HA_ERR_INTERNAL_ERROR, - message: - 'No query handler for prepared statements.' - }); - } - break; - case CommandCode.STMT_EXECUTE: - if (connection.listeners('stmt_execute').length) { - const { stmtId, flags, iterationCount, values } = Packets.Execute.fromPacket(packet, encoding); - connection.emit('stmt_execute', stmtId, flags, iterationCount, values); - } else { - connection.writeError({ - code: Errors.HA_ERR_INTERNAL_ERROR, - message: - 'No query handler for execute statements.' - }); - } - break; - case CommandCode.QUIT: - if (connection.listeners('quit').length) { - connection.emit('quit'); - } else { - connection.stream.end(); - } - break; - case CommandCode.INIT_DB: - if (connection.listeners('init_db').length) { - const schemaName = packet.readString(undefined, encoding); - connection.emit('init_db', schemaName); - } else { - connection.writeOk(); - } - break; - case CommandCode.QUERY: - if (connection.listeners('query').length) { - const query = packet.readString(undefined, encoding); - if (this._isStatement(query, 'PREPARE') || this._isStatement(query, 'SET')) { - connection.emit('stmt_prepare', query); - } - else if (this._isStatement(query, 'EXECUTE')) { - connection.emit('stmt_execute', null, null, null, null, query); - } - else connection.emit('query', query); - } else { - connection.writeError({ - code: Errors.HA_ERR_INTERNAL_ERROR, - message: 'No query handler' - }); - } - break; - case CommandCode.FIELD_LIST: - if (connection.listeners('field_list').length) { - const table = packet.readNullTerminatedString(encoding); - const fields = packet.readString(undefined, encoding); - connection.emit('field_list', table, fields); - } else { - connection.writeError({ - code: Errors.ER_WARN_DEPRECATED_SYNTAX, - message: - 'As of MySQL 5.7.11, COM_FIELD_LIST is deprecated and will be removed in a future version of MySQL.' - }); - } - break; - case CommandCode.PING: - if (connection.listeners('ping').length) { - connection.emit('ping'); - } else { - connection.writeOk(); - } - break; - default: - knownCommand = false; - } - if (connection.listeners('packet').length) { - connection.emit('packet', packet.clone(), knownCommand, commandCode); - } else if (!knownCommand) { - // eslint-disable-next-line no-console - console.log('Unknown command:', commandCode); - } - return ServerHandshake.prototype.dispatchCommands; - } -} - -module.exports = ServerHandshake; - -// TODO: implement server-side 4.1 authentication -/* -4.1 authentication: (http://bazaar.launchpad.net/~mysql/mysql-server/5.5/view/head:/sql/password.c) - - SERVER: public_seed=create_random_string() - send(public_seed) - - CLIENT: recv(public_seed) - hash_stage1=sha1("password") - hash_stage2=sha1(hash_stage1) - reply=xor(hash_stage1, sha1(public_seed,hash_stage2) - - // this three steps are done in scramble() - - send(reply) - - - SERVER: recv(reply) - hash_stage1=xor(reply, sha1(public_seed,hash_stage2)) - candidate_hash2=sha1(hash_stage1) - check(candidate_hash2==hash_stage2) - -server stores sha1(sha1(password)) ( hash_stag2) -*/ diff --git a/node_modules/mysql2/lib/compressed_protocol.js b/node_modules/mysql2/lib/compressed_protocol.js deleted file mode 100644 index 67a7c39..0000000 --- a/node_modules/mysql2/lib/compressed_protocol.js +++ /dev/null @@ -1,127 +0,0 @@ -'use strict'; - -// connection mixins -// implementation of http://dev.mysql.com/doc/internals/en/compression.html - -const zlib = require('zlib'); -const PacketParser = require('./packet_parser.js'); - -function handleCompressedPacket(packet) { - // eslint-disable-next-line consistent-this, no-invalid-this - const connection = this; - const deflatedLength = packet.readInt24(); - const body = packet.readBuffer(); - - if (deflatedLength !== 0) { - connection.inflateQueue.push(task => { - zlib.inflate(body, (err, data) => { - if (err) { - connection._handleNetworkError(err); - return; - } - connection._bumpCompressedSequenceId(packet.numPackets); - connection._inflatedPacketsParser.execute(data); - task.done(); - }); - }); - } else { - connection.inflateQueue.push(task => { - connection._bumpCompressedSequenceId(packet.numPackets); - connection._inflatedPacketsParser.execute(body); - task.done(); - }); - } -} - -function writeCompressed(buffer) { - // http://dev.mysql.com/doc/internals/en/example-several-mysql-packets.html - // note: sending a MySQL Packet of the size 2^24−5 to 2^24−1 via compression - // leads to at least one extra compressed packet. - // (this is because "length of the packet before compression" need to fit - // into 3 byte unsigned int. "length of the packet before compression" includes - // 4 byte packet header, hence 2^24−5) - const MAX_COMPRESSED_LENGTH = 16777210; - let start; - if (buffer.length > MAX_COMPRESSED_LENGTH) { - for (start = 0; start < buffer.length; start += MAX_COMPRESSED_LENGTH) { - writeCompressed.call( - // eslint-disable-next-line no-invalid-this - this, - buffer.slice(start, start + MAX_COMPRESSED_LENGTH) - ); - } - return; - } - - // eslint-disable-next-line no-invalid-this, consistent-this - const connection = this; - - let packetLen = buffer.length; - const compressHeader = Buffer.allocUnsafe(7); - - // seqqueue is used here because zlib async execution is routed via thread pool - // internally and when we have multiple compressed packets arriving we need - // to assemble uncompressed result sequentially - (function(seqId) { - connection.deflateQueue.push(task => { - zlib.deflate(buffer, (err, compressed) => { - if (err) { - connection._handleFatalError(err); - return; - } - let compressedLength = compressed.length; - - if (compressedLength < packetLen) { - compressHeader.writeUInt8(compressedLength & 0xff, 0); - compressHeader.writeUInt16LE(compressedLength >> 8, 1); - compressHeader.writeUInt8(seqId, 3); - compressHeader.writeUInt8(packetLen & 0xff, 4); - compressHeader.writeUInt16LE(packetLen >> 8, 5); - connection.writeUncompressed(compressHeader); - connection.writeUncompressed(compressed); - } else { - // http://dev.mysql.com/doc/internals/en/uncompressed-payload.html - // To send an uncompressed payload: - // - set length of payload before compression to 0 - // - the compressed payload contains the uncompressed payload instead. - compressedLength = packetLen; - packetLen = 0; - compressHeader.writeUInt8(compressedLength & 0xff, 0); - compressHeader.writeUInt16LE(compressedLength >> 8, 1); - compressHeader.writeUInt8(seqId, 3); - compressHeader.writeUInt8(packetLen & 0xff, 4); - compressHeader.writeUInt16LE(packetLen >> 8, 5); - connection.writeUncompressed(compressHeader); - connection.writeUncompressed(buffer); - } - task.done(); - }); - }); - })(connection.compressedSequenceId); - connection._bumpCompressedSequenceId(1); -} - -function enableCompression(connection) { - connection._lastWrittenPacketId = 0; - connection._lastReceivedPacketId = 0; - - connection._handleCompressedPacket = handleCompressedPacket; - connection._inflatedPacketsParser = new PacketParser(p => { - connection.handlePacket(p); - }, 4); - connection._inflatedPacketsParser._lastPacket = 0; - connection.packetParser = new PacketParser(packet => { - connection._handleCompressedPacket(packet); - }, 7); - - connection.writeUncompressed = connection.write; - connection.write = writeCompressed; - - const seqqueue = require('seq-queue'); - connection.inflateQueue = seqqueue.createQueue(); - connection.deflateQueue = seqqueue.createQueue(); -} - -module.exports = { - enableCompression: enableCompression -}; diff --git a/node_modules/mysql2/lib/connection.js b/node_modules/mysql2/lib/connection.js deleted file mode 100644 index dcd841c..0000000 --- a/node_modules/mysql2/lib/connection.js +++ /dev/null @@ -1,945 +0,0 @@ -// This file was modified by Oracle on June 1, 2021. -// The changes involve new logic to handle an additional ERR Packet sent by -// the MySQL server when the connection is closed unexpectedly. -// Modifications copyright (c) 2021, Oracle and/or its affiliates. - -// This file was modified by Oracle on June 17, 2021. -// The changes involve logic to ensure the socket connection is closed when -// there is a fatal error. -// Modifications copyright (c) 2021, Oracle and/or its affiliates. - -// This file was modified by Oracle on September 21, 2021. -// The changes involve passing additional authentication factor passwords -// to the ChangeUser Command instance. -// Modifications copyright (c) 2021, Oracle and/or its affiliates. - -'use strict'; - -const Net = require('net'); -const Tls = require('tls'); -const Timers = require('timers'); -const EventEmitter = require('events').EventEmitter; -const Readable = require('stream').Readable; -const Queue = require('denque'); -const SqlString = require('sqlstring'); -const LRU = require('lru-cache').default; - -const PacketParser = require('./packet_parser.js'); -const Packets = require('./packets/index.js'); -const Commands = require('./commands/index.js'); -const ConnectionConfig = require('./connection_config.js'); -const CharsetToEncoding = require('./constants/charset_encodings.js'); - -let _connectionId = 0; - -let convertNamedPlaceholders = null; - -class Connection extends EventEmitter { - constructor(opts) { - super(); - this.config = opts.config; - // TODO: fill defaults - // if no params, connect to /var/lib/mysql/mysql.sock ( /tmp/mysql.sock on OSX ) - // if host is given, connect to host:3306 - // TODO: use `/usr/local/mysql/bin/mysql_config --socket` output? as default socketPath - // if there is no host/port and no socketPath parameters? - if (!opts.config.stream) { - if (opts.config.socketPath) { - this.stream = Net.connect(opts.config.socketPath); - } else { - this.stream = Net.connect( - opts.config.port, - opts.config.host - ); - - // Optionally enable keep-alive on the socket. - if (this.config.enableKeepAlive) { - this.stream.on('connect', () => { - this.stream.setKeepAlive(true, this.config.keepAliveInitialDelay); - }); - } - - // Enable TCP_NODELAY flag. This is needed so that the network packets - // are sent immediately to the server - this.stream.setNoDelay(true); - } - // if stream is a function, treat it as "stream agent / factory" - } else if (typeof opts.config.stream === 'function') { - this.stream = opts.config.stream(opts); - } else { - this.stream = opts.config.stream; - } - - this._internalId = _connectionId++; - this._commands = new Queue(); - this._command = null; - this._paused = false; - this._paused_packets = new Queue(); - this._statements = new LRU({ - max: this.config.maxPreparedStatements, - dispose: function(statement) { - statement.close(); - } - }); - this.serverCapabilityFlags = 0; - this.authorized = false; - this.sequenceId = 0; - this.compressedSequenceId = 0; - this.threadId = null; - this._handshakePacket = null; - this._fatalError = null; - this._protocolError = null; - this._outOfOrderPackets = []; - this.clientEncoding = CharsetToEncoding[this.config.charsetNumber]; - this.stream.on('error', this._handleNetworkError.bind(this)); - // see https://gist.github.com/khoomeister/4985691#use-that-instead-of-bind - this.packetParser = new PacketParser(p => { - this.handlePacket(p); - }); - this.stream.on('data', data => { - if (this.connectTimeout) { - Timers.clearTimeout(this.connectTimeout); - this.connectTimeout = null; - } - this.packetParser.execute(data); - }); - this.stream.on('end', () => { - // emit the end event so that the pooled connection can close the connection - this.emit('end'); - }); - this.stream.on('close', () => { - // we need to set this flag everywhere where we want connection to close - if (this._closing) { - return; - } - if (!this._protocolError) { - // no particular error message before disconnect - this._protocolError = new Error( - 'Connection lost: The server closed the connection.' - ); - this._protocolError.fatal = true; - this._protocolError.code = 'PROTOCOL_CONNECTION_LOST'; - } - this._notifyError(this._protocolError); - }); - let handshakeCommand; - if (!this.config.isServer) { - handshakeCommand = new Commands.ClientHandshake(this.config.clientFlags); - handshakeCommand.on('end', () => { - // this happens when handshake finishes early either because there was - // some fatal error or the server sent an error packet instead of - // an hello packet (for example, 'Too many connections' error) - if (!handshakeCommand.handshake || this._fatalError || this._protocolError) { - return; - } - this._handshakePacket = handshakeCommand.handshake; - this.threadId = handshakeCommand.handshake.connectionId; - this.emit('connect', handshakeCommand.handshake); - }); - handshakeCommand.on('error', err => { - this._closing = true; - this._notifyError(err); - }); - this.addCommand(handshakeCommand); - } - // in case there was no initial handshake but we need to read sting, assume it utf-8 - // most common example: "Too many connections" error ( packet is sent immediately on connection attempt, we don't know server encoding yet) - // will be overwritten with actual encoding value as soon as server handshake packet is received - this.serverEncoding = 'utf8'; - if (this.config.connectTimeout) { - const timeoutHandler = this._handleTimeoutError.bind(this); - this.connectTimeout = Timers.setTimeout( - timeoutHandler, - this.config.connectTimeout - ); - } - } - - promise(promiseImpl) { - const PromiseConnection = require('../promise').PromiseConnection; - return new PromiseConnection(this, promiseImpl); - } - - _addCommandClosedState(cmd) { - const err = new Error( - "Can't add new command when connection is in closed state" - ); - err.fatal = true; - if (cmd.onResult) { - cmd.onResult(err); - } else { - this.emit('error', err); - } - } - - _handleFatalError(err) { - err.fatal = true; - // stop receiving packets - this.stream.removeAllListeners('data'); - this.addCommand = this._addCommandClosedState; - this.write = () => { - this.emit('error', new Error("Can't write in closed state")); - }; - this._notifyError(err); - this._fatalError = err; - } - - _handleNetworkError(err) { - if (this.connectTimeout) { - Timers.clearTimeout(this.connectTimeout); - this.connectTimeout = null; - } - // Do not throw an error when a connection ends with a RST,ACK packet - if (err.code === 'ECONNRESET' && this._closing) { - return; - } - this._handleFatalError(err); - } - - _handleTimeoutError() { - if (this.connectTimeout) { - Timers.clearTimeout(this.connectTimeout); - this.connectTimeout = null; - } - this.stream.destroy && this.stream.destroy(); - const err = new Error('connect ETIMEDOUT'); - err.errorno = 'ETIMEDOUT'; - err.code = 'ETIMEDOUT'; - err.syscall = 'connect'; - this._handleNetworkError(err); - } - - // notify all commands in the queue and bubble error as connection "error" - // called on stream error or unexpected termination - _notifyError(err) { - if (this.connectTimeout) { - Timers.clearTimeout(this.connectTimeout); - this.connectTimeout = null; - } - // prevent from emitting 'PROTOCOL_CONNECTION_LOST' after EPIPE or ECONNRESET - if (this._fatalError) { - return; - } - let command; - // if there is no active command, notify connection - // if there are commands and all of them have callbacks, pass error via callback - let bubbleErrorToConnection = !this._command; - if (this._command && this._command.onResult) { - this._command.onResult(err); - this._command = null; - // connection handshake is special because we allow it to be implicit - // if error happened during handshake, but there are others commands in queue - // then bubble error to other commands and not to connection - } else if ( - !( - this._command && - this._command.constructor === Commands.ClientHandshake && - this._commands.length > 0 - ) - ) { - bubbleErrorToConnection = true; - } - while ((command = this._commands.shift())) { - if (command.onResult) { - command.onResult(err); - } else { - bubbleErrorToConnection = true; - } - } - // notify connection if some comands in the queue did not have callbacks - // or if this is pool connection ( so it can be removed from pool ) - if (bubbleErrorToConnection || this._pool) { - this.emit('error', err); - } - // close connection after emitting the event in case of a fatal error - if (err.fatal) { - this.close(); - } - } - - write(buffer) { - const result = this.stream.write(buffer, err => { - if (err) { - this._handleNetworkError(err); - } - }); - - if (!result) { - this.stream.emit('pause'); - } - } - - // http://dev.mysql.com/doc/internals/en/sequence-id.html - // - // The sequence-id is incremented with each packet and may wrap around. - // It starts at 0 and is reset to 0 when a new command - // begins in the Command Phase. - // http://dev.mysql.com/doc/internals/en/example-several-mysql-packets.html - _resetSequenceId() { - this.sequenceId = 0; - this.compressedSequenceId = 0; - } - - _bumpCompressedSequenceId(numPackets) { - this.compressedSequenceId += numPackets; - this.compressedSequenceId %= 256; - } - - _bumpSequenceId(numPackets) { - this.sequenceId += numPackets; - this.sequenceId %= 256; - } - - writePacket(packet) { - const MAX_PACKET_LENGTH = 16777215; - const length = packet.length(); - let chunk, offset, header; - if (length < MAX_PACKET_LENGTH) { - packet.writeHeader(this.sequenceId); - if (this.config.debug) { - // eslint-disable-next-line no-console - console.log( - `${this._internalId} ${this.connectionId} <== ${this._command._commandName}#${this._command.stateName()}(${[this.sequenceId, packet._name, packet.length()].join(',')})` - ); - // eslint-disable-next-line no-console - console.log( - `${this._internalId} ${this.connectionId} <== ${packet.buffer.toString('hex')}` - ); - } - this._bumpSequenceId(1); - this.write(packet.buffer); - } else { - if (this.config.debug) { - // eslint-disable-next-line no-console - console.log( - `${this._internalId} ${this.connectionId} <== Writing large packet, raw content not written:` - ); - // eslint-disable-next-line no-console - console.log( - `${this._internalId} ${this.connectionId} <== ${this._command._commandName}#${this._command.stateName()}(${[this.sequenceId, packet._name, packet.length()].join(',')})` - ); - } - for (offset = 4; offset < 4 + length; offset += MAX_PACKET_LENGTH) { - chunk = packet.buffer.slice(offset, offset + MAX_PACKET_LENGTH); - if (chunk.length === MAX_PACKET_LENGTH) { - header = Buffer.from([0xff, 0xff, 0xff, this.sequenceId]); - } else { - header = Buffer.from([ - chunk.length & 0xff, - (chunk.length >> 8) & 0xff, - (chunk.length >> 16) & 0xff, - this.sequenceId - ]); - } - this._bumpSequenceId(1); - this.write(header); - this.write(chunk); - } - } - } - - // 0.11+ environment - startTLS(onSecure) { - if (this.config.debug) { - // eslint-disable-next-line no-console - console.log('Upgrading connection to TLS'); - } - const secureContext = Tls.createSecureContext({ - ca: this.config.ssl.ca, - cert: this.config.ssl.cert, - ciphers: this.config.ssl.ciphers, - key: this.config.ssl.key, - passphrase: this.config.ssl.passphrase, - minVersion: this.config.ssl.minVersion, - maxVersion: this.config.ssl.maxVersion - }); - const rejectUnauthorized = this.config.ssl.rejectUnauthorized; - const verifyIdentity = this.config.ssl.verifyIdentity; - const servername = this.config.host; - - let secureEstablished = false; - this.stream.removeAllListeners('data'); - const secureSocket = Tls.connect({ - rejectUnauthorized, - requestCert: rejectUnauthorized, - secureContext, - isServer: false, - socket: this.stream, - servername - }, () => { - secureEstablished = true; - if (rejectUnauthorized) { - if (typeof servername === 'string' && verifyIdentity) { - const cert = secureSocket.getPeerCertificate(true); - const serverIdentityCheckError = Tls.checkServerIdentity(servername, cert); - if (serverIdentityCheckError) { - onSecure(serverIdentityCheckError); - return; - } - } - } - onSecure(); - }); - // error handler for secure socket - secureSocket.on('error', err => { - if (secureEstablished) { - this._handleNetworkError(err); - } else { - onSecure(err); - } - }); - secureSocket.on('data', data => { - this.packetParser.execute(data); - }); - this.write = buffer => secureSocket.write(buffer); - } - - protocolError(message, code) { - // Starting with MySQL 8.0.24, if the client closes the connection - // unexpectedly, the server will send a last ERR Packet, which we can - // safely ignore. - // https://dev.mysql.com/worklog/task/?id=12999 - if (this._closing) { - return; - } - - const err = new Error(message); - err.fatal = true; - err.code = code || 'PROTOCOL_ERROR'; - this.emit('error', err); - } - - get fatalError() { - return this._fatalError; - } - - handlePacket(packet) { - if (this._paused) { - this._paused_packets.push(packet); - return; - } - if (this.config.debug) { - if (packet) { - // eslint-disable-next-line no-console - console.log( - ` raw: ${packet.buffer - .slice(packet.offset, packet.offset + packet.length()) - .toString('hex')}` - ); - // eslint-disable-next-line no-console - console.trace(); - const commandName = this._command - ? this._command._commandName - : '(no command)'; - const stateName = this._command - ? this._command.stateName() - : '(no command)'; - // eslint-disable-next-line no-console - console.log( - `${this._internalId} ${this.connectionId} ==> ${commandName}#${stateName}(${[packet.sequenceId, packet.type(), packet.length()].join(',')})` - ); - } - } - if (!this._command) { - const marker = packet.peekByte(); - // If it's an Err Packet, we should use it. - if (marker === 0xff) { - const error = Packets.Error.fromPacket(packet); - this.protocolError(error.message, error.code); - } else { - // Otherwise, it means it's some other unexpected packet. - this.protocolError( - 'Unexpected packet while no commands in the queue', - 'PROTOCOL_UNEXPECTED_PACKET' - ); - } - this.close(); - return; - } - if (packet) { - // Note: when server closes connection due to inactivity, Err packet ER_CLIENT_INTERACTION_TIMEOUT from MySQL 8.0.24, sequenceId will be 0 - if (this.sequenceId !== packet.sequenceId) { - const err = new Error( - `Warning: got packets out of order. Expected ${this.sequenceId} but received ${packet.sequenceId}` - ); - err.expected = this.sequenceId; - err.received = packet.sequenceId; - this.emit('warn', err); // REVIEW - // eslint-disable-next-line no-console - console.error(err.message); - } - this._bumpSequenceId(packet.numPackets); - } - try { - if (this._fatalError) { - // skip remaining packets after client is in the error state - return; - } - const done = this._command.execute(packet, this); - if (done) { - this._command = this._commands.shift(); - if (this._command) { - this.sequenceId = 0; - this.compressedSequenceId = 0; - this.handlePacket(); - } - } - } catch (err) { - this._handleFatalError(err); - this.stream.destroy(); - } - } - - addCommand(cmd) { - // this.compressedSequenceId = 0; - // this.sequenceId = 0; - if (this.config.debug) { - const commandName = cmd.constructor.name; - // eslint-disable-next-line no-console - console.log(`Add command: ${commandName}`); - cmd._commandName = commandName; - } - if (!this._command) { - this._command = cmd; - this.handlePacket(); - } else { - this._commands.push(cmd); - } - return cmd; - } - - format(sql, values) { - if (typeof this.config.queryFormat === 'function') { - return this.config.queryFormat.call( - this, - sql, - values, - this.config.timezone - ); - } - const opts = { - sql: sql, - values: values - }; - this._resolveNamedPlaceholders(opts); - return SqlString.format( - opts.sql, - opts.values, - this.config.stringifyObjects, - this.config.timezone - ); - } - - escape(value) { - return SqlString.escape(value, false, this.config.timezone); - } - - escapeId(value) { - return SqlString.escapeId(value, false); - } - - raw(sql) { - return SqlString.raw(sql); - } - - _resolveNamedPlaceholders(options) { - let unnamed; - if (this.config.namedPlaceholders || options.namedPlaceholders) { - if (Array.isArray(options.values)) { - // if an array is provided as the values, assume the conversion is not necessary. - // this allows the usage of unnamed placeholders even if the namedPlaceholders flag is enabled. - return - } - if (convertNamedPlaceholders === null) { - convertNamedPlaceholders = require('named-placeholders')(); - } - unnamed = convertNamedPlaceholders(options.sql, options.values); - options.sql = unnamed[0]; - options.values = unnamed[1]; - } - } - - query(sql, values, cb) { - let cmdQuery; - if (sql.constructor === Commands.Query) { - cmdQuery = sql; - } else { - cmdQuery = Connection.createQuery(sql, values, cb, this.config); - } - this._resolveNamedPlaceholders(cmdQuery); - const rawSql = this.format(cmdQuery.sql, cmdQuery.values !== undefined ? cmdQuery.values : []); - cmdQuery.sql = rawSql; - return this.addCommand(cmdQuery); - } - - pause() { - this._paused = true; - this.stream.pause(); - } - - resume() { - let packet; - this._paused = false; - while ((packet = this._paused_packets.shift())) { - this.handlePacket(packet); - // don't resume if packet handler paused connection - if (this._paused) { - return; - } - } - this.stream.resume(); - } - - // TODO: named placeholders support - prepare(options, cb) { - if (typeof options === 'string') { - options = { sql: options }; - } - return this.addCommand(new Commands.Prepare(options, cb)); - } - - unprepare(sql) { - let options = {}; - if (typeof sql === 'object') { - options = sql; - } else { - options.sql = sql; - } - const key = Connection.statementKey(options); - const stmt = this._statements.get(key); - if (stmt) { - this._statements.delete(key); - stmt.close(); - } - return stmt; - } - - execute(sql, values, cb) { - let options = { - infileStreamFactory: this.config.infileStreamFactory - }; - if (typeof sql === 'object') { - // execute(options, cb) - options = { - ...options, - ...sql, - sql: sql.sql, - values: sql.values - }; - if (typeof values === 'function') { - cb = values; - } else { - options.values = options.values || values; - } - } else if (typeof values === 'function') { - // execute(sql, cb) - cb = values; - options.sql = sql; - options.values = undefined; - } else { - // execute(sql, values, cb) - options.sql = sql; - options.values = values; - } - this._resolveNamedPlaceholders(options); - // check for values containing undefined - if (options.values) { - //If namedPlaceholder is not enabled and object is passed as bind parameters - if (!Array.isArray(options.values)) { - throw new TypeError( - 'Bind parameters must be array if namedPlaceholders parameter is not enabled' - ); - } - options.values.forEach(val => { - //If namedPlaceholder is not enabled and object is passed as bind parameters - if (!Array.isArray(options.values)) { - throw new TypeError( - 'Bind parameters must be array if namedPlaceholders parameter is not enabled' - ); - } - if (val === undefined) { - throw new TypeError( - 'Bind parameters must not contain undefined. To pass SQL NULL specify JS null' - ); - } - if (typeof val === 'function') { - throw new TypeError( - 'Bind parameters must not contain function(s). To pass the body of a function as a string call .toString() first' - ); - } - }); - } - const executeCommand = new Commands.Execute(options, cb); - const prepareCommand = new Commands.Prepare(options, (err, stmt) => { - if (err) { - // skip execute command if prepare failed, we have main - // combined callback here - executeCommand.start = function() { - return null; - }; - if (cb) { - cb(err); - } else { - executeCommand.emit('error', err); - } - executeCommand.emit('end'); - return; - } - executeCommand.statement = stmt; - }); - this.addCommand(prepareCommand); - this.addCommand(executeCommand); - return executeCommand; - } - - changeUser(options, callback) { - if (!callback && typeof options === 'function') { - callback = options; - options = {}; - } - const charsetNumber = options.charset - ? ConnectionConfig.getCharsetNumber(options.charset) - : this.config.charsetNumber; - return this.addCommand( - new Commands.ChangeUser( - { - user: options.user || this.config.user, - // for the purpose of multi-factor authentication, or not, the main - // password (used for the 1st authentication factor) can also be - // provided via the "password1" option - password: options.password || options.password1 || this.config.password || this.config.password1, - password2: options.password2 || this.config.password2, - password3: options.password3 || this.config.password3, - passwordSha1: options.passwordSha1 || this.config.passwordSha1, - database: options.database || this.config.database, - timeout: options.timeout, - charsetNumber: charsetNumber, - currentConfig: this.config - }, - err => { - if (err) { - err.fatal = true; - } - if (callback) { - callback(err); - } - } - ) - ); - } - - // transaction helpers - beginTransaction(cb) { - return this.query('START TRANSACTION', cb); - } - - commit(cb) { - return this.query('COMMIT', cb); - } - - rollback(cb) { - return this.query('ROLLBACK', cb); - } - - ping(cb) { - return this.addCommand(new Commands.Ping(cb)); - } - - _registerSlave(opts, cb) { - return this.addCommand(new Commands.RegisterSlave(opts, cb)); - } - - _binlogDump(opts, cb) { - return this.addCommand(new Commands.BinlogDump(opts, cb)); - } - - // currently just alias to close - destroy() { - this.close(); - } - - close() { - if (this.connectTimeout) { - Timers.clearTimeout(this.connectTimeout); - this.connectTimeout = null; - } - this._closing = true; - this.stream.end(); - this.addCommand = this._addCommandClosedState; - } - - createBinlogStream(opts) { - // TODO: create proper stream class - // TODO: use through2 - let test = 1; - const stream = new Readable({ objectMode: true }); - stream._read = function() { - return { - data: test++ - }; - }; - this._registerSlave(opts, () => { - const dumpCmd = this._binlogDump(opts); - dumpCmd.on('event', ev => { - stream.push(ev); - }); - dumpCmd.on('eof', () => { - stream.push(null); - // if non-blocking, then close stream to prevent errors - if (opts.flags && opts.flags & 0x01) { - this.close(); - } - }); - // TODO: pipe errors as well - }); - return stream; - } - - connect(cb) { - if (!cb) { - return; - } - if (this._fatalError || this._protocolError) { - return cb(this._fatalError || this._protocolError); - } - if (this._handshakePacket) { - return cb(null, this); - } - let connectCalled = 0; - function callbackOnce(isErrorHandler) { - return function(param) { - if (!connectCalled) { - if (isErrorHandler) { - cb(param); - } else { - cb(null, param); - } - } - connectCalled = 1; - }; - } - this.once('error', callbackOnce(true)); - this.once('connect', callbackOnce(false)); - } - - // =================================== - // outgoing server connection methods - // =================================== - writeColumns(columns) { - this.writePacket(Packets.ResultSetHeader.toPacket(columns.length)); - columns.forEach(column => { - this.writePacket( - Packets.ColumnDefinition.toPacket(column, this.serverConfig.encoding) - ); - }); - this.writeEof(); - } - - // row is array of columns, not hash - writeTextRow(column) { - this.writePacket( - Packets.TextRow.toPacket(column, this.serverConfig.encoding) - ); - } - - writeBinaryRow(column) { - this.writePacket( - Packets.BinaryRow.toPacket(column, this.serverConfig.encoding) - ); - } - - writeTextResult(rows, columns, binary=false) { - this.writeColumns(columns); - rows.forEach(row => { - const arrayRow = new Array(columns.length); - columns.forEach(column => { - arrayRow.push(row[column.name]); - }); - if(binary) { - this.writeBinaryRow(arrayRow); - } - else this.writeTextRow(arrayRow); - }); - this.writeEof(); - } - - writeEof(warnings, statusFlags) { - this.writePacket(Packets.EOF.toPacket(warnings, statusFlags)); - } - - writeOk(args) { - if (!args) { - args = { affectedRows: 0 }; - } - this.writePacket(Packets.OK.toPacket(args, this.serverConfig.encoding)); - } - - writeError(args) { - // if we want to send error before initial hello was sent, use default encoding - const encoding = this.serverConfig ? this.serverConfig.encoding : 'cesu8'; - this.writePacket(Packets.Error.toPacket(args, encoding)); - } - - serverHandshake(args) { - this.serverConfig = args; - this.serverConfig.encoding = - CharsetToEncoding[this.serverConfig.characterSet]; - return this.addCommand(new Commands.ServerHandshake(args)); - } - - // =============================================================== - end(callback) { - if (this.config.isServer) { - this._closing = true; - const quitCmd = new EventEmitter(); - setImmediate(() => { - this.stream.end(); - quitCmd.emit('end'); - }); - return quitCmd; - } - // trigger error if more commands enqueued after end command - const quitCmd = this.addCommand(new Commands.Quit(callback)); - this.addCommand = this._addCommandClosedState; - return quitCmd; - } - - static createQuery(sql, values, cb, config) { - let options = { - rowsAsArray: config.rowsAsArray, - infileStreamFactory: config.infileStreamFactory - }; - if (typeof sql === 'object') { - // query(options, cb) - options = { - ...options, - ...sql, - sql: sql.sql, - values: sql.values - }; - if (typeof values === 'function') { - cb = values; - } else if (values !== undefined) { - options.values = values; - } - } else if (typeof values === 'function') { - // query(sql, cb) - cb = values; - options.sql = sql; - options.values = undefined; - } else { - // query(sql, values, cb) - options.sql = sql; - options.values = values; - } - return new Commands.Query(options, cb); - } - - static statementKey(options) { - return ( - `${typeof options.nestTables}/${options.nestTables}/${options.rowsAsArray}${options.sql}` - ); - } -} - -module.exports = Connection; diff --git a/node_modules/mysql2/lib/connection_config.js b/node_modules/mysql2/lib/connection_config.js deleted file mode 100644 index a18b30b..0000000 --- a/node_modules/mysql2/lib/connection_config.js +++ /dev/null @@ -1,282 +0,0 @@ -// This file was modified by Oracle on September 21, 2021. -// New connection options for additional authentication factors were -// introduced. -// Multi-factor authentication capability is now enabled if one of these -// options is used. -// Modifications copyright (c) 2021, Oracle and/or its affiliates. - -'use strict'; - -const { URL } = require('url'); -const ClientConstants = require('./constants/client'); -const Charsets = require('./constants/charsets'); -const { version } = require('../package.json') -let SSLProfiles = null; - -const validOptions = { - authPlugins: 1, - authSwitchHandler: 1, - bigNumberStrings: 1, - charset: 1, - charsetNumber: 1, - compress: 1, - connectAttributes: 1, - connectTimeout: 1, - database: 1, - dateStrings: 1, - debug: 1, - decimalNumbers: 1, - enableKeepAlive: 1, - flags: 1, - host: 1, - insecureAuth: 1, - infileStreamFactory: 1, - isServer: 1, - keepAliveInitialDelay: 1, - localAddress: 1, - maxPreparedStatements: 1, - multipleStatements: 1, - namedPlaceholders: 1, - nestTables: 1, - password: 1, - // with multi-factor authentication, the main password (used for the first - // authentication factor) can be provided via password1 - password1: 1, - password2: 1, - password3: 1, - passwordSha1: 1, - pool: 1, - port: 1, - queryFormat: 1, - rowsAsArray: 1, - socketPath: 1, - ssl: 1, - stream: 1, - stringifyObjects: 1, - supportBigNumbers: 1, - timezone: 1, - trace: 1, - typeCast: 1, - uri: 1, - user: 1, - // These options are used for Pool - connectionLimit: 1, - maxIdle: 1, - idleTimeout: 1, - Promise: 1, - queueLimit: 1, - waitForConnections: 1 -}; - -class ConnectionConfig { - constructor(options) { - if (typeof options === 'string') { - options = ConnectionConfig.parseUrl(options); - } else if (options && options.uri) { - const uriOptions = ConnectionConfig.parseUrl(options.uri); - for (const key in uriOptions) { - if (!Object.prototype.hasOwnProperty.call(uriOptions, key)) continue; - if (options[key]) continue; - options[key] = uriOptions[key]; - } - } - for (const key in options) { - if (!Object.prototype.hasOwnProperty.call(options, key)) continue; - if (validOptions[key] !== 1) { - // REVIEW: Should this be emitted somehow? - // eslint-disable-next-line no-console - console.error( - `Ignoring invalid configuration option passed to Connection: ${key}. This is currently a warning, but in future versions of MySQL2, an error will be thrown if you pass an invalid configuration option to a Connection` - ); - } - } - this.isServer = options.isServer; - this.stream = options.stream; - this.host = options.host || 'localhost'; - this.port = (typeof options.port === 'string' ? parseInt(options.port, 10) : options.port)|| 3306; - this.localAddress = options.localAddress; - this.socketPath = options.socketPath; - this.user = options.user || undefined; - // for the purpose of multi-factor authentication, or not, the main - // password (used for the 1st authentication factor) can also be - // provided via the "password1" option - this.password = options.password || options.password1 || undefined; - this.password2 = options.password2 || undefined; - this.password3 = options.password3 || undefined; - this.passwordSha1 = options.passwordSha1 || undefined; - this.database = options.database; - this.connectTimeout = isNaN(options.connectTimeout) - ? 10 * 1000 - : options.connectTimeout; - this.insecureAuth = options.insecureAuth || false; - this.infileStreamFactory = options.infileStreamFactory || undefined; - this.supportBigNumbers = options.supportBigNumbers || false; - this.bigNumberStrings = options.bigNumberStrings || false; - this.decimalNumbers = options.decimalNumbers || false; - this.dateStrings = options.dateStrings || false; - this.debug = options.debug; - this.trace = options.trace !== false; - this.stringifyObjects = options.stringifyObjects || false; - this.enableKeepAlive = options.enableKeepAlive !== false; - this.keepAliveInitialDelay = options.keepAliveInitialDelay || 0; - if ( - options.timezone && - !/^(?:local|Z|[ +-]\d\d:\d\d)$/.test(options.timezone) - ) { - // strictly supports timezones specified by mysqljs/mysql: - // https://github.com/mysqljs/mysql#user-content-connection-options - // eslint-disable-next-line no-console - console.error( - `Ignoring invalid timezone passed to Connection: ${options.timezone}. This is currently a warning, but in future versions of MySQL2, an error will be thrown if you pass an invalid configuration option to a Connection` - ); - // SqlStrings falls back to UTC on invalid timezone - this.timezone = 'Z'; - } else { - this.timezone = options.timezone || 'local'; - } - this.queryFormat = options.queryFormat; - this.pool = options.pool || undefined; - this.ssl = - typeof options.ssl === 'string' - ? ConnectionConfig.getSSLProfile(options.ssl) - : options.ssl || false; - this.multipleStatements = options.multipleStatements || false; - this.rowsAsArray = options.rowsAsArray || false; - this.namedPlaceholders = options.namedPlaceholders || false; - this.nestTables = - options.nestTables === undefined ? undefined : options.nestTables; - this.typeCast = options.typeCast === undefined ? true : options.typeCast; - if (this.timezone[0] === ' ') { - // "+" is a url encoded char for space so it - // gets translated to space when giving a - // connection string.. - this.timezone = `+${this.timezone.slice(1)}`; - } - if (this.ssl) { - if (typeof this.ssl !== 'object') { - throw new TypeError( - `SSL profile must be an object, instead it's a ${typeof this.ssl}` - ); - } - // Default rejectUnauthorized to true - this.ssl.rejectUnauthorized = this.ssl.rejectUnauthorized !== false; - } - this.maxPacketSize = 0; - this.charsetNumber = options.charset - ? ConnectionConfig.getCharsetNumber(options.charset) - : options.charsetNumber || Charsets.UTF8MB4_UNICODE_CI; - this.compress = options.compress || false; - this.authPlugins = options.authPlugins; - this.authSwitchHandler = options.authSwitchHandler; - this.clientFlags = ConnectionConfig.mergeFlags( - ConnectionConfig.getDefaultFlags(options), - options.flags || '' - ); - // Default connection attributes - // https://dev.mysql.com/doc/refman/8.0/en/performance-schema-connection-attribute-tables.html - const defaultConnectAttributes = { - _client_name: 'Node-MySQL-2', - _client_version: version - }; - this.connectAttributes = { ...defaultConnectAttributes, ...(options.connectAttributes || {})}; - this.maxPreparedStatements = options.maxPreparedStatements || 16000; - } - - static mergeFlags(default_flags, user_flags) { - let flags = 0x0, - i; - if (!Array.isArray(user_flags)) { - user_flags = String(user_flags || '') - .toUpperCase() - .split(/\s*,+\s*/); - } - // add default flags unless "blacklisted" - for (i in default_flags) { - if (user_flags.indexOf(`-${default_flags[i]}`) >= 0) { - continue; - } - flags |= ClientConstants[default_flags[i]] || 0x0; - } - // add user flags unless already already added - for (i in user_flags) { - if (user_flags[i][0] === '-') { - continue; - } - if (default_flags.indexOf(user_flags[i]) >= 0) { - continue; - } - flags |= ClientConstants[user_flags[i]] || 0x0; - } - return flags; - } - - static getDefaultFlags(options) { - const defaultFlags = [ - 'LONG_PASSWORD', - 'FOUND_ROWS', - 'LONG_FLAG', - 'CONNECT_WITH_DB', - 'ODBC', - 'LOCAL_FILES', - 'IGNORE_SPACE', - 'PROTOCOL_41', - 'IGNORE_SIGPIPE', - 'TRANSACTIONS', - 'RESERVED', - 'SECURE_CONNECTION', - 'MULTI_RESULTS', - 'TRANSACTIONS', - 'SESSION_TRACK', - 'CONNECT_ATTRS' - ]; - if (options && options.multipleStatements) { - defaultFlags.push('MULTI_STATEMENTS'); - } - defaultFlags.push('PLUGIN_AUTH'); - defaultFlags.push('PLUGIN_AUTH_LENENC_CLIENT_DATA'); - - return defaultFlags; - } - - static getCharsetNumber(charset) { - const num = Charsets[charset.toUpperCase()]; - if (num === undefined) { - throw new TypeError(`Unknown charset '${charset}'`); - } - return num; - } - - static getSSLProfile(name) { - if (!SSLProfiles) { - SSLProfiles = require('./constants/ssl_profiles.js'); - } - const ssl = SSLProfiles[name]; - if (ssl === undefined) { - throw new TypeError(`Unknown SSL profile '${name}'`); - } - return ssl; - } - - static parseUrl(url) { - const parsedUrl = new URL(url); - const options = { - host: decodeURIComponent(parsedUrl.hostname), - port: parseInt(parsedUrl.port, 10), - database: decodeURIComponent(parsedUrl.pathname.slice(1)), - user: decodeURIComponent(parsedUrl.username), - password: decodeURIComponent(parsedUrl.password), - }; - parsedUrl.searchParams.forEach((value, key) => { - try { - // Try to parse this as a JSON expression first - options[key] = JSON.parse(value); - } catch (err) { - // Otherwise assume it is a plain string - options[key] = value; - } - }); - return options; - } -} - -module.exports = ConnectionConfig; diff --git a/node_modules/mysql2/lib/constants/charset_encodings.js b/node_modules/mysql2/lib/constants/charset_encodings.js deleted file mode 100644 index f7449a4..0000000 --- a/node_modules/mysql2/lib/constants/charset_encodings.js +++ /dev/null @@ -1,316 +0,0 @@ -'use strict'; - -// see tools/generate-charset-mapping.js -// basicalliy result of "SHOW COLLATION" query - -module.exports = [ - 'utf8', - 'big5', - 'latin2', - 'dec8', - 'cp850', - 'latin1', - 'hp8', - 'koi8r', - 'latin1', - 'latin2', - 'swe7', - 'ascii', - 'eucjp', - 'sjis', - 'cp1251', - 'latin1', - 'hebrew', - 'utf8', - 'tis620', - 'euckr', - 'latin7', - 'latin2', - 'koi8u', - 'cp1251', - 'gb2312', - 'greek', - 'cp1250', - 'latin2', - 'gbk', - 'cp1257', - 'latin5', - 'latin1', - 'armscii8', - 'cesu8', - 'cp1250', - 'ucs2', - 'cp866', - 'keybcs2', - 'macintosh', - 'macroman', - 'cp852', - 'latin7', - 'latin7', - 'macintosh', - 'cp1250', - 'utf8', - 'utf8', - 'latin1', - 'latin1', - 'latin1', - 'cp1251', - 'cp1251', - 'cp1251', - 'macroman', - 'utf16', - 'utf16', - 'utf16-le', - 'cp1256', - 'cp1257', - 'cp1257', - 'utf32', - 'utf32', - 'utf16-le', - 'binary', - 'armscii8', - 'ascii', - 'cp1250', - 'cp1256', - 'cp866', - 'dec8', - 'greek', - 'hebrew', - 'hp8', - 'keybcs2', - 'koi8r', - 'koi8u', - 'cesu8', - 'latin2', - 'latin5', - 'latin7', - 'cp850', - 'cp852', - 'swe7', - 'cesu8', - 'big5', - 'euckr', - 'gb2312', - 'gbk', - 'sjis', - 'tis620', - 'ucs2', - 'eucjp', - 'geostd8', - 'geostd8', - 'latin1', - 'cp932', - 'cp932', - 'eucjpms', - 'eucjpms', - 'cp1250', - 'utf16', - 'utf16', - 'utf16', - 'utf16', - 'utf16', - 'utf16', - 'utf16', - 'utf16', - 'utf16', - 'utf16', - 'utf16', - 'utf16', - 'utf16', - 'utf16', - 'utf16', - 'utf16', - 'utf16', - 'utf16', - 'utf16', - 'utf16', - 'utf16', - 'utf16', - 'utf16', - 'utf16', - 'utf16', - 'utf8', - 'utf8', - 'utf8', - 'ucs2', - 'ucs2', - 'ucs2', - 'ucs2', - 'ucs2', - 'ucs2', - 'ucs2', - 'ucs2', - 'ucs2', - 'ucs2', - 'ucs2', - 'ucs2', - 'ucs2', - 'ucs2', - 'ucs2', - 'ucs2', - 'ucs2', - 'ucs2', - 'ucs2', - 'ucs2', - 'ucs2', - 'ucs2', - 'ucs2', - 'ucs2', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'ucs2', - 'utf32', - 'utf32', - 'utf32', - 'utf32', - 'utf32', - 'utf32', - 'utf32', - 'utf32', - 'utf32', - 'utf32', - 'utf32', - 'utf32', - 'utf32', - 'utf32', - 'utf32', - 'utf32', - 'utf32', - 'utf32', - 'utf32', - 'utf32', - 'utf32', - 'utf32', - 'utf32', - 'utf32', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'cesu8', - 'cesu8', - 'cesu8', - 'cesu8', - 'cesu8', - 'cesu8', - 'cesu8', - 'cesu8', - 'cesu8', - 'cesu8', - 'cesu8', - 'cesu8', - 'cesu8', - 'cesu8', - 'cesu8', - 'cesu8', - 'cesu8', - 'cesu8', - 'cesu8', - 'cesu8', - 'cesu8', - 'cesu8', - 'cesu8', - 'cesu8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'cesu8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'gb18030', - 'gb18030', - 'gb18030', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8', - 'utf8' -]; diff --git a/node_modules/mysql2/lib/constants/charsets.js b/node_modules/mysql2/lib/constants/charsets.js deleted file mode 100644 index 2cb0a97..0000000 --- a/node_modules/mysql2/lib/constants/charsets.js +++ /dev/null @@ -1,317 +0,0 @@ -'use strict'; - -exports.BIG5_CHINESE_CI = 1; -exports.LATIN2_CZECH_CS = 2; -exports.DEC8_SWEDISH_CI = 3; -exports.CP850_GENERAL_CI = 4; -exports.LATIN1_GERMAN1_CI = 5; -exports.HP8_ENGLISH_CI = 6; -exports.KOI8R_GENERAL_CI = 7; -exports.LATIN1_SWEDISH_CI = 8; -exports.LATIN2_GENERAL_CI = 9; -exports.SWE7_SWEDISH_CI = 10; -exports.ASCII_GENERAL_CI = 11; -exports.UJIS_JAPANESE_CI = 12; -exports.SJIS_JAPANESE_CI = 13; -exports.CP1251_BULGARIAN_CI = 14; -exports.LATIN1_DANISH_CI = 15; -exports.HEBREW_GENERAL_CI = 16; -exports.TIS620_THAI_CI = 18; -exports.EUCKR_KOREAN_CI = 19; -exports.LATIN7_ESTONIAN_CS = 20; -exports.LATIN2_HUNGARIAN_CI = 21; -exports.KOI8U_GENERAL_CI = 22; -exports.CP1251_UKRAINIAN_CI = 23; -exports.GB2312_CHINESE_CI = 24; -exports.GREEK_GENERAL_CI = 25; -exports.CP1250_GENERAL_CI = 26; -exports.LATIN2_CROATIAN_CI = 27; -exports.GBK_CHINESE_CI = 28; -exports.CP1257_LITHUANIAN_CI = 29; -exports.LATIN5_TURKISH_CI = 30; -exports.LATIN1_GERMAN2_CI = 31; -exports.ARMSCII8_GENERAL_CI = 32; -exports.UTF8_GENERAL_CI = 33; -exports.CP1250_CZECH_CS = 34; -exports.UCS2_GENERAL_CI = 35; -exports.CP866_GENERAL_CI = 36; -exports.KEYBCS2_GENERAL_CI = 37; -exports.MACCE_GENERAL_CI = 38; -exports.MACROMAN_GENERAL_CI = 39; -exports.CP852_GENERAL_CI = 40; -exports.LATIN7_GENERAL_CI = 41; -exports.LATIN7_GENERAL_CS = 42; -exports.MACCE_BIN = 43; -exports.CP1250_CROATIAN_CI = 44; -exports.UTF8MB4_GENERAL_CI = 45; -exports.UTF8MB4_BIN = 46; -exports.LATIN1_BIN = 47; -exports.LATIN1_GENERAL_CI = 48; -exports.LATIN1_GENERAL_CS = 49; -exports.CP1251_BIN = 50; -exports.CP1251_GENERAL_CI = 51; -exports.CP1251_GENERAL_CS = 52; -exports.MACROMAN_BIN = 53; -exports.UTF16_GENERAL_CI = 54; -exports.UTF16_BIN = 55; -exports.UTF16LE_GENERAL_CI = 56; -exports.CP1256_GENERAL_CI = 57; -exports.CP1257_BIN = 58; -exports.CP1257_GENERAL_CI = 59; -exports.UTF32_GENERAL_CI = 60; -exports.UTF32_BIN = 61; -exports.UTF16LE_BIN = 62; -exports.BINARY = 63; -exports.ARMSCII8_BIN = 64; -exports.ASCII_BIN = 65; -exports.CP1250_BIN = 66; -exports.CP1256_BIN = 67; -exports.CP866_BIN = 68; -exports.DEC8_BIN = 69; -exports.GREEK_BIN = 70; -exports.HEBREW_BIN = 71; -exports.HP8_BIN = 72; -exports.KEYBCS2_BIN = 73; -exports.KOI8R_BIN = 74; -exports.KOI8U_BIN = 75; -exports.UTF8_TOLOWER_CI = 76; -exports.LATIN2_BIN = 77; -exports.LATIN5_BIN = 78; -exports.LATIN7_BIN = 79; -exports.CP850_BIN = 80; -exports.CP852_BIN = 81; -exports.SWE7_BIN = 82; -exports.UTF8_BIN = 83; -exports.BIG5_BIN = 84; -exports.EUCKR_BIN = 85; -exports.GB2312_BIN = 86; -exports.GBK_BIN = 87; -exports.SJIS_BIN = 88; -exports.TIS620_BIN = 89; -exports.UCS2_BIN = 90; -exports.UJIS_BIN = 91; -exports.GEOSTD8_GENERAL_CI = 92; -exports.GEOSTD8_BIN = 93; -exports.LATIN1_SPANISH_CI = 94; -exports.CP932_JAPANESE_CI = 95; -exports.CP932_BIN = 96; -exports.EUCJPMS_JAPANESE_CI = 97; -exports.EUCJPMS_BIN = 98; -exports.CP1250_POLISH_CI = 99; -exports.UTF16_UNICODE_CI = 101; -exports.UTF16_ICELANDIC_CI = 102; -exports.UTF16_LATVIAN_CI = 103; -exports.UTF16_ROMANIAN_CI = 104; -exports.UTF16_SLOVENIAN_CI = 105; -exports.UTF16_POLISH_CI = 106; -exports.UTF16_ESTONIAN_CI = 107; -exports.UTF16_SPANISH_CI = 108; -exports.UTF16_SWEDISH_CI = 109; -exports.UTF16_TURKISH_CI = 110; -exports.UTF16_CZECH_CI = 111; -exports.UTF16_DANISH_CI = 112; -exports.UTF16_LITHUANIAN_CI = 113; -exports.UTF16_SLOVAK_CI = 114; -exports.UTF16_SPANISH2_CI = 115; -exports.UTF16_ROMAN_CI = 116; -exports.UTF16_PERSIAN_CI = 117; -exports.UTF16_ESPERANTO_CI = 118; -exports.UTF16_HUNGARIAN_CI = 119; -exports.UTF16_SINHALA_CI = 120; -exports.UTF16_GERMAN2_CI = 121; -exports.UTF16_CROATIAN_CI = 122; -exports.UTF16_UNICODE_520_CI = 123; -exports.UTF16_VIETNAMESE_CI = 124; -exports.UCS2_UNICODE_CI = 128; -exports.UCS2_ICELANDIC_CI = 129; -exports.UCS2_LATVIAN_CI = 130; -exports.UCS2_ROMANIAN_CI = 131; -exports.UCS2_SLOVENIAN_CI = 132; -exports.UCS2_POLISH_CI = 133; -exports.UCS2_ESTONIAN_CI = 134; -exports.UCS2_SPANISH_CI = 135; -exports.UCS2_SWEDISH_CI = 136; -exports.UCS2_TURKISH_CI = 137; -exports.UCS2_CZECH_CI = 138; -exports.UCS2_DANISH_CI = 139; -exports.UCS2_LITHUANIAN_CI = 140; -exports.UCS2_SLOVAK_CI = 141; -exports.UCS2_SPANISH2_CI = 142; -exports.UCS2_ROMAN_CI = 143; -exports.UCS2_PERSIAN_CI = 144; -exports.UCS2_ESPERANTO_CI = 145; -exports.UCS2_HUNGARIAN_CI = 146; -exports.UCS2_SINHALA_CI = 147; -exports.UCS2_GERMAN2_CI = 148; -exports.UCS2_CROATIAN_CI = 149; -exports.UCS2_UNICODE_520_CI = 150; -exports.UCS2_VIETNAMESE_CI = 151; -exports.UCS2_GENERAL_MYSQL500_CI = 159; -exports.UTF32_UNICODE_CI = 160; -exports.UTF32_ICELANDIC_CI = 161; -exports.UTF32_LATVIAN_CI = 162; -exports.UTF32_ROMANIAN_CI = 163; -exports.UTF32_SLOVENIAN_CI = 164; -exports.UTF32_POLISH_CI = 165; -exports.UTF32_ESTONIAN_CI = 166; -exports.UTF32_SPANISH_CI = 167; -exports.UTF32_SWEDISH_CI = 168; -exports.UTF32_TURKISH_CI = 169; -exports.UTF32_CZECH_CI = 170; -exports.UTF32_DANISH_CI = 171; -exports.UTF32_LITHUANIAN_CI = 172; -exports.UTF32_SLOVAK_CI = 173; -exports.UTF32_SPANISH2_CI = 174; -exports.UTF32_ROMAN_CI = 175; -exports.UTF32_PERSIAN_CI = 176; -exports.UTF32_ESPERANTO_CI = 177; -exports.UTF32_HUNGARIAN_CI = 178; -exports.UTF32_SINHALA_CI = 179; -exports.UTF32_GERMAN2_CI = 180; -exports.UTF32_CROATIAN_CI = 181; -exports.UTF32_UNICODE_520_CI = 182; -exports.UTF32_VIETNAMESE_CI = 183; -exports.UTF8_UNICODE_CI = 192; -exports.UTF8_ICELANDIC_CI = 193; -exports.UTF8_LATVIAN_CI = 194; -exports.UTF8_ROMANIAN_CI = 195; -exports.UTF8_SLOVENIAN_CI = 196; -exports.UTF8_POLISH_CI = 197; -exports.UTF8_ESTONIAN_CI = 198; -exports.UTF8_SPANISH_CI = 199; -exports.UTF8_SWEDISH_CI = 200; -exports.UTF8_TURKISH_CI = 201; -exports.UTF8_CZECH_CI = 202; -exports.UTF8_DANISH_CI = 203; -exports.UTF8_LITHUANIAN_CI = 204; -exports.UTF8_SLOVAK_CI = 205; -exports.UTF8_SPANISH2_CI = 206; -exports.UTF8_ROMAN_CI = 207; -exports.UTF8_PERSIAN_CI = 208; -exports.UTF8_ESPERANTO_CI = 209; -exports.UTF8_HUNGARIAN_CI = 210; -exports.UTF8_SINHALA_CI = 211; -exports.UTF8_GERMAN2_CI = 212; -exports.UTF8_CROATIAN_CI = 213; -exports.UTF8_UNICODE_520_CI = 214; -exports.UTF8_VIETNAMESE_CI = 215; -exports.UTF8_GENERAL_MYSQL500_CI = 223; -exports.UTF8MB4_UNICODE_CI = 224; -exports.UTF8MB4_ICELANDIC_CI = 225; -exports.UTF8MB4_LATVIAN_CI = 226; -exports.UTF8MB4_ROMANIAN_CI = 227; -exports.UTF8MB4_SLOVENIAN_CI = 228; -exports.UTF8MB4_POLISH_CI = 229; -exports.UTF8MB4_ESTONIAN_CI = 230; -exports.UTF8MB4_SPANISH_CI = 231; -exports.UTF8MB4_SWEDISH_CI = 232; -exports.UTF8MB4_TURKISH_CI = 233; -exports.UTF8MB4_CZECH_CI = 234; -exports.UTF8MB4_DANISH_CI = 235; -exports.UTF8MB4_LITHUANIAN_CI = 236; -exports.UTF8MB4_SLOVAK_CI = 237; -exports.UTF8MB4_SPANISH2_CI = 238; -exports.UTF8MB4_ROMAN_CI = 239; -exports.UTF8MB4_PERSIAN_CI = 240; -exports.UTF8MB4_ESPERANTO_CI = 241; -exports.UTF8MB4_HUNGARIAN_CI = 242; -exports.UTF8MB4_SINHALA_CI = 243; -exports.UTF8MB4_GERMAN2_CI = 244; -exports.UTF8MB4_CROATIAN_CI = 245; -exports.UTF8MB4_UNICODE_520_CI = 246; -exports.UTF8MB4_VIETNAMESE_CI = 247; -exports.GB18030_CHINESE_CI = 248; -exports.GB18030_BIN = 249; -exports.GB18030_UNICODE_520_CI = 250; -exports.UTF8_GENERAL50_CI = 253; // deprecated -exports.UTF8MB4_0900_AI_CI = 255; -exports.UTF8MB4_DE_PB_0900_AI_CI = 256; -exports.UTF8MB4_IS_0900_AI_CI = 257; -exports.UTF8MB4_LV_0900_AI_CI = 258; -exports.UTF8MB4_RO_0900_AI_CI = 259; -exports.UTF8MB4_SL_0900_AI_CI = 260; -exports.UTF8MB4_PL_0900_AI_CI = 261; -exports.UTF8MB4_ET_0900_AI_CI = 262; -exports.UTF8MB4_ES_0900_AI_CI = 263; -exports.UTF8MB4_SV_0900_AI_CI = 264; -exports.UTF8MB4_TR_0900_AI_CI = 265; -exports.UTF8MB4_CS_0900_AI_CI = 266; -exports.UTF8MB4_DA_0900_AI_CI = 267; -exports.UTF8MB4_LT_0900_AI_CI = 268; -exports.UTF8MB4_SK_0900_AI_CI = 269; -exports.UTF8MB4_ES_TRAD_0900_AI_CI = 270; -exports.UTF8MB4_LA_0900_AI_CI = 271; -exports.UTF8MB4_EO_0900_AI_CI = 273; -exports.UTF8MB4_HU_0900_AI_CI = 274; -exports.UTF8MB4_HR_0900_AI_CI = 275; -exports.UTF8MB4_VI_0900_AI_CI = 277; -exports.UTF8MB4_0900_AS_CS = 278; -exports.UTF8MB4_DE_PB_0900_AS_CS = 279; -exports.UTF8MB4_IS_0900_AS_CS = 280; -exports.UTF8MB4_LV_0900_AS_CS = 281; -exports.UTF8MB4_RO_0900_AS_CS = 282; -exports.UTF8MB4_SL_0900_AS_CS = 283; -exports.UTF8MB4_PL_0900_AS_CS = 284; -exports.UTF8MB4_ET_0900_AS_CS = 285; -exports.UTF8MB4_ES_0900_AS_CS = 286; -exports.UTF8MB4_SV_0900_AS_CS = 287; -exports.UTF8MB4_TR_0900_AS_CS = 288; -exports.UTF8MB4_CS_0900_AS_CS = 289; -exports.UTF8MB4_DA_0900_AS_CS = 290; -exports.UTF8MB4_LT_0900_AS_CS = 291; -exports.UTF8MB4_SK_0900_AS_CS = 292; -exports.UTF8MB4_ES_TRAD_0900_AS_CS = 293; -exports.UTF8MB4_LA_0900_AS_CS = 294; -exports.UTF8MB4_EO_0900_AS_CS = 296; -exports.UTF8MB4_HU_0900_AS_CS = 297; -exports.UTF8MB4_HR_0900_AS_CS = 298; -exports.UTF8MB4_VI_0900_AS_CS = 300; -exports.UTF8MB4_JA_0900_AS_CS = 303; -exports.UTF8MB4_JA_0900_AS_CS_KS = 304; -exports.UTF8MB4_0900_AS_CI = 305; -exports.UTF8MB4_RU_0900_AI_CI = 306; -exports.UTF8MB4_RU_0900_AS_CS = 307; -exports.UTF8MB4_ZH_0900_AS_CS = 308; -exports.UTF8MB4_0900_BIN = 309; - -// short aliases -exports.BIG5 = exports.BIG5_CHINESE_CI; -exports.DEC8 = exports.DEC8_SWEDISH_CI; -exports.CP850 = exports.CP850_GENERAL_CI; -exports.HP8 = exports.HP8_ENGLISH_CI; -exports.KOI8R = exports.KOI8R_GENERAL_CI; -exports.LATIN1 = exports.LATIN1_SWEDISH_CI; -exports.LATIN2 = exports.LATIN2_GENERAL_CI; -exports.SWE7 = exports.SWE7_SWEDISH_CI; -exports.ASCII = exports.ASCII_GENERAL_CI; -exports.UJIS = exports.UJIS_JAPANESE_CI; -exports.SJIS = exports.SJIS_JAPANESE_CI; -exports.HEBREW = exports.HEBREW_GENERAL_CI; -exports.TIS620 = exports.TIS620_THAI_CI; -exports.EUCKR = exports.EUCKR_KOREAN_CI; -exports.KOI8U = exports.KOI8U_GENERAL_CI; -exports.GB2312 = exports.GB2312_CHINESE_CI; -exports.GREEK = exports.GREEK_GENERAL_CI; -exports.CP1250 = exports.CP1250_GENERAL_CI; -exports.GBK = exports.GBK_CHINESE_CI; -exports.LATIN5 = exports.LATIN5_TURKISH_CI; -exports.ARMSCII8 = exports.ARMSCII8_GENERAL_CI; -exports.UTF8 = exports.UTF8_GENERAL_CI; -exports.UCS2 = exports.UCS2_GENERAL_CI; -exports.CP866 = exports.CP866_GENERAL_CI; -exports.KEYBCS2 = exports.KEYBCS2_GENERAL_CI; -exports.MACCE = exports.MACCE_GENERAL_CI; -exports.MACROMAN = exports.MACROMAN_GENERAL_CI; -exports.CP852 = exports.CP852_GENERAL_CI; -exports.LATIN7 = exports.LATIN7_GENERAL_CI; -exports.UTF8MB4 = exports.UTF8MB4_GENERAL_CI; -exports.CP1251 = exports.CP1251_GENERAL_CI; -exports.UTF16 = exports.UTF16_GENERAL_CI; -exports.UTF16LE = exports.UTF16LE_GENERAL_CI; -exports.CP1256 = exports.CP1256_GENERAL_CI; -exports.CP1257 = exports.CP1257_GENERAL_CI; -exports.UTF32 = exports.UTF32_GENERAL_CI; -exports.CP932 = exports.CP932_JAPANESE_CI; -exports.EUCJPMS = exports.EUCJPMS_JAPANESE_CI; -exports.GB18030 = exports.GB18030_CHINESE_CI; -exports.GEOSTD8 = exports.GEOSTD8_GENERAL_CI; diff --git a/node_modules/mysql2/lib/constants/client.js b/node_modules/mysql2/lib/constants/client.js deleted file mode 100644 index 6a6964d..0000000 --- a/node_modules/mysql2/lib/constants/client.js +++ /dev/null @@ -1,39 +0,0 @@ -// This file was modified by Oracle on September 21, 2021. -// New capability for multi-factor authentication based on mandatory session -// trackers, that are signaled with an extra single-byte prefix on new -// versions of the MySQL server. -// Modifications copyright (c) 2021, Oracle and/or its affiliates. - -'use strict'; - -// Manually extracted from mysql-5.5.23/include/mysql_com.h -exports.LONG_PASSWORD = 0x00000001; /* new more secure passwords */ -exports.FOUND_ROWS = 0x00000002; /* found instead of affected rows */ -exports.LONG_FLAG = 0x00000004; /* get all column flags */ -exports.CONNECT_WITH_DB = 0x00000008; /* one can specify db on connect */ -exports.NO_SCHEMA = 0x00000010; /* don't allow database.table.column */ -exports.COMPRESS = 0x00000020; /* can use compression protocol */ -exports.ODBC = 0x00000040; /* odbc client */ -exports.LOCAL_FILES = 0x00000080; /* can use LOAD DATA LOCAL */ -exports.IGNORE_SPACE = 0x00000100; /* ignore spaces before '' */ -exports.PROTOCOL_41 = 0x00000200; /* new 4.1 protocol */ -exports.INTERACTIVE = 0x00000400; /* this is an interactive client */ -exports.SSL = 0x00000800; /* switch to ssl after handshake */ -exports.IGNORE_SIGPIPE = 0x00001000; /* IGNORE sigpipes */ -exports.TRANSACTIONS = 0x00002000; /* client knows about transactions */ -exports.RESERVED = 0x00004000; /* old flag for 4.1 protocol */ -exports.SECURE_CONNECTION = 0x00008000; /* new 4.1 authentication */ -exports.MULTI_STATEMENTS = 0x00010000; /* enable/disable multi-stmt support */ -exports.MULTI_RESULTS = 0x00020000; /* enable/disable multi-results */ -exports.PS_MULTI_RESULTS = 0x00040000; /* multi-results in ps-protocol */ -exports.PLUGIN_AUTH = 0x00080000; /* client supports plugin authentication */ -exports.CONNECT_ATTRS = 0x00100000; /* permits connection attributes */ -exports.PLUGIN_AUTH_LENENC_CLIENT_DATA = 0x00200000; /* Understands length-encoded integer for auth response data in Protocol::HandshakeResponse41. */ -exports.CAN_HANDLE_EXPIRED_PASSWORDS = 0x00400000; /* Announces support for expired password extension. */ -exports.SESSION_TRACK = 0x00800000; /* Can set SERVER_SESSION_STATE_CHANGED in the Status Flags and send session-state change data after a OK packet. */ -exports.DEPRECATE_EOF = 0x01000000; /* Can send OK after a Text Resultset. */ - -exports.SSL_VERIFY_SERVER_CERT = 0x40000000; -exports.REMEMBER_OPTIONS = 0x80000000; - -exports.MULTI_FACTOR_AUTHENTICATION = 0x10000000; /* multi-factor authentication */ diff --git a/node_modules/mysql2/lib/constants/commands.js b/node_modules/mysql2/lib/constants/commands.js deleted file mode 100644 index c0ed47d..0000000 --- a/node_modules/mysql2/lib/constants/commands.js +++ /dev/null @@ -1,36 +0,0 @@ -'use strict'; - -module.exports = { - SLEEP: 0x00, // deprecated - QUIT: 0x01, - INIT_DB: 0x02, - QUERY: 0x03, - FIELD_LIST: 0x04, - CREATE_DB: 0x05, - DROP_DB: 0x06, - REFRESH: 0x07, - SHUTDOWN: 0x08, - STATISTICS: 0x09, - PROCESS_INFO: 0x0a, // deprecated - CONNECT: 0x0b, // deprecated - PROCESS_KILL: 0x0c, - DEBUG: 0x0d, - PING: 0x0e, - TIME: 0x0f, // deprecated - DELAYED_INSERT: 0x10, // deprecated - CHANGE_USER: 0x11, - BINLOG_DUMP: 0x12, - TABLE_DUMP: 0x13, - CONNECT_OUT: 0x14, - REGISTER_SLAVE: 0x15, - STMT_PREPARE: 0x16, - STMT_EXECUTE: 0x17, - STMT_SEND_LONG_DATA: 0x18, - STMT_CLOSE: 0x19, - STMT_RESET: 0x1a, - SET_OPTION: 0x1b, - STMT_FETCH: 0x1c, - DAEMON: 0x1d, // deprecated - BINLOG_DUMP_GTID: 0x1e, - UNKNOWN: 0xff // bad! -}; diff --git a/node_modules/mysql2/lib/constants/cursor.js b/node_modules/mysql2/lib/constants/cursor.js deleted file mode 100644 index 8ed1ebf..0000000 --- a/node_modules/mysql2/lib/constants/cursor.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -module.exports = { - NO_CURSOR: 0, - READ_ONLY: 1, - FOR_UPDATE: 2, - SCROLLABLE: 3 -}; diff --git a/node_modules/mysql2/lib/constants/encoding_charset.js b/node_modules/mysql2/lib/constants/encoding_charset.js deleted file mode 100644 index 3e076e8..0000000 --- a/node_modules/mysql2/lib/constants/encoding_charset.js +++ /dev/null @@ -1,49 +0,0 @@ -'use strict'; - -// inverse of charset_encodings -// given encoding, get matching mysql charset number - -module.exports = { - big5: 1, - latin2: 2, - dec8: 3, - cp850: 4, - latin1: 5, - hp8: 6, - koi8r: 7, - swe7: 10, - ascii: 11, - eucjp: 12, - sjis: 13, - cp1251: 14, - hebrew: 16, - tis620: 18, - euckr: 19, - latin7: 20, - koi8u: 22, - gb2312: 24, - greek: 25, - cp1250: 26, - gbk: 28, - cp1257: 29, - latin5: 30, - armscii8: 32, - cesu8: 33, - ucs2: 35, - cp866: 36, - keybcs2: 37, - macintosh: 38, - macroman: 39, - cp852: 40, - utf8: 45, - utf8mb4: 45, - utf16: 54, - utf16le: 56, - cp1256: 57, - utf32: 60, - binary: 63, - geostd8: 92, - cp932: 95, - eucjpms: 97, - gb18030: 248 -}; diff --git a/node_modules/mysql2/lib/constants/errors.js b/node_modules/mysql2/lib/constants/errors.js deleted file mode 100644 index 52d10f8..0000000 --- a/node_modules/mysql2/lib/constants/errors.js +++ /dev/null @@ -1,3968 +0,0 @@ -// This file was modified by Oracle on June 1, 2021. -// An entry was created for a new error reported by the MySQL server due to -// client inactivity. -// Modifications copyright (c) 2021, Oracle and/or its affiliates. - -'use strict'; - -// originally copied from https://raw.githubusercontent.com/mysqljs/mysql/7770ee5bb13260c56a160b91fe480d9165dbeeba/lib/protocol/constants/errors.js -// (c) node-mysql authors - -// updated to contain error codes as is contained in MySQL 8.0 -// by adapting node-mysql: /.../generate-error-constants.js - -/** - * MySQL error constants - * - * Extracted from version 8.0.33 - * - * !! Generated by generate-error-constants.js, do not modify by hand !! - */ - - -exports.EE_CANTCREATEFILE = 1 -exports.EE_READ = 2 -exports.EE_WRITE = 3 -exports.EE_BADCLOSE = 4 -exports.EE_OUTOFMEMORY = 5 -exports.EE_DELETE = 6 -exports.EE_LINK = 7 -exports.EE_EOFERR = 9 -exports.EE_CANTLOCK = 10 -exports.EE_CANTUNLOCK = 11 -exports.EE_DIR = 12 -exports.EE_STAT = 13 -exports.EE_CANT_CHSIZE = 14 -exports.EE_CANT_OPEN_STREAM = 15 -exports.EE_GETWD = 16 -exports.EE_SETWD = 17 -exports.EE_LINK_WARNING = 18 -exports.EE_OPEN_WARNING = 19 -exports.EE_DISK_FULL = 20 -exports.EE_CANT_MKDIR = 21 -exports.EE_UNKNOWN_CHARSET = 22 -exports.EE_OUT_OF_FILERESOURCES = 23 -exports.EE_CANT_READLINK = 24 -exports.EE_CANT_SYMLINK = 25 -exports.EE_REALPATH = 26 -exports.EE_SYNC = 27 -exports.EE_UNKNOWN_COLLATION = 28 -exports.EE_FILENOTFOUND = 29 -exports.EE_FILE_NOT_CLOSED = 30 -exports.EE_CHANGE_OWNERSHIP = 31 -exports.EE_CHANGE_PERMISSIONS = 32 -exports.EE_CANT_SEEK = 33 -exports.EE_CAPACITY_EXCEEDED = 34 -exports.EE_DISK_FULL_WITH_RETRY_MSG = 35 -exports.EE_FAILED_TO_CREATE_TIMER = 36 -exports.EE_FAILED_TO_DELETE_TIMER = 37 -exports.EE_FAILED_TO_CREATE_TIMER_QUEUE = 38 -exports.EE_FAILED_TO_START_TIMER_NOTIFY_THREAD = 39 -exports.EE_FAILED_TO_CREATE_TIMER_NOTIFY_THREAD_INTERRUPT_EVENT = 40 -exports.EE_EXITING_TIMER_NOTIFY_THREAD = 41 -exports.EE_WIN_LIBRARY_LOAD_FAILED = 42 -exports.EE_WIN_RUN_TIME_ERROR_CHECK = 43 -exports.EE_FAILED_TO_DETERMINE_LARGE_PAGE_SIZE = 44 -exports.EE_FAILED_TO_KILL_ALL_THREADS = 45 -exports.EE_FAILED_TO_CREATE_IO_COMPLETION_PORT = 46 -exports.EE_FAILED_TO_OPEN_DEFAULTS_FILE = 47 -exports.EE_FAILED_TO_HANDLE_DEFAULTS_FILE = 48 -exports.EE_WRONG_DIRECTIVE_IN_CONFIG_FILE = 49 -exports.EE_SKIPPING_DIRECTIVE_DUE_TO_MAX_INCLUDE_RECURSION = 50 -exports.EE_INCORRECT_GRP_DEFINITION_IN_CONFIG_FILE = 51 -exports.EE_OPTION_WITHOUT_GRP_IN_CONFIG_FILE = 52 -exports.EE_CONFIG_FILE_PERMISSION_ERROR = 53 -exports.EE_IGNORE_WORLD_WRITABLE_CONFIG_FILE = 54 -exports.EE_USING_DISABLED_OPTION = 55 -exports.EE_USING_DISABLED_SHORT_OPTION = 56 -exports.EE_USING_PASSWORD_ON_CLI_IS_INSECURE = 57 -exports.EE_UNKNOWN_SUFFIX_FOR_VARIABLE = 58 -exports.EE_SSL_ERROR_FROM_FILE = 59 -exports.EE_SSL_ERROR = 60 -exports.EE_NET_SEND_ERROR_IN_BOOTSTRAP = 61 -exports.EE_PACKETS_OUT_OF_ORDER = 62 -exports.EE_UNKNOWN_PROTOCOL_OPTION = 63 -exports.EE_FAILED_TO_LOCATE_SERVER_PUBLIC_KEY = 64 -exports.EE_PUBLIC_KEY_NOT_IN_PEM_FORMAT = 65 -exports.EE_DEBUG_INFO = 66 -exports.EE_UNKNOWN_VARIABLE = 67 -exports.EE_UNKNOWN_OPTION = 68 -exports.EE_UNKNOWN_SHORT_OPTION = 69 -exports.EE_OPTION_WITHOUT_ARGUMENT = 70 -exports.EE_OPTION_REQUIRES_ARGUMENT = 71 -exports.EE_SHORT_OPTION_REQUIRES_ARGUMENT = 72 -exports.EE_OPTION_IGNORED_DUE_TO_INVALID_VALUE = 73 -exports.EE_OPTION_WITH_EMPTY_VALUE = 74 -exports.EE_FAILED_TO_ASSIGN_MAX_VALUE_TO_OPTION = 75 -exports.EE_INCORRECT_BOOLEAN_VALUE_FOR_OPTION = 76 -exports.EE_FAILED_TO_SET_OPTION_VALUE = 77 -exports.EE_INCORRECT_INT_VALUE_FOR_OPTION = 78 -exports.EE_INCORRECT_UINT_VALUE_FOR_OPTION = 79 -exports.EE_ADJUSTED_SIGNED_VALUE_FOR_OPTION = 80 -exports.EE_ADJUSTED_UNSIGNED_VALUE_FOR_OPTION = 81 -exports.EE_ADJUSTED_ULONGLONG_VALUE_FOR_OPTION = 82 -exports.EE_ADJUSTED_DOUBLE_VALUE_FOR_OPTION = 83 -exports.EE_INVALID_DECIMAL_VALUE_FOR_OPTION = 84 -exports.EE_COLLATION_PARSER_ERROR = 85 -exports.EE_FAILED_TO_RESET_BEFORE_PRIMARY_IGNORABLE_CHAR = 86 -exports.EE_FAILED_TO_RESET_BEFORE_TERTIARY_IGNORABLE_CHAR = 87 -exports.EE_SHIFT_CHAR_OUT_OF_RANGE = 88 -exports.EE_RESET_CHAR_OUT_OF_RANGE = 89 -exports.EE_UNKNOWN_LDML_TAG = 90 -exports.EE_FAILED_TO_RESET_BEFORE_SECONDARY_IGNORABLE_CHAR = 91 -exports.EE_FAILED_PROCESSING_DIRECTIVE = 92 -exports.EE_PTHREAD_KILL_FAILED = 93 -exports.HA_ERR_KEY_NOT_FOUND = 120 -exports.HA_ERR_FOUND_DUPP_KEY = 121 -exports.HA_ERR_INTERNAL_ERROR = 122 -exports.HA_ERR_RECORD_CHANGED = 123 -exports.HA_ERR_WRONG_INDEX = 124 -exports.HA_ERR_ROLLED_BACK = 125 -exports.HA_ERR_CRASHED = 126 -exports.HA_ERR_WRONG_IN_RECORD = 127 -exports.HA_ERR_OUT_OF_MEM = 128 -exports.HA_ERR_NOT_A_TABLE = 130 -exports.HA_ERR_WRONG_COMMAND = 131 -exports.HA_ERR_OLD_FILE = 132 -exports.HA_ERR_NO_ACTIVE_RECORD = 133 -exports.HA_ERR_RECORD_DELETED = 134 -exports.HA_ERR_RECORD_FILE_FULL = 135 -exports.HA_ERR_INDEX_FILE_FULL = 136 -exports.HA_ERR_END_OF_FILE = 137 -exports.HA_ERR_UNSUPPORTED = 138 -exports.HA_ERR_TOO_BIG_ROW = 139 -exports.HA_WRONG_CREATE_OPTION = 140 -exports.HA_ERR_FOUND_DUPP_UNIQUE = 141 -exports.HA_ERR_UNKNOWN_CHARSET = 142 -exports.HA_ERR_WRONG_MRG_TABLE_DEF = 143 -exports.HA_ERR_CRASHED_ON_REPAIR = 144 -exports.HA_ERR_CRASHED_ON_USAGE = 145 -exports.HA_ERR_LOCK_WAIT_TIMEOUT = 146 -exports.HA_ERR_LOCK_TABLE_FULL = 147 -exports.HA_ERR_READ_ONLY_TRANSACTION = 148 -exports.HA_ERR_LOCK_DEADLOCK = 149 -exports.HA_ERR_CANNOT_ADD_FOREIGN = 150 -exports.HA_ERR_NO_REFERENCED_ROW = 151 -exports.HA_ERR_ROW_IS_REFERENCED = 152 -exports.HA_ERR_NO_SAVEPOINT = 153 -exports.HA_ERR_NON_UNIQUE_BLOCK_SIZE = 154 -exports.HA_ERR_NO_SUCH_TABLE = 155 -exports.HA_ERR_TABLE_EXIST = 156 -exports.HA_ERR_NO_CONNECTION = 157 -exports.HA_ERR_NULL_IN_SPATIAL = 158 -exports.HA_ERR_TABLE_DEF_CHANGED = 159 -exports.HA_ERR_NO_PARTITION_FOUND = 160 -exports.HA_ERR_RBR_LOGGING_FAILED = 161 -exports.HA_ERR_DROP_INDEX_FK = 162 -exports.HA_ERR_FOREIGN_DUPLICATE_KEY = 163 -exports.HA_ERR_TABLE_NEEDS_UPGRADE = 164 -exports.HA_ERR_TABLE_READONLY = 165 -exports.HA_ERR_AUTOINC_READ_FAILED = 166 -exports.HA_ERR_AUTOINC_ERANGE = 167 -exports.HA_ERR_GENERIC = 168 -exports.HA_ERR_RECORD_IS_THE_SAME = 169 -exports.HA_ERR_LOGGING_IMPOSSIBLE = 170 -exports.HA_ERR_CORRUPT_EVENT = 171 -exports.HA_ERR_NEW_FILE = 172 -exports.HA_ERR_ROWS_EVENT_APPLY = 173 -exports.HA_ERR_INITIALIZATION = 174 -exports.HA_ERR_FILE_TOO_SHORT = 175 -exports.HA_ERR_WRONG_CRC = 176 -exports.HA_ERR_TOO_MANY_CONCURRENT_TRXS = 177 -exports.HA_ERR_NOT_IN_LOCK_PARTITIONS = 178 -exports.HA_ERR_INDEX_COL_TOO_LONG = 179 -exports.HA_ERR_INDEX_CORRUPT = 180 -exports.HA_ERR_UNDO_REC_TOO_BIG = 181 -exports.HA_FTS_INVALID_DOCID = 182 -exports.HA_ERR_TABLE_IN_FK_CHECK = 183 -exports.HA_ERR_TABLESPACE_EXISTS = 184 -exports.HA_ERR_TOO_MANY_FIELDS = 185 -exports.HA_ERR_ROW_IN_WRONG_PARTITION = 186 -exports.HA_ERR_INNODB_READ_ONLY = 187 -exports.HA_ERR_FTS_EXCEED_RESULT_CACHE_LIMIT = 188 -exports.HA_ERR_TEMP_FILE_WRITE_FAILURE = 189 -exports.HA_ERR_INNODB_FORCED_RECOVERY = 190 -exports.HA_ERR_FTS_TOO_MANY_WORDS_IN_PHRASE = 191 -exports.HA_ERR_FK_DEPTH_EXCEEDED = 192 -exports.HA_MISSING_CREATE_OPTION = 193 -exports.HA_ERR_SE_OUT_OF_MEMORY = 194 -exports.HA_ERR_TABLE_CORRUPT = 195 -exports.HA_ERR_QUERY_INTERRUPTED = 196 -exports.HA_ERR_TABLESPACE_MISSING = 197 -exports.HA_ERR_TABLESPACE_IS_NOT_EMPTY = 198 -exports.HA_ERR_WRONG_FILE_NAME = 199 -exports.HA_ERR_NOT_ALLOWED_COMMAND = 200 -exports.HA_ERR_COMPUTE_FAILED = 201 -exports.HA_ERR_ROW_FORMAT_CHANGED = 202 -exports.HA_ERR_NO_WAIT_LOCK = 203 -exports.HA_ERR_DISK_FULL_NOWAIT = 204 -exports.HA_ERR_NO_SESSION_TEMP = 205 -exports.HA_ERR_WRONG_TABLE_NAME = 206 -exports.HA_ERR_TOO_LONG_PATH = 207 -exports.HA_ERR_SAMPLING_INIT_FAILED = 208 -exports.HA_ERR_FTS_TOO_MANY_NESTED_EXP = 209 -exports.ER_HASHCHK = 1000 -exports.ER_NISAMCHK = 1001 -exports.ER_NO = 1002 -exports.ER_YES = 1003 -exports.ER_CANT_CREATE_FILE = 1004 -exports.ER_CANT_CREATE_TABLE = 1005 -exports.ER_CANT_CREATE_DB = 1006 -exports.ER_DB_CREATE_EXISTS = 1007 -exports.ER_DB_DROP_EXISTS = 1008 -exports.ER_DB_DROP_DELETE = 1009 -exports.ER_DB_DROP_RMDIR = 1010 -exports.ER_CANT_DELETE_FILE = 1011 -exports.ER_CANT_FIND_SYSTEM_REC = 1012 -exports.ER_CANT_GET_STAT = 1013 -exports.ER_CANT_GET_WD = 1014 -exports.ER_CANT_LOCK = 1015 -exports.ER_CANT_OPEN_FILE = 1016 -exports.ER_FILE_NOT_FOUND = 1017 -exports.ER_CANT_READ_DIR = 1018 -exports.ER_CANT_SET_WD = 1019 -exports.ER_CHECKREAD = 1020 -exports.ER_DISK_FULL = 1021 -exports.ER_DUP_KEY = 1022 -exports.ER_ERROR_ON_CLOSE = 1023 -exports.ER_ERROR_ON_READ = 1024 -exports.ER_ERROR_ON_RENAME = 1025 -exports.ER_ERROR_ON_WRITE = 1026 -exports.ER_FILE_USED = 1027 -exports.ER_FILSORT_ABORT = 1028 -exports.ER_FORM_NOT_FOUND = 1029 -exports.ER_GET_ERRNO = 1030 -exports.ER_ILLEGAL_HA = 1031 -exports.ER_KEY_NOT_FOUND = 1032 -exports.ER_NOT_FORM_FILE = 1033 -exports.ER_NOT_KEYFILE = 1034 -exports.ER_OLD_KEYFILE = 1035 -exports.ER_OPEN_AS_READONLY = 1036 -exports.ER_OUTOFMEMORY = 1037 -exports.ER_OUT_OF_SORTMEMORY = 1038 -exports.ER_UNEXPECTED_EOF = 1039 -exports.ER_CON_COUNT_ERROR = 1040 -exports.ER_OUT_OF_RESOURCES = 1041 -exports.ER_BAD_HOST_ERROR = 1042 -exports.ER_HANDSHAKE_ERROR = 1043 -exports.ER_DBACCESS_DENIED_ERROR = 1044 -exports.ER_ACCESS_DENIED_ERROR = 1045 -exports.ER_NO_DB_ERROR = 1046 -exports.ER_UNKNOWN_COM_ERROR = 1047 -exports.ER_BAD_NULL_ERROR = 1048 -exports.ER_BAD_DB_ERROR = 1049 -exports.ER_TABLE_EXISTS_ERROR = 1050 -exports.ER_BAD_TABLE_ERROR = 1051 -exports.ER_NON_UNIQ_ERROR = 1052 -exports.ER_SERVER_SHUTDOWN = 1053 -exports.ER_BAD_FIELD_ERROR = 1054 -exports.ER_WRONG_FIELD_WITH_GROUP = 1055 -exports.ER_WRONG_GROUP_FIELD = 1056 -exports.ER_WRONG_SUM_SELECT = 1057 -exports.ER_WRONG_VALUE_COUNT = 1058 -exports.ER_TOO_LONG_IDENT = 1059 -exports.ER_DUP_FIELDNAME = 1060 -exports.ER_DUP_KEYNAME = 1061 -exports.ER_DUP_ENTRY = 1062 -exports.ER_WRONG_FIELD_SPEC = 1063 -exports.ER_PARSE_ERROR = 1064 -exports.ER_EMPTY_QUERY = 1065 -exports.ER_NONUNIQ_TABLE = 1066 -exports.ER_INVALID_DEFAULT = 1067 -exports.ER_MULTIPLE_PRI_KEY = 1068 -exports.ER_TOO_MANY_KEYS = 1069 -exports.ER_TOO_MANY_KEY_PARTS = 1070 -exports.ER_TOO_LONG_KEY = 1071 -exports.ER_KEY_COLUMN_DOES_NOT_EXITS = 1072 -exports.ER_BLOB_USED_AS_KEY = 1073 -exports.ER_TOO_BIG_FIELDLENGTH = 1074 -exports.ER_WRONG_AUTO_KEY = 1075 -exports.ER_READY = 1076 -exports.ER_NORMAL_SHUTDOWN = 1077 -exports.ER_GOT_SIGNAL = 1078 -exports.ER_SHUTDOWN_COMPLETE = 1079 -exports.ER_FORCING_CLOSE = 1080 -exports.ER_IPSOCK_ERROR = 1081 -exports.ER_NO_SUCH_INDEX = 1082 -exports.ER_WRONG_FIELD_TERMINATORS = 1083 -exports.ER_BLOBS_AND_NO_TERMINATED = 1084 -exports.ER_TEXTFILE_NOT_READABLE = 1085 -exports.ER_FILE_EXISTS_ERROR = 1086 -exports.ER_LOAD_INFO = 1087 -exports.ER_ALTER_INFO = 1088 -exports.ER_WRONG_SUB_KEY = 1089 -exports.ER_CANT_REMOVE_ALL_FIELDS = 1090 -exports.ER_CANT_DROP_FIELD_OR_KEY = 1091 -exports.ER_INSERT_INFO = 1092 -exports.ER_UPDATE_TABLE_USED = 1093 -exports.ER_NO_SUCH_THREAD = 1094 -exports.ER_KILL_DENIED_ERROR = 1095 -exports.ER_NO_TABLES_USED = 1096 -exports.ER_TOO_BIG_SET = 1097 -exports.ER_NO_UNIQUE_LOGFILE = 1098 -exports.ER_TABLE_NOT_LOCKED_FOR_WRITE = 1099 -exports.ER_TABLE_NOT_LOCKED = 1100 -exports.ER_BLOB_CANT_HAVE_DEFAULT = 1101 -exports.ER_WRONG_DB_NAME = 1102 -exports.ER_WRONG_TABLE_NAME = 1103 -exports.ER_TOO_BIG_SELECT = 1104 -exports.ER_UNKNOWN_ERROR = 1105 -exports.ER_UNKNOWN_PROCEDURE = 1106 -exports.ER_WRONG_PARAMCOUNT_TO_PROCEDURE = 1107 -exports.ER_WRONG_PARAMETERS_TO_PROCEDURE = 1108 -exports.ER_UNKNOWN_TABLE = 1109 -exports.ER_FIELD_SPECIFIED_TWICE = 1110 -exports.ER_INVALID_GROUP_FUNC_USE = 1111 -exports.ER_UNSUPPORTED_EXTENSION = 1112 -exports.ER_TABLE_MUST_HAVE_COLUMNS = 1113 -exports.ER_RECORD_FILE_FULL = 1114 -exports.ER_UNKNOWN_CHARACTER_SET = 1115 -exports.ER_TOO_MANY_TABLES = 1116 -exports.ER_TOO_MANY_FIELDS = 1117 -exports.ER_TOO_BIG_ROWSIZE = 1118 -exports.ER_STACK_OVERRUN = 1119 -exports.ER_WRONG_OUTER_JOIN = 1120 -exports.ER_NULL_COLUMN_IN_INDEX = 1121 -exports.ER_CANT_FIND_UDF = 1122 -exports.ER_CANT_INITIALIZE_UDF = 1123 -exports.ER_UDF_NO_PATHS = 1124 -exports.ER_UDF_EXISTS = 1125 -exports.ER_CANT_OPEN_LIBRARY = 1126 -exports.ER_CANT_FIND_DL_ENTRY = 1127 -exports.ER_FUNCTION_NOT_DEFINED = 1128 -exports.ER_HOST_IS_BLOCKED = 1129 -exports.ER_HOST_NOT_PRIVILEGED = 1130 -exports.ER_PASSWORD_ANONYMOUS_USER = 1131 -exports.ER_PASSWORD_NOT_ALLOWED = 1132 -exports.ER_PASSWORD_NO_MATCH = 1133 -exports.ER_UPDATE_INFO = 1134 -exports.ER_CANT_CREATE_THREAD = 1135 -exports.ER_WRONG_VALUE_COUNT_ON_ROW = 1136 -exports.ER_CANT_REOPEN_TABLE = 1137 -exports.ER_INVALID_USE_OF_NULL = 1138 -exports.ER_REGEXP_ERROR = 1139 -exports.ER_MIX_OF_GROUP_FUNC_AND_FIELDS = 1140 -exports.ER_NONEXISTING_GRANT = 1141 -exports.ER_TABLEACCESS_DENIED_ERROR = 1142 -exports.ER_COLUMNACCESS_DENIED_ERROR = 1143 -exports.ER_ILLEGAL_GRANT_FOR_TABLE = 1144 -exports.ER_GRANT_WRONG_HOST_OR_USER = 1145 -exports.ER_NO_SUCH_TABLE = 1146 -exports.ER_NONEXISTING_TABLE_GRANT = 1147 -exports.ER_NOT_ALLOWED_COMMAND = 1148 -exports.ER_SYNTAX_ERROR = 1149 -exports.ER_UNUSED1 = 1150 -exports.ER_UNUSED2 = 1151 -exports.ER_ABORTING_CONNECTION = 1152 -exports.ER_NET_PACKET_TOO_LARGE = 1153 -exports.ER_NET_READ_ERROR_FROM_PIPE = 1154 -exports.ER_NET_FCNTL_ERROR = 1155 -exports.ER_NET_PACKETS_OUT_OF_ORDER = 1156 -exports.ER_NET_UNCOMPRESS_ERROR = 1157 -exports.ER_NET_READ_ERROR = 1158 -exports.ER_NET_READ_INTERRUPTED = 1159 -exports.ER_NET_ERROR_ON_WRITE = 1160 -exports.ER_NET_WRITE_INTERRUPTED = 1161 -exports.ER_TOO_LONG_STRING = 1162 -exports.ER_TABLE_CANT_HANDLE_BLOB = 1163 -exports.ER_TABLE_CANT_HANDLE_AUTO_INCREMENT = 1164 -exports.ER_UNUSED3 = 1165 -exports.ER_WRONG_COLUMN_NAME = 1166 -exports.ER_WRONG_KEY_COLUMN = 1167 -exports.ER_WRONG_MRG_TABLE = 1168 -exports.ER_DUP_UNIQUE = 1169 -exports.ER_BLOB_KEY_WITHOUT_LENGTH = 1170 -exports.ER_PRIMARY_CANT_HAVE_NULL = 1171 -exports.ER_TOO_MANY_ROWS = 1172 -exports.ER_REQUIRES_PRIMARY_KEY = 1173 -exports.ER_NO_RAID_COMPILED = 1174 -exports.ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE = 1175 -exports.ER_KEY_DOES_NOT_EXITS = 1176 -exports.ER_CHECK_NO_SUCH_TABLE = 1177 -exports.ER_CHECK_NOT_IMPLEMENTED = 1178 -exports.ER_CANT_DO_THIS_DURING_AN_TRANSACTION = 1179 -exports.ER_ERROR_DURING_COMMIT = 1180 -exports.ER_ERROR_DURING_ROLLBACK = 1181 -exports.ER_ERROR_DURING_FLUSH_LOGS = 1182 -exports.ER_ERROR_DURING_CHECKPOINT = 1183 -exports.ER_NEW_ABORTING_CONNECTION = 1184 -exports.ER_DUMP_NOT_IMPLEMENTED = 1185 -exports.ER_FLUSH_MASTER_BINLOG_CLOSED = 1186 -exports.ER_INDEX_REBUILD = 1187 -exports.ER_SOURCE = 1188 -exports.ER_SOURCE_NET_READ = 1189 -exports.ER_SOURCE_NET_WRITE = 1190 -exports.ER_FT_MATCHING_KEY_NOT_FOUND = 1191 -exports.ER_LOCK_OR_ACTIVE_TRANSACTION = 1192 -exports.ER_UNKNOWN_SYSTEM_VARIABLE = 1193 -exports.ER_CRASHED_ON_USAGE = 1194 -exports.ER_CRASHED_ON_REPAIR = 1195 -exports.ER_WARNING_NOT_COMPLETE_ROLLBACK = 1196 -exports.ER_TRANS_CACHE_FULL = 1197 -exports.ER_SLAVE_MUST_STOP = 1198 -exports.ER_REPLICA_NOT_RUNNING = 1199 -exports.ER_BAD_REPLICA = 1200 -exports.ER_CONNECTION_METADATA = 1201 -exports.ER_REPLICA_THREAD = 1202 -exports.ER_TOO_MANY_USER_CONNECTIONS = 1203 -exports.ER_SET_CONSTANTS_ONLY = 1204 -exports.ER_LOCK_WAIT_TIMEOUT = 1205 -exports.ER_LOCK_TABLE_FULL = 1206 -exports.ER_READ_ONLY_TRANSACTION = 1207 -exports.ER_DROP_DB_WITH_READ_LOCK = 1208 -exports.ER_CREATE_DB_WITH_READ_LOCK = 1209 -exports.ER_WRONG_ARGUMENTS = 1210 -exports.ER_NO_PERMISSION_TO_CREATE_USER = 1211 -exports.ER_UNION_TABLES_IN_DIFFERENT_DIR = 1212 -exports.ER_LOCK_DEADLOCK = 1213 -exports.ER_TABLE_CANT_HANDLE_FT = 1214 -exports.ER_CANNOT_ADD_FOREIGN = 1215 -exports.ER_NO_REFERENCED_ROW = 1216 -exports.ER_ROW_IS_REFERENCED = 1217 -exports.ER_CONNECT_TO_SOURCE = 1218 -exports.ER_QUERY_ON_MASTER = 1219 -exports.ER_ERROR_WHEN_EXECUTING_COMMAND = 1220 -exports.ER_WRONG_USAGE = 1221 -exports.ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT = 1222 -exports.ER_CANT_UPDATE_WITH_READLOCK = 1223 -exports.ER_MIXING_NOT_ALLOWED = 1224 -exports.ER_DUP_ARGUMENT = 1225 -exports.ER_USER_LIMIT_REACHED = 1226 -exports.ER_SPECIFIC_ACCESS_DENIED_ERROR = 1227 -exports.ER_LOCAL_VARIABLE = 1228 -exports.ER_GLOBAL_VARIABLE = 1229 -exports.ER_NO_DEFAULT = 1230 -exports.ER_WRONG_VALUE_FOR_VAR = 1231 -exports.ER_WRONG_TYPE_FOR_VAR = 1232 -exports.ER_VAR_CANT_BE_READ = 1233 -exports.ER_CANT_USE_OPTION_HERE = 1234 -exports.ER_NOT_SUPPORTED_YET = 1235 -exports.ER_SOURCE_FATAL_ERROR_READING_BINLOG = 1236 -exports.ER_REPLICA_IGNORED_TABLE = 1237 -exports.ER_INCORRECT_GLOBAL_LOCAL_VAR = 1238 -exports.ER_WRONG_FK_DEF = 1239 -exports.ER_KEY_REF_DO_NOT_MATCH_TABLE_REF = 1240 -exports.ER_OPERAND_COLUMNS = 1241 -exports.ER_SUBQUERY_NO_1_ROW = 1242 -exports.ER_UNKNOWN_STMT_HANDLER = 1243 -exports.ER_CORRUPT_HELP_DB = 1244 -exports.ER_CYCLIC_REFERENCE = 1245 -exports.ER_AUTO_CONVERT = 1246 -exports.ER_ILLEGAL_REFERENCE = 1247 -exports.ER_DERIVED_MUST_HAVE_ALIAS = 1248 -exports.ER_SELECT_REDUCED = 1249 -exports.ER_TABLENAME_NOT_ALLOWED_HERE = 1250 -exports.ER_NOT_SUPPORTED_AUTH_MODE = 1251 -exports.ER_SPATIAL_CANT_HAVE_NULL = 1252 -exports.ER_COLLATION_CHARSET_MISMATCH = 1253 -exports.ER_SLAVE_WAS_RUNNING = 1254 -exports.ER_SLAVE_WAS_NOT_RUNNING = 1255 -exports.ER_TOO_BIG_FOR_UNCOMPRESS = 1256 -exports.ER_ZLIB_Z_MEM_ERROR = 1257 -exports.ER_ZLIB_Z_BUF_ERROR = 1258 -exports.ER_ZLIB_Z_DATA_ERROR = 1259 -exports.ER_CUT_VALUE_GROUP_CONCAT = 1260 -exports.ER_WARN_TOO_FEW_RECORDS = 1261 -exports.ER_WARN_TOO_MANY_RECORDS = 1262 -exports.ER_WARN_NULL_TO_NOTNULL = 1263 -exports.ER_WARN_DATA_OUT_OF_RANGE = 1264 -exports.WARN_DATA_TRUNCATED = 1265 -exports.ER_WARN_USING_OTHER_HANDLER = 1266 -exports.ER_CANT_AGGREGATE_2COLLATIONS = 1267 -exports.ER_DROP_USER = 1268 -exports.ER_REVOKE_GRANTS = 1269 -exports.ER_CANT_AGGREGATE_3COLLATIONS = 1270 -exports.ER_CANT_AGGREGATE_NCOLLATIONS = 1271 -exports.ER_VARIABLE_IS_NOT_STRUCT = 1272 -exports.ER_UNKNOWN_COLLATION = 1273 -exports.ER_REPLICA_IGNORED_SSL_PARAMS = 1274 -exports.ER_SERVER_IS_IN_SECURE_AUTH_MODE = 1275 -exports.ER_WARN_FIELD_RESOLVED = 1276 -exports.ER_BAD_REPLICA_UNTIL_COND = 1277 -exports.ER_MISSING_SKIP_REPLICA = 1278 -exports.ER_UNTIL_COND_IGNORED = 1279 -exports.ER_WRONG_NAME_FOR_INDEX = 1280 -exports.ER_WRONG_NAME_FOR_CATALOG = 1281 -exports.ER_WARN_QC_RESIZE = 1282 -exports.ER_BAD_FT_COLUMN = 1283 -exports.ER_UNKNOWN_KEY_CACHE = 1284 -exports.ER_WARN_HOSTNAME_WONT_WORK = 1285 -exports.ER_UNKNOWN_STORAGE_ENGINE = 1286 -exports.ER_WARN_DEPRECATED_SYNTAX = 1287 -exports.ER_NON_UPDATABLE_TABLE = 1288 -exports.ER_FEATURE_DISABLED = 1289 -exports.ER_OPTION_PREVENTS_STATEMENT = 1290 -exports.ER_DUPLICATED_VALUE_IN_TYPE = 1291 -exports.ER_TRUNCATED_WRONG_VALUE = 1292 -exports.ER_TOO_MUCH_AUTO_TIMESTAMP_COLS = 1293 -exports.ER_INVALID_ON_UPDATE = 1294 -exports.ER_UNSUPPORTED_PS = 1295 -exports.ER_GET_ERRMSG = 1296 -exports.ER_GET_TEMPORARY_ERRMSG = 1297 -exports.ER_UNKNOWN_TIME_ZONE = 1298 -exports.ER_WARN_INVALID_TIMESTAMP = 1299 -exports.ER_INVALID_CHARACTER_STRING = 1300 -exports.ER_WARN_ALLOWED_PACKET_OVERFLOWED = 1301 -exports.ER_CONFLICTING_DECLARATIONS = 1302 -exports.ER_SP_NO_RECURSIVE_CREATE = 1303 -exports.ER_SP_ALREADY_EXISTS = 1304 -exports.ER_SP_DOES_NOT_EXIST = 1305 -exports.ER_SP_DROP_FAILED = 1306 -exports.ER_SP_STORE_FAILED = 1307 -exports.ER_SP_LILABEL_MISMATCH = 1308 -exports.ER_SP_LABEL_REDEFINE = 1309 -exports.ER_SP_LABEL_MISMATCH = 1310 -exports.ER_SP_UNINIT_VAR = 1311 -exports.ER_SP_BADSELECT = 1312 -exports.ER_SP_BADRETURN = 1313 -exports.ER_SP_BADSTATEMENT = 1314 -exports.ER_UPDATE_LOG_DEPRECATED_IGNORED = 1315 -exports.ER_UPDATE_LOG_DEPRECATED_TRANSLATED = 1316 -exports.ER_QUERY_INTERRUPTED = 1317 -exports.ER_SP_WRONG_NO_OF_ARGS = 1318 -exports.ER_SP_COND_MISMATCH = 1319 -exports.ER_SP_NORETURN = 1320 -exports.ER_SP_NORETURNEND = 1321 -exports.ER_SP_BAD_CURSOR_QUERY = 1322 -exports.ER_SP_BAD_CURSOR_SELECT = 1323 -exports.ER_SP_CURSOR_MISMATCH = 1324 -exports.ER_SP_CURSOR_ALREADY_OPEN = 1325 -exports.ER_SP_CURSOR_NOT_OPEN = 1326 -exports.ER_SP_UNDECLARED_VAR = 1327 -exports.ER_SP_WRONG_NO_OF_FETCH_ARGS = 1328 -exports.ER_SP_FETCH_NO_DATA = 1329 -exports.ER_SP_DUP_PARAM = 1330 -exports.ER_SP_DUP_VAR = 1331 -exports.ER_SP_DUP_COND = 1332 -exports.ER_SP_DUP_CURS = 1333 -exports.ER_SP_CANT_ALTER = 1334 -exports.ER_SP_SUBSELECT_NYI = 1335 -exports.ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG = 1336 -exports.ER_SP_VARCOND_AFTER_CURSHNDLR = 1337 -exports.ER_SP_CURSOR_AFTER_HANDLER = 1338 -exports.ER_SP_CASE_NOT_FOUND = 1339 -exports.ER_FPARSER_TOO_BIG_FILE = 1340 -exports.ER_FPARSER_BAD_HEADER = 1341 -exports.ER_FPARSER_EOF_IN_COMMENT = 1342 -exports.ER_FPARSER_ERROR_IN_PARAMETER = 1343 -exports.ER_FPARSER_EOF_IN_UNKNOWN_PARAMETER = 1344 -exports.ER_VIEW_NO_EXPLAIN = 1345 -exports.ER_FRM_UNKNOWN_TYPE = 1346 -exports.ER_WRONG_OBJECT = 1347 -exports.ER_NONUPDATEABLE_COLUMN = 1348 -exports.ER_VIEW_SELECT_DERIVED = 1349 -exports.ER_VIEW_SELECT_CLAUSE = 1350 -exports.ER_VIEW_SELECT_VARIABLE = 1351 -exports.ER_VIEW_SELECT_TMPTABLE = 1352 -exports.ER_VIEW_WRONG_LIST = 1353 -exports.ER_WARN_VIEW_MERGE = 1354 -exports.ER_WARN_VIEW_WITHOUT_KEY = 1355 -exports.ER_VIEW_INVALID = 1356 -exports.ER_SP_NO_DROP_SP = 1357 -exports.ER_SP_GOTO_IN_HNDLR = 1358 -exports.ER_TRG_ALREADY_EXISTS = 1359 -exports.ER_TRG_DOES_NOT_EXIST = 1360 -exports.ER_TRG_ON_VIEW_OR_TEMP_TABLE = 1361 -exports.ER_TRG_CANT_CHANGE_ROW = 1362 -exports.ER_TRG_NO_SUCH_ROW_IN_TRG = 1363 -exports.ER_NO_DEFAULT_FOR_FIELD = 1364 -exports.ER_DIVISION_BY_ZERO = 1365 -exports.ER_TRUNCATED_WRONG_VALUE_FOR_FIELD = 1366 -exports.ER_ILLEGAL_VALUE_FOR_TYPE = 1367 -exports.ER_VIEW_NONUPD_CHECK = 1368 -exports.ER_VIEW_CHECK_FAILED = 1369 -exports.ER_PROCACCESS_DENIED_ERROR = 1370 -exports.ER_RELAY_LOG_FAIL = 1371 -exports.ER_PASSWD_LENGTH = 1372 -exports.ER_UNKNOWN_TARGET_BINLOG = 1373 -exports.ER_IO_ERR_LOG_INDEX_READ = 1374 -exports.ER_BINLOG_PURGE_PROHIBITED = 1375 -exports.ER_FSEEK_FAIL = 1376 -exports.ER_BINLOG_PURGE_FATAL_ERR = 1377 -exports.ER_LOG_IN_USE = 1378 -exports.ER_LOG_PURGE_UNKNOWN_ERR = 1379 -exports.ER_RELAY_LOG_INIT = 1380 -exports.ER_NO_BINARY_LOGGING = 1381 -exports.ER_RESERVED_SYNTAX = 1382 -exports.ER_WSAS_FAILED = 1383 -exports.ER_DIFF_GROUPS_PROC = 1384 -exports.ER_NO_GROUP_FOR_PROC = 1385 -exports.ER_ORDER_WITH_PROC = 1386 -exports.ER_LOGGING_PROHIBIT_CHANGING_OF = 1387 -exports.ER_NO_FILE_MAPPING = 1388 -exports.ER_WRONG_MAGIC = 1389 -exports.ER_PS_MANY_PARAM = 1390 -exports.ER_KEY_PART_0 = 1391 -exports.ER_VIEW_CHECKSUM = 1392 -exports.ER_VIEW_MULTIUPDATE = 1393 -exports.ER_VIEW_NO_INSERT_FIELD_LIST = 1394 -exports.ER_VIEW_DELETE_MERGE_VIEW = 1395 -exports.ER_CANNOT_USER = 1396 -exports.ER_XAER_NOTA = 1397 -exports.ER_XAER_INVAL = 1398 -exports.ER_XAER_RMFAIL = 1399 -exports.ER_XAER_OUTSIDE = 1400 -exports.ER_XAER_RMERR = 1401 -exports.ER_XA_RBROLLBACK = 1402 -exports.ER_NONEXISTING_PROC_GRANT = 1403 -exports.ER_PROC_AUTO_GRANT_FAIL = 1404 -exports.ER_PROC_AUTO_REVOKE_FAIL = 1405 -exports.ER_DATA_TOO_LONG = 1406 -exports.ER_SP_BAD_SQLSTATE = 1407 -exports.ER_STARTUP = 1408 -exports.ER_LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR = 1409 -exports.ER_CANT_CREATE_USER_WITH_GRANT = 1410 -exports.ER_WRONG_VALUE_FOR_TYPE = 1411 -exports.ER_TABLE_DEF_CHANGED = 1412 -exports.ER_SP_DUP_HANDLER = 1413 -exports.ER_SP_NOT_VAR_ARG = 1414 -exports.ER_SP_NO_RETSET = 1415 -exports.ER_CANT_CREATE_GEOMETRY_OBJECT = 1416 -exports.ER_FAILED_ROUTINE_BREAK_BINLOG = 1417 -exports.ER_BINLOG_UNSAFE_ROUTINE = 1418 -exports.ER_BINLOG_CREATE_ROUTINE_NEED_SUPER = 1419 -exports.ER_EXEC_STMT_WITH_OPEN_CURSOR = 1420 -exports.ER_STMT_HAS_NO_OPEN_CURSOR = 1421 -exports.ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG = 1422 -exports.ER_NO_DEFAULT_FOR_VIEW_FIELD = 1423 -exports.ER_SP_NO_RECURSION = 1424 -exports.ER_TOO_BIG_SCALE = 1425 -exports.ER_TOO_BIG_PRECISION = 1426 -exports.ER_M_BIGGER_THAN_D = 1427 -exports.ER_WRONG_LOCK_OF_SYSTEM_TABLE = 1428 -exports.ER_CONNECT_TO_FOREIGN_DATA_SOURCE = 1429 -exports.ER_QUERY_ON_FOREIGN_DATA_SOURCE = 1430 -exports.ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST = 1431 -exports.ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE = 1432 -exports.ER_FOREIGN_DATA_STRING_INVALID = 1433 -exports.ER_CANT_CREATE_FEDERATED_TABLE = 1434 -exports.ER_TRG_IN_WRONG_SCHEMA = 1435 -exports.ER_STACK_OVERRUN_NEED_MORE = 1436 -exports.ER_TOO_LONG_BODY = 1437 -exports.ER_WARN_CANT_DROP_DEFAULT_KEYCACHE = 1438 -exports.ER_TOO_BIG_DISPLAYWIDTH = 1439 -exports.ER_XAER_DUPID = 1440 -exports.ER_DATETIME_FUNCTION_OVERFLOW = 1441 -exports.ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG = 1442 -exports.ER_VIEW_PREVENT_UPDATE = 1443 -exports.ER_PS_NO_RECURSION = 1444 -exports.ER_SP_CANT_SET_AUTOCOMMIT = 1445 -exports.ER_MALFORMED_DEFINER = 1446 -exports.ER_VIEW_FRM_NO_USER = 1447 -exports.ER_VIEW_OTHER_USER = 1448 -exports.ER_NO_SUCH_USER = 1449 -exports.ER_FORBID_SCHEMA_CHANGE = 1450 -exports.ER_ROW_IS_REFERENCED_2 = 1451 -exports.ER_NO_REFERENCED_ROW_2 = 1452 -exports.ER_SP_BAD_VAR_SHADOW = 1453 -exports.ER_TRG_NO_DEFINER = 1454 -exports.ER_OLD_FILE_FORMAT = 1455 -exports.ER_SP_RECURSION_LIMIT = 1456 -exports.ER_SP_PROC_TABLE_CORRUPT = 1457 -exports.ER_SP_WRONG_NAME = 1458 -exports.ER_TABLE_NEEDS_UPGRADE = 1459 -exports.ER_SP_NO_AGGREGATE = 1460 -exports.ER_MAX_PREPARED_STMT_COUNT_REACHED = 1461 -exports.ER_VIEW_RECURSIVE = 1462 -exports.ER_NON_GROUPING_FIELD_USED = 1463 -exports.ER_TABLE_CANT_HANDLE_SPKEYS = 1464 -exports.ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA = 1465 -exports.ER_REMOVED_SPACES = 1466 -exports.ER_AUTOINC_READ_FAILED = 1467 -exports.ER_USERNAME = 1468 -exports.ER_HOSTNAME = 1469 -exports.ER_WRONG_STRING_LENGTH = 1470 -exports.ER_NON_INSERTABLE_TABLE = 1471 -exports.ER_ADMIN_WRONG_MRG_TABLE = 1472 -exports.ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT = 1473 -exports.ER_NAME_BECOMES_EMPTY = 1474 -exports.ER_AMBIGUOUS_FIELD_TERM = 1475 -exports.ER_FOREIGN_SERVER_EXISTS = 1476 -exports.ER_FOREIGN_SERVER_DOESNT_EXIST = 1477 -exports.ER_ILLEGAL_HA_CREATE_OPTION = 1478 -exports.ER_PARTITION_REQUIRES_VALUES_ERROR = 1479 -exports.ER_PARTITION_WRONG_VALUES_ERROR = 1480 -exports.ER_PARTITION_MAXVALUE_ERROR = 1481 -exports.ER_PARTITION_SUBPARTITION_ERROR = 1482 -exports.ER_PARTITION_SUBPART_MIX_ERROR = 1483 -exports.ER_PARTITION_WRONG_NO_PART_ERROR = 1484 -exports.ER_PARTITION_WRONG_NO_SUBPART_ERROR = 1485 -exports.ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR = 1486 -exports.ER_NO_CONST_EXPR_IN_RANGE_OR_LIST_ERROR = 1487 -exports.ER_FIELD_NOT_FOUND_PART_ERROR = 1488 -exports.ER_LIST_OF_FIELDS_ONLY_IN_HASH_ERROR = 1489 -exports.ER_INCONSISTENT_PARTITION_INFO_ERROR = 1490 -exports.ER_PARTITION_FUNC_NOT_ALLOWED_ERROR = 1491 -exports.ER_PARTITIONS_MUST_BE_DEFINED_ERROR = 1492 -exports.ER_RANGE_NOT_INCREASING_ERROR = 1493 -exports.ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR = 1494 -exports.ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR = 1495 -exports.ER_PARTITION_ENTRY_ERROR = 1496 -exports.ER_MIX_HANDLER_ERROR = 1497 -exports.ER_PARTITION_NOT_DEFINED_ERROR = 1498 -exports.ER_TOO_MANY_PARTITIONS_ERROR = 1499 -exports.ER_SUBPARTITION_ERROR = 1500 -exports.ER_CANT_CREATE_HANDLER_FILE = 1501 -exports.ER_BLOB_FIELD_IN_PART_FUNC_ERROR = 1502 -exports.ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF = 1503 -exports.ER_NO_PARTS_ERROR = 1504 -exports.ER_PARTITION_MGMT_ON_NONPARTITIONED = 1505 -exports.ER_FOREIGN_KEY_ON_PARTITIONED = 1506 -exports.ER_DROP_PARTITION_NON_EXISTENT = 1507 -exports.ER_DROP_LAST_PARTITION = 1508 -exports.ER_COALESCE_ONLY_ON_HASH_PARTITION = 1509 -exports.ER_REORG_HASH_ONLY_ON_SAME_NO = 1510 -exports.ER_REORG_NO_PARAM_ERROR = 1511 -exports.ER_ONLY_ON_RANGE_LIST_PARTITION = 1512 -exports.ER_ADD_PARTITION_SUBPART_ERROR = 1513 -exports.ER_ADD_PARTITION_NO_NEW_PARTITION = 1514 -exports.ER_COALESCE_PARTITION_NO_PARTITION = 1515 -exports.ER_REORG_PARTITION_NOT_EXIST = 1516 -exports.ER_SAME_NAME_PARTITION = 1517 -exports.ER_NO_BINLOG_ERROR = 1518 -exports.ER_CONSECUTIVE_REORG_PARTITIONS = 1519 -exports.ER_REORG_OUTSIDE_RANGE = 1520 -exports.ER_PARTITION_FUNCTION_FAILURE = 1521 -exports.ER_PART_STATE_ERROR = 1522 -exports.ER_LIMITED_PART_RANGE = 1523 -exports.ER_PLUGIN_IS_NOT_LOADED = 1524 -exports.ER_WRONG_VALUE = 1525 -exports.ER_NO_PARTITION_FOR_GIVEN_VALUE = 1526 -exports.ER_FILEGROUP_OPTION_ONLY_ONCE = 1527 -exports.ER_CREATE_FILEGROUP_FAILED = 1528 -exports.ER_DROP_FILEGROUP_FAILED = 1529 -exports.ER_TABLESPACE_AUTO_EXTEND_ERROR = 1530 -exports.ER_WRONG_SIZE_NUMBER = 1531 -exports.ER_SIZE_OVERFLOW_ERROR = 1532 -exports.ER_ALTER_FILEGROUP_FAILED = 1533 -exports.ER_BINLOG_ROW_LOGGING_FAILED = 1534 -exports.ER_BINLOG_ROW_WRONG_TABLE_DEF = 1535 -exports.ER_BINLOG_ROW_RBR_TO_SBR = 1536 -exports.ER_EVENT_ALREADY_EXISTS = 1537 -exports.ER_EVENT_STORE_FAILED = 1538 -exports.ER_EVENT_DOES_NOT_EXIST = 1539 -exports.ER_EVENT_CANT_ALTER = 1540 -exports.ER_EVENT_DROP_FAILED = 1541 -exports.ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG = 1542 -exports.ER_EVENT_ENDS_BEFORE_STARTS = 1543 -exports.ER_EVENT_EXEC_TIME_IN_THE_PAST = 1544 -exports.ER_EVENT_OPEN_TABLE_FAILED = 1545 -exports.ER_EVENT_NEITHER_M_EXPR_NOR_M_AT = 1546 -exports.ER_COL_COUNT_DOESNT_MATCH_CORRUPTED = 1547 -exports.ER_CANNOT_LOAD_FROM_TABLE = 1548 -exports.ER_EVENT_CANNOT_DELETE = 1549 -exports.ER_EVENT_COMPILE_ERROR = 1550 -exports.ER_EVENT_SAME_NAME = 1551 -exports.ER_EVENT_DATA_TOO_LONG = 1552 -exports.ER_DROP_INDEX_FK = 1553 -exports.ER_WARN_DEPRECATED_SYNTAX_WITH_VER = 1554 -exports.ER_CANT_WRITE_LOCK_LOG_TABLE = 1555 -exports.ER_CANT_LOCK_LOG_TABLE = 1556 -exports.ER_FOREIGN_DUPLICATE_KEY = 1557 -exports.ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE = 1558 -exports.ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR = 1559 -exports.ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT = 1560 -exports.ER_NDB_CANT_SWITCH_BINLOG_FORMAT = 1561 -exports.ER_PARTITION_NO_TEMPORARY = 1562 -exports.ER_PARTITION_CONST_DOMAIN_ERROR = 1563 -exports.ER_PARTITION_FUNCTION_IS_NOT_ALLOWED = 1564 -exports.ER_DDL_LOG_ERROR = 1565 -exports.ER_NULL_IN_VALUES_LESS_THAN = 1566 -exports.ER_WRONG_PARTITION_NAME = 1567 -exports.ER_CANT_CHANGE_TX_CHARACTERISTICS = 1568 -exports.ER_DUP_ENTRY_AUTOINCREMENT_CASE = 1569 -exports.ER_EVENT_MODIFY_QUEUE_ERROR = 1570 -exports.ER_EVENT_SET_VAR_ERROR = 1571 -exports.ER_PARTITION_MERGE_ERROR = 1572 -exports.ER_CANT_ACTIVATE_LOG = 1573 -exports.ER_RBR_NOT_AVAILABLE = 1574 -exports.ER_BASE64_DECODE_ERROR = 1575 -exports.ER_EVENT_RECURSION_FORBIDDEN = 1576 -exports.ER_EVENTS_DB_ERROR = 1577 -exports.ER_ONLY_INTEGERS_ALLOWED = 1578 -exports.ER_UNSUPORTED_LOG_ENGINE = 1579 -exports.ER_BAD_LOG_STATEMENT = 1580 -exports.ER_CANT_RENAME_LOG_TABLE = 1581 -exports.ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT = 1582 -exports.ER_WRONG_PARAMETERS_TO_NATIVE_FCT = 1583 -exports.ER_WRONG_PARAMETERS_TO_STORED_FCT = 1584 -exports.ER_NATIVE_FCT_NAME_COLLISION = 1585 -exports.ER_DUP_ENTRY_WITH_KEY_NAME = 1586 -exports.ER_BINLOG_PURGE_EMFILE = 1587 -exports.ER_EVENT_CANNOT_CREATE_IN_THE_PAST = 1588 -exports.ER_EVENT_CANNOT_ALTER_IN_THE_PAST = 1589 -exports.ER_SLAVE_INCIDENT = 1590 -exports.ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT = 1591 -exports.ER_BINLOG_UNSAFE_STATEMENT = 1592 -exports.ER_BINLOG_FATAL_ERROR = 1593 -exports.ER_SLAVE_RELAY_LOG_READ_FAILURE = 1594 -exports.ER_SLAVE_RELAY_LOG_WRITE_FAILURE = 1595 -exports.ER_SLAVE_CREATE_EVENT_FAILURE = 1596 -exports.ER_SLAVE_MASTER_COM_FAILURE = 1597 -exports.ER_BINLOG_LOGGING_IMPOSSIBLE = 1598 -exports.ER_VIEW_NO_CREATION_CTX = 1599 -exports.ER_VIEW_INVALID_CREATION_CTX = 1600 -exports.ER_SR_INVALID_CREATION_CTX = 1601 -exports.ER_TRG_CORRUPTED_FILE = 1602 -exports.ER_TRG_NO_CREATION_CTX = 1603 -exports.ER_TRG_INVALID_CREATION_CTX = 1604 -exports.ER_EVENT_INVALID_CREATION_CTX = 1605 -exports.ER_TRG_CANT_OPEN_TABLE = 1606 -exports.ER_CANT_CREATE_SROUTINE = 1607 -exports.ER_NEVER_USED = 1608 -exports.ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT = 1609 -exports.ER_REPLICA_CORRUPT_EVENT = 1610 -exports.ER_LOAD_DATA_INVALID_COLUMN = 1611 -exports.ER_LOG_PURGE_NO_FILE = 1612 -exports.ER_XA_RBTIMEOUT = 1613 -exports.ER_XA_RBDEADLOCK = 1614 -exports.ER_NEED_REPREPARE = 1615 -exports.ER_DELAYED_NOT_SUPPORTED = 1616 -exports.WARN_NO_CONNECTION_METADATA = 1617 -exports.WARN_OPTION_IGNORED = 1618 -exports.ER_PLUGIN_DELETE_BUILTIN = 1619 -exports.WARN_PLUGIN_BUSY = 1620 -exports.ER_VARIABLE_IS_READONLY = 1621 -exports.ER_WARN_ENGINE_TRANSACTION_ROLLBACK = 1622 -exports.ER_SLAVE_HEARTBEAT_FAILURE = 1623 -exports.ER_REPLICA_HEARTBEAT_VALUE_OUT_OF_RANGE = 1624 -exports.ER_NDB_REPLICATION_SCHEMA_ERROR = 1625 -exports.ER_CONFLICT_FN_PARSE_ERROR = 1626 -exports.ER_EXCEPTIONS_WRITE_ERROR = 1627 -exports.ER_TOO_LONG_TABLE_COMMENT = 1628 -exports.ER_TOO_LONG_FIELD_COMMENT = 1629 -exports.ER_FUNC_INEXISTENT_NAME_COLLISION = 1630 -exports.ER_DATABASE_NAME = 1631 -exports.ER_TABLE_NAME = 1632 -exports.ER_PARTITION_NAME = 1633 -exports.ER_SUBPARTITION_NAME = 1634 -exports.ER_TEMPORARY_NAME = 1635 -exports.ER_RENAMED_NAME = 1636 -exports.ER_TOO_MANY_CONCURRENT_TRXS = 1637 -exports.WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED = 1638 -exports.ER_DEBUG_SYNC_TIMEOUT = 1639 -exports.ER_DEBUG_SYNC_HIT_LIMIT = 1640 -exports.ER_DUP_SIGNAL_SET = 1641 -exports.ER_SIGNAL_WARN = 1642 -exports.ER_SIGNAL_NOT_FOUND = 1643 -exports.ER_SIGNAL_EXCEPTION = 1644 -exports.ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER = 1645 -exports.ER_SIGNAL_BAD_CONDITION_TYPE = 1646 -exports.WARN_COND_ITEM_TRUNCATED = 1647 -exports.ER_COND_ITEM_TOO_LONG = 1648 -exports.ER_UNKNOWN_LOCALE = 1649 -exports.ER_REPLICA_IGNORE_SERVER_IDS = 1650 -exports.ER_QUERY_CACHE_DISABLED = 1651 -exports.ER_SAME_NAME_PARTITION_FIELD = 1652 -exports.ER_PARTITION_COLUMN_LIST_ERROR = 1653 -exports.ER_WRONG_TYPE_COLUMN_VALUE_ERROR = 1654 -exports.ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR = 1655 -exports.ER_MAXVALUE_IN_VALUES_IN = 1656 -exports.ER_TOO_MANY_VALUES_ERROR = 1657 -exports.ER_ROW_SINGLE_PARTITION_FIELD_ERROR = 1658 -exports.ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD = 1659 -exports.ER_PARTITION_FIELDS_TOO_LONG = 1660 -exports.ER_BINLOG_ROW_ENGINE_AND_STMT_ENGINE = 1661 -exports.ER_BINLOG_ROW_MODE_AND_STMT_ENGINE = 1662 -exports.ER_BINLOG_UNSAFE_AND_STMT_ENGINE = 1663 -exports.ER_BINLOG_ROW_INJECTION_AND_STMT_ENGINE = 1664 -exports.ER_BINLOG_STMT_MODE_AND_ROW_ENGINE = 1665 -exports.ER_BINLOG_ROW_INJECTION_AND_STMT_MODE = 1666 -exports.ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE = 1667 -exports.ER_BINLOG_UNSAFE_LIMIT = 1668 -exports.ER_UNUSED4 = 1669 -exports.ER_BINLOG_UNSAFE_SYSTEM_TABLE = 1670 -exports.ER_BINLOG_UNSAFE_AUTOINC_COLUMNS = 1671 -exports.ER_BINLOG_UNSAFE_UDF = 1672 -exports.ER_BINLOG_UNSAFE_SYSTEM_VARIABLE = 1673 -exports.ER_BINLOG_UNSAFE_SYSTEM_FUNCTION = 1674 -exports.ER_BINLOG_UNSAFE_NONTRANS_AFTER_TRANS = 1675 -exports.ER_MESSAGE_AND_STATEMENT = 1676 -exports.ER_SLAVE_CONVERSION_FAILED = 1677 -exports.ER_REPLICA_CANT_CREATE_CONVERSION = 1678 -exports.ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT = 1679 -exports.ER_PATH_LENGTH = 1680 -exports.ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT = 1681 -exports.ER_WRONG_NATIVE_TABLE_STRUCTURE = 1682 -exports.ER_WRONG_PERFSCHEMA_USAGE = 1683 -exports.ER_WARN_I_S_SKIPPED_TABLE = 1684 -exports.ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT = 1685 -exports.ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_DIRECT = 1686 -exports.ER_SPATIAL_MUST_HAVE_GEOM_COL = 1687 -exports.ER_TOO_LONG_INDEX_COMMENT = 1688 -exports.ER_LOCK_ABORTED = 1689 -exports.ER_DATA_OUT_OF_RANGE = 1690 -exports.ER_WRONG_SPVAR_TYPE_IN_LIMIT = 1691 -exports.ER_BINLOG_UNSAFE_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE = 1692 -exports.ER_BINLOG_UNSAFE_MIXED_STATEMENT = 1693 -exports.ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SQL_LOG_BIN = 1694 -exports.ER_STORED_FUNCTION_PREVENTS_SWITCH_SQL_LOG_BIN = 1695 -exports.ER_FAILED_READ_FROM_PAR_FILE = 1696 -exports.ER_VALUES_IS_NOT_INT_TYPE_ERROR = 1697 -exports.ER_ACCESS_DENIED_NO_PASSWORD_ERROR = 1698 -exports.ER_SET_PASSWORD_AUTH_PLUGIN = 1699 -exports.ER_GRANT_PLUGIN_USER_EXISTS = 1700 -exports.ER_TRUNCATE_ILLEGAL_FK = 1701 -exports.ER_PLUGIN_IS_PERMANENT = 1702 -exports.ER_REPLICA_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN = 1703 -exports.ER_REPLICA_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX = 1704 -exports.ER_STMT_CACHE_FULL = 1705 -exports.ER_MULTI_UPDATE_KEY_CONFLICT = 1706 -exports.ER_TABLE_NEEDS_REBUILD = 1707 -exports.WARN_OPTION_BELOW_LIMIT = 1708 -exports.ER_INDEX_COLUMN_TOO_LONG = 1709 -exports.ER_ERROR_IN_TRIGGER_BODY = 1710 -exports.ER_ERROR_IN_UNKNOWN_TRIGGER_BODY = 1711 -exports.ER_INDEX_CORRUPT = 1712 -exports.ER_UNDO_RECORD_TOO_BIG = 1713 -exports.ER_BINLOG_UNSAFE_INSERT_IGNORE_SELECT = 1714 -exports.ER_BINLOG_UNSAFE_INSERT_SELECT_UPDATE = 1715 -exports.ER_BINLOG_UNSAFE_REPLACE_SELECT = 1716 -exports.ER_BINLOG_UNSAFE_CREATE_IGNORE_SELECT = 1717 -exports.ER_BINLOG_UNSAFE_CREATE_REPLACE_SELECT = 1718 -exports.ER_BINLOG_UNSAFE_UPDATE_IGNORE = 1719 -exports.ER_PLUGIN_NO_UNINSTALL = 1720 -exports.ER_PLUGIN_NO_INSTALL = 1721 -exports.ER_BINLOG_UNSAFE_WRITE_AUTOINC_SELECT = 1722 -exports.ER_BINLOG_UNSAFE_CREATE_SELECT_AUTOINC = 1723 -exports.ER_BINLOG_UNSAFE_INSERT_TWO_KEYS = 1724 -exports.ER_TABLE_IN_FK_CHECK = 1725 -exports.ER_UNSUPPORTED_ENGINE = 1726 -exports.ER_BINLOG_UNSAFE_AUTOINC_NOT_FIRST = 1727 -exports.ER_CANNOT_LOAD_FROM_TABLE_V2 = 1728 -exports.ER_SOURCE_DELAY_VALUE_OUT_OF_RANGE = 1729 -exports.ER_ONLY_FD_AND_RBR_EVENTS_ALLOWED_IN_BINLOG_STATEMENT = 1730 -exports.ER_PARTITION_EXCHANGE_DIFFERENT_OPTION = 1731 -exports.ER_PARTITION_EXCHANGE_PART_TABLE = 1732 -exports.ER_PARTITION_EXCHANGE_TEMP_TABLE = 1733 -exports.ER_PARTITION_INSTEAD_OF_SUBPARTITION = 1734 -exports.ER_UNKNOWN_PARTITION = 1735 -exports.ER_TABLES_DIFFERENT_METADATA = 1736 -exports.ER_ROW_DOES_NOT_MATCH_PARTITION = 1737 -exports.ER_BINLOG_CACHE_SIZE_GREATER_THAN_MAX = 1738 -exports.ER_WARN_INDEX_NOT_APPLICABLE = 1739 -exports.ER_PARTITION_EXCHANGE_FOREIGN_KEY = 1740 -exports.ER_NO_SUCH_KEY_VALUE = 1741 -exports.ER_RPL_INFO_DATA_TOO_LONG = 1742 -exports.ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE = 1743 -exports.ER_BINLOG_READ_EVENT_CHECKSUM_FAILURE = 1744 -exports.ER_BINLOG_STMT_CACHE_SIZE_GREATER_THAN_MAX = 1745 -exports.ER_CANT_UPDATE_TABLE_IN_CREATE_TABLE_SELECT = 1746 -exports.ER_PARTITION_CLAUSE_ON_NONPARTITIONED = 1747 -exports.ER_ROW_DOES_NOT_MATCH_GIVEN_PARTITION_SET = 1748 -exports.ER_NO_SUCH_PARTITION = 1749 -exports.ER_CHANGE_RPL_INFO_REPOSITORY_FAILURE = 1750 -exports.ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_CREATED_TEMP_TABLE = 1751 -exports.ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_DROPPED_TEMP_TABLE = 1752 -exports.ER_MTA_FEATURE_IS_NOT_SUPPORTED = 1753 -exports.ER_MTA_UPDATED_DBS_GREATER_MAX = 1754 -exports.ER_MTA_CANT_PARALLEL = 1755 -exports.ER_MTA_INCONSISTENT_DATA = 1756 -exports.ER_FULLTEXT_NOT_SUPPORTED_WITH_PARTITIONING = 1757 -exports.ER_DA_INVALID_CONDITION_NUMBER = 1758 -exports.ER_INSECURE_PLAIN_TEXT = 1759 -exports.ER_INSECURE_CHANGE_SOURCE = 1760 -exports.ER_FOREIGN_DUPLICATE_KEY_WITH_CHILD_INFO = 1761 -exports.ER_FOREIGN_DUPLICATE_KEY_WITHOUT_CHILD_INFO = 1762 -exports.ER_SQLTHREAD_WITH_SECURE_REPLICA = 1763 -exports.ER_TABLE_HAS_NO_FT = 1764 -exports.ER_VARIABLE_NOT_SETTABLE_IN_SF_OR_TRIGGER = 1765 -exports.ER_VARIABLE_NOT_SETTABLE_IN_TRANSACTION = 1766 -exports.ER_GTID_NEXT_IS_NOT_IN_GTID_NEXT_LIST = 1767 -exports.ER_CANT_CHANGE_GTID_NEXT_IN_TRANSACTION = 1768 -exports.ER_SET_STATEMENT_CANNOT_INVOKE_FUNCTION = 1769 -exports.ER_GTID_NEXT_CANT_BE_AUTOMATIC_IF_GTID_NEXT_LIST_IS_NON_NULL = 1770 -exports.ER_SKIPPING_LOGGED_TRANSACTION = 1771 -exports.ER_MALFORMED_GTID_SET_SPECIFICATION = 1772 -exports.ER_MALFORMED_GTID_SET_ENCODING = 1773 -exports.ER_MALFORMED_GTID_SPECIFICATION = 1774 -exports.ER_GNO_EXHAUSTED = 1775 -exports.ER_BAD_REPLICA_AUTO_POSITION = 1776 -exports.ER_AUTO_POSITION_REQUIRES_GTID_MODE_NOT_OFF = 1777 -exports.ER_CANT_DO_IMPLICIT_COMMIT_IN_TRX_WHEN_GTID_NEXT_IS_SET = 1778 -exports.ER_GTID_MODE_ON_REQUIRES_ENFORCE_GTID_CONSISTENCY_ON = 1779 -exports.ER_GTID_MODE_REQUIRES_BINLOG = 1780 -exports.ER_CANT_SET_GTID_NEXT_TO_GTID_WHEN_GTID_MODE_IS_OFF = 1781 -exports.ER_CANT_SET_GTID_NEXT_TO_ANONYMOUS_WHEN_GTID_MODE_IS_ON = 1782 -exports.ER_CANT_SET_GTID_NEXT_LIST_TO_NON_NULL_WHEN_GTID_MODE_IS_OFF = 1783 -exports.ER_FOUND_GTID_EVENT_WHEN_GTID_MODE_IS_OFF = 1784 -exports.ER_GTID_UNSAFE_NON_TRANSACTIONAL_TABLE = 1785 -exports.ER_GTID_UNSAFE_CREATE_SELECT = 1786 -exports.ER_GTID_UNSAFE_CREATE_DROP_TEMP_TABLE_IN_TRANSACTION = 1787 -exports.ER_GTID_MODE_CAN_ONLY_CHANGE_ONE_STEP_AT_A_TIME = 1788 -exports.ER_SOURCE_HAS_PURGED_REQUIRED_GTIDS = 1789 -exports.ER_CANT_SET_GTID_NEXT_WHEN_OWNING_GTID = 1790 -exports.ER_UNKNOWN_EXPLAIN_FORMAT = 1791 -exports.ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION = 1792 -exports.ER_TOO_LONG_TABLE_PARTITION_COMMENT = 1793 -exports.ER_REPLICA_CONFIGURATION = 1794 -exports.ER_INNODB_FT_LIMIT = 1795 -exports.ER_INNODB_NO_FT_TEMP_TABLE = 1796 -exports.ER_INNODB_FT_WRONG_DOCID_COLUMN = 1797 -exports.ER_INNODB_FT_WRONG_DOCID_INDEX = 1798 -exports.ER_INNODB_ONLINE_LOG_TOO_BIG = 1799 -exports.ER_UNKNOWN_ALTER_ALGORITHM = 1800 -exports.ER_UNKNOWN_ALTER_LOCK = 1801 -exports.ER_MTA_CHANGE_SOURCE_CANT_RUN_WITH_GAPS = 1802 -exports.ER_MTA_RECOVERY_FAILURE = 1803 -exports.ER_MTA_RESET_WORKERS = 1804 -exports.ER_COL_COUNT_DOESNT_MATCH_CORRUPTED_V2 = 1805 -exports.ER_REPLICA_SILENT_RETRY_TRANSACTION = 1806 -exports.ER_DISCARD_FK_CHECKS_RUNNING = 1807 -exports.ER_TABLE_SCHEMA_MISMATCH = 1808 -exports.ER_TABLE_IN_SYSTEM_TABLESPACE = 1809 -exports.ER_IO_READ_ERROR = 1810 -exports.ER_IO_WRITE_ERROR = 1811 -exports.ER_TABLESPACE_MISSING = 1812 -exports.ER_TABLESPACE_EXISTS = 1813 -exports.ER_TABLESPACE_DISCARDED = 1814 -exports.ER_INTERNAL_ERROR = 1815 -exports.ER_INNODB_IMPORT_ERROR = 1816 -exports.ER_INNODB_INDEX_CORRUPT = 1817 -exports.ER_INVALID_YEAR_COLUMN_LENGTH = 1818 -exports.ER_NOT_VALID_PASSWORD = 1819 -exports.ER_MUST_CHANGE_PASSWORD = 1820 -exports.ER_FK_NO_INDEX_CHILD = 1821 -exports.ER_FK_NO_INDEX_PARENT = 1822 -exports.ER_FK_FAIL_ADD_SYSTEM = 1823 -exports.ER_FK_CANNOT_OPEN_PARENT = 1824 -exports.ER_FK_INCORRECT_OPTION = 1825 -exports.ER_FK_DUP_NAME = 1826 -exports.ER_PASSWORD_FORMAT = 1827 -exports.ER_FK_COLUMN_CANNOT_DROP = 1828 -exports.ER_FK_COLUMN_CANNOT_DROP_CHILD = 1829 -exports.ER_FK_COLUMN_NOT_NULL = 1830 -exports.ER_DUP_INDEX = 1831 -exports.ER_FK_COLUMN_CANNOT_CHANGE = 1832 -exports.ER_FK_COLUMN_CANNOT_CHANGE_CHILD = 1833 -exports.ER_UNUSED5 = 1834 -exports.ER_MALFORMED_PACKET = 1835 -exports.ER_READ_ONLY_MODE = 1836 -exports.ER_GTID_NEXT_TYPE_UNDEFINED_GTID = 1837 -exports.ER_VARIABLE_NOT_SETTABLE_IN_SP = 1838 -exports.ER_CANT_SET_GTID_PURGED_WHEN_GTID_MODE_IS_OFF = 1839 -exports.ER_CANT_SET_GTID_PURGED_WHEN_GTID_EXECUTED_IS_NOT_EMPTY = 1840 -exports.ER_CANT_SET_GTID_PURGED_WHEN_OWNED_GTIDS_IS_NOT_EMPTY = 1841 -exports.ER_GTID_PURGED_WAS_CHANGED = 1842 -exports.ER_GTID_EXECUTED_WAS_CHANGED = 1843 -exports.ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES = 1844 -exports.ER_ALTER_OPERATION_NOT_SUPPORTED = 1845 -exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON = 1846 -exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COPY = 1847 -exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_PARTITION = 1848 -exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_RENAME = 1849 -exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COLUMN_TYPE = 1850 -exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_CHECK = 1851 -exports.ER_UNUSED6 = 1852 -exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOPK = 1853 -exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_AUTOINC = 1854 -exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_HIDDEN_FTS = 1855 -exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_CHANGE_FTS = 1856 -exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FTS = 1857 -exports.ER_SQL_REPLICA_SKIP_COUNTER_NOT_SETTABLE_IN_GTID_MODE = 1858 -exports.ER_DUP_UNKNOWN_IN_INDEX = 1859 -exports.ER_IDENT_CAUSES_TOO_LONG_PATH = 1860 -exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOT_NULL = 1861 -exports.ER_MUST_CHANGE_PASSWORD_LOGIN = 1862 -exports.ER_ROW_IN_WRONG_PARTITION = 1863 -exports.ER_MTA_EVENT_BIGGER_PENDING_JOBS_SIZE_MAX = 1864 -exports.ER_INNODB_NO_FT_USES_PARSER = 1865 -exports.ER_BINLOG_LOGICAL_CORRUPTION = 1866 -exports.ER_WARN_PURGE_LOG_IN_USE = 1867 -exports.ER_WARN_PURGE_LOG_IS_ACTIVE = 1868 -exports.ER_AUTO_INCREMENT_CONFLICT = 1869 -exports.WARN_ON_BLOCKHOLE_IN_RBR = 1870 -exports.ER_REPLICA_CM_INIT_REPOSITORY = 1871 -exports.ER_REPLICA_AM_INIT_REPOSITORY = 1872 -exports.ER_ACCESS_DENIED_CHANGE_USER_ERROR = 1873 -exports.ER_INNODB_READ_ONLY = 1874 -exports.ER_STOP_REPLICA_SQL_THREAD_TIMEOUT = 1875 -exports.ER_STOP_REPLICA_IO_THREAD_TIMEOUT = 1876 -exports.ER_TABLE_CORRUPT = 1877 -exports.ER_TEMP_FILE_WRITE_FAILURE = 1878 -exports.ER_INNODB_FT_AUX_NOT_HEX_ID = 1879 -exports.ER_OLD_TEMPORALS_UPGRADED = 1880 -exports.ER_INNODB_FORCED_RECOVERY = 1881 -exports.ER_AES_INVALID_IV = 1882 -exports.ER_PLUGIN_CANNOT_BE_UNINSTALLED = 1883 -exports.ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_ASSIGNED_GTID = 1884 -exports.ER_REPLICA_HAS_MORE_GTIDS_THAN_SOURCE = 1885 -exports.ER_MISSING_KEY = 1886 -exports.WARN_NAMED_PIPE_ACCESS_EVERYONE = 1887 -exports.ER_FILE_CORRUPT = 3000 -exports.ER_ERROR_ON_SOURCE = 3001 -exports.ER_INCONSISTENT_ERROR = 3002 -exports.ER_STORAGE_ENGINE_NOT_LOADED = 3003 -exports.ER_GET_STACKED_DA_WITHOUT_ACTIVE_HANDLER = 3004 -exports.ER_WARN_LEGACY_SYNTAX_CONVERTED = 3005 -exports.ER_BINLOG_UNSAFE_FULLTEXT_PLUGIN = 3006 -exports.ER_CANNOT_DISCARD_TEMPORARY_TABLE = 3007 -exports.ER_FK_DEPTH_EXCEEDED = 3008 -exports.ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE_V2 = 3009 -exports.ER_WARN_TRIGGER_DOESNT_HAVE_CREATED = 3010 -exports.ER_REFERENCED_TRG_DOES_NOT_EXIST = 3011 -exports.ER_EXPLAIN_NOT_SUPPORTED = 3012 -exports.ER_INVALID_FIELD_SIZE = 3013 -exports.ER_MISSING_HA_CREATE_OPTION = 3014 -exports.ER_ENGINE_OUT_OF_MEMORY = 3015 -exports.ER_PASSWORD_EXPIRE_ANONYMOUS_USER = 3016 -exports.ER_REPLICA_SQL_THREAD_MUST_STOP = 3017 -exports.ER_NO_FT_MATERIALIZED_SUBQUERY = 3018 -exports.ER_INNODB_UNDO_LOG_FULL = 3019 -exports.ER_INVALID_ARGUMENT_FOR_LOGARITHM = 3020 -exports.ER_REPLICA_CHANNEL_IO_THREAD_MUST_STOP = 3021 -exports.ER_WARN_OPEN_TEMP_TABLES_MUST_BE_ZERO = 3022 -exports.ER_WARN_ONLY_SOURCE_LOG_FILE_NO_POS = 3023 -exports.ER_QUERY_TIMEOUT = 3024 -exports.ER_NON_RO_SELECT_DISABLE_TIMER = 3025 -exports.ER_DUP_LIST_ENTRY = 3026 -exports.ER_SQL_MODE_NO_EFFECT = 3027 -exports.ER_AGGREGATE_ORDER_FOR_UNION = 3028 -exports.ER_AGGREGATE_ORDER_NON_AGG_QUERY = 3029 -exports.ER_REPLICA_WORKER_STOPPED_PREVIOUS_THD_ERROR = 3030 -exports.ER_DONT_SUPPORT_REPLICA_PRESERVE_COMMIT_ORDER = 3031 -exports.ER_SERVER_OFFLINE_MODE = 3032 -exports.ER_GIS_DIFFERENT_SRIDS = 3033 -exports.ER_GIS_UNSUPPORTED_ARGUMENT = 3034 -exports.ER_GIS_UNKNOWN_ERROR = 3035 -exports.ER_GIS_UNKNOWN_EXCEPTION = 3036 -exports.ER_GIS_INVALID_DATA = 3037 -exports.ER_BOOST_GEOMETRY_EMPTY_INPUT_EXCEPTION = 3038 -exports.ER_BOOST_GEOMETRY_CENTROID_EXCEPTION = 3039 -exports.ER_BOOST_GEOMETRY_OVERLAY_INVALID_INPUT_EXCEPTION = 3040 -exports.ER_BOOST_GEOMETRY_TURN_INFO_EXCEPTION = 3041 -exports.ER_BOOST_GEOMETRY_SELF_INTERSECTION_POINT_EXCEPTION = 3042 -exports.ER_BOOST_GEOMETRY_UNKNOWN_EXCEPTION = 3043 -exports.ER_STD_BAD_ALLOC_ERROR = 3044 -exports.ER_STD_DOMAIN_ERROR = 3045 -exports.ER_STD_LENGTH_ERROR = 3046 -exports.ER_STD_INVALID_ARGUMENT = 3047 -exports.ER_STD_OUT_OF_RANGE_ERROR = 3048 -exports.ER_STD_OVERFLOW_ERROR = 3049 -exports.ER_STD_RANGE_ERROR = 3050 -exports.ER_STD_UNDERFLOW_ERROR = 3051 -exports.ER_STD_LOGIC_ERROR = 3052 -exports.ER_STD_RUNTIME_ERROR = 3053 -exports.ER_STD_UNKNOWN_EXCEPTION = 3054 -exports.ER_GIS_DATA_WRONG_ENDIANESS = 3055 -exports.ER_CHANGE_SOURCE_PASSWORD_LENGTH = 3056 -exports.ER_USER_LOCK_WRONG_NAME = 3057 -exports.ER_USER_LOCK_DEADLOCK = 3058 -exports.ER_REPLACE_INACCESSIBLE_ROWS = 3059 -exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_GIS = 3060 -exports.ER_ILLEGAL_USER_VAR = 3061 -exports.ER_GTID_MODE_OFF = 3062 -exports.ER_UNSUPPORTED_BY_REPLICATION_THREAD = 3063 -exports.ER_INCORRECT_TYPE = 3064 -exports.ER_FIELD_IN_ORDER_NOT_SELECT = 3065 -exports.ER_AGGREGATE_IN_ORDER_NOT_SELECT = 3066 -exports.ER_INVALID_RPL_WILD_TABLE_FILTER_PATTERN = 3067 -exports.ER_NET_OK_PACKET_TOO_LARGE = 3068 -exports.ER_INVALID_JSON_DATA = 3069 -exports.ER_INVALID_GEOJSON_MISSING_MEMBER = 3070 -exports.ER_INVALID_GEOJSON_WRONG_TYPE = 3071 -exports.ER_INVALID_GEOJSON_UNSPECIFIED = 3072 -exports.ER_DIMENSION_UNSUPPORTED = 3073 -exports.ER_REPLICA_CHANNEL_DOES_NOT_EXIST = 3074 -exports.ER_SLAVE_MULTIPLE_CHANNELS_HOST_PORT = 3075 -exports.ER_REPLICA_CHANNEL_NAME_INVALID_OR_TOO_LONG = 3076 -exports.ER_REPLICA_NEW_CHANNEL_WRONG_REPOSITORY = 3077 -exports.ER_SLAVE_CHANNEL_DELETE = 3078 -exports.ER_REPLICA_MULTIPLE_CHANNELS_CMD = 3079 -exports.ER_REPLICA_MAX_CHANNELS_EXCEEDED = 3080 -exports.ER_REPLICA_CHANNEL_MUST_STOP = 3081 -exports.ER_REPLICA_CHANNEL_NOT_RUNNING = 3082 -exports.ER_REPLICA_CHANNEL_WAS_RUNNING = 3083 -exports.ER_REPLICA_CHANNEL_WAS_NOT_RUNNING = 3084 -exports.ER_REPLICA_CHANNEL_SQL_THREAD_MUST_STOP = 3085 -exports.ER_REPLICA_CHANNEL_SQL_SKIP_COUNTER = 3086 -exports.ER_WRONG_FIELD_WITH_GROUP_V2 = 3087 -exports.ER_MIX_OF_GROUP_FUNC_AND_FIELDS_V2 = 3088 -exports.ER_WARN_DEPRECATED_SYSVAR_UPDATE = 3089 -exports.ER_WARN_DEPRECATED_SQLMODE = 3090 -exports.ER_CANNOT_LOG_PARTIAL_DROP_DATABASE_WITH_GTID = 3091 -exports.ER_GROUP_REPLICATION_CONFIGURATION = 3092 -exports.ER_GROUP_REPLICATION_RUNNING = 3093 -exports.ER_GROUP_REPLICATION_APPLIER_INIT_ERROR = 3094 -exports.ER_GROUP_REPLICATION_STOP_APPLIER_THREAD_TIMEOUT = 3095 -exports.ER_GROUP_REPLICATION_COMMUNICATION_LAYER_SESSION_ERROR = 3096 -exports.ER_GROUP_REPLICATION_COMMUNICATION_LAYER_JOIN_ERROR = 3097 -exports.ER_BEFORE_DML_VALIDATION_ERROR = 3098 -exports.ER_PREVENTS_VARIABLE_WITHOUT_RBR = 3099 -exports.ER_RUN_HOOK_ERROR = 3100 -exports.ER_TRANSACTION_ROLLBACK_DURING_COMMIT = 3101 -exports.ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED = 3102 -exports.ER_UNSUPPORTED_ALTER_INPLACE_ON_VIRTUAL_COLUMN = 3103 -exports.ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN = 3104 -exports.ER_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN = 3105 -exports.ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN = 3106 -exports.ER_GENERATED_COLUMN_NON_PRIOR = 3107 -exports.ER_DEPENDENT_BY_GENERATED_COLUMN = 3108 -exports.ER_GENERATED_COLUMN_REF_AUTO_INC = 3109 -exports.ER_FEATURE_NOT_AVAILABLE = 3110 -exports.ER_CANT_SET_GTID_MODE = 3111 -exports.ER_CANT_USE_AUTO_POSITION_WITH_GTID_MODE_OFF = 3112 -exports.ER_CANT_REPLICATE_ANONYMOUS_WITH_AUTO_POSITION = 3113 -exports.ER_CANT_REPLICATE_ANONYMOUS_WITH_GTID_MODE_ON = 3114 -exports.ER_CANT_REPLICATE_GTID_WITH_GTID_MODE_OFF = 3115 -exports.ER_CANT_ENFORCE_GTID_CONSISTENCY_WITH_ONGOING_GTID_VIOLATING_TX = 3116 -exports.ER_ENFORCE_GTID_CONSISTENCY_WARN_WITH_ONGOING_GTID_VIOLATING_TX = 3117 -exports.ER_ACCOUNT_HAS_BEEN_LOCKED = 3118 -exports.ER_WRONG_TABLESPACE_NAME = 3119 -exports.ER_TABLESPACE_IS_NOT_EMPTY = 3120 -exports.ER_WRONG_FILE_NAME = 3121 -exports.ER_BOOST_GEOMETRY_INCONSISTENT_TURNS_EXCEPTION = 3122 -exports.ER_WARN_OPTIMIZER_HINT_SYNTAX_ERROR = 3123 -exports.ER_WARN_BAD_MAX_EXECUTION_TIME = 3124 -exports.ER_WARN_UNSUPPORTED_MAX_EXECUTION_TIME = 3125 -exports.ER_WARN_CONFLICTING_HINT = 3126 -exports.ER_WARN_UNKNOWN_QB_NAME = 3127 -exports.ER_UNRESOLVED_HINT_NAME = 3128 -exports.ER_WARN_ON_MODIFYING_GTID_EXECUTED_TABLE = 3129 -exports.ER_PLUGGABLE_PROTOCOL_COMMAND_NOT_SUPPORTED = 3130 -exports.ER_LOCKING_SERVICE_WRONG_NAME = 3131 -exports.ER_LOCKING_SERVICE_DEADLOCK = 3132 -exports.ER_LOCKING_SERVICE_TIMEOUT = 3133 -exports.ER_GIS_MAX_POINTS_IN_GEOMETRY_OVERFLOWED = 3134 -exports.ER_SQL_MODE_MERGED = 3135 -exports.ER_VTOKEN_PLUGIN_TOKEN_MISMATCH = 3136 -exports.ER_VTOKEN_PLUGIN_TOKEN_NOT_FOUND = 3137 -exports.ER_CANT_SET_VARIABLE_WHEN_OWNING_GTID = 3138 -exports.ER_REPLICA_CHANNEL_OPERATION_NOT_ALLOWED = 3139 -exports.ER_INVALID_JSON_TEXT = 3140 -exports.ER_INVALID_JSON_TEXT_IN_PARAM = 3141 -exports.ER_INVALID_JSON_BINARY_DATA = 3142 -exports.ER_INVALID_JSON_PATH = 3143 -exports.ER_INVALID_JSON_CHARSET = 3144 -exports.ER_INVALID_JSON_CHARSET_IN_FUNCTION = 3145 -exports.ER_INVALID_TYPE_FOR_JSON = 3146 -exports.ER_INVALID_CAST_TO_JSON = 3147 -exports.ER_INVALID_JSON_PATH_CHARSET = 3148 -exports.ER_INVALID_JSON_PATH_WILDCARD = 3149 -exports.ER_JSON_VALUE_TOO_BIG = 3150 -exports.ER_JSON_KEY_TOO_BIG = 3151 -exports.ER_JSON_USED_AS_KEY = 3152 -exports.ER_JSON_VACUOUS_PATH = 3153 -exports.ER_JSON_BAD_ONE_OR_ALL_ARG = 3154 -exports.ER_NUMERIC_JSON_VALUE_OUT_OF_RANGE = 3155 -exports.ER_INVALID_JSON_VALUE_FOR_CAST = 3156 -exports.ER_JSON_DOCUMENT_TOO_DEEP = 3157 -exports.ER_JSON_DOCUMENT_NULL_KEY = 3158 -exports.ER_SECURE_TRANSPORT_REQUIRED = 3159 -exports.ER_NO_SECURE_TRANSPORTS_CONFIGURED = 3160 -exports.ER_DISABLED_STORAGE_ENGINE = 3161 -exports.ER_USER_DOES_NOT_EXIST = 3162 -exports.ER_USER_ALREADY_EXISTS = 3163 -exports.ER_AUDIT_API_ABORT = 3164 -exports.ER_INVALID_JSON_PATH_ARRAY_CELL = 3165 -exports.ER_BUFPOOL_RESIZE_INPROGRESS = 3166 -exports.ER_FEATURE_DISABLED_SEE_DOC = 3167 -exports.ER_SERVER_ISNT_AVAILABLE = 3168 -exports.ER_SESSION_WAS_KILLED = 3169 -exports.ER_CAPACITY_EXCEEDED = 3170 -exports.ER_CAPACITY_EXCEEDED_IN_RANGE_OPTIMIZER = 3171 -exports.ER_TABLE_NEEDS_UPG_PART = 3172 -exports.ER_CANT_WAIT_FOR_EXECUTED_GTID_SET_WHILE_OWNING_A_GTID = 3173 -exports.ER_CANNOT_ADD_FOREIGN_BASE_COL_VIRTUAL = 3174 -exports.ER_CANNOT_CREATE_VIRTUAL_INDEX_CONSTRAINT = 3175 -exports.ER_ERROR_ON_MODIFYING_GTID_EXECUTED_TABLE = 3176 -exports.ER_LOCK_REFUSED_BY_ENGINE = 3177 -exports.ER_UNSUPPORTED_ALTER_ONLINE_ON_VIRTUAL_COLUMN = 3178 -exports.ER_MASTER_KEY_ROTATION_NOT_SUPPORTED_BY_SE = 3179 -exports.ER_MASTER_KEY_ROTATION_ERROR_BY_SE = 3180 -exports.ER_MASTER_KEY_ROTATION_BINLOG_FAILED = 3181 -exports.ER_MASTER_KEY_ROTATION_SE_UNAVAILABLE = 3182 -exports.ER_TABLESPACE_CANNOT_ENCRYPT = 3183 -exports.ER_INVALID_ENCRYPTION_OPTION = 3184 -exports.ER_CANNOT_FIND_KEY_IN_KEYRING = 3185 -exports.ER_CAPACITY_EXCEEDED_IN_PARSER = 3186 -exports.ER_UNSUPPORTED_ALTER_ENCRYPTION_INPLACE = 3187 -exports.ER_KEYRING_UDF_KEYRING_SERVICE_ERROR = 3188 -exports.ER_USER_COLUMN_OLD_LENGTH = 3189 -exports.ER_CANT_RESET_SOURCE = 3190 -exports.ER_GROUP_REPLICATION_MAX_GROUP_SIZE = 3191 -exports.ER_CANNOT_ADD_FOREIGN_BASE_COL_STORED = 3192 -exports.ER_TABLE_REFERENCED = 3193 -exports.ER_PARTITION_ENGINE_DEPRECATED_FOR_TABLE = 3194 -exports.ER_WARN_USING_GEOMFROMWKB_TO_SET_SRID_ZERO = 3195 -exports.ER_WARN_USING_GEOMFROMWKB_TO_SET_SRID = 3196 -exports.ER_XA_RETRY = 3197 -exports.ER_KEYRING_AWS_UDF_AWS_KMS_ERROR = 3198 -exports.ER_BINLOG_UNSAFE_XA = 3199 -exports.ER_UDF_ERROR = 3200 -exports.ER_KEYRING_MIGRATION_FAILURE = 3201 -exports.ER_KEYRING_ACCESS_DENIED_ERROR = 3202 -exports.ER_KEYRING_MIGRATION_STATUS = 3203 -exports.ER_PLUGIN_FAILED_TO_OPEN_TABLES = 3204 -exports.ER_PLUGIN_FAILED_TO_OPEN_TABLE = 3205 -exports.ER_AUDIT_LOG_NO_KEYRING_PLUGIN_INSTALLED = 3206 -exports.ER_AUDIT_LOG_ENCRYPTION_PASSWORD_HAS_NOT_BEEN_SET = 3207 -exports.ER_AUDIT_LOG_COULD_NOT_CREATE_AES_KEY = 3208 -exports.ER_AUDIT_LOG_ENCRYPTION_PASSWORD_CANNOT_BE_FETCHED = 3209 -exports.ER_AUDIT_LOG_JSON_FILTERING_NOT_ENABLED = 3210 -exports.ER_AUDIT_LOG_UDF_INSUFFICIENT_PRIVILEGE = 3211 -exports.ER_AUDIT_LOG_SUPER_PRIVILEGE_REQUIRED = 3212 -exports.ER_COULD_NOT_REINITIALIZE_AUDIT_LOG_FILTERS = 3213 -exports.ER_AUDIT_LOG_UDF_INVALID_ARGUMENT_TYPE = 3214 -exports.ER_AUDIT_LOG_UDF_INVALID_ARGUMENT_COUNT = 3215 -exports.ER_AUDIT_LOG_HAS_NOT_BEEN_INSTALLED = 3216 -exports.ER_AUDIT_LOG_UDF_READ_INVALID_MAX_ARRAY_LENGTH_ARG_TYPE = 3217 -exports.ER_AUDIT_LOG_UDF_READ_INVALID_MAX_ARRAY_LENGTH_ARG_VALUE = 3218 -exports.ER_AUDIT_LOG_JSON_FILTER_PARSING_ERROR = 3219 -exports.ER_AUDIT_LOG_JSON_FILTER_NAME_CANNOT_BE_EMPTY = 3220 -exports.ER_AUDIT_LOG_JSON_USER_NAME_CANNOT_BE_EMPTY = 3221 -exports.ER_AUDIT_LOG_JSON_FILTER_DOES_NOT_EXISTS = 3222 -exports.ER_AUDIT_LOG_USER_FIRST_CHARACTER_MUST_BE_ALPHANUMERIC = 3223 -exports.ER_AUDIT_LOG_USER_NAME_INVALID_CHARACTER = 3224 -exports.ER_AUDIT_LOG_HOST_NAME_INVALID_CHARACTER = 3225 -exports.WARN_DEPRECATED_MAXDB_SQL_MODE_FOR_TIMESTAMP = 3226 -exports.ER_XA_REPLICATION_FILTERS = 3227 -exports.ER_CANT_OPEN_ERROR_LOG = 3228 -exports.ER_GROUPING_ON_TIMESTAMP_IN_DST = 3229 -exports.ER_CANT_START_SERVER_NAMED_PIPE = 3230 -exports.ER_WRITE_SET_EXCEEDS_LIMIT = 3231 -exports.ER_DEPRECATED_TLS_VERSION_SESSION_57 = 3232 -exports.ER_WARN_DEPRECATED_TLS_VERSION_57 = 3233 -exports.ER_WARN_WRONG_NATIVE_TABLE_STRUCTURE = 3234 -exports.ER_AES_INVALID_KDF_NAME = 3235 -exports.ER_AES_INVALID_KDF_ITERATIONS = 3236 -exports.WARN_AES_KEY_SIZE = 3237 -exports.ER_AES_INVALID_KDF_OPTION_SIZE = 3238 -exports.ER_UNSUPPORT_COMPRESSED_TEMPORARY_TABLE = 3500 -exports.ER_ACL_OPERATION_FAILED = 3501 -exports.ER_UNSUPPORTED_INDEX_ALGORITHM = 3502 -exports.ER_NO_SUCH_DB = 3503 -exports.ER_TOO_BIG_ENUM = 3504 -exports.ER_TOO_LONG_SET_ENUM_VALUE = 3505 -exports.ER_INVALID_DD_OBJECT = 3506 -exports.ER_UPDATING_DD_TABLE = 3507 -exports.ER_INVALID_DD_OBJECT_ID = 3508 -exports.ER_INVALID_DD_OBJECT_NAME = 3509 -exports.ER_TABLESPACE_MISSING_WITH_NAME = 3510 -exports.ER_TOO_LONG_ROUTINE_COMMENT = 3511 -exports.ER_SP_LOAD_FAILED = 3512 -exports.ER_INVALID_BITWISE_OPERANDS_SIZE = 3513 -exports.ER_INVALID_BITWISE_AGGREGATE_OPERANDS_SIZE = 3514 -exports.ER_WARN_UNSUPPORTED_HINT = 3515 -exports.ER_UNEXPECTED_GEOMETRY_TYPE = 3516 -exports.ER_SRS_PARSE_ERROR = 3517 -exports.ER_SRS_PROJ_PARAMETER_MISSING = 3518 -exports.ER_WARN_SRS_NOT_FOUND = 3519 -exports.ER_SRS_NOT_CARTESIAN = 3520 -exports.ER_SRS_NOT_CARTESIAN_UNDEFINED = 3521 -exports.ER_PK_INDEX_CANT_BE_INVISIBLE = 3522 -exports.ER_UNKNOWN_AUTHID = 3523 -exports.ER_FAILED_ROLE_GRANT = 3524 -exports.ER_OPEN_ROLE_TABLES = 3525 -exports.ER_FAILED_DEFAULT_ROLES = 3526 -exports.ER_COMPONENTS_NO_SCHEME = 3527 -exports.ER_COMPONENTS_NO_SCHEME_SERVICE = 3528 -exports.ER_COMPONENTS_CANT_LOAD = 3529 -exports.ER_ROLE_NOT_GRANTED = 3530 -exports.ER_FAILED_REVOKE_ROLE = 3531 -exports.ER_RENAME_ROLE = 3532 -exports.ER_COMPONENTS_CANT_ACQUIRE_SERVICE_IMPLEMENTATION = 3533 -exports.ER_COMPONENTS_CANT_SATISFY_DEPENDENCY = 3534 -exports.ER_COMPONENTS_LOAD_CANT_REGISTER_SERVICE_IMPLEMENTATION = 3535 -exports.ER_COMPONENTS_LOAD_CANT_INITIALIZE = 3536 -exports.ER_COMPONENTS_UNLOAD_NOT_LOADED = 3537 -exports.ER_COMPONENTS_UNLOAD_CANT_DEINITIALIZE = 3538 -exports.ER_COMPONENTS_CANT_RELEASE_SERVICE = 3539 -exports.ER_COMPONENTS_UNLOAD_CANT_UNREGISTER_SERVICE = 3540 -exports.ER_COMPONENTS_CANT_UNLOAD = 3541 -exports.ER_WARN_UNLOAD_THE_NOT_PERSISTED = 3542 -exports.ER_COMPONENT_TABLE_INCORRECT = 3543 -exports.ER_COMPONENT_MANIPULATE_ROW_FAILED = 3544 -exports.ER_COMPONENTS_UNLOAD_DUPLICATE_IN_GROUP = 3545 -exports.ER_CANT_SET_GTID_PURGED_DUE_SETS_CONSTRAINTS = 3546 -exports.ER_CANNOT_LOCK_USER_MANAGEMENT_CACHES = 3547 -exports.ER_SRS_NOT_FOUND = 3548 -exports.ER_VARIABLE_NOT_PERSISTED = 3549 -exports.ER_IS_QUERY_INVALID_CLAUSE = 3550 -exports.ER_UNABLE_TO_STORE_STATISTICS = 3551 -exports.ER_NO_SYSTEM_SCHEMA_ACCESS = 3552 -exports.ER_NO_SYSTEM_TABLESPACE_ACCESS = 3553 -exports.ER_NO_SYSTEM_TABLE_ACCESS = 3554 -exports.ER_NO_SYSTEM_TABLE_ACCESS_FOR_DICTIONARY_TABLE = 3555 -exports.ER_NO_SYSTEM_TABLE_ACCESS_FOR_SYSTEM_TABLE = 3556 -exports.ER_NO_SYSTEM_TABLE_ACCESS_FOR_TABLE = 3557 -exports.ER_INVALID_OPTION_KEY = 3558 -exports.ER_INVALID_OPTION_VALUE = 3559 -exports.ER_INVALID_OPTION_KEY_VALUE_PAIR = 3560 -exports.ER_INVALID_OPTION_START_CHARACTER = 3561 -exports.ER_INVALID_OPTION_END_CHARACTER = 3562 -exports.ER_INVALID_OPTION_CHARACTERS = 3563 -exports.ER_DUPLICATE_OPTION_KEY = 3564 -exports.ER_WARN_SRS_NOT_FOUND_AXIS_ORDER = 3565 -exports.ER_NO_ACCESS_TO_NATIVE_FCT = 3566 -exports.ER_RESET_SOURCE_TO_VALUE_OUT_OF_RANGE = 3567 -exports.ER_UNRESOLVED_TABLE_LOCK = 3568 -exports.ER_DUPLICATE_TABLE_LOCK = 3569 -exports.ER_BINLOG_UNSAFE_SKIP_LOCKED = 3570 -exports.ER_BINLOG_UNSAFE_NOWAIT = 3571 -exports.ER_LOCK_NOWAIT = 3572 -exports.ER_CTE_RECURSIVE_REQUIRES_UNION = 3573 -exports.ER_CTE_RECURSIVE_REQUIRES_NONRECURSIVE_FIRST = 3574 -exports.ER_CTE_RECURSIVE_FORBIDS_AGGREGATION = 3575 -exports.ER_CTE_RECURSIVE_FORBIDDEN_JOIN_ORDER = 3576 -exports.ER_CTE_RECURSIVE_REQUIRES_SINGLE_REFERENCE = 3577 -exports.ER_SWITCH_TMP_ENGINE = 3578 -exports.ER_WINDOW_NO_SUCH_WINDOW = 3579 -exports.ER_WINDOW_CIRCULARITY_IN_WINDOW_GRAPH = 3580 -exports.ER_WINDOW_NO_CHILD_PARTITIONING = 3581 -exports.ER_WINDOW_NO_INHERIT_FRAME = 3582 -exports.ER_WINDOW_NO_REDEFINE_ORDER_BY = 3583 -exports.ER_WINDOW_FRAME_START_ILLEGAL = 3584 -exports.ER_WINDOW_FRAME_END_ILLEGAL = 3585 -exports.ER_WINDOW_FRAME_ILLEGAL = 3586 -exports.ER_WINDOW_RANGE_FRAME_ORDER_TYPE = 3587 -exports.ER_WINDOW_RANGE_FRAME_TEMPORAL_TYPE = 3588 -exports.ER_WINDOW_RANGE_FRAME_NUMERIC_TYPE = 3589 -exports.ER_WINDOW_RANGE_BOUND_NOT_CONSTANT = 3590 -exports.ER_WINDOW_DUPLICATE_NAME = 3591 -exports.ER_WINDOW_ILLEGAL_ORDER_BY = 3592 -exports.ER_WINDOW_INVALID_WINDOW_FUNC_USE = 3593 -exports.ER_WINDOW_INVALID_WINDOW_FUNC_ALIAS_USE = 3594 -exports.ER_WINDOW_NESTED_WINDOW_FUNC_USE_IN_WINDOW_SPEC = 3595 -exports.ER_WINDOW_ROWS_INTERVAL_USE = 3596 -exports.ER_WINDOW_NO_GROUP_ORDER = 3597 -exports.ER_WINDOW_EXPLAIN_JSON = 3598 -exports.ER_WINDOW_FUNCTION_IGNORES_FRAME = 3599 -exports.ER_WL9236_NOW = 3600 -exports.ER_INVALID_NO_OF_ARGS = 3601 -exports.ER_FIELD_IN_GROUPING_NOT_GROUP_BY = 3602 -exports.ER_TOO_LONG_TABLESPACE_COMMENT = 3603 -exports.ER_ENGINE_CANT_DROP_TABLE = 3604 -exports.ER_ENGINE_CANT_DROP_MISSING_TABLE = 3605 -exports.ER_TABLESPACE_DUP_FILENAME = 3606 -exports.ER_DB_DROP_RMDIR2 = 3607 -exports.ER_IMP_NO_FILES_MATCHED = 3608 -exports.ER_IMP_SCHEMA_DOES_NOT_EXIST = 3609 -exports.ER_IMP_TABLE_ALREADY_EXISTS = 3610 -exports.ER_IMP_INCOMPATIBLE_MYSQLD_VERSION = 3611 -exports.ER_IMP_INCOMPATIBLE_DD_VERSION = 3612 -exports.ER_IMP_INCOMPATIBLE_SDI_VERSION = 3613 -exports.ER_WARN_INVALID_HINT = 3614 -exports.ER_VAR_DOES_NOT_EXIST = 3615 -exports.ER_LONGITUDE_OUT_OF_RANGE = 3616 -exports.ER_LATITUDE_OUT_OF_RANGE = 3617 -exports.ER_NOT_IMPLEMENTED_FOR_GEOGRAPHIC_SRS = 3618 -exports.ER_ILLEGAL_PRIVILEGE_LEVEL = 3619 -exports.ER_NO_SYSTEM_VIEW_ACCESS = 3620 -exports.ER_COMPONENT_FILTER_FLABBERGASTED = 3621 -exports.ER_PART_EXPR_TOO_LONG = 3622 -exports.ER_UDF_DROP_DYNAMICALLY_REGISTERED = 3623 -exports.ER_UNABLE_TO_STORE_COLUMN_STATISTICS = 3624 -exports.ER_UNABLE_TO_UPDATE_COLUMN_STATISTICS = 3625 -exports.ER_UNABLE_TO_DROP_COLUMN_STATISTICS = 3626 -exports.ER_UNABLE_TO_BUILD_HISTOGRAM = 3627 -exports.ER_MANDATORY_ROLE = 3628 -exports.ER_MISSING_TABLESPACE_FILE = 3629 -exports.ER_PERSIST_ONLY_ACCESS_DENIED_ERROR = 3630 -exports.ER_CMD_NEED_SUPER = 3631 -exports.ER_PATH_IN_DATADIR = 3632 -exports.ER_CLONE_DDL_IN_PROGRESS = 3633 -exports.ER_CLONE_TOO_MANY_CONCURRENT_CLONES = 3634 -exports.ER_APPLIER_LOG_EVENT_VALIDATION_ERROR = 3635 -exports.ER_CTE_MAX_RECURSION_DEPTH = 3636 -exports.ER_NOT_HINT_UPDATABLE_VARIABLE = 3637 -exports.ER_CREDENTIALS_CONTRADICT_TO_HISTORY = 3638 -exports.ER_WARNING_PASSWORD_HISTORY_CLAUSES_VOID = 3639 -exports.ER_CLIENT_DOES_NOT_SUPPORT = 3640 -exports.ER_I_S_SKIPPED_TABLESPACE = 3641 -exports.ER_TABLESPACE_ENGINE_MISMATCH = 3642 -exports.ER_WRONG_SRID_FOR_COLUMN = 3643 -exports.ER_CANNOT_ALTER_SRID_DUE_TO_INDEX = 3644 -exports.ER_WARN_BINLOG_PARTIAL_UPDATES_DISABLED = 3645 -exports.ER_WARN_BINLOG_V1_ROW_EVENTS_DISABLED = 3646 -exports.ER_WARN_BINLOG_PARTIAL_UPDATES_SUGGESTS_PARTIAL_IMAGES = 3647 -exports.ER_COULD_NOT_APPLY_JSON_DIFF = 3648 -exports.ER_CORRUPTED_JSON_DIFF = 3649 -exports.ER_RESOURCE_GROUP_EXISTS = 3650 -exports.ER_RESOURCE_GROUP_NOT_EXISTS = 3651 -exports.ER_INVALID_VCPU_ID = 3652 -exports.ER_INVALID_VCPU_RANGE = 3653 -exports.ER_INVALID_THREAD_PRIORITY = 3654 -exports.ER_DISALLOWED_OPERATION = 3655 -exports.ER_RESOURCE_GROUP_BUSY = 3656 -exports.ER_RESOURCE_GROUP_DISABLED = 3657 -exports.ER_FEATURE_UNSUPPORTED = 3658 -exports.ER_ATTRIBUTE_IGNORED = 3659 -exports.ER_INVALID_THREAD_ID = 3660 -exports.ER_RESOURCE_GROUP_BIND_FAILED = 3661 -exports.ER_INVALID_USE_OF_FORCE_OPTION = 3662 -exports.ER_GROUP_REPLICATION_COMMAND_FAILURE = 3663 -exports.ER_SDI_OPERATION_FAILED = 3664 -exports.ER_MISSING_JSON_TABLE_VALUE = 3665 -exports.ER_WRONG_JSON_TABLE_VALUE = 3666 -exports.ER_TF_MUST_HAVE_ALIAS = 3667 -exports.ER_TF_FORBIDDEN_JOIN_TYPE = 3668 -exports.ER_JT_VALUE_OUT_OF_RANGE = 3669 -exports.ER_JT_MAX_NESTED_PATH = 3670 -exports.ER_PASSWORD_EXPIRATION_NOT_SUPPORTED_BY_AUTH_METHOD = 3671 -exports.ER_INVALID_GEOJSON_CRS_NOT_TOP_LEVEL = 3672 -exports.ER_BAD_NULL_ERROR_NOT_IGNORED = 3673 -exports.WARN_USELESS_SPATIAL_INDEX = 3674 -exports.ER_DISK_FULL_NOWAIT = 3675 -exports.ER_PARSE_ERROR_IN_DIGEST_FN = 3676 -exports.ER_UNDISCLOSED_PARSE_ERROR_IN_DIGEST_FN = 3677 -exports.ER_SCHEMA_DIR_EXISTS = 3678 -exports.ER_SCHEMA_DIR_MISSING = 3679 -exports.ER_SCHEMA_DIR_CREATE_FAILED = 3680 -exports.ER_SCHEMA_DIR_UNKNOWN = 3681 -exports.ER_ONLY_IMPLEMENTED_FOR_SRID_0_AND_4326 = 3682 -exports.ER_BINLOG_EXPIRE_LOG_DAYS_AND_SECS_USED_TOGETHER = 3683 -exports.ER_REGEXP_BUFFER_OVERFLOW = 3684 -exports.ER_REGEXP_ILLEGAL_ARGUMENT = 3685 -exports.ER_REGEXP_INDEX_OUTOFBOUNDS_ERROR = 3686 -exports.ER_REGEXP_INTERNAL_ERROR = 3687 -exports.ER_REGEXP_RULE_SYNTAX = 3688 -exports.ER_REGEXP_BAD_ESCAPE_SEQUENCE = 3689 -exports.ER_REGEXP_UNIMPLEMENTED = 3690 -exports.ER_REGEXP_MISMATCHED_PAREN = 3691 -exports.ER_REGEXP_BAD_INTERVAL = 3692 -exports.ER_REGEXP_MAX_LT_MIN = 3693 -exports.ER_REGEXP_INVALID_BACK_REF = 3694 -exports.ER_REGEXP_LOOK_BEHIND_LIMIT = 3695 -exports.ER_REGEXP_MISSING_CLOSE_BRACKET = 3696 -exports.ER_REGEXP_INVALID_RANGE = 3697 -exports.ER_REGEXP_STACK_OVERFLOW = 3698 -exports.ER_REGEXP_TIME_OUT = 3699 -exports.ER_REGEXP_PATTERN_TOO_BIG = 3700 -exports.ER_CANT_SET_ERROR_LOG_SERVICE = 3701 -exports.ER_EMPTY_PIPELINE_FOR_ERROR_LOG_SERVICE = 3702 -exports.ER_COMPONENT_FILTER_DIAGNOSTICS = 3703 -exports.ER_NOT_IMPLEMENTED_FOR_CARTESIAN_SRS = 3704 -exports.ER_NOT_IMPLEMENTED_FOR_PROJECTED_SRS = 3705 -exports.ER_NONPOSITIVE_RADIUS = 3706 -exports.ER_RESTART_SERVER_FAILED = 3707 -exports.ER_SRS_MISSING_MANDATORY_ATTRIBUTE = 3708 -exports.ER_SRS_MULTIPLE_ATTRIBUTE_DEFINITIONS = 3709 -exports.ER_SRS_NAME_CANT_BE_EMPTY_OR_WHITESPACE = 3710 -exports.ER_SRS_ORGANIZATION_CANT_BE_EMPTY_OR_WHITESPACE = 3711 -exports.ER_SRS_ID_ALREADY_EXISTS = 3712 -exports.ER_WARN_SRS_ID_ALREADY_EXISTS = 3713 -exports.ER_CANT_MODIFY_SRID_0 = 3714 -exports.ER_WARN_RESERVED_SRID_RANGE = 3715 -exports.ER_CANT_MODIFY_SRS_USED_BY_COLUMN = 3716 -exports.ER_SRS_INVALID_CHARACTER_IN_ATTRIBUTE = 3717 -exports.ER_SRS_ATTRIBUTE_STRING_TOO_LONG = 3718 -exports.ER_DEPRECATED_UTF8_ALIAS = 3719 -exports.ER_DEPRECATED_NATIONAL = 3720 -exports.ER_INVALID_DEFAULT_UTF8MB4_COLLATION = 3721 -exports.ER_UNABLE_TO_COLLECT_LOG_STATUS = 3722 -exports.ER_RESERVED_TABLESPACE_NAME = 3723 -exports.ER_UNABLE_TO_SET_OPTION = 3724 -exports.ER_REPLICA_POSSIBLY_DIVERGED_AFTER_DDL = 3725 -exports.ER_SRS_NOT_GEOGRAPHIC = 3726 -exports.ER_POLYGON_TOO_LARGE = 3727 -exports.ER_SPATIAL_UNIQUE_INDEX = 3728 -exports.ER_INDEX_TYPE_NOT_SUPPORTED_FOR_SPATIAL_INDEX = 3729 -exports.ER_FK_CANNOT_DROP_PARENT = 3730 -exports.ER_GEOMETRY_PARAM_LONGITUDE_OUT_OF_RANGE = 3731 -exports.ER_GEOMETRY_PARAM_LATITUDE_OUT_OF_RANGE = 3732 -exports.ER_FK_CANNOT_USE_VIRTUAL_COLUMN = 3733 -exports.ER_FK_NO_COLUMN_PARENT = 3734 -exports.ER_CANT_SET_ERROR_SUPPRESSION_LIST = 3735 -exports.ER_SRS_GEOGCS_INVALID_AXES = 3736 -exports.ER_SRS_INVALID_SEMI_MAJOR_AXIS = 3737 -exports.ER_SRS_INVALID_INVERSE_FLATTENING = 3738 -exports.ER_SRS_INVALID_ANGULAR_UNIT = 3739 -exports.ER_SRS_INVALID_PRIME_MERIDIAN = 3740 -exports.ER_TRANSFORM_SOURCE_SRS_NOT_SUPPORTED = 3741 -exports.ER_TRANSFORM_TARGET_SRS_NOT_SUPPORTED = 3742 -exports.ER_TRANSFORM_SOURCE_SRS_MISSING_TOWGS84 = 3743 -exports.ER_TRANSFORM_TARGET_SRS_MISSING_TOWGS84 = 3744 -exports.ER_TEMP_TABLE_PREVENTS_SWITCH_SESSION_BINLOG_FORMAT = 3745 -exports.ER_TEMP_TABLE_PREVENTS_SWITCH_GLOBAL_BINLOG_FORMAT = 3746 -exports.ER_RUNNING_APPLIER_PREVENTS_SWITCH_GLOBAL_BINLOG_FORMAT = 3747 -exports.ER_CLIENT_GTID_UNSAFE_CREATE_DROP_TEMP_TABLE_IN_TRX_IN_SBR = 3748 -exports.ER_XA_CANT_CREATE_MDL_BACKUP = 3749 -exports.ER_TABLE_WITHOUT_PK = 3750 -exports.ER_WARN_DATA_TRUNCATED_FUNCTIONAL_INDEX = 3751 -exports.ER_WARN_DATA_OUT_OF_RANGE_FUNCTIONAL_INDEX = 3752 -exports.ER_FUNCTIONAL_INDEX_ON_JSON_OR_GEOMETRY_FUNCTION = 3753 -exports.ER_FUNCTIONAL_INDEX_REF_AUTO_INCREMENT = 3754 -exports.ER_CANNOT_DROP_COLUMN_FUNCTIONAL_INDEX = 3755 -exports.ER_FUNCTIONAL_INDEX_PRIMARY_KEY = 3756 -exports.ER_FUNCTIONAL_INDEX_ON_LOB = 3757 -exports.ER_FUNCTIONAL_INDEX_FUNCTION_IS_NOT_ALLOWED = 3758 -exports.ER_FULLTEXT_FUNCTIONAL_INDEX = 3759 -exports.ER_SPATIAL_FUNCTIONAL_INDEX = 3760 -exports.ER_WRONG_KEY_COLUMN_FUNCTIONAL_INDEX = 3761 -exports.ER_FUNCTIONAL_INDEX_ON_FIELD = 3762 -exports.ER_GENERATED_COLUMN_NAMED_FUNCTION_IS_NOT_ALLOWED = 3763 -exports.ER_GENERATED_COLUMN_ROW_VALUE = 3764 -exports.ER_GENERATED_COLUMN_VARIABLES = 3765 -exports.ER_DEPENDENT_BY_DEFAULT_GENERATED_VALUE = 3766 -exports.ER_DEFAULT_VAL_GENERATED_NON_PRIOR = 3767 -exports.ER_DEFAULT_VAL_GENERATED_REF_AUTO_INC = 3768 -exports.ER_DEFAULT_VAL_GENERATED_FUNCTION_IS_NOT_ALLOWED = 3769 -exports.ER_DEFAULT_VAL_GENERATED_NAMED_FUNCTION_IS_NOT_ALLOWED = 3770 -exports.ER_DEFAULT_VAL_GENERATED_ROW_VALUE = 3771 -exports.ER_DEFAULT_VAL_GENERATED_VARIABLES = 3772 -exports.ER_DEFAULT_AS_VAL_GENERATED = 3773 -exports.ER_UNSUPPORTED_ACTION_ON_DEFAULT_VAL_GENERATED = 3774 -exports.ER_GTID_UNSAFE_ALTER_ADD_COL_WITH_DEFAULT_EXPRESSION = 3775 -exports.ER_FK_CANNOT_CHANGE_ENGINE = 3776 -exports.ER_WARN_DEPRECATED_USER_SET_EXPR = 3777 -exports.ER_WARN_DEPRECATED_UTF8MB3_COLLATION = 3778 -exports.ER_WARN_DEPRECATED_NESTED_COMMENT_SYNTAX = 3779 -exports.ER_FK_INCOMPATIBLE_COLUMNS = 3780 -exports.ER_GR_HOLD_WAIT_TIMEOUT = 3781 -exports.ER_GR_HOLD_KILLED = 3782 -exports.ER_GR_HOLD_MEMBER_STATUS_ERROR = 3783 -exports.ER_RPL_ENCRYPTION_FAILED_TO_FETCH_KEY = 3784 -exports.ER_RPL_ENCRYPTION_KEY_NOT_FOUND = 3785 -exports.ER_RPL_ENCRYPTION_KEYRING_INVALID_KEY = 3786 -exports.ER_RPL_ENCRYPTION_HEADER_ERROR = 3787 -exports.ER_RPL_ENCRYPTION_FAILED_TO_ROTATE_LOGS = 3788 -exports.ER_RPL_ENCRYPTION_KEY_EXISTS_UNEXPECTED = 3789 -exports.ER_RPL_ENCRYPTION_FAILED_TO_GENERATE_KEY = 3790 -exports.ER_RPL_ENCRYPTION_FAILED_TO_STORE_KEY = 3791 -exports.ER_RPL_ENCRYPTION_FAILED_TO_REMOVE_KEY = 3792 -exports.ER_RPL_ENCRYPTION_UNABLE_TO_CHANGE_OPTION = 3793 -exports.ER_RPL_ENCRYPTION_MASTER_KEY_RECOVERY_FAILED = 3794 -exports.ER_SLOW_LOG_MODE_IGNORED_WHEN_NOT_LOGGING_TO_FILE = 3795 -exports.ER_GRP_TRX_CONSISTENCY_NOT_ALLOWED = 3796 -exports.ER_GRP_TRX_CONSISTENCY_BEFORE = 3797 -exports.ER_GRP_TRX_CONSISTENCY_AFTER_ON_TRX_BEGIN = 3798 -exports.ER_GRP_TRX_CONSISTENCY_BEGIN_NOT_ALLOWED = 3799 -exports.ER_FUNCTIONAL_INDEX_ROW_VALUE_IS_NOT_ALLOWED = 3800 -exports.ER_RPL_ENCRYPTION_FAILED_TO_ENCRYPT = 3801 -exports.ER_PAGE_TRACKING_NOT_STARTED = 3802 -exports.ER_PAGE_TRACKING_RANGE_NOT_TRACKED = 3803 -exports.ER_PAGE_TRACKING_CANNOT_PURGE = 3804 -exports.ER_RPL_ENCRYPTION_CANNOT_ROTATE_BINLOG_MASTER_KEY = 3805 -exports.ER_BINLOG_MASTER_KEY_RECOVERY_OUT_OF_COMBINATION = 3806 -exports.ER_BINLOG_MASTER_KEY_ROTATION_FAIL_TO_OPERATE_KEY = 3807 -exports.ER_BINLOG_MASTER_KEY_ROTATION_FAIL_TO_ROTATE_LOGS = 3808 -exports.ER_BINLOG_MASTER_KEY_ROTATION_FAIL_TO_REENCRYPT_LOG = 3809 -exports.ER_BINLOG_MASTER_KEY_ROTATION_FAIL_TO_CLEANUP_UNUSED_KEYS = 3810 -exports.ER_BINLOG_MASTER_KEY_ROTATION_FAIL_TO_CLEANUP_AUX_KEY = 3811 -exports.ER_NON_BOOLEAN_EXPR_FOR_CHECK_CONSTRAINT = 3812 -exports.ER_COLUMN_CHECK_CONSTRAINT_REFERENCES_OTHER_COLUMN = 3813 -exports.ER_CHECK_CONSTRAINT_NAMED_FUNCTION_IS_NOT_ALLOWED = 3814 -exports.ER_CHECK_CONSTRAINT_FUNCTION_IS_NOT_ALLOWED = 3815 -exports.ER_CHECK_CONSTRAINT_VARIABLES = 3816 -exports.ER_CHECK_CONSTRAINT_ROW_VALUE = 3817 -exports.ER_CHECK_CONSTRAINT_REFERS_AUTO_INCREMENT_COLUMN = 3818 -exports.ER_CHECK_CONSTRAINT_VIOLATED = 3819 -exports.ER_CHECK_CONSTRAINT_REFERS_UNKNOWN_COLUMN = 3820 -exports.ER_CHECK_CONSTRAINT_NOT_FOUND = 3821 -exports.ER_CHECK_CONSTRAINT_DUP_NAME = 3822 -exports.ER_CHECK_CONSTRAINT_CLAUSE_USING_FK_REFER_ACTION_COLUMN = 3823 -exports.WARN_UNENCRYPTED_TABLE_IN_ENCRYPTED_DB = 3824 -exports.ER_INVALID_ENCRYPTION_REQUEST = 3825 -exports.ER_CANNOT_SET_TABLE_ENCRYPTION = 3826 -exports.ER_CANNOT_SET_DATABASE_ENCRYPTION = 3827 -exports.ER_CANNOT_SET_TABLESPACE_ENCRYPTION = 3828 -exports.ER_TABLESPACE_CANNOT_BE_ENCRYPTED = 3829 -exports.ER_TABLESPACE_CANNOT_BE_DECRYPTED = 3830 -exports.ER_TABLESPACE_TYPE_UNKNOWN = 3831 -exports.ER_TARGET_TABLESPACE_UNENCRYPTED = 3832 -exports.ER_CANNOT_USE_ENCRYPTION_CLAUSE = 3833 -exports.ER_INVALID_MULTIPLE_CLAUSES = 3834 -exports.ER_UNSUPPORTED_USE_OF_GRANT_AS = 3835 -exports.ER_UKNOWN_AUTH_ID_OR_ACCESS_DENIED_FOR_GRANT_AS = 3836 -exports.ER_DEPENDENT_BY_FUNCTIONAL_INDEX = 3837 -exports.ER_PLUGIN_NOT_EARLY = 3838 -exports.ER_INNODB_REDO_LOG_ARCHIVE_START_SUBDIR_PATH = 3839 -exports.ER_INNODB_REDO_LOG_ARCHIVE_START_TIMEOUT = 3840 -exports.ER_INNODB_REDO_LOG_ARCHIVE_DIRS_INVALID = 3841 -exports.ER_INNODB_REDO_LOG_ARCHIVE_LABEL_NOT_FOUND = 3842 -exports.ER_INNODB_REDO_LOG_ARCHIVE_DIR_EMPTY = 3843 -exports.ER_INNODB_REDO_LOG_ARCHIVE_NO_SUCH_DIR = 3844 -exports.ER_INNODB_REDO_LOG_ARCHIVE_DIR_CLASH = 3845 -exports.ER_INNODB_REDO_LOG_ARCHIVE_DIR_PERMISSIONS = 3846 -exports.ER_INNODB_REDO_LOG_ARCHIVE_FILE_CREATE = 3847 -exports.ER_INNODB_REDO_LOG_ARCHIVE_ACTIVE = 3848 -exports.ER_INNODB_REDO_LOG_ARCHIVE_INACTIVE = 3849 -exports.ER_INNODB_REDO_LOG_ARCHIVE_FAILED = 3850 -exports.ER_INNODB_REDO_LOG_ARCHIVE_SESSION = 3851 -exports.ER_STD_REGEX_ERROR = 3852 -exports.ER_INVALID_JSON_TYPE = 3853 -exports.ER_CANNOT_CONVERT_STRING = 3854 -exports.ER_DEPENDENT_BY_PARTITION_FUNC = 3855 -exports.ER_WARN_DEPRECATED_FLOAT_AUTO_INCREMENT = 3856 -exports.ER_RPL_CANT_STOP_REPLICA_WHILE_LOCKED_BACKUP = 3857 -exports.ER_WARN_DEPRECATED_FLOAT_DIGITS = 3858 -exports.ER_WARN_DEPRECATED_FLOAT_UNSIGNED = 3859 -exports.ER_WARN_DEPRECATED_INTEGER_DISPLAY_WIDTH = 3860 -exports.ER_WARN_DEPRECATED_ZEROFILL = 3861 -exports.ER_CLONE_DONOR = 3862 -exports.ER_CLONE_PROTOCOL = 3863 -exports.ER_CLONE_DONOR_VERSION = 3864 -exports.ER_CLONE_OS = 3865 -exports.ER_CLONE_PLATFORM = 3866 -exports.ER_CLONE_CHARSET = 3867 -exports.ER_CLONE_CONFIG = 3868 -exports.ER_CLONE_SYS_CONFIG = 3869 -exports.ER_CLONE_PLUGIN_MATCH = 3870 -exports.ER_CLONE_LOOPBACK = 3871 -exports.ER_CLONE_ENCRYPTION = 3872 -exports.ER_CLONE_DISK_SPACE = 3873 -exports.ER_CLONE_IN_PROGRESS = 3874 -exports.ER_CLONE_DISALLOWED = 3875 -exports.ER_CANNOT_GRANT_ROLES_TO_ANONYMOUS_USER = 3876 -exports.ER_SECONDARY_ENGINE_PLUGIN = 3877 -exports.ER_SECOND_PASSWORD_CANNOT_BE_EMPTY = 3878 -exports.ER_DB_ACCESS_DENIED = 3879 -exports.ER_DA_AUTH_ID_WITH_SYSTEM_USER_PRIV_IN_MANDATORY_ROLES = 3880 -exports.ER_DA_RPL_GTID_TABLE_CANNOT_OPEN = 3881 -exports.ER_GEOMETRY_IN_UNKNOWN_LENGTH_UNIT = 3882 -exports.ER_DA_PLUGIN_INSTALL_ERROR = 3883 -exports.ER_NO_SESSION_TEMP = 3884 -exports.ER_DA_UNKNOWN_ERROR_NUMBER = 3885 -exports.ER_COLUMN_CHANGE_SIZE = 3886 -exports.ER_REGEXP_INVALID_CAPTURE_GROUP_NAME = 3887 -exports.ER_DA_SSL_LIBRARY_ERROR = 3888 -exports.ER_SECONDARY_ENGINE = 3889 -exports.ER_SECONDARY_ENGINE_DDL = 3890 -exports.ER_INCORRECT_CURRENT_PASSWORD = 3891 -exports.ER_MISSING_CURRENT_PASSWORD = 3892 -exports.ER_CURRENT_PASSWORD_NOT_REQUIRED = 3893 -exports.ER_PASSWORD_CANNOT_BE_RETAINED_ON_PLUGIN_CHANGE = 3894 -exports.ER_CURRENT_PASSWORD_CANNOT_BE_RETAINED = 3895 -exports.ER_PARTIAL_REVOKES_EXIST = 3896 -exports.ER_CANNOT_GRANT_SYSTEM_PRIV_TO_MANDATORY_ROLE = 3897 -exports.ER_XA_REPLICATION_FILTERS = 3898 -exports.ER_UNSUPPORTED_SQL_MODE = 3899 -exports.ER_REGEXP_INVALID_FLAG = 3900 -exports.ER_PARTIAL_REVOKE_AND_DB_GRANT_BOTH_EXISTS = 3901 -exports.ER_UNIT_NOT_FOUND = 3902 -exports.ER_INVALID_JSON_VALUE_FOR_FUNC_INDEX = 3903 -exports.ER_JSON_VALUE_OUT_OF_RANGE_FOR_FUNC_INDEX = 3904 -exports.ER_EXCEEDED_MV_KEYS_NUM = 3905 -exports.ER_EXCEEDED_MV_KEYS_SPACE = 3906 -exports.ER_FUNCTIONAL_INDEX_DATA_IS_TOO_LONG = 3907 -exports.ER_WRONG_MVI_VALUE = 3908 -exports.ER_WARN_FUNC_INDEX_NOT_APPLICABLE = 3909 -exports.ER_GRP_RPL_UDF_ERROR = 3910 -exports.ER_UPDATE_GTID_PURGED_WITH_GR = 3911 -exports.ER_GROUPING_ON_TIMESTAMP_IN_DST = 3912 -exports.ER_TABLE_NAME_CAUSES_TOO_LONG_PATH = 3913 -exports.ER_AUDIT_LOG_INSUFFICIENT_PRIVILEGE = 3914 -exports.ER_AUDIT_LOG_PASSWORD_HAS_BEEN_COPIED = 3915 -exports.ER_DA_GRP_RPL_STARTED_AUTO_REJOIN = 3916 -exports.ER_SYSVAR_CHANGE_DURING_QUERY = 3917 -exports.ER_GLOBSTAT_CHANGE_DURING_QUERY = 3918 -exports.ER_GRP_RPL_MESSAGE_SERVICE_INIT_FAILURE = 3919 -exports.ER_CHANGE_SOURCE_WRONG_COMPRESSION_ALGORITHM_CLIENT = 3920 -exports.ER_CHANGE_SOURCE_WRONG_COMPRESSION_LEVEL_CLIENT = 3921 -exports.ER_WRONG_COMPRESSION_ALGORITHM_CLIENT = 3922 -exports.ER_WRONG_COMPRESSION_LEVEL_CLIENT = 3923 -exports.ER_CHANGE_SOURCE_WRONG_COMPRESSION_ALGORITHM_LIST_CLIENT = 3924 -exports.ER_CLIENT_PRIVILEGE_CHECKS_USER_CANNOT_BE_ANONYMOUS = 3925 -exports.ER_CLIENT_PRIVILEGE_CHECKS_USER_DOES_NOT_EXIST = 3926 -exports.ER_CLIENT_PRIVILEGE_CHECKS_USER_CORRUPT = 3927 -exports.ER_CLIENT_PRIVILEGE_CHECKS_USER_NEEDS_RPL_APPLIER_PRIV = 3928 -exports.ER_WARN_DA_PRIVILEGE_NOT_REGISTERED = 3929 -exports.ER_CLIENT_KEYRING_UDF_KEY_INVALID = 3930 -exports.ER_CLIENT_KEYRING_UDF_KEY_TYPE_INVALID = 3931 -exports.ER_CLIENT_KEYRING_UDF_KEY_TOO_LONG = 3932 -exports.ER_CLIENT_KEYRING_UDF_KEY_TYPE_TOO_LONG = 3933 -exports.ER_JSON_SCHEMA_VALIDATION_ERROR_WITH_DETAILED_REPORT = 3934 -exports.ER_DA_UDF_INVALID_CHARSET_SPECIFIED = 3935 -exports.ER_DA_UDF_INVALID_CHARSET = 3936 -exports.ER_DA_UDF_INVALID_COLLATION = 3937 -exports.ER_DA_UDF_INVALID_EXTENSION_ARGUMENT_TYPE = 3938 -exports.ER_MULTIPLE_CONSTRAINTS_WITH_SAME_NAME = 3939 -exports.ER_CONSTRAINT_NOT_FOUND = 3940 -exports.ER_ALTER_CONSTRAINT_ENFORCEMENT_NOT_SUPPORTED = 3941 -exports.ER_TABLE_VALUE_CONSTRUCTOR_MUST_HAVE_COLUMNS = 3942 -exports.ER_TABLE_VALUE_CONSTRUCTOR_CANNOT_HAVE_DEFAULT = 3943 -exports.ER_CLIENT_QUERY_FAILURE_INVALID_NON_ROW_FORMAT = 3944 -exports.ER_REQUIRE_ROW_FORMAT_INVALID_VALUE = 3945 -exports.ER_FAILED_TO_DETERMINE_IF_ROLE_IS_MANDATORY = 3946 -exports.ER_FAILED_TO_FETCH_MANDATORY_ROLE_LIST = 3947 -exports.ER_CLIENT_LOCAL_FILES_DISABLED = 3948 -exports.ER_IMP_INCOMPATIBLE_CFG_VERSION = 3949 -exports.ER_DA_OOM = 3950 -exports.ER_DA_UDF_INVALID_ARGUMENT_TO_SET_CHARSET = 3951 -exports.ER_DA_UDF_INVALID_RETURN_TYPE_TO_SET_CHARSET = 3952 -exports.ER_MULTIPLE_INTO_CLAUSES = 3953 -exports.ER_MISPLACED_INTO = 3954 -exports.ER_USER_ACCESS_DENIED_FOR_USER_ACCOUNT_BLOCKED_BY_PASSWORD_LOCK = 3955 -exports.ER_WARN_DEPRECATED_YEAR_UNSIGNED = 3956 -exports.ER_CLONE_NETWORK_PACKET = 3957 -exports.ER_SDI_OPERATION_FAILED_MISSING_RECORD = 3958 -exports.ER_DEPENDENT_BY_CHECK_CONSTRAINT = 3959 -exports.ER_GRP_OPERATION_NOT_ALLOWED_GR_MUST_STOP = 3960 -exports.ER_WARN_DEPRECATED_JSON_TABLE_ON_ERROR_ON_EMPTY = 3961 -exports.ER_WARN_DEPRECATED_INNER_INTO = 3962 -exports.ER_WARN_DEPRECATED_VALUES_FUNCTION_ALWAYS_NULL = 3963 -exports.ER_WARN_DEPRECATED_SQL_CALC_FOUND_ROWS = 3964 -exports.ER_WARN_DEPRECATED_FOUND_ROWS = 3965 -exports.ER_MISSING_JSON_VALUE = 3966 -exports.ER_MULTIPLE_JSON_VALUES = 3967 -exports.ER_HOSTNAME_TOO_LONG = 3968 -exports.ER_WARN_CLIENT_DEPRECATED_PARTITION_PREFIX_KEY = 3969 -exports.ER_GROUP_REPLICATION_USER_EMPTY_MSG = 3970 -exports.ER_GROUP_REPLICATION_USER_MANDATORY_MSG = 3971 -exports.ER_GROUP_REPLICATION_PASSWORD_LENGTH = 3972 -exports.ER_SUBQUERY_TRANSFORM_REJECTED = 3973 -exports.ER_DA_GRP_RPL_RECOVERY_ENDPOINT_FORMAT = 3974 -exports.ER_DA_GRP_RPL_RECOVERY_ENDPOINT_INVALID = 3975 -exports.ER_WRONG_VALUE_FOR_VAR_PLUS_ACTIONABLE_PART = 3976 -exports.ER_STATEMENT_NOT_ALLOWED_AFTER_START_TRANSACTION = 3977 -exports.ER_FOREIGN_KEY_WITH_ATOMIC_CREATE_SELECT = 3978 -exports.ER_NOT_ALLOWED_WITH_START_TRANSACTION = 3979 -exports.ER_INVALID_JSON_ATTRIBUTE = 3980 -exports.ER_ENGINE_ATTRIBUTE_NOT_SUPPORTED = 3981 -exports.ER_INVALID_USER_ATTRIBUTE_JSON = 3982 -exports.ER_INNODB_REDO_DISABLED = 3983 -exports.ER_INNODB_REDO_ARCHIVING_ENABLED = 3984 -exports.ER_MDL_OUT_OF_RESOURCES = 3985 -exports.ER_IMPLICIT_COMPARISON_FOR_JSON = 3986 -exports.ER_FUNCTION_DOES_NOT_SUPPORT_CHARACTER_SET = 3987 -exports.ER_IMPOSSIBLE_STRING_CONVERSION = 3988 -exports.ER_SCHEMA_READ_ONLY = 3989 -exports.ER_RPL_ASYNC_RECONNECT_GTID_MODE_OFF = 3990 -exports.ER_RPL_ASYNC_RECONNECT_AUTO_POSITION_OFF = 3991 -exports.ER_DISABLE_GTID_MODE_REQUIRES_ASYNC_RECONNECT_OFF = 3992 -exports.ER_DISABLE_AUTO_POSITION_REQUIRES_ASYNC_RECONNECT_OFF = 3993 -exports.ER_INVALID_PARAMETER_USE = 3994 -exports.ER_CHARACTER_SET_MISMATCH = 3995 -exports.ER_WARN_VAR_VALUE_CHANGE_NOT_SUPPORTED = 3996 -exports.ER_INVALID_TIME_ZONE_INTERVAL = 3997 -exports.ER_INVALID_CAST = 3998 -exports.ER_HYPERGRAPH_NOT_SUPPORTED_YET = 3999 -exports.ER_WARN_HYPERGRAPH_EXPERIMENTAL = 4000 -exports.ER_DA_NO_ERROR_LOG_PARSER_CONFIGURED = 4001 -exports.ER_DA_ERROR_LOG_TABLE_DISABLED = 4002 -exports.ER_DA_ERROR_LOG_MULTIPLE_FILTERS = 4003 -exports.ER_DA_CANT_OPEN_ERROR_LOG = 4004 -exports.ER_USER_REFERENCED_AS_DEFINER = 4005 -exports.ER_CANNOT_USER_REFERENCED_AS_DEFINER = 4006 -exports.ER_REGEX_NUMBER_TOO_BIG = 4007 -exports.ER_SPVAR_NONINTEGER_TYPE = 4008 -exports.WARN_UNSUPPORTED_ACL_TABLES_READ = 4009 -exports.ER_BINLOG_UNSAFE_ACL_TABLE_READ_IN_DML_DDL = 4010 -exports.ER_STOP_REPLICA_MONITOR_IO_THREAD_TIMEOUT = 4011 -exports.ER_STARTING_REPLICA_MONITOR_IO_THREAD = 4012 -exports.ER_CANT_USE_ANONYMOUS_TO_GTID_WITH_GTID_MODE_NOT_ON = 4013 -exports.ER_CANT_COMBINE_ANONYMOUS_TO_GTID_AND_AUTOPOSITION = 4014 -exports.ER_ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS_REQUIRES_GTID_MODE_ON = 4015 -exports.ER_SQL_REPLICA_SKIP_COUNTER_USED_WITH_GTID_MODE_ON = 4016 -exports.ER_USING_ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS_AS_LOCAL_OR_UUID = 4017 -exports.ER_CANT_SET_ANONYMOUS_TO_GTID_AND_WAIT_UNTIL_SQL_THD_AFTER_GTIDS = 4018 -exports.ER_CANT_SET_SQL_AFTER_OR_BEFORE_GTIDS_WITH_ANONYMOUS_TO_GTID = 4019 -exports.ER_ANONYMOUS_TO_GTID_UUID_SAME_AS_GROUP_NAME = 4020 -exports.ER_CANT_USE_SAME_UUID_AS_GROUP_NAME = 4021 -exports.ER_GRP_RPL_RECOVERY_CHANNEL_STILL_RUNNING = 4022 -exports.ER_INNODB_INVALID_AUTOEXTEND_SIZE_VALUE = 4023 -exports.ER_INNODB_INCOMPATIBLE_WITH_TABLESPACE = 4024 -exports.ER_INNODB_AUTOEXTEND_SIZE_OUT_OF_RANGE = 4025 -exports.ER_CANNOT_USE_AUTOEXTEND_SIZE_CLAUSE = 4026 -exports.ER_ROLE_GRANTED_TO_ITSELF = 4027 -exports.ER_TABLE_MUST_HAVE_A_VISIBLE_COLUMN = 4028 -exports.ER_INNODB_COMPRESSION_FAILURE = 4029 -exports.ER_WARN_ASYNC_CONN_FAILOVER_NETWORK_NAMESPACE = 4030 -exports.ER_CLIENT_INTERACTION_TIMEOUT = 4031 -exports.ER_INVALID_CAST_TO_GEOMETRY = 4032 -exports.ER_INVALID_CAST_POLYGON_RING_DIRECTION = 4033 -exports.ER_GIS_DIFFERENT_SRIDS_AGGREGATION = 4034 -exports.ER_RELOAD_KEYRING_FAILURE = 4035 -exports.ER_SDI_GET_KEYS_INVALID_TABLESPACE = 4036 -exports.ER_CHANGE_RPL_SRC_WRONG_COMPRESSION_ALGORITHM_SIZE = 4037 -exports.ER_WARN_DEPRECATED_TLS_VERSION_FOR_CHANNEL_CLI = 4038 -exports.ER_CANT_USE_SAME_UUID_AS_VIEW_CHANGE_UUID = 4039 -exports.ER_ANONYMOUS_TO_GTID_UUID_SAME_AS_VIEW_CHANGE_UUID = 4040 -exports.ER_GRP_RPL_VIEW_CHANGE_UUID_FAIL_GET_VARIABLE = 4041 -exports.ER_WARN_ADUIT_LOG_MAX_SIZE_AND_PRUNE_SECONDS = 4042 -exports.ER_WARN_ADUIT_LOG_MAX_SIZE_CLOSE_TO_ROTATE_ON_SIZE = 4043 -exports.ER_KERBEROS_CREATE_USER = 4044 -exports.ER_INSTALL_PLUGIN_CONFLICT_CLIENT = 4045 -exports.ER_DA_ERROR_LOG_COMPONENT_FLUSH_FAILED = 4046 -exports.ER_WARN_SQL_AFTER_MTS_GAPS_GAP_NOT_CALCULATED = 4047 -exports.ER_INVALID_ASSIGNMENT_TARGET = 4048 -exports.ER_OPERATION_NOT_ALLOWED_ON_GR_SECONDARY = 4049 -exports.ER_GRP_RPL_FAILOVER_CHANNEL_STATUS_PROPAGATION = 4050 -exports.ER_WARN_AUDIT_LOG_FORMAT_UNIX_TIMESTAMP_ONLY_WHEN_JSON = 4051 -exports.ER_INVALID_MFA_PLUGIN_SPECIFIED = 4052 -exports.ER_IDENTIFIED_BY_UNSUPPORTED = 4053 -exports.ER_INVALID_PLUGIN_FOR_REGISTRATION = 4054 -exports.ER_PLUGIN_REQUIRES_REGISTRATION = 4055 -exports.ER_MFA_METHOD_EXISTS = 4056 -exports.ER_MFA_METHOD_NOT_EXISTS = 4057 -exports.ER_AUTHENTICATION_POLICY_MISMATCH = 4058 -exports.ER_PLUGIN_REGISTRATION_DONE = 4059 -exports.ER_INVALID_USER_FOR_REGISTRATION = 4060 -exports.ER_USER_REGISTRATION_FAILED = 4061 -exports.ER_MFA_METHODS_INVALID_ORDER = 4062 -exports.ER_MFA_METHODS_IDENTICAL = 4063 -exports.ER_INVALID_MFA_OPERATIONS_FOR_PASSWORDLESS_USER = 4064 -exports.ER_CHANGE_REPLICATION_SOURCE_NO_OPTIONS_FOR_GTID_ONLY = 4065 -exports.ER_CHANGE_REP_SOURCE_CANT_DISABLE_REQ_ROW_FORMAT_WITH_GTID_ONLY = 4066 -exports.ER_CHANGE_REP_SOURCE_CANT_DISABLE_AUTO_POSITION_WITH_GTID_ONLY = 4067 -exports.ER_CHANGE_REP_SOURCE_CANT_DISABLE_GTID_ONLY_WITHOUT_POSITIONS = 4068 -exports.ER_CHANGE_REP_SOURCE_CANT_DISABLE_AUTO_POS_WITHOUT_POSITIONS = 4069 -exports.ER_CHANGE_REP_SOURCE_GR_CHANNEL_WITH_GTID_MODE_NOT_ON = 4070 -exports.ER_CANT_USE_GTID_ONLY_WITH_GTID_MODE_NOT_ON = 4071 -exports.ER_WARN_C_DISABLE_GTID_ONLY_WITH_SOURCE_AUTO_POS_INVALID_POS = 4072 -exports.ER_DA_SSL_FIPS_MODE_ERROR = 4073 -exports.ER_VALUE_OUT_OF_RANGE = 4074 -exports.ER_FULLTEXT_WITH_ROLLUP = 4075 -exports.ER_REGEXP_MISSING_RESOURCE = 4076 -exports.ER_WARN_REGEXP_USING_DEFAULT = 4077 -exports.ER_REGEXP_MISSING_FILE = 4078 -exports.ER_WARN_DEPRECATED_COLLATION = 4079 -exports.ER_CONCURRENT_PROCEDURE_USAGE = 4080 -exports.ER_DA_GLOBAL_CONN_LIMIT = 4081 -exports.ER_DA_CONN_LIMIT = 4082 -exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COLUMN_TYPE_INSTANT = 4083 -exports.ER_WARN_SF_UDF_NAME_COLLISION = 4084 -exports.ER_CANNOT_PURGE_BINLOG_WITH_BACKUP_LOCK = 4085 -exports.ER_TOO_MANY_WINDOWS = 4086 -exports.ER_MYSQLBACKUP_CLIENT_MSG = 4087 -exports.ER_COMMENT_CONTAINS_INVALID_STRING = 4088 -exports.ER_DEFINITION_CONTAINS_INVALID_STRING = 4089 -exports.ER_CANT_EXECUTE_COMMAND_WITH_ASSIGNED_GTID_NEXT = 4090 -exports.ER_XA_TEMP_TABLE = 4091 -exports.ER_INNODB_MAX_ROW_VERSION = 4092 -exports.ER_INNODB_INSTANT_ADD_NOT_SUPPORTED_MAX_SIZE = 4093 -exports.ER_OPERATION_NOT_ALLOWED_WHILE_PRIMARY_CHANGE_IS_RUNNING = 4094 -exports.ER_WARN_DEPRECATED_DATETIME_DELIMITER = 4095 -exports.ER_WARN_DEPRECATED_SUPERFLUOUS_DELIMITER = 4096 -exports.ER_CANNOT_PERSIST_SENSITIVE_VARIABLES = 4097 -exports.ER_WARN_CANNOT_SECURELY_PERSIST_SENSITIVE_VARIABLES = 4098 -exports.ER_WARN_TRG_ALREADY_EXISTS = 4099 -exports.ER_IF_NOT_EXISTS_UNSUPPORTED_TRG_EXISTS_ON_DIFFERENT_TABLE = 4100 -exports.ER_IF_NOT_EXISTS_UNSUPPORTED_UDF_NATIVE_FCT_NAME_COLLISION = 4101 -exports.ER_SET_PASSWORD_AUTH_PLUGIN_ERROR = 4102 -exports.ER_REDUCED_DBLWR_FILE_CORRUPTED = 4103 -exports.ER_REDUCED_DBLWR_PAGE_FOUND = 4104 -exports.ER_SRS_INVALID_LATITUDE_OF_ORIGIN = 4105 -exports.ER_SRS_INVALID_LONGITUDE_OF_ORIGIN = 4106 -exports.ER_SRS_UNUSED_PROJ_PARAMETER_PRESENT = 4107 -exports.ER_GIPK_COLUMN_EXISTS = 4108 -exports.ER_GIPK_FAILED_AUTOINC_COLUMN_EXISTS = 4109 -exports.ER_GIPK_COLUMN_ALTER_NOT_ALLOWED = 4110 -exports.ER_DROP_PK_COLUMN_TO_DROP_GIPK = 4111 -exports.ER_CREATE_SELECT_WITH_GIPK_DISALLOWED_IN_SBR = 4112 -exports.ER_DA_EXPIRE_LOGS_DAYS_IGNORED = 4113 -exports.ER_CTE_RECURSIVE_NOT_UNION = 4114 -exports.ER_COMMAND_BACKEND_FAILED_TO_FETCH_SECURITY_CTX = 4115 -exports.ER_COMMAND_SERVICE_BACKEND_FAILED = 4116 -exports.ER_CLIENT_FILE_PRIVILEGE_FOR_REPLICATION_CHECKS = 4117 -exports.ER_GROUP_REPLICATION_FORCE_MEMBERS_COMMAND_FAILURE = 4118 -exports.ER_WARN_DEPRECATED_IDENT = 4119 -exports.ER_INTERSECT_ALL_MAX_DUPLICATES_EXCEEDED = 4120 -exports.ER_TP_QUERY_THRS_PER_GRP_EXCEEDS_TXN_THR_LIMIT = 4121 -exports.ER_BAD_TIMESTAMP_FORMAT = 4122 -exports.ER_SHAPE_PRIDICTION_UDF = 4123 -exports.ER_SRS_INVALID_HEIGHT = 4124 -exports.ER_SRS_INVALID_SCALING = 4125 -exports.ER_SRS_INVALID_ZONE_WIDTH = 4126 -exports.ER_SRS_INVALID_LATITUDE_POLAR_STERE_VAR_A = 4127 -exports.ER_WARN_DEPRECATED_CLIENT_NO_SCHEMA_OPTION = 4128 -exports.ER_TABLE_NOT_EMPTY = 4129 -exports.ER_TABLE_NO_PRIMARY_KEY = 4130 -exports.ER_TABLE_IN_SHARED_TABLESPACE = 4131 -exports.ER_INDEX_OTHER_THAN_PK = 4132 -exports.ER_LOAD_BULK_DATA_UNSORTED = 4133 -exports.ER_BULK_EXECUTOR_ERROR = 4134 -exports.ER_BULK_READER_LIBCURL_INIT_FAILED = 4135 -exports.ER_BULK_READER_LIBCURL_ERROR = 4136 -exports.ER_BULK_READER_SERVER_ERROR = 4137 -exports.ER_BULK_READER_COMMUNICATION_ERROR = 4138 -exports.ER_BULK_LOAD_DATA_FAILED = 4139 -exports.ER_BULK_LOADER_COLUMN_TOO_BIG_FOR_LEFTOVER_BUFFER = 4140 -exports.ER_BULK_LOADER_COMPONENT_ERROR = 4141 -exports.ER_BULK_LOADER_FILE_CONTAINS_LESS_LINES_THAN_IGNORE_CLAUSE = 4142 -exports.ER_BULK_PARSER_MISSING_ENCLOSED_BY = 4143 -exports.ER_BULK_PARSER_ROW_BUFFER_MAX_TOTAL_COLS_EXCEEDED = 4144 -exports.ER_BULK_PARSER_COPY_BUFFER_SIZE_EXCEEDED = 4145 -exports.ER_BULK_PARSER_UNEXPECTED_END_OF_INPUT = 4146 -exports.ER_BULK_PARSER_UNEXPECTED_ROW_TERMINATOR = 4147 -exports.ER_BULK_PARSER_UNEXPECTED_CHAR_AFTER_ENDING_ENCLOSED_BY = 4148 -exports.ER_BULK_PARSER_UNEXPECTED_CHAR_AFTER_NULL_ESCAPE = 4149 -exports.ER_BULK_PARSER_UNEXPECTED_CHAR_AFTER_COLUMN_TERMINATOR = 4150 -exports.ER_BULK_PARSER_INCOMPLETE_ESCAPE_SEQUENCE = 4151 -exports.ER_LOAD_BULK_DATA_FAILED = 4152 -exports.ER_LOAD_BULK_DATA_WRONG_VALUE_FOR_FIELD = 4153 -exports.ER_LOAD_BULK_DATA_WARN_NULL_TO_NOTNULL = 4154 -exports.ER_REQUIRE_TABLE_PRIMARY_KEY_CHECK_GENERATE_WITH_GR = 4155 -exports.ER_CANT_CHANGE_SYS_VAR_IN_READ_ONLY_MODE = 4156 -exports.ER_INNODB_INSTANT_ADD_DROP_NOT_SUPPORTED_MAX_SIZE = 4157 -exports.ER_INNODB_INSTANT_ADD_NOT_SUPPORTED_MAX_FIELDS = 4158 -exports.ER_CANT_SET_PERSISTED = 4159 -exports.ER_INSTALL_COMPONENT_SET_NULL_VALUE = 4160 -exports.ER_INSTALL_COMPONENT_SET_UNUSED_VALUE = 4161 -exports.ER_WARN_DEPRECATED_USER_DEFINED_COLLATIONS = 4162 - -// Lookup-by-number table -exports[1] = 'EE_CANTCREATEFILE' -exports[2] = 'EE_READ' -exports[3] = 'EE_WRITE' -exports[4] = 'EE_BADCLOSE' -exports[5] = 'EE_OUTOFMEMORY' -exports[6] = 'EE_DELETE' -exports[7] = 'EE_LINK' -exports[9] = 'EE_EOFERR' -exports[10] = 'EE_CANTLOCK' -exports[11] = 'EE_CANTUNLOCK' -exports[12] = 'EE_DIR' -exports[13] = 'EE_STAT' -exports[14] = 'EE_CANT_CHSIZE' -exports[15] = 'EE_CANT_OPEN_STREAM' -exports[16] = 'EE_GETWD' -exports[17] = 'EE_SETWD' -exports[18] = 'EE_LINK_WARNING' -exports[19] = 'EE_OPEN_WARNING' -exports[20] = 'EE_DISK_FULL' -exports[21] = 'EE_CANT_MKDIR' -exports[22] = 'EE_UNKNOWN_CHARSET' -exports[23] = 'EE_OUT_OF_FILERESOURCES' -exports[24] = 'EE_CANT_READLINK' -exports[25] = 'EE_CANT_SYMLINK' -exports[26] = 'EE_REALPATH' -exports[27] = 'EE_SYNC' -exports[28] = 'EE_UNKNOWN_COLLATION' -exports[29] = 'EE_FILENOTFOUND' -exports[30] = 'EE_FILE_NOT_CLOSED' -exports[31] = 'EE_CHANGE_OWNERSHIP' -exports[32] = 'EE_CHANGE_PERMISSIONS' -exports[33] = 'EE_CANT_SEEK' -exports[34] = 'EE_CAPACITY_EXCEEDED' -exports[35] = 'EE_DISK_FULL_WITH_RETRY_MSG' -exports[36] = 'EE_FAILED_TO_CREATE_TIMER' -exports[37] = 'EE_FAILED_TO_DELETE_TIMER' -exports[38] = 'EE_FAILED_TO_CREATE_TIMER_QUEUE' -exports[39] = 'EE_FAILED_TO_START_TIMER_NOTIFY_THREAD' -exports[40] = 'EE_FAILED_TO_CREATE_TIMER_NOTIFY_THREAD_INTERRUPT_EVENT' -exports[41] = 'EE_EXITING_TIMER_NOTIFY_THREAD' -exports[42] = 'EE_WIN_LIBRARY_LOAD_FAILED' -exports[43] = 'EE_WIN_RUN_TIME_ERROR_CHECK' -exports[44] = 'EE_FAILED_TO_DETERMINE_LARGE_PAGE_SIZE' -exports[45] = 'EE_FAILED_TO_KILL_ALL_THREADS' -exports[46] = 'EE_FAILED_TO_CREATE_IO_COMPLETION_PORT' -exports[47] = 'EE_FAILED_TO_OPEN_DEFAULTS_FILE' -exports[48] = 'EE_FAILED_TO_HANDLE_DEFAULTS_FILE' -exports[49] = 'EE_WRONG_DIRECTIVE_IN_CONFIG_FILE' -exports[50] = 'EE_SKIPPING_DIRECTIVE_DUE_TO_MAX_INCLUDE_RECURSION' -exports[51] = 'EE_INCORRECT_GRP_DEFINITION_IN_CONFIG_FILE' -exports[52] = 'EE_OPTION_WITHOUT_GRP_IN_CONFIG_FILE' -exports[53] = 'EE_CONFIG_FILE_PERMISSION_ERROR' -exports[54] = 'EE_IGNORE_WORLD_WRITABLE_CONFIG_FILE' -exports[55] = 'EE_USING_DISABLED_OPTION' -exports[56] = 'EE_USING_DISABLED_SHORT_OPTION' -exports[57] = 'EE_USING_PASSWORD_ON_CLI_IS_INSECURE' -exports[58] = 'EE_UNKNOWN_SUFFIX_FOR_VARIABLE' -exports[59] = 'EE_SSL_ERROR_FROM_FILE' -exports[60] = 'EE_SSL_ERROR' -exports[61] = 'EE_NET_SEND_ERROR_IN_BOOTSTRAP' -exports[62] = 'EE_PACKETS_OUT_OF_ORDER' -exports[63] = 'EE_UNKNOWN_PROTOCOL_OPTION' -exports[64] = 'EE_FAILED_TO_LOCATE_SERVER_PUBLIC_KEY' -exports[65] = 'EE_PUBLIC_KEY_NOT_IN_PEM_FORMAT' -exports[66] = 'EE_DEBUG_INFO' -exports[67] = 'EE_UNKNOWN_VARIABLE' -exports[68] = 'EE_UNKNOWN_OPTION' -exports[69] = 'EE_UNKNOWN_SHORT_OPTION' -exports[70] = 'EE_OPTION_WITHOUT_ARGUMENT' -exports[71] = 'EE_OPTION_REQUIRES_ARGUMENT' -exports[72] = 'EE_SHORT_OPTION_REQUIRES_ARGUMENT' -exports[73] = 'EE_OPTION_IGNORED_DUE_TO_INVALID_VALUE' -exports[74] = 'EE_OPTION_WITH_EMPTY_VALUE' -exports[75] = 'EE_FAILED_TO_ASSIGN_MAX_VALUE_TO_OPTION' -exports[76] = 'EE_INCORRECT_BOOLEAN_VALUE_FOR_OPTION' -exports[77] = 'EE_FAILED_TO_SET_OPTION_VALUE' -exports[78] = 'EE_INCORRECT_INT_VALUE_FOR_OPTION' -exports[79] = 'EE_INCORRECT_UINT_VALUE_FOR_OPTION' -exports[80] = 'EE_ADJUSTED_SIGNED_VALUE_FOR_OPTION' -exports[81] = 'EE_ADJUSTED_UNSIGNED_VALUE_FOR_OPTION' -exports[82] = 'EE_ADJUSTED_ULONGLONG_VALUE_FOR_OPTION' -exports[83] = 'EE_ADJUSTED_DOUBLE_VALUE_FOR_OPTION' -exports[84] = 'EE_INVALID_DECIMAL_VALUE_FOR_OPTION' -exports[85] = 'EE_COLLATION_PARSER_ERROR' -exports[86] = 'EE_FAILED_TO_RESET_BEFORE_PRIMARY_IGNORABLE_CHAR' -exports[87] = 'EE_FAILED_TO_RESET_BEFORE_TERTIARY_IGNORABLE_CHAR' -exports[88] = 'EE_SHIFT_CHAR_OUT_OF_RANGE' -exports[89] = 'EE_RESET_CHAR_OUT_OF_RANGE' -exports[90] = 'EE_UNKNOWN_LDML_TAG' -exports[91] = 'EE_FAILED_TO_RESET_BEFORE_SECONDARY_IGNORABLE_CHAR' -exports[92] = 'EE_FAILED_PROCESSING_DIRECTIVE' -exports[93] = 'EE_PTHREAD_KILL_FAILED' -exports[120] = 'HA_ERR_KEY_NOT_FOUND' -exports[121] = 'HA_ERR_FOUND_DUPP_KEY' -exports[122] = 'HA_ERR_INTERNAL_ERROR' -exports[123] = 'HA_ERR_RECORD_CHANGED' -exports[124] = 'HA_ERR_WRONG_INDEX' -exports[125] = 'HA_ERR_ROLLED_BACK' -exports[126] = 'HA_ERR_CRASHED' -exports[127] = 'HA_ERR_WRONG_IN_RECORD' -exports[128] = 'HA_ERR_OUT_OF_MEM' -exports[130] = 'HA_ERR_NOT_A_TABLE' -exports[131] = 'HA_ERR_WRONG_COMMAND' -exports[132] = 'HA_ERR_OLD_FILE' -exports[133] = 'HA_ERR_NO_ACTIVE_RECORD' -exports[134] = 'HA_ERR_RECORD_DELETED' -exports[135] = 'HA_ERR_RECORD_FILE_FULL' -exports[136] = 'HA_ERR_INDEX_FILE_FULL' -exports[137] = 'HA_ERR_END_OF_FILE' -exports[138] = 'HA_ERR_UNSUPPORTED' -exports[139] = 'HA_ERR_TOO_BIG_ROW' -exports[140] = 'HA_WRONG_CREATE_OPTION' -exports[141] = 'HA_ERR_FOUND_DUPP_UNIQUE' -exports[142] = 'HA_ERR_UNKNOWN_CHARSET' -exports[143] = 'HA_ERR_WRONG_MRG_TABLE_DEF' -exports[144] = 'HA_ERR_CRASHED_ON_REPAIR' -exports[145] = 'HA_ERR_CRASHED_ON_USAGE' -exports[146] = 'HA_ERR_LOCK_WAIT_TIMEOUT' -exports[147] = 'HA_ERR_LOCK_TABLE_FULL' -exports[148] = 'HA_ERR_READ_ONLY_TRANSACTION' -exports[149] = 'HA_ERR_LOCK_DEADLOCK' -exports[150] = 'HA_ERR_CANNOT_ADD_FOREIGN' -exports[151] = 'HA_ERR_NO_REFERENCED_ROW' -exports[152] = 'HA_ERR_ROW_IS_REFERENCED' -exports[153] = 'HA_ERR_NO_SAVEPOINT' -exports[154] = 'HA_ERR_NON_UNIQUE_BLOCK_SIZE' -exports[155] = 'HA_ERR_NO_SUCH_TABLE' -exports[156] = 'HA_ERR_TABLE_EXIST' -exports[157] = 'HA_ERR_NO_CONNECTION' -exports[158] = 'HA_ERR_NULL_IN_SPATIAL' -exports[159] = 'HA_ERR_TABLE_DEF_CHANGED' -exports[160] = 'HA_ERR_NO_PARTITION_FOUND' -exports[161] = 'HA_ERR_RBR_LOGGING_FAILED' -exports[162] = 'HA_ERR_DROP_INDEX_FK' -exports[163] = 'HA_ERR_FOREIGN_DUPLICATE_KEY' -exports[164] = 'HA_ERR_TABLE_NEEDS_UPGRADE' -exports[165] = 'HA_ERR_TABLE_READONLY' -exports[166] = 'HA_ERR_AUTOINC_READ_FAILED' -exports[167] = 'HA_ERR_AUTOINC_ERANGE' -exports[168] = 'HA_ERR_GENERIC' -exports[169] = 'HA_ERR_RECORD_IS_THE_SAME' -exports[170] = 'HA_ERR_LOGGING_IMPOSSIBLE' -exports[171] = 'HA_ERR_CORRUPT_EVENT' -exports[172] = 'HA_ERR_NEW_FILE' -exports[173] = 'HA_ERR_ROWS_EVENT_APPLY' -exports[174] = 'HA_ERR_INITIALIZATION' -exports[175] = 'HA_ERR_FILE_TOO_SHORT' -exports[176] = 'HA_ERR_WRONG_CRC' -exports[177] = 'HA_ERR_TOO_MANY_CONCURRENT_TRXS' -exports[178] = 'HA_ERR_NOT_IN_LOCK_PARTITIONS' -exports[179] = 'HA_ERR_INDEX_COL_TOO_LONG' -exports[180] = 'HA_ERR_INDEX_CORRUPT' -exports[181] = 'HA_ERR_UNDO_REC_TOO_BIG' -exports[182] = 'HA_FTS_INVALID_DOCID' -exports[183] = 'HA_ERR_TABLE_IN_FK_CHECK' -exports[184] = 'HA_ERR_TABLESPACE_EXISTS' -exports[185] = 'HA_ERR_TOO_MANY_FIELDS' -exports[186] = 'HA_ERR_ROW_IN_WRONG_PARTITION' -exports[187] = 'HA_ERR_INNODB_READ_ONLY' -exports[188] = 'HA_ERR_FTS_EXCEED_RESULT_CACHE_LIMIT' -exports[189] = 'HA_ERR_TEMP_FILE_WRITE_FAILURE' -exports[190] = 'HA_ERR_INNODB_FORCED_RECOVERY' -exports[191] = 'HA_ERR_FTS_TOO_MANY_WORDS_IN_PHRASE' -exports[192] = 'HA_ERR_FK_DEPTH_EXCEEDED' -exports[193] = 'HA_MISSING_CREATE_OPTION' -exports[194] = 'HA_ERR_SE_OUT_OF_MEMORY' -exports[195] = 'HA_ERR_TABLE_CORRUPT' -exports[196] = 'HA_ERR_QUERY_INTERRUPTED' -exports[197] = 'HA_ERR_TABLESPACE_MISSING' -exports[198] = 'HA_ERR_TABLESPACE_IS_NOT_EMPTY' -exports[199] = 'HA_ERR_WRONG_FILE_NAME' -exports[200] = 'HA_ERR_NOT_ALLOWED_COMMAND' -exports[201] = 'HA_ERR_COMPUTE_FAILED' -exports[202] = 'HA_ERR_ROW_FORMAT_CHANGED' -exports[203] = 'HA_ERR_NO_WAIT_LOCK' -exports[204] = 'HA_ERR_DISK_FULL_NOWAIT' -exports[205] = 'HA_ERR_NO_SESSION_TEMP' -exports[206] = 'HA_ERR_WRONG_TABLE_NAME' -exports[207] = 'HA_ERR_TOO_LONG_PATH' -exports[208] = 'HA_ERR_SAMPLING_INIT_FAILED' -exports[209] = 'HA_ERR_FTS_TOO_MANY_NESTED_EXP' -exports[1000] = 'ER_HASHCHK' -exports[1001] = 'ER_NISAMCHK' -exports[1002] = 'ER_NO' -exports[1003] = 'ER_YES' -exports[1004] = 'ER_CANT_CREATE_FILE' -exports[1005] = 'ER_CANT_CREATE_TABLE' -exports[1006] = 'ER_CANT_CREATE_DB' -exports[1007] = 'ER_DB_CREATE_EXISTS' -exports[1008] = 'ER_DB_DROP_EXISTS' -exports[1009] = 'ER_DB_DROP_DELETE' -exports[1010] = 'ER_DB_DROP_RMDIR' -exports[1011] = 'ER_CANT_DELETE_FILE' -exports[1012] = 'ER_CANT_FIND_SYSTEM_REC' -exports[1013] = 'ER_CANT_GET_STAT' -exports[1014] = 'ER_CANT_GET_WD' -exports[1015] = 'ER_CANT_LOCK' -exports[1016] = 'ER_CANT_OPEN_FILE' -exports[1017] = 'ER_FILE_NOT_FOUND' -exports[1018] = 'ER_CANT_READ_DIR' -exports[1019] = 'ER_CANT_SET_WD' -exports[1020] = 'ER_CHECKREAD' -exports[1021] = 'ER_DISK_FULL' -exports[1022] = 'ER_DUP_KEY' -exports[1023] = 'ER_ERROR_ON_CLOSE' -exports[1024] = 'ER_ERROR_ON_READ' -exports[1025] = 'ER_ERROR_ON_RENAME' -exports[1026] = 'ER_ERROR_ON_WRITE' -exports[1027] = 'ER_FILE_USED' -exports[1028] = 'ER_FILSORT_ABORT' -exports[1029] = 'ER_FORM_NOT_FOUND' -exports[1030] = 'ER_GET_ERRNO' -exports[1031] = 'ER_ILLEGAL_HA' -exports[1032] = 'ER_KEY_NOT_FOUND' -exports[1033] = 'ER_NOT_FORM_FILE' -exports[1034] = 'ER_NOT_KEYFILE' -exports[1035] = 'ER_OLD_KEYFILE' -exports[1036] = 'ER_OPEN_AS_READONLY' -exports[1037] = 'ER_OUTOFMEMORY' -exports[1038] = 'ER_OUT_OF_SORTMEMORY' -exports[1039] = 'ER_UNEXPECTED_EOF' -exports[1040] = 'ER_CON_COUNT_ERROR' -exports[1041] = 'ER_OUT_OF_RESOURCES' -exports[1042] = 'ER_BAD_HOST_ERROR' -exports[1043] = 'ER_HANDSHAKE_ERROR' -exports[1044] = 'ER_DBACCESS_DENIED_ERROR' -exports[1045] = 'ER_ACCESS_DENIED_ERROR' -exports[1046] = 'ER_NO_DB_ERROR' -exports[1047] = 'ER_UNKNOWN_COM_ERROR' -exports[1048] = 'ER_BAD_NULL_ERROR' -exports[1049] = 'ER_BAD_DB_ERROR' -exports[1050] = 'ER_TABLE_EXISTS_ERROR' -exports[1051] = 'ER_BAD_TABLE_ERROR' -exports[1052] = 'ER_NON_UNIQ_ERROR' -exports[1053] = 'ER_SERVER_SHUTDOWN' -exports[1054] = 'ER_BAD_FIELD_ERROR' -exports[1055] = 'ER_WRONG_FIELD_WITH_GROUP' -exports[1056] = 'ER_WRONG_GROUP_FIELD' -exports[1057] = 'ER_WRONG_SUM_SELECT' -exports[1058] = 'ER_WRONG_VALUE_COUNT' -exports[1059] = 'ER_TOO_LONG_IDENT' -exports[1060] = 'ER_DUP_FIELDNAME' -exports[1061] = 'ER_DUP_KEYNAME' -exports[1062] = 'ER_DUP_ENTRY' -exports[1063] = 'ER_WRONG_FIELD_SPEC' -exports[1064] = 'ER_PARSE_ERROR' -exports[1065] = 'ER_EMPTY_QUERY' -exports[1066] = 'ER_NONUNIQ_TABLE' -exports[1067] = 'ER_INVALID_DEFAULT' -exports[1068] = 'ER_MULTIPLE_PRI_KEY' -exports[1069] = 'ER_TOO_MANY_KEYS' -exports[1070] = 'ER_TOO_MANY_KEY_PARTS' -exports[1071] = 'ER_TOO_LONG_KEY' -exports[1072] = 'ER_KEY_COLUMN_DOES_NOT_EXITS' -exports[1073] = 'ER_BLOB_USED_AS_KEY' -exports[1074] = 'ER_TOO_BIG_FIELDLENGTH' -exports[1075] = 'ER_WRONG_AUTO_KEY' -exports[1076] = 'ER_READY' -exports[1077] = 'ER_NORMAL_SHUTDOWN' -exports[1078] = 'ER_GOT_SIGNAL' -exports[1079] = 'ER_SHUTDOWN_COMPLETE' -exports[1080] = 'ER_FORCING_CLOSE' -exports[1081] = 'ER_IPSOCK_ERROR' -exports[1082] = 'ER_NO_SUCH_INDEX' -exports[1083] = 'ER_WRONG_FIELD_TERMINATORS' -exports[1084] = 'ER_BLOBS_AND_NO_TERMINATED' -exports[1085] = 'ER_TEXTFILE_NOT_READABLE' -exports[1086] = 'ER_FILE_EXISTS_ERROR' -exports[1087] = 'ER_LOAD_INFO' -exports[1088] = 'ER_ALTER_INFO' -exports[1089] = 'ER_WRONG_SUB_KEY' -exports[1090] = 'ER_CANT_REMOVE_ALL_FIELDS' -exports[1091] = 'ER_CANT_DROP_FIELD_OR_KEY' -exports[1092] = 'ER_INSERT_INFO' -exports[1093] = 'ER_UPDATE_TABLE_USED' -exports[1094] = 'ER_NO_SUCH_THREAD' -exports[1095] = 'ER_KILL_DENIED_ERROR' -exports[1096] = 'ER_NO_TABLES_USED' -exports[1097] = 'ER_TOO_BIG_SET' -exports[1098] = 'ER_NO_UNIQUE_LOGFILE' -exports[1099] = 'ER_TABLE_NOT_LOCKED_FOR_WRITE' -exports[1100] = 'ER_TABLE_NOT_LOCKED' -exports[1101] = 'ER_BLOB_CANT_HAVE_DEFAULT' -exports[1102] = 'ER_WRONG_DB_NAME' -exports[1103] = 'ER_WRONG_TABLE_NAME' -exports[1104] = 'ER_TOO_BIG_SELECT' -exports[1105] = 'ER_UNKNOWN_ERROR' -exports[1106] = 'ER_UNKNOWN_PROCEDURE' -exports[1107] = 'ER_WRONG_PARAMCOUNT_TO_PROCEDURE' -exports[1108] = 'ER_WRONG_PARAMETERS_TO_PROCEDURE' -exports[1109] = 'ER_UNKNOWN_TABLE' -exports[1110] = 'ER_FIELD_SPECIFIED_TWICE' -exports[1111] = 'ER_INVALID_GROUP_FUNC_USE' -exports[1112] = 'ER_UNSUPPORTED_EXTENSION' -exports[1113] = 'ER_TABLE_MUST_HAVE_COLUMNS' -exports[1114] = 'ER_RECORD_FILE_FULL' -exports[1115] = 'ER_UNKNOWN_CHARACTER_SET' -exports[1116] = 'ER_TOO_MANY_TABLES' -exports[1117] = 'ER_TOO_MANY_FIELDS' -exports[1118] = 'ER_TOO_BIG_ROWSIZE' -exports[1119] = 'ER_STACK_OVERRUN' -exports[1120] = 'ER_WRONG_OUTER_JOIN' -exports[1121] = 'ER_NULL_COLUMN_IN_INDEX' -exports[1122] = 'ER_CANT_FIND_UDF' -exports[1123] = 'ER_CANT_INITIALIZE_UDF' -exports[1124] = 'ER_UDF_NO_PATHS' -exports[1125] = 'ER_UDF_EXISTS' -exports[1126] = 'ER_CANT_OPEN_LIBRARY' -exports[1127] = 'ER_CANT_FIND_DL_ENTRY' -exports[1128] = 'ER_FUNCTION_NOT_DEFINED' -exports[1129] = 'ER_HOST_IS_BLOCKED' -exports[1130] = 'ER_HOST_NOT_PRIVILEGED' -exports[1131] = 'ER_PASSWORD_ANONYMOUS_USER' -exports[1132] = 'ER_PASSWORD_NOT_ALLOWED' -exports[1133] = 'ER_PASSWORD_NO_MATCH' -exports[1134] = 'ER_UPDATE_INFO' -exports[1135] = 'ER_CANT_CREATE_THREAD' -exports[1136] = 'ER_WRONG_VALUE_COUNT_ON_ROW' -exports[1137] = 'ER_CANT_REOPEN_TABLE' -exports[1138] = 'ER_INVALID_USE_OF_NULL' -exports[1139] = 'ER_REGEXP_ERROR' -exports[1140] = 'ER_MIX_OF_GROUP_FUNC_AND_FIELDS' -exports[1141] = 'ER_NONEXISTING_GRANT' -exports[1142] = 'ER_TABLEACCESS_DENIED_ERROR' -exports[1143] = 'ER_COLUMNACCESS_DENIED_ERROR' -exports[1144] = 'ER_ILLEGAL_GRANT_FOR_TABLE' -exports[1145] = 'ER_GRANT_WRONG_HOST_OR_USER' -exports[1146] = 'ER_NO_SUCH_TABLE' -exports[1147] = 'ER_NONEXISTING_TABLE_GRANT' -exports[1148] = 'ER_NOT_ALLOWED_COMMAND' -exports[1149] = 'ER_SYNTAX_ERROR' -exports[1150] = 'ER_UNUSED1' -exports[1151] = 'ER_UNUSED2' -exports[1152] = 'ER_ABORTING_CONNECTION' -exports[1153] = 'ER_NET_PACKET_TOO_LARGE' -exports[1154] = 'ER_NET_READ_ERROR_FROM_PIPE' -exports[1155] = 'ER_NET_FCNTL_ERROR' -exports[1156] = 'ER_NET_PACKETS_OUT_OF_ORDER' -exports[1157] = 'ER_NET_UNCOMPRESS_ERROR' -exports[1158] = 'ER_NET_READ_ERROR' -exports[1159] = 'ER_NET_READ_INTERRUPTED' -exports[1160] = 'ER_NET_ERROR_ON_WRITE' -exports[1161] = 'ER_NET_WRITE_INTERRUPTED' -exports[1162] = 'ER_TOO_LONG_STRING' -exports[1163] = 'ER_TABLE_CANT_HANDLE_BLOB' -exports[1164] = 'ER_TABLE_CANT_HANDLE_AUTO_INCREMENT' -exports[1165] = 'ER_UNUSED3' -exports[1166] = 'ER_WRONG_COLUMN_NAME' -exports[1167] = 'ER_WRONG_KEY_COLUMN' -exports[1168] = 'ER_WRONG_MRG_TABLE' -exports[1169] = 'ER_DUP_UNIQUE' -exports[1170] = 'ER_BLOB_KEY_WITHOUT_LENGTH' -exports[1171] = 'ER_PRIMARY_CANT_HAVE_NULL' -exports[1172] = 'ER_TOO_MANY_ROWS' -exports[1173] = 'ER_REQUIRES_PRIMARY_KEY' -exports[1174] = 'ER_NO_RAID_COMPILED' -exports[1175] = 'ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE' -exports[1176] = 'ER_KEY_DOES_NOT_EXITS' -exports[1177] = 'ER_CHECK_NO_SUCH_TABLE' -exports[1178] = 'ER_CHECK_NOT_IMPLEMENTED' -exports[1179] = 'ER_CANT_DO_THIS_DURING_AN_TRANSACTION' -exports[1180] = 'ER_ERROR_DURING_COMMIT' -exports[1181] = 'ER_ERROR_DURING_ROLLBACK' -exports[1182] = 'ER_ERROR_DURING_FLUSH_LOGS' -exports[1183] = 'ER_ERROR_DURING_CHECKPOINT' -exports[1184] = 'ER_NEW_ABORTING_CONNECTION' -exports[1185] = 'ER_DUMP_NOT_IMPLEMENTED' -exports[1186] = 'ER_FLUSH_MASTER_BINLOG_CLOSED' -exports[1187] = 'ER_INDEX_REBUILD' -exports[1188] = 'ER_SOURCE' -exports[1189] = 'ER_SOURCE_NET_READ' -exports[1190] = 'ER_SOURCE_NET_WRITE' -exports[1191] = 'ER_FT_MATCHING_KEY_NOT_FOUND' -exports[1192] = 'ER_LOCK_OR_ACTIVE_TRANSACTION' -exports[1193] = 'ER_UNKNOWN_SYSTEM_VARIABLE' -exports[1194] = 'ER_CRASHED_ON_USAGE' -exports[1195] = 'ER_CRASHED_ON_REPAIR' -exports[1196] = 'ER_WARNING_NOT_COMPLETE_ROLLBACK' -exports[1197] = 'ER_TRANS_CACHE_FULL' -exports[1198] = 'ER_SLAVE_MUST_STOP' -exports[1199] = 'ER_REPLICA_NOT_RUNNING' -exports[1200] = 'ER_BAD_REPLICA' -exports[1201] = 'ER_CONNECTION_METADATA' -exports[1202] = 'ER_REPLICA_THREAD' -exports[1203] = 'ER_TOO_MANY_USER_CONNECTIONS' -exports[1204] = 'ER_SET_CONSTANTS_ONLY' -exports[1205] = 'ER_LOCK_WAIT_TIMEOUT' -exports[1206] = 'ER_LOCK_TABLE_FULL' -exports[1207] = 'ER_READ_ONLY_TRANSACTION' -exports[1208] = 'ER_DROP_DB_WITH_READ_LOCK' -exports[1209] = 'ER_CREATE_DB_WITH_READ_LOCK' -exports[1210] = 'ER_WRONG_ARGUMENTS' -exports[1211] = 'ER_NO_PERMISSION_TO_CREATE_USER' -exports[1212] = 'ER_UNION_TABLES_IN_DIFFERENT_DIR' -exports[1213] = 'ER_LOCK_DEADLOCK' -exports[1214] = 'ER_TABLE_CANT_HANDLE_FT' -exports[1215] = 'ER_CANNOT_ADD_FOREIGN' -exports[1216] = 'ER_NO_REFERENCED_ROW' -exports[1217] = 'ER_ROW_IS_REFERENCED' -exports[1218] = 'ER_CONNECT_TO_SOURCE' -exports[1219] = 'ER_QUERY_ON_MASTER' -exports[1220] = 'ER_ERROR_WHEN_EXECUTING_COMMAND' -exports[1221] = 'ER_WRONG_USAGE' -exports[1222] = 'ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT' -exports[1223] = 'ER_CANT_UPDATE_WITH_READLOCK' -exports[1224] = 'ER_MIXING_NOT_ALLOWED' -exports[1225] = 'ER_DUP_ARGUMENT' -exports[1226] = 'ER_USER_LIMIT_REACHED' -exports[1227] = 'ER_SPECIFIC_ACCESS_DENIED_ERROR' -exports[1228] = 'ER_LOCAL_VARIABLE' -exports[1229] = 'ER_GLOBAL_VARIABLE' -exports[1230] = 'ER_NO_DEFAULT' -exports[1231] = 'ER_WRONG_VALUE_FOR_VAR' -exports[1232] = 'ER_WRONG_TYPE_FOR_VAR' -exports[1233] = 'ER_VAR_CANT_BE_READ' -exports[1234] = 'ER_CANT_USE_OPTION_HERE' -exports[1235] = 'ER_NOT_SUPPORTED_YET' -exports[1236] = 'ER_SOURCE_FATAL_ERROR_READING_BINLOG' -exports[1237] = 'ER_REPLICA_IGNORED_TABLE' -exports[1238] = 'ER_INCORRECT_GLOBAL_LOCAL_VAR' -exports[1239] = 'ER_WRONG_FK_DEF' -exports[1240] = 'ER_KEY_REF_DO_NOT_MATCH_TABLE_REF' -exports[1241] = 'ER_OPERAND_COLUMNS' -exports[1242] = 'ER_SUBQUERY_NO_1_ROW' -exports[1243] = 'ER_UNKNOWN_STMT_HANDLER' -exports[1244] = 'ER_CORRUPT_HELP_DB' -exports[1245] = 'ER_CYCLIC_REFERENCE' -exports[1246] = 'ER_AUTO_CONVERT' -exports[1247] = 'ER_ILLEGAL_REFERENCE' -exports[1248] = 'ER_DERIVED_MUST_HAVE_ALIAS' -exports[1249] = 'ER_SELECT_REDUCED' -exports[1250] = 'ER_TABLENAME_NOT_ALLOWED_HERE' -exports[1251] = 'ER_NOT_SUPPORTED_AUTH_MODE' -exports[1252] = 'ER_SPATIAL_CANT_HAVE_NULL' -exports[1253] = 'ER_COLLATION_CHARSET_MISMATCH' -exports[1254] = 'ER_SLAVE_WAS_RUNNING' -exports[1255] = 'ER_SLAVE_WAS_NOT_RUNNING' -exports[1256] = 'ER_TOO_BIG_FOR_UNCOMPRESS' -exports[1257] = 'ER_ZLIB_Z_MEM_ERROR' -exports[1258] = 'ER_ZLIB_Z_BUF_ERROR' -exports[1259] = 'ER_ZLIB_Z_DATA_ERROR' -exports[1260] = 'ER_CUT_VALUE_GROUP_CONCAT' -exports[1261] = 'ER_WARN_TOO_FEW_RECORDS' -exports[1262] = 'ER_WARN_TOO_MANY_RECORDS' -exports[1263] = 'ER_WARN_NULL_TO_NOTNULL' -exports[1264] = 'ER_WARN_DATA_OUT_OF_RANGE' -exports[1265] = 'WARN_DATA_TRUNCATED' -exports[1266] = 'ER_WARN_USING_OTHER_HANDLER' -exports[1267] = 'ER_CANT_AGGREGATE_2COLLATIONS' -exports[1268] = 'ER_DROP_USER' -exports[1269] = 'ER_REVOKE_GRANTS' -exports[1270] = 'ER_CANT_AGGREGATE_3COLLATIONS' -exports[1271] = 'ER_CANT_AGGREGATE_NCOLLATIONS' -exports[1272] = 'ER_VARIABLE_IS_NOT_STRUCT' -exports[1273] = 'ER_UNKNOWN_COLLATION' -exports[1274] = 'ER_REPLICA_IGNORED_SSL_PARAMS' -exports[1275] = 'ER_SERVER_IS_IN_SECURE_AUTH_MODE' -exports[1276] = 'ER_WARN_FIELD_RESOLVED' -exports[1277] = 'ER_BAD_REPLICA_UNTIL_COND' -exports[1278] = 'ER_MISSING_SKIP_REPLICA' -exports[1279] = 'ER_UNTIL_COND_IGNORED' -exports[1280] = 'ER_WRONG_NAME_FOR_INDEX' -exports[1281] = 'ER_WRONG_NAME_FOR_CATALOG' -exports[1282] = 'ER_WARN_QC_RESIZE' -exports[1283] = 'ER_BAD_FT_COLUMN' -exports[1284] = 'ER_UNKNOWN_KEY_CACHE' -exports[1285] = 'ER_WARN_HOSTNAME_WONT_WORK' -exports[1286] = 'ER_UNKNOWN_STORAGE_ENGINE' -exports[1287] = 'ER_WARN_DEPRECATED_SYNTAX' -exports[1288] = 'ER_NON_UPDATABLE_TABLE' -exports[1289] = 'ER_FEATURE_DISABLED' -exports[1290] = 'ER_OPTION_PREVENTS_STATEMENT' -exports[1291] = 'ER_DUPLICATED_VALUE_IN_TYPE' -exports[1292] = 'ER_TRUNCATED_WRONG_VALUE' -exports[1293] = 'ER_TOO_MUCH_AUTO_TIMESTAMP_COLS' -exports[1294] = 'ER_INVALID_ON_UPDATE' -exports[1295] = 'ER_UNSUPPORTED_PS' -exports[1296] = 'ER_GET_ERRMSG' -exports[1297] = 'ER_GET_TEMPORARY_ERRMSG' -exports[1298] = 'ER_UNKNOWN_TIME_ZONE' -exports[1299] = 'ER_WARN_INVALID_TIMESTAMP' -exports[1300] = 'ER_INVALID_CHARACTER_STRING' -exports[1301] = 'ER_WARN_ALLOWED_PACKET_OVERFLOWED' -exports[1302] = 'ER_CONFLICTING_DECLARATIONS' -exports[1303] = 'ER_SP_NO_RECURSIVE_CREATE' -exports[1304] = 'ER_SP_ALREADY_EXISTS' -exports[1305] = 'ER_SP_DOES_NOT_EXIST' -exports[1306] = 'ER_SP_DROP_FAILED' -exports[1307] = 'ER_SP_STORE_FAILED' -exports[1308] = 'ER_SP_LILABEL_MISMATCH' -exports[1309] = 'ER_SP_LABEL_REDEFINE' -exports[1310] = 'ER_SP_LABEL_MISMATCH' -exports[1311] = 'ER_SP_UNINIT_VAR' -exports[1312] = 'ER_SP_BADSELECT' -exports[1313] = 'ER_SP_BADRETURN' -exports[1314] = 'ER_SP_BADSTATEMENT' -exports[1315] = 'ER_UPDATE_LOG_DEPRECATED_IGNORED' -exports[1316] = 'ER_UPDATE_LOG_DEPRECATED_TRANSLATED' -exports[1317] = 'ER_QUERY_INTERRUPTED' -exports[1318] = 'ER_SP_WRONG_NO_OF_ARGS' -exports[1319] = 'ER_SP_COND_MISMATCH' -exports[1320] = 'ER_SP_NORETURN' -exports[1321] = 'ER_SP_NORETURNEND' -exports[1322] = 'ER_SP_BAD_CURSOR_QUERY' -exports[1323] = 'ER_SP_BAD_CURSOR_SELECT' -exports[1324] = 'ER_SP_CURSOR_MISMATCH' -exports[1325] = 'ER_SP_CURSOR_ALREADY_OPEN' -exports[1326] = 'ER_SP_CURSOR_NOT_OPEN' -exports[1327] = 'ER_SP_UNDECLARED_VAR' -exports[1328] = 'ER_SP_WRONG_NO_OF_FETCH_ARGS' -exports[1329] = 'ER_SP_FETCH_NO_DATA' -exports[1330] = 'ER_SP_DUP_PARAM' -exports[1331] = 'ER_SP_DUP_VAR' -exports[1332] = 'ER_SP_DUP_COND' -exports[1333] = 'ER_SP_DUP_CURS' -exports[1334] = 'ER_SP_CANT_ALTER' -exports[1335] = 'ER_SP_SUBSELECT_NYI' -exports[1336] = 'ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG' -exports[1337] = 'ER_SP_VARCOND_AFTER_CURSHNDLR' -exports[1338] = 'ER_SP_CURSOR_AFTER_HANDLER' -exports[1339] = 'ER_SP_CASE_NOT_FOUND' -exports[1340] = 'ER_FPARSER_TOO_BIG_FILE' -exports[1341] = 'ER_FPARSER_BAD_HEADER' -exports[1342] = 'ER_FPARSER_EOF_IN_COMMENT' -exports[1343] = 'ER_FPARSER_ERROR_IN_PARAMETER' -exports[1344] = 'ER_FPARSER_EOF_IN_UNKNOWN_PARAMETER' -exports[1345] = 'ER_VIEW_NO_EXPLAIN' -exports[1346] = 'ER_FRM_UNKNOWN_TYPE' -exports[1347] = 'ER_WRONG_OBJECT' -exports[1348] = 'ER_NONUPDATEABLE_COLUMN' -exports[1349] = 'ER_VIEW_SELECT_DERIVED' -exports[1350] = 'ER_VIEW_SELECT_CLAUSE' -exports[1351] = 'ER_VIEW_SELECT_VARIABLE' -exports[1352] = 'ER_VIEW_SELECT_TMPTABLE' -exports[1353] = 'ER_VIEW_WRONG_LIST' -exports[1354] = 'ER_WARN_VIEW_MERGE' -exports[1355] = 'ER_WARN_VIEW_WITHOUT_KEY' -exports[1356] = 'ER_VIEW_INVALID' -exports[1357] = 'ER_SP_NO_DROP_SP' -exports[1358] = 'ER_SP_GOTO_IN_HNDLR' -exports[1359] = 'ER_TRG_ALREADY_EXISTS' -exports[1360] = 'ER_TRG_DOES_NOT_EXIST' -exports[1361] = 'ER_TRG_ON_VIEW_OR_TEMP_TABLE' -exports[1362] = 'ER_TRG_CANT_CHANGE_ROW' -exports[1363] = 'ER_TRG_NO_SUCH_ROW_IN_TRG' -exports[1364] = 'ER_NO_DEFAULT_FOR_FIELD' -exports[1365] = 'ER_DIVISION_BY_ZERO' -exports[1366] = 'ER_TRUNCATED_WRONG_VALUE_FOR_FIELD' -exports[1367] = 'ER_ILLEGAL_VALUE_FOR_TYPE' -exports[1368] = 'ER_VIEW_NONUPD_CHECK' -exports[1369] = 'ER_VIEW_CHECK_FAILED' -exports[1370] = 'ER_PROCACCESS_DENIED_ERROR' -exports[1371] = 'ER_RELAY_LOG_FAIL' -exports[1372] = 'ER_PASSWD_LENGTH' -exports[1373] = 'ER_UNKNOWN_TARGET_BINLOG' -exports[1374] = 'ER_IO_ERR_LOG_INDEX_READ' -exports[1375] = 'ER_BINLOG_PURGE_PROHIBITED' -exports[1376] = 'ER_FSEEK_FAIL' -exports[1377] = 'ER_BINLOG_PURGE_FATAL_ERR' -exports[1378] = 'ER_LOG_IN_USE' -exports[1379] = 'ER_LOG_PURGE_UNKNOWN_ERR' -exports[1380] = 'ER_RELAY_LOG_INIT' -exports[1381] = 'ER_NO_BINARY_LOGGING' -exports[1382] = 'ER_RESERVED_SYNTAX' -exports[1383] = 'ER_WSAS_FAILED' -exports[1384] = 'ER_DIFF_GROUPS_PROC' -exports[1385] = 'ER_NO_GROUP_FOR_PROC' -exports[1386] = 'ER_ORDER_WITH_PROC' -exports[1387] = 'ER_LOGGING_PROHIBIT_CHANGING_OF' -exports[1388] = 'ER_NO_FILE_MAPPING' -exports[1389] = 'ER_WRONG_MAGIC' -exports[1390] = 'ER_PS_MANY_PARAM' -exports[1391] = 'ER_KEY_PART_0' -exports[1392] = 'ER_VIEW_CHECKSUM' -exports[1393] = 'ER_VIEW_MULTIUPDATE' -exports[1394] = 'ER_VIEW_NO_INSERT_FIELD_LIST' -exports[1395] = 'ER_VIEW_DELETE_MERGE_VIEW' -exports[1396] = 'ER_CANNOT_USER' -exports[1397] = 'ER_XAER_NOTA' -exports[1398] = 'ER_XAER_INVAL' -exports[1399] = 'ER_XAER_RMFAIL' -exports[1400] = 'ER_XAER_OUTSIDE' -exports[1401] = 'ER_XAER_RMERR' -exports[1402] = 'ER_XA_RBROLLBACK' -exports[1403] = 'ER_NONEXISTING_PROC_GRANT' -exports[1404] = 'ER_PROC_AUTO_GRANT_FAIL' -exports[1405] = 'ER_PROC_AUTO_REVOKE_FAIL' -exports[1406] = 'ER_DATA_TOO_LONG' -exports[1407] = 'ER_SP_BAD_SQLSTATE' -exports[1408] = 'ER_STARTUP' -exports[1409] = 'ER_LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR' -exports[1410] = 'ER_CANT_CREATE_USER_WITH_GRANT' -exports[1411] = 'ER_WRONG_VALUE_FOR_TYPE' -exports[1412] = 'ER_TABLE_DEF_CHANGED' -exports[1413] = 'ER_SP_DUP_HANDLER' -exports[1414] = 'ER_SP_NOT_VAR_ARG' -exports[1415] = 'ER_SP_NO_RETSET' -exports[1416] = 'ER_CANT_CREATE_GEOMETRY_OBJECT' -exports[1417] = 'ER_FAILED_ROUTINE_BREAK_BINLOG' -exports[1418] = 'ER_BINLOG_UNSAFE_ROUTINE' -exports[1419] = 'ER_BINLOG_CREATE_ROUTINE_NEED_SUPER' -exports[1420] = 'ER_EXEC_STMT_WITH_OPEN_CURSOR' -exports[1421] = 'ER_STMT_HAS_NO_OPEN_CURSOR' -exports[1422] = 'ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG' -exports[1423] = 'ER_NO_DEFAULT_FOR_VIEW_FIELD' -exports[1424] = 'ER_SP_NO_RECURSION' -exports[1425] = 'ER_TOO_BIG_SCALE' -exports[1426] = 'ER_TOO_BIG_PRECISION' -exports[1427] = 'ER_M_BIGGER_THAN_D' -exports[1428] = 'ER_WRONG_LOCK_OF_SYSTEM_TABLE' -exports[1429] = 'ER_CONNECT_TO_FOREIGN_DATA_SOURCE' -exports[1430] = 'ER_QUERY_ON_FOREIGN_DATA_SOURCE' -exports[1431] = 'ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST' -exports[1432] = 'ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE' -exports[1433] = 'ER_FOREIGN_DATA_STRING_INVALID' -exports[1434] = 'ER_CANT_CREATE_FEDERATED_TABLE' -exports[1435] = 'ER_TRG_IN_WRONG_SCHEMA' -exports[1436] = 'ER_STACK_OVERRUN_NEED_MORE' -exports[1437] = 'ER_TOO_LONG_BODY' -exports[1438] = 'ER_WARN_CANT_DROP_DEFAULT_KEYCACHE' -exports[1439] = 'ER_TOO_BIG_DISPLAYWIDTH' -exports[1440] = 'ER_XAER_DUPID' -exports[1441] = 'ER_DATETIME_FUNCTION_OVERFLOW' -exports[1442] = 'ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG' -exports[1443] = 'ER_VIEW_PREVENT_UPDATE' -exports[1444] = 'ER_PS_NO_RECURSION' -exports[1445] = 'ER_SP_CANT_SET_AUTOCOMMIT' -exports[1446] = 'ER_MALFORMED_DEFINER' -exports[1447] = 'ER_VIEW_FRM_NO_USER' -exports[1448] = 'ER_VIEW_OTHER_USER' -exports[1449] = 'ER_NO_SUCH_USER' -exports[1450] = 'ER_FORBID_SCHEMA_CHANGE' -exports[1451] = 'ER_ROW_IS_REFERENCED_2' -exports[1452] = 'ER_NO_REFERENCED_ROW_2' -exports[1453] = 'ER_SP_BAD_VAR_SHADOW' -exports[1454] = 'ER_TRG_NO_DEFINER' -exports[1455] = 'ER_OLD_FILE_FORMAT' -exports[1456] = 'ER_SP_RECURSION_LIMIT' -exports[1457] = 'ER_SP_PROC_TABLE_CORRUPT' -exports[1458] = 'ER_SP_WRONG_NAME' -exports[1459] = 'ER_TABLE_NEEDS_UPGRADE' -exports[1460] = 'ER_SP_NO_AGGREGATE' -exports[1461] = 'ER_MAX_PREPARED_STMT_COUNT_REACHED' -exports[1462] = 'ER_VIEW_RECURSIVE' -exports[1463] = 'ER_NON_GROUPING_FIELD_USED' -exports[1464] = 'ER_TABLE_CANT_HANDLE_SPKEYS' -exports[1465] = 'ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA' -exports[1466] = 'ER_REMOVED_SPACES' -exports[1467] = 'ER_AUTOINC_READ_FAILED' -exports[1468] = 'ER_USERNAME' -exports[1469] = 'ER_HOSTNAME' -exports[1470] = 'ER_WRONG_STRING_LENGTH' -exports[1471] = 'ER_NON_INSERTABLE_TABLE' -exports[1472] = 'ER_ADMIN_WRONG_MRG_TABLE' -exports[1473] = 'ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT' -exports[1474] = 'ER_NAME_BECOMES_EMPTY' -exports[1475] = 'ER_AMBIGUOUS_FIELD_TERM' -exports[1476] = 'ER_FOREIGN_SERVER_EXISTS' -exports[1477] = 'ER_FOREIGN_SERVER_DOESNT_EXIST' -exports[1478] = 'ER_ILLEGAL_HA_CREATE_OPTION' -exports[1479] = 'ER_PARTITION_REQUIRES_VALUES_ERROR' -exports[1480] = 'ER_PARTITION_WRONG_VALUES_ERROR' -exports[1481] = 'ER_PARTITION_MAXVALUE_ERROR' -exports[1482] = 'ER_PARTITION_SUBPARTITION_ERROR' -exports[1483] = 'ER_PARTITION_SUBPART_MIX_ERROR' -exports[1484] = 'ER_PARTITION_WRONG_NO_PART_ERROR' -exports[1485] = 'ER_PARTITION_WRONG_NO_SUBPART_ERROR' -exports[1486] = 'ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR' -exports[1487] = 'ER_NO_CONST_EXPR_IN_RANGE_OR_LIST_ERROR' -exports[1488] = 'ER_FIELD_NOT_FOUND_PART_ERROR' -exports[1489] = 'ER_LIST_OF_FIELDS_ONLY_IN_HASH_ERROR' -exports[1490] = 'ER_INCONSISTENT_PARTITION_INFO_ERROR' -exports[1491] = 'ER_PARTITION_FUNC_NOT_ALLOWED_ERROR' -exports[1492] = 'ER_PARTITIONS_MUST_BE_DEFINED_ERROR' -exports[1493] = 'ER_RANGE_NOT_INCREASING_ERROR' -exports[1494] = 'ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR' -exports[1495] = 'ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR' -exports[1496] = 'ER_PARTITION_ENTRY_ERROR' -exports[1497] = 'ER_MIX_HANDLER_ERROR' -exports[1498] = 'ER_PARTITION_NOT_DEFINED_ERROR' -exports[1499] = 'ER_TOO_MANY_PARTITIONS_ERROR' -exports[1500] = 'ER_SUBPARTITION_ERROR' -exports[1501] = 'ER_CANT_CREATE_HANDLER_FILE' -exports[1502] = 'ER_BLOB_FIELD_IN_PART_FUNC_ERROR' -exports[1503] = 'ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF' -exports[1504] = 'ER_NO_PARTS_ERROR' -exports[1505] = 'ER_PARTITION_MGMT_ON_NONPARTITIONED' -exports[1506] = 'ER_FOREIGN_KEY_ON_PARTITIONED' -exports[1507] = 'ER_DROP_PARTITION_NON_EXISTENT' -exports[1508] = 'ER_DROP_LAST_PARTITION' -exports[1509] = 'ER_COALESCE_ONLY_ON_HASH_PARTITION' -exports[1510] = 'ER_REORG_HASH_ONLY_ON_SAME_NO' -exports[1511] = 'ER_REORG_NO_PARAM_ERROR' -exports[1512] = 'ER_ONLY_ON_RANGE_LIST_PARTITION' -exports[1513] = 'ER_ADD_PARTITION_SUBPART_ERROR' -exports[1514] = 'ER_ADD_PARTITION_NO_NEW_PARTITION' -exports[1515] = 'ER_COALESCE_PARTITION_NO_PARTITION' -exports[1516] = 'ER_REORG_PARTITION_NOT_EXIST' -exports[1517] = 'ER_SAME_NAME_PARTITION' -exports[1518] = 'ER_NO_BINLOG_ERROR' -exports[1519] = 'ER_CONSECUTIVE_REORG_PARTITIONS' -exports[1520] = 'ER_REORG_OUTSIDE_RANGE' -exports[1521] = 'ER_PARTITION_FUNCTION_FAILURE' -exports[1522] = 'ER_PART_STATE_ERROR' -exports[1523] = 'ER_LIMITED_PART_RANGE' -exports[1524] = 'ER_PLUGIN_IS_NOT_LOADED' -exports[1525] = 'ER_WRONG_VALUE' -exports[1526] = 'ER_NO_PARTITION_FOR_GIVEN_VALUE' -exports[1527] = 'ER_FILEGROUP_OPTION_ONLY_ONCE' -exports[1528] = 'ER_CREATE_FILEGROUP_FAILED' -exports[1529] = 'ER_DROP_FILEGROUP_FAILED' -exports[1530] = 'ER_TABLESPACE_AUTO_EXTEND_ERROR' -exports[1531] = 'ER_WRONG_SIZE_NUMBER' -exports[1532] = 'ER_SIZE_OVERFLOW_ERROR' -exports[1533] = 'ER_ALTER_FILEGROUP_FAILED' -exports[1534] = 'ER_BINLOG_ROW_LOGGING_FAILED' -exports[1535] = 'ER_BINLOG_ROW_WRONG_TABLE_DEF' -exports[1536] = 'ER_BINLOG_ROW_RBR_TO_SBR' -exports[1537] = 'ER_EVENT_ALREADY_EXISTS' -exports[1538] = 'ER_EVENT_STORE_FAILED' -exports[1539] = 'ER_EVENT_DOES_NOT_EXIST' -exports[1540] = 'ER_EVENT_CANT_ALTER' -exports[1541] = 'ER_EVENT_DROP_FAILED' -exports[1542] = 'ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG' -exports[1543] = 'ER_EVENT_ENDS_BEFORE_STARTS' -exports[1544] = 'ER_EVENT_EXEC_TIME_IN_THE_PAST' -exports[1545] = 'ER_EVENT_OPEN_TABLE_FAILED' -exports[1546] = 'ER_EVENT_NEITHER_M_EXPR_NOR_M_AT' -exports[1547] = 'ER_COL_COUNT_DOESNT_MATCH_CORRUPTED' -exports[1548] = 'ER_CANNOT_LOAD_FROM_TABLE' -exports[1549] = 'ER_EVENT_CANNOT_DELETE' -exports[1550] = 'ER_EVENT_COMPILE_ERROR' -exports[1551] = 'ER_EVENT_SAME_NAME' -exports[1552] = 'ER_EVENT_DATA_TOO_LONG' -exports[1553] = 'ER_DROP_INDEX_FK' -exports[1554] = 'ER_WARN_DEPRECATED_SYNTAX_WITH_VER' -exports[1555] = 'ER_CANT_WRITE_LOCK_LOG_TABLE' -exports[1556] = 'ER_CANT_LOCK_LOG_TABLE' -exports[1557] = 'ER_FOREIGN_DUPLICATE_KEY' -exports[1558] = 'ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE' -exports[1559] = 'ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR' -exports[1560] = 'ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT' -exports[1561] = 'ER_NDB_CANT_SWITCH_BINLOG_FORMAT' -exports[1562] = 'ER_PARTITION_NO_TEMPORARY' -exports[1563] = 'ER_PARTITION_CONST_DOMAIN_ERROR' -exports[1564] = 'ER_PARTITION_FUNCTION_IS_NOT_ALLOWED' -exports[1565] = 'ER_DDL_LOG_ERROR' -exports[1566] = 'ER_NULL_IN_VALUES_LESS_THAN' -exports[1567] = 'ER_WRONG_PARTITION_NAME' -exports[1568] = 'ER_CANT_CHANGE_TX_CHARACTERISTICS' -exports[1569] = 'ER_DUP_ENTRY_AUTOINCREMENT_CASE' -exports[1570] = 'ER_EVENT_MODIFY_QUEUE_ERROR' -exports[1571] = 'ER_EVENT_SET_VAR_ERROR' -exports[1572] = 'ER_PARTITION_MERGE_ERROR' -exports[1573] = 'ER_CANT_ACTIVATE_LOG' -exports[1574] = 'ER_RBR_NOT_AVAILABLE' -exports[1575] = 'ER_BASE64_DECODE_ERROR' -exports[1576] = 'ER_EVENT_RECURSION_FORBIDDEN' -exports[1577] = 'ER_EVENTS_DB_ERROR' -exports[1578] = 'ER_ONLY_INTEGERS_ALLOWED' -exports[1579] = 'ER_UNSUPORTED_LOG_ENGINE' -exports[1580] = 'ER_BAD_LOG_STATEMENT' -exports[1581] = 'ER_CANT_RENAME_LOG_TABLE' -exports[1582] = 'ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT' -exports[1583] = 'ER_WRONG_PARAMETERS_TO_NATIVE_FCT' -exports[1584] = 'ER_WRONG_PARAMETERS_TO_STORED_FCT' -exports[1585] = 'ER_NATIVE_FCT_NAME_COLLISION' -exports[1586] = 'ER_DUP_ENTRY_WITH_KEY_NAME' -exports[1587] = 'ER_BINLOG_PURGE_EMFILE' -exports[1588] = 'ER_EVENT_CANNOT_CREATE_IN_THE_PAST' -exports[1589] = 'ER_EVENT_CANNOT_ALTER_IN_THE_PAST' -exports[1590] = 'ER_SLAVE_INCIDENT' -exports[1591] = 'ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT' -exports[1592] = 'ER_BINLOG_UNSAFE_STATEMENT' -exports[1593] = 'ER_BINLOG_FATAL_ERROR' -exports[1594] = 'ER_SLAVE_RELAY_LOG_READ_FAILURE' -exports[1595] = 'ER_SLAVE_RELAY_LOG_WRITE_FAILURE' -exports[1596] = 'ER_SLAVE_CREATE_EVENT_FAILURE' -exports[1597] = 'ER_SLAVE_MASTER_COM_FAILURE' -exports[1598] = 'ER_BINLOG_LOGGING_IMPOSSIBLE' -exports[1599] = 'ER_VIEW_NO_CREATION_CTX' -exports[1600] = 'ER_VIEW_INVALID_CREATION_CTX' -exports[1601] = 'ER_SR_INVALID_CREATION_CTX' -exports[1602] = 'ER_TRG_CORRUPTED_FILE' -exports[1603] = 'ER_TRG_NO_CREATION_CTX' -exports[1604] = 'ER_TRG_INVALID_CREATION_CTX' -exports[1605] = 'ER_EVENT_INVALID_CREATION_CTX' -exports[1606] = 'ER_TRG_CANT_OPEN_TABLE' -exports[1607] = 'ER_CANT_CREATE_SROUTINE' -exports[1608] = 'ER_NEVER_USED' -exports[1609] = 'ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT' -exports[1610] = 'ER_REPLICA_CORRUPT_EVENT' -exports[1611] = 'ER_LOAD_DATA_INVALID_COLUMN' -exports[1612] = 'ER_LOG_PURGE_NO_FILE' -exports[1613] = 'ER_XA_RBTIMEOUT' -exports[1614] = 'ER_XA_RBDEADLOCK' -exports[1615] = 'ER_NEED_REPREPARE' -exports[1616] = 'ER_DELAYED_NOT_SUPPORTED' -exports[1617] = 'WARN_NO_CONNECTION_METADATA' -exports[1618] = 'WARN_OPTION_IGNORED' -exports[1619] = 'ER_PLUGIN_DELETE_BUILTIN' -exports[1620] = 'WARN_PLUGIN_BUSY' -exports[1621] = 'ER_VARIABLE_IS_READONLY' -exports[1622] = 'ER_WARN_ENGINE_TRANSACTION_ROLLBACK' -exports[1623] = 'ER_SLAVE_HEARTBEAT_FAILURE' -exports[1624] = 'ER_REPLICA_HEARTBEAT_VALUE_OUT_OF_RANGE' -exports[1625] = 'ER_NDB_REPLICATION_SCHEMA_ERROR' -exports[1626] = 'ER_CONFLICT_FN_PARSE_ERROR' -exports[1627] = 'ER_EXCEPTIONS_WRITE_ERROR' -exports[1628] = 'ER_TOO_LONG_TABLE_COMMENT' -exports[1629] = 'ER_TOO_LONG_FIELD_COMMENT' -exports[1630] = 'ER_FUNC_INEXISTENT_NAME_COLLISION' -exports[1631] = 'ER_DATABASE_NAME' -exports[1632] = 'ER_TABLE_NAME' -exports[1633] = 'ER_PARTITION_NAME' -exports[1634] = 'ER_SUBPARTITION_NAME' -exports[1635] = 'ER_TEMPORARY_NAME' -exports[1636] = 'ER_RENAMED_NAME' -exports[1637] = 'ER_TOO_MANY_CONCURRENT_TRXS' -exports[1638] = 'WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED' -exports[1639] = 'ER_DEBUG_SYNC_TIMEOUT' -exports[1640] = 'ER_DEBUG_SYNC_HIT_LIMIT' -exports[1641] = 'ER_DUP_SIGNAL_SET' -exports[1642] = 'ER_SIGNAL_WARN' -exports[1643] = 'ER_SIGNAL_NOT_FOUND' -exports[1644] = 'ER_SIGNAL_EXCEPTION' -exports[1645] = 'ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER' -exports[1646] = 'ER_SIGNAL_BAD_CONDITION_TYPE' -exports[1647] = 'WARN_COND_ITEM_TRUNCATED' -exports[1648] = 'ER_COND_ITEM_TOO_LONG' -exports[1649] = 'ER_UNKNOWN_LOCALE' -exports[1650] = 'ER_REPLICA_IGNORE_SERVER_IDS' -exports[1651] = 'ER_QUERY_CACHE_DISABLED' -exports[1652] = 'ER_SAME_NAME_PARTITION_FIELD' -exports[1653] = 'ER_PARTITION_COLUMN_LIST_ERROR' -exports[1654] = 'ER_WRONG_TYPE_COLUMN_VALUE_ERROR' -exports[1655] = 'ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR' -exports[1656] = 'ER_MAXVALUE_IN_VALUES_IN' -exports[1657] = 'ER_TOO_MANY_VALUES_ERROR' -exports[1658] = 'ER_ROW_SINGLE_PARTITION_FIELD_ERROR' -exports[1659] = 'ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD' -exports[1660] = 'ER_PARTITION_FIELDS_TOO_LONG' -exports[1661] = 'ER_BINLOG_ROW_ENGINE_AND_STMT_ENGINE' -exports[1662] = 'ER_BINLOG_ROW_MODE_AND_STMT_ENGINE' -exports[1663] = 'ER_BINLOG_UNSAFE_AND_STMT_ENGINE' -exports[1664] = 'ER_BINLOG_ROW_INJECTION_AND_STMT_ENGINE' -exports[1665] = 'ER_BINLOG_STMT_MODE_AND_ROW_ENGINE' -exports[1666] = 'ER_BINLOG_ROW_INJECTION_AND_STMT_MODE' -exports[1667] = 'ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE' -exports[1668] = 'ER_BINLOG_UNSAFE_LIMIT' -exports[1669] = 'ER_UNUSED4' -exports[1670] = 'ER_BINLOG_UNSAFE_SYSTEM_TABLE' -exports[1671] = 'ER_BINLOG_UNSAFE_AUTOINC_COLUMNS' -exports[1672] = 'ER_BINLOG_UNSAFE_UDF' -exports[1673] = 'ER_BINLOG_UNSAFE_SYSTEM_VARIABLE' -exports[1674] = 'ER_BINLOG_UNSAFE_SYSTEM_FUNCTION' -exports[1675] = 'ER_BINLOG_UNSAFE_NONTRANS_AFTER_TRANS' -exports[1676] = 'ER_MESSAGE_AND_STATEMENT' -exports[1677] = 'ER_SLAVE_CONVERSION_FAILED' -exports[1678] = 'ER_REPLICA_CANT_CREATE_CONVERSION' -exports[1679] = 'ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT' -exports[1680] = 'ER_PATH_LENGTH' -exports[1681] = 'ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT' -exports[1682] = 'ER_WRONG_NATIVE_TABLE_STRUCTURE' -exports[1683] = 'ER_WRONG_PERFSCHEMA_USAGE' -exports[1684] = 'ER_WARN_I_S_SKIPPED_TABLE' -exports[1685] = 'ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT' -exports[1686] = 'ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_DIRECT' -exports[1687] = 'ER_SPATIAL_MUST_HAVE_GEOM_COL' -exports[1688] = 'ER_TOO_LONG_INDEX_COMMENT' -exports[1689] = 'ER_LOCK_ABORTED' -exports[1690] = 'ER_DATA_OUT_OF_RANGE' -exports[1691] = 'ER_WRONG_SPVAR_TYPE_IN_LIMIT' -exports[1692] = 'ER_BINLOG_UNSAFE_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE' -exports[1693] = 'ER_BINLOG_UNSAFE_MIXED_STATEMENT' -exports[1694] = 'ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SQL_LOG_BIN' -exports[1695] = 'ER_STORED_FUNCTION_PREVENTS_SWITCH_SQL_LOG_BIN' -exports[1696] = 'ER_FAILED_READ_FROM_PAR_FILE' -exports[1697] = 'ER_VALUES_IS_NOT_INT_TYPE_ERROR' -exports[1698] = 'ER_ACCESS_DENIED_NO_PASSWORD_ERROR' -exports[1699] = 'ER_SET_PASSWORD_AUTH_PLUGIN' -exports[1700] = 'ER_GRANT_PLUGIN_USER_EXISTS' -exports[1701] = 'ER_TRUNCATE_ILLEGAL_FK' -exports[1702] = 'ER_PLUGIN_IS_PERMANENT' -exports[1703] = 'ER_REPLICA_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN' -exports[1704] = 'ER_REPLICA_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX' -exports[1705] = 'ER_STMT_CACHE_FULL' -exports[1706] = 'ER_MULTI_UPDATE_KEY_CONFLICT' -exports[1707] = 'ER_TABLE_NEEDS_REBUILD' -exports[1708] = 'WARN_OPTION_BELOW_LIMIT' -exports[1709] = 'ER_INDEX_COLUMN_TOO_LONG' -exports[1710] = 'ER_ERROR_IN_TRIGGER_BODY' -exports[1711] = 'ER_ERROR_IN_UNKNOWN_TRIGGER_BODY' -exports[1712] = 'ER_INDEX_CORRUPT' -exports[1713] = 'ER_UNDO_RECORD_TOO_BIG' -exports[1714] = 'ER_BINLOG_UNSAFE_INSERT_IGNORE_SELECT' -exports[1715] = 'ER_BINLOG_UNSAFE_INSERT_SELECT_UPDATE' -exports[1716] = 'ER_BINLOG_UNSAFE_REPLACE_SELECT' -exports[1717] = 'ER_BINLOG_UNSAFE_CREATE_IGNORE_SELECT' -exports[1718] = 'ER_BINLOG_UNSAFE_CREATE_REPLACE_SELECT' -exports[1719] = 'ER_BINLOG_UNSAFE_UPDATE_IGNORE' -exports[1720] = 'ER_PLUGIN_NO_UNINSTALL' -exports[1721] = 'ER_PLUGIN_NO_INSTALL' -exports[1722] = 'ER_BINLOG_UNSAFE_WRITE_AUTOINC_SELECT' -exports[1723] = 'ER_BINLOG_UNSAFE_CREATE_SELECT_AUTOINC' -exports[1724] = 'ER_BINLOG_UNSAFE_INSERT_TWO_KEYS' -exports[1725] = 'ER_TABLE_IN_FK_CHECK' -exports[1726] = 'ER_UNSUPPORTED_ENGINE' -exports[1727] = 'ER_BINLOG_UNSAFE_AUTOINC_NOT_FIRST' -exports[1728] = 'ER_CANNOT_LOAD_FROM_TABLE_V2' -exports[1729] = 'ER_SOURCE_DELAY_VALUE_OUT_OF_RANGE' -exports[1730] = 'ER_ONLY_FD_AND_RBR_EVENTS_ALLOWED_IN_BINLOG_STATEMENT' -exports[1731] = 'ER_PARTITION_EXCHANGE_DIFFERENT_OPTION' -exports[1732] = 'ER_PARTITION_EXCHANGE_PART_TABLE' -exports[1733] = 'ER_PARTITION_EXCHANGE_TEMP_TABLE' -exports[1734] = 'ER_PARTITION_INSTEAD_OF_SUBPARTITION' -exports[1735] = 'ER_UNKNOWN_PARTITION' -exports[1736] = 'ER_TABLES_DIFFERENT_METADATA' -exports[1737] = 'ER_ROW_DOES_NOT_MATCH_PARTITION' -exports[1738] = 'ER_BINLOG_CACHE_SIZE_GREATER_THAN_MAX' -exports[1739] = 'ER_WARN_INDEX_NOT_APPLICABLE' -exports[1740] = 'ER_PARTITION_EXCHANGE_FOREIGN_KEY' -exports[1741] = 'ER_NO_SUCH_KEY_VALUE' -exports[1742] = 'ER_RPL_INFO_DATA_TOO_LONG' -exports[1743] = 'ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE' -exports[1744] = 'ER_BINLOG_READ_EVENT_CHECKSUM_FAILURE' -exports[1745] = 'ER_BINLOG_STMT_CACHE_SIZE_GREATER_THAN_MAX' -exports[1746] = 'ER_CANT_UPDATE_TABLE_IN_CREATE_TABLE_SELECT' -exports[1747] = 'ER_PARTITION_CLAUSE_ON_NONPARTITIONED' -exports[1748] = 'ER_ROW_DOES_NOT_MATCH_GIVEN_PARTITION_SET' -exports[1749] = 'ER_NO_SUCH_PARTITION' -exports[1750] = 'ER_CHANGE_RPL_INFO_REPOSITORY_FAILURE' -exports[1751] = 'ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_CREATED_TEMP_TABLE' -exports[1752] = 'ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_DROPPED_TEMP_TABLE' -exports[1753] = 'ER_MTA_FEATURE_IS_NOT_SUPPORTED' -exports[1754] = 'ER_MTA_UPDATED_DBS_GREATER_MAX' -exports[1755] = 'ER_MTA_CANT_PARALLEL' -exports[1756] = 'ER_MTA_INCONSISTENT_DATA' -exports[1757] = 'ER_FULLTEXT_NOT_SUPPORTED_WITH_PARTITIONING' -exports[1758] = 'ER_DA_INVALID_CONDITION_NUMBER' -exports[1759] = 'ER_INSECURE_PLAIN_TEXT' -exports[1760] = 'ER_INSECURE_CHANGE_SOURCE' -exports[1761] = 'ER_FOREIGN_DUPLICATE_KEY_WITH_CHILD_INFO' -exports[1762] = 'ER_FOREIGN_DUPLICATE_KEY_WITHOUT_CHILD_INFO' -exports[1763] = 'ER_SQLTHREAD_WITH_SECURE_REPLICA' -exports[1764] = 'ER_TABLE_HAS_NO_FT' -exports[1765] = 'ER_VARIABLE_NOT_SETTABLE_IN_SF_OR_TRIGGER' -exports[1766] = 'ER_VARIABLE_NOT_SETTABLE_IN_TRANSACTION' -exports[1767] = 'ER_GTID_NEXT_IS_NOT_IN_GTID_NEXT_LIST' -exports[1768] = 'ER_CANT_CHANGE_GTID_NEXT_IN_TRANSACTION' -exports[1769] = 'ER_SET_STATEMENT_CANNOT_INVOKE_FUNCTION' -exports[1770] = 'ER_GTID_NEXT_CANT_BE_AUTOMATIC_IF_GTID_NEXT_LIST_IS_NON_NULL' -exports[1771] = 'ER_SKIPPING_LOGGED_TRANSACTION' -exports[1772] = 'ER_MALFORMED_GTID_SET_SPECIFICATION' -exports[1773] = 'ER_MALFORMED_GTID_SET_ENCODING' -exports[1774] = 'ER_MALFORMED_GTID_SPECIFICATION' -exports[1775] = 'ER_GNO_EXHAUSTED' -exports[1776] = 'ER_BAD_REPLICA_AUTO_POSITION' -exports[1777] = 'ER_AUTO_POSITION_REQUIRES_GTID_MODE_NOT_OFF' -exports[1778] = 'ER_CANT_DO_IMPLICIT_COMMIT_IN_TRX_WHEN_GTID_NEXT_IS_SET' -exports[1779] = 'ER_GTID_MODE_ON_REQUIRES_ENFORCE_GTID_CONSISTENCY_ON' -exports[1780] = 'ER_GTID_MODE_REQUIRES_BINLOG' -exports[1781] = 'ER_CANT_SET_GTID_NEXT_TO_GTID_WHEN_GTID_MODE_IS_OFF' -exports[1782] = 'ER_CANT_SET_GTID_NEXT_TO_ANONYMOUS_WHEN_GTID_MODE_IS_ON' -exports[1783] = 'ER_CANT_SET_GTID_NEXT_LIST_TO_NON_NULL_WHEN_GTID_MODE_IS_OFF' -exports[1784] = 'ER_FOUND_GTID_EVENT_WHEN_GTID_MODE_IS_OFF' -exports[1785] = 'ER_GTID_UNSAFE_NON_TRANSACTIONAL_TABLE' -exports[1786] = 'ER_GTID_UNSAFE_CREATE_SELECT' -exports[1787] = 'ER_GTID_UNSAFE_CREATE_DROP_TEMP_TABLE_IN_TRANSACTION' -exports[1788] = 'ER_GTID_MODE_CAN_ONLY_CHANGE_ONE_STEP_AT_A_TIME' -exports[1789] = 'ER_SOURCE_HAS_PURGED_REQUIRED_GTIDS' -exports[1790] = 'ER_CANT_SET_GTID_NEXT_WHEN_OWNING_GTID' -exports[1791] = 'ER_UNKNOWN_EXPLAIN_FORMAT' -exports[1792] = 'ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION' -exports[1793] = 'ER_TOO_LONG_TABLE_PARTITION_COMMENT' -exports[1794] = 'ER_REPLICA_CONFIGURATION' -exports[1795] = 'ER_INNODB_FT_LIMIT' -exports[1796] = 'ER_INNODB_NO_FT_TEMP_TABLE' -exports[1797] = 'ER_INNODB_FT_WRONG_DOCID_COLUMN' -exports[1798] = 'ER_INNODB_FT_WRONG_DOCID_INDEX' -exports[1799] = 'ER_INNODB_ONLINE_LOG_TOO_BIG' -exports[1800] = 'ER_UNKNOWN_ALTER_ALGORITHM' -exports[1801] = 'ER_UNKNOWN_ALTER_LOCK' -exports[1802] = 'ER_MTA_CHANGE_SOURCE_CANT_RUN_WITH_GAPS' -exports[1803] = 'ER_MTA_RECOVERY_FAILURE' -exports[1804] = 'ER_MTA_RESET_WORKERS' -exports[1805] = 'ER_COL_COUNT_DOESNT_MATCH_CORRUPTED_V2' -exports[1806] = 'ER_REPLICA_SILENT_RETRY_TRANSACTION' -exports[1807] = 'ER_DISCARD_FK_CHECKS_RUNNING' -exports[1808] = 'ER_TABLE_SCHEMA_MISMATCH' -exports[1809] = 'ER_TABLE_IN_SYSTEM_TABLESPACE' -exports[1810] = 'ER_IO_READ_ERROR' -exports[1811] = 'ER_IO_WRITE_ERROR' -exports[1812] = 'ER_TABLESPACE_MISSING' -exports[1813] = 'ER_TABLESPACE_EXISTS' -exports[1814] = 'ER_TABLESPACE_DISCARDED' -exports[1815] = 'ER_INTERNAL_ERROR' -exports[1816] = 'ER_INNODB_IMPORT_ERROR' -exports[1817] = 'ER_INNODB_INDEX_CORRUPT' -exports[1818] = 'ER_INVALID_YEAR_COLUMN_LENGTH' -exports[1819] = 'ER_NOT_VALID_PASSWORD' -exports[1820] = 'ER_MUST_CHANGE_PASSWORD' -exports[1821] = 'ER_FK_NO_INDEX_CHILD' -exports[1822] = 'ER_FK_NO_INDEX_PARENT' -exports[1823] = 'ER_FK_FAIL_ADD_SYSTEM' -exports[1824] = 'ER_FK_CANNOT_OPEN_PARENT' -exports[1825] = 'ER_FK_INCORRECT_OPTION' -exports[1826] = 'ER_FK_DUP_NAME' -exports[1827] = 'ER_PASSWORD_FORMAT' -exports[1828] = 'ER_FK_COLUMN_CANNOT_DROP' -exports[1829] = 'ER_FK_COLUMN_CANNOT_DROP_CHILD' -exports[1830] = 'ER_FK_COLUMN_NOT_NULL' -exports[1831] = 'ER_DUP_INDEX' -exports[1832] = 'ER_FK_COLUMN_CANNOT_CHANGE' -exports[1833] = 'ER_FK_COLUMN_CANNOT_CHANGE_CHILD' -exports[1834] = 'ER_UNUSED5' -exports[1835] = 'ER_MALFORMED_PACKET' -exports[1836] = 'ER_READ_ONLY_MODE' -exports[1837] = 'ER_GTID_NEXT_TYPE_UNDEFINED_GTID' -exports[1838] = 'ER_VARIABLE_NOT_SETTABLE_IN_SP' -exports[1839] = 'ER_CANT_SET_GTID_PURGED_WHEN_GTID_MODE_IS_OFF' -exports[1840] = 'ER_CANT_SET_GTID_PURGED_WHEN_GTID_EXECUTED_IS_NOT_EMPTY' -exports[1841] = 'ER_CANT_SET_GTID_PURGED_WHEN_OWNED_GTIDS_IS_NOT_EMPTY' -exports[1842] = 'ER_GTID_PURGED_WAS_CHANGED' -exports[1843] = 'ER_GTID_EXECUTED_WAS_CHANGED' -exports[1844] = 'ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES' -exports[1845] = 'ER_ALTER_OPERATION_NOT_SUPPORTED' -exports[1846] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON' -exports[1847] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COPY' -exports[1848] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_PARTITION' -exports[1849] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_RENAME' -exports[1850] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COLUMN_TYPE' -exports[1851] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_CHECK' -exports[1852] = 'ER_UNUSED6' -exports[1853] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOPK' -exports[1854] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_AUTOINC' -exports[1855] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_HIDDEN_FTS' -exports[1856] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_CHANGE_FTS' -exports[1857] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FTS' -exports[1858] = 'ER_SQL_REPLICA_SKIP_COUNTER_NOT_SETTABLE_IN_GTID_MODE' -exports[1859] = 'ER_DUP_UNKNOWN_IN_INDEX' -exports[1860] = 'ER_IDENT_CAUSES_TOO_LONG_PATH' -exports[1861] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOT_NULL' -exports[1862] = 'ER_MUST_CHANGE_PASSWORD_LOGIN' -exports[1863] = 'ER_ROW_IN_WRONG_PARTITION' -exports[1864] = 'ER_MTA_EVENT_BIGGER_PENDING_JOBS_SIZE_MAX' -exports[1865] = 'ER_INNODB_NO_FT_USES_PARSER' -exports[1866] = 'ER_BINLOG_LOGICAL_CORRUPTION' -exports[1867] = 'ER_WARN_PURGE_LOG_IN_USE' -exports[1868] = 'ER_WARN_PURGE_LOG_IS_ACTIVE' -exports[1869] = 'ER_AUTO_INCREMENT_CONFLICT' -exports[1870] = 'WARN_ON_BLOCKHOLE_IN_RBR' -exports[1871] = 'ER_REPLICA_CM_INIT_REPOSITORY' -exports[1872] = 'ER_REPLICA_AM_INIT_REPOSITORY' -exports[1873] = 'ER_ACCESS_DENIED_CHANGE_USER_ERROR' -exports[1874] = 'ER_INNODB_READ_ONLY' -exports[1875] = 'ER_STOP_REPLICA_SQL_THREAD_TIMEOUT' -exports[1876] = 'ER_STOP_REPLICA_IO_THREAD_TIMEOUT' -exports[1877] = 'ER_TABLE_CORRUPT' -exports[1878] = 'ER_TEMP_FILE_WRITE_FAILURE' -exports[1879] = 'ER_INNODB_FT_AUX_NOT_HEX_ID' -exports[1880] = 'ER_OLD_TEMPORALS_UPGRADED' -exports[1881] = 'ER_INNODB_FORCED_RECOVERY' -exports[1882] = 'ER_AES_INVALID_IV' -exports[1883] = 'ER_PLUGIN_CANNOT_BE_UNINSTALLED' -exports[1884] = 'ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_ASSIGNED_GTID' -exports[1885] = 'ER_REPLICA_HAS_MORE_GTIDS_THAN_SOURCE' -exports[1886] = 'ER_MISSING_KEY' -exports[1887] = 'WARN_NAMED_PIPE_ACCESS_EVERYONE' -exports[3000] = 'ER_FILE_CORRUPT' -exports[3001] = 'ER_ERROR_ON_SOURCE' -exports[3002] = 'ER_INCONSISTENT_ERROR' -exports[3003] = 'ER_STORAGE_ENGINE_NOT_LOADED' -exports[3004] = 'ER_GET_STACKED_DA_WITHOUT_ACTIVE_HANDLER' -exports[3005] = 'ER_WARN_LEGACY_SYNTAX_CONVERTED' -exports[3006] = 'ER_BINLOG_UNSAFE_FULLTEXT_PLUGIN' -exports[3007] = 'ER_CANNOT_DISCARD_TEMPORARY_TABLE' -exports[3008] = 'ER_FK_DEPTH_EXCEEDED' -exports[3009] = 'ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE_V2' -exports[3010] = 'ER_WARN_TRIGGER_DOESNT_HAVE_CREATED' -exports[3011] = 'ER_REFERENCED_TRG_DOES_NOT_EXIST' -exports[3012] = 'ER_EXPLAIN_NOT_SUPPORTED' -exports[3013] = 'ER_INVALID_FIELD_SIZE' -exports[3014] = 'ER_MISSING_HA_CREATE_OPTION' -exports[3015] = 'ER_ENGINE_OUT_OF_MEMORY' -exports[3016] = 'ER_PASSWORD_EXPIRE_ANONYMOUS_USER' -exports[3017] = 'ER_REPLICA_SQL_THREAD_MUST_STOP' -exports[3018] = 'ER_NO_FT_MATERIALIZED_SUBQUERY' -exports[3019] = 'ER_INNODB_UNDO_LOG_FULL' -exports[3020] = 'ER_INVALID_ARGUMENT_FOR_LOGARITHM' -exports[3021] = 'ER_REPLICA_CHANNEL_IO_THREAD_MUST_STOP' -exports[3022] = 'ER_WARN_OPEN_TEMP_TABLES_MUST_BE_ZERO' -exports[3023] = 'ER_WARN_ONLY_SOURCE_LOG_FILE_NO_POS' -exports[3024] = 'ER_QUERY_TIMEOUT' -exports[3025] = 'ER_NON_RO_SELECT_DISABLE_TIMER' -exports[3026] = 'ER_DUP_LIST_ENTRY' -exports[3027] = 'ER_SQL_MODE_NO_EFFECT' -exports[3028] = 'ER_AGGREGATE_ORDER_FOR_UNION' -exports[3029] = 'ER_AGGREGATE_ORDER_NON_AGG_QUERY' -exports[3030] = 'ER_REPLICA_WORKER_STOPPED_PREVIOUS_THD_ERROR' -exports[3031] = 'ER_DONT_SUPPORT_REPLICA_PRESERVE_COMMIT_ORDER' -exports[3032] = 'ER_SERVER_OFFLINE_MODE' -exports[3033] = 'ER_GIS_DIFFERENT_SRIDS' -exports[3034] = 'ER_GIS_UNSUPPORTED_ARGUMENT' -exports[3035] = 'ER_GIS_UNKNOWN_ERROR' -exports[3036] = 'ER_GIS_UNKNOWN_EXCEPTION' -exports[3037] = 'ER_GIS_INVALID_DATA' -exports[3038] = 'ER_BOOST_GEOMETRY_EMPTY_INPUT_EXCEPTION' -exports[3039] = 'ER_BOOST_GEOMETRY_CENTROID_EXCEPTION' -exports[3040] = 'ER_BOOST_GEOMETRY_OVERLAY_INVALID_INPUT_EXCEPTION' -exports[3041] = 'ER_BOOST_GEOMETRY_TURN_INFO_EXCEPTION' -exports[3042] = 'ER_BOOST_GEOMETRY_SELF_INTERSECTION_POINT_EXCEPTION' -exports[3043] = 'ER_BOOST_GEOMETRY_UNKNOWN_EXCEPTION' -exports[3044] = 'ER_STD_BAD_ALLOC_ERROR' -exports[3045] = 'ER_STD_DOMAIN_ERROR' -exports[3046] = 'ER_STD_LENGTH_ERROR' -exports[3047] = 'ER_STD_INVALID_ARGUMENT' -exports[3048] = 'ER_STD_OUT_OF_RANGE_ERROR' -exports[3049] = 'ER_STD_OVERFLOW_ERROR' -exports[3050] = 'ER_STD_RANGE_ERROR' -exports[3051] = 'ER_STD_UNDERFLOW_ERROR' -exports[3052] = 'ER_STD_LOGIC_ERROR' -exports[3053] = 'ER_STD_RUNTIME_ERROR' -exports[3054] = 'ER_STD_UNKNOWN_EXCEPTION' -exports[3055] = 'ER_GIS_DATA_WRONG_ENDIANESS' -exports[3056] = 'ER_CHANGE_SOURCE_PASSWORD_LENGTH' -exports[3057] = 'ER_USER_LOCK_WRONG_NAME' -exports[3058] = 'ER_USER_LOCK_DEADLOCK' -exports[3059] = 'ER_REPLACE_INACCESSIBLE_ROWS' -exports[3060] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_GIS' -exports[3061] = 'ER_ILLEGAL_USER_VAR' -exports[3062] = 'ER_GTID_MODE_OFF' -exports[3063] = 'ER_UNSUPPORTED_BY_REPLICATION_THREAD' -exports[3064] = 'ER_INCORRECT_TYPE' -exports[3065] = 'ER_FIELD_IN_ORDER_NOT_SELECT' -exports[3066] = 'ER_AGGREGATE_IN_ORDER_NOT_SELECT' -exports[3067] = 'ER_INVALID_RPL_WILD_TABLE_FILTER_PATTERN' -exports[3068] = 'ER_NET_OK_PACKET_TOO_LARGE' -exports[3069] = 'ER_INVALID_JSON_DATA' -exports[3070] = 'ER_INVALID_GEOJSON_MISSING_MEMBER' -exports[3071] = 'ER_INVALID_GEOJSON_WRONG_TYPE' -exports[3072] = 'ER_INVALID_GEOJSON_UNSPECIFIED' -exports[3073] = 'ER_DIMENSION_UNSUPPORTED' -exports[3074] = 'ER_REPLICA_CHANNEL_DOES_NOT_EXIST' -exports[3075] = 'ER_SLAVE_MULTIPLE_CHANNELS_HOST_PORT' -exports[3076] = 'ER_REPLICA_CHANNEL_NAME_INVALID_OR_TOO_LONG' -exports[3077] = 'ER_REPLICA_NEW_CHANNEL_WRONG_REPOSITORY' -exports[3078] = 'ER_SLAVE_CHANNEL_DELETE' -exports[3079] = 'ER_REPLICA_MULTIPLE_CHANNELS_CMD' -exports[3080] = 'ER_REPLICA_MAX_CHANNELS_EXCEEDED' -exports[3081] = 'ER_REPLICA_CHANNEL_MUST_STOP' -exports[3082] = 'ER_REPLICA_CHANNEL_NOT_RUNNING' -exports[3083] = 'ER_REPLICA_CHANNEL_WAS_RUNNING' -exports[3084] = 'ER_REPLICA_CHANNEL_WAS_NOT_RUNNING' -exports[3085] = 'ER_REPLICA_CHANNEL_SQL_THREAD_MUST_STOP' -exports[3086] = 'ER_REPLICA_CHANNEL_SQL_SKIP_COUNTER' -exports[3087] = 'ER_WRONG_FIELD_WITH_GROUP_V2' -exports[3088] = 'ER_MIX_OF_GROUP_FUNC_AND_FIELDS_V2' -exports[3089] = 'ER_WARN_DEPRECATED_SYSVAR_UPDATE' -exports[3090] = 'ER_WARN_DEPRECATED_SQLMODE' -exports[3091] = 'ER_CANNOT_LOG_PARTIAL_DROP_DATABASE_WITH_GTID' -exports[3092] = 'ER_GROUP_REPLICATION_CONFIGURATION' -exports[3093] = 'ER_GROUP_REPLICATION_RUNNING' -exports[3094] = 'ER_GROUP_REPLICATION_APPLIER_INIT_ERROR' -exports[3095] = 'ER_GROUP_REPLICATION_STOP_APPLIER_THREAD_TIMEOUT' -exports[3096] = 'ER_GROUP_REPLICATION_COMMUNICATION_LAYER_SESSION_ERROR' -exports[3097] = 'ER_GROUP_REPLICATION_COMMUNICATION_LAYER_JOIN_ERROR' -exports[3098] = 'ER_BEFORE_DML_VALIDATION_ERROR' -exports[3099] = 'ER_PREVENTS_VARIABLE_WITHOUT_RBR' -exports[3100] = 'ER_RUN_HOOK_ERROR' -exports[3101] = 'ER_TRANSACTION_ROLLBACK_DURING_COMMIT' -exports[3102] = 'ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED' -exports[3103] = 'ER_UNSUPPORTED_ALTER_INPLACE_ON_VIRTUAL_COLUMN' -exports[3104] = 'ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN' -exports[3105] = 'ER_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN' -exports[3106] = 'ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN' -exports[3107] = 'ER_GENERATED_COLUMN_NON_PRIOR' -exports[3108] = 'ER_DEPENDENT_BY_GENERATED_COLUMN' -exports[3109] = 'ER_GENERATED_COLUMN_REF_AUTO_INC' -exports[3110] = 'ER_FEATURE_NOT_AVAILABLE' -exports[3111] = 'ER_CANT_SET_GTID_MODE' -exports[3112] = 'ER_CANT_USE_AUTO_POSITION_WITH_GTID_MODE_OFF' -exports[3113] = 'ER_CANT_REPLICATE_ANONYMOUS_WITH_AUTO_POSITION' -exports[3114] = 'ER_CANT_REPLICATE_ANONYMOUS_WITH_GTID_MODE_ON' -exports[3115] = 'ER_CANT_REPLICATE_GTID_WITH_GTID_MODE_OFF' -exports[3116] = - 'ER_CANT_ENFORCE_GTID_CONSISTENCY_WITH_ONGOING_GTID_VIOLATING_TX' -exports[3117] = - 'ER_ENFORCE_GTID_CONSISTENCY_WARN_WITH_ONGOING_GTID_VIOLATING_TX' -exports[3118] = 'ER_ACCOUNT_HAS_BEEN_LOCKED' -exports[3119] = 'ER_WRONG_TABLESPACE_NAME' -exports[3120] = 'ER_TABLESPACE_IS_NOT_EMPTY' -exports[3121] = 'ER_WRONG_FILE_NAME' -exports[3122] = 'ER_BOOST_GEOMETRY_INCONSISTENT_TURNS_EXCEPTION' -exports[3123] = 'ER_WARN_OPTIMIZER_HINT_SYNTAX_ERROR' -exports[3124] = 'ER_WARN_BAD_MAX_EXECUTION_TIME' -exports[3125] = 'ER_WARN_UNSUPPORTED_MAX_EXECUTION_TIME' -exports[3126] = 'ER_WARN_CONFLICTING_HINT' -exports[3127] = 'ER_WARN_UNKNOWN_QB_NAME' -exports[3128] = 'ER_UNRESOLVED_HINT_NAME' -exports[3129] = 'ER_WARN_ON_MODIFYING_GTID_EXECUTED_TABLE' -exports[3130] = 'ER_PLUGGABLE_PROTOCOL_COMMAND_NOT_SUPPORTED' -exports[3131] = 'ER_LOCKING_SERVICE_WRONG_NAME' -exports[3132] = 'ER_LOCKING_SERVICE_DEADLOCK' -exports[3133] = 'ER_LOCKING_SERVICE_TIMEOUT' -exports[3134] = 'ER_GIS_MAX_POINTS_IN_GEOMETRY_OVERFLOWED' -exports[3135] = 'ER_SQL_MODE_MERGED' -exports[3136] = 'ER_VTOKEN_PLUGIN_TOKEN_MISMATCH' -exports[3137] = 'ER_VTOKEN_PLUGIN_TOKEN_NOT_FOUND' -exports[3138] = 'ER_CANT_SET_VARIABLE_WHEN_OWNING_GTID' -exports[3139] = 'ER_REPLICA_CHANNEL_OPERATION_NOT_ALLOWED' -exports[3140] = 'ER_INVALID_JSON_TEXT' -exports[3141] = 'ER_INVALID_JSON_TEXT_IN_PARAM' -exports[3142] = 'ER_INVALID_JSON_BINARY_DATA' -exports[3143] = 'ER_INVALID_JSON_PATH' -exports[3144] = 'ER_INVALID_JSON_CHARSET' -exports[3145] = 'ER_INVALID_JSON_CHARSET_IN_FUNCTION' -exports[3146] = 'ER_INVALID_TYPE_FOR_JSON' -exports[3147] = 'ER_INVALID_CAST_TO_JSON' -exports[3148] = 'ER_INVALID_JSON_PATH_CHARSET' -exports[3149] = 'ER_INVALID_JSON_PATH_WILDCARD' -exports[3150] = 'ER_JSON_VALUE_TOO_BIG' -exports[3151] = 'ER_JSON_KEY_TOO_BIG' -exports[3152] = 'ER_JSON_USED_AS_KEY' -exports[3153] = 'ER_JSON_VACUOUS_PATH' -exports[3154] = 'ER_JSON_BAD_ONE_OR_ALL_ARG' -exports[3155] = 'ER_NUMERIC_JSON_VALUE_OUT_OF_RANGE' -exports[3156] = 'ER_INVALID_JSON_VALUE_FOR_CAST' -exports[3157] = 'ER_JSON_DOCUMENT_TOO_DEEP' -exports[3158] = 'ER_JSON_DOCUMENT_NULL_KEY' -exports[3159] = 'ER_SECURE_TRANSPORT_REQUIRED' -exports[3160] = 'ER_NO_SECURE_TRANSPORTS_CONFIGURED' -exports[3161] = 'ER_DISABLED_STORAGE_ENGINE' -exports[3162] = 'ER_USER_DOES_NOT_EXIST' -exports[3163] = 'ER_USER_ALREADY_EXISTS' -exports[3164] = 'ER_AUDIT_API_ABORT' -exports[3165] = 'ER_INVALID_JSON_PATH_ARRAY_CELL' -exports[3166] = 'ER_BUFPOOL_RESIZE_INPROGRESS' -exports[3167] = 'ER_FEATURE_DISABLED_SEE_DOC' -exports[3168] = 'ER_SERVER_ISNT_AVAILABLE' -exports[3169] = 'ER_SESSION_WAS_KILLED' -exports[3170] = 'ER_CAPACITY_EXCEEDED' -exports[3171] = 'ER_CAPACITY_EXCEEDED_IN_RANGE_OPTIMIZER' -exports[3172] = 'ER_TABLE_NEEDS_UPG_PART' -exports[3173] = 'ER_CANT_WAIT_FOR_EXECUTED_GTID_SET_WHILE_OWNING_A_GTID' -exports[3174] = 'ER_CANNOT_ADD_FOREIGN_BASE_COL_VIRTUAL' -exports[3175] = 'ER_CANNOT_CREATE_VIRTUAL_INDEX_CONSTRAINT' -exports[3176] = 'ER_ERROR_ON_MODIFYING_GTID_EXECUTED_TABLE' -exports[3177] = 'ER_LOCK_REFUSED_BY_ENGINE' -exports[3178] = 'ER_UNSUPPORTED_ALTER_ONLINE_ON_VIRTUAL_COLUMN' -exports[3179] = 'ER_MASTER_KEY_ROTATION_NOT_SUPPORTED_BY_SE' -exports[3180] = 'ER_MASTER_KEY_ROTATION_ERROR_BY_SE' -exports[3181] = 'ER_MASTER_KEY_ROTATION_BINLOG_FAILED' -exports[3182] = 'ER_MASTER_KEY_ROTATION_SE_UNAVAILABLE' -exports[3183] = 'ER_TABLESPACE_CANNOT_ENCRYPT' -exports[3184] = 'ER_INVALID_ENCRYPTION_OPTION' -exports[3185] = 'ER_CANNOT_FIND_KEY_IN_KEYRING' -exports[3186] = 'ER_CAPACITY_EXCEEDED_IN_PARSER' -exports[3187] = 'ER_UNSUPPORTED_ALTER_ENCRYPTION_INPLACE' -exports[3188] = 'ER_KEYRING_UDF_KEYRING_SERVICE_ERROR' -exports[3189] = 'ER_USER_COLUMN_OLD_LENGTH' -exports[3190] = 'ER_CANT_RESET_SOURCE' -exports[3191] = 'ER_GROUP_REPLICATION_MAX_GROUP_SIZE' -exports[3192] = 'ER_CANNOT_ADD_FOREIGN_BASE_COL_STORED' -exports[3193] = 'ER_TABLE_REFERENCED' -exports[3194] = 'ER_PARTITION_ENGINE_DEPRECATED_FOR_TABLE' -exports[3195] = 'ER_WARN_USING_GEOMFROMWKB_TO_SET_SRID_ZERO' -exports[3196] = 'ER_WARN_USING_GEOMFROMWKB_TO_SET_SRID' -exports[3197] = 'ER_XA_RETRY' -exports[3198] = 'ER_KEYRING_AWS_UDF_AWS_KMS_ERROR' -exports[3199] = 'ER_BINLOG_UNSAFE_XA' -exports[3200] = 'ER_UDF_ERROR' -exports[3201] = 'ER_KEYRING_MIGRATION_FAILURE' -exports[3202] = 'ER_KEYRING_ACCESS_DENIED_ERROR' -exports[3203] = 'ER_KEYRING_MIGRATION_STATUS' -exports[3204] = 'ER_PLUGIN_FAILED_TO_OPEN_TABLES' -exports[3205] = 'ER_PLUGIN_FAILED_TO_OPEN_TABLE' -exports[3206] = 'ER_AUDIT_LOG_NO_KEYRING_PLUGIN_INSTALLED' -exports[3207] = 'ER_AUDIT_LOG_ENCRYPTION_PASSWORD_HAS_NOT_BEEN_SET' -exports[3208] = 'ER_AUDIT_LOG_COULD_NOT_CREATE_AES_KEY' -exports[3209] = 'ER_AUDIT_LOG_ENCRYPTION_PASSWORD_CANNOT_BE_FETCHED' -exports[3210] = 'ER_AUDIT_LOG_JSON_FILTERING_NOT_ENABLED' -exports[3211] = 'ER_AUDIT_LOG_UDF_INSUFFICIENT_PRIVILEGE' -exports[3212] = 'ER_AUDIT_LOG_SUPER_PRIVILEGE_REQUIRED' -exports[3213] = 'ER_COULD_NOT_REINITIALIZE_AUDIT_LOG_FILTERS' -exports[3214] = 'ER_AUDIT_LOG_UDF_INVALID_ARGUMENT_TYPE' -exports[3215] = 'ER_AUDIT_LOG_UDF_INVALID_ARGUMENT_COUNT' -exports[3216] = 'ER_AUDIT_LOG_HAS_NOT_BEEN_INSTALLED' -exports[3217] = 'ER_AUDIT_LOG_UDF_READ_INVALID_MAX_ARRAY_LENGTH_ARG_TYPE' -exports[3218] = 'ER_AUDIT_LOG_UDF_READ_INVALID_MAX_ARRAY_LENGTH_ARG_VALUE' -exports[3219] = 'ER_AUDIT_LOG_JSON_FILTER_PARSING_ERROR' -exports[3220] = 'ER_AUDIT_LOG_JSON_FILTER_NAME_CANNOT_BE_EMPTY' -exports[3221] = 'ER_AUDIT_LOG_JSON_USER_NAME_CANNOT_BE_EMPTY' -exports[3222] = 'ER_AUDIT_LOG_JSON_FILTER_DOES_NOT_EXISTS' -exports[3223] = 'ER_AUDIT_LOG_USER_FIRST_CHARACTER_MUST_BE_ALPHANUMERIC' -exports[3224] = 'ER_AUDIT_LOG_USER_NAME_INVALID_CHARACTER' -exports[3225] = 'ER_AUDIT_LOG_HOST_NAME_INVALID_CHARACTER' -exports[3226] = 'WARN_DEPRECATED_MAXDB_SQL_MODE_FOR_TIMESTAMP' -exports[3227] = 'ER_XA_REPLICATION_FILTERS' -exports[3228] = 'ER_CANT_OPEN_ERROR_LOG' -exports[3229] = 'ER_GROUPING_ON_TIMESTAMP_IN_DST' -exports[3230] = 'ER_CANT_START_SERVER_NAMED_PIPE' -exports[3231] = 'ER_WRITE_SET_EXCEEDS_LIMIT' -exports[3232] = 'ER_DEPRECATED_TLS_VERSION_SESSION_57' -exports[3233] = 'ER_WARN_DEPRECATED_TLS_VERSION_57' -exports[3234] = 'ER_WARN_WRONG_NATIVE_TABLE_STRUCTURE' -exports[3235] = 'ER_AES_INVALID_KDF_NAME' -exports[3236] = 'ER_AES_INVALID_KDF_ITERATIONS' -exports[3237] = 'WARN_AES_KEY_SIZE' -exports[3238] = 'ER_AES_INVALID_KDF_OPTION_SIZE' -exports[3500] = 'ER_UNSUPPORT_COMPRESSED_TEMPORARY_TABLE' -exports[3501] = 'ER_ACL_OPERATION_FAILED' -exports[3502] = 'ER_UNSUPPORTED_INDEX_ALGORITHM' -exports[3503] = 'ER_NO_SUCH_DB' -exports[3504] = 'ER_TOO_BIG_ENUM' -exports[3505] = 'ER_TOO_LONG_SET_ENUM_VALUE' -exports[3506] = 'ER_INVALID_DD_OBJECT' -exports[3507] = 'ER_UPDATING_DD_TABLE' -exports[3508] = 'ER_INVALID_DD_OBJECT_ID' -exports[3509] = 'ER_INVALID_DD_OBJECT_NAME' -exports[3510] = 'ER_TABLESPACE_MISSING_WITH_NAME' -exports[3511] = 'ER_TOO_LONG_ROUTINE_COMMENT' -exports[3512] = 'ER_SP_LOAD_FAILED' -exports[3513] = 'ER_INVALID_BITWISE_OPERANDS_SIZE' -exports[3514] = 'ER_INVALID_BITWISE_AGGREGATE_OPERANDS_SIZE' -exports[3515] = 'ER_WARN_UNSUPPORTED_HINT' -exports[3516] = 'ER_UNEXPECTED_GEOMETRY_TYPE' -exports[3517] = 'ER_SRS_PARSE_ERROR' -exports[3518] = 'ER_SRS_PROJ_PARAMETER_MISSING' -exports[3519] = 'ER_WARN_SRS_NOT_FOUND' -exports[3520] = 'ER_SRS_NOT_CARTESIAN' -exports[3521] = 'ER_SRS_NOT_CARTESIAN_UNDEFINED' -exports[3522] = 'ER_PK_INDEX_CANT_BE_INVISIBLE' -exports[3523] = 'ER_UNKNOWN_AUTHID' -exports[3524] = 'ER_FAILED_ROLE_GRANT' -exports[3525] = 'ER_OPEN_ROLE_TABLES' -exports[3526] = 'ER_FAILED_DEFAULT_ROLES' -exports[3527] = 'ER_COMPONENTS_NO_SCHEME' -exports[3528] = 'ER_COMPONENTS_NO_SCHEME_SERVICE' -exports[3529] = 'ER_COMPONENTS_CANT_LOAD' -exports[3530] = 'ER_ROLE_NOT_GRANTED' -exports[3531] = 'ER_FAILED_REVOKE_ROLE' -exports[3532] = 'ER_RENAME_ROLE' -exports[3533] = 'ER_COMPONENTS_CANT_ACQUIRE_SERVICE_IMPLEMENTATION' -exports[3534] = 'ER_COMPONENTS_CANT_SATISFY_DEPENDENCY' -exports[3535] = 'ER_COMPONENTS_LOAD_CANT_REGISTER_SERVICE_IMPLEMENTATION' -exports[3536] = 'ER_COMPONENTS_LOAD_CANT_INITIALIZE' -exports[3537] = 'ER_COMPONENTS_UNLOAD_NOT_LOADED' -exports[3538] = 'ER_COMPONENTS_UNLOAD_CANT_DEINITIALIZE' -exports[3539] = 'ER_COMPONENTS_CANT_RELEASE_SERVICE' -exports[3540] = 'ER_COMPONENTS_UNLOAD_CANT_UNREGISTER_SERVICE' -exports[3541] = 'ER_COMPONENTS_CANT_UNLOAD' -exports[3542] = 'ER_WARN_UNLOAD_THE_NOT_PERSISTED' -exports[3543] = 'ER_COMPONENT_TABLE_INCORRECT' -exports[3544] = 'ER_COMPONENT_MANIPULATE_ROW_FAILED' -exports[3545] = 'ER_COMPONENTS_UNLOAD_DUPLICATE_IN_GROUP' -exports[3546] = 'ER_CANT_SET_GTID_PURGED_DUE_SETS_CONSTRAINTS' -exports[3547] = 'ER_CANNOT_LOCK_USER_MANAGEMENT_CACHES' -exports[3548] = 'ER_SRS_NOT_FOUND' -exports[3549] = 'ER_VARIABLE_NOT_PERSISTED' -exports[3550] = 'ER_IS_QUERY_INVALID_CLAUSE' -exports[3551] = 'ER_UNABLE_TO_STORE_STATISTICS' -exports[3552] = 'ER_NO_SYSTEM_SCHEMA_ACCESS' -exports[3553] = 'ER_NO_SYSTEM_TABLESPACE_ACCESS' -exports[3554] = 'ER_NO_SYSTEM_TABLE_ACCESS' -exports[3555] = 'ER_NO_SYSTEM_TABLE_ACCESS_FOR_DICTIONARY_TABLE' -exports[3556] = 'ER_NO_SYSTEM_TABLE_ACCESS_FOR_SYSTEM_TABLE' -exports[3557] = 'ER_NO_SYSTEM_TABLE_ACCESS_FOR_TABLE' -exports[3558] = 'ER_INVALID_OPTION_KEY' -exports[3559] = 'ER_INVALID_OPTION_VALUE' -exports[3560] = 'ER_INVALID_OPTION_KEY_VALUE_PAIR' -exports[3561] = 'ER_INVALID_OPTION_START_CHARACTER' -exports[3562] = 'ER_INVALID_OPTION_END_CHARACTER' -exports[3563] = 'ER_INVALID_OPTION_CHARACTERS' -exports[3564] = 'ER_DUPLICATE_OPTION_KEY' -exports[3565] = 'ER_WARN_SRS_NOT_FOUND_AXIS_ORDER' -exports[3566] = 'ER_NO_ACCESS_TO_NATIVE_FCT' -exports[3567] = 'ER_RESET_SOURCE_TO_VALUE_OUT_OF_RANGE' -exports[3568] = 'ER_UNRESOLVED_TABLE_LOCK' -exports[3569] = 'ER_DUPLICATE_TABLE_LOCK' -exports[3570] = 'ER_BINLOG_UNSAFE_SKIP_LOCKED' -exports[3571] = 'ER_BINLOG_UNSAFE_NOWAIT' -exports[3572] = 'ER_LOCK_NOWAIT' -exports[3573] = 'ER_CTE_RECURSIVE_REQUIRES_UNION' -exports[3574] = 'ER_CTE_RECURSIVE_REQUIRES_NONRECURSIVE_FIRST' -exports[3575] = 'ER_CTE_RECURSIVE_FORBIDS_AGGREGATION' -exports[3576] = 'ER_CTE_RECURSIVE_FORBIDDEN_JOIN_ORDER' -exports[3577] = 'ER_CTE_RECURSIVE_REQUIRES_SINGLE_REFERENCE' -exports[3578] = 'ER_SWITCH_TMP_ENGINE' -exports[3579] = 'ER_WINDOW_NO_SUCH_WINDOW' -exports[3580] = 'ER_WINDOW_CIRCULARITY_IN_WINDOW_GRAPH' -exports[3581] = 'ER_WINDOW_NO_CHILD_PARTITIONING' -exports[3582] = 'ER_WINDOW_NO_INHERIT_FRAME' -exports[3583] = 'ER_WINDOW_NO_REDEFINE_ORDER_BY' -exports[3584] = 'ER_WINDOW_FRAME_START_ILLEGAL' -exports[3585] = 'ER_WINDOW_FRAME_END_ILLEGAL' -exports[3586] = 'ER_WINDOW_FRAME_ILLEGAL' -exports[3587] = 'ER_WINDOW_RANGE_FRAME_ORDER_TYPE' -exports[3588] = 'ER_WINDOW_RANGE_FRAME_TEMPORAL_TYPE' -exports[3589] = 'ER_WINDOW_RANGE_FRAME_NUMERIC_TYPE' -exports[3590] = 'ER_WINDOW_RANGE_BOUND_NOT_CONSTANT' -exports[3591] = 'ER_WINDOW_DUPLICATE_NAME' -exports[3592] = 'ER_WINDOW_ILLEGAL_ORDER_BY' -exports[3593] = 'ER_WINDOW_INVALID_WINDOW_FUNC_USE' -exports[3594] = 'ER_WINDOW_INVALID_WINDOW_FUNC_ALIAS_USE' -exports[3595] = 'ER_WINDOW_NESTED_WINDOW_FUNC_USE_IN_WINDOW_SPEC' -exports[3596] = 'ER_WINDOW_ROWS_INTERVAL_USE' -exports[3597] = 'ER_WINDOW_NO_GROUP_ORDER' -exports[3598] = 'ER_WINDOW_EXPLAIN_JSON' -exports[3599] = 'ER_WINDOW_FUNCTION_IGNORES_FRAME' -exports[3600] = 'ER_WL9236_NOW' -exports[3601] = 'ER_INVALID_NO_OF_ARGS' -exports[3602] = 'ER_FIELD_IN_GROUPING_NOT_GROUP_BY' -exports[3603] = 'ER_TOO_LONG_TABLESPACE_COMMENT' -exports[3604] = 'ER_ENGINE_CANT_DROP_TABLE' -exports[3605] = 'ER_ENGINE_CANT_DROP_MISSING_TABLE' -exports[3606] = 'ER_TABLESPACE_DUP_FILENAME' -exports[3607] = 'ER_DB_DROP_RMDIR2' -exports[3608] = 'ER_IMP_NO_FILES_MATCHED' -exports[3609] = 'ER_IMP_SCHEMA_DOES_NOT_EXIST' -exports[3610] = 'ER_IMP_TABLE_ALREADY_EXISTS' -exports[3611] = 'ER_IMP_INCOMPATIBLE_MYSQLD_VERSION' -exports[3612] = 'ER_IMP_INCOMPATIBLE_DD_VERSION' -exports[3613] = 'ER_IMP_INCOMPATIBLE_SDI_VERSION' -exports[3614] = 'ER_WARN_INVALID_HINT' -exports[3615] = 'ER_VAR_DOES_NOT_EXIST' -exports[3616] = 'ER_LONGITUDE_OUT_OF_RANGE' -exports[3617] = 'ER_LATITUDE_OUT_OF_RANGE' -exports[3618] = 'ER_NOT_IMPLEMENTED_FOR_GEOGRAPHIC_SRS' -exports[3619] = 'ER_ILLEGAL_PRIVILEGE_LEVEL' -exports[3620] = 'ER_NO_SYSTEM_VIEW_ACCESS' -exports[3621] = 'ER_COMPONENT_FILTER_FLABBERGASTED' -exports[3622] = 'ER_PART_EXPR_TOO_LONG' -exports[3623] = 'ER_UDF_DROP_DYNAMICALLY_REGISTERED' -exports[3624] = 'ER_UNABLE_TO_STORE_COLUMN_STATISTICS' -exports[3625] = 'ER_UNABLE_TO_UPDATE_COLUMN_STATISTICS' -exports[3626] = 'ER_UNABLE_TO_DROP_COLUMN_STATISTICS' -exports[3627] = 'ER_UNABLE_TO_BUILD_HISTOGRAM' -exports[3628] = 'ER_MANDATORY_ROLE' -exports[3629] = 'ER_MISSING_TABLESPACE_FILE' -exports[3630] = 'ER_PERSIST_ONLY_ACCESS_DENIED_ERROR' -exports[3631] = 'ER_CMD_NEED_SUPER' -exports[3632] = 'ER_PATH_IN_DATADIR' -exports[3633] = 'ER_CLONE_DDL_IN_PROGRESS' -exports[3634] = 'ER_CLONE_TOO_MANY_CONCURRENT_CLONES' -exports[3635] = 'ER_APPLIER_LOG_EVENT_VALIDATION_ERROR' -exports[3636] = 'ER_CTE_MAX_RECURSION_DEPTH' -exports[3637] = 'ER_NOT_HINT_UPDATABLE_VARIABLE' -exports[3638] = 'ER_CREDENTIALS_CONTRADICT_TO_HISTORY' -exports[3639] = 'ER_WARNING_PASSWORD_HISTORY_CLAUSES_VOID' -exports[3640] = 'ER_CLIENT_DOES_NOT_SUPPORT' -exports[3641] = 'ER_I_S_SKIPPED_TABLESPACE' -exports[3642] = 'ER_TABLESPACE_ENGINE_MISMATCH' -exports[3643] = 'ER_WRONG_SRID_FOR_COLUMN' -exports[3644] = 'ER_CANNOT_ALTER_SRID_DUE_TO_INDEX' -exports[3645] = 'ER_WARN_BINLOG_PARTIAL_UPDATES_DISABLED' -exports[3646] = 'ER_WARN_BINLOG_V1_ROW_EVENTS_DISABLED' -exports[3647] = 'ER_WARN_BINLOG_PARTIAL_UPDATES_SUGGESTS_PARTIAL_IMAGES' -exports[3648] = 'ER_COULD_NOT_APPLY_JSON_DIFF' -exports[3649] = 'ER_CORRUPTED_JSON_DIFF' -exports[3650] = 'ER_RESOURCE_GROUP_EXISTS' -exports[3651] = 'ER_RESOURCE_GROUP_NOT_EXISTS' -exports[3652] = 'ER_INVALID_VCPU_ID' -exports[3653] = 'ER_INVALID_VCPU_RANGE' -exports[3654] = 'ER_INVALID_THREAD_PRIORITY' -exports[3655] = 'ER_DISALLOWED_OPERATION' -exports[3656] = 'ER_RESOURCE_GROUP_BUSY' -exports[3657] = 'ER_RESOURCE_GROUP_DISABLED' -exports[3658] = 'ER_FEATURE_UNSUPPORTED' -exports[3659] = 'ER_ATTRIBUTE_IGNORED' -exports[3660] = 'ER_INVALID_THREAD_ID' -exports[3661] = 'ER_RESOURCE_GROUP_BIND_FAILED' -exports[3662] = 'ER_INVALID_USE_OF_FORCE_OPTION' -exports[3663] = 'ER_GROUP_REPLICATION_COMMAND_FAILURE' -exports[3664] = 'ER_SDI_OPERATION_FAILED' -exports[3665] = 'ER_MISSING_JSON_TABLE_VALUE' -exports[3666] = 'ER_WRONG_JSON_TABLE_VALUE' -exports[3667] = 'ER_TF_MUST_HAVE_ALIAS' -exports[3668] = 'ER_TF_FORBIDDEN_JOIN_TYPE' -exports[3669] = 'ER_JT_VALUE_OUT_OF_RANGE' -exports[3670] = 'ER_JT_MAX_NESTED_PATH' -exports[3671] = 'ER_PASSWORD_EXPIRATION_NOT_SUPPORTED_BY_AUTH_METHOD' -exports[3672] = 'ER_INVALID_GEOJSON_CRS_NOT_TOP_LEVEL' -exports[3673] = 'ER_BAD_NULL_ERROR_NOT_IGNORED' -exports[3674] = 'WARN_USELESS_SPATIAL_INDEX' -exports[3675] = 'ER_DISK_FULL_NOWAIT' -exports[3676] = 'ER_PARSE_ERROR_IN_DIGEST_FN' -exports[3677] = 'ER_UNDISCLOSED_PARSE_ERROR_IN_DIGEST_FN' -exports[3678] = 'ER_SCHEMA_DIR_EXISTS' -exports[3679] = 'ER_SCHEMA_DIR_MISSING' -exports[3680] = 'ER_SCHEMA_DIR_CREATE_FAILED' -exports[3681] = 'ER_SCHEMA_DIR_UNKNOWN' -exports[3682] = 'ER_ONLY_IMPLEMENTED_FOR_SRID_0_AND_4326' -exports[3683] = 'ER_BINLOG_EXPIRE_LOG_DAYS_AND_SECS_USED_TOGETHER' -exports[3684] = 'ER_REGEXP_BUFFER_OVERFLOW' -exports[3685] = 'ER_REGEXP_ILLEGAL_ARGUMENT' -exports[3686] = 'ER_REGEXP_INDEX_OUTOFBOUNDS_ERROR' -exports[3687] = 'ER_REGEXP_INTERNAL_ERROR' -exports[3688] = 'ER_REGEXP_RULE_SYNTAX' -exports[3689] = 'ER_REGEXP_BAD_ESCAPE_SEQUENCE' -exports[3690] = 'ER_REGEXP_UNIMPLEMENTED' -exports[3691] = 'ER_REGEXP_MISMATCHED_PAREN' -exports[3692] = 'ER_REGEXP_BAD_INTERVAL' -exports[3693] = 'ER_REGEXP_MAX_LT_MIN' -exports[3694] = 'ER_REGEXP_INVALID_BACK_REF' -exports[3695] = 'ER_REGEXP_LOOK_BEHIND_LIMIT' -exports[3696] = 'ER_REGEXP_MISSING_CLOSE_BRACKET' -exports[3697] = 'ER_REGEXP_INVALID_RANGE' -exports[3698] = 'ER_REGEXP_STACK_OVERFLOW' -exports[3699] = 'ER_REGEXP_TIME_OUT' -exports[3700] = 'ER_REGEXP_PATTERN_TOO_BIG' -exports[3701] = 'ER_CANT_SET_ERROR_LOG_SERVICE' -exports[3702] = 'ER_EMPTY_PIPELINE_FOR_ERROR_LOG_SERVICE' -exports[3703] = 'ER_COMPONENT_FILTER_DIAGNOSTICS' -exports[3704] = 'ER_NOT_IMPLEMENTED_FOR_CARTESIAN_SRS' -exports[3705] = 'ER_NOT_IMPLEMENTED_FOR_PROJECTED_SRS' -exports[3706] = 'ER_NONPOSITIVE_RADIUS' -exports[3707] = 'ER_RESTART_SERVER_FAILED' -exports[3708] = 'ER_SRS_MISSING_MANDATORY_ATTRIBUTE' -exports[3709] = 'ER_SRS_MULTIPLE_ATTRIBUTE_DEFINITIONS' -exports[3710] = 'ER_SRS_NAME_CANT_BE_EMPTY_OR_WHITESPACE' -exports[3711] = 'ER_SRS_ORGANIZATION_CANT_BE_EMPTY_OR_WHITESPACE' -exports[3712] = 'ER_SRS_ID_ALREADY_EXISTS' -exports[3713] = 'ER_WARN_SRS_ID_ALREADY_EXISTS' -exports[3714] = 'ER_CANT_MODIFY_SRID_0' -exports[3715] = 'ER_WARN_RESERVED_SRID_RANGE' -exports[3716] = 'ER_CANT_MODIFY_SRS_USED_BY_COLUMN' -exports[3717] = 'ER_SRS_INVALID_CHARACTER_IN_ATTRIBUTE' -exports[3718] = 'ER_SRS_ATTRIBUTE_STRING_TOO_LONG' -exports[3719] = 'ER_DEPRECATED_UTF8_ALIAS' -exports[3720] = 'ER_DEPRECATED_NATIONAL' -exports[3721] = 'ER_INVALID_DEFAULT_UTF8MB4_COLLATION' -exports[3722] = 'ER_UNABLE_TO_COLLECT_LOG_STATUS' -exports[3723] = 'ER_RESERVED_TABLESPACE_NAME' -exports[3724] = 'ER_UNABLE_TO_SET_OPTION' -exports[3725] = 'ER_REPLICA_POSSIBLY_DIVERGED_AFTER_DDL' -exports[3726] = 'ER_SRS_NOT_GEOGRAPHIC' -exports[3727] = 'ER_POLYGON_TOO_LARGE' -exports[3728] = 'ER_SPATIAL_UNIQUE_INDEX' -exports[3729] = 'ER_INDEX_TYPE_NOT_SUPPORTED_FOR_SPATIAL_INDEX' -exports[3730] = 'ER_FK_CANNOT_DROP_PARENT' -exports[3731] = 'ER_GEOMETRY_PARAM_LONGITUDE_OUT_OF_RANGE' -exports[3732] = 'ER_GEOMETRY_PARAM_LATITUDE_OUT_OF_RANGE' -exports[3733] = 'ER_FK_CANNOT_USE_VIRTUAL_COLUMN' -exports[3734] = 'ER_FK_NO_COLUMN_PARENT' -exports[3735] = 'ER_CANT_SET_ERROR_SUPPRESSION_LIST' -exports[3736] = 'ER_SRS_GEOGCS_INVALID_AXES' -exports[3737] = 'ER_SRS_INVALID_SEMI_MAJOR_AXIS' -exports[3738] = 'ER_SRS_INVALID_INVERSE_FLATTENING' -exports[3739] = 'ER_SRS_INVALID_ANGULAR_UNIT' -exports[3740] = 'ER_SRS_INVALID_PRIME_MERIDIAN' -exports[3741] = 'ER_TRANSFORM_SOURCE_SRS_NOT_SUPPORTED' -exports[3742] = 'ER_TRANSFORM_TARGET_SRS_NOT_SUPPORTED' -exports[3743] = 'ER_TRANSFORM_SOURCE_SRS_MISSING_TOWGS84' -exports[3744] = 'ER_TRANSFORM_TARGET_SRS_MISSING_TOWGS84' -exports[3745] = 'ER_TEMP_TABLE_PREVENTS_SWITCH_SESSION_BINLOG_FORMAT' -exports[3746] = 'ER_TEMP_TABLE_PREVENTS_SWITCH_GLOBAL_BINLOG_FORMAT' -exports[3747] = 'ER_RUNNING_APPLIER_PREVENTS_SWITCH_GLOBAL_BINLOG_FORMAT' -exports[3748] = 'ER_CLIENT_GTID_UNSAFE_CREATE_DROP_TEMP_TABLE_IN_TRX_IN_SBR' -exports[3749] = 'ER_XA_CANT_CREATE_MDL_BACKUP' -exports[3750] = 'ER_TABLE_WITHOUT_PK' -exports[3751] = 'ER_WARN_DATA_TRUNCATED_FUNCTIONAL_INDEX' -exports[3752] = 'ER_WARN_DATA_OUT_OF_RANGE_FUNCTIONAL_INDEX' -exports[3753] = 'ER_FUNCTIONAL_INDEX_ON_JSON_OR_GEOMETRY_FUNCTION' -exports[3754] = 'ER_FUNCTIONAL_INDEX_REF_AUTO_INCREMENT' -exports[3755] = 'ER_CANNOT_DROP_COLUMN_FUNCTIONAL_INDEX' -exports[3756] = 'ER_FUNCTIONAL_INDEX_PRIMARY_KEY' -exports[3757] = 'ER_FUNCTIONAL_INDEX_ON_LOB' -exports[3758] = 'ER_FUNCTIONAL_INDEX_FUNCTION_IS_NOT_ALLOWED' -exports[3759] = 'ER_FULLTEXT_FUNCTIONAL_INDEX' -exports[3760] = 'ER_SPATIAL_FUNCTIONAL_INDEX' -exports[3761] = 'ER_WRONG_KEY_COLUMN_FUNCTIONAL_INDEX' -exports[3762] = 'ER_FUNCTIONAL_INDEX_ON_FIELD' -exports[3763] = 'ER_GENERATED_COLUMN_NAMED_FUNCTION_IS_NOT_ALLOWED' -exports[3764] = 'ER_GENERATED_COLUMN_ROW_VALUE' -exports[3765] = 'ER_GENERATED_COLUMN_VARIABLES' -exports[3766] = 'ER_DEPENDENT_BY_DEFAULT_GENERATED_VALUE' -exports[3767] = 'ER_DEFAULT_VAL_GENERATED_NON_PRIOR' -exports[3768] = 'ER_DEFAULT_VAL_GENERATED_REF_AUTO_INC' -exports[3769] = 'ER_DEFAULT_VAL_GENERATED_FUNCTION_IS_NOT_ALLOWED' -exports[3770] = 'ER_DEFAULT_VAL_GENERATED_NAMED_FUNCTION_IS_NOT_ALLOWED' -exports[3771] = 'ER_DEFAULT_VAL_GENERATED_ROW_VALUE' -exports[3772] = 'ER_DEFAULT_VAL_GENERATED_VARIABLES' -exports[3773] = 'ER_DEFAULT_AS_VAL_GENERATED' -exports[3774] = 'ER_UNSUPPORTED_ACTION_ON_DEFAULT_VAL_GENERATED' -exports[3775] = 'ER_GTID_UNSAFE_ALTER_ADD_COL_WITH_DEFAULT_EXPRESSION' -exports[3776] = 'ER_FK_CANNOT_CHANGE_ENGINE' -exports[3777] = 'ER_WARN_DEPRECATED_USER_SET_EXPR' -exports[3778] = 'ER_WARN_DEPRECATED_UTF8MB3_COLLATION' -exports[3779] = 'ER_WARN_DEPRECATED_NESTED_COMMENT_SYNTAX' -exports[3780] = 'ER_FK_INCOMPATIBLE_COLUMNS' -exports[3781] = 'ER_GR_HOLD_WAIT_TIMEOUT' -exports[3782] = 'ER_GR_HOLD_KILLED' -exports[3783] = 'ER_GR_HOLD_MEMBER_STATUS_ERROR' -exports[3784] = 'ER_RPL_ENCRYPTION_FAILED_TO_FETCH_KEY' -exports[3785] = 'ER_RPL_ENCRYPTION_KEY_NOT_FOUND' -exports[3786] = 'ER_RPL_ENCRYPTION_KEYRING_INVALID_KEY' -exports[3787] = 'ER_RPL_ENCRYPTION_HEADER_ERROR' -exports[3788] = 'ER_RPL_ENCRYPTION_FAILED_TO_ROTATE_LOGS' -exports[3789] = 'ER_RPL_ENCRYPTION_KEY_EXISTS_UNEXPECTED' -exports[3790] = 'ER_RPL_ENCRYPTION_FAILED_TO_GENERATE_KEY' -exports[3791] = 'ER_RPL_ENCRYPTION_FAILED_TO_STORE_KEY' -exports[3792] = 'ER_RPL_ENCRYPTION_FAILED_TO_REMOVE_KEY' -exports[3793] = 'ER_RPL_ENCRYPTION_UNABLE_TO_CHANGE_OPTION' -exports[3794] = 'ER_RPL_ENCRYPTION_MASTER_KEY_RECOVERY_FAILED' -exports[3795] = 'ER_SLOW_LOG_MODE_IGNORED_WHEN_NOT_LOGGING_TO_FILE' -exports[3796] = 'ER_GRP_TRX_CONSISTENCY_NOT_ALLOWED' -exports[3797] = 'ER_GRP_TRX_CONSISTENCY_BEFORE' -exports[3798] = 'ER_GRP_TRX_CONSISTENCY_AFTER_ON_TRX_BEGIN' -exports[3799] = 'ER_GRP_TRX_CONSISTENCY_BEGIN_NOT_ALLOWED' -exports[3800] = 'ER_FUNCTIONAL_INDEX_ROW_VALUE_IS_NOT_ALLOWED' -exports[3801] = 'ER_RPL_ENCRYPTION_FAILED_TO_ENCRYPT' -exports[3802] = 'ER_PAGE_TRACKING_NOT_STARTED' -exports[3803] = 'ER_PAGE_TRACKING_RANGE_NOT_TRACKED' -exports[3804] = 'ER_PAGE_TRACKING_CANNOT_PURGE' -exports[3805] = 'ER_RPL_ENCRYPTION_CANNOT_ROTATE_BINLOG_MASTER_KEY' -exports[3806] = 'ER_BINLOG_MASTER_KEY_RECOVERY_OUT_OF_COMBINATION' -exports[3807] = 'ER_BINLOG_MASTER_KEY_ROTATION_FAIL_TO_OPERATE_KEY' -exports[3808] = 'ER_BINLOG_MASTER_KEY_ROTATION_FAIL_TO_ROTATE_LOGS' -exports[3809] = 'ER_BINLOG_MASTER_KEY_ROTATION_FAIL_TO_REENCRYPT_LOG' -exports[3810] = 'ER_BINLOG_MASTER_KEY_ROTATION_FAIL_TO_CLEANUP_UNUSED_KEYS' -exports[3811] = 'ER_BINLOG_MASTER_KEY_ROTATION_FAIL_TO_CLEANUP_AUX_KEY' -exports[3812] = 'ER_NON_BOOLEAN_EXPR_FOR_CHECK_CONSTRAINT' -exports[3813] = 'ER_COLUMN_CHECK_CONSTRAINT_REFERENCES_OTHER_COLUMN' -exports[3814] = 'ER_CHECK_CONSTRAINT_NAMED_FUNCTION_IS_NOT_ALLOWED' -exports[3815] = 'ER_CHECK_CONSTRAINT_FUNCTION_IS_NOT_ALLOWED' -exports[3816] = 'ER_CHECK_CONSTRAINT_VARIABLES' -exports[3817] = 'ER_CHECK_CONSTRAINT_ROW_VALUE' -exports[3818] = 'ER_CHECK_CONSTRAINT_REFERS_AUTO_INCREMENT_COLUMN' -exports[3819] = 'ER_CHECK_CONSTRAINT_VIOLATED' -exports[3820] = 'ER_CHECK_CONSTRAINT_REFERS_UNKNOWN_COLUMN' -exports[3821] = 'ER_CHECK_CONSTRAINT_NOT_FOUND' -exports[3822] = 'ER_CHECK_CONSTRAINT_DUP_NAME' -exports[3823] = 'ER_CHECK_CONSTRAINT_CLAUSE_USING_FK_REFER_ACTION_COLUMN' -exports[3824] = 'WARN_UNENCRYPTED_TABLE_IN_ENCRYPTED_DB' -exports[3825] = 'ER_INVALID_ENCRYPTION_REQUEST' -exports[3826] = 'ER_CANNOT_SET_TABLE_ENCRYPTION' -exports[3827] = 'ER_CANNOT_SET_DATABASE_ENCRYPTION' -exports[3828] = 'ER_CANNOT_SET_TABLESPACE_ENCRYPTION' -exports[3829] = 'ER_TABLESPACE_CANNOT_BE_ENCRYPTED' -exports[3830] = 'ER_TABLESPACE_CANNOT_BE_DECRYPTED' -exports[3831] = 'ER_TABLESPACE_TYPE_UNKNOWN' -exports[3832] = 'ER_TARGET_TABLESPACE_UNENCRYPTED' -exports[3833] = 'ER_CANNOT_USE_ENCRYPTION_CLAUSE' -exports[3834] = 'ER_INVALID_MULTIPLE_CLAUSES' -exports[3835] = 'ER_UNSUPPORTED_USE_OF_GRANT_AS' -exports[3836] = 'ER_UKNOWN_AUTH_ID_OR_ACCESS_DENIED_FOR_GRANT_AS' -exports[3837] = 'ER_DEPENDENT_BY_FUNCTIONAL_INDEX' -exports[3838] = 'ER_PLUGIN_NOT_EARLY' -exports[3839] = 'ER_INNODB_REDO_LOG_ARCHIVE_START_SUBDIR_PATH' -exports[3840] = 'ER_INNODB_REDO_LOG_ARCHIVE_START_TIMEOUT' -exports[3841] = 'ER_INNODB_REDO_LOG_ARCHIVE_DIRS_INVALID' -exports[3842] = 'ER_INNODB_REDO_LOG_ARCHIVE_LABEL_NOT_FOUND' -exports[3843] = 'ER_INNODB_REDO_LOG_ARCHIVE_DIR_EMPTY' -exports[3844] = 'ER_INNODB_REDO_LOG_ARCHIVE_NO_SUCH_DIR' -exports[3845] = 'ER_INNODB_REDO_LOG_ARCHIVE_DIR_CLASH' -exports[3846] = 'ER_INNODB_REDO_LOG_ARCHIVE_DIR_PERMISSIONS' -exports[3847] = 'ER_INNODB_REDO_LOG_ARCHIVE_FILE_CREATE' -exports[3848] = 'ER_INNODB_REDO_LOG_ARCHIVE_ACTIVE' -exports[3849] = 'ER_INNODB_REDO_LOG_ARCHIVE_INACTIVE' -exports[3850] = 'ER_INNODB_REDO_LOG_ARCHIVE_FAILED' -exports[3851] = 'ER_INNODB_REDO_LOG_ARCHIVE_SESSION' -exports[3852] = 'ER_STD_REGEX_ERROR' -exports[3853] = 'ER_INVALID_JSON_TYPE' -exports[3854] = 'ER_CANNOT_CONVERT_STRING' -exports[3855] = 'ER_DEPENDENT_BY_PARTITION_FUNC' -exports[3856] = 'ER_WARN_DEPRECATED_FLOAT_AUTO_INCREMENT' -exports[3857] = 'ER_RPL_CANT_STOP_REPLICA_WHILE_LOCKED_BACKUP' -exports[3858] = 'ER_WARN_DEPRECATED_FLOAT_DIGITS' -exports[3859] = 'ER_WARN_DEPRECATED_FLOAT_UNSIGNED' -exports[3860] = 'ER_WARN_DEPRECATED_INTEGER_DISPLAY_WIDTH' -exports[3861] = 'ER_WARN_DEPRECATED_ZEROFILL' -exports[3862] = 'ER_CLONE_DONOR' -exports[3863] = 'ER_CLONE_PROTOCOL' -exports[3864] = 'ER_CLONE_DONOR_VERSION' -exports[3865] = 'ER_CLONE_OS' -exports[3866] = 'ER_CLONE_PLATFORM' -exports[3867] = 'ER_CLONE_CHARSET' -exports[3868] = 'ER_CLONE_CONFIG' -exports[3869] = 'ER_CLONE_SYS_CONFIG' -exports[3870] = 'ER_CLONE_PLUGIN_MATCH' -exports[3871] = 'ER_CLONE_LOOPBACK' -exports[3872] = 'ER_CLONE_ENCRYPTION' -exports[3873] = 'ER_CLONE_DISK_SPACE' -exports[3874] = 'ER_CLONE_IN_PROGRESS' -exports[3875] = 'ER_CLONE_DISALLOWED' -exports[3876] = 'ER_CANNOT_GRANT_ROLES_TO_ANONYMOUS_USER' -exports[3877] = 'ER_SECONDARY_ENGINE_PLUGIN' -exports[3878] = 'ER_SECOND_PASSWORD_CANNOT_BE_EMPTY' -exports[3879] = 'ER_DB_ACCESS_DENIED' -exports[3880] = 'ER_DA_AUTH_ID_WITH_SYSTEM_USER_PRIV_IN_MANDATORY_ROLES' -exports[3881] = 'ER_DA_RPL_GTID_TABLE_CANNOT_OPEN' -exports[3882] = 'ER_GEOMETRY_IN_UNKNOWN_LENGTH_UNIT' -exports[3883] = 'ER_DA_PLUGIN_INSTALL_ERROR' -exports[3884] = 'ER_NO_SESSION_TEMP' -exports[3885] = 'ER_DA_UNKNOWN_ERROR_NUMBER' -exports[3886] = 'ER_COLUMN_CHANGE_SIZE' -exports[3887] = 'ER_REGEXP_INVALID_CAPTURE_GROUP_NAME' -exports[3888] = 'ER_DA_SSL_LIBRARY_ERROR' -exports[3889] = 'ER_SECONDARY_ENGINE' -exports[3890] = 'ER_SECONDARY_ENGINE_DDL' -exports[3891] = 'ER_INCORRECT_CURRENT_PASSWORD' -exports[3892] = 'ER_MISSING_CURRENT_PASSWORD' -exports[3893] = 'ER_CURRENT_PASSWORD_NOT_REQUIRED' -exports[3894] = 'ER_PASSWORD_CANNOT_BE_RETAINED_ON_PLUGIN_CHANGE' -exports[3895] = 'ER_CURRENT_PASSWORD_CANNOT_BE_RETAINED' -exports[3896] = 'ER_PARTIAL_REVOKES_EXIST' -exports[3897] = 'ER_CANNOT_GRANT_SYSTEM_PRIV_TO_MANDATORY_ROLE' -exports[3898] = 'ER_XA_REPLICATION_FILTERS' -exports[3899] = 'ER_UNSUPPORTED_SQL_MODE' -exports[3900] = 'ER_REGEXP_INVALID_FLAG' -exports[3901] = 'ER_PARTIAL_REVOKE_AND_DB_GRANT_BOTH_EXISTS' -exports[3902] = 'ER_UNIT_NOT_FOUND' -exports[3903] = 'ER_INVALID_JSON_VALUE_FOR_FUNC_INDEX' -exports[3904] = 'ER_JSON_VALUE_OUT_OF_RANGE_FOR_FUNC_INDEX' -exports[3905] = 'ER_EXCEEDED_MV_KEYS_NUM' -exports[3906] = 'ER_EXCEEDED_MV_KEYS_SPACE' -exports[3907] = 'ER_FUNCTIONAL_INDEX_DATA_IS_TOO_LONG' -exports[3908] = 'ER_WRONG_MVI_VALUE' -exports[3909] = 'ER_WARN_FUNC_INDEX_NOT_APPLICABLE' -exports[3910] = 'ER_GRP_RPL_UDF_ERROR' -exports[3911] = 'ER_UPDATE_GTID_PURGED_WITH_GR' -exports[3912] = 'ER_GROUPING_ON_TIMESTAMP_IN_DST' -exports[3913] = 'ER_TABLE_NAME_CAUSES_TOO_LONG_PATH' -exports[3914] = 'ER_AUDIT_LOG_INSUFFICIENT_PRIVILEGE' -exports[3915] = 'ER_AUDIT_LOG_PASSWORD_HAS_BEEN_COPIED' -exports[3916] = 'ER_DA_GRP_RPL_STARTED_AUTO_REJOIN' -exports[3917] = 'ER_SYSVAR_CHANGE_DURING_QUERY' -exports[3918] = 'ER_GLOBSTAT_CHANGE_DURING_QUERY' -exports[3919] = 'ER_GRP_RPL_MESSAGE_SERVICE_INIT_FAILURE' -exports[3920] = 'ER_CHANGE_SOURCE_WRONG_COMPRESSION_ALGORITHM_CLIENT' -exports[3921] = 'ER_CHANGE_SOURCE_WRONG_COMPRESSION_LEVEL_CLIENT' -exports[3922] = 'ER_WRONG_COMPRESSION_ALGORITHM_CLIENT' -exports[3923] = 'ER_WRONG_COMPRESSION_LEVEL_CLIENT' -exports[3924] = 'ER_CHANGE_SOURCE_WRONG_COMPRESSION_ALGORITHM_LIST_CLIENT' -exports[3925] = 'ER_CLIENT_PRIVILEGE_CHECKS_USER_CANNOT_BE_ANONYMOUS' -exports[3926] = 'ER_CLIENT_PRIVILEGE_CHECKS_USER_DOES_NOT_EXIST' -exports[3927] = 'ER_CLIENT_PRIVILEGE_CHECKS_USER_CORRUPT' -exports[3928] = 'ER_CLIENT_PRIVILEGE_CHECKS_USER_NEEDS_RPL_APPLIER_PRIV' -exports[3929] = 'ER_WARN_DA_PRIVILEGE_NOT_REGISTERED' -exports[3930] = 'ER_CLIENT_KEYRING_UDF_KEY_INVALID' -exports[3931] = 'ER_CLIENT_KEYRING_UDF_KEY_TYPE_INVALID' -exports[3932] = 'ER_CLIENT_KEYRING_UDF_KEY_TOO_LONG' -exports[3933] = 'ER_CLIENT_KEYRING_UDF_KEY_TYPE_TOO_LONG' -exports[3934] = 'ER_JSON_SCHEMA_VALIDATION_ERROR_WITH_DETAILED_REPORT' -exports[3935] = 'ER_DA_UDF_INVALID_CHARSET_SPECIFIED' -exports[3936] = 'ER_DA_UDF_INVALID_CHARSET' -exports[3937] = 'ER_DA_UDF_INVALID_COLLATION' -exports[3938] = 'ER_DA_UDF_INVALID_EXTENSION_ARGUMENT_TYPE' -exports[3939] = 'ER_MULTIPLE_CONSTRAINTS_WITH_SAME_NAME' -exports[3940] = 'ER_CONSTRAINT_NOT_FOUND' -exports[3941] = 'ER_ALTER_CONSTRAINT_ENFORCEMENT_NOT_SUPPORTED' -exports[3942] = 'ER_TABLE_VALUE_CONSTRUCTOR_MUST_HAVE_COLUMNS' -exports[3943] = 'ER_TABLE_VALUE_CONSTRUCTOR_CANNOT_HAVE_DEFAULT' -exports[3944] = 'ER_CLIENT_QUERY_FAILURE_INVALID_NON_ROW_FORMAT' -exports[3945] = 'ER_REQUIRE_ROW_FORMAT_INVALID_VALUE' -exports[3946] = 'ER_FAILED_TO_DETERMINE_IF_ROLE_IS_MANDATORY' -exports[3947] = 'ER_FAILED_TO_FETCH_MANDATORY_ROLE_LIST' -exports[3948] = 'ER_CLIENT_LOCAL_FILES_DISABLED' -exports[3949] = 'ER_IMP_INCOMPATIBLE_CFG_VERSION' -exports[3950] = 'ER_DA_OOM' -exports[3951] = 'ER_DA_UDF_INVALID_ARGUMENT_TO_SET_CHARSET' -exports[3952] = 'ER_DA_UDF_INVALID_RETURN_TYPE_TO_SET_CHARSET' -exports[3953] = 'ER_MULTIPLE_INTO_CLAUSES' -exports[3954] = 'ER_MISPLACED_INTO' -exports[3955] = 'ER_USER_ACCESS_DENIED_FOR_USER_ACCOUNT_BLOCKED_BY_PASSWORD_LOCK' -exports[3956] = 'ER_WARN_DEPRECATED_YEAR_UNSIGNED' -exports[3957] = 'ER_CLONE_NETWORK_PACKET' -exports[3958] = 'ER_SDI_OPERATION_FAILED_MISSING_RECORD' -exports[3959] = 'ER_DEPENDENT_BY_CHECK_CONSTRAINT' -exports[3960] = 'ER_GRP_OPERATION_NOT_ALLOWED_GR_MUST_STOP' -exports[3961] = 'ER_WARN_DEPRECATED_JSON_TABLE_ON_ERROR_ON_EMPTY' -exports[3962] = 'ER_WARN_DEPRECATED_INNER_INTO' -exports[3963] = 'ER_WARN_DEPRECATED_VALUES_FUNCTION_ALWAYS_NULL' -exports[3964] = 'ER_WARN_DEPRECATED_SQL_CALC_FOUND_ROWS' -exports[3965] = 'ER_WARN_DEPRECATED_FOUND_ROWS' -exports[3966] = 'ER_MISSING_JSON_VALUE' -exports[3967] = 'ER_MULTIPLE_JSON_VALUES' -exports[3968] = 'ER_HOSTNAME_TOO_LONG' -exports[3969] = 'ER_WARN_CLIENT_DEPRECATED_PARTITION_PREFIX_KEY' -exports[3970] = 'ER_GROUP_REPLICATION_USER_EMPTY_MSG' -exports[3971] = 'ER_GROUP_REPLICATION_USER_MANDATORY_MSG' -exports[3972] = 'ER_GROUP_REPLICATION_PASSWORD_LENGTH' -exports[3973] = 'ER_SUBQUERY_TRANSFORM_REJECTED' -exports[3974] = 'ER_DA_GRP_RPL_RECOVERY_ENDPOINT_FORMAT' -exports[3975] = 'ER_DA_GRP_RPL_RECOVERY_ENDPOINT_INVALID' -exports[3976] = 'ER_WRONG_VALUE_FOR_VAR_PLUS_ACTIONABLE_PART' -exports[3977] = 'ER_STATEMENT_NOT_ALLOWED_AFTER_START_TRANSACTION' -exports[3978] = 'ER_FOREIGN_KEY_WITH_ATOMIC_CREATE_SELECT' -exports[3979] = 'ER_NOT_ALLOWED_WITH_START_TRANSACTION' -exports[3980] = 'ER_INVALID_JSON_ATTRIBUTE' -exports[3981] = 'ER_ENGINE_ATTRIBUTE_NOT_SUPPORTED' -exports[3982] = 'ER_INVALID_USER_ATTRIBUTE_JSON' -exports[3983] = 'ER_INNODB_REDO_DISABLED' -exports[3984] = 'ER_INNODB_REDO_ARCHIVING_ENABLED' -exports[3985] = 'ER_MDL_OUT_OF_RESOURCES' -exports[3986] = 'ER_IMPLICIT_COMPARISON_FOR_JSON' -exports[3987] = 'ER_FUNCTION_DOES_NOT_SUPPORT_CHARACTER_SET' -exports[3988] = 'ER_IMPOSSIBLE_STRING_CONVERSION' -exports[3989] = 'ER_SCHEMA_READ_ONLY' -exports[3990] = 'ER_RPL_ASYNC_RECONNECT_GTID_MODE_OFF' -exports[3991] = 'ER_RPL_ASYNC_RECONNECT_AUTO_POSITION_OFF' -exports[3992] = 'ER_DISABLE_GTID_MODE_REQUIRES_ASYNC_RECONNECT_OFF' -exports[3993] = 'ER_DISABLE_AUTO_POSITION_REQUIRES_ASYNC_RECONNECT_OFF' -exports[3994] = 'ER_INVALID_PARAMETER_USE' -exports[3995] = 'ER_CHARACTER_SET_MISMATCH' -exports[3996] = 'ER_WARN_VAR_VALUE_CHANGE_NOT_SUPPORTED' -exports[3997] = 'ER_INVALID_TIME_ZONE_INTERVAL' -exports[3998] = 'ER_INVALID_CAST' -exports[3999] = 'ER_HYPERGRAPH_NOT_SUPPORTED_YET' -exports[4000] = 'ER_WARN_HYPERGRAPH_EXPERIMENTAL' -exports[4001] = 'ER_DA_NO_ERROR_LOG_PARSER_CONFIGURED' -exports[4002] = 'ER_DA_ERROR_LOG_TABLE_DISABLED' -exports[4003] = 'ER_DA_ERROR_LOG_MULTIPLE_FILTERS' -exports[4004] = 'ER_DA_CANT_OPEN_ERROR_LOG' -exports[4005] = 'ER_USER_REFERENCED_AS_DEFINER' -exports[4006] = 'ER_CANNOT_USER_REFERENCED_AS_DEFINER' -exports[4007] = 'ER_REGEX_NUMBER_TOO_BIG' -exports[4008] = 'ER_SPVAR_NONINTEGER_TYPE' -exports[4009] = 'WARN_UNSUPPORTED_ACL_TABLES_READ' -exports[4010] = 'ER_BINLOG_UNSAFE_ACL_TABLE_READ_IN_DML_DDL' -exports[4011] = 'ER_STOP_REPLICA_MONITOR_IO_THREAD_TIMEOUT' -exports[4012] = 'ER_STARTING_REPLICA_MONITOR_IO_THREAD' -exports[4013] = 'ER_CANT_USE_ANONYMOUS_TO_GTID_WITH_GTID_MODE_NOT_ON' -exports[4014] = 'ER_CANT_COMBINE_ANONYMOUS_TO_GTID_AND_AUTOPOSITION' -exports[4015] = 'ER_ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS_REQUIRES_GTID_MODE_ON' -exports[4016] = 'ER_SQL_REPLICA_SKIP_COUNTER_USED_WITH_GTID_MODE_ON' -exports[4017] = 'ER_USING_ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS_AS_LOCAL_OR_UUID' -exports[4018] = 'ER_CANT_SET_ANONYMOUS_TO_GTID_AND_WAIT_UNTIL_SQL_THD_AFTER_GTIDS' -exports[4019] = 'ER_CANT_SET_SQL_AFTER_OR_BEFORE_GTIDS_WITH_ANONYMOUS_TO_GTID' -exports[4020] = 'ER_ANONYMOUS_TO_GTID_UUID_SAME_AS_GROUP_NAME' -exports[4021] = 'ER_CANT_USE_SAME_UUID_AS_GROUP_NAME' -exports[4022] = 'ER_GRP_RPL_RECOVERY_CHANNEL_STILL_RUNNING' -exports[4023] = 'ER_INNODB_INVALID_AUTOEXTEND_SIZE_VALUE' -exports[4024] = 'ER_INNODB_INCOMPATIBLE_WITH_TABLESPACE' -exports[4025] = 'ER_INNODB_AUTOEXTEND_SIZE_OUT_OF_RANGE' -exports[4026] = 'ER_CANNOT_USE_AUTOEXTEND_SIZE_CLAUSE' -exports[4027] = 'ER_ROLE_GRANTED_TO_ITSELF' -exports[4028] = 'ER_TABLE_MUST_HAVE_A_VISIBLE_COLUMN' -exports[4029] = 'ER_INNODB_COMPRESSION_FAILURE' -exports[4030] = 'ER_WARN_ASYNC_CONN_FAILOVER_NETWORK_NAMESPACE' -exports[4031] = 'ER_CLIENT_INTERACTION_TIMEOUT' -exports[4032] = 'ER_INVALID_CAST_TO_GEOMETRY' -exports[4033] = 'ER_INVALID_CAST_POLYGON_RING_DIRECTION' -exports[4034] = 'ER_GIS_DIFFERENT_SRIDS_AGGREGATION' -exports[4035] = 'ER_RELOAD_KEYRING_FAILURE' -exports[4036] = 'ER_SDI_GET_KEYS_INVALID_TABLESPACE' -exports[4037] = 'ER_CHANGE_RPL_SRC_WRONG_COMPRESSION_ALGORITHM_SIZE' -exports[4038] = 'ER_WARN_DEPRECATED_TLS_VERSION_FOR_CHANNEL_CLI' -exports[4039] = 'ER_CANT_USE_SAME_UUID_AS_VIEW_CHANGE_UUID' -exports[4040] = 'ER_ANONYMOUS_TO_GTID_UUID_SAME_AS_VIEW_CHANGE_UUID' -exports[4041] = 'ER_GRP_RPL_VIEW_CHANGE_UUID_FAIL_GET_VARIABLE' -exports[4042] = 'ER_WARN_ADUIT_LOG_MAX_SIZE_AND_PRUNE_SECONDS' -exports[4043] = 'ER_WARN_ADUIT_LOG_MAX_SIZE_CLOSE_TO_ROTATE_ON_SIZE' -exports[4044] = 'ER_KERBEROS_CREATE_USER' -exports[4045] = 'ER_INSTALL_PLUGIN_CONFLICT_CLIENT' -exports[4046] = 'ER_DA_ERROR_LOG_COMPONENT_FLUSH_FAILED' -exports[4047] = 'ER_WARN_SQL_AFTER_MTS_GAPS_GAP_NOT_CALCULATED' -exports[4048] = 'ER_INVALID_ASSIGNMENT_TARGET' -exports[4049] = 'ER_OPERATION_NOT_ALLOWED_ON_GR_SECONDARY' -exports[4050] = 'ER_GRP_RPL_FAILOVER_CHANNEL_STATUS_PROPAGATION' -exports[4051] = 'ER_WARN_AUDIT_LOG_FORMAT_UNIX_TIMESTAMP_ONLY_WHEN_JSON' -exports[4052] = 'ER_INVALID_MFA_PLUGIN_SPECIFIED' -exports[4053] = 'ER_IDENTIFIED_BY_UNSUPPORTED' -exports[4054] = 'ER_INVALID_PLUGIN_FOR_REGISTRATION' -exports[4055] = 'ER_PLUGIN_REQUIRES_REGISTRATION' -exports[4056] = 'ER_MFA_METHOD_EXISTS' -exports[4057] = 'ER_MFA_METHOD_NOT_EXISTS' -exports[4058] = 'ER_AUTHENTICATION_POLICY_MISMATCH' -exports[4059] = 'ER_PLUGIN_REGISTRATION_DONE' -exports[4060] = 'ER_INVALID_USER_FOR_REGISTRATION' -exports[4061] = 'ER_USER_REGISTRATION_FAILED' -exports[4062] = 'ER_MFA_METHODS_INVALID_ORDER' -exports[4063] = 'ER_MFA_METHODS_IDENTICAL' -exports[4064] = 'ER_INVALID_MFA_OPERATIONS_FOR_PASSWORDLESS_USER' -exports[4065] = 'ER_CHANGE_REPLICATION_SOURCE_NO_OPTIONS_FOR_GTID_ONLY' -exports[4066] = 'ER_CHANGE_REP_SOURCE_CANT_DISABLE_REQ_ROW_FORMAT_WITH_GTID_ONLY' -exports[4067] = 'ER_CHANGE_REP_SOURCE_CANT_DISABLE_AUTO_POSITION_WITH_GTID_ONLY' -exports[4068] = 'ER_CHANGE_REP_SOURCE_CANT_DISABLE_GTID_ONLY_WITHOUT_POSITIONS' -exports[4069] = 'ER_CHANGE_REP_SOURCE_CANT_DISABLE_AUTO_POS_WITHOUT_POSITIONS' -exports[4070] = 'ER_CHANGE_REP_SOURCE_GR_CHANNEL_WITH_GTID_MODE_NOT_ON' -exports[4071] = 'ER_CANT_USE_GTID_ONLY_WITH_GTID_MODE_NOT_ON' -exports[4072] = 'ER_WARN_C_DISABLE_GTID_ONLY_WITH_SOURCE_AUTO_POS_INVALID_POS' -exports[4073] = 'ER_DA_SSL_FIPS_MODE_ERROR' -exports[4074] = 'ER_VALUE_OUT_OF_RANGE' -exports[4075] = 'ER_FULLTEXT_WITH_ROLLUP' -exports[4076] = 'ER_REGEXP_MISSING_RESOURCE' -exports[4077] = 'ER_WARN_REGEXP_USING_DEFAULT' -exports[4078] = 'ER_REGEXP_MISSING_FILE' -exports[4079] = 'ER_WARN_DEPRECATED_COLLATION' -exports[4080] = 'ER_CONCURRENT_PROCEDURE_USAGE' -exports[4081] = 'ER_DA_GLOBAL_CONN_LIMIT' -exports[4082] = 'ER_DA_CONN_LIMIT' -exports[4083] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COLUMN_TYPE_INSTANT' -exports[4084] = 'ER_WARN_SF_UDF_NAME_COLLISION' -exports[4085] = 'ER_CANNOT_PURGE_BINLOG_WITH_BACKUP_LOCK' -exports[4086] = 'ER_TOO_MANY_WINDOWS' -exports[4087] = 'ER_MYSQLBACKUP_CLIENT_MSG' -exports[4088] = 'ER_COMMENT_CONTAINS_INVALID_STRING' -exports[4089] = 'ER_DEFINITION_CONTAINS_INVALID_STRING' -exports[4090] = 'ER_CANT_EXECUTE_COMMAND_WITH_ASSIGNED_GTID_NEXT' -exports[4091] = 'ER_XA_TEMP_TABLE' -exports[4092] = 'ER_INNODB_MAX_ROW_VERSION' -exports[4093] = 'ER_INNODB_INSTANT_ADD_NOT_SUPPORTED_MAX_SIZE' -exports[4094] = 'ER_OPERATION_NOT_ALLOWED_WHILE_PRIMARY_CHANGE_IS_RUNNING' -exports[4095] = 'ER_WARN_DEPRECATED_DATETIME_DELIMITER' -exports[4096] = 'ER_WARN_DEPRECATED_SUPERFLUOUS_DELIMITER' -exports[4097] = 'ER_CANNOT_PERSIST_SENSITIVE_VARIABLES' -exports[4098] = 'ER_WARN_CANNOT_SECURELY_PERSIST_SENSITIVE_VARIABLES' -exports[4099] = 'ER_WARN_TRG_ALREADY_EXISTS' -exports[4100] = 'ER_IF_NOT_EXISTS_UNSUPPORTED_TRG_EXISTS_ON_DIFFERENT_TABLE' -exports[4101] = 'ER_IF_NOT_EXISTS_UNSUPPORTED_UDF_NATIVE_FCT_NAME_COLLISION' -exports[4102] = 'ER_SET_PASSWORD_AUTH_PLUGIN_ERROR' -exports[4103] = 'ER_REDUCED_DBLWR_FILE_CORRUPTED' -exports[4104] = 'ER_REDUCED_DBLWR_PAGE_FOUND' -exports[4105] = 'ER_SRS_INVALID_LATITUDE_OF_ORIGIN' -exports[4106] = 'ER_SRS_INVALID_LONGITUDE_OF_ORIGIN' -exports[4107] = 'ER_SRS_UNUSED_PROJ_PARAMETER_PRESENT' -exports[4108] = 'ER_GIPK_COLUMN_EXISTS' -exports[4109] = 'ER_GIPK_FAILED_AUTOINC_COLUMN_EXISTS' -exports[4110] = 'ER_GIPK_COLUMN_ALTER_NOT_ALLOWED' -exports[4111] = 'ER_DROP_PK_COLUMN_TO_DROP_GIPK' -exports[4112] = 'ER_CREATE_SELECT_WITH_GIPK_DISALLOWED_IN_SBR' -exports[4113] = 'ER_DA_EXPIRE_LOGS_DAYS_IGNORED' -exports[4114] = 'ER_CTE_RECURSIVE_NOT_UNION' -exports[4115] = 'ER_COMMAND_BACKEND_FAILED_TO_FETCH_SECURITY_CTX' -exports[4116] = 'ER_COMMAND_SERVICE_BACKEND_FAILED' -exports[4117] = 'ER_CLIENT_FILE_PRIVILEGE_FOR_REPLICATION_CHECKS' -exports[4118] = 'ER_GROUP_REPLICATION_FORCE_MEMBERS_COMMAND_FAILURE' -exports[4119] = 'ER_WARN_DEPRECATED_IDENT' -exports[4120] = 'ER_INTERSECT_ALL_MAX_DUPLICATES_EXCEEDED' -exports[4121] = 'ER_TP_QUERY_THRS_PER_GRP_EXCEEDS_TXN_THR_LIMIT' -exports[4122] = 'ER_BAD_TIMESTAMP_FORMAT' -exports[4123] = 'ER_SHAPE_PRIDICTION_UDF' -exports[4124] = 'ER_SRS_INVALID_HEIGHT' -exports[4125] = 'ER_SRS_INVALID_SCALING' -exports[4126] = 'ER_SRS_INVALID_ZONE_WIDTH' -exports[4127] = 'ER_SRS_INVALID_LATITUDE_POLAR_STERE_VAR_A' -exports[4128] = 'ER_WARN_DEPRECATED_CLIENT_NO_SCHEMA_OPTION' -exports[4129] = 'ER_TABLE_NOT_EMPTY' -exports[4130] = 'ER_TABLE_NO_PRIMARY_KEY' -exports[4131] = 'ER_TABLE_IN_SHARED_TABLESPACE' -exports[4132] = 'ER_INDEX_OTHER_THAN_PK' -exports[4133] = 'ER_LOAD_BULK_DATA_UNSORTED' -exports[4134] = 'ER_BULK_EXECUTOR_ERROR' -exports[4135] = 'ER_BULK_READER_LIBCURL_INIT_FAILED' -exports[4136] = 'ER_BULK_READER_LIBCURL_ERROR' -exports[4137] = 'ER_BULK_READER_SERVER_ERROR' -exports[4138] = 'ER_BULK_READER_COMMUNICATION_ERROR' -exports[4139] = 'ER_BULK_LOAD_DATA_FAILED' -exports[4140] = 'ER_BULK_LOADER_COLUMN_TOO_BIG_FOR_LEFTOVER_BUFFER' -exports[4141] = 'ER_BULK_LOADER_COMPONENT_ERROR' -exports[4142] = 'ER_BULK_LOADER_FILE_CONTAINS_LESS_LINES_THAN_IGNORE_CLAUSE' -exports[4143] = 'ER_BULK_PARSER_MISSING_ENCLOSED_BY' -exports[4144] = 'ER_BULK_PARSER_ROW_BUFFER_MAX_TOTAL_COLS_EXCEEDED' -exports[4145] = 'ER_BULK_PARSER_COPY_BUFFER_SIZE_EXCEEDED' -exports[4146] = 'ER_BULK_PARSER_UNEXPECTED_END_OF_INPUT' -exports[4147] = 'ER_BULK_PARSER_UNEXPECTED_ROW_TERMINATOR' -exports[4148] = 'ER_BULK_PARSER_UNEXPECTED_CHAR_AFTER_ENDING_ENCLOSED_BY' -exports[4149] = 'ER_BULK_PARSER_UNEXPECTED_CHAR_AFTER_NULL_ESCAPE' -exports[4150] = 'ER_BULK_PARSER_UNEXPECTED_CHAR_AFTER_COLUMN_TERMINATOR' -exports[4151] = 'ER_BULK_PARSER_INCOMPLETE_ESCAPE_SEQUENCE' -exports[4152] = 'ER_LOAD_BULK_DATA_FAILED' -exports[4153] = 'ER_LOAD_BULK_DATA_WRONG_VALUE_FOR_FIELD' -exports[4154] = 'ER_LOAD_BULK_DATA_WARN_NULL_TO_NOTNULL' -exports[4155] = 'ER_REQUIRE_TABLE_PRIMARY_KEY_CHECK_GENERATE_WITH_GR' -exports[4156] = 'ER_CANT_CHANGE_SYS_VAR_IN_READ_ONLY_MODE' -exports[4157] = 'ER_INNODB_INSTANT_ADD_DROP_NOT_SUPPORTED_MAX_SIZE' -exports[4158] = 'ER_INNODB_INSTANT_ADD_NOT_SUPPORTED_MAX_FIELDS' -exports[4159] = 'ER_CANT_SET_PERSISTED' -exports[4160] = 'ER_INSTALL_COMPONENT_SET_NULL_VALUE' -exports[4161] = 'ER_INSTALL_COMPONENT_SET_UNUSED_VALUE' -exports[4162] = 'ER_WARN_DEPRECATED_USER_DEFINED_COLLATIONS' diff --git a/node_modules/mysql2/lib/constants/field_flags.js b/node_modules/mysql2/lib/constants/field_flags.js deleted file mode 100644 index 184905c..0000000 --- a/node_modules/mysql2/lib/constants/field_flags.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -// Manually extracted from mysql-5.5.23/include/mysql_com.h -exports.NOT_NULL = 1; /* Field can't be NULL */ -exports.PRI_KEY = 2; /* Field is part of a primary key */ -exports.UNIQUE_KEY = 4; /* Field is part of a unique key */ -exports.MULTIPLE_KEY = 8; /* Field is part of a key */ -exports.BLOB = 16; /* Field is a blob */ -exports.UNSIGNED = 32; /* Field is unsigned */ -exports.ZEROFILL = 64; /* Field is zerofill */ -exports.BINARY = 128; /* Field is binary */ - -/* The following are only sent to new clients */ -exports.ENUM = 256; /* field is an enum */ -exports.AUTO_INCREMENT = 512; /* field is a autoincrement field */ -exports.TIMESTAMP = 1024; /* Field is a timestamp */ -exports.SET = 2048; /* field is a set */ -exports.NO_DEFAULT_VALUE = 4096; /* Field doesn't have default value */ -exports.ON_UPDATE_NOW = 8192; /* Field is set to NOW on UPDATE */ -exports.NUM = 32768; /* Field is num (for clients) */ diff --git a/node_modules/mysql2/lib/constants/session_track.js b/node_modules/mysql2/lib/constants/session_track.js deleted file mode 100644 index 85d8fbf..0000000 --- a/node_modules/mysql2/lib/constants/session_track.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -exports.SYSTEM_VARIABLES = 0; -exports.SCHEMA = 1; -exports.STATE_CHANGE = 2; -exports.STATE_GTIDS = 3; -exports.TRANSACTION_CHARACTERISTICS = 4; -exports.TRANSACTION_STATE = 5; - -exports.FIRST_KEY = exports.SYSTEM_VARIABLES; -exports.LAST_KEY = exports.TRANSACTION_STATE; diff --git a/node_modules/mysql2/lib/constants/ssl_profiles.js b/node_modules/mysql2/lib/constants/ssl_profiles.js deleted file mode 100644 index 103ef46..0000000 --- a/node_modules/mysql2/lib/constants/ssl_profiles.js +++ /dev/null @@ -1,1383 +0,0 @@ -'use strict'; - -// Certificate for Amazon RDS (Updated for 2019) -// https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html -// https://docs.amazonaws.cn/en_us/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.SSL.html -// https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless.html#aurora-serverless.tls -exports['Amazon RDS'] = { - ca: [ - '-----BEGIN CERTIFICATE-----\n' + - 'MIID9DCCAtygAwIBAgIBQjANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx\n' + - 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n' + - 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n' + - 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNTAyMDUwOTExMzFaFw0y\n' + - 'MDAzMDUwOTExMzFaMIGKMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n' + - 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n' + - 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEbMBkGA1UEAwwSQW1hem9uIFJE\n' + - 'UyBSb290IENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuD8nrZ8V\n' + - 'u+VA8yVlUipCZIKPTDcOILYpUe8Tct0YeQQr0uyl018StdBsa3CjBgvwpDRq1HgF\n' + - 'Ji2N3+39+shCNspQeE6aYU+BHXhKhIIStt3r7gl/4NqYiDDMWKHxHq0nsGDFfArf\n' + - 'AOcjZdJagOMqb3fF46flc8k2E7THTm9Sz4L7RY1WdABMuurpICLFE3oHcGdapOb9\n' + - 'T53pQR+xpHW9atkcf3pf7gbO0rlKVSIoUenBlZipUlp1VZl/OD/E+TtRhDDNdI2J\n' + - 'P/DSMM3aEsq6ZQkfbz/Ilml+Lx3tJYXUDmp+ZjzMPLk/+3beT8EhrwtcG3VPpvwp\n' + - 'BIOqsqVVTvw/CwIDAQABo2MwYTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUw\n' + - 'AwEB/zAdBgNVHQ4EFgQUTgLurD72FchM7Sz1BcGPnIQISYMwHwYDVR0jBBgwFoAU\n' + - 'TgLurD72FchM7Sz1BcGPnIQISYMwDQYJKoZIhvcNAQEFBQADggEBAHZcgIio8pAm\n' + - 'MjHD5cl6wKjXxScXKtXygWH2BoDMYBJF9yfyKO2jEFxYKbHePpnXB1R04zJSWAw5\n' + - '2EUuDI1pSBh9BA82/5PkuNlNeSTB3dXDD2PEPdzVWbSKvUB8ZdooV+2vngL0Zm4r\n' + - '47QPyd18yPHrRIbtBtHR/6CwKevLZ394zgExqhnekYKIqqEX41xsUV0Gm6x4vpjf\n' + - '2u6O/+YE2U+qyyxHE5Wd5oqde0oo9UUpFETJPVb6Q2cEeQib8PBAyi0i6KnF+kIV\n' + - 'A9dY7IHSubtCK/i8wxMVqfd5GtbA8mmpeJFwnDvm9rBEsHybl08qlax9syEwsUYr\n' + - '/40NawZfTUU=\n' + - '-----END CERTIFICATE-----\n', - '-----BEGIN CERTIFICATE-----\n' + - 'MIIEATCCAumgAwIBAgIBRDANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx\n' + - 'EzARBgNVBAgMCldhc2hpb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e25iGjj5n8r+M3dlye8ORfCE/dijHtxqAKasXHgKX8I9Tw\n' + - 'JkBiGWiuzqn7gO5MJ0nMMro1+gq29qjZnYX1pDHPgsRjUX8R+juRhgJ3JSHijRbf\n' + - '4qNJrnwga7pj94MhcLq9u0f6dxH6dXbyMv21T4TZMTmcFduf1KgaiVx1PEyJjC6r\n' + - 'M+Ru+A0eM+jJ7uCjUoZKcpX8xkj4nmSnz9NMPog3wdOSB9cAW7XIc5mHa656wr7I\n' + - 'WJxVcYNHTXIjCcng2zMKd1aCcl2KSFfy56sRfT7J5Wp69QSr+jq8KM55gw8uqAwi\n' + - 'VPrXn2899T1rcTtFYFP16WXjGuc0\n' + - '-----END CERTIFICATE-----\n', - '-----BEGIN CERTIFICATE-----\n' + - 'MIIEATCCAumgAwIBAgIBRTANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx\n' + - 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n' + - 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n' + - 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNTAyMDUyMjAzMTlaFw0y\n' + - 'MDAzMDUyMjAzMTlaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n' + - 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n' + - 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzElMCMGA1UEAwwcQW1hem9uIFJE\n' + - 'UyBhcC1zb3V0aGVhc3QtMSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC\n' + - 'ggEBANaXElmSEYt/UtxHFsARFhSUahTf1KNJzR0Dmay6hqOXQuRVbKRwPd19u5vx\n' + - 'DdF1sLT7D69IK3VDnUiQSc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0//IhYEAIiIDjyFVgjbTkKV3sh4RbdldKVOUB9kumz/\n' + - 'ZpShplsGt3z4QQiVnKfrAgqxWDjR0I0pQKkxXa6Sjkicos9LQxVtJ0XA4ieG1E7z\n' + - 'zJr+6t80wmzxvkInSaWP3xNJK9azVRTrgQZQlvkbpDbExl4mNTG66VD3bAp6t3Wa\n' + - 'B49//uDdfZmPkqqbX+hsxp160OH0rxJppwO3Bh869PkDnaPEd/Pxw7PawC+li0gi\n' + - 'NRV8iCEx85aFxcyOhqn0WZOasxee\n' + - '-----END CERTIFICATE-----\n', - '-----BEGIN CERTIFICATE-----\n' + - 'MIID/zCCAuegAwIBAgIBRzANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx\n' + - 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n' + - 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n' + - 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNTAyMDUyMjAzMzFaFw0y\n' + - 'MDAzMDUyMjAzMzFaMIGSMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n' + - 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n' + - 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEjMCEGA1UEAwwaQW1hem9uIFJE\n' + - 'UyBldS1jZW50cmFsLTEgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB\n' + - 'AQDFtP2dhSLuaPOI4ZrrPWsK4OY9ocQBp3yApH1KJYmI9wpQKZG/KCH2E6Oo7JAw\n' + - 'QORU519r033T+FO2Z7pFPlmz1yrxGXyHpJs8ySx3Yo5S8ncDCdZJCLmtPiq/hahg\n' + - '5/0ffexMFUCQaYicFZsrJ/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H0DgQkbWMBfCRgolLLitAZklZ4dvdlEBS7evN1/7ttBxUK6SvkeeSx3zBl\n' + - 'ww3BlXqc3bvTQL0A+RRysaVyFbvtp9domFaDKZCpMmDFAN/ntx215xmQdrSt+K3F\n' + - 'cXdGQYHx5q410CAclGnbAgMBAAGjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMB\n' + - 'Af8ECDAGAQH/AgEAMB0GA1UdDgQWBBT6iVWnm/uakS+tEX2mzIfw+8JL0zAfBgNV\n' + - 'HSMEGDAWgBROAu6sPvYVyEztLPUFwY+chAhJgzANBgkqhkiG9w0BAQUFAAOCAQEA\n' + - 'FmDD+QuDklXn2EgShwQxV13+txPRuVdOSrutHhoCgMwFWCMtPPtBAKs6KPY7Guvw\n' + - 'DpJoZSehDiOfsgMirjOWjvfkeWSNvKfjWTVneX7pZD9W5WPnsDBvTbCGezm+v87z\n' + - 'b+ZM2ZMo98m/wkMcIEAgdSKilR2fuw8rLkAjhYFfs0A7tDgZ9noKwgHvoE4dsrI0\n' + - 'KZYco6DlP/brASfHTPa2puBLN9McK3v+h0JaSqqm5Ro2Bh56tZkQh8AWy/miuDuK\n' + - '3+hNEVdxosxlkM1TPa1DGj0EzzK0yoeerXuH2HX7LlCrrxf6/wdKnjR12PMrLQ4A\n' + - 'pCqkcWw894z6bV9MAvKe6A==\n' + - '-----END CERTIFICATE-----\n', - '-----BEGIN CERTIFICATE-----\n' + - 'MIID/DCCAuSgAwIBAgIBQzANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx\n' + - 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n' + - 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n' + - 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNTAyMDUyMTU0MDRaFw0y\n' + - 'MDAzMDUyMTU0MD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qOznZTqTzSFVXFECAwEAAaNmMGQwDgYDVR0PAQH/BAQDAgEGMBIG\n' + - 'A1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFM6Nox/QWbhzWVvzoJ/y0kGpNPK+\n' + - 'MB8GA1UdIwQYMBaAFE4C7qw+9hXITO0s9QXBj5yECEmDMA0GCSqGSIb3DQEBBQUA\n' + - 'A4IBAQCTkWBqNvyRf3Y/W21DwFx3oT/AIWrHt0BdGZO34tavummXemTH9LZ/mqv9\n' + - 'aljt6ZuDtf5DEQjdsAwXMsyo03ffnP7doWm8iaF1+Mui77ot0TmTsP/deyGwukvJ\n' + - 'tkxX8bZjDh+EaNauWKr+CYnniNxCQLfFtXYJsfOdVBzK3xNL+Z3ucOQRhr2helWc\n' + - 'CDQgwfhP1+3pRVKqHvWCPC4R3fT7RZHuRmZ38kndv476GxRntejh+ePffif78bFI\n' + - '3rIZCPBGobrrUMycafSbyXteoGca/kA+/IqrAPlk0pWQ4aEL0yTWN2h2dnjoD7oX\n' + - 'byIuL/g9AGRh97+ssn7D6bDRPTbW\n' + - '-----END CERTIFICATE-----\n', - '-----BEGIN CERTIFICATE-----\n' + - 'MIID/TCCAuWgAwIBAgIBTTANBgkqhkiG9w0BAQsFADCBijELMAkGA1UEBhMCVVMx\n' + - 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n' + - 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n' + - 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNjA1MDMyMTI5MjJaFw0y\n' + - 'MDAzMDUyMTI5MjJaMIGQMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n' + - 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n' + - 'cywgSW5jLjET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0=\n' + - '-----END CERTIFICATE-----\n', - '-----BEGIN CERTIFICATE-----\n' + - 'MIID/DCCAuSgAwIBAgIBTjANBgkqhkiG9w0BAQsFADCBijELMAkGA1UEBhMCVVMx\n' + - 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n' + - 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n' + - 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNjA4MTExOTU4NDVaFw0y\n' + - 'MDAzMDUxOTU4NDVaMIGPMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n' + - 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n' + - 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEgMB4GA1UEAwwXQW1hem9uIFJE\n' + - 'UyB1cy1lYXN0LTIgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCp\n' + - 'WnnUX7wM0zzstccX+4iXKJa9GR0a2PpvB1paEX4QRCgfhEdQWDaSqyrWNgdVCKkt\n' + - '1aQkWu5j6VAC2XIG7kKoonm1ZdBVyBLqW5lXNywlaiU9yhJkwo8BR+/OqgE+PLt/\n' + - 'EO1mlN0PQudja/XkExCXTO29TG2j7F/O7hox6vTyHNHc0H88zS21uPuBE+jivViS\n' + - 'yzj/BkyoQ85hnkues3f9R6gCGdc+J51JbZnmgzUkvXjAEuKhAm9JksVOxcOKUYe5\n' + - 'ERhn0U9zjzpfbAITIkul97VVa5IxskFFTHIPJbvRKHJkiF6wTJww/tc9wm+fSCJ1\n' + - '+DbQTGZgkQ3bJrqRN29/AgMBAAGjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMB\n' + - 'Af8ECDAGAQH/AgEAMB0GA1UdDg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+ - 'QDh7JEHI9tqEEVOA5OvRrDRcyeEYBoTDgh76ROco2lR+/9uCvGtHVrMCtG7BP7ZB\n' + - 'sSVNAr1IIRZZqKLv2skKT/7mzZR2ivcw9UeBBTUf8xsfiYVBvMGoEsXEycjYdf6w\n' + - 'WV+7XS7teNOc9UgsFNN+9AhIBc1jvee5E//72/4F8pAttAg/+mmPUyIKtekNJ4gj\n' + - 'OAR2VAzGx1ybzWPwIgOudZFHXFduxvq4f1hIRPH0KbQ/gkRrAgMBAAGjZjBkMA4G\n' + - 'A1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEAMB0GA1UdDgQWBBTkvpCD\n' + - '6C43rar9TtJoXr7q8dkrrjAfBgNVHSMEGDAWgBStoQwVpbGx87fxB3dEGDqKKnBT\n' + - '4TANBgkqhkiG9w0BAQsFAAOCAQEAJd9fOSkwB3uVdsS+puj6gCER8jqmhd3g/J5V\n' + - 'Zjk9cKS8H0e8pq/tMxeJ8kpurPAzUk5RkCspGt2l0BSwmf3ahr8aJRviMX6AuW3/\n' + - 'g8aKplTvq/WMNGKLXONa3Sq8591J+ce8gtOX/1rDKmFI4wQ/gUzOSYiT991m7QKS\n' + - 'Fr6HMgFuz7RNJbb3Fy5cnurh8eYWA7mMv7laiLwTNsaro5qsqErD5uXuot6o9beT\n' + - 'a+GiKinEur35tNxAr47ax4IRubuIzyfCrezjfKc5raVV2NURJDyKP0m0CCaffAxE\n' + - 'qn2dNfYc3v1D8ypg3XjHlOzRo32RB04o8ALHMD9LSwsYDLpMag==\n' + - '-----END CERTIFICATE-----\n', - '-----BEGIN CERTIFICATE-----\n' + - 'MIIEEDCCAvigAwIBAgIJAKFMXyltvuRdMA0GCSqGSIb3DQEBCwUAMIGUMQswCQYD\n' + - 'VQQGEwJVUzEQMA4GA1UEBwwHU2VhdHRsZTETMBEGA1UECAwKV2FzaGluZ3RvbjEi\n' + - 'MCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNlcywgSW5jL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74Z+jDH\n' + - '-----END CERTIFICATE-----\n', - '-----BEGIN CERTIFICATE-----\n' + - 'MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsF\n' + - 'ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6\n' + - 'b24gUm9vdCBDQSAxMB4XDTE1MDUyNjAwMDAwMFoXDTM4MDExNzAwMDAwMFowOTEL\n' + - 'MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJv\n' + - 'b3QgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJ4gHHKeNXj\n' + - 'ca9HgFB0fW7Y14h29Jlo91ghYPl0hAEvrAIthtOgQ3pOsqTQNroBvo3bSMgHFzZM\n' + - '9O6II8c+6zf1tRn4SWiw3te5djgdYZ6k/oI2peVKVuRF4fn9tBb6dNqcmzU5L/qw\n' + - 'IFAGbHrQgLKm+a/sRxmPUDgH3KKHOVj4utWp+UhnMJbulHheb4mjUcAwhmahRWa6\n' + - 'VOujw5H5SNz/0egwLX0tdHA114gk957EWW67c4cX8jJGKLhD+rcdqsq08p8kDi1L\n' + - '93FcXmn/6pUCyziKrlA4b9v7LWIbxcceVOF34GfID5yHI9Y/QCB/IIDEgEw+OyQm\n' + - 'jgSubJrIqg0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC\n' + - 'AYYwHQYDVR0OBBYEFIQYzIU07LwMlJQuCFmcx7IQTgoIMA0GCSqGSIb3DQEBCwUA\n' + - 'A4IBAQCY8jdaQZChGsV2USggNiMOruYou6r4lK5IpDB/G/wkjUu0yKGX9rbxenDI\n' + - 'U5PMCCjjmCXPI6T53iHTfIUJrU6adTrCC2qJeHZERxhlbI1Bjjt/msv0tadQ1wUs\n' + - 'N+gDS63pYaACbvXy8MWy7Vu33PqU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fM3cU\n' + - 'yFI9KFITDF4feeon2P49qXx8YX8KUEYzNbkNQhPSt1J91kvy0ddHLrxxNd+LoQFi\n' + - 'A5vu7a51VmX1MtKYs7SzEIUdrON3FKK/2cci2yCnwzoc3kam3jXvPUu56op+aH35\n' + - '0JHEco0i+NUjh7n5UV/yWc1+8kPLBQr+VMV3ndp85ik209esvCRWgQ+iWuADqHbf\n' + - 'vjrFm/zjFIiwuX5qapkDtSRVwM6FwIfjSEF6udhZjsermfD2AoTesptZEiNIPRzV\n' + - 'et6s/U5gMjvAhc+MQgjjdCLBlhbXWR1CPtXOMp6o8Pjn2Et3eiM6G1T0jUO28BGP\n' + - '3/iq3JOXFj8CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUEoBo\n' + - 'nXIxui+T8RXYqgzikVat82EwDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEBCwUA\n' + - 'A4IBAQAk4XdDesWKYgE35KMqg2+tCY/gbBrKVMdvZzy2kAv9QH8bwCcojeMw4wGh\n' + - 'u0mjfX0vawoot2bNY6Yu0+mVxBtkelhay7enN+mA5g5DfkyKkLb6Jg/9N7m95w4N\n' + - 'ICQwM3Yb9OsuquxBPPE7JkrZv10AzVz2Xqu/OHDyDpfnkcCfNusHyIAycjxq/ZEF\n' + - '7LOSBv3S20sJU72EKfrNGSfMDv9qvnusum/vTYKuSNCTR0vARxbB7LLVZZ/Pg2w8\n' + - '22RQK9zr+u5WkfTGMqF4NnbuJGphU21QHUIZYY8QAnte0hbK+AbTUyeKGHxqRDun\n' + - 'BQn6/GvgP2tPDKj/Huauo/CVSd+M\n' + - '-----END CERTIFICATE-----\n', - '-----BEGIN CERTIFICATE-----\n' + - 'MIICrzCCAjWgAwIBAgIQTEq2iHmd2QzeVBzmBUbAUTAKBggqhkjOPQQDAzCBlzEL\n' + - 'MAkGA1UEBhMCVVMxIjAgBgNVBAoMGUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4x\n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PEZ0PPv3Z\n' + - '/euD2wUPkXnf27FC1XJE0pJX96B97ZXIEHl4S4obBRSlybzuvmfH4gyu+b+7Tebv\n' + - 'VmfsAodyfYCm90heAYADWkc/XKDj+oe3NkbR+LokrM+5aOB71f5mMLnFgYHQW/dI\n' + - 'IRDziUSpP0LMr+YNKvM7qytrobPS2TOWtweWpXesNBBeiLTHZpTEu8DYcE+4e2tj\n' + - 'O0spF3HuoF0Oc7ioVy2exE+HV1oJOquHGSanZSdMHCAEDMfKUmlT7/zcwC877UT/\n' + - 'sysqYU/fl6vX48QDfalZuBYj+d1dUxIb1sx6q4Iw4+s=\n' + - '-----END CERTIFICATE-----\n', - '-----BEGIN CERTIFICATE-----\n' + - 'MIIEEDCCAvigAwIBAgIDAJJhMA0GCSqGSIb3DQEBCwUAMIGSMQswCQYDVQQGEwJV\n' + - 'UzEQMA4GA1UEBwwHU2VhdHRsZTETMBEGA1UECAwKV2FzaGluZ3RvbjEiMCAGA1UE\n' + - 'CgwZQW1hem9uIFdlYiBTZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJE\n' + - 'UzEjMCEGA1UEAwwaQW1hem9uIFJEUyBDTiBSb290IDIwMTkgQ0EwHhcNMTkwOTE3\n' + - 'MTY0OTE3WhcNMjQwOTA5MTY1NzIyWjCBmTELMAkGA1UEBhMCVVMxEzARBgNVBAgM\n' + - 'Cldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoMGUFtYXpvbiBX\n' + - 'ZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMxKjAoBgNVBAMM\n' + - 'IUFtYXpvbiBSRFMgY24tbm9ydGh3ZXN0LTEgMjAxOSBDQTCCASIwDQYJKoZIhvcN\n' + - 'AQEBBQADggEPADCCAQoCggEBAMr4bvXQVykL0RHtBALyP7FycubzLJM178wMw5vK\n' + - 'QS/1IVlQlbdZ8bNYmSMqa2IlGoWdjvLonES0jD0T8LC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J+8Vb9FwC5vIWSYun8u3Rh\n' + - 'tOoQ3GAy\n' + - '-----END CERTIFICATE-----\n' - ] -}; diff --git a/node_modules/mysql2/lib/constants/types.js b/node_modules/mysql2/lib/constants/types.js deleted file mode 100644 index aa975e2..0000000 --- a/node_modules/mysql2/lib/constants/types.js +++ /dev/null @@ -1,64 +0,0 @@ -'use strict'; - -module.exports = { - 0x00: 'DECIMAL', // aka DECIMAL - 0x01: 'TINY', // aka TINYINT, 1 byte - 0x02: 'SHORT', // aka SMALLINT, 2 bytes - 0x03: 'LONG', // aka INT, 4 bytes - 0x04: 'FLOAT', // aka FLOAT, 4-8 bytes - 0x05: 'DOUBLE', // aka DOUBLE, 8 bytes - 0x06: 'NULL', // NULL (used for prepared statements, I think) - 0x07: 'TIMESTAMP', // aka TIMESTAMP - 0x08: 'LONGLONG', // aka BIGINT, 8 bytes - 0x09: 'INT24', // aka MEDIUMINT, 3 bytes - 0x0a: 'DATE', // aka DATE - 0x0b: 'TIME', // aka TIME - 0x0c: 'DATETIME', // aka DATETIME - 0x0d: 'YEAR', // aka YEAR, 1 byte (don't ask) - 0x0e: 'NEWDATE', // aka ? - 0x0f: 'VARCHAR', // aka VARCHAR (?) - 0x10: 'BIT', // aka BIT, 1-8 byte - 0xf5: 'JSON', - 0xf6: 'NEWDECIMAL', // aka DECIMAL - 0xf7: 'ENUM', // aka ENUM - 0xf8: 'SET', // aka SET - 0xf9: 'TINY_BLOB', // aka TINYBLOB, TINYTEXT - 0xfa: 'MEDIUM_BLOB', // aka MEDIUMBLOB, MEDIUMTEXT - 0xfb: 'LONG_BLOB', // aka LONGBLOG, LONGTEXT - 0xfc: 'BLOB', // aka BLOB, TEXT - 0xfd: 'VAR_STRING', // aka VARCHAR, VARBINARY - 0xfe: 'STRING', // aka CHAR, BINARY - 0xff: 'GEOMETRY' // aka GEOMETRY -}; - - -// Manually extracted from mysql-5.5.23/include/mysql_com.h -// some more info here: http://dev.mysql.com/doc/refman/5.5/en/c-api-prepared-statement-type-codes.html -module.exports.DECIMAL = 0x00; // aka DECIMAL (http://dev.mysql.com/doc/refman/5.0/en/precision-math-decimal-changes.html) -module.exports.TINY = 0x01; // aka TINYINT, 1 byte -module.exports.SHORT = 0x02; // aka SMALLINT, 2 bytes -module.exports.LONG = 0x03; // aka INT, 4 bytes -module.exports.FLOAT = 0x04; // aka FLOAT, 4-8 bytes -module.exports.DOUBLE = 0x05; // aka DOUBLE, 8 bytes -module.exports.NULL = 0x06; // NULL (used for prepared statements, I think) -module.exports.TIMESTAMP = 0x07; // aka TIMESTAMP -module.exports.LONGLONG = 0x08; // aka BIGINT, 8 bytes -module.exports.INT24 = 0x09; // aka MEDIUMINT, 3 bytes -module.exports.DATE = 0x0a; // aka DATE -module.exports.TIME = 0x0b; // aka TIME -module.exports.DATETIME = 0x0c; // aka DATETIME -module.exports.YEAR = 0x0d; // aka YEAR, 1 byte (don't ask) -module.exports.NEWDATE = 0x0e; // aka ? -module.exports.VARCHAR = 0x0f; // aka VARCHAR (?) -module.exports.BIT = 0x10; // aka BIT, 1-8 byte -module.exports.JSON = 0xf5; -module.exports.NEWDECIMAL = 0xf6; // aka DECIMAL -module.exports.ENUM = 0xf7; // aka ENUM -module.exports.SET = 0xf8; // aka SET -module.exports.TINY_BLOB = 0xf9; // aka TINYBLOB, TINYTEXT -module.exports.MEDIUM_BLOB = 0xfa; // aka MEDIUMBLOB, MEDIUMTEXT -module.exports.LONG_BLOB = 0xfb; // aka LONGBLOG, LONGTEXT -module.exports.BLOB = 0xfc; // aka BLOB, TEXT -module.exports.VAR_STRING = 0xfd; // aka VARCHAR, VARBINARY -module.exports.STRING = 0xfe; // aka CHAR, BINARY -module.exports.GEOMETRY = 0xff; // aka GEOMETRY diff --git a/node_modules/mysql2/lib/helpers.js b/node_modules/mysql2/lib/helpers.js deleted file mode 100644 index 2a8f803..0000000 --- a/node_modules/mysql2/lib/helpers.js +++ /dev/null @@ -1,65 +0,0 @@ -'use strict'; - -/* - - this seems to be not only shorter, but faster than - string.replace(/\\/g, '\\\\'). - replace(/\u0008/g, '\\b'). - replace(/\t/g, '\\t'). - replace(/\n/g, '\\n'). - replace(/\f/g, '\\f'). - replace(/\r/g, '\\r'). - replace(/'/g, '\\\''). - replace(/"/g, '\\"'); - or string.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&") - see http://jsperf.com/string-escape-regexp-vs-json-stringify - */ -function srcEscape(str) { - return JSON.stringify({ - [str]: 1 - }).slice(1, -3); -} - -exports.srcEscape = srcEscape; - -let highlightFn; -let cardinalRecommended = false; -try { - // the purpose of this is to prevent projects using Webpack from displaying a warning during runtime if cardinal is not a dependency - const REQUIRE_TERMINATOR = ''; - highlightFn = require(`cardinal${REQUIRE_TERMINATOR}`).highlight; -} catch (err) { - highlightFn = text => { - if (!cardinalRecommended) { - // eslint-disable-next-line no-console - console.log('For nicer debug output consider install cardinal@^2.0.0'); - cardinalRecommended = true; - } - return text; - }; -} - -/** - * Prints debug message with code frame, will try to use `cardinal` if available. - */ -function printDebugWithCode(msg, code) { - // eslint-disable-next-line no-console - console.log(`\n\n${msg}:\n`); - // eslint-disable-next-line no-console - console.log(`${highlightFn(code)}\n`); -} - -exports.printDebugWithCode = printDebugWithCode; - -/** - * checks whether the `type` is in the `list` - */ -function typeMatch(type, list, Types) { - if (Array.isArray(list)) { - return list.some(t => type === Types[t]); - } - - return !!list; -} - -exports.typeMatch = typeMatch; diff --git a/node_modules/mysql2/lib/packet_parser.js b/node_modules/mysql2/lib/packet_parser.js deleted file mode 100644 index 1899e56..0000000 --- a/node_modules/mysql2/lib/packet_parser.js +++ /dev/null @@ -1,195 +0,0 @@ -'use strict'; - -const Packet = require('./packets/packet.js'); - -const MAX_PACKET_LENGTH = 16777215; - -function readPacketLength(b, off) { - const b0 = b[off]; - const b1 = b[off + 1]; - const b2 = b[off + 2]; - if (b1 + b2 === 0) { - return b0; - } - return b0 + (b1 << 8) + (b2 << 16); -} - -class PacketParser { - constructor(onPacket, packetHeaderLength) { - // 4 for normal packets, 7 for comprssed protocol packets - if (typeof packetHeaderLength === 'undefined') { - packetHeaderLength = 4; - } - // array of last payload chunks - // only used when current payload is not complete - this.buffer = []; - // total length of chunks on buffer - this.bufferLength = 0; - this.packetHeaderLength = packetHeaderLength; - // incomplete header state: number of header bytes received - this.headerLen = 0; - // expected payload length - this.length = 0; - this.largePacketParts = []; - this.firstPacketSequenceId = 0; - this.onPacket = onPacket; - this.execute = PacketParser.prototype.executeStart; - this._flushLargePacket = - packetHeaderLength === 7 - ? this._flushLargePacket7 - : this._flushLargePacket4; - } - - _flushLargePacket4() { - const numPackets = this.largePacketParts.length; - this.largePacketParts.unshift(Buffer.from([0, 0, 0, 0])); // insert header - const body = Buffer.concat(this.largePacketParts); - const packet = new Packet(this.firstPacketSequenceId, body, 0, body.length); - this.largePacketParts.length = 0; - packet.numPackets = numPackets; - this.onPacket(packet); - } - - _flushLargePacket7() { - const numPackets = this.largePacketParts.length; - this.largePacketParts.unshift(Buffer.from([0, 0, 0, 0, 0, 0, 0])); // insert header - const body = Buffer.concat(this.largePacketParts); - this.largePacketParts.length = 0; - const packet = new Packet(this.firstPacketSequenceId, body, 0, body.length); - packet.numPackets = numPackets; - this.onPacket(packet); - } - - executeStart(chunk) { - let start = 0; - const end = chunk.length; - while (end - start >= 3) { - this.length = readPacketLength(chunk, start); - if (end - start >= this.length + this.packetHeaderLength) { - // at least one full packet - const sequenceId = chunk[start + 3]; - if ( - this.length < MAX_PACKET_LENGTH && - this.largePacketParts.length === 0 - ) { - this.onPacket( - new Packet( - sequenceId, - chunk, - start, - start + this.packetHeaderLength + this.length - ) - ); - } else { - // first large packet - remember it's id - if (this.largePacketParts.length === 0) { - this.firstPacketSequenceId = sequenceId; - } - this.largePacketParts.push( - chunk.slice( - start + this.packetHeaderLength, - start + this.packetHeaderLength + this.length - ) - ); - if (this.length < MAX_PACKET_LENGTH) { - this._flushLargePacket(); - } - } - start += this.packetHeaderLength + this.length; - } else { - // payload is incomplete - this.buffer = [chunk.slice(start + 3, end)]; - this.bufferLength = end - start - 3; - this.execute = PacketParser.prototype.executePayload; - return; - } - } - if (end - start > 0) { - // there is start of length header, but it's not full 3 bytes - this.headerLen = end - start; // 1 or 2 bytes - this.length = chunk[start]; - if (this.headerLen === 2) { - this.length = chunk[start] + (chunk[start + 1] << 8); - this.execute = PacketParser.prototype.executeHeader3; - } else { - this.execute = PacketParser.prototype.executeHeader2; - } - } - } - - executePayload(chunk) { - let start = 0; - const end = chunk.length; - const remainingPayload = - this.length - this.bufferLength + this.packetHeaderLength - 3; - if (end - start >= remainingPayload) { - // last chunk for payload - const payload = Buffer.allocUnsafe(this.length + this.packetHeaderLength); - let offset = 3; - for (let i = 0; i < this.buffer.length; ++i) { - this.buffer[i].copy(payload, offset); - offset += this.buffer[i].length; - } - chunk.copy(payload, offset, start, start + remainingPayload); - const sequenceId = payload[3]; - if ( - this.length < MAX_PACKET_LENGTH && - this.largePacketParts.length === 0 - ) { - this.onPacket( - new Packet( - sequenceId, - payload, - 0, - this.length + this.packetHeaderLength - ) - ); - } else { - // first large packet - remember it's id - if (this.largePacketParts.length === 0) { - this.firstPacketSequenceId = sequenceId; - } - this.largePacketParts.push( - payload.slice( - this.packetHeaderLength, - this.packetHeaderLength + this.length - ) - ); - if (this.length < MAX_PACKET_LENGTH) { - this._flushLargePacket(); - } - } - this.buffer = []; - this.bufferLength = 0; - this.execute = PacketParser.prototype.executeStart; - start += remainingPayload; - if (end - start > 0) { - return this.execute(chunk.slice(start, end)); - } - } else { - this.buffer.push(chunk); - this.bufferLength += chunk.length; - } - return null; - } - - executeHeader2(chunk) { - this.length += chunk[0] << 8; - if (chunk.length > 1) { - this.length += chunk[1] << 16; - this.execute = PacketParser.prototype.executePayload; - return this.executePayload(chunk.slice(2)); - } - this.execute = PacketParser.prototype.executeHeader3; - - return null; - } - - executeHeader3(chunk) { - this.length += chunk[0] << 16; - this.execute = PacketParser.prototype.executePayload; - return this.executePayload(chunk.slice(1)); - } -} - -module.exports = PacketParser; diff --git a/node_modules/mysql2/lib/packets/auth_next_factor.js b/node_modules/mysql2/lib/packets/auth_next_factor.js deleted file mode 100644 index fd644a6..0000000 --- a/node_modules/mysql2/lib/packets/auth_next_factor.js +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) 2021, Oracle and/or its affiliates. - -'use strict'; - -const Packet = require('../packets/packet'); - -class AuthNextFactor { - constructor(opts) { - this.pluginName = opts.pluginName; - this.pluginData = opts.pluginData; - } - - toPacket(encoding) { - const length = 6 + this.pluginName.length + this.pluginData.length; - const buffer = Buffer.allocUnsafe(length); - const packet = new Packet(0, buffer, 0, length); - packet.offset = 4; - packet.writeInt8(0x02); - packet.writeNullTerminatedString(this.pluginName, encoding); - packet.writeBuffer(this.pluginData); - return packet; - } - - static fromPacket(packet, encoding) { - packet.readInt8(); // marker - const name = packet.readNullTerminatedString(encoding); - const data = packet.readBuffer(); - return new AuthNextFactor({ - pluginName: name, - pluginData: data - }); - } -} - -module.exports = AuthNextFactor; diff --git a/node_modules/mysql2/lib/packets/auth_switch_request.js b/node_modules/mysql2/lib/packets/auth_switch_request.js deleted file mode 100644 index a05abf2..0000000 --- a/node_modules/mysql2/lib/packets/auth_switch_request.js +++ /dev/null @@ -1,38 +0,0 @@ -'use strict'; - -// http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::AuthSwitchRequest - -const Packet = require('../packets/packet'); - -class AuthSwitchRequest { - constructor(opts) { - this.pluginName = opts.pluginName; - this.pluginData = opts.pluginData; - } - - toPacket() { - const length = 6 + this.pluginName.length + this.pluginData.length; - const buffer = Buffer.allocUnsafe(length); - const packet = new Packet(0, buffer, 0, length); - packet.offset = 4; - packet.writeInt8(0xfe); - // TODO: use server encoding - packet.writeNullTerminatedString(this.pluginName, 'cesu8'); - packet.writeBuffer(this.pluginData); - return packet; - } - - static fromPacket(packet) { - packet.readInt8(); // marker - // assert marker == 0xfe? - // TODO: use server encoding - const name = packet.readNullTerminatedString('cesu8'); - const data = packet.readBuffer(); - return new AuthSwitchRequest({ - pluginName: name, - pluginData: data - }); - } -} - -module.exports = AuthSwitchRequest; diff --git a/node_modules/mysql2/lib/packets/auth_switch_request_more_data.js b/node_modules/mysql2/lib/packets/auth_switch_request_more_data.js deleted file mode 100644 index 7294d08..0000000 --- a/node_modules/mysql2/lib/packets/auth_switch_request_more_data.js +++ /dev/null @@ -1,33 +0,0 @@ -'use strict'; - -// http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::AuthSwitchRequest - -const Packet = require('../packets/packet'); - -class AuthSwitchRequestMoreData { - constructor(data) { - this.data = data; - } - - toPacket() { - const length = 5 + this.data.length; - const buffer = Buffer.allocUnsafe(length); - const packet = new Packet(0, buffer, 0, length); - packet.offset = 4; - packet.writeInt8(0x01); - packet.writeBuffer(this.data); - return packet; - } - - static fromPacket(packet) { - packet.readInt8(); // marker - const data = packet.readBuffer(); - return new AuthSwitchRequestMoreData(data); - } - - static verifyMarker(packet) { - return packet.peekByte() === 0x01; - } -} - -module.exports = AuthSwitchRequestMoreData; diff --git a/node_modules/mysql2/lib/packets/auth_switch_response.js b/node_modules/mysql2/lib/packets/auth_switch_response.js deleted file mode 100644 index 2a821a0..0000000 --- a/node_modules/mysql2/lib/packets/auth_switch_response.js +++ /dev/null @@ -1,30 +0,0 @@ -'use strict'; - -// http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::AuthSwitchRequest - -const Packet = require('../packets/packet'); - -class AuthSwitchResponse { - constructor(data) { - if (!Buffer.isBuffer(data)) { - data = Buffer.from(data); - } - this.data = data; - } - - toPacket() { - const length = 4 + this.data.length; - const buffer = Buffer.allocUnsafe(length); - const packet = new Packet(0, buffer, 0, length); - packet.offset = 4; - packet.writeBuffer(this.data); - return packet; - } - - static fromPacket(packet) { - const data = packet.readBuffer(); - return new AuthSwitchResponse(data); - } -} - -module.exports = AuthSwitchResponse; diff --git a/node_modules/mysql2/lib/packets/binary_row.js b/node_modules/mysql2/lib/packets/binary_row.js deleted file mode 100644 index e9d1343..0000000 --- a/node_modules/mysql2/lib/packets/binary_row.js +++ /dev/null @@ -1,95 +0,0 @@ -'use strict'; - -const Types = require('../constants/types'); -const Packet = require('../packets/packet'); - -const binaryReader = new Array(256); - -class BinaryRow { - constructor(columns) { - this.columns = columns || []; - } - - static toPacket(columns, encoding) { - // throw new Error('Not implemented'); - const sequenceId = 0; // TODO remove, this is calculated now in connecton - let length = 0; - columns.forEach(val => { - if (val === null || typeof val === 'undefined') { - ++length; - return; - } - length += Packet.lengthCodedStringLength(val.toString(10), encoding); - }); - - length = length + 2; - - const buffer = Buffer.allocUnsafe(length + 4); - const packet = new Packet(sequenceId, buffer, 0, length + 4); - packet.offset = 4; - - packet.writeInt8(0); - - let bitmap = 0; - let bitValue = 1; - columns.forEach(parameter => { - if (parameter.type === Types.NULL) { - bitmap += bitValue; - } - bitValue *= 2; - if (bitValue === 256) { - packet.writeInt8(bitmap); - bitmap = 0; - bitValue = 1; - } - }); - if (bitValue !== 1) { - packet.writeInt8(bitmap); - } - - columns.forEach(val => { - if (val === null) { - packet.writeNull(); - return; - } - if (typeof val === 'undefined') { - packet.writeInt8(0); - return; - } - packet.writeLengthCodedString(val.toString(10), encoding); - }); - return packet; - } - - // TODO: complete list of types... - static fromPacket(fields, packet) { - const columns = new Array(fields.length); - packet.readInt8(); // TODO check it's 0 - const nullBitmapLength = Math.floor((fields.length + 7 + 2) / 8); - // TODO: read and interpret null bitmap - packet.skip(nullBitmapLength); - for (let i = 0; i < columns.length; ++i) { - columns[i] = binaryReader[fields[i].columnType].apply(packet); - } - return new BinaryRow(columns); - } -} - -// TODO: replace with constants.MYSQL_TYPE_* -binaryReader[Types.DECIMAL] = Packet.prototype.readLengthCodedString; -binaryReader[1] = Packet.prototype.readInt8; // tiny -binaryReader[2] = Packet.prototype.readInt16; // short -binaryReader[3] = Packet.prototype.readInt32; // long -binaryReader[4] = Packet.prototype.readFloat; // float -binaryReader[5] = Packet.prototype.readDouble; // double -binaryReader[6] = Packet.prototype.assertInvalid; // null, should be skipped vie null bitmap -binaryReader[7] = Packet.prototype.readTimestamp; // timestamp, http://dev.mysql.com/doc/internals/en/prepared-statements.html#packet-ProtocolBinary::MYSQL_TYPE_TIMESTAMP -binaryReader[8] = Packet.prototype.readInt64; // long long -binaryReader[9] = Packet.prototype.readInt32; // int24 -binaryReader[10] = Packet.prototype.readTimestamp; // date -binaryReader[11] = Packet.prototype.readTime; // time, http://dev.mysql.com/doc/internals/en/prepared-statements.html#packet-ProtocolBinary::MYSQL_TYPE_TIME -binaryReader[12] = Packet.prototype.readDateTime; // datetime, http://dev.mysql.com/doc/internals/en/prepared-statements.html#packet-ProtocolBinary::MYSQL_TYPE_DATETIME -binaryReader[13] = Packet.prototype.readInt16; // year -binaryReader[Types.VAR_STRING] = Packet.prototype.readLengthCodedString; // var string - -module.exports = BinaryRow; diff --git a/node_modules/mysql2/lib/packets/binlog_dump.js b/node_modules/mysql2/lib/packets/binlog_dump.js deleted file mode 100644 index e014837..0000000 --- a/node_modules/mysql2/lib/packets/binlog_dump.js +++ /dev/null @@ -1,33 +0,0 @@ -'use strict'; - -// http://dev.mysql.com/doc/internals/en/com-binlog-dump.html#packet-COM_BINLOG_DUMP - -const Packet = require('../packets/packet'); -const CommandCodes = require('../constants/commands'); - -// TODO: add flag to constants -// 0x01 - BINLOG_DUMP_NON_BLOCK -// send EOF instead of blocking -class BinlogDump { - constructor(opts) { - this.binlogPos = opts.binlogPos || 0; - this.serverId = opts.serverId || 0; - this.flags = opts.flags || 0; - this.filename = opts.filename || ''; - } - - toPacket() { - const length = 15 + Buffer.byteLength(this.filename, 'utf8'); // TODO: should be ascii? - const buffer = Buffer.allocUnsafe(length); - const packet = new Packet(0, buffer, 0, length); - packet.offset = 4; - packet.writeInt8(CommandCodes.BINLOG_DUMP); - packet.writeInt32(this.binlogPos); - packet.writeInt16(this.flags); - packet.writeInt32(this.serverId); - packet.writeString(this.filename); - return packet; - } -} - -module.exports = BinlogDump; diff --git a/node_modules/mysql2/lib/packets/binlog_query_statusvars.js b/node_modules/mysql2/lib/packets/binlog_query_statusvars.js deleted file mode 100644 index 8e45fb5..0000000 --- a/node_modules/mysql2/lib/packets/binlog_query_statusvars.js +++ /dev/null @@ -1,115 +0,0 @@ -'use strict'; - -// http://dev.mysql.com/doc/internals/en/query-event.html - -const keys = { - FLAGS2: 0, - SQL_MODE: 1, - CATALOG: 2, - AUTO_INCREMENT: 3, - CHARSET: 4, - TIME_ZONE: 5, - CATALOG_NZ: 6, - LC_TIME_NAMES: 7, - CHARSET_DATABASE: 8, - TABLE_MAP_FOR_UPDATE: 9, - MASTER_DATA_WRITTEN: 10, - INVOKERS: 11, - UPDATED_DB_NAMES: 12, - MICROSECONDS: 3 -}; - -module.exports = function parseStatusVars(buffer) { - const result = {}; - let offset = 0; - let key, length, prevOffset; - while (offset < buffer.length) { - key = buffer[offset++]; - switch (key) { - case keys.FLAGS2: - result.flags = buffer.readUInt32LE(offset); - offset += 4; - break; - case keys.SQL_MODE: - // value is 8 bytes, but all dcumented flags are in first 4 bytes - result.sqlMode = buffer.readUInt32LE(offset); - offset += 8; - break; - case keys.CATALOG: - length = buffer[offset++]; - result.catalog = buffer.toString('utf8', offset, offset + length); - offset += length + 1; // null byte after string - break; - case keys.CHARSET: - result.clientCharset = buffer.readUInt16LE(offset); - result.connectionCollation = buffer.readUInt16LE(offset + 2); - result.serverCharset = buffer.readUInt16LE(offset + 4); - offset += 6; - break; - case keys.TIME_ZONE: - length = buffer[offset++]; - result.timeZone = buffer.toString('utf8', offset, offset + length); - offset += length; // no null byte - break; - case keys.CATALOG_NZ: - length = buffer[offset++]; - result.catalogNz = buffer.toString('utf8', offset, offset + length); - offset += length; // no null byte - break; - case keys.LC_TIME_NAMES: - result.lcTimeNames = buffer.readUInt16LE(offset); - offset += 2; - break; - case keys.CHARSET_DATABASE: - result.schemaCharset = buffer.readUInt16LE(offset); - offset += 2; - break; - case keys.TABLE_MAP_FOR_UPDATE: - result.mapForUpdate1 = buffer.readUInt32LE(offset); - result.mapForUpdate2 = buffer.readUInt32LE(offset + 4); - offset += 8; - break; - case keys.MASTER_DATA_WRITTEN: - result.masterDataWritten = buffer.readUInt32LE(offset); - offset += 4; - break; - case keys.INVOKERS: - length = buffer[offset++]; - result.invokerUsername = buffer.toString( - 'utf8', - offset, - offset + length - ); - offset += length; - length = buffer[offset++]; - result.invokerHostname = buffer.toString( - 'utf8', - offset, - offset + length - ); - offset += length; - break; - case keys.UPDATED_DB_NAMES: - length = buffer[offset++]; - // length - number of null-terminated strings - result.updatedDBs = []; // we'll store them as array here - for (; length; --length) { - prevOffset = offset; - // fast forward to null terminating byte - while (buffer[offset++] && offset < buffer.length) { - // empty body, everything inside while condition - } - result.updatedDBs.push( - buffer.toString('utf8', prevOffset, offset - 1) - ); - } - break; - case keys.MICROSECONDS: - result.microseconds = - // REVIEW: INVALID UNKNOWN VARIABLE! - buffer.readInt16LE(offset) + (buffer[offset + 2] << 16); - offset += 3; - } - } - return result; -}; diff --git a/node_modules/mysql2/lib/packets/change_user.js b/node_modules/mysql2/lib/packets/change_user.js deleted file mode 100644 index 3fa3937..0000000 --- a/node_modules/mysql2/lib/packets/change_user.js +++ /dev/null @@ -1,97 +0,0 @@ -'use strict'; - -const CommandCode = require('../constants/commands.js'); -const ClientConstants = require('../constants/client.js'); -const Packet = require('../packets/packet.js'); -const auth41 = require('../auth_41.js'); -const CharsetToEncoding = require('../constants/charset_encodings.js'); - -// https://dev.mysql.com/doc/internals/en/com-change-user.html#packet-COM_CHANGE_USER -class ChangeUser { - constructor(opts) { - this.flags = opts.flags; - this.user = opts.user || ''; - this.database = opts.database || ''; - this.password = opts.password || ''; - this.passwordSha1 = opts.passwordSha1; - this.authPluginData1 = opts.authPluginData1; - this.authPluginData2 = opts.authPluginData2; - this.connectAttributes = opts.connectAttrinutes || {}; - let authToken; - if (this.passwordSha1) { - authToken = auth41.calculateTokenFromPasswordSha( - this.passwordSha1, - this.authPluginData1, - this.authPluginData2 - ); - } else { - authToken = auth41.calculateToken( - this.password, - this.authPluginData1, - this.authPluginData2 - ); - } - this.authToken = authToken; - this.charsetNumber = opts.charsetNumber; - } - - // TODO - // ChangeUser.fromPacket = function(packet) - // }; - serializeToBuffer(buffer) { - const isSet = flag => this.flags & ClientConstants[flag]; - const packet = new Packet(0, buffer, 0, buffer.length); - packet.offset = 4; - const encoding = CharsetToEncoding[this.charsetNumber]; - packet.writeInt8(CommandCode.CHANGE_USER); - packet.writeNullTerminatedString(this.user, encoding); - if (isSet('SECURE_CONNECTION')) { - packet.writeInt8(this.authToken.length); - packet.writeBuffer(this.authToken); - } else { - packet.writeBuffer(this.authToken); - packet.writeInt8(0); - } - packet.writeNullTerminatedString(this.database, encoding); - packet.writeInt16(this.charsetNumber); - if (isSet('PLUGIN_AUTH')) { - // TODO: read this from parameters - packet.writeNullTerminatedString('mysql_native_password', 'latin1'); - } - if (isSet('CONNECT_ATTRS')) { - const connectAttributes = this.connectAttributes; - const attrNames = Object.keys(connectAttributes); - let keysLength = 0; - for (let k = 0; k < attrNames.length; ++k) { - keysLength += Packet.lengthCodedStringLength(attrNames[k], encoding); - keysLength += Packet.lengthCodedStringLength( - connectAttributes[attrNames[k]], - encoding - ); - } - packet.writeLengthCodedNumber(keysLength); - for (let k = 0; k < attrNames.length; ++k) { - packet.writeLengthCodedString(attrNames[k], encoding); - packet.writeLengthCodedString( - connectAttributes[attrNames[k]], - encoding - ); - } - } - return packet; - } - - toPacket() { - if (typeof this.user !== 'string') { - throw new Error('"user" connection config property must be a string'); - } - if (typeof this.database !== 'string') { - throw new Error('"database" connection config property must be a string'); - } - // dry run: calculate resulting packet length - const p = this.serializeToBuffer(Packet.MockBuffer()); - return this.serializeToBuffer(Buffer.allocUnsafe(p.offset)); - } -} - -module.exports = ChangeUser; diff --git a/node_modules/mysql2/lib/packets/close_statement.js b/node_modules/mysql2/lib/packets/close_statement.js deleted file mode 100644 index d8be98d..0000000 --- a/node_modules/mysql2/lib/packets/close_statement.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict'; - -const Packet = require('../packets/packet'); -const CommandCodes = require('../constants/commands'); - -class CloseStatement { - constructor(id) { - this.id = id; - } - - // note: no response sent back - toPacket() { - const packet = new Packet(0, Buffer.allocUnsafe(9), 0, 9); - packet.offset = 4; - packet.writeInt8(CommandCodes.STMT_CLOSE); - packet.writeInt32(this.id); - return packet; - } -} - -module.exports = CloseStatement; diff --git a/node_modules/mysql2/lib/packets/column_definition.js b/node_modules/mysql2/lib/packets/column_definition.js deleted file mode 100644 index 35b32a1..0000000 --- a/node_modules/mysql2/lib/packets/column_definition.js +++ /dev/null @@ -1,290 +0,0 @@ -'use strict'; - -const Packet = require('../packets/packet'); -const StringParser = require('../parsers/string'); -const CharsetToEncoding = require('../constants/charset_encodings.js'); - -const fields = ['catalog', 'schema', 'table', 'orgTable', 'name', 'orgName']; - -// creating JS string is relatively expensive (compared to -// reading few bytes from buffer) because all string properties -// except for name are unlikely to be used we postpone -// string conversion until property access -// -// TODO: watch for integration benchmarks (one with real network buffer) -// there could be bad side effect as keeping reference to a buffer makes it -// sit in the memory longer (usually until final .query() callback) -// Latest v8 perform much better in regard to bufferer -> string conversion, -// at some point of time this optimisation might become unnecessary -// see https://github.com/sidorares/node-mysql2/pull/137 -// -class ColumnDefinition { - constructor(packet, clientEncoding) { - this._buf = packet.buffer; - this._clientEncoding = clientEncoding; - this._catalogLength = packet.readLengthCodedNumber(); - this._catalogStart = packet.offset; - packet.offset += this._catalogLength; - this._schemaLength = packet.readLengthCodedNumber(); - this._schemaStart = packet.offset; - packet.offset += this._schemaLength; - this._tableLength = packet.readLengthCodedNumber(); - this._tableStart = packet.offset; - packet.offset += this._tableLength; - this._orgTableLength = packet.readLengthCodedNumber(); - this._orgTableStart = packet.offset; - packet.offset += this._orgTableLength; - // name is always used, don't make it lazy - const _nameLength = packet.readLengthCodedNumber(); - const _nameStart = packet.offset; - packet.offset += _nameLength; - this._orgNameLength = packet.readLengthCodedNumber(); - this._orgNameStart = packet.offset; - packet.offset += this._orgNameLength; - packet.skip(1); // length of the following fields (always 0x0c) - this.characterSet = packet.readInt16(); - this.encoding = CharsetToEncoding[this.characterSet]; - this.name = StringParser.decode( - this._buf, - this.encoding === 'binary' ? this._clientEncoding : this.encoding, - _nameStart, - _nameStart + _nameLength - ); - this.columnLength = packet.readInt32(); - this.columnType = packet.readInt8(); - this.type = this.columnType; - this.flags = packet.readInt16(); - this.decimals = packet.readInt8(); - } - - inspect() { - return { - catalog: this.catalog, - schema: this.schema, - name: this.name, - orgName: this.orgName, - table: this.table, - orgTable: this.orgTable, - characterSet: this.characterSet, - encoding: this.encoding, - columnLength: this.columnLength, - type: this.columnType, - flags: this.flags, - decimals: this.decimals - }; - } - - [Symbol.for('nodejs.util.inspect.custom')](depth, inspectOptions, inspect) { - const Types = require('../constants/types.js'); - const typeNames = []; - for (const t in Types) { - typeNames[Types[t]] = t; - } - const fiedFlags = require('../constants/field_flags.js'); - const flagNames = []; - // TODO: respect inspectOptions.showHidden - //const inspectFlags = inspectOptions.showHidden ? this.flags : this.flags & ~fiedFlags.PRI_KEY; - const inspectFlags = this.flags; - for (const f in fiedFlags) { - if (inspectFlags & fiedFlags[f]) { - if (f === 'PRI_KEY') { - flagNames.push('PRIMARY KEY'); - } else if (f === 'NOT_NULL') { - flagNames.push('NOT NULL'); - } else if (f === 'BINARY') { - // ignore flag for now - } else if (f === 'MULTIPLE_KEY') { - // not sure if that should be part of inspection. - // in the schema usually this is part of index definition - // example: UNIQUE KEY `my_uniq_id` (`id_box_elements`,`id_router`) - // note that only first column has MULTIPLE_KEY flag set in this case - // so there is no good way of knowing that this is part of index just - // by looking at indifidual field flags - } else if (f === 'NO_DEFAULT_VALUE') { - // almost the same as NOT_NULL? - } else if (f === 'BLOB') { - // included in the type - } else if (f === 'UNSIGNED') { - // this should be first after type - } else if (f === 'TIMESTAMP') { - // timestamp flag is redundant for inspection - already included in type - } else if (f === 'ON_UPDATE_NOW') { - flagNames.push('ON UPDATE CURRENT_TIMESTAMP'); - } else { - flagNames.push(f); - } - } - } - - if (depth > 1) { - return inspect({ - ...this.inspect(), - typeName: typeNames[this.columnType], - flags: flagNames, - }); - } - - const isUnsigned = this.flags & fiedFlags.UNSIGNED; - - let typeName = typeNames[this.columnType]; - if (typeName === 'BLOB') { - // TODO: check for non-utf8mb4 encoding - if (this.columnLength === 4294967295) { - typeName = 'LONGTEXT'; - } else if (this.columnLength === 67108860) { - typeName = 'MEDIUMTEXT'; - } else if (this.columnLength === 262140) { - typeName = 'TEXT'; - } else if (this.columnLength === 1020) { // 255*4 - typeName = 'TINYTEXT'; - } else { - typeName = `BLOB(${this.columnLength})`; - } - } else if (typeName === 'VAR_STRING') { - // TODO: check for non-utf8mb4 encoding - typeName = `VARCHAR(${Math.ceil(this.columnLength/4)})`; - } else if (typeName === 'TINY') { - if ( - (this.columnLength === 3 && isUnsigned) || - (this.columnLength === 4 && !isUnsigned) ) { - typeName = 'TINYINT'; - } else { - typeName = `TINYINT(${this.columnLength})`; - } - } else if (typeName === 'LONGLONG') { - if (this.columnLength === 20) { - typeName = 'BIGINT'; - } else { - typeName = `BIGINT(${this.columnLength})`; - } - } else if (typeName === 'SHORT') { - if (isUnsigned && this.columnLength === 5) { - typeName = 'SMALLINT'; - } else if (!isUnsigned && this.columnLength === 6) { - typeName = 'SMALLINT'; - } else { - typeName = `SMALLINT(${this.columnLength})`; - } - - } else if (typeName === 'LONG') { - if (isUnsigned && this.columnLength === 10) { - typeName = 'INT'; - } else if (!isUnsigned && this.columnLength === 11) { - typeName = 'INT'; - } else { - typeName = `INT(${this.columnLength})`; - } - } else if (typeName === 'INT24') { - if (isUnsigned && this.columnLength === 8) { - typeName = 'MEDIUMINT'; - } else if (!isUnsigned && this.columnLength === 9) { - typeName = 'MEDIUMINT'; - } else { - typeName = `MEDIUMINT(${this.columnLength})`; - } - } else if (typeName === 'DOUBLE') { - // DOUBLE without modifiers is reported as DOUBLE(22, 31) - if (this.columnLength === 22 && this.decimals === 31) { - typeName = 'DOUBLE'; - } else { - typeName = `DOUBLE(${this.columnLength},${this.decimals})`; - } - } else if (typeName === 'FLOAT') { - // FLOAT without modifiers is reported as FLOAT(12, 31) - if (this.columnLength === 12 && this.decimals === 31) { - typeName = 'FLOAT'; - } else { - typeName = `FLOAT(${this.columnLength},${this.decimals})`; - } - } else if (typeName === 'NEWDECIMAL') { - if (this.columnLength === 11 && this.decimals === 0) { - typeName = 'DECIMAL'; - } else if (this.decimals === 0) { - // not sure why, but DECIMAL(13) is reported as DECIMAL(14, 0) - // and DECIMAL(13, 9) is reported as NEWDECIMAL(15, 9) - if (isUnsigned) { - typeName = `DECIMAL(${this.columnLength})`; - } else { - typeName = `DECIMAL(${this.columnLength - 1})`; - } - } else { - typeName = `DECIMAL(${this.columnLength - 2},${this.decimals})`; - } - } else { - typeName = `${typeNames[this.columnType]}(${this.columnLength})`; - } - - if (isUnsigned) { - typeName += ' UNSIGNED'; - } - - // TODO respect colors option - return `\`${this.name}\` ${[typeName, ...flagNames].join(' ')}`; - } - - static toPacket(column, sequenceId) { - let length = 17; // = 4 padding + 1 + 12 for the rest - fields.forEach(field => { - length += Packet.lengthCodedStringLength( - column[field], - CharsetToEncoding[column.characterSet] - ); - }); - const buffer = Buffer.allocUnsafe(length); - - const packet = new Packet(sequenceId, buffer, 0, length); - function writeField(name) { - packet.writeLengthCodedString( - column[name], - CharsetToEncoding[column.characterSet] - ); - } - packet.offset = 4; - fields.forEach(writeField); - packet.writeInt8(0x0c); - packet.writeInt16(column.characterSet); - packet.writeInt32(column.columnLength); - packet.writeInt8(column.columnType); - packet.writeInt16(column.flags); - packet.writeInt8(column.decimals); - packet.writeInt16(0); // filler - return packet; - } - - // node-mysql compatibility: alias "db" to "schema" - get db() { - return this.schema; - } -} - -const addString = function(name) { - Object.defineProperty(ColumnDefinition.prototype, name, { - get: function() { - const start = this[`_${name}Start`]; - const end = start + this[`_${name}Length`]; - const val = StringParser.decode( - this._buf, - this.encoding === 'binary' ? this._clientEncoding : this.encoding, - start, - end - ); - - Object.defineProperty(this, name, { - value: val, - writable: false, - configurable: false, - enumerable: false - }); - - return val; - } - }); -}; - -addString('catalog'); -addString('schema'); -addString('table'); -addString('orgTable'); -addString('orgName'); - -module.exports = ColumnDefinition; diff --git a/node_modules/mysql2/lib/packets/execute.js b/node_modules/mysql2/lib/packets/execute.js deleted file mode 100644 index daf1df9..0000000 --- a/node_modules/mysql2/lib/packets/execute.js +++ /dev/null @@ -1,212 +0,0 @@ -'use strict'; - -const CursorType = require('../constants/cursor'); -const CommandCodes = require('../constants/commands'); -const Types = require('../constants/types'); -const Packet = require('../packets/packet'); -const CharsetToEncoding = require('../constants/charset_encodings.js'); - -function isJSON(value) { - return ( - Array.isArray(value) || - value.constructor === Object || - (typeof value.toJSON === 'function' && !Buffer.isBuffer(value)) - ); -} - -/** - * Converts a value to an object describing type, String/Buffer representation and length - * @param {*} value - */ -function toParameter(value, encoding, timezone) { - let type = Types.VAR_STRING; - let length; - let writer = function(value) { - // eslint-disable-next-line no-invalid-this - return Packet.prototype.writeLengthCodedString.call(this, value, encoding); - }; - if (value !== null) { - switch (typeof value) { - case 'undefined': - throw new TypeError('Bind parameters must not contain undefined'); - - case 'number': - type = Types.DOUBLE; - length = 8; - writer = Packet.prototype.writeDouble; - break; - - case 'boolean': - value = value | 0; - type = Types.TINY; - length = 1; - writer = Packet.prototype.writeInt8; - break; - - case 'object': - if (Object.prototype.toString.call(value) === '[object Date]') { - type = Types.DATETIME; - length = 12; - writer = function(value) { - // eslint-disable-next-line no-invalid-this - return Packet.prototype.writeDate.call(this, value, timezone); - }; - } else if (isJSON(value)) { - value = JSON.stringify(value); - type = Types.JSON; - } else if (Buffer.isBuffer(value)) { - length = Packet.lengthCodedNumberLength(value.length) + value.length; - writer = Packet.prototype.writeLengthCodedBuffer; - } - break; - - default: - value = value.toString(); - } - } else { - value = ''; - type = Types.NULL; - } - if (!length) { - length = Packet.lengthCodedStringLength(value, encoding); - } - return { value, type, length, writer }; -} - -class Execute { - constructor(id, parameters, charsetNumber, timezone) { - this.id = id; - this.parameters = parameters; - this.encoding = CharsetToEncoding[charsetNumber]; - this.timezone = timezone; - } - - static fromPacket(packet, encoding) { - const stmtId = packet.readInt32(); - const flags = packet.readInt8(); - const iterationCount = packet.readInt32(); - - let i = packet.offset; - while (i < packet.end - 1) { - if((packet.buffer[i+1] === Types.VAR_STRING - || packet.buffer[i+1] === Types.NULL - || packet.buffer[i+1] === Types.DOUBLE - || packet.buffer[i+1] === Types.TINY - || packet.buffer[i+1] === Types.DATETIME - || packet.buffer[i+1] === Types.JSON) && packet.buffer[i] === 1 && packet.buffer[i+2] === 0) { - break; - } - else { - packet.readInt8() - } - i++; - } - - const types = []; - - for(let i = packet.offset + 1; i < packet.end - 1; i++) { - if((packet.buffer[i] === Types.VAR_STRING - || packet.buffer[i] === Types.NULL - || packet.buffer[i] === Types.DOUBLE - || packet.buffer[i] === Types.TINY - || packet.buffer[i] === Types.DATETIME - || packet.buffer[i] === Types.JSON) && packet.buffer[i + 1] === 0) { - types.push(packet.buffer[i]); - packet.skip(2); - } - } - - packet.skip(1); - - const values = []; - for(let i = 0; i < types.length; i++) { - if(types[i] === Types.VAR_STRING) { - values.push(packet.readLengthCodedString(encoding)) - } - else if(types[i] === Types.DOUBLE) { - values.push(packet.readDouble()) - } - else if(types[i] === Types.TINY) { - values.push(packet.readInt8()) - } - else if(types[i] === Types.DATETIME) { - values.push(packet.readDateTime()) - } - else if(types[i] === Types.JSON) { - values.push(JSON.parse(packet.readLengthCodedString(encoding))) - } - if(types[i] === Types.NULL) { - values.push(null) - } - } - - return { stmtId, flags, iterationCount, values }; - } - - toPacket() { - // TODO: don't try to calculate packet length in advance, allocate some big buffer in advance (header + 256 bytes?) - // and copy + reallocate if not enough - // 0 + 4 - length, seqId - // 4 + 1 - COM_EXECUTE - // 5 + 4 - stmtId - // 9 + 1 - flags - // 10 + 4 - iteration-count (always 1) - let length = 14; - let parameters; - if (this.parameters && this.parameters.length > 0) { - length += Math.floor((this.parameters.length + 7) / 8); - length += 1; // new-params-bound-flag - length += 2 * this.parameters.length; // type byte for each parameter if new-params-bound-flag is set - parameters = this.parameters.map(value => - toParameter(value, this.encoding, this.timezone) - ); - length += parameters.reduce( - (accumulator, parameter) => accumulator + parameter.length, - 0 - ); - } - const buffer = Buffer.allocUnsafe(length); - const packet = new Packet(0, buffer, 0, length); - packet.offset = 4; - packet.writeInt8(CommandCodes.STMT_EXECUTE); - packet.writeInt32(this.id); - packet.writeInt8(CursorType.NO_CURSOR); // flags - packet.writeInt32(1); // iteration-count, always 1 - if (parameters) { - let bitmap = 0; - let bitValue = 1; - parameters.forEach(parameter => { - if (parameter.type === Types.NULL) { - bitmap += bitValue; - } - bitValue *= 2; - if (bitValue === 256) { - packet.writeInt8(bitmap); - bitmap = 0; - bitValue = 1; - } - }); - if (bitValue !== 1) { - packet.writeInt8(bitmap); - } - // TODO: explain meaning of the flag - // afaik, if set n*2 bytes with type of parameter are sent before parameters - // if not, previous execution types are used (TODO prooflink) - packet.writeInt8(1); // new-params-bound-flag - // Write parameter types - parameters.forEach(parameter => { - packet.writeInt8(parameter.type); // field type - packet.writeInt8(0); // parameter flag - }); - // Write parameter values - parameters.forEach(parameter => { - if (parameter.type !== Types.NULL) { - parameter.writer.call(packet, parameter.value); - } - }); - } - return packet; - } -} - -module.exports = Execute; diff --git a/node_modules/mysql2/lib/packets/handshake.js b/node_modules/mysql2/lib/packets/handshake.js deleted file mode 100644 index 239387c..0000000 --- a/node_modules/mysql2/lib/packets/handshake.js +++ /dev/null @@ -1,112 +0,0 @@ -'use strict'; - -const Packet = require('../packets/packet'); -const ClientConstants = require('../constants/client.js'); - -// https://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::Handshake - -class Handshake { - constructor(args) { - this.protocolVersion = args.protocolVersion; - this.serverVersion = args.serverVersion; - this.capabilityFlags = args.capabilityFlags; - this.connectionId = args.connectionId; - this.authPluginData1 = args.authPluginData1; - this.authPluginData2 = args.authPluginData2; - this.characterSet = args.characterSet; - this.statusFlags = args.statusFlags; - this.autPluginName = args.autPluginName; - } - - setScrambleData(cb) { - require('crypto').randomBytes(20, (err, data) => { - if (err) { - cb(err); - return; - } - this.authPluginData1 = data.slice(0, 8); - this.authPluginData2 = data.slice(8, 20); - cb(); - }); - } - - toPacket(sequenceId) { - const length = 68 + Buffer.byteLength(this.serverVersion, 'utf8'); - const buffer = Buffer.alloc(length + 4, 0); // zero fill, 10 bytes filler later needs to contain zeros - const packet = new Packet(sequenceId, buffer, 0, length + 4); - packet.offset = 4; - packet.writeInt8(this.protocolVersion); - packet.writeString(this.serverVersion, 'cesu8'); - packet.writeInt8(0); - packet.writeInt32(this.connectionId); - packet.writeBuffer(this.authPluginData1); - packet.writeInt8(0); - const capabilityFlagsBuffer = Buffer.allocUnsafe(4); - capabilityFlagsBuffer.writeUInt32LE(this.capabilityFlags, 0); - packet.writeBuffer(capabilityFlagsBuffer.slice(0, 2)); - packet.writeInt8(this.characterSet); - packet.writeInt16(this.statusFlags); - packet.writeBuffer(capabilityFlagsBuffer.slice(2, 4)); - packet.writeInt8(21); // authPluginDataLength - packet.skip(10); - packet.writeBuffer(this.authPluginData2); - packet.writeInt8(0); - packet.writeString('mysql_native_password', 'latin1'); - packet.writeInt8(0); - return packet; - } - - static fromPacket(packet) { - const args = {}; - args.protocolVersion = packet.readInt8(); - args.serverVersion = packet.readNullTerminatedString('cesu8'); - args.connectionId = packet.readInt32(); - args.authPluginData1 = packet.readBuffer(8); - packet.skip(1); - const capabilityFlagsBuffer = Buffer.allocUnsafe(4); - capabilityFlagsBuffer[0] = packet.readInt8(); - capabilityFlagsBuffer[1] = packet.readInt8(); - if (packet.haveMoreData()) { - args.characterSet = packet.readInt8(); - args.statusFlags = packet.readInt16(); - // upper 2 bytes - capabilityFlagsBuffer[2] = packet.readInt8(); - capabilityFlagsBuffer[3] = packet.readInt8(); - args.capabilityFlags = capabilityFlagsBuffer.readUInt32LE(0); - if (args.capabilityFlags & ClientConstants.PLUGIN_AUTH) { - args.authPluginDataLength = packet.readInt8(); - } else { - args.authPluginDataLength = 0; - packet.skip(1); - } - packet.skip(10); - } else { - args.capabilityFlags = capabilityFlagsBuffer.readUInt16LE(0); - } - - const isSecureConnection = - args.capabilityFlags & ClientConstants.SECURE_CONNECTION; - if (isSecureConnection) { - const authPluginDataLength = args.authPluginDataLength; - if (authPluginDataLength === 0) { - // for Secure Password Authentication - args.authPluginDataLength = 20; - args.authPluginData2 = packet.readBuffer(12); - packet.skip(1); - } else { - // length > 0 - // for Custom Auth Plugin (PLUGIN_AUTH) - const len = Math.max(13, authPluginDataLength - 8); - args.authPluginData2 = packet.readBuffer(len); - } - } - - if (args.capabilityFlags & ClientConstants.PLUGIN_AUTH) { - args.autPluginName = packet.readNullTerminatedString('ascii'); - } - - return new Handshake(args); - } -} - -module.exports = Handshake; diff --git a/node_modules/mysql2/lib/packets/handshake_response.js b/node_modules/mysql2/lib/packets/handshake_response.js deleted file mode 100644 index b2dee38..0000000 --- a/node_modules/mysql2/lib/packets/handshake_response.js +++ /dev/null @@ -1,145 +0,0 @@ -'use strict'; - -const ClientConstants = require('../constants/client.js'); -const CharsetToEncoding = require('../constants/charset_encodings.js'); -const Packet = require('../packets/packet.js'); - -const auth41 = require('../auth_41.js'); - -class HandshakeResponse { - constructor(handshake) { - this.user = handshake.user || ''; - this.database = handshake.database || ''; - this.password = handshake.password || ''; - this.passwordSha1 = handshake.passwordSha1; - this.authPluginData1 = handshake.authPluginData1; - this.authPluginData2 = handshake.authPluginData2; - this.compress = handshake.compress; - this.clientFlags = handshake.flags; - // TODO: pre-4.1 auth support - let authToken; - if (this.passwordSha1) { - authToken = auth41.calculateTokenFromPasswordSha( - this.passwordSha1, - this.authPluginData1, - this.authPluginData2 - ); - } else { - authToken = auth41.calculateToken( - this.password, - this.authPluginData1, - this.authPluginData2 - ); - } - this.authToken = authToken; - this.charsetNumber = handshake.charsetNumber; - this.encoding = CharsetToEncoding[handshake.charsetNumber]; - this.connectAttributes = handshake.connectAttributes; - } - - serializeResponse(buffer) { - const isSet = flag => this.clientFlags & ClientConstants[flag]; - const packet = new Packet(0, buffer, 0, buffer.length); - packet.offset = 4; - packet.writeInt32(this.clientFlags); - packet.writeInt32(0); // max packet size. todo: move to config - packet.writeInt8(this.charsetNumber); - packet.skip(23); - const encoding = this.encoding; - packet.writeNullTerminatedString(this.user, encoding); - let k; - if (isSet('PLUGIN_AUTH_LENENC_CLIENT_DATA')) { - packet.writeLengthCodedNumber(this.authToken.length); - packet.writeBuffer(this.authToken); - } else if (isSet('SECURE_CONNECTION')) { - packet.writeInt8(this.authToken.length); - packet.writeBuffer(this.authToken); - } else { - packet.writeBuffer(this.authToken); - packet.writeInt8(0); - } - if (isSet('CONNECT_WITH_DB')) { - packet.writeNullTerminatedString(this.database, encoding); - } - if (isSet('PLUGIN_AUTH')) { - // TODO: pass from config - packet.writeNullTerminatedString('mysql_native_password', 'latin1'); - } - if (isSet('CONNECT_ATTRS')) { - const connectAttributes = this.connectAttributes || {}; - const attrNames = Object.keys(connectAttributes); - let keysLength = 0; - for (k = 0; k < attrNames.length; ++k) { - keysLength += Packet.lengthCodedStringLength(attrNames[k], encoding); - keysLength += Packet.lengthCodedStringLength( - connectAttributes[attrNames[k]], - encoding - ); - } - packet.writeLengthCodedNumber(keysLength); - for (k = 0; k < attrNames.length; ++k) { - packet.writeLengthCodedString(attrNames[k], encoding); - packet.writeLengthCodedString( - connectAttributes[attrNames[k]], - encoding - ); - } - } - return packet; - } - - toPacket() { - if (typeof this.user !== 'string') { - throw new Error('"user" connection config property must be a string'); - } - if (typeof this.database !== 'string') { - throw new Error('"database" connection config property must be a string'); - } - // dry run: calculate resulting packet length - const p = this.serializeResponse(Packet.MockBuffer()); - return this.serializeResponse(Buffer.alloc(p.offset)); - } - static fromPacket(packet) { - const args = {}; - args.clientFlags = packet.readInt32(); - function isSet(flag) { - return args.clientFlags & ClientConstants[flag]; - } - args.maxPacketSize = packet.readInt32(); - args.charsetNumber = packet.readInt8(); - const encoding = CharsetToEncoding[args.charsetNumber]; - args.encoding = encoding; - packet.skip(23); - args.user = packet.readNullTerminatedString(encoding); - let authTokenLength; - if (isSet('PLUGIN_AUTH_LENENC_CLIENT_DATA')) { - authTokenLength = packet.readLengthCodedNumber(encoding); - args.authToken = packet.readBuffer(authTokenLength); - } else if (isSet('SECURE_CONNECTION')) { - authTokenLength = packet.readInt8(); - args.authToken = packet.readBuffer(authTokenLength); - } else { - args.authToken = packet.readNullTerminatedString(encoding); - } - if (isSet('CONNECT_WITH_DB')) { - args.database = packet.readNullTerminatedString(encoding); - } - if (isSet('PLUGIN_AUTH')) { - args.authPluginName = packet.readNullTerminatedString(encoding); - } - if (isSet('CONNECT_ATTRS')) { - const keysLength = packet.readLengthCodedNumber(encoding); - const keysEnd = packet.offset + keysLength; - const attrs = {}; - while (packet.offset < keysEnd) { - attrs[ - packet.readLengthCodedString(encoding) - ] = packet.readLengthCodedString(encoding); - } - args.connectAttributes = attrs; - } - return args; - } -} - -module.exports = HandshakeResponse; diff --git a/node_modules/mysql2/lib/packets/index.js b/node_modules/mysql2/lib/packets/index.js deleted file mode 100644 index bf66e1a..0000000 --- a/node_modules/mysql2/lib/packets/index.js +++ /dev/null @@ -1,152 +0,0 @@ -// This file was modified by Oracle on June 1, 2021. -// A utility method was introduced to generate an Error instance from a -// binary server packet. -// Modifications copyright (c) 2021, Oracle and/or its affiliates. - -// This file was modified by Oracle on September 21, 2021. -// The new AuthNextFactor packet is now available. -// Modifications copyright (c) 2021, Oracle and/or its affiliates. - -'use strict'; - -const process = require('process'); - -const AuthNextFactor = require('./auth_next_factor'); -const AuthSwitchRequest = require('./auth_switch_request'); -const AuthSwitchRequestMoreData = require('./auth_switch_request_more_data'); -const AuthSwitchResponse = require('./auth_switch_response'); -const BinaryRow = require('./binary_row'); -const BinlogDump = require('./binlog_dump'); -const ChangeUser = require('./change_user'); -const CloseStatement = require('./close_statement'); -const ColumnDefinition = require('./column_definition'); -const Execute = require('./execute'); -const Handshake = require('./handshake'); -const HandshakeResponse = require('./handshake_response'); -const PrepareStatement = require('./prepare_statement'); -const PreparedStatementHeader = require('./prepared_statement_header'); -const Query = require('./query'); -const RegisterSlave = require('./register_slave'); -const ResultSetHeader = require('./resultset_header'); -const SSLRequest = require('./ssl_request'); -const TextRow = require('./text_row'); - -const ctorMap = { - AuthNextFactor, - AuthSwitchRequest, - AuthSwitchRequestMoreData, - AuthSwitchResponse, - BinaryRow, - BinlogDump, - ChangeUser, - CloseStatement, - ColumnDefinition, - Execute, - Handshake, - HandshakeResponse, - PrepareStatement, - PreparedStatementHeader, - Query, - RegisterSlave, - ResultSetHeader, - SSLRequest, - TextRow -}; -Object.entries(ctorMap).forEach(([name, ctor]) => { - module.exports[name] = ctor; - // monkey-patch it to include name if debug is on - if (process.env.NODE_DEBUG) { - if (ctor.prototype.toPacket) { - const old = ctor.prototype.toPacket; - ctor.prototype.toPacket = function() { - const p = old.call(this); - p._name = name; - return p; - }; - } - } -}); - -// simple packets: -const Packet = require('./packet'); -exports.Packet = Packet; - -class OK { - static toPacket(args, encoding) { - args = args || {}; - const affectedRows = args.affectedRows || 0; - const insertId = args.insertId || 0; - const serverStatus = args.serverStatus || 0; - const warningCount = args.warningCount || 0; - const message = args.message || ''; - - let length = 9 + Packet.lengthCodedNumberLength(affectedRows); - length += Packet.lengthCodedNumberLength(insertId); - - const buffer = Buffer.allocUnsafe(length); - const packet = new Packet(0, buffer, 0, length); - packet.offset = 4; - packet.writeInt8(0); - packet.writeLengthCodedNumber(affectedRows); - packet.writeLengthCodedNumber(insertId); - packet.writeInt16(serverStatus); - packet.writeInt16(warningCount); - packet.writeString(message, encoding); - packet._name = 'OK'; - return packet; - } -} - -exports.OK = OK; - -// warnings, statusFlags -class EOF { - static toPacket(warnings, statusFlags) { - if (typeof warnings === 'undefined') { - warnings = 0; - } - if (typeof statusFlags === 'undefined') { - statusFlags = 0; - } - const packet = new Packet(0, Buffer.allocUnsafe(9), 0, 9); - packet.offset = 4; - packet.writeInt8(0xfe); - packet.writeInt16(warnings); - packet.writeInt16(statusFlags); - packet._name = 'EOF'; - return packet; - } -} - -exports.EOF = EOF; - -class Error { - static toPacket(args, encoding) { - const length = 13 + Buffer.byteLength(args.message, 'utf8'); - const packet = new Packet(0, Buffer.allocUnsafe(length), 0, length); - packet.offset = 4; - packet.writeInt8(0xff); - packet.writeInt16(args.code); - // TODO: sql state parameter - packet.writeString('#_____', encoding); - packet.writeString(args.message, encoding); - packet._name = 'Error'; - return packet; - } - - static fromPacket(packet) { - packet.readInt8(); // marker - const code = packet.readInt16(); - packet.readString(1, 'ascii'); // sql state marker - // The SQL state of the ERR_Packet which is always 5 bytes long. - // https://dev.mysql.com/doc/dev/mysql-server/8.0.11/page_protocol_basic_dt_strings.html#sect_protocol_basic_dt_string_fix - packet.readString(5, 'ascii'); // sql state (ignore for now) - const message = packet.readNullTerminatedString('utf8'); - const error = new Error(); - error.message = message; - error.code = code; - return error; - } -} - -exports.Error = Error; diff --git a/node_modules/mysql2/lib/packets/packet.js b/node_modules/mysql2/lib/packets/packet.js deleted file mode 100644 index ccf3a84..0000000 --- a/node_modules/mysql2/lib/packets/packet.js +++ /dev/null @@ -1,919 +0,0 @@ -// This file was modified by Oracle on June 1, 2021. -// A comment describing some changes in the strict default SQL mode regarding -// non-standard dates was introduced. -// Modifications copyright (c) 2021, Oracle and/or its affiliates. - -'use strict'; - -const ErrorCodeToName = require('../constants/errors.js'); -const NativeBuffer = require('buffer').Buffer; -const Long = require('long'); -const StringParser = require('../parsers/string.js'); - -const INVALID_DATE = new Date(NaN); - -// this is nearly duplicate of previous function so generated code is not slower -// due to "if (dateStrings)" branching -const pad = '000000000000'; -function leftPad(num, value) { - const s = value.toString(); - // if we don't need to pad - if (s.length >= num) { - return s; - } - return (pad + s).slice(-num); -} - -// The whole reason parse* function below exist -// is because String creation is relatively expensive (at least with V8), and if we have -// a buffer with "12345" content ideally we would like to bypass intermediate -// "12345" string creation and directly build 12345 number out of -// data. -// In my benchmarks the difference is ~25M 8-digit numbers per second vs -// 4.5 M using Number(packet.readLengthCodedString()) -// not used when size is close to max precision as series of *10 accumulate error -// and approximate result mihgt be diffreent from (approximate as well) Number(bigNumStringValue)) -// In the futire node version if speed difference is smaller parse* functions might be removed -// don't consider them as Packet public API - -const minus = '-'.charCodeAt(0); -const plus = '+'.charCodeAt(0); - -// TODO: handle E notation -const dot = '.'.charCodeAt(0); -const exponent = 'e'.charCodeAt(0); -const exponentCapital = 'E'.charCodeAt(0); - -class Packet { - constructor(id, buffer, start, end) { - // hot path, enable checks when testing only - // if (!Buffer.isBuffer(buffer) || typeof start == 'undefined' || typeof end == 'undefined') - // throw new Error('invalid packet'); - this.sequenceId = id; - this.numPackets = 1; - this.buffer = buffer; - this.start = start; - this.offset = start + 4; - this.end = end; - } - - // ============================== - // readers - // ============================== - reset() { - this.offset = this.start + 4; - } - - length() { - return this.end - this.start; - } - - slice() { - return this.buffer.slice(this.start, this.end); - } - - dump() { - // eslint-disable-next-line no-console - console.log( - [this.buffer.asciiSlice(this.start, this.end)], - this.buffer.slice(this.start, this.end), - this.length(), - this.sequenceId - ); - } - - haveMoreData() { - return this.end > this.offset; - } - - skip(num) { - this.offset += num; - } - - readInt8() { - return this.buffer[this.offset++]; - } - - readInt16() { - this.offset += 2; - return this.buffer.readUInt16LE(this.offset - 2); - } - - readInt24() { - return this.readInt16() + (this.readInt8() << 16); - } - - readInt32() { - this.offset += 4; - return this.buffer.readUInt32LE(this.offset - 4); - } - - readSInt8() { - return this.buffer.readInt8(this.offset++); - } - - readSInt16() { - this.offset += 2; - return this.buffer.readInt16LE(this.offset - 2); - } - - readSInt32() { - this.offset += 4; - return this.buffer.readInt32LE(this.offset - 4); - } - - readInt64JSNumber() { - const word0 = this.readInt32(); - const word1 = this.readInt32(); - const l = new Long(word0, word1, true); - return l.toNumber(); - } - - readSInt64JSNumber() { - const word0 = this.readInt32(); - const word1 = this.readInt32(); - if (!(word1 & 0x80000000)) { - return word0 + 0x100000000 * word1; - } - const l = new Long(word0, word1, false); - return l.toNumber(); - } - - readInt64String() { - const word0 = this.readInt32(); - const word1 = this.readInt32(); - const res = new Long(word0, word1, true); - return res.toString(); - } - - readSInt64String() { - const word0 = this.readInt32(); - const word1 = this.readInt32(); - const res = new Long(word0, word1, false); - return res.toString(); - } - - readInt64() { - const word0 = this.readInt32(); - const word1 = this.readInt32(); - let res = new Long(word0, word1, true); - const resNumber = res.toNumber(); - const resString = res.toString(); - res = resNumber.toString() === resString ? resNumber : resString; - return res; - } - - readSInt64() { - const word0 = this.readInt32(); - const word1 = this.readInt32(); - let res = new Long(word0, word1, false); - const resNumber = res.toNumber(); - const resString = res.toString(); - res = resNumber.toString() === resString ? resNumber : resString; - return res; - } - - isEOF() { - return this.buffer[this.offset] === 0xfe && this.length() < 13; - } - - eofStatusFlags() { - return this.buffer.readInt16LE(this.offset + 3); - } - - eofWarningCount() { - return this.buffer.readInt16LE(this.offset + 1); - } - - readLengthCodedNumber(bigNumberStrings, signed) { - const byte1 = this.buffer[this.offset++]; - if (byte1 < 251) { - return byte1; - } - return this.readLengthCodedNumberExt(byte1, bigNumberStrings, signed); - } - - readLengthCodedNumberSigned(bigNumberStrings) { - return this.readLengthCodedNumber(bigNumberStrings, true); - } - - readLengthCodedNumberExt(tag, bigNumberStrings, signed) { - let word0, word1; - let res; - if (tag === 0xfb) { - return null; - } - if (tag === 0xfc) { - return this.readInt8() + (this.readInt8() << 8); - } - if (tag === 0xfd) { - return this.readInt8() + (this.readInt8() << 8) + (this.readInt8() << 16); - } - if (tag === 0xfe) { - // TODO: check version - // Up to MySQL 3.22, 0xfe was followed by a 4-byte integer. - word0 = this.readInt32(); - word1 = this.readInt32(); - if (word1 === 0) { - return word0; // don't convert to float if possible - } - if (word1 < 2097152) { - // max exact float point int, 2^52 / 2^32 - return word1 * 0x100000000 + word0; - } - res = new Long(word0, word1, !signed); // Long need unsigned - const resNumber = res.toNumber(); - const resString = res.toString(); - res = resNumber.toString() === resString ? resNumber : resString; - return bigNumberStrings ? resString : res; - } - // eslint-disable-next-line no-console - console.trace(); - throw new Error(`Should not reach here: ${tag}`); - } - - readFloat() { - const res = this.buffer.readFloatLE(this.offset); - this.offset += 4; - return res; - } - - readDouble() { - const res = this.buffer.readDoubleLE(this.offset); - this.offset += 8; - return res; - } - - readBuffer(len) { - if (typeof len === 'undefined') { - len = this.end - this.offset; - } - this.offset += len; - return this.buffer.slice(this.offset - len, this.offset); - } - - // DATE, DATETIME and TIMESTAMP - readDateTime(timezone) { - if (!timezone || timezone === 'Z' || timezone === 'local') { - const length = this.readInt8(); - if (length === 0xfb) { - return null; - } - let y = 0; - let m = 0; - let d = 0; - let H = 0; - let M = 0; - let S = 0; - let ms = 0; - if (length > 3) { - y = this.readInt16(); - m = this.readInt8(); - d = this.readInt8(); - } - if (length > 6) { - H = this.readInt8(); - M = this.readInt8(); - S = this.readInt8(); - } - if (length > 10) { - ms = this.readInt32() / 1000; - } - // NO_ZERO_DATE mode and NO_ZERO_IN_DATE mode are part of the strict - // default SQL mode used by MySQL 8.0. This means that non-standard - // dates like '0000-00-00' become NULL. For older versions and other - // possible MySQL flavours we still need to account for the - // non-standard behaviour. - if (y + m + d + H + M + S + ms === 0) { - return INVALID_DATE; - } - if (timezone === 'Z') { - return new Date(Date.UTC(y, m - 1, d, H, M, S, ms)); - } - return new Date(y, m - 1, d, H, M, S, ms); - } - let str = this.readDateTimeString(6, 'T'); - if (str.length === 10) { - str += 'T00:00:00'; - } - return new Date(str + timezone); - } - - readDateTimeString(decimals, timeSep) { - const length = this.readInt8(); - let y = 0; - let m = 0; - let d = 0; - let H = 0; - let M = 0; - let S = 0; - let ms = 0; - let str; - if (length > 3) { - y = this.readInt16(); - m = this.readInt8(); - d = this.readInt8(); - str = [leftPad(4, y), leftPad(2, m), leftPad(2, d)].join('-'); - } - if (length > 6) { - H = this.readInt8(); - M = this.readInt8(); - S = this.readInt8(); - str += `${timeSep || ' '}${[ - leftPad(2, H), - leftPad(2, M), - leftPad(2, S) - ].join(':')}`; - } - if (length > 10) { - ms = this.readInt32(); - str += '.'; - if (decimals) { - ms = leftPad(6, ms); - if (ms.length > decimals) { - ms = ms.substring(0, decimals); // rounding is done at the MySQL side, only 0 are here - } - } - str += ms; - } - return str; - } - - // TIME - value as a string, Can be negative - readTimeString(convertTtoMs) { - const length = this.readInt8(); - if (length === 0) { - return '00:00:00'; - } - const sign = this.readInt8() ? -1 : 1; // 'isNegative' flag byte - let d = 0; - let H = 0; - let M = 0; - let S = 0; - let ms = 0; - if (length > 6) { - d = this.readInt32(); - H = this.readInt8(); - M = this.readInt8(); - S = this.readInt8(); - } - if (length > 10) { - ms = this.readInt32(); - } - if (convertTtoMs) { - H += d * 24; - M += H * 60; - S += M * 60; - ms += S * 1000; - ms *= sign; - return ms; - } - // Format follows mySQL TIME format ([-][h]hh:mm:ss[.u[u[u[u[u[u]]]]]]) - // For positive times below 24 hours, this makes it equal to ISO 8601 times - return ( - (sign === -1 ? '-' : '') + - [leftPad(2, d * 24 + H), leftPad(2, M), leftPad(2, S)].join(':') + - (ms ? `.${ms}`.replace(/0+$/, '') : '') - ); - } - - readLengthCodedString(encoding) { - const len = this.readLengthCodedNumber(); - // TODO: check manually first byte here to avoid polymorphic return type? - if (len === null) { - return null; - } - this.offset += len; - // TODO: Use characterSetCode to get proper encoding - // https://github.com/sidorares/node-mysql2/pull/374 - return StringParser.decode( - this.buffer, - encoding, - this.offset - len, - this.offset - ); - } - - readLengthCodedBuffer() { - const len = this.readLengthCodedNumber(); - if (len === null) { - return null; - } - return this.readBuffer(len); - } - - readNullTerminatedString(encoding) { - const start = this.offset; - let end = this.offset; - while (this.buffer[end]) { - end = end + 1; // TODO: handle OOB check - } - this.offset = end + 1; - return StringParser.decode(this.buffer, encoding, start, end); - } - - // TODO reuse? - readString(len, encoding) { - if (typeof len === 'string' && typeof encoding === 'undefined') { - encoding = len; - len = undefined; - } - if (typeof len === 'undefined') { - len = this.end - this.offset; - } - this.offset += len; - return StringParser.decode( - this.buffer, - encoding, - this.offset - len, - this.offset - ); - } - - parseInt(len, supportBigNumbers) { - if (len === null) { - return null; - } - if (len >= 14 && !supportBigNumbers) { - const s = this.buffer.toString('ascii', this.offset, this.offset + len); - this.offset += len; - return Number(s); - } - let result = 0; - const start = this.offset; - const end = this.offset + len; - let sign = 1; - if (len === 0) { - return 0; // TODO: assert? exception? - } - if (this.buffer[this.offset] === minus) { - this.offset++; - sign = -1; - } - // max precise int is 9007199254740992 - let str; - const numDigits = end - this.offset; - if (supportBigNumbers) { - if (numDigits >= 15) { - str = this.readString(end - this.offset, 'binary'); - result = parseInt(str, 10); - if (result.toString() === str) { - return sign * result; - } - return sign === -1 ? `-${str}` : str; - } - if (numDigits > 16) { - str = this.readString(end - this.offset); - return sign === -1 ? `-${str}` : str; - } - } - if (this.buffer[this.offset] === plus) { - this.offset++; // just ignore - } - while (this.offset < end) { - result *= 10; - result += this.buffer[this.offset] - 48; - this.offset++; - } - const num = result * sign; - if (!supportBigNumbers) { - return num; - } - str = this.buffer.toString('ascii', start, end); - if (num.toString() === str) { - return num; - } - return str; - } - - // note that if value of inputNumberAsString is bigger than MAX_SAFE_INTEGER - // ( or smaller than MIN_SAFE_INTEGER ) the parseIntNoBigCheck result might be - // different from what you would get from Number(inputNumberAsString) - // String(parseIntNoBigCheck) <> String(Number(inputNumberAsString)) <> inputNumberAsString - parseIntNoBigCheck(len) { - if (len === null) { - return null; - } - let result = 0; - const end = this.offset + len; - let sign = 1; - if (len === 0) { - return 0; // TODO: assert? exception? - } - if (this.buffer[this.offset] === minus) { - this.offset++; - sign = -1; - } - if (this.buffer[this.offset] === plus) { - this.offset++; // just ignore - } - while (this.offset < end) { - result *= 10; - result += this.buffer[this.offset] - 48; - this.offset++; - } - return result * sign; - } - - // copy-paste from https://github.com/mysqljs/mysql/blob/master/lib/protocol/Parser.js - parseGeometryValue() { - const buffer = this.readLengthCodedBuffer(); - let offset = 4; - if (buffer === null || !buffer.length) { - return null; - } - function parseGeometry() { - let x, y, i, j, numPoints, line; - let result = null; - const byteOrder = buffer.readUInt8(offset); - offset += 1; - const wkbType = byteOrder - ? buffer.readUInt32LE(offset) - : buffer.readUInt32BE(offset); - offset += 4; - switch (wkbType) { - case 1: // WKBPoint - x = byteOrder - ? buffer.readDoubleLE(offset) - : buffer.readDoubleBE(offset); - offset += 8; - y = byteOrder - ? buffer.readDoubleLE(offset) - : buffer.readDoubleBE(offset); - offset += 8; - result = { x: x, y: y }; - break; - case 2: // WKBLineString - numPoints = byteOrder - ? buffer.readUInt32LE(offset) - : buffer.readUInt32BE(offset); - offset += 4; - result = []; - for (i = numPoints; i > 0; i--) { - x = byteOrder - ? buffer.readDoubleLE(offset) - : buffer.readDoubleBE(offset); - offset += 8; - y = byteOrder - ? buffer.readDoubleLE(offset) - : buffer.readDoubleBE(offset); - offset += 8; - result.push({ x: x, y: y }); - } - break; - case 3: // WKBPolygon - // eslint-disable-next-line no-case-declarations - const numRings = byteOrder - ? buffer.readUInt32LE(offset) - : buffer.readUInt32BE(offset); - offset += 4; - result = []; - for (i = numRings; i > 0; i--) { - numPoints = byteOrder - ? buffer.readUInt32LE(offset) - : buffer.readUInt32BE(offset); - offset += 4; - line = []; - for (j = numPoints; j > 0; j--) { - x = byteOrder - ? buffer.readDoubleLE(offset) - : buffer.readDoubleBE(offset); - offset += 8; - y = byteOrder - ? buffer.readDoubleLE(offset) - : buffer.readDoubleBE(offset); - offset += 8; - line.push({ x: x, y: y }); - } - result.push(line); - } - break; - case 4: // WKBMultiPoint - case 5: // WKBMultiLineString - case 6: // WKBMultiPolygon - case 7: // WKBGeometryCollection - // eslint-disable-next-line no-case-declarations - const num = byteOrder - ? buffer.readUInt32LE(offset) - : buffer.readUInt32BE(offset); - offset += 4; - result = []; - for (i = num; i > 0; i--) { - result.push(parseGeometry()); - } - break; - } - return result; - } - return parseGeometry(); - } - - parseDate(timezone) { - const strLen = this.readLengthCodedNumber(); - if (strLen === null) { - return null; - } - if (strLen !== 10) { - // we expect only YYYY-MM-DD here. - // if for some reason it's not the case return invalid date - return new Date(NaN); - } - const y = this.parseInt(4); - this.offset++; // - - const m = this.parseInt(2); - this.offset++; // - - const d = this.parseInt(2); - if (!timezone || timezone === 'local') { - return new Date(y, m - 1, d); - } - if (timezone === 'Z') { - return new Date(Date.UTC(y, m - 1, d)); - } - return new Date( - `${leftPad(4, y)}-${leftPad(2, m)}-${leftPad(2, d)}T00:00:00${timezone}` - ); - } - - parseDateTime(timezone) { - const str = this.readLengthCodedString('binary'); - if (str === null) { - return null; - } - if (!timezone || timezone === 'local') { - return new Date(str); - } - return new Date(`${str}${timezone}`); - } - - parseFloat(len) { - if (len === null) { - return null; - } - let result = 0; - const end = this.offset + len; - let factor = 1; - let pastDot = false; - let charCode = 0; - if (len === 0) { - return 0; // TODO: assert? exception? - } - if (this.buffer[this.offset] === minus) { - this.offset++; - factor = -1; - } - if (this.buffer[this.offset] === plus) { - this.offset++; // just ignore - } - while (this.offset < end) { - charCode = this.buffer[this.offset]; - if (charCode === dot) { - pastDot = true; - this.offset++; - } else if (charCode === exponent || charCode === exponentCapital) { - this.offset++; - const exponentValue = this.parseInt(end - this.offset); - return (result / factor) * Math.pow(10, exponentValue); - } else { - result *= 10; - result += this.buffer[this.offset] - 48; - this.offset++; - if (pastDot) { - factor = factor * 10; - } - } - } - return result / factor; - } - - parseLengthCodedIntNoBigCheck() { - return this.parseIntNoBigCheck(this.readLengthCodedNumber()); - } - - parseLengthCodedInt(supportBigNumbers) { - return this.parseInt(this.readLengthCodedNumber(), supportBigNumbers); - } - - parseLengthCodedIntString() { - return this.readLengthCodedString('binary'); - } - - parseLengthCodedFloat() { - return this.parseFloat(this.readLengthCodedNumber()); - } - - peekByte() { - return this.buffer[this.offset]; - } - - // OxFE is often used as "Alt" flag - not ok, not error. - // For example, it's first byte of AuthSwitchRequest - isAlt() { - return this.peekByte() === 0xfe; - } - - isError() { - return this.peekByte() === 0xff; - } - - asError(encoding) { - this.reset(); - this.readInt8(); // fieldCount - const errorCode = this.readInt16(); - let sqlState = ''; - if (this.buffer[this.offset] === 0x23) { - this.skip(1); - sqlState = this.readBuffer(5).toString(); - } - const message = this.readString(undefined, encoding); - const err = new Error(message); - err.code = ErrorCodeToName[errorCode]; - err.errno = errorCode; - err.sqlState = sqlState; - err.sqlMessage = message; - return err; - } - - writeInt32(n) { - this.buffer.writeUInt32LE(n, this.offset); - this.offset += 4; - } - - writeInt24(n) { - this.writeInt8(n & 0xff); - this.writeInt16(n >> 8); - } - - writeInt16(n) { - this.buffer.writeUInt16LE(n, this.offset); - this.offset += 2; - } - - writeInt8(n) { - this.buffer.writeUInt8(n, this.offset); - this.offset++; - } - - writeDouble(n) { - this.buffer.writeDoubleLE(n, this.offset); - this.offset += 8; - } - - writeBuffer(b) { - b.copy(this.buffer, this.offset); - this.offset += b.length; - } - - writeNull() { - this.buffer[this.offset] = 0xfb; - this.offset++; - } - - // TODO: refactor following three? - writeNullTerminatedString(s, encoding) { - const buf = StringParser.encode(s, encoding); - this.buffer.length && buf.copy(this.buffer, this.offset); - this.offset += buf.length; - this.writeInt8(0); - } - - writeString(s, encoding) { - if (s === null) { - this.writeInt8(0xfb); - return; - } - if (s.length === 0) { - return; - } - // const bytes = Buffer.byteLength(s, 'utf8'); - // this.buffer.write(s, this.offset, bytes, 'utf8'); - // this.offset += bytes; - const buf = StringParser.encode(s, encoding); - this.buffer.length && buf.copy(this.buffer, this.offset); - this.offset += buf.length; - } - - writeLengthCodedString(s, encoding) { - const buf = StringParser.encode(s, encoding); - this.writeLengthCodedNumber(buf.length); - this.buffer.length && buf.copy(this.buffer, this.offset); - this.offset += buf.length; - } - - writeLengthCodedBuffer(b) { - this.writeLengthCodedNumber(b.length); - b.copy(this.buffer, this.offset); - this.offset += b.length; - } - - writeLengthCodedNumber(n) { - if (n < 0xfb) { - return this.writeInt8(n); - } - if (n < 0xffff) { - this.writeInt8(0xfc); - return this.writeInt16(n); - } - if (n < 0xffffff) { - this.writeInt8(0xfd); - return this.writeInt24(n); - } - if (n === null) { - return this.writeInt8(0xfb); - } - // TODO: check that n is out of int precision - this.writeInt8(0xfe); - this.buffer.writeUInt32LE(n, this.offset); - this.offset += 4; - this.buffer.writeUInt32LE(n >> 32, this.offset); - this.offset += 4; - return this.offset; - } - - writeDate(d, timezone) { - this.buffer.writeUInt8(11, this.offset); - if (!timezone || timezone === 'local') { - this.buffer.writeUInt16LE(d.getFullYear(), this.offset + 1); - this.buffer.writeUInt8(d.getMonth() + 1, this.offset + 3); - this.buffer.writeUInt8(d.getDate(), this.offset + 4); - this.buffer.writeUInt8(d.getHours(), this.offset + 5); - this.buffer.writeUInt8(d.getMinutes(), this.offset + 6); - this.buffer.writeUInt8(d.getSeconds(), this.offset + 7); - this.buffer.writeUInt32LE(d.getMilliseconds() * 1000, this.offset + 8); - } else { - if (timezone !== 'Z') { - const offset = - (timezone[0] === '-' ? -1 : 1) * - (parseInt(timezone.substring(1, 3), 10) * 60 + - parseInt(timezone.substring(4), 10)); - if (offset !== 0) { - d = new Date(d.getTime() + 60000 * offset); - } - } - this.buffer.writeUInt16LE(d.getUTCFullYear(), this.offset + 1); - this.buffer.writeUInt8(d.getUTCMonth() + 1, this.offset + 3); - this.buffer.writeUInt8(d.getUTCDate(), this.offset + 4); - this.buffer.writeUInt8(d.getUTCHours(), this.offset + 5); - this.buffer.writeUInt8(d.getUTCMinutes(), this.offset + 6); - this.buffer.writeUInt8(d.getUTCSeconds(), this.offset + 7); - this.buffer.writeUInt32LE(d.getUTCMilliseconds() * 1000, this.offset + 8); - } - this.offset += 12; - } - - writeHeader(sequenceId) { - const offset = this.offset; - this.offset = 0; - this.writeInt24(this.buffer.length - 4); - this.writeInt8(sequenceId); - this.offset = offset; - } - - clone() { - return new Packet(this.sequenceId, this.buffer, this.start, this.end); - } - - type() { - if (this.isEOF()) { - return 'EOF'; - } - if (this.isError()) { - return 'Error'; - } - if (this.buffer[this.offset] === 0) { - return 'maybeOK'; // could be other packet types as well - } - return ''; - } - - static lengthCodedNumberLength(n) { - if (n < 0xfb) { - return 1; - } - if (n < 0xffff) { - return 3; - } - if (n < 0xffffff) { - return 5; - } - return 9; - } - - static lengthCodedStringLength(str, encoding) { - const buf = StringParser.encode(str, encoding); - const slen = buf.length; - return Packet.lengthCodedNumberLength(slen) + slen; - } - - static MockBuffer() { - const noop = function () {}; - const res = Buffer.alloc(0); - for (const op in NativeBuffer.prototype) { - if (typeof res[op] === 'function') { - res[op] = noop; - } - } - return res; - } -} - -module.exports = Packet; diff --git a/node_modules/mysql2/lib/packets/prepare_statement.js b/node_modules/mysql2/lib/packets/prepare_statement.js deleted file mode 100644 index d53c222..0000000 --- a/node_modules/mysql2/lib/packets/prepare_statement.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict'; - -const Packet = require('../packets/packet'); -const CommandCodes = require('../constants/commands'); -const StringParser = require('../parsers/string.js'); -const CharsetToEncoding = require('../constants/charset_encodings.js'); - -class PrepareStatement { - constructor(sql, charsetNumber) { - this.query = sql; - this.charsetNumber = charsetNumber; - this.encoding = CharsetToEncoding[charsetNumber]; - } - - toPacket() { - const buf = StringParser.encode(this.query, this.encoding); - const length = 5 + buf.length; - const buffer = Buffer.allocUnsafe(length); - const packet = new Packet(0, buffer, 0, length); - packet.offset = 4; - packet.writeInt8(CommandCodes.STMT_PREPARE); - packet.writeBuffer(buf); - return packet; - } -} - -module.exports = PrepareStatement; diff --git a/node_modules/mysql2/lib/packets/prepared_statement_header.js b/node_modules/mysql2/lib/packets/prepared_statement_header.js deleted file mode 100644 index 70b263a..0000000 --- a/node_modules/mysql2/lib/packets/prepared_statement_header.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; - -class PreparedStatementHeader { - constructor(packet) { - packet.skip(1); // should be 0 - this.id = packet.readInt32(); - this.fieldCount = packet.readInt16(); - this.parameterCount = packet.readInt16(); - packet.skip(1); // should be 0 - this.warningCount = packet.readInt16(); - } -} - -// TODO: toPacket - -module.exports = PreparedStatementHeader; diff --git a/node_modules/mysql2/lib/packets/query.js b/node_modules/mysql2/lib/packets/query.js deleted file mode 100644 index b650b35..0000000 --- a/node_modules/mysql2/lib/packets/query.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict'; - -const Packet = require('../packets/packet.js'); -const CommandCode = require('../constants/commands.js'); -const StringParser = require('../parsers/string.js'); -const CharsetToEncoding = require('../constants/charset_encodings.js'); - -class Query { - constructor(sql, charsetNumber) { - this.query = sql; - this.charsetNumber = charsetNumber; - this.encoding = CharsetToEncoding[charsetNumber]; - } - - toPacket() { - const buf = StringParser.encode(this.query, this.encoding); - const length = 5 + buf.length; - const buffer = Buffer.allocUnsafe(length); - const packet = new Packet(0, buffer, 0, length); - packet.offset = 4; - packet.writeInt8(CommandCode.QUERY); - packet.writeBuffer(buf); - return packet; - } -} - -module.exports = Query; diff --git a/node_modules/mysql2/lib/packets/register_slave.js b/node_modules/mysql2/lib/packets/register_slave.js deleted file mode 100644 index 26e802f..0000000 --- a/node_modules/mysql2/lib/packets/register_slave.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict'; - -// http://dev.mysql.com/doc/internals/en/com-register-slave.html -// note that documentation is incorrect, for example command code is actually 0x15 but documented as 0x14 - -const Packet = require('../packets/packet'); -const CommandCodes = require('../constants/commands'); - -class RegisterSlave { - constructor(opts) { - this.serverId = opts.serverId || 0; - this.slaveHostname = opts.slaveHostname || ''; - this.slaveUser = opts.slaveUser || ''; - this.slavePassword = opts.slavePassword || ''; - this.slavePort = opts.slavePort || 0; - this.replicationRank = opts.replicationRank || 0; - this.masterId = opts.masterId || 0; - } - - toPacket() { - const length = - 15 + // TODO: should be ascii? - Buffer.byteLength(this.slaveHostname, 'utf8') + - Buffer.byteLength(this.slaveUser, 'utf8') + - Buffer.byteLength(this.slavePassword, 'utf8') + - 3 + - 4; - const buffer = Buffer.allocUnsafe(length); - const packet = new Packet(0, buffer, 0, length); - packet.offset = 4; - packet.writeInt8(CommandCodes.REGISTER_SLAVE); - packet.writeInt32(this.serverId); - packet.writeInt8(Buffer.byteLength(this.slaveHostname, 'utf8')); - packet.writeString(this.slaveHostname); - packet.writeInt8(Buffer.byteLength(this.slaveUser, 'utf8')); - packet.writeString(this.slaveUser); - packet.writeInt8(Buffer.byteLength(this.slavePassword, 'utf8')); - packet.writeString(this.slavePassword); - packet.writeInt16(this.slavePort); - packet.writeInt32(this.replicationRank); - packet.writeInt32(this.masterId); - return packet; - } -} - -module.exports = RegisterSlave; diff --git a/node_modules/mysql2/lib/packets/resultset_header.js b/node_modules/mysql2/lib/packets/resultset_header.js deleted file mode 100644 index 8aa17e0..0000000 --- a/node_modules/mysql2/lib/packets/resultset_header.js +++ /dev/null @@ -1,119 +0,0 @@ -'use strict'; - -// TODO: rename to OK packet -// https://dev.mysql.com/doc/internals/en/packet-OK_Packet.html - -const Packet = require('./packet.js'); -const ClientConstants = require('../constants/client.js'); -const ServerSatusFlags = require('../constants/server_status.js'); - -const EncodingToCharset = require('../constants/encoding_charset.js'); -const sessionInfoTypes = require('../constants/session_track.js'); - -class ResultSetHeader { - constructor(packet, connection) { - const bigNumberStrings = connection.config.bigNumberStrings; - const encoding = connection.serverEncoding; - const flags = connection._handshakePacket.capabilityFlags; - const isSet = function(flag) { - return flags & ClientConstants[flag]; - }; - if (packet.buffer[packet.offset] !== 0) { - this.fieldCount = packet.readLengthCodedNumber(); - if (this.fieldCount === null) { - this.infileName = packet.readString(undefined, encoding); - } - return; - } - this.fieldCount = packet.readInt8(); // skip OK byte - this.affectedRows = packet.readLengthCodedNumber(bigNumberStrings); - this.insertId = packet.readLengthCodedNumberSigned(bigNumberStrings); - this.info = ''; - if (isSet('PROTOCOL_41')) { - this.serverStatus = packet.readInt16(); - this.warningStatus = packet.readInt16(); - } else if (isSet('TRANSACTIONS')) { - this.serverStatus = packet.readInt16(); - } - let stateChanges = null; - if (isSet('SESSION_TRACK') && packet.offset < packet.end) { - this.info = packet.readLengthCodedString(encoding); - - if (this.serverStatus && ServerSatusFlags.SERVER_SESSION_STATE_CHANGED) { - // session change info record - see - // https://dev.mysql.com/doc/internals/en/packet-OK_Packet.html#cs-sect-packet-ok-sessioninfo - let len = - packet.offset < packet.end ? packet.readLengthCodedNumber() : 0; - const end = packet.offset + len; - let type, key, stateEnd; - if (len > 0) { - stateChanges = { - systemVariables: {}, - schema: null, - gtids: [], - trackStateChange: null - }; - } - while (packet.offset < end) { - type = packet.readInt8(); - len = packet.readLengthCodedNumber(); - stateEnd = packet.offset + len; - if (type === sessionInfoTypes.SYSTEM_VARIABLES) { - key = packet.readLengthCodedString(encoding); - const val = packet.readLengthCodedString(encoding); - stateChanges.systemVariables[key] = val; - if (key === 'character_set_client') { - const charsetNumber = EncodingToCharset[val]; - connection.config.charsetNumber = charsetNumber; - } - } else if (type === sessionInfoTypes.SCHEMA) { - key = packet.readLengthCodedString(encoding); - stateChanges.schema = key; - } else if (type === sessionInfoTypes.STATE_CHANGE) { - stateChanges.trackStateChange = packet.readLengthCodedString( - encoding - ); - } else if (type === sessionInfoTypes.STATE_GTIDS) { - // TODO: find if the first length coded string means anything. Usually comes as empty - // eslint-disable-next-line no-unused-vars - const _unknownString = packet.readLengthCodedString(encoding); - const gtid = packet.readLengthCodedString(encoding); - stateChanges.gtids = gtid.split(','); - } else { - // unsupported session track type. For now just ignore - } - packet.offset = stateEnd; - } - } - } else { - this.info = packet.readString(undefined, encoding); - } - if (stateChanges) { - this.stateChanges = stateChanges; - } - const m = this.info.match(/\schanged:\s*(\d+)/i); - if (m !== null) { - this.changedRows = parseInt(m[1], 10); - } else { - this.changedRows = 0; - } - } - - // TODO: should be consistent instance member, but it's just easier here to have just function - static toPacket(fieldCount, insertId) { - let length = 4 + Packet.lengthCodedNumberLength(fieldCount); - if (typeof insertId !== 'undefined') { - length += Packet.lengthCodedNumberLength(insertId); - } - const buffer = Buffer.allocUnsafe(length); - const packet = new Packet(0, buffer, 0, length); - packet.offset = 4; - packet.writeLengthCodedNumber(fieldCount); - if (typeof insertId !== 'undefined') { - packet.writeLengthCodedNumber(insertId); - } - return packet; - } -} - -module.exports = ResultSetHeader; diff --git a/node_modules/mysql2/lib/packets/ssl_request.js b/node_modules/mysql2/lib/packets/ssl_request.js deleted file mode 100644 index 69eec24..0000000 --- a/node_modules/mysql2/lib/packets/ssl_request.js +++ /dev/null @@ -1,25 +0,0 @@ -'use strict'; - -const ClientConstants = require('../constants/client'); -const Packet = require('../packets/packet'); - -class SSLRequest { - constructor(flags, charset) { - this.clientFlags = flags | ClientConstants.SSL; - this.charset = charset; - } - - toPacket() { - const length = 36; - const buffer = Buffer.allocUnsafe(length); - const packet = new Packet(0, buffer, 0, length); - buffer.fill(0); - packet.offset = 4; - packet.writeInt32(this.clientFlags); - packet.writeInt32(0); // max packet size. todo: move to config - packet.writeInt8(this.charset); - return packet; - } -} - -module.exports = SSLRequest; diff --git a/node_modules/mysql2/lib/packets/text_row.js b/node_modules/mysql2/lib/packets/text_row.js deleted file mode 100644 index af9ab93..0000000 --- a/node_modules/mysql2/lib/packets/text_row.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict'; - -const Packet = require('../packets/packet'); - -class TextRow { - constructor(columns) { - this.columns = columns || []; - } - - static fromPacket(packet) { - // packet.reset(); // set offset to starting point? - const columns = []; - while (packet.haveMoreData()) { - columns.push(packet.readLengthCodedString()); - } - return new TextRow(columns); - } - - static toPacket(columns, encoding) { - const sequenceId = 0; // TODO remove, this is calculated now in connecton - let length = 0; - columns.forEach(val => { - if (val === null || typeof val === 'undefined') { - ++length; - return; - } - length += Packet.lengthCodedStringLength(val.toString(10), encoding); - }); - const buffer = Buffer.allocUnsafe(length + 4); - const packet = new Packet(sequenceId, buffer, 0, length + 4); - packet.offset = 4; - columns.forEach(val => { - if (val === null) { - packet.writeNull(); - return; - } - if (typeof val === 'undefined') { - packet.writeInt8(0); - return; - } - packet.writeLengthCodedString(val.toString(10), encoding); - }); - return packet; - } -} - -module.exports = TextRow; diff --git a/node_modules/mysql2/lib/parsers/binary_parser.js b/node_modules/mysql2/lib/parsers/binary_parser.js deleted file mode 100644 index bbd2959..0000000 --- a/node_modules/mysql2/lib/parsers/binary_parser.js +++ /dev/null @@ -1,186 +0,0 @@ -'use strict'; - -const FieldFlags = require('../constants/field_flags.js'); -const Charsets = require('../constants/charsets.js'); -const Types = require('../constants/types.js'); -const helpers = require('../helpers'); -const genFunc = require('generate-function'); -const parserCache = require('./parser_cache.js'); -const typeNames = []; -for (const t in Types) { - typeNames[Types[t]] = t; -} - -function readCodeFor(field, config, options, fieldNum) { - const supportBigNumbers = - options.supportBigNumbers || config.supportBigNumbers; - const bigNumberStrings = options.bigNumberStrings || config.bigNumberStrings; - const timezone = options.timezone || config.timezone; - const dateStrings = options.dateStrings || config.dateStrings; - const unsigned = field.flags & FieldFlags.UNSIGNED; - switch (field.columnType) { - case Types.TINY: - return unsigned ? 'packet.readInt8();' : 'packet.readSInt8();'; - case Types.SHORT: - return unsigned ? 'packet.readInt16();' : 'packet.readSInt16();'; - case Types.LONG: - case Types.INT24: // in binary protocol int24 is encoded in 4 bytes int32 - return unsigned ? 'packet.readInt32();' : 'packet.readSInt32();'; - case Types.YEAR: - return 'packet.readInt16()'; - case Types.FLOAT: - return 'packet.readFloat();'; - case Types.DOUBLE: - return 'packet.readDouble();'; - case Types.NULL: - return 'null;'; - case Types.DATE: - case Types.DATETIME: - case Types.TIMESTAMP: - case Types.NEWDATE: - if (helpers.typeMatch(field.columnType, dateStrings, Types)) { - return `packet.readDateTimeString(${field.decimals});`; - } - return `packet.readDateTime('${timezone}');`; - case Types.TIME: - return 'packet.readTimeString()'; - case Types.DECIMAL: - case Types.NEWDECIMAL: - if (config.decimalNumbers) { - return 'packet.parseLengthCodedFloat();'; - } - return 'packet.readLengthCodedString("ascii");'; - case Types.GEOMETRY: - return 'packet.parseGeometryValue();'; - case Types.JSON: - // Since for JSON columns mysql always returns charset 63 (BINARY), - // we have to handle it according to JSON specs and use "utf8", - // see https://github.com/sidorares/node-mysql2/issues/409 - return 'JSON.parse(packet.readLengthCodedString("utf8"));'; - case Types.LONGLONG: - if (!supportBigNumbers) { - return unsigned - ? 'packet.readInt64JSNumber();' - : 'packet.readSInt64JSNumber();'; - } - if (bigNumberStrings) { - return unsigned - ? 'packet.readInt64String();' - : 'packet.readSInt64String();'; - } - return unsigned ? 'packet.readInt64();' : 'packet.readSInt64();'; - - default: - if (field.characterSet === Charsets.BINARY) { - return 'packet.readLengthCodedBuffer();'; - } - return `packet.readLengthCodedString(fields[${fieldNum}].encoding)`; - } -} - -function compile(fields, options, config) { - const parserFn = genFunc(); - let i = 0; - const nullBitmapLength = Math.floor((fields.length + 7 + 2) / 8); - - /* eslint-disable no-trailing-spaces */ - /* eslint-disable no-spaced-func */ - /* eslint-disable no-unexpected-multiline */ - - parserFn('(function(){'); - parserFn('return class BinaryRow {'); - parserFn('constructor() {'); - parserFn('}'); - - parserFn('next(packet, fields, options) {'); - if (options.rowsAsArray) { - parserFn(`const result = new Array(${fields.length});`); - } else { - parserFn("const result = {};"); - } - - const resultTables = {}; - let resultTablesArray = []; - - if (options.nestTables === true) { - for (i = 0; i < fields.length; i++) { - resultTables[fields[i].table] = 1; - } - resultTablesArray = Object.keys(resultTables); - for (i = 0; i < resultTablesArray.length; i++) { - parserFn(`result[${helpers.srcEscape(resultTablesArray[i])}] = {};`); - } - } - - parserFn('packet.readInt8();'); // status byte - for (i = 0; i < nullBitmapLength; ++i) { - parserFn(`const nullBitmaskByte${i} = packet.readInt8();`); - } - - let lvalue = ''; - let currentFieldNullBit = 4; - let nullByteIndex = 0; - let fieldName = ''; - let tableName = ''; - - for (i = 0; i < fields.length; i++) { - fieldName = helpers.srcEscape(fields[i].name); - parserFn(`// ${fieldName}: ${typeNames[fields[i].columnType]}`); - - if (typeof options.nestTables === 'string') { - tableName = helpers.srcEscape(fields[i].table); - lvalue = `result[${helpers.srcEscape( - fields[i].table + options.nestTables + fields[i].name - )}]`; - } else if (options.nestTables === true) { - tableName = helpers.srcEscape(fields[i].table); - lvalue = `result[${tableName}][${fieldName}]`; - } else if (options.rowsAsArray) { - lvalue = `result[${i.toString(10)}]`; - } else { - lvalue = `result[${helpers.srcEscape(fields[i].name)}]`; - } - - // TODO: this used to be an optimisation ( if column marked as NOT_NULL don't include code to check null - // bitmap at all, but it seems that we can't rely on this flag, see #178 - // TODO: benchmark performance difference - // - // if (fields[i].flags & FieldFlags.NOT_NULL) { // don't need to check null bitmap if field can't be null. - // result.push(lvalue + ' = ' + readCodeFor(fields[i], config)); - // } else if (fields[i].columnType == Types.NULL) { - // result.push(lvalue + ' = null;'); - // } else { - parserFn(`if (nullBitmaskByte${nullByteIndex} & ${currentFieldNullBit})`); - parserFn(`${lvalue} = null;`); - parserFn('else'); - parserFn(`${lvalue} = ${readCodeFor(fields[i], config, options, i)}`); - // } - currentFieldNullBit *= 2; - if (currentFieldNullBit === 0x100) { - currentFieldNullBit = 1; - nullByteIndex++; - } - } - - parserFn('return result;'); - parserFn('}'); - parserFn('};')('})()'); - - /* eslint-enable no-trailing-spaces */ - /* eslint-enable no-spaced-func */ - /* eslint-enable no-unexpected-multiline */ - - if (config.debug) { - helpers.printDebugWithCode( - 'Compiled binary protocol row parser', - parserFn.toString() - ); - } - return parserFn.toFunction(); -} - -function getBinaryParser(fields, options, config) { - return parserCache.getParser('binary', fields, options, config, compile); -} - -module.exports = getBinaryParser; diff --git a/node_modules/mysql2/lib/parsers/parser_cache.js b/node_modules/mysql2/lib/parsers/parser_cache.js deleted file mode 100644 index 2660da9..0000000 --- a/node_modules/mysql2/lib/parsers/parser_cache.js +++ /dev/null @@ -1,53 +0,0 @@ -'use strict'; - -const LRU = require('lru-cache').default; - -const parserCache = new LRU({ - max: 15000 -}); - -function keyFromFields(type, fields, options, config) { - let res = - `${type}` + - `/${typeof options.nestTables}` + - `/${options.nestTables}` + - `/${options.rowsAsArray}` + - `/${options.supportBigNumbers || config.supportBigNumbers}` + - `/${options.bigNumberStrings || config.bigNumberStrings}` + - `/${typeof options.typeCast}` + - `/${options.timezone || config.timezone}` + - `/${options.decimalNumbers}` + - `/${options.dateStrings}`; - for (let i = 0; i < fields.length; ++i) { - const field = fields[i]; - res += `/${field.name}:${field.columnType}:${field.length}:${field.schema}:${field.table}:${field.flags}:${field.characterSet}`; - } - return res; -} - -function getParser(type, fields, options, config, compiler) { - const key = keyFromFields(type, fields, options, config); - let parser = parserCache.get(key); - - if (parser) { - return parser; - } - - parser = compiler(fields, options, config); - parserCache.set(key, parser); - return parser; -} - -function setMaxCache(max) { - parserCache.max = max; -} - -function clearCache() { - parserCache.clear(); -} - -module.exports = { - getParser: getParser, - setMaxCache: setMaxCache, - clearCache: clearCache -}; diff --git a/node_modules/mysql2/lib/parsers/string.js b/node_modules/mysql2/lib/parsers/string.js deleted file mode 100644 index 5523fb2..0000000 --- a/node_modules/mysql2/lib/parsers/string.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict'; - -const Iconv = require('iconv-lite'); - -exports.decode = function(buffer, encoding, start, end, options) { - if (Buffer.isEncoding(encoding)) { - return buffer.toString(encoding, start, end); - } - - const decoder = Iconv.getDecoder(encoding, options || {}); - - const res = decoder.write(buffer.slice(start, end)); - const trail = decoder.end(); - - return trail ? res + trail : res; -}; - -exports.encode = function(string, encoding, options) { - if (Buffer.isEncoding(encoding)) { - return Buffer.from(string, encoding); - } - - const encoder = Iconv.getEncoder(encoding, options || {}); - - const res = encoder.write(string); - const trail = encoder.end(); - - return trail && trail.length > 0 ? Buffer.concat([res, trail]) : res; -}; diff --git a/node_modules/mysql2/lib/parsers/text_parser.js b/node_modules/mysql2/lib/parsers/text_parser.js deleted file mode 100644 index 49a128c..0000000 --- a/node_modules/mysql2/lib/parsers/text_parser.js +++ /dev/null @@ -1,209 +0,0 @@ -'use strict'; - -const Types = require('../constants/types.js'); -const Charsets = require('../constants/charsets.js'); -const helpers = require('../helpers'); -const genFunc = require('generate-function'); -const parserCache = require('./parser_cache.js'); - -const typeNames = []; -for (const t in Types) { - typeNames[Types[t]] = t; -} - -function readCodeFor(type, charset, encodingExpr, config, options) { - const supportBigNumbers = - options.supportBigNumbers || config.supportBigNumbers; - const bigNumberStrings = options.bigNumberStrings || config.bigNumberStrings; - const timezone = options.timezone || config.timezone; - const dateStrings = options.dateStrings || config.dateStrings; - - switch (type) { - case Types.TINY: - case Types.SHORT: - case Types.LONG: - case Types.INT24: - case Types.YEAR: - return 'packet.parseLengthCodedIntNoBigCheck()'; - case Types.LONGLONG: - if (supportBigNumbers && bigNumberStrings) { - return 'packet.parseLengthCodedIntString()'; - } - return `packet.parseLengthCodedInt(${supportBigNumbers})`; - case Types.FLOAT: - case Types.DOUBLE: - return 'packet.parseLengthCodedFloat()'; - case Types.NULL: - return 'packet.readLengthCodedNumber()'; - case Types.DECIMAL: - case Types.NEWDECIMAL: - if (config.decimalNumbers) { - return 'packet.parseLengthCodedFloat()'; - } - return 'packet.readLengthCodedString("ascii")'; - case Types.DATE: - if (helpers.typeMatch(type, dateStrings, Types)) { - return 'packet.readLengthCodedString("ascii")'; - } - return `packet.parseDate('${timezone}')`; - case Types.DATETIME: - case Types.TIMESTAMP: - if (helpers.typeMatch(type, dateStrings, Types)) { - return 'packet.readLengthCodedString("ascii")'; - } - return `packet.parseDateTime('${timezone}')`; - case Types.TIME: - return 'packet.readLengthCodedString("ascii")'; - case Types.GEOMETRY: - return 'packet.parseGeometryValue()'; - case Types.JSON: - // Since for JSON columns mysql always returns charset 63 (BINARY), - // we have to handle it according to JSON specs and use "utf8", - // see https://github.com/sidorares/node-mysql2/issues/409 - return 'JSON.parse(packet.readLengthCodedString("utf8"))'; - default: - if (charset === Charsets.BINARY) { - return 'packet.readLengthCodedBuffer()'; - } - return `packet.readLengthCodedString(${encodingExpr})`; - } -} - -function compile(fields, options, config) { - // use global typeCast if current query doesn't specify one - if ( - typeof config.typeCast === 'function' && - typeof options.typeCast !== 'function' - ) { - options.typeCast = config.typeCast; - } - - function wrap(field, _this) { - return { - type: typeNames[field.columnType], - length: field.columnLength, - db: field.schema, - table: field.table, - name: field.name, - string: function(encoding = field.encoding) { - if (field.columnType === Types.JSON && encoding === field.encoding) { - // Since for JSON columns mysql always returns charset 63 (BINARY), - // we have to handle it according to JSON specs and use "utf8", - // see https://github.com/sidorares/node-mysql2/issues/1661 - console.warn(`typeCast: JSON column "${field.name}" is interpreted as BINARY by default, recommended to manually set utf8 encoding: \`field.string("utf8")\``); - } - - return _this.packet.readLengthCodedString(encoding); - }, - buffer: function() { - return _this.packet.readLengthCodedBuffer(); - }, - geometry: function() { - return _this.packet.parseGeometryValue(); - } - }; - } - - const parserFn = genFunc(); - - /* eslint-disable no-trailing-spaces */ - /* eslint-disable no-spaced-func */ - /* eslint-disable no-unexpected-multiline */ - parserFn('(function () {')( - 'return class TextRow {' - ); - - // constructor method - parserFn('constructor(fields) {'); - // node-mysql typeCast compatibility wrapper - // see https://github.com/mysqljs/mysql/blob/96fdd0566b654436624e2375c7b6604b1f50f825/lib/protocol/packets/Field.js - if (typeof options.typeCast === 'function') { - parserFn('const _this = this;'); - parserFn('for(let i=0; i cb(new Error('Pool is closed.'))); - } - let connection; - if (this._freeConnections.length > 0) { - connection = this._freeConnections.pop(); - this.emit('acquire', connection); - return process.nextTick(() => cb(null, connection)); - } - if ( - this.config.connectionLimit === 0 || - this._allConnections.length < this.config.connectionLimit - ) { - connection = new PoolConnection(this, { - config: this.config.connectionConfig - }); - this._allConnections.push(connection); - return connection.connect(err => { - if (this._closed) { - return cb(new Error('Pool is closed.')); - } - if (err) { - return cb(err); - } - this.emit('connection', connection); - this.emit('acquire', connection); - return cb(null, connection); - }); - } - if (!this.config.waitForConnections) { - return process.nextTick(() => cb(new Error('No connections available.'))); - } - if ( - this.config.queueLimit && - this._connectionQueue.length >= this.config.queueLimit - ) { - return cb(new Error('Queue limit reached.')); - } - this.emit('enqueue'); - return this._connectionQueue.push(cb); - } - - releaseConnection(connection) { - let cb; - if (!connection._pool) { - // The connection has been removed from the pool and is no longer good. - if (this._connectionQueue.length) { - cb = this._connectionQueue.shift(); - process.nextTick(this.getConnection.bind(this, cb)); - } - } else if (this._connectionQueue.length) { - cb = this._connectionQueue.shift(); - process.nextTick(cb.bind(null, null, connection)); - } else { - this._freeConnections.push(connection); - this.emit('release', connection); - } - } - - end(cb) { - this._closed = true; - if (typeof cb !== 'function') { - cb = function(err) { - if (err) { - throw err; - } - }; - } - let calledBack = false; - let closedConnections = 0; - let connection; - const endCB = function(err) { - if (calledBack) { - return; - } - if (err || ++closedConnections >= this._allConnections.length) { - calledBack = true; - cb(err); - return; - } - }.bind(this); - if (this._allConnections.length === 0) { - endCB(); - return; - } - for (let i = 0; i < this._allConnections.length; i++) { - connection = this._allConnections.get(i); - connection._realEnd(endCB); - } - } - - query(sql, values, cb) { - const cmdQuery = Connection.createQuery( - sql, - values, - cb, - this.config.connectionConfig - ); - if (typeof cmdQuery.namedPlaceholders === 'undefined') { - cmdQuery.namedPlaceholders = this.config.connectionConfig.namedPlaceholders; - } - this.getConnection((err, conn) => { - if (err) { - if (typeof cmdQuery.onResult === 'function') { - cmdQuery.onResult(err); - } else { - cmdQuery.emit('error', err); - } - return; - } - try { - conn.query(cmdQuery).once('end', () => { - conn.release(); - }); - } catch (e) { - conn.release(); - throw e; - } - }); - return cmdQuery; - } - - execute(sql, values, cb) { - // TODO construct execute command first here and pass it to connection.execute - // so that polymorphic arguments logic is there in one place - if (typeof values === 'function') { - cb = values; - values = []; - } - this.getConnection((err, conn) => { - if (err) { - return cb(err); - } - try { - conn.execute(sql, values, cb).once('end', () => { - conn.release(); - }); - } catch (e) { - conn.release(); - return cb(e); - } - }); - } - - _removeConnection(connection) { - // Remove connection from all connections - spliceConnection(this._allConnections, connection); - // Remove connection from free connections - spliceConnection(this._freeConnections, connection); - this.releaseConnection(connection); - } - - _removeIdleTimeoutConnections() { - if (this._removeIdleTimeoutConnectionsTimer) { - clearTimeout(this._removeIdleTimeoutConnectionsTimer); - } - - this._removeIdleTimeoutConnectionsTimer = setTimeout(() => { - try { - while ( - this._freeConnections.length > this.config.maxIdle && - Date.now() - this._freeConnections.get(0).lastActiveTime > - this.config.idleTimeout - ) { - this._freeConnections.get(0).destroy(); - } - } finally { - this._removeIdleTimeoutConnections(); - } - }, 1000); - } - - format(sql, values) { - return mysql.format( - sql, - values, - this.config.connectionConfig.stringifyObjects, - this.config.connectionConfig.timezone - ); - } - - escape(value) { - return mysql.escape( - value, - this.config.connectionConfig.stringifyObjects, - this.config.connectionConfig.timezone - ); - } - - escapeId(value) { - return mysql.escapeId(value, false); - } -} - -module.exports = Pool; diff --git a/node_modules/mysql2/lib/pool_cluster.js b/node_modules/mysql2/lib/pool_cluster.js deleted file mode 100644 index 92f53de..0000000 --- a/node_modules/mysql2/lib/pool_cluster.js +++ /dev/null @@ -1,283 +0,0 @@ -'use strict'; - -const process = require('process'); - -const Pool = require('./pool.js'); -const PoolConfig = require('./pool_config.js'); -const Connection = require('./connection.js'); -const EventEmitter = require('events').EventEmitter; - -/** - * Selector - */ -const makeSelector = { - RR() { - let index = 0; - return clusterIds => clusterIds[index++ % clusterIds.length]; - }, - RANDOM() { - return clusterIds => - clusterIds[Math.floor(Math.random() * clusterIds.length)]; - }, - ORDER() { - return clusterIds => clusterIds[0]; - } -}; - -class PoolNamespace { - constructor(cluster, pattern, selector) { - this._cluster = cluster; - this._pattern = pattern; - this._selector = makeSelector[selector](); - } - - getConnection(cb) { - const clusterNode = this._getClusterNode(); - if (clusterNode === null) { - return cb(new Error('Pool does Not exists.')); - } - return this._cluster._getConnection(clusterNode, (err, connection) => { - if (err) { - return cb(err); - } - if (connection === 'retry') { - return this.getConnection(cb); - } - return cb(null, connection); - }); - } - - /** - * pool cluster query - * @param {*} sql - * @param {*} values - * @param {*} cb - * @returns query - */ - query(sql, values, cb) { - const query = Connection.createQuery(sql, values, cb, {}); - this.getConnection((err, conn) => { - if (err) { - if (typeof query.onResult === 'function') { - query.onResult(err); - } else { - query.emit('error', err); - } - return; - } - try { - conn.query(query).once('end', () => { - conn.release(); - }); - } catch (e) { - conn.release(); - throw e; - } - }); - return query; - } - - /** - * pool cluster execute - * @param {*} sql - * @param {*} values - * @param {*} cb - */ - execute(sql, values, cb) { - if (typeof values === 'function') { - cb = values; - values = []; - } - this.getConnection((err, conn) => { - if (err) { - return cb(err); - } - try { - conn.execute(sql, values, cb).once('end', () => { - conn.release(); - }); - } catch (e) { - conn.release(); - throw e; - } - }); - } - - _getClusterNode() { - const foundNodeIds = this._cluster._findNodeIds(this._pattern); - if (foundNodeIds.length === 0) { - return null; - } - const nodeId = - foundNodeIds.length === 1 - ? foundNodeIds[0] - : this._selector(foundNodeIds); - return this._cluster._getNode(nodeId); - } -} - -class PoolCluster extends EventEmitter { - constructor(config) { - super(); - config = config || {}; - this._canRetry = - typeof config.canRetry === 'undefined' ? true : config.canRetry; - this._removeNodeErrorCount = config.removeNodeErrorCount || 5; - this._defaultSelector = config.defaultSelector || 'RR'; - this._closed = false; - this._lastId = 0; - this._nodes = {}; - this._serviceableNodeIds = []; - this._namespaces = {}; - this._findCaches = {}; - } - - of(pattern, selector) { - pattern = pattern || '*'; - selector = selector || this._defaultSelector; - selector = selector.toUpperCase(); - if (!makeSelector[selector] === 'undefined') { - selector = this._defaultSelector; - } - const key = pattern + selector; - if (typeof this._namespaces[key] === 'undefined') { - this._namespaces[key] = new PoolNamespace(this, pattern, selector); - } - return this._namespaces[key]; - } - - add(id, config) { - if (typeof id === 'object') { - config = id; - id = `CLUSTER::${++this._lastId}`; - } - if (typeof this._nodes[id] === 'undefined') { - this._nodes[id] = { - id: id, - errorCount: 0, - pool: new Pool({ config: new PoolConfig(config) }) - }; - this._serviceableNodeIds.push(id); - this._clearFindCaches(); - } - } - - getConnection(pattern, selector, cb) { - let namespace; - if (typeof pattern === 'function') { - cb = pattern; - namespace = this.of(); - } else { - if (typeof selector === 'function') { - cb = selector; - selector = this._defaultSelector; - } - namespace = this.of(pattern, selector); - } - namespace.getConnection(cb); - } - - end(callback) { - const cb = - callback !== undefined - ? callback - : err => { - if (err) { - throw err; - } - }; - if (this._closed) { - process.nextTick(cb); - return; - } - this._closed = true; - - let calledBack = false; - let waitingClose = 0; - const onEnd = err => { - if (!calledBack && (err || --waitingClose <= 0)) { - calledBack = true; - return cb(err); - } - }; - - for (const id in this._nodes) { - waitingClose++; - this._nodes[id].pool.end(onEnd); - } - if (waitingClose === 0) { - process.nextTick(onEnd); - } - } - - _findNodeIds(pattern) { - if (typeof this._findCaches[pattern] !== 'undefined') { - return this._findCaches[pattern]; - } - let foundNodeIds; - if (pattern === '*') { - // all - foundNodeIds = this._serviceableNodeIds; - } else if (this._serviceableNodeIds.indexOf(pattern) !== -1) { - // one - foundNodeIds = [pattern]; - } else { - // wild matching - const keyword = pattern.substring(pattern.length - 1, 0); - foundNodeIds = this._serviceableNodeIds.filter(id => - id.startsWith(keyword) - ); - } - this._findCaches[pattern] = foundNodeIds; - return foundNodeIds; - } - - _getNode(id) { - return this._nodes[id] || null; - } - - _increaseErrorCount(node) { - if (++node.errorCount >= this._removeNodeErrorCount) { - const index = this._serviceableNodeIds.indexOf(node.id); - if (index !== -1) { - this._serviceableNodeIds.splice(index, 1); - delete this._nodes[node.id]; - this._clearFindCaches(); - node.pool.end(); - this.emit('remove', node.id); - } - } - } - - _decreaseErrorCount(node) { - if (node.errorCount > 0) { - --node.errorCount; - } - } - - _getConnection(node, cb) { - node.pool.getConnection((err, connection) => { - if (err) { - this._increaseErrorCount(node); - if (this._canRetry) { - // REVIEW: this seems wrong? - this.emit('warn', err); - // eslint-disable-next-line no-console - console.warn(`[Error] PoolCluster : ${err}`); - return cb(null, 'retry'); - } - return cb(err); - } - this._decreaseErrorCount(node); - - connection._clusterId = node.id; - return cb(null, connection); - }); - } - - _clearFindCaches() { - this._findCaches = {}; - } -} - -module.exports = PoolCluster; diff --git a/node_modules/mysql2/lib/pool_config.js b/node_modules/mysql2/lib/pool_config.js deleted file mode 100644 index 0a4a260..0000000 --- a/node_modules/mysql2/lib/pool_config.js +++ /dev/null @@ -1,30 +0,0 @@ -'use strict'; - -const ConnectionConfig = require('./connection_config.js'); - -class PoolConfig { - constructor(options) { - if (typeof options === 'string') { - options = ConnectionConfig.parseUrl(options); - } - this.connectionConfig = new ConnectionConfig(options); - this.waitForConnections = - options.waitForConnections === undefined - ? true - : Boolean(options.waitForConnections); - this.connectionLimit = isNaN(options.connectionLimit) - ? 10 - : Number(options.connectionLimit); - this.maxIdle = isNaN(options.maxIdle) - ? this.connectionLimit - : Number(options.maxIdle); - this.idleTimeout = isNaN(options.idleTimeout) - ? 60000 - : Number(options.idleTimeout); - this.queueLimit = isNaN(options.queueLimit) - ? 0 - : Number(options.queueLimit); - } -} - -module.exports = PoolConfig; diff --git a/node_modules/mysql2/lib/pool_connection.js b/node_modules/mysql2/lib/pool_connection.js deleted file mode 100644 index 78aac6d..0000000 --- a/node_modules/mysql2/lib/pool_connection.js +++ /dev/null @@ -1,69 +0,0 @@ -'use strict'; - -const Connection = require('../index.js').Connection; - -class PoolConnection extends Connection { - constructor(pool, options) { - super(options); - this._pool = pool; - // The last active time of this connection - this.lastActiveTime = Date.now(); - // When a fatal error occurs the connection's protocol ends, which will cause - // the connection to end as well, thus we only need to watch for the end event - // and we will be notified of disconnects. - // REVIEW: Moved to `once` - this.once('end', () => { - this._removeFromPool(); - }); - this.once('error', () => { - this._removeFromPool(); - }); - } - - release() { - if (!this._pool || this._pool._closed) { - return; - } - // update last active time - this.lastActiveTime = Date.now(); - this._pool.releaseConnection(this); - } - - promise(promiseImpl) { - const PromisePoolConnection = require('../promise').PromisePoolConnection; - return new PromisePoolConnection(this, promiseImpl); - } - - end() { - const err = new Error( - 'Calling conn.end() to release a pooled connection is ' + - 'deprecated. In next version calling conn.end() will be ' + - 'restored to default conn.end() behavior. Use ' + - 'conn.release() instead.' - ); - this.emit('warn', err); - // eslint-disable-next-line no-console - console.warn(err.message); - this.release(); - } - - destroy() { - this._removeFromPool(); - super.destroy(); - } - - _removeFromPool() { - if (!this._pool || this._pool._closed) { - return; - } - const pool = this._pool; - this._pool = null; - pool._removeConnection(this); - } -} - -PoolConnection.statementKey = Connection.statementKey; -module.exports = PoolConnection; - -// TODO: Remove this when we are removing PoolConnection#end -PoolConnection.prototype._realEnd = Connection.prototype.end; diff --git a/node_modules/mysql2/lib/results_stream.js b/node_modules/mysql2/lib/results_stream.js deleted file mode 100644 index 66fe343..0000000 --- a/node_modules/mysql2/lib/results_stream.js +++ /dev/null @@ -1,38 +0,0 @@ -'use strict'; - -const Readable = require('stream').Readable; - -// copy-paste from https://github.com/mysqljs/mysql/blob/master/lib/protocol/sequences/Query.js -module.exports = function(command, connectionStream) { - command.stream = function(options) { - let stream; - - options = options || {}; - options.objectMode = true; - (stream = new Readable(options)), - (stream._read = function() { - connectionStream.resume(); - }); - - this.on('result', (row, i) => { - if (!stream.push(row)) { - connectionStream.pause(); - } - stream.emit('result', row, i); // replicate old emitter - }); - - this.on('error', err => { - stream.emit('error', err); // Pass on any errors - }); - - this.on('end', () => { - stream.push(null); // pushing null, indicating EOF - }); - - this.on('fields', (fields, i) => { - stream.emit('fields', fields, i); // replicate old emitter - }); - - return stream; - }; -}; diff --git a/node_modules/mysql2/lib/server.js b/node_modules/mysql2/lib/server.js deleted file mode 100644 index 4ee2d4a..0000000 --- a/node_modules/mysql2/lib/server.js +++ /dev/null @@ -1,37 +0,0 @@ -'use strict'; - -const net = require('net'); -const EventEmitter = require('events').EventEmitter; - -const Connection = require('./connection'); -const ConnectionConfig = require('./connection_config'); - -// TODO: inherit Server from net.Server -class Server extends EventEmitter { - constructor() { - super(); - this.connections = []; - this._server = net.createServer(this._handleConnection.bind(this)); - } - - _handleConnection(socket) { - const connectionConfig = new ConnectionConfig({ - stream: socket, - isServer: true - }); - const connection = new Connection({ config: connectionConfig }); - this.emit('connection', connection); - } - - listen(port) { - this._port = port; - this._server.listen.apply(this._server, arguments); - return this; - } - - close(cb) { - this._server.close(cb); - } -} - -module.exports = Server; diff --git a/node_modules/mysql2/node_modules/iconv-lite/.github/dependabot.yml b/node_modules/mysql2/node_modules/iconv-lite/.github/dependabot.yml deleted file mode 100644 index e4a0e0a..0000000 --- a/node_modules/mysql2/node_modules/iconv-lite/.github/dependabot.yml +++ /dev/null @@ -1,11 +0,0 @@ -# Please see the documentation for all configuration options: -# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates - -version: 2 -updates: - - package-ecosystem: "npm" - directory: "/" - schedule: - interval: "daily" - allow: - - dependency-type: production diff --git a/node_modules/mysql2/node_modules/iconv-lite/.idea/codeStyles/Project.xml b/node_modules/mysql2/node_modules/iconv-lite/.idea/codeStyles/Project.xml deleted file mode 100644 index 3f2688c..0000000 --- a/node_modules/mysql2/node_modules/iconv-lite/.idea/codeStyles/Project.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/node_modules/mysql2/node_modules/iconv-lite/.idea/codeStyles/codeStyleConfig.xml b/node_modules/mysql2/node_modules/iconv-lite/.idea/codeStyles/codeStyleConfig.xml deleted file mode 100644 index 79ee123..0000000 --- a/node_modules/mysql2/node_modules/iconv-lite/.idea/codeStyles/codeStyleConfig.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/node_modules/mysql2/node_modules/iconv-lite/.idea/iconv-lite.iml b/node_modules/mysql2/node_modules/iconv-lite/.idea/iconv-lite.iml deleted file mode 100644 index 0c8867d..0000000 --- a/node_modules/mysql2/node_modules/iconv-lite/.idea/iconv-lite.iml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/node_modules/mysql2/node_modules/iconv-lite/.idea/inspectionProfiles/Project_Default.xml b/node_modules/mysql2/node_modules/iconv-lite/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index 03d9549..0000000 --- a/node_modules/mysql2/node_modules/iconv-lite/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/node_modules/mysql2/node_modules/iconv-lite/.idea/modules.xml b/node_modules/mysql2/node_modules/iconv-lite/.idea/modules.xml deleted file mode 100644 index 5d24f2e..0000000 --- a/node_modules/mysql2/node_modules/iconv-lite/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/node_modules/mysql2/node_modules/iconv-lite/.idea/vcs.xml b/node_modules/mysql2/node_modules/iconv-lite/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/node_modules/mysql2/node_modules/iconv-lite/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/node_modules/mysql2/node_modules/iconv-lite/Changelog.md b/node_modules/mysql2/node_modules/iconv-lite/Changelog.md deleted file mode 100644 index 464549b..0000000 --- a/node_modules/mysql2/node_modules/iconv-lite/Changelog.md +++ /dev/null @@ -1,212 +0,0 @@ -## 0.6.3 / 2021-05-23 - * Fix HKSCS encoding to prefer Big5 codes if both Big5 and HKSCS codes are possible (#264) - - -## 0.6.2 / 2020-07-08 - * Support Uint8Array-s decoding without conversion to Buffers, plus fix an edge case. - - -## 0.6.1 / 2020-06-28 - * Support Uint8Array-s directly when decoding (#246, by @gyzerok) - * Unify package.json version ranges to be strictly semver-compatible (#241) - * Fix minor issue in UTF-32 decoder's endianness detection code. - - -## 0.6.0 / 2020-06-08 - * Updated 'gb18030' encoding to :2005 edition (see https://github.com/whatwg/encoding/issues/22). - * Removed `iconv.extendNodeEncodings()` mechanism. It was deprecated 5 years ago and didn't work - in recent Node versions. - * Reworked Streaming API behavior in browser environments to fix #204. Streaming API will be - excluded by default in browser packs, saving ~100Kb bundle size, unless enabled explicitly using - `iconv.enableStreamingAPI(require('stream'))`. - * Updates to development environment & tests: - * Added ./test/webpack private package to test complex new use cases that need custom environment. - It's tested as a separate job in Travis CI. - * Updated generation code for the new EUC-KR index file format from Encoding Standard. - * Removed Buffer() constructor in tests (#197 by @gabrielschulhof). - - -## 0.5.2 / 2020-06-08 - * Added `iconv.getEncoder()` and `iconv.getDecoder()` methods to typescript definitions (#229). - * Fixed semver version to 6.1.2 to support Node 8.x (by @tanandara). - * Capped iconv version to 2.x as 3.x has dropped support for older Node versions. - * Switched from instanbul to c8 for code coverage. - - -## 0.5.1 / 2020-01-18 - - * Added cp720 encoding (#221, by @kr-deps) - * (minor) Changed Changelog.md formatting to use h2. - - -## 0.5.0 / 2019-06-26 - - * Added UTF-32 encoding, both little-endian and big-endian variants (UTF-32LE, UTF32-BE). If endianness - is not provided for decoding, it's deduced automatically from the stream using a heuristic similar to - what we use in UTF-16. (great work in #216 by @kshetline) - * Several minor updates to README (#217 by @oldj, plus some more) - * Added Node versions 10 and 12 to Travis test harness. - - -## 0.4.24 / 2018-08-22 - - * Added MIK encoding (#196, by @Ivan-Kalatchev) - - -## 0.4.23 / 2018-05-07 - - * Fix deprecation warning in Node v10 due to the last usage of `new Buffer` (#185, by @felixbuenemann) - * Switched from NodeBuffer to Buffer in typings (#155 by @felixfbecker, #186 by @larssn) - - -## 0.4.22 / 2018-05-05 - - * Use older semver style for dependencies to be compatible with Node version 0.10 (#182, by @dougwilson) - * Fix tests to accomodate fixes in Node v10 (#182, by @dougwilson) - - -## 0.4.21 / 2018-04-06 - - * Fix encoding canonicalization (#156) - * Fix the paths in the "browser" field in package.json (#174 by @LMLB) - * Removed "contributors" section in package.json - see Git history instead. - - -## 0.4.20 / 2018-04-06 - - * Updated `new Buffer()` usages with recommended replacements as it's being deprecated in Node v10 (#176, #178 by @ChALkeR) - - -## 0.4.19 / 2017-09-09 - - * Fixed iso8859-1 codec regression in handling untranslatable characters (#162, caused by #147) - * Re-generated windows1255 codec, because it was updated in iconv project - * Fixed grammar in error message when iconv-lite is loaded with encoding other than utf8 - - -## 0.4.18 / 2017-06-13 - - * Fixed CESU-8 regression in Node v8. - - -## 0.4.17 / 2017-04-22 - - * Updated typescript definition file to support Angular 2 AoT mode (#153 by @larssn) - - -## 0.4.16 / 2017-04-22 - - * Added support for React Native (#150) - * Changed iso8859-1 encoding to usine internal 'binary' encoding, as it's the same thing (#147 by @mscdex) - * Fixed typo in Readme (#138 by @jiangzhuo) - * Fixed build for Node v6.10+ by making correct version comparison - * Added a warning if iconv-lite is loaded not as utf-8 (see #142) - - -## 0.4.15 / 2016-11-21 - - * Fixed typescript type definition (#137) - - -## 0.4.14 / 2016-11-20 - - * Preparation for v1.0 - * Added Node v6 and latest Node versions to Travis CI test rig - * Deprecated Node v0.8 support - * Typescript typings (@larssn) - * Fix encoding of Euro character in GB 18030 (inspired by @lygstate) - * Add ms prefix to dbcs windows encodings (@rokoroku) - - -## 0.4.13 / 2015-10-01 - - * Fix silly mistake in deprecation notice. - - -## 0.4.12 / 2015-09-26 - - * Node v4 support: - * Added CESU-8 decoding (#106) - * Added deprecation notice for `extendNodeEncodings` - * Added Travis tests for Node v4 and io.js latest (#105 by @Mithgol) - - -## 0.4.11 / 2015-07-03 - - * Added CESU-8 encoding. - - -## 0.4.10 / 2015-05-26 - - * Changed UTF-16 endianness heuristic to take into account any ASCII chars, not - just spaces. This should minimize the importance of "default" endianness. - - -## 0.4.9 / 2015-05-24 - - * Streamlined BOM handling: strip BOM by default, add BOM when encoding if - addBOM: true. Added docs to Readme. - * UTF16 now uses UTF16-LE by default. - * Fixed minor issue with big5 encoding. - * Added io.js testing on Travis; updated node-iconv version to test against. - Now we just skip testing SBCS encodings that node-iconv doesn't support. - * (internal refactoring) Updated codec interface to use classes. - * Use strict mode in all files. - - -## 0.4.8 / 2015-04-14 - - * added alias UNICODE-1-1-UTF-7 for UTF-7 encoding (#94) - - -## 0.4.7 / 2015-02-05 - - * stop official support of Node.js v0.8. Should still work, but no guarantees. - reason: Packages needed for testing are hard to get on Travis CI. - * work in environment where Object.prototype is monkey patched with enumerable - props (#89). - - -## 0.4.6 / 2015-01-12 - - * fix rare aliases of single-byte encodings (thanks @mscdex) - * double the timeout for dbcs tests to make them less flaky on travis - - -## 0.4.5 / 2014-11-20 - - * fix windows-31j and x-sjis encoding support (@nleush) - * minor fix: undefined variable reference when internal error happens - - -## 0.4.4 / 2014-07-16 - - * added encodings UTF-7 (RFC2152) and UTF-7-IMAP (RFC3501 Section 5.1.3) - * fixed streaming base64 encoding - - -## 0.4.3 / 2014-06-14 - - * added encodings UTF-16BE and UTF-16 with BOM - - -## 0.4.2 / 2014-06-12 - - * don't throw exception if `extendNodeEncodings()` is called more than once - - -## 0.4.1 / 2014-06-11 - - * codepage 808 added - - -## 0.4.0 / 2014-06-10 - - * code is rewritten from scratch - * all widespread encodings are supported - * streaming interface added - * browserify compatibility added - * (optional) extend core primitive encodings to make usage even simpler - * moved from vows to mocha as the testing framework - - diff --git a/node_modules/mysql2/node_modules/iconv-lite/LICENSE b/node_modules/mysql2/node_modules/iconv-lite/LICENSE deleted file mode 100644 index d518d83..0000000 --- a/node_modules/mysql2/node_modules/iconv-lite/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -Copyright (c) 2011 Alexander Shtuchkin - -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/mysql2/node_modules/iconv-lite/README.md b/node_modules/mysql2/node_modules/iconv-lite/README.md deleted file mode 100644 index 3c97f87..0000000 --- a/node_modules/mysql2/node_modules/iconv-lite/README.md +++ /dev/null @@ -1,130 +0,0 @@ -## iconv-lite: Pure JS character encoding conversion - - * No need for native code compilation. Quick to install, works on Windows and in sandboxed environments like [Cloud9](http://c9.io). - * Used in popular projects like [Express.js (body_parser)](https://github.com/expressjs/body-parser), - [Grunt](http://gruntjs.com/), [Nodemailer](http://www.nodemailer.com/), [Yeoman](http://yeoman.io/) and others. - * Faster than [node-iconv](https://github.com/bnoordhuis/node-iconv) (see below for performance comparison). - * Intuitive encode/decode API, including Streaming support. - * In-browser usage via [browserify](https://github.com/substack/node-browserify) or [webpack](https://webpack.js.org/) (~180kb gzip compressed with Buffer shim included). - * Typescript [type definition file](https://github.com/ashtuchkin/iconv-lite/blob/master/lib/index.d.ts) included. - * React Native is supported (need to install `stream` module to enable Streaming API). - * License: MIT. - -[![NPM Stats](https://nodei.co/npm/iconv-lite.png)](https://npmjs.org/package/iconv-lite/) -[![Build Status](https://travis-ci.org/ashtuchkin/iconv-lite.svg?branch=master)](https://travis-ci.org/ashtuchkin/iconv-lite) -[![npm](https://img.shields.io/npm/v/iconv-lite.svg)](https://npmjs.org/package/iconv-lite/) -[![npm downloads](https://img.shields.io/npm/dm/iconv-lite.svg)](https://npmjs.org/package/iconv-lite/) -[![npm bundle size](https://img.shields.io/bundlephobia/min/iconv-lite.svg)](https://npmjs.org/package/iconv-lite/) - -## Usage -### Basic API -```javascript -var iconv = require('iconv-lite'); - -// Convert from an encoded buffer to a js string. -str = iconv.decode(Buffer.from([0x68, 0x65, 0x6c, 0x6c, 0x6f]), 'win1251'); - -// Convert from a js string to an encoded buffer. -buf = iconv.encode("Sample input string", 'win1251'); - -// Check if encoding is supported -iconv.encodingExists("us-ascii") -``` - -### Streaming API -```javascript - -// Decode stream (from binary data stream to js strings) -http.createServer(function(req, res) { - var converterStream = iconv.decodeStream('win1251'); - req.pipe(converterStream); - - converterStream.on('data', function(str) { - console.log(str); // Do something with decoded strings, chunk-by-chunk. - }); -}); - -// Convert encoding streaming example -fs.createReadStream('file-in-win1251.txt') - .pipe(iconv.decodeStream('win1251')) - .pipe(iconv.encodeStream('ucs2')) - .pipe(fs.createWriteStream('file-in-ucs2.txt')); - -// Sugar: all encode/decode streams have .collect(cb) method to accumulate data. -http.createServer(function(req, res) { - req.pipe(iconv.decodeStream('win1251')).collect(function(err, body) { - assert(typeof body == 'string'); - console.log(body); // full request body string - }); -}); -``` - -## Supported encodings - - * All node.js native encodings: utf8, ucs2 / utf16-le, ascii, binary, base64, hex. - * Additional unicode encodings: utf16, utf16-be, utf-7, utf-7-imap, utf32, utf32-le, and utf32-be. - * All widespread singlebyte encodings: Windows 125x family, ISO-8859 family, - IBM/DOS codepages, Macintosh family, KOI8 family, all others supported by iconv library. - Aliases like 'latin1', 'us-ascii' also supported. - * All widespread multibyte encodings: CP932, CP936, CP949, CP950, GB2312, GBK, GB18030, Big5, Shift_JIS, EUC-JP. - -See [all supported encodings on wiki](https://github.com/ashtuchkin/iconv-lite/wiki/Supported-Encodings). - -Most singlebyte encodings are generated automatically from [node-iconv](https://github.com/bnoordhuis/node-iconv). Thank you Ben Noordhuis and libiconv authors! - -Multibyte encodings are generated from [Unicode.org mappings](http://www.unicode.org/Public/MAPPINGS/) and [WHATWG Encoding Standard mappings](http://encoding.spec.whatwg.org/). Thank you, respective authors! - - -## Encoding/decoding speed - -Comparison with node-iconv module (1000x256kb, on MacBook Pro, Core i5/2.6 GHz, Node v0.12.0). -Note: your results may vary, so please always check on your hardware. - - operation iconv@2.1.4 iconv-lite@0.4.7 - ---------------------------------------------------------- - encode('win1251') ~96 Mb/s ~320 Mb/s - decode('win1251') ~95 Mb/s ~246 Mb/s - -## BOM handling - - * Decoding: BOM is stripped by default, unless overridden by passing `stripBOM: false` in options - (f.ex. `iconv.decode(buf, enc, {stripBOM: false})`). - A callback might also be given as a `stripBOM` parameter - it'll be called if BOM character was actually found. - * If you want to detect UTF-8 BOM when decoding other encodings, use [node-autodetect-decoder-stream](https://github.com/danielgindi/node-autodetect-decoder-stream) module. - * Encoding: No BOM added, unless overridden by `addBOM: true` option. - -## UTF-16 Encodings - -This library supports UTF-16LE, UTF-16BE and UTF-16 encodings. First two are straightforward, but UTF-16 is trying to be -smart about endianness in the following ways: - * Decoding: uses BOM and 'spaces heuristic' to determine input endianness. Default is UTF-16LE, but can be - overridden with `defaultEncoding: 'utf-16be'` option. Strips BOM unless `stripBOM: false`. - * Encoding: uses UTF-16LE and writes BOM by default. Use `addBOM: false` to override. - -## UTF-32 Encodings - -This library supports UTF-32LE, UTF-32BE and UTF-32 encodings. Like the UTF-16 encoding above, UTF-32 defaults to UTF-32LE, but uses BOM and 'spaces heuristics' to determine input endianness. - * The default of UTF-32LE can be overridden with the `defaultEncoding: 'utf-32be'` option. Strips BOM unless `stripBOM: false`. - * Encoding: uses UTF-32LE and writes BOM by default. Use `addBOM: false` to override. (`defaultEncoding: 'utf-32be'` can also be used here to change encoding.) - -## Other notes - -When decoding, be sure to supply a Buffer to decode() method, otherwise [bad things usually happen](https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding). -Untranslatable characters are set to � or ?. No transliteration is currently supported. -Node versions 0.10.31 and 0.11.13 are buggy, don't use them (see #65, #77). - -## Testing - -```bash -$ git clone git@github.com:ashtuchkin/iconv-lite.git -$ cd iconv-lite -$ npm install -$ npm test - -$ # To view performance: -$ node test/performance.js - -$ # To view test coverage: -$ npm run coverage -$ open coverage/lcov-report/index.html -``` diff --git a/node_modules/mysql2/node_modules/iconv-lite/encodings/dbcs-codec.js b/node_modules/mysql2/node_modules/iconv-lite/encodings/dbcs-codec.js deleted file mode 100644 index fa83917..0000000 --- a/node_modules/mysql2/node_modules/iconv-lite/encodings/dbcs-codec.js +++ /dev/null @@ -1,597 +0,0 @@ -"use strict"; -var Buffer = require("safer-buffer").Buffer; - -// Multibyte codec. In this scheme, a character is represented by 1 or more bytes. -// Our codec supports UTF-16 surrogates, extensions for GB18030 and unicode sequences. -// To save memory and loading time, we read table files only when requested. - -exports._dbcs = DBCSCodec; - -var UNASSIGNED = -1, - GB18030_CODE = -2, - SEQ_START = -10, - NODE_START = -1000, - UNASSIGNED_NODE = new Array(0x100), - DEF_CHAR = -1; - -for (var i = 0; i < 0x100; i++) - UNASSIGNED_NODE[i] = UNASSIGNED; - - -// Class DBCSCodec reads and initializes mapping tables. -function DBCSCodec(codecOptions, iconv) { - this.encodingName = codecOptions.encodingName; - if (!codecOptions) - throw new Error("DBCS codec is called without the data.") - if (!codecOptions.table) - throw new Error("Encoding '" + this.encodingName + "' has no data."); - - // Load tables. - var mappingTable = codecOptions.table(); - - - // Decode tables: MBCS -> Unicode. - - // decodeTables is a trie, encoded as an array of arrays of integers. Internal arrays are trie nodes and all have len = 256. - // Trie root is decodeTables[0]. - // Values: >= 0 -> unicode character code. can be > 0xFFFF - // == UNASSIGNED -> unknown/unassigned sequence. - // == GB18030_CODE -> this is the end of a GB18030 4-byte sequence. - // <= NODE_START -> index of the next node in our trie to process next byte. - // <= SEQ_START -> index of the start of a character code sequence, in decodeTableSeq. - this.decodeTables = []; - this.decodeTables[0] = UNASSIGNED_NODE.slice(0); // Create root node. - - // Sometimes a MBCS char corresponds to a sequence of unicode chars. We store them as arrays of integers here. - this.decodeTableSeq = []; - - // Actual mapping tables consist of chunks. Use them to fill up decode tables. - for (var i = 0; i < mappingTable.length; i++) - this._addDecodeChunk(mappingTable[i]); - - // Load & create GB18030 tables when needed. - if (typeof codecOptions.gb18030 === 'function') { - this.gb18030 = codecOptions.gb18030(); // Load GB18030 ranges. - - // Add GB18030 common decode nodes. - var commonThirdByteNodeIdx = this.decodeTables.length; - this.decodeTables.push(UNASSIGNED_NODE.slice(0)); - - var commonFourthByteNodeIdx = this.decodeTables.length; - this.decodeTables.push(UNASSIGNED_NODE.slice(0)); - - // Fill out the tree - var firstByteNode = this.decodeTables[0]; - for (var i = 0x81; i <= 0xFE; i++) { - var secondByteNode = this.decodeTables[NODE_START - firstByteNode[i]]; - for (var j = 0x30; j <= 0x39; j++) { - if (secondByteNode[j] === UNASSIGNED) { - secondByteNode[j] = NODE_START - commonThirdByteNodeIdx; - } else if (secondByteNode[j] > NODE_START) { - throw new Error("gb18030 decode tables conflict at byte 2"); - } - - var thirdByteNode = this.decodeTables[NODE_START - secondByteNode[j]]; - for (var k = 0x81; k <= 0xFE; k++) { - if (thirdByteNode[k] === UNASSIGNED) { - thirdByteNode[k] = NODE_START - commonFourthByteNodeIdx; - } else if (thirdByteNode[k] === NODE_START - commonFourthByteNodeIdx) { - continue; - } else if (thirdByteNode[k] > NODE_START) { - throw new Error("gb18030 decode tables conflict at byte 3"); - } - - var fourthByteNode = this.decodeTables[NODE_START - thirdByteNode[k]]; - for (var l = 0x30; l <= 0x39; l++) { - if (fourthByteNode[l] === UNASSIGNED) - fourthByteNode[l] = GB18030_CODE; - } - } - } - } - } - - this.defaultCharUnicode = iconv.defaultCharUnicode; - - - // Encode tables: Unicode -> DBCS. - - // `encodeTable` is array mapping from unicode char to encoded char. All its values are integers for performance. - // Because it can be sparse, it is represented as array of buckets by 256 chars each. Bucket can be null. - // Values: >= 0 -> it is a normal char. Write the value (if <=256 then 1 byte, if <=65536 then 2 bytes, etc.). - // == UNASSIGNED -> no conversion found. Output a default char. - // <= SEQ_START -> it's an index in encodeTableSeq, see below. The character starts a sequence. - this.encodeTable = []; - - // `encodeTableSeq` is used when a sequence of unicode characters is encoded as a single code. We use a tree of - // objects where keys correspond to characters in sequence and leafs are the encoded dbcs values. A special DEF_CHAR key - // means end of sequence (needed when one sequence is a strict subsequence of another). - // Objects are kept separately from encodeTable to increase performance. - this.encodeTableSeq = []; - - // Some chars can be decoded, but need not be encoded. - var skipEncodeChars = {}; - if (codecOptions.encodeSkipVals) - for (var i = 0; i < codecOptions.encodeSkipVals.length; i++) { - var val = codecOptions.encodeSkipVals[i]; - if (typeof val === 'number') - skipEncodeChars[val] = true; - else - for (var j = val.from; j <= val.to; j++) - skipEncodeChars[j] = true; - } - - // Use decode trie to recursively fill out encode tables. - this._fillEncodeTable(0, 0, skipEncodeChars); - - // Add more encoding pairs when needed. - if (codecOptions.encodeAdd) { - for (var uChar in codecOptions.encodeAdd) - if (Object.prototype.hasOwnProperty.call(codecOptions.encodeAdd, uChar)) - this._setEncodeChar(uChar.charCodeAt(0), codecOptions.encodeAdd[uChar]); - } - - this.defCharSB = this.encodeTable[0][iconv.defaultCharSingleByte.charCodeAt(0)]; - if (this.defCharSB === UNASSIGNED) this.defCharSB = this.encodeTable[0]['?']; - if (this.defCharSB === UNASSIGNED) this.defCharSB = "?".charCodeAt(0); -} - -DBCSCodec.prototype.encoder = DBCSEncoder; -DBCSCodec.prototype.decoder = DBCSDecoder; - -// Decoder helpers -DBCSCodec.prototype._getDecodeTrieNode = function(addr) { - var bytes = []; - for (; addr > 0; addr >>>= 8) - bytes.push(addr & 0xFF); - if (bytes.length == 0) - bytes.push(0); - - var node = this.decodeTables[0]; - for (var i = bytes.length-1; i > 0; i--) { // Traverse nodes deeper into the trie. - var val = node[bytes[i]]; - - if (val == UNASSIGNED) { // Create new node. - node[bytes[i]] = NODE_START - this.decodeTables.length; - this.decodeTables.push(node = UNASSIGNED_NODE.slice(0)); - } - else if (val <= NODE_START) { // Existing node. - node = this.decodeTables[NODE_START - val]; - } - else - throw new Error("Overwrite byte in " + this.encodingName + ", addr: " + addr.toString(16)); - } - return node; -} - - -DBCSCodec.prototype._addDecodeChunk = function(chunk) { - // First element of chunk is the hex mbcs code where we start. - var curAddr = parseInt(chunk[0], 16); - - // Choose the decoding node where we'll write our chars. - var writeTable = this._getDecodeTrieNode(curAddr); - curAddr = curAddr & 0xFF; - - // Write all other elements of the chunk to the table. - for (var k = 1; k < chunk.length; k++) { - var part = chunk[k]; - if (typeof part === "string") { // String, write as-is. - for (var l = 0; l < part.length;) { - var code = part.charCodeAt(l++); - if (0xD800 <= code && code < 0xDC00) { // Decode surrogate - var codeTrail = part.charCodeAt(l++); - if (0xDC00 <= codeTrail && codeTrail < 0xE000) - writeTable[curAddr++] = 0x10000 + (code - 0xD800) * 0x400 + (codeTrail - 0xDC00); - else - throw new Error("Incorrect surrogate pair in " + this.encodingName + " at chunk " + chunk[0]); - } - else if (0x0FF0 < code && code <= 0x0FFF) { // Character sequence (our own encoding used) - var len = 0xFFF - code + 2; - var seq = []; - for (var m = 0; m < len; m++) - seq.push(part.charCodeAt(l++)); // Simple variation: don't support surrogates or subsequences in seq. - - writeTable[curAddr++] = SEQ_START - this.decodeTableSeq.length; - this.decodeTableSeq.push(seq); - } - else - writeTable[curAddr++] = code; // Basic char - } - } - else if (typeof part === "number") { // Integer, meaning increasing sequence starting with prev character. - var charCode = writeTable[curAddr - 1] + 1; - for (var l = 0; l < part; l++) - writeTable[curAddr++] = charCode++; - } - else - throw new Error("Incorrect type '" + typeof part + "' given in " + this.encodingName + " at chunk " + chunk[0]); - } - if (curAddr > 0xFF) - throw new Error("Incorrect chunk in " + this.encodingName + " at addr " + chunk[0] + ": too long" + curAddr); -} - -// Encoder helpers -DBCSCodec.prototype._getEncodeBucket = function(uCode) { - var high = uCode >> 8; // This could be > 0xFF because of astral characters. - if (this.encodeTable[high] === undefined) - this.encodeTable[high] = UNASSIGNED_NODE.slice(0); // Create bucket on demand. - return this.encodeTable[high]; -} - -DBCSCodec.prototype._setEncodeChar = function(uCode, dbcsCode) { - var bucket = this._getEncodeBucket(uCode); - var low = uCode & 0xFF; - if (bucket[low] <= SEQ_START) - this.encodeTableSeq[SEQ_START-bucket[low]][DEF_CHAR] = dbcsCode; // There's already a sequence, set a single-char subsequence of it. - else if (bucket[low] == UNASSIGNED) - bucket[low] = dbcsCode; -} - -DBCSCodec.prototype._setEncodeSequence = function(seq, dbcsCode) { - - // Get the root of character tree according to first character of the sequence. - var uCode = seq[0]; - var bucket = this._getEncodeBucket(uCode); - var low = uCode & 0xFF; - - var node; - if (bucket[low] <= SEQ_START) { - // There's already a sequence with - use it. - node = this.encodeTableSeq[SEQ_START-bucket[low]]; - } - else { - // There was no sequence object - allocate a new one. - node = {}; - if (bucket[low] !== UNASSIGNED) node[DEF_CHAR] = bucket[low]; // If a char was set before - make it a single-char subsequence. - bucket[low] = SEQ_START - this.encodeTableSeq.length; - this.encodeTableSeq.push(node); - } - - // Traverse the character tree, allocating new nodes as needed. - for (var j = 1; j < seq.length-1; j++) { - var oldVal = node[uCode]; - if (typeof oldVal === 'object') - node = oldVal; - else { - node = node[uCode] = {} - if (oldVal !== undefined) - node[DEF_CHAR] = oldVal - } - } - - // Set the leaf to given dbcsCode. - uCode = seq[seq.length-1]; - node[uCode] = dbcsCode; -} - -DBCSCodec.prototype._fillEncodeTable = function(nodeIdx, prefix, skipEncodeChars) { - var node = this.decodeTables[nodeIdx]; - var hasValues = false; - var subNodeEmpty = {}; - for (var i = 0; i < 0x100; i++) { - var uCode = node[i]; - var mbCode = prefix + i; - if (skipEncodeChars[mbCode]) - continue; - - if (uCode >= 0) { - this._setEncodeChar(uCode, mbCode); - hasValues = true; - } else if (uCode <= NODE_START) { - var subNodeIdx = NODE_START - uCode; - if (!subNodeEmpty[subNodeIdx]) { // Skip empty subtrees (they are too large in gb18030). - var newPrefix = (mbCode << 8) >>> 0; // NOTE: '>>> 0' keeps 32-bit num positive. - if (this._fillEncodeTable(subNodeIdx, newPrefix, skipEncodeChars)) - hasValues = true; - else - subNodeEmpty[subNodeIdx] = true; - } - } else if (uCode <= SEQ_START) { - this._setEncodeSequence(this.decodeTableSeq[SEQ_START - uCode], mbCode); - hasValues = true; - } - } - return hasValues; -} - - - -// == Encoder ================================================================== - -function DBCSEncoder(options, codec) { - // Encoder state - this.leadSurrogate = -1; - this.seqObj = undefined; - - // Static data - this.encodeTable = codec.encodeTable; - this.encodeTableSeq = codec.encodeTableSeq; - this.defaultCharSingleByte = codec.defCharSB; - this.gb18030 = codec.gb18030; -} - -DBCSEncoder.prototype.write = function(str) { - var newBuf = Buffer.alloc(str.length * (this.gb18030 ? 4 : 3)), - leadSurrogate = this.leadSurrogate, - seqObj = this.seqObj, nextChar = -1, - i = 0, j = 0; - - while (true) { - // 0. Get next character. - if (nextChar === -1) { - if (i == str.length) break; - var uCode = str.charCodeAt(i++); - } - else { - var uCode = nextChar; - nextChar = -1; - } - - // 1. Handle surrogates. - if (0xD800 <= uCode && uCode < 0xE000) { // Char is one of surrogates. - if (uCode < 0xDC00) { // We've got lead surrogate. - if (leadSurrogate === -1) { - leadSurrogate = uCode; - continue; - } else { - leadSurrogate = uCode; - // Double lead surrogate found. - uCode = UNASSIGNED; - } - } else { // We've got trail surrogate. - if (leadSurrogate !== -1) { - uCode = 0x10000 + (leadSurrogate - 0xD800) * 0x400 + (uCode - 0xDC00); - leadSurrogate = -1; - } else { - // Incomplete surrogate pair - only trail surrogate found. - uCode = UNASSIGNED; - } - - } - } - else if (leadSurrogate !== -1) { - // Incomplete surrogate pair - only lead surrogate found. - nextChar = uCode; uCode = UNASSIGNED; // Write an error, then current char. - leadSurrogate = -1; - } - - // 2. Convert uCode character. - var dbcsCode = UNASSIGNED; - if (seqObj !== undefined && uCode != UNASSIGNED) { // We are in the middle of the sequence - var resCode = seqObj[uCode]; - if (typeof resCode === 'object') { // Sequence continues. - seqObj = resCode; - continue; - - } else if (typeof resCode == 'number') { // Sequence finished. Write it. - dbcsCode = resCode; - - } else if (resCode == undefined) { // Current character is not part of the sequence. - - // Try default character for this sequence - resCode = seqObj[DEF_CHAR]; - if (resCode !== undefined) { - dbcsCode = resCode; // Found. Write it. - nextChar = uCode; // Current character will be written too in the next iteration. - - } else { - // TODO: What if we have no default? (resCode == undefined) - // Then, we should write first char of the sequence as-is and try the rest recursively. - // Didn't do it for now because no encoding has this situation yet. - // Currently, just skip the sequence and write current char. - } - } - seqObj = undefined; - } - else if (uCode >= 0) { // Regular character - var subtable = this.encodeTable[uCode >> 8]; - if (subtable !== undefined) - dbcsCode = subtable[uCode & 0xFF]; - - if (dbcsCode <= SEQ_START) { // Sequence start - seqObj = this.encodeTableSeq[SEQ_START-dbcsCode]; - continue; - } - - if (dbcsCode == UNASSIGNED && this.gb18030) { - // Use GB18030 algorithm to find character(s) to write. - var idx = findIdx(this.gb18030.uChars, uCode); - if (idx != -1) { - var dbcsCode = this.gb18030.gbChars[idx] + (uCode - this.gb18030.uChars[idx]); - newBuf[j++] = 0x81 + Math.floor(dbcsCode / 12600); dbcsCode = dbcsCode % 12600; - newBuf[j++] = 0x30 + Math.floor(dbcsCode / 1260); dbcsCode = dbcsCode % 1260; - newBuf[j++] = 0x81 + Math.floor(dbcsCode / 10); dbcsCode = dbcsCode % 10; - newBuf[j++] = 0x30 + dbcsCode; - continue; - } - } - } - - // 3. Write dbcsCode character. - if (dbcsCode === UNASSIGNED) - dbcsCode = this.defaultCharSingleByte; - - if (dbcsCode < 0x100) { - newBuf[j++] = dbcsCode; - } - else if (dbcsCode < 0x10000) { - newBuf[j++] = dbcsCode >> 8; // high byte - newBuf[j++] = dbcsCode & 0xFF; // low byte - } - else if (dbcsCode < 0x1000000) { - newBuf[j++] = dbcsCode >> 16; - newBuf[j++] = (dbcsCode >> 8) & 0xFF; - newBuf[j++] = dbcsCode & 0xFF; - } else { - newBuf[j++] = dbcsCode >>> 24; - newBuf[j++] = (dbcsCode >>> 16) & 0xFF; - newBuf[j++] = (dbcsCode >>> 8) & 0xFF; - newBuf[j++] = dbcsCode & 0xFF; - } - } - - this.seqObj = seqObj; - this.leadSurrogate = leadSurrogate; - return newBuf.slice(0, j); -} - -DBCSEncoder.prototype.end = function() { - if (this.leadSurrogate === -1 && this.seqObj === undefined) - return; // All clean. Most often case. - - var newBuf = Buffer.alloc(10), j = 0; - - if (this.seqObj) { // We're in the sequence. - var dbcsCode = this.seqObj[DEF_CHAR]; - if (dbcsCode !== undefined) { // Write beginning of the sequence. - if (dbcsCode < 0x100) { - newBuf[j++] = dbcsCode; - } - else { - newBuf[j++] = dbcsCode >> 8; // high byte - newBuf[j++] = dbcsCode & 0xFF; // low byte - } - } else { - // See todo above. - } - this.seqObj = undefined; - } - - if (this.leadSurrogate !== -1) { - // Incomplete surrogate pair - only lead surrogate found. - newBuf[j++] = this.defaultCharSingleByte; - this.leadSurrogate = -1; - } - - return newBuf.slice(0, j); -} - -// Export for testing -DBCSEncoder.prototype.findIdx = findIdx; - - -// == Decoder ================================================================== - -function DBCSDecoder(options, codec) { - // Decoder state - this.nodeIdx = 0; - this.prevBytes = []; - - // Static data - this.decodeTables = codec.decodeTables; - this.decodeTableSeq = codec.decodeTableSeq; - this.defaultCharUnicode = codec.defaultCharUnicode; - this.gb18030 = codec.gb18030; -} - -DBCSDecoder.prototype.write = function(buf) { - var newBuf = Buffer.alloc(buf.length*2), - nodeIdx = this.nodeIdx, - prevBytes = this.prevBytes, prevOffset = this.prevBytes.length, - seqStart = -this.prevBytes.length, // idx of the start of current parsed sequence. - uCode; - - for (var i = 0, j = 0; i < buf.length; i++) { - var curByte = (i >= 0) ? buf[i] : prevBytes[i + prevOffset]; - - // Lookup in current trie node. - var uCode = this.decodeTables[nodeIdx][curByte]; - - if (uCode >= 0) { - // Normal character, just use it. - } - else if (uCode === UNASSIGNED) { // Unknown char. - // TODO: Callback with seq. - uCode = this.defaultCharUnicode.charCodeAt(0); - i = seqStart; // Skip one byte ('i' will be incremented by the for loop) and try to parse again. - } - else if (uCode === GB18030_CODE) { - if (i >= 3) { - var ptr = (buf[i-3]-0x81)*12600 + (buf[i-2]-0x30)*1260 + (buf[i-1]-0x81)*10 + (curByte-0x30); - } else { - var ptr = (prevBytes[i-3+prevOffset]-0x81)*12600 + - (((i-2 >= 0) ? buf[i-2] : prevBytes[i-2+prevOffset])-0x30)*1260 + - (((i-1 >= 0) ? buf[i-1] : prevBytes[i-1+prevOffset])-0x81)*10 + - (curByte-0x30); - } - var idx = findIdx(this.gb18030.gbChars, ptr); - uCode = this.gb18030.uChars[idx] + ptr - this.gb18030.gbChars[idx]; - } - else if (uCode <= NODE_START) { // Go to next trie node. - nodeIdx = NODE_START - uCode; - continue; - } - else if (uCode <= SEQ_START) { // Output a sequence of chars. - var seq = this.decodeTableSeq[SEQ_START - uCode]; - for (var k = 0; k < seq.length - 1; k++) { - uCode = seq[k]; - newBuf[j++] = uCode & 0xFF; - newBuf[j++] = uCode >> 8; - } - uCode = seq[seq.length-1]; - } - else - throw new Error("iconv-lite internal error: invalid decoding table value " + uCode + " at " + nodeIdx + "/" + curByte); - - // Write the character to buffer, handling higher planes using surrogate pair. - if (uCode >= 0x10000) { - uCode -= 0x10000; - var uCodeLead = 0xD800 | (uCode >> 10); - newBuf[j++] = uCodeLead & 0xFF; - newBuf[j++] = uCodeLead >> 8; - - uCode = 0xDC00 | (uCode & 0x3FF); - } - newBuf[j++] = uCode & 0xFF; - newBuf[j++] = uCode >> 8; - - // Reset trie node. - nodeIdx = 0; seqStart = i+1; - } - - this.nodeIdx = nodeIdx; - this.prevBytes = (seqStart >= 0) - ? Array.prototype.slice.call(buf, seqStart) - : prevBytes.slice(seqStart + prevOffset).concat(Array.prototype.slice.call(buf)); - - return newBuf.slice(0, j).toString('ucs2'); -} - -DBCSDecoder.prototype.end = function() { - var ret = ''; - - // Try to parse all remaining chars. - while (this.prevBytes.length > 0) { - // Skip 1 character in the buffer. - ret += this.defaultCharUnicode; - var bytesArr = this.prevBytes.slice(1); - - // Parse remaining as usual. - this.prevBytes = []; - this.nodeIdx = 0; - if (bytesArr.length > 0) - ret += this.write(bytesArr); - } - - this.prevBytes = []; - this.nodeIdx = 0; - return ret; -} - -// Binary search for GB18030. Returns largest i such that table[i] <= val. -function findIdx(table, val) { - if (table[0] > val) - return -1; - - var l = 0, r = table.length; - while (l < r-1) { // always table[l] <= val < table[r] - var mid = l + ((r-l+1) >> 1); - if (table[mid] <= val) - l = mid; - else - r = mid; - } - return l; -} - diff --git a/node_modules/mysql2/node_modules/iconv-lite/encodings/dbcs-data.js b/node_modules/mysql2/node_modules/iconv-lite/encodings/dbcs-data.js deleted file mode 100644 index 0d17e58..0000000 --- a/node_modules/mysql2/node_modules/iconv-lite/encodings/dbcs-data.js +++ /dev/null @@ -1,188 +0,0 @@ -"use strict"; - -// Description of supported double byte encodings and aliases. -// Tables are not require()-d until they are needed to speed up library load. -// require()-s are direct to support Browserify. - -module.exports = { - - // == Japanese/ShiftJIS ==================================================== - // All japanese encodings are based on JIS X set of standards: - // JIS X 0201 - Single-byte encoding of ASCII + ¥ + Kana chars at 0xA1-0xDF. - // JIS X 0208 - Main set of 6879 characters, placed in 94x94 plane, to be encoded by 2 bytes. - // Has several variations in 1978, 1983, 1990 and 1997. - // JIS X 0212 - Supplementary plane of 6067 chars in 94x94 plane. 1990. Effectively dead. - // JIS X 0213 - Extension and modern replacement of 0208 and 0212. Total chars: 11233. - // 2 planes, first is superset of 0208, second - revised 0212. - // Introduced in 2000, revised 2004. Some characters are in Unicode Plane 2 (0x2xxxx) - - // Byte encodings are: - // * Shift_JIS: Compatible with 0201, uses not defined chars in top half as lead bytes for double-byte - // encoding of 0208. Lead byte ranges: 0x81-0x9F, 0xE0-0xEF; Trail byte ranges: 0x40-0x7E, 0x80-0x9E, 0x9F-0xFC. - // Windows CP932 is a superset of Shift_JIS. Some companies added more chars, notably KDDI. - // * EUC-JP: Up to 3 bytes per character. Used mostly on *nixes. - // 0x00-0x7F - lower part of 0201 - // 0x8E, 0xA1-0xDF - upper part of 0201 - // (0xA1-0xFE)x2 - 0208 plane (94x94). - // 0x8F, (0xA1-0xFE)x2 - 0212 plane (94x94). - // * JIS X 208: 7-bit, direct encoding of 0208. Byte ranges: 0x21-0x7E (94 values). Uncommon. - // Used as-is in ISO2022 family. - // * ISO2022-JP: Stateful encoding, with escape sequences to switch between ASCII, - // 0201-1976 Roman, 0208-1978, 0208-1983. - // * ISO2022-JP-1: Adds esc seq for 0212-1990. - // * ISO2022-JP-2: Adds esc seq for GB2313-1980, KSX1001-1992, ISO8859-1, ISO8859-7. - // * ISO2022-JP-3: Adds esc seq for 0201-1976 Kana set, 0213-2000 Planes 1, 2. - // * ISO2022-JP-2004: Adds 0213-2004 Plane 1. - // - // After JIS X 0213 appeared, Shift_JIS-2004, EUC-JISX0213 and ISO2022-JP-2004 followed, with just changing the planes. - // - // Overall, it seems that it's a mess :( http://www8.plala.or.jp/tkubota1/unicode-symbols-map2.html - - 'shiftjis': { - type: '_dbcs', - table: function() { return require('./tables/shiftjis.json') }, - encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E}, - encodeSkipVals: [{from: 0xED40, to: 0xF940}], - }, - 'csshiftjis': 'shiftjis', - 'mskanji': 'shiftjis', - 'sjis': 'shiftjis', - 'windows31j': 'shiftjis', - 'ms31j': 'shiftjis', - 'xsjis': 'shiftjis', - 'windows932': 'shiftjis', - 'ms932': 'shiftjis', - '932': 'shiftjis', - 'cp932': 'shiftjis', - - 'eucjp': { - type: '_dbcs', - table: function() { return require('./tables/eucjp.json') }, - encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E}, - }, - - // TODO: KDDI extension to Shift_JIS - // TODO: IBM CCSID 942 = CP932, but F0-F9 custom chars and other char changes. - // TODO: IBM CCSID 943 = Shift_JIS = CP932 with original Shift_JIS lower 128 chars. - - - // == Chinese/GBK ========================================================== - // http://en.wikipedia.org/wiki/GBK - // We mostly implement W3C recommendation: https://www.w3.org/TR/encoding/#gbk-encoder - - // Oldest GB2312 (1981, ~7600 chars) is a subset of CP936 - 'gb2312': 'cp936', - 'gb231280': 'cp936', - 'gb23121980': 'cp936', - 'csgb2312': 'cp936', - 'csiso58gb231280': 'cp936', - 'euccn': 'cp936', - - // Microsoft's CP936 is a subset and approximation of GBK. - 'windows936': 'cp936', - 'ms936': 'cp936', - '936': 'cp936', - 'cp936': { - type: '_dbcs', - table: function() { return require('./tables/cp936.json') }, - }, - - // GBK (~22000 chars) is an extension of CP936 that added user-mapped chars and some other. - 'gbk': { - type: '_dbcs', - table: function() { return require('./tables/cp936.json').concat(require('./tables/gbk-added.json')) }, - }, - 'xgbk': 'gbk', - 'isoir58': 'gbk', - - // GB18030 is an algorithmic extension of GBK. - // Main source: https://www.w3.org/TR/encoding/#gbk-encoder - // http://icu-project.org/docs/papers/gb18030.html - // http://source.icu-project.org/repos/icu/data/trunk/charset/data/xml/gb-18030-2000.xml - // http://www.khngai.com/chinese/charmap/tblgbk.php?page=0 - 'gb18030': { - type: '_dbcs', - table: function() { return require('./tables/cp936.json').concat(require('./tables/gbk-added.json')) }, - gb18030: function() { return require('./tables/gb18030-ranges.json') }, - encodeSkipVals: [0x80], - encodeAdd: {'€': 0xA2E3}, - }, - - 'chinese': 'gb18030', - - - // == Korean =============================================================== - // EUC-KR, KS_C_5601 and KS X 1001 are exactly the same. - 'windows949': 'cp949', - 'ms949': 'cp949', - '949': 'cp949', - 'cp949': { - type: '_dbcs', - table: function() { return require('./tables/cp949.json') }, - }, - - 'cseuckr': 'cp949', - 'csksc56011987': 'cp949', - 'euckr': 'cp949', - 'isoir149': 'cp949', - 'korean': 'cp949', - 'ksc56011987': 'cp949', - 'ksc56011989': 'cp949', - 'ksc5601': 'cp949', - - - // == Big5/Taiwan/Hong Kong ================================================ - // There are lots of tables for Big5 and cp950. Please see the following links for history: - // http://moztw.org/docs/big5/ http://www.haible.de/bruno/charsets/conversion-tables/Big5.html - // Variations, in roughly number of defined chars: - // * Windows CP 950: Microsoft variant of Big5. Canonical: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT - // * Windows CP 951: Microsoft variant of Big5-HKSCS-2001. Seems to be never public. http://me.abelcheung.org/articles/research/what-is-cp951/ - // * Big5-2003 (Taiwan standard) almost superset of cp950. - // * Unicode-at-on (UAO) / Mozilla 1.8. Falling out of use on the Web. Not supported by other browsers. - // * Big5-HKSCS (-2001, -2004, -2008). Hong Kong standard. - // many unicode code points moved from PUA to Supplementary plane (U+2XXXX) over the years. - // Plus, it has 4 combining sequences. - // Seems that Mozilla refused to support it for 10 yrs. https://bugzilla.mozilla.org/show_bug.cgi?id=162431 https://bugzilla.mozilla.org/show_bug.cgi?id=310299 - // because big5-hkscs is the only encoding to include astral characters in non-algorithmic way. - // Implementations are not consistent within browsers; sometimes labeled as just big5. - // MS Internet Explorer switches from big5 to big5-hkscs when a patch applied. - // Great discussion & recap of what's going on https://bugzilla.mozilla.org/show_bug.cgi?id=912470#c31 - // In the encoder, it might make sense to support encoding old PUA mappings to Big5 bytes seq-s. - // Official spec: http://www.ogcio.gov.hk/en/business/tech_promotion/ccli/terms/doc/2003cmp_2008.txt - // http://www.ogcio.gov.hk/tc/business/tech_promotion/ccli/terms/doc/hkscs-2008-big5-iso.txt - // - // Current understanding of how to deal with Big5(-HKSCS) is in the Encoding Standard, http://encoding.spec.whatwg.org/#big5-encoder - // Unicode mapping (http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT) is said to be wrong. - - 'windows950': 'cp950', - 'ms950': 'cp950', - '950': 'cp950', - 'cp950': { - type: '_dbcs', - table: function() { return require('./tables/cp950.json') }, - }, - - // Big5 has many variations and is an extension of cp950. We use Encoding Standard's as a consensus. - 'big5': 'big5hkscs', - 'big5hkscs': { - type: '_dbcs', - table: function() { return require('./tables/cp950.json').concat(require('./tables/big5-added.json')) }, - encodeSkipVals: [ - // Although Encoding Standard says we should avoid encoding to HKSCS area (See Step 1 of - // https://encoding.spec.whatwg.org/#index-big5-pointer), we still do it to increase compatibility with ICU. - // But if a single unicode point can be encoded both as HKSCS and regular Big5, we prefer the latter. - 0x8e69, 0x8e6f, 0x8e7e, 0x8eab, 0x8eb4, 0x8ecd, 0x8ed0, 0x8f57, 0x8f69, 0x8f6e, 0x8fcb, 0x8ffe, - 0x906d, 0x907a, 0x90c4, 0x90dc, 0x90f1, 0x91bf, 0x92af, 0x92b0, 0x92b1, 0x92b2, 0x92d1, 0x9447, 0x94ca, - 0x95d9, 0x96fc, 0x9975, 0x9b76, 0x9b78, 0x9b7b, 0x9bc6, 0x9bde, 0x9bec, 0x9bf6, 0x9c42, 0x9c53, 0x9c62, - 0x9c68, 0x9c6b, 0x9c77, 0x9cbc, 0x9cbd, 0x9cd0, 0x9d57, 0x9d5a, 0x9dc4, 0x9def, 0x9dfb, 0x9ea9, 0x9eef, - 0x9efd, 0x9f60, 0x9fcb, 0xa077, 0xa0dc, 0xa0df, 0x8fcc, 0x92c8, 0x9644, 0x96ed, - - // Step 2 of https://encoding.spec.whatwg.org/#index-big5-pointer: Use last pointer for U+2550, U+255E, U+2561, U+256A, U+5341, or U+5345 - 0xa2a4, 0xa2a5, 0xa2a7, 0xa2a6, 0xa2cc, 0xa2ce, - ], - }, - - 'cnbig5': 'big5hkscs', - 'csbig5': 'big5hkscs', - 'xxbig5': 'big5hkscs', -}; diff --git a/node_modules/mysql2/node_modules/iconv-lite/encodings/index.js b/node_modules/mysql2/node_modules/iconv-lite/encodings/index.js deleted file mode 100644 index d95c244..0000000 --- a/node_modules/mysql2/node_modules/iconv-lite/encodings/index.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; - -// Update this array if you add/rename/remove files in this directory. -// We support Browserify by skipping automatic module discovery and requiring modules directly. -var modules = [ - require("./internal"), - require("./utf32"), - require("./utf16"), - require("./utf7"), - require("./sbcs-codec"), - require("./sbcs-data"), - require("./sbcs-data-generated"), - require("./dbcs-codec"), - require("./dbcs-data"), -]; - -// Put all encoding/alias/codec definitions to single object and export it. -for (var i = 0; i < modules.length; i++) { - var module = modules[i]; - for (var enc in module) - if (Object.prototype.hasOwnProperty.call(module, enc)) - exports[enc] = module[enc]; -} diff --git a/node_modules/mysql2/node_modules/iconv-lite/encodings/internal.js b/node_modules/mysql2/node_modules/iconv-lite/encodings/internal.js deleted file mode 100644 index dc1074f..0000000 --- a/node_modules/mysql2/node_modules/iconv-lite/encodings/internal.js +++ /dev/null @@ -1,198 +0,0 @@ -"use strict"; -var Buffer = require("safer-buffer").Buffer; - -// Export Node.js internal encodings. - -module.exports = { - // Encodings - utf8: { type: "_internal", bomAware: true}, - cesu8: { type: "_internal", bomAware: true}, - unicode11utf8: "utf8", - - ucs2: { type: "_internal", bomAware: true}, - utf16le: "ucs2", - - binary: { type: "_internal" }, - base64: { type: "_internal" }, - hex: { type: "_internal" }, - - // Codec. - _internal: InternalCodec, -}; - -//------------------------------------------------------------------------------ - -function InternalCodec(codecOptions, iconv) { - this.enc = codecOptions.encodingName; - this.bomAware = codecOptions.bomAware; - - if (this.enc === "base64") - this.encoder = InternalEncoderBase64; - else if (this.enc === "cesu8") { - this.enc = "utf8"; // Use utf8 for decoding. - this.encoder = InternalEncoderCesu8; - - // Add decoder for versions of Node not supporting CESU-8 - if (Buffer.from('eda0bdedb2a9', 'hex').toString() !== '💩') { - this.decoder = InternalDecoderCesu8; - this.defaultCharUnicode = iconv.defaultCharUnicode; - } - } -} - -InternalCodec.prototype.encoder = InternalEncoder; -InternalCodec.prototype.decoder = InternalDecoder; - -//------------------------------------------------------------------------------ - -// We use node.js internal decoder. Its signature is the same as ours. -var StringDecoder = require('string_decoder').StringDecoder; - -if (!StringDecoder.prototype.end) // Node v0.8 doesn't have this method. - StringDecoder.prototype.end = function() {}; - - -function InternalDecoder(options, codec) { - this.decoder = new StringDecoder(codec.enc); -} - -InternalDecoder.prototype.write = function(buf) { - if (!Buffer.isBuffer(buf)) { - buf = Buffer.from(buf); - } - - return this.decoder.write(buf); -} - -InternalDecoder.prototype.end = function() { - return this.decoder.end(); -} - - -//------------------------------------------------------------------------------ -// Encoder is mostly trivial - -function InternalEncoder(options, codec) { - this.enc = codec.enc; -} - -InternalEncoder.prototype.write = function(str) { - return Buffer.from(str, this.enc); -} - -InternalEncoder.prototype.end = function() { -} - - -//------------------------------------------------------------------------------ -// Except base64 encoder, which must keep its state. - -function InternalEncoderBase64(options, codec) { - this.prevStr = ''; -} - -InternalEncoderBase64.prototype.write = function(str) { - str = this.prevStr + str; - var completeQuads = str.length - (str.length % 4); - this.prevStr = str.slice(completeQuads); - str = str.slice(0, completeQuads); - - return Buffer.from(str, "base64"); -} - -InternalEncoderBase64.prototype.end = function() { - return Buffer.from(this.prevStr, "base64"); -} - - -//------------------------------------------------------------------------------ -// CESU-8 encoder is also special. - -function InternalEncoderCesu8(options, codec) { -} - -InternalEncoderCesu8.prototype.write = function(str) { - var buf = Buffer.alloc(str.length * 3), bufIdx = 0; - for (var i = 0; i < str.length; i++) { - var charCode = str.charCodeAt(i); - // Naive implementation, but it works because CESU-8 is especially easy - // to convert from UTF-16 (which all JS strings are encoded in). - if (charCode < 0x80) - buf[bufIdx++] = charCode; - else if (charCode < 0x800) { - buf[bufIdx++] = 0xC0 + (charCode >>> 6); - buf[bufIdx++] = 0x80 + (charCode & 0x3f); - } - else { // charCode will always be < 0x10000 in javascript. - buf[bufIdx++] = 0xE0 + (charCode >>> 12); - buf[bufIdx++] = 0x80 + ((charCode >>> 6) & 0x3f); - buf[bufIdx++] = 0x80 + (charCode & 0x3f); - } - } - return buf.slice(0, bufIdx); -} - -InternalEncoderCesu8.prototype.end = function() { -} - -//------------------------------------------------------------------------------ -// CESU-8 decoder is not implemented in Node v4.0+ - -function InternalDecoderCesu8(options, codec) { - this.acc = 0; - this.contBytes = 0; - this.accBytes = 0; - this.defaultCharUnicode = codec.defaultCharUnicode; -} - -InternalDecoderCesu8.prototype.write = function(buf) { - var acc = this.acc, contBytes = this.contBytes, accBytes = this.accBytes, - res = ''; - for (var i = 0; i < buf.length; i++) { - var curByte = buf[i]; - if ((curByte & 0xC0) !== 0x80) { // Leading byte - if (contBytes > 0) { // Previous code is invalid - res += this.defaultCharUnicode; - contBytes = 0; - } - - if (curByte < 0x80) { // Single-byte code - res += String.fromCharCode(curByte); - } else if (curByte < 0xE0) { // Two-byte code - acc = curByte & 0x1F; - contBytes = 1; accBytes = 1; - } else if (curByte < 0xF0) { // Three-byte code - acc = curByte & 0x0F; - contBytes = 2; accBytes = 1; - } else { // Four or more are not supported for CESU-8. - res += this.defaultCharUnicode; - } - } else { // Continuation byte - if (contBytes > 0) { // We're waiting for it. - acc = (acc << 6) | (curByte & 0x3f); - contBytes--; accBytes++; - if (contBytes === 0) { - // Check for overlong encoding, but support Modified UTF-8 (encoding NULL as C0 80) - if (accBytes === 2 && acc < 0x80 && acc > 0) - res += this.defaultCharUnicode; - else if (accBytes === 3 && acc < 0x800) - res += this.defaultCharUnicode; - else - // Actually add character. - res += String.fromCharCode(acc); - } - } else { // Unexpected continuation byte - res += this.defaultCharUnicode; - } - } - } - this.acc = acc; this.contBytes = contBytes; this.accBytes = accBytes; - return res; -} - -InternalDecoderCesu8.prototype.end = function() { - var res = 0; - if (this.contBytes > 0) - res += this.defaultCharUnicode; - return res; -} diff --git a/node_modules/mysql2/node_modules/iconv-lite/encodings/sbcs-codec.js b/node_modules/mysql2/node_modules/iconv-lite/encodings/sbcs-codec.js deleted file mode 100644 index abac5ff..0000000 --- a/node_modules/mysql2/node_modules/iconv-lite/encodings/sbcs-codec.js +++ /dev/null @@ -1,72 +0,0 @@ -"use strict"; -var Buffer = require("safer-buffer").Buffer; - -// Single-byte codec. Needs a 'chars' string parameter that contains 256 or 128 chars that -// correspond to encoded bytes (if 128 - then lower half is ASCII). - -exports._sbcs = SBCSCodec; -function SBCSCodec(codecOptions, iconv) { - if (!codecOptions) - throw new Error("SBCS codec is called without the data.") - - // Prepare char buffer for decoding. - if (!codecOptions.chars || (codecOptions.chars.length !== 128 && codecOptions.chars.length !== 256)) - throw new Error("Encoding '"+codecOptions.type+"' has incorrect 'chars' (must be of len 128 or 256)"); - - if (codecOptions.chars.length === 128) { - var asciiString = ""; - for (var i = 0; i < 128; i++) - asciiString += String.fromCharCode(i); - codecOptions.chars = asciiString + codecOptions.chars; - } - - this.decodeBuf = Buffer.from(codecOptions.chars, 'ucs2'); - - // Encoding buffer. - var encodeBuf = Buffer.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0)); - - for (var i = 0; i < codecOptions.chars.length; i++) - encodeBuf[codecOptions.chars.charCodeAt(i)] = i; - - this.encodeBuf = encodeBuf; -} - -SBCSCodec.prototype.encoder = SBCSEncoder; -SBCSCodec.prototype.decoder = SBCSDecoder; - - -function SBCSEncoder(options, codec) { - this.encodeBuf = codec.encodeBuf; -} - -SBCSEncoder.prototype.write = function(str) { - var buf = Buffer.alloc(str.length); - for (var i = 0; i < str.length; i++) - buf[i] = this.encodeBuf[str.charCodeAt(i)]; - - return buf; -} - -SBCSEncoder.prototype.end = function() { -} - - -function SBCSDecoder(options, codec) { - this.decodeBuf = codec.decodeBuf; -} - -SBCSDecoder.prototype.write = function(buf) { - // Strings are immutable in JS -> we use ucs2 buffer to speed up computations. - var decodeBuf = this.decodeBuf; - var newBuf = Buffer.alloc(buf.length*2); - var idx1 = 0, idx2 = 0; - for (var i = 0; i < buf.length; i++) { - idx1 = buf[i]*2; idx2 = i*2; - newBuf[idx2] = decodeBuf[idx1]; - newBuf[idx2+1] = decodeBuf[idx1+1]; - } - return newBuf.toString('ucs2'); -} - -SBCSDecoder.prototype.end = function() { -} diff --git a/node_modules/mysql2/node_modules/iconv-lite/encodings/sbcs-data-generated.js b/node_modules/mysql2/node_modules/iconv-lite/encodings/sbcs-data-generated.js deleted file mode 100644 index 9b48236..0000000 --- a/node_modules/mysql2/node_modules/iconv-lite/encodings/sbcs-data-generated.js +++ /dev/null @@ -1,451 +0,0 @@ -"use strict"; - -// Generated data for sbcs codec. Don't edit manually. Regenerate using generation/gen-sbcs.js script. -module.exports = { - "437": "cp437", - "737": "cp737", - "775": "cp775", - "850": "cp850", - "852": "cp852", - "855": "cp855", - "856": "cp856", - "857": "cp857", - "858": "cp858", - "860": "cp860", - "861": "cp861", - "862": "cp862", - "863": "cp863", - "864": "cp864", - "865": "cp865", - "866": "cp866", - "869": "cp869", - "874": "windows874", - "922": "cp922", - "1046": "cp1046", - "1124": "cp1124", - "1125": "cp1125", - "1129": "cp1129", - "1133": "cp1133", - "1161": "cp1161", - "1162": "cp1162", - "1163": "cp1163", - "1250": "windows1250", - "1251": "windows1251", - "1252": "windows1252", - "1253": "windows1253", - "1254": "windows1254", - "1255": "windows1255", - "1256": "windows1256", - "1257": "windows1257", - "1258": "windows1258", - "28591": "iso88591", - "28592": "iso88592", - "28593": "iso88593", - "28594": "iso88594", - "28595": "iso88595", - "28596": "iso88596", - "28597": "iso88597", - "28598": "iso88598", - "28599": "iso88599", - "28600": "iso885910", - "28601": "iso885911", - "28603": "iso885913", - "28604": "iso885914", - "28605": "iso885915", - "28606": "iso885916", - "windows874": { - "type": "_sbcs", - "chars": "€����…�����������‘’“”•–—�������� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" - }, - "win874": "windows874", - "cp874": "windows874", - "windows1250": { - "type": "_sbcs", - "chars": "€�‚�„…†‡�‰Š‹ŚŤŽŹ�‘’“”•–—�™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬­®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" - }, - "win1250": "windows1250", - "cp1250": "windows1250", - "windows1251": { - "type": "_sbcs", - "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—�™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬­®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" - }, - "win1251": "windows1251", - "cp1251": "windows1251", - "windows1252": { - "type": "_sbcs", - "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" - }, - "win1252": "windows1252", - "cp1252": "windows1252", - "windows1253": { - "type": "_sbcs", - "chars": "€�‚ƒ„…†‡�‰�‹�����‘’“”•–—�™�›���� ΅Ά£¤¥¦§¨©�«¬­®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" - }, - "win1253": "windows1253", - "cp1253": "windows1253", - "windows1254": { - "type": "_sbcs", - "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ����‘’“”•–—˜™š›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" - }, - "win1254": "windows1254", - "cp1254": "windows1254", - "windows1255": { - "type": "_sbcs", - "chars": "€�‚ƒ„…†‡ˆ‰�‹�����‘’“”•–—˜™�›���� ¡¢£₪¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹֺֻּֽ־ֿ׀ׁׂ׃װױײ׳״�������אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" - }, - "win1255": "windows1255", - "cp1255": "windows1255", - "windows1256": { - "type": "_sbcs", - "chars": "€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ‌‍ں ،¢£¤¥¦§¨©ھ«¬­®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûü‎‏ے" - }, - "win1256": "windows1256", - "cp1256": "windows1256", - "windows1257": { - "type": "_sbcs", - "chars": "€�‚�„…†‡�‰�‹�¨ˇ¸�‘’“”•–—�™�›�¯˛� �¢£¤�¦§Ø©Ŗ«¬­®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙" - }, - "win1257": "windows1257", - "cp1257": "windows1257", - "windows1258": { - "type": "_sbcs", - "chars": "€�‚ƒ„…†‡ˆ‰�‹Œ����‘’“”•–—˜™�›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" - }, - "win1258": "windows1258", - "cp1258": "windows1258", - "iso88591": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" - }, - "cp28591": "iso88591", - "iso88592": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" - }, - "cp28592": "iso88592", - "iso88593": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ħ˘£¤�Ĥ§¨İŞĞĴ­�ݰħ²³´µĥ·¸ışğĵ½�żÀÁÂ�ÄĊĈÇÈÉÊËÌÍÎÏ�ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ�äċĉçèéêëìíîï�ñòóôġö÷ĝùúûüŭŝ˙" - }, - "cp28593": "iso88593", - "iso88594": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĸŖ¤Ĩϧ¨ŠĒĢŦ­Ž¯°ą˛ŗ´ĩšēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖרŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙" - }, - "cp28594": "iso88594", - "iso88595": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ" - }, - "cp28595": "iso88595", - "iso88596": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ���¤�������،­�������������؛���؟�ءآأؤإئابةتثجحخدذرزسشصضطظعغ�����ـفقكلمنهوىيًٌٍَُِّْ�������������" - }, - "cp28596": "iso88596", - "iso88597": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ‘’£€₯¦§¨©ͺ«¬­�―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" - }, - "cp28597": "iso88597", - "iso88598": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �¢£¤¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾��������������������������������‗אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" - }, - "cp28598": "iso88598", - "iso88599": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" - }, - "cp28599": "iso88599", - "iso885910": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĒĢĪĨͧĻĐŠŦŽ­ŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ" - }, - "cp28600": "iso885910", - "iso885911": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" - }, - "cp28601": "iso885911", - "iso885913": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’" - }, - "cp28603": "iso885913", - "iso885914": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ­®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ" - }, - "cp28604": "iso885914", - "iso885915": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥Š§š©ª«¬­®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" - }, - "cp28605": "iso885915", - "iso885916": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄąŁ€„Чš©Ș«Ź­źŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ" - }, - "cp28606": "iso885916", - "cp437": { - "type": "_sbcs", - "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " - }, - "ibm437": "cp437", - "csibm437": "cp437", - "cp737": { - "type": "_sbcs", - "chars": "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ " - }, - "ibm737": "cp737", - "csibm737": "cp737", - "cp775": { - "type": "_sbcs", - "chars": "ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£Ø×¤ĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’­±“¾¶§÷„°∙·¹³²■ " - }, - "ibm775": "cp775", - "csibm775": "cp775", - "cp850": { - "type": "_sbcs", - "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " - }, - "ibm850": "cp850", - "csibm850": "cp850", - "cp852": { - "type": "_sbcs", - "chars": "ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´­˝˛ˇ˘§÷¸°¨˙űŘř■ " - }, - "ibm852": "cp852", - "csibm852": "cp852", - "cp855": { - "type": "_sbcs", - "chars": "ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№­ыЫзЗшШэЭщЩчЧ§■ " - }, - "ibm855": "cp855", - "csibm855": "cp855", - "cp856": { - "type": "_sbcs", - "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת�£�×����������®¬½¼�«»░▒▓│┤���©╣║╗╝¢¥┐└┴┬├─┼��╚╔╩╦╠═╬¤���������┘┌█▄¦�▀������µ�������¯´­±‗¾¶§÷¸°¨·¹³²■ " - }, - "ibm856": "cp856", - "csibm856": "cp856", - "cp857": { - "type": "_sbcs", - "chars": "ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ�ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ�×ÚÛÙìÿ¯´­±�¾¶§÷¸°¨·¹³²■ " - }, - "ibm857": "cp857", - "csibm857": "cp857", - "cp858": { - "type": "_sbcs", - "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " - }, - "ibm858": "cp858", - "csibm858": "cp858", - "cp860": { - "type": "_sbcs", - "chars": "ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " - }, - "ibm860": "cp860", - "csibm860": "cp860", - "cp861": { - "type": "_sbcs", - "chars": "ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " - }, - "ibm861": "cp861", - "csibm861": "cp861", - "cp862": { - "type": "_sbcs", - "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " - }, - "ibm862": "cp862", - "csibm862": "cp862", - "cp863": { - "type": "_sbcs", - "chars": "ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " - }, - "ibm863": "cp863", - "csibm863": "cp863", - "cp864": { - "type": "_sbcs", - "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ­ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�" - }, - "ibm864": "cp864", - "csibm864": "cp864", - "cp865": { - "type": "_sbcs", - "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " - }, - "ibm865": "cp865", - "csibm865": "cp865", - "cp866": { - "type": "_sbcs", - "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ " - }, - "ibm866": "cp866", - "csibm866": "cp866", - "cp869": { - "type": "_sbcs", - "chars": "������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ " - }, - "ibm869": "cp869", - "csibm869": "cp869", - "cp922": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®‾°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖרÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ" - }, - "ibm922": "cp922", - "csibm922": "cp922", - "cp1046": { - "type": "_sbcs", - "chars": "ﺈ×÷ﹱˆ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،­ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�" - }, - "ibm1046": "cp1046", - "csibm1046": "cp1046", - "cp1124": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂҐЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ" - }, - "ibm1124": "cp1124", - "csibm1124": "cp1124", - "cp1125": { - "type": "_sbcs", - "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ " - }, - "ibm1125": "cp1125", - "csibm1125": "cp1125", - "cp1129": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" - }, - "ibm1129": "cp1129", - "csibm1129": "cp1129", - "cp1133": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�" - }, - "ibm1133": "cp1133", - "csibm1133": "cp1133", - "cp1161": { - "type": "_sbcs", - "chars": "��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ " - }, - "ibm1161": "cp1161", - "csibm1161": "cp1161", - "cp1162": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" - }, - "ibm1162": "cp1162", - "csibm1162": "cp1162", - "cp1163": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" - }, - "ibm1163": "cp1163", - "csibm1163": "cp1163", - "maccroatian": { - "type": "_sbcs", - "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊�©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ" - }, - "maccyrillic": { - "type": "_sbcs", - "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" - }, - "macgreek": { - "type": "_sbcs", - "chars": "Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦­ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�" - }, - "maciceland": { - "type": "_sbcs", - "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" - }, - "macroman": { - "type": "_sbcs", - "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" - }, - "macromania": { - "type": "_sbcs", - "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›Ţţ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" - }, - "macthai": { - "type": "_sbcs", - "chars": "«»…“”�•‘’� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู​–—฿เแโใไๅๆ็่้๊๋์ํ™๏๐๑๒๓๔๕๖๗๘๙®©����" - }, - "macturkish": { - "type": "_sbcs", - "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ" - }, - "macukraine": { - "type": "_sbcs", - "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" - }, - "koi8r": { - "type": "_sbcs", - "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" - }, - "koi8u": { - "type": "_sbcs", - "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" - }, - "koi8ru": { - "type": "_sbcs", - "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґў╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪ҐЎ©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" - }, - "koi8t": { - "type": "_sbcs", - "chars": "қғ‚Ғ„…†‡�‰ҳ‹ҲҷҶ�Қ‘’“”•–—�™�›�����ӯӮё¤ӣ¦§���«¬­®�°±²Ё�Ӣ¶·�№�»���©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" - }, - "armscii8": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �և։)(»«—.՝,-֊…՜՛՞ԱաԲբԳգԴդԵեԶզԷէԸըԹթԺժԻիԼլԽխԾծԿկՀհՁձՂղՃճՄմՅյՆնՇշՈոՉչՊպՋջՌռՍսՎվՏտՐրՑցՒւՓփՔքՕօՖֆ՚�" - }, - "rk1048": { - "type": "_sbcs", - "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊҚҺЏђ‘’“”•–—�™љ›њқһџ ҰұӘ¤Ө¦§Ё©Ғ«¬­®Ү°±Ііөµ¶·ё№ғ»әҢңүАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" - }, - "tcvn": { - "type": "_sbcs", - "chars": "\u0000ÚỤ\u0003ỪỬỮ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010ỨỰỲỶỸÝỴ\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ" - }, - "georgianacademy": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ" - }, - "georgianps": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" - }, - "pt154": { - "type": "_sbcs", - "chars": "ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" - }, - "viscii": { - "type": "_sbcs", - "chars": "\u0000\u0001Ẳ\u0003\u0004ẴẪ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013Ỷ\u0015\u0016\u0017\u0018Ỹ\u001a\u001b\u001c\u001dỴ\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ" - }, - "iso646cn": { - "type": "_sbcs", - "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������" - }, - "iso646jp": { - "type": "_sbcs", - "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������" - }, - "hproman8": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±�" - }, - "macintosh": { - "type": "_sbcs", - "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" - }, - "ascii": { - "type": "_sbcs", - "chars": "��������������������������������������������������������������������������������������������������������������������������������" - }, - "tis620": { - "type": "_sbcs", - "chars": "���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" - } -} \ No newline at end of file diff --git a/node_modules/mysql2/node_modules/iconv-lite/encodings/sbcs-data.js b/node_modules/mysql2/node_modules/iconv-lite/encodings/sbcs-data.js deleted file mode 100644 index 066f904..0000000 --- a/node_modules/mysql2/node_modules/iconv-lite/encodings/sbcs-data.js +++ /dev/null @@ -1,179 +0,0 @@ -"use strict"; - -// Manually added data to be used by sbcs codec in addition to generated one. - -module.exports = { - // Not supported by iconv, not sure why. - "10029": "maccenteuro", - "maccenteuro": { - "type": "_sbcs", - "chars": "ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ" - }, - - "808": "cp808", - "ibm808": "cp808", - "cp808": { - "type": "_sbcs", - "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№€■ " - }, - - "mik": { - "type": "_sbcs", - "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя└┴┬├─┼╣║╚╔╩╦╠═╬┐░▒▓│┤№§╗╝┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " - }, - - "cp720": { - "type": "_sbcs", - "chars": "\x80\x81éâ\x84à\x86çêëèïî\x8d\x8e\x8f\x90\u0651\u0652ô¤ـûùءآأؤ£إئابةتثجحخدذرزسشص«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ضطظعغفµقكلمنهوىي≡\u064b\u064c\u064d\u064e\u064f\u0650≈°∙·√ⁿ²■\u00a0" - }, - - // Aliases of generated encodings. - "ascii8bit": "ascii", - "usascii": "ascii", - "ansix34": "ascii", - "ansix341968": "ascii", - "ansix341986": "ascii", - "csascii": "ascii", - "cp367": "ascii", - "ibm367": "ascii", - "isoir6": "ascii", - "iso646us": "ascii", - "iso646irv": "ascii", - "us": "ascii", - - "latin1": "iso88591", - "latin2": "iso88592", - "latin3": "iso88593", - "latin4": "iso88594", - "latin5": "iso88599", - "latin6": "iso885910", - "latin7": "iso885913", - "latin8": "iso885914", - "latin9": "iso885915", - "latin10": "iso885916", - - "csisolatin1": "iso88591", - "csisolatin2": "iso88592", - "csisolatin3": "iso88593", - "csisolatin4": "iso88594", - "csisolatincyrillic": "iso88595", - "csisolatinarabic": "iso88596", - "csisolatingreek" : "iso88597", - "csisolatinhebrew": "iso88598", - "csisolatin5": "iso88599", - "csisolatin6": "iso885910", - - "l1": "iso88591", - "l2": "iso88592", - "l3": "iso88593", - "l4": "iso88594", - "l5": "iso88599", - "l6": "iso885910", - "l7": "iso885913", - "l8": "iso885914", - "l9": "iso885915", - "l10": "iso885916", - - "isoir14": "iso646jp", - "isoir57": "iso646cn", - "isoir100": "iso88591", - "isoir101": "iso88592", - "isoir109": "iso88593", - "isoir110": "iso88594", - "isoir144": "iso88595", - "isoir127": "iso88596", - "isoir126": "iso88597", - "isoir138": "iso88598", - "isoir148": "iso88599", - "isoir157": "iso885910", - "isoir166": "tis620", - "isoir179": "iso885913", - "isoir199": "iso885914", - "isoir203": "iso885915", - "isoir226": "iso885916", - - "cp819": "iso88591", - "ibm819": "iso88591", - - "cyrillic": "iso88595", - - "arabic": "iso88596", - "arabic8": "iso88596", - "ecma114": "iso88596", - "asmo708": "iso88596", - - "greek" : "iso88597", - "greek8" : "iso88597", - "ecma118" : "iso88597", - "elot928" : "iso88597", - - "hebrew": "iso88598", - "hebrew8": "iso88598", - - "turkish": "iso88599", - "turkish8": "iso88599", - - "thai": "iso885911", - "thai8": "iso885911", - - "celtic": "iso885914", - "celtic8": "iso885914", - "isoceltic": "iso885914", - - "tis6200": "tis620", - "tis62025291": "tis620", - "tis62025330": "tis620", - - "10000": "macroman", - "10006": "macgreek", - "10007": "maccyrillic", - "10079": "maciceland", - "10081": "macturkish", - - "cspc8codepage437": "cp437", - "cspc775baltic": "cp775", - "cspc850multilingual": "cp850", - "cspcp852": "cp852", - "cspc862latinhebrew": "cp862", - "cpgr": "cp869", - - "msee": "cp1250", - "mscyrl": "cp1251", - "msansi": "cp1252", - "msgreek": "cp1253", - "msturk": "cp1254", - "mshebr": "cp1255", - "msarab": "cp1256", - "winbaltrim": "cp1257", - - "cp20866": "koi8r", - "20866": "koi8r", - "ibm878": "koi8r", - "cskoi8r": "koi8r", - - "cp21866": "koi8u", - "21866": "koi8u", - "ibm1168": "koi8u", - - "strk10482002": "rk1048", - - "tcvn5712": "tcvn", - "tcvn57121": "tcvn", - - "gb198880": "iso646cn", - "cn": "iso646cn", - - "csiso14jisc6220ro": "iso646jp", - "jisc62201969ro": "iso646jp", - "jp": "iso646jp", - - "cshproman8": "hproman8", - "r8": "hproman8", - "roman8": "hproman8", - "xroman8": "hproman8", - "ibm1051": "hproman8", - - "mac": "macintosh", - "csmacintosh": "macintosh", -}; - diff --git a/node_modules/mysql2/node_modules/iconv-lite/encodings/tables/big5-added.json b/node_modules/mysql2/node_modules/iconv-lite/encodings/tables/big5-added.json deleted file mode 100644 index 3c3d3c2..0000000 --- a/node_modules/mysql2/node_modules/iconv-lite/encodings/tables/big5-added.json +++ /dev/null @@ -1,122 +0,0 @@ -[ -["8740","䏰䰲䘃䖦䕸𧉧䵷䖳𧲱䳢𧳅㮕䜶䝄䱇䱀𤊿𣘗𧍒𦺋𧃒䱗𪍑䝏䗚䲅𧱬䴇䪤䚡𦬣爥𥩔𡩣𣸆𣽡晍囻"], -["8767","綕夝𨮹㷴霴𧯯寛𡵞媤㘥𩺰嫑宷峼杮薓𩥅瑡璝㡵𡵓𣚞𦀡㻬"], -["87a1","𥣞㫵竼龗𤅡𨤍𣇪𠪊𣉞䌊蒄龖鐯䤰蘓墖靊鈘秐稲晠権袝瑌篅枂稬剏遆㓦珄𥶹瓆鿇垳䤯呌䄱𣚎堘穲𧭥讏䚮𦺈䆁𥶙箮𢒼鿈𢓁𢓉𢓌鿉蔄𣖻䂴鿊䓡𪷿拁灮鿋"], -["8840","㇀",4,"𠄌㇅𠃑𠃍㇆㇇𠃋𡿨㇈𠃊㇉㇊㇋㇌𠄎㇍㇎ĀÁǍÀĒÉĚÈŌÓǑÒ࿿Ê̄Ế࿿Ê̌ỀÊāáǎàɑēéěèīíǐìōóǒòūúǔùǖǘǚ"], -["88a1","ǜü࿿ê̄ế࿿ê̌ềêɡ⏚⏛"], -["8940","𪎩𡅅"], -["8943","攊"], -["8946","丽滝鵎釟"], -["894c","𧜵撑会伨侨兖兴农凤务动医华发变团声处备夲头学实実岚庆总斉柾栄桥济炼电纤纬纺织经统缆缷艺苏药视设询车轧轮"], -["89a1","琑糼緍楆竉刧"], -["89ab","醌碸酞肼"], -["89b0","贋胶𠧧"], -["89b5","肟黇䳍鷉鸌䰾𩷶𧀎鸊𪄳㗁"], -["89c1","溚舾甙"], -["89c5","䤑马骏龙禇𨑬𡷊𠗐𢫦两亁亀亇亿仫伷㑌侽㹈倃傈㑽㒓㒥円夅凛凼刅争剹劐匧㗇厩㕑厰㕓参吣㕭㕲㚁咓咣咴咹哐哯唘唣唨㖘唿㖥㖿嗗㗅"], -["8a40","𧶄唥"], -["8a43","𠱂𠴕𥄫喐𢳆㧬𠍁蹆𤶸𩓥䁓𨂾睺𢰸㨴䟕𨅝𦧲𤷪擝𠵼𠾴𠳕𡃴撍蹾𠺖𠰋𠽤𢲩𨉖𤓓"], -["8a64","𠵆𩩍𨃩䟴𤺧𢳂骲㩧𩗴㿭㔆𥋇𩟔𧣈𢵄鵮頕"], -["8a76","䏙𦂥撴哣𢵌𢯊𡁷㧻𡁯"], -["8aa1","𦛚𦜖𧦠擪𥁒𠱃蹨𢆡𨭌𠜱"], -["8aac","䠋𠆩㿺塳𢶍"], -["8ab2","𤗈𠓼𦂗𠽌𠶖啹䂻䎺"], -["8abb","䪴𢩦𡂝膪飵𠶜捹㧾𢝵跀嚡摼㹃"], -["8ac9","𪘁𠸉𢫏𢳉"], -["8ace","𡃈𣧂㦒㨆𨊛㕸𥹉𢃇噒𠼱𢲲𩜠㒼氽𤸻"], -["8adf","𧕴𢺋𢈈𪙛𨳍𠹺𠰴𦠜羓𡃏𢠃𢤹㗻𥇣𠺌𠾍𠺪㾓𠼰𠵇𡅏𠹌"], -["8af6","𠺫𠮩𠵈𡃀𡄽㿹𢚖搲𠾭"], -["8b40","𣏴𧘹𢯎𠵾𠵿𢱑𢱕㨘𠺘𡃇𠼮𪘲𦭐𨳒𨶙𨳊閪哌苄喹"], -["8b55","𩻃鰦骶𧝞𢷮煀腭胬尜𦕲脴㞗卟𨂽醶𠻺𠸏𠹷𠻻㗝𤷫㘉𠳖嚯𢞵𡃉𠸐𠹸𡁸𡅈𨈇𡑕𠹹𤹐𢶤婔𡀝𡀞𡃵𡃶垜𠸑"], -["8ba1","𧚔𨋍𠾵𠹻𥅾㜃𠾶𡆀𥋘𪊽𤧚𡠺𤅷𨉼墙剨㘚𥜽箲孨䠀䬬鼧䧧鰟鮍𥭴𣄽嗻㗲嚉丨夂𡯁屮靑𠂆乛亻㔾尣彑忄㣺扌攵歺氵氺灬爫丬犭𤣩罒礻糹罓𦉪㓁"], -["8bde","𦍋耂肀𦘒𦥑卝衤见𧢲讠贝钅镸长门𨸏韦页风飞饣𩠐鱼鸟黄歯龜丷𠂇阝户钢"], -["8c40","倻淾𩱳龦㷉袏𤅎灷峵䬠𥇍㕙𥴰愢𨨲辧釶熑朙玺𣊁𪄇㲋𡦀䬐磤琂冮𨜏䀉橣𪊺䈣蘏𠩯稪𩥇𨫪靕灍匤𢁾鏴盙𨧣龧矝亣俰傼丯众龨吴綋墒壐𡶶庒庙忂𢜒斋"], -["8ca1","𣏹椙橃𣱣泿"], -["8ca7","爀𤔅玌㻛𤨓嬕璹讃𥲤𥚕窓篬糃繬苸薗龩袐龪躹龫迏蕟駠鈡龬𨶹𡐿䁱䊢娚"], -["8cc9","顨杫䉶圽"], -["8cce","藖𤥻芿𧄍䲁𦵴嵻𦬕𦾾龭龮宖龯曧繛湗秊㶈䓃𣉖𢞖䎚䔶"], -["8ce6","峕𣬚諹屸㴒𣕑嵸龲煗䕘𤃬𡸣䱷㥸㑊𠆤𦱁諌侴𠈹妿腬顖𩣺弻"], -["8d40","𠮟"], -["8d42","𢇁𨥭䄂䚻𩁹㼇龳𪆵䃸㟖䛷𦱆䅼𨚲𧏿䕭㣔𥒚䕡䔛䶉䱻䵶䗪㿈𤬏㙡䓞䒽䇭崾嵈嵖㷼㠏嶤嶹㠠㠸幂庽弥徃㤈㤔㤿㥍惗愽峥㦉憷憹懏㦸戬抐拥挘㧸嚱"], -["8da1","㨃揢揻搇摚㩋擀崕嘡龟㪗斆㪽旿晓㫲暒㬢朖㭂枤栀㭘桊梄㭲㭱㭻椉楃牜楤榟榅㮼槖㯝橥橴橱檂㯬檙㯲檫檵櫔櫶殁毁毪汵沪㳋洂洆洦涁㳯涤涱渕渘温溆𨧀溻滢滚齿滨滩漤漴㵆𣽁澁澾㵪㵵熷岙㶊瀬㶑灐灔灯灿炉𠌥䏁㗱𠻘"], -["8e40","𣻗垾𦻓焾𥟠㙎榢𨯩孴穉𥣡𩓙穥穽𥦬窻窰竂竃燑𦒍䇊竚竝竪䇯咲𥰁笋筕笩𥌎𥳾箢筯莜𥮴𦱿篐萡箒箸𥴠㶭𥱥蒒篺簆簵𥳁籄粃𤢂粦晽𤕸糉糇糦籴糳糵糎"], -["8ea1","繧䔝𦹄絝𦻖璍綉綫焵綳緒𤁗𦀩緤㴓緵𡟹緥𨍭縝𦄡𦅚繮纒䌫鑬縧罀罁罇礶𦋐駡羗𦍑羣𡙡𠁨䕜𣝦䔃𨌺翺𦒉者耈耝耨耯𪂇𦳃耻耼聡𢜔䦉𦘦𣷣𦛨朥肧𨩈脇脚墰𢛶汿𦒘𤾸擧𡒊舘𡡞橓𤩥𤪕䑺舩𠬍𦩒𣵾俹𡓽蓢荢𦬊𤦧𣔰𡝳𣷸芪椛芳䇛"], -["8f40","蕋苐茚𠸖𡞴㛁𣅽𣕚艻苢茘𣺋𦶣𦬅𦮗𣗎㶿茝嗬莅䔋𦶥莬菁菓㑾𦻔橗蕚㒖𦹂𢻯葘𥯤葱㷓䓤檧葊𣲵祘蒨𦮖𦹷𦹃蓞萏莑䒠蒓蓤𥲑䉀𥳀䕃蔴嫲𦺙䔧蕳䔖枿蘖"], -["8fa1","𨘥𨘻藁𧂈蘂𡖂𧃍䕫䕪蘨㙈𡢢号𧎚虾蝱𪃸蟮𢰧螱蟚蠏噡虬桖䘏衅衆𧗠𣶹𧗤衞袜䙛袴袵揁装睷𧜏覇覊覦覩覧覼𨨥觧𧤤𧪽誜瞓釾誐𧩙竩𧬺𣾏䜓𧬸煼謌謟𥐰𥕥謿譌譍誩𤩺讐讛誯𡛟䘕衏貛𧵔𧶏貫㜥𧵓賖𧶘𧶽贒贃𡤐賛灜贑𤳉㻐起"], -["9040","趩𨀂𡀔𤦊㭼𨆼𧄌竧躭躶軃鋔輙輭𨍥𨐒辥錃𪊟𠩐辳䤪𨧞𨔽𣶻廸𣉢迹𪀔𨚼𨔁𢌥㦀𦻗逷𨔼𧪾遡𨕬𨘋邨𨜓郄𨛦邮都酧㫰醩釄粬𨤳𡺉鈎沟鉁鉢𥖹銹𨫆𣲛𨬌𥗛"], -["90a1","𠴱錬鍫𨫡𨯫炏嫃𨫢𨫥䥥鉄𨯬𨰹𨯿鍳鑛躼閅閦鐦閠濶䊹𢙺𨛘𡉼𣸮䧟氜陻隖䅬隣𦻕懚隶磵𨫠隽双䦡𦲸𠉴𦐐𩂯𩃥𤫑𡤕𣌊霱虂霶䨏䔽䖅𤫩灵孁霛靜𩇕靗孊𩇫靟鐥僐𣂷𣂼鞉鞟鞱鞾韀韒韠𥑬韮琜𩐳響韵𩐝𧥺䫑頴頳顋顦㬎𧅵㵑𠘰𤅜"], -["9140","𥜆飊颷飈飇䫿𦴧𡛓喰飡飦飬鍸餹𤨩䭲𩡗𩤅駵騌騻騐驘𥜥㛄𩂱𩯕髠髢𩬅髴䰎鬔鬭𨘀倴鬴𦦨㣃𣁽魐魀𩴾婅𡡣鮎𤉋鰂鯿鰌𩹨鷔𩾷𪆒𪆫𪃡𪄣𪇟鵾鶃𪄴鸎梈"], -["91a1","鷄𢅛𪆓𪈠𡤻𪈳鴹𪂹𪊴麐麕麞麢䴴麪麯𤍤黁㭠㧥㴝伲㞾𨰫鼂鼈䮖鐤𦶢鼗鼖鼹嚟嚊齅馸𩂋韲葿齢齩竜龎爖䮾𤥵𤦻煷𤧸𤍈𤩑玞𨯚𡣺禟𨥾𨸶鍩鏳𨩄鋬鎁鏋𨥬𤒹爗㻫睲穃烐𤑳𤏸煾𡟯炣𡢾𣖙㻇𡢅𥐯𡟸㜢𡛻𡠹㛡𡝴𡣑𥽋㜣𡛀坛𤨥𡏾𡊨"], -["9240","𡏆𡒶蔃𣚦蔃葕𤦔𧅥𣸱𥕜𣻻𧁒䓴𣛮𩦝𦼦柹㜳㰕㷧塬𡤢栐䁗𣜿𤃡𤂋𤄏𦰡哋嚞𦚱嚒𠿟𠮨𠸍鏆𨬓鎜仸儫㠙𤐶亼𠑥𠍿佋侊𥙑婨𠆫𠏋㦙𠌊𠐔㐵伩𠋀𨺳𠉵諚𠈌亘"], -["92a1","働儍侢伃𤨎𣺊佂倮偬傁俌俥偘僼兙兛兝兞湶𣖕𣸹𣺿浲𡢄𣺉冨凃𠗠䓝𠒣𠒒𠒑赺𨪜𠜎剙劤𠡳勡鍮䙺熌𤎌𠰠𤦬𡃤槑𠸝瑹㻞璙琔瑖玘䮎𤪼𤂍叐㖄爏𤃉喴𠍅响𠯆圝鉝雴鍦埝垍坿㘾壋媙𨩆𡛺𡝯𡜐娬妸銏婾嫏娒𥥆𡧳𡡡𤊕㛵洅瑃娡𥺃"], -["9340","媁𨯗𠐓鏠璌𡌃焅䥲鐈𨧻鎽㞠尞岞幞幈𡦖𡥼𣫮廍孏𡤃𡤄㜁𡢠㛝𡛾㛓脪𨩇𡶺𣑲𨦨弌弎𡤧𡞫婫𡜻孄蘔𧗽衠恾𢡠𢘫忛㺸𢖯𢖾𩂈𦽳懀𠀾𠁆𢘛憙憘恵𢲛𢴇𤛔𩅍"], -["93a1","摱𤙥𢭪㨩𢬢𣑐𩣪𢹸挷𪑛撶挱揑𤧣𢵧护𢲡搻敫楲㯴𣂎𣊭𤦉𣊫唍𣋠𡣙𩐿曎𣊉𣆳㫠䆐𥖄𨬢𥖏𡛼𥕛𥐥磮𣄃𡠪𣈴㑤𣈏𣆂𤋉暎𦴤晫䮓昰𧡰𡷫晣𣋒𣋡昞𥡲㣑𣠺𣞼㮙𣞢𣏾瓐㮖枏𤘪梶栞㯄檾㡣𣟕𤒇樳橒櫉欅𡤒攑梘橌㯗橺歗𣿀𣲚鎠鋲𨯪𨫋"], -["9440","銉𨀞𨧜鑧涥漋𤧬浧𣽿㶏渄𤀼娽渊塇洤硂焻𤌚𤉶烱牐犇犔𤞏𤜥兹𤪤𠗫瑺𣻸𣙟𤩊𤤗𥿡㼆㺱𤫟𨰣𣼵悧㻳瓌琼鎇琷䒟𦷪䕑疃㽣𤳙𤴆㽘畕癳𪗆㬙瑨𨫌𤦫𤦎㫻"], -["94a1","㷍𤩎㻿𤧅𤣳釺圲鍂𨫣𡡤僟𥈡𥇧睸𣈲眎眏睻𤚗𣞁㩞𤣰琸璛㺿𤪺𤫇䃈𤪖𦆮錇𥖁砞碍碈磒珐祙𧝁𥛣䄎禛蒖禥樭𣻺稺秴䅮𡛦䄲鈵秱𠵌𤦌𠊙𣶺𡝮㖗啫㕰㚪𠇔𠰍竢婙𢛵𥪯𥪜娍𠉛磰娪𥯆竾䇹籝籭䈑𥮳𥺼𥺦糍𤧹𡞰粎籼粮檲緜縇緓罎𦉡"], -["9540","𦅜𧭈綗𥺂䉪𦭵𠤖柖𠁎𣗏埄𦐒𦏸𤥢翝笧𠠬𥫩𥵃笌𥸎駦虅驣樜𣐿㧢𤧷𦖭騟𦖠蒀𧄧𦳑䓪脷䐂胆脉腂𦞴飃𦩂艢艥𦩑葓𦶧蘐𧈛媆䅿𡡀嬫𡢡嫤𡣘蚠蜨𣶏蠭𧐢娂"], -["95a1","衮佅袇袿裦襥襍𥚃襔𧞅𧞄𨯵𨯙𨮜𨧹㺭蒣䛵䛏㟲訽訜𩑈彍鈫𤊄旔焩烄𡡅鵭貟賩𧷜妚矃姰䍮㛔踪躧𤰉輰轊䋴汘澻𢌡䢛潹溋𡟚鯩㚵𤤯邻邗啱䤆醻鐄𨩋䁢𨫼鐧𨰝𨰻蓥訫閙閧閗閖𨴴瑅㻂𤣿𤩂𤏪㻧𣈥随𨻧𨹦𨹥㻌𤧭𤩸𣿮琒瑫㻼靁𩂰"], -["9640","桇䨝𩂓𥟟靝鍨𨦉𨰦𨬯𦎾銺嬑譩䤼珹𤈛鞛靱餸𠼦巁𨯅𤪲頟𩓚鋶𩗗釥䓀𨭐𤩧𨭤飜𨩅㼀鈪䤥萔餻饍𧬆㷽馛䭯馪驜𨭥𥣈檏騡嫾騯𩣱䮐𩥈馼䮽䮗鍽塲𡌂堢𤦸"], -["96a1","𡓨硄𢜟𣶸棅㵽鑘㤧慐𢞁𢥫愇鱏鱓鱻鰵鰐魿鯏𩸭鮟𪇵𪃾鴡䲮𤄄鸘䲰鴌𪆴𪃭𪃳𩤯鶥蒽𦸒𦿟𦮂藼䔳𦶤𦺄𦷰萠藮𦸀𣟗𦁤秢𣖜𣙀䤭𤧞㵢鏛銾鍈𠊿碹鉷鑍俤㑀遤𥕝砽硔碶硋𡝗𣇉𤥁㚚佲濚濙瀞瀞吔𤆵垻壳垊鴖埗焴㒯𤆬燫𦱀𤾗嬨𡞵𨩉"], -["9740","愌嫎娋䊼𤒈㜬䭻𨧼鎻鎸𡣖𠼝葲𦳀𡐓𤋺𢰦𤏁妔𣶷𦝁綨𦅛𦂤𤦹𤦋𨧺鋥珢㻩璴𨭣𡢟㻡𤪳櫘珳珻㻖𤨾𤪔𡟙𤩦𠎧𡐤𤧥瑈𤤖炥𤥶銄珦鍟𠓾錱𨫎𨨖鎆𨯧𥗕䤵𨪂煫"], -["97a1","𤥃𠳿嚤𠘚𠯫𠲸唂秄𡟺緾𡛂𤩐𡡒䔮鐁㜊𨫀𤦭妰𡢿𡢃𧒄媡㛢𣵛㚰鉟婹𨪁𡡢鍴㳍𠪴䪖㦊僴㵩㵌𡎜煵䋻𨈘渏𩃤䓫浗𧹏灧沯㳖𣿭𣸭渂漌㵯𠏵畑㚼㓈䚀㻚䡱姄鉮䤾轁𨰜𦯀堒埈㛖𡑒烾𤍢𤩱𢿣𡊰𢎽梹楧𡎘𣓥𧯴𣛟𨪃𣟖𣏺𤲟樚𣚭𦲷萾䓟䓎"], -["9840","𦴦𦵑𦲂𦿞漗𧄉茽𡜺菭𦲀𧁓𡟛妉媂𡞳婡婱𡤅𤇼㜭姯𡜼㛇熎鎐暚𤊥婮娫𤊓樫𣻹𧜶𤑛𤋊焝𤉙𨧡侰𦴨峂𤓎𧹍𤎽樌𤉖𡌄炦焳𤏩㶥泟勇𤩏繥姫崯㷳彜𤩝𡟟綤萦"], -["98a1","咅𣫺𣌀𠈔坾𠣕𠘙㿥𡾞𪊶瀃𩅛嵰玏糓𨩙𩐠俈翧狍猐𧫴猸猹𥛶獁獈㺩𧬘遬燵𤣲珡臶㻊県㻑沢国琙琞琟㻢㻰㻴㻺瓓㼎㽓畂畭畲疍㽼痈痜㿀癍㿗癴㿜発𤽜熈嘣覀塩䀝睃䀹条䁅㗛瞘䁪䁯属瞾矋売砘点砜䂨砹硇硑硦葈𥔵礳栃礲䄃"], -["9940","䄉禑禙辻稆込䅧窑䆲窼艹䇄竏竛䇏両筢筬筻簒簛䉠䉺类粜䊌粸䊔糭输烀𠳏総緔緐緽羮羴犟䎗耠耥笹耮耱联㷌垴炠肷胩䏭脌猪脎脒畠脔䐁㬹腖腙腚"], -["99a1","䐓堺腼膄䐥膓䐭膥埯臁臤艔䒏芦艶苊苘苿䒰荗险榊萅烵葤惣蒈䔄蒾蓡蓸蔐蔸蕒䔻蕯蕰藠䕷虲蚒蚲蛯际螋䘆䘗袮裿褤襇覑𧥧訩訸誔誴豑賔賲贜䞘塟跃䟭仮踺嗘坔蹱嗵躰䠷軎転軤軭軲辷迁迊迌逳駄䢭飠鈓䤞鈨鉘鉫銱銮銿"], -["9a40","鋣鋫鋳鋴鋽鍃鎄鎭䥅䥑麿鐗匁鐝鐭鐾䥪鑔鑹锭関䦧间阳䧥枠䨤靀䨵鞲韂噔䫤惨颹䬙飱塄餎餙冴餜餷饂饝饢䭰駅䮝騼鬏窃魩鮁鯝鯱鯴䱭鰠㝯𡯂鵉鰺"], -["9aa1","黾噐鶓鶽鷀鷼银辶鹻麬麱麽黆铜黢黱黸竈齄𠂔𠊷𠎠椚铃妬𠓗塀铁㞹𠗕𠘕𠙶𡚺块煳𠫂𠫍𠮿呪吆𠯋咞𠯻𠰻𠱓𠱥𠱼惧𠲍噺𠲵𠳝𠳭𠵯𠶲𠷈楕鰯螥𠸄𠸎𠻗𠾐𠼭𠹳尠𠾼帋𡁜𡁏𡁶朞𡁻𡂈𡂖㙇𡂿𡃓𡄯𡄻卤蒭𡋣𡍵𡌶讁𡕷𡘙𡟃𡟇乸炻𡠭𡥪"], -["9b40","𡨭𡩅𡰪𡱰𡲬𡻈拃𡻕𡼕熘桕𢁅槩㛈𢉼𢏗𢏺𢜪𢡱𢥏苽𢥧𢦓𢫕覥𢫨辠𢬎鞸𢬿顇骽𢱌"], -["9b62","𢲈𢲷𥯨𢴈𢴒𢶷𢶕𢹂𢽴𢿌𣀳𣁦𣌟𣏞徱晈暿𧩹𣕧𣗳爁𤦺矗𣘚𣜖纇𠍆墵朎"], -["9ba1","椘𣪧𧙗𥿢𣸑𣺹𧗾𢂚䣐䪸𤄙𨪚𤋮𤌍𤀻𤌴𤎖𤩅𠗊凒𠘑妟𡺨㮾𣳿𤐄𤓖垈𤙴㦛𤜯𨗨𩧉㝢𢇃譞𨭎駖𤠒𤣻𤨕爉𤫀𠱸奥𤺥𤾆𠝹軚𥀬劏圿煱𥊙𥐙𣽊𤪧喼𥑆𥑮𦭒釔㑳𥔿𧘲𥕞䜘𥕢𥕦𥟇𤤿𥡝偦㓻𣏌惞𥤃䝼𨥈𥪮𥮉𥰆𡶐垡煑澶𦄂𧰒遖𦆲𤾚譢𦐂𦑊"], -["9c40","嵛𦯷輶𦒄𡤜諪𤧶𦒈𣿯𦔒䯀𦖿𦚵𢜛鑥𥟡憕娧晉侻嚹𤔡𦛼乪𤤴陖涏𦲽㘘襷𦞙𦡮𦐑𦡞營𦣇筂𩃀𠨑𦤦鄄𦤹穅鷰𦧺騦𦨭㙟𦑩𠀡禃𦨴𦭛崬𣔙菏𦮝䛐𦲤画补𦶮墶"], -["9ca1","㜜𢖍𧁋𧇍㱔𧊀𧊅銁𢅺𧊋錰𧋦𤧐氹钟𧑐𠻸蠧裵𢤦𨑳𡞱溸𤨪𡠠㦤㚹尐秣䔿暶𩲭𩢤襃𧟌𧡘囖䃟𡘊㦡𣜯𨃨𡏅熭荦𧧝𩆨婧䲷𧂯𨦫𧧽𧨊𧬋𧵦𤅺筃祾𨀉澵𪋟樃𨌘厢𦸇鎿栶靝𨅯𨀣𦦵𡏭𣈯𨁈嶅𨰰𨂃圕頣𨥉嶫𤦈斾槕叒𤪥𣾁㰑朶𨂐𨃴𨄮𡾡𨅏"], -["9d40","𨆉𨆯𨈚𨌆𨌯𨎊㗊𨑨𨚪䣺揦𨥖砈鉕𨦸䏲𨧧䏟𨧨𨭆𨯔姸𨰉輋𨿅𩃬筑𩄐𩄼㷷𩅞𤫊运犏嚋𩓧𩗩𩖰𩖸𩜲𩣑𩥉𩥪𩧃𩨨𩬎𩵚𩶛纟𩻸𩼣䲤镇𪊓熢𪋿䶑递𪗋䶜𠲜达嗁"], -["9da1","辺𢒰边𤪓䔉繿潖檱仪㓤𨬬𧢝㜺躀𡟵𨀤𨭬𨮙𧨾𦚯㷫𧙕𣲷𥘵𥥖亚𥺁𦉘嚿𠹭踎孭𣺈𤲞揞拐𡟶𡡻攰嘭𥱊吚𥌑㷆𩶘䱽嘢嘞罉𥻘奵𣵀蝰东𠿪𠵉𣚺脗鵞贘瘻鱅癎瞹鍅吲腈苷嘥脲萘肽嗪祢噃吖𠺝㗎嘅嗱曱𨋢㘭甴嗰喺咗啲𠱁𠲖廐𥅈𠹶𢱢"], -["9e40","𠺢麫絚嗞𡁵抝靭咔賍燶酶揼掹揾啩𢭃鱲𢺳冚㓟𠶧冧呍唞唓癦踭𦢊疱肶蠄螆裇膶萜𡃁䓬猄𤜆宐茋𦢓噻𢛴𧴯𤆣𧵳𦻐𧊶酰𡇙鈈𣳼𪚩𠺬𠻹牦𡲢䝎𤿂𧿹𠿫䃺"], -["9ea1","鱝攟𢶠䣳𤟠𩵼𠿬𠸊恢𧖣𠿭"], -["9ead","𦁈𡆇熣纎鵐业丄㕷嬍沲卧㚬㧜卽㚥𤘘墚𤭮舭呋垪𥪕𠥹"], -["9ec5","㩒𢑥獴𩺬䴉鯭𣳾𩼰䱛𤾩𩖞𩿞葜𣶶𧊲𦞳𣜠挮紥𣻷𣸬㨪逈勌㹴㙺䗩𠒎癀嫰𠺶硺𧼮墧䂿噼鮋嵴癔𪐴麅䳡痹㟻愙𣃚𤏲"], -["9ef5","噝𡊩垧𤥣𩸆刴𧂮㖭汊鵼"], -["9f40","籖鬹埞𡝬屓擓𩓐𦌵𧅤蚭𠴨𦴢𤫢𠵱"], -["9f4f","凾𡼏嶎霃𡷑麁遌笟鬂峑箣扨挵髿篏鬪籾鬮籂粆鰕篼鬉鼗鰛𤤾齚啳寃俽麘俲剠㸆勑坧偖妷帒韈鶫轜呩鞴饀鞺匬愰"], -["9fa1","椬叚鰊鴂䰻陁榀傦畆𡝭駚剳"], -["9fae","酙隁酜"], -["9fb2","酑𨺗捿𦴣櫊嘑醎畺抅𠏼獏籰𥰡𣳽"], -["9fc1","𤤙盖鮝个𠳔莾衂"], -["9fc9","届槀僭坺刟巵从氱𠇲伹咜哚劚趂㗾弌㗳"], -["9fdb","歒酼龥鮗頮颴骺麨麄煺笔"], -["9fe7","毺蠘罸"], -["9feb","嘠𪙊蹷齓"], -["9ff0","跔蹏鸜踁抂𨍽踨蹵竓𤩷稾磘泪詧瘇"], -["a040","𨩚鼦泎蟖痃𪊲硓咢贌狢獱謭猂瓱賫𤪻蘯徺袠䒷"], -["a055","𡠻𦸅"], -["a058","詾𢔛"], -["a05b","惽癧髗鵄鍮鮏蟵"], -["a063","蠏賷猬霡鮰㗖犲䰇籑饊𦅙慙䰄麖慽"], -["a073","坟慯抦戹拎㩜懢厪𣏵捤栂㗒"], -["a0a1","嵗𨯂迚𨸹"], -["a0a6","僙𡵆礆匲阸𠼻䁥"], -["a0ae","矾"], -["a0b0","糂𥼚糚稭聦聣絍甅瓲覔舚朌聢𧒆聛瓰脃眤覉𦟌畓𦻑螩蟎臈螌詉貭譃眫瓸蓚㘵榲趦"], -["a0d4","覩瑨涹蟁𤀑瓧㷛煶悤憜㳑煢恷"], -["a0e2","罱𨬭牐惩䭾删㰘𣳇𥻗𧙖𥔱𡥄𡋾𩤃𦷜𧂭峁𦆭𨨏𣙷𠃮𦡆𤼎䕢嬟𦍌齐麦𦉫"], -["a3c0","␀",31,"␡"], -["c6a1","①",9,"⑴",9,"ⅰ",9,"丶丿亅亠冂冖冫勹匸卩厶夊宀巛⼳广廴彐彡攴无疒癶辵隶¨ˆヽヾゝゞ〃仝々〆〇ー[]✽ぁ",23], -["c740","す",58,"ァアィイ"], -["c7a1","ゥ",81,"А",5,"ЁЖ",4], -["c840","Л",26,"ёж",25,"⇧↸↹㇏𠃌乚𠂊刂䒑"], -["c8a1","龰冈龱𧘇"], -["c8cd","¬¦'"㈱№℡゛゜⺀⺄⺆⺇⺈⺊⺌⺍⺕⺜⺝⺥⺧⺪⺬⺮⺶⺼⺾⻆⻊⻌⻍⻏⻖⻗⻞⻣"], -["c8f5","ʃɐɛɔɵœøŋʊɪ"], -["f9fe","■"], -["fa40","𠕇鋛𠗟𣿅蕌䊵珯况㙉𤥂𨧤鍄𡧛苮𣳈砼杄拟𤤳𨦪𠊠𦮳𡌅侫𢓭倈𦴩𧪄𣘀𤪱𢔓倩𠍾徤𠎀𠍇滛𠐟偽儁㑺儎顬㝃萖𤦤𠒇兠𣎴兪𠯿𢃼𠋥𢔰𠖎𣈳𡦃宂蝽𠖳𣲙冲冸"], -["faa1","鴴凉减凑㳜凓𤪦决凢卂凭菍椾𣜭彻刋刦刼劵剗劔効勅簕蕂勠蘍𦬓包𨫞啉滙𣾀𠥔𣿬匳卄𠯢泋𡜦栛珕恊㺪㣌𡛨燝䒢卭却𨚫卾卿𡖖𡘓矦厓𨪛厠厫厮玧𥝲㽙玜叁叅汉义埾叙㪫𠮏叠𣿫𢶣叶𠱷吓灹唫晗浛呭𦭓𠵴啝咏咤䞦𡜍𠻝㶴𠵍"], -["fb40","𨦼𢚘啇䳭启琗喆喩嘅𡣗𤀺䕒𤐵暳𡂴嘷曍𣊊暤暭噍噏磱囱鞇叾圀囯园𨭦㘣𡉏坆𤆥汮炋坂㚱𦱾埦𡐖堃𡑔𤍣堦𤯵塜墪㕡壠壜𡈼壻寿坃𪅐𤉸鏓㖡够梦㛃湙"], -["fba1","𡘾娤啓𡚒蔅姉𠵎𦲁𦴪𡟜姙𡟻𡞲𦶦浱𡠨𡛕姹𦹅媫婣㛦𤦩婷㜈媖瑥嫓𦾡𢕔㶅𡤑㜲𡚸広勐孶斈孼𧨎䀄䡝𠈄寕慠𡨴𥧌𠖥寳宝䴐尅𡭄尓珎尔𡲥𦬨屉䣝岅峩峯嶋𡷹𡸷崐崘嵆𡺤岺巗苼㠭𤤁𢁉𢅳芇㠶㯂帮檊幵幺𤒼𠳓厦亷廐厨𡝱帉廴𨒂"], -["fc40","廹廻㢠廼栾鐛弍𠇁弢㫞䢮𡌺强𦢈𢏐彘𢑱彣鞽𦹮彲鍀𨨶徧嶶㵟𥉐𡽪𧃸𢙨釖𠊞𨨩怱暅𡡷㥣㷇㘹垐𢞴祱㹀悞悤悳𤦂𤦏𧩓璤僡媠慤萤慂慈𦻒憁凴𠙖憇宪𣾷"], -["fca1","𢡟懓𨮝𩥝懐㤲𢦀𢣁怣慜攞掋𠄘担𡝰拕𢸍捬𤧟㨗搸揸𡎎𡟼撐澊𢸶頔𤂌𥜝擡擥鑻㩦携㩗敍漖𤨨𤨣斅敭敟𣁾斵𤥀䬷旑䃘𡠩无旣忟𣐀昘𣇷𣇸晄𣆤𣆥晋𠹵晧𥇦晳晴𡸽𣈱𨗴𣇈𥌓矅𢣷馤朂𤎜𤨡㬫槺𣟂杞杧杢𤇍𩃭柗䓩栢湐鈼栁𣏦𦶠桝"], -["fd40","𣑯槡樋𨫟楳棃𣗍椁椀㴲㨁𣘼㮀枬楡𨩊䋼椶榘㮡𠏉荣傐槹𣙙𢄪橅𣜃檝㯳枱櫈𩆜㰍欝𠤣惞欵歴𢟍溵𣫛𠎵𡥘㝀吡𣭚毡𣻼毜氷𢒋𤣱𦭑汚舦汹𣶼䓅𣶽𤆤𤤌𤤀"], -["fda1","𣳉㛥㳫𠴲鮃𣇹𢒑羏样𦴥𦶡𦷫涖浜湼漄𤥿𤂅𦹲蔳𦽴凇沜渝萮𨬡港𣸯瑓𣾂秌湏媑𣁋濸㜍澝𣸰滺𡒗𤀽䕕鏰潄潜㵎潴𩅰㴻澟𤅄濓𤂑𤅕𤀹𣿰𣾴𤄿凟𤅖𤅗𤅀𦇝灋灾炧炁烌烕烖烟䄄㷨熴熖𤉷焫煅媈煊煮岜𤍥煏鍢𤋁焬𤑚𤨧𤨢熺𨯨炽爎"], -["fe40","鑂爕夑鑃爤鍁𥘅爮牀𤥴梽牕牗㹕𣁄栍漽犂猪猫𤠣𨠫䣭𨠄猨献珏玪𠰺𦨮珉瑉𤇢𡛧𤨤昣㛅𤦷𤦍𤧻珷琕椃𤨦琹𠗃㻗瑜𢢭瑠𨺲瑇珤瑶莹瑬㜰瑴鏱樬璂䥓𤪌"], -["fea1","𤅟𤩹𨮏孆𨰃𡢞瓈𡦈甎瓩甞𨻙𡩋寗𨺬鎅畍畊畧畮𤾂㼄𤴓疎瑝疞疴瘂瘬癑癏癯癶𦏵皐臯㟸𦤑𦤎皡皥皷盌𦾟葢𥂝𥅽𡸜眞眦着撯𥈠睘𣊬瞯𨥤𨥨𡛁矴砉𡍶𤨒棊碯磇磓隥礮𥗠磗礴碱𧘌辸袄𨬫𦂃𢘜禆褀椂禀𥡗禝𧬹礼禩渪𧄦㺨秆𩄍秔"] -] diff --git a/node_modules/mysql2/node_modules/iconv-lite/encodings/tables/cp936.json b/node_modules/mysql2/node_modules/iconv-lite/encodings/tables/cp936.json deleted file mode 100644 index 49ddb9a..0000000 --- a/node_modules/mysql2/node_modules/iconv-lite/encodings/tables/cp936.json +++ /dev/null @@ -1,264 +0,0 @@ -[ -["0","\u0000",127,"€"], -["8140","丂丄丅丆丏丒丗丟丠両丣並丩丮丯丱丳丵丷丼乀乁乂乄乆乊乑乕乗乚乛乢乣乤乥乧乨乪",5,"乲乴",9,"乿",6,"亇亊"], -["8180","亐亖亗亙亜亝亞亣亪亯亰亱亴亶亷亸亹亼亽亾仈仌仏仐仒仚仛仜仠仢仦仧仩仭仮仯仱仴仸仹仺仼仾伀伂",6,"伋伌伒",4,"伜伝伡伣伨伩伬伭伮伱伳伵伷伹伻伾",4,"佄佅佇",5,"佒佔佖佡佢佦佨佪佫佭佮佱佲併佷佸佹佺佽侀侁侂侅來侇侊侌侎侐侒侓侕侖侘侙侚侜侞侟価侢"], -["8240","侤侫侭侰",4,"侶",8,"俀俁係俆俇俈俉俋俌俍俒",4,"俙俛俠俢俤俥俧俫俬俰俲俴俵俶俷俹俻俼俽俿",11], -["8280","個倎倐們倓倕倖倗倛倝倞倠倢倣値倧倫倯",10,"倻倽倿偀偁偂偄偅偆偉偊偋偍偐",4,"偖偗偘偙偛偝",7,"偦",5,"偭",8,"偸偹偺偼偽傁傂傃傄傆傇傉傊傋傌傎",20,"傤傦傪傫傭",4,"傳",6,"傼"], -["8340","傽",17,"僐",5,"僗僘僙僛",10,"僨僩僪僫僯僰僱僲僴僶",4,"僼",9,"儈"], -["8380","儉儊儌",5,"儓",13,"儢",28,"兂兇兊兌兎兏児兒兓兗兘兙兛兝",4,"兣兤兦內兩兪兯兲兺兾兿冃冄円冇冊冋冎冏冐冑冓冔冘冚冝冞冟冡冣冦",4,"冭冮冴冸冹冺冾冿凁凂凃凅凈凊凍凎凐凒",5], -["8440","凘凙凚凜凞凟凢凣凥",5,"凬凮凱凲凴凷凾刄刅刉刋刌刏刐刓刔刕刜刞刟刡刢刣別刦刧刪刬刯刱刲刴刵刼刾剄",5,"剋剎剏剒剓剕剗剘"], -["8480","剙剚剛剝剟剠剢剣剤剦剨剫剬剭剮剰剱剳",9,"剾劀劃",4,"劉",6,"劑劒劔",6,"劜劤劥劦劧劮劯劰労",9,"勀勁勂勄勅勆勈勊勌勍勎勏勑勓勔動勗務",5,"勠勡勢勣勥",10,"勱",7,"勻勼勽匁匂匃匄匇匉匊匋匌匎"], -["8540","匑匒匓匔匘匛匜匞匟匢匤匥匧匨匩匫匬匭匯",9,"匼匽區卂卄卆卋卌卍卐協単卙卛卝卥卨卪卬卭卲卶卹卻卼卽卾厀厁厃厇厈厊厎厏"], -["8580","厐",4,"厖厗厙厛厜厞厠厡厤厧厪厫厬厭厯",6,"厷厸厹厺厼厽厾叀參",4,"収叏叐叒叓叕叚叜叝叞叡叢叧叴叺叾叿吀吂吅吇吋吔吘吙吚吜吢吤吥吪吰吳吶吷吺吽吿呁呂呄呅呇呉呌呍呎呏呑呚呝",4,"呣呥呧呩",7,"呴呹呺呾呿咁咃咅咇咈咉咊咍咑咓咗咘咜咞咟咠咡"], -["8640","咢咥咮咰咲咵咶咷咹咺咼咾哃哅哊哋哖哘哛哠",4,"哫哬哯哰哱哴",5,"哻哾唀唂唃唄唅唈唊",4,"唒唓唕",5,"唜唝唞唟唡唥唦"], -["8680","唨唩唫唭唲唴唵唶唸唹唺唻唽啀啂啅啇啈啋",4,"啑啒啓啔啗",4,"啝啞啟啠啢啣啨啩啫啯",5,"啹啺啽啿喅喆喌喍喎喐喒喓喕喖喗喚喛喞喠",6,"喨",8,"喲喴営喸喺喼喿",4,"嗆嗇嗈嗊嗋嗎嗏嗐嗕嗗",4,"嗞嗠嗢嗧嗩嗭嗮嗰嗱嗴嗶嗸",4,"嗿嘂嘃嘄嘅"], -["8740","嘆嘇嘊嘋嘍嘐",7,"嘙嘚嘜嘝嘠嘡嘢嘥嘦嘨嘩嘪嘫嘮嘯嘰嘳嘵嘷嘸嘺嘼嘽嘾噀",11,"噏",4,"噕噖噚噛噝",4], -["8780","噣噥噦噧噭噮噯噰噲噳噴噵噷噸噹噺噽",7,"嚇",6,"嚐嚑嚒嚔",14,"嚤",10,"嚰",6,"嚸嚹嚺嚻嚽",12,"囋",8,"囕囖囘囙囜団囥",5,"囬囮囯囲図囶囷囸囻囼圀圁圂圅圇國",6], -["8840","園",9,"圝圞圠圡圢圤圥圦圧圫圱圲圴",4,"圼圽圿坁坃坄坅坆坈坉坋坒",4,"坘坙坢坣坥坧坬坮坰坱坲坴坵坸坹坺坽坾坿垀"], -["8880","垁垇垈垉垊垍",4,"垔",6,"垜垝垞垟垥垨垪垬垯垰垱垳垵垶垷垹",8,"埄",6,"埌埍埐埑埓埖埗埛埜埞埡埢埣埥",7,"埮埰埱埲埳埵埶執埻埼埾埿堁堃堄堅堈堉堊堌堎堏堐堒堓堔堖堗堘堚堛堜堝堟堢堣堥",4,"堫",4,"報堲堳場堶",7], -["8940","堾",5,"塅",6,"塎塏塐塒塓塕塖塗塙",4,"塟",5,"塦",4,"塭",16,"塿墂墄墆墇墈墊墋墌"], -["8980","墍",4,"墔",4,"墛墜墝墠",7,"墪",17,"墽墾墿壀壂壃壄壆",10,"壒壓壔壖",13,"壥",5,"壭壯壱売壴壵壷壸壺",7,"夃夅夆夈",4,"夎夐夑夒夓夗夘夛夝夞夠夡夢夣夦夨夬夰夲夳夵夶夻"], -["8a40","夽夾夿奀奃奅奆奊奌奍奐奒奓奙奛",4,"奡奣奤奦",12,"奵奷奺奻奼奾奿妀妅妉妋妌妎妏妐妑妔妕妘妚妛妜妝妟妠妡妢妦"], -["8a80","妧妬妭妰妱妳",5,"妺妼妽妿",6,"姇姈姉姌姍姎姏姕姖姙姛姞",4,"姤姦姧姩姪姫姭",11,"姺姼姽姾娀娂娊娋娍娎娏娐娒娔娕娖娗娙娚娛娝娞娡娢娤娦娧娨娪",6,"娳娵娷",4,"娽娾娿婁",4,"婇婈婋",9,"婖婗婘婙婛",5], -["8b40","婡婣婤婥婦婨婩婫",8,"婸婹婻婼婽婾媀",17,"媓",6,"媜",13,"媫媬"], -["8b80","媭",4,"媴媶媷媹",4,"媿嫀嫃",5,"嫊嫋嫍",4,"嫓嫕嫗嫙嫚嫛嫝嫞嫟嫢嫤嫥嫧嫨嫪嫬",4,"嫲",22,"嬊",11,"嬘",25,"嬳嬵嬶嬸",7,"孁",6], -["8c40","孈",7,"孒孖孞孠孡孧孨孫孭孮孯孲孴孶孷學孹孻孼孾孿宂宆宊宍宎宐宑宒宔宖実宧宨宩宬宭宮宯宱宲宷宺宻宼寀寁寃寈寉寊寋寍寎寏"], -["8c80","寑寔",8,"寠寢寣實寧審",4,"寯寱",6,"寽対尀専尃尅將專尋尌對導尐尒尓尗尙尛尞尟尠尡尣尦尨尩尪尫尭尮尯尰尲尳尵尶尷屃屄屆屇屌屍屒屓屔屖屗屘屚屛屜屝屟屢層屧",6,"屰屲",6,"屻屼屽屾岀岃",4,"岉岊岋岎岏岒岓岕岝",4,"岤",4], -["8d40","岪岮岯岰岲岴岶岹岺岻岼岾峀峂峃峅",5,"峌",5,"峓",5,"峚",6,"峢峣峧峩峫峬峮峯峱",9,"峼",4], -["8d80","崁崄崅崈",5,"崏",4,"崕崗崘崙崚崜崝崟",4,"崥崨崪崫崬崯",4,"崵",7,"崿",7,"嵈嵉嵍",10,"嵙嵚嵜嵞",10,"嵪嵭嵮嵰嵱嵲嵳嵵",12,"嶃",21,"嶚嶛嶜嶞嶟嶠"], -["8e40","嶡",21,"嶸",12,"巆",6,"巎",12,"巜巟巠巣巤巪巬巭"], -["8e80","巰巵巶巸",4,"巿帀帄帇帉帊帋帍帎帒帓帗帞",7,"帨",4,"帯帰帲",4,"帹帺帾帿幀幁幃幆",5,"幍",6,"幖",4,"幜幝幟幠幣",14,"幵幷幹幾庁庂広庅庈庉庌庍庎庒庘庛庝庡庢庣庤庨",4,"庮",4,"庴庺庻庼庽庿",6], -["8f40","廆廇廈廋",5,"廔廕廗廘廙廚廜",11,"廩廫",8,"廵廸廹廻廼廽弅弆弇弉弌弍弎弐弒弔弖弙弚弜弝弞弡弢弣弤"], -["8f80","弨弫弬弮弰弲",6,"弻弽弾弿彁",14,"彑彔彙彚彛彜彞彟彠彣彥彧彨彫彮彯彲彴彵彶彸彺彽彾彿徃徆徍徎徏徑従徔徖徚徛徝從徟徠徢",5,"復徫徬徯",5,"徶徸徹徺徻徾",4,"忇忈忊忋忎忓忔忕忚忛応忞忟忢忣忥忦忨忩忬忯忰忲忳忴忶忷忹忺忼怇"], -["9040","怈怉怋怌怐怑怓怗怘怚怞怟怢怣怤怬怭怮怰",4,"怶",4,"怽怾恀恄",6,"恌恎恏恑恓恔恖恗恘恛恜恞恟恠恡恥恦恮恱恲恴恵恷恾悀"], -["9080","悁悂悅悆悇悈悊悋悎悏悐悑悓悕悗悘悙悜悞悡悢悤悥悧悩悪悮悰悳悵悶悷悹悺悽",7,"惇惈惉惌",4,"惒惓惔惖惗惙惛惞惡",4,"惪惱惲惵惷惸惻",4,"愂愃愄愅愇愊愋愌愐",4,"愖愗愘愙愛愜愝愞愡愢愥愨愩愪愬",18,"慀",6], -["9140","慇慉態慍慏慐慒慓慔慖",6,"慞慟慠慡慣慤慥慦慩",6,"慱慲慳慴慶慸",18,"憌憍憏",4,"憕"], -["9180","憖",6,"憞",8,"憪憫憭",9,"憸",5,"憿懀懁懃",4,"應懌",4,"懓懕",16,"懧",13,"懶",8,"戀",5,"戇戉戓戔戙戜戝戞戠戣戦戧戨戩戫戭戯戰戱戲戵戶戸",4,"扂扄扅扆扊"], -["9240","扏扐払扖扗扙扚扜",6,"扤扥扨扱扲扴扵扷扸扺扻扽抁抂抃抅抆抇抈抋",5,"抔抙抜抝択抣抦抧抩抪抭抮抯抰抲抳抴抶抷抸抺抾拀拁"], -["9280","拃拋拏拑拕拝拞拠拡拤拪拫拰拲拵拸拹拺拻挀挃挄挅挆挊挋挌挍挏挐挒挓挔挕挗挘挙挜挦挧挩挬挭挮挰挱挳",5,"挻挼挾挿捀捁捄捇捈捊捑捒捓捔捖",7,"捠捤捥捦捨捪捫捬捯捰捲捳捴捵捸捹捼捽捾捿掁掃掄掅掆掋掍掑掓掔掕掗掙",6,"採掤掦掫掯掱掲掵掶掹掻掽掿揀"], -["9340","揁揂揃揅揇揈揊揋揌揑揓揔揕揗",6,"揟揢揤",4,"揫揬揮揯揰揱揳揵揷揹揺揻揼揾搃搄搆",4,"損搎搑搒搕",5,"搝搟搢搣搤"], -["9380","搥搧搨搩搫搮",5,"搵",4,"搻搼搾摀摂摃摉摋",6,"摓摕摖摗摙",4,"摟",7,"摨摪摫摬摮",9,"摻",6,"撃撆撈",8,"撓撔撗撘撚撛撜撝撟",4,"撥撦撧撨撪撫撯撱撲撳撴撶撹撻撽撾撿擁擃擄擆",6,"擏擑擓擔擕擖擙據"], -["9440","擛擜擝擟擠擡擣擥擧",24,"攁",7,"攊",7,"攓",4,"攙",8], -["9480","攢攣攤攦",4,"攬攭攰攱攲攳攷攺攼攽敀",4,"敆敇敊敋敍敎敐敒敓敔敗敘敚敜敟敠敡敤敥敧敨敩敪敭敮敯敱敳敵敶數",14,"斈斉斊斍斎斏斒斔斕斖斘斚斝斞斠斢斣斦斨斪斬斮斱",7,"斺斻斾斿旀旂旇旈旉旊旍旐旑旓旔旕旘",7,"旡旣旤旪旫"], -["9540","旲旳旴旵旸旹旻",4,"昁昄昅昇昈昉昋昍昐昑昒昖昗昘昚昛昜昞昡昢昣昤昦昩昪昫昬昮昰昲昳昷",4,"昽昿晀時晄",6,"晍晎晐晑晘"], -["9580","晙晛晜晝晞晠晢晣晥晧晩",4,"晱晲晳晵晸晹晻晼晽晿暀暁暃暅暆暈暉暊暋暍暎暏暐暒暓暔暕暘",4,"暞",8,"暩",4,"暯",4,"暵暶暷暸暺暻暼暽暿",25,"曚曞",7,"曧曨曪",5,"曱曵曶書曺曻曽朁朂會"], -["9640","朄朅朆朇朌朎朏朑朒朓朖朘朙朚朜朞朠",5,"朧朩朮朰朲朳朶朷朸朹朻朼朾朿杁杄杅杇杊杋杍杒杔杕杗",4,"杝杢杣杤杦杧杫杬杮東杴杶"], -["9680","杸杹杺杻杽枀枂枃枅枆枈枊枌枍枎枏枑枒枓枔枖枙枛枟枠枡枤枦枩枬枮枱枲枴枹",7,"柂柅",9,"柕柖柗柛柟柡柣柤柦柧柨柪柫柭柮柲柵",7,"柾栁栂栃栄栆栍栐栒栔栕栘",4,"栞栟栠栢",6,"栫",6,"栴栵栶栺栻栿桇桋桍桏桒桖",5], -["9740","桜桝桞桟桪桬",7,"桵桸",8,"梂梄梇",7,"梐梑梒梔梕梖梘",9,"梣梤梥梩梪梫梬梮梱梲梴梶梷梸"], -["9780","梹",6,"棁棃",5,"棊棌棎棏棐棑棓棔棖棗棙棛",4,"棡棢棤",9,"棯棲棳棴棶棷棸棻棽棾棿椀椂椃椄椆",4,"椌椏椑椓",11,"椡椢椣椥",7,"椮椯椱椲椳椵椶椷椸椺椻椼椾楀楁楃",16,"楕楖楘楙楛楜楟"], -["9840","楡楢楤楥楧楨楩楪楬業楯楰楲",4,"楺楻楽楾楿榁榃榅榊榋榌榎",5,"榖榗榙榚榝",9,"榩榪榬榮榯榰榲榳榵榶榸榹榺榼榽"], -["9880","榾榿槀槂",7,"構槍槏槑槒槓槕",5,"槜槝槞槡",11,"槮槯槰槱槳",9,"槾樀",9,"樋",11,"標",5,"樠樢",5,"権樫樬樭樮樰樲樳樴樶",6,"樿",4,"橅橆橈",7,"橑",6,"橚"], -["9940","橜",4,"橢橣橤橦",10,"橲",6,"橺橻橽橾橿檁檂檃檅",8,"檏檒",4,"檘",7,"檡",5], -["9980","檧檨檪檭",114,"欥欦欨",6], -["9a40","欯欰欱欳欴欵欶欸欻欼欽欿歀歁歂歄歅歈歊歋歍",11,"歚",7,"歨歩歫",13,"歺歽歾歿殀殅殈"], -["9a80","殌殎殏殐殑殔殕殗殘殙殜",4,"殢",7,"殫",7,"殶殸",6,"毀毃毄毆",4,"毌毎毐毑毘毚毜",4,"毢",7,"毬毭毮毰毱毲毴毶毷毸毺毻毼毾",6,"氈",4,"氎氒気氜氝氞氠氣氥氫氬氭氱氳氶氷氹氺氻氼氾氿汃汄汅汈汋",4,"汑汒汓汖汘"], -["9b40","汙汚汢汣汥汦汧汫",4,"汱汳汵汷汸決汻汼汿沀沄沇沊沋沍沎沑沒沕沖沗沘沚沜沝沞沠沢沨沬沯沰沴沵沶沷沺泀況泂泃泆泇泈泋泍泎泏泑泒泘"], -["9b80","泙泚泜泝泟泤泦泧泩泬泭泲泴泹泿洀洂洃洅洆洈洉洊洍洏洐洑洓洔洕洖洘洜洝洟",5,"洦洨洩洬洭洯洰洴洶洷洸洺洿浀浂浄浉浌浐浕浖浗浘浛浝浟浡浢浤浥浧浨浫浬浭浰浱浲浳浵浶浹浺浻浽",4,"涃涄涆涇涊涋涍涏涐涒涖",4,"涜涢涥涬涭涰涱涳涴涶涷涹",5,"淁淂淃淈淉淊"], -["9c40","淍淎淏淐淒淓淔淕淗淚淛淜淟淢淣淥淧淨淩淪淭淯淰淲淴淵淶淸淺淽",7,"渆渇済渉渋渏渒渓渕渘渙減渜渞渟渢渦渧渨渪測渮渰渱渳渵"], -["9c80","渶渷渹渻",7,"湅",7,"湏湐湑湒湕湗湙湚湜湝湞湠",10,"湬湭湯",14,"満溁溂溄溇溈溊",4,"溑",6,"溙溚溛溝溞溠溡溣溤溦溨溩溫溬溭溮溰溳溵溸溹溼溾溿滀滃滄滅滆滈滉滊滌滍滎滐滒滖滘滙滛滜滝滣滧滪",5], -["9d40","滰滱滲滳滵滶滷滸滺",7,"漃漄漅漇漈漊",4,"漐漑漒漖",9,"漡漢漣漥漦漧漨漬漮漰漲漴漵漷",6,"漿潀潁潂"], -["9d80","潃潄潅潈潉潊潌潎",9,"潙潚潛潝潟潠潡潣潤潥潧",5,"潯潰潱潳潵潶潷潹潻潽",6,"澅澆澇澊澋澏",12,"澝澞澟澠澢",4,"澨",10,"澴澵澷澸澺",5,"濁濃",5,"濊",6,"濓",10,"濟濢濣濤濥"], -["9e40","濦",7,"濰",32,"瀒",7,"瀜",6,"瀤",6], -["9e80","瀫",9,"瀶瀷瀸瀺",17,"灍灎灐",13,"灟",11,"灮灱灲灳灴灷灹灺灻災炁炂炃炄炆炇炈炋炌炍炏炐炑炓炗炘炚炛炞",12,"炰炲炴炵炶為炾炿烄烅烆烇烉烋",12,"烚"], -["9f40","烜烝烞烠烡烢烣烥烪烮烰",6,"烸烺烻烼烾",10,"焋",4,"焑焒焔焗焛",10,"焧",7,"焲焳焴"], -["9f80","焵焷",13,"煆煇煈煉煋煍煏",12,"煝煟",4,"煥煩",4,"煯煰煱煴煵煶煷煹煻煼煾",5,"熅",4,"熋熌熍熎熐熑熒熓熕熖熗熚",4,"熡",6,"熩熪熫熭",5,"熴熶熷熸熺",8,"燄",9,"燏",4], -["a040","燖",9,"燡燢燣燤燦燨",5,"燯",9,"燺",11,"爇",19], -["a080","爛爜爞",9,"爩爫爭爮爯爲爳爴爺爼爾牀",6,"牉牊牋牎牏牐牑牓牔牕牗牘牚牜牞牠牣牤牥牨牪牫牬牭牰牱牳牴牶牷牸牻牼牽犂犃犅",4,"犌犎犐犑犓",11,"犠",11,"犮犱犲犳犵犺",6,"狅狆狇狉狊狋狌狏狑狓狔狕狖狘狚狛"], -["a1a1"," 、。·ˉˇ¨〃々—~‖…‘’“”〔〕〈",7,"〖〗【】±×÷∶∧∨∑∏∪∩∈∷√⊥∥∠⌒⊙∫∮≡≌≈∽∝≠≮≯≤≥∞∵∴♂♀°′″℃$¤¢£‰§№☆★○●◎◇◆□■△▲※→←↑↓〓"], -["a2a1","ⅰ",9], -["a2b1","⒈",19,"⑴",19,"①",9], -["a2e5","㈠",9], -["a2f1","Ⅰ",11], -["a3a1","!"#¥%",88," ̄"], -["a4a1","ぁ",82], -["a5a1","ァ",85], -["a6a1","Α",16,"Σ",6], -["a6c1","α",16,"σ",6], -["a6e0","︵︶︹︺︿﹀︽︾﹁﹂﹃﹄"], -["a6ee","︻︼︷︸︱"], -["a6f4","︳︴"], -["a7a1","А",5,"ЁЖ",25], -["a7d1","а",5,"ёж",25], -["a840","ˊˋ˙–―‥‵℅℉↖↗↘↙∕∟∣≒≦≧⊿═",35,"▁",6], -["a880","█",7,"▓▔▕▼▽◢◣◤◥☉⊕〒〝〞"], -["a8a1","āáǎàēéěèīíǐìōóǒòūúǔùǖǘǚǜüêɑ"], -["a8bd","ńň"], -["a8c0","ɡ"], -["a8c5","ㄅ",36], -["a940","〡",8,"㊣㎎㎏㎜㎝㎞㎡㏄㏎㏑㏒㏕︰¬¦"], -["a959","℡㈱"], -["a95c","‐"], -["a960","ー゛゜ヽヾ〆ゝゞ﹉",9,"﹔﹕﹖﹗﹙",8], -["a980","﹢",4,"﹨﹩﹪﹫"], -["a996","〇"], -["a9a4","─",75], -["aa40","狜狝狟狢",5,"狪狫狵狶狹狽狾狿猀猂猄",5,"猋猌猍猏猐猑猒猔猘猙猚猟猠猣猤猦猧猨猭猯猰猲猳猵猶猺猻猼猽獀",8], -["aa80","獉獊獋獌獎獏獑獓獔獕獖獘",7,"獡",10,"獮獰獱"], -["ab40","獲",11,"獿",4,"玅玆玈玊玌玍玏玐玒玓玔玕玗玘玙玚玜玝玞玠玡玣",5,"玪玬玭玱玴玵玶玸玹玼玽玾玿珁珃",4], -["ab80","珋珌珎珒",6,"珚珛珜珝珟珡珢珣珤珦珨珪珫珬珮珯珰珱珳",4], -["ac40","珸",10,"琄琇琈琋琌琍琎琑",8,"琜",5,"琣琤琧琩琫琭琯琱琲琷",4,"琽琾琿瑀瑂",11], -["ac80","瑎",6,"瑖瑘瑝瑠",12,"瑮瑯瑱",4,"瑸瑹瑺"], -["ad40","瑻瑼瑽瑿璂璄璅璆璈璉璊璌璍璏璑",10,"璝璟",7,"璪",15,"璻",12], -["ad80","瓈",9,"瓓",8,"瓝瓟瓡瓥瓧",6,"瓰瓱瓲"], -["ae40","瓳瓵瓸",6,"甀甁甂甃甅",7,"甎甐甒甔甕甖甗甛甝甞甠",4,"甦甧甪甮甴甶甹甼甽甿畁畂畃畄畆畇畉畊畍畐畑畒畓畕畖畗畘"], -["ae80","畝",7,"畧畨畩畫",6,"畳畵當畷畺",4,"疀疁疂疄疅疇"], -["af40","疈疉疊疌疍疎疐疓疕疘疛疜疞疢疦",4,"疭疶疷疺疻疿痀痁痆痋痌痎痏痐痑痓痗痙痚痜痝痟痠痡痥痩痬痭痮痯痲痳痵痶痷痸痺痻痽痾瘂瘄瘆瘇"], -["af80","瘈瘉瘋瘍瘎瘏瘑瘒瘓瘔瘖瘚瘜瘝瘞瘡瘣瘧瘨瘬瘮瘯瘱瘲瘶瘷瘹瘺瘻瘽癁療癄"], -["b040","癅",6,"癎",5,"癕癗",4,"癝癟癠癡癢癤",6,"癬癭癮癰",7,"癹発發癿皀皁皃皅皉皊皌皍皏皐皒皔皕皗皘皚皛"], -["b080","皜",7,"皥",8,"皯皰皳皵",9,"盀盁盃啊阿埃挨哎唉哀皑癌蔼矮艾碍爱隘鞍氨安俺按暗岸胺案肮昂盎凹敖熬翱袄傲奥懊澳芭捌扒叭吧笆八疤巴拔跋靶把耙坝霸罢爸白柏百摆佰败拜稗斑班搬扳般颁板版扮拌伴瓣半办绊邦帮梆榜膀绑棒磅蚌镑傍谤苞胞包褒剥"], -["b140","盄盇盉盋盌盓盕盙盚盜盝盞盠",4,"盦",7,"盰盳盵盶盷盺盻盽盿眀眂眃眅眆眊県眎",10,"眛眜眝眞眡眣眤眥眧眪眫"], -["b180","眬眮眰",4,"眹眻眽眾眿睂睄睅睆睈",7,"睒",7,"睜薄雹保堡饱宝抱报暴豹鲍爆杯碑悲卑北辈背贝钡倍狈备惫焙被奔苯本笨崩绷甭泵蹦迸逼鼻比鄙笔彼碧蓖蔽毕毙毖币庇痹闭敝弊必辟壁臂避陛鞭边编贬扁便变卞辨辩辫遍标彪膘表鳖憋别瘪彬斌濒滨宾摈兵冰柄丙秉饼炳"], -["b240","睝睞睟睠睤睧睩睪睭",11,"睺睻睼瞁瞂瞃瞆",5,"瞏瞐瞓",11,"瞡瞣瞤瞦瞨瞫瞭瞮瞯瞱瞲瞴瞶",4], -["b280","瞼瞾矀",12,"矎",8,"矘矙矚矝",4,"矤病并玻菠播拨钵波博勃搏铂箔伯帛舶脖膊渤泊驳捕卜哺补埠不布步簿部怖擦猜裁材才财睬踩采彩菜蔡餐参蚕残惭惨灿苍舱仓沧藏操糙槽曹草厕策侧册测层蹭插叉茬茶查碴搽察岔差诧拆柴豺搀掺蝉馋谗缠铲产阐颤昌猖"], -["b340","矦矨矪矯矰矱矲矴矵矷矹矺矻矼砃",5,"砊砋砎砏砐砓砕砙砛砞砠砡砢砤砨砪砫砮砯砱砲砳砵砶砽砿硁硂硃硄硆硈硉硊硋硍硏硑硓硔硘硙硚"], -["b380","硛硜硞",11,"硯",7,"硸硹硺硻硽",6,"场尝常长偿肠厂敞畅唱倡超抄钞朝嘲潮巢吵炒车扯撤掣彻澈郴臣辰尘晨忱沉陈趁衬撑称城橙成呈乘程惩澄诚承逞骋秤吃痴持匙池迟弛驰耻齿侈尺赤翅斥炽充冲虫崇宠抽酬畴踌稠愁筹仇绸瞅丑臭初出橱厨躇锄雏滁除楚"], -["b440","碄碅碆碈碊碋碏碐碒碔碕碖碙碝碞碠碢碤碦碨",7,"碵碶碷碸確碻碼碽碿磀磂磃磄磆磇磈磌磍磎磏磑磒磓磖磗磘磚",9], -["b480","磤磥磦磧磩磪磫磭",4,"磳磵磶磸磹磻",5,"礂礃礄礆",6,"础储矗搐触处揣川穿椽传船喘串疮窗幢床闯创吹炊捶锤垂春椿醇唇淳纯蠢戳绰疵茨磁雌辞慈瓷词此刺赐次聪葱囱匆从丛凑粗醋簇促蹿篡窜摧崔催脆瘁粹淬翠村存寸磋撮搓措挫错搭达答瘩打大呆歹傣戴带殆代贷袋待逮"], -["b540","礍",5,"礔",9,"礟",4,"礥",14,"礵",4,"礽礿祂祃祄祅祇祊",8,"祔祕祘祙祡祣"], -["b580","祤祦祩祪祫祬祮祰",6,"祹祻",4,"禂禃禆禇禈禉禋禌禍禎禐禑禒怠耽担丹单郸掸胆旦氮但惮淡诞弹蛋当挡党荡档刀捣蹈倒岛祷导到稻悼道盗德得的蹬灯登等瞪凳邓堤低滴迪敌笛狄涤翟嫡抵底地蒂第帝弟递缔颠掂滇碘点典靛垫电佃甸店惦奠淀殿碉叼雕凋刁掉吊钓调跌爹碟蝶迭谍叠"], -["b640","禓",6,"禛",11,"禨",10,"禴",4,"禼禿秂秄秅秇秈秊秌秎秏秐秓秔秖秗秙",5,"秠秡秢秥秨秪"], -["b680","秬秮秱",6,"秹秺秼秾秿稁稄稅稇稈稉稊稌稏",4,"稕稖稘稙稛稜丁盯叮钉顶鼎锭定订丢东冬董懂动栋侗恫冻洞兜抖斗陡豆逗痘都督毒犊独读堵睹赌杜镀肚度渡妒端短锻段断缎堆兑队对墩吨蹲敦顿囤钝盾遁掇哆多夺垛躲朵跺舵剁惰堕蛾峨鹅俄额讹娥恶厄扼遏鄂饿恩而儿耳尔饵洱二"], -["b740","稝稟稡稢稤",14,"稴稵稶稸稺稾穀",5,"穇",9,"穒",4,"穘",16], -["b780","穩",6,"穱穲穳穵穻穼穽穾窂窅窇窉窊窋窌窎窏窐窓窔窙窚窛窞窡窢贰发罚筏伐乏阀法珐藩帆番翻樊矾钒繁凡烦反返范贩犯饭泛坊芳方肪房防妨仿访纺放菲非啡飞肥匪诽吠肺废沸费芬酚吩氛分纷坟焚汾粉奋份忿愤粪丰封枫蜂峰锋风疯烽逢冯缝讽奉凤佛否夫敷肤孵扶拂辐幅氟符伏俘服"], -["b840","窣窤窧窩窪窫窮",4,"窴",10,"竀",10,"竌",9,"竗竘竚竛竜竝竡竢竤竧",5,"竮竰竱竲竳"], -["b880","竴",4,"竻竼竾笀笁笂笅笇笉笌笍笎笐笒笓笖笗笘笚笜笝笟笡笢笣笧笩笭浮涪福袱弗甫抚辅俯釜斧脯腑府腐赴副覆赋复傅付阜父腹负富讣附妇缚咐噶嘎该改概钙盖溉干甘杆柑竿肝赶感秆敢赣冈刚钢缸肛纲岗港杠篙皋高膏羔糕搞镐稿告哥歌搁戈鸽胳疙割革葛格蛤阁隔铬个各给根跟耕更庚羹"], -["b940","笯笰笲笴笵笶笷笹笻笽笿",5,"筆筈筊筍筎筓筕筗筙筜筞筟筡筣",10,"筯筰筳筴筶筸筺筼筽筿箁箂箃箄箆",6,"箎箏"], -["b980","箑箒箓箖箘箙箚箛箞箟箠箣箤箥箮箯箰箲箳箵箶箷箹",7,"篂篃範埂耿梗工攻功恭龚供躬公宫弓巩汞拱贡共钩勾沟苟狗垢构购够辜菇咕箍估沽孤姑鼓古蛊骨谷股故顾固雇刮瓜剐寡挂褂乖拐怪棺关官冠观管馆罐惯灌贯光广逛瑰规圭硅归龟闺轨鬼诡癸桂柜跪贵刽辊滚棍锅郭国果裹过哈"], -["ba40","篅篈築篊篋篍篎篏篐篒篔",4,"篛篜篞篟篠篢篣篤篧篨篩篫篬篭篯篰篲",4,"篸篹篺篻篽篿",7,"簈簉簊簍簎簐",5,"簗簘簙"], -["ba80","簚",4,"簠",5,"簨簩簫",12,"簹",5,"籂骸孩海氦亥害骇酣憨邯韩含涵寒函喊罕翰撼捍旱憾悍焊汗汉夯杭航壕嚎豪毫郝好耗号浩呵喝荷菏核禾和何合盒貉阂河涸赫褐鹤贺嘿黑痕很狠恨哼亨横衡恒轰哄烘虹鸿洪宏弘红喉侯猴吼厚候后呼乎忽瑚壶葫胡蝴狐糊湖"], -["bb40","籃",9,"籎",36,"籵",5,"籾",9], -["bb80","粈粊",6,"粓粔粖粙粚粛粠粡粣粦粧粨粩粫粬粭粯粰粴",4,"粺粻弧虎唬护互沪户花哗华猾滑画划化话槐徊怀淮坏欢环桓还缓换患唤痪豢焕涣宦幻荒慌黄磺蝗簧皇凰惶煌晃幌恍谎灰挥辉徽恢蛔回毁悔慧卉惠晦贿秽会烩汇讳诲绘荤昏婚魂浑混豁活伙火获或惑霍货祸击圾基机畸稽积箕"], -["bc40","粿糀糂糃糄糆糉糋糎",6,"糘糚糛糝糞糡",6,"糩",5,"糰",7,"糹糺糼",13,"紋",5], -["bc80","紑",14,"紡紣紤紥紦紨紩紪紬紭紮細",6,"肌饥迹激讥鸡姬绩缉吉极棘辑籍集及急疾汲即嫉级挤几脊己蓟技冀季伎祭剂悸济寄寂计记既忌际妓继纪嘉枷夹佳家加荚颊贾甲钾假稼价架驾嫁歼监坚尖笺间煎兼肩艰奸缄茧检柬碱硷拣捡简俭剪减荐槛鉴践贱见键箭件"], -["bd40","紷",54,"絯",7], -["bd80","絸",32,"健舰剑饯渐溅涧建僵姜将浆江疆蒋桨奖讲匠酱降蕉椒礁焦胶交郊浇骄娇嚼搅铰矫侥脚狡角饺缴绞剿教酵轿较叫窖揭接皆秸街阶截劫节桔杰捷睫竭洁结解姐戒藉芥界借介疥诫届巾筋斤金今津襟紧锦仅谨进靳晋禁近烬浸"], -["be40","継",12,"綧",6,"綯",42], -["be80","線",32,"尽劲荆兢茎睛晶鲸京惊精粳经井警景颈静境敬镜径痉靖竟竞净炯窘揪究纠玖韭久灸九酒厩救旧臼舅咎就疚鞠拘狙疽居驹菊局咀矩举沮聚拒据巨具距踞锯俱句惧炬剧捐鹃娟倦眷卷绢撅攫抉掘倔爵觉决诀绝均菌钧军君峻"], -["bf40","緻",62], -["bf80","縺縼",4,"繂",4,"繈",21,"俊竣浚郡骏喀咖卡咯开揩楷凯慨刊堪勘坎砍看康慷糠扛抗亢炕考拷烤靠坷苛柯棵磕颗科壳咳可渴克刻客课肯啃垦恳坑吭空恐孔控抠口扣寇枯哭窟苦酷库裤夸垮挎跨胯块筷侩快宽款匡筐狂框矿眶旷况亏盔岿窥葵奎魁傀"], -["c040","繞",35,"纃",23,"纜纝纞"], -["c080","纮纴纻纼绖绤绬绹缊缐缞缷缹缻",6,"罃罆",9,"罒罓馈愧溃坤昆捆困括扩廓阔垃拉喇蜡腊辣啦莱来赖蓝婪栏拦篮阑兰澜谰揽览懒缆烂滥琅榔狼廊郎朗浪捞劳牢老佬姥酪烙涝勒乐雷镭蕾磊累儡垒擂肋类泪棱楞冷厘梨犁黎篱狸离漓理李里鲤礼莉荔吏栗丽厉励砾历利傈例俐"], -["c140","罖罙罛罜罝罞罠罣",4,"罫罬罭罯罰罳罵罶罷罸罺罻罼罽罿羀羂",7,"羋羍羏",4,"羕",4,"羛羜羠羢羣羥羦羨",6,"羱"], -["c180","羳",4,"羺羻羾翀翂翃翄翆翇翈翉翋翍翏",4,"翖翗翙",5,"翢翣痢立粒沥隶力璃哩俩联莲连镰廉怜涟帘敛脸链恋炼练粮凉梁粱良两辆量晾亮谅撩聊僚疗燎寥辽潦了撂镣廖料列裂烈劣猎琳林磷霖临邻鳞淋凛赁吝拎玲菱零龄铃伶羚凌灵陵岭领另令溜琉榴硫馏留刘瘤流柳六龙聋咙笼窿"], -["c240","翤翧翨翪翫翬翭翯翲翴",6,"翽翾翿耂耇耈耉耊耎耏耑耓耚耛耝耞耟耡耣耤耫",5,"耲耴耹耺耼耾聀聁聄聅聇聈聉聎聏聐聑聓聕聖聗"], -["c280","聙聛",13,"聫",5,"聲",11,"隆垄拢陇楼娄搂篓漏陋芦卢颅庐炉掳卤虏鲁麓碌露路赂鹿潞禄录陆戮驴吕铝侣旅履屡缕虑氯律率滤绿峦挛孪滦卵乱掠略抡轮伦仑沦纶论萝螺罗逻锣箩骡裸落洛骆络妈麻玛码蚂马骂嘛吗埋买麦卖迈脉瞒馒蛮满蔓曼慢漫"], -["c340","聾肁肂肅肈肊肍",5,"肔肕肗肙肞肣肦肧肨肬肰肳肵肶肸肹肻胅胇",4,"胏",6,"胘胟胠胢胣胦胮胵胷胹胻胾胿脀脁脃脄脅脇脈脋"], -["c380","脌脕脗脙脛脜脝脟",12,"脭脮脰脳脴脵脷脹",4,"脿谩芒茫盲氓忙莽猫茅锚毛矛铆卯茂冒帽貌贸么玫枚梅酶霉煤没眉媒镁每美昧寐妹媚门闷们萌蒙檬盟锰猛梦孟眯醚靡糜迷谜弥米秘觅泌蜜密幂棉眠绵冕免勉娩缅面苗描瞄藐秒渺庙妙蔑灭民抿皿敏悯闽明螟鸣铭名命谬摸"], -["c440","腀",5,"腇腉腍腎腏腒腖腗腘腛",4,"腡腢腣腤腦腨腪腫腬腯腲腳腵腶腷腸膁膃",4,"膉膋膌膍膎膐膒",5,"膙膚膞",4,"膤膥"], -["c480","膧膩膫",7,"膴",5,"膼膽膾膿臄臅臇臈臉臋臍",6,"摹蘑模膜磨摩魔抹末莫墨默沫漠寞陌谋牟某拇牡亩姆母墓暮幕募慕木目睦牧穆拿哪呐钠那娜纳氖乃奶耐奈南男难囊挠脑恼闹淖呢馁内嫩能妮霓倪泥尼拟你匿腻逆溺蔫拈年碾撵捻念娘酿鸟尿捏聂孽啮镊镍涅您柠狞凝宁"], -["c540","臔",14,"臤臥臦臨臩臫臮",4,"臵",5,"臽臿舃與",4,"舎舏舑舓舕",5,"舝舠舤舥舦舧舩舮舲舺舼舽舿"], -["c580","艀艁艂艃艅艆艈艊艌艍艎艐",7,"艙艛艜艝艞艠",7,"艩拧泞牛扭钮纽脓浓农弄奴努怒女暖虐疟挪懦糯诺哦欧鸥殴藕呕偶沤啪趴爬帕怕琶拍排牌徘湃派攀潘盘磐盼畔判叛乓庞旁耪胖抛咆刨炮袍跑泡呸胚培裴赔陪配佩沛喷盆砰抨烹澎彭蓬棚硼篷膨朋鹏捧碰坯砒霹批披劈琵毗"], -["c640","艪艫艬艭艱艵艶艷艸艻艼芀芁芃芅芆芇芉芌芐芓芔芕芖芚芛芞芠芢芣芧芲芵芶芺芻芼芿苀苂苃苅苆苉苐苖苙苚苝苢苧苨苩苪苬苭苮苰苲苳苵苶苸"], -["c680","苺苼",4,"茊茋茍茐茒茓茖茘茙茝",9,"茩茪茮茰茲茷茻茽啤脾疲皮匹痞僻屁譬篇偏片骗飘漂瓢票撇瞥拼频贫品聘乒坪苹萍平凭瓶评屏坡泼颇婆破魄迫粕剖扑铺仆莆葡菩蒲埔朴圃普浦谱曝瀑期欺栖戚妻七凄漆柒沏其棋奇歧畦崎脐齐旗祈祁骑起岂乞企启契砌器气迄弃汽泣讫掐"], -["c740","茾茿荁荂荄荅荈荊",4,"荓荕",4,"荝荢荰",6,"荹荺荾",6,"莇莈莊莋莌莍莏莐莑莔莕莖莗莙莚莝莟莡",6,"莬莭莮"], -["c780","莯莵莻莾莿菂菃菄菆菈菉菋菍菎菐菑菒菓菕菗菙菚菛菞菢菣菤菦菧菨菫菬菭恰洽牵扦钎铅千迁签仟谦乾黔钱钳前潜遣浅谴堑嵌欠歉枪呛腔羌墙蔷强抢橇锹敲悄桥瞧乔侨巧鞘撬翘峭俏窍切茄且怯窃钦侵亲秦琴勤芹擒禽寝沁青轻氢倾卿清擎晴氰情顷请庆琼穷秋丘邱球求囚酋泅趋区蛆曲躯屈驱渠"], -["c840","菮華菳",4,"菺菻菼菾菿萀萂萅萇萈萉萊萐萒",5,"萙萚萛萞",5,"萩",7,"萲",5,"萹萺萻萾",7,"葇葈葉"], -["c880","葊",6,"葒",4,"葘葝葞葟葠葢葤",4,"葪葮葯葰葲葴葷葹葻葼取娶龋趣去圈颧权醛泉全痊拳犬券劝缺炔瘸却鹊榷确雀裙群然燃冉染瓤壤攘嚷让饶扰绕惹热壬仁人忍韧任认刃妊纫扔仍日戎茸蓉荣融熔溶容绒冗揉柔肉茹蠕儒孺如辱乳汝入褥软阮蕊瑞锐闰润若弱撒洒萨腮鳃塞赛三叁"], -["c940","葽",4,"蒃蒄蒅蒆蒊蒍蒏",7,"蒘蒚蒛蒝蒞蒟蒠蒢",12,"蒰蒱蒳蒵蒶蒷蒻蒼蒾蓀蓂蓃蓅蓆蓇蓈蓋蓌蓎蓏蓒蓔蓕蓗"], -["c980","蓘",4,"蓞蓡蓢蓤蓧",4,"蓭蓮蓯蓱",10,"蓽蓾蔀蔁蔂伞散桑嗓丧搔骚扫嫂瑟色涩森僧莎砂杀刹沙纱傻啥煞筛晒珊苫杉山删煽衫闪陕擅赡膳善汕扇缮墒伤商赏晌上尚裳梢捎稍烧芍勺韶少哨邵绍奢赊蛇舌舍赦摄射慑涉社设砷申呻伸身深娠绅神沈审婶甚肾慎渗声生甥牲升绳"], -["ca40","蔃",8,"蔍蔎蔏蔐蔒蔔蔕蔖蔘蔙蔛蔜蔝蔞蔠蔢",8,"蔭",9,"蔾",4,"蕄蕅蕆蕇蕋",10], -["ca80","蕗蕘蕚蕛蕜蕝蕟",4,"蕥蕦蕧蕩",8,"蕳蕵蕶蕷蕸蕼蕽蕿薀薁省盛剩胜圣师失狮施湿诗尸虱十石拾时什食蚀实识史矢使屎驶始式示士世柿事拭誓逝势是嗜噬适仕侍释饰氏市恃室视试收手首守寿授售受瘦兽蔬枢梳殊抒输叔舒淑疏书赎孰熟薯暑曙署蜀黍鼠属术述树束戍竖墅庶数漱"], -["cb40","薂薃薆薈",6,"薐",10,"薝",6,"薥薦薧薩薫薬薭薱",5,"薸薺",6,"藂",6,"藊",4,"藑藒"], -["cb80","藔藖",5,"藝",6,"藥藦藧藨藪",14,"恕刷耍摔衰甩帅栓拴霜双爽谁水睡税吮瞬顺舜说硕朔烁斯撕嘶思私司丝死肆寺嗣四伺似饲巳松耸怂颂送宋讼诵搜艘擞嗽苏酥俗素速粟僳塑溯宿诉肃酸蒜算虽隋随绥髓碎岁穗遂隧祟孙损笋蓑梭唆缩琐索锁所塌他它她塔"], -["cc40","藹藺藼藽藾蘀",4,"蘆",10,"蘒蘓蘔蘕蘗",15,"蘨蘪",13,"蘹蘺蘻蘽蘾蘿虀"], -["cc80","虁",11,"虒虓處",4,"虛虜虝號虠虡虣",7,"獭挞蹋踏胎苔抬台泰酞太态汰坍摊贪瘫滩坛檀痰潭谭谈坦毯袒碳探叹炭汤塘搪堂棠膛唐糖倘躺淌趟烫掏涛滔绦萄桃逃淘陶讨套特藤腾疼誊梯剔踢锑提题蹄啼体替嚏惕涕剃屉天添填田甜恬舔腆挑条迢眺跳贴铁帖厅听烃"], -["cd40","虭虯虰虲",6,"蚃",6,"蚎",4,"蚔蚖",5,"蚞",4,"蚥蚦蚫蚭蚮蚲蚳蚷蚸蚹蚻",4,"蛁蛂蛃蛅蛈蛌蛍蛒蛓蛕蛖蛗蛚蛜"], -["cd80","蛝蛠蛡蛢蛣蛥蛦蛧蛨蛪蛫蛬蛯蛵蛶蛷蛺蛻蛼蛽蛿蜁蜄蜅蜆蜋蜌蜎蜏蜐蜑蜔蜖汀廷停亭庭挺艇通桐酮瞳同铜彤童桶捅筒统痛偷投头透凸秃突图徒途涂屠土吐兔湍团推颓腿蜕褪退吞屯臀拖托脱鸵陀驮驼椭妥拓唾挖哇蛙洼娃瓦袜歪外豌弯湾玩顽丸烷完碗挽晚皖惋宛婉万腕汪王亡枉网往旺望忘妄威"], -["ce40","蜙蜛蜝蜟蜠蜤蜦蜧蜨蜪蜫蜬蜭蜯蜰蜲蜳蜵蜶蜸蜹蜺蜼蜽蝀",6,"蝊蝋蝍蝏蝐蝑蝒蝔蝕蝖蝘蝚",5,"蝡蝢蝦",7,"蝯蝱蝲蝳蝵"], -["ce80","蝷蝸蝹蝺蝿螀螁螄螆螇螉螊螌螎",4,"螔螕螖螘",6,"螠",4,"巍微危韦违桅围唯惟为潍维苇萎委伟伪尾纬未蔚味畏胃喂魏位渭谓尉慰卫瘟温蚊文闻纹吻稳紊问嗡翁瓮挝蜗涡窝我斡卧握沃巫呜钨乌污诬屋无芜梧吾吴毋武五捂午舞伍侮坞戊雾晤物勿务悟误昔熙析西硒矽晰嘻吸锡牺"], -["cf40","螥螦螧螩螪螮螰螱螲螴螶螷螸螹螻螼螾螿蟁",4,"蟇蟈蟉蟌",4,"蟔",6,"蟜蟝蟞蟟蟡蟢蟣蟤蟦蟧蟨蟩蟫蟬蟭蟯",9], -["cf80","蟺蟻蟼蟽蟿蠀蠁蠂蠄",5,"蠋",7,"蠔蠗蠘蠙蠚蠜",4,"蠣稀息希悉膝夕惜熄烯溪汐犀檄袭席习媳喜铣洗系隙戏细瞎虾匣霞辖暇峡侠狭下厦夏吓掀锨先仙鲜纤咸贤衔舷闲涎弦嫌显险现献县腺馅羡宪陷限线相厢镶香箱襄湘乡翔祥详想响享项巷橡像向象萧硝霄削哮嚣销消宵淆晓"], -["d040","蠤",13,"蠳",5,"蠺蠻蠽蠾蠿衁衂衃衆",5,"衎",5,"衕衖衘衚",6,"衦衧衪衭衯衱衳衴衵衶衸衹衺"], -["d080","衻衼袀袃袆袇袉袊袌袎袏袐袑袓袔袕袗",4,"袝",4,"袣袥",5,"小孝校肖啸笑效楔些歇蝎鞋协挟携邪斜胁谐写械卸蟹懈泄泻谢屑薪芯锌欣辛新忻心信衅星腥猩惺兴刑型形邢行醒幸杏性姓兄凶胸匈汹雄熊休修羞朽嗅锈秀袖绣墟戌需虚嘘须徐许蓄酗叙旭序畜恤絮婿绪续轩喧宣悬旋玄"], -["d140","袬袮袯袰袲",4,"袸袹袺袻袽袾袿裀裃裄裇裈裊裋裌裍裏裐裑裓裖裗裚",4,"裠裡裦裧裩",6,"裲裵裶裷裺裻製裿褀褁褃",5], -["d180","褉褋",4,"褑褔",4,"褜",4,"褢褣褤褦褧褨褩褬褭褮褯褱褲褳褵褷选癣眩绚靴薛学穴雪血勋熏循旬询寻驯巡殉汛训讯逊迅压押鸦鸭呀丫芽牙蚜崖衙涯雅哑亚讶焉咽阉烟淹盐严研蜒岩延言颜阎炎沿奄掩眼衍演艳堰燕厌砚雁唁彦焰宴谚验殃央鸯秧杨扬佯疡羊洋阳氧仰痒养样漾邀腰妖瑶"], -["d240","褸",8,"襂襃襅",24,"襠",5,"襧",19,"襼"], -["d280","襽襾覀覂覄覅覇",26,"摇尧遥窑谣姚咬舀药要耀椰噎耶爷野冶也页掖业叶曳腋夜液一壹医揖铱依伊衣颐夷遗移仪胰疑沂宜姨彝椅蚁倚已乙矣以艺抑易邑屹亿役臆逸肄疫亦裔意毅忆义益溢诣议谊译异翼翌绎茵荫因殷音阴姻吟银淫寅饮尹引隐"], -["d340","覢",30,"觃觍觓觔觕觗觘觙觛觝觟觠觡觢觤觧觨觩觪觬觭觮觰觱觲觴",6], -["d380","觻",4,"訁",5,"計",21,"印英樱婴鹰应缨莹萤营荧蝇迎赢盈影颖硬映哟拥佣臃痈庸雍踊蛹咏泳涌永恿勇用幽优悠忧尤由邮铀犹油游酉有友右佑釉诱又幼迂淤于盂榆虞愚舆余俞逾鱼愉渝渔隅予娱雨与屿禹宇语羽玉域芋郁吁遇喻峪御愈欲狱育誉"], -["d440","訞",31,"訿",8,"詉",21], -["d480","詟",25,"詺",6,"浴寓裕预豫驭鸳渊冤元垣袁原援辕园员圆猿源缘远苑愿怨院曰约越跃钥岳粤月悦阅耘云郧匀陨允运蕴酝晕韵孕匝砸杂栽哉灾宰载再在咱攒暂赞赃脏葬遭糟凿藻枣早澡蚤躁噪造皂灶燥责择则泽贼怎增憎曾赠扎喳渣札轧"], -["d540","誁",7,"誋",7,"誔",46], -["d580","諃",32,"铡闸眨栅榨咋乍炸诈摘斋宅窄债寨瞻毡詹粘沾盏斩辗崭展蘸栈占战站湛绽樟章彰漳张掌涨杖丈帐账仗胀瘴障招昭找沼赵照罩兆肇召遮折哲蛰辙者锗蔗这浙珍斟真甄砧臻贞针侦枕疹诊震振镇阵蒸挣睁征狰争怔整拯正政"], -["d640","諤",34,"謈",27], -["d680","謤謥謧",30,"帧症郑证芝枝支吱蜘知肢脂汁之织职直植殖执值侄址指止趾只旨纸志挚掷至致置帜峙制智秩稚质炙痔滞治窒中盅忠钟衷终种肿重仲众舟周州洲诌粥轴肘帚咒皱宙昼骤珠株蛛朱猪诸诛逐竹烛煮拄瞩嘱主著柱助蛀贮铸筑"], -["d740","譆",31,"譧",4,"譭",25], -["d780","讇",24,"讬讱讻诇诐诪谉谞住注祝驻抓爪拽专砖转撰赚篆桩庄装妆撞壮状椎锥追赘坠缀谆准捉拙卓桌琢茁酌啄着灼浊兹咨资姿滋淄孜紫仔籽滓子自渍字鬃棕踪宗综总纵邹走奏揍租足卒族祖诅阻组钻纂嘴醉最罪尊遵昨左佐柞做作坐座"], -["d840","谸",8,"豂豃豄豅豈豊豋豍",7,"豖豗豘豙豛",5,"豣",6,"豬",6,"豴豵豶豷豻",6,"貃貄貆貇"], -["d880","貈貋貍",6,"貕貖貗貙",20,"亍丌兀丐廿卅丕亘丞鬲孬噩丨禺丿匕乇夭爻卮氐囟胤馗毓睾鼗丶亟鼐乜乩亓芈孛啬嘏仄厍厝厣厥厮靥赝匚叵匦匮匾赜卦卣刂刈刎刭刳刿剀剌剞剡剜蒯剽劂劁劐劓冂罔亻仃仉仂仨仡仫仞伛仳伢佤仵伥伧伉伫佞佧攸佚佝"], -["d940","貮",62], -["d980","賭",32,"佟佗伲伽佶佴侑侉侃侏佾佻侪佼侬侔俦俨俪俅俚俣俜俑俟俸倩偌俳倬倏倮倭俾倜倌倥倨偾偃偕偈偎偬偻傥傧傩傺僖儆僭僬僦僮儇儋仝氽佘佥俎龠汆籴兮巽黉馘冁夔勹匍訇匐凫夙兕亠兖亳衮袤亵脔裒禀嬴蠃羸冫冱冽冼"], -["da40","贎",14,"贠赑赒赗赟赥赨赩赪赬赮赯赱赲赸",8,"趂趃趆趇趈趉趌",4,"趒趓趕",9,"趠趡"], -["da80","趢趤",12,"趲趶趷趹趻趽跀跁跂跅跇跈跉跊跍跐跒跓跔凇冖冢冥讠讦讧讪讴讵讷诂诃诋诏诎诒诓诔诖诘诙诜诟诠诤诨诩诮诰诳诶诹诼诿谀谂谄谇谌谏谑谒谔谕谖谙谛谘谝谟谠谡谥谧谪谫谮谯谲谳谵谶卩卺阝阢阡阱阪阽阼陂陉陔陟陧陬陲陴隈隍隗隰邗邛邝邙邬邡邴邳邶邺"], -["db40","跕跘跙跜跠跡跢跥跦跧跩跭跮跰跱跲跴跶跼跾",6,"踆踇踈踋踍踎踐踑踒踓踕",7,"踠踡踤",4,"踫踭踰踲踳踴踶踷踸踻踼踾"], -["db80","踿蹃蹅蹆蹌",4,"蹓",5,"蹚",11,"蹧蹨蹪蹫蹮蹱邸邰郏郅邾郐郄郇郓郦郢郜郗郛郫郯郾鄄鄢鄞鄣鄱鄯鄹酃酆刍奂劢劬劭劾哿勐勖勰叟燮矍廴凵凼鬯厶弁畚巯坌垩垡塾墼壅壑圩圬圪圳圹圮圯坜圻坂坩垅坫垆坼坻坨坭坶坳垭垤垌垲埏垧垴垓垠埕埘埚埙埒垸埴埯埸埤埝"], -["dc40","蹳蹵蹷",4,"蹽蹾躀躂躃躄躆躈",6,"躑躒躓躕",6,"躝躟",11,"躭躮躰躱躳",6,"躻",7], -["dc80","軃",10,"軏",21,"堋堍埽埭堀堞堙塄堠塥塬墁墉墚墀馨鼙懿艹艽艿芏芊芨芄芎芑芗芙芫芸芾芰苈苊苣芘芷芮苋苌苁芩芴芡芪芟苄苎芤苡茉苷苤茏茇苜苴苒苘茌苻苓茑茚茆茔茕苠苕茜荑荛荜茈莒茼茴茱莛荞茯荏荇荃荟荀茗荠茭茺茳荦荥"], -["dd40","軥",62], -["dd80","輤",32,"荨茛荩荬荪荭荮莰荸莳莴莠莪莓莜莅荼莶莩荽莸荻莘莞莨莺莼菁萁菥菘堇萘萋菝菽菖萜萸萑萆菔菟萏萃菸菹菪菅菀萦菰菡葜葑葚葙葳蒇蒈葺蒉葸萼葆葩葶蒌蒎萱葭蓁蓍蓐蓦蒽蓓蓊蒿蒺蓠蒡蒹蒴蒗蓥蓣蔌甍蔸蓰蔹蔟蔺"], -["de40","轅",32,"轪辀辌辒辝辠辡辢辤辥辦辧辪辬辭辮辯農辳辴辵辷辸辺辻込辿迀迃迆"], -["de80","迉",4,"迏迒迖迗迚迠迡迣迧迬迯迱迲迴迵迶迺迻迼迾迿逇逈逌逎逓逕逘蕖蔻蓿蓼蕙蕈蕨蕤蕞蕺瞢蕃蕲蕻薤薨薇薏蕹薮薜薅薹薷薰藓藁藜藿蘧蘅蘩蘖蘼廾弈夼奁耷奕奚奘匏尢尥尬尴扌扪抟抻拊拚拗拮挢拶挹捋捃掭揶捱捺掎掴捭掬掊捩掮掼揲揸揠揿揄揞揎摒揆掾摅摁搋搛搠搌搦搡摞撄摭撖"], -["df40","這逜連逤逥逧",5,"逰",4,"逷逹逺逽逿遀遃遅遆遈",4,"過達違遖遙遚遜",5,"遤遦遧適遪遫遬遯",4,"遶",6,"遾邁"], -["df80","還邅邆邇邉邊邌",4,"邒邔邖邘邚邜邞邟邠邤邥邧邨邩邫邭邲邷邼邽邿郀摺撷撸撙撺擀擐擗擤擢攉攥攮弋忒甙弑卟叱叽叩叨叻吒吖吆呋呒呓呔呖呃吡呗呙吣吲咂咔呷呱呤咚咛咄呶呦咝哐咭哂咴哒咧咦哓哔呲咣哕咻咿哌哙哚哜咩咪咤哝哏哞唛哧唠哽唔哳唢唣唏唑唧唪啧喏喵啉啭啁啕唿啐唼"], -["e040","郂郃郆郈郉郋郌郍郒郔郕郖郘郙郚郞郟郠郣郤郥郩郪郬郮郰郱郲郳郵郶郷郹郺郻郼郿鄀鄁鄃鄅",19,"鄚鄛鄜"], -["e080","鄝鄟鄠鄡鄤",10,"鄰鄲",6,"鄺",8,"酄唷啖啵啶啷唳唰啜喋嗒喃喱喹喈喁喟啾嗖喑啻嗟喽喾喔喙嗪嗷嗉嘟嗑嗫嗬嗔嗦嗝嗄嗯嗥嗲嗳嗌嗍嗨嗵嗤辔嘞嘈嘌嘁嘤嘣嗾嘀嘧嘭噘嘹噗嘬噍噢噙噜噌噔嚆噤噱噫噻噼嚅嚓嚯囔囗囝囡囵囫囹囿圄圊圉圜帏帙帔帑帱帻帼"], -["e140","酅酇酈酑酓酔酕酖酘酙酛酜酟酠酦酧酨酫酭酳酺酻酼醀",4,"醆醈醊醎醏醓",6,"醜",5,"醤",5,"醫醬醰醱醲醳醶醷醸醹醻"], -["e180","醼",10,"釈釋釐釒",9,"針",8,"帷幄幔幛幞幡岌屺岍岐岖岈岘岙岑岚岜岵岢岽岬岫岱岣峁岷峄峒峤峋峥崂崃崧崦崮崤崞崆崛嵘崾崴崽嵬嵛嵯嵝嵫嵋嵊嵩嵴嶂嶙嶝豳嶷巅彳彷徂徇徉後徕徙徜徨徭徵徼衢彡犭犰犴犷犸狃狁狎狍狒狨狯狩狲狴狷猁狳猃狺"], -["e240","釦",62], -["e280","鈥",32,"狻猗猓猡猊猞猝猕猢猹猥猬猸猱獐獍獗獠獬獯獾舛夥飧夤夂饣饧",5,"饴饷饽馀馄馇馊馍馐馑馓馔馕庀庑庋庖庥庠庹庵庾庳赓廒廑廛廨廪膺忄忉忖忏怃忮怄忡忤忾怅怆忪忭忸怙怵怦怛怏怍怩怫怊怿怡恸恹恻恺恂"], -["e340","鉆",45,"鉵",16], -["e380","銆",7,"銏",24,"恪恽悖悚悭悝悃悒悌悛惬悻悱惝惘惆惚悴愠愦愕愣惴愀愎愫慊慵憬憔憧憷懔懵忝隳闩闫闱闳闵闶闼闾阃阄阆阈阊阋阌阍阏阒阕阖阗阙阚丬爿戕氵汔汜汊沣沅沐沔沌汨汩汴汶沆沩泐泔沭泷泸泱泗沲泠泖泺泫泮沱泓泯泾"], -["e440","銨",5,"銯",24,"鋉",31], -["e480","鋩",32,"洹洧洌浃浈洇洄洙洎洫浍洮洵洚浏浒浔洳涑浯涞涠浞涓涔浜浠浼浣渚淇淅淞渎涿淠渑淦淝淙渖涫渌涮渫湮湎湫溲湟溆湓湔渲渥湄滟溱溘滠漭滢溥溧溽溻溷滗溴滏溏滂溟潢潆潇漤漕滹漯漶潋潴漪漉漩澉澍澌潸潲潼潺濑"], -["e540","錊",51,"錿",10], -["e580","鍊",31,"鍫濉澧澹澶濂濡濮濞濠濯瀚瀣瀛瀹瀵灏灞宀宄宕宓宥宸甯骞搴寤寮褰寰蹇謇辶迓迕迥迮迤迩迦迳迨逅逄逋逦逑逍逖逡逵逶逭逯遄遑遒遐遨遘遢遛暹遴遽邂邈邃邋彐彗彖彘尻咫屐屙孱屣屦羼弪弩弭艴弼鬻屮妁妃妍妩妪妣"], -["e640","鍬",34,"鎐",27], -["e680","鎬",29,"鏋鏌鏍妗姊妫妞妤姒妲妯姗妾娅娆姝娈姣姘姹娌娉娲娴娑娣娓婀婧婊婕娼婢婵胬媪媛婷婺媾嫫媲嫒嫔媸嫠嫣嫱嫖嫦嫘嫜嬉嬗嬖嬲嬷孀尕尜孚孥孳孑孓孢驵驷驸驺驿驽骀骁骅骈骊骐骒骓骖骘骛骜骝骟骠骢骣骥骧纟纡纣纥纨纩"], -["e740","鏎",7,"鏗",54], -["e780","鐎",32,"纭纰纾绀绁绂绉绋绌绐绔绗绛绠绡绨绫绮绯绱绲缍绶绺绻绾缁缂缃缇缈缋缌缏缑缒缗缙缜缛缟缡",6,"缪缫缬缭缯",4,"缵幺畿巛甾邕玎玑玮玢玟珏珂珑玷玳珀珉珈珥珙顼琊珩珧珞玺珲琏琪瑛琦琥琨琰琮琬"], -["e840","鐯",14,"鐿",43,"鑬鑭鑮鑯"], -["e880","鑰",20,"钑钖钘铇铏铓铔铚铦铻锜锠琛琚瑁瑜瑗瑕瑙瑷瑭瑾璜璎璀璁璇璋璞璨璩璐璧瓒璺韪韫韬杌杓杞杈杩枥枇杪杳枘枧杵枨枞枭枋杷杼柰栉柘栊柩枰栌柙枵柚枳柝栀柃枸柢栎柁柽栲栳桠桡桎桢桄桤梃栝桕桦桁桧桀栾桊桉栩梵梏桴桷梓桫棂楮棼椟椠棹"], -["e940","锧锳锽镃镈镋镕镚镠镮镴镵長",7,"門",42], -["e980","閫",32,"椤棰椋椁楗棣椐楱椹楠楂楝榄楫榀榘楸椴槌榇榈槎榉楦楣楹榛榧榻榫榭槔榱槁槊槟榕槠榍槿樯槭樗樘橥槲橄樾檠橐橛樵檎橹樽樨橘橼檑檐檩檗檫猷獒殁殂殇殄殒殓殍殚殛殡殪轫轭轱轲轳轵轶轸轷轹轺轼轾辁辂辄辇辋"], -["ea40","闌",27,"闬闿阇阓阘阛阞阠阣",6,"阫阬阭阯阰阷阸阹阺阾陁陃陊陎陏陑陒陓陖陗"], -["ea80","陘陙陚陜陝陞陠陣陥陦陫陭",4,"陳陸",12,"隇隉隊辍辎辏辘辚軎戋戗戛戟戢戡戥戤戬臧瓯瓴瓿甏甑甓攴旮旯旰昊昙杲昃昕昀炅曷昝昴昱昶昵耆晟晔晁晏晖晡晗晷暄暌暧暝暾曛曜曦曩贲贳贶贻贽赀赅赆赈赉赇赍赕赙觇觊觋觌觎觏觐觑牮犟牝牦牯牾牿犄犋犍犏犒挈挲掰"], -["eb40","隌階隑隒隓隕隖隚際隝",9,"隨",7,"隱隲隴隵隷隸隺隻隿雂雃雈雊雋雐雑雓雔雖",9,"雡",6,"雫"], -["eb80","雬雭雮雰雱雲雴雵雸雺電雼雽雿霂霃霅霊霋霌霐霑霒霔霕霗",4,"霝霟霠搿擘耄毪毳毽毵毹氅氇氆氍氕氘氙氚氡氩氤氪氲攵敕敫牍牒牖爰虢刖肟肜肓肼朊肽肱肫肭肴肷胧胨胩胪胛胂胄胙胍胗朐胝胫胱胴胭脍脎胲胼朕脒豚脶脞脬脘脲腈腌腓腴腙腚腱腠腩腼腽腭腧塍媵膈膂膑滕膣膪臌朦臊膻"], -["ec40","霡",8,"霫霬霮霯霱霳",4,"霺霻霼霽霿",18,"靔靕靗靘靚靜靝靟靣靤靦靧靨靪",7], -["ec80","靲靵靷",4,"靽",7,"鞆",4,"鞌鞎鞏鞐鞓鞕鞖鞗鞙",4,"臁膦欤欷欹歃歆歙飑飒飓飕飙飚殳彀毂觳斐齑斓於旆旄旃旌旎旒旖炀炜炖炝炻烀炷炫炱烨烊焐焓焖焯焱煳煜煨煅煲煊煸煺熘熳熵熨熠燠燔燧燹爝爨灬焘煦熹戾戽扃扈扉礻祀祆祉祛祜祓祚祢祗祠祯祧祺禅禊禚禧禳忑忐"], -["ed40","鞞鞟鞡鞢鞤",6,"鞬鞮鞰鞱鞳鞵",46], -["ed80","韤韥韨韮",4,"韴韷",23,"怼恝恚恧恁恙恣悫愆愍慝憩憝懋懑戆肀聿沓泶淼矶矸砀砉砗砘砑斫砭砜砝砹砺砻砟砼砥砬砣砩硎硭硖硗砦硐硇硌硪碛碓碚碇碜碡碣碲碹碥磔磙磉磬磲礅磴礓礤礞礴龛黹黻黼盱眄眍盹眇眈眚眢眙眭眦眵眸睐睑睇睃睚睨"], -["ee40","頏",62], -["ee80","顎",32,"睢睥睿瞍睽瞀瞌瞑瞟瞠瞰瞵瞽町畀畎畋畈畛畲畹疃罘罡罟詈罨罴罱罹羁罾盍盥蠲钅钆钇钋钊钌钍钏钐钔钗钕钚钛钜钣钤钫钪钭钬钯钰钲钴钶",4,"钼钽钿铄铈",6,"铐铑铒铕铖铗铙铘铛铞铟铠铢铤铥铧铨铪"], -["ef40","顯",5,"颋颎颒颕颙颣風",37,"飏飐飔飖飗飛飜飝飠",4], -["ef80","飥飦飩",30,"铩铫铮铯铳铴铵铷铹铼铽铿锃锂锆锇锉锊锍锎锏锒",4,"锘锛锝锞锟锢锪锫锩锬锱锲锴锶锷锸锼锾锿镂锵镄镅镆镉镌镎镏镒镓镔镖镗镘镙镛镞镟镝镡镢镤",8,"镯镱镲镳锺矧矬雉秕秭秣秫稆嵇稃稂稞稔"], -["f040","餈",4,"餎餏餑",28,"餯",26], -["f080","饊",9,"饖",12,"饤饦饳饸饹饻饾馂馃馉稹稷穑黏馥穰皈皎皓皙皤瓞瓠甬鸠鸢鸨",4,"鸲鸱鸶鸸鸷鸹鸺鸾鹁鹂鹄鹆鹇鹈鹉鹋鹌鹎鹑鹕鹗鹚鹛鹜鹞鹣鹦",6,"鹱鹭鹳疒疔疖疠疝疬疣疳疴疸痄疱疰痃痂痖痍痣痨痦痤痫痧瘃痱痼痿瘐瘀瘅瘌瘗瘊瘥瘘瘕瘙"], -["f140","馌馎馚",10,"馦馧馩",47], -["f180","駙",32,"瘛瘼瘢瘠癀瘭瘰瘿瘵癃瘾瘳癍癞癔癜癖癫癯翊竦穸穹窀窆窈窕窦窠窬窨窭窳衤衩衲衽衿袂袢裆袷袼裉裢裎裣裥裱褚裼裨裾裰褡褙褓褛褊褴褫褶襁襦襻疋胥皲皴矜耒耔耖耜耠耢耥耦耧耩耨耱耋耵聃聆聍聒聩聱覃顸颀颃"], -["f240","駺",62], -["f280","騹",32,"颉颌颍颏颔颚颛颞颟颡颢颥颦虍虔虬虮虿虺虼虻蚨蚍蚋蚬蚝蚧蚣蚪蚓蚩蚶蛄蚵蛎蚰蚺蚱蚯蛉蛏蚴蛩蛱蛲蛭蛳蛐蜓蛞蛴蛟蛘蛑蜃蜇蛸蜈蜊蜍蜉蜣蜻蜞蜥蜮蜚蜾蝈蜴蜱蜩蜷蜿螂蜢蝽蝾蝻蝠蝰蝌蝮螋蝓蝣蝼蝤蝙蝥螓螯螨蟒"], -["f340","驚",17,"驲骃骉骍骎骔骕骙骦骩",6,"骲骳骴骵骹骻骽骾骿髃髄髆",4,"髍髎髏髐髒體髕髖髗髙髚髛髜"], -["f380","髝髞髠髢髣髤髥髧髨髩髪髬髮髰",8,"髺髼",6,"鬄鬅鬆蟆螈螅螭螗螃螫蟥螬螵螳蟋蟓螽蟑蟀蟊蟛蟪蟠蟮蠖蠓蟾蠊蠛蠡蠹蠼缶罂罄罅舐竺竽笈笃笄笕笊笫笏筇笸笪笙笮笱笠笥笤笳笾笞筘筚筅筵筌筝筠筮筻筢筲筱箐箦箧箸箬箝箨箅箪箜箢箫箴篑篁篌篝篚篥篦篪簌篾篼簏簖簋"], -["f440","鬇鬉",5,"鬐鬑鬒鬔",10,"鬠鬡鬢鬤",10,"鬰鬱鬳",7,"鬽鬾鬿魀魆魊魋魌魎魐魒魓魕",5], -["f480","魛",32,"簟簪簦簸籁籀臾舁舂舄臬衄舡舢舣舭舯舨舫舸舻舳舴舾艄艉艋艏艚艟艨衾袅袈裘裟襞羝羟羧羯羰羲籼敉粑粝粜粞粢粲粼粽糁糇糌糍糈糅糗糨艮暨羿翎翕翥翡翦翩翮翳糸絷綦綮繇纛麸麴赳趄趔趑趱赧赭豇豉酊酐酎酏酤"], -["f540","魼",62], -["f580","鮻",32,"酢酡酰酩酯酽酾酲酴酹醌醅醐醍醑醢醣醪醭醮醯醵醴醺豕鹾趸跫踅蹙蹩趵趿趼趺跄跖跗跚跞跎跏跛跆跬跷跸跣跹跻跤踉跽踔踝踟踬踮踣踯踺蹀踹踵踽踱蹉蹁蹂蹑蹒蹊蹰蹶蹼蹯蹴躅躏躔躐躜躞豸貂貊貅貘貔斛觖觞觚觜"], -["f640","鯜",62], -["f680","鰛",32,"觥觫觯訾謦靓雩雳雯霆霁霈霏霎霪霭霰霾龀龃龅",5,"龌黾鼋鼍隹隼隽雎雒瞿雠銎銮鋈錾鍪鏊鎏鐾鑫鱿鲂鲅鲆鲇鲈稣鲋鲎鲐鲑鲒鲔鲕鲚鲛鲞",5,"鲥",4,"鲫鲭鲮鲰",7,"鲺鲻鲼鲽鳄鳅鳆鳇鳊鳋"], -["f740","鰼",62], -["f780","鱻鱽鱾鲀鲃鲄鲉鲊鲌鲏鲓鲖鲗鲘鲙鲝鲪鲬鲯鲹鲾",4,"鳈鳉鳑鳒鳚鳛鳠鳡鳌",4,"鳓鳔鳕鳗鳘鳙鳜鳝鳟鳢靼鞅鞑鞒鞔鞯鞫鞣鞲鞴骱骰骷鹘骶骺骼髁髀髅髂髋髌髑魅魃魇魉魈魍魑飨餍餮饕饔髟髡髦髯髫髻髭髹鬈鬏鬓鬟鬣麽麾縻麂麇麈麋麒鏖麝麟黛黜黝黠黟黢黩黧黥黪黯鼢鼬鼯鼹鼷鼽鼾齄"], -["f840","鳣",62], -["f880","鴢",32], -["f940","鵃",62], -["f980","鶂",32], -["fa40","鶣",62], -["fa80","鷢",32], -["fb40","鸃",27,"鸤鸧鸮鸰鸴鸻鸼鹀鹍鹐鹒鹓鹔鹖鹙鹝鹟鹠鹡鹢鹥鹮鹯鹲鹴",9,"麀"], -["fb80","麁麃麄麅麆麉麊麌",5,"麔",8,"麞麠",5,"麧麨麩麪"], -["fc40","麫",8,"麵麶麷麹麺麼麿",4,"黅黆黇黈黊黋黌黐黒黓黕黖黗黙黚點黡黣黤黦黨黫黬黭黮黰",8,"黺黽黿",6], -["fc80","鼆",4,"鼌鼏鼑鼒鼔鼕鼖鼘鼚",5,"鼡鼣",8,"鼭鼮鼰鼱"], -["fd40","鼲",4,"鼸鼺鼼鼿",4,"齅",10,"齒",38], -["fd80","齹",5,"龁龂龍",11,"龜龝龞龡",4,"郎凉秊裏隣"], -["fe40","兀嗀﨎﨏﨑﨓﨔礼﨟蘒﨡﨣﨤﨧﨨﨩"] -] diff --git a/node_modules/mysql2/node_modules/iconv-lite/encodings/tables/cp949.json b/node_modules/mysql2/node_modules/iconv-lite/encodings/tables/cp949.json deleted file mode 100644 index 2022a00..0000000 --- a/node_modules/mysql2/node_modules/iconv-lite/encodings/tables/cp949.json +++ /dev/null @@ -1,273 +0,0 @@ -[ -["0","\u0000",127], -["8141","갂갃갅갆갋",4,"갘갞갟갡갢갣갥",6,"갮갲갳갴"], -["8161","갵갶갷갺갻갽갾갿걁",9,"걌걎",5,"걕"], -["8181","걖걗걙걚걛걝",18,"걲걳걵걶걹걻",4,"겂겇겈겍겎겏겑겒겓겕",6,"겞겢",5,"겫겭겮겱",6,"겺겾겿곀곂곃곅곆곇곉곊곋곍",7,"곖곘",7,"곢곣곥곦곩곫곭곮곲곴곷",4,"곾곿괁괂괃괅괇",4,"괎괐괒괓"], -["8241","괔괕괖괗괙괚괛괝괞괟괡",7,"괪괫괮",5], -["8261","괶괷괹괺괻괽",6,"굆굈굊",5,"굑굒굓굕굖굗"], -["8281","굙",7,"굢굤",7,"굮굯굱굲굷굸굹굺굾궀궃",4,"궊궋궍궎궏궑",10,"궞",5,"궥",17,"궸",7,"귂귃귅귆귇귉",6,"귒귔",7,"귝귞귟귡귢귣귥",18], -["8341","귺귻귽귾긂",5,"긊긌긎",5,"긕",7], -["8361","긝",18,"긲긳긵긶긹긻긼"], -["8381","긽긾긿깂깄깇깈깉깋깏깑깒깓깕깗",4,"깞깢깣깤깦깧깪깫깭깮깯깱",6,"깺깾",5,"꺆",5,"꺍",46,"꺿껁껂껃껅",6,"껎껒",5,"껚껛껝",8], -["8441","껦껧껩껪껬껮",5,"껵껶껷껹껺껻껽",8], -["8461","꼆꼉꼊꼋꼌꼎꼏꼑",18], -["8481","꼤",7,"꼮꼯꼱꼳꼵",6,"꼾꽀꽄꽅꽆꽇꽊",5,"꽑",10,"꽞",5,"꽦",18,"꽺",5,"꾁꾂꾃꾅꾆꾇꾉",6,"꾒꾓꾔꾖",5,"꾝",26,"꾺꾻꾽꾾"], -["8541","꾿꿁",5,"꿊꿌꿏",4,"꿕",6,"꿝",4], -["8561","꿢",5,"꿪",5,"꿲꿳꿵꿶꿷꿹",6,"뀂뀃"], -["8581","뀅",6,"뀍뀎뀏뀑뀒뀓뀕",6,"뀞",9,"뀩",26,"끆끇끉끋끍끏끐끑끒끖끘끚끛끜끞",29,"끾끿낁낂낃낅",6,"낎낐낒",5,"낛낝낞낣낤"], -["8641","낥낦낧낪낰낲낶낷낹낺낻낽",6,"냆냊",5,"냒"], -["8661","냓냕냖냗냙",6,"냡냢냣냤냦",10], -["8681","냱",22,"넊넍넎넏넑넔넕넖넗넚넞",4,"넦넧넩넪넫넭",6,"넶넺",5,"녂녃녅녆녇녉",6,"녒녓녖녗녙녚녛녝녞녟녡",22,"녺녻녽녾녿놁놃",4,"놊놌놎놏놐놑놕놖놗놙놚놛놝"], -["8741","놞",9,"놩",15], -["8761","놹",18,"뇍뇎뇏뇑뇒뇓뇕"], -["8781","뇖",5,"뇞뇠",7,"뇪뇫뇭뇮뇯뇱",7,"뇺뇼뇾",5,"눆눇눉눊눍",6,"눖눘눚",5,"눡",18,"눵",6,"눽",26,"뉙뉚뉛뉝뉞뉟뉡",6,"뉪",4], -["8841","뉯",4,"뉶",5,"뉽",6,"늆늇늈늊",4], -["8861","늏늒늓늕늖늗늛",4,"늢늤늧늨늩늫늭늮늯늱늲늳늵늶늷"], -["8881","늸",15,"닊닋닍닎닏닑닓",4,"닚닜닞닟닠닡닣닧닩닪닰닱닲닶닼닽닾댂댃댅댆댇댉",6,"댒댖",5,"댝",54,"덗덙덚덝덠덡덢덣"], -["8941","덦덨덪덬덭덯덲덳덵덶덷덹",6,"뎂뎆",5,"뎍"], -["8961","뎎뎏뎑뎒뎓뎕",10,"뎢",5,"뎩뎪뎫뎭"], -["8981","뎮",21,"돆돇돉돊돍돏돑돒돓돖돘돚돜돞돟돡돢돣돥돦돧돩",18,"돽",18,"됑",6,"됙됚됛됝됞됟됡",6,"됪됬",7,"됵",15], -["8a41","둅",10,"둒둓둕둖둗둙",6,"둢둤둦"], -["8a61","둧",4,"둭",18,"뒁뒂"], -["8a81","뒃",4,"뒉",19,"뒞",5,"뒥뒦뒧뒩뒪뒫뒭",7,"뒶뒸뒺",5,"듁듂듃듅듆듇듉",6,"듑듒듓듔듖",5,"듞듟듡듢듥듧",4,"듮듰듲",5,"듹",26,"딖딗딙딚딝"], -["8b41","딞",5,"딦딫",4,"딲딳딵딶딷딹",6,"땂땆"], -["8b61","땇땈땉땊땎땏땑땒땓땕",6,"땞땢",8], -["8b81","땫",52,"떢떣떥떦떧떩떬떭떮떯떲떶",4,"떾떿뗁뗂뗃뗅",6,"뗎뗒",5,"뗙",18,"뗭",18], -["8c41","똀",15,"똒똓똕똖똗똙",4], -["8c61","똞",6,"똦",5,"똭",6,"똵",5], -["8c81","똻",12,"뙉",26,"뙥뙦뙧뙩",50,"뚞뚟뚡뚢뚣뚥",5,"뚭뚮뚯뚰뚲",16], -["8d41","뛃",16,"뛕",8], -["8d61","뛞",17,"뛱뛲뛳뛵뛶뛷뛹뛺"], -["8d81","뛻",4,"뜂뜃뜄뜆",33,"뜪뜫뜭뜮뜱",6,"뜺뜼",7,"띅띆띇띉띊띋띍",6,"띖",9,"띡띢띣띥띦띧띩",6,"띲띴띶",5,"띾띿랁랂랃랅",6,"랎랓랔랕랚랛랝랞"], -["8e41","랟랡",6,"랪랮",5,"랶랷랹",8], -["8e61","럂",4,"럈럊",19], -["8e81","럞",13,"럮럯럱럲럳럵",6,"럾렂",4,"렊렋렍렎렏렑",6,"렚렜렞",5,"렦렧렩렪렫렭",6,"렶렺",5,"롁롂롃롅",11,"롒롔",7,"롞롟롡롢롣롥",6,"롮롰롲",5,"롹롺롻롽",7], -["8f41","뢅",7,"뢎",17], -["8f61","뢠",7,"뢩",6,"뢱뢲뢳뢵뢶뢷뢹",4], -["8f81","뢾뢿룂룄룆",5,"룍룎룏룑룒룓룕",7,"룞룠룢",5,"룪룫룭룮룯룱",6,"룺룼룾",5,"뤅",18,"뤙",6,"뤡",26,"뤾뤿륁륂륃륅",6,"륍륎륐륒",5], -["9041","륚륛륝륞륟륡",6,"륪륬륮",5,"륶륷륹륺륻륽"], -["9061","륾",5,"릆릈릋릌릏",15], -["9081","릟",12,"릮릯릱릲릳릵",6,"릾맀맂",5,"맊맋맍맓",4,"맚맜맟맠맢맦맧맩맪맫맭",6,"맶맻",4,"먂",5,"먉",11,"먖",33,"먺먻먽먾먿멁멃멄멅멆"], -["9141","멇멊멌멏멐멑멒멖멗멙멚멛멝",6,"멦멪",5], -["9161","멲멳멵멶멷멹",9,"몆몈몉몊몋몍",5], -["9181","몓",20,"몪몭몮몯몱몳",4,"몺몼몾",5,"뫅뫆뫇뫉",14,"뫚",33,"뫽뫾뫿묁묂묃묅",7,"묎묐묒",5,"묙묚묛묝묞묟묡",6], -["9241","묨묪묬",7,"묷묹묺묿",4,"뭆뭈뭊뭋뭌뭎뭑뭒"], -["9261","뭓뭕뭖뭗뭙",7,"뭢뭤",7,"뭭",4], -["9281","뭲",21,"뮉뮊뮋뮍뮎뮏뮑",18,"뮥뮦뮧뮩뮪뮫뮭",6,"뮵뮶뮸",7,"믁믂믃믅믆믇믉",6,"믑믒믔",35,"믺믻믽믾밁"], -["9341","밃",4,"밊밎밐밒밓밙밚밠밡밢밣밦밨밪밫밬밮밯밲밳밵"], -["9361","밶밷밹",6,"뱂뱆뱇뱈뱊뱋뱎뱏뱑",8], -["9381","뱚뱛뱜뱞",37,"벆벇벉벊벍벏",4,"벖벘벛",4,"벢벣벥벦벩",6,"벲벶",5,"벾벿볁볂볃볅",7,"볎볒볓볔볖볗볙볚볛볝",22,"볷볹볺볻볽"], -["9441","볾",5,"봆봈봊",5,"봑봒봓봕",8], -["9461","봞",5,"봥",6,"봭",12], -["9481","봺",5,"뵁",6,"뵊뵋뵍뵎뵏뵑",6,"뵚",9,"뵥뵦뵧뵩",22,"붂붃붅붆붋",4,"붒붔붖붗붘붛붝",6,"붥",10,"붱",6,"붹",24], -["9541","뷒뷓뷖뷗뷙뷚뷛뷝",11,"뷪",5,"뷱"], -["9561","뷲뷳뷵뷶뷷뷹",6,"븁븂븄븆",5,"븎븏븑븒븓"], -["9581","븕",6,"븞븠",35,"빆빇빉빊빋빍빏",4,"빖빘빜빝빞빟빢빣빥빦빧빩빫",4,"빲빶",4,"빾빿뺁뺂뺃뺅",6,"뺎뺒",5,"뺚",13,"뺩",14], -["9641","뺸",23,"뻒뻓"], -["9661","뻕뻖뻙",6,"뻡뻢뻦",5,"뻭",8], -["9681","뻶",10,"뼂",5,"뼊",13,"뼚뼞",33,"뽂뽃뽅뽆뽇뽉",6,"뽒뽓뽔뽖",44], -["9741","뾃",16,"뾕",8], -["9761","뾞",17,"뾱",7], -["9781","뾹",11,"뿆",5,"뿎뿏뿑뿒뿓뿕",6,"뿝뿞뿠뿢",89,"쀽쀾쀿"], -["9841","쁀",16,"쁒",5,"쁙쁚쁛"], -["9861","쁝쁞쁟쁡",6,"쁪",15], -["9881","쁺",21,"삒삓삕삖삗삙",6,"삢삤삦",5,"삮삱삲삷",4,"삾샂샃샄샆샇샊샋샍샎샏샑",6,"샚샞",5,"샦샧샩샪샫샭",6,"샶샸샺",5,"섁섂섃섅섆섇섉",6,"섑섒섓섔섖",5,"섡섢섥섨섩섪섫섮"], -["9941","섲섳섴섵섷섺섻섽섾섿셁",6,"셊셎",5,"셖셗"], -["9961","셙셚셛셝",6,"셦셪",5,"셱셲셳셵셶셷셹셺셻"], -["9981","셼",8,"솆",5,"솏솑솒솓솕솗",4,"솞솠솢솣솤솦솧솪솫솭솮솯솱",11,"솾",5,"쇅쇆쇇쇉쇊쇋쇍",6,"쇕쇖쇙",6,"쇡쇢쇣쇥쇦쇧쇩",6,"쇲쇴",7,"쇾쇿숁숂숃숅",6,"숎숐숒",5,"숚숛숝숞숡숢숣"], -["9a41","숤숥숦숧숪숬숮숰숳숵",16], -["9a61","쉆쉇쉉",6,"쉒쉓쉕쉖쉗쉙",6,"쉡쉢쉣쉤쉦"], -["9a81","쉧",4,"쉮쉯쉱쉲쉳쉵",6,"쉾슀슂",5,"슊",5,"슑",6,"슙슚슜슞",5,"슦슧슩슪슫슮",5,"슶슸슺",33,"싞싟싡싢싥",5,"싮싰싲싳싴싵싷싺싽싾싿쌁",6,"쌊쌋쌎쌏"], -["9b41","쌐쌑쌒쌖쌗쌙쌚쌛쌝",6,"쌦쌧쌪",8], -["9b61","쌳",17,"썆",7], -["9b81","썎",25,"썪썫썭썮썯썱썳",4,"썺썻썾",5,"쎅쎆쎇쎉쎊쎋쎍",50,"쏁",22,"쏚"], -["9c41","쏛쏝쏞쏡쏣",4,"쏪쏫쏬쏮",5,"쏶쏷쏹",5], -["9c61","쏿",8,"쐉",6,"쐑",9], -["9c81","쐛",8,"쐥",6,"쐭쐮쐯쐱쐲쐳쐵",6,"쐾",9,"쑉",26,"쑦쑧쑩쑪쑫쑭",6,"쑶쑷쑸쑺",5,"쒁",18,"쒕",6,"쒝",12], -["9d41","쒪",13,"쒹쒺쒻쒽",8], -["9d61","쓆",25], -["9d81","쓠",8,"쓪",5,"쓲쓳쓵쓶쓷쓹쓻쓼쓽쓾씂",9,"씍씎씏씑씒씓씕",6,"씝",10,"씪씫씭씮씯씱",6,"씺씼씾",5,"앆앇앋앏앐앑앒앖앚앛앜앟앢앣앥앦앧앩",6,"앲앶",5,"앾앿얁얂얃얅얆얈얉얊얋얎얐얒얓얔"], -["9e41","얖얙얚얛얝얞얟얡",7,"얪",9,"얶"], -["9e61","얷얺얿",4,"엋엍엏엒엓엕엖엗엙",6,"엢엤엦엧"], -["9e81","엨엩엪엫엯엱엲엳엵엸엹엺엻옂옃옄옉옊옋옍옎옏옑",6,"옚옝",6,"옦옧옩옪옫옯옱옲옶옸옺옼옽옾옿왂왃왅왆왇왉",6,"왒왖",5,"왞왟왡",10,"왭왮왰왲",5,"왺왻왽왾왿욁",6,"욊욌욎",5,"욖욗욙욚욛욝",6,"욦"], -["9f41","욨욪",5,"욲욳욵욶욷욻",4,"웂웄웆",5,"웎"], -["9f61","웏웑웒웓웕",6,"웞웟웢",5,"웪웫웭웮웯웱웲"], -["9f81","웳",4,"웺웻웼웾",5,"윆윇윉윊윋윍",6,"윖윘윚",5,"윢윣윥윦윧윩",6,"윲윴윶윸윹윺윻윾윿읁읂읃읅",4,"읋읎읐읙읚읛읝읞읟읡",6,"읩읪읬",7,"읶읷읹읺읻읿잀잁잂잆잋잌잍잏잒잓잕잙잛",4,"잢잧",4,"잮잯잱잲잳잵잶잷"], -["a041","잸잹잺잻잾쟂",5,"쟊쟋쟍쟏쟑",6,"쟙쟚쟛쟜"], -["a061","쟞",5,"쟥쟦쟧쟩쟪쟫쟭",13], -["a081","쟻",4,"젂젃젅젆젇젉젋",4,"젒젔젗",4,"젞젟젡젢젣젥",6,"젮젰젲",5,"젹젺젻젽젾젿졁",6,"졊졋졎",5,"졕",26,"졲졳졵졶졷졹졻",4,"좂좄좈좉좊좎",5,"좕",7,"좞좠좢좣좤"], -["a141","좥좦좧좩",18,"좾좿죀죁"], -["a161","죂죃죅죆죇죉죊죋죍",6,"죖죘죚",5,"죢죣죥"], -["a181","죦",14,"죶",5,"죾죿줁줂줃줇",4,"줎 、。·‥…¨〃­―∥\∼‘’“”〔〕〈",9,"±×÷≠≤≥∞∴°′″℃Å¢£¥♂♀∠⊥⌒∂∇≡≒§※☆★○●◎◇◆□■△▲▽▼→←↑↓↔〓≪≫√∽∝∵∫∬∈∋⊆⊇⊂⊃∪∩∧∨¬"], -["a241","줐줒",5,"줙",18], -["a261","줭",6,"줵",18], -["a281","쥈",7,"쥒쥓쥕쥖쥗쥙",6,"쥢쥤",7,"쥭쥮쥯⇒⇔∀∃´~ˇ˘˝˚˙¸˛¡¿ː∮∑∏¤℉‰◁◀▷▶♤♠♡♥♧♣⊙◈▣◐◑▒▤▥▨▧▦▩♨☏☎☜☞¶†‡↕↗↙↖↘♭♩♪♬㉿㈜№㏇™㏂㏘℡€®"], -["a341","쥱쥲쥳쥵",6,"쥽",10,"즊즋즍즎즏"], -["a361","즑",6,"즚즜즞",16], -["a381","즯",16,"짂짃짅짆짉짋",4,"짒짔짗짘짛!",58,"₩]",32," ̄"], -["a441","짞짟짡짣짥짦짨짩짪짫짮짲",5,"짺짻짽짾짿쨁쨂쨃쨄"], -["a461","쨅쨆쨇쨊쨎",5,"쨕쨖쨗쨙",12], -["a481","쨦쨧쨨쨪",28,"ㄱ",93], -["a541","쩇",4,"쩎쩏쩑쩒쩓쩕",6,"쩞쩢",5,"쩩쩪"], -["a561","쩫",17,"쩾",5,"쪅쪆"], -["a581","쪇",16,"쪙",14,"ⅰ",9], -["a5b0","Ⅰ",9], -["a5c1","Α",16,"Σ",6], -["a5e1","α",16,"σ",6], -["a641","쪨",19,"쪾쪿쫁쫂쫃쫅"], -["a661","쫆",5,"쫎쫐쫒쫔쫕쫖쫗쫚",5,"쫡",6], -["a681","쫨쫩쫪쫫쫭",6,"쫵",18,"쬉쬊─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂┒┑┚┙┖┕┎┍┞┟┡┢┦┧┩┪┭┮┱┲┵┶┹┺┽┾╀╁╃",7], -["a741","쬋",4,"쬑쬒쬓쬕쬖쬗쬙",6,"쬢",7], -["a761","쬪",22,"쭂쭃쭄"], -["a781","쭅쭆쭇쭊쭋쭍쭎쭏쭑",6,"쭚쭛쭜쭞",5,"쭥",7,"㎕㎖㎗ℓ㎘㏄㎣㎤㎥㎦㎙",9,"㏊㎍㎎㎏㏏㎈㎉㏈㎧㎨㎰",9,"㎀",4,"㎺",5,"㎐",4,"Ω㏀㏁㎊㎋㎌㏖㏅㎭㎮㎯㏛㎩㎪㎫㎬㏝㏐㏓㏃㏉㏜㏆"], -["a841","쭭",10,"쭺",14], -["a861","쮉",18,"쮝",6], -["a881","쮤",19,"쮹",11,"ÆÐªĦ"], -["a8a6","IJ"], -["a8a8","ĿŁØŒºÞŦŊ"], -["a8b1","㉠",27,"ⓐ",25,"①",14,"½⅓⅔¼¾⅛⅜⅝⅞"], -["a941","쯅",14,"쯕",10], -["a961","쯠쯡쯢쯣쯥쯦쯨쯪",18], -["a981","쯽",14,"찎찏찑찒찓찕",6,"찞찟찠찣찤æđðħıijĸŀłøœßþŧŋʼn㈀",27,"⒜",25,"⑴",14,"¹²³⁴ⁿ₁₂₃₄"], -["aa41","찥찦찪찫찭찯찱",6,"찺찿",4,"챆챇챉챊챋챍챎"], -["aa61","챏",4,"챖챚",5,"챡챢챣챥챧챩",6,"챱챲"], -["aa81","챳챴챶",29,"ぁ",82], -["ab41","첔첕첖첗첚첛첝첞첟첡",6,"첪첮",5,"첶첷첹"], -["ab61","첺첻첽",6,"쳆쳈쳊",5,"쳑쳒쳓쳕",5], -["ab81","쳛",8,"쳥",6,"쳭쳮쳯쳱",12,"ァ",85], -["ac41","쳾쳿촀촂",5,"촊촋촍촎촏촑",6,"촚촜촞촟촠"], -["ac61","촡촢촣촥촦촧촩촪촫촭",11,"촺",4], -["ac81","촿",28,"쵝쵞쵟А",5,"ЁЖ",25], -["acd1","а",5,"ёж",25], -["ad41","쵡쵢쵣쵥",6,"쵮쵰쵲",5,"쵹",7], -["ad61","춁",6,"춉",10,"춖춗춙춚춛춝춞춟"], -["ad81","춠춡춢춣춦춨춪",5,"춱",18,"췅"], -["ae41","췆",5,"췍췎췏췑",16], -["ae61","췢",5,"췩췪췫췭췮췯췱",6,"췺췼췾",4], -["ae81","츃츅츆츇츉츊츋츍",6,"츕츖츗츘츚",5,"츢츣츥츦츧츩츪츫"], -["af41","츬츭츮츯츲츴츶",19], -["af61","칊",13,"칚칛칝칞칢",5,"칪칬"], -["af81","칮",5,"칶칷칹칺칻칽",6,"캆캈캊",5,"캒캓캕캖캗캙"], -["b041","캚",5,"캢캦",5,"캮",12], -["b061","캻",5,"컂",19], -["b081","컖",13,"컦컧컩컪컭",6,"컶컺",5,"가각간갇갈갉갊감",7,"같",4,"갠갤갬갭갯갰갱갸갹갼걀걋걍걔걘걜거걱건걷걸걺검겁것겄겅겆겉겊겋게겐겔겜겝겟겠겡겨격겪견겯결겸겹겻겼경곁계곈곌곕곗고곡곤곧골곪곬곯곰곱곳공곶과곽관괄괆"], -["b141","켂켃켅켆켇켉",6,"켒켔켖",5,"켝켞켟켡켢켣"], -["b161","켥",6,"켮켲",5,"켹",11], -["b181","콅",14,"콖콗콙콚콛콝",6,"콦콨콪콫콬괌괍괏광괘괜괠괩괬괭괴괵괸괼굄굅굇굉교굔굘굡굣구국군굳굴굵굶굻굼굽굿궁궂궈궉권궐궜궝궤궷귀귁귄귈귐귑귓규균귤그극근귿글긁금급긋긍긔기긱긴긷길긺김깁깃깅깆깊까깍깎깐깔깖깜깝깟깠깡깥깨깩깬깰깸"], -["b241","콭콮콯콲콳콵콶콷콹",6,"쾁쾂쾃쾄쾆",5,"쾍"], -["b261","쾎",18,"쾢",5,"쾩"], -["b281","쾪",5,"쾱",18,"쿅",6,"깹깻깼깽꺄꺅꺌꺼꺽꺾껀껄껌껍껏껐껑께껙껜껨껫껭껴껸껼꼇꼈꼍꼐꼬꼭꼰꼲꼴꼼꼽꼿꽁꽂꽃꽈꽉꽐꽜꽝꽤꽥꽹꾀꾄꾈꾐꾑꾕꾜꾸꾹꾼꿀꿇꿈꿉꿋꿍꿎꿔꿜꿨꿩꿰꿱꿴꿸뀀뀁뀄뀌뀐뀔뀜뀝뀨끄끅끈끊끌끎끓끔끕끗끙"], -["b341","쿌",19,"쿢쿣쿥쿦쿧쿩"], -["b361","쿪",5,"쿲쿴쿶",5,"쿽쿾쿿퀁퀂퀃퀅",5], -["b381","퀋",5,"퀒",5,"퀙",19,"끝끼끽낀낄낌낍낏낑나낙낚난낟날낡낢남납낫",4,"낱낳내낵낸낼냄냅냇냈냉냐냑냔냘냠냥너넉넋넌널넒넓넘넙넛넜넝넣네넥넨넬넴넵넷넸넹녀녁년녈념녑녔녕녘녜녠노녹논놀놂놈놉놋농높놓놔놘놜놨뇌뇐뇔뇜뇝"], -["b441","퀮",5,"퀶퀷퀹퀺퀻퀽",6,"큆큈큊",5], -["b461","큑큒큓큕큖큗큙",6,"큡",10,"큮큯"], -["b481","큱큲큳큵",6,"큾큿킀킂",18,"뇟뇨뇩뇬뇰뇹뇻뇽누눅눈눋눌눔눕눗눙눠눴눼뉘뉜뉠뉨뉩뉴뉵뉼늄늅늉느늑는늘늙늚늠늡늣능늦늪늬늰늴니닉닌닐닒님닙닛닝닢다닥닦단닫",4,"닳담답닷",4,"닿대댁댄댈댐댑댓댔댕댜더덕덖던덛덜덞덟덤덥"], -["b541","킕",14,"킦킧킩킪킫킭",5], -["b561","킳킶킸킺",5,"탂탃탅탆탇탊",5,"탒탖",4], -["b581","탛탞탟탡탢탣탥",6,"탮탲",5,"탹",11,"덧덩덫덮데덱덴델뎀뎁뎃뎄뎅뎌뎐뎔뎠뎡뎨뎬도독돈돋돌돎돐돔돕돗동돛돝돠돤돨돼됐되된될됨됩됫됴두둑둔둘둠둡둣둥둬뒀뒈뒝뒤뒨뒬뒵뒷뒹듀듄듈듐듕드득든듣들듦듬듭듯등듸디딕딘딛딜딤딥딧딨딩딪따딱딴딸"], -["b641","턅",7,"턎",17], -["b661","턠",15,"턲턳턵턶턷턹턻턼턽턾"], -["b681","턿텂텆",5,"텎텏텑텒텓텕",6,"텞텠텢",5,"텩텪텫텭땀땁땃땄땅땋때땍땐땔땜땝땟땠땡떠떡떤떨떪떫떰떱떳떴떵떻떼떽뗀뗄뗌뗍뗏뗐뗑뗘뗬또똑똔똘똥똬똴뙈뙤뙨뚜뚝뚠뚤뚫뚬뚱뛔뛰뛴뛸뜀뜁뜅뜨뜩뜬뜯뜰뜸뜹뜻띄띈띌띔띕띠띤띨띰띱띳띵라락란랄람랍랏랐랑랒랖랗"], -["b741","텮",13,"텽",6,"톅톆톇톉톊"], -["b761","톋",20,"톢톣톥톦톧"], -["b781","톩",6,"톲톴톶톷톸톹톻톽톾톿퇁",14,"래랙랜랠램랩랫랬랭랴략랸럇량러럭런럴럼럽럿렀렁렇레렉렌렐렘렙렛렝려력련렬렴렵렷렸령례롄롑롓로록론롤롬롭롯롱롸롼뢍뢨뢰뢴뢸룀룁룃룅료룐룔룝룟룡루룩룬룰룸룹룻룽뤄뤘뤠뤼뤽륀륄륌륏륑류륙륜률륨륩"], -["b841","퇐",7,"퇙",17], -["b861","퇫",8,"퇵퇶퇷퇹",13], -["b881","툈툊",5,"툑",24,"륫륭르륵른를름릅릇릉릊릍릎리릭린릴림립릿링마막만많",4,"맘맙맛망맞맡맣매맥맨맬맴맵맷맸맹맺먀먁먈먕머먹먼멀멂멈멉멋멍멎멓메멕멘멜멤멥멧멨멩며멱면멸몃몄명몇몌모목몫몬몰몲몸몹못몽뫄뫈뫘뫙뫼"], -["b941","툪툫툮툯툱툲툳툵",6,"툾퉀퉂",5,"퉉퉊퉋퉌"], -["b961","퉍",14,"퉝",6,"퉥퉦퉧퉨"], -["b981","퉩",22,"튂튃튅튆튇튉튊튋튌묀묄묍묏묑묘묜묠묩묫무묵묶문묻물묽묾뭄뭅뭇뭉뭍뭏뭐뭔뭘뭡뭣뭬뮈뮌뮐뮤뮨뮬뮴뮷므믄믈믐믓미믹민믿밀밂밈밉밋밌밍및밑바",4,"받",4,"밤밥밧방밭배백밴밸뱀뱁뱃뱄뱅뱉뱌뱍뱐뱝버벅번벋벌벎범법벗"], -["ba41","튍튎튏튒튓튔튖",5,"튝튞튟튡튢튣튥",6,"튭"], -["ba61","튮튯튰튲",5,"튺튻튽튾틁틃",4,"틊틌",5], -["ba81","틒틓틕틖틗틙틚틛틝",6,"틦",9,"틲틳틵틶틷틹틺벙벚베벡벤벧벨벰벱벳벴벵벼벽변별볍볏볐병볕볘볜보복볶본볼봄봅봇봉봐봔봤봬뵀뵈뵉뵌뵐뵘뵙뵤뵨부북분붇불붉붊붐붑붓붕붙붚붜붤붰붸뷔뷕뷘뷜뷩뷰뷴뷸븀븃븅브븍븐블븜븝븟비빅빈빌빎빔빕빗빙빚빛빠빡빤"], -["bb41","틻",4,"팂팄팆",5,"팏팑팒팓팕팗",4,"팞팢팣"], -["bb61","팤팦팧팪팫팭팮팯팱",6,"팺팾",5,"퍆퍇퍈퍉"], -["bb81","퍊",31,"빨빪빰빱빳빴빵빻빼빽뺀뺄뺌뺍뺏뺐뺑뺘뺙뺨뻐뻑뻔뻗뻘뻠뻣뻤뻥뻬뼁뼈뼉뼘뼙뼛뼜뼝뽀뽁뽄뽈뽐뽑뽕뾔뾰뿅뿌뿍뿐뿔뿜뿟뿡쀼쁑쁘쁜쁠쁨쁩삐삑삔삘삠삡삣삥사삭삯산삳살삵삶삼삽삿샀상샅새색샌샐샘샙샛샜생샤"], -["bc41","퍪",17,"퍾퍿펁펂펃펅펆펇"], -["bc61","펈펉펊펋펎펒",5,"펚펛펝펞펟펡",6,"펪펬펮"], -["bc81","펯",4,"펵펶펷펹펺펻펽",6,"폆폇폊",5,"폑",5,"샥샨샬샴샵샷샹섀섄섈섐섕서",4,"섣설섦섧섬섭섯섰성섶세섹센셀셈셉셋셌셍셔셕션셜셤셥셧셨셩셰셴셸솅소속솎손솔솖솜솝솟송솥솨솩솬솰솽쇄쇈쇌쇔쇗쇘쇠쇤쇨쇰쇱쇳쇼쇽숀숄숌숍숏숑수숙순숟술숨숩숫숭"], -["bd41","폗폙",7,"폢폤",7,"폮폯폱폲폳폵폶폷"], -["bd61","폸폹폺폻폾퐀퐂",5,"퐉",13], -["bd81","퐗",5,"퐞",25,"숯숱숲숴쉈쉐쉑쉔쉘쉠쉥쉬쉭쉰쉴쉼쉽쉿슁슈슉슐슘슛슝스슥슨슬슭슴습슷승시식신싣실싫심십싯싱싶싸싹싻싼쌀쌈쌉쌌쌍쌓쌔쌕쌘쌜쌤쌥쌨쌩썅써썩썬썰썲썸썹썼썽쎄쎈쎌쏀쏘쏙쏜쏟쏠쏢쏨쏩쏭쏴쏵쏸쐈쐐쐤쐬쐰"], -["be41","퐸",7,"푁푂푃푅",14], -["be61","푔",7,"푝푞푟푡푢푣푥",7,"푮푰푱푲"], -["be81","푳",4,"푺푻푽푾풁풃",4,"풊풌풎",5,"풕",8,"쐴쐼쐽쑈쑤쑥쑨쑬쑴쑵쑹쒀쒔쒜쒸쒼쓩쓰쓱쓴쓸쓺쓿씀씁씌씐씔씜씨씩씬씰씸씹씻씽아악안앉않알앍앎앓암압앗았앙앝앞애액앤앨앰앱앳앴앵야약얀얄얇얌얍얏양얕얗얘얜얠얩어억언얹얻얼얽얾엄",6,"엌엎"], -["bf41","풞",10,"풪",14], -["bf61","풹",18,"퓍퓎퓏퓑퓒퓓퓕"], -["bf81","퓖",5,"퓝퓞퓠",7,"퓩퓪퓫퓭퓮퓯퓱",6,"퓹퓺퓼에엑엔엘엠엡엣엥여역엮연열엶엷염",5,"옅옆옇예옌옐옘옙옛옜오옥온올옭옮옰옳옴옵옷옹옻와왁완왈왐왑왓왔왕왜왝왠왬왯왱외왹왼욀욈욉욋욍요욕욘욜욤욥욧용우욱운울욹욺움웁웃웅워웍원월웜웝웠웡웨"], -["c041","퓾",5,"픅픆픇픉픊픋픍",6,"픖픘",5], -["c061","픞",25], -["c081","픸픹픺픻픾픿핁핂핃핅",6,"핎핐핒",5,"핚핛핝핞핟핡핢핣웩웬웰웸웹웽위윅윈윌윔윕윗윙유육윤율윰윱윳융윷으윽은을읊음읍읏응",7,"읜읠읨읫이익인일읽읾잃임입잇있잉잊잎자작잔잖잗잘잚잠잡잣잤장잦재잭잰잴잼잽잿쟀쟁쟈쟉쟌쟎쟐쟘쟝쟤쟨쟬저적전절젊"], -["c141","핤핦핧핪핬핮",5,"핶핷핹핺핻핽",6,"햆햊햋"], -["c161","햌햍햎햏햑",19,"햦햧"], -["c181","햨",31,"점접젓정젖제젝젠젤젬젭젯젱져젼졀졈졉졌졍졔조족존졸졺좀좁좃종좆좇좋좌좍좔좝좟좡좨좼좽죄죈죌죔죕죗죙죠죡죤죵주죽준줄줅줆줌줍줏중줘줬줴쥐쥑쥔쥘쥠쥡쥣쥬쥰쥴쥼즈즉즌즐즘즙즛증지직진짇질짊짐집짓"], -["c241","헊헋헍헎헏헑헓",4,"헚헜헞",5,"헦헧헩헪헫헭헮"], -["c261","헯",4,"헶헸헺",5,"혂혃혅혆혇혉",6,"혒"], -["c281","혖",5,"혝혞혟혡혢혣혥",7,"혮",9,"혺혻징짖짙짚짜짝짠짢짤짧짬짭짯짰짱째짹짼쨀쨈쨉쨋쨌쨍쨔쨘쨩쩌쩍쩐쩔쩜쩝쩟쩠쩡쩨쩽쪄쪘쪼쪽쫀쫄쫌쫍쫏쫑쫓쫘쫙쫠쫬쫴쬈쬐쬔쬘쬠쬡쭁쭈쭉쭌쭐쭘쭙쭝쭤쭸쭹쮜쮸쯔쯤쯧쯩찌찍찐찔찜찝찡찢찧차착찬찮찰참찹찻"], -["c341","혽혾혿홁홂홃홄홆홇홊홌홎홏홐홒홓홖홗홙홚홛홝",4], -["c361","홢",4,"홨홪",5,"홲홳홵",11], -["c381","횁횂횄횆",5,"횎횏횑횒횓횕",7,"횞횠횢",5,"횩횪찼창찾채책챈챌챔챕챗챘챙챠챤챦챨챰챵처척천철첨첩첫첬청체첵첸첼쳄쳅쳇쳉쳐쳔쳤쳬쳰촁초촉촌촐촘촙촛총촤촨촬촹최쵠쵤쵬쵭쵯쵱쵸춈추축춘출춤춥춧충춰췄췌췐취췬췰췸췹췻췽츄츈츌츔츙츠측츤츨츰츱츳층"], -["c441","횫횭횮횯횱",7,"횺횼",7,"훆훇훉훊훋"], -["c461","훍훎훏훐훒훓훕훖훘훚",5,"훡훢훣훥훦훧훩",4], -["c481","훮훯훱훲훳훴훶",5,"훾훿휁휂휃휅",11,"휒휓휔치칙친칟칠칡침칩칫칭카칵칸칼캄캅캇캉캐캑캔캘캠캡캣캤캥캬캭컁커컥컨컫컬컴컵컷컸컹케켁켄켈켐켑켓켕켜켠켤켬켭켯켰켱켸코콕콘콜콤콥콧콩콰콱콴콸쾀쾅쾌쾡쾨쾰쿄쿠쿡쿤쿨쿰쿱쿳쿵쿼퀀퀄퀑퀘퀭퀴퀵퀸퀼"], -["c541","휕휖휗휚휛휝휞휟휡",6,"휪휬휮",5,"휶휷휹"], -["c561","휺휻휽",6,"흅흆흈흊",5,"흒흓흕흚",4], -["c581","흟흢흤흦흧흨흪흫흭흮흯흱흲흳흵",6,"흾흿힀힂",5,"힊힋큄큅큇큉큐큔큘큠크큭큰클큼큽킁키킥킨킬킴킵킷킹타탁탄탈탉탐탑탓탔탕태택탠탤탬탭탯탰탱탸턍터턱턴털턺텀텁텃텄텅테텍텐텔템텝텟텡텨텬텼톄톈토톡톤톨톰톱톳통톺톼퇀퇘퇴퇸툇툉툐투툭툰툴툼툽툿퉁퉈퉜"], -["c641","힍힎힏힑",6,"힚힜힞",5], -["c6a1","퉤튀튁튄튈튐튑튕튜튠튤튬튱트특튼튿틀틂틈틉틋틔틘틜틤틥티틱틴틸팀팁팃팅파팍팎판팔팖팜팝팟팠팡팥패팩팬팰팸팹팻팼팽퍄퍅퍼퍽펀펄펌펍펏펐펑페펙펜펠펨펩펫펭펴편펼폄폅폈평폐폘폡폣포폭폰폴폼폽폿퐁"], -["c7a1","퐈퐝푀푄표푠푤푭푯푸푹푼푿풀풂품풉풋풍풔풩퓌퓐퓔퓜퓟퓨퓬퓰퓸퓻퓽프픈플픔픕픗피픽핀필핌핍핏핑하학한할핥함합핫항해핵핸핼햄햅햇했행햐향허헉헌헐헒험헙헛헝헤헥헨헬헴헵헷헹혀혁현혈혐협혓혔형혜혠"], -["c8a1","혤혭호혹혼홀홅홈홉홋홍홑화확환활홧황홰홱홴횃횅회획횐횔횝횟횡효횬횰횹횻후훅훈훌훑훔훗훙훠훤훨훰훵훼훽휀휄휑휘휙휜휠휨휩휫휭휴휵휸휼흄흇흉흐흑흔흖흗흘흙흠흡흣흥흩희흰흴흼흽힁히힉힌힐힘힙힛힝"], -["caa1","伽佳假價加可呵哥嘉嫁家暇架枷柯歌珂痂稼苛茄街袈訶賈跏軻迦駕刻却各恪慤殼珏脚覺角閣侃刊墾奸姦干幹懇揀杆柬桿澗癎看磵稈竿簡肝艮艱諫間乫喝曷渴碣竭葛褐蝎鞨勘坎堪嵌感憾戡敢柑橄減甘疳監瞰紺邯鑑鑒龕"], -["cba1","匣岬甲胛鉀閘剛堈姜岡崗康强彊慷江畺疆糠絳綱羌腔舡薑襁講鋼降鱇介价個凱塏愷愾慨改槪漑疥皆盖箇芥蓋豈鎧開喀客坑更粳羹醵倨去居巨拒据據擧渠炬祛距踞車遽鉅鋸乾件健巾建愆楗腱虔蹇鍵騫乞傑杰桀儉劍劒檢"], -["cca1","瞼鈐黔劫怯迲偈憩揭擊格檄激膈覡隔堅牽犬甄絹繭肩見譴遣鵑抉決潔結缺訣兼慊箝謙鉗鎌京俓倞傾儆勁勍卿坰境庚徑慶憬擎敬景暻更梗涇炅烱璟璥瓊痙硬磬竟競絅經耕耿脛莖警輕逕鏡頃頸驚鯨係啓堺契季屆悸戒桂械"], -["cda1","棨溪界癸磎稽系繫繼計誡谿階鷄古叩告呱固姑孤尻庫拷攷故敲暠枯槁沽痼皐睾稿羔考股膏苦苽菰藁蠱袴誥賈辜錮雇顧高鼓哭斛曲梏穀谷鵠困坤崑昆梱棍滾琨袞鯤汨滑骨供公共功孔工恐恭拱控攻珙空蚣貢鞏串寡戈果瓜"], -["cea1","科菓誇課跨過鍋顆廓槨藿郭串冠官寬慣棺款灌琯瓘管罐菅觀貫關館刮恝括适侊光匡壙廣曠洸炚狂珖筐胱鑛卦掛罫乖傀塊壞怪愧拐槐魁宏紘肱轟交僑咬喬嬌嶠巧攪敎校橋狡皎矯絞翹膠蕎蛟較轎郊餃驕鮫丘久九仇俱具勾"], -["cfa1","區口句咎嘔坵垢寇嶇廐懼拘救枸柩構歐毆毬求溝灸狗玖球瞿矩究絿耉臼舅舊苟衢謳購軀逑邱鉤銶駒驅鳩鷗龜國局菊鞠鞫麴君窘群裙軍郡堀屈掘窟宮弓穹窮芎躬倦券勸卷圈拳捲權淃眷厥獗蕨蹶闕机櫃潰詭軌饋句晷歸貴"], -["d0a1","鬼龜叫圭奎揆槻珪硅窺竅糾葵規赳逵閨勻均畇筠菌鈞龜橘克剋劇戟棘極隙僅劤勤懃斤根槿瑾筋芹菫覲謹近饉契今妗擒昑檎琴禁禽芩衾衿襟金錦伋及急扱汲級給亘兢矜肯企伎其冀嗜器圻基埼夔奇妓寄岐崎己幾忌技旗旣"], -["d1a1","朞期杞棋棄機欺氣汽沂淇玘琦琪璂璣畸畿碁磯祁祇祈祺箕紀綺羈耆耭肌記譏豈起錡錤飢饑騎騏驥麒緊佶吉拮桔金喫儺喇奈娜懦懶拏拿癩",5,"那樂",4,"諾酪駱亂卵暖欄煖爛蘭難鸞捏捺南嵐枏楠湳濫男藍襤拉"], -["d2a1","納臘蠟衲囊娘廊",4,"乃來內奈柰耐冷女年撚秊念恬拈捻寧寗努勞奴弩怒擄櫓爐瑙盧",5,"駑魯",10,"濃籠聾膿農惱牢磊腦賂雷尿壘",7,"嫩訥杻紐勒",5,"能菱陵尼泥匿溺多茶"], -["d3a1","丹亶但單團壇彖斷旦檀段湍短端簞緞蛋袒鄲鍛撻澾獺疸達啖坍憺擔曇淡湛潭澹痰聃膽蕁覃談譚錟沓畓答踏遝唐堂塘幢戇撞棠當糖螳黨代垈坮大對岱帶待戴擡玳臺袋貸隊黛宅德悳倒刀到圖堵塗導屠島嶋度徒悼挑掉搗桃"], -["d4a1","棹櫂淘渡滔濤燾盜睹禱稻萄覩賭跳蹈逃途道都鍍陶韜毒瀆牘犢獨督禿篤纛讀墩惇敦旽暾沌焞燉豚頓乭突仝冬凍動同憧東桐棟洞潼疼瞳童胴董銅兜斗杜枓痘竇荳讀豆逗頭屯臀芚遁遯鈍得嶝橙燈登等藤謄鄧騰喇懶拏癩羅"], -["d5a1","蘿螺裸邏樂洛烙珞絡落諾酪駱丹亂卵欄欒瀾爛蘭鸞剌辣嵐擥攬欖濫籃纜藍襤覽拉臘蠟廊朗浪狼琅瑯螂郞來崍徠萊冷掠略亮倆兩凉梁樑粮粱糧良諒輛量侶儷勵呂廬慮戾旅櫚濾礪藜蠣閭驢驪麗黎力曆歷瀝礫轢靂憐戀攣漣"], -["d6a1","煉璉練聯蓮輦連鍊冽列劣洌烈裂廉斂殮濂簾獵令伶囹寧岺嶺怜玲笭羚翎聆逞鈴零靈領齡例澧禮醴隷勞怒撈擄櫓潞瀘爐盧老蘆虜路輅露魯鷺鹵碌祿綠菉錄鹿麓論壟弄朧瀧瓏籠聾儡瀨牢磊賂賚賴雷了僚寮廖料燎療瞭聊蓼"], -["d7a1","遼鬧龍壘婁屢樓淚漏瘻累縷蔞褸鏤陋劉旒柳榴流溜瀏琉瑠留瘤硫謬類六戮陸侖倫崙淪綸輪律慄栗率隆勒肋凜凌楞稜綾菱陵俚利厘吏唎履悧李梨浬犁狸理璃異痢籬罹羸莉裏裡里釐離鯉吝潾燐璘藺躪隣鱗麟林淋琳臨霖砬"], -["d8a1","立笠粒摩瑪痲碼磨馬魔麻寞幕漠膜莫邈万卍娩巒彎慢挽晩曼滿漫灣瞞萬蔓蠻輓饅鰻唜抹末沫茉襪靺亡妄忘忙望網罔芒茫莽輞邙埋妹媒寐昧枚梅每煤罵買賣邁魅脈貊陌驀麥孟氓猛盲盟萌冪覓免冕勉棉沔眄眠綿緬面麵滅"], -["d9a1","蔑冥名命明暝椧溟皿瞑茗蓂螟酩銘鳴袂侮冒募姆帽慕摸摹暮某模母毛牟牡瑁眸矛耗芼茅謀謨貌木沐牧目睦穆鶩歿沒夢朦蒙卯墓妙廟描昴杳渺猫竗苗錨務巫憮懋戊拇撫无楙武毋無珷畝繆舞茂蕪誣貿霧鵡墨默們刎吻問文"], -["daa1","汶紊紋聞蚊門雯勿沕物味媚尾嵋彌微未梶楣渼湄眉米美薇謎迷靡黴岷悶愍憫敏旻旼民泯玟珉緡閔密蜜謐剝博拍搏撲朴樸泊珀璞箔粕縛膊舶薄迫雹駁伴半反叛拌搬攀斑槃泮潘班畔瘢盤盼磐磻礬絆般蟠返頒飯勃拔撥渤潑"], -["dba1","發跋醱鉢髮魃倣傍坊妨尨幇彷房放方旁昉枋榜滂磅紡肪膀舫芳蒡蚌訪謗邦防龐倍俳北培徘拜排杯湃焙盃背胚裴裵褙賠輩配陪伯佰帛柏栢白百魄幡樊煩燔番磻繁蕃藩飜伐筏罰閥凡帆梵氾汎泛犯範范法琺僻劈壁擘檗璧癖"], -["dca1","碧蘗闢霹便卞弁變辨辯邊別瞥鱉鼈丙倂兵屛幷昞昺柄棅炳甁病秉竝輧餠騈保堡報寶普步洑湺潽珤甫菩補褓譜輔伏僕匐卜宓復服福腹茯蔔複覆輹輻馥鰒本乶俸奉封峯峰捧棒烽熢琫縫蓬蜂逢鋒鳳不付俯傅剖副否咐埠夫婦"], -["dda1","孚孵富府復扶敷斧浮溥父符簿缶腐腑膚艀芙莩訃負賦賻赴趺部釜阜附駙鳧北分吩噴墳奔奮忿憤扮昐汾焚盆粉糞紛芬賁雰不佛弗彿拂崩朋棚硼繃鵬丕備匕匪卑妃婢庇悲憊扉批斐枇榧比毖毗毘沸泌琵痺砒碑秕秘粃緋翡肥"], -["dea1","脾臂菲蜚裨誹譬費鄙非飛鼻嚬嬪彬斌檳殯浜濱瀕牝玭貧賓頻憑氷聘騁乍事些仕伺似使俟僿史司唆嗣四士奢娑寫寺射巳師徙思捨斜斯柶査梭死沙泗渣瀉獅砂社祀祠私篩紗絲肆舍莎蓑蛇裟詐詞謝賜赦辭邪飼駟麝削數朔索"], -["dfa1","傘刪山散汕珊産疝算蒜酸霰乷撒殺煞薩三參杉森渗芟蔘衫揷澁鈒颯上傷像償商喪嘗孀尙峠常床庠廂想桑橡湘爽牀狀相祥箱翔裳觴詳象賞霜塞璽賽嗇塞穡索色牲生甥省笙墅壻嶼序庶徐恕抒捿敍暑曙書栖棲犀瑞筮絮緖署"], -["e0a1","胥舒薯西誓逝鋤黍鼠夕奭席惜昔晳析汐淅潟石碩蓆釋錫仙僊先善嬋宣扇敾旋渲煽琁瑄璇璿癬禪線繕羨腺膳船蘚蟬詵跣選銑鐥饍鮮卨屑楔泄洩渫舌薛褻設說雪齧剡暹殲纖蟾贍閃陝攝涉燮葉城姓宬性惺成星晟猩珹盛省筬"], -["e1a1","聖聲腥誠醒世勢歲洗稅笹細說貰召嘯塑宵小少巢所掃搔昭梳沼消溯瀟炤燒甦疏疎瘙笑篠簫素紹蔬蕭蘇訴逍遡邵銷韶騷俗屬束涑粟續謖贖速孫巽損蓀遜飡率宋悚松淞訟誦送頌刷殺灑碎鎖衰釗修受嗽囚垂壽嫂守岫峀帥愁"], -["e2a1","戍手授搜收數樹殊水洙漱燧狩獸琇璲瘦睡秀穗竪粹綏綬繡羞脩茱蒐蓚藪袖誰讐輸遂邃酬銖銹隋隧隨雖需須首髓鬚叔塾夙孰宿淑潚熟琡璹肅菽巡徇循恂旬栒楯橓殉洵淳珣盾瞬筍純脣舜荀蓴蕣詢諄醇錞順馴戌術述鉥崇崧"], -["e3a1","嵩瑟膝蝨濕拾習褶襲丞乘僧勝升承昇繩蠅陞侍匙嘶始媤尸屎屍市弑恃施是時枾柴猜矢示翅蒔蓍視試詩諡豕豺埴寔式息拭植殖湜熄篒蝕識軾食飾伸侁信呻娠宸愼新晨燼申神紳腎臣莘薪藎蜃訊身辛辰迅失室實悉審尋心沁"], -["e4a1","沈深瀋甚芯諶什十拾雙氏亞俄兒啞娥峨我牙芽莪蛾衙訝阿雅餓鴉鵝堊岳嶽幄惡愕握樂渥鄂鍔顎鰐齷安岸按晏案眼雁鞍顔鮟斡謁軋閼唵岩巖庵暗癌菴闇壓押狎鴨仰央怏昻殃秧鴦厓哀埃崖愛曖涯碍艾隘靄厄扼掖液縊腋額"], -["e5a1","櫻罌鶯鸚也倻冶夜惹揶椰爺耶若野弱掠略約若葯蒻藥躍亮佯兩凉壤孃恙揚攘敭暘梁楊樣洋瀁煬痒瘍禳穰糧羊良襄諒讓釀陽量養圄御於漁瘀禦語馭魚齬億憶抑檍臆偃堰彦焉言諺孼蘖俺儼嚴奄掩淹嶪業円予余勵呂女如廬"], -["e6a1","旅歟汝濾璵礖礪與艅茹輿轝閭餘驪麗黎亦力域役易曆歷疫繹譯轢逆驛嚥堧姸娟宴年延憐戀捐挻撚椽沇沿涎涓淵演漣烟然煙煉燃燕璉硏硯秊筵緣練縯聯衍軟輦蓮連鉛鍊鳶列劣咽悅涅烈熱裂說閱厭廉念捻染殮炎焰琰艶苒"], -["e7a1","簾閻髥鹽曄獵燁葉令囹塋寧嶺嶸影怜映暎楹榮永泳渶潁濚瀛瀯煐營獰玲瑛瑩瓔盈穎纓羚聆英詠迎鈴鍈零霙靈領乂倪例刈叡曳汭濊猊睿穢芮藝蘂禮裔詣譽豫醴銳隸霓預五伍俉傲午吾吳嗚塢墺奧娛寤悟惡懊敖旿晤梧汚澳"], -["e8a1","烏熬獒筽蜈誤鰲鼇屋沃獄玉鈺溫瑥瘟穩縕蘊兀壅擁瓮甕癰翁邕雍饔渦瓦窩窪臥蛙蝸訛婉完宛梡椀浣玩琓琬碗緩翫脘腕莞豌阮頑曰往旺枉汪王倭娃歪矮外嵬巍猥畏了僚僥凹堯夭妖姚寥寮尿嶢拗搖撓擾料曜樂橈燎燿瑤療"], -["e9a1","窈窯繇繞耀腰蓼蟯要謠遙遼邀饒慾欲浴縟褥辱俑傭冗勇埇墉容庸慂榕涌湧溶熔瑢用甬聳茸蓉踊鎔鏞龍于佑偶優又友右宇寓尤愚憂旴牛玗瑀盂祐禑禹紆羽芋藕虞迂遇郵釪隅雨雩勖彧旭昱栯煜稶郁頊云暈橒殞澐熉耘芸蕓"], -["eaa1","運隕雲韻蔚鬱亐熊雄元原員圓園垣媛嫄寃怨愿援沅洹湲源爰猿瑗苑袁轅遠阮院願鴛月越鉞位偉僞危圍委威尉慰暐渭爲瑋緯胃萎葦蔿蝟衛褘謂違韋魏乳侑儒兪劉唯喩孺宥幼幽庾悠惟愈愉揄攸有杻柔柚柳楡楢油洧流游溜"], -["eba1","濡猶猷琉瑜由留癒硫紐維臾萸裕誘諛諭踰蹂遊逾遺酉釉鍮類六堉戮毓肉育陸倫允奫尹崙淪潤玧胤贇輪鈗閏律慄栗率聿戎瀜絨融隆垠恩慇殷誾銀隱乙吟淫蔭陰音飮揖泣邑凝應膺鷹依倚儀宜意懿擬椅毅疑矣義艤薏蟻衣誼"], -["eca1","議醫二以伊利吏夷姨履已弛彛怡易李梨泥爾珥理異痍痢移罹而耳肄苡荑裏裡貽貳邇里離飴餌匿溺瀷益翊翌翼謚人仁刃印吝咽因姻寅引忍湮燐璘絪茵藺蚓認隣靭靷鱗麟一佚佾壹日溢逸鎰馹任壬妊姙恁林淋稔臨荏賃入卄"], -["eda1","立笠粒仍剩孕芿仔刺咨姉姿子字孜恣慈滋炙煮玆瓷疵磁紫者自茨蔗藉諮資雌作勺嚼斫昨灼炸爵綽芍酌雀鵲孱棧殘潺盞岑暫潛箴簪蠶雜丈仗匠場墻壯奬將帳庄張掌暲杖樟檣欌漿牆狀獐璋章粧腸臟臧莊葬蔣薔藏裝贓醬長"], -["eea1","障再哉在宰才材栽梓渽滓災縡裁財載齋齎爭箏諍錚佇低儲咀姐底抵杵楮樗沮渚狙猪疽箸紵苧菹著藷詛貯躇這邸雎齟勣吊嫡寂摘敵滴狄炙的積笛籍績翟荻謫賊赤跡蹟迪迹適鏑佃佺傳全典前剪塡塼奠專展廛悛戰栓殿氈澱"], -["efa1","煎琠田甸畑癲筌箋箭篆纏詮輾轉鈿銓錢鐫電顚顫餞切截折浙癤竊節絶占岾店漸点粘霑鮎點接摺蝶丁井亭停偵呈姃定幀庭廷征情挺政整旌晶晸柾楨檉正汀淀淨渟湞瀞炡玎珽町睛碇禎程穽精綎艇訂諪貞鄭酊釘鉦鋌錠霆靖"], -["f0a1","靜頂鼎制劑啼堤帝弟悌提梯濟祭第臍薺製諸蹄醍除際霽題齊俎兆凋助嘲弔彫措操早晁曺曹朝條棗槽漕潮照燥爪璪眺祖祚租稠窕粗糟組繰肇藻蚤詔調趙躁造遭釣阻雕鳥族簇足鏃存尊卒拙猝倧宗從悰慫棕淙琮種終綜縱腫"], -["f1a1","踪踵鍾鐘佐坐左座挫罪主住侏做姝胄呪周嗾奏宙州廚晝朱柱株注洲湊澍炷珠疇籌紂紬綢舟蛛註誅走躊輳週酎酒鑄駐竹粥俊儁准埈寯峻晙樽浚準濬焌畯竣蠢逡遵雋駿茁中仲衆重卽櫛楫汁葺增憎曾拯烝甑症繒蒸證贈之只"], -["f2a1","咫地址志持指摯支旨智枝枳止池沚漬知砥祉祗紙肢脂至芝芷蜘誌識贄趾遲直稙稷織職唇嗔塵振搢晉晋桭榛殄津溱珍瑨璡畛疹盡眞瞋秦縉縝臻蔯袗診賑軫辰進鎭陣陳震侄叱姪嫉帙桎瓆疾秩窒膣蛭質跌迭斟朕什執潗緝輯"], -["f3a1","鏶集徵懲澄且侘借叉嗟嵯差次此磋箚茶蹉車遮捉搾着窄錯鑿齪撰澯燦璨瓚竄簒纂粲纘讚贊鑽餐饌刹察擦札紮僭參塹慘慙懺斬站讒讖倉倡創唱娼廠彰愴敞昌昶暢槍滄漲猖瘡窓脹艙菖蒼債埰寀寨彩採砦綵菜蔡采釵冊柵策"], -["f4a1","責凄妻悽處倜刺剔尺慽戚拓擲斥滌瘠脊蹠陟隻仟千喘天川擅泉淺玔穿舛薦賤踐遷釧闡阡韆凸哲喆徹撤澈綴輟轍鐵僉尖沾添甛瞻簽籤詹諂堞妾帖捷牒疊睫諜貼輒廳晴淸聽菁請靑鯖切剃替涕滯締諦逮遞體初剿哨憔抄招梢"], -["f5a1","椒楚樵炒焦硝礁礎秒稍肖艸苕草蕉貂超酢醋醮促囑燭矗蜀觸寸忖村邨叢塚寵悤憁摠總聰蔥銃撮催崔最墜抽推椎楸樞湫皺秋芻萩諏趨追鄒酋醜錐錘鎚雛騶鰍丑畜祝竺筑築縮蓄蹙蹴軸逐春椿瑃出朮黜充忠沖蟲衝衷悴膵萃"], -["f6a1","贅取吹嘴娶就炊翠聚脆臭趣醉驟鷲側仄厠惻測層侈値嗤峙幟恥梔治淄熾痔痴癡稚穉緇緻置致蚩輜雉馳齒則勅飭親七柒漆侵寢枕沈浸琛砧針鍼蟄秤稱快他咤唾墮妥惰打拖朶楕舵陀馱駝倬卓啄坼度托拓擢晫柝濁濯琢琸託"], -["f7a1","鐸呑嘆坦彈憚歎灘炭綻誕奪脫探眈耽貪塔搭榻宕帑湯糖蕩兌台太怠態殆汰泰笞胎苔跆邰颱宅擇澤撑攄兎吐土討慟桶洞痛筒統通堆槌腿褪退頹偸套妬投透鬪慝特闖坡婆巴把播擺杷波派爬琶破罷芭跛頗判坂板版瓣販辦鈑"], -["f8a1","阪八叭捌佩唄悖敗沛浿牌狽稗覇貝彭澎烹膨愎便偏扁片篇編翩遍鞭騙貶坪平枰萍評吠嬖幣廢弊斃肺蔽閉陛佈包匍匏咆哺圃布怖抛抱捕暴泡浦疱砲胞脯苞葡蒲袍褒逋鋪飽鮑幅暴曝瀑爆輻俵剽彪慓杓標漂瓢票表豹飇飄驃"], -["f9a1","品稟楓諷豊風馮彼披疲皮被避陂匹弼必泌珌畢疋筆苾馝乏逼下何厦夏廈昰河瑕荷蝦賀遐霞鰕壑學虐謔鶴寒恨悍旱汗漢澣瀚罕翰閑閒限韓割轄函含咸啣喊檻涵緘艦銜陷鹹合哈盒蛤閤闔陜亢伉姮嫦巷恒抗杭桁沆港缸肛航"], -["faa1","行降項亥偕咳垓奚孩害懈楷海瀣蟹解該諧邂駭骸劾核倖幸杏荇行享向嚮珦鄕響餉饗香噓墟虛許憲櫶獻軒歇險驗奕爀赫革俔峴弦懸晛泫炫玄玹現眩睍絃絢縣舷衒見賢鉉顯孑穴血頁嫌俠協夾峽挾浹狹脅脇莢鋏頰亨兄刑型"], -["fba1","形泂滎瀅灐炯熒珩瑩荊螢衡逈邢鎣馨兮彗惠慧暳蕙蹊醯鞋乎互呼壕壺好岵弧戶扈昊晧毫浩淏湖滸澔濠濩灝狐琥瑚瓠皓祜糊縞胡芦葫蒿虎號蝴護豪鎬頀顥惑或酷婚昏混渾琿魂忽惚笏哄弘汞泓洪烘紅虹訌鴻化和嬅樺火畵"], -["fca1","禍禾花華話譁貨靴廓擴攫確碻穫丸喚奐宦幻患換歡晥桓渙煥環紈還驩鰥活滑猾豁闊凰幌徨恍惶愰慌晃晄榥況湟滉潢煌璜皇篁簧荒蝗遑隍黃匯回廻徊恢悔懷晦會檜淮澮灰獪繪膾茴蛔誨賄劃獲宖橫鐄哮嚆孝效斅曉梟涍淆"], -["fda1","爻肴酵驍侯候厚后吼喉嗅帿後朽煦珝逅勛勳塤壎焄熏燻薰訓暈薨喧暄煊萱卉喙毁彙徽揮暉煇諱輝麾休携烋畦虧恤譎鷸兇凶匈洶胸黑昕欣炘痕吃屹紇訖欠欽歆吸恰洽翕興僖凞喜噫囍姬嬉希憙憘戱晞曦熙熹熺犧禧稀羲詰"] -] diff --git a/node_modules/mysql2/node_modules/iconv-lite/encodings/tables/cp950.json b/node_modules/mysql2/node_modules/iconv-lite/encodings/tables/cp950.json deleted file mode 100644 index d8bc871..0000000 --- a/node_modules/mysql2/node_modules/iconv-lite/encodings/tables/cp950.json +++ /dev/null @@ -1,177 +0,0 @@ -[ -["0","\u0000",127], -["a140"," ,、。.‧;:?!︰…‥﹐﹑﹒·﹔﹕﹖﹗|–︱—︳╴︴﹏()︵︶{}︷︸〔〕︹︺【】︻︼《》︽︾〈〉︿﹀「」﹁﹂『』﹃﹄﹙﹚"], -["a1a1","﹛﹜﹝﹞‘’“”〝〞‵′#&*※§〃○●△▲◎☆★◇◆□■▽▼㊣℅¯ ̄_ˍ﹉﹊﹍﹎﹋﹌﹟﹠﹡+-×÷±√<>=≦≧≠∞≒≡﹢",4,"~∩∪⊥∠∟⊿㏒㏑∫∮∵∴♀♂⊕⊙↑↓←→↖↗↙↘∥∣/"], -["a240","\∕﹨$¥〒¢£%@℃℉﹩﹪﹫㏕㎜㎝㎞㏎㎡㎎㎏㏄°兙兛兞兝兡兣嗧瓩糎▁",7,"▏▎▍▌▋▊▉┼┴┬┤├▔─│▕┌┐└┘╭"], -["a2a1","╮╰╯═╞╪╡◢◣◥◤╱╲╳0",9,"Ⅰ",9,"〡",8,"十卄卅A",25,"a",21], -["a340","wxyzΑ",16,"Σ",6,"α",16,"σ",6,"ㄅ",10], -["a3a1","ㄐ",25,"˙ˉˊˇˋ"], -["a3e1","€"], -["a440","一乙丁七乃九了二人儿入八几刀刁力匕十卜又三下丈上丫丸凡久么也乞于亡兀刃勺千叉口土士夕大女子孑孓寸小尢尸山川工己已巳巾干廾弋弓才"], -["a4a1","丑丐不中丰丹之尹予云井互五亢仁什仃仆仇仍今介仄元允內六兮公冗凶分切刈勻勾勿化匹午升卅卞厄友及反壬天夫太夭孔少尤尺屯巴幻廿弔引心戈戶手扎支文斗斤方日曰月木欠止歹毋比毛氏水火爪父爻片牙牛犬王丙"], -["a540","世丕且丘主乍乏乎以付仔仕他仗代令仙仞充兄冉冊冬凹出凸刊加功包匆北匝仟半卉卡占卯卮去可古右召叮叩叨叼司叵叫另只史叱台句叭叻四囚外"], -["a5a1","央失奴奶孕它尼巨巧左市布平幼弁弘弗必戊打扔扒扑斥旦朮本未末札正母民氐永汁汀氾犯玄玉瓜瓦甘生用甩田由甲申疋白皮皿目矛矢石示禾穴立丞丟乒乓乩亙交亦亥仿伉伙伊伕伍伐休伏仲件任仰仳份企伋光兇兆先全"], -["a640","共再冰列刑划刎刖劣匈匡匠印危吉吏同吊吐吁吋各向名合吃后吆吒因回囝圳地在圭圬圯圩夙多夷夸妄奸妃好她如妁字存宇守宅安寺尖屹州帆并年"], -["a6a1","式弛忙忖戎戌戍成扣扛托收早旨旬旭曲曳有朽朴朱朵次此死氖汝汗汙江池汐汕污汛汍汎灰牟牝百竹米糸缶羊羽老考而耒耳聿肉肋肌臣自至臼舌舛舟艮色艾虫血行衣西阡串亨位住佇佗佞伴佛何估佐佑伽伺伸佃佔似但佣"], -["a740","作你伯低伶余佝佈佚兌克免兵冶冷別判利刪刨劫助努劬匣即卵吝吭吞吾否呎吧呆呃吳呈呂君吩告吹吻吸吮吵吶吠吼呀吱含吟听囪困囤囫坊坑址坍"], -["a7a1","均坎圾坐坏圻壯夾妝妒妨妞妣妙妖妍妤妓妊妥孝孜孚孛完宋宏尬局屁尿尾岐岑岔岌巫希序庇床廷弄弟彤形彷役忘忌志忍忱快忸忪戒我抄抗抖技扶抉扭把扼找批扳抒扯折扮投抓抑抆改攻攸旱更束李杏材村杜杖杞杉杆杠"], -["a840","杓杗步每求汞沙沁沈沉沅沛汪決沐汰沌汨沖沒汽沃汲汾汴沆汶沍沔沘沂灶灼災灸牢牡牠狄狂玖甬甫男甸皂盯矣私秀禿究系罕肖肓肝肘肛肚育良芒"], -["a8a1","芋芍見角言谷豆豕貝赤走足身車辛辰迂迆迅迄巡邑邢邪邦那酉釆里防阮阱阪阬並乖乳事些亞享京佯依侍佳使佬供例來侃佰併侈佩佻侖佾侏侑佺兔兒兕兩具其典冽函刻券刷刺到刮制剁劾劻卒協卓卑卦卷卸卹取叔受味呵"], -["a940","咖呸咕咀呻呷咄咒咆呼咐呱呶和咚呢周咋命咎固垃坷坪坩坡坦坤坼夜奉奇奈奄奔妾妻委妹妮姑姆姐姍始姓姊妯妳姒姅孟孤季宗定官宜宙宛尚屈居"], -["a9a1","屆岷岡岸岩岫岱岳帘帚帖帕帛帑幸庚店府底庖延弦弧弩往征彿彼忝忠忽念忿怏怔怯怵怖怪怕怡性怩怫怛或戕房戾所承拉拌拄抿拂抹拒招披拓拔拋拈抨抽押拐拙拇拍抵拚抱拘拖拗拆抬拎放斧於旺昔易昌昆昂明昀昏昕昊"], -["aa40","昇服朋杭枋枕東果杳杷枇枝林杯杰板枉松析杵枚枓杼杪杲欣武歧歿氓氛泣注泳沱泌泥河沽沾沼波沫法泓沸泄油況沮泗泅泱沿治泡泛泊沬泯泜泖泠"], -["aaa1","炕炎炒炊炙爬爭爸版牧物狀狎狙狗狐玩玨玟玫玥甽疝疙疚的盂盲直知矽社祀祁秉秈空穹竺糾罔羌羋者肺肥肢肱股肫肩肴肪肯臥臾舍芳芝芙芭芽芟芹花芬芥芯芸芣芰芾芷虎虱初表軋迎返近邵邸邱邶采金長門阜陀阿阻附"], -["ab40","陂隹雨青非亟亭亮信侵侯便俠俑俏保促侶俘俟俊俗侮俐俄係俚俎俞侷兗冒冑冠剎剃削前剌剋則勇勉勃勁匍南卻厚叛咬哀咨哎哉咸咦咳哇哂咽咪品"], -["aba1","哄哈咯咫咱咻咩咧咿囿垂型垠垣垢城垮垓奕契奏奎奐姜姘姿姣姨娃姥姪姚姦威姻孩宣宦室客宥封屎屏屍屋峙峒巷帝帥帟幽庠度建弈弭彥很待徊律徇後徉怒思怠急怎怨恍恰恨恢恆恃恬恫恪恤扁拜挖按拼拭持拮拽指拱拷"], -["ac40","拯括拾拴挑挂政故斫施既春昭映昧是星昨昱昤曷柿染柱柔某柬架枯柵柩柯柄柑枴柚查枸柏柞柳枰柙柢柝柒歪殃殆段毒毗氟泉洋洲洪流津洌洱洞洗"], -["aca1","活洽派洶洛泵洹洧洸洩洮洵洎洫炫為炳炬炯炭炸炮炤爰牲牯牴狩狠狡玷珊玻玲珍珀玳甚甭畏界畎畋疫疤疥疢疣癸皆皇皈盈盆盃盅省盹相眉看盾盼眇矜砂研砌砍祆祉祈祇禹禺科秒秋穿突竿竽籽紂紅紀紉紇約紆缸美羿耄"], -["ad40","耐耍耑耶胖胥胚胃胄背胡胛胎胞胤胝致舢苧范茅苣苛苦茄若茂茉苒苗英茁苜苔苑苞苓苟苯茆虐虹虻虺衍衫要觔計訂訃貞負赴赳趴軍軌述迦迢迪迥"], -["ada1","迭迫迤迨郊郎郁郃酋酊重閂限陋陌降面革韋韭音頁風飛食首香乘亳倌倍倣俯倦倥俸倩倖倆值借倚倒們俺倀倔倨俱倡個候倘俳修倭倪俾倫倉兼冤冥冢凍凌准凋剖剜剔剛剝匪卿原厝叟哨唐唁唷哼哥哲唆哺唔哩哭員唉哮哪"], -["ae40","哦唧唇哽唏圃圄埂埔埋埃堉夏套奘奚娑娘娜娟娛娓姬娠娣娩娥娌娉孫屘宰害家宴宮宵容宸射屑展屐峭峽峻峪峨峰島崁峴差席師庫庭座弱徒徑徐恙"], -["aea1","恣恥恐恕恭恩息悄悟悚悍悔悌悅悖扇拳挈拿捎挾振捕捂捆捏捉挺捐挽挪挫挨捍捌效敉料旁旅時晉晏晃晒晌晅晁書朔朕朗校核案框桓根桂桔栩梳栗桌桑栽柴桐桀格桃株桅栓栘桁殊殉殷氣氧氨氦氤泰浪涕消涇浦浸海浙涓"], -["af40","浬涉浮浚浴浩涌涊浹涅浥涔烊烘烤烙烈烏爹特狼狹狽狸狷玆班琉珮珠珪珞畔畝畜畚留疾病症疲疳疽疼疹痂疸皋皰益盍盎眩真眠眨矩砰砧砸砝破砷"], -["afa1","砥砭砠砟砲祕祐祠祟祖神祝祗祚秤秣秧租秦秩秘窄窈站笆笑粉紡紗紋紊素索純紐紕級紜納紙紛缺罟羔翅翁耆耘耕耙耗耽耿胱脂胰脅胭胴脆胸胳脈能脊胼胯臭臬舀舐航舫舨般芻茫荒荔荊茸荐草茵茴荏茲茹茶茗荀茱茨荃"], -["b040","虔蚊蚪蚓蚤蚩蚌蚣蚜衰衷袁袂衽衹記訐討訌訕訊託訓訖訏訑豈豺豹財貢起躬軒軔軏辱送逆迷退迺迴逃追逅迸邕郡郝郢酒配酌釘針釗釜釙閃院陣陡"], -["b0a1","陛陝除陘陞隻飢馬骨高鬥鬲鬼乾偺偽停假偃偌做偉健偶偎偕偵側偷偏倏偯偭兜冕凰剪副勒務勘動匐匏匙匿區匾參曼商啪啦啄啞啡啃啊唱啖問啕唯啤唸售啜唬啣唳啁啗圈國圉域堅堊堆埠埤基堂堵執培夠奢娶婁婉婦婪婀"], -["b140","娼婢婚婆婊孰寇寅寄寂宿密尉專將屠屜屝崇崆崎崛崖崢崑崩崔崙崤崧崗巢常帶帳帷康庸庶庵庾張強彗彬彩彫得徙從徘御徠徜恿患悉悠您惋悴惦悽"], -["b1a1","情悻悵惜悼惘惕惆惟悸惚惇戚戛扈掠控捲掖探接捷捧掘措捱掩掉掃掛捫推掄授掙採掬排掏掀捻捩捨捺敝敖救教敗啟敏敘敕敔斜斛斬族旋旌旎晝晚晤晨晦晞曹勗望梁梯梢梓梵桿桶梱梧梗械梃棄梭梆梅梔條梨梟梡梂欲殺"], -["b240","毫毬氫涎涼淳淙液淡淌淤添淺清淇淋涯淑涮淞淹涸混淵淅淒渚涵淚淫淘淪深淮淨淆淄涪淬涿淦烹焉焊烽烯爽牽犁猜猛猖猓猙率琅琊球理現琍瓠瓶"], -["b2a1","瓷甜產略畦畢異疏痔痕疵痊痍皎盔盒盛眷眾眼眶眸眺硫硃硎祥票祭移窒窕笠笨笛第符笙笞笮粒粗粕絆絃統紮紹紼絀細紳組累終紲紱缽羞羚翌翎習耜聊聆脯脖脣脫脩脰脤舂舵舷舶船莎莞莘荸莢莖莽莫莒莊莓莉莠荷荻荼"], -["b340","莆莧處彪蛇蛀蚶蛄蚵蛆蛋蚱蚯蛉術袞袈被袒袖袍袋覓規訪訝訣訥許設訟訛訢豉豚販責貫貨貪貧赧赦趾趺軛軟這逍通逗連速逝逐逕逞造透逢逖逛途"], -["b3a1","部郭都酗野釵釦釣釧釭釩閉陪陵陳陸陰陴陶陷陬雀雪雩章竟頂頃魚鳥鹵鹿麥麻傢傍傅備傑傀傖傘傚最凱割剴創剩勞勝勛博厥啻喀喧啼喊喝喘喂喜喪喔喇喋喃喳單喟唾喲喚喻喬喱啾喉喫喙圍堯堪場堤堰報堡堝堠壹壺奠"], -["b440","婷媚婿媒媛媧孳孱寒富寓寐尊尋就嵌嵐崴嵇巽幅帽幀幃幾廊廁廂廄弼彭復循徨惑惡悲悶惠愜愣惺愕惰惻惴慨惱愎惶愉愀愒戟扉掣掌描揀揩揉揆揍"], -["b4a1","插揣提握揖揭揮捶援揪換摒揚揹敞敦敢散斑斐斯普晰晴晶景暑智晾晷曾替期朝棺棕棠棘棗椅棟棵森棧棹棒棲棣棋棍植椒椎棉棚楮棻款欺欽殘殖殼毯氮氯氬港游湔渡渲湧湊渠渥渣減湛湘渤湖湮渭渦湯渴湍渺測湃渝渾滋"], -["b540","溉渙湎湣湄湲湩湟焙焚焦焰無然煮焜牌犄犀猶猥猴猩琺琪琳琢琥琵琶琴琯琛琦琨甥甦畫番痢痛痣痙痘痞痠登發皖皓皴盜睏短硝硬硯稍稈程稅稀窘"], -["b5a1","窗窖童竣等策筆筐筒答筍筋筏筑粟粥絞結絨絕紫絮絲絡給絢絰絳善翔翕耋聒肅腕腔腋腑腎脹腆脾腌腓腴舒舜菩萃菸萍菠菅萋菁華菱菴著萊菰萌菌菽菲菊萸萎萄菜萇菔菟虛蛟蛙蛭蛔蛛蛤蛐蛞街裁裂袱覃視註詠評詞証詁"], -["b640","詔詛詐詆訴診訶詖象貂貯貼貳貽賁費賀貴買貶貿貸越超趁跎距跋跚跑跌跛跆軻軸軼辜逮逵週逸進逶鄂郵鄉郾酣酥量鈔鈕鈣鈉鈞鈍鈐鈇鈑閔閏開閑"], -["b6a1","間閒閎隊階隋陽隅隆隍陲隄雁雅雄集雇雯雲韌項順須飧飪飯飩飲飭馮馭黃黍黑亂傭債傲傳僅傾催傷傻傯僇剿剷剽募勦勤勢勣匯嗟嗨嗓嗦嗎嗜嗇嗑嗣嗤嗯嗚嗡嗅嗆嗥嗉園圓塞塑塘塗塚塔填塌塭塊塢塒塋奧嫁嫉嫌媾媽媼"], -["b740","媳嫂媲嵩嵯幌幹廉廈弒彙徬微愚意慈感想愛惹愁愈慎慌慄慍愾愴愧愍愆愷戡戢搓搾搞搪搭搽搬搏搜搔損搶搖搗搆敬斟新暗暉暇暈暖暄暘暍會榔業"], -["b7a1","楚楷楠楔極椰概楊楨楫楞楓楹榆楝楣楛歇歲毀殿毓毽溢溯滓溶滂源溝滇滅溥溘溼溺溫滑準溜滄滔溪溧溴煎煙煩煤煉照煜煬煦煌煥煞煆煨煖爺牒猷獅猿猾瑯瑚瑕瑟瑞瑁琿瑙瑛瑜當畸瘀痰瘁痲痱痺痿痴痳盞盟睛睫睦睞督"], -["b840","睹睪睬睜睥睨睢矮碎碰碗碘碌碉硼碑碓硿祺祿禁萬禽稜稚稠稔稟稞窟窠筷節筠筮筧粱粳粵經絹綑綁綏絛置罩罪署義羨群聖聘肆肄腱腰腸腥腮腳腫"], -["b8a1","腹腺腦舅艇蒂葷落萱葵葦葫葉葬葛萼萵葡董葩葭葆虞虜號蛹蜓蜈蜇蜀蛾蛻蜂蜃蜆蜊衙裟裔裙補裘裝裡裊裕裒覜解詫該詳試詩詰誇詼詣誠話誅詭詢詮詬詹詻訾詨豢貊貉賊資賈賄貲賃賂賅跡跟跨路跳跺跪跤跦躲較載軾輊"], -["b940","辟農運遊道遂達逼違遐遇遏過遍遑逾遁鄒鄗酬酪酩釉鈷鉗鈸鈽鉀鈾鉛鉋鉤鉑鈴鉉鉍鉅鈹鈿鉚閘隘隔隕雍雋雉雊雷電雹零靖靴靶預頑頓頊頒頌飼飴"], -["b9a1","飽飾馳馱馴髡鳩麂鼎鼓鼠僧僮僥僖僭僚僕像僑僱僎僩兢凳劃劂匱厭嗾嘀嘛嘗嗽嘔嘆嘉嘍嘎嗷嘖嘟嘈嘐嗶團圖塵塾境墓墊塹墅塽壽夥夢夤奪奩嫡嫦嫩嫗嫖嫘嫣孵寞寧寡寥實寨寢寤察對屢嶄嶇幛幣幕幗幔廓廖弊彆彰徹慇"], -["ba40","愿態慷慢慣慟慚慘慵截撇摘摔撤摸摟摺摑摧搴摭摻敲斡旗旖暢暨暝榜榨榕槁榮槓構榛榷榻榫榴槐槍榭槌榦槃榣歉歌氳漳演滾漓滴漩漾漠漬漏漂漢"], -["baa1","滿滯漆漱漸漲漣漕漫漯澈漪滬漁滲滌滷熔熙煽熊熄熒爾犒犖獄獐瑤瑣瑪瑰瑭甄疑瘧瘍瘋瘉瘓盡監瞄睽睿睡磁碟碧碳碩碣禎福禍種稱窪窩竭端管箕箋筵算箝箔箏箸箇箄粹粽精綻綰綜綽綾綠緊綴網綱綺綢綿綵綸維緒緇綬"], -["bb40","罰翠翡翟聞聚肇腐膀膏膈膊腿膂臧臺與舔舞艋蓉蒿蓆蓄蒙蒞蒲蒜蓋蒸蓀蓓蒐蒼蓑蓊蜿蜜蜻蜢蜥蜴蜘蝕蜷蜩裳褂裴裹裸製裨褚裯誦誌語誣認誡誓誤"], -["bba1","說誥誨誘誑誚誧豪貍貌賓賑賒赫趙趕跼輔輒輕輓辣遠遘遜遣遙遞遢遝遛鄙鄘鄞酵酸酷酴鉸銀銅銘銖鉻銓銜銨鉼銑閡閨閩閣閥閤隙障際雌雒需靼鞅韶頗領颯颱餃餅餌餉駁骯骰髦魁魂鳴鳶鳳麼鼻齊億儀僻僵價儂儈儉儅凜"], -["bc40","劇劈劉劍劊勰厲嘮嘻嘹嘲嘿嘴嘩噓噎噗噴嘶嘯嘰墀墟增墳墜墮墩墦奭嬉嫻嬋嫵嬌嬈寮寬審寫層履嶝嶔幢幟幡廢廚廟廝廣廠彈影德徵慶慧慮慝慕憂"], -["bca1","慼慰慫慾憧憐憫憎憬憚憤憔憮戮摩摯摹撞撲撈撐撰撥撓撕撩撒撮播撫撚撬撙撢撳敵敷數暮暫暴暱樣樟槨樁樞標槽模樓樊槳樂樅槭樑歐歎殤毅毆漿潼澄潑潦潔澆潭潛潸潮澎潺潰潤澗潘滕潯潠潟熟熬熱熨牖犛獎獗瑩璋璃"], -["bd40","瑾璀畿瘠瘩瘟瘤瘦瘡瘢皚皺盤瞎瞇瞌瞑瞋磋磅確磊碾磕碼磐稿稼穀稽稷稻窯窮箭箱範箴篆篇篁箠篌糊締練緯緻緘緬緝編緣線緞緩綞緙緲緹罵罷羯"], -["bda1","翩耦膛膜膝膠膚膘蔗蔽蔚蓮蔬蔭蔓蔑蔣蔡蔔蓬蔥蓿蔆螂蝴蝶蝠蝦蝸蝨蝙蝗蝌蝓衛衝褐複褒褓褕褊誼諒談諄誕請諸課諉諂調誰論諍誶誹諛豌豎豬賠賞賦賤賬賭賢賣賜質賡赭趟趣踫踐踝踢踏踩踟踡踞躺輝輛輟輩輦輪輜輞"], -["be40","輥適遮遨遭遷鄰鄭鄧鄱醇醉醋醃鋅銻銷鋪銬鋤鋁銳銼鋒鋇鋰銲閭閱霄霆震霉靠鞍鞋鞏頡頫頜颳養餓餒餘駝駐駟駛駑駕駒駙骷髮髯鬧魅魄魷魯鴆鴉"], -["bea1","鴃麩麾黎墨齒儒儘儔儐儕冀冪凝劑劓勳噙噫噹噩噤噸噪器噥噱噯噬噢噶壁墾壇壅奮嬝嬴學寰導彊憲憑憩憊懍憶憾懊懈戰擅擁擋撻撼據擄擇擂操撿擒擔撾整曆曉暹曄曇暸樽樸樺橙橫橘樹橄橢橡橋橇樵機橈歙歷氅濂澱澡"], -["bf40","濃澤濁澧澳激澹澶澦澠澴熾燉燐燒燈燕熹燎燙燜燃燄獨璜璣璘璟璞瓢甌甍瘴瘸瘺盧盥瞠瞞瞟瞥磨磚磬磧禦積穎穆穌穋窺篙簑築篤篛篡篩篦糕糖縊"], -["bfa1","縑縈縛縣縞縝縉縐罹羲翰翱翮耨膳膩膨臻興艘艙蕊蕙蕈蕨蕩蕃蕉蕭蕪蕞螃螟螞螢融衡褪褲褥褫褡親覦諦諺諫諱謀諜諧諮諾謁謂諷諭諳諶諼豫豭貓賴蹄踱踴蹂踹踵輻輯輸輳辨辦遵遴選遲遼遺鄴醒錠錶鋸錳錯錢鋼錫錄錚"], -["c040","錐錦錡錕錮錙閻隧隨險雕霎霑霖霍霓霏靛靜靦鞘頰頸頻頷頭頹頤餐館餞餛餡餚駭駢駱骸骼髻髭鬨鮑鴕鴣鴦鴨鴒鴛默黔龍龜優償儡儲勵嚎嚀嚐嚅嚇"], -["c0a1","嚏壕壓壑壎嬰嬪嬤孺尷屨嶼嶺嶽嶸幫彌徽應懂懇懦懋戲戴擎擊擘擠擰擦擬擱擢擭斂斃曙曖檀檔檄檢檜櫛檣橾檗檐檠歜殮毚氈濘濱濟濠濛濤濫濯澀濬濡濩濕濮濰燧營燮燦燥燭燬燴燠爵牆獰獲璩環璦璨癆療癌盪瞳瞪瞰瞬"], -["c140","瞧瞭矯磷磺磴磯礁禧禪穗窿簇簍篾篷簌篠糠糜糞糢糟糙糝縮績繆縷縲繃縫總縱繅繁縴縹繈縵縿縯罄翳翼聱聲聰聯聳臆臃膺臂臀膿膽臉膾臨舉艱薪"], -["c1a1","薄蕾薜薑薔薯薛薇薨薊虧蟀蟑螳蟒蟆螫螻螺蟈蟋褻褶襄褸褽覬謎謗謙講謊謠謝謄謐豁谿豳賺賽購賸賻趨蹉蹋蹈蹊轄輾轂轅輿避遽還邁邂邀鄹醣醞醜鍍鎂錨鍵鍊鍥鍋錘鍾鍬鍛鍰鍚鍔闊闋闌闈闆隱隸雖霜霞鞠韓顆颶餵騁"], -["c240","駿鮮鮫鮪鮭鴻鴿麋黏點黜黝黛鼾齋叢嚕嚮壙壘嬸彝懣戳擴擲擾攆擺擻擷斷曜朦檳檬櫃檻檸櫂檮檯歟歸殯瀉瀋濾瀆濺瀑瀏燻燼燾燸獷獵璧璿甕癖癘"], -["c2a1","癒瞽瞿瞻瞼礎禮穡穢穠竄竅簫簧簪簞簣簡糧織繕繞繚繡繒繙罈翹翻職聶臍臏舊藏薩藍藐藉薰薺薹薦蟯蟬蟲蟠覆覲觴謨謹謬謫豐贅蹙蹣蹦蹤蹟蹕軀轉轍邇邃邈醫醬釐鎔鎊鎖鎢鎳鎮鎬鎰鎘鎚鎗闔闖闐闕離雜雙雛雞霤鞣鞦"], -["c340","鞭韹額顏題顎顓颺餾餿餽餮馥騎髁鬃鬆魏魎魍鯊鯉鯽鯈鯀鵑鵝鵠黠鼕鼬儳嚥壞壟壢寵龐廬懲懷懶懵攀攏曠曝櫥櫝櫚櫓瀛瀟瀨瀚瀝瀕瀘爆爍牘犢獸"], -["c3a1","獺璽瓊瓣疇疆癟癡矇礙禱穫穩簾簿簸簽簷籀繫繭繹繩繪羅繳羶羹羸臘藩藝藪藕藤藥藷蟻蠅蠍蟹蟾襠襟襖襞譁譜識證譚譎譏譆譙贈贊蹼蹲躇蹶蹬蹺蹴轔轎辭邊邋醱醮鏡鏑鏟鏃鏈鏜鏝鏖鏢鏍鏘鏤鏗鏨關隴難霪霧靡韜韻類"], -["c440","願顛颼饅饉騖騙鬍鯨鯧鯖鯛鶉鵡鵲鵪鵬麒麗麓麴勸嚨嚷嚶嚴嚼壤孀孃孽寶巉懸懺攘攔攙曦朧櫬瀾瀰瀲爐獻瓏癢癥礦礪礬礫竇競籌籃籍糯糰辮繽繼"], -["c4a1","纂罌耀臚艦藻藹蘑藺蘆蘋蘇蘊蠔蠕襤覺觸議譬警譯譟譫贏贍躉躁躅躂醴釋鐘鐃鏽闡霰飄饒饑馨騫騰騷騵鰓鰍鹹麵黨鼯齟齣齡儷儸囁囀囂夔屬巍懼懾攝攜斕曩櫻欄櫺殲灌爛犧瓖瓔癩矓籐纏續羼蘗蘭蘚蠣蠢蠡蠟襪襬覽譴"], -["c540","護譽贓躊躍躋轟辯醺鐮鐳鐵鐺鐸鐲鐫闢霸霹露響顧顥饗驅驃驀騾髏魔魑鰭鰥鶯鶴鷂鶸麝黯鼙齜齦齧儼儻囈囊囉孿巔巒彎懿攤權歡灑灘玀瓤疊癮癬"], -["c5a1","禳籠籟聾聽臟襲襯觼讀贖贗躑躓轡酈鑄鑑鑒霽霾韃韁顫饕驕驍髒鬚鱉鰱鰾鰻鷓鷗鼴齬齪龔囌巖戀攣攫攪曬欐瓚竊籤籣籥纓纖纔臢蘸蘿蠱變邐邏鑣鑠鑤靨顯饜驚驛驗髓體髑鱔鱗鱖鷥麟黴囑壩攬灞癱癲矗罐羈蠶蠹衢讓讒"], -["c640","讖艷贛釀鑪靂靈靄韆顰驟鬢魘鱟鷹鷺鹼鹽鼇齷齲廳欖灣籬籮蠻觀躡釁鑲鑰顱饞髖鬣黌灤矚讚鑷韉驢驥纜讜躪釅鑽鑾鑼鱷鱸黷豔鑿鸚爨驪鬱鸛鸞籲"], -["c940","乂乜凵匚厂万丌乇亍囗兀屮彳丏冇与丮亓仂仉仈冘勼卬厹圠夃夬尐巿旡殳毌气爿丱丼仨仜仩仡仝仚刌匜卌圢圣夗夯宁宄尒尻屴屳帄庀庂忉戉扐氕"], -["c9a1","氶汃氿氻犮犰玊禸肊阞伎优伬仵伔仱伀价伈伝伂伅伢伓伄仴伒冱刓刉刐劦匢匟卍厊吇囡囟圮圪圴夼妀奼妅奻奾奷奿孖尕尥屼屺屻屾巟幵庄异弚彴忕忔忏扜扞扤扡扦扢扙扠扚扥旯旮朾朹朸朻机朿朼朳氘汆汒汜汏汊汔汋"], -["ca40","汌灱牞犴犵玎甪癿穵网艸艼芀艽艿虍襾邙邗邘邛邔阢阤阠阣佖伻佢佉体佤伾佧佒佟佁佘伭伳伿佡冏冹刜刞刡劭劮匉卣卲厎厏吰吷吪呔呅吙吜吥吘"], -["caa1","吽呏呁吨吤呇囮囧囥坁坅坌坉坋坒夆奀妦妘妠妗妎妢妐妏妧妡宎宒尨尪岍岏岈岋岉岒岊岆岓岕巠帊帎庋庉庌庈庍弅弝彸彶忒忑忐忭忨忮忳忡忤忣忺忯忷忻怀忴戺抃抌抎抏抔抇扱扻扺扰抁抈扷扽扲扴攷旰旴旳旲旵杅杇"], -["cb40","杙杕杌杈杝杍杚杋毐氙氚汸汧汫沄沋沏汱汯汩沚汭沇沕沜汦汳汥汻沎灴灺牣犿犽狃狆狁犺狅玕玗玓玔玒町甹疔疕皁礽耴肕肙肐肒肜芐芏芅芎芑芓"], -["cba1","芊芃芄豸迉辿邟邡邥邞邧邠阰阨阯阭丳侘佼侅佽侀侇佶佴侉侄佷佌侗佪侚佹侁佸侐侜侔侞侒侂侕佫佮冞冼冾刵刲刳剆刱劼匊匋匼厒厔咇呿咁咑咂咈呫呺呾呥呬呴呦咍呯呡呠咘呣呧呤囷囹坯坲坭坫坱坰坶垀坵坻坳坴坢"], -["cc40","坨坽夌奅妵妺姏姎妲姌姁妶妼姃姖妱妽姀姈妴姇孢孥宓宕屄屇岮岤岠岵岯岨岬岟岣岭岢岪岧岝岥岶岰岦帗帔帙弨弢弣弤彔徂彾彽忞忥怭怦怙怲怋"], -["cca1","怴怊怗怳怚怞怬怢怍怐怮怓怑怌怉怜戔戽抭抴拑抾抪抶拊抮抳抯抻抩抰抸攽斨斻昉旼昄昒昈旻昃昋昍昅旽昑昐曶朊枅杬枎枒杶杻枘枆构杴枍枌杺枟枑枙枃杽极杸杹枔欥殀歾毞氝沓泬泫泮泙沶泔沭泧沷泐泂沺泃泆泭泲"], -["cd40","泒泝沴沊沝沀泞泀洰泍泇沰泹泏泩泑炔炘炅炓炆炄炑炖炂炚炃牪狖狋狘狉狜狒狔狚狌狑玤玡玭玦玢玠玬玝瓝瓨甿畀甾疌疘皯盳盱盰盵矸矼矹矻矺"], -["cda1","矷祂礿秅穸穻竻籵糽耵肏肮肣肸肵肭舠芠苀芫芚芘芛芵芧芮芼芞芺芴芨芡芩苂芤苃芶芢虰虯虭虮豖迒迋迓迍迖迕迗邲邴邯邳邰阹阽阼阺陃俍俅俓侲俉俋俁俔俜俙侻侳俛俇俖侺俀侹俬剄剉勀勂匽卼厗厖厙厘咺咡咭咥哏"], -["ce40","哃茍咷咮哖咶哅哆咠呰咼咢咾呲哞咰垵垞垟垤垌垗垝垛垔垘垏垙垥垚垕壴复奓姡姞姮娀姱姝姺姽姼姶姤姲姷姛姩姳姵姠姾姴姭宨屌峐峘峌峗峋峛"], -["cea1","峞峚峉峇峊峖峓峔峏峈峆峎峟峸巹帡帢帣帠帤庰庤庢庛庣庥弇弮彖徆怷怹恔恲恞恅恓恇恉恛恌恀恂恟怤恄恘恦恮扂扃拏挍挋拵挎挃拫拹挏挌拸拶挀挓挔拺挕拻拰敁敃斪斿昶昡昲昵昜昦昢昳昫昺昝昴昹昮朏朐柁柲柈枺"], -["cf40","柜枻柸柘柀枷柅柫柤柟枵柍枳柷柶柮柣柂枹柎柧柰枲柼柆柭柌枮柦柛柺柉柊柃柪柋欨殂殄殶毖毘毠氠氡洨洴洭洟洼洿洒洊泚洳洄洙洺洚洑洀洝浂"], -["cfa1","洁洘洷洃洏浀洇洠洬洈洢洉洐炷炟炾炱炰炡炴炵炩牁牉牊牬牰牳牮狊狤狨狫狟狪狦狣玅珌珂珈珅玹玶玵玴珫玿珇玾珃珆玸珋瓬瓮甮畇畈疧疪癹盄眈眃眄眅眊盷盻盺矧矨砆砑砒砅砐砏砎砉砃砓祊祌祋祅祄秕种秏秖秎窀"], -["d040","穾竑笀笁籺籸籹籿粀粁紃紈紁罘羑羍羾耇耎耏耔耷胘胇胠胑胈胂胐胅胣胙胜胊胕胉胏胗胦胍臿舡芔苙苾苹茇苨茀苕茺苫苖苴苬苡苲苵茌苻苶苰苪"], -["d0a1","苤苠苺苳苭虷虴虼虳衁衎衧衪衩觓訄訇赲迣迡迮迠郱邽邿郕郅邾郇郋郈釔釓陔陏陑陓陊陎倞倅倇倓倢倰倛俵俴倳倷倬俶俷倗倜倠倧倵倯倱倎党冔冓凊凄凅凈凎剡剚剒剞剟剕剢勍匎厞唦哢唗唒哧哳哤唚哿唄唈哫唑唅哱"], -["d140","唊哻哷哸哠唎唃唋圁圂埌堲埕埒垺埆垽垼垸垶垿埇埐垹埁夎奊娙娖娭娮娕娏娗娊娞娳孬宧宭宬尃屖屔峬峿峮峱峷崀峹帩帨庨庮庪庬弳弰彧恝恚恧"], -["d1a1","恁悢悈悀悒悁悝悃悕悛悗悇悜悎戙扆拲挐捖挬捄捅挶捃揤挹捋捊挼挩捁挴捘捔捙挭捇挳捚捑挸捗捀捈敊敆旆旃旄旂晊晟晇晑朒朓栟栚桉栲栳栻桋桏栖栱栜栵栫栭栯桎桄栴栝栒栔栦栨栮桍栺栥栠欬欯欭欱欴歭肂殈毦毤"], -["d240","毨毣毢毧氥浺浣浤浶洍浡涒浘浢浭浯涑涍淯浿涆浞浧浠涗浰浼浟涂涘洯浨涋浾涀涄洖涃浻浽浵涐烜烓烑烝烋缹烢烗烒烞烠烔烍烅烆烇烚烎烡牂牸"], -["d2a1","牷牶猀狺狴狾狶狳狻猁珓珙珥珖玼珧珣珩珜珒珛珔珝珚珗珘珨瓞瓟瓴瓵甡畛畟疰痁疻痄痀疿疶疺皊盉眝眛眐眓眒眣眑眕眙眚眢眧砣砬砢砵砯砨砮砫砡砩砳砪砱祔祛祏祜祓祒祑秫秬秠秮秭秪秜秞秝窆窉窅窋窌窊窇竘笐"], -["d340","笄笓笅笏笈笊笎笉笒粄粑粊粌粈粍粅紞紝紑紎紘紖紓紟紒紏紌罜罡罞罠罝罛羖羒翃翂翀耖耾耹胺胲胹胵脁胻脀舁舯舥茳茭荄茙荑茥荖茿荁茦茜茢"], -["d3a1","荂荎茛茪茈茼荍茖茤茠茷茯茩荇荅荌荓茞茬荋茧荈虓虒蚢蚨蚖蚍蚑蚞蚇蚗蚆蚋蚚蚅蚥蚙蚡蚧蚕蚘蚎蚝蚐蚔衃衄衭衵衶衲袀衱衿衯袃衾衴衼訒豇豗豻貤貣赶赸趵趷趶軑軓迾迵适迿迻逄迼迶郖郠郙郚郣郟郥郘郛郗郜郤酐"], -["d440","酎酏釕釢釚陜陟隼飣髟鬯乿偰偪偡偞偠偓偋偝偲偈偍偁偛偊偢倕偅偟偩偫偣偤偆偀偮偳偗偑凐剫剭剬剮勖勓匭厜啵啶唼啍啐唴唪啑啢唶唵唰啒啅"], -["d4a1","唌唲啥啎唹啈唭唻啀啋圊圇埻堔埢埶埜埴堀埭埽堈埸堋埳埏堇埮埣埲埥埬埡堎埼堐埧堁堌埱埩埰堍堄奜婠婘婕婧婞娸娵婭婐婟婥婬婓婤婗婃婝婒婄婛婈媎娾婍娹婌婰婩婇婑婖婂婜孲孮寁寀屙崞崋崝崚崠崌崨崍崦崥崏"], -["d540","崰崒崣崟崮帾帴庱庴庹庲庳弶弸徛徖徟悊悐悆悾悰悺惓惔惏惤惙惝惈悱惛悷惊悿惃惍惀挲捥掊掂捽掽掞掭掝掗掫掎捯掇掐据掯捵掜捭掮捼掤挻掟"], -["d5a1","捸掅掁掑掍捰敓旍晥晡晛晙晜晢朘桹梇梐梜桭桮梮梫楖桯梣梬梩桵桴梲梏桷梒桼桫桲梪梀桱桾梛梖梋梠梉梤桸桻梑梌梊桽欶欳欷欸殑殏殍殎殌氪淀涫涴涳湴涬淩淢涷淶淔渀淈淠淟淖涾淥淜淝淛淴淊涽淭淰涺淕淂淏淉"], -["d640","淐淲淓淽淗淍淣涻烺焍烷焗烴焌烰焄烳焐烼烿焆焓焀烸烶焋焂焎牾牻牼牿猝猗猇猑猘猊猈狿猏猞玈珶珸珵琄琁珽琇琀珺珼珿琌琋珴琈畤畣痎痒痏"], -["d6a1","痋痌痑痐皏皉盓眹眯眭眱眲眴眳眽眥眻眵硈硒硉硍硊硌砦硅硐祤祧祩祪祣祫祡离秺秸秶秷窏窔窐笵筇笴笥笰笢笤笳笘笪笝笱笫笭笯笲笸笚笣粔粘粖粣紵紽紸紶紺絅紬紩絁絇紾紿絊紻紨罣羕羜羝羛翊翋翍翐翑翇翏翉耟"], -["d740","耞耛聇聃聈脘脥脙脛脭脟脬脞脡脕脧脝脢舑舸舳舺舴舲艴莐莣莨莍荺荳莤荴莏莁莕莙荵莔莩荽莃莌莝莛莪莋荾莥莯莈莗莰荿莦莇莮荶莚虙虖蚿蚷"], -["d7a1","蛂蛁蛅蚺蚰蛈蚹蚳蚸蛌蚴蚻蚼蛃蚽蚾衒袉袕袨袢袪袚袑袡袟袘袧袙袛袗袤袬袌袓袎覂觖觙觕訰訧訬訞谹谻豜豝豽貥赽赻赹趼跂趹趿跁軘軞軝軜軗軠軡逤逋逑逜逌逡郯郪郰郴郲郳郔郫郬郩酖酘酚酓酕釬釴釱釳釸釤釹釪"], -["d840","釫釷釨釮镺閆閈陼陭陫陱陯隿靪頄飥馗傛傕傔傞傋傣傃傌傎傝偨傜傒傂傇兟凔匒匑厤厧喑喨喥喭啷噅喢喓喈喏喵喁喣喒喤啽喌喦啿喕喡喎圌堩堷"], -["d8a1","堙堞堧堣堨埵塈堥堜堛堳堿堶堮堹堸堭堬堻奡媯媔媟婺媢媞婸媦婼媥媬媕媮娷媄媊媗媃媋媩婻婽媌媜媏媓媝寪寍寋寔寑寊寎尌尰崷嵃嵫嵁嵋崿崵嵑嵎嵕崳崺嵒崽崱嵙嵂崹嵉崸崼崲崶嵀嵅幄幁彘徦徥徫惉悹惌惢惎惄愔"], -["d940","惲愊愖愅惵愓惸惼惾惁愃愘愝愐惿愄愋扊掔掱掰揎揥揨揯揃撝揳揊揠揶揕揲揵摡揟掾揝揜揄揘揓揂揇揌揋揈揰揗揙攲敧敪敤敜敨敥斌斝斞斮旐旒"], -["d9a1","晼晬晻暀晱晹晪晲朁椌棓椄棜椪棬棪棱椏棖棷棫棤棶椓椐棳棡椇棌椈楰梴椑棯棆椔棸棐棽棼棨椋椊椗棎棈棝棞棦棴棑椆棔棩椕椥棇欹欻欿欼殔殗殙殕殽毰毲毳氰淼湆湇渟湉溈渼渽湅湢渫渿湁湝湳渜渳湋湀湑渻渃渮湞"], -["da40","湨湜湡渱渨湠湱湫渹渢渰湓湥渧湸湤湷湕湹湒湦渵渶湚焠焞焯烻焮焱焣焥焢焲焟焨焺焛牋牚犈犉犆犅犋猒猋猰猢猱猳猧猲猭猦猣猵猌琮琬琰琫琖"], -["daa1","琚琡琭琱琤琣琝琩琠琲瓻甯畯畬痧痚痡痦痝痟痤痗皕皒盚睆睇睄睍睅睊睎睋睌矞矬硠硤硥硜硭硱硪确硰硩硨硞硢祴祳祲祰稂稊稃稌稄窙竦竤筊笻筄筈筌筎筀筘筅粢粞粨粡絘絯絣絓絖絧絪絏絭絜絫絒絔絩絑絟絎缾缿罥"], -["db40","罦羢羠羡翗聑聏聐胾胔腃腊腒腏腇脽腍脺臦臮臷臸臹舄舼舽舿艵茻菏菹萣菀菨萒菧菤菼菶萐菆菈菫菣莿萁菝菥菘菿菡菋菎菖菵菉萉萏菞萑萆菂菳"], -["dba1","菕菺菇菑菪萓菃菬菮菄菻菗菢萛菛菾蛘蛢蛦蛓蛣蛚蛪蛝蛫蛜蛬蛩蛗蛨蛑衈衖衕袺裗袹袸裀袾袶袼袷袽袲褁裉覕覘覗觝觚觛詎詍訹詙詀詗詘詄詅詒詈詑詊詌詏豟貁貀貺貾貰貹貵趄趀趉跘跓跍跇跖跜跏跕跙跈跗跅軯軷軺"], -["dc40","軹軦軮軥軵軧軨軶軫軱軬軴軩逭逴逯鄆鄬鄄郿郼鄈郹郻鄁鄀鄇鄅鄃酡酤酟酢酠鈁鈊鈥鈃鈚鈦鈏鈌鈀鈒釿釽鈆鈄鈧鈂鈜鈤鈙鈗鈅鈖镻閍閌閐隇陾隈"], -["dca1","隉隃隀雂雈雃雱雰靬靰靮頇颩飫鳦黹亃亄亶傽傿僆傮僄僊傴僈僂傰僁傺傱僋僉傶傸凗剺剸剻剼嗃嗛嗌嗐嗋嗊嗝嗀嗔嗄嗩喿嗒喍嗏嗕嗢嗖嗈嗲嗍嗙嗂圔塓塨塤塏塍塉塯塕塎塝塙塥塛堽塣塱壼嫇嫄嫋媺媸媱媵媰媿嫈媻嫆"], -["dd40","媷嫀嫊媴媶嫍媹媐寖寘寙尟尳嵱嵣嵊嵥嵲嵬嵞嵨嵧嵢巰幏幎幊幍幋廅廌廆廋廇彀徯徭惷慉慊愫慅愶愲愮慆愯慏愩慀戠酨戣戥戤揅揱揫搐搒搉搠搤"], -["dda1","搳摃搟搕搘搹搷搢搣搌搦搰搨摁搵搯搊搚摀搥搧搋揧搛搮搡搎敯斒旓暆暌暕暐暋暊暙暔晸朠楦楟椸楎楢楱椿楅楪椹楂楗楙楺楈楉椵楬椳椽楥棰楸椴楩楀楯楄楶楘楁楴楌椻楋椷楜楏楑椲楒椯楻椼歆歅歃歂歈歁殛嗀毻毼"], -["de40","毹毷毸溛滖滈溏滀溟溓溔溠溱溹滆滒溽滁溞滉溷溰滍溦滏溲溾滃滜滘溙溒溎溍溤溡溿溳滐滊溗溮溣煇煔煒煣煠煁煝煢煲煸煪煡煂煘煃煋煰煟煐煓"], -["dea1","煄煍煚牏犍犌犑犐犎猼獂猻猺獀獊獉瑄瑊瑋瑒瑑瑗瑀瑏瑐瑎瑂瑆瑍瑔瓡瓿瓾瓽甝畹畷榃痯瘏瘃痷痾痼痹痸瘐痻痶痭痵痽皙皵盝睕睟睠睒睖睚睩睧睔睙睭矠碇碚碔碏碄碕碅碆碡碃硹碙碀碖硻祼禂祽祹稑稘稙稒稗稕稢稓"], -["df40","稛稐窣窢窞竫筦筤筭筴筩筲筥筳筱筰筡筸筶筣粲粴粯綈綆綀綍絿綅絺綎絻綃絼綌綔綄絽綒罭罫罧罨罬羦羥羧翛翜耡腤腠腷腜腩腛腢腲朡腞腶腧腯"], -["dfa1","腄腡舝艉艄艀艂艅蓱萿葖葶葹蒏蒍葥葑葀蒆葧萰葍葽葚葙葴葳葝蔇葞萷萺萴葺葃葸萲葅萩菙葋萯葂萭葟葰萹葎葌葒葯蓅蒎萻葇萶萳葨葾葄萫葠葔葮葐蜋蜄蛷蜌蛺蛖蛵蝍蛸蜎蜉蜁蛶蜍蜅裖裋裍裎裞裛裚裌裐覅覛觟觥觤"], -["e040","觡觠觢觜触詶誆詿詡訿詷誂誄詵誃誁詴詺谼豋豊豥豤豦貆貄貅賌赨赩趑趌趎趏趍趓趔趐趒跰跠跬跱跮跐跩跣跢跧跲跫跴輆軿輁輀輅輇輈輂輋遒逿"], -["e0a1","遄遉逽鄐鄍鄏鄑鄖鄔鄋鄎酮酯鉈鉒鈰鈺鉦鈳鉥鉞銃鈮鉊鉆鉭鉬鉏鉠鉧鉯鈶鉡鉰鈱鉔鉣鉐鉲鉎鉓鉌鉖鈲閟閜閞閛隒隓隑隗雎雺雽雸雵靳靷靸靲頏頍頎颬飶飹馯馲馰馵骭骫魛鳪鳭鳧麀黽僦僔僗僨僳僛僪僝僤僓僬僰僯僣僠"], -["e140","凘劀劁勩勫匰厬嘧嘕嘌嘒嗼嘏嘜嘁嘓嘂嗺嘝嘄嗿嗹墉塼墐墘墆墁塿塴墋塺墇墑墎塶墂墈塻墔墏壾奫嫜嫮嫥嫕嫪嫚嫭嫫嫳嫢嫠嫛嫬嫞嫝嫙嫨嫟孷寠"], -["e1a1","寣屣嶂嶀嵽嶆嵺嶁嵷嶊嶉嶈嵾嵼嶍嵹嵿幘幙幓廘廑廗廎廜廕廙廒廔彄彃彯徶愬愨慁慞慱慳慒慓慲慬憀慴慔慺慛慥愻慪慡慖戩戧戫搫摍摛摝摴摶摲摳摽摵摦撦摎撂摞摜摋摓摠摐摿搿摬摫摙摥摷敳斠暡暠暟朅朄朢榱榶槉"], -["e240","榠槎榖榰榬榼榑榙榎榧榍榩榾榯榿槄榽榤槔榹槊榚槏榳榓榪榡榞槙榗榐槂榵榥槆歊歍歋殞殟殠毃毄毾滎滵滱漃漥滸漷滻漮漉潎漙漚漧漘漻漒滭漊"], -["e2a1","漶潳滹滮漭潀漰漼漵滫漇漎潃漅滽滶漹漜滼漺漟漍漞漈漡熇熐熉熀熅熂熏煻熆熁熗牄牓犗犕犓獃獍獑獌瑢瑳瑱瑵瑲瑧瑮甀甂甃畽疐瘖瘈瘌瘕瘑瘊瘔皸瞁睼瞅瞂睮瞀睯睾瞃碲碪碴碭碨硾碫碞碥碠碬碢碤禘禊禋禖禕禔禓"], -["e340","禗禈禒禐稫穊稰稯稨稦窨窫窬竮箈箜箊箑箐箖箍箌箛箎箅箘劄箙箤箂粻粿粼粺綧綷緂綣綪緁緀緅綝緎緄緆緋緌綯綹綖綼綟綦綮綩綡緉罳翢翣翥翞"], -["e3a1","耤聝聜膉膆膃膇膍膌膋舕蒗蒤蒡蒟蒺蓎蓂蒬蒮蒫蒹蒴蓁蓍蒪蒚蒱蓐蒝蒧蒻蒢蒔蓇蓌蒛蒩蒯蒨蓖蒘蒶蓏蒠蓗蓔蓒蓛蒰蒑虡蜳蜣蜨蝫蝀蜮蜞蜡蜙蜛蝃蜬蝁蜾蝆蜠蜲蜪蜭蜼蜒蜺蜱蜵蝂蜦蜧蜸蜤蜚蜰蜑裷裧裱裲裺裾裮裼裶裻"], -["e440","裰裬裫覝覡覟覞觩觫觨誫誙誋誒誏誖谽豨豩賕賏賗趖踉踂跿踍跽踊踃踇踆踅跾踀踄輐輑輎輍鄣鄜鄠鄢鄟鄝鄚鄤鄡鄛酺酲酹酳銥銤鉶銛鉺銠銔銪銍"], -["e4a1","銦銚銫鉹銗鉿銣鋮銎銂銕銢鉽銈銡銊銆銌銙銧鉾銇銩銝銋鈭隞隡雿靘靽靺靾鞃鞀鞂靻鞄鞁靿韎韍頖颭颮餂餀餇馝馜駃馹馻馺駂馽駇骱髣髧鬾鬿魠魡魟鳱鳲鳵麧僿儃儰僸儆儇僶僾儋儌僽儊劋劌勱勯噈噂噌嘵噁噊噉噆噘"], -["e540","噚噀嘳嘽嘬嘾嘸嘪嘺圚墫墝墱墠墣墯墬墥墡壿嫿嫴嫽嫷嫶嬃嫸嬂嫹嬁嬇嬅嬏屧嶙嶗嶟嶒嶢嶓嶕嶠嶜嶡嶚嶞幩幝幠幜緳廛廞廡彉徲憋憃慹憱憰憢憉"], -["e5a1","憛憓憯憭憟憒憪憡憍慦憳戭摮摰撖撠撅撗撜撏撋撊撌撣撟摨撱撘敶敺敹敻斲斳暵暰暩暲暷暪暯樀樆樗槥槸樕槱槤樠槿槬槢樛樝槾樧槲槮樔槷槧橀樈槦槻樍槼槫樉樄樘樥樏槶樦樇槴樖歑殥殣殢殦氁氀毿氂潁漦潾澇濆澒"], -["e640","澍澉澌潢潏澅潚澖潶潬澂潕潲潒潐潗澔澓潝漀潡潫潽潧澐潓澋潩潿澕潣潷潪潻熲熯熛熰熠熚熩熵熝熥熞熤熡熪熜熧熳犘犚獘獒獞獟獠獝獛獡獚獙"], -["e6a1","獢璇璉璊璆璁瑽璅璈瑼瑹甈甇畾瘥瘞瘙瘝瘜瘣瘚瘨瘛皜皝皞皛瞍瞏瞉瞈磍碻磏磌磑磎磔磈磃磄磉禚禡禠禜禢禛歶稹窲窴窳箷篋箾箬篎箯箹篊箵糅糈糌糋緷緛緪緧緗緡縃緺緦緶緱緰緮緟罶羬羰羭翭翫翪翬翦翨聤聧膣膟"], -["e740","膞膕膢膙膗舖艏艓艒艐艎艑蔤蔻蔏蔀蔩蔎蔉蔍蔟蔊蔧蔜蓻蔫蓺蔈蔌蓴蔪蓲蔕蓷蓫蓳蓼蔒蓪蓩蔖蓾蔨蔝蔮蔂蓽蔞蓶蔱蔦蓧蓨蓰蓯蓹蔘蔠蔰蔋蔙蔯虢"], -["e7a1","蝖蝣蝤蝷蟡蝳蝘蝔蝛蝒蝡蝚蝑蝞蝭蝪蝐蝎蝟蝝蝯蝬蝺蝮蝜蝥蝏蝻蝵蝢蝧蝩衚褅褌褔褋褗褘褙褆褖褑褎褉覢覤覣觭觰觬諏諆誸諓諑諔諕誻諗誾諀諅諘諃誺誽諙谾豍貏賥賟賙賨賚賝賧趠趜趡趛踠踣踥踤踮踕踛踖踑踙踦踧"], -["e840","踔踒踘踓踜踗踚輬輤輘輚輠輣輖輗遳遰遯遧遫鄯鄫鄩鄪鄲鄦鄮醅醆醊醁醂醄醀鋐鋃鋄鋀鋙銶鋏鋱鋟鋘鋩鋗鋝鋌鋯鋂鋨鋊鋈鋎鋦鋍鋕鋉鋠鋞鋧鋑鋓"], -["e8a1","銵鋡鋆銴镼閬閫閮閰隤隢雓霅霈霂靚鞊鞎鞈韐韏頞頝頦頩頨頠頛頧颲餈飺餑餔餖餗餕駜駍駏駓駔駎駉駖駘駋駗駌骳髬髫髳髲髱魆魃魧魴魱魦魶魵魰魨魤魬鳼鳺鳽鳿鳷鴇鴀鳹鳻鴈鴅鴄麃黓鼏鼐儜儓儗儚儑凞匴叡噰噠噮"], -["e940","噳噦噣噭噲噞噷圜圛壈墽壉墿墺壂墼壆嬗嬙嬛嬡嬔嬓嬐嬖嬨嬚嬠嬞寯嶬嶱嶩嶧嶵嶰嶮嶪嶨嶲嶭嶯嶴幧幨幦幯廩廧廦廨廥彋徼憝憨憖懅憴懆懁懌憺"], -["e9a1","憿憸憌擗擖擐擏擉撽撉擃擛擳擙攳敿敼斢曈暾曀曊曋曏暽暻暺曌朣樴橦橉橧樲橨樾橝橭橶橛橑樨橚樻樿橁橪橤橐橏橔橯橩橠樼橞橖橕橍橎橆歕歔歖殧殪殫毈毇氄氃氆澭濋澣濇澼濎濈潞濄澽澞濊澨瀄澥澮澺澬澪濏澿澸"], -["ea40","澢濉澫濍澯澲澰燅燂熿熸燖燀燁燋燔燊燇燏熽燘熼燆燚燛犝犞獩獦獧獬獥獫獪瑿璚璠璔璒璕璡甋疀瘯瘭瘱瘽瘳瘼瘵瘲瘰皻盦瞚瞝瞡瞜瞛瞢瞣瞕瞙"], -["eaa1","瞗磝磩磥磪磞磣磛磡磢磭磟磠禤穄穈穇窶窸窵窱窷篞篣篧篝篕篥篚篨篹篔篪篢篜篫篘篟糒糔糗糐糑縒縡縗縌縟縠縓縎縜縕縚縢縋縏縖縍縔縥縤罃罻罼罺羱翯耪耩聬膱膦膮膹膵膫膰膬膴膲膷膧臲艕艖艗蕖蕅蕫蕍蕓蕡蕘"], -["eb40","蕀蕆蕤蕁蕢蕄蕑蕇蕣蔾蕛蕱蕎蕮蕵蕕蕧蕠薌蕦蕝蕔蕥蕬虣虥虤螛螏螗螓螒螈螁螖螘蝹螇螣螅螐螑螝螄螔螜螚螉褞褦褰褭褮褧褱褢褩褣褯褬褟觱諠"], -["eba1","諢諲諴諵諝謔諤諟諰諈諞諡諨諿諯諻貑貒貐賵賮賱賰賳赬赮趥趧踳踾踸蹀蹅踶踼踽蹁踰踿躽輶輮輵輲輹輷輴遶遹遻邆郺鄳鄵鄶醓醐醑醍醏錧錞錈錟錆錏鍺錸錼錛錣錒錁鍆錭錎錍鋋錝鋺錥錓鋹鋷錴錂錤鋿錩錹錵錪錔錌"], -["ec40","錋鋾錉錀鋻錖閼闍閾閹閺閶閿閵閽隩雔霋霒霐鞙鞗鞔韰韸頵頯頲餤餟餧餩馞駮駬駥駤駰駣駪駩駧骹骿骴骻髶髺髹髷鬳鮀鮅鮇魼魾魻鮂鮓鮒鮐魺鮕"], -["eca1","魽鮈鴥鴗鴠鴞鴔鴩鴝鴘鴢鴐鴙鴟麈麆麇麮麭黕黖黺鼒鼽儦儥儢儤儠儩勴嚓嚌嚍嚆嚄嚃噾嚂噿嚁壖壔壏壒嬭嬥嬲嬣嬬嬧嬦嬯嬮孻寱寲嶷幬幪徾徻懃憵憼懧懠懥懤懨懞擯擩擣擫擤擨斁斀斶旚曒檍檖檁檥檉檟檛檡檞檇檓檎"], -["ed40","檕檃檨檤檑橿檦檚檅檌檒歛殭氉濌澩濴濔濣濜濭濧濦濞濲濝濢濨燡燱燨燲燤燰燢獳獮獯璗璲璫璐璪璭璱璥璯甐甑甒甏疄癃癈癉癇皤盩瞵瞫瞲瞷瞶"], -["eda1","瞴瞱瞨矰磳磽礂磻磼磲礅磹磾礄禫禨穜穛穖穘穔穚窾竀竁簅簏篲簀篿篻簎篴簋篳簂簉簃簁篸篽簆篰篱簐簊糨縭縼繂縳顈縸縪繉繀繇縩繌縰縻縶繄縺罅罿罾罽翴翲耬膻臄臌臊臅臇膼臩艛艚艜薃薀薏薧薕薠薋薣蕻薤薚薞"], -["ee40","蕷蕼薉薡蕺蕸蕗薎薖薆薍薙薝薁薢薂薈薅蕹蕶薘薐薟虨螾螪螭蟅螰螬螹螵螼螮蟉蟃蟂蟌螷螯蟄蟊螴螶螿螸螽蟞螲褵褳褼褾襁襒褷襂覭覯覮觲觳謞"], -["eea1","謘謖謑謅謋謢謏謒謕謇謍謈謆謜謓謚豏豰豲豱豯貕貔賹赯蹎蹍蹓蹐蹌蹇轃轀邅遾鄸醚醢醛醙醟醡醝醠鎡鎃鎯鍤鍖鍇鍼鍘鍜鍶鍉鍐鍑鍠鍭鎏鍌鍪鍹鍗鍕鍒鍏鍱鍷鍻鍡鍞鍣鍧鎀鍎鍙闇闀闉闃闅閷隮隰隬霠霟霘霝霙鞚鞡鞜"], -["ef40","鞞鞝韕韔韱顁顄顊顉顅顃餥餫餬餪餳餲餯餭餱餰馘馣馡騂駺駴駷駹駸駶駻駽駾駼騃骾髾髽鬁髼魈鮚鮨鮞鮛鮦鮡鮥鮤鮆鮢鮠鮯鴳鵁鵧鴶鴮鴯鴱鴸鴰"], -["efa1","鵅鵂鵃鴾鴷鵀鴽翵鴭麊麉麍麰黈黚黻黿鼤鼣鼢齔龠儱儭儮嚘嚜嚗嚚嚝嚙奰嬼屩屪巀幭幮懘懟懭懮懱懪懰懫懖懩擿攄擽擸攁攃擼斔旛曚曛曘櫅檹檽櫡櫆檺檶檷櫇檴檭歞毉氋瀇瀌瀍瀁瀅瀔瀎濿瀀濻瀦濼濷瀊爁燿燹爃燽獶"], -["f040","璸瓀璵瓁璾璶璻瓂甔甓癜癤癙癐癓癗癚皦皽盬矂瞺磿礌礓礔礉礐礒礑禭禬穟簜簩簙簠簟簭簝簦簨簢簥簰繜繐繖繣繘繢繟繑繠繗繓羵羳翷翸聵臑臒"], -["f0a1","臐艟艞薴藆藀藃藂薳薵薽藇藄薿藋藎藈藅薱薶藒蘤薸薷薾虩蟧蟦蟢蟛蟫蟪蟥蟟蟳蟤蟔蟜蟓蟭蟘蟣螤蟗蟙蠁蟴蟨蟝襓襋襏襌襆襐襑襉謪謧謣謳謰謵譇謯謼謾謱謥謷謦謶謮謤謻謽謺豂豵貙貘貗賾贄贂贀蹜蹢蹠蹗蹖蹞蹥蹧"], -["f140","蹛蹚蹡蹝蹩蹔轆轇轈轋鄨鄺鄻鄾醨醥醧醯醪鎵鎌鎒鎷鎛鎝鎉鎧鎎鎪鎞鎦鎕鎈鎙鎟鎍鎱鎑鎲鎤鎨鎴鎣鎥闒闓闑隳雗雚巂雟雘雝霣霢霥鞬鞮鞨鞫鞤鞪"], -["f1a1","鞢鞥韗韙韖韘韺顐顑顒颸饁餼餺騏騋騉騍騄騑騊騅騇騆髀髜鬈鬄鬅鬩鬵魊魌魋鯇鯆鯃鮿鯁鮵鮸鯓鮶鯄鮹鮽鵜鵓鵏鵊鵛鵋鵙鵖鵌鵗鵒鵔鵟鵘鵚麎麌黟鼁鼀鼖鼥鼫鼪鼩鼨齌齕儴儵劖勷厴嚫嚭嚦嚧嚪嚬壚壝壛夒嬽嬾嬿巃幰"], -["f240","徿懻攇攐攍攉攌攎斄旞旝曞櫧櫠櫌櫑櫙櫋櫟櫜櫐櫫櫏櫍櫞歠殰氌瀙瀧瀠瀖瀫瀡瀢瀣瀩瀗瀤瀜瀪爌爊爇爂爅犥犦犤犣犡瓋瓅璷瓃甖癠矉矊矄矱礝礛"], -["f2a1","礡礜礗礞禰穧穨簳簼簹簬簻糬糪繶繵繸繰繷繯繺繲繴繨罋罊羃羆羷翽翾聸臗臕艤艡艣藫藱藭藙藡藨藚藗藬藲藸藘藟藣藜藑藰藦藯藞藢蠀蟺蠃蟶蟷蠉蠌蠋蠆蟼蠈蟿蠊蠂襢襚襛襗襡襜襘襝襙覈覷覶觶譐譈譊譀譓譖譔譋譕"], -["f340","譑譂譒譗豃豷豶貚贆贇贉趬趪趭趫蹭蹸蹳蹪蹯蹻軂轒轑轏轐轓辴酀鄿醰醭鏞鏇鏏鏂鏚鏐鏹鏬鏌鏙鎩鏦鏊鏔鏮鏣鏕鏄鏎鏀鏒鏧镽闚闛雡霩霫霬霨霦"], -["f3a1","鞳鞷鞶韝韞韟顜顙顝顗颿颽颻颾饈饇饃馦馧騚騕騥騝騤騛騢騠騧騣騞騜騔髂鬋鬊鬎鬌鬷鯪鯫鯠鯞鯤鯦鯢鯰鯔鯗鯬鯜鯙鯥鯕鯡鯚鵷鶁鶊鶄鶈鵱鶀鵸鶆鶋鶌鵽鵫鵴鵵鵰鵩鶅鵳鵻鶂鵯鵹鵿鶇鵨麔麑黀黼鼭齀齁齍齖齗齘匷嚲"], -["f440","嚵嚳壣孅巆巇廮廯忀忁懹攗攖攕攓旟曨曣曤櫳櫰櫪櫨櫹櫱櫮櫯瀼瀵瀯瀷瀴瀱灂瀸瀿瀺瀹灀瀻瀳灁爓爔犨獽獼璺皫皪皾盭矌矎矏矍矲礥礣礧礨礤礩"], -["f4a1","禲穮穬穭竷籉籈籊籇籅糮繻繾纁纀羺翿聹臛臙舋艨艩蘢藿蘁藾蘛蘀藶蘄蘉蘅蘌藽蠙蠐蠑蠗蠓蠖襣襦覹觷譠譪譝譨譣譥譧譭趮躆躈躄轙轖轗轕轘轚邍酃酁醷醵醲醳鐋鐓鏻鐠鐏鐔鏾鐕鐐鐨鐙鐍鏵鐀鏷鐇鐎鐖鐒鏺鐉鏸鐊鏿"], -["f540","鏼鐌鏶鐑鐆闞闠闟霮霯鞹鞻韽韾顠顢顣顟飁飂饐饎饙饌饋饓騲騴騱騬騪騶騩騮騸騭髇髊髆鬐鬒鬑鰋鰈鯷鰅鰒鯸鱀鰇鰎鰆鰗鰔鰉鶟鶙鶤鶝鶒鶘鶐鶛"], -["f5a1","鶠鶔鶜鶪鶗鶡鶚鶢鶨鶞鶣鶿鶩鶖鶦鶧麙麛麚黥黤黧黦鼰鼮齛齠齞齝齙龑儺儹劘劗囃嚽嚾孈孇巋巏廱懽攛欂櫼欃櫸欀灃灄灊灈灉灅灆爝爚爙獾甗癪矐礭礱礯籔籓糲纊纇纈纋纆纍罍羻耰臝蘘蘪蘦蘟蘣蘜蘙蘧蘮蘡蘠蘩蘞蘥"], -["f640","蠩蠝蠛蠠蠤蠜蠫衊襭襩襮襫觺譹譸譅譺譻贐贔趯躎躌轞轛轝酆酄酅醹鐿鐻鐶鐩鐽鐼鐰鐹鐪鐷鐬鑀鐱闥闤闣霵霺鞿韡顤飉飆飀饘饖騹騽驆驄驂驁騺"], -["f6a1","騿髍鬕鬗鬘鬖鬺魒鰫鰝鰜鰬鰣鰨鰩鰤鰡鶷鶶鶼鷁鷇鷊鷏鶾鷅鷃鶻鶵鷎鶹鶺鶬鷈鶱鶭鷌鶳鷍鶲鹺麜黫黮黭鼛鼘鼚鼱齎齥齤龒亹囆囅囋奱孋孌巕巑廲攡攠攦攢欋欈欉氍灕灖灗灒爞爟犩獿瓘瓕瓙瓗癭皭礵禴穰穱籗籜籙籛籚"], -["f740","糴糱纑罏羇臞艫蘴蘵蘳蘬蘲蘶蠬蠨蠦蠪蠥襱覿覾觻譾讄讂讆讅譿贕躕躔躚躒躐躖躗轠轢酇鑌鑐鑊鑋鑏鑇鑅鑈鑉鑆霿韣顪顩飋饔饛驎驓驔驌驏驈驊"], -["f7a1","驉驒驐髐鬙鬫鬻魖魕鱆鱈鰿鱄鰹鰳鱁鰼鰷鰴鰲鰽鰶鷛鷒鷞鷚鷋鷐鷜鷑鷟鷩鷙鷘鷖鷵鷕鷝麶黰鼵鼳鼲齂齫龕龢儽劙壨壧奲孍巘蠯彏戁戃戄攩攥斖曫欑欒欏毊灛灚爢玂玁玃癰矔籧籦纕艬蘺虀蘹蘼蘱蘻蘾蠰蠲蠮蠳襶襴襳觾"], -["f840","讌讎讋讈豅贙躘轤轣醼鑢鑕鑝鑗鑞韄韅頀驖驙鬞鬟鬠鱒鱘鱐鱊鱍鱋鱕鱙鱌鱎鷻鷷鷯鷣鷫鷸鷤鷶鷡鷮鷦鷲鷰鷢鷬鷴鷳鷨鷭黂黐黲黳鼆鼜鼸鼷鼶齃齏"], -["f8a1","齱齰齮齯囓囍孎屭攭曭曮欓灟灡灝灠爣瓛瓥矕礸禷禶籪纗羉艭虃蠸蠷蠵衋讔讕躞躟躠躝醾醽釂鑫鑨鑩雥靆靃靇韇韥驞髕魙鱣鱧鱦鱢鱞鱠鸂鷾鸇鸃鸆鸅鸀鸁鸉鷿鷽鸄麠鼞齆齴齵齶囔攮斸欘欙欗欚灢爦犪矘矙礹籩籫糶纚"], -["f940","纘纛纙臠臡虆虇虈襹襺襼襻觿讘讙躥躤躣鑮鑭鑯鑱鑳靉顲饟鱨鱮鱭鸋鸍鸐鸏鸒鸑麡黵鼉齇齸齻齺齹圞灦籯蠼趲躦釃鑴鑸鑶鑵驠鱴鱳鱱鱵鸔鸓黶鼊"], -["f9a1","龤灨灥糷虪蠾蠽蠿讞貜躩軉靋顳顴飌饡馫驤驦驧鬤鸕鸗齈戇欞爧虌躨钂钀钁驩驨鬮鸙爩虋讟钃鱹麷癵驫鱺鸝灩灪麤齾齉龘碁銹裏墻恒粧嫺╔╦╗╠╬╣╚╩╝╒╤╕╞╪╡╘╧╛╓╥╖╟╫╢╙╨╜║═╭╮╰╯▓"] -] diff --git a/node_modules/mysql2/node_modules/iconv-lite/encodings/tables/eucjp.json b/node_modules/mysql2/node_modules/iconv-lite/encodings/tables/eucjp.json deleted file mode 100644 index 4fa61ca..0000000 --- a/node_modules/mysql2/node_modules/iconv-lite/encodings/tables/eucjp.json +++ /dev/null @@ -1,182 +0,0 @@ -[ -["0","\u0000",127], -["8ea1","。",62], -["a1a1"," 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈",9,"+-±×÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇"], -["a2a1","◆□■△▲▽▼※〒→←↑↓〓"], -["a2ba","∈∋⊆⊇⊂⊃∪∩"], -["a2ca","∧∨¬⇒⇔∀∃"], -["a2dc","∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬"], -["a2f2","ʼn♯♭♪†‡¶"], -["a2fe","◯"], -["a3b0","0",9], -["a3c1","A",25], -["a3e1","a",25], -["a4a1","ぁ",82], -["a5a1","ァ",85], -["a6a1","Α",16,"Σ",6], -["a6c1","α",16,"σ",6], -["a7a1","А",5,"ЁЖ",25], -["a7d1","а",5,"ёж",25], -["a8a1","─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂"], -["ada1","①",19,"Ⅰ",9], -["adc0","㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡"], -["addf","㍻〝〟№㏍℡㊤",4,"㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪"], -["b0a1","亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭"], -["b1a1","院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応"], -["b2a1","押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改"], -["b3a1","魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱"], -["b4a1","粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄"], -["b5a1","機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京"], -["b6a1","供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈"], -["b7a1","掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲"], -["b8a1","検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向"], -["b9a1","后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込"], -["baa1","此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷"], -["bba1","察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時"], -["bca1","次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周"], -["bda1","宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償"], -["bea1","勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾"], -["bfa1","拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾"], -["c0a1","澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線"], -["c1a1","繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎"], -["c2a1","臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只"], -["c3a1","叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵"], -["c4a1","帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓"], -["c5a1","邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到"], -["c6a1","董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入"], -["c7a1","如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦"], -["c8a1","函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美"], -["c9a1","鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服"], -["caa1","福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋"], -["cba1","法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満"], -["cca1","漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒"], -["cda1","諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃"], -["cea1","痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯"], -["cfa1","蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕"], -["d0a1","弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲"], -["d1a1","僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨"], -["d2a1","辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨"], -["d3a1","咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉"], -["d4a1","圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩"], -["d5a1","奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓"], -["d6a1","屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏"], -["d7a1","廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚"], -["d8a1","悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛"], -["d9a1","戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼"], -["daa1","據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼"], -["dba1","曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍"], -["dca1","棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣"], -["dda1","檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾"], -["dea1","沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌"], -["dfa1","漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼"], -["e0a1","燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱"], -["e1a1","瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰"], -["e2a1","癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬"], -["e3a1","磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐"], -["e4a1","筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆"], -["e5a1","紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺"], -["e6a1","罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋"], -["e7a1","隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙"], -["e8a1","茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈"], -["e9a1","蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙"], -["eaa1","蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞"], -["eba1","襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫"], -["eca1","譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊"], -["eda1","蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸"], -["eea1","遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮"], -["efa1","錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞"], -["f0a1","陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰"], -["f1a1","顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷"], -["f2a1","髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈"], -["f3a1","鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠"], -["f4a1","堯槇遙瑤凜熙"], -["f9a1","纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德"], -["faa1","忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱"], -["fba1","犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚"], -["fca1","釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"], -["fcf1","ⅰ",9,"¬¦'""], -["8fa2af","˘ˇ¸˙˝¯˛˚~΄΅"], -["8fa2c2","¡¦¿"], -["8fa2eb","ºª©®™¤№"], -["8fa6e1","ΆΈΉΊΪ"], -["8fa6e7","Ό"], -["8fa6e9","ΎΫ"], -["8fa6ec","Ώ"], -["8fa6f1","άέήίϊΐόςύϋΰώ"], -["8fa7c2","Ђ",10,"ЎЏ"], -["8fa7f2","ђ",10,"ўџ"], -["8fa9a1","ÆĐ"], -["8fa9a4","Ħ"], -["8fa9a6","IJ"], -["8fa9a8","ŁĿ"], -["8fa9ab","ŊØŒ"], -["8fa9af","ŦÞ"], -["8fa9c1","æđðħıijĸłŀʼnŋøœßŧþ"], -["8faaa1","ÁÀÄÂĂǍĀĄÅÃĆĈČÇĊĎÉÈËÊĚĖĒĘ"], -["8faaba","ĜĞĢĠĤÍÌÏÎǏİĪĮĨĴĶĹĽĻŃŇŅÑÓÒÖÔǑŐŌÕŔŘŖŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙǕŴÝŸŶŹŽŻ"], -["8faba1","áàäâăǎāąåãćĉčçċďéèëêěėēęǵĝğ"], -["8fabbd","ġĥíìïîǐ"], -["8fabc5","īįĩĵķĺľļńňņñóòöôǒőōõŕřŗśŝšşťţúùüûŭǔűūųůũǘǜǚǖŵýÿŷźžż"], -["8fb0a1","丂丄丅丌丒丟丣两丨丫丮丯丰丵乀乁乄乇乑乚乜乣乨乩乴乵乹乿亍亖亗亝亯亹仃仐仚仛仠仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘佟佣佪佬佮佱佷佸佹佺佽佾侁侂侄"], -["8fb1a1","侅侉侊侌侎侐侒侓侔侗侙侚侞侟侲侷侹侻侼侽侾俀俁俅俆俈俉俋俌俍俏俒俜俠俢俰俲俼俽俿倀倁倄倇倊倌倎倐倓倗倘倛倜倝倞倢倧倮倰倲倳倵偀偁偂偅偆偊偌偎偑偒偓偗偙偟偠偢偣偦偧偪偭偰偱倻傁傃傄傆傊傎傏傐"], -["8fb2a1","傒傓傔傖傛傜傞",4,"傪傯傰傹傺傽僀僃僄僇僌僎僐僓僔僘僜僝僟僢僤僦僨僩僯僱僶僺僾儃儆儇儈儋儌儍儎僲儐儗儙儛儜儝儞儣儧儨儬儭儯儱儳儴儵儸儹兂兊兏兓兕兗兘兟兤兦兾冃冄冋冎冘冝冡冣冭冸冺冼冾冿凂"], -["8fb3a1","凈减凑凒凓凕凘凞凢凥凮凲凳凴凷刁刂刅划刓刕刖刘刢刨刱刲刵刼剅剉剕剗剘剚剜剟剠剡剦剮剷剸剹劀劂劅劊劌劓劕劖劗劘劚劜劤劥劦劧劯劰劶劷劸劺劻劽勀勄勆勈勌勏勑勔勖勛勜勡勥勨勩勪勬勰勱勴勶勷匀匃匊匋"], -["8fb4a1","匌匑匓匘匛匜匞匟匥匧匨匩匫匬匭匰匲匵匼匽匾卂卌卋卙卛卡卣卥卬卭卲卹卾厃厇厈厎厓厔厙厝厡厤厪厫厯厲厴厵厷厸厺厽叀叅叏叒叓叕叚叝叞叠另叧叵吂吓吚吡吧吨吪启吱吴吵呃呄呇呍呏呞呢呤呦呧呩呫呭呮呴呿"], -["8fb5a1","咁咃咅咈咉咍咑咕咖咜咟咡咦咧咩咪咭咮咱咷咹咺咻咿哆哊响哎哠哪哬哯哶哼哾哿唀唁唅唈唉唌唍唎唕唪唫唲唵唶唻唼唽啁啇啉啊啍啐啑啘啚啛啞啠啡啤啦啿喁喂喆喈喎喏喑喒喓喔喗喣喤喭喲喿嗁嗃嗆嗉嗋嗌嗎嗑嗒"], -["8fb6a1","嗓嗗嗘嗛嗞嗢嗩嗶嗿嘅嘈嘊嘍",5,"嘙嘬嘰嘳嘵嘷嘹嘻嘼嘽嘿噀噁噃噄噆噉噋噍噏噔噞噠噡噢噣噦噩噭噯噱噲噵嚄嚅嚈嚋嚌嚕嚙嚚嚝嚞嚟嚦嚧嚨嚩嚫嚬嚭嚱嚳嚷嚾囅囉囊囋囏囐囌囍囙囜囝囟囡囤",4,"囱囫园"], -["8fb7a1","囶囷圁圂圇圊圌圑圕圚圛圝圠圢圣圤圥圩圪圬圮圯圳圴圽圾圿坅坆坌坍坒坢坥坧坨坫坭",4,"坳坴坵坷坹坺坻坼坾垁垃垌垔垗垙垚垜垝垞垟垡垕垧垨垩垬垸垽埇埈埌埏埕埝埞埤埦埧埩埭埰埵埶埸埽埾埿堃堄堈堉埡"], -["8fb8a1","堌堍堛堞堟堠堦堧堭堲堹堿塉塌塍塏塐塕塟塡塤塧塨塸塼塿墀墁墇墈墉墊墌墍墏墐墔墖墝墠墡墢墦墩墱墲壄墼壂壈壍壎壐壒壔壖壚壝壡壢壩壳夅夆夋夌夒夓夔虁夝夡夣夤夨夯夰夳夵夶夿奃奆奒奓奙奛奝奞奟奡奣奫奭"], -["8fb9a1","奯奲奵奶她奻奼妋妌妎妒妕妗妟妤妧妭妮妯妰妳妷妺妼姁姃姄姈姊姍姒姝姞姟姣姤姧姮姯姱姲姴姷娀娄娌娍娎娒娓娞娣娤娧娨娪娭娰婄婅婇婈婌婐婕婞婣婥婧婭婷婺婻婾媋媐媓媖媙媜媞媟媠媢媧媬媱媲媳媵媸媺媻媿"], -["8fbaa1","嫄嫆嫈嫏嫚嫜嫠嫥嫪嫮嫵嫶嫽嬀嬁嬈嬗嬴嬙嬛嬝嬡嬥嬭嬸孁孋孌孒孖孞孨孮孯孼孽孾孿宁宄宆宊宎宐宑宓宔宖宨宩宬宭宯宱宲宷宺宼寀寁寍寏寖",4,"寠寯寱寴寽尌尗尞尟尣尦尩尫尬尮尰尲尵尶屙屚屜屢屣屧屨屩"], -["8fbba1","屭屰屴屵屺屻屼屽岇岈岊岏岒岝岟岠岢岣岦岪岲岴岵岺峉峋峒峝峗峮峱峲峴崁崆崍崒崫崣崤崦崧崱崴崹崽崿嵂嵃嵆嵈嵕嵑嵙嵊嵟嵠嵡嵢嵤嵪嵭嵰嵹嵺嵾嵿嶁嶃嶈嶊嶒嶓嶔嶕嶙嶛嶟嶠嶧嶫嶰嶴嶸嶹巃巇巋巐巎巘巙巠巤"], -["8fbca1","巩巸巹帀帇帍帒帔帕帘帟帠帮帨帲帵帾幋幐幉幑幖幘幛幜幞幨幪",4,"幰庀庋庎庢庤庥庨庪庬庱庳庽庾庿廆廌廋廎廑廒廔廕廜廞廥廫异弆弇弈弎弙弜弝弡弢弣弤弨弫弬弮弰弴弶弻弽弿彀彄彅彇彍彐彔彘彛彠彣彤彧"], -["8fbda1","彯彲彴彵彸彺彽彾徉徍徏徖徜徝徢徧徫徤徬徯徰徱徸忄忇忈忉忋忐",4,"忞忡忢忨忩忪忬忭忮忯忲忳忶忺忼怇怊怍怓怔怗怘怚怟怤怭怳怵恀恇恈恉恌恑恔恖恗恝恡恧恱恾恿悂悆悈悊悎悑悓悕悘悝悞悢悤悥您悰悱悷"], -["8fbea1","悻悾惂惄惈惉惊惋惎惏惔惕惙惛惝惞惢惥惲惵惸惼惽愂愇愊愌愐",4,"愖愗愙愜愞愢愪愫愰愱愵愶愷愹慁慅慆慉慞慠慬慲慸慻慼慿憀憁憃憄憋憍憒憓憗憘憜憝憟憠憥憨憪憭憸憹憼懀懁懂懎懏懕懜懝懞懟懡懢懧懩懥"], -["8fbfa1","懬懭懯戁戃戄戇戓戕戜戠戢戣戧戩戫戹戽扂扃扄扆扌扐扑扒扔扖扚扜扤扭扯扳扺扽抍抎抏抐抦抨抳抶抷抺抾抿拄拎拕拖拚拪拲拴拼拽挃挄挊挋挍挐挓挖挘挩挪挭挵挶挹挼捁捂捃捄捆捊捋捎捒捓捔捘捛捥捦捬捭捱捴捵"], -["8fc0a1","捸捼捽捿掂掄掇掊掐掔掕掙掚掞掤掦掭掮掯掽揁揅揈揎揑揓揔揕揜揠揥揪揬揲揳揵揸揹搉搊搐搒搔搘搞搠搢搤搥搩搪搯搰搵搽搿摋摏摑摒摓摔摚摛摜摝摟摠摡摣摭摳摴摻摽撅撇撏撐撑撘撙撛撝撟撡撣撦撨撬撳撽撾撿"], -["8fc1a1","擄擉擊擋擌擎擐擑擕擗擤擥擩擪擭擰擵擷擻擿攁攄攈攉攊攏攓攔攖攙攛攞攟攢攦攩攮攱攺攼攽敃敇敉敐敒敔敟敠敧敫敺敽斁斅斊斒斕斘斝斠斣斦斮斲斳斴斿旂旈旉旎旐旔旖旘旟旰旲旴旵旹旾旿昀昄昈昉昍昑昒昕昖昝"], -["8fc2a1","昞昡昢昣昤昦昩昪昫昬昮昰昱昳昹昷晀晅晆晊晌晑晎晗晘晙晛晜晠晡曻晪晫晬晾晳晵晿晷晸晹晻暀晼暋暌暍暐暒暙暚暛暜暟暠暤暭暱暲暵暻暿曀曂曃曈曌曎曏曔曛曟曨曫曬曮曺朅朇朎朓朙朜朠朢朳朾杅杇杈杌杔杕杝"], -["8fc3a1","杦杬杮杴杶杻极构枎枏枑枓枖枘枙枛枰枱枲枵枻枼枽柹柀柂柃柅柈柉柒柗柙柜柡柦柰柲柶柷桒栔栙栝栟栨栧栬栭栯栰栱栳栻栿桄桅桊桌桕桗桘桛桫桮",4,"桵桹桺桻桼梂梄梆梈梖梘梚梜梡梣梥梩梪梮梲梻棅棈棌棏"], -["8fc4a1","棐棑棓棖棙棜棝棥棨棪棫棬棭棰棱棵棶棻棼棽椆椉椊椐椑椓椖椗椱椳椵椸椻楂楅楉楎楗楛楣楤楥楦楨楩楬楰楱楲楺楻楿榀榍榒榖榘榡榥榦榨榫榭榯榷榸榺榼槅槈槑槖槗槢槥槮槯槱槳槵槾樀樁樃樏樑樕樚樝樠樤樨樰樲"], -["8fc5a1","樴樷樻樾樿橅橆橉橊橎橐橑橒橕橖橛橤橧橪橱橳橾檁檃檆檇檉檋檑檛檝檞檟檥檫檯檰檱檴檽檾檿櫆櫉櫈櫌櫐櫔櫕櫖櫜櫝櫤櫧櫬櫰櫱櫲櫼櫽欂欃欆欇欉欏欐欑欗欛欞欤欨欫欬欯欵欶欻欿歆歊歍歒歖歘歝歠歧歫歮歰歵歽"], -["8fc6a1","歾殂殅殗殛殟殠殢殣殨殩殬殭殮殰殸殹殽殾毃毄毉毌毖毚毡毣毦毧毮毱毷毹毿氂氄氅氉氍氎氐氒氙氟氦氧氨氬氮氳氵氶氺氻氿汊汋汍汏汒汔汙汛汜汫汭汯汴汶汸汹汻沅沆沇沉沔沕沗沘沜沟沰沲沴泂泆泍泏泐泑泒泔泖"], -["8fc7a1","泚泜泠泧泩泫泬泮泲泴洄洇洊洎洏洑洓洚洦洧洨汧洮洯洱洹洼洿浗浞浟浡浥浧浯浰浼涂涇涑涒涔涖涗涘涪涬涴涷涹涽涿淄淈淊淎淏淖淛淝淟淠淢淥淩淯淰淴淶淼渀渄渞渢渧渲渶渹渻渼湄湅湈湉湋湏湑湒湓湔湗湜湝湞"], -["8fc8a1","湢湣湨湳湻湽溍溓溙溠溧溭溮溱溳溻溿滀滁滃滇滈滊滍滎滏滫滭滮滹滻滽漄漈漊漌漍漖漘漚漛漦漩漪漯漰漳漶漻漼漭潏潑潒潓潗潙潚潝潞潡潢潨潬潽潾澃澇澈澋澌澍澐澒澓澔澖澚澟澠澥澦澧澨澮澯澰澵澶澼濅濇濈濊"], -["8fc9a1","濚濞濨濩濰濵濹濼濽瀀瀅瀆瀇瀍瀗瀠瀣瀯瀴瀷瀹瀼灃灄灈灉灊灋灔灕灝灞灎灤灥灬灮灵灶灾炁炅炆炔",4,"炛炤炫炰炱炴炷烊烑烓烔烕烖烘烜烤烺焃",4,"焋焌焏焞焠焫焭焯焰焱焸煁煅煆煇煊煋煐煒煗煚煜煞煠"], -["8fcaa1","煨煹熀熅熇熌熒熚熛熠熢熯熰熲熳熺熿燀燁燄燋燌燓燖燙燚燜燸燾爀爇爈爉爓爗爚爝爟爤爫爯爴爸爹牁牂牃牅牎牏牐牓牕牖牚牜牞牠牣牨牫牮牯牱牷牸牻牼牿犄犉犍犎犓犛犨犭犮犱犴犾狁狇狉狌狕狖狘狟狥狳狴狺狻"], -["8fcba1","狾猂猄猅猇猋猍猒猓猘猙猞猢猤猧猨猬猱猲猵猺猻猽獃獍獐獒獖獘獝獞獟獠獦獧獩獫獬獮獯獱獷獹獼玀玁玃玅玆玎玐玓玕玗玘玜玞玟玠玢玥玦玪玫玭玵玷玹玼玽玿珅珆珉珋珌珏珒珓珖珙珝珡珣珦珧珩珴珵珷珹珺珻珽"], -["8fcca1","珿琀琁琄琇琊琑琚琛琤琦琨",9,"琹瑀瑃瑄瑆瑇瑋瑍瑑瑒瑗瑝瑢瑦瑧瑨瑫瑭瑮瑱瑲璀璁璅璆璇璉璏璐璑璒璘璙璚璜璟璠璡璣璦璨璩璪璫璮璯璱璲璵璹璻璿瓈瓉瓌瓐瓓瓘瓚瓛瓞瓟瓤瓨瓪瓫瓯瓴瓺瓻瓼瓿甆"], -["8fcda1","甒甖甗甠甡甤甧甩甪甯甶甹甽甾甿畀畃畇畈畎畐畒畗畞畟畡畯畱畹",5,"疁疅疐疒疓疕疙疜疢疤疴疺疿痀痁痄痆痌痎痏痗痜痟痠痡痤痧痬痮痯痱痹瘀瘂瘃瘄瘇瘈瘊瘌瘏瘒瘓瘕瘖瘙瘛瘜瘝瘞瘣瘥瘦瘩瘭瘲瘳瘵瘸瘹"], -["8fcea1","瘺瘼癊癀癁癃癄癅癉癋癕癙癟癤癥癭癮癯癱癴皁皅皌皍皕皛皜皝皟皠皢",6,"皪皭皽盁盅盉盋盌盎盔盙盠盦盨盬盰盱盶盹盼眀眆眊眎眒眔眕眗眙眚眜眢眨眭眮眯眴眵眶眹眽眾睂睅睆睊睍睎睏睒睖睗睜睞睟睠睢"], -["8fcfa1","睤睧睪睬睰睲睳睴睺睽瞀瞄瞌瞍瞔瞕瞖瞚瞟瞢瞧瞪瞮瞯瞱瞵瞾矃矉矑矒矕矙矞矟矠矤矦矪矬矰矱矴矸矻砅砆砉砍砎砑砝砡砢砣砭砮砰砵砷硃硄硇硈硌硎硒硜硞硠硡硣硤硨硪确硺硾碊碏碔碘碡碝碞碟碤碨碬碭碰碱碲碳"], -["8fd0a1","碻碽碿磇磈磉磌磎磒磓磕磖磤磛磟磠磡磦磪磲磳礀磶磷磺磻磿礆礌礐礚礜礞礟礠礥礧礩礭礱礴礵礻礽礿祄祅祆祊祋祏祑祔祘祛祜祧祩祫祲祹祻祼祾禋禌禑禓禔禕禖禘禛禜禡禨禩禫禯禱禴禸离秂秄秇秈秊秏秔秖秚秝秞"], -["8fd1a1","秠秢秥秪秫秭秱秸秼稂稃稇稉稊稌稑稕稛稞稡稧稫稭稯稰稴稵稸稹稺穄穅穇穈穌穕穖穙穜穝穟穠穥穧穪穭穵穸穾窀窂窅窆窊窋窐窑窔窞窠窣窬窳窵窹窻窼竆竉竌竎竑竛竨竩竫竬竱竴竻竽竾笇笔笟笣笧笩笪笫笭笮笯笰"], -["8fd2a1","笱笴笽笿筀筁筇筎筕筠筤筦筩筪筭筯筲筳筷箄箉箎箐箑箖箛箞箠箥箬箯箰箲箵箶箺箻箼箽篂篅篈篊篔篖篗篙篚篛篨篪篲篴篵篸篹篺篼篾簁簂簃簄簆簉簋簌簎簏簙簛簠簥簦簨簬簱簳簴簶簹簺籆籊籕籑籒籓籙",5], -["8fd3a1","籡籣籧籩籭籮籰籲籹籼籽粆粇粏粔粞粠粦粰粶粷粺粻粼粿糄糇糈糉糍糏糓糔糕糗糙糚糝糦糩糫糵紃紇紈紉紏紑紒紓紖紝紞紣紦紪紭紱紼紽紾絀絁絇絈絍絑絓絗絙絚絜絝絥絧絪絰絸絺絻絿綁綂綃綅綆綈綋綌綍綑綖綗綝"], -["8fd4a1","綞綦綧綪綳綶綷綹緂",4,"緌緍緎緗緙縀緢緥緦緪緫緭緱緵緶緹緺縈縐縑縕縗縜縝縠縧縨縬縭縯縳縶縿繄繅繇繎繐繒繘繟繡繢繥繫繮繯繳繸繾纁纆纇纊纍纑纕纘纚纝纞缼缻缽缾缿罃罄罇罏罒罓罛罜罝罡罣罤罥罦罭"], -["8fd5a1","罱罽罾罿羀羋羍羏羐羑羖羗羜羡羢羦羪羭羴羼羿翀翃翈翎翏翛翟翣翥翨翬翮翯翲翺翽翾翿耇耈耊耍耎耏耑耓耔耖耝耞耟耠耤耦耬耮耰耴耵耷耹耺耼耾聀聄聠聤聦聭聱聵肁肈肎肜肞肦肧肫肸肹胈胍胏胒胔胕胗胘胠胭胮"], -["8fd6a1","胰胲胳胶胹胺胾脃脋脖脗脘脜脞脠脤脧脬脰脵脺脼腅腇腊腌腒腗腠腡腧腨腩腭腯腷膁膐膄膅膆膋膎膖膘膛膞膢膮膲膴膻臋臃臅臊臎臏臕臗臛臝臞臡臤臫臬臰臱臲臵臶臸臹臽臿舀舃舏舓舔舙舚舝舡舢舨舲舴舺艃艄艅艆"], -["8fd7a1","艋艎艏艑艖艜艠艣艧艭艴艻艽艿芀芁芃芄芇芉芊芎芑芔芖芘芚芛芠芡芣芤芧芨芩芪芮芰芲芴芷芺芼芾芿苆苐苕苚苠苢苤苨苪苭苯苶苷苽苾茀茁茇茈茊茋荔茛茝茞茟茡茢茬茭茮茰茳茷茺茼茽荂荃荄荇荍荎荑荕荖荗荰荸"], -["8fd8a1","荽荿莀莂莄莆莍莒莔莕莘莙莛莜莝莦莧莩莬莾莿菀菇菉菏菐菑菔菝荓菨菪菶菸菹菼萁萆萊萏萑萕萙莭萯萹葅葇葈葊葍葏葑葒葖葘葙葚葜葠葤葥葧葪葰葳葴葶葸葼葽蒁蒅蒒蒓蒕蒞蒦蒨蒩蒪蒯蒱蒴蒺蒽蒾蓀蓂蓇蓈蓌蓏蓓"], -["8fd9a1","蓜蓧蓪蓯蓰蓱蓲蓷蔲蓺蓻蓽蔂蔃蔇蔌蔎蔐蔜蔞蔢蔣蔤蔥蔧蔪蔫蔯蔳蔴蔶蔿蕆蕏",4,"蕖蕙蕜",6,"蕤蕫蕯蕹蕺蕻蕽蕿薁薅薆薉薋薌薏薓薘薝薟薠薢薥薧薴薶薷薸薼薽薾薿藂藇藊藋藎薭藘藚藟藠藦藨藭藳藶藼"], -["8fdaa1","藿蘀蘄蘅蘍蘎蘐蘑蘒蘘蘙蘛蘞蘡蘧蘩蘶蘸蘺蘼蘽虀虂虆虒虓虖虗虘虙虝虠",4,"虩虬虯虵虶虷虺蚍蚑蚖蚘蚚蚜蚡蚦蚧蚨蚭蚱蚳蚴蚵蚷蚸蚹蚿蛀蛁蛃蛅蛑蛒蛕蛗蛚蛜蛠蛣蛥蛧蚈蛺蛼蛽蜄蜅蜇蜋蜎蜏蜐蜓蜔蜙蜞蜟蜡蜣"], -["8fdba1","蜨蜮蜯蜱蜲蜹蜺蜼蜽蜾蝀蝃蝅蝍蝘蝝蝡蝤蝥蝯蝱蝲蝻螃",6,"螋螌螐螓螕螗螘螙螞螠螣螧螬螭螮螱螵螾螿蟁蟈蟉蟊蟎蟕蟖蟙蟚蟜蟟蟢蟣蟤蟪蟫蟭蟱蟳蟸蟺蟿蠁蠃蠆蠉蠊蠋蠐蠙蠒蠓蠔蠘蠚蠛蠜蠞蠟蠨蠭蠮蠰蠲蠵"], -["8fdca1","蠺蠼衁衃衅衈衉衊衋衎衑衕衖衘衚衜衟衠衤衩衱衹衻袀袘袚袛袜袟袠袨袪袺袽袾裀裊",4,"裑裒裓裛裞裧裯裰裱裵裷褁褆褍褎褏褕褖褘褙褚褜褠褦褧褨褰褱褲褵褹褺褾襀襂襅襆襉襏襒襗襚襛襜襡襢襣襫襮襰襳襵襺"], -["8fdda1","襻襼襽覉覍覐覔覕覛覜覟覠覥覰覴覵覶覷覼觔",4,"觥觩觫觭觱觳觶觹觽觿訄訅訇訏訑訒訔訕訞訠訢訤訦訫訬訯訵訷訽訾詀詃詅詇詉詍詎詓詖詗詘詜詝詡詥詧詵詶詷詹詺詻詾詿誀誃誆誋誏誐誒誖誗誙誟誧誩誮誯誳"], -["8fdea1","誶誷誻誾諃諆諈諉諊諑諓諔諕諗諝諟諬諰諴諵諶諼諿謅謆謋謑謜謞謟謊謭謰謷謼譂",4,"譈譒譓譔譙譍譞譣譭譶譸譹譼譾讁讄讅讋讍讏讔讕讜讞讟谸谹谽谾豅豇豉豋豏豑豓豔豗豘豛豝豙豣豤豦豨豩豭豳豵豶豻豾貆"], -["8fdfa1","貇貋貐貒貓貙貛貜貤貹貺賅賆賉賋賏賖賕賙賝賡賨賬賯賰賲賵賷賸賾賿贁贃贉贒贗贛赥赩赬赮赿趂趄趈趍趐趑趕趞趟趠趦趫趬趯趲趵趷趹趻跀跅跆跇跈跊跎跑跔跕跗跙跤跥跧跬跰趼跱跲跴跽踁踄踅踆踋踑踔踖踠踡踢"], -["8fe0a1","踣踦踧踱踳踶踷踸踹踽蹀蹁蹋蹍蹎蹏蹔蹛蹜蹝蹞蹡蹢蹩蹬蹭蹯蹰蹱蹹蹺蹻躂躃躉躐躒躕躚躛躝躞躢躧躩躭躮躳躵躺躻軀軁軃軄軇軏軑軔軜軨軮軰軱軷軹軺軭輀輂輇輈輏輐輖輗輘輞輠輡輣輥輧輨輬輭輮輴輵輶輷輺轀轁"], -["8fe1a1","轃轇轏轑",4,"轘轝轞轥辝辠辡辤辥辦辵辶辸达迀迁迆迊迋迍运迒迓迕迠迣迤迨迮迱迵迶迻迾适逄逈逌逘逛逨逩逯逪逬逭逳逴逷逿遃遄遌遛遝遢遦遧遬遰遴遹邅邈邋邌邎邐邕邗邘邙邛邠邡邢邥邰邲邳邴邶邽郌邾郃"], -["8fe2a1","郄郅郇郈郕郗郘郙郜郝郟郥郒郶郫郯郰郴郾郿鄀鄄鄅鄆鄈鄍鄐鄔鄖鄗鄘鄚鄜鄞鄠鄥鄢鄣鄧鄩鄮鄯鄱鄴鄶鄷鄹鄺鄼鄽酃酇酈酏酓酗酙酚酛酡酤酧酭酴酹酺酻醁醃醅醆醊醎醑醓醔醕醘醞醡醦醨醬醭醮醰醱醲醳醶醻醼醽醿"], -["8fe3a1","釂釃釅釓釔釗釙釚釞釤釥釩釪釬",5,"釷釹釻釽鈀鈁鈄鈅鈆鈇鈉鈊鈌鈐鈒鈓鈖鈘鈜鈝鈣鈤鈥鈦鈨鈮鈯鈰鈳鈵鈶鈸鈹鈺鈼鈾鉀鉂鉃鉆鉇鉊鉍鉎鉏鉑鉘鉙鉜鉝鉠鉡鉥鉧鉨鉩鉮鉯鉰鉵",4,"鉻鉼鉽鉿銈銉銊銍銎銒銗"], -["8fe4a1","銙銟銠銤銥銧銨銫銯銲銶銸銺銻銼銽銿",4,"鋅鋆鋇鋈鋋鋌鋍鋎鋐鋓鋕鋗鋘鋙鋜鋝鋟鋠鋡鋣鋥鋧鋨鋬鋮鋰鋹鋻鋿錀錂錈錍錑錔錕錜錝錞錟錡錤錥錧錩錪錳錴錶錷鍇鍈鍉鍐鍑鍒鍕鍗鍘鍚鍞鍤鍥鍧鍩鍪鍭鍯鍰鍱鍳鍴鍶"], -["8fe5a1","鍺鍽鍿鎀鎁鎂鎈鎊鎋鎍鎏鎒鎕鎘鎛鎞鎡鎣鎤鎦鎨鎫鎴鎵鎶鎺鎩鏁鏄鏅鏆鏇鏉",4,"鏓鏙鏜鏞鏟鏢鏦鏧鏹鏷鏸鏺鏻鏽鐁鐂鐄鐈鐉鐍鐎鐏鐕鐖鐗鐟鐮鐯鐱鐲鐳鐴鐻鐿鐽鑃鑅鑈鑊鑌鑕鑙鑜鑟鑡鑣鑨鑫鑭鑮鑯鑱鑲钄钃镸镹"], -["8fe6a1","镾閄閈閌閍閎閝閞閟閡閦閩閫閬閴閶閺閽閿闆闈闉闋闐闑闒闓闙闚闝闞闟闠闤闦阝阞阢阤阥阦阬阱阳阷阸阹阺阼阽陁陒陔陖陗陘陡陮陴陻陼陾陿隁隂隃隄隉隑隖隚隝隟隤隥隦隩隮隯隳隺雊雒嶲雘雚雝雞雟雩雯雱雺霂"], -["8fe7a1","霃霅霉霚霛霝霡霢霣霨霱霳靁靃靊靎靏靕靗靘靚靛靣靧靪靮靳靶靷靸靻靽靿鞀鞉鞕鞖鞗鞙鞚鞞鞟鞢鞬鞮鞱鞲鞵鞶鞸鞹鞺鞼鞾鞿韁韄韅韇韉韊韌韍韎韐韑韔韗韘韙韝韞韠韛韡韤韯韱韴韷韸韺頇頊頙頍頎頔頖頜頞頠頣頦"], -["8fe8a1","頫頮頯頰頲頳頵頥頾顄顇顊顑顒顓顖顗顙顚顢顣顥顦顪顬颫颭颮颰颴颷颸颺颻颿飂飅飈飌飡飣飥飦飧飪飳飶餂餇餈餑餕餖餗餚餛餜餟餢餦餧餫餱",4,"餹餺餻餼饀饁饆饇饈饍饎饔饘饙饛饜饞饟饠馛馝馟馦馰馱馲馵"], -["8fe9a1","馹馺馽馿駃駉駓駔駙駚駜駞駧駪駫駬駰駴駵駹駽駾騂騃騄騋騌騐騑騖騞騠騢騣騤騧騭騮騳騵騶騸驇驁驄驊驋驌驎驑驔驖驝骪骬骮骯骲骴骵骶骹骻骾骿髁髃髆髈髎髐髒髕髖髗髛髜髠髤髥髧髩髬髲髳髵髹髺髽髿",4], -["8feaa1","鬄鬅鬈鬉鬋鬌鬍鬎鬐鬒鬖鬙鬛鬜鬠鬦鬫鬭鬳鬴鬵鬷鬹鬺鬽魈魋魌魕魖魗魛魞魡魣魥魦魨魪",4,"魳魵魷魸魹魿鮀鮄鮅鮆鮇鮉鮊鮋鮍鮏鮐鮔鮚鮝鮞鮦鮧鮩鮬鮰鮱鮲鮷鮸鮻鮼鮾鮿鯁鯇鯈鯎鯐鯗鯘鯝鯟鯥鯧鯪鯫鯯鯳鯷鯸"], -["8feba1","鯹鯺鯽鯿鰀鰂鰋鰏鰑鰖鰘鰙鰚鰜鰞鰢鰣鰦",4,"鰱鰵鰶鰷鰽鱁鱃鱄鱅鱉鱊鱎鱏鱐鱓鱔鱖鱘鱛鱝鱞鱟鱣鱩鱪鱜鱫鱨鱮鱰鱲鱵鱷鱻鳦鳲鳷鳹鴋鴂鴑鴗鴘鴜鴝鴞鴯鴰鴲鴳鴴鴺鴼鵅鴽鵂鵃鵇鵊鵓鵔鵟鵣鵢鵥鵩鵪鵫鵰鵶鵷鵻"], -["8feca1","鵼鵾鶃鶄鶆鶊鶍鶎鶒鶓鶕鶖鶗鶘鶡鶪鶬鶮鶱鶵鶹鶼鶿鷃鷇鷉鷊鷔鷕鷖鷗鷚鷞鷟鷠鷥鷧鷩鷫鷮鷰鷳鷴鷾鸊鸂鸇鸎鸐鸑鸒鸕鸖鸙鸜鸝鹺鹻鹼麀麂麃麄麅麇麎麏麖麘麛麞麤麨麬麮麯麰麳麴麵黆黈黋黕黟黤黧黬黭黮黰黱黲黵"], -["8feda1","黸黿鼂鼃鼉鼏鼐鼑鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿齁齃",4,"齓齕齖齗齘齚齝齞齨齩齭",4,"齳齵齺齽龏龐龑龒龔龖龗龞龡龢龣龥"] -] diff --git a/node_modules/mysql2/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json b/node_modules/mysql2/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json deleted file mode 100644 index 85c6934..0000000 --- a/node_modules/mysql2/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +++ /dev/null @@ -1 +0,0 @@ -{"uChars":[128,165,169,178,184,216,226,235,238,244,248,251,253,258,276,284,300,325,329,334,364,463,465,467,469,471,473,475,477,506,594,610,712,716,730,930,938,962,970,1026,1104,1106,8209,8215,8218,8222,8231,8241,8244,8246,8252,8365,8452,8454,8458,8471,8482,8556,8570,8596,8602,8713,8720,8722,8726,8731,8737,8740,8742,8748,8751,8760,8766,8777,8781,8787,8802,8808,8816,8854,8858,8870,8896,8979,9322,9372,9548,9588,9616,9622,9634,9652,9662,9672,9676,9680,9702,9735,9738,9793,9795,11906,11909,11913,11917,11928,11944,11947,11951,11956,11960,11964,11979,12284,12292,12312,12319,12330,12351,12436,12447,12535,12543,12586,12842,12850,12964,13200,13215,13218,13253,13263,13267,13270,13384,13428,13727,13839,13851,14617,14703,14801,14816,14964,15183,15471,15585,16471,16736,17208,17325,17330,17374,17623,17997,18018,18212,18218,18301,18318,18760,18811,18814,18820,18823,18844,18848,18872,19576,19620,19738,19887,40870,59244,59336,59367,59413,59417,59423,59431,59437,59443,59452,59460,59478,59493,63789,63866,63894,63976,63986,64016,64018,64021,64025,64034,64037,64042,65074,65093,65107,65112,65127,65132,65375,65510,65536],"gbChars":[0,36,38,45,50,81,89,95,96,100,103,104,105,109,126,133,148,172,175,179,208,306,307,308,309,310,311,312,313,341,428,443,544,545,558,741,742,749,750,805,819,820,7922,7924,7925,7927,7934,7943,7944,7945,7950,8062,8148,8149,8152,8164,8174,8236,8240,8262,8264,8374,8380,8381,8384,8388,8390,8392,8393,8394,8396,8401,8406,8416,8419,8424,8437,8439,8445,8482,8485,8496,8521,8603,8936,8946,9046,9050,9063,9066,9076,9092,9100,9108,9111,9113,9131,9162,9164,9218,9219,11329,11331,11334,11336,11346,11361,11363,11366,11370,11372,11375,11389,11682,11686,11687,11692,11694,11714,11716,11723,11725,11730,11736,11982,11989,12102,12336,12348,12350,12384,12393,12395,12397,12510,12553,12851,12962,12973,13738,13823,13919,13933,14080,14298,14585,14698,15583,15847,16318,16434,16438,16481,16729,17102,17122,17315,17320,17402,17418,17859,17909,17911,17915,17916,17936,17939,17961,18664,18703,18814,18962,19043,33469,33470,33471,33484,33485,33490,33497,33501,33505,33513,33520,33536,33550,37845,37921,37948,38029,38038,38064,38065,38066,38069,38075,38076,38078,39108,39109,39113,39114,39115,39116,39265,39394,189000]} \ No newline at end of file diff --git a/node_modules/mysql2/node_modules/iconv-lite/encodings/tables/gbk-added.json b/node_modules/mysql2/node_modules/iconv-lite/encodings/tables/gbk-added.json deleted file mode 100644 index b742e36..0000000 --- a/node_modules/mysql2/node_modules/iconv-lite/encodings/tables/gbk-added.json +++ /dev/null @@ -1,56 +0,0 @@ -[ -["a140","",62], -["a180","",32], -["a240","",62], -["a280","",32], -["a2ab","",5], -["a2e3","€"], -["a2ef",""], -["a2fd",""], -["a340","",62], -["a380","",31," "], -["a440","",62], -["a480","",32], -["a4f4","",10], -["a540","",62], -["a580","",32], -["a5f7","",7], -["a640","",62], -["a680","",32], -["a6b9","",7], -["a6d9","",6], -["a6ec",""], -["a6f3",""], -["a6f6","",8], -["a740","",62], -["a780","",32], -["a7c2","",14], -["a7f2","",12], -["a896","",10], -["a8bc","ḿ"], -["a8bf","ǹ"], -["a8c1",""], -["a8ea","",20], -["a958",""], -["a95b",""], -["a95d",""], -["a989","〾⿰",11], -["a997","",12], -["a9f0","",14], -["aaa1","",93], -["aba1","",93], -["aca1","",93], -["ada1","",93], -["aea1","",93], -["afa1","",93], -["d7fa","",4], -["f8a1","",93], -["f9a1","",93], -["faa1","",93], -["fba1","",93], -["fca1","",93], -["fda1","",93], -["fe50","⺁⺄㑳㑇⺈⺋㖞㘚㘎⺌⺗㥮㤘㧏㧟㩳㧐㭎㱮㳠⺧⺪䁖䅟⺮䌷⺳⺶⺷䎱䎬⺻䏝䓖䙡䙌"], -["fe80","䜣䜩䝼䞍⻊䥇䥺䥽䦂䦃䦅䦆䦟䦛䦷䦶䲣䲟䲠䲡䱷䲢䴓",6,"䶮",93], -["8135f437",""] -] diff --git a/node_modules/mysql2/node_modules/iconv-lite/encodings/tables/shiftjis.json b/node_modules/mysql2/node_modules/iconv-lite/encodings/tables/shiftjis.json deleted file mode 100644 index 5a3a43c..0000000 --- a/node_modules/mysql2/node_modules/iconv-lite/encodings/tables/shiftjis.json +++ /dev/null @@ -1,125 +0,0 @@ -[ -["0","\u0000",128], -["a1","。",62], -["8140"," 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈",9,"+-±×"], -["8180","÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇◆□■△▲▽▼※〒→←↑↓〓"], -["81b8","∈∋⊆⊇⊂⊃∪∩"], -["81c8","∧∨¬⇒⇔∀∃"], -["81da","∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬"], -["81f0","ʼn♯♭♪†‡¶"], -["81fc","◯"], -["824f","0",9], -["8260","A",25], -["8281","a",25], -["829f","ぁ",82], -["8340","ァ",62], -["8380","ム",22], -["839f","Α",16,"Σ",6], -["83bf","α",16,"σ",6], -["8440","А",5,"ЁЖ",25], -["8470","а",5,"ёж",7], -["8480","о",17], -["849f","─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂"], -["8740","①",19,"Ⅰ",9], -["875f","㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡"], -["877e","㍻"], -["8780","〝〟№㏍℡㊤",4,"㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪"], -["889f","亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭"], -["8940","院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円"], -["8980","園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改"], -["8a40","魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫"], -["8a80","橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄"], -["8b40","機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救"], -["8b80","朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈"], -["8c40","掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨"], -["8c80","劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向"], -["8d40","后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降"], -["8d80","項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷"], -["8e40","察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止"], -["8e80","死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周"], -["8f40","宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳"], -["8f80","準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾"], -["9040","拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨"], -["9080","逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線"], -["9140","繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻"], -["9180","操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只"], -["9240","叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄"], -["9280","逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓"], -["9340","邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬"], -["9380","凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入"], -["9440","如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅"], -["9480","楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美"], -["9540","鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷"], -["9580","斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋"], -["9640","法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆"], -["9680","摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒"], -["9740","諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲"], -["9780","沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯"], -["9840","蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕"], -["989f","弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲"], -["9940","僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭"], -["9980","凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨"], -["9a40","咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸"], -["9a80","噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩"], -["9b40","奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀"], -["9b80","它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏"], -["9c40","廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠"], -["9c80","怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛"], -["9d40","戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫"], -["9d80","捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼"], -["9e40","曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎"], -["9e80","梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣"], -["9f40","檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯"], -["9f80","麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌"], -["e040","漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝"], -["e080","烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱"], -["e140","瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿"], -["e180","痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬"], -["e240","磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰"], -["e280","窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆"], -["e340","紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷"], -["e380","縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋"], -["e440","隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤"], -["e480","艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈"], -["e540","蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬"], -["e580","蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞"], -["e640","襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧"], -["e680","諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊"], -["e740","蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜"], -["e780","轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮"], -["e840","錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙"], -["e880","閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰"], -["e940","顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃"], -["e980","騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈"], -["ea40","鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯"], -["ea80","黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠堯槇遙瑤凜熙"], -["ed40","纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏"], -["ed80","塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱"], -["ee40","犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙"], -["ee80","蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"], -["eeef","ⅰ",9,"¬¦'""], -["f040","",62], -["f080","",124], -["f140","",62], -["f180","",124], -["f240","",62], -["f280","",124], -["f340","",62], -["f380","",124], -["f440","",62], -["f480","",124], -["f540","",62], -["f580","",124], -["f640","",62], -["f680","",124], -["f740","",62], -["f780","",124], -["f840","",62], -["f880","",124], -["f940",""], -["fa40","ⅰ",9,"Ⅰ",9,"¬¦'"㈱№℡∵纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊"], -["fa80","兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯"], -["fb40","涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神"], -["fb80","祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙"], -["fc40","髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"] -] diff --git a/node_modules/mysql2/node_modules/iconv-lite/encodings/utf16.js b/node_modules/mysql2/node_modules/iconv-lite/encodings/utf16.js deleted file mode 100644 index 97d0669..0000000 --- a/node_modules/mysql2/node_modules/iconv-lite/encodings/utf16.js +++ /dev/null @@ -1,197 +0,0 @@ -"use strict"; -var Buffer = require("safer-buffer").Buffer; - -// Note: UTF16-LE (or UCS2) codec is Node.js native. See encodings/internal.js - -// == UTF16-BE codec. ========================================================== - -exports.utf16be = Utf16BECodec; -function Utf16BECodec() { -} - -Utf16BECodec.prototype.encoder = Utf16BEEncoder; -Utf16BECodec.prototype.decoder = Utf16BEDecoder; -Utf16BECodec.prototype.bomAware = true; - - -// -- Encoding - -function Utf16BEEncoder() { -} - -Utf16BEEncoder.prototype.write = function(str) { - var buf = Buffer.from(str, 'ucs2'); - for (var i = 0; i < buf.length; i += 2) { - var tmp = buf[i]; buf[i] = buf[i+1]; buf[i+1] = tmp; - } - return buf; -} - -Utf16BEEncoder.prototype.end = function() { -} - - -// -- Decoding - -function Utf16BEDecoder() { - this.overflowByte = -1; -} - -Utf16BEDecoder.prototype.write = function(buf) { - if (buf.length == 0) - return ''; - - var buf2 = Buffer.alloc(buf.length + 1), - i = 0, j = 0; - - if (this.overflowByte !== -1) { - buf2[0] = buf[0]; - buf2[1] = this.overflowByte; - i = 1; j = 2; - } - - for (; i < buf.length-1; i += 2, j+= 2) { - buf2[j] = buf[i+1]; - buf2[j+1] = buf[i]; - } - - this.overflowByte = (i == buf.length-1) ? buf[buf.length-1] : -1; - - return buf2.slice(0, j).toString('ucs2'); -} - -Utf16BEDecoder.prototype.end = function() { - this.overflowByte = -1; -} - - -// == UTF-16 codec ============================================================= -// Decoder chooses automatically from UTF-16LE and UTF-16BE using BOM and space-based heuristic. -// Defaults to UTF-16LE, as it's prevalent and default in Node. -// http://en.wikipedia.org/wiki/UTF-16 and http://encoding.spec.whatwg.org/#utf-16le -// Decoder default can be changed: iconv.decode(buf, 'utf16', {defaultEncoding: 'utf-16be'}); - -// Encoder uses UTF-16LE and prepends BOM (which can be overridden with addBOM: false). - -exports.utf16 = Utf16Codec; -function Utf16Codec(codecOptions, iconv) { - this.iconv = iconv; -} - -Utf16Codec.prototype.encoder = Utf16Encoder; -Utf16Codec.prototype.decoder = Utf16Decoder; - - -// -- Encoding (pass-through) - -function Utf16Encoder(options, codec) { - options = options || {}; - if (options.addBOM === undefined) - options.addBOM = true; - this.encoder = codec.iconv.getEncoder('utf-16le', options); -} - -Utf16Encoder.prototype.write = function(str) { - return this.encoder.write(str); -} - -Utf16Encoder.prototype.end = function() { - return this.encoder.end(); -} - - -// -- Decoding - -function Utf16Decoder(options, codec) { - this.decoder = null; - this.initialBufs = []; - this.initialBufsLen = 0; - - this.options = options || {}; - this.iconv = codec.iconv; -} - -Utf16Decoder.prototype.write = function(buf) { - if (!this.decoder) { - // Codec is not chosen yet. Accumulate initial bytes. - this.initialBufs.push(buf); - this.initialBufsLen += buf.length; - - if (this.initialBufsLen < 16) // We need more bytes to use space heuristic (see below) - return ''; - - // We have enough bytes -> detect endianness. - var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); - this.decoder = this.iconv.getDecoder(encoding, this.options); - - var resStr = ''; - for (var i = 0; i < this.initialBufs.length; i++) - resStr += this.decoder.write(this.initialBufs[i]); - - this.initialBufs.length = this.initialBufsLen = 0; - return resStr; - } - - return this.decoder.write(buf); -} - -Utf16Decoder.prototype.end = function() { - if (!this.decoder) { - var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); - this.decoder = this.iconv.getDecoder(encoding, this.options); - - var resStr = ''; - for (var i = 0; i < this.initialBufs.length; i++) - resStr += this.decoder.write(this.initialBufs[i]); - - var trail = this.decoder.end(); - if (trail) - resStr += trail; - - this.initialBufs.length = this.initialBufsLen = 0; - return resStr; - } - return this.decoder.end(); -} - -function detectEncoding(bufs, defaultEncoding) { - var b = []; - var charsProcessed = 0; - var asciiCharsLE = 0, asciiCharsBE = 0; // Number of ASCII chars when decoded as LE or BE. - - outer_loop: - for (var i = 0; i < bufs.length; i++) { - var buf = bufs[i]; - for (var j = 0; j < buf.length; j++) { - b.push(buf[j]); - if (b.length === 2) { - if (charsProcessed === 0) { - // Check BOM first. - if (b[0] === 0xFF && b[1] === 0xFE) return 'utf-16le'; - if (b[0] === 0xFE && b[1] === 0xFF) return 'utf-16be'; - } - - if (b[0] === 0 && b[1] !== 0) asciiCharsBE++; - if (b[0] !== 0 && b[1] === 0) asciiCharsLE++; - - b.length = 0; - charsProcessed++; - - if (charsProcessed >= 100) { - break outer_loop; - } - } - } - } - - // Make decisions. - // Most of the time, the content has ASCII chars (U+00**), but the opposite (U+**00) is uncommon. - // So, we count ASCII as if it was LE or BE, and decide from that. - if (asciiCharsBE > asciiCharsLE) return 'utf-16be'; - if (asciiCharsBE < asciiCharsLE) return 'utf-16le'; - - // Couldn't decide (likely all zeros or not enough data). - return defaultEncoding || 'utf-16le'; -} - - diff --git a/node_modules/mysql2/node_modules/iconv-lite/encodings/utf32.js b/node_modules/mysql2/node_modules/iconv-lite/encodings/utf32.js deleted file mode 100644 index 2fa900a..0000000 --- a/node_modules/mysql2/node_modules/iconv-lite/encodings/utf32.js +++ /dev/null @@ -1,319 +0,0 @@ -'use strict'; - -var Buffer = require('safer-buffer').Buffer; - -// == UTF32-LE/BE codec. ========================================================== - -exports._utf32 = Utf32Codec; - -function Utf32Codec(codecOptions, iconv) { - this.iconv = iconv; - this.bomAware = true; - this.isLE = codecOptions.isLE; -} - -exports.utf32le = { type: '_utf32', isLE: true }; -exports.utf32be = { type: '_utf32', isLE: false }; - -// Aliases -exports.ucs4le = 'utf32le'; -exports.ucs4be = 'utf32be'; - -Utf32Codec.prototype.encoder = Utf32Encoder; -Utf32Codec.prototype.decoder = Utf32Decoder; - -// -- Encoding - -function Utf32Encoder(options, codec) { - this.isLE = codec.isLE; - this.highSurrogate = 0; -} - -Utf32Encoder.prototype.write = function(str) { - var src = Buffer.from(str, 'ucs2'); - var dst = Buffer.alloc(src.length * 2); - var write32 = this.isLE ? dst.writeUInt32LE : dst.writeUInt32BE; - var offset = 0; - - for (var i = 0; i < src.length; i += 2) { - var code = src.readUInt16LE(i); - var isHighSurrogate = (0xD800 <= code && code < 0xDC00); - var isLowSurrogate = (0xDC00 <= code && code < 0xE000); - - if (this.highSurrogate) { - if (isHighSurrogate || !isLowSurrogate) { - // There shouldn't be two high surrogates in a row, nor a high surrogate which isn't followed by a low - // surrogate. If this happens, keep the pending high surrogate as a stand-alone semi-invalid character - // (technically wrong, but expected by some applications, like Windows file names). - write32.call(dst, this.highSurrogate, offset); - offset += 4; - } - else { - // Create 32-bit value from high and low surrogates; - var codepoint = (((this.highSurrogate - 0xD800) << 10) | (code - 0xDC00)) + 0x10000; - - write32.call(dst, codepoint, offset); - offset += 4; - this.highSurrogate = 0; - - continue; - } - } - - if (isHighSurrogate) - this.highSurrogate = code; - else { - // Even if the current character is a low surrogate, with no previous high surrogate, we'll - // encode it as a semi-invalid stand-alone character for the same reasons expressed above for - // unpaired high surrogates. - write32.call(dst, code, offset); - offset += 4; - this.highSurrogate = 0; - } - } - - if (offset < dst.length) - dst = dst.slice(0, offset); - - return dst; -}; - -Utf32Encoder.prototype.end = function() { - // Treat any leftover high surrogate as a semi-valid independent character. - if (!this.highSurrogate) - return; - - var buf = Buffer.alloc(4); - - if (this.isLE) - buf.writeUInt32LE(this.highSurrogate, 0); - else - buf.writeUInt32BE(this.highSurrogate, 0); - - this.highSurrogate = 0; - - return buf; -}; - -// -- Decoding - -function Utf32Decoder(options, codec) { - this.isLE = codec.isLE; - this.badChar = codec.iconv.defaultCharUnicode.charCodeAt(0); - this.overflow = []; -} - -Utf32Decoder.prototype.write = function(src) { - if (src.length === 0) - return ''; - - var i = 0; - var codepoint = 0; - var dst = Buffer.alloc(src.length + 4); - var offset = 0; - var isLE = this.isLE; - var overflow = this.overflow; - var badChar = this.badChar; - - if (overflow.length > 0) { - for (; i < src.length && overflow.length < 4; i++) - overflow.push(src[i]); - - if (overflow.length === 4) { - // NOTE: codepoint is a signed int32 and can be negative. - // NOTE: We copied this block from below to help V8 optimize it (it works with array, not buffer). - if (isLE) { - codepoint = overflow[i] | (overflow[i+1] << 8) | (overflow[i+2] << 16) | (overflow[i+3] << 24); - } else { - codepoint = overflow[i+3] | (overflow[i+2] << 8) | (overflow[i+1] << 16) | (overflow[i] << 24); - } - overflow.length = 0; - - offset = _writeCodepoint(dst, offset, codepoint, badChar); - } - } - - // Main loop. Should be as optimized as possible. - for (; i < src.length - 3; i += 4) { - // NOTE: codepoint is a signed int32 and can be negative. - if (isLE) { - codepoint = src[i] | (src[i+1] << 8) | (src[i+2] << 16) | (src[i+3] << 24); - } else { - codepoint = src[i+3] | (src[i+2] << 8) | (src[i+1] << 16) | (src[i] << 24); - } - offset = _writeCodepoint(dst, offset, codepoint, badChar); - } - - // Keep overflowing bytes. - for (; i < src.length; i++) { - overflow.push(src[i]); - } - - return dst.slice(0, offset).toString('ucs2'); -}; - -function _writeCodepoint(dst, offset, codepoint, badChar) { - // NOTE: codepoint is signed int32 and can be negative. We keep it that way to help V8 with optimizations. - if (codepoint < 0 || codepoint > 0x10FFFF) { - // Not a valid Unicode codepoint - codepoint = badChar; - } - - // Ephemeral Planes: Write high surrogate. - if (codepoint >= 0x10000) { - codepoint -= 0x10000; - - var high = 0xD800 | (codepoint >> 10); - dst[offset++] = high & 0xff; - dst[offset++] = high >> 8; - - // Low surrogate is written below. - var codepoint = 0xDC00 | (codepoint & 0x3FF); - } - - // Write BMP char or low surrogate. - dst[offset++] = codepoint & 0xff; - dst[offset++] = codepoint >> 8; - - return offset; -}; - -Utf32Decoder.prototype.end = function() { - this.overflow.length = 0; -}; - -// == UTF-32 Auto codec ============================================================= -// Decoder chooses automatically from UTF-32LE and UTF-32BE using BOM and space-based heuristic. -// Defaults to UTF-32LE. http://en.wikipedia.org/wiki/UTF-32 -// Encoder/decoder default can be changed: iconv.decode(buf, 'utf32', {defaultEncoding: 'utf-32be'}); - -// Encoder prepends BOM (which can be overridden with (addBOM: false}). - -exports.utf32 = Utf32AutoCodec; -exports.ucs4 = 'utf32'; - -function Utf32AutoCodec(options, iconv) { - this.iconv = iconv; -} - -Utf32AutoCodec.prototype.encoder = Utf32AutoEncoder; -Utf32AutoCodec.prototype.decoder = Utf32AutoDecoder; - -// -- Encoding - -function Utf32AutoEncoder(options, codec) { - options = options || {}; - - if (options.addBOM === undefined) - options.addBOM = true; - - this.encoder = codec.iconv.getEncoder(options.defaultEncoding || 'utf-32le', options); -} - -Utf32AutoEncoder.prototype.write = function(str) { - return this.encoder.write(str); -}; - -Utf32AutoEncoder.prototype.end = function() { - return this.encoder.end(); -}; - -// -- Decoding - -function Utf32AutoDecoder(options, codec) { - this.decoder = null; - this.initialBufs = []; - this.initialBufsLen = 0; - this.options = options || {}; - this.iconv = codec.iconv; -} - -Utf32AutoDecoder.prototype.write = function(buf) { - if (!this.decoder) { - // Codec is not chosen yet. Accumulate initial bytes. - this.initialBufs.push(buf); - this.initialBufsLen += buf.length; - - if (this.initialBufsLen < 32) // We need more bytes to use space heuristic (see below) - return ''; - - // We have enough bytes -> detect endianness. - var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); - this.decoder = this.iconv.getDecoder(encoding, this.options); - - var resStr = ''; - for (var i = 0; i < this.initialBufs.length; i++) - resStr += this.decoder.write(this.initialBufs[i]); - - this.initialBufs.length = this.initialBufsLen = 0; - return resStr; - } - - return this.decoder.write(buf); -}; - -Utf32AutoDecoder.prototype.end = function() { - if (!this.decoder) { - var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); - this.decoder = this.iconv.getDecoder(encoding, this.options); - - var resStr = ''; - for (var i = 0; i < this.initialBufs.length; i++) - resStr += this.decoder.write(this.initialBufs[i]); - - var trail = this.decoder.end(); - if (trail) - resStr += trail; - - this.initialBufs.length = this.initialBufsLen = 0; - return resStr; - } - - return this.decoder.end(); -}; - -function detectEncoding(bufs, defaultEncoding) { - var b = []; - var charsProcessed = 0; - var invalidLE = 0, invalidBE = 0; // Number of invalid chars when decoded as LE or BE. - var bmpCharsLE = 0, bmpCharsBE = 0; // Number of BMP chars when decoded as LE or BE. - - outer_loop: - for (var i = 0; i < bufs.length; i++) { - var buf = bufs[i]; - for (var j = 0; j < buf.length; j++) { - b.push(buf[j]); - if (b.length === 4) { - if (charsProcessed === 0) { - // Check BOM first. - if (b[0] === 0xFF && b[1] === 0xFE && b[2] === 0 && b[3] === 0) { - return 'utf-32le'; - } - if (b[0] === 0 && b[1] === 0 && b[2] === 0xFE && b[3] === 0xFF) { - return 'utf-32be'; - } - } - - if (b[0] !== 0 || b[1] > 0x10) invalidBE++; - if (b[3] !== 0 || b[2] > 0x10) invalidLE++; - - if (b[0] === 0 && b[1] === 0 && (b[2] !== 0 || b[3] !== 0)) bmpCharsBE++; - if ((b[0] !== 0 || b[1] !== 0) && b[2] === 0 && b[3] === 0) bmpCharsLE++; - - b.length = 0; - charsProcessed++; - - if (charsProcessed >= 100) { - break outer_loop; - } - } - } - } - - // Make decisions. - if (bmpCharsBE - invalidBE > bmpCharsLE - invalidLE) return 'utf-32be'; - if (bmpCharsBE - invalidBE < bmpCharsLE - invalidLE) return 'utf-32le'; - - // Couldn't decide (likely all zeros or not enough data). - return defaultEncoding || 'utf-32le'; -} diff --git a/node_modules/mysql2/node_modules/iconv-lite/encodings/utf7.js b/node_modules/mysql2/node_modules/iconv-lite/encodings/utf7.js deleted file mode 100644 index eacae34..0000000 --- a/node_modules/mysql2/node_modules/iconv-lite/encodings/utf7.js +++ /dev/null @@ -1,290 +0,0 @@ -"use strict"; -var Buffer = require("safer-buffer").Buffer; - -// UTF-7 codec, according to https://tools.ietf.org/html/rfc2152 -// See also below a UTF-7-IMAP codec, according to http://tools.ietf.org/html/rfc3501#section-5.1.3 - -exports.utf7 = Utf7Codec; -exports.unicode11utf7 = 'utf7'; // Alias UNICODE-1-1-UTF-7 -function Utf7Codec(codecOptions, iconv) { - this.iconv = iconv; -}; - -Utf7Codec.prototype.encoder = Utf7Encoder; -Utf7Codec.prototype.decoder = Utf7Decoder; -Utf7Codec.prototype.bomAware = true; - - -// -- Encoding - -var nonDirectChars = /[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g; - -function Utf7Encoder(options, codec) { - this.iconv = codec.iconv; -} - -Utf7Encoder.prototype.write = function(str) { - // Naive implementation. - // Non-direct chars are encoded as "+-"; single "+" char is encoded as "+-". - return Buffer.from(str.replace(nonDirectChars, function(chunk) { - return "+" + (chunk === '+' ? '' : - this.iconv.encode(chunk, 'utf16-be').toString('base64').replace(/=+$/, '')) - + "-"; - }.bind(this))); -} - -Utf7Encoder.prototype.end = function() { -} - - -// -- Decoding - -function Utf7Decoder(options, codec) { - this.iconv = codec.iconv; - this.inBase64 = false; - this.base64Accum = ''; -} - -var base64Regex = /[A-Za-z0-9\/+]/; -var base64Chars = []; -for (var i = 0; i < 256; i++) - base64Chars[i] = base64Regex.test(String.fromCharCode(i)); - -var plusChar = '+'.charCodeAt(0), - minusChar = '-'.charCodeAt(0), - andChar = '&'.charCodeAt(0); - -Utf7Decoder.prototype.write = function(buf) { - var res = "", lastI = 0, - inBase64 = this.inBase64, - base64Accum = this.base64Accum; - - // The decoder is more involved as we must handle chunks in stream. - - for (var i = 0; i < buf.length; i++) { - if (!inBase64) { // We're in direct mode. - // Write direct chars until '+' - if (buf[i] == plusChar) { - res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars. - lastI = i+1; - inBase64 = true; - } - } else { // We decode base64. - if (!base64Chars[buf[i]]) { // Base64 ended. - if (i == lastI && buf[i] == minusChar) {// "+-" -> "+" - res += "+"; - } else { - var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii"); - res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); - } - - if (buf[i] != minusChar) // Minus is absorbed after base64. - i--; - - lastI = i+1; - inBase64 = false; - base64Accum = ''; - } - } - } - - if (!inBase64) { - res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars. - } else { - var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii"); - - var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. - base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future. - b64str = b64str.slice(0, canBeDecoded); - - res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); - } - - this.inBase64 = inBase64; - this.base64Accum = base64Accum; - - return res; -} - -Utf7Decoder.prototype.end = function() { - var res = ""; - if (this.inBase64 && this.base64Accum.length > 0) - res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be"); - - this.inBase64 = false; - this.base64Accum = ''; - return res; -} - - -// UTF-7-IMAP codec. -// RFC3501 Sec. 5.1.3 Modified UTF-7 (http://tools.ietf.org/html/rfc3501#section-5.1.3) -// Differences: -// * Base64 part is started by "&" instead of "+" -// * Direct characters are 0x20-0x7E, except "&" (0x26) -// * In Base64, "," is used instead of "/" -// * Base64 must not be used to represent direct characters. -// * No implicit shift back from Base64 (should always end with '-') -// * String must end in non-shifted position. -// * "-&" while in base64 is not allowed. - - -exports.utf7imap = Utf7IMAPCodec; -function Utf7IMAPCodec(codecOptions, iconv) { - this.iconv = iconv; -}; - -Utf7IMAPCodec.prototype.encoder = Utf7IMAPEncoder; -Utf7IMAPCodec.prototype.decoder = Utf7IMAPDecoder; -Utf7IMAPCodec.prototype.bomAware = true; - - -// -- Encoding - -function Utf7IMAPEncoder(options, codec) { - this.iconv = codec.iconv; - this.inBase64 = false; - this.base64Accum = Buffer.alloc(6); - this.base64AccumIdx = 0; -} - -Utf7IMAPEncoder.prototype.write = function(str) { - var inBase64 = this.inBase64, - base64Accum = this.base64Accum, - base64AccumIdx = this.base64AccumIdx, - buf = Buffer.alloc(str.length*5 + 10), bufIdx = 0; - - for (var i = 0; i < str.length; i++) { - var uChar = str.charCodeAt(i); - if (0x20 <= uChar && uChar <= 0x7E) { // Direct character or '&'. - if (inBase64) { - if (base64AccumIdx > 0) { - bufIdx += buf.write(base64Accum.slice(0, base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx); - base64AccumIdx = 0; - } - - buf[bufIdx++] = minusChar; // Write '-', then go to direct mode. - inBase64 = false; - } - - if (!inBase64) { - buf[bufIdx++] = uChar; // Write direct character - - if (uChar === andChar) // Ampersand -> '&-' - buf[bufIdx++] = minusChar; - } - - } else { // Non-direct character - if (!inBase64) { - buf[bufIdx++] = andChar; // Write '&', then go to base64 mode. - inBase64 = true; - } - if (inBase64) { - base64Accum[base64AccumIdx++] = uChar >> 8; - base64Accum[base64AccumIdx++] = uChar & 0xFF; - - if (base64AccumIdx == base64Accum.length) { - bufIdx += buf.write(base64Accum.toString('base64').replace(/\//g, ','), bufIdx); - base64AccumIdx = 0; - } - } - } - } - - this.inBase64 = inBase64; - this.base64AccumIdx = base64AccumIdx; - - return buf.slice(0, bufIdx); -} - -Utf7IMAPEncoder.prototype.end = function() { - var buf = Buffer.alloc(10), bufIdx = 0; - if (this.inBase64) { - if (this.base64AccumIdx > 0) { - bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx); - this.base64AccumIdx = 0; - } - - buf[bufIdx++] = minusChar; // Write '-', then go to direct mode. - this.inBase64 = false; - } - - return buf.slice(0, bufIdx); -} - - -// -- Decoding - -function Utf7IMAPDecoder(options, codec) { - this.iconv = codec.iconv; - this.inBase64 = false; - this.base64Accum = ''; -} - -var base64IMAPChars = base64Chars.slice(); -base64IMAPChars[','.charCodeAt(0)] = true; - -Utf7IMAPDecoder.prototype.write = function(buf) { - var res = "", lastI = 0, - inBase64 = this.inBase64, - base64Accum = this.base64Accum; - - // The decoder is more involved as we must handle chunks in stream. - // It is forgiving, closer to standard UTF-7 (for example, '-' is optional at the end). - - for (var i = 0; i < buf.length; i++) { - if (!inBase64) { // We're in direct mode. - // Write direct chars until '&' - if (buf[i] == andChar) { - res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars. - lastI = i+1; - inBase64 = true; - } - } else { // We decode base64. - if (!base64IMAPChars[buf[i]]) { // Base64 ended. - if (i == lastI && buf[i] == minusChar) { // "&-" -> "&" - res += "&"; - } else { - var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii").replace(/,/g, '/'); - res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); - } - - if (buf[i] != minusChar) // Minus may be absorbed after base64. - i--; - - lastI = i+1; - inBase64 = false; - base64Accum = ''; - } - } - } - - if (!inBase64) { - res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars. - } else { - var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii").replace(/,/g, '/'); - - var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. - base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future. - b64str = b64str.slice(0, canBeDecoded); - - res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); - } - - this.inBase64 = inBase64; - this.base64Accum = base64Accum; - - return res; -} - -Utf7IMAPDecoder.prototype.end = function() { - var res = ""; - if (this.inBase64 && this.base64Accum.length > 0) - res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be"); - - this.inBase64 = false; - this.base64Accum = ''; - return res; -} - - diff --git a/node_modules/mysql2/node_modules/iconv-lite/lib/bom-handling.js b/node_modules/mysql2/node_modules/iconv-lite/lib/bom-handling.js deleted file mode 100644 index 1050872..0000000 --- a/node_modules/mysql2/node_modules/iconv-lite/lib/bom-handling.js +++ /dev/null @@ -1,52 +0,0 @@ -"use strict"; - -var BOMChar = '\uFEFF'; - -exports.PrependBOM = PrependBOMWrapper -function PrependBOMWrapper(encoder, options) { - this.encoder = encoder; - this.addBOM = true; -} - -PrependBOMWrapper.prototype.write = function(str) { - if (this.addBOM) { - str = BOMChar + str; - this.addBOM = false; - } - - return this.encoder.write(str); -} - -PrependBOMWrapper.prototype.end = function() { - return this.encoder.end(); -} - - -//------------------------------------------------------------------------------ - -exports.StripBOM = StripBOMWrapper; -function StripBOMWrapper(decoder, options) { - this.decoder = decoder; - this.pass = false; - this.options = options || {}; -} - -StripBOMWrapper.prototype.write = function(buf) { - var res = this.decoder.write(buf); - if (this.pass || !res) - return res; - - if (res[0] === BOMChar) { - res = res.slice(1); - if (typeof this.options.stripBOM === 'function') - this.options.stripBOM(); - } - - this.pass = true; - return res; -} - -StripBOMWrapper.prototype.end = function() { - return this.decoder.end(); -} - diff --git a/node_modules/mysql2/node_modules/iconv-lite/lib/index.d.ts b/node_modules/mysql2/node_modules/iconv-lite/lib/index.d.ts deleted file mode 100644 index 99f200f..0000000 --- a/node_modules/mysql2/node_modules/iconv-lite/lib/index.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. - * REQUIREMENT: This definition is dependent on the @types/node definition. - * Install with `npm install @types/node --save-dev` - *--------------------------------------------------------------------------------------------*/ - -declare module 'iconv-lite' { - // Basic API - export function decode(buffer: Buffer, encoding: string, options?: Options): string; - - export function encode(content: string, encoding: string, options?: Options): Buffer; - - export function encodingExists(encoding: string): boolean; - - // Stream API - export function decodeStream(encoding: string, options?: Options): NodeJS.ReadWriteStream; - - export function encodeStream(encoding: string, options?: Options): NodeJS.ReadWriteStream; - - // Low-level stream APIs - export function getEncoder(encoding: string, options?: Options): EncoderStream; - - export function getDecoder(encoding: string, options?: Options): DecoderStream; -} - -export interface Options { - stripBOM?: boolean; - addBOM?: boolean; - defaultEncoding?: string; -} - -export interface EncoderStream { - write(str: string): Buffer; - end(): Buffer | undefined; -} - -export interface DecoderStream { - write(buf: Buffer): string; - end(): string | undefined; -} diff --git a/node_modules/mysql2/node_modules/iconv-lite/lib/index.js b/node_modules/mysql2/node_modules/iconv-lite/lib/index.js deleted file mode 100644 index 657701c..0000000 --- a/node_modules/mysql2/node_modules/iconv-lite/lib/index.js +++ /dev/null @@ -1,180 +0,0 @@ -"use strict"; - -var Buffer = require("safer-buffer").Buffer; - -var bomHandling = require("./bom-handling"), - iconv = module.exports; - -// All codecs and aliases are kept here, keyed by encoding name/alias. -// They are lazy loaded in `iconv.getCodec` from `encodings/index.js`. -iconv.encodings = null; - -// Characters emitted in case of error. -iconv.defaultCharUnicode = '�'; -iconv.defaultCharSingleByte = '?'; - -// Public API. -iconv.encode = function encode(str, encoding, options) { - str = "" + (str || ""); // Ensure string. - - var encoder = iconv.getEncoder(encoding, options); - - var res = encoder.write(str); - var trail = encoder.end(); - - return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res; -} - -iconv.decode = function decode(buf, encoding, options) { - if (typeof buf === 'string') { - if (!iconv.skipDecodeWarning) { - console.error('Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding'); - iconv.skipDecodeWarning = true; - } - - buf = Buffer.from("" + (buf || ""), "binary"); // Ensure buffer. - } - - var decoder = iconv.getDecoder(encoding, options); - - var res = decoder.write(buf); - var trail = decoder.end(); - - return trail ? (res + trail) : res; -} - -iconv.encodingExists = function encodingExists(enc) { - try { - iconv.getCodec(enc); - return true; - } catch (e) { - return false; - } -} - -// Legacy aliases to convert functions -iconv.toEncoding = iconv.encode; -iconv.fromEncoding = iconv.decode; - -// Search for a codec in iconv.encodings. Cache codec data in iconv._codecDataCache. -iconv._codecDataCache = {}; -iconv.getCodec = function getCodec(encoding) { - if (!iconv.encodings) - iconv.encodings = require("../encodings"); // Lazy load all encoding definitions. - - // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. - var enc = iconv._canonicalizeEncoding(encoding); - - // Traverse iconv.encodings to find actual codec. - var codecOptions = {}; - while (true) { - var codec = iconv._codecDataCache[enc]; - if (codec) - return codec; - - var codecDef = iconv.encodings[enc]; - - switch (typeof codecDef) { - case "string": // Direct alias to other encoding. - enc = codecDef; - break; - - case "object": // Alias with options. Can be layered. - for (var key in codecDef) - codecOptions[key] = codecDef[key]; - - if (!codecOptions.encodingName) - codecOptions.encodingName = enc; - - enc = codecDef.type; - break; - - case "function": // Codec itself. - if (!codecOptions.encodingName) - codecOptions.encodingName = enc; - - // The codec function must load all tables and return object with .encoder and .decoder methods. - // It'll be called only once (for each different options object). - codec = new codecDef(codecOptions, iconv); - - iconv._codecDataCache[codecOptions.encodingName] = codec; // Save it to be reused later. - return codec; - - default: - throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '"+enc+"')"); - } - } -} - -iconv._canonicalizeEncoding = function(encoding) { - // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. - return (''+encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, ""); -} - -iconv.getEncoder = function getEncoder(encoding, options) { - var codec = iconv.getCodec(encoding), - encoder = new codec.encoder(options, codec); - - if (codec.bomAware && options && options.addBOM) - encoder = new bomHandling.PrependBOM(encoder, options); - - return encoder; -} - -iconv.getDecoder = function getDecoder(encoding, options) { - var codec = iconv.getCodec(encoding), - decoder = new codec.decoder(options, codec); - - if (codec.bomAware && !(options && options.stripBOM === false)) - decoder = new bomHandling.StripBOM(decoder, options); - - return decoder; -} - -// Streaming API -// NOTE: Streaming API naturally depends on 'stream' module from Node.js. Unfortunately in browser environments this module can add -// up to 100Kb to the output bundle. To avoid unnecessary code bloat, we don't enable Streaming API in browser by default. -// If you would like to enable it explicitly, please add the following code to your app: -// > iconv.enableStreamingAPI(require('stream')); -iconv.enableStreamingAPI = function enableStreamingAPI(stream_module) { - if (iconv.supportsStreams) - return; - - // Dependency-inject stream module to create IconvLite stream classes. - var streams = require("./streams")(stream_module); - - // Not public API yet, but expose the stream classes. - iconv.IconvLiteEncoderStream = streams.IconvLiteEncoderStream; - iconv.IconvLiteDecoderStream = streams.IconvLiteDecoderStream; - - // Streaming API. - iconv.encodeStream = function encodeStream(encoding, options) { - return new iconv.IconvLiteEncoderStream(iconv.getEncoder(encoding, options), options); - } - - iconv.decodeStream = function decodeStream(encoding, options) { - return new iconv.IconvLiteDecoderStream(iconv.getDecoder(encoding, options), options); - } - - iconv.supportsStreams = true; -} - -// Enable Streaming API automatically if 'stream' module is available and non-empty (the majority of environments). -var stream_module; -try { - stream_module = require("stream"); -} catch (e) {} - -if (stream_module && stream_module.Transform) { - iconv.enableStreamingAPI(stream_module); - -} else { - // In rare cases where 'stream' module is not available by default, throw a helpful exception. - iconv.encodeStream = iconv.decodeStream = function() { - throw new Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it."); - }; -} - -if ("Ā" != "\u0100") { - console.error("iconv-lite warning: js files use non-utf8 encoding. See https://github.com/ashtuchkin/iconv-lite/wiki/Javascript-source-file-encodings for more info."); -} diff --git a/node_modules/mysql2/node_modules/iconv-lite/lib/streams.js b/node_modules/mysql2/node_modules/iconv-lite/lib/streams.js deleted file mode 100644 index a150648..0000000 --- a/node_modules/mysql2/node_modules/iconv-lite/lib/streams.js +++ /dev/null @@ -1,109 +0,0 @@ -"use strict"; - -var Buffer = require("safer-buffer").Buffer; - -// NOTE: Due to 'stream' module being pretty large (~100Kb, significant in browser environments), -// we opt to dependency-inject it instead of creating a hard dependency. -module.exports = function(stream_module) { - var Transform = stream_module.Transform; - - // == Encoder stream ======================================================= - - function IconvLiteEncoderStream(conv, options) { - this.conv = conv; - options = options || {}; - options.decodeStrings = false; // We accept only strings, so we don't need to decode them. - Transform.call(this, options); - } - - IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, { - constructor: { value: IconvLiteEncoderStream } - }); - - IconvLiteEncoderStream.prototype._transform = function(chunk, encoding, done) { - if (typeof chunk != 'string') - return done(new Error("Iconv encoding stream needs strings as its input.")); - try { - var res = this.conv.write(chunk); - if (res && res.length) this.push(res); - done(); - } - catch (e) { - done(e); - } - } - - IconvLiteEncoderStream.prototype._flush = function(done) { - try { - var res = this.conv.end(); - if (res && res.length) this.push(res); - done(); - } - catch (e) { - done(e); - } - } - - IconvLiteEncoderStream.prototype.collect = function(cb) { - var chunks = []; - this.on('error', cb); - this.on('data', function(chunk) { chunks.push(chunk); }); - this.on('end', function() { - cb(null, Buffer.concat(chunks)); - }); - return this; - } - - - // == Decoder stream ======================================================= - - function IconvLiteDecoderStream(conv, options) { - this.conv = conv; - options = options || {}; - options.encoding = this.encoding = 'utf8'; // We output strings. - Transform.call(this, options); - } - - IconvLiteDecoderStream.prototype = Object.create(Transform.prototype, { - constructor: { value: IconvLiteDecoderStream } - }); - - IconvLiteDecoderStream.prototype._transform = function(chunk, encoding, done) { - if (!Buffer.isBuffer(chunk) && !(chunk instanceof Uint8Array)) - return done(new Error("Iconv decoding stream needs buffers as its input.")); - try { - var res = this.conv.write(chunk); - if (res && res.length) this.push(res, this.encoding); - done(); - } - catch (e) { - done(e); - } - } - - IconvLiteDecoderStream.prototype._flush = function(done) { - try { - var res = this.conv.end(); - if (res && res.length) this.push(res, this.encoding); - done(); - } - catch (e) { - done(e); - } - } - - IconvLiteDecoderStream.prototype.collect = function(cb) { - var res = ''; - this.on('error', cb); - this.on('data', function(chunk) { res += chunk; }); - this.on('end', function() { - cb(null, res); - }); - return this; - } - - return { - IconvLiteEncoderStream: IconvLiteEncoderStream, - IconvLiteDecoderStream: IconvLiteDecoderStream, - }; -}; diff --git a/node_modules/mysql2/node_modules/iconv-lite/package.json b/node_modules/mysql2/node_modules/iconv-lite/package.json deleted file mode 100644 index d351115..0000000 --- a/node_modules/mysql2/node_modules/iconv-lite/package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "iconv-lite", - "description": "Convert character encodings in pure javascript.", - "version": "0.6.3", - "license": "MIT", - "keywords": [ - "iconv", - "convert", - "charset", - "icu" - ], - "author": "Alexander Shtuchkin ", - "main": "./lib/index.js", - "typings": "./lib/index.d.ts", - "homepage": "https://github.com/ashtuchkin/iconv-lite", - "bugs": "https://github.com/ashtuchkin/iconv-lite/issues", - "repository": { - "type": "git", - "url": "git://github.com/ashtuchkin/iconv-lite.git" - }, - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "coverage": "c8 _mocha --grep .", - "test": "mocha --reporter spec --grep ." - }, - "browser": { - "stream": false - }, - "devDependencies": { - "async": "^3.2.0", - "c8": "^7.2.0", - "errto": "^0.2.1", - "iconv": "^2.3.5", - "mocha": "^3.5.3", - "request": "^2.88.2", - "semver": "^6.3.0", - "unorm": "^1.6.0" - }, - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - } -} diff --git a/node_modules/mysql2/node_modules/lru-cache/LICENSE b/node_modules/mysql2/node_modules/lru-cache/LICENSE deleted file mode 100644 index f785757..0000000 --- a/node_modules/mysql2/node_modules/lru-cache/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) 2010-2023 Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/mysql2/node_modules/lru-cache/README.md b/node_modules/mysql2/node_modules/lru-cache/README.md deleted file mode 100644 index bd86f4e..0000000 --- a/node_modules/mysql2/node_modules/lru-cache/README.md +++ /dev/null @@ -1,1180 +0,0 @@ -# lru-cache - -A cache object that deletes the least-recently-used items. - -Specify a max number of the most recently used items that you -want to keep, and this cache will keep that many of the most -recently accessed items. - -This is not primarily a TTL cache, and does not make strong TTL -guarantees. There is no preemptive pruning of expired items by -default, but you _may_ set a TTL on the cache or on a single -`set`. If you do so, it will treat expired items as missing, and -delete them when fetched. If you are more interested in TTL -caching than LRU caching, check out -[@isaacs/ttlcache](http://npm.im/@isaacs/ttlcache). - -As of version 7, this is one of the most performant LRU -implementations available in JavaScript, and supports a wide -diversity of use cases. However, note that using some of the -features will necessarily impact performance, by causing the -cache to have to do more work. See the "Performance" section -below. - -## Installation - -```bash -npm install lru-cache --save -``` - -## Usage - -```js -// hybrid module, either works -import LRUCache from 'lru-cache' -// or: -const LRUCache = require('lru-cache') -// or in minified form for web browsers: -import LRUCache from 'http://unpkg.com/lru-cache@8/dist/mjs/index.min.mjs' - -// At least one of 'max', 'ttl', or 'maxSize' is required, to prevent -// unsafe unbounded storage. -// -// In most cases, it's best to specify a max for performance, so all -// the required memory allocation is done up-front. -// -// All the other options are optional, see the sections below for -// documentation on what each one does. Most of them can be -// overridden for specific items in get()/set() -const options = { - max: 500, - - // for use with tracking overall storage size - maxSize: 5000, - sizeCalculation: (value, key) => { - return 1 - }, - - // for use when you need to clean up something when objects - // are evicted from the cache - dispose: (value, key) => { - freeFromMemoryOrWhatever(value) - }, - - // how long to live in ms - ttl: 1000 * 60 * 5, - - // return stale items before removing from cache? - allowStale: false, - - updateAgeOnGet: false, - updateAgeOnHas: false, - - // async method to use for cache.fetch(), for - // stale-while-revalidate type of behavior - fetchMethod: async ( - key, - staleValue, - { options, signal, context } - ) => {}, -} - -const cache = new LRUCache(options) - -cache.set('key', 'value') -cache.get('key') // "value" - -// non-string keys ARE fully supported -// but note that it must be THE SAME object, not -// just a JSON-equivalent object. -var someObject = { a: 1 } -cache.set(someObject, 'a value') -// Object keys are not toString()-ed -cache.set('[object Object]', 'a different value') -assert.equal(cache.get(someObject), 'a value') -// A similar object with same keys/values won't work, -// because it's a different object identity -assert.equal(cache.get({ a: 1 }), undefined) - -cache.clear() // empty the cache -``` - -If you put more stuff in the cache, then less recently used items -will fall out. That's what an LRU cache is. - -## `class LRUCache(options)` - -Create a new `LRUCache` object. - -When using TypeScript, set the `K` and `V` types to the `key` and -`value` types, respectively. - -The `FC` ("fetch context") generic type defaults to `unknown`. -If set to a value other than `void` or `undefined`, then any -calls to `cache.fetch()` _must_ provide a `context` option -matching the `FC` type. If `FC` is set to `void` or `undefined`, -then `cache.fetch()` _must not_ provide a `context` option. See -the documentation on `async fetch()` below. - -## Options - -All options are available on the LRUCache instance, making it -safe to pass an LRUCache instance as the options argument to make -another empty cache of the same type. - -Some options are marked read-only because changing them after -instantiation is not safe. Changing any of the other options -will of course only have an effect on subsequent method calls. - -### `max` (read only) - -The maximum number of items that remain in the cache (assuming no -TTL pruning or explicit deletions). Note that fewer items may be -stored if size calculation is used, and `maxSize` is exceeded. -This must be a positive finite intger. - -At least one of `max`, `maxSize`, or `TTL` is required. This -must be a positive integer if set. - -**It is strongly recommended to set a `max` to prevent unbounded -growth of the cache.** See "Storage Bounds Safety" below. - -### `maxSize` (read only) - -Set to a positive integer to track the sizes of items added to -the cache, and automatically evict items in order to stay below -this size. Note that this may result in fewer than `max` items -being stored. - -Attempting to add an item to the cache whose calculated size is -greater that this amount will be a no-op. The item will not be -cached, and no other items will be evicted. - -Optional, must be a positive integer if provided. - -Sets `maxEntrySize` to the same value, unless a different value -is provided for `maxEntrySize`. - -At least one of `max`, `maxSize`, or `TTL` is required. This -must be a positive integer if set. - -Even if size tracking is enabled, **it is strongly recommended to -set a `max` to prevent unbounded growth of the cache.** See -"Storage Bounds Safety" below. - -### `maxEntrySize` - -Set to a positive integer to track the sizes of items added to -the cache, and prevent caching any item over a given size. -Attempting to add an item whose calculated size is greater than -this amount will be a no-op. The item will not be cached, and no -other items will be evicted. - -Optional, must be a positive integer if provided. Defaults to -the value of `maxSize` if provided. - -### `sizeCalculation` - -Function used to calculate the size of stored items. If you're -storing strings or buffers, then you probably want to do -something like `n => n.length`. The item is passed as the first -argument, and the key is passed as the second argument. - -This may be overridden by passing an options object to -`cache.set()`. - -Requires `maxSize` to be set. - -If the `size` (or return value of `sizeCalculation`) for a given -entry is greater than `maxEntrySize`, then the item will not be -added to the cache. - -### `fetchMethod` (read only) - -Function that is used to make background asynchronous fetches. -Called with `fetchMethod(key, staleValue, { signal, options, -context })`. May return a Promise. - -If `fetchMethod` is not provided, then `cache.fetch(key)` is -equivalent to `Promise.resolve(cache.get(key))`. - -If at any time, `signal.aborted` is set to `true`, or if the -`signal.onabort` method is called, or if it emits an `'abort'` -event which you can listen to with `addEventListener`, then that -means that the fetch should be abandoned. This may be passed -along to async functions aware of AbortController/AbortSignal -behavior. - -The `fetchMethod` should **only** return `undefined` or a Promise -resolving to `undefined` if the AbortController signaled an -`abort` event. In all other cases, it should return or resolve -to a value suitable for adding to the cache. - -The `options` object is a union of the options that may be -provided to `set()` and `get()`. If they are modified, then that -will result in modifying the settings to `cache.set()` when the -value is resolved, and in the case of `noDeleteOnFetchRejection` -and `allowStaleOnFetchRejection`, the handling of `fetchMethod` -failures. - -For example, a DNS cache may update the TTL based on the value -returned from a remote DNS server by changing `options.ttl` in -the `fetchMethod`. - -### `noDeleteOnFetchRejection` - -If a `fetchMethod` throws an error or returns a rejected promise, -then by default, any existing stale value will be removed from -the cache. - -If `noDeleteOnFetchRejection` is set to `true`, then this -behavior is suppressed, and the stale value remains in the cache -in the case of a rejected `fetchMethod`. - -This is important in cases where a `fetchMethod` is _only_ called -as a background update while the stale value is returned, when -`allowStale` is used. - -This is implicitly in effect when `allowStaleOnFetchRejection` is -set. - -This may be set in calls to `fetch()`, or defaulted on the -constructor, or overridden by modifying the options object in the -`fetchMethod`. - -### `allowStaleOnFetchRejection` - -Set to true to return a stale value from the cache when a -`fetchMethod` throws an error or returns a rejected Promise. - -If a `fetchMethod` fails, and there is no stale value available, -the `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` -errors are suppressed. - -Implies `noDeleteOnFetchRejection`. - -This may be set in calls to `fetch()`, or defaulted on the -constructor, or overridden by modifying the options object in the -`fetchMethod`. - -### `allowStaleOnFetchAbort` - -Set to true to return a stale value from the cache when the -`AbortSignal` passed to the `fetchMethod` dispatches an `'abort'` -event, whether user-triggered, or due to internal cache behavior. - -Unless `ignoreFetchAbort` is also set, the underlying -`fetchMethod` will still be considered canceled, and its return -value will be ignored and not cached. - -### `ignoreFetchAbort` - -Set to true to ignore the `abort` event emitted by the -`AbortSignal` object passed to `fetchMethod`, and still cache the -resulting resolution value, as long as it is not `undefined`. - -When used on its own, this means aborted `fetch()` calls are not -immediately resolved or rejected when they are aborted, and -instead take the full time to await. - -When used with `allowStaleOnFetchAbort`, aborted `fetch()` calls -will resolve immediately to their stale cached value or -`undefined`, and will continue to process and eventually update -the cache when they resolve, as long as the resulting value is -not `undefined`, thus supporting a "return stale on timeout while -refreshing" mechanism by passing `AbortSignal.timeout(n)` as the -signal. - -For example: - -```js -const c = new LRUCache({ - ttl: 100, - ignoreFetchAbort: true, - allowStaleOnFetchAbort: true, - fetchMethod: async (key, oldValue, { signal }) => { - // note: do NOT pass the signal to fetch()! - // let's say this fetch can take a long time. - const res = await fetch(`https://slow-backend-server/${key}`) - return await res.json() - }, -}) - -// this will return the stale value after 100ms, while still -// updating in the background for next time. -const val = await c.fetch('key', { signal: AbortSignal.timeout(100) }) -``` - -**Note**: regardless of this setting, an `abort` event _is still -emitted on the `AbortSignal` object_, so may result in invalid -results when passed to other underlying APIs that use -AbortSignals. - -This may be overridden on the `fetch()` call or in the -`fetchMethod` itself. - -### `dispose` (read only) - -Function that is called on items when they are dropped from the -cache, as `this.dispose(value, key, reason)`. - -This can be handy if you want to close file descriptors or do -other cleanup tasks when items are no longer stored in the cache. - -**NOTE**: It is called _before_ the item has been fully removed -from the cache, so if you want to put it right back in, you need -to wait until the next tick. If you try to add it back in during -the `dispose()` function call, it will break things in subtle and -weird ways. - -Unlike several other options, this may _not_ be overridden by -passing an option to `set()`, for performance reasons. - -The `reason` will be one of the following strings, corresponding -to the reason for the item's deletion: - -- `evict` Item was evicted to make space for a new addition -- `set` Item was overwritten by a new value -- `delete` Item was removed by explicit `cache.delete(key)` or by - calling `cache.clear()`, which deletes everything. - -The `dispose()` method is _not_ called for canceled calls to -`fetchMethod()`. If you wish to handle evictions, overwrites, -and deletes of in-flight asynchronous fetches, you must use the -`AbortSignal` provided. - -Optional, must be a function. - -### `disposeAfter` (read only) - -The same as `dispose`, but called _after_ the entry is completely -removed and the cache is once again in a clean state. - -It is safe to add an item right back into the cache at this -point. However, note that it is _very_ easy to inadvertently -create infinite recursion in this way. - -The `disposeAfter()` method is _not_ called for canceled calls to -`fetchMethod()`. If you wish to handle evictions, overwrites, -and deletes of in-flight asynchronous fetches, you must use the -`AbortSignal` provided. - -### `noDisposeOnSet` - -Set to `true` to suppress calling the `dispose()` function if the -entry key is still accessible within the cache. - -This may be overridden by passing an options object to -`cache.set()`. - -Boolean, default `false`. Only relevant if `dispose` or -`disposeAfter` options are set. - -### `ttl` - -Max time to live for items before they are considered stale. -Note that stale items are NOT preemptively removed by default, -and MAY live in the cache, contributing to its LRU max, long -after they have expired. - -Also, as this cache is optimized for LRU/MRU operations, some of -the staleness/TTL checks will reduce performance. - -This is not primarily a TTL cache, and does not make strong TTL -guarantees. There is no pre-emptive pruning of expired items, -but you _may_ set a TTL on the cache, and it will treat expired -items as missing when they are fetched, and delete them. - -Optional, but must be a positive integer in ms if specified. - -This may be overridden by passing an options object to -`cache.set()`. - -At least one of `max`, `maxSize`, or `TTL` is required. This -must be a positive integer if set. - -Even if ttl tracking is enabled, **it is strongly recommended to -set a `max` to prevent unbounded growth of the cache.** See -"Storage Bounds Safety" below. - -If ttl tracking is enabled, and `max` and `maxSize` are not set, -and `ttlAutopurge` is not set, then a warning will be emitted -cautioning about the potential for unbounded memory consumption. -(The TypeScript definitions will also discourage this.) - -### `noUpdateTTL` - -Boolean flag to tell the cache to not update the TTL when setting -a new value for an existing key (ie, when updating a value rather -than inserting a new value). Note that the TTL value is _always_ -set (if provided) when adding a new entry into the cache. - -This may be passed as an option to `cache.set()`. - -Boolean, default false. - -### `ttlResolution` - -Minimum amount of time in ms in which to check for staleness. -Defaults to `1`, which means that the current time is checked at -most once per millisecond. - -Set to `0` to check the current time every time staleness is -tested. - -Note that setting this to a higher value _will_ improve -performance somewhat while using ttl tracking, albeit at the -expense of keeping stale items around a bit longer than intended. - -### `ttlAutopurge` - -Preemptively remove stale items from the cache. - -Note that this may _significantly_ degrade performance, -especially if the cache is storing a large number of items. It -is almost always best to just leave the stale items in the cache, -and let them fall out as new items are added. - -Note that this means that `allowStale` is a bit pointless, as -stale items will be deleted almost as soon as they expire. - -Use with caution! - -Boolean, default `false` - -### `allowStale` - -By default, if you set `ttl`, it'll only delete stale items from -the cache when you `get(key)`. That is, it's not preemptively -pruning items. - -If you set `allowStale:true`, it'll return the stale value as -well as deleting it. If you don't set this, then it'll return -`undefined` when you try to get a stale entry. - -Note that when a stale entry is fetched, _even if it is returned -due to `allowStale` being set_, it is removed from the cache -immediately. You can immediately put it back in the cache if you -wish, thus resetting the TTL. - -This may be overridden by passing an options object to -`cache.get()`. The `cache.has()` method will always return -`false` for stale items. - -Boolean, default false, only relevant if `ttl` is set. - -### `noDeleteOnStaleGet` - -When using time-expiring entries with `ttl`, by default stale -items will be removed from the cache when the key is accessed -with `cache.get()`. - -Setting `noDeleteOnStaleGet` to `true` will cause stale items to -remain in the cache, until they are explicitly deleted with -`cache.delete(key)`, or retrieved with `noDeleteOnStaleGet` set -to `false`. - -This may be overridden by passing an options object to -`cache.get()`. - -Boolean, default false, only relevant if `ttl` is set. - -### `updateAgeOnGet` - -When using time-expiring entries with `ttl`, setting this to -`true` will make each item's age reset to 0 whenever it is -retrieved from cache with `get()`, causing it to not expire. (It -can still fall out of cache based on recency of use, of course.) - -This may be overridden by passing an options object to -`cache.get()`. - -Boolean, default false, only relevant if `ttl` is set. - -### `updateAgeOnHas` - -When using time-expiring entries with `ttl`, setting this to -`true` will make each item's age reset to 0 whenever its presence -in the cache is checked with `has()`, causing it to not expire. -(It can still fall out of cache based on recency of use, of -course.) - -This may be overridden by passing an options object to -`cache.has()`. - -Boolean, default false, only relevant if `ttl` is set. - -## API - -### `new LRUCache(options)` - -Create a new LRUCache. All options are documented above, and are -on the cache as public members. - -The `K` and `V` types define the key and value types, -respectively. The optional `FC` type defines the type of the -`context` object passed to `cache.fetch()`. - -Keys and values **must not** be `null` or `undefined`. - -### `cache.max`, `cache.maxSize`, `cache.allowStale`, - -`cache.noDisposeOnSet`, `cache.sizeCalculation`, `cache.dispose`, -`cache.maxSize`, `cache.ttl`, `cache.updateAgeOnGet`, -`cache.updateAgeOnHas` - -All option names are exposed as public members on the cache -object. - -These are intended for read access only. Changing them during -program operation can cause undefined behavior. - -### `cache.size` - -The total number of items held in the cache at the current -moment. - -### `cache.calculatedSize` - -The total size of items in cache when using size tracking. - -### `set(key, value, [{ size, sizeCalculation, ttl, noDisposeOnSet, start, status }])` - -Add a value to the cache. - -Optional options object may contain `ttl` and `sizeCalculation` -as described above, which default to the settings on the cache -object. - -If `start` is provided, then that will set the effective start -time for the TTL calculation. Note that this must be a previous -value of `performance.now()` if supported, or a previous value of -`Date.now()` if not. - -Options object may also include `size`, which will prevent -calling the `sizeCalculation` function and just use the specified -number if it is a positive integer, and `noDisposeOnSet` which -will prevent calling a `dispose` function in the case of -overwrites. - -If the `size` (or return value of `sizeCalculation`) for a given -entry is greater than `maxEntrySize`, then the item will not be -added to the cache. - -Will update the recency of the entry. - -Returns the cache object. - -For the usage of the `status` option, see **Status Tracking** -below. - -### `get(key, { updateAgeOnGet, allowStale, status } = {}) => value` - -Return a value from the cache. - -Will update the recency of the cache entry found. - -If the key is not found, `get()` will return `undefined`. - -For the usage of the `status` option, see **Status Tracking** -below. - -### `async fetch(key, options = {}) => Promise` - -The following options are supported: - -- `updateAgeOnGet` -- `allowStale` -- `size` -- `sizeCalculation` -- `ttl` -- `noDisposeOnSet` -- `forceRefresh` -- `status` - See **Status Tracking** below. -- `signal` - AbortSignal can be used to cancel the `fetch()`. - Note that the `signal` option provided to the `fetchMethod` is - a different object, because it must also respond to internal - cache state changes, but aborting this signal will abort the - one passed to `fetchMethod` as well. -- `context` - sets the `context` option passed to the underlying - `fetchMethod`. - -If the value is in the cache and not stale, then the returned -Promise resolves to the value. - -If not in the cache, or beyond its TTL staleness, then -`fetchMethod(key, staleValue, { options, signal, context })` is -called, and the value returned will be added to the cache once -resolved. - -If called with `allowStale`, and an asynchronous fetch is -currently in progress to reload a stale value, then the former -stale value will be returned. - -If called with `forceRefresh`, then the cached item will be -re-fetched, even if it is not stale. However, if `allowStale` is -set, then the old value will still be returned. This is useful -in cases where you want to force a reload of a cached value. If -a background fetch is already in progress, then `forceRefresh` -has no effect. - -Multiple fetches for the same `key` will only call `fetchMethod` -a single time, and all will be resolved when the value is -resolved, even if different options are used. - -If `fetchMethod` is not specified, then this is effectively an -alias for `Promise.resolve(cache.get(key))`. - -When the fetch method resolves to a value, if the fetch has not -been aborted due to deletion, eviction, or being overwritten, -then it is added to the cache using the options provided. - -If the key is evicted or deleted before the `fetchMethod` -resolves, then the AbortSignal passed to the `fetchMethod` will -receive an `abort` event, and the promise returned by `fetch()` -will reject with the reason for the abort. - -If a `signal` is passed to the `fetch()` call, then aborting the -signal will abort the fetch and cause the `fetch()` promise to -reject with the reason provided. - -#### Setting `context` - -If an `FC` type is set to a type other than `unknown`, `void`, or -`undefined` in the LRUCache constructor, then all -calls to `cache.fetch()` _must_ provide a `context` option. If -set to `undefined` or `void`, then calls to fetch _must not_ -provide a `context` option. - -The `context` param allows you to provide arbitrary data that -might be relevant in the course of fetching the data. It is only -relevant for the course of a single `fetch()` operation, and -discarded afterwards. - -#### Note: `fetch()` calls are inflight-unique - -If you call `fetch()` multiple times with the same key value, -then every call after the first will resolve on the same -promise1, -_even if they have different settings that would otherwise change -the behvavior of the fetch_, such as `noDeleteOnFetchRejection` -or `ignoreFetchAbort`. - -In most cases, this is not a problem (in fact, only fetching -something once is what you probably want, if you're caching in -the first place). If you are changing the fetch() options -dramatically between runs, there's a good chance that you might -be trying to fit divergent semantics into a single object, and -would be better off with multiple cache instances. - -**1**: Ie, they're not the "same Promise", but they resolve at -the same time, because they're both waiting on the same -underlying fetchMethod response. - -### `peek(key, { allowStale } = {}) => value` - -Like `get()` but doesn't update recency or delete stale items. - -Returns `undefined` if the item is stale, unless `allowStale` is -set either on the cache or in the options object. - -### `has(key, { updateAgeOnHas, status } = {}) => Boolean` - -Check if a key is in the cache, without updating the recency of -use. Age is updated if `updateAgeOnHas` is set to `true` in -either the options or the constructor. - -Will return `false` if the item is stale, even though it is -technically in the cache. The difference can be determined (if -it matters) by using a `status` argument, and inspecting the -`has` field. - -For the usage of the `status` option, see **Status Tracking** -below. - -### `delete(key)` - -Deletes a key out of the cache. - -Returns `true` if the key was deleted, `false` otherwise. - -### `clear()` - -Clear the cache entirely, throwing away all values. - -### `keys()` - -Return a generator yielding the keys in the cache, in order from -most recently used to least recently used. - -### `rkeys()` - -Return a generator yielding the keys in the cache, in order from -least recently used to most recently used. - -### `values()` - -Return a generator yielding the values in the cache, in order -from most recently used to least recently used. - -### `rvalues()` - -Return a generator yielding the values in the cache, in order -from least recently used to most recently used. - -### `entries()` - -Return a generator yielding `[key, value]` pairs, in order from -most recently used to least recently used. - -### `rentries()` - -Return a generator yielding `[key, value]` pairs, in order from -least recently used to most recently used. - -### `find(fn, [getOptions])` - -Find a value for which the supplied `fn` method returns a truthy -value, similar to `Array.find()`. - -`fn` is called as `fn(value, key, cache)`. - -The optional `getOptions` are applied to the resulting `get()` of -the item found. - -### `dump()` - -Return an array of `[key, entry]` objects which can be passed to -`cache.load()` - -The `start` fields are calculated relative to a portable -`Date.now()` timestamp, even if `performance.now()` is available. - -Stale entries are always included in the `dump`, even if -`allowStale` is false. - -Note: this returns an actual array, not a generator, so it can be -more easily passed around. - -### `load(entries)` - -Reset the cache and load in the items in `entries` in the order -listed. Note that the shape of the resulting cache may be -different if the same options are not used in both caches. - -The `start` fields are assumed to be calculated relative to a -portable `Date.now()` timestamp, even if `performance.now()` is -available. - -### `purgeStale()` - -Delete any stale entries. Returns `true` if anything was -removed, `false` otherwise. - -### `getRemainingTTL(key)` - -Return the number of ms left in the item's TTL. If item is not -in cache, returns `0`. Returns `Infinity` if item is in cache -without a defined TTL. - -### `forEach(fn, [thisp])` - -Call the `fn` function with each set of `fn(value, key, cache)` -in the LRU cache, from most recent to least recently used. - -Does not affect recency of use. - -If `thisp` is provided, function will be called in the -`this`-context of the provided object. - -### `rforEach(fn, [thisp])` - -Same as `cache.forEach(fn, thisp)`, but in order from least -recently used to most recently used. - -### `pop()` - -Evict the least recently used item, returning its value. - -Returns `undefined` if cache is empty. - -### Internal Methods and Properties - -In order to optimize performance as much as possible, "private" -members and methods are exposed on the object as normal -properties, rather than being accessed via Symbols, private -members, or closure variables. - -**Do not use or rely on these.** They will change or be removed -without notice. They will cause undefined behavior if used -inappropriately. There is no need or reason to ever call them -directly. - -This documentation is here so that it is especially clear that -this not "undocumented" because someone forgot; it _is_ -documented, and the documentation is telling you not to do it. - -**Do not report bugs that stem from using these properties.** -They will be ignored. - -- `initializeTTLTracking()` Set up the cache for tracking TTLs -- `updateItemAge(index)` Called when an item age is updated, by - internal ID -- `setItemTTL(index)` Called when an item ttl is updated, by - internal ID -- `isStale(index)` Called to check an item's staleness, by - internal ID -- `initializeSizeTracking()` Set up the cache for tracking item - size. Called automatically when a size is specified. -- `removeItemSize(index)` Updates the internal size calculation - when an item is removed or modified, by internal ID -- `addItemSize(index)` Updates the internal size calculation when - an item is added or modified, by internal ID -- `indexes()` An iterator over the non-stale internal IDs, from - most recently to least recently used. -- `rindexes()` An iterator over the non-stale internal IDs, from - least recently to most recently used. -- `newIndex()` Create a new internal ID, either reusing a deleted - ID, evicting the least recently used ID, or walking to the end - of the allotted space. -- `evict()` Evict the least recently used internal ID, returning - its ID. Does not do any bounds checking. -- `connect(p, n)` Connect the `p` and `n` internal IDs in the - linked list. -- `moveToTail(index)` Move the specified internal ID to the most - recently used position. -- `keyMap` Map of keys to internal IDs -- `keyList` List of keys by internal ID -- `valList` List of values by internal ID -- `sizes` List of calculated sizes by internal ID -- `ttls` List of TTL values by internal ID -- `starts` List of start time values by internal ID -- `next` Array of "next" pointers by internal ID -- `prev` Array of "previous" pointers by internal ID -- `head` Internal ID of least recently used item -- `tail` Internal ID of most recently used item -- `free` Stack of deleted internal IDs - -## Status Tracking - -Occasionally, it may be useful to track the internal behavior of -the cache, particularly for logging, debugging, or for behavior -within the `fetchMethod`. To do this, you can pass a `status` -object to the `get()`, `set()`, `has()`, and `fetch()` methods. - -The `status` option should be a plain JavaScript object. - -The following fields will be set appropriately: - -```ts -interface Status { - /** - * The status of a set() operation. - * - * - add: the item was not found in the cache, and was added - * - update: the item was in the cache, with the same value provided - * - replace: the item was in the cache, and replaced - * - miss: the item was not added to the cache for some reason - */ - set?: 'add' | 'update' | 'replace' | 'miss' - - /** - * the ttl stored for the item, or undefined if ttls are not used. - */ - ttl?: LRUMilliseconds - - /** - * the start time for the item, or undefined if ttls are not used. - */ - start?: LRUMilliseconds - - /** - * The timestamp used for TTL calculation - */ - now?: LRUMilliseconds - - /** - * the remaining ttl for the item, or undefined if ttls are not used. - */ - remainingTTL?: LRUMilliseconds - - /** - * The calculated size for the item, if sizes are used. - */ - size?: LRUSize - - /** - * A flag indicating that the item was not stored, due to exceeding the - * {@link maxEntrySize} - */ - maxEntrySizeExceeded?: true - - /** - * The old value, specified in the case of `set:'update'` or - * `set:'replace'` - */ - oldValue?: V - - /** - * The results of a {@link has} operation - * - * - hit: the item was found in the cache - * - stale: the item was found in the cache, but is stale - * - miss: the item was not found in the cache - */ - has?: 'hit' | 'stale' | 'miss' - - /** - * The status of a {@link fetch} operation. - * Note that this can change as the underlying fetch() moves through - * various states. - * - * - inflight: there is another fetch() for this key which is in process - * - get: there is no fetchMethod, so {@link get} was called. - * - miss: the item is not in cache, and will be fetched. - * - hit: the item is in the cache, and was resolved immediately. - * - stale: the item is in the cache, but stale. - * - refresh: the item is in the cache, and not stale, but - * {@link forceRefresh} was specified. - */ - fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh' - - /** - * The {@link fetchMethod} was called - */ - fetchDispatched?: true - - /** - * The cached value was updated after a successful call to fetchMethod - */ - fetchUpdated?: true - - /** - * The reason for a fetch() rejection. Either the error raised by the - * {@link fetchMethod}, or the reason for an AbortSignal. - */ - fetchError?: Error - - /** - * The fetch received an abort signal - */ - fetchAborted?: true - - /** - * The abort signal received was ignored, and the fetch was allowed to - * continue. - */ - fetchAbortIgnored?: true - - /** - * The fetchMethod promise resolved successfully - */ - fetchResolved?: true - - /** - * The results of the fetchMethod promise were stored in the cache - */ - fetchUpdated?: true - - /** - * The fetchMethod promise was rejected - */ - fetchRejected?: true - - /** - * The status of a {@link get} operation. - * - * - fetching: The item is currently being fetched. If a previous value is - * present and allowed, that will be returned. - * - stale: The item is in the cache, and is stale. - * - hit: the item is in the cache - * - miss: the item is not in the cache - */ - get?: 'stale' | 'hit' | 'miss' - - /** - * A fetch or get operation returned a stale value. - */ - returnedStale?: true -} -``` - -## Storage Bounds Safety - -This implementation aims to be as flexible as possible, within -the limits of safe memory consumption and optimal performance. - -At initial object creation, storage is allocated for `max` items. -If `max` is set to zero, then some performance is lost, and item -count is unbounded. Either `maxSize` or `ttl` _must_ be set if -`max` is not specified. - -If `maxSize` is set, then this creates a safe limit on the -maximum storage consumed, but without the performance benefits of -pre-allocation. When `maxSize` is set, every item _must_ provide -a size, either via the `sizeCalculation` method provided to the -constructor, or via a `size` or `sizeCalculation` option provided -to `cache.set()`. The size of every item _must_ be a positive -integer. - -If neither `max` nor `maxSize` are set, then `ttl` tracking must -be enabled. Note that, even when tracking item `ttl`, items are -_not_ preemptively deleted when they become stale, unless -`ttlAutopurge` is enabled. Instead, they are only purged the -next time the key is requested. Thus, if `ttlAutopurge`, `max`, -and `maxSize` are all not set, then the cache will potentially -grow unbounded. - -In this case, a warning is printed to standard error. Future -versions may require the use of `ttlAutopurge` if `max` and -`maxSize` are not specified. - -If you truly wish to use a cache that is bound _only_ by TTL -expiration, consider using a `Map` object, and calling -`setTimeout` to delete entries when they expire. It will perform -much better than an LRU cache. - -Here is an implementation you may use, under the same -[license](./LICENSE) as this package: - -```js -// a storage-unbounded ttl cache that is not an lru-cache -const cache = { - data: new Map(), - timers: new Map(), - set: (k, v, ttl) => { - if (cache.timers.has(k)) { - clearTimeout(cache.timers.get(k)) - } - cache.timers.set( - k, - setTimeout(() => cache.delete(k), ttl) - ) - cache.data.set(k, v) - }, - get: k => cache.data.get(k), - has: k => cache.data.has(k), - delete: k => { - if (cache.timers.has(k)) { - clearTimeout(cache.timers.get(k)) - } - cache.timers.delete(k) - return cache.data.delete(k) - }, - clear: () => { - cache.data.clear() - for (const v of cache.timers.values()) { - clearTimeout(v) - } - cache.timers.clear() - }, -} -``` - -If that isn't to your liking, check out -[@isaacs/ttlcache](http://npm.im/@isaacs/ttlcache). - -## Performance - -As of January 2022, version 7 of this library is one of the most -performant LRU cache implementations in JavaScript. - -Benchmarks can be extremely difficult to get right. In -particular, the performance of set/get/delete operations on -objects will vary _wildly_ depending on the type of key used. V8 -is highly optimized for objects with keys that are short strings, -especially integer numeric strings. Thus any benchmark which -tests _solely_ using numbers as keys will tend to find that an -object-based approach performs the best. - -Note that coercing _anything_ to strings to use as object keys is -unsafe, unless you can be 100% certain that no other type of -value will be used. For example: - -```js -const myCache = {} -const set = (k, v) => (myCache[k] = v) -const get = k => myCache[k] - -set({}, 'please hang onto this for me') -set('[object Object]', 'oopsie') -``` - -Also beware of "Just So" stories regarding performance. Garbage -collection of large (especially: deep) object graphs can be -incredibly costly, with several "tipping points" where it -increases exponentially. As a result, putting that off until -later can make it much worse, and less predictable. If a library -performs well, but only in a scenario where the object graph is -kept shallow, then that won't help you if you are using large -objects as keys. - -In general, when attempting to use a library to improve -performance (such as a cache like this one), it's best to choose -an option that will perform well in the sorts of scenarios where -you'll actually use it. - -This library is optimized for repeated gets and minimizing -eviction time, since that is the expected need of a LRU. Set -operations are somewhat slower on average than a few other -options, in part because of that optimization. It is assumed -that you'll be caching some costly operation, ideally as rarely -as possible, so optimizing set over get would be unwise. - -If performance matters to you: - -1. If it's at all possible to use small integer values as keys, - and you can guarantee that no other types of values will be - used as keys, then do that, and use a cache such as - [lru-fast](https://npmjs.com/package/lru-fast), or - [mnemonist's - LRUCache](https://yomguithereal.github.io/mnemonist/lru-cache) - which uses an Object as its data store. - -2. Failing that, if at all possible, use short non-numeric - strings (ie, less than 256 characters) as your keys, and use - [mnemonist's - LRUCache](https://yomguithereal.github.io/mnemonist/lru-cache). - -3. If the types of your keys will be anything else, especially - long strings, strings that look like floats, objects, or some - mix of types, or if you aren't sure, then this library will - work well for you. - - If you do not need the features that this library provides - (like asynchronous fetching, a variety of TTL staleness - options, and so on), then [mnemonist's - LRUMap](https://yomguithereal.github.io/mnemonist/lru-map) is - a very good option, and just slightly faster than this module - (since it does considerably less). - -4. Do not use a `dispose` function, size tracking, or especially - ttl behavior, unless absolutely needed. These features are - convenient, and necessary in some use cases, and every attempt - has been made to make the performance impact minimal, but it - isn't nothing. - -## Breaking Changes in Version 7 - -This library changed to a different algorithm and internal data -structure in version 7, yielding significantly better -performance, albeit with some subtle changes as a result. - -If you were relying on the internals of LRUCache in version 6 or -before, it probably will not work in version 7 and above. - -## Breaking Changes in Version 8 - -- The `fetchContext` option was renamed to `context`, and may no - longer be set on the cache instance itself. -- Rewritten in TypeScript, so pretty much all the types moved - around a lot. -- The AbortController/AbortSignal polyfill is removed. For this - reason, **Node version 16.14.0 or higher is now required**. -- Internal properties were moved to actual private class - properties. -- Keys and values must not be `null` or `undefined`. -- Minified export available at `'lru-cache/min'`, for both CJS - and MJS builds. - -For more info, see the [change log](CHANGELOG.md). diff --git a/node_modules/mysql2/node_modules/lru-cache/dist/cjs/index-cjs.d.ts b/node_modules/mysql2/node_modules/lru-cache/dist/cjs/index-cjs.d.ts deleted file mode 100644 index 177a96f..0000000 --- a/node_modules/mysql2/node_modules/lru-cache/dist/cjs/index-cjs.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import LRUCache from './index.js'; -declare const _default: typeof LRUCache & { - default: typeof LRUCache; - LRUCache: typeof LRUCache; -}; -export = _default; -//# sourceMappingURL=index-cjs.d.ts.map \ No newline at end of file diff --git a/node_modules/mysql2/node_modules/lru-cache/dist/cjs/index-cjs.d.ts.map b/node_modules/mysql2/node_modules/lru-cache/dist/cjs/index-cjs.d.ts.map deleted file mode 100644 index 15ad4ae..0000000 --- a/node_modules/mysql2/node_modules/lru-cache/dist/cjs/index-cjs.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index-cjs.d.ts","sourceRoot":"","sources":["../../src/index-cjs.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAA;;;;;AAEjC,kBAAiE"} \ No newline at end of file diff --git a/node_modules/mysql2/node_modules/lru-cache/dist/cjs/index-cjs.js b/node_modules/mysql2/node_modules/lru-cache/dist/cjs/index-cjs.js deleted file mode 100644 index 00f0952..0000000 --- a/node_modules/mysql2/node_modules/lru-cache/dist/cjs/index-cjs.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -const index_js_1 = __importDefault(require("./index.js")); -module.exports = Object.assign(index_js_1.default, { default: index_js_1.default, LRUCache: index_js_1.default }); -//# sourceMappingURL=index-cjs.js.map \ No newline at end of file diff --git a/node_modules/mysql2/node_modules/lru-cache/dist/cjs/index-cjs.js.map b/node_modules/mysql2/node_modules/lru-cache/dist/cjs/index-cjs.js.map deleted file mode 100644 index fa4be4c..0000000 --- a/node_modules/mysql2/node_modules/lru-cache/dist/cjs/index-cjs.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index-cjs.js","sourceRoot":"","sources":["../../src/index-cjs.ts"],"names":[],"mappings":";;;;AAAA,0DAAiC;AAEjC,iBAAS,MAAM,CAAC,MAAM,CAAC,kBAAQ,EAAE,EAAE,OAAO,EAAE,kBAAQ,EAAE,QAAQ,EAAR,kBAAQ,EAAE,CAAC,CAAA","sourcesContent":["import LRUCache from './index.js'\n\nexport = Object.assign(LRUCache, { default: LRUCache, LRUCache })\n"]} \ No newline at end of file diff --git a/node_modules/mysql2/node_modules/lru-cache/dist/cjs/index.d.ts b/node_modules/mysql2/node_modules/lru-cache/dist/cjs/index.d.ts deleted file mode 100644 index 8415eeb..0000000 --- a/node_modules/mysql2/node_modules/lru-cache/dist/cjs/index.d.ts +++ /dev/null @@ -1,807 +0,0 @@ -/** - * @module LRUCache - */ -declare const TYPE: unique symbol; -type Index = number & { - [TYPE]: 'LRUCache Index'; -}; -type UintArray = Uint8Array | Uint16Array | Uint32Array; -type NumberArray = UintArray | number[]; -declare class ZeroArray extends Array { - constructor(size: number); -} -type StackLike = Stack | Index[]; -declare class Stack { - #private; - heap: NumberArray; - length: number; - static create(max: number): StackLike; - constructor(max: number, HeapCls: { - new (n: number): NumberArray; - }); - push(n: Index): void; - pop(): Index; -} -/** - * Promise representing an in-progress {@link LRUCache#fetch} call - */ -export type BackgroundFetch = Promise & { - __returned: BackgroundFetch | undefined; - __abortController: AbortController; - __staleWhileFetching: V | undefined; -}; -export declare namespace LRUCache { - /** - * An integer greater than 0, reflecting the calculated size of items - */ - type Size = number; - /** - * Integer greater than 0, representing some number of milliseconds, or the - * time at which a TTL started counting from. - */ - type Milliseconds = number; - /** - * An integer greater than 0, reflecting a number of items - */ - type Count = number; - /** - * The reason why an item was removed from the cache, passed - * to the {@link Disposer} methods. - */ - type DisposeReason = 'evict' | 'set' | 'delete'; - /** - * A method called upon item removal, passed as the - * {@link OptionsBase.dispose} and/or - * {@link OptionsBase.disposeAfter} options. - */ - type Disposer = (value: V, key: K, reason: DisposeReason) => void; - /** - * A function that returns the effective calculated size - * of an entry in the cache. - */ - type SizeCalculator = (value: V, key: K) => Size; - /** - * Options provided to the - * {@link OptionsBase.fetchMethod} function. - */ - interface FetcherOptions { - signal: AbortSignal; - options: FetcherFetchOptions; - /** - * Object provided in the {@link FetchOptions.context} option to - * {@link LRUCache#fetch} - */ - context: FC; - } - /** - * Status object that may be passed to {@link LRUCache#fetch}, - * {@link LRUCache#get}, {@link LRUCache#set}, and {@link LRUCache#has}. - */ - interface Status { - /** - * The status of a set() operation. - * - * - add: the item was not found in the cache, and was added - * - update: the item was in the cache, with the same value provided - * - replace: the item was in the cache, and replaced - * - miss: the item was not added to the cache for some reason - */ - set?: 'add' | 'update' | 'replace' | 'miss'; - /** - * the ttl stored for the item, or undefined if ttls are not used. - */ - ttl?: Milliseconds; - /** - * the start time for the item, or undefined if ttls are not used. - */ - start?: Milliseconds; - /** - * The timestamp used for TTL calculation - */ - now?: Milliseconds; - /** - * the remaining ttl for the item, or undefined if ttls are not used. - */ - remainingTTL?: Milliseconds; - /** - * The calculated size for the item, if sizes are used. - */ - entrySize?: Size; - /** - * The total calculated size of the cache, if sizes are used. - */ - totalCalculatedSize?: Size; - /** - * A flag indicating that the item was not stored, due to exceeding the - * {@link OptionsBase.maxEntrySize} - */ - maxEntrySizeExceeded?: true; - /** - * The old value, specified in the case of `set:'update'` or - * `set:'replace'` - */ - oldValue?: V; - /** - * The results of a {@link LRUCache#has} operation - * - * - hit: the item was found in the cache - * - stale: the item was found in the cache, but is stale - * - miss: the item was not found in the cache - */ - has?: 'hit' | 'stale' | 'miss'; - /** - * The status of a {@link LRUCache#fetch} operation. - * Note that this can change as the underlying fetch() moves through - * various states. - * - * - inflight: there is another fetch() for this key which is in process - * - get: there is no fetchMethod, so {@link LRUCache#get} was called. - * - miss: the item is not in cache, and will be fetched. - * - hit: the item is in the cache, and was resolved immediately. - * - stale: the item is in the cache, but stale. - * - refresh: the item is in the cache, and not stale, but - * {@link FetchOptions.forceRefresh} was specified. - */ - fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'; - /** - * The {@link OptionsBase.fetchMethod} was called - */ - fetchDispatched?: true; - /** - * The cached value was updated after a successful call to - * {@link OptionsBase.fetchMethod} - */ - fetchUpdated?: true; - /** - * The reason for a fetch() rejection. Either the error raised by the - * {@link OptionsBase.fetchMethod}, or the reason for an - * AbortSignal. - */ - fetchError?: Error; - /** - * The fetch received an abort signal - */ - fetchAborted?: true; - /** - * The abort signal received was ignored, and the fetch was allowed to - * continue. - */ - fetchAbortIgnored?: true; - /** - * The fetchMethod promise resolved successfully - */ - fetchResolved?: true; - /** - * The fetchMethod promise was rejected - */ - fetchRejected?: true; - /** - * The status of a {@link LRUCache#get} operation. - * - * - fetching: The item is currently being fetched. If a previous value - * is present and allowed, that will be returned. - * - stale: The item is in the cache, and is stale. - * - hit: the item is in the cache - * - miss: the item is not in the cache - */ - get?: 'stale' | 'hit' | 'miss'; - /** - * A fetch or get operation returned a stale value. - */ - returnedStale?: true; - } - /** - * options which override the options set in the LRUCache constructor - * when calling {@link LRUCache#fetch}. - * - * This is the union of {@link GetOptions} and {@link SetOptions}, plus - * {@link OptionsBase.noDeleteOnFetchRejection}, - * {@link OptionsBase.allowStaleOnFetchRejection}, - * {@link FetchOptions.forceRefresh}, and - * {@link OptionsBase.context} - * - * Any of these may be modified in the {@link OptionsBase.fetchMethod} - * function, but the {@link GetOptions} fields will of course have no - * effect, as the {@link LRUCache#get} call already happened by the time - * the fetchMethod is called. - */ - interface FetcherFetchOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { - status?: Status; - size?: Size; - } - /** - * Options that may be passed to the {@link LRUCache#fetch} method. - */ - interface FetchOptions extends FetcherFetchOptions { - /** - * Set to true to force a re-load of the existing data, even if it - * is not yet stale. - */ - forceRefresh?: boolean; - /** - * Context provided to the {@link OptionsBase.fetchMethod} as - * the {@link FetcherOptions.context} param. - * - * If the FC type is specified as unknown (the default), - * undefined or void, then this is optional. Otherwise, it will - * be required. - */ - context?: FC; - signal?: AbortSignal; - status?: Status; - } - /** - * Options provided to {@link LRUCache#fetch} when the FC type is something - * other than `unknown`, `undefined`, or `void` - */ - interface FetchOptionsWithContext extends FetchOptions { - context: FC; - } - /** - * Options provided to {@link LRUCache#fetch} when the FC type is - * `undefined` or `void` - */ - interface FetchOptionsNoContext extends FetchOptions { - context?: undefined; - } - /** - * Options that may be passed to the {@link LRUCache#has} method. - */ - interface HasOptions extends Pick, 'updateAgeOnHas'> { - status?: Status; - } - /** - * Options that may be passed to the {@link LRUCache#get} method. - */ - interface GetOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'> { - status?: Status; - } - /** - * Options that may be passed to the {@link LRUCache#peek} method. - */ - interface PeekOptions extends Pick, 'allowStale'> { - } - /** - * Options that may be passed to the {@link LRUCache#set} method. - */ - interface SetOptions extends Pick, 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { - /** - * If size tracking is enabled, then setting an explicit size - * in the {@link LRUCache#set} call will prevent calling the - * {@link OptionsBase.sizeCalculation} function. - */ - size?: Size; - /** - * If TTL tracking is enabled, then setting an explicit start - * time in the {@link LRUCache#set} call will override the - * default time from `performance.now()` or `Date.now()`. - * - * Note that it must be a valid value for whichever time-tracking - * method is in use. - */ - start?: Milliseconds; - status?: Status; - } - /** - * The type signature for the {@link OptionsBase.fetchMethod} option. - */ - type Fetcher = (key: K, staleValue: V | undefined, options: FetcherOptions) => Promise | V | void | undefined; - /** - * Options which may be passed to the {@link LRUCache} constructor. - * - * Most of these may be overridden in the various options that use - * them. - * - * Despite all being technically optional, the constructor requires that - * a cache is at minimum limited by one or more of {@link OptionsBase.max}, - * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}. - * - * If {@link OptionsBase.ttl} is used alone, then it is strongly advised - * (and in fact required by the type definitions here) that the cache - * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially - * unbounded storage. - */ - interface OptionsBase { - /** - * The maximum number of items to store in the cache before evicting - * old entries. This is read-only on the {@link LRUCache} instance, - * and may not be overridden. - * - * If set, then storage space will be pre-allocated at construction - * time, and the cache will perform significantly faster. - * - * Note that significantly fewer items may be stored, if - * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also - * set. - */ - max?: Count; - /** - * Max time in milliseconds for items to live in cache before they are - * considered stale. Note that stale items are NOT preemptively removed - * by default, and MAY live in the cache long after they have expired. - * - * Also, as this cache is optimized for LRU/MRU operations, some of - * the staleness/TTL checks will reduce performance, as they will incur - * overhead by deleting items. - * - * Must be an integer number of ms. If set to 0, this indicates "no TTL" - * - * @default 0 - */ - ttl?: Milliseconds; - /** - * Minimum amount of time in ms in which to check for staleness. - * Defaults to 1, which means that the current time is checked - * at most once per millisecond. - * - * Set to 0 to check the current time every time staleness is tested. - * (This reduces performance, and is theoretically unnecessary.) - * - * Setting this to a higher value will improve performance somewhat - * while using ttl tracking, albeit at the expense of keeping stale - * items around a bit longer than their TTLs would indicate. - * - * @default 1 - */ - ttlResolution?: Milliseconds; - /** - * Preemptively remove stale items from the cache. - * Note that this may significantly degrade performance, - * especially if the cache is storing a large number of items. - * It is almost always best to just leave the stale items in - * the cache, and let them fall out as new items are added. - * - * Note that this means that {@link OptionsBase.allowStale} is a bit - * pointless, as stale items will be deleted almost as soon as they - * expire. - * - * @default false - */ - ttlAutopurge?: boolean; - /** - * Update the age of items on {@link LRUCache#get}, renewing their TTL - * - * Has no effect if {@link OptionsBase.ttl} is not set. - * - * @default false - */ - updateAgeOnGet?: boolean; - /** - * Update the age of items on {@link LRUCache#has}, renewing their TTL - * - * Has no effect if {@link OptionsBase.ttl} is not set. - * - * @default false - */ - updateAgeOnHas?: boolean; - /** - * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return - * stale data, if available. - */ - allowStale?: boolean; - /** - * Function that is called on items when they are dropped from the cache. - * This can be handy if you want to close file descriptors or do other - * cleanup tasks when items are no longer accessible. Called with `key, - * value`. It's called before actually removing the item from the - * internal cache, so it is *NOT* safe to re-add them. - * - * Use {@link OptionsBase.disposeAfter} if you wish to dispose items after - * they have been full removed, when it is safe to add them back to the - * cache. - */ - dispose?: Disposer; - /** - * The same as {@link OptionsBase.dispose}, but called *after* the entry - * is completely removed and the cache is once again in a clean state. - * It is safe to add an item right back into the cache at this point. - * However, note that it is *very* easy to inadvertently create infinite - * recursion this way. - */ - disposeAfter?: Disposer; - /** - * Set to true to suppress calling the - * {@link OptionsBase.dispose} function if the entry key is - * still accessible within the cache. - * This may be overridden by passing an options object to - * {@link LRUCache#set}. - */ - noDisposeOnSet?: boolean; - /** - * Boolean flag to tell the cache to not update the TTL when - * setting a new value for an existing key (ie, when updating a value - * rather than inserting a new value). Note that the TTL value is - * _always_ set (if provided) when adding a new entry into the cache. - * - * Has no effect if a {@link OptionsBase.ttl} is not set. - */ - noUpdateTTL?: boolean; - /** - * If you wish to track item size, you must provide a maxSize - * note that we still will only keep up to max *actual items*, - * if max is set, so size tracking may cause fewer than max items - * to be stored. At the extreme, a single item of maxSize size - * will cause everything else in the cache to be dropped when it - * is added. Use with caution! - * - * Note also that size tracking can negatively impact performance, - * though for most cases, only minimally. - */ - maxSize?: Size; - /** - * The maximum allowed size for any single item in the cache. - * - * If a larger item is passed to {@link LRUCache#set} or returned by a - * {@link OptionsBase.fetchMethod}, then it will not be stored in the - * cache. - */ - maxEntrySize?: Size; - /** - * A function that returns a number indicating the item's size. - * - * If not provided, and {@link OptionsBase.maxSize} or - * {@link OptionsBase.maxEntrySize} are set, then all - * {@link LRUCache#set} calls **must** provide an explicit - * {@link SetOptions.size} or sizeCalculation param. - */ - sizeCalculation?: SizeCalculator; - /** - * Method that provides the implementation for {@link LRUCache#fetch} - */ - fetchMethod?: Fetcher; - /** - * Set to true to suppress the deletion of stale data when a - * {@link OptionsBase.fetchMethod} returns a rejected promise. - */ - noDeleteOnFetchRejection?: boolean; - /** - * Do not delete stale items when they are retrieved with - * {@link LRUCache#get}. - * - * Note that the `get` return value will still be `undefined` - * unless {@link OptionsBase.allowStale} is true. - */ - noDeleteOnStaleGet?: boolean; - /** - * Set to true to allow returning stale data when a - * {@link OptionsBase.fetchMethod} throws an error or returns a rejected - * promise. - * - * This differs from using {@link OptionsBase.allowStale} in that stale - * data will ONLY be returned in the case that the - * {@link LRUCache#fetch} fails, not any other times. - */ - allowStaleOnFetchRejection?: boolean; - /** - * Set to true to return a stale value from the cache when the - * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches an `'abort'` - * event, whether user-triggered, or due to internal cache behavior. - * - * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying - * {@link OptionsBase.fetchMethod} will still be considered canceled, and its return - * value will be ignored and not cached. - */ - allowStaleOnFetchAbort?: boolean; - /** - * Set to true to ignore the `abort` event emitted by the `AbortSignal` - * object passed to {@link OptionsBase.fetchMethod}, and still cache the - * resulting resolution value, as long as it is not `undefined`. - * - * When used on its own, this means aborted {@link LRUCache#fetch} calls are not - * immediately resolved or rejected when they are aborted, and instead - * take the full time to await. - * - * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted - * {@link LRUCache#fetch} calls will resolve immediately to their stale - * cached value or `undefined`, and will continue to process and eventually - * update the cache when they resolve, as long as the resulting value is - * not `undefined`, thus supporting a "return stale on timeout while - * refreshing" mechanism by passing `AbortSignal.timeout(n)` as the signal. - * - * **Note**: regardless of this setting, an `abort` event _is still - * emitted on the `AbortSignal` object_, so may result in invalid results - * when passed to other underlying APIs that use AbortSignals. - * - * This may be overridden in the {@link OptionsBase.fetchMethod} or the - * call to {@link LRUCache#fetch}. - */ - ignoreFetchAbort?: boolean; - } - interface OptionsMaxLimit extends OptionsBase { - max: Count; - } - interface OptionsTTLLimit extends OptionsBase { - ttl: Milliseconds; - ttlAutopurge: boolean; - } - interface OptionsSizeLimit extends OptionsBase { - maxSize: Size; - } - /** - * The valid safe options for the {@link LRUCache} constructor - */ - type Options = OptionsMaxLimit | OptionsSizeLimit | OptionsTTLLimit; - /** - * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump} - */ - interface Entry { - value: V; - ttl?: Milliseconds; - size?: Size; - start?: Milliseconds; - } -} -/** - * Default export, the thing you're using this module to get. - * - * All properties from the options object (with the exception of - * {@link OptionsBase.max} and {@link OptionsBase.maxSize}) are added as - * normal public members. (`max` and `maxBase` are read-only getters.) - * Changing any of these will alter the defaults for subsequent method calls, - * but is otherwise safe. - */ -export declare class LRUCache { - #private; - /** - * {@link LRUCache.OptionsBase.ttl} - */ - ttl: LRUCache.Milliseconds; - /** - * {@link LRUCache.OptionsBase.ttlResolution} - */ - ttlResolution: LRUCache.Milliseconds; - /** - * {@link LRUCache.OptionsBase.ttlAutopurge} - */ - ttlAutopurge: boolean; - /** - * {@link LRUCache.OptionsBase.updateAgeOnGet} - */ - updateAgeOnGet: boolean; - /** - * {@link LRUCache.OptionsBase.updateAgeOnHas} - */ - updateAgeOnHas: boolean; - /** - * {@link LRUCache.OptionsBase.allowStale} - */ - allowStale: boolean; - /** - * {@link LRUCache.OptionsBase.noDisposeOnSet} - */ - noDisposeOnSet: boolean; - /** - * {@link LRUCache.OptionsBase.noUpdateTTL} - */ - noUpdateTTL: boolean; - /** - * {@link LRUCache.OptionsBase.maxEntrySize} - */ - maxEntrySize: LRUCache.Size; - /** - * {@link LRUCache.OptionsBase.sizeCalculation} - */ - sizeCalculation?: LRUCache.SizeCalculator; - /** - * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} - */ - noDeleteOnFetchRejection: boolean; - /** - * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} - */ - noDeleteOnStaleGet: boolean; - /** - * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} - */ - allowStaleOnFetchAbort: boolean; - /** - * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} - */ - allowStaleOnFetchRejection: boolean; - /** - * {@link LRUCache.OptionsBase.ignoreFetchAbort} - */ - ignoreFetchAbort: boolean; - /** - * Do not call this method unless you need to inspect the - * inner workings of the cache. If anything returned by this - * object is modified in any way, strange breakage may occur. - * - * These fields are private for a reason! - * - * @internal - */ - static unsafeExposeInternals(c: LRUCache): { - starts: ZeroArray | undefined; - ttls: ZeroArray | undefined; - sizes: ZeroArray | undefined; - keyMap: Map; - keyList: (K | undefined)[]; - valList: (V | BackgroundFetch | undefined)[]; - next: NumberArray; - prev: NumberArray; - readonly head: Index; - readonly tail: Index; - free: StackLike; - isBackgroundFetch: (p: any) => boolean; - backgroundFetch: (k: K, index: number | undefined, options: LRUCache.FetchOptions, context: any) => BackgroundFetch; - moveToTail: (index: number) => void; - indexes: (options?: { - allowStale: boolean; - }) => Generator; - rindexes: (options?: { - allowStale: boolean; - }) => Generator; - isStale: (index: number | undefined) => boolean; - }; - /** - * {@link LRUCache.OptionsBase.max} (read-only) - */ - get max(): LRUCache.Count; - /** - * {@link LRUCache.OptionsBase.maxSize} (read-only) - */ - get maxSize(): LRUCache.Count; - /** - * The total computed size of items in the cache (read-only) - */ - get calculatedSize(): LRUCache.Size; - /** - * The number of items stored in the cache (read-only) - */ - get size(): LRUCache.Count; - /** - * {@link LRUCache.OptionsBase.fetchMethod} (read-only) - */ - get fetchMethod(): LRUCache.Fetcher | undefined; - /** - * {@link LRUCache.OptionsBase.dispose} (read-only) - */ - get dispose(): LRUCache.Disposer | undefined; - /** - * {@link LRUCache.OptionsBase.disposeAfter} (read-only) - */ - get disposeAfter(): LRUCache.Disposer | undefined; - constructor(options: LRUCache.Options | LRUCache); - /** - * Return the remaining TTL time for a given entry key - */ - getRemainingTTL(key: K): number; - /** - * Return a generator yielding `[key, value]` pairs, - * in order from most recently used to least recently used. - */ - entries(): Generator<(K | V | BackgroundFetch | undefined)[], void, unknown>; - /** - * Inverse order version of {@link LRUCache.entries} - * - * Return a generator yielding `[key, value]` pairs, - * in order from least recently used to most recently used. - */ - rentries(): Generator<(K | V | BackgroundFetch | undefined)[], void, unknown>; - /** - * Return a generator yielding the keys in the cache, - * in order from most recently used to least recently used. - */ - keys(): Generator; - /** - * Inverse order version of {@link LRUCache.keys} - * - * Return a generator yielding the keys in the cache, - * in order from least recently used to most recently used. - */ - rkeys(): Generator; - /** - * Return a generator yielding the values in the cache, - * in order from most recently used to least recently used. - */ - values(): Generator | undefined, void, unknown>; - /** - * Inverse order version of {@link LRUCache.values} - * - * Return a generator yielding the values in the cache, - * in order from least recently used to most recently used. - */ - rvalues(): Generator | undefined, void, unknown>; - /** - * Iterating over the cache itself yields the same results as - * {@link LRUCache.entries} - */ - [Symbol.iterator](): Generator<(K | V | BackgroundFetch | undefined)[], void, unknown>; - /** - * Find a value for which the supplied fn method returns a truthy value, - * similar to Array.find(). fn is called as fn(value, key, cache). - */ - find(fn: (v: V, k: K, self: LRUCache) => boolean, getOptions?: LRUCache.GetOptions): V | undefined; - /** - * Call the supplied function on each item in the cache, in order from - * most recently used to least recently used. fn is called as - * fn(value, key, cache). Does not update age or recenty of use. - * Does not iterate over stale values. - */ - forEach(fn: (v: V, k: K, self: LRUCache) => any, thisp?: any): void; - /** - * The same as {@link LRUCache.forEach} but items are iterated over in - * reverse order. (ie, less recently used items are iterated over first.) - */ - rforEach(fn: (v: V, k: K, self: LRUCache) => any, thisp?: any): void; - /** - * Delete any stale entries. Returns true if anything was removed, - * false otherwise. - */ - purgeStale(): boolean; - /** - * Return an array of [key, {@link LRUCache.Entry}] tuples which can be - * passed to cache.load() - */ - dump(): [K, LRUCache.Entry][]; - /** - * Reset the cache and load in the items in entries in the order listed. - * Note that the shape of the resulting cache may be different if the - * same options are not used in both caches. - */ - load(arr: [K, LRUCache.Entry][]): void; - /** - * Add a value to the cache. - */ - set(k: K, v: V | BackgroundFetch, setOptions?: LRUCache.SetOptions): this; - /** - * Evict the least recently used item, returning its value or - * `undefined` if cache is empty. - */ - pop(): V | undefined; - /** - * Check if a key is in the cache, without updating the recency of use. - * Will return false if the item is stale, even though it is technically - * in the cache. - * - * Will not update item age unless - * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. - */ - has(k: K, hasOptions?: LRUCache.HasOptions): boolean; - /** - * Like {@link LRUCache#get} but doesn't update recency or delete stale - * items. - * - * Returns `undefined` if the item is stale, unless - * {@link LRUCache.OptionsBase.allowStale} is set. - */ - peek(k: K, peekOptions?: LRUCache.PeekOptions): V | undefined; - /** - * Make an asynchronous cached fetch using the - * {@link LRUCache.OptionsBase.fetchMethod} function. - * - * If multiple fetches for the same key are issued, then they will all be - * coalesced into a single call to fetchMethod. - * - * Note that this means that handling options such as - * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}, - * {@link LRUCache.FetchOptions.signal}, - * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be - * determined by the FIRST fetch() call for a given key. - * - * This is a known (fixable) shortcoming which will be addresed on when - * someone complains about it, as the fix would involve added complexity and - * may not be worth the costs for this edge case. - */ - fetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; - fetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; - /** - * Return a value from the cache. Will update the recency of the cache - * entry found. - * - * If the key is not found, get() will return `undefined`. - */ - get(k: K, getOptions?: LRUCache.GetOptions): V | undefined; - /** - * Deletes a key out of the cache. - * Returns true if the key was deleted, false otherwise. - */ - delete(k: K): boolean; - /** - * Clear the cache entirely, throwing away all values. - */ - clear(): void; -} -export default LRUCache; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/mysql2/node_modules/lru-cache/dist/cjs/index.d.ts.map b/node_modules/mysql2/node_modules/lru-cache/dist/cjs/index.d.ts.map deleted file mode 100644 index 2f068e4..0000000 --- a/node_modules/mysql2/node_modules/lru-cache/dist/cjs/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GA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,CAAC,EAAE,EAAE,CAAM;IAsK3D;;;;;;;;;;;;;;;;OAgBG;IACH,KAAK,CACH,CAAC,EAAE,CAAC,EACJ,YAAY,EAAE,OAAO,SAAS,EAAE,GAC5B,QAAQ,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAC/B,EAAE,SAAS,SAAS,GAAG,IAAI,GAC3B,QAAQ,CAAC,qBAAqB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GACxC,QAAQ,CAAC,uBAAuB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAC7C,OAAO,CAAC,IAAI,GAAG,CAAC,CAAC;IAEpB,KAAK,CACH,CAAC,EAAE,OAAO,SAAS,EAAE,GACjB,CAAC,GACD,EAAE,SAAS,SAAS,GAAG,IAAI,GAC3B,CAAC,GACD,KAAK,EACT,YAAY,CAAC,EAAE,OAAO,SAAS,EAAE,GAC7B,QAAQ,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAC/B,EAAE,SAAS,SAAS,GAAG,IAAI,GAC3B,QAAQ,CAAC,qBAAqB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GACxC,KAAK,GACR,OAAO,CAAC,IAAI,GAAG,CAAC,CAAC;IAkGpB;;;;;OAKG;IACH,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,UAAU,GAAE,QAAQ,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAM;IAgFxD;;;OAGG;IACH,MAAM,CAAC,CAAC,EAAE,CAAC;IA+CX;;OAEG;IACH,KAAK;CAuCN;AAED,eAAe,QAAQ,CAAA"} \ No newline at end of file diff --git a/node_modules/mysql2/node_modules/lru-cache/dist/cjs/index.js b/node_modules/mysql2/node_modules/lru-cache/dist/cjs/index.js deleted file mode 100644 index 09f15dd..0000000 --- a/node_modules/mysql2/node_modules/lru-cache/dist/cjs/index.js +++ /dev/null @@ -1,1334 +0,0 @@ -"use strict"; -/** - * @module LRUCache - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.LRUCache = void 0; -const perf = typeof performance === 'object' && - performance && - typeof performance.now === 'function' - ? performance - : Date; -const warned = new Set(); -const emitWarning = (msg, type, code, fn) => { - typeof process === 'object' && - process && - typeof process.emitWarning === 'function' - ? process.emitWarning(msg, type, code, fn) - : console.error(`[${code}] ${type}: ${msg}`); -}; -const shouldWarn = (code) => !warned.has(code); -const TYPE = Symbol('type'); -const isPosInt = (n) => n && n === Math.floor(n) && n > 0 && isFinite(n); -/* c8 ignore start */ -// This is a little bit ridiculous, tbh. -// The maximum array length is 2^32-1 or thereabouts on most JS impls. -// And well before that point, you're caching the entire world, I mean, -// that's ~32GB of just integers for the next/prev links, plus whatever -// else to hold that many keys and values. Just filling the memory with -// zeroes at init time is brutal when you get that big. -// But why not be complete? -// Maybe in the future, these limits will have expanded. -const getUintArray = (max) => !isPosInt(max) - ? null - : max <= Math.pow(2, 8) - ? Uint8Array - : max <= Math.pow(2, 16) - ? Uint16Array - : max <= Math.pow(2, 32) - ? Uint32Array - : max <= Number.MAX_SAFE_INTEGER - ? ZeroArray - : null; -/* c8 ignore stop */ -class ZeroArray extends Array { - constructor(size) { - super(size); - this.fill(0); - } -} -class Stack { - heap; - length; - // private constructor - static #constructing = false; - static create(max) { - const HeapCls = getUintArray(max); - if (!HeapCls) - return []; - Stack.#constructing = true; - const s = new Stack(max, HeapCls); - Stack.#constructing = false; - return s; - } - constructor(max, HeapCls) { - /* c8 ignore start */ - if (!Stack.#constructing) { - throw new TypeError('instantiate Stack using Stack.create(n)'); - } - /* c8 ignore stop */ - this.heap = new HeapCls(max); - this.length = 0; - } - push(n) { - this.heap[this.length++] = n; - } - pop() { - return this.heap[--this.length]; - } -} -/** - * Default export, the thing you're using this module to get. - * - * All properties from the options object (with the exception of - * {@link OptionsBase.max} and {@link OptionsBase.maxSize}) are added as - * normal public members. (`max` and `maxBase` are read-only getters.) - * Changing any of these will alter the defaults for subsequent method calls, - * but is otherwise safe. - */ -class LRUCache { - // properties coming in from the options of these, only max and maxSize - // really *need* to be protected. The rest can be modified, as they just - // set defaults for various methods. - #max; - #maxSize; - #dispose; - #disposeAfter; - #fetchMethod; - /** - * {@link LRUCache.OptionsBase.ttl} - */ - ttl; - /** - * {@link LRUCache.OptionsBase.ttlResolution} - */ - ttlResolution; - /** - * {@link LRUCache.OptionsBase.ttlAutopurge} - */ - ttlAutopurge; - /** - * {@link LRUCache.OptionsBase.updateAgeOnGet} - */ - updateAgeOnGet; - /** - * {@link LRUCache.OptionsBase.updateAgeOnHas} - */ - updateAgeOnHas; - /** - * {@link LRUCache.OptionsBase.allowStale} - */ - allowStale; - /** - * {@link LRUCache.OptionsBase.noDisposeOnSet} - */ - noDisposeOnSet; - /** - * {@link LRUCache.OptionsBase.noUpdateTTL} - */ - noUpdateTTL; - /** - * {@link LRUCache.OptionsBase.maxEntrySize} - */ - maxEntrySize; - /** - * {@link LRUCache.OptionsBase.sizeCalculation} - */ - sizeCalculation; - /** - * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} - */ - noDeleteOnFetchRejection; - /** - * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} - */ - noDeleteOnStaleGet; - /** - * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} - */ - allowStaleOnFetchAbort; - /** - * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} - */ - allowStaleOnFetchRejection; - /** - * {@link LRUCache.OptionsBase.ignoreFetchAbort} - */ - ignoreFetchAbort; - // computed properties - #size; - #calculatedSize; - #keyMap; - #keyList; - #valList; - #next; - #prev; - #head; - #tail; - #free; - #disposed; - #sizes; - #starts; - #ttls; - #hasDispose; - #hasFetchMethod; - #hasDisposeAfter; - /** - * Do not call this method unless you need to inspect the - * inner workings of the cache. If anything returned by this - * object is modified in any way, strange breakage may occur. - * - * These fields are private for a reason! - * - * @internal - */ - static unsafeExposeInternals(c) { - return { - // properties - starts: c.#starts, - ttls: c.#ttls, - sizes: c.#sizes, - keyMap: c.#keyMap, - keyList: c.#keyList, - valList: c.#valList, - next: c.#next, - prev: c.#prev, - get head() { - return c.#head; - }, - get tail() { - return c.#tail; - }, - free: c.#free, - // methods - isBackgroundFetch: (p) => c.#isBackgroundFetch(p), - backgroundFetch: (k, index, options, context) => c.#backgroundFetch(k, index, options, context), - moveToTail: (index) => c.#moveToTail(index), - indexes: (options) => c.#indexes(options), - rindexes: (options) => c.#rindexes(options), - isStale: (index) => c.#isStale(index), - }; - } - // Protected read-only members - /** - * {@link LRUCache.OptionsBase.max} (read-only) - */ - get max() { - return this.#max; - } - /** - * {@link LRUCache.OptionsBase.maxSize} (read-only) - */ - get maxSize() { - return this.#maxSize; - } - /** - * The total computed size of items in the cache (read-only) - */ - get calculatedSize() { - return this.#calculatedSize; - } - /** - * The number of items stored in the cache (read-only) - */ - get size() { - return this.#size; - } - /** - * {@link LRUCache.OptionsBase.fetchMethod} (read-only) - */ - get fetchMethod() { - return this.#fetchMethod; - } - /** - * {@link LRUCache.OptionsBase.dispose} (read-only) - */ - get dispose() { - return this.#dispose; - } - /** - * {@link LRUCache.OptionsBase.disposeAfter} (read-only) - */ - get disposeAfter() { - return this.#disposeAfter; - } - constructor(options) { - const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, } = options; - if (max !== 0 && !isPosInt(max)) { - throw new TypeError('max option must be a nonnegative integer'); - } - const UintArray = max ? getUintArray(max) : Array; - if (!UintArray) { - throw new Error('invalid max value: ' + max); - } - this.#max = max; - this.#maxSize = maxSize; - this.maxEntrySize = maxEntrySize || this.#maxSize; - this.sizeCalculation = sizeCalculation; - if (this.sizeCalculation) { - if (!this.#maxSize && !this.maxEntrySize) { - throw new TypeError('cannot set sizeCalculation without setting maxSize or maxEntrySize'); - } - if (typeof this.sizeCalculation !== 'function') { - throw new TypeError('sizeCalculation set to non-function'); - } - } - if (fetchMethod !== undefined && - typeof fetchMethod !== 'function') { - throw new TypeError('fetchMethod must be a function if specified'); - } - this.#fetchMethod = fetchMethod; - this.#hasFetchMethod = !!fetchMethod; - this.#keyMap = new Map(); - this.#keyList = new Array(max).fill(undefined); - this.#valList = new Array(max).fill(undefined); - this.#next = new UintArray(max); - this.#prev = new UintArray(max); - this.#head = 0; - this.#tail = 0; - this.#free = Stack.create(max); - this.#size = 0; - this.#calculatedSize = 0; - if (typeof dispose === 'function') { - this.#dispose = dispose; - } - if (typeof disposeAfter === 'function') { - this.#disposeAfter = disposeAfter; - this.#disposed = []; - } - else { - this.#disposeAfter = undefined; - this.#disposed = undefined; - } - this.#hasDispose = !!this.#dispose; - this.#hasDisposeAfter = !!this.#disposeAfter; - this.noDisposeOnSet = !!noDisposeOnSet; - this.noUpdateTTL = !!noUpdateTTL; - this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection; - this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection; - this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort; - this.ignoreFetchAbort = !!ignoreFetchAbort; - // NB: maxEntrySize is set to maxSize if it's set - if (this.maxEntrySize !== 0) { - if (this.#maxSize !== 0) { - if (!isPosInt(this.#maxSize)) { - throw new TypeError('maxSize must be a positive integer if specified'); - } - } - if (!isPosInt(this.maxEntrySize)) { - throw new TypeError('maxEntrySize must be a positive integer if specified'); - } - this.#initializeSizeTracking(); - } - this.allowStale = !!allowStale; - this.noDeleteOnStaleGet = !!noDeleteOnStaleGet; - this.updateAgeOnGet = !!updateAgeOnGet; - this.updateAgeOnHas = !!updateAgeOnHas; - this.ttlResolution = - isPosInt(ttlResolution) || ttlResolution === 0 - ? ttlResolution - : 1; - this.ttlAutopurge = !!ttlAutopurge; - this.ttl = ttl || 0; - if (this.ttl) { - if (!isPosInt(this.ttl)) { - throw new TypeError('ttl must be a positive integer if specified'); - } - this.#initializeTTLTracking(); - } - // do not allow completely unbounded caches - if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) { - throw new TypeError('At least one of max, maxSize, or ttl is required'); - } - if (!this.ttlAutopurge && !this.#max && !this.#maxSize) { - const code = 'LRU_CACHE_UNBOUNDED'; - if (shouldWarn(code)) { - warned.add(code); - const msg = 'TTL caching without ttlAutopurge, max, or maxSize can ' + - 'result in unbounded memory consumption.'; - emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache); - } - } - } - /** - * Return the remaining TTL time for a given entry key - */ - getRemainingTTL(key) { - return this.#keyMap.has(key) ? Infinity : 0; - } - #initializeTTLTracking() { - const ttls = new ZeroArray(this.#max); - const starts = new ZeroArray(this.#max); - this.#ttls = ttls; - this.#starts = starts; - this.#setItemTTL = (index, ttl, start = perf.now()) => { - starts[index] = ttl !== 0 ? start : 0; - ttls[index] = ttl; - if (ttl !== 0 && this.ttlAutopurge) { - const t = setTimeout(() => { - if (this.#isStale(index)) { - this.delete(this.#keyList[index]); - } - }, ttl + 1); - // unref() not supported on all platforms - /* c8 ignore start */ - if (t.unref) { - t.unref(); - } - /* c8 ignore stop */ - } - }; - this.#updateItemAge = index => { - starts[index] = ttls[index] !== 0 ? perf.now() : 0; - }; - this.#statusTTL = (status, index) => { - if (ttls[index]) { - const ttl = ttls[index]; - const start = starts[index]; - status.ttl = ttl; - status.start = start; - status.now = cachedNow || getNow(); - status.remainingTTL = status.now + ttl - start; - } - }; - // debounce calls to perf.now() to 1s so we're not hitting - // that costly call repeatedly. - let cachedNow = 0; - const getNow = () => { - const n = perf.now(); - if (this.ttlResolution > 0) { - cachedNow = n; - const t = setTimeout(() => (cachedNow = 0), this.ttlResolution); - // not available on all platforms - /* c8 ignore start */ - if (t.unref) { - t.unref(); - } - /* c8 ignore stop */ - } - return n; - }; - this.getRemainingTTL = key => { - const index = this.#keyMap.get(key); - if (index === undefined) { - return 0; - } - return ttls[index] === 0 || starts[index] === 0 - ? Infinity - : starts[index] + ttls[index] - (cachedNow || getNow()); - }; - this.#isStale = index => { - return (ttls[index] !== 0 && - starts[index] !== 0 && - (cachedNow || getNow()) - starts[index] > ttls[index]); - }; - } - // conditionally set private methods related to TTL - #updateItemAge = () => { }; - #statusTTL = () => { }; - #setItemTTL = () => { }; - /* c8 ignore stop */ - #isStale = () => false; - #initializeSizeTracking() { - const sizes = new ZeroArray(this.#max); - this.#calculatedSize = 0; - this.#sizes = sizes; - this.#removeItemSize = index => { - this.#calculatedSize -= sizes[index]; - sizes[index] = 0; - }; - this.#requireSize = (k, v, size, sizeCalculation) => { - // provisionally accept background fetches. - // actual value size will be checked when they return. - if (this.#isBackgroundFetch(v)) { - return 0; - } - if (!isPosInt(size)) { - if (sizeCalculation) { - if (typeof sizeCalculation !== 'function') { - throw new TypeError('sizeCalculation must be a function'); - } - size = sizeCalculation(v, k); - if (!isPosInt(size)) { - throw new TypeError('sizeCalculation return invalid (expect positive integer)'); - } - } - else { - throw new TypeError('invalid size value (must be positive integer). ' + - 'When maxSize or maxEntrySize is used, sizeCalculation ' + - 'or size must be set.'); - } - } - return size; - }; - this.#addItemSize = (index, size, status) => { - sizes[index] = size; - if (this.#maxSize) { - const maxSize = this.#maxSize - sizes[index]; - while (this.#calculatedSize > maxSize) { - this.#evict(true); - } - } - this.#calculatedSize += sizes[index]; - if (status) { - status.entrySize = size; - status.totalCalculatedSize = this.#calculatedSize; - } - }; - } - #removeItemSize = _i => { }; - #addItemSize = (_i, _s, _st) => { }; - #requireSize = (_k, _v, size, sizeCalculation) => { - if (size || sizeCalculation) { - throw new TypeError('cannot set size without setting maxSize or maxEntrySize on cache'); - } - return 0; - }; - *#indexes({ allowStale = this.allowStale } = {}) { - if (this.#size) { - for (let i = this.#tail; true;) { - if (!this.#isValidIndex(i)) { - break; - } - if (allowStale || !this.#isStale(i)) { - yield i; - } - if (i === this.#head) { - break; - } - else { - i = this.#prev[i]; - } - } - } - } - *#rindexes({ allowStale = this.allowStale } = {}) { - if (this.#size) { - for (let i = this.#head; true;) { - if (!this.#isValidIndex(i)) { - break; - } - if (allowStale || !this.#isStale(i)) { - yield i; - } - if (i === this.#tail) { - break; - } - else { - i = this.#next[i]; - } - } - } - } - #isValidIndex(index) { - return (index !== undefined && - this.#keyMap.get(this.#keyList[index]) === index); - } - /** - * Return a generator yielding `[key, value]` pairs, - * in order from most recently used to least recently used. - */ - *entries() { - for (const i of this.#indexes()) { - if (this.#valList[i] !== undefined && - this.#keyList[i] !== undefined && - !this.#isBackgroundFetch(this.#valList[i])) { - yield [this.#keyList[i], this.#valList[i]]; - } - } - } - /** - * Inverse order version of {@link LRUCache.entries} - * - * Return a generator yielding `[key, value]` pairs, - * in order from least recently used to most recently used. - */ - *rentries() { - for (const i of this.#rindexes()) { - if (this.#valList[i] !== undefined && - this.#keyList[i] !== undefined && - !this.#isBackgroundFetch(this.#valList[i])) { - yield [this.#keyList[i], this.#valList[i]]; - } - } - } - /** - * Return a generator yielding the keys in the cache, - * in order from most recently used to least recently used. - */ - *keys() { - for (const i of this.#indexes()) { - const k = this.#keyList[i]; - if (k !== undefined && - !this.#isBackgroundFetch(this.#valList[i])) { - yield k; - } - } - } - /** - * Inverse order version of {@link LRUCache.keys} - * - * Return a generator yielding the keys in the cache, - * in order from least recently used to most recently used. - */ - *rkeys() { - for (const i of this.#rindexes()) { - const k = this.#keyList[i]; - if (k !== undefined && - !this.#isBackgroundFetch(this.#valList[i])) { - yield k; - } - } - } - /** - * Return a generator yielding the values in the cache, - * in order from most recently used to least recently used. - */ - *values() { - for (const i of this.#indexes()) { - const v = this.#valList[i]; - if (v !== undefined && - !this.#isBackgroundFetch(this.#valList[i])) { - yield this.#valList[i]; - } - } - } - /** - * Inverse order version of {@link LRUCache.values} - * - * Return a generator yielding the values in the cache, - * in order from least recently used to most recently used. - */ - *rvalues() { - for (const i of this.#rindexes()) { - const v = this.#valList[i]; - if (v !== undefined && - !this.#isBackgroundFetch(this.#valList[i])) { - yield this.#valList[i]; - } - } - } - /** - * Iterating over the cache itself yields the same results as - * {@link LRUCache.entries} - */ - [Symbol.iterator]() { - return this.entries(); - } - /** - * Find a value for which the supplied fn method returns a truthy value, - * similar to Array.find(). fn is called as fn(value, key, cache). - */ - find(fn, getOptions = {}) { - for (const i of this.#indexes()) { - const v = this.#valList[i]; - const value = this.#isBackgroundFetch(v) - ? v.__staleWhileFetching - : v; - if (value === undefined) - continue; - if (fn(value, this.#keyList[i], this)) { - return this.get(this.#keyList[i], getOptions); - } - } - } - /** - * Call the supplied function on each item in the cache, in order from - * most recently used to least recently used. fn is called as - * fn(value, key, cache). Does not update age or recenty of use. - * Does not iterate over stale values. - */ - forEach(fn, thisp = this) { - for (const i of this.#indexes()) { - const v = this.#valList[i]; - const value = this.#isBackgroundFetch(v) - ? v.__staleWhileFetching - : v; - if (value === undefined) - continue; - fn.call(thisp, value, this.#keyList[i], this); - } - } - /** - * The same as {@link LRUCache.forEach} but items are iterated over in - * reverse order. (ie, less recently used items are iterated over first.) - */ - rforEach(fn, thisp = this) { - for (const i of this.#rindexes()) { - const v = this.#valList[i]; - const value = this.#isBackgroundFetch(v) - ? v.__staleWhileFetching - : v; - if (value === undefined) - continue; - fn.call(thisp, value, this.#keyList[i], this); - } - } - /** - * Delete any stale entries. Returns true if anything was removed, - * false otherwise. - */ - purgeStale() { - let deleted = false; - for (const i of this.#rindexes({ allowStale: true })) { - if (this.#isStale(i)) { - this.delete(this.#keyList[i]); - deleted = true; - } - } - return deleted; - } - /** - * Return an array of [key, {@link LRUCache.Entry}] tuples which can be - * passed to cache.load() - */ - dump() { - const arr = []; - for (const i of this.#indexes({ allowStale: true })) { - const key = this.#keyList[i]; - const v = this.#valList[i]; - const value = this.#isBackgroundFetch(v) - ? v.__staleWhileFetching - : v; - if (value === undefined || key === undefined) - continue; - const entry = { value }; - if (this.#ttls && this.#starts) { - entry.ttl = this.#ttls[i]; - // always dump the start relative to a portable timestamp - // it's ok for this to be a bit slow, it's a rare operation. - const age = perf.now() - this.#starts[i]; - entry.start = Math.floor(Date.now() - age); - } - if (this.#sizes) { - entry.size = this.#sizes[i]; - } - arr.unshift([key, entry]); - } - return arr; - } - /** - * Reset the cache and load in the items in entries in the order listed. - * Note that the shape of the resulting cache may be different if the - * same options are not used in both caches. - */ - load(arr) { - this.clear(); - for (const [key, entry] of arr) { - if (entry.start) { - // entry.start is a portable timestamp, but we may be using - // node's performance.now(), so calculate the offset, so that - // we get the intended remaining TTL, no matter how long it's - // been on ice. - // - // it's ok for this to be a bit slow, it's a rare operation. - const age = Date.now() - entry.start; - entry.start = perf.now() - age; - } - this.set(key, entry.value, entry); - } - } - /** - * Add a value to the cache. - */ - set(k, v, setOptions = {}) { - const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status, } = setOptions; - let { noUpdateTTL = this.noUpdateTTL } = setOptions; - const size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation); - // if the item doesn't fit, don't do anything - // NB: maxEntrySize set to maxSize by default - if (this.maxEntrySize && size > this.maxEntrySize) { - if (status) { - status.set = 'miss'; - status.maxEntrySizeExceeded = true; - } - // have to delete, in case something is there already. - this.delete(k); - return this; - } - let index = this.#size === 0 ? undefined : this.#keyMap.get(k); - if (index === undefined) { - // addition - index = (this.#size === 0 - ? this.#tail - : this.#free.length !== 0 - ? this.#free.pop() - : this.#size === this.#max - ? this.#evict(false) - : this.#size); - this.#keyList[index] = k; - this.#valList[index] = v; - this.#keyMap.set(k, index); - this.#next[this.#tail] = index; - this.#prev[index] = this.#tail; - this.#tail = index; - this.#size++; - this.#addItemSize(index, size, status); - if (status) - status.set = 'add'; - noUpdateTTL = false; - } - else { - // update - this.#moveToTail(index); - const oldVal = this.#valList[index]; - if (v !== oldVal) { - if (this.#hasFetchMethod && this.#isBackgroundFetch(oldVal)) { - oldVal.__abortController.abort(new Error('replaced')); - } - else if (!noDisposeOnSet) { - if (this.#hasDispose) { - this.#dispose?.(oldVal, k, 'set'); - } - if (this.#hasDisposeAfter) { - this.#disposed?.push([oldVal, k, 'set']); - } - } - this.#removeItemSize(index); - this.#addItemSize(index, size, status); - this.#valList[index] = v; - if (status) { - status.set = 'replace'; - const oldValue = oldVal && this.#isBackgroundFetch(oldVal) - ? oldVal.__staleWhileFetching - : oldVal; - if (oldValue !== undefined) - status.oldValue = oldValue; - } - } - else if (status) { - status.set = 'update'; - } - } - if (ttl !== 0 && !this.#ttls) { - this.#initializeTTLTracking(); - } - if (this.#ttls) { - if (!noUpdateTTL) { - this.#setItemTTL(index, ttl, start); - } - if (status) - this.#statusTTL(status, index); - } - if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) { - const dt = this.#disposed; - let task; - while ((task = dt?.shift())) { - this.#disposeAfter?.(...task); - } - } - return this; - } - /** - * Evict the least recently used item, returning its value or - * `undefined` if cache is empty. - */ - pop() { - try { - while (this.#size) { - const val = this.#valList[this.#head]; - this.#evict(true); - if (this.#isBackgroundFetch(val)) { - if (val.__staleWhileFetching) { - return val.__staleWhileFetching; - } - } - else if (val !== undefined) { - return val; - } - } - } - finally { - if (this.#hasDisposeAfter && this.#disposed) { - const dt = this.#disposed; - let task; - while ((task = dt?.shift())) { - this.#disposeAfter?.(...task); - } - } - } - } - #evict(free) { - const head = this.#head; - const k = this.#keyList[head]; - const v = this.#valList[head]; - if (this.#hasFetchMethod && this.#isBackgroundFetch(v)) { - v.__abortController.abort(new Error('evicted')); - } - else if (this.#hasDispose || this.#hasDisposeAfter) { - if (this.#hasDispose) { - this.#dispose?.(v, k, 'evict'); - } - if (this.#hasDisposeAfter) { - this.#disposed?.push([v, k, 'evict']); - } - } - this.#removeItemSize(head); - // if we aren't about to use the index, then null these out - if (free) { - this.#keyList[head] = undefined; - this.#valList[head] = undefined; - this.#free.push(head); - } - if (this.#size === 1) { - this.#head = this.#tail = 0; - this.#free.length = 0; - } - else { - this.#head = this.#next[head]; - } - this.#keyMap.delete(k); - this.#size--; - return head; - } - /** - * Check if a key is in the cache, without updating the recency of use. - * Will return false if the item is stale, even though it is technically - * in the cache. - * - * Will not update item age unless - * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. - */ - has(k, hasOptions = {}) { - const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions; - const index = this.#keyMap.get(k); - if (index !== undefined) { - const v = this.#valList[index]; - if (this.#isBackgroundFetch(v) && - v.__staleWhileFetching === undefined) { - return false; - } - if (!this.#isStale(index)) { - if (updateAgeOnHas) { - this.#updateItemAge(index); - } - if (status) { - status.has = 'hit'; - this.#statusTTL(status, index); - } - return true; - } - else if (status) { - status.has = 'stale'; - this.#statusTTL(status, index); - } - } - else if (status) { - status.has = 'miss'; - } - return false; - } - /** - * Like {@link LRUCache#get} but doesn't update recency or delete stale - * items. - * - * Returns `undefined` if the item is stale, unless - * {@link LRUCache.OptionsBase.allowStale} is set. - */ - peek(k, peekOptions = {}) { - const { allowStale = this.allowStale } = peekOptions; - const index = this.#keyMap.get(k); - if (index !== undefined && - (allowStale || !this.#isStale(index))) { - const v = this.#valList[index]; - // either stale and allowed, or forcing a refresh of non-stale value - return this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; - } - } - #backgroundFetch(k, index, options, context) { - const v = index === undefined ? undefined : this.#valList[index]; - if (this.#isBackgroundFetch(v)) { - return v; - } - const ac = new AbortController(); - const { signal } = options; - // when/if our AC signals, then stop listening to theirs. - signal?.addEventListener('abort', () => ac.abort(signal.reason), { - signal: ac.signal, - }); - const fetchOpts = { - signal: ac.signal, - options, - context, - }; - const cb = (v, updateCache = false) => { - const { aborted } = ac.signal; - const ignoreAbort = options.ignoreFetchAbort && v !== undefined; - if (options.status) { - if (aborted && !updateCache) { - options.status.fetchAborted = true; - options.status.fetchError = ac.signal.reason; - if (ignoreAbort) - options.status.fetchAbortIgnored = true; - } - else { - options.status.fetchResolved = true; - } - } - if (aborted && !ignoreAbort && !updateCache) { - return fetchFail(ac.signal.reason); - } - // either we didn't abort, and are still here, or we did, and ignored - const bf = p; - if (this.#valList[index] === p) { - if (v === undefined) { - if (bf.__staleWhileFetching) { - this.#valList[index] = bf.__staleWhileFetching; - } - else { - this.delete(k); - } - } - else { - if (options.status) - options.status.fetchUpdated = true; - this.set(k, v, fetchOpts.options); - } - } - return v; - }; - const eb = (er) => { - if (options.status) { - options.status.fetchRejected = true; - options.status.fetchError = er; - } - return fetchFail(er); - }; - const fetchFail = (er) => { - const { aborted } = ac.signal; - const allowStaleAborted = aborted && options.allowStaleOnFetchAbort; - const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection; - const noDelete = allowStale || options.noDeleteOnFetchRejection; - const bf = p; - if (this.#valList[index] === p) { - // if we allow stale on fetch rejections, then we need to ensure that - // the stale value is not removed from the cache when the fetch fails. - const del = !noDelete || bf.__staleWhileFetching === undefined; - if (del) { - this.delete(k); - } - else if (!allowStaleAborted) { - // still replace the *promise* with the stale value, - // since we are done with the promise at this point. - // leave it untouched if we're still waiting for an - // aborted background fetch that hasn't yet returned. - this.#valList[index] = bf.__staleWhileFetching; - } - } - if (allowStale) { - if (options.status && bf.__staleWhileFetching !== undefined) { - options.status.returnedStale = true; - } - return bf.__staleWhileFetching; - } - else if (bf.__returned === bf) { - throw er; - } - }; - const pcall = (res, rej) => { - const fmp = this.#fetchMethod?.(k, v, fetchOpts); - if (fmp && fmp instanceof Promise) { - fmp.then(v => res(v), rej); - } - // ignored, we go until we finish, regardless. - // defer check until we are actually aborting, - // so fetchMethod can override. - ac.signal.addEventListener('abort', () => { - if (!options.ignoreFetchAbort || - options.allowStaleOnFetchAbort) { - res(); - // when it eventually resolves, update the cache. - if (options.allowStaleOnFetchAbort) { - res = v => cb(v, true); - } - } - }); - }; - if (options.status) - options.status.fetchDispatched = true; - const p = new Promise(pcall).then(cb, eb); - const bf = Object.assign(p, { - __abortController: ac, - __staleWhileFetching: v, - __returned: undefined, - }); - if (index === undefined) { - // internal, don't expose status. - this.set(k, bf, { ...fetchOpts.options, status: undefined }); - index = this.#keyMap.get(k); - } - else { - this.#valList[index] = bf; - } - return bf; - } - #isBackgroundFetch(p) { - if (!this.#hasFetchMethod) - return false; - const b = p; - return (!!b && - b instanceof Promise && - b.hasOwnProperty('__staleWhileFetching') && - b.__abortController instanceof AbortController); - } - async fetch(k, fetchOptions = {}) { - const { - // get options - allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, - // set options - ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, - // fetch exclusive options - noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, ignoreFetchAbort = this.ignoreFetchAbort, allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, context, forceRefresh = false, status, signal, } = fetchOptions; - if (!this.#hasFetchMethod) { - if (status) - status.fetch = 'get'; - return this.get(k, { - allowStale, - updateAgeOnGet, - noDeleteOnStaleGet, - status, - }); - } - const options = { - allowStale, - updateAgeOnGet, - noDeleteOnStaleGet, - ttl, - noDisposeOnSet, - size, - sizeCalculation, - noUpdateTTL, - noDeleteOnFetchRejection, - allowStaleOnFetchRejection, - allowStaleOnFetchAbort, - ignoreFetchAbort, - status, - signal, - }; - let index = this.#keyMap.get(k); - if (index === undefined) { - if (status) - status.fetch = 'miss'; - const p = this.#backgroundFetch(k, index, options, context); - return (p.__returned = p); - } - else { - // in cache, maybe already fetching - const v = this.#valList[index]; - if (this.#isBackgroundFetch(v)) { - const stale = allowStale && v.__staleWhileFetching !== undefined; - if (status) { - status.fetch = 'inflight'; - if (stale) - status.returnedStale = true; - } - return stale ? v.__staleWhileFetching : (v.__returned = v); - } - // if we force a refresh, that means do NOT serve the cached value, - // unless we are already in the process of refreshing the cache. - const isStale = this.#isStale(index); - if (!forceRefresh && !isStale) { - if (status) - status.fetch = 'hit'; - this.#moveToTail(index); - if (updateAgeOnGet) { - this.#updateItemAge(index); - } - if (status) - this.#statusTTL(status, index); - return v; - } - // ok, it is stale or a forced refresh, and not already fetching. - // refresh the cache. - const p = this.#backgroundFetch(k, index, options, context); - const hasStale = p.__staleWhileFetching !== undefined; - const staleVal = hasStale && allowStale; - if (status) { - status.fetch = isStale ? 'stale' : 'refresh'; - if (staleVal && isStale) - status.returnedStale = true; - } - return staleVal ? p.__staleWhileFetching : (p.__returned = p); - } - } - /** - * Return a value from the cache. Will update the recency of the cache - * entry found. - * - * If the key is not found, get() will return `undefined`. - */ - get(k, getOptions = {}) { - const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status, } = getOptions; - const index = this.#keyMap.get(k); - if (index !== undefined) { - const value = this.#valList[index]; - const fetching = this.#isBackgroundFetch(value); - if (status) - this.#statusTTL(status, index); - if (this.#isStale(index)) { - if (status) - status.get = 'stale'; - // delete only if not an in-flight background fetch - if (!fetching) { - if (!noDeleteOnStaleGet) { - this.delete(k); - } - if (status && allowStale) - status.returnedStale = true; - return allowStale ? value : undefined; - } - else { - if (status && - allowStale && - value.__staleWhileFetching !== undefined) { - status.returnedStale = true; - } - return allowStale ? value.__staleWhileFetching : undefined; - } - } - else { - if (status) - status.get = 'hit'; - // if we're currently fetching it, we don't actually have it yet - // it's not stale, which means this isn't a staleWhileRefetching. - // If it's not stale, and fetching, AND has a __staleWhileFetching - // value, then that means the user fetched with {forceRefresh:true}, - // so it's safe to return that value. - if (fetching) { - return value.__staleWhileFetching; - } - this.#moveToTail(index); - if (updateAgeOnGet) { - this.#updateItemAge(index); - } - return value; - } - } - else if (status) { - status.get = 'miss'; - } - } - #connect(p, n) { - this.#prev[n] = p; - this.#next[p] = n; - } - #moveToTail(index) { - // if tail already, nothing to do - // if head, move head to next[index] - // else - // move next[prev[index]] to next[index] (head has no prev) - // move prev[next[index]] to prev[index] - // prev[index] = tail - // next[tail] = index - // tail = index - if (index !== this.#tail) { - if (index === this.#head) { - this.#head = this.#next[index]; - } - else { - this.#connect(this.#prev[index], this.#next[index]); - } - this.#connect(this.#tail, index); - this.#tail = index; - } - } - /** - * Deletes a key out of the cache. - * Returns true if the key was deleted, false otherwise. - */ - delete(k) { - let deleted = false; - if (this.#size !== 0) { - const index = this.#keyMap.get(k); - if (index !== undefined) { - deleted = true; - if (this.#size === 1) { - this.clear(); - } - else { - this.#removeItemSize(index); - const v = this.#valList[index]; - if (this.#isBackgroundFetch(v)) { - v.__abortController.abort(new Error('deleted')); - } - else if (this.#hasDispose || this.#hasDisposeAfter) { - if (this.#hasDispose) { - this.#dispose?.(v, k, 'delete'); - } - if (this.#hasDisposeAfter) { - this.#disposed?.push([v, k, 'delete']); - } - } - this.#keyMap.delete(k); - this.#keyList[index] = undefined; - this.#valList[index] = undefined; - if (index === this.#tail) { - this.#tail = this.#prev[index]; - } - else if (index === this.#head) { - this.#head = this.#next[index]; - } - else { - this.#next[this.#prev[index]] = this.#next[index]; - this.#prev[this.#next[index]] = this.#prev[index]; - } - this.#size--; - this.#free.push(index); - } - } - } - if (this.#hasDisposeAfter && this.#disposed?.length) { - const dt = this.#disposed; - let task; - while ((task = dt?.shift())) { - this.#disposeAfter?.(...task); - } - } - return deleted; - } - /** - * Clear the cache entirely, throwing away all values. - */ - clear() { - for (const index of this.#rindexes({ allowStale: true })) { - const v = this.#valList[index]; - if (this.#isBackgroundFetch(v)) { - v.__abortController.abort(new Error('deleted')); - } - else { - const k = this.#keyList[index]; - if (this.#hasDispose) { - this.#dispose?.(v, k, 'delete'); - } - if (this.#hasDisposeAfter) { - this.#disposed?.push([v, k, 'delete']); - } - } - } - this.#keyMap.clear(); - this.#valList.fill(undefined); - this.#keyList.fill(undefined); - if (this.#ttls && this.#starts) { - this.#ttls.fill(0); - this.#starts.fill(0); - } - if (this.#sizes) { - this.#sizes.fill(0); - } - this.#head = 0; - this.#tail = 0; - this.#free.length = 0; - this.#calculatedSize = 0; - this.#size = 0; - if (this.#hasDisposeAfter && this.#disposed) { - const dt = this.#disposed; - let task; - while ((task = dt?.shift())) { - this.#disposeAfter?.(...task); - } - } - } -} -exports.LRUCache = LRUCache; -exports.default = LRUCache; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/mysql2/node_modules/lru-cache/dist/cjs/index.js.map b/node_modules/mysql2/node_modules/lru-cache/dist/cjs/index.js.map deleted file mode 100644 index eb4e477..0000000 --- a/node_modules/mysql2/node_modules/lru-cache/dist/cjs/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAIH,MAAM,IAAI,GACR,OAAO,WAAW,KAAK,QAAQ;IAC/B,WAAW;IACX,OAAO,WAAW,CAAC,GAAG,KAAK,UAAU;IACnC,CAAC,CAAC,WAAW;IACb,CAAC,CAAC,IAAI,CAAA;AAEV,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAA;AAKhC,MAAM,WAAW,GAAG,CAClB,GAAW,EACX,IAAY,EACZ,IAAY,EACZ,EAAQ,EACR,EAAE;IACF,OAAO,OAAO,KAAK,QAAQ;QAC3B,OAAO;QACP,OAAO,OAAO,CAAC,WAAW,KAAK,UAAU;QACvC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC;QAC1C,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,IAAI,KAAK,GAAG,EAAE,CAAC,CAAA;AAChD,CAAC,CAAA;AAED,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;AAEtD,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA;AAI3B,MAAM,QAAQ,GAAG,CAAC,CAAM,EAAe,EAAE,CACvC,CAAC,IAAI,CAAC,KAAK,IAA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n\n// module-private names and types\ntype Perf = { now: () => number }\nconst perf: Perf =\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ? performance\n : Date\n\nconst warned = new Set()\n\n// either a function or a class\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC\n) => {\n typeof process === 'object' &&\n process &&\n typeof process.emitWarning === 'function'\n ? process.emitWarning(msg, type, code, fn)\n : console.error(`[${code}] ${type}: ${msg}`)\n}\n\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\ntype PosInt = number & { [TYPE]: 'Positive Integer' }\ntype Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: any): n is PosInt =>\n n && n === Math.floor(n) && n > 0 && isFinite(n)\n\ntype UintArray = Uint8Array | Uint16Array | Uint32Array\ntype NumberArray = UintArray | number[]\n\n/* c8 ignore start */\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\nconst getUintArray = (max: number) =>\n !isPosInt(max)\n ? null\n : max <= Math.pow(2, 8)\n ? Uint8Array\n : max <= Math.pow(2, 16)\n ? Uint16Array\n : max <= Math.pow(2, 32)\n ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER\n ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\n\ntype StackLike = Stack | Index[]\nclass Stack {\n heap: NumberArray\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(\n max: number,\n HeapCls: { new (n: number): NumberArray }\n ) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\ntype DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n */\n export type DisposeReason = 'evict' | 'set' | 'delete'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Status object that may be passed to {@link LRUCache#fetch},\n * {@link LRUCache#get}, {@link LRUCache#set}, and {@link LRUCache#has}.\n */\n export interface Status {\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss'\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The old value, specified in the case of `set:'update'` or\n * `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no fetchMethod, so {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link OptionsBase.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions\n extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions\n extends FetcherFetchOptions {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext\n extends FetchOptions {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext\n extends FetchOptions {\n context?: undefined\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions\n extends Pick, 'updateAgeOnHas'> {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions\n extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions\n extends Pick, 'allowStale'> {}\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions\n extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions\n ) => Promise | V | void | undefined\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed\n * by default, and MAY live in the cache long after they have expired.\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * Must be an integer number of ms. If set to 0, this indicates \"no TTL\"\n *\n * @default 0\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n * Note that this may significantly degrade performance,\n * especially if the cache is storing a large number of items.\n * It is almost always best to just leave the stale items in\n * the cache, and let them fall out as new items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * @default false\n */\n ttlAutopurge?: boolean\n\n /**\n * Update the age of items on {@link LRUCache#get}, renewing their TTL\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * @default false\n */\n updateAgeOnGet?: boolean\n\n /**\n * Update the age of items on {@link LRUCache#has}, renewing their TTL\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * @default false\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the cache.\n * This can be handy if you want to close file descriptors or do other\n * cleanup tasks when items are no longer accessible. Called with `key,\n * value`. It's called before actually removing the item from the\n * internal cache, so it is *NOT* safe to re-add them.\n *\n * Use {@link OptionsBase.disposeAfter} if you wish to dispose items after\n * they have been full removed, when it is safe to add them back to the\n * cache.\n */\n dispose?: Disposer\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when\n * setting a new value for an existing key (ie, when updating a value\n * rather than inserting a new value). Note that the TTL value is\n * _always_ set (if provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n */\n noUpdateTTL?: boolean\n\n /**\n * If you wish to track item size, you must provide a maxSize\n * note that we still will only keep up to max *actual items*,\n * if max is set, so size tracking may cause fewer than max items\n * to be stored. At the extreme, a single item of maxSize size\n * will cause everything else in the cache to be dropped when it\n * is added. Use with caution!\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod}, then it will not be stored in the\n * cache.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n */\n fetchMethod?: Fetcher\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the\n * {@link LRUCache#fetch} fails, not any other times.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches an `'abort'`\n * event, whether user-triggered, or due to internal cache behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and its return\n * value will be ignored and not cached.\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls are not\n * immediately resolved or rejected when they are aborted, and instead\n * take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n }\n\n export interface OptionsMaxLimit\n extends OptionsBase {\n max: Count\n }\n export interface OptionsTTLLimit\n extends OptionsBase {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit\n extends OptionsBase {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump}\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * All properties from the options object (with the exception of\n * {@link OptionsBase.max} and {@link OptionsBase.maxSize}) are added as\n * normal public members. (`max` and `maxBase` are read-only getters.)\n * Changing any of these will alter the defaults for subsequent method calls,\n * but is otherwise safe.\n */\nexport class LRUCache {\n // properties coming in from the options of these, only max and maxSize\n // really *need* to be protected. The rest can be modified, as they just\n // set defaults for various methods.\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: any) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: any\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context\n ),\n moveToTail: (index: number): void =>\n c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) =>\n c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) =>\n c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(\n options: LRUCache.Options | LRUCache\n ) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n } = options\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize'\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (\n fetchMethod !== undefined &&\n typeof fetchMethod !== 'function'\n ) {\n throw new TypeError(\n 'fetchMethod must be a function if specified'\n )\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = new Array(max).fill(undefined)\n this.#valList = new Array(max).fill(undefined)\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified'\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified'\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0\n ? ttlResolution\n : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError(\n 'ttl must be a positive integer if specified'\n )\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required'\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the remaining TTL time for a given entry key\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n\n this.#setItemTTL = (index, ttl, start = perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n if (ttl !== 0 && this.ttlAutopurge) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.delete(this.#keyList[index] as K)\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? perf.now() : 0\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n status.remainingTTL = status.now + ttl - start\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(\n () => (cachedNow = 0),\n this.ttlResolution\n )\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n return ttls[index] === 0 || starts[index] === 0\n ? Infinity\n : starts[index] + ttls[index] - (cachedNow || getNow())\n }\n\n this.#isStale = index => {\n return (\n ttls[index] !== 0 &&\n starts[index] !== 0 &&\n (cachedNow || getNow()) - starts[index] > ttls[index]\n )\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index]\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n return 0\n }\n if (!isPosInt(size)) {\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)'\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.'\n )\n }\n }\n return size\n }\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index]\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index]\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status\n ) => void = (_i, _s, _st) => {}\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache'\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; true; ) {\n if (!this.#isValidIndex(i)) {\n break\n }\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; true; ) {\n if (!this.#isValidIndex(i)) {\n break\n }\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (\n k !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (\n k !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (\n v !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (\n v !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to Array.find(). fn is called as fn(value, key, cache).\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {}\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from\n * most recently used to least recently used. fn is called as\n * fn(value, key, cache). Does not update age or recenty of use.\n * Does not iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => any,\n thisp: any = this\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => any,\n thisp: any = this\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.delete(this.#keyList[i] as K)\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to cache.load()\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = perf.now() - this.#starts[i]\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n * Note that the shape of the resulting cache may be different if the\n * same options are not used in both caches.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = perf.now() - age\n }\n this.set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n */\n set(\n k: K,\n v: V | BackgroundFetch,\n setOptions: LRUCache.SetOptions = {}\n ) {\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n // have to delete, in case something is there already.\n this.delete(k)\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0\n ? this.#tail\n : this.#free.length !== 0\n ? this.#free.pop()\n : this.#size === this.#max\n ? this.#evict(false)\n : this.#size\n ) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n } else {\n // update\n this.#moveToTail(index)\n const oldVal = this.#valList[index] as V | BackgroundFetch\n if (v !== oldVal) {\n if (this.#hasFetchMethod && this.#isBackgroundFetch(oldVal)) {\n oldVal.__abortController.abort(new Error('replaced'))\n } else if (!noDisposeOnSet) {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal as V, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal as V, k, 'set'])\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (status) {\n status.set = 'replace'\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal)\n ? oldVal.__staleWhileFetching\n : oldVal\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n } else if (status) {\n status.set = 'update'\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head] as K\n const v = this.#valList[head] as V\n if (this.#hasFetchMethod && this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('evicted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } =\n hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (\n index !== undefined &&\n (allowStale || !this.#isStale(index))\n ) {\n const v = this.#valList[index]\n // either stale and allowed, or forcing a refresh of non-stale value\n return this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n }\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: any\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AbortController()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (\n v: V | void | undefined,\n updateCache = false\n ): V | undefined | void => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n if (v === undefined) {\n if (bf.__staleWhileFetching) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.delete(k)\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.set(k, v, fetchOpts.options)\n }\n }\n return v\n }\n\n const eb = (er: any) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er\n }\n return fetchFail(er)\n }\n\n const fetchFail = (er: any): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted =\n aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del = !noDelete || bf.__staleWhileFetching === undefined\n if (del) {\n this.delete(k)\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | void | undefined) => void,\n rej: (e: any) => void\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v), rej)\n }\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (\n !options.ignoreFetchAbort ||\n options.allowStaleOnFetchAbort\n ) {\n res()\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: any): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AbortController\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n */\n fetch(\n k: K,\n fetchOptions: unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext\n ): Promise\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC\n ? K\n : FC extends undefined | void\n ? K\n : never,\n fetchOptions?: unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : never\n ): Promise\n async fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {}\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale =\n allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n if (status) status.get = 'stale'\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.delete(k)\n }\n if (status && allowStale) status.returnedStale = true\n return allowStale ? value : undefined\n } else {\n if (\n status &&\n allowStale &&\n value.__staleWhileFetching !== undefined\n ) {\n status.returnedStale = true\n }\n return allowStale ? value.__staleWhileFetching : undefined\n }\n } else {\n if (status) status.get = 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n if (fetching) {\n return value.__staleWhileFetching\n }\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return value\n }\n } else if (status) {\n status.get = 'miss'\n }\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n deleted = true\n if (this.#size === 1) {\n this.clear()\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, 'delete')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, 'delete'])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#next[this.#prev[index]] = this.#next[index]\n this.#prev[this.#next[index]] = this.#prev[index]\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, 'delete')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, 'delete'])\n }\n }\n }\n\n this.#keyMap.clear()\n this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n\nexport default LRUCache\n"]} \ No newline at end of file diff --git a/node_modules/mysql2/node_modules/lru-cache/dist/cjs/index.min.js b/node_modules/mysql2/node_modules/lru-cache/dist/cjs/index.min.js deleted file mode 100644 index f0edea4..0000000 --- a/node_modules/mysql2/node_modules/lru-cache/dist/cjs/index.min.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";var N=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports);var x=(r,t,e)=>{if(!t.has(r))throw TypeError("Cannot "+e)};var M=(r,t,e)=>(x(r,t,"read from private field"),e?e.call(r):t.get(r)),G=(r,t,e)=>{if(t.has(r))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(r):t.set(r,e)},R=(r,t,e,i)=>(x(r,t,"write to private field"),i?i.call(r,e):t.set(r,e),e);var H=N(W=>{"use strict";Object.defineProperty(W,"__esModule",{value:!0});W.LRUCache=void 0;var D=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,I=new Set,V=(r,t,e,i)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(r,t,e,i):console.error(`[${e}] ${t}: ${r}`)},q=r=>!I.has(r),X=Symbol("type"),F=r=>r&&r===Math.floor(r)&&r>0&&isFinite(r),k=r=>F(r)?r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?O:null:null,O=class extends Array{constructor(t){super(t),this.fill(0)}},v,T=class{heap;length;static create(t){let e=k(t);if(!e)return[];R(T,v,!0);let i=new T(t,e);return R(T,v,!1),i}constructor(t,e){if(!M(T,v))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},C=T;v=new WeakMap,G(C,v,!1);var E=class{#d;#f;#_;#g;#D;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#s;#p;#n;#i;#t;#o;#c;#l;#h;#w;#r;#F;#A;#S;#y;#T;#a;static unsafeExposeInternals(t){return{starts:t.#A,ttls:t.#S,sizes:t.#F,keyMap:t.#n,keyList:t.#i,valList:t.#t,next:t.#o,prev:t.#c,get head(){return t.#l},get tail(){return t.#h},free:t.#w,isBackgroundFetch:e=>t.#e(e),backgroundFetch:(e,i,s,n)=>t.#R(e,i,s,n),moveToTail:e=>t.#E(e),indexes:e=>t.#m(e),rindexes:e=>t.#b(e),isStale:e=>t.#u(e)}}get max(){return this.#d}get maxSize(){return this.#f}get calculatedSize(){return this.#p}get size(){return this.#s}get fetchMethod(){return this.#D}get dispose(){return this.#_}get disposeAfter(){return this.#g}constructor(t){let{max:e=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:h,updateAgeOnHas:f,allowStale:l,dispose:p,disposeAfter:y,noDisposeOnSet:a,noUpdateTTL:u,maxSize:g=0,maxEntrySize:A=0,sizeCalculation:c,fetchMethod:w,noDeleteOnFetchRejection:o,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:d,ignoreFetchAbort:_}=t;if(e!==0&&!F(e))throw new TypeError("max option must be a nonnegative integer");let z=e?k(e):Array;if(!z)throw new Error("invalid max value: "+e);if(this.#d=e,this.#f=g,this.maxEntrySize=A||this.#f,this.sizeCalculation=c,this.sizeCalculation){if(!this.#f&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(w!==void 0&&typeof w!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#D=w,this.#T=!!w,this.#n=new Map,this.#i=new Array(e).fill(void 0),this.#t=new Array(e).fill(void 0),this.#o=new z(e),this.#c=new z(e),this.#l=0,this.#h=0,this.#w=C.create(e),this.#s=0,this.#p=0,typeof p=="function"&&(this.#_=p),typeof y=="function"?(this.#g=y,this.#r=[]):(this.#g=void 0,this.#r=void 0),this.#y=!!this.#_,this.#a=!!this.#g,this.noDisposeOnSet=!!a,this.noUpdateTTL=!!u,this.noDeleteOnFetchRejection=!!o,this.allowStaleOnFetchRejection=!!m,this.allowStaleOnFetchAbort=!!d,this.ignoreFetchAbort=!!_,this.maxEntrySize!==0){if(this.#f!==0&&!F(this.#f))throw new TypeError("maxSize must be a positive integer if specified");if(!F(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#G()}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!h,this.updateAgeOnHas=!!f,this.ttlResolution=F(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!F(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#L()}if(this.#d===0&&this.ttl===0&&this.#f===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#d&&!this.#f){let b="LRU_CACHE_UNBOUNDED";q(b)&&(I.add(b),V("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",b,E))}}getRemainingTTL(t){return this.#n.has(t)?1/0:0}#L(){let t=new O(this.#d),e=new O(this.#d);this.#S=t,this.#A=e,this.#j=(n,h,f=D.now())=>{if(e[n]=h!==0?f:0,t[n]=h,h!==0&&this.ttlAutopurge){let l=setTimeout(()=>{this.#u(n)&&this.delete(this.#i[n])},h+1);l.unref&&l.unref()}},this.#O=n=>{e[n]=t[n]!==0?D.now():0},this.#z=(n,h)=>{if(t[h]){let f=t[h],l=e[h];n.ttl=f,n.start=l,n.now=i||s(),n.remainingTTL=n.now+f-l}};let i=0,s=()=>{let n=D.now();if(this.ttlResolution>0){i=n;let h=setTimeout(()=>i=0,this.ttlResolution);h.unref&&h.unref()}return n};this.getRemainingTTL=n=>{let h=this.#n.get(n);return h===void 0?0:t[h]===0||e[h]===0?1/0:e[h]+t[h]-(i||s())},this.#u=n=>t[n]!==0&&e[n]!==0&&(i||s())-e[n]>t[n]}#O=()=>{};#z=()=>{};#j=()=>{};#u=()=>!1;#G(){let t=new O(this.#d);this.#p=0,this.#F=t,this.#v=e=>{this.#p-=t[e],t[e]=0},this.#U=(e,i,s,n)=>{if(this.#e(i))return 0;if(!F(s))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,e),!F(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s},this.#W=(e,i,s)=>{if(t[e]=i,this.#f){let n=this.#f-t[e];for(;this.#p>n;)this.#C(!0)}this.#p+=t[e],s&&(s.entrySize=i,s.totalCalculatedSize=this.#p)}}#v=t=>{};#W=(t,e,i)=>{};#U=(t,e,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#m({allowStale:t=this.allowStale}={}){if(this.#s)for(let e=this.#h;!(!this.#x(e)||((t||!this.#u(e))&&(yield e),e===this.#l));)e=this.#c[e]}*#b({allowStale:t=this.allowStale}={}){if(this.#s)for(let e=this.#l;!(!this.#x(e)||((t||!this.#u(e))&&(yield e),e===this.#h));)e=this.#o[e]}#x(t){return t!==void 0&&this.#n.get(this.#i[t])===t}*entries(){for(let t of this.#m())this.#t[t]!==void 0&&this.#i[t]!==void 0&&!this.#e(this.#t[t])&&(yield[this.#i[t],this.#t[t]])}*rentries(){for(let t of this.#b())this.#t[t]!==void 0&&this.#i[t]!==void 0&&!this.#e(this.#t[t])&&(yield[this.#i[t],this.#t[t]])}*keys(){for(let t of this.#m()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e)}}*rkeys(){for(let t of this.#b()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e)}}*values(){for(let t of this.#m())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t])}*rvalues(){for(let t of this.#b())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t])}[Symbol.iterator](){return this.entries()}find(t,e={}){for(let i of this.#m()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;if(n!==void 0&&t(n,this.#i[i],this))return this.get(this.#i[i],e)}}forEach(t,e=this){for(let i of this.#m()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(e,n,this.#i[i],this)}}rforEach(t,e=this){for(let i of this.#b()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(e,n,this.#i[i],this)}}purgeStale(){let t=!1;for(let e of this.#b({allowStale:!0}))this.#u(e)&&(this.delete(this.#i[e]),t=!0);return t}dump(){let t=[];for(let e of this.#m({allowStale:!0})){let i=this.#i[e],s=this.#t[e],n=this.#e(s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let h={value:n};if(this.#S&&this.#A){h.ttl=this.#S[e];let f=D.now()-this.#A[e];h.start=Math.floor(Date.now()-f)}this.#F&&(h.size=this.#F[e]),t.unshift([i,h])}return t}load(t){this.clear();for(let[e,i]of t){if(i.start){let s=Date.now()-i.start;i.start=D.now()-s}this.set(e,i.value,i)}}set(t,e,i={}){let{ttl:s=this.ttl,start:n,noDisposeOnSet:h=this.noDisposeOnSet,sizeCalculation:f=this.sizeCalculation,status:l}=i,{noUpdateTTL:p=this.noUpdateTTL}=i,y=this.#U(t,e,i.size||0,f);if(this.maxEntrySize&&y>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this.delete(t),this;let a=this.#s===0?void 0:this.#n.get(t);if(a===void 0)a=this.#s===0?this.#h:this.#w.length!==0?this.#w.pop():this.#s===this.#d?this.#C(!1):this.#s,this.#i[a]=t,this.#t[a]=e,this.#n.set(t,a),this.#o[this.#h]=a,this.#c[a]=this.#h,this.#h=a,this.#s++,this.#W(a,y,l),l&&(l.set="add"),p=!1;else{this.#E(a);let u=this.#t[a];if(e!==u){if(this.#T&&this.#e(u)?u.__abortController.abort(new Error("replaced")):h||(this.#y&&this.#_?.(u,t,"set"),this.#a&&this.#r?.push([u,t,"set"])),this.#v(a),this.#W(a,y,l),this.#t[a]=e,l){l.set="replace";let g=u&&this.#e(u)?u.__staleWhileFetching:u;g!==void 0&&(l.oldValue=g)}}else l&&(l.set="update")}if(s!==0&&!this.#S&&this.#L(),this.#S&&(p||this.#j(a,s,n),l&&this.#z(l,a)),!h&&this.#a&&this.#r){let u=this.#r,g;for(;g=u?.shift();)this.#g?.(...g)}return this}pop(){try{for(;this.#s;){let t=this.#t[this.#l];if(this.#C(!0),this.#e(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#a&&this.#r){let t=this.#r,e;for(;e=t?.shift();)this.#g?.(...e)}}}#C(t){let e=this.#l,i=this.#i[e],s=this.#t[e];return this.#T&&this.#e(s)?s.__abortController.abort(new Error("evicted")):(this.#y||this.#a)&&(this.#y&&this.#_?.(s,i,"evict"),this.#a&&this.#r?.push([s,i,"evict"])),this.#v(e),t&&(this.#i[e]=void 0,this.#t[e]=void 0,this.#w.push(e)),this.#s===1?(this.#l=this.#h=0,this.#w.length=0):this.#l=this.#o[e],this.#n.delete(i),this.#s--,e}has(t,e={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=e,n=this.#n.get(t);if(n!==void 0){let h=this.#t[n];if(this.#e(h)&&h.__staleWhileFetching===void 0)return!1;if(this.#u(n))s&&(s.has="stale",this.#z(s,n));else return i&&this.#O(n),s&&(s.has="hit",this.#z(s,n)),!0}else s&&(s.has="miss");return!1}peek(t,e={}){let{allowStale:i=this.allowStale}=e,s=this.#n.get(t);if(s!==void 0&&(i||!this.#u(s))){let n=this.#t[s];return this.#e(n)?n.__staleWhileFetching:n}}#R(t,e,i,s){let n=e===void 0?void 0:this.#t[e];if(this.#e(n))return n;let h=new AbortController,{signal:f}=i;f?.addEventListener("abort",()=>h.abort(f.reason),{signal:h.signal});let l={signal:h.signal,options:i,context:s},p=(c,w=!1)=>{let{aborted:o}=h.signal,S=i.ignoreFetchAbort&&c!==void 0;if(i.status&&(o&&!w?(i.status.fetchAborted=!0,i.status.fetchError=h.signal.reason,S&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),o&&!S&&!w)return a(h.signal.reason);let m=g;return this.#t[e]===g&&(c===void 0?m.__staleWhileFetching?this.#t[e]=m.__staleWhileFetching:this.delete(t):(i.status&&(i.status.fetchUpdated=!0),this.set(t,c,l.options))),c},y=c=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=c),a(c)),a=c=>{let{aborted:w}=h.signal,o=w&&i.allowStaleOnFetchAbort,S=o||i.allowStaleOnFetchRejection,m=S||i.noDeleteOnFetchRejection,d=g;if(this.#t[e]===g&&(!m||d.__staleWhileFetching===void 0?this.delete(t):o||(this.#t[e]=d.__staleWhileFetching)),S)return i.status&&d.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),d.__staleWhileFetching;if(d.__returned===d)throw c},u=(c,w)=>{let o=this.#D?.(t,n,l);o&&o instanceof Promise&&o.then(S=>c(S),w),h.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(c(),i.allowStaleOnFetchAbort&&(c=S=>p(S,!0)))})};i.status&&(i.status.fetchDispatched=!0);let g=new Promise(u).then(p,y),A=Object.assign(g,{__abortController:h,__staleWhileFetching:n,__returned:void 0});return e===void 0?(this.set(t,A,{...l.options,status:void 0}),e=this.#n.get(t)):this.#t[e]=A,A}#e(t){if(!this.#T)return!1;let e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof AbortController}async fetch(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:h=this.ttl,noDisposeOnSet:f=this.noDisposeOnSet,size:l=0,sizeCalculation:p=this.sizeCalculation,noUpdateTTL:y=this.noUpdateTTL,noDeleteOnFetchRejection:a=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:u=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:A=this.allowStaleOnFetchAbort,context:c,forceRefresh:w=!1,status:o,signal:S}=e;if(!this.#T)return o&&(o.fetch="get"),this.get(t,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:o});let m={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:h,noDisposeOnSet:f,size:l,sizeCalculation:p,noUpdateTTL:y,noDeleteOnFetchRejection:a,allowStaleOnFetchRejection:u,allowStaleOnFetchAbort:A,ignoreFetchAbort:g,status:o,signal:S},d=this.#n.get(t);if(d===void 0){o&&(o.fetch="miss");let _=this.#R(t,d,m,c);return _.__returned=_}else{let _=this.#t[d];if(this.#e(_)){let U=i&&_.__staleWhileFetching!==void 0;return o&&(o.fetch="inflight",U&&(o.returnedStale=!0)),U?_.__staleWhileFetching:_.__returned=_}let z=this.#u(d);if(!w&&!z)return o&&(o.fetch="hit"),this.#E(d),s&&this.#O(d),o&&this.#z(o,d),_;let b=this.#R(t,d,m,c),j=b.__staleWhileFetching!==void 0&&i;return o&&(o.fetch=z?"stale":"refresh",j&&z&&(o.returnedStale=!0)),j?b.__staleWhileFetching:b.__returned=b}}get(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:h}=e,f=this.#n.get(t);if(f!==void 0){let l=this.#t[f],p=this.#e(l);return h&&this.#z(h,f),this.#u(f)?(h&&(h.get="stale"),p?(h&&i&&l.__staleWhileFetching!==void 0&&(h.returnedStale=!0),i?l.__staleWhileFetching:void 0):(n||this.delete(t),h&&i&&(h.returnedStale=!0),i?l:void 0)):(h&&(h.get="hit"),p?l.__staleWhileFetching:(this.#E(f),s&&this.#O(f),l))}else h&&(h.get="miss")}#M(t,e){this.#c[e]=t,this.#o[t]=e}#E(t){t!==this.#h&&(t===this.#l?this.#l=this.#o[t]:this.#M(this.#c[t],this.#o[t]),this.#M(this.#h,t),this.#h=t)}delete(t){let e=!1;if(this.#s!==0){let i=this.#n.get(t);if(i!==void 0)if(e=!0,this.#s===1)this.clear();else{this.#v(i);let s=this.#t[i];this.#e(s)?s.__abortController.abort(new Error("deleted")):(this.#y||this.#a)&&(this.#y&&this.#_?.(s,t,"delete"),this.#a&&this.#r?.push([s,t,"delete"])),this.#n.delete(t),this.#i[i]=void 0,this.#t[i]=void 0,i===this.#h?this.#h=this.#c[i]:i===this.#l?this.#l=this.#o[i]:(this.#o[this.#c[i]]=this.#o[i],this.#c[this.#o[i]]=this.#c[i]),this.#s--,this.#w.push(i)}}if(this.#a&&this.#r?.length){let i=this.#r,s;for(;s=i?.shift();)this.#g?.(...s)}return e}clear(){for(let t of this.#b({allowStale:!0})){let e=this.#t[t];if(this.#e(e))e.__abortController.abort(new Error("deleted"));else{let i=this.#i[t];this.#y&&this.#_?.(e,i,"delete"),this.#a&&this.#r?.push([e,i,"delete"])}}if(this.#n.clear(),this.#t.fill(void 0),this.#i.fill(void 0),this.#S&&this.#A&&(this.#S.fill(0),this.#A.fill(0)),this.#F&&this.#F.fill(0),this.#l=0,this.#h=0,this.#w.length=0,this.#p=0,this.#s=0,this.#a&&this.#r){let t=this.#r,e;for(;e=t?.shift();)this.#g?.(...e)}}};W.LRUCache=E;W.default=E});var B=exports&&exports.__importDefault||function(r){return r&&r.__esModule?r:{default:r}},L=B(H());module.exports=Object.assign(L.default,{default:L.default,LRUCache:L.default}); -//# sourceMappingURL=index.min.js.map diff --git a/node_modules/mysql2/node_modules/lru-cache/dist/cjs/index.min.js.map b/node_modules/mysql2/node_modules/lru-cache/dist/cjs/index.min.js.map deleted file mode 100644 index e7d19cc..0000000 --- a/node_modules/mysql2/node_modules/lru-cache/dist/cjs/index.min.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../src/index.ts", "../../src/index-cjs.ts"], - "sourcesContent": ["/**\n * @module LRUCache\n */\n\n// module-private names and types\ntype Perf = { now: () => number }\nconst perf: Perf =\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ? performance\n : Date\n\nconst warned = new Set()\n\n// either a function or a class\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC\n) => {\n typeof process === 'object' &&\n process &&\n typeof process.emitWarning === 'function'\n ? process.emitWarning(msg, type, code, fn)\n : console.error(`[${code}] ${type}: ${msg}`)\n}\n\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\ntype PosInt = number & { [TYPE]: 'Positive Integer' }\ntype Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: any): n is PosInt =>\n n && n === Math.floor(n) && n > 0 && isFinite(n)\n\ntype UintArray = Uint8Array | Uint16Array | Uint32Array\ntype NumberArray = UintArray | number[]\n\n/* c8 ignore start */\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\nconst getUintArray = (max: number) =>\n !isPosInt(max)\n ? null\n : max <= Math.pow(2, 8)\n ? Uint8Array\n : max <= Math.pow(2, 16)\n ? Uint16Array\n : max <= Math.pow(2, 32)\n ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER\n ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\n\ntype StackLike = Stack | Index[]\nclass Stack {\n heap: NumberArray\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(\n max: number,\n HeapCls: { new (n: number): NumberArray }\n ) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\ntype DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n */\n export type DisposeReason = 'evict' | 'set' | 'delete'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Status object that may be passed to {@link LRUCache#fetch},\n * {@link LRUCache#get}, {@link LRUCache#set}, and {@link LRUCache#has}.\n */\n export interface Status {\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss'\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The old value, specified in the case of `set:'update'` or\n * `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no fetchMethod, so {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link OptionsBase.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions\n extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions\n extends FetcherFetchOptions {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext\n extends FetchOptions {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext\n extends FetchOptions {\n context?: undefined\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions\n extends Pick, 'updateAgeOnHas'> {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions\n extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions\n extends Pick, 'allowStale'> {}\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions\n extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions\n ) => Promise | V | void | undefined\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed\n * by default, and MAY live in the cache long after they have expired.\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * Must be an integer number of ms. If set to 0, this indicates \"no TTL\"\n *\n * @default 0\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n * Note that this may significantly degrade performance,\n * especially if the cache is storing a large number of items.\n * It is almost always best to just leave the stale items in\n * the cache, and let them fall out as new items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * @default false\n */\n ttlAutopurge?: boolean\n\n /**\n * Update the age of items on {@link LRUCache#get}, renewing their TTL\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * @default false\n */\n updateAgeOnGet?: boolean\n\n /**\n * Update the age of items on {@link LRUCache#has}, renewing their TTL\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * @default false\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the cache.\n * This can be handy if you want to close file descriptors or do other\n * cleanup tasks when items are no longer accessible. Called with `key,\n * value`. It's called before actually removing the item from the\n * internal cache, so it is *NOT* safe to re-add them.\n *\n * Use {@link OptionsBase.disposeAfter} if you wish to dispose items after\n * they have been full removed, when it is safe to add them back to the\n * cache.\n */\n dispose?: Disposer\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when\n * setting a new value for an existing key (ie, when updating a value\n * rather than inserting a new value). Note that the TTL value is\n * _always_ set (if provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n */\n noUpdateTTL?: boolean\n\n /**\n * If you wish to track item size, you must provide a maxSize\n * note that we still will only keep up to max *actual items*,\n * if max is set, so size tracking may cause fewer than max items\n * to be stored. At the extreme, a single item of maxSize size\n * will cause everything else in the cache to be dropped when it\n * is added. Use with caution!\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod}, then it will not be stored in the\n * cache.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n */\n fetchMethod?: Fetcher\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the\n * {@link LRUCache#fetch} fails, not any other times.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches an `'abort'`\n * event, whether user-triggered, or due to internal cache behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and its return\n * value will be ignored and not cached.\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls are not\n * immediately resolved or rejected when they are aborted, and instead\n * take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n }\n\n export interface OptionsMaxLimit\n extends OptionsBase {\n max: Count\n }\n export interface OptionsTTLLimit\n extends OptionsBase {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit\n extends OptionsBase {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump}\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * All properties from the options object (with the exception of\n * {@link OptionsBase.max} and {@link OptionsBase.maxSize}) are added as\n * normal public members. (`max` and `maxBase` are read-only getters.)\n * Changing any of these will alter the defaults for subsequent method calls,\n * but is otherwise safe.\n */\nexport class LRUCache {\n // properties coming in from the options of these, only max and maxSize\n // really *need* to be protected. The rest can be modified, as they just\n // set defaults for various methods.\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: any) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: any\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context\n ),\n moveToTail: (index: number): void =>\n c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) =>\n c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) =>\n c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(\n options: LRUCache.Options | LRUCache\n ) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n } = options\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize'\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (\n fetchMethod !== undefined &&\n typeof fetchMethod !== 'function'\n ) {\n throw new TypeError(\n 'fetchMethod must be a function if specified'\n )\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = new Array(max).fill(undefined)\n this.#valList = new Array(max).fill(undefined)\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified'\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified'\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0\n ? ttlResolution\n : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError(\n 'ttl must be a positive integer if specified'\n )\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required'\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the remaining TTL time for a given entry key\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n\n this.#setItemTTL = (index, ttl, start = perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n if (ttl !== 0 && this.ttlAutopurge) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.delete(this.#keyList[index] as K)\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? perf.now() : 0\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n status.remainingTTL = status.now + ttl - start\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(\n () => (cachedNow = 0),\n this.ttlResolution\n )\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n return ttls[index] === 0 || starts[index] === 0\n ? Infinity\n : starts[index] + ttls[index] - (cachedNow || getNow())\n }\n\n this.#isStale = index => {\n return (\n ttls[index] !== 0 &&\n starts[index] !== 0 &&\n (cachedNow || getNow()) - starts[index] > ttls[index]\n )\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index]\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n return 0\n }\n if (!isPosInt(size)) {\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)'\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.'\n )\n }\n }\n return size\n }\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index]\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index]\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status\n ) => void = (_i, _s, _st) => {}\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache'\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; true; ) {\n if (!this.#isValidIndex(i)) {\n break\n }\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; true; ) {\n if (!this.#isValidIndex(i)) {\n break\n }\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (\n k !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (\n k !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (\n v !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (\n v !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to Array.find(). fn is called as fn(value, key, cache).\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {}\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from\n * most recently used to least recently used. fn is called as\n * fn(value, key, cache). Does not update age or recenty of use.\n * Does not iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => any,\n thisp: any = this\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => any,\n thisp: any = this\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.delete(this.#keyList[i] as K)\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to cache.load()\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = perf.now() - this.#starts[i]\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n * Note that the shape of the resulting cache may be different if the\n * same options are not used in both caches.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = perf.now() - age\n }\n this.set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n */\n set(\n k: K,\n v: V | BackgroundFetch,\n setOptions: LRUCache.SetOptions = {}\n ) {\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n // have to delete, in case something is there already.\n this.delete(k)\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0\n ? this.#tail\n : this.#free.length !== 0\n ? this.#free.pop()\n : this.#size === this.#max\n ? this.#evict(false)\n : this.#size\n ) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n } else {\n // update\n this.#moveToTail(index)\n const oldVal = this.#valList[index] as V | BackgroundFetch\n if (v !== oldVal) {\n if (this.#hasFetchMethod && this.#isBackgroundFetch(oldVal)) {\n oldVal.__abortController.abort(new Error('replaced'))\n } else if (!noDisposeOnSet) {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal as V, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal as V, k, 'set'])\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (status) {\n status.set = 'replace'\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal)\n ? oldVal.__staleWhileFetching\n : oldVal\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n } else if (status) {\n status.set = 'update'\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head] as K\n const v = this.#valList[head] as V\n if (this.#hasFetchMethod && this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('evicted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } =\n hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (\n index !== undefined &&\n (allowStale || !this.#isStale(index))\n ) {\n const v = this.#valList[index]\n // either stale and allowed, or forcing a refresh of non-stale value\n return this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n }\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: any\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AbortController()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (\n v: V | void | undefined,\n updateCache = false\n ): V | undefined | void => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n if (v === undefined) {\n if (bf.__staleWhileFetching) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.delete(k)\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.set(k, v, fetchOpts.options)\n }\n }\n return v\n }\n\n const eb = (er: any) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er\n }\n return fetchFail(er)\n }\n\n const fetchFail = (er: any): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted =\n aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del = !noDelete || bf.__staleWhileFetching === undefined\n if (del) {\n this.delete(k)\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | void | undefined) => void,\n rej: (e: any) => void\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v), rej)\n }\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (\n !options.ignoreFetchAbort ||\n options.allowStaleOnFetchAbort\n ) {\n res()\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: any): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AbortController\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n */\n fetch(\n k: K,\n fetchOptions: unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext\n ): Promise\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC\n ? K\n : FC extends undefined | void\n ? K\n : never,\n fetchOptions?: unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : never\n ): Promise\n async fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {}\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale =\n allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n if (status) status.get = 'stale'\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.delete(k)\n }\n if (status && allowStale) status.returnedStale = true\n return allowStale ? value : undefined\n } else {\n if (\n status &&\n allowStale &&\n value.__staleWhileFetching !== undefined\n ) {\n status.returnedStale = true\n }\n return allowStale ? value.__staleWhileFetching : undefined\n }\n } else {\n if (status) status.get = 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n if (fetching) {\n return value.__staleWhileFetching\n }\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return value\n }\n } else if (status) {\n status.get = 'miss'\n }\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n deleted = true\n if (this.#size === 1) {\n this.clear()\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, 'delete')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, 'delete'])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#next[this.#prev[index]] = this.#next[index]\n this.#prev[this.#next[index]] = this.#prev[index]\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, 'delete')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, 'delete'])\n }\n }\n }\n\n this.#keyMap.clear()\n this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n\nexport default LRUCache\n", "import LRUCache from './index.js'\n\nexport = Object.assign(LRUCache, { default: LRUCache, LRUCache })\n"], - "mappings": "0fAMA,IAAMA,EACJ,OAAO,aAAgB,UACvB,aACA,OAAO,YAAY,KAAQ,WACvB,YACA,KAEAC,EAAS,IAAI,IAKbC,EAAc,CAClBC,EACAC,EACAC,EACAC,IACE,CACF,OAAO,SAAY,UACnB,SACA,OAAO,QAAQ,aAAgB,WAC3B,QAAQ,YAAYH,EAAKC,EAAMC,EAAMC,CAAE,EACvC,QAAQ,MAAM,IAAID,MAASD,MAASD,GAAK,CAC/C,EAEMI,EAAcF,GAAiB,CAACJ,EAAO,IAAII,CAAI,EAE/CG,EAAO,OAAO,MAAM,EAIpBC,EAAYC,GAChBA,GAAKA,IAAM,KAAK,MAAMA,CAAC,GAAKA,EAAI,GAAK,SAASA,CAAC,EAc3CC,EAAgBC,GACnBH,EAASG,CAAG,EAETA,GAAO,KAAK,IAAI,EAAG,CAAC,EACpB,WACAA,GAAO,KAAK,IAAI,EAAG,EAAE,EACrB,YACAA,GAAO,KAAK,IAAI,EAAG,EAAE,EACrB,YACAA,GAAO,OAAO,iBACdC,EACA,KATA,KAY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B,KAAKR,GAAkB,EACvB,KAAKD,GAAQ,EACT,KAAKgB,IAAoB,KAAKN,GAAW,CAC3C,IAAM2E,EAAK,KAAK3E,GACZ4E,EACJ,KAAQA,EAAOD,GAAI,MAAK,GACtB,KAAKvF,KAAgB,GAAGwF,CAAI,EAGlC,GAh9CF+B,EAAA,SAAA3H,EAm9CA2H,EAAA,QAAe3H,8FC3qEf4H,EAAAC,EAAA,GAAA,EAEA,OAAA,QAAS,OAAO,OAAOD,EAAA,QAAU,CAAE,QAASA,EAAA,QAAU,SAAAA,EAAA,OAAQ,CAAE", - "names": ["perf", "warned", "emitWarning", "msg", "type", "code", "fn", "shouldWarn", "TYPE", "isPosInt", "n", "getUintArray", "max", "ZeroArray", "size", "_Stack", "HeapCls", "__privateSet", "_constructing", "s", "__privateGet", "Stack", "__privateAdd", "LRUCache", "#max", "#maxSize", "#dispose", "#disposeAfter", "#fetchMethod", "#size", "#calculatedSize", "#keyMap", "#keyList", "#valList", "#next", "#prev", "#head", "#tail", "#free", "#disposed", "#sizes", "#starts", "#ttls", "#hasDispose", "#hasFetchMethod", "#hasDisposeAfter", "c", "p", "#isBackgroundFetch", "k", "index", "options", "context", "#backgroundFetch", "#moveToTail", "#indexes", "#rindexes", "#isStale", "ttl", "ttlResolution", "ttlAutopurge", "updateAgeOnGet", "updateAgeOnHas", "allowStale", "dispose", "disposeAfter", "noDisposeOnSet", "noUpdateTTL", "maxSize", "maxEntrySize", "sizeCalculation", "fetchMethod", "noDeleteOnFetchRejection", "noDeleteOnStaleGet", "allowStaleOnFetchRejection", "allowStaleOnFetchAbort", "ignoreFetchAbort", "UintArray", "#initializeSizeTracking", "#initializeTTLTracking", "key", "ttls", "starts", "#setItemTTL", "start", "t", "#updateItemAge", "#statusTTL", "status", "cachedNow", "getNow", "sizes", "#removeItemSize", "#requireSize", "v", "#addItemSize", "#evict", "_i", "_s", "_st", "_k", "_v", "i", "#isValidIndex", "getOptions", "value", "thisp", "deleted", "arr", "entry", "age", "setOptions", "oldVal", "oldValue", "dt", "task", "val", "free", "head", "hasOptions", "peekOptions", "ac", "signal", "fetchOpts", "cb", "updateCache", "aborted", "ignoreAbort", "fetchFail", "bf", "eb", "er", "allowStaleAborted", "noDelete", "pcall", "res", "rej", "fmp", "b", "fetchOptions", "forceRefresh", "stale", "isStale", "staleVal", "fetching", "#connect", "exports", "index_js_1", "__importDefault"] -} diff --git a/node_modules/mysql2/node_modules/lru-cache/dist/cjs/package.json b/node_modules/mysql2/node_modules/lru-cache/dist/cjs/package.json deleted file mode 100644 index 5bbefff..0000000 --- a/node_modules/mysql2/node_modules/lru-cache/dist/cjs/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "commonjs" -} diff --git a/node_modules/mysql2/node_modules/lru-cache/dist/mjs/index.d.ts b/node_modules/mysql2/node_modules/lru-cache/dist/mjs/index.d.ts deleted file mode 100644 index 8415eeb..0000000 --- a/node_modules/mysql2/node_modules/lru-cache/dist/mjs/index.d.ts +++ /dev/null @@ -1,807 +0,0 @@ -/** - * @module LRUCache - */ -declare const TYPE: unique symbol; -type Index = number & { - [TYPE]: 'LRUCache Index'; -}; -type UintArray = Uint8Array | Uint16Array | Uint32Array; -type NumberArray = UintArray | number[]; -declare class ZeroArray extends Array { - constructor(size: number); -} -type StackLike = Stack | Index[]; -declare class Stack { - #private; - heap: NumberArray; - length: number; - static create(max: number): StackLike; - constructor(max: number, HeapCls: { - new (n: number): NumberArray; - }); - push(n: Index): void; - pop(): Index; -} -/** - * Promise representing an in-progress {@link LRUCache#fetch} call - */ -export type BackgroundFetch = Promise & { - __returned: BackgroundFetch | undefined; - __abortController: AbortController; - __staleWhileFetching: V | undefined; -}; -export declare namespace LRUCache { - /** - * An integer greater than 0, reflecting the calculated size of items - */ - type Size = number; - /** - * Integer greater than 0, representing some number of milliseconds, or the - * time at which a TTL started counting from. - */ - type Milliseconds = number; - /** - * An integer greater than 0, reflecting a number of items - */ - type Count = number; - /** - * The reason why an item was removed from the cache, passed - * to the {@link Disposer} methods. - */ - type DisposeReason = 'evict' | 'set' | 'delete'; - /** - * A method called upon item removal, passed as the - * {@link OptionsBase.dispose} and/or - * {@link OptionsBase.disposeAfter} options. - */ - type Disposer = (value: V, key: K, reason: DisposeReason) => void; - /** - * A function that returns the effective calculated size - * of an entry in the cache. - */ - type SizeCalculator = (value: V, key: K) => Size; - /** - * Options provided to the - * {@link OptionsBase.fetchMethod} function. - */ - interface FetcherOptions { - signal: AbortSignal; - options: FetcherFetchOptions; - /** - * Object provided in the {@link FetchOptions.context} option to - * {@link LRUCache#fetch} - */ - context: FC; - } - /** - * Status object that may be passed to {@link LRUCache#fetch}, - * {@link LRUCache#get}, {@link LRUCache#set}, and {@link LRUCache#has}. - */ - interface Status { - /** - * The status of a set() operation. - * - * - add: the item was not found in the cache, and was added - * - update: the item was in the cache, with the same value provided - * - replace: the item was in the cache, and replaced - * - miss: the item was not added to the cache for some reason - */ - set?: 'add' | 'update' | 'replace' | 'miss'; - /** - * the ttl stored for the item, or undefined if ttls are not used. - */ - ttl?: Milliseconds; - /** - * the start time for the item, or undefined if ttls are not used. - */ - start?: Milliseconds; - /** - * The timestamp used for TTL calculation - */ - now?: Milliseconds; - /** - * the remaining ttl for the item, or undefined if ttls are not used. - */ - remainingTTL?: Milliseconds; - /** - * The calculated size for the item, if sizes are used. - */ - entrySize?: Size; - /** - * The total calculated size of the cache, if sizes are used. - */ - totalCalculatedSize?: Size; - /** - * A flag indicating that the item was not stored, due to exceeding the - * {@link OptionsBase.maxEntrySize} - */ - maxEntrySizeExceeded?: true; - /** - * The old value, specified in the case of `set:'update'` or - * `set:'replace'` - */ - oldValue?: V; - /** - * The results of a {@link LRUCache#has} operation - * - * - hit: the item was found in the cache - * - stale: the item was found in the cache, but is stale - * - miss: the item was not found in the cache - */ - has?: 'hit' | 'stale' | 'miss'; - /** - * The status of a {@link LRUCache#fetch} operation. - * Note that this can change as the underlying fetch() moves through - * various states. - * - * - inflight: there is another fetch() for this key which is in process - * - get: there is no fetchMethod, so {@link LRUCache#get} was called. - * - miss: the item is not in cache, and will be fetched. - * - hit: the item is in the cache, and was resolved immediately. - * - stale: the item is in the cache, but stale. - * - refresh: the item is in the cache, and not stale, but - * {@link FetchOptions.forceRefresh} was specified. - */ - fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'; - /** - * The {@link OptionsBase.fetchMethod} was called - */ - fetchDispatched?: true; - /** - * The cached value was updated after a successful call to - * {@link OptionsBase.fetchMethod} - */ - fetchUpdated?: true; - /** - * The reason for a fetch() rejection. Either the error raised by the - * {@link OptionsBase.fetchMethod}, or the reason for an - * AbortSignal. - */ - fetchError?: Error; - /** - * The fetch received an abort signal - */ - fetchAborted?: true; - /** - * The abort signal received was ignored, and the fetch was allowed to - * continue. - */ - fetchAbortIgnored?: true; - /** - * The fetchMethod promise resolved successfully - */ - fetchResolved?: true; - /** - * The fetchMethod promise was rejected - */ - fetchRejected?: true; - /** - * The status of a {@link LRUCache#get} operation. - * - * - fetching: The item is currently being fetched. If a previous value - * is present and allowed, that will be returned. - * - stale: The item is in the cache, and is stale. - * - hit: the item is in the cache - * - miss: the item is not in the cache - */ - get?: 'stale' | 'hit' | 'miss'; - /** - * A fetch or get operation returned a stale value. - */ - returnedStale?: true; - } - /** - * options which override the options set in the LRUCache constructor - * when calling {@link LRUCache#fetch}. - * - * This is the union of {@link GetOptions} and {@link SetOptions}, plus - * {@link OptionsBase.noDeleteOnFetchRejection}, - * {@link OptionsBase.allowStaleOnFetchRejection}, - * {@link FetchOptions.forceRefresh}, and - * {@link OptionsBase.context} - * - * Any of these may be modified in the {@link OptionsBase.fetchMethod} - * function, but the {@link GetOptions} fields will of course have no - * effect, as the {@link LRUCache#get} call already happened by the time - * the fetchMethod is called. - */ - interface FetcherFetchOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { - status?: Status; - size?: Size; - } - /** - * Options that may be passed to the {@link LRUCache#fetch} method. - */ - interface FetchOptions extends FetcherFetchOptions { - /** - * Set to true to force a re-load of the existing data, even if it - * is not yet stale. - */ - forceRefresh?: boolean; - /** - * Context provided to the {@link OptionsBase.fetchMethod} as - * the {@link FetcherOptions.context} param. - * - * If the FC type is specified as unknown (the default), - * undefined or void, then this is optional. Otherwise, it will - * be required. - */ - context?: FC; - signal?: AbortSignal; - status?: Status; - } - /** - * Options provided to {@link LRUCache#fetch} when the FC type is something - * other than `unknown`, `undefined`, or `void` - */ - interface FetchOptionsWithContext extends FetchOptions { - context: FC; - } - /** - * Options provided to {@link LRUCache#fetch} when the FC type is - * `undefined` or `void` - */ - interface FetchOptionsNoContext extends FetchOptions { - context?: undefined; - } - /** - * Options that may be passed to the {@link LRUCache#has} method. - */ - interface HasOptions extends Pick, 'updateAgeOnHas'> { - status?: Status; - } - /** - * Options that may be passed to the {@link LRUCache#get} method. - */ - interface GetOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'> { - status?: Status; - } - /** - * Options that may be passed to the {@link LRUCache#peek} method. - */ - interface PeekOptions extends Pick, 'allowStale'> { - } - /** - * Options that may be passed to the {@link LRUCache#set} method. - */ - interface SetOptions extends Pick, 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { - /** - * If size tracking is enabled, then setting an explicit size - * in the {@link LRUCache#set} call will prevent calling the - * {@link OptionsBase.sizeCalculation} function. - */ - size?: Size; - /** - * If TTL tracking is enabled, then setting an explicit start - * time in the {@link LRUCache#set} call will override the - * default time from `performance.now()` or `Date.now()`. - * - * Note that it must be a valid value for whichever time-tracking - * method is in use. - */ - start?: Milliseconds; - status?: Status; - } - /** - * The type signature for the {@link OptionsBase.fetchMethod} option. - */ - type Fetcher = (key: K, staleValue: V | undefined, options: FetcherOptions) => Promise | V | void | undefined; - /** - * Options which may be passed to the {@link LRUCache} constructor. - * - * Most of these may be overridden in the various options that use - * them. - * - * Despite all being technically optional, the constructor requires that - * a cache is at minimum limited by one or more of {@link OptionsBase.max}, - * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}. - * - * If {@link OptionsBase.ttl} is used alone, then it is strongly advised - * (and in fact required by the type definitions here) that the cache - * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially - * unbounded storage. - */ - interface OptionsBase { - /** - * The maximum number of items to store in the cache before evicting - * old entries. This is read-only on the {@link LRUCache} instance, - * and may not be overridden. - * - * If set, then storage space will be pre-allocated at construction - * time, and the cache will perform significantly faster. - * - * Note that significantly fewer items may be stored, if - * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also - * set. - */ - max?: Count; - /** - * Max time in milliseconds for items to live in cache before they are - * considered stale. Note that stale items are NOT preemptively removed - * by default, and MAY live in the cache long after they have expired. - * - * Also, as this cache is optimized for LRU/MRU operations, some of - * the staleness/TTL checks will reduce performance, as they will incur - * overhead by deleting items. - * - * Must be an integer number of ms. If set to 0, this indicates "no TTL" - * - * @default 0 - */ - ttl?: Milliseconds; - /** - * Minimum amount of time in ms in which to check for staleness. - * Defaults to 1, which means that the current time is checked - * at most once per millisecond. - * - * Set to 0 to check the current time every time staleness is tested. - * (This reduces performance, and is theoretically unnecessary.) - * - * Setting this to a higher value will improve performance somewhat - * while using ttl tracking, albeit at the expense of keeping stale - * items around a bit longer than their TTLs would indicate. - * - * @default 1 - */ - ttlResolution?: Milliseconds; - /** - * Preemptively remove stale items from the cache. - * Note that this may significantly degrade performance, - * especially if the cache is storing a large number of items. - * It is almost always best to just leave the stale items in - * the cache, and let them fall out as new items are added. - * - * Note that this means that {@link OptionsBase.allowStale} is a bit - * pointless, as stale items will be deleted almost as soon as they - * expire. - * - * @default false - */ - ttlAutopurge?: boolean; - /** - * Update the age of items on {@link LRUCache#get}, renewing their TTL - * - * Has no effect if {@link OptionsBase.ttl} is not set. - * - * @default false - */ - updateAgeOnGet?: boolean; - /** - * Update the age of items on {@link LRUCache#has}, renewing their TTL - * - * Has no effect if {@link OptionsBase.ttl} is not set. - * - * @default false - */ - updateAgeOnHas?: boolean; - /** - * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return - * stale data, if available. - */ - allowStale?: boolean; - /** - * Function that is called on items when they are dropped from the cache. - * This can be handy if you want to close file descriptors or do other - * cleanup tasks when items are no longer accessible. Called with `key, - * value`. It's called before actually removing the item from the - * internal cache, so it is *NOT* safe to re-add them. - * - * Use {@link OptionsBase.disposeAfter} if you wish to dispose items after - * they have been full removed, when it is safe to add them back to the - * cache. - */ - dispose?: Disposer; - /** - * The same as {@link OptionsBase.dispose}, but called *after* the entry - * is completely removed and the cache is once again in a clean state. - * It is safe to add an item right back into the cache at this point. - * However, note that it is *very* easy to inadvertently create infinite - * recursion this way. - */ - disposeAfter?: Disposer; - /** - * Set to true to suppress calling the - * {@link OptionsBase.dispose} function if the entry key is - * still accessible within the cache. - * This may be overridden by passing an options object to - * {@link LRUCache#set}. - */ - noDisposeOnSet?: boolean; - /** - * Boolean flag to tell the cache to not update the TTL when - * setting a new value for an existing key (ie, when updating a value - * rather than inserting a new value). Note that the TTL value is - * _always_ set (if provided) when adding a new entry into the cache. - * - * Has no effect if a {@link OptionsBase.ttl} is not set. - */ - noUpdateTTL?: boolean; - /** - * If you wish to track item size, you must provide a maxSize - * note that we still will only keep up to max *actual items*, - * if max is set, so size tracking may cause fewer than max items - * to be stored. At the extreme, a single item of maxSize size - * will cause everything else in the cache to be dropped when it - * is added. Use with caution! - * - * Note also that size tracking can negatively impact performance, - * though for most cases, only minimally. - */ - maxSize?: Size; - /** - * The maximum allowed size for any single item in the cache. - * - * If a larger item is passed to {@link LRUCache#set} or returned by a - * {@link OptionsBase.fetchMethod}, then it will not be stored in the - * cache. - */ - maxEntrySize?: Size; - /** - * A function that returns a number indicating the item's size. - * - * If not provided, and {@link OptionsBase.maxSize} or - * {@link OptionsBase.maxEntrySize} are set, then all - * {@link LRUCache#set} calls **must** provide an explicit - * {@link SetOptions.size} or sizeCalculation param. - */ - sizeCalculation?: SizeCalculator; - /** - * Method that provides the implementation for {@link LRUCache#fetch} - */ - fetchMethod?: Fetcher; - /** - * Set to true to suppress the deletion of stale data when a - * {@link OptionsBase.fetchMethod} returns a rejected promise. - */ - noDeleteOnFetchRejection?: boolean; - /** - * Do not delete stale items when they are retrieved with - * {@link LRUCache#get}. - * - * Note that the `get` return value will still be `undefined` - * unless {@link OptionsBase.allowStale} is true. - */ - noDeleteOnStaleGet?: boolean; - /** - * Set to true to allow returning stale data when a - * {@link OptionsBase.fetchMethod} throws an error or returns a rejected - * promise. - * - * This differs from using {@link OptionsBase.allowStale} in that stale - * data will ONLY be returned in the case that the - * {@link LRUCache#fetch} fails, not any other times. - */ - allowStaleOnFetchRejection?: boolean; - /** - * Set to true to return a stale value from the cache when the - * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches an `'abort'` - * event, whether user-triggered, or due to internal cache behavior. - * - * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying - * {@link OptionsBase.fetchMethod} will still be considered canceled, and its return - * value will be ignored and not cached. - */ - allowStaleOnFetchAbort?: boolean; - /** - * Set to true to ignore the `abort` event emitted by the `AbortSignal` - * object passed to {@link OptionsBase.fetchMethod}, and still cache the - * resulting resolution value, as long as it is not `undefined`. - * - * When used on its own, this means aborted {@link LRUCache#fetch} calls are not - * immediately resolved or rejected when they are aborted, and instead - * take the full time to await. - * - * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted - * {@link LRUCache#fetch} calls will resolve immediately to their stale - * cached value or `undefined`, and will continue to process and eventually - * update the cache when they resolve, as long as the resulting value is - * not `undefined`, thus supporting a "return stale on timeout while - * refreshing" mechanism by passing `AbortSignal.timeout(n)` as the signal. - * - * **Note**: regardless of this setting, an `abort` event _is still - * emitted on the `AbortSignal` object_, so may result in invalid results - * when passed to other underlying APIs that use AbortSignals. - * - * This may be overridden in the {@link OptionsBase.fetchMethod} or the - * call to {@link LRUCache#fetch}. - */ - ignoreFetchAbort?: boolean; - } - interface OptionsMaxLimit extends OptionsBase { - max: Count; - } - interface OptionsTTLLimit extends OptionsBase { - ttl: Milliseconds; - ttlAutopurge: boolean; - } - interface OptionsSizeLimit extends OptionsBase { - maxSize: Size; - } - /** - * The valid safe options for the {@link LRUCache} constructor - */ - type Options = OptionsMaxLimit | OptionsSizeLimit | OptionsTTLLimit; - /** - * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump} - */ - interface Entry { - value: V; - ttl?: Milliseconds; - size?: Size; - start?: Milliseconds; - } -} -/** - * Default export, the thing you're using this module to get. - * - * All properties from the options object (with the exception of - * {@link OptionsBase.max} and {@link OptionsBase.maxSize}) are added as - * normal public members. (`max` and `maxBase` are read-only getters.) - * Changing any of these will alter the defaults for subsequent method calls, - * but is otherwise safe. - */ -export declare class LRUCache { - #private; - /** - * {@link LRUCache.OptionsBase.ttl} - */ - ttl: LRUCache.Milliseconds; - /** - * {@link LRUCache.OptionsBase.ttlResolution} - */ - ttlResolution: LRUCache.Milliseconds; - /** - * {@link LRUCache.OptionsBase.ttlAutopurge} - */ - ttlAutopurge: boolean; - /** - * {@link LRUCache.OptionsBase.updateAgeOnGet} - */ - updateAgeOnGet: boolean; - /** - * {@link LRUCache.OptionsBase.updateAgeOnHas} - */ - updateAgeOnHas: boolean; - /** - * {@link LRUCache.OptionsBase.allowStale} - */ - allowStale: boolean; - /** - * {@link LRUCache.OptionsBase.noDisposeOnSet} - */ - noDisposeOnSet: boolean; - /** - * {@link LRUCache.OptionsBase.noUpdateTTL} - */ - noUpdateTTL: boolean; - /** - * {@link LRUCache.OptionsBase.maxEntrySize} - */ - maxEntrySize: LRUCache.Size; - /** - * {@link LRUCache.OptionsBase.sizeCalculation} - */ - sizeCalculation?: LRUCache.SizeCalculator; - /** - * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} - */ - noDeleteOnFetchRejection: boolean; - /** - * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} - */ - noDeleteOnStaleGet: boolean; - /** - * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} - */ - allowStaleOnFetchAbort: boolean; - /** - * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} - */ - allowStaleOnFetchRejection: boolean; - /** - * {@link LRUCache.OptionsBase.ignoreFetchAbort} - */ - ignoreFetchAbort: boolean; - /** - * Do not call this method unless you need to inspect the - * inner workings of the cache. If anything returned by this - * object is modified in any way, strange breakage may occur. - * - * These fields are private for a reason! - * - * @internal - */ - static unsafeExposeInternals(c: LRUCache): { - starts: ZeroArray | undefined; - ttls: ZeroArray | undefined; - sizes: ZeroArray | undefined; - keyMap: Map; - keyList: (K | undefined)[]; - valList: (V | BackgroundFetch | undefined)[]; - next: NumberArray; - prev: NumberArray; - readonly head: Index; - readonly tail: Index; - free: StackLike; - isBackgroundFetch: (p: any) => boolean; - backgroundFetch: (k: K, index: number | undefined, options: LRUCache.FetchOptions, context: any) => BackgroundFetch; - moveToTail: (index: number) => void; - indexes: (options?: { - allowStale: boolean; - }) => Generator; - rindexes: (options?: { - allowStale: boolean; - }) => Generator; - isStale: (index: number | undefined) => boolean; - }; - /** - * {@link LRUCache.OptionsBase.max} (read-only) - */ - get max(): LRUCache.Count; - /** - * {@link LRUCache.OptionsBase.maxSize} (read-only) - */ - get maxSize(): LRUCache.Count; - /** - * The total computed size of items in the cache (read-only) - */ - get calculatedSize(): LRUCache.Size; - /** - * The number of items stored in the cache (read-only) - */ - get size(): LRUCache.Count; - /** - * {@link LRUCache.OptionsBase.fetchMethod} (read-only) - */ - get fetchMethod(): LRUCache.Fetcher | undefined; - /** - * {@link LRUCache.OptionsBase.dispose} (read-only) - */ - get dispose(): LRUCache.Disposer | undefined; - /** - * {@link LRUCache.OptionsBase.disposeAfter} (read-only) - */ - get disposeAfter(): LRUCache.Disposer | undefined; - constructor(options: LRUCache.Options | LRUCache); - /** - * Return the remaining TTL time for a given entry key - */ - getRemainingTTL(key: K): number; - /** - * Return a generator yielding `[key, value]` pairs, - * in order from most recently used to least recently used. - */ - entries(): Generator<(K | V | BackgroundFetch | undefined)[], void, unknown>; - /** - * Inverse order version of {@link LRUCache.entries} - * - * Return a generator yielding `[key, value]` pairs, - * in order from least recently used to most recently used. - */ - rentries(): Generator<(K | V | BackgroundFetch | undefined)[], void, unknown>; - /** - * Return a generator yielding the keys in the cache, - * in order from most recently used to least recently used. - */ - keys(): Generator; - /** - * Inverse order version of {@link LRUCache.keys} - * - * Return a generator yielding the keys in the cache, - * in order from least recently used to most recently used. - */ - rkeys(): Generator; - /** - * Return a generator yielding the values in the cache, - * in order from most recently used to least recently used. - */ - values(): Generator | undefined, void, unknown>; - /** - * Inverse order version of {@link LRUCache.values} - * - * Return a generator yielding the values in the cache, - * in order from least recently used to most recently used. - */ - rvalues(): Generator | undefined, void, unknown>; - /** - * Iterating over the cache itself yields the same results as - * {@link LRUCache.entries} - */ - [Symbol.iterator](): Generator<(K | V | BackgroundFetch | undefined)[], void, unknown>; - /** - * Find a value for which the supplied fn method returns a truthy value, - * similar to Array.find(). fn is called as fn(value, key, cache). - */ - find(fn: (v: V, k: K, self: LRUCache) => boolean, getOptions?: LRUCache.GetOptions): V | undefined; - /** - * Call the supplied function on each item in the cache, in order from - * most recently used to least recently used. fn is called as - * fn(value, key, cache). Does not update age or recenty of use. - * Does not iterate over stale values. - */ - forEach(fn: (v: V, k: K, self: LRUCache) => any, thisp?: any): void; - /** - * The same as {@link LRUCache.forEach} but items are iterated over in - * reverse order. (ie, less recently used items are iterated over first.) - */ - rforEach(fn: (v: V, k: K, self: LRUCache) => any, thisp?: any): void; - /** - * Delete any stale entries. Returns true if anything was removed, - * false otherwise. - */ - purgeStale(): boolean; - /** - * Return an array of [key, {@link LRUCache.Entry}] tuples which can be - * passed to cache.load() - */ - dump(): [K, LRUCache.Entry][]; - /** - * Reset the cache and load in the items in entries in the order listed. - * Note that the shape of the resulting cache may be different if the - * same options are not used in both caches. - */ - load(arr: [K, LRUCache.Entry][]): void; - /** - * Add a value to the cache. - */ - set(k: K, v: V | BackgroundFetch, setOptions?: LRUCache.SetOptions): this; - /** - * Evict the least recently used item, returning its value or - * `undefined` if cache is empty. - */ - pop(): V | undefined; - /** - * Check if a key is in the cache, without updating the recency of use. - * Will return false if the item is stale, even though it is technically - * in the cache. - * - * Will not update item age unless - * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. - */ - has(k: K, hasOptions?: LRUCache.HasOptions): boolean; - /** - * Like {@link LRUCache#get} but doesn't update recency or delete stale - * items. - * - * Returns `undefined` if the item is stale, unless - * {@link LRUCache.OptionsBase.allowStale} is set. - */ - peek(k: K, peekOptions?: LRUCache.PeekOptions): V | undefined; - /** - * Make an asynchronous cached fetch using the - * {@link LRUCache.OptionsBase.fetchMethod} function. - * - * If multiple fetches for the same key are issued, then they will all be - * coalesced into a single call to fetchMethod. - * - * Note that this means that handling options such as - * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}, - * {@link LRUCache.FetchOptions.signal}, - * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be - * determined by the FIRST fetch() call for a given key. - * - * This is a known (fixable) shortcoming which will be addresed on when - * someone complains about it, as the fix would involve added complexity and - * may not be worth the costs for this edge case. - */ - fetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; - fetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; - /** - * Return a value from the cache. Will update the recency of the cache - * entry found. - * - * If the key is not found, get() will return `undefined`. - */ - get(k: K, getOptions?: LRUCache.GetOptions): V | undefined; - /** - * Deletes a key out of the cache. - * Returns true if the key was deleted, false otherwise. - */ - delete(k: K): boolean; - /** - * Clear the cache entirely, throwing away all values. - */ - clear(): void; -} -export default LRUCache; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/mysql2/node_modules/lru-cache/dist/mjs/index.d.ts.map b/node_modules/mysql2/node_modules/lru-cache/dist/mjs/index.d.ts.map deleted file mode 100644 index 2f068e4..0000000 --- a/node_modules/mysql2/node_modules/lru-cache/dist/mjs/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AA+BH,QAAA,MAAM,IAAI,eAAiB,CAAA;AAE3B,KAAK,KAAK,GAAG,MAAM,GAAG;IAAE,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAA;CAAE,CAAA;AAKlD,KAAK,SAAS,GAAG,UAAU,GAAG,WAAW,GAAG,WAAW,CAAA;AACvD,KAAK,WAAW,GAAG,SAAS,GAAG,MAAM,EAAE,CAAA;AAyBvC,cAAM,SAAU,SAAQ,KAAK,CAAC,MAAM,CAAC;gBACvB,IAAI,EAAE,MAAM;CAIzB;AAED,KAAK,SAAS,GAAG,KAAK,GAAG,KAAK,EAAE,CAAA;AAChC,cAAM,KAAK;;IACT,IAAI,EAAE,WAAW,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;IAGd,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS;gBASnC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,GAAG,WAAW,CAAA;KAAE;IAU3C,IAAI,CAAC,CAAC,EAAE,KAAK;IAGb,GAAG,IAAI,KAAK;CAGb;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC,GAAG;IAC/D,UAAU,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,SAAS,CAAA;IAC1C,iBAAiB,EAAE,eAAe,CAAA;IAClC,oBAAoB,EAAE,CAAC,G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AC,EAAE,EAAE,CAAM;IAgFxD;;;OAGG;IACH,MAAM,CAAC,CAAC,EAAE,CAAC;IA+CX;;OAEG;IACH,KAAK;CAuCN;AAED,eAAe,QAAQ,CAAA"} \ No newline at end of file diff --git a/node_modules/mysql2/node_modules/lru-cache/dist/mjs/index.js b/node_modules/mysql2/node_modules/lru-cache/dist/mjs/index.js deleted file mode 100644 index fdb1ce2..0000000 --- a/node_modules/mysql2/node_modules/lru-cache/dist/mjs/index.js +++ /dev/null @@ -1,1330 +0,0 @@ -/** - * @module LRUCache - */ -const perf = typeof performance === 'object' && - performance && - typeof performance.now === 'function' - ? performance - : Date; -const warned = new Set(); -const emitWarning = (msg, type, code, fn) => { - typeof process === 'object' && - process && - typeof process.emitWarning === 'function' - ? process.emitWarning(msg, type, code, fn) - : console.error(`[${code}] ${type}: ${msg}`); -}; -const shouldWarn = (code) => !warned.has(code); -const TYPE = Symbol('type'); -const isPosInt = (n) => n && n === Math.floor(n) && n > 0 && isFinite(n); -/* c8 ignore start */ -// This is a little bit ridiculous, tbh. -// The maximum array length is 2^32-1 or thereabouts on most JS impls. -// And well before that point, you're caching the entire world, I mean, -// that's ~32GB of just integers for the next/prev links, plus whatever -// else to hold that many keys and values. Just filling the memory with -// zeroes at init time is brutal when you get that big. -// But why not be complete? -// Maybe in the future, these limits will have expanded. -const getUintArray = (max) => !isPosInt(max) - ? null - : max <= Math.pow(2, 8) - ? Uint8Array - : max <= Math.pow(2, 16) - ? Uint16Array - : max <= Math.pow(2, 32) - ? Uint32Array - : max <= Number.MAX_SAFE_INTEGER - ? ZeroArray - : null; -/* c8 ignore stop */ -class ZeroArray extends Array { - constructor(size) { - super(size); - this.fill(0); - } -} -class Stack { - heap; - length; - // private constructor - static #constructing = false; - static create(max) { - const HeapCls = getUintArray(max); - if (!HeapCls) - return []; - Stack.#constructing = true; - const s = new Stack(max, HeapCls); - Stack.#constructing = false; - return s; - } - constructor(max, HeapCls) { - /* c8 ignore start */ - if (!Stack.#constructing) { - throw new TypeError('instantiate Stack using Stack.create(n)'); - } - /* c8 ignore stop */ - this.heap = new HeapCls(max); - this.length = 0; - } - push(n) { - this.heap[this.length++] = n; - } - pop() { - return this.heap[--this.length]; - } -} -/** - * Default export, the thing you're using this module to get. - * - * All properties from the options object (with the exception of - * {@link OptionsBase.max} and {@link OptionsBase.maxSize}) are added as - * normal public members. (`max` and `maxBase` are read-only getters.) - * Changing any of these will alter the defaults for subsequent method calls, - * but is otherwise safe. - */ -export class LRUCache { - // properties coming in from the options of these, only max and maxSize - // really *need* to be protected. The rest can be modified, as they just - // set defaults for various methods. - #max; - #maxSize; - #dispose; - #disposeAfter; - #fetchMethod; - /** - * {@link LRUCache.OptionsBase.ttl} - */ - ttl; - /** - * {@link LRUCache.OptionsBase.ttlResolution} - */ - ttlResolution; - /** - * {@link LRUCache.OptionsBase.ttlAutopurge} - */ - ttlAutopurge; - /** - * {@link LRUCache.OptionsBase.updateAgeOnGet} - */ - updateAgeOnGet; - /** - * {@link LRUCache.OptionsBase.updateAgeOnHas} - */ - updateAgeOnHas; - /** - * {@link LRUCache.OptionsBase.allowStale} - */ - allowStale; - /** - * {@link LRUCache.OptionsBase.noDisposeOnSet} - */ - noDisposeOnSet; - /** - * {@link LRUCache.OptionsBase.noUpdateTTL} - */ - noUpdateTTL; - /** - * {@link LRUCache.OptionsBase.maxEntrySize} - */ - maxEntrySize; - /** - * {@link LRUCache.OptionsBase.sizeCalculation} - */ - sizeCalculation; - /** - * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} - */ - noDeleteOnFetchRejection; - /** - * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} - */ - noDeleteOnStaleGet; - /** - * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} - */ - allowStaleOnFetchAbort; - /** - * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} - */ - allowStaleOnFetchRejection; - /** - * {@link LRUCache.OptionsBase.ignoreFetchAbort} - */ - ignoreFetchAbort; - // computed properties - #size; - #calculatedSize; - #keyMap; - #keyList; - #valList; - #next; - #prev; - #head; - #tail; - #free; - #disposed; - #sizes; - #starts; - #ttls; - #hasDispose; - #hasFetchMethod; - #hasDisposeAfter; - /** - * Do not call this method unless you need to inspect the - * inner workings of the cache. If anything returned by this - * object is modified in any way, strange breakage may occur. - * - * These fields are private for a reason! - * - * @internal - */ - static unsafeExposeInternals(c) { - return { - // properties - starts: c.#starts, - ttls: c.#ttls, - sizes: c.#sizes, - keyMap: c.#keyMap, - keyList: c.#keyList, - valList: c.#valList, - next: c.#next, - prev: c.#prev, - get head() { - return c.#head; - }, - get tail() { - return c.#tail; - }, - free: c.#free, - // methods - isBackgroundFetch: (p) => c.#isBackgroundFetch(p), - backgroundFetch: (k, index, options, context) => c.#backgroundFetch(k, index, options, context), - moveToTail: (index) => c.#moveToTail(index), - indexes: (options) => c.#indexes(options), - rindexes: (options) => c.#rindexes(options), - isStale: (index) => c.#isStale(index), - }; - } - // Protected read-only members - /** - * {@link LRUCache.OptionsBase.max} (read-only) - */ - get max() { - return this.#max; - } - /** - * {@link LRUCache.OptionsBase.maxSize} (read-only) - */ - get maxSize() { - return this.#maxSize; - } - /** - * The total computed size of items in the cache (read-only) - */ - get calculatedSize() { - return this.#calculatedSize; - } - /** - * The number of items stored in the cache (read-only) - */ - get size() { - return this.#size; - } - /** - * {@link LRUCache.OptionsBase.fetchMethod} (read-only) - */ - get fetchMethod() { - return this.#fetchMethod; - } - /** - * {@link LRUCache.OptionsBase.dispose} (read-only) - */ - get dispose() { - return this.#dispose; - } - /** - * {@link LRUCache.OptionsBase.disposeAfter} (read-only) - */ - get disposeAfter() { - return this.#disposeAfter; - } - constructor(options) { - const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, } = options; - if (max !== 0 && !isPosInt(max)) { - throw new TypeError('max option must be a nonnegative integer'); - } - const UintArray = max ? getUintArray(max) : Array; - if (!UintArray) { - throw new Error('invalid max value: ' + max); - } - this.#max = max; - this.#maxSize = maxSize; - this.maxEntrySize = maxEntrySize || this.#maxSize; - this.sizeCalculation = sizeCalculation; - if (this.sizeCalculation) { - if (!this.#maxSize && !this.maxEntrySize) { - throw new TypeError('cannot set sizeCalculation without setting maxSize or maxEntrySize'); - } - if (typeof this.sizeCalculation !== 'function') { - throw new TypeError('sizeCalculation set to non-function'); - } - } - if (fetchMethod !== undefined && - typeof fetchMethod !== 'function') { - throw new TypeError('fetchMethod must be a function if specified'); - } - this.#fetchMethod = fetchMethod; - this.#hasFetchMethod = !!fetchMethod; - this.#keyMap = new Map(); - this.#keyList = new Array(max).fill(undefined); - this.#valList = new Array(max).fill(undefined); - this.#next = new UintArray(max); - this.#prev = new UintArray(max); - this.#head = 0; - this.#tail = 0; - this.#free = Stack.create(max); - this.#size = 0; - this.#calculatedSize = 0; - if (typeof dispose === 'function') { - this.#dispose = dispose; - } - if (typeof disposeAfter === 'function') { - this.#disposeAfter = disposeAfter; - this.#disposed = []; - } - else { - this.#disposeAfter = undefined; - this.#disposed = undefined; - } - this.#hasDispose = !!this.#dispose; - this.#hasDisposeAfter = !!this.#disposeAfter; - this.noDisposeOnSet = !!noDisposeOnSet; - this.noUpdateTTL = !!noUpdateTTL; - this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection; - this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection; - this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort; - this.ignoreFetchAbort = !!ignoreFetchAbort; - // NB: maxEntrySize is set to maxSize if it's set - if (this.maxEntrySize !== 0) { - if (this.#maxSize !== 0) { - if (!isPosInt(this.#maxSize)) { - throw new TypeError('maxSize must be a positive integer if specified'); - } - } - if (!isPosInt(this.maxEntrySize)) { - throw new TypeError('maxEntrySize must be a positive integer if specified'); - } - this.#initializeSizeTracking(); - } - this.allowStale = !!allowStale; - this.noDeleteOnStaleGet = !!noDeleteOnStaleGet; - this.updateAgeOnGet = !!updateAgeOnGet; - this.updateAgeOnHas = !!updateAgeOnHas; - this.ttlResolution = - isPosInt(ttlResolution) || ttlResolution === 0 - ? ttlResolution - : 1; - this.ttlAutopurge = !!ttlAutopurge; - this.ttl = ttl || 0; - if (this.ttl) { - if (!isPosInt(this.ttl)) { - throw new TypeError('ttl must be a positive integer if specified'); - } - this.#initializeTTLTracking(); - } - // do not allow completely unbounded caches - if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) { - throw new TypeError('At least one of max, maxSize, or ttl is required'); - } - if (!this.ttlAutopurge && !this.#max && !this.#maxSize) { - const code = 'LRU_CACHE_UNBOUNDED'; - if (shouldWarn(code)) { - warned.add(code); - const msg = 'TTL caching without ttlAutopurge, max, or maxSize can ' + - 'result in unbounded memory consumption.'; - emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache); - } - } - } - /** - * Return the remaining TTL time for a given entry key - */ - getRemainingTTL(key) { - return this.#keyMap.has(key) ? Infinity : 0; - } - #initializeTTLTracking() { - const ttls = new ZeroArray(this.#max); - const starts = new ZeroArray(this.#max); - this.#ttls = ttls; - this.#starts = starts; - this.#setItemTTL = (index, ttl, start = perf.now()) => { - starts[index] = ttl !== 0 ? start : 0; - ttls[index] = ttl; - if (ttl !== 0 && this.ttlAutopurge) { - const t = setTimeout(() => { - if (this.#isStale(index)) { - this.delete(this.#keyList[index]); - } - }, ttl + 1); - // unref() not supported on all platforms - /* c8 ignore start */ - if (t.unref) { - t.unref(); - } - /* c8 ignore stop */ - } - }; - this.#updateItemAge = index => { - starts[index] = ttls[index] !== 0 ? perf.now() : 0; - }; - this.#statusTTL = (status, index) => { - if (ttls[index]) { - const ttl = ttls[index]; - const start = starts[index]; - status.ttl = ttl; - status.start = start; - status.now = cachedNow || getNow(); - status.remainingTTL = status.now + ttl - start; - } - }; - // debounce calls to perf.now() to 1s so we're not hitting - // that costly call repeatedly. - let cachedNow = 0; - const getNow = () => { - const n = perf.now(); - if (this.ttlResolution > 0) { - cachedNow = n; - const t = setTimeout(() => (cachedNow = 0), this.ttlResolution); - // not available on all platforms - /* c8 ignore start */ - if (t.unref) { - t.unref(); - } - /* c8 ignore stop */ - } - return n; - }; - this.getRemainingTTL = key => { - const index = this.#keyMap.get(key); - if (index === undefined) { - return 0; - } - return ttls[index] === 0 || starts[index] === 0 - ? Infinity - : starts[index] + ttls[index] - (cachedNow || getNow()); - }; - this.#isStale = index => { - return (ttls[index] !== 0 && - starts[index] !== 0 && - (cachedNow || getNow()) - starts[index] > ttls[index]); - }; - } - // conditionally set private methods related to TTL - #updateItemAge = () => { }; - #statusTTL = () => { }; - #setItemTTL = () => { }; - /* c8 ignore stop */ - #isStale = () => false; - #initializeSizeTracking() { - const sizes = new ZeroArray(this.#max); - this.#calculatedSize = 0; - this.#sizes = sizes; - this.#removeItemSize = index => { - this.#calculatedSize -= sizes[index]; - sizes[index] = 0; - }; - this.#requireSize = (k, v, size, sizeCalculation) => { - // provisionally accept background fetches. - // actual value size will be checked when they return. - if (this.#isBackgroundFetch(v)) { - return 0; - } - if (!isPosInt(size)) { - if (sizeCalculation) { - if (typeof sizeCalculation !== 'function') { - throw new TypeError('sizeCalculation must be a function'); - } - size = sizeCalculation(v, k); - if (!isPosInt(size)) { - throw new TypeError('sizeCalculation return invalid (expect positive integer)'); - } - } - else { - throw new TypeError('invalid size value (must be positive integer). ' + - 'When maxSize or maxEntrySize is used, sizeCalculation ' + - 'or size must be set.'); - } - } - return size; - }; - this.#addItemSize = (index, size, status) => { - sizes[index] = size; - if (this.#maxSize) { - const maxSize = this.#maxSize - sizes[index]; - while (this.#calculatedSize > maxSize) { - this.#evict(true); - } - } - this.#calculatedSize += sizes[index]; - if (status) { - status.entrySize = size; - status.totalCalculatedSize = this.#calculatedSize; - } - }; - } - #removeItemSize = _i => { }; - #addItemSize = (_i, _s, _st) => { }; - #requireSize = (_k, _v, size, sizeCalculation) => { - if (size || sizeCalculation) { - throw new TypeError('cannot set size without setting maxSize or maxEntrySize on cache'); - } - return 0; - }; - *#indexes({ allowStale = this.allowStale } = {}) { - if (this.#size) { - for (let i = this.#tail; true;) { - if (!this.#isValidIndex(i)) { - break; - } - if (allowStale || !this.#isStale(i)) { - yield i; - } - if (i === this.#head) { - break; - } - else { - i = this.#prev[i]; - } - } - } - } - *#rindexes({ allowStale = this.allowStale } = {}) { - if (this.#size) { - for (let i = this.#head; true;) { - if (!this.#isValidIndex(i)) { - break; - } - if (allowStale || !this.#isStale(i)) { - yield i; - } - if (i === this.#tail) { - break; - } - else { - i = this.#next[i]; - } - } - } - } - #isValidIndex(index) { - return (index !== undefined && - this.#keyMap.get(this.#keyList[index]) === index); - } - /** - * Return a generator yielding `[key, value]` pairs, - * in order from most recently used to least recently used. - */ - *entries() { - for (const i of this.#indexes()) { - if (this.#valList[i] !== undefined && - this.#keyList[i] !== undefined && - !this.#isBackgroundFetch(this.#valList[i])) { - yield [this.#keyList[i], this.#valList[i]]; - } - } - } - /** - * Inverse order version of {@link LRUCache.entries} - * - * Return a generator yielding `[key, value]` pairs, - * in order from least recently used to most recently used. - */ - *rentries() { - for (const i of this.#rindexes()) { - if (this.#valList[i] !== undefined && - this.#keyList[i] !== undefined && - !this.#isBackgroundFetch(this.#valList[i])) { - yield [this.#keyList[i], this.#valList[i]]; - } - } - } - /** - * Return a generator yielding the keys in the cache, - * in order from most recently used to least recently used. - */ - *keys() { - for (const i of this.#indexes()) { - const k = this.#keyList[i]; - if (k !== undefined && - !this.#isBackgroundFetch(this.#valList[i])) { - yield k; - } - } - } - /** - * Inverse order version of {@link LRUCache.keys} - * - * Return a generator yielding the keys in the cache, - * in order from least recently used to most recently used. - */ - *rkeys() { - for (const i of this.#rindexes()) { - const k = this.#keyList[i]; - if (k !== undefined && - !this.#isBackgroundFetch(this.#valList[i])) { - yield k; - } - } - } - /** - * Return a generator yielding the values in the cache, - * in order from most recently used to least recently used. - */ - *values() { - for (const i of this.#indexes()) { - const v = this.#valList[i]; - if (v !== undefined && - !this.#isBackgroundFetch(this.#valList[i])) { - yield this.#valList[i]; - } - } - } - /** - * Inverse order version of {@link LRUCache.values} - * - * Return a generator yielding the values in the cache, - * in order from least recently used to most recently used. - */ - *rvalues() { - for (const i of this.#rindexes()) { - const v = this.#valList[i]; - if (v !== undefined && - !this.#isBackgroundFetch(this.#valList[i])) { - yield this.#valList[i]; - } - } - } - /** - * Iterating over the cache itself yields the same results as - * {@link LRUCache.entries} - */ - [Symbol.iterator]() { - return this.entries(); - } - /** - * Find a value for which the supplied fn method returns a truthy value, - * similar to Array.find(). fn is called as fn(value, key, cache). - */ - find(fn, getOptions = {}) { - for (const i of this.#indexes()) { - const v = this.#valList[i]; - const value = this.#isBackgroundFetch(v) - ? v.__staleWhileFetching - : v; - if (value === undefined) - continue; - if (fn(value, this.#keyList[i], this)) { - return this.get(this.#keyList[i], getOptions); - } - } - } - /** - * Call the supplied function on each item in the cache, in order from - * most recently used to least recently used. fn is called as - * fn(value, key, cache). Does not update age or recenty of use. - * Does not iterate over stale values. - */ - forEach(fn, thisp = this) { - for (const i of this.#indexes()) { - const v = this.#valList[i]; - const value = this.#isBackgroundFetch(v) - ? v.__staleWhileFetching - : v; - if (value === undefined) - continue; - fn.call(thisp, value, this.#keyList[i], this); - } - } - /** - * The same as {@link LRUCache.forEach} but items are iterated over in - * reverse order. (ie, less recently used items are iterated over first.) - */ - rforEach(fn, thisp = this) { - for (const i of this.#rindexes()) { - const v = this.#valList[i]; - const value = this.#isBackgroundFetch(v) - ? v.__staleWhileFetching - : v; - if (value === undefined) - continue; - fn.call(thisp, value, this.#keyList[i], this); - } - } - /** - * Delete any stale entries. Returns true if anything was removed, - * false otherwise. - */ - purgeStale() { - let deleted = false; - for (const i of this.#rindexes({ allowStale: true })) { - if (this.#isStale(i)) { - this.delete(this.#keyList[i]); - deleted = true; - } - } - return deleted; - } - /** - * Return an array of [key, {@link LRUCache.Entry}] tuples which can be - * passed to cache.load() - */ - dump() { - const arr = []; - for (const i of this.#indexes({ allowStale: true })) { - const key = this.#keyList[i]; - const v = this.#valList[i]; - const value = this.#isBackgroundFetch(v) - ? v.__staleWhileFetching - : v; - if (value === undefined || key === undefined) - continue; - const entry = { value }; - if (this.#ttls && this.#starts) { - entry.ttl = this.#ttls[i]; - // always dump the start relative to a portable timestamp - // it's ok for this to be a bit slow, it's a rare operation. - const age = perf.now() - this.#starts[i]; - entry.start = Math.floor(Date.now() - age); - } - if (this.#sizes) { - entry.size = this.#sizes[i]; - } - arr.unshift([key, entry]); - } - return arr; - } - /** - * Reset the cache and load in the items in entries in the order listed. - * Note that the shape of the resulting cache may be different if the - * same options are not used in both caches. - */ - load(arr) { - this.clear(); - for (const [key, entry] of arr) { - if (entry.start) { - // entry.start is a portable timestamp, but we may be using - // node's performance.now(), so calculate the offset, so that - // we get the intended remaining TTL, no matter how long it's - // been on ice. - // - // it's ok for this to be a bit slow, it's a rare operation. - const age = Date.now() - entry.start; - entry.start = perf.now() - age; - } - this.set(key, entry.value, entry); - } - } - /** - * Add a value to the cache. - */ - set(k, v, setOptions = {}) { - const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status, } = setOptions; - let { noUpdateTTL = this.noUpdateTTL } = setOptions; - const size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation); - // if the item doesn't fit, don't do anything - // NB: maxEntrySize set to maxSize by default - if (this.maxEntrySize && size > this.maxEntrySize) { - if (status) { - status.set = 'miss'; - status.maxEntrySizeExceeded = true; - } - // have to delete, in case something is there already. - this.delete(k); - return this; - } - let index = this.#size === 0 ? undefined : this.#keyMap.get(k); - if (index === undefined) { - // addition - index = (this.#size === 0 - ? this.#tail - : this.#free.length !== 0 - ? this.#free.pop() - : this.#size === this.#max - ? this.#evict(false) - : this.#size); - this.#keyList[index] = k; - this.#valList[index] = v; - this.#keyMap.set(k, index); - this.#next[this.#tail] = index; - this.#prev[index] = this.#tail; - this.#tail = index; - this.#size++; - this.#addItemSize(index, size, status); - if (status) - status.set = 'add'; - noUpdateTTL = false; - } - else { - // update - this.#moveToTail(index); - const oldVal = this.#valList[index]; - if (v !== oldVal) { - if (this.#hasFetchMethod && this.#isBackgroundFetch(oldVal)) { - oldVal.__abortController.abort(new Error('replaced')); - } - else if (!noDisposeOnSet) { - if (this.#hasDispose) { - this.#dispose?.(oldVal, k, 'set'); - } - if (this.#hasDisposeAfter) { - this.#disposed?.push([oldVal, k, 'set']); - } - } - this.#removeItemSize(index); - this.#addItemSize(index, size, status); - this.#valList[index] = v; - if (status) { - status.set = 'replace'; - const oldValue = oldVal && this.#isBackgroundFetch(oldVal) - ? oldVal.__staleWhileFetching - : oldVal; - if (oldValue !== undefined) - status.oldValue = oldValue; - } - } - else if (status) { - status.set = 'update'; - } - } - if (ttl !== 0 && !this.#ttls) { - this.#initializeTTLTracking(); - } - if (this.#ttls) { - if (!noUpdateTTL) { - this.#setItemTTL(index, ttl, start); - } - if (status) - this.#statusTTL(status, index); - } - if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) { - const dt = this.#disposed; - let task; - while ((task = dt?.shift())) { - this.#disposeAfter?.(...task); - } - } - return this; - } - /** - * Evict the least recently used item, returning its value or - * `undefined` if cache is empty. - */ - pop() { - try { - while (this.#size) { - const val = this.#valList[this.#head]; - this.#evict(true); - if (this.#isBackgroundFetch(val)) { - if (val.__staleWhileFetching) { - return val.__staleWhileFetching; - } - } - else if (val !== undefined) { - return val; - } - } - } - finally { - if (this.#hasDisposeAfter && this.#disposed) { - const dt = this.#disposed; - let task; - while ((task = dt?.shift())) { - this.#disposeAfter?.(...task); - } - } - } - } - #evict(free) { - const head = this.#head; - const k = this.#keyList[head]; - const v = this.#valList[head]; - if (this.#hasFetchMethod && this.#isBackgroundFetch(v)) { - v.__abortController.abort(new Error('evicted')); - } - else if (this.#hasDispose || this.#hasDisposeAfter) { - if (this.#hasDispose) { - this.#dispose?.(v, k, 'evict'); - } - if (this.#hasDisposeAfter) { - this.#disposed?.push([v, k, 'evict']); - } - } - this.#removeItemSize(head); - // if we aren't about to use the index, then null these out - if (free) { - this.#keyList[head] = undefined; - this.#valList[head] = undefined; - this.#free.push(head); - } - if (this.#size === 1) { - this.#head = this.#tail = 0; - this.#free.length = 0; - } - else { - this.#head = this.#next[head]; - } - this.#keyMap.delete(k); - this.#size--; - return head; - } - /** - * Check if a key is in the cache, without updating the recency of use. - * Will return false if the item is stale, even though it is technically - * in the cache. - * - * Will not update item age unless - * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. - */ - has(k, hasOptions = {}) { - const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions; - const index = this.#keyMap.get(k); - if (index !== undefined) { - const v = this.#valList[index]; - if (this.#isBackgroundFetch(v) && - v.__staleWhileFetching === undefined) { - return false; - } - if (!this.#isStale(index)) { - if (updateAgeOnHas) { - this.#updateItemAge(index); - } - if (status) { - status.has = 'hit'; - this.#statusTTL(status, index); - } - return true; - } - else if (status) { - status.has = 'stale'; - this.#statusTTL(status, index); - } - } - else if (status) { - status.has = 'miss'; - } - return false; - } - /** - * Like {@link LRUCache#get} but doesn't update recency or delete stale - * items. - * - * Returns `undefined` if the item is stale, unless - * {@link LRUCache.OptionsBase.allowStale} is set. - */ - peek(k, peekOptions = {}) { - const { allowStale = this.allowStale } = peekOptions; - const index = this.#keyMap.get(k); - if (index !== undefined && - (allowStale || !this.#isStale(index))) { - const v = this.#valList[index]; - // either stale and allowed, or forcing a refresh of non-stale value - return this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; - } - } - #backgroundFetch(k, index, options, context) { - const v = index === undefined ? undefined : this.#valList[index]; - if (this.#isBackgroundFetch(v)) { - return v; - } - const ac = new AbortController(); - const { signal } = options; - // when/if our AC signals, then stop listening to theirs. - signal?.addEventListener('abort', () => ac.abort(signal.reason), { - signal: ac.signal, - }); - const fetchOpts = { - signal: ac.signal, - options, - context, - }; - const cb = (v, updateCache = false) => { - const { aborted } = ac.signal; - const ignoreAbort = options.ignoreFetchAbort && v !== undefined; - if (options.status) { - if (aborted && !updateCache) { - options.status.fetchAborted = true; - options.status.fetchError = ac.signal.reason; - if (ignoreAbort) - options.status.fetchAbortIgnored = true; - } - else { - options.status.fetchResolved = true; - } - } - if (aborted && !ignoreAbort && !updateCache) { - return fetchFail(ac.signal.reason); - } - // either we didn't abort, and are still here, or we did, and ignored - const bf = p; - if (this.#valList[index] === p) { - if (v === undefined) { - if (bf.__staleWhileFetching) { - this.#valList[index] = bf.__staleWhileFetching; - } - else { - this.delete(k); - } - } - else { - if (options.status) - options.status.fetchUpdated = true; - this.set(k, v, fetchOpts.options); - } - } - return v; - }; - const eb = (er) => { - if (options.status) { - options.status.fetchRejected = true; - options.status.fetchError = er; - } - return fetchFail(er); - }; - const fetchFail = (er) => { - const { aborted } = ac.signal; - const allowStaleAborted = aborted && options.allowStaleOnFetchAbort; - const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection; - const noDelete = allowStale || options.noDeleteOnFetchRejection; - const bf = p; - if (this.#valList[index] === p) { - // if we allow stale on fetch rejections, then we need to ensure that - // the stale value is not removed from the cache when the fetch fails. - const del = !noDelete || bf.__staleWhileFetching === undefined; - if (del) { - this.delete(k); - } - else if (!allowStaleAborted) { - // still replace the *promise* with the stale value, - // since we are done with the promise at this point. - // leave it untouched if we're still waiting for an - // aborted background fetch that hasn't yet returned. - this.#valList[index] = bf.__staleWhileFetching; - } - } - if (allowStale) { - if (options.status && bf.__staleWhileFetching !== undefined) { - options.status.returnedStale = true; - } - return bf.__staleWhileFetching; - } - else if (bf.__returned === bf) { - throw er; - } - }; - const pcall = (res, rej) => { - const fmp = this.#fetchMethod?.(k, v, fetchOpts); - if (fmp && fmp instanceof Promise) { - fmp.then(v => res(v), rej); - } - // ignored, we go until we finish, regardless. - // defer check until we are actually aborting, - // so fetchMethod can override. - ac.signal.addEventListener('abort', () => { - if (!options.ignoreFetchAbort || - options.allowStaleOnFetchAbort) { - res(); - // when it eventually resolves, update the cache. - if (options.allowStaleOnFetchAbort) { - res = v => cb(v, true); - } - } - }); - }; - if (options.status) - options.status.fetchDispatched = true; - const p = new Promise(pcall).then(cb, eb); - const bf = Object.assign(p, { - __abortController: ac, - __staleWhileFetching: v, - __returned: undefined, - }); - if (index === undefined) { - // internal, don't expose status. - this.set(k, bf, { ...fetchOpts.options, status: undefined }); - index = this.#keyMap.get(k); - } - else { - this.#valList[index] = bf; - } - return bf; - } - #isBackgroundFetch(p) { - if (!this.#hasFetchMethod) - return false; - const b = p; - return (!!b && - b instanceof Promise && - b.hasOwnProperty('__staleWhileFetching') && - b.__abortController instanceof AbortController); - } - async fetch(k, fetchOptions = {}) { - const { - // get options - allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, - // set options - ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, - // fetch exclusive options - noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, ignoreFetchAbort = this.ignoreFetchAbort, allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, context, forceRefresh = false, status, signal, } = fetchOptions; - if (!this.#hasFetchMethod) { - if (status) - status.fetch = 'get'; - return this.get(k, { - allowStale, - updateAgeOnGet, - noDeleteOnStaleGet, - status, - }); - } - const options = { - allowStale, - updateAgeOnGet, - noDeleteOnStaleGet, - ttl, - noDisposeOnSet, - size, - sizeCalculation, - noUpdateTTL, - noDeleteOnFetchRejection, - allowStaleOnFetchRejection, - allowStaleOnFetchAbort, - ignoreFetchAbort, - status, - signal, - }; - let index = this.#keyMap.get(k); - if (index === undefined) { - if (status) - status.fetch = 'miss'; - const p = this.#backgroundFetch(k, index, options, context); - return (p.__returned = p); - } - else { - // in cache, maybe already fetching - const v = this.#valList[index]; - if (this.#isBackgroundFetch(v)) { - const stale = allowStale && v.__staleWhileFetching !== undefined; - if (status) { - status.fetch = 'inflight'; - if (stale) - status.returnedStale = true; - } - return stale ? v.__staleWhileFetching : (v.__returned = v); - } - // if we force a refresh, that means do NOT serve the cached value, - // unless we are already in the process of refreshing the cache. - const isStale = this.#isStale(index); - if (!forceRefresh && !isStale) { - if (status) - status.fetch = 'hit'; - this.#moveToTail(index); - if (updateAgeOnGet) { - this.#updateItemAge(index); - } - if (status) - this.#statusTTL(status, index); - return v; - } - // ok, it is stale or a forced refresh, and not already fetching. - // refresh the cache. - const p = this.#backgroundFetch(k, index, options, context); - const hasStale = p.__staleWhileFetching !== undefined; - const staleVal = hasStale && allowStale; - if (status) { - status.fetch = isStale ? 'stale' : 'refresh'; - if (staleVal && isStale) - status.returnedStale = true; - } - return staleVal ? p.__staleWhileFetching : (p.__returned = p); - } - } - /** - * Return a value from the cache. Will update the recency of the cache - * entry found. - * - * If the key is not found, get() will return `undefined`. - */ - get(k, getOptions = {}) { - const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status, } = getOptions; - const index = this.#keyMap.get(k); - if (index !== undefined) { - const value = this.#valList[index]; - const fetching = this.#isBackgroundFetch(value); - if (status) - this.#statusTTL(status, index); - if (this.#isStale(index)) { - if (status) - status.get = 'stale'; - // delete only if not an in-flight background fetch - if (!fetching) { - if (!noDeleteOnStaleGet) { - this.delete(k); - } - if (status && allowStale) - status.returnedStale = true; - return allowStale ? value : undefined; - } - else { - if (status && - allowStale && - value.__staleWhileFetching !== undefined) { - status.returnedStale = true; - } - return allowStale ? value.__staleWhileFetching : undefined; - } - } - else { - if (status) - status.get = 'hit'; - // if we're currently fetching it, we don't actually have it yet - // it's not stale, which means this isn't a staleWhileRefetching. - // If it's not stale, and fetching, AND has a __staleWhileFetching - // value, then that means the user fetched with {forceRefresh:true}, - // so it's safe to return that value. - if (fetching) { - return value.__staleWhileFetching; - } - this.#moveToTail(index); - if (updateAgeOnGet) { - this.#updateItemAge(index); - } - return value; - } - } - else if (status) { - status.get = 'miss'; - } - } - #connect(p, n) { - this.#prev[n] = p; - this.#next[p] = n; - } - #moveToTail(index) { - // if tail already, nothing to do - // if head, move head to next[index] - // else - // move next[prev[index]] to next[index] (head has no prev) - // move prev[next[index]] to prev[index] - // prev[index] = tail - // next[tail] = index - // tail = index - if (index !== this.#tail) { - if (index === this.#head) { - this.#head = this.#next[index]; - } - else { - this.#connect(this.#prev[index], this.#next[index]); - } - this.#connect(this.#tail, index); - this.#tail = index; - } - } - /** - * Deletes a key out of the cache. - * Returns true if the key was deleted, false otherwise. - */ - delete(k) { - let deleted = false; - if (this.#size !== 0) { - const index = this.#keyMap.get(k); - if (index !== undefined) { - deleted = true; - if (this.#size === 1) { - this.clear(); - } - else { - this.#removeItemSize(index); - const v = this.#valList[index]; - if (this.#isBackgroundFetch(v)) { - v.__abortController.abort(new Error('deleted')); - } - else if (this.#hasDispose || this.#hasDisposeAfter) { - if (this.#hasDispose) { - this.#dispose?.(v, k, 'delete'); - } - if (this.#hasDisposeAfter) { - this.#disposed?.push([v, k, 'delete']); - } - } - this.#keyMap.delete(k); - this.#keyList[index] = undefined; - this.#valList[index] = undefined; - if (index === this.#tail) { - this.#tail = this.#prev[index]; - } - else if (index === this.#head) { - this.#head = this.#next[index]; - } - else { - this.#next[this.#prev[index]] = this.#next[index]; - this.#prev[this.#next[index]] = this.#prev[index]; - } - this.#size--; - this.#free.push(index); - } - } - } - if (this.#hasDisposeAfter && this.#disposed?.length) { - const dt = this.#disposed; - let task; - while ((task = dt?.shift())) { - this.#disposeAfter?.(...task); - } - } - return deleted; - } - /** - * Clear the cache entirely, throwing away all values. - */ - clear() { - for (const index of this.#rindexes({ allowStale: true })) { - const v = this.#valList[index]; - if (this.#isBackgroundFetch(v)) { - v.__abortController.abort(new Error('deleted')); - } - else { - const k = this.#keyList[index]; - if (this.#hasDispose) { - this.#dispose?.(v, k, 'delete'); - } - if (this.#hasDisposeAfter) { - this.#disposed?.push([v, k, 'delete']); - } - } - } - this.#keyMap.clear(); - this.#valList.fill(undefined); - this.#keyList.fill(undefined); - if (this.#ttls && this.#starts) { - this.#ttls.fill(0); - this.#starts.fill(0); - } - if (this.#sizes) { - this.#sizes.fill(0); - } - this.#head = 0; - this.#tail = 0; - this.#free.length = 0; - this.#calculatedSize = 0; - this.#size = 0; - if (this.#hasDisposeAfter && this.#disposed) { - const dt = this.#disposed; - let task; - while ((task = dt?.shift())) { - this.#disposeAfter?.(...task); - } - } - } -} -export default LRUCache; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/mysql2/node_modules/lru-cache/dist/mjs/index.js.map b/node_modules/mysql2/node_modules/lru-cache/dist/mjs/index.js.map deleted file mode 100644 index 84f5b72..0000000 --- a/node_modules/mysql2/node_modules/lru-cache/dist/mjs/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,MAAM,IAAI,GACR,OAAO,WAAW,KAAK,QAAQ;IAC/B,WAAW;IACX,OAAO,WAAW,CAAC,GAAG,KAAK,UAAU;IACnC,CAAC,CAAC,WAAW;IACb,CAAC,CAAC,IAAI,CAAA;AAEV,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAA;AAKhC,MAAM,WAAW,GAAG,CAClB,GAAW,EACX,IAAY,EACZ,IAAY,EACZ,EAAQ,EACR,EAAE;IACF,OAAO,OAAO,KAAK,QAAQ;QAC3B,OAAO;QACP,OAAO,OAAO,CAAC,WAAW,KAAK,UAAU;QACvC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC;QAC1C,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,IAAI,KAAK,GAAG,EAAE,CAAC,CAAA;AAChD,CAAC,CAAA;AAED,M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AAmC,CAAA;YACvC,OAAO,CAAC,IAAI,GAAG,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE;gBAC3B,IAAI,CAAC,aAAa,EAAE,CAAC,GAAG,IAAI,CAAC,CAAA;aAC9B;SACF;IACH,CAAC;CACF;AAED,eAAe,QAAQ,CAAA","sourcesContent":["/**\n * @module LRUCache\n */\n\n// module-private names and types\ntype Perf = { now: () => number }\nconst perf: Perf =\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ? performance\n : Date\n\nconst warned = new Set()\n\n// either a function or a class\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC\n) => {\n typeof process === 'object' &&\n process &&\n typeof process.emitWarning === 'function'\n ? process.emitWarning(msg, type, code, fn)\n : console.error(`[${code}] ${type}: ${msg}`)\n}\n\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\ntype PosInt = number & { [TYPE]: 'Positive Integer' }\ntype Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: any): n is PosInt =>\n n && n === Math.floor(n) && n > 0 && isFinite(n)\n\ntype UintArray = Uint8Array | Uint16Array | Uint32Array\ntype NumberArray = UintArray | number[]\n\n/* c8 ignore start */\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\nconst getUintArray = (max: number) =>\n !isPosInt(max)\n ? null\n : max <= Math.pow(2, 8)\n ? Uint8Array\n : max <= Math.pow(2, 16)\n ? Uint16Array\n : max <= Math.pow(2, 32)\n ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER\n ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\n\ntype StackLike = Stack | Index[]\nclass Stack {\n heap: NumberArray\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(\n max: number,\n HeapCls: { new (n: number): NumberArray }\n ) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\ntype DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n */\n export type DisposeReason = 'evict' | 'set' | 'delete'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Status object that may be passed to {@link LRUCache#fetch},\n * {@link LRUCache#get}, {@link LRUCache#set}, and {@link LRUCache#has}.\n */\n export interface Status {\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss'\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The old value, specified in the case of `set:'update'` or\n * `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no fetchMethod, so {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link OptionsBase.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions\n extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions\n extends FetcherFetchOptions {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext\n extends FetchOptions {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext\n extends FetchOptions {\n context?: undefined\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions\n extends Pick, 'updateAgeOnHas'> {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions\n extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions\n extends Pick, 'allowStale'> {}\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions\n extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions\n ) => Promise | V | void | undefined\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed\n * by default, and MAY live in the cache long after they have expired.\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * Must be an integer number of ms. If set to 0, this indicates \"no TTL\"\n *\n * @default 0\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n * Note that this may significantly degrade performance,\n * especially if the cache is storing a large number of items.\n * It is almost always best to just leave the stale items in\n * the cache, and let them fall out as new items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * @default false\n */\n ttlAutopurge?: boolean\n\n /**\n * Update the age of items on {@link LRUCache#get}, renewing their TTL\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * @default false\n */\n updateAgeOnGet?: boolean\n\n /**\n * Update the age of items on {@link LRUCache#has}, renewing their TTL\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * @default false\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the cache.\n * This can be handy if you want to close file descriptors or do other\n * cleanup tasks when items are no longer accessible. Called with `key,\n * value`. It's called before actually removing the item from the\n * internal cache, so it is *NOT* safe to re-add them.\n *\n * Use {@link OptionsBase.disposeAfter} if you wish to dispose items after\n * they have been full removed, when it is safe to add them back to the\n * cache.\n */\n dispose?: Disposer\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when\n * setting a new value for an existing key (ie, when updating a value\n * rather than inserting a new value). Note that the TTL value is\n * _always_ set (if provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n */\n noUpdateTTL?: boolean\n\n /**\n * If you wish to track item size, you must provide a maxSize\n * note that we still will only keep up to max *actual items*,\n * if max is set, so size tracking may cause fewer than max items\n * to be stored. At the extreme, a single item of maxSize size\n * will cause everything else in the cache to be dropped when it\n * is added. Use with caution!\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod}, then it will not be stored in the\n * cache.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n */\n fetchMethod?: Fetcher\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the\n * {@link LRUCache#fetch} fails, not any other times.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches an `'abort'`\n * event, whether user-triggered, or due to internal cache behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and its return\n * value will be ignored and not cached.\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls are not\n * immediately resolved or rejected when they are aborted, and instead\n * take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n }\n\n export interface OptionsMaxLimit\n extends OptionsBase {\n max: Count\n }\n export interface OptionsTTLLimit\n extends OptionsBase {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit\n extends OptionsBase {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump}\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * All properties from the options object (with the exception of\n * {@link OptionsBase.max} and {@link OptionsBase.maxSize}) are added as\n * normal public members. (`max` and `maxBase` are read-only getters.)\n * Changing any of these will alter the defaults for subsequent method calls,\n * but is otherwise safe.\n */\nexport class LRUCache {\n // properties coming in from the options of these, only max and maxSize\n // really *need* to be protected. The rest can be modified, as they just\n // set defaults for various methods.\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: any) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: any\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context\n ),\n moveToTail: (index: number): void =>\n c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) =>\n c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) =>\n c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(\n options: LRUCache.Options | LRUCache\n ) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n } = options\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize'\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (\n fetchMethod !== undefined &&\n typeof fetchMethod !== 'function'\n ) {\n throw new TypeError(\n 'fetchMethod must be a function if specified'\n )\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = new Array(max).fill(undefined)\n this.#valList = new Array(max).fill(undefined)\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified'\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified'\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0\n ? ttlResolution\n : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError(\n 'ttl must be a positive integer if specified'\n )\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required'\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the remaining TTL time for a given entry key\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n\n this.#setItemTTL = (index, ttl, start = perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n if (ttl !== 0 && this.ttlAutopurge) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.delete(this.#keyList[index] as K)\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? perf.now() : 0\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n status.remainingTTL = status.now + ttl - start\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(\n () => (cachedNow = 0),\n this.ttlResolution\n )\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n return ttls[index] === 0 || starts[index] === 0\n ? Infinity\n : starts[index] + ttls[index] - (cachedNow || getNow())\n }\n\n this.#isStale = index => {\n return (\n ttls[index] !== 0 &&\n starts[index] !== 0 &&\n (cachedNow || getNow()) - starts[index] > ttls[index]\n )\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index]\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n return 0\n }\n if (!isPosInt(size)) {\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)'\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.'\n )\n }\n }\n return size\n }\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index]\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index]\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status\n ) => void = (_i, _s, _st) => {}\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache'\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; true; ) {\n if (!this.#isValidIndex(i)) {\n break\n }\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; true; ) {\n if (!this.#isValidIndex(i)) {\n break\n }\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (\n k !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (\n k !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (\n v !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (\n v !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to Array.find(). fn is called as fn(value, key, cache).\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {}\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from\n * most recently used to least recently used. fn is called as\n * fn(value, key, cache). Does not update age or recenty of use.\n * Does not iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => any,\n thisp: any = this\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => any,\n thisp: any = this\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.delete(this.#keyList[i] as K)\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to cache.load()\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = perf.now() - this.#starts[i]\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n * Note that the shape of the resulting cache may be different if the\n * same options are not used in both caches.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = perf.now() - age\n }\n this.set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n */\n set(\n k: K,\n v: V | BackgroundFetch,\n setOptions: LRUCache.SetOptions = {}\n ) {\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n // have to delete, in case something is there already.\n this.delete(k)\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0\n ? this.#tail\n : this.#free.length !== 0\n ? this.#free.pop()\n : this.#size === this.#max\n ? this.#evict(false)\n : this.#size\n ) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n } else {\n // update\n this.#moveToTail(index)\n const oldVal = this.#valList[index] as V | BackgroundFetch\n if (v !== oldVal) {\n if (this.#hasFetchMethod && this.#isBackgroundFetch(oldVal)) {\n oldVal.__abortController.abort(new Error('replaced'))\n } else if (!noDisposeOnSet) {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal as V, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal as V, k, 'set'])\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (status) {\n status.set = 'replace'\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal)\n ? oldVal.__staleWhileFetching\n : oldVal\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n } else if (status) {\n status.set = 'update'\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head] as K\n const v = this.#valList[head] as V\n if (this.#hasFetchMethod && this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('evicted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } =\n hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (\n index !== undefined &&\n (allowStale || !this.#isStale(index))\n ) {\n const v = this.#valList[index]\n // either stale and allowed, or forcing a refresh of non-stale value\n return this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n }\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: any\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AbortController()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (\n v: V | void | undefined,\n updateCache = false\n ): V | undefined | void => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n if (v === undefined) {\n if (bf.__staleWhileFetching) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.delete(k)\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.set(k, v, fetchOpts.options)\n }\n }\n return v\n }\n\n const eb = (er: any) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er\n }\n return fetchFail(er)\n }\n\n const fetchFail = (er: any): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted =\n aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del = !noDelete || bf.__staleWhileFetching === undefined\n if (del) {\n this.delete(k)\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | void | undefined) => void,\n rej: (e: any) => void\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v), rej)\n }\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (\n !options.ignoreFetchAbort ||\n options.allowStaleOnFetchAbort\n ) {\n res()\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: any): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AbortController\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n */\n fetch(\n k: K,\n fetchOptions: unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext\n ): Promise\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC\n ? K\n : FC extends undefined | void\n ? K\n : never,\n fetchOptions?: unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : never\n ): Promise\n async fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {}\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale =\n allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n if (status) status.get = 'stale'\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.delete(k)\n }\n if (status && allowStale) status.returnedStale = true\n return allowStale ? value : undefined\n } else {\n if (\n status &&\n allowStale &&\n value.__staleWhileFetching !== undefined\n ) {\n status.returnedStale = true\n }\n return allowStale ? value.__staleWhileFetching : undefined\n }\n } else {\n if (status) status.get = 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n if (fetching) {\n return value.__staleWhileFetching\n }\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return value\n }\n } else if (status) {\n status.get = 'miss'\n }\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n deleted = true\n if (this.#size === 1) {\n this.clear()\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, 'delete')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, 'delete'])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#next[this.#prev[index]] = this.#next[index]\n this.#prev[this.#next[index]] = this.#prev[index]\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, 'delete')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, 'delete'])\n }\n }\n }\n\n this.#keyMap.clear()\n this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n\nexport default LRUCache\n"]} \ No newline at end of file diff --git a/node_modules/mysql2/node_modules/lru-cache/dist/mjs/index.min.js b/node_modules/mysql2/node_modules/lru-cache/dist/mjs/index.min.js deleted file mode 100644 index 7a889a4..0000000 --- a/node_modules/mysql2/node_modules/lru-cache/dist/mjs/index.min.js +++ /dev/null @@ -1,2 +0,0 @@ -var L=(o,t,e)=>{if(!t.has(o))throw TypeError("Cannot "+e)};var j=(o,t,e)=>(L(o,t,"read from private field"),e?e.call(o):t.get(o)),G=(o,t,e)=>{if(t.has(o))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(o):t.set(o,e)},C=(o,t,e,i)=>(L(o,t,"write to private field"),i?i.call(o,e):t.set(o,e),e);var v=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,U=new Set,k=(o,t,e,i)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(o,t,e,i):console.error(`[${e}] ${t}: ${o}`)},H=o=>!U.has(o),P=Symbol("type"),F=o=>o&&o===Math.floor(o)&&o>0&&isFinite(o),M=o=>F(o)?o<=Math.pow(2,8)?Uint8Array:o<=Math.pow(2,16)?Uint16Array:o<=Math.pow(2,32)?Uint32Array:o<=Number.MAX_SAFE_INTEGER?O:null:null,O=class extends Array{constructor(t){super(t),this.fill(0)}},E,T=class{heap;length;static create(t){let e=M(t);if(!e)return[];C(T,E,!0);let i=new T(t,e);return C(T,E,!1),i}constructor(t,e){if(!j(T,E))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},D=T;E=new WeakMap,G(D,E,!1);var W=class{#d;#f;#_;#g;#W;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#s;#p;#n;#i;#t;#l;#c;#o;#h;#w;#r;#F;#A;#S;#y;#T;#a;static unsafeExposeInternals(t){return{starts:t.#A,ttls:t.#S,sizes:t.#F,keyMap:t.#n,keyList:t.#i,valList:t.#t,next:t.#l,prev:t.#c,get head(){return t.#o},get tail(){return t.#h},free:t.#w,isBackgroundFetch:e=>t.#e(e),backgroundFetch:(e,i,s,n)=>t.#R(e,i,s,n),moveToTail:e=>t.#v(e),indexes:e=>t.#m(e),rindexes:e=>t.#b(e),isStale:e=>t.#u(e)}}get max(){return this.#d}get maxSize(){return this.#f}get calculatedSize(){return this.#p}get size(){return this.#s}get fetchMethod(){return this.#W}get dispose(){return this.#_}get disposeAfter(){return this.#g}constructor(t){let{max:e=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:h,updateAgeOnHas:f,allowStale:r,dispose:p,disposeAfter:y,noDisposeOnSet:a,noUpdateTTL:u,maxSize:g=0,maxEntrySize:A=0,sizeCalculation:c,fetchMethod:w,noDeleteOnFetchRejection:l,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:d,ignoreFetchAbort:_}=t;if(e!==0&&!F(e))throw new TypeError("max option must be a nonnegative integer");let z=e?M(e):Array;if(!z)throw new Error("invalid max value: "+e);if(this.#d=e,this.#f=g,this.maxEntrySize=A||this.#f,this.sizeCalculation=c,this.sizeCalculation){if(!this.#f&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(w!==void 0&&typeof w!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#W=w,this.#T=!!w,this.#n=new Map,this.#i=new Array(e).fill(void 0),this.#t=new Array(e).fill(void 0),this.#l=new z(e),this.#c=new z(e),this.#o=0,this.#h=0,this.#w=D.create(e),this.#s=0,this.#p=0,typeof p=="function"&&(this.#_=p),typeof y=="function"?(this.#g=y,this.#r=[]):(this.#g=void 0,this.#r=void 0),this.#y=!!this.#_,this.#a=!!this.#g,this.noDisposeOnSet=!!a,this.noUpdateTTL=!!u,this.noDeleteOnFetchRejection=!!l,this.allowStaleOnFetchRejection=!!m,this.allowStaleOnFetchAbort=!!d,this.ignoreFetchAbort=!!_,this.maxEntrySize!==0){if(this.#f!==0&&!F(this.#f))throw new TypeError("maxSize must be a positive integer if specified");if(!F(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#M()}if(this.allowStale=!!r,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!h,this.updateAgeOnHas=!!f,this.ttlResolution=F(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!F(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#x()}if(this.#d===0&&this.ttl===0&&this.#f===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#d&&!this.#f){let b="LRU_CACHE_UNBOUNDED";H(b)&&(U.add(b),k("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",b,W))}}getRemainingTTL(t){return this.#n.has(t)?1/0:0}#x(){let t=new O(this.#d),e=new O(this.#d);this.#S=t,this.#A=e,this.#L=(n,h,f=v.now())=>{if(e[n]=h!==0?f:0,t[n]=h,h!==0&&this.ttlAutopurge){let r=setTimeout(()=>{this.#u(n)&&this.delete(this.#i[n])},h+1);r.unref&&r.unref()}},this.#O=n=>{e[n]=t[n]!==0?v.now():0},this.#z=(n,h)=>{if(t[h]){let f=t[h],r=e[h];n.ttl=f,n.start=r,n.now=i||s(),n.remainingTTL=n.now+f-r}};let i=0,s=()=>{let n=v.now();if(this.ttlResolution>0){i=n;let h=setTimeout(()=>i=0,this.ttlResolution);h.unref&&h.unref()}return n};this.getRemainingTTL=n=>{let h=this.#n.get(n);return h===void 0?0:t[h]===0||e[h]===0?1/0:e[h]+t[h]-(i||s())},this.#u=n=>t[n]!==0&&e[n]!==0&&(i||s())-e[n]>t[n]}#O=()=>{};#z=()=>{};#L=()=>{};#u=()=>!1;#M(){let t=new O(this.#d);this.#p=0,this.#F=t,this.#E=e=>{this.#p-=t[e],t[e]=0},this.#j=(e,i,s,n)=>{if(this.#e(i))return 0;if(!F(s))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,e),!F(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s},this.#D=(e,i,s)=>{if(t[e]=i,this.#f){let n=this.#f-t[e];for(;this.#p>n;)this.#C(!0)}this.#p+=t[e],s&&(s.entrySize=i,s.totalCalculatedSize=this.#p)}}#E=t=>{};#D=(t,e,i)=>{};#j=(t,e,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#m({allowStale:t=this.allowStale}={}){if(this.#s)for(let e=this.#h;!(!this.#G(e)||((t||!this.#u(e))&&(yield e),e===this.#o));)e=this.#c[e]}*#b({allowStale:t=this.allowStale}={}){if(this.#s)for(let e=this.#o;!(!this.#G(e)||((t||!this.#u(e))&&(yield e),e===this.#h));)e=this.#l[e]}#G(t){return t!==void 0&&this.#n.get(this.#i[t])===t}*entries(){for(let t of this.#m())this.#t[t]!==void 0&&this.#i[t]!==void 0&&!this.#e(this.#t[t])&&(yield[this.#i[t],this.#t[t]])}*rentries(){for(let t of this.#b())this.#t[t]!==void 0&&this.#i[t]!==void 0&&!this.#e(this.#t[t])&&(yield[this.#i[t],this.#t[t]])}*keys(){for(let t of this.#m()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e)}}*rkeys(){for(let t of this.#b()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e)}}*values(){for(let t of this.#m())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t])}*rvalues(){for(let t of this.#b())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t])}[Symbol.iterator](){return this.entries()}find(t,e={}){for(let i of this.#m()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;if(n!==void 0&&t(n,this.#i[i],this))return this.get(this.#i[i],e)}}forEach(t,e=this){for(let i of this.#m()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(e,n,this.#i[i],this)}}rforEach(t,e=this){for(let i of this.#b()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(e,n,this.#i[i],this)}}purgeStale(){let t=!1;for(let e of this.#b({allowStale:!0}))this.#u(e)&&(this.delete(this.#i[e]),t=!0);return t}dump(){let t=[];for(let e of this.#m({allowStale:!0})){let i=this.#i[e],s=this.#t[e],n=this.#e(s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let h={value:n};if(this.#S&&this.#A){h.ttl=this.#S[e];let f=v.now()-this.#A[e];h.start=Math.floor(Date.now()-f)}this.#F&&(h.size=this.#F[e]),t.unshift([i,h])}return t}load(t){this.clear();for(let[e,i]of t){if(i.start){let s=Date.now()-i.start;i.start=v.now()-s}this.set(e,i.value,i)}}set(t,e,i={}){let{ttl:s=this.ttl,start:n,noDisposeOnSet:h=this.noDisposeOnSet,sizeCalculation:f=this.sizeCalculation,status:r}=i,{noUpdateTTL:p=this.noUpdateTTL}=i,y=this.#j(t,e,i.size||0,f);if(this.maxEntrySize&&y>this.maxEntrySize)return r&&(r.set="miss",r.maxEntrySizeExceeded=!0),this.delete(t),this;let a=this.#s===0?void 0:this.#n.get(t);if(a===void 0)a=this.#s===0?this.#h:this.#w.length!==0?this.#w.pop():this.#s===this.#d?this.#C(!1):this.#s,this.#i[a]=t,this.#t[a]=e,this.#n.set(t,a),this.#l[this.#h]=a,this.#c[a]=this.#h,this.#h=a,this.#s++,this.#D(a,y,r),r&&(r.set="add"),p=!1;else{this.#v(a);let u=this.#t[a];if(e!==u){if(this.#T&&this.#e(u)?u.__abortController.abort(new Error("replaced")):h||(this.#y&&this.#_?.(u,t,"set"),this.#a&&this.#r?.push([u,t,"set"])),this.#E(a),this.#D(a,y,r),this.#t[a]=e,r){r.set="replace";let g=u&&this.#e(u)?u.__staleWhileFetching:u;g!==void 0&&(r.oldValue=g)}}else r&&(r.set="update")}if(s!==0&&!this.#S&&this.#x(),this.#S&&(p||this.#L(a,s,n),r&&this.#z(r,a)),!h&&this.#a&&this.#r){let u=this.#r,g;for(;g=u?.shift();)this.#g?.(...g)}return this}pop(){try{for(;this.#s;){let t=this.#t[this.#o];if(this.#C(!0),this.#e(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#a&&this.#r){let t=this.#r,e;for(;e=t?.shift();)this.#g?.(...e)}}}#C(t){let e=this.#o,i=this.#i[e],s=this.#t[e];return this.#T&&this.#e(s)?s.__abortController.abort(new Error("evicted")):(this.#y||this.#a)&&(this.#y&&this.#_?.(s,i,"evict"),this.#a&&this.#r?.push([s,i,"evict"])),this.#E(e),t&&(this.#i[e]=void 0,this.#t[e]=void 0,this.#w.push(e)),this.#s===1?(this.#o=this.#h=0,this.#w.length=0):this.#o=this.#l[e],this.#n.delete(i),this.#s--,e}has(t,e={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=e,n=this.#n.get(t);if(n!==void 0){let h=this.#t[n];if(this.#e(h)&&h.__staleWhileFetching===void 0)return!1;if(this.#u(n))s&&(s.has="stale",this.#z(s,n));else return i&&this.#O(n),s&&(s.has="hit",this.#z(s,n)),!0}else s&&(s.has="miss");return!1}peek(t,e={}){let{allowStale:i=this.allowStale}=e,s=this.#n.get(t);if(s!==void 0&&(i||!this.#u(s))){let n=this.#t[s];return this.#e(n)?n.__staleWhileFetching:n}}#R(t,e,i,s){let n=e===void 0?void 0:this.#t[e];if(this.#e(n))return n;let h=new AbortController,{signal:f}=i;f?.addEventListener("abort",()=>h.abort(f.reason),{signal:h.signal});let r={signal:h.signal,options:i,context:s},p=(c,w=!1)=>{let{aborted:l}=h.signal,S=i.ignoreFetchAbort&&c!==void 0;if(i.status&&(l&&!w?(i.status.fetchAborted=!0,i.status.fetchError=h.signal.reason,S&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),l&&!S&&!w)return a(h.signal.reason);let m=g;return this.#t[e]===g&&(c===void 0?m.__staleWhileFetching?this.#t[e]=m.__staleWhileFetching:this.delete(t):(i.status&&(i.status.fetchUpdated=!0),this.set(t,c,r.options))),c},y=c=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=c),a(c)),a=c=>{let{aborted:w}=h.signal,l=w&&i.allowStaleOnFetchAbort,S=l||i.allowStaleOnFetchRejection,m=S||i.noDeleteOnFetchRejection,d=g;if(this.#t[e]===g&&(!m||d.__staleWhileFetching===void 0?this.delete(t):l||(this.#t[e]=d.__staleWhileFetching)),S)return i.status&&d.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),d.__staleWhileFetching;if(d.__returned===d)throw c},u=(c,w)=>{let l=this.#W?.(t,n,r);l&&l instanceof Promise&&l.then(S=>c(S),w),h.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(c(),i.allowStaleOnFetchAbort&&(c=S=>p(S,!0)))})};i.status&&(i.status.fetchDispatched=!0);let g=new Promise(u).then(p,y),A=Object.assign(g,{__abortController:h,__staleWhileFetching:n,__returned:void 0});return e===void 0?(this.set(t,A,{...r.options,status:void 0}),e=this.#n.get(t)):this.#t[e]=A,A}#e(t){if(!this.#T)return!1;let e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof AbortController}async fetch(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:h=this.ttl,noDisposeOnSet:f=this.noDisposeOnSet,size:r=0,sizeCalculation:p=this.sizeCalculation,noUpdateTTL:y=this.noUpdateTTL,noDeleteOnFetchRejection:a=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:u=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:A=this.allowStaleOnFetchAbort,context:c,forceRefresh:w=!1,status:l,signal:S}=e;if(!this.#T)return l&&(l.fetch="get"),this.get(t,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:l});let m={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:h,noDisposeOnSet:f,size:r,sizeCalculation:p,noUpdateTTL:y,noDeleteOnFetchRejection:a,allowStaleOnFetchRejection:u,allowStaleOnFetchAbort:A,ignoreFetchAbort:g,status:l,signal:S},d=this.#n.get(t);if(d===void 0){l&&(l.fetch="miss");let _=this.#R(t,d,m,c);return _.__returned=_}else{let _=this.#t[d];if(this.#e(_)){let x=i&&_.__staleWhileFetching!==void 0;return l&&(l.fetch="inflight",x&&(l.returnedStale=!0)),x?_.__staleWhileFetching:_.__returned=_}let z=this.#u(d);if(!w&&!z)return l&&(l.fetch="hit"),this.#v(d),s&&this.#O(d),l&&this.#z(l,d),_;let b=this.#R(t,d,m,c),R=b.__staleWhileFetching!==void 0&&i;return l&&(l.fetch=z?"stale":"refresh",R&&z&&(l.returnedStale=!0)),R?b.__staleWhileFetching:b.__returned=b}}get(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:h}=e,f=this.#n.get(t);if(f!==void 0){let r=this.#t[f],p=this.#e(r);return h&&this.#z(h,f),this.#u(f)?(h&&(h.get="stale"),p?(h&&i&&r.__staleWhileFetching!==void 0&&(h.returnedStale=!0),i?r.__staleWhileFetching:void 0):(n||this.delete(t),h&&i&&(h.returnedStale=!0),i?r:void 0)):(h&&(h.get="hit"),p?r.__staleWhileFetching:(this.#v(f),s&&this.#O(f),r))}else h&&(h.get="miss")}#U(t,e){this.#c[e]=t,this.#l[t]=e}#v(t){t!==this.#h&&(t===this.#o?this.#o=this.#l[t]:this.#U(this.#c[t],this.#l[t]),this.#U(this.#h,t),this.#h=t)}delete(t){let e=!1;if(this.#s!==0){let i=this.#n.get(t);if(i!==void 0)if(e=!0,this.#s===1)this.clear();else{this.#E(i);let s=this.#t[i];this.#e(s)?s.__abortController.abort(new Error("deleted")):(this.#y||this.#a)&&(this.#y&&this.#_?.(s,t,"delete"),this.#a&&this.#r?.push([s,t,"delete"])),this.#n.delete(t),this.#i[i]=void 0,this.#t[i]=void 0,i===this.#h?this.#h=this.#c[i]:i===this.#o?this.#o=this.#l[i]:(this.#l[this.#c[i]]=this.#l[i],this.#c[this.#l[i]]=this.#c[i]),this.#s--,this.#w.push(i)}}if(this.#a&&this.#r?.length){let i=this.#r,s;for(;s=i?.shift();)this.#g?.(...s)}return e}clear(){for(let t of this.#b({allowStale:!0})){let e=this.#t[t];if(this.#e(e))e.__abortController.abort(new Error("deleted"));else{let i=this.#i[t];this.#y&&this.#_?.(e,i,"delete"),this.#a&&this.#r?.push([e,i,"delete"])}}if(this.#n.clear(),this.#t.fill(void 0),this.#i.fill(void 0),this.#S&&this.#A&&(this.#S.fill(0),this.#A.fill(0)),this.#F&&this.#F.fill(0),this.#o=0,this.#h=0,this.#w.length=0,this.#p=0,this.#s=0,this.#a&&this.#r){let t=this.#r,e;for(;e=t?.shift();)this.#g?.(...e)}}},V=W;export{W as LRUCache,V as default}; -//# sourceMappingURL=index.min.js.map diff --git a/node_modules/mysql2/node_modules/lru-cache/dist/mjs/index.min.js.map b/node_modules/mysql2/node_modules/lru-cache/dist/mjs/index.min.js.map deleted file mode 100644 index a2e7bfa..0000000 --- a/node_modules/mysql2/node_modules/lru-cache/dist/mjs/index.min.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../src/index.ts"], - "sourcesContent": ["/**\n * @module LRUCache\n */\n\n// module-private names and types\ntype Perf = { now: () => number }\nconst perf: Perf =\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ? performance\n : Date\n\nconst warned = new Set()\n\n// either a function or a class\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC\n) => {\n typeof process === 'object' &&\n process &&\n typeof process.emitWarning === 'function'\n ? process.emitWarning(msg, type, code, fn)\n : console.error(`[${code}] ${type}: ${msg}`)\n}\n\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\ntype PosInt = number & { [TYPE]: 'Positive Integer' }\ntype Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: any): n is PosInt =>\n n && n === Math.floor(n) && n > 0 && isFinite(n)\n\ntype UintArray = Uint8Array | Uint16Array | Uint32Array\ntype NumberArray = UintArray | number[]\n\n/* c8 ignore start */\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\nconst getUintArray = (max: number) =>\n !isPosInt(max)\n ? null\n : max <= Math.pow(2, 8)\n ? Uint8Array\n : max <= Math.pow(2, 16)\n ? Uint16Array\n : max <= Math.pow(2, 32)\n ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER\n ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\n\ntype StackLike = Stack | Index[]\nclass Stack {\n heap: NumberArray\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(\n max: number,\n HeapCls: { new (n: number): NumberArray }\n ) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\ntype DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n */\n export type DisposeReason = 'evict' | 'set' | 'delete'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Status object that may be passed to {@link LRUCache#fetch},\n * {@link LRUCache#get}, {@link LRUCache#set}, and {@link LRUCache#has}.\n */\n export interface Status {\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss'\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The old value, specified in the case of `set:'update'` or\n * `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no fetchMethod, so {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link OptionsBase.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions\n extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions\n extends FetcherFetchOptions {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext\n extends FetchOptions {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext\n extends FetchOptions {\n context?: undefined\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions\n extends Pick, 'updateAgeOnHas'> {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions\n extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions\n extends Pick, 'allowStale'> {}\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions\n extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions\n ) => Promise | V | void | undefined\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed\n * by default, and MAY live in the cache long after they have expired.\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * Must be an integer number of ms. If set to 0, this indicates \"no TTL\"\n *\n * @default 0\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n * Note that this may significantly degrade performance,\n * especially if the cache is storing a large number of items.\n * It is almost always best to just leave the stale items in\n * the cache, and let them fall out as new items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * @default false\n */\n ttlAutopurge?: boolean\n\n /**\n * Update the age of items on {@link LRUCache#get}, renewing their TTL\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * @default false\n */\n updateAgeOnGet?: boolean\n\n /**\n * Update the age of items on {@link LRUCache#has}, renewing their TTL\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * @default false\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the cache.\n * This can be handy if you want to close file descriptors or do other\n * cleanup tasks when items are no longer accessible. Called with `key,\n * value`. It's called before actually removing the item from the\n * internal cache, so it is *NOT* safe to re-add them.\n *\n * Use {@link OptionsBase.disposeAfter} if you wish to dispose items after\n * they have been full removed, when it is safe to add them back to the\n * cache.\n */\n dispose?: Disposer\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when\n * setting a new value for an existing key (ie, when updating a value\n * rather than inserting a new value). Note that the TTL value is\n * _always_ set (if provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n */\n noUpdateTTL?: boolean\n\n /**\n * If you wish to track item size, you must provide a maxSize\n * note that we still will only keep up to max *actual items*,\n * if max is set, so size tracking may cause fewer than max items\n * to be stored. At the extreme, a single item of maxSize size\n * will cause everything else in the cache to be dropped when it\n * is added. Use with caution!\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod}, then it will not be stored in the\n * cache.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n */\n fetchMethod?: Fetcher\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the\n * {@link LRUCache#fetch} fails, not any other times.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches an `'abort'`\n * event, whether user-triggered, or due to internal cache behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and its return\n * value will be ignored and not cached.\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls are not\n * immediately resolved or rejected when they are aborted, and instead\n * take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n }\n\n export interface OptionsMaxLimit\n extends OptionsBase {\n max: Count\n }\n export interface OptionsTTLLimit\n extends OptionsBase {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit\n extends OptionsBase {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump}\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * All properties from the options object (with the exception of\n * {@link OptionsBase.max} and {@link OptionsBase.maxSize}) are added as\n * normal public members. (`max` and `maxBase` are read-only getters.)\n * Changing any of these will alter the defaults for subsequent method calls,\n * but is otherwise safe.\n */\nexport class LRUCache {\n // properties coming in from the options of these, only max and maxSize\n // really *need* to be protected. The rest can be modified, as they just\n // set defaults for various methods.\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: any) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: any\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context\n ),\n moveToTail: (index: number): void =>\n c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) =>\n c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) =>\n c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(\n options: LRUCache.Options | LRUCache\n ) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n } = options\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize'\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (\n fetchMethod !== undefined &&\n typeof fetchMethod !== 'function'\n ) {\n throw new TypeError(\n 'fetchMethod must be a function if specified'\n )\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = new Array(max).fill(undefined)\n this.#valList = new Array(max).fill(undefined)\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified'\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified'\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0\n ? ttlResolution\n : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError(\n 'ttl must be a positive integer if specified'\n )\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required'\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the remaining TTL time for a given entry key\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n\n this.#setItemTTL = (index, ttl, start = perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n if (ttl !== 0 && this.ttlAutopurge) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.delete(this.#keyList[index] as K)\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? perf.now() : 0\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n status.remainingTTL = status.now + ttl - start\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(\n () => (cachedNow = 0),\n this.ttlResolution\n )\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n return ttls[index] === 0 || starts[index] === 0\n ? Infinity\n : starts[index] + ttls[index] - (cachedNow || getNow())\n }\n\n this.#isStale = index => {\n return (\n ttls[index] !== 0 &&\n starts[index] !== 0 &&\n (cachedNow || getNow()) - starts[index] > ttls[index]\n )\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index]\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n return 0\n }\n if (!isPosInt(size)) {\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)'\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.'\n )\n }\n }\n return size\n }\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index]\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index]\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status\n ) => void = (_i, _s, _st) => {}\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache'\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; true; ) {\n if (!this.#isValidIndex(i)) {\n break\n }\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; true; ) {\n if (!this.#isValidIndex(i)) {\n break\n }\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (\n k !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (\n k !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (\n v !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (\n v !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to Array.find(). fn is called as fn(value, key, cache).\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {}\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from\n * most recently used to least recently used. fn is called as\n * fn(value, key, cache). Does not update age or recenty of use.\n * Does not iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => any,\n thisp: any = this\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => any,\n thisp: any = this\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.delete(this.#keyList[i] as K)\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to cache.load()\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = perf.now() - this.#starts[i]\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n * Note that the shape of the resulting cache may be different if the\n * same options are not used in both caches.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = perf.now() - age\n }\n this.set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n */\n set(\n k: K,\n v: V | BackgroundFetch,\n setOptions: LRUCache.SetOptions = {}\n ) {\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n // have to delete, in case something is there already.\n this.delete(k)\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0\n ? this.#tail\n : this.#free.length !== 0\n ? this.#free.pop()\n : this.#size === this.#max\n ? this.#evict(false)\n : this.#size\n ) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n } else {\n // update\n this.#moveToTail(index)\n const oldVal = this.#valList[index] as V | BackgroundFetch\n if (v !== oldVal) {\n if (this.#hasFetchMethod && this.#isBackgroundFetch(oldVal)) {\n oldVal.__abortController.abort(new Error('replaced'))\n } else if (!noDisposeOnSet) {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal as V, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal as V, k, 'set'])\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (status) {\n status.set = 'replace'\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal)\n ? oldVal.__staleWhileFetching\n : oldVal\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n } else if (status) {\n status.set = 'update'\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head] as K\n const v = this.#valList[head] as V\n if (this.#hasFetchMethod && this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('evicted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } =\n hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (\n index !== undefined &&\n (allowStale || !this.#isStale(index))\n ) {\n const v = this.#valList[index]\n // either stale and allowed, or forcing a refresh of non-stale value\n return this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n }\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: any\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AbortController()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (\n v: V | void | undefined,\n updateCache = false\n ): V | undefined | void => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n if (v === undefined) {\n if (bf.__staleWhileFetching) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.delete(k)\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.set(k, v, fetchOpts.options)\n }\n }\n return v\n }\n\n const eb = (er: any) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er\n }\n return fetchFail(er)\n }\n\n const fetchFail = (er: any): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted =\n aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del = !noDelete || bf.__staleWhileFetching === undefined\n if (del) {\n this.delete(k)\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | void | undefined) => void,\n rej: (e: any) => void\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v), rej)\n }\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (\n !options.ignoreFetchAbort ||\n options.allowStaleOnFetchAbort\n ) {\n res()\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: any): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AbortController\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n */\n fetch(\n k: K,\n fetchOptions: unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext\n ): Promise\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC\n ? K\n : FC extends undefined | void\n ? K\n : never,\n fetchOptions?: unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : never\n ): Promise\n async fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {}\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale =\n allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n if (status) status.get = 'stale'\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.delete(k)\n }\n if (status && allowStale) status.returnedStale = true\n return allowStale ? value : undefined\n } else {\n if (\n status &&\n allowStale &&\n value.__staleWhileFetching !== undefined\n ) {\n status.returnedStale = true\n }\n return allowStale ? value.__staleWhileFetching : undefined\n }\n } else {\n if (status) status.get = 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n if (fetching) {\n return value.__staleWhileFetching\n }\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return value\n }\n } else if (status) {\n status.get = 'miss'\n }\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n deleted = true\n if (this.#size === 1) {\n this.clear()\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, 'delete')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, 'delete'])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#next[this.#prev[index]] = this.#next[index]\n this.#prev[this.#next[index]] = this.#prev[index]\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, 'delete')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, 'delete'])\n }\n }\n }\n\n this.#keyMap.clear()\n this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n\nexport default LRUCache\n"], - "mappings": "mVAMA,IAAMA,EACJ,OAAO,aAAgB,UACvB,aACA,OAAO,YAAY,KAAQ,WACvB,YACA,KAEAC,EAAS,IAAI,IAKbC,EAAc,CAClBC,EACAC,EACAC,EACAC,IACE,CACF,OAAO,SAAY,UACnB,SACA,OAAO,QAAQ,aAAgB,WAC3B,QAAQ,YAAYH,EAAKC,EAAMC,EAAMC,CAAE,EACvC,QAAQ,MAAM,IAAID,MAASD,MAASD,GAAK,CAC/C,EAEMI,EAAcF,GAAiB,CAACJ,EAAO,IAAII,CAAI,EAE/CG,EAAO,OAAO,MAAM,EAIpBC,EAAYC,GAChBA,GAAKA,IAAM,KAAK,MAAMA,CAAC,GAAKA,EAAI,GAAK,SAASA,CAAC,EAc3CC,EAAgBC,GACnBH,EAASG,CAAG,EAETA,GAAO,KAAK,IAAI,EAAG,CAAC,EACpB,WACAA,GAAO,KAAK,IAAI,EAAG,EAAE,EACrB,YACAA,GAAO,KAAK,IAAI,EAAG,EAAE,EACrB,YACAA,GAAO,OAAO,iBACdC,EACA,KATA,KAYAA,EAAN,cAAwB,KAAa,CACnC,YAAYC,EAAY,CACtB,MAAM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KAAKgB,IAAoB,KAAKN,GAAW,CAC3C,IAAM2E,EAAK,KAAK3E,GACZ4E,EACJ,KAAQA,EAAOD,GAAI,MAAK,GACtB,KAAKvF,KAAgB,GAAGwF,CAAI,EAGlC,GAGF+B,EAAe3H", - "names": ["perf", "warned", "emitWarning", "msg", "type", "code", "fn", "shouldWarn", "TYPE", "isPosInt", "n", "getUintArray", "max", "ZeroArray", "size", "_constructing", "_Stack", "HeapCls", "__privateSet", "s", "__privateGet", "Stack", "__privateAdd", "LRUCache", "#max", "#maxSize", "#dispose", "#disposeAfter", "#fetchMethod", "#size", "#calculatedSize", "#keyMap", "#keyList", "#valList", "#next", "#prev", "#head", "#tail", "#free", "#disposed", "#sizes", "#starts", "#ttls", "#hasDispose", "#hasFetchMethod", "#hasDisposeAfter", "c", "p", "#isBackgroundFetch", "k", "index", "options", "context", "#backgroundFetch", "#moveToTail", "#indexes", "#rindexes", "#isStale", "ttl", "ttlResolution", "ttlAutopurge", "updateAgeOnGet", "updateAgeOnHas", "allowStale", "dispose", "disposeAfter", "noDisposeOnSet", "noUpdateTTL", "maxSize", "maxEntrySize", "sizeCalculation", "fetchMethod", "noDeleteOnFetchRejection", "noDeleteOnStaleGet", "allowStaleOnFetchRejection", "allowStaleOnFetchAbort", "ignoreFetchAbort", "UintArray", "#initializeSizeTracking", "#initializeTTLTracking", "key", "ttls", "starts", "#setItemTTL", "start", "t", "#updateItemAge", "#statusTTL", "status", "cachedNow", "getNow", "sizes", "#removeItemSize", "#requireSize", "v", "#addItemSize", "#evict", "_i", "_s", "_st", "_k", "_v", "i", "#isValidIndex", "getOptions", "value", "thisp", "deleted", "arr", "entry", "age", "setOptions", "oldVal", "oldValue", "dt", "task", "val", "free", "head", "hasOptions", "peekOptions", "ac", "signal", "fetchOpts", "cb", "updateCache", "aborted", "ignoreAbort", "fetchFail", "bf", "eb", "er", "allowStaleAborted", "noDelete", "pcall", "res", "rej", "fmp", "b", "fetchOptions", "forceRefresh", "stale", "isStale", "staleVal", "fetching", "#connect", "mjs_default"] -} diff --git a/node_modules/mysql2/node_modules/lru-cache/dist/mjs/package.json b/node_modules/mysql2/node_modules/lru-cache/dist/mjs/package.json deleted file mode 100644 index 3dbc1ca..0000000 --- a/node_modules/mysql2/node_modules/lru-cache/dist/mjs/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "module" -} diff --git a/node_modules/mysql2/node_modules/lru-cache/package.json b/node_modules/mysql2/node_modules/lru-cache/package.json deleted file mode 100644 index c98b763..0000000 --- a/node_modules/mysql2/node_modules/lru-cache/package.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "name": "lru-cache", - "description": "A cache object that deletes the least-recently-used items.", - "version": "8.0.5", - "author": "Isaac Z. Schlueter ", - "keywords": [ - "mru", - "lru", - "cache" - ], - "sideEffects": false, - "scripts": { - "build": "npm run prepare", - "preprepare": "rm -rf dist", - "prepare": "tsc -p tsconfig.json && tsc -p tsconfig-esm.json", - "postprepare": "bash fixup.sh", - "pretest": "npm run prepare", - "presnap": "npm run prepare", - "test": "c8 tap", - "snap": "c8 tap", - "preversion": "npm test", - "postversion": "npm publish", - "prepublishOnly": "git push origin --follow-tags", - "format": "prettier --write .", - "typedoc": "typedoc --tsconfig tsconfig-esm.json ./src/*.ts", - "benchmark-results-typedoc": "bash scripts/benchmark-results-typedoc.sh", - "prebenchmark": "npm run prepare", - "benchmark": "make -C benchmark", - "preprofile": "npm run prepare", - "profile": "make -C benchmark profile" - }, - "main": "./dist/cjs/index-cjs.js", - "module": "./dist/mjs/index.js", - "types": "./dist/mjs/index.d.ts", - "exports": { - "./min": { - "import": { - "types": "./dist/mjs/index.d.ts", - "default": "./dist/mjs/index.min.js" - }, - "require": { - "types": "./dist/cjs/index.d.ts", - "default": "./dist/cjs/index.min.js" - } - }, - ".": { - "import": { - "types": "./dist/mjs/index.d.ts", - "default": "./dist/mjs/index.js" - }, - "require": { - "types": "./dist/cjs/index.d.ts", - "default": "./dist/cjs/index-cjs.js" - } - } - }, - "repository": "git://github.com/isaacs/node-lru-cache.git", - "devDependencies": { - "@size-limit/preset-small-lib": "^7.0.8", - "@types/node": "^17.0.31", - "@types/tap": "^15.0.6", - "benchmark": "^2.1.4", - "c8": "^7.11.2", - "clock-mock": "^1.0.6", - "esbuild": "^0.17.11", - "eslint-config-prettier": "^8.5.0", - "marked": "^4.2.12", - "mkdirp": "^2.1.5", - "prettier": "^2.6.2", - "size-limit": "^7.0.8", - "tap": "^16.3.4", - "ts-node": "^10.7.0", - "tslib": "^2.4.0", - "typedoc": "^0.23.24", - "typescript": "^4.6.4" - }, - "license": "ISC", - "files": [ - "dist" - ], - "engines": { - "node": ">=16.14" - }, - "prettier": { - "semi": false, - "printWidth": 70, - "tabWidth": 2, - "useTabs": false, - "singleQuote": true, - "jsxSingleQuote": false, - "bracketSameLine": true, - "arrowParens": "avoid", - "endOfLine": "lf" - }, - "tap": { - "coverage": false, - "node-arg": [ - "--expose-gc", - "--no-warnings", - "--loader", - "ts-node/esm" - ], - "ts": false - }, - "size-limit": [ - { - "path": "./dist/mjs/index.js" - } - ] -} diff --git a/node_modules/mysql2/package.json b/node_modules/mysql2/package.json deleted file mode 100644 index 015dd36..0000000 --- a/node_modules/mysql2/package.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "name": "mysql2", - "version": "3.6.5", - "description": "fast mysql driver. Implements core protocol, prepared statements, ssl and compression in native JS", - "main": "index.js", - "directories": { - "example": "examples" - }, - "typings": "typings/mysql/index", - "scripts": { - "lint": "npm run lint:docs && npm run lint:code", - "lint:code": "eslint index.js promise.js index.d.ts promise.d.ts \"typings/**/*.ts\" \"lib/**/*.js\" \"test/**/*.{js,ts}\" \"benchmarks/**/*.js\"", - "lint:docs": "eslint Contributing.md README.md \"documentation/**/*.md\" \"examples/*.js\"", - "test": "node ./test/run.js", - "test:builtin-node-runner": "NODE_V8_COVERAGE=./coverage node --test --experimental-test-coverage test/builtin-runner", - "test:tsc-build": "cd \"test/tsc-build\" && npx tsc -p \"tsconfig.json\"", - "coverage-test": "c8 -r cobertura -r lcov -r text node ./test/run.js", - "benchmark": "node ./benchmarks/benchmark.js", - "prettier": "prettier --single-quote --trailing-comma none --write \"{lib,examples,test}/**/*.js\"", - "prettier:docs": "prettier --single-quote --trailing-comma none --write README.md documentation/*", - "precommit": "lint-staged", - "eslint-check": "eslint --print-config .eslintrc | eslint-config-prettier-check", - "wait-port": "wait-on" - }, - "lint-staged": { - "*.js": [ - "prettier --single-quote --trailing-comma none --write", - "git add" - ] - }, - "repository": { - "type": "git", - "url": "https://github.com/sidorares/node-mysql2" - }, - "keywords": [ - "mysql", - "client", - "server" - ], - "files": [ - "lib", - "typings/mysql", - "index.js", - "index.d.ts", - "promise.js", - "promise.d.ts" - ], - "exports": { - ".": "./index.js", - "./package.json": "./package.json", - "./promise": "./promise.js", - "./promise.js": "./promise.js" - }, - "engines": { - "node": ">= 8.0" - }, - "author": "Andrey Sidorov ", - "license": "MIT", - "dependencies": { - "denque": "^2.1.0", - "generate-function": "^2.3.1", - "iconv-lite": "^0.6.3", - "long": "^5.2.1", - "lru-cache": "^8.0.0", - "named-placeholders": "^1.1.3", - "seq-queue": "^0.0.5", - "sqlstring": "^2.3.2" - }, - "devDependencies": { - "@types/node": "^20.0.0", - "@typescript-eslint/eslint-plugin": "^5.42.1", - "@typescript-eslint/parser": "^5.42.1", - "assert-diff": "^3.0.2", - "benchmark": "^2.1.4", - "c8": "^8.0.0", - "error-stack-parser": "^2.0.3", - "eslint": "^8.27.0", - "eslint-config-prettier": "^9.0.0", - "eslint-plugin-async-await": "0.0.0", - "eslint-plugin-markdown": "^3.0.0", - "husky": "^8.0.2", - "lint-staged": "^15.0.1", - "portfinder": "^1.0.28", - "prettier": "^3.0.0", - "progress": "^2.0.3", - "typescript": "^5.0.2", - "urun": "0.0.8", - "utest": "0.0.8" - } -} diff --git a/node_modules/mysql2/promise.d.ts b/node_modules/mysql2/promise.d.ts deleted file mode 100644 index e9f3e08..0000000 --- a/node_modules/mysql2/promise.d.ts +++ /dev/null @@ -1,131 +0,0 @@ -import { EventEmitter } from 'events'; - -import { - RowDataPacket, - OkPacket, - ResultSetHeader, - FieldPacket, - QueryOptions, - ConnectionOptions, - PoolOptions, - PoolClusterOptions, - Pool as CorePool, -} from './index.js'; -import { ExecutableBase as ExecutableBaseClass } from './typings/mysql/lib/protocol/sequences/promise/ExecutableBase.js'; -import { QueryableBase as QueryableBaseClass } from './typings/mysql/lib/protocol/sequences/promise/QueryableBase.js'; - -export * from './index.js'; - -// Expose class interfaces -declare class QueryableAndExecutableBase extends QueryableBaseClass( - ExecutableBaseClass(EventEmitter), -) {} - -export interface PreparedStatementInfo { - close(): Promise; - execute( - parameters: any | any[] | { [param: string]: any }, - ): Promise< - [ - ( - | RowDataPacket[][] - | RowDataPacket[] - | OkPacket - | OkPacket[] - | ResultSetHeader - ), - FieldPacket[], - ] - >; -} - -export interface Connection extends QueryableAndExecutableBase { - config: ConnectionOptions; - - threadId: number; - - connect(): Promise; - - ping(): Promise; - - beginTransaction(): Promise; - - commit(): Promise; - - rollback(): Promise; - - changeUser(options: ConnectionOptions): Promise; - - prepare(options: string | QueryOptions): Promise; - - unprepare(sql: string | QueryOptions): void; - - end(options?: any): Promise; - - destroy(): void; - - pause(): void; - - resume(): void; - - escape(value: any): string; - - escapeId(value: string): string; - escapeId(values: string[]): string; - - format(sql: string, values?: any | any[] | { [param: string]: any }): string; -} - -export interface PoolConnection extends Connection { - release(): void; - connection: Connection; -} - -export interface Pool extends Connection { - getConnection(): Promise; - - releaseConnection(connection: PoolConnection): void; - - on(event: 'connection', listener: (connection: PoolConnection) => any): this; - on(event: 'acquire', listener: (connection: PoolConnection) => any): this; - on(event: 'release', listener: (connection: PoolConnection) => any): this; - on(event: 'enqueue', listener: () => any): this; - - end(): Promise; - - pool: CorePool; -} - -export interface PoolNamespace extends QueryableAndExecutableBase { - getConnection(): Promise; -} - -export interface PoolCluster extends EventEmitter { - config: PoolClusterOptions; - - add(config: PoolOptions): void; - add(group: string, connectionUri: string): void; - add(group: string, config: PoolOptions): void; - - end(): Promise; - - getConnection(): Promise; - getConnection(group: string): Promise; - getConnection(group: string, selector: string): Promise; - - of(pattern: string, selector?: string): PoolNamespace; - - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'remove', listener: (nodeId: number) => void): this; - on(event: 'warn', listener: (err: Error) => void): this; -} - -export function createConnection(connectionUri: string): Promise; -export function createConnection( - config: ConnectionOptions, -): Promise; - -export function createPool(connectionUri: string): Pool; -export function createPool(config: PoolOptions): Pool; - -export function createPoolCluster(config?: PoolClusterOptions): PoolCluster; diff --git a/node_modules/mysql2/promise.js b/node_modules/mysql2/promise.js deleted file mode 100644 index 95c5808..0000000 --- a/node_modules/mysql2/promise.js +++ /dev/null @@ -1,584 +0,0 @@ -'use strict'; - -const core = require('./index.js'); -const EventEmitter = require('events').EventEmitter; -const parserCache = require('./lib/parsers/parser_cache.js'); - -function makeDoneCb(resolve, reject, localErr) { - return function (err, rows, fields) { - if (err) { - localErr.message = err.message; - localErr.code = err.code; - localErr.errno = err.errno; - localErr.sql = err.sql; - localErr.sqlState = err.sqlState; - localErr.sqlMessage = err.sqlMessage; - reject(localErr); - } else { - resolve([rows, fields]); - } - }; -} - -function inheritEvents(source, target, events) { - const listeners = {}; - target - .on('newListener', eventName => { - if (events.indexOf(eventName) >= 0 && !target.listenerCount(eventName)) { - source.on( - eventName, - (listeners[eventName] = function () { - const args = [].slice.call(arguments); - args.unshift(eventName); - - target.emit.apply(target, args); - }) - ); - } - }) - .on('removeListener', eventName => { - if (events.indexOf(eventName) >= 0 && !target.listenerCount(eventName)) { - source.removeListener(eventName, listeners[eventName]); - delete listeners[eventName]; - } - }); -} - -class PromisePreparedStatementInfo { - constructor(statement, promiseImpl) { - this.statement = statement; - this.Promise = promiseImpl; - } - - execute(parameters) { - const s = this.statement; - const localErr = new Error(); - return new this.Promise((resolve, reject) => { - const done = makeDoneCb(resolve, reject, localErr); - if (parameters) { - s.execute(parameters, done); - } else { - s.execute(done); - } - }); - } - - close() { - return new this.Promise(resolve => { - this.statement.close(); - resolve(); - }); - } -} - -class PromiseConnection extends EventEmitter { - constructor(connection, promiseImpl) { - super(); - this.connection = connection; - this.Promise = promiseImpl || Promise; - inheritEvents(connection, this, [ - 'error', - 'drain', - 'connect', - 'end', - 'enqueue' - ]); - } - - release() { - this.connection.release(); - } - - query(query, params) { - const c = this.connection; - const localErr = new Error(); - if (typeof params === 'function') { - throw new Error( - 'Callback function is not available with promise clients.' - ); - } - return new this.Promise((resolve, reject) => { - const done = makeDoneCb(resolve, reject, localErr); - if (params !== undefined) { - c.query(query, params, done); - } else { - c.query(query, done); - } - }); - } - - execute(query, params) { - const c = this.connection; - const localErr = new Error(); - if (typeof params === 'function') { - throw new Error( - 'Callback function is not available with promise clients.' - ); - } - return new this.Promise((resolve, reject) => { - const done = makeDoneCb(resolve, reject, localErr); - if (params !== undefined) { - c.execute(query, params, done); - } else { - c.execute(query, done); - } - }); - } - - end() { - return new this.Promise(resolve => { - this.connection.end(resolve); - }); - } - - beginTransaction() { - const c = this.connection; - const localErr = new Error(); - return new this.Promise((resolve, reject) => { - const done = makeDoneCb(resolve, reject, localErr); - c.beginTransaction(done); - }); - } - - commit() { - const c = this.connection; - const localErr = new Error(); - return new this.Promise((resolve, reject) => { - const done = makeDoneCb(resolve, reject, localErr); - c.commit(done); - }); - } - - rollback() { - const c = this.connection; - const localErr = new Error(); - return new this.Promise((resolve, reject) => { - const done = makeDoneCb(resolve, reject, localErr); - c.rollback(done); - }); - } - - ping() { - const c = this.connection; - const localErr = new Error(); - return new this.Promise((resolve, reject) => { - c.ping(err => { - if (err) { - localErr.message = err.message; - localErr.code = err.code; - localErr.errno = err.errno; - localErr.sqlState = err.sqlState; - localErr.sqlMessage = err.sqlMessage; - reject(localErr); - } else { - resolve(true); - } - }); - }); - } - - connect() { - const c = this.connection; - const localErr = new Error(); - return new this.Promise((resolve, reject) => { - c.connect((err, param) => { - if (err) { - localErr.message = err.message; - localErr.code = err.code; - localErr.errno = err.errno; - localErr.sqlState = err.sqlState; - localErr.sqlMessage = err.sqlMessage; - reject(localErr); - } else { - resolve(param); - } - }); - }); - } - - prepare(options) { - const c = this.connection; - const promiseImpl = this.Promise; - const localErr = new Error(); - return new this.Promise((resolve, reject) => { - c.prepare(options, (err, statement) => { - if (err) { - localErr.message = err.message; - localErr.code = err.code; - localErr.errno = err.errno; - localErr.sqlState = err.sqlState; - localErr.sqlMessage = err.sqlMessage; - reject(localErr); - } else { - const wrappedStatement = new PromisePreparedStatementInfo( - statement, - promiseImpl - ); - resolve(wrappedStatement); - } - }); - }); - } - - changeUser(options) { - const c = this.connection; - const localErr = new Error(); - return new this.Promise((resolve, reject) => { - c.changeUser(options, err => { - if (err) { - localErr.message = err.message; - localErr.code = err.code; - localErr.errno = err.errno; - localErr.sqlState = err.sqlState; - localErr.sqlMessage = err.sqlMessage; - reject(localErr); - } else { - resolve(); - } - }); - }); - } - - get config() { - return this.connection.config; - } - - get threadId() { - return this.connection.threadId; - } -} - -function createConnection(opts) { - const coreConnection = core.createConnection(opts); - const createConnectionErr = new Error(); - const thePromise = opts.Promise || Promise; - if (!thePromise) { - throw new Error( - 'no Promise implementation available.' + - 'Use promise-enabled node version or pass userland Promise' + - " implementation as parameter, for example: { Promise: require('bluebird') }" - ); - } - return new thePromise((resolve, reject) => { - coreConnection.once('connect', () => { - resolve(new PromiseConnection(coreConnection, thePromise)); - }); - coreConnection.once('error', err => { - createConnectionErr.message = err.message; - createConnectionErr.code = err.code; - createConnectionErr.errno = err.errno; - createConnectionErr.sqlState = err.sqlState; - reject(createConnectionErr); - }); - }); -} - -// note: the callback of "changeUser" is not called on success -// hence there is no possibility to call "resolve" - -// patching PromiseConnection -// create facade functions for prototype functions on "Connection" that are not yet -// implemented with PromiseConnection - -// proxy synchronous functions only -(function (functionsToWrap) { - for (let i = 0; functionsToWrap && i < functionsToWrap.length; i++) { - const func = functionsToWrap[i]; - - if ( - typeof core.Connection.prototype[func] === 'function' && - PromiseConnection.prototype[func] === undefined - ) { - PromiseConnection.prototype[func] = (function factory(funcName) { - return function () { - return core.Connection.prototype[funcName].apply( - this.connection, - arguments - ); - }; - })(func); - } - } -})([ - // synchronous functions - 'close', - 'createBinlogStream', - 'destroy', - 'escape', - 'escapeId', - 'format', - 'pause', - 'pipe', - 'resume', - 'unprepare' -]); - -class PromisePoolConnection extends PromiseConnection { - constructor(connection, promiseImpl) { - super(connection, promiseImpl); - } - - destroy() { - return core.PoolConnection.prototype.destroy.apply( - this.connection, - arguments - ); - } -} - -class PromisePool extends EventEmitter { - constructor(pool, thePromise) { - super(); - this.pool = pool; - this.Promise = thePromise || Promise; - inheritEvents(pool, this, ['acquire', 'connection', 'enqueue', 'release']); - } - - getConnection() { - const corePool = this.pool; - return new this.Promise((resolve, reject) => { - corePool.getConnection((err, coreConnection) => { - if (err) { - reject(err); - } else { - resolve(new PromisePoolConnection(coreConnection, this.Promise)); - } - }); - }); - } - - releaseConnection(connection) { - if (connection instanceof PromisePoolConnection) connection.release(); - } - - query(sql, args) { - const corePool = this.pool; - const localErr = new Error(); - if (typeof args === 'function') { - throw new Error( - 'Callback function is not available with promise clients.' - ); - } - return new this.Promise((resolve, reject) => { - const done = makeDoneCb(resolve, reject, localErr); - if (args !== undefined) { - corePool.query(sql, args, done); - } else { - corePool.query(sql, done); - } - }); - } - - execute(sql, args) { - const corePool = this.pool; - const localErr = new Error(); - if (typeof args === 'function') { - throw new Error( - 'Callback function is not available with promise clients.' - ); - } - return new this.Promise((resolve, reject) => { - const done = makeDoneCb(resolve, reject, localErr); - if (args) { - corePool.execute(sql, args, done); - } else { - corePool.execute(sql, done); - } - }); - } - - end() { - const corePool = this.pool; - const localErr = new Error(); - return new this.Promise((resolve, reject) => { - corePool.end(err => { - if (err) { - localErr.message = err.message; - localErr.code = err.code; - localErr.errno = err.errno; - localErr.sqlState = err.sqlState; - localErr.sqlMessage = err.sqlMessage; - reject(localErr); - } else { - resolve(); - } - }); - }); - } -} - -function createPool(opts) { - const corePool = core.createPool(opts); - const thePromise = opts.Promise || Promise; - if (!thePromise) { - throw new Error( - 'no Promise implementation available.' + - 'Use promise-enabled node version or pass userland Promise' + - " implementation as parameter, for example: { Promise: require('bluebird') }" - ); - } - - return new PromisePool(corePool, thePromise); -} - -(function (functionsToWrap) { - for (let i = 0; functionsToWrap && i < functionsToWrap.length; i++) { - const func = functionsToWrap[i]; - - if ( - typeof core.Pool.prototype[func] === 'function' && - PromisePool.prototype[func] === undefined - ) { - PromisePool.prototype[func] = (function factory(funcName) { - return function () { - return core.Pool.prototype[funcName].apply(this.pool, arguments); - }; - })(func); - } - } -})([ - // synchronous functions - 'escape', - 'escapeId', - 'format' -]); - -class PromisePoolCluster extends EventEmitter { - constructor(poolCluster, thePromise) { - super(); - this.poolCluster = poolCluster; - this.Promise = thePromise || Promise; - inheritEvents(poolCluster, this, ['warn', 'remove']); - } - - getConnection() { - const corePoolCluster = this.poolCluster; - return new this.Promise((resolve, reject) => { - corePoolCluster.getConnection((err, coreConnection) => { - if (err) { - reject(err); - } else { - resolve(new PromisePoolConnection(coreConnection, this.Promise)); - } - }); - }); - } - - query(sql, args) { - const corePoolCluster = this.poolCluster; - const localErr = new Error(); - if (typeof args === 'function') { - throw new Error( - 'Callback function is not available with promise clients.' - ); - } - return new this.Promise((resolve, reject) => { - const done = makeDoneCb(resolve, reject, localErr); - corePoolCluster.query(sql, args, done); - }); - } - - execute(sql, args) { - const corePoolCluster = this.poolCluster; - const localErr = new Error(); - if (typeof args === 'function') { - throw new Error( - 'Callback function is not available with promise clients.' - ); - } - return new this.Promise((resolve, reject) => { - const done = makeDoneCb(resolve, reject, localErr); - corePoolCluster.execute(sql, args, done); - }); - } - - of(pattern, selector) { - return new PromisePoolCluster( - this.poolCluster.of(pattern, selector), - this.Promise - ); - } - - end() { - const corePoolCluster = this.poolCluster; - const localErr = new Error(); - return new this.Promise((resolve, reject) => { - corePoolCluster.end(err => { - if (err) { - localErr.message = err.message; - localErr.code = err.code; - localErr.errno = err.errno; - localErr.sqlState = err.sqlState; - localErr.sqlMessage = err.sqlMessage; - reject(localErr); - } else { - resolve(); - } - }); - }); - } -} - -/** - * proxy poolCluster synchronous functions - */ -(function (functionsToWrap) { - for (let i = 0; functionsToWrap && i < functionsToWrap.length; i++) { - const func = functionsToWrap[i]; - - if ( - typeof core.PoolCluster.prototype[func] === 'function' && - PromisePoolCluster.prototype[func] === undefined - ) { - PromisePoolCluster.prototype[func] = (function factory(funcName) { - return function () { - return core.PoolCluster.prototype[funcName].apply(this.poolCluster, arguments); - }; - })(func); - } - } -})([ - 'add' -]); - -function createPoolCluster(opts) { - const corePoolCluster = core.createPoolCluster(opts); - const thePromise = (opts && opts.Promise) || Promise; - if (!thePromise) { - throw new Error( - 'no Promise implementation available.' + - 'Use promise-enabled node version or pass userland Promise' + - " implementation as parameter, for example: { Promise: require('bluebird') }" - ); - } - return new PromisePoolCluster(corePoolCluster, thePromise); -} - -exports.createConnection = createConnection; -exports.createPool = createPool; -exports.createPoolCluster = createPoolCluster; -exports.escape = core.escape; -exports.escapeId = core.escapeId; -exports.format = core.format; -exports.raw = core.raw; -exports.PromisePool = PromisePool; -exports.PromiseConnection = PromiseConnection; -exports.PromisePoolConnection = PromisePoolConnection; - -exports.__defineGetter__('Types', () => require('./lib/constants/types.js')); - -exports.__defineGetter__('Charsets', () => - require('./lib/constants/charsets.js') -); - -exports.__defineGetter__('CharsetToEncoding', () => - require('./lib/constants/charset_encodings.js') -); - -exports.setMaxParserCache = function(max) { - parserCache.setMaxCache(max); -}; - -exports.clearParserCache = function() { - parserCache.clearCache(); -}; diff --git a/node_modules/mysql2/typings/mysql/LICENSE.txt b/node_modules/mysql2/typings/mysql/LICENSE.txt deleted file mode 100644 index fc35417..0000000 --- a/node_modules/mysql2/typings/mysql/LICENSE.txt +++ /dev/null @@ -1,15 +0,0 @@ -ISC License - -Copyright (c) 2016, Felix Frederick Becker - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/mysql2/typings/mysql/index.d.ts b/node_modules/mysql2/typings/mysql/index.d.ts deleted file mode 100644 index b7fd83a..0000000 --- a/node_modules/mysql2/typings/mysql/index.d.ts +++ /dev/null @@ -1,94 +0,0 @@ -import { Pool as BasePool, PoolOptions } from './lib/Pool.js'; -import { - Connection as BaseConnection, - ConnectionOptions, - SslOptions, -} from './lib/Connection.js'; -import { - Query as BaseQuery, - QueryOptions, - QueryError, -} from './lib/protocol/sequences/Query.js'; -import { - PoolCluster as BasePoolCluster, - PoolClusterOptions, - PoolNamespace, -} from './lib/PoolCluster.js'; -import { PoolConnection as BasePoolConnection } from './lib/PoolConnection.js'; -import { - Prepare as BasePrepare, - PrepareStatementInfo, -} from './lib/protocol/sequences/Prepare.js'; -import { Server } from './lib/Server.js'; - -export { - ConnectionOptions, - SslOptions, - PoolOptions, - PoolClusterOptions, - PoolNamespace, - QueryOptions, - QueryError, - PrepareStatementInfo, -}; - -export * from './lib/protocol/packets/index.js'; -export * from './lib/Auth.js'; -export * from './lib/constants/index.js'; -export * from './lib/parsers/index.js'; - -// Expose class interfaces -export interface Connection extends BaseConnection {} -export interface Pool extends BasePool {} -export interface PoolConnection extends BasePoolConnection {} -export interface PoolCluster extends BasePoolCluster {} -export interface Query extends BaseQuery {} -export interface Prepare extends BasePrepare {} - -export function createConnection(connectionUri: string): BaseConnection; -export function createConnection(config: ConnectionOptions): BaseConnection; - -export function createPool(connectionUri: string): BasePool; -export function createPool(config: PoolOptions): BasePool; - -export function createPoolCluster(config?: PoolClusterOptions): PoolCluster; - -export function escape(value: any): string; - -export function escapeId(value: any): string; - -export function format(sql: string): string; -export function format( - sql: string, - values: any[], - stringifyObjects?: boolean, - timeZone?: string -): string; - -export function format( - sql: string, - values: any, - stringifyObjects?: boolean, - timeZone?: string -): string; - -export function raw(sql: string): { - toSqlString: () => string; -}; - -export interface ConnectionConfig extends ConnectionOptions { - mergeFlags(defaultFlags: string[], userFlags: string[] | string): number; - getDefaultFlags(options?: ConnectionOptions): string[]; - getCharsetNumber(charset: string): number; - getSSLProfile(name: string): { ca: string[] }; - parseUrl(url: string): { - host: string; - port: number; - database: string; - user: string; - password: string; - [key: string]: any; - }; -} - -export function createServer(handler: (conn: BaseConnection) => any): Server; diff --git a/node_modules/mysql2/typings/mysql/info.txt b/node_modules/mysql2/typings/mysql/info.txt deleted file mode 100644 index 8ee9419..0000000 --- a/node_modules/mysql2/typings/mysql/info.txt +++ /dev/null @@ -1 +0,0 @@ -temporary workaround, see https://github.com/sidorares/node-mysql2/issues/1210 diff --git a/node_modules/mysql2/typings/mysql/lib/Auth.d.ts b/node_modules/mysql2/typings/mysql/lib/Auth.d.ts deleted file mode 100644 index bfb32bd..0000000 --- a/node_modules/mysql2/typings/mysql/lib/Auth.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { RsaPublicKey, RsaPrivateKey, KeyLike } from 'crypto'; -import { Connection } from './Connection.js'; - -export type AuthPlugin = (pluginMetadata: { - connection: Connection; - command: string; -}) => ( - pluginData: Buffer -) => Promise | string | Buffer | Promise | null; - -type AuthPluginDefinition = (pluginOptions?: T) => AuthPlugin; - -export const authPlugins: { - caching_sha2_password: AuthPluginDefinition<{ - overrideIsSecure?: boolean; - serverPublicKey?: RsaPublicKey | RsaPrivateKey | KeyLike; - jonServerPublicKey?: (data: Buffer) => void; - }>; - mysql_clear_password: AuthPluginDefinition<{ - password?: string; - }>; - mysql_native_password: AuthPluginDefinition<{ - password?: string; - passwordSha1?: string; - }>; - sha256_password: AuthPluginDefinition<{ - serverPublicKey?: RsaPublicKey | RsaPrivateKey | KeyLike; - joinServerPublicKey?: (data: Buffer) => void; - }>; -}; diff --git a/node_modules/mysql2/typings/mysql/lib/Connection.d.ts b/node_modules/mysql2/typings/mysql/lib/Connection.d.ts deleted file mode 100644 index f6691f6..0000000 --- a/node_modules/mysql2/typings/mysql/lib/Connection.d.ts +++ /dev/null @@ -1,408 +0,0 @@ -// This file was modified by Oracle on November 04, 2021. -// Type definitions and corresponding descriptions were introduced for the -// connection options relevant for multifactor authentication. -// Modifications copyright (c) 2021, Oracle and/or its affiliates. - -import { EventEmitter } from 'events'; -import { Readable } from 'stream'; -import { Query, QueryError } from './protocol/sequences/Query.js'; -import { Prepare, PrepareStatementInfo } from './protocol/sequences/Prepare.js'; -import { - OkPacket, - FieldPacket, - RowDataPacket, - ResultSetHeader, - OkPacketParams, - ErrorPacketParams, -} from './protocol/packets/index.js'; -import { Connection as PromiseConnection } from '../../../promise.js'; -import { AuthPlugin } from './Auth.js'; -import { QueryableBase } from './protocol/sequences/QueryableBase.js'; -import { ExecutableBase } from './protocol/sequences/ExecutableBase.js'; - -export interface SslOptions { - /** - * A string or buffer holding the PFX or PKCS12 encoded private key, certificate and CA certificates - */ - pfx?: string; - - /** - * Either a string/buffer or list of strings/Buffers holding the PEM encoded private key(s) to use - */ - key?: string | string[] | Buffer | Buffer[]; - - /** - * A string of passphrase for the private key or pfx - */ - passphrase?: string; - - /** - * A string/buffer or list of strings/Buffers holding the PEM encoded certificate(s) - */ - cert?: string | string[] | Buffer | Buffer[]; - - /** - * Either a string/Buffer or list of strings/Buffers of PEM encoded CA certificates to trust. - */ - ca?: string | string[] | Buffer | Buffer[]; - - /** - * Either a string or list of strings of PEM encoded CRLs (Certificate Revocation List) - */ - crl?: string | string[]; - - /** - * A string describing the ciphers to use or exclude - */ - ciphers?: string; - - /** - * You can also connect to a MySQL server without properly providing the appropriate CA to trust. You should not do this. - */ - rejectUnauthorized?: boolean; - - /** - * Configure the minimum supported version of SSL, the default is TLSv1.2. - */ - minVersion?: string; - - /** - * Configure the maximum supported version of SSL, the default is TLSv1.3. - */ - maxVersion?: string; - - /** - * You can verify the server name identity presented on the server certificate when connecting to a MySQL server. - * You should enable this but it is disabled by default right now for backwards compatibility. - */ - verifyIdentity?: boolean; -} - -export interface ConnectionOptions { - /** - * DECIMAL and NEWDECIMAL types will be returned as numbers if this option is set to `true` ( default: `false`). - */ - decimalNumbers?: boolean; - - /** - * The MySQL user to authenticate as - */ - user?: string; - - /** - * The password of that MySQL user - */ - password?: string; - - /** - * Alias for the MySQL user password. Makes a bit more sense in a multifactor authentication setup (see - * "password2" and "password3") - */ - password1?: string; - - /** - * 2nd factor authentication password. Mandatory when the authentication policy for the MySQL user account - * requires an additional authentication method that needs a password. - * https://dev.mysql.com/doc/refman/8.0/en/multifactor-authentication.html - */ - password2?: string; - - /** - * 3rd factor authentication password. Mandatory when the authentication policy for the MySQL user account - * requires two additional authentication methods and the last one needs a password. - * https://dev.mysql.com/doc/refman/8.0/en/multifactor-authentication.html - */ - password3?: string; - - /** - * Name of the database to use for this connection - */ - database?: string; - - /** - * The charset for the connection. This is called 'collation' in the SQL-level of MySQL (like utf8_general_ci). - * If a SQL-level charset is specified (like utf8mb4) then the default collation for that charset is used. - * (Default: 'UTF8_GENERAL_CI') - */ - charset?: string; - - /** - * The hostname of the database you are connecting to. (Default: localhost) - */ - host?: string; - - /** - * The port number to connect to. (Default: 3306) - */ - port?: number; - - /** - * The source IP address to use for TCP connection - */ - localAddress?: string; - - /** - * The path to a unix domain socket to connect to. When used host and port are ignored - */ - socketPath?: string; - - /** - * The timezone used to store local dates. (Default: 'local') - */ - timezone?: string | 'local'; - - /** - * The milliseconds before a timeout occurs during the initial connection to the MySQL server. (Default: 10 seconds) - */ - connectTimeout?: number; - - /** - * Stringify objects instead of converting to values. (Default: 'false') - */ - stringifyObjects?: boolean; - - /** - * Allow connecting to MySQL instances that ask for the old (insecure) authentication method. (Default: false) - */ - insecureAuth?: boolean; - - /** - * By specifying a function that returns a readable stream, an arbitrary stream can be sent when sending a local fs file. - */ - infileStreamFactory?: (path: string) => Readable; - - /** - * Determines if column values should be converted to native JavaScript types. It is not recommended (and may go away / change in the future) - * to disable type casting, but you can currently do so on either the connection or query level. (Default: true) - * - * You can also specify a function (field: any, next: () => void) => {} to do the type casting yourself. - * - * WARNING: YOU MUST INVOKE the parser using one of these three field functions in your custom typeCast callback. They can only be called once. - * - * field.string() - * field.buffer() - * field.geometry() - * - * are aliases for - * - * parser.parseLengthCodedString() - * parser.parseLengthCodedBuffer() - * parser.parseGeometryValue() - * - * You can find which field function you need to use by looking at: RowDataPacket.prototype._typeCast - */ - typeCast?: boolean | ((field: any, next: () => void) => any); - - /** - * A custom query format function - */ - queryFormat?: (query: string, values: any) => void; - - /** - * When dealing with big numbers (BIGINT and DECIMAL columns) in the database, you should enable this option - * (Default: false) - */ - supportBigNumbers?: boolean; - - /** - * Enabling both supportBigNumbers and bigNumberStrings forces big numbers (BIGINT and DECIMAL columns) to be - * always returned as JavaScript String objects (Default: false). Enabling supportBigNumbers but leaving - * bigNumberStrings disabled will return big numbers as String objects only when they cannot be accurately - * represented with [JavaScript Number objects](https://262.ecma-international.org/5.1/#sec-8.5) - * (which happens when they exceed the [-2^53, +2^53] range), otherwise they will be returned as Number objects. - * This option is ignored if supportBigNumbers is disabled. - */ - bigNumberStrings?: boolean; - - /** - * Force date types (TIMESTAMP, DATETIME, DATE) to be returned as strings rather then inflated into JavaScript Date - * objects. Can be true/false or an array of type names to keep as strings. - * - * (Default: false) - */ - dateStrings?: boolean | Array<'TIMESTAMP' | 'DATETIME' | 'DATE'>; - - /** - * This will print all incoming and outgoing packets on stdout. - * You can also restrict debugging to packet types by passing an array of types (strings) to debug; - * - * (Default: false) - */ - debug?: any; - - /** - * Generates stack traces on Error to include call site of library entrance ('long stack traces'). Slight - * performance penalty for most calls. (Default: true) - */ - trace?: boolean; - - /** - * Allow multiple mysql statements per query. Be careful with this, it exposes you to SQL injection attacks. (Default: false) - */ - multipleStatements?: boolean; - - /** - * List of connection flags to use other than the default ones. It is also possible to blacklist default ones - */ - flags?: Array; - - /** - * object with ssl parameters or a string containing name of ssl profile - */ - ssl?: string | SslOptions; - - /** - * Return each row as an array, not as an object. - * This is useful when you have duplicate column names. - * This can also be set in the `QueryOption` object to be applied per-query. - */ - rowsAsArray?: boolean; - - /** - * Enable keep-alive on the socket. (Default: true) - */ - enableKeepAlive?: boolean; - - /** - * If keep-alive is enabled users can supply an initial delay. (Default: 0) - */ - keepAliveInitialDelay?: number; - - charsetNumber?: number; - - compress?: boolean; - - authSwitchHandler?: (data: any, callback: () => void) => any; - - connectAttributes?: { [param: string]: any }; - - isServer?: boolean; - - maxPreparedStatements?: number; - - namedPlaceholders?: boolean; - - nestTables?: boolean | string; - - passwordSha1?: string; - - pool?: any; - - stream?: any; - - uri?: string; - - connectionLimit?: number; - - maxIdle?: number; - - idleTimeout?: number; - - Promise?: any; - - queueLimit?: number; - - waitForConnections?: boolean; - - authPlugins?: { - [key: string]: AuthPlugin; - }; -} - -declare class Connection extends QueryableBase(ExecutableBase(EventEmitter)) { - config: ConnectionOptions; - - threadId: number; - - authorized: boolean; - - static createQuery< - T extends - | RowDataPacket[][] - | RowDataPacket[] - | OkPacket - | OkPacket[] - | ResultSetHeader, - >( - sql: string, - callback?: ( - err: QueryError | null, - result: T, - fields: FieldPacket[], - ) => any, - ): Query; - static createQuery< - T extends - | RowDataPacket[][] - | RowDataPacket[] - | OkPacket - | OkPacket[] - | ResultSetHeader, - >( - sql: string, - values: any | any[] | { [param: string]: any }, - callback?: ( - err: QueryError | null, - result: T, - fields: FieldPacket[], - ) => any, - ): Query; - - beginTransaction(callback: (err: QueryError | null) => void): void; - - connect(callback?: (err: QueryError | null) => void): void; - - commit(callback?: (err: QueryError | null) => void): void; - - changeUser( - options: ConnectionOptions, - callback?: (err: QueryError | null) => void, - ): void; - - end(callback?: (err: QueryError | null) => void): void; - end(options: any, callback?: (err: QueryError | null) => void): void; - - destroy(): void; - - pause(): void; - - resume(): void; - - escape(value: any): string; - - escapeId(value: string): string; - escapeId(values: string[]): string; - - format(sql: string, values?: any | any[] | { [param: string]: any }): string; - - on(event: string, listener: (...args: any[]) => void): this; - - rollback(callback: (err: QueryError | null) => void): void; - - prepare( - sql: string, - callback?: (err: QueryError | null, statement: PrepareStatementInfo) => any, - ): Prepare; - - unprepare(sql: string): PrepareStatementInfo; - - serverHandshake(args: any): any; - - promise(promiseImpl?: PromiseConstructor): PromiseConnection; - - ping(callback?: (err: QueryError | null) => any): void; - - writeOk(args?: OkPacketParams): void; - - writeError(args?: ErrorPacketParams): void; - - writeEof(warnings?: number, statusFlags?: number): void; - - writeTextResult(rows?: Array, columns?: Array): void; - - writePacket(packet: any): void; - - sequenceId: number; -} - -export { Connection }; diff --git a/node_modules/mysql2/typings/mysql/lib/Pool.d.ts b/node_modules/mysql2/typings/mysql/lib/Pool.d.ts deleted file mode 100644 index 90ed5e9..0000000 --- a/node_modules/mysql2/typings/mysql/lib/Pool.d.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { EventEmitter } from 'events'; -import { PrepareStatementInfo } from './protocol/sequences/Prepare.js'; -import { ConnectionOptions } from './Connection.js'; -import { PoolConnection } from './PoolConnection.js'; -import { - Pool as PromisePool, - PoolConnection as PromisePoolConnection, -} from '../../../promise.js'; -import { QueryableBase } from './protocol/sequences/QueryableBase.js'; -import { ExecutableBase } from './protocol/sequences/ExecutableBase.js'; - -export interface PoolOptions extends ConnectionOptions { - /** - * Determines the pool's action when no connections are available and the limit has been reached. If true, the pool will queue - * the connection request and call it when one becomes available. If false, the pool will immediately call back with an error. - * (Default: true) - */ - waitForConnections?: boolean; - - /** - * The maximum number of connections to create at once. (Default: 10) - */ - connectionLimit?: number; - - /** - * The maximum number of idle connections. (Default: same as `connectionLimit`) - */ - maxIdle?: number; - - /** - * The idle connections timeout, in milliseconds. (Default: 60000) - */ - idleTimeout?: number; - - /** - * The maximum number of connection requests the pool will queue before returning an error from getConnection. If set to 0, there - * is no limit to the number of queued connection requests. (Default: 0) - */ - queueLimit?: number; -} - -declare class Pool extends QueryableBase(ExecutableBase(EventEmitter)) { - getConnection( - callback: ( - err: NodeJS.ErrnoException | null, - connection: PoolConnection - ) => any - ): void; - - releaseConnection(connection: PoolConnection | PromisePoolConnection): void; - - end( - callback?: (err: NodeJS.ErrnoException | null, ...args: any[]) => any - ): void; - - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'connection', listener: (connection: PoolConnection) => any): this; - on(event: 'acquire', listener: (connection: PoolConnection) => any): this; - on(event: 'release', listener: (connection: PoolConnection) => any): this; - on(event: 'enqueue', listener: () => any): this; - - unprepare(sql: string): PrepareStatementInfo; - - promise(promiseImpl?: PromiseConstructor): PromisePool; - - config: PoolOptions; -} - -export { Pool }; diff --git a/node_modules/mysql2/typings/mysql/lib/PoolCluster.d.ts b/node_modules/mysql2/typings/mysql/lib/PoolCluster.d.ts deleted file mode 100644 index 476d3de..0000000 --- a/node_modules/mysql2/typings/mysql/lib/PoolCluster.d.ts +++ /dev/null @@ -1,86 +0,0 @@ -import { EventEmitter } from 'events'; -import { PoolConnection } from './PoolConnection.js'; -import { PoolOptions } from './Pool.js'; -import { ExecutableBase as ExecutableBaseClass } from './protocol/sequences/ExecutableBase.js'; -import { QueryableBase as QueryableBaseClass } from './protocol/sequences/QueryableBase.js'; - -// Expose class interfaces -declare class QueryableAndExecutableBase extends QueryableBaseClass( - ExecutableBaseClass(EventEmitter) -) {} - -export interface PoolClusterOptions { - /** - * If true, PoolCluster will attempt to reconnect when connection fails. (Default: true) - */ - canRetry?: boolean; - - /** - * If connection fails, node's errorCount increases. When errorCount is greater than removeNodeErrorCount, - * remove a node in the PoolCluster. (Default: 5) - */ - removeNodeErrorCount?: number; - - /** - * If connection fails, specifies the number of milliseconds before another connection attempt will be made. - * If set to 0, then node will be removed instead and never re-used. (Default: 0) - */ - restoreNodeTimeout?: number; - - /** - * The default selector. (Default: RR) - * RR: Select one alternately. (Round-Robin) - * RANDOM: Select the node by random function. - * ORDER: Select the first node available unconditionally. - */ - defaultSelector?: string; -} - -export interface PoolNamespace extends QueryableAndExecutableBase { - getConnection( - callback: ( - err: NodeJS.ErrnoException | null, - connection: PoolConnection - ) => any - ): void; -} - -declare class PoolCluster extends EventEmitter { - config: PoolClusterOptions; - - add(config: PoolOptions): void; - add(group: string, connectionUri: string): void; - add(group: string, config: PoolOptions): void; - - end(): void; - - getConnection( - callback: ( - err: NodeJS.ErrnoException | null, - connection: PoolConnection - ) => void - ): void; - getConnection( - group: string, - callback: ( - err: NodeJS.ErrnoException | null, - connection: PoolConnection - ) => void - ): void; - getConnection( - group: string, - selector: string, - callback: ( - err: NodeJS.ErrnoException | null, - connection: PoolConnection - ) => void - ): void; - - of(pattern: string, selector?: string): PoolNamespace; - - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'remove', listener: (nodeId: number) => void): this; - on(event: 'warn', listener: (err: Error) => void): this; -} - -export { PoolCluster }; diff --git a/node_modules/mysql2/typings/mysql/lib/PoolConnection.d.ts b/node_modules/mysql2/typings/mysql/lib/PoolConnection.d.ts deleted file mode 100644 index cce4ef7..0000000 --- a/node_modules/mysql2/typings/mysql/lib/PoolConnection.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Connection } from './Connection.js'; -import { Pool as PromisePool } from '../../../promise.js'; - -declare class PoolConnection extends Connection { - connection: Connection; - release(): void; - promise(promiseImpl?: PromiseConstructor): PromisePool; -} - -export { PoolConnection }; diff --git a/node_modules/mysql2/typings/mysql/lib/Server.d.ts b/node_modules/mysql2/typings/mysql/lib/Server.d.ts deleted file mode 100644 index 195adee..0000000 --- a/node_modules/mysql2/typings/mysql/lib/Server.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { EventEmitter } from 'events'; -import { Connection } from './Connection.js'; - -declare class Server extends EventEmitter { - connections: Array; - - listen(port: number): Server; - close(callback: (error: Error, count: number) => any): void; -} - -export { Server }; diff --git a/node_modules/mysql2/typings/mysql/lib/constants/CharsetToEncoding.d.ts b/node_modules/mysql2/typings/mysql/lib/constants/CharsetToEncoding.d.ts deleted file mode 100644 index aa28389..0000000 --- a/node_modules/mysql2/typings/mysql/lib/constants/CharsetToEncoding.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Constant `CharsetToEncoding`. - * - * Please note that `CharsetToEncoding` can only be accessed from the `mysql` object and not imported directly. - */ -declare const CharsetToEncoding: string[]; - -export { CharsetToEncoding }; diff --git a/node_modules/mysql2/typings/mysql/lib/constants/Charsets.d.ts b/node_modules/mysql2/typings/mysql/lib/constants/Charsets.d.ts deleted file mode 100644 index 0b35769..0000000 --- a/node_modules/mysql2/typings/mysql/lib/constants/Charsets.d.ts +++ /dev/null @@ -1,326 +0,0 @@ -interface Charsets { - BIG5_CHINESE_CI: number; - LATIN2_CZECH_CS: number; - DEC8_SWEDISH_CI: number; - CP850_GENERAL_CI: number; - LATIN1_GERMAN1_CI: number; - HP8_ENGLISH_CI: number; - KOI8R_GENERAL_CI: number; - LATIN1_SWEDISH_CI: number; - LATIN2_GENERAL_CI: number; - SWE7_SWEDISH_CI: number; - ASCII_GENERAL_CI: number; - UJIS_JAPANESE_CI: number; - SJIS_JAPANESE_CI: number; - CP1251_BULGARIAN_CI: number; - LATIN1_DANISH_CI: number; - HEBREW_GENERAL_CI: number; - TIS620_THAI_CI: number; - EUCKR_KOREAN_CI: number; - LATIN7_ESTONIAN_CS: number; - LATIN2_HUNGARIAN_CI: number; - KOI8U_GENERAL_CI: number; - CP1251_UKRAINIAN_CI: number; - GB2312_CHINESE_CI: number; - GREEK_GENERAL_CI: number; - CP1250_GENERAL_CI: number; - LATIN2_CROATIAN_CI: number; - GBK_CHINESE_CI: number; - CP1257_LITHUANIAN_CI: number; - LATIN5_TURKISH_CI: number; - LATIN1_GERMAN2_CI: number; - ARMSCII8_GENERAL_CI: number; - UTF8_GENERAL_CI: number; - CP1250_CZECH_CS: number; - UCS2_GENERAL_CI: number; - CP866_GENERAL_CI: number; - KEYBCS2_GENERAL_CI: number; - MACCE_GENERAL_CI: number; - MACROMAN_GENERAL_CI: number; - CP852_GENERAL_CI: number; - LATIN7_GENERAL_CI: number; - LATIN7_GENERAL_CS: number; - MACCE_BIN: number; - CP1250_CROATIAN_CI: number; - UTF8MB4_GENERAL_CI: number; - UTF8MB4_BIN: number; - LATIN1_BIN: number; - LATIN1_GENERAL_CI: number; - LATIN1_GENERAL_CS: number; - CP1251_BIN: number; - CP1251_GENERAL_CI: number; - CP1251_GENERAL_CS: number; - MACROMAN_BIN: number; - UTF16_GENERAL_CI: number; - UTF16_BIN: number; - UTF16LE_GENERAL_CI: number; - CP1256_GENERAL_CI: number; - CP1257_BIN: number; - CP1257_GENERAL_CI: number; - UTF32_GENERAL_CI: number; - UTF32_BIN: number; - UTF16LE_BIN: number; - BINARY: number; - ARMSCII8_BIN: number; - ASCII_BIN: number; - CP1250_BIN: number; - CP1256_BIN: number; - CP866_BIN: number; - DEC8_BIN: number; - GREEK_BIN: number; - HEBREW_BIN: number; - HP8_BIN: number; - KEYBCS2_BIN: number; - KOI8R_BIN: number; - KOI8U_BIN: number; - UTF8_TOLOWER_CI: number; - LATIN2_BIN: number; - LATIN5_BIN: number; - LATIN7_BIN: number; - CP850_BIN: number; - CP852_BIN: number; - SWE7_BIN: number; - UTF8_BIN: number; - BIG5_BIN: number; - EUCKR_BIN: number; - GB2312_BIN: number; - GBK_BIN: number; - SJIS_BIN: number; - TIS620_BIN: number; - UCS2_BIN: number; - UJIS_BIN: number; - GEOSTD8_GENERAL_CI: number; - GEOSTD8_BIN: number; - LATIN1_SPANISH_CI: number; - CP932_JAPANESE_CI: number; - CP932_BIN: number; - EUCJPMS_JAPANESE_CI: number; - EUCJPMS_BIN: number; - CP1250_POLISH_CI: number; - UTF16_UNICODE_CI: number; - UTF16_ICELANDIC_CI: number; - UTF16_LATVIAN_CI: number; - UTF16_ROMANIAN_CI: number; - UTF16_SLOVENIAN_CI: number; - UTF16_POLISH_CI: number; - UTF16_ESTONIAN_CI: number; - UTF16_SPANISH_CI: number; - UTF16_SWEDISH_CI: number; - UTF16_TURKISH_CI: number; - UTF16_CZECH_CI: number; - UTF16_DANISH_CI: number; - UTF16_LITHUANIAN_CI: number; - UTF16_SLOVAK_CI: number; - UTF16_SPANISH2_CI: number; - UTF16_ROMAN_CI: number; - UTF16_PERSIAN_CI: number; - UTF16_ESPERANTO_CI: number; - UTF16_HUNGARIAN_CI: number; - UTF16_SINHALA_CI: number; - UTF16_GERMAN2_CI: number; - UTF16_CROATIAN_CI: number; - UTF16_UNICODE_520_CI: number; - UTF16_VIETNAMESE_CI: number; - UCS2_UNICODE_CI: number; - UCS2_ICELANDIC_CI: number; - UCS2_LATVIAN_CI: number; - UCS2_ROMANIAN_CI: number; - UCS2_SLOVENIAN_CI: number; - UCS2_POLISH_CI: number; - UCS2_ESTONIAN_CI: number; - UCS2_SPANISH_CI: number; - UCS2_SWEDISH_CI: number; - UCS2_TURKISH_CI: number; - UCS2_CZECH_CI: number; - UCS2_DANISH_CI: number; - UCS2_LITHUANIAN_CI: number; - UCS2_SLOVAK_CI: number; - UCS2_SPANISH2_CI: number; - UCS2_ROMAN_CI: number; - UCS2_PERSIAN_CI: number; - UCS2_ESPERANTO_CI: number; - UCS2_HUNGARIAN_CI: number; - UCS2_SINHALA_CI: number; - UCS2_GERMAN2_CI: number; - UCS2_CROATIAN_CI: number; - UCS2_UNICODE_520_CI: number; - UCS2_VIETNAMESE_CI: number; - UCS2_GENERAL_MYSQL500_CI: number; - UTF32_UNICODE_CI: number; - UTF32_ICELANDIC_CI: number; - UTF32_LATVIAN_CI: number; - UTF32_ROMANIAN_CI: number; - UTF32_SLOVENIAN_CI: number; - UTF32_POLISH_CI: number; - UTF32_ESTONIAN_CI: number; - UTF32_SPANISH_CI: number; - UTF32_SWEDISH_CI: number; - UTF32_TURKISH_CI: number; - UTF32_CZECH_CI: number; - UTF32_DANISH_CI: number; - UTF32_LITHUANIAN_CI: number; - UTF32_SLOVAK_CI: number; - UTF32_SPANISH2_CI: number; - UTF32_ROMAN_CI: number; - UTF32_PERSIAN_CI: number; - UTF32_ESPERANTO_CI: number; - UTF32_HUNGARIAN_CI: number; - UTF32_SINHALA_CI: number; - UTF32_GERMAN2_CI: number; - UTF32_CROATIAN_CI: number; - UTF32_UNICODE_520_CI: number; - UTF32_VIETNAMESE_CI: number; - UTF8_UNICODE_CI: number; - UTF8_ICELANDIC_CI: number; - UTF8_LATVIAN_CI: number; - UTF8_ROMANIAN_CI: number; - UTF8_SLOVENIAN_CI: number; - UTF8_POLISH_CI: number; - UTF8_ESTONIAN_CI: number; - UTF8_SPANISH_CI: number; - UTF8_SWEDISH_CI: number; - UTF8_TURKISH_CI: number; - UTF8_CZECH_CI: number; - UTF8_DANISH_CI: number; - UTF8_LITHUANIAN_CI: number; - UTF8_SLOVAK_CI: number; - UTF8_SPANISH2_CI: number; - UTF8_ROMAN_CI: number; - UTF8_PERSIAN_CI: number; - UTF8_ESPERANTO_CI: number; - UTF8_HUNGARIAN_CI: number; - UTF8_SINHALA_CI: number; - UTF8_GERMAN2_CI: number; - UTF8_CROATIAN_CI: number; - UTF8_UNICODE_520_CI: number; - UTF8_VIETNAMESE_CI: number; - UTF8_GENERAL_MYSQL500_CI: number; - UTF8MB4_UNICODE_CI: number; - UTF8MB4_ICELANDIC_CI: number; - UTF8MB4_LATVIAN_CI: number; - UTF8MB4_ROMANIAN_CI: number; - UTF8MB4_SLOVENIAN_CI: number; - UTF8MB4_POLISH_CI: number; - UTF8MB4_ESTONIAN_CI: number; - UTF8MB4_SPANISH_CI: number; - UTF8MB4_SWEDISH_CI: number; - UTF8MB4_TURKISH_CI: number; - UTF8MB4_CZECH_CI: number; - UTF8MB4_DANISH_CI: number; - UTF8MB4_LITHUANIAN_CI: number; - UTF8MB4_SLOVAK_CI: number; - UTF8MB4_SPANISH2_CI: number; - UTF8MB4_ROMAN_CI: number; - UTF8MB4_PERSIAN_CI: number; - UTF8MB4_ESPERANTO_CI: number; - UTF8MB4_HUNGARIAN_CI: number; - UTF8MB4_SINHALA_CI: number; - UTF8MB4_GERMAN2_CI: number; - UTF8MB4_CROATIAN_CI: number; - UTF8MB4_UNICODE_520_CI: number; - UTF8MB4_VIETNAMESE_CI: number; - GB18030_CHINESE_CI: number; - GB18030_BIN: number; - GB18030_UNICODE_520_CI: number; - /** @deprecated */ - UTF8_GENERAL50_CI: number; - UTF8MB4_0900_AI_CI: number; - UTF8MB4_DE_PB_0900_AI_CI: number; - UTF8MB4_IS_0900_AI_CI: number; - UTF8MB4_LV_0900_AI_CI: number; - UTF8MB4_RO_0900_AI_CI: number; - UTF8MB4_SL_0900_AI_CI: number; - UTF8MB4_PL_0900_AI_CI: number; - UTF8MB4_ET_0900_AI_CI: number; - UTF8MB4_ES_0900_AI_CI: number; - UTF8MB4_SV_0900_AI_CI: number; - UTF8MB4_TR_0900_AI_CI: number; - UTF8MB4_CS_0900_AI_CI: number; - UTF8MB4_DA_0900_AI_CI: number; - UTF8MB4_LT_0900_AI_CI: number; - UTF8MB4_SK_0900_AI_CI: number; - UTF8MB4_ES_TRAD_0900_AI_CI: number; - UTF8MB4_LA_0900_AI_CI: number; - UTF8MB4_EO_0900_AI_CI: number; - UTF8MB4_HU_0900_AI_CI: number; - UTF8MB4_HR_0900_AI_CI: number; - UTF8MB4_VI_0900_AI_CI: number; - UTF8MB4_0900_AS_CS: number; - UTF8MB4_DE_PB_0900_AS_CS: number; - UTF8MB4_IS_0900_AS_CS: number; - UTF8MB4_LV_0900_AS_CS: number; - UTF8MB4_RO_0900_AS_CS: number; - UTF8MB4_SL_0900_AS_CS: number; - UTF8MB4_PL_0900_AS_CS: number; - UTF8MB4_ET_0900_AS_CS: number; - UTF8MB4_ES_0900_AS_CS: number; - UTF8MB4_SV_0900_AS_CS: number; - UTF8MB4_TR_0900_AS_CS: number; - UTF8MB4_CS_0900_AS_CS: number; - UTF8MB4_DA_0900_AS_CS: number; - UTF8MB4_LT_0900_AS_CS: number; - UTF8MB4_SK_0900_AS_CS: number; - UTF8MB4_ES_TRAD_0900_AS_CS: number; - UTF8MB4_LA_0900_AS_CS: number; - UTF8MB4_EO_0900_AS_CS: number; - UTF8MB4_HU_0900_AS_CS: number; - UTF8MB4_HR_0900_AS_CS: number; - UTF8MB4_VI_0900_AS_CS: number; - UTF8MB4_JA_0900_AS_CS: number; - UTF8MB4_JA_0900_AS_CS_KS: number; - UTF8MB4_0900_AS_CI: number; - UTF8MB4_RU_0900_AI_CI: number; - UTF8MB4_RU_0900_AS_CS: number; - UTF8MB4_ZH_0900_AS_CS: number; - UTF8MB4_0900_BIN: number; - - BIG5: number; - DEC8: number; - CP850: number; - HP8: number; - KOI8R: number; - LATIN1: number; - LATIN2: number; - SWE7: number; - ASCII: number; - UJIS: number; - SJIS: number; - HEBREW: number; - TIS620: number; - EUCKR: number; - KOI8U: number; - GB2312: number; - GREEK: number; - CP1250: number; - GBK: number; - LATIN5: number; - ARMSCII8: number; - UTF8: number; - UCS2: number; - CP866: number; - KEYBCS2: number; - MACCE: number; - MACROMAN: number; - CP852: number; - LATIN7: number; - UTF8MB4: number; - CP1251: number; - UTF16: number; - UTF16LE: number; - CP1256: number; - CP1257: number; - UTF32: number; - CP932: number; - EUCJPMS: number; - GB18030: number; - GEOSTD8: number; -} - -/** - * Constant `Charsets`. - * - * Please note that `Charsets` can only be accessed from the `mysql` object and not imported directly. - */ -declare const Charsets: Charsets; - -export { Charsets }; diff --git a/node_modules/mysql2/typings/mysql/lib/constants/Types.d.ts b/node_modules/mysql2/typings/mysql/lib/constants/Types.d.ts deleted file mode 100644 index 73f34f0..0000000 --- a/node_modules/mysql2/typings/mysql/lib/constants/Types.d.ts +++ /dev/null @@ -1,68 +0,0 @@ -interface Types { - 0x00: string; - 0x01: string; - 0x02: string; - 0x03: string; - 0x04: string; - 0x05: string; - 0x06: string; - 0x07: string; - 0x08: string; - 0x09: string; - 0x0a: string; - 0x0b: string; - 0x0c: string; - 0x0d: string; - 0x0e: string; - 0x0f: string; - 0x10: string; - 0xf5: string; - 0xf6: string; - 0xf7: string; - 0xf8: string; - 0xf9: string; - 0xfa: string; - 0xfb: string; - 0xfc: string; - 0xfd: string; - 0xfe: string; - 0xff: string; - - DECIMAL: number; - TINY: number; - SHORT: number; - LONG: number; - FLOAT: number; - DOUBLE: number; - NULL: number; - TIMESTAMP: number; - LONGLONG: number; - INT24: number; - DATE: number; - TIME: number; - DATETIME: number; - YEAR: number; - NEWDATE: number; - VARCHAR: number; - BIT: number; - JSON: number; - NEWDECIMAL: number; - ENUM: number; - SET: number; - TINY_BLOB: number; - MEDIUM_BLOB: number; - LONG_BLOB: number; - BLOB: number; - VAR_STRING: number; - STRING: number; - GEOMETRY: number; -} - -/** - * Constant `Types`. - * - * Please note that `Types` can only be accessed from the `mysql` object and not imported directly. - */ -declare const Types: Types; - -export { Types }; diff --git a/node_modules/mysql2/typings/mysql/lib/constants/index.d.ts b/node_modules/mysql2/typings/mysql/lib/constants/index.d.ts deleted file mode 100644 index d08ba2c..0000000 --- a/node_modules/mysql2/typings/mysql/lib/constants/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { Types } from './Types.js'; -import { Charsets } from './Charsets.js'; -import { CharsetToEncoding } from './CharsetToEncoding.js'; - -export { Types, Charsets, CharsetToEncoding }; diff --git a/node_modules/mysql2/typings/mysql/lib/parsers/ParserCache.d.ts b/node_modules/mysql2/typings/mysql/lib/parsers/ParserCache.d.ts deleted file mode 100644 index 0f1e7fa..0000000 --- a/node_modules/mysql2/typings/mysql/lib/parsers/ParserCache.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -declare function setMaxParserCache(max: number): void; -declare function clearParserCache(): void; - -export { setMaxParserCache, clearParserCache }; diff --git a/node_modules/mysql2/typings/mysql/lib/parsers/index.d.ts b/node_modules/mysql2/typings/mysql/lib/parsers/index.d.ts deleted file mode 100644 index 7f1d48e..0000000 --- a/node_modules/mysql2/typings/mysql/lib/parsers/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { setMaxParserCache, clearParserCache } from './ParserCache.js'; - -export { setMaxParserCache, clearParserCache }; diff --git a/node_modules/mysql2/typings/mysql/lib/protocol/packets/Field.d.ts b/node_modules/mysql2/typings/mysql/lib/protocol/packets/Field.d.ts deleted file mode 100644 index dc9967b..0000000 --- a/node_modules/mysql2/typings/mysql/lib/protocol/packets/Field.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -declare interface Field { - constructor: { - name: 'Field'; - }; - db: string; - table: string; - name: string; - type: string; - length: number; - string: () => any; - buffer: () => any; - geometry: () => any; -} - -export { Field }; diff --git a/node_modules/mysql2/typings/mysql/lib/protocol/packets/FieldPacket.d.ts b/node_modules/mysql2/typings/mysql/lib/protocol/packets/FieldPacket.d.ts deleted file mode 100644 index 316c44e..0000000 --- a/node_modules/mysql2/typings/mysql/lib/protocol/packets/FieldPacket.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -declare interface FieldPacket { - constructor: { - name: 'FieldPacket'; - }; - catalog: string; - charsetNr?: number; - db?: string; - schema?: string; - characterSet?: number; - decimals: number; - default?: any; - flags: number | string[]; - length?: number; - name: string; - orgName: string; - orgTable: string; - protocol41?: boolean; - table: string; - type?: number; - columnType?: number - zerofill?: boolean; - typeName?: string; - encoding?: string; - columnLength?: number; -} - -export { FieldPacket }; diff --git a/node_modules/mysql2/typings/mysql/lib/protocol/packets/OkPacket.d.ts b/node_modules/mysql2/typings/mysql/lib/protocol/packets/OkPacket.d.ts deleted file mode 100644 index 321d082..0000000 --- a/node_modules/mysql2/typings/mysql/lib/protocol/packets/OkPacket.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @deprecated - * `OkPacket` is deprecated and might be removed in the future major release. Please use `ResultSetHeader` instead. - */ -declare interface OkPacket { - constructor: { - name: 'OkPacket'; - }; - fieldCount: number; - affectedRows: number; - /** - * @deprecated - * `changedRows` is deprecated and might be removed in the future major release. Please use `affectedRows` property instead. - */ - changedRows: number; - insertId: number; - serverStatus: number; - warningCount: number; - message: string; - procotol41: boolean; -} - -export { OkPacket }; diff --git a/node_modules/mysql2/typings/mysql/lib/protocol/packets/ProcedurePacket.d.ts b/node_modules/mysql2/typings/mysql/lib/protocol/packets/ProcedurePacket.d.ts deleted file mode 100644 index 47e51fd..0000000 --- a/node_modules/mysql2/typings/mysql/lib/protocol/packets/ProcedurePacket.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { OkPacket } from './OkPacket.js'; -import { ResultSetHeader } from './ResultSetHeader.js'; -import { RowDataPacket } from './RowDataPacket.js'; - -declare type ProcedureCallPacket< - T = [RowDataPacket[], ResultSetHeader] | ResultSetHeader, -> = T extends RowDataPacket[] - ? [T, ResultSetHeader] - : T extends ResultSetHeader | OkPacket - ? ResultSetHeader - : [RowDataPacket[], ResultSetHeader] | ResultSetHeader; - -export { ProcedureCallPacket }; diff --git a/node_modules/mysql2/typings/mysql/lib/protocol/packets/ResultSetHeader.d.ts b/node_modules/mysql2/typings/mysql/lib/protocol/packets/ResultSetHeader.d.ts deleted file mode 100644 index 00b596f..0000000 --- a/node_modules/mysql2/typings/mysql/lib/protocol/packets/ResultSetHeader.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -declare interface ResultSetHeader { - constructor: { - name: 'ResultSetHeader'; - }; - affectedRows: number; - fieldCount: number; - info: string; - insertId: number; - serverStatus: number; - warningStatus: number; - /** - * @deprecated - * `changedRows` is deprecated and might be removed in the future major release. Please use `affectedRows` property instead. - */ - changedRows: number; -} - -export { ResultSetHeader }; diff --git a/node_modules/mysql2/typings/mysql/lib/protocol/packets/RowDataPacket.d.ts b/node_modules/mysql2/typings/mysql/lib/protocol/packets/RowDataPacket.d.ts deleted file mode 100644 index d9cac1b..0000000 --- a/node_modules/mysql2/typings/mysql/lib/protocol/packets/RowDataPacket.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -declare interface RowDataPacket { - constructor: { - name: 'RowDataPacket'; - }; - [column: string]: any; - [column: number]: any; -} - -export { RowDataPacket }; diff --git a/node_modules/mysql2/typings/mysql/lib/protocol/packets/index.d.ts b/node_modules/mysql2/typings/mysql/lib/protocol/packets/index.d.ts deleted file mode 100644 index dda38ae..0000000 --- a/node_modules/mysql2/typings/mysql/lib/protocol/packets/index.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { OkPacket } from './OkPacket.js'; -import { RowDataPacket } from './RowDataPacket.js'; -import { FieldPacket } from './FieldPacket.js'; -import { Field } from './Field.js'; -import { ProcedureCallPacket } from './ProcedurePacket.js'; -import { ResultSetHeader } from './ResultSetHeader.js'; -import { OkPacketParams } from './params/OkPacketParams.js'; -import { ErrorPacketParams } from './params/ErrorPacketParams.js'; - -export { - OkPacket, - RowDataPacket, - FieldPacket, - Field, - ProcedureCallPacket, - ResultSetHeader, - OkPacketParams, - ErrorPacketParams, -}; diff --git a/node_modules/mysql2/typings/mysql/lib/protocol/packets/params/ErrorPacketParams.d.ts b/node_modules/mysql2/typings/mysql/lib/protocol/packets/params/ErrorPacketParams.d.ts deleted file mode 100644 index dece3db..0000000 --- a/node_modules/mysql2/typings/mysql/lib/protocol/packets/params/ErrorPacketParams.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -declare interface ErrorPacketParams { - message?: string; - code?: number | string; -} - -export { ErrorPacketParams }; diff --git a/node_modules/mysql2/typings/mysql/lib/protocol/packets/params/OkPacketParams.d.ts b/node_modules/mysql2/typings/mysql/lib/protocol/packets/params/OkPacketParams.d.ts deleted file mode 100644 index a5d2d00..0000000 --- a/node_modules/mysql2/typings/mysql/lib/protocol/packets/params/OkPacketParams.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -declare interface OkPacketParams { - affectedRows?: number; - insertId?: number; - serverStatus?: number; - warningCount?: number; - message?: string; -} - -export { OkPacketParams }; diff --git a/node_modules/mysql2/typings/mysql/lib/protocol/sequences/ExecutableBase.d.ts b/node_modules/mysql2/typings/mysql/lib/protocol/sequences/ExecutableBase.d.ts deleted file mode 100644 index 74587f3..0000000 --- a/node_modules/mysql2/typings/mysql/lib/protocol/sequences/ExecutableBase.d.ts +++ /dev/null @@ -1,82 +0,0 @@ -import { - OkPacket, - FieldPacket, - RowDataPacket, - ResultSetHeader, - ProcedureCallPacket, -} from '../packets/index.js'; -import { - Query, - QueryError, - QueryOptions, - QueryableConstructor, -} from './Query.js'; - -export declare function ExecutableBase( - Base?: T -): { - new (...args: any[]): { - execute< - T extends - | OkPacket - | ResultSetHeader - | ResultSetHeader[] - | RowDataPacket[] - | RowDataPacket[][] - | OkPacket[] - | ProcedureCallPacket - >( - sql: string, - callback?: - | ((err: QueryError | null, result: T, fields: FieldPacket[]) => any) - | undefined - ): Query; - execute< - T extends - | OkPacket - | ResultSetHeader - | ResultSetHeader[] - | RowDataPacket[] - | RowDataPacket[][] - | OkPacket[] - | ProcedureCallPacket - >( - sql: string, - values: any, - callback?: - | ((err: QueryError | null, result: T, fields: FieldPacket[]) => any) - | undefined - ): Query; - execute< - T extends - | OkPacket - | ResultSetHeader - | ResultSetHeader[] - | RowDataPacket[] - | RowDataPacket[][] - | OkPacket[] - | ProcedureCallPacket - >( - options: QueryOptions, - callback?: - | ((err: QueryError | null, result: T, fields?: FieldPacket[]) => any) - | undefined - ): Query; - execute< - T extends - | OkPacket - | ResultSetHeader - | ResultSetHeader[] - | RowDataPacket[] - | RowDataPacket[][] - | OkPacket[] - | ProcedureCallPacket - >( - options: QueryOptions, - values: any, - callback?: - | ((err: QueryError | null, result: T, fields: FieldPacket[]) => any) - | undefined - ): Query; - }; -} & T; diff --git a/node_modules/mysql2/typings/mysql/lib/protocol/sequences/Prepare.d.ts b/node_modules/mysql2/typings/mysql/lib/protocol/sequences/Prepare.d.ts deleted file mode 100644 index ef13801..0000000 --- a/node_modules/mysql2/typings/mysql/lib/protocol/sequences/Prepare.d.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { Sequence } from './Sequence.js'; -import { Query, QueryError, StreamOptions } from '../sequences/Query.js'; -import { - OkPacket, - FieldPacket, - RowDataPacket, - ResultSetHeader, -} from '../packets/index.js'; -import { Readable } from 'stream'; - -export class PrepareStatementInfo { - close(): void; - execute< - T extends - | RowDataPacket[][] - | RowDataPacket[] - | OkPacket - | OkPacket[] - | ResultSetHeader - >( - parameters: any | any[] | { [param: string]: any }, - callback?: (err: QueryError | null, result: T, fields: FieldPacket[]) => any - ): Query; -} - -declare class Prepare extends Sequence { - /** - * The SQL for a constructed query - */ - sql: string; - - /** - * Emits a query packet to start the query - */ - start(): void; - - /** - * Determines the packet class to use given the first byte of the packet. - * - * @param firstByte The first byte of the packet - * @param parser The packet parser - */ - determinePacket(firstByte: number, parser: any): any; - - /** - * Creates a Readable stream with the given options - * - * @param options The options for the stream. - */ - stream(options?: StreamOptions): Readable; - - on(event: string, listener: (args: []) => void): this; - on(event: 'error', listener: (err: QueryError) => any): this; - on( - event: 'fields', - listener: (fields: FieldPacket, index: number) => any - ): this; - on( - event: 'result', - listener: (result: RowDataPacket | OkPacket, index: number) => any - ): this; - on(event: 'end', listener: () => any): this; -} - -export { Prepare }; diff --git a/node_modules/mysql2/typings/mysql/lib/protocol/sequences/Query.d.ts b/node_modules/mysql2/typings/mysql/lib/protocol/sequences/Query.d.ts deleted file mode 100644 index 00b2bcb..0000000 --- a/node_modules/mysql2/typings/mysql/lib/protocol/sequences/Query.d.ts +++ /dev/null @@ -1,151 +0,0 @@ -import { Sequence } from './Sequence.js'; -import { OkPacket, RowDataPacket, FieldPacket } from '../packets/index.js'; -import { Readable } from 'stream'; - -export interface QueryOptions { - /** - * The SQL for the query - */ - sql: string; - - /** - * The values for the query - */ - values?: any | any[] | { [param: string]: any }; - - /** - * This overrides the namedPlaceholders option set at the connection level. - */ - namedPlaceholders?: boolean; - - /** - * Every operation takes an optional inactivity timeout option. This allows you to specify appropriate timeouts for - * operations. It is important to note that these timeouts are not part of the MySQL protocol, and rather timeout - * operations through the client. This means that when a timeout is reached, the connection it occurred on will be - * destroyed and no further operations can be performed. - */ - timeout?: number; - - /** - * Either a boolean or string. If true, tables will be nested objects. If string (e.g. '_'), tables will be - * nested as tableName_fieldName - */ - nestTables?: any; - - /** - * Determines if column values should be converted to native JavaScript types. It is not recommended (and may go away / change in the future) - * to disable type casting, but you can currently do so on either the connection or query level. (Default: true) - * - * You can also specify a function (field: any, next: () => void) => {} to do the type casting yourself. - * - * WARNING: YOU MUST INVOKE the parser using one of these three field functions in your custom typeCast callback. They can only be called once. - * - * field.string() - * field.buffer() - * field.geometry() - * - * are aliases for - * - * parser.parseLengthCodedString() - * parser.parseLengthCodedBuffer() - * parser.parseGeometryValue() - * - * You can find which field function you need to use by looking at: RowDataPacket.prototype._typeCast - */ - typeCast?: any; - - /** - * This overrides the same option set at the connection level. - * - */ - rowsAsArray?: boolean; - - /** - * By specifying a function that returns a readable stream, an arbitrary stream can be sent when sending a local fs file. - */ - infileStreamFactory?: (path: string) => Readable; -} - -export interface StreamOptions { - /** - * Sets the max buffer size in objects of a stream - */ - highWaterMark?: number; - - /** - * The object mode of the stream (Default: true) - */ - objectMode?: any; -} - -export interface QueryError extends NodeJS.ErrnoException { - /** - * Either a MySQL server error (e.g. 'ER_ACCESS_DENIED_ERROR'), - * a node.js error (e.g. 'ECONNREFUSED') or an internal error - * (e.g. 'PROTOCOL_CONNECTION_LOST'). - */ - code: string; - - /** - * The sql state marker - */ - sqlStateMarker?: string; - - /** - * The sql state - */ - sqlState?: string; - - /** - * The field count - */ - fieldCount?: number; - - /** - * Boolean, indicating if this error is terminal to the connection object. - */ - fatal: boolean; -} - -declare class Query extends Sequence { - /** - * The SQL for a constructed query - */ - sql: string; - - /** - * Emits a query packet to start the query - */ - start(): void; - - /** - * Determines the packet class to use given the first byte of the packet. - * - * @param firstByte The first byte of the packet - * @param parser The packet parser - */ - determinePacket(firstByte: number, parser: any): any; - - /** - * Creates a Readable stream with the given options - * - * @param options The options for the stream. - */ - stream(options?: StreamOptions): Readable; - - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'error', listener: (err: QueryError) => any): this; - on( - event: 'fields', - listener: (fields: FieldPacket, index: number) => any - ): this; - on( - event: 'result', - listener: (result: RowDataPacket | OkPacket, index: number) => any - ): this; - on(event: 'end', listener: () => any): this; -} - -export type QueryableConstructor = new (...args: any[]) => T; - -export { Query }; diff --git a/node_modules/mysql2/typings/mysql/lib/protocol/sequences/QueryableBase.d.ts b/node_modules/mysql2/typings/mysql/lib/protocol/sequences/QueryableBase.d.ts deleted file mode 100644 index d2ead29..0000000 --- a/node_modules/mysql2/typings/mysql/lib/protocol/sequences/QueryableBase.d.ts +++ /dev/null @@ -1,82 +0,0 @@ -import { - OkPacket, - FieldPacket, - RowDataPacket, - ResultSetHeader, - ProcedureCallPacket, -} from '../packets/index.js'; -import { - Query, - QueryError, - QueryOptions, - QueryableConstructor, -} from './Query.js'; - -export declare function QueryableBase( - Base?: T -): { - new (...args: any[]): { - query< - T extends - | OkPacket - | ResultSetHeader - | ResultSetHeader[] - | RowDataPacket[] - | RowDataPacket[][] - | OkPacket[] - | ProcedureCallPacket - >( - sql: string, - callback?: - | ((err: QueryError | null, result: T, fields: FieldPacket[]) => any) - | undefined - ): Query; - query< - T extends - | OkPacket - | ResultSetHeader - | ResultSetHeader[] - | RowDataPacket[] - | RowDataPacket[][] - | OkPacket[] - | ProcedureCallPacket - >( - sql: string, - values: any, - callback?: - | ((err: QueryError | null, result: T, fields: FieldPacket[]) => any) - | undefined - ): Query; - query< - T extends - | OkPacket - | ResultSetHeader - | ResultSetHeader[] - | RowDataPacket[] - | RowDataPacket[][] - | OkPacket[] - | ProcedureCallPacket - >( - options: QueryOptions, - callback?: - | ((err: QueryError | null, result: T, fields?: FieldPacket[]) => any) - | undefined - ): Query; - query< - T extends - | OkPacket - | ResultSetHeader - | ResultSetHeader[] - | RowDataPacket[] - | RowDataPacket[][] - | OkPacket[] - | ProcedureCallPacket - >( - options: QueryOptions, - values: any, - callback?: - | ((err: QueryError | null, result: T, fields: FieldPacket[]) => any) - | undefined - ): Query; - }; -} & T; diff --git a/node_modules/mysql2/typings/mysql/lib/protocol/sequences/Sequence.d.ts b/node_modules/mysql2/typings/mysql/lib/protocol/sequences/Sequence.d.ts deleted file mode 100644 index 05c91c3..0000000 --- a/node_modules/mysql2/typings/mysql/lib/protocol/sequences/Sequence.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { EventEmitter } from 'events'; - -declare class Sequence extends EventEmitter {} - -export { Sequence }; diff --git a/node_modules/mysql2/typings/mysql/lib/protocol/sequences/promise/ExecutableBase.d.ts b/node_modules/mysql2/typings/mysql/lib/protocol/sequences/promise/ExecutableBase.d.ts deleted file mode 100644 index 2340873..0000000 --- a/node_modules/mysql2/typings/mysql/lib/protocol/sequences/promise/ExecutableBase.d.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { - OkPacket, - FieldPacket, - RowDataPacket, - ResultSetHeader, - ProcedureCallPacket, -} from '../../packets/index.js'; -import { QueryOptions, QueryableConstructor } from '../Query.js'; - -export declare function ExecutableBase( - Base?: T -): { - new (...args: any[]): { - execute< - T extends - | OkPacket - | ResultSetHeader - | ResultSetHeader[] - | RowDataPacket[] - | RowDataPacket[][] - | OkPacket[] - | ProcedureCallPacket - >( - sql: string - ): Promise<[T, FieldPacket[]]>; - execute< - T extends - | OkPacket - | ResultSetHeader - | ResultSetHeader[] - | RowDataPacket[] - | RowDataPacket[][] - | OkPacket[] - | ProcedureCallPacket - >( - sql: string, - values: any - ): Promise<[T, FieldPacket[]]>; - execute< - T extends - | OkPacket - | ResultSetHeader - | ResultSetHeader[] - | RowDataPacket[] - | RowDataPacket[][] - | OkPacket[] - | ProcedureCallPacket - >( - options: QueryOptions - ): Promise<[T, FieldPacket[]]>; - execute< - T extends - | OkPacket - | ResultSetHeader - | ResultSetHeader[] - | RowDataPacket[] - | RowDataPacket[][] - | OkPacket[] - | ProcedureCallPacket - >( - options: QueryOptions, - values: any - ): Promise<[T, FieldPacket[]]>; - }; -} & T; diff --git a/node_modules/mysql2/typings/mysql/lib/protocol/sequences/promise/QueryableBase.d.ts b/node_modules/mysql2/typings/mysql/lib/protocol/sequences/promise/QueryableBase.d.ts deleted file mode 100644 index 6be03c6..0000000 --- a/node_modules/mysql2/typings/mysql/lib/protocol/sequences/promise/QueryableBase.d.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { - OkPacket, - FieldPacket, - RowDataPacket, - ResultSetHeader, - ProcedureCallPacket, -} from '../../packets/index.js'; -import { QueryOptions, QueryableConstructor } from '../Query.js'; - -export declare function QueryableBase( - Base?: T -): { - new (...args: any[]): { - query< - T extends - | OkPacket - | ResultSetHeader - | ResultSetHeader[] - | RowDataPacket[] - | RowDataPacket[][] - | OkPacket[] - | ProcedureCallPacket - >( - sql: string - ): Promise<[T, FieldPacket[]]>; - query< - T extends - | OkPacket - | ResultSetHeader - | ResultSetHeader[] - | RowDataPacket[] - | RowDataPacket[][] - | OkPacket[] - | ProcedureCallPacket - >( - sql: string, - values: any - ): Promise<[T, FieldPacket[]]>; - query< - T extends - | OkPacket - | ResultSetHeader - | ResultSetHeader[] - | RowDataPacket[] - | RowDataPacket[][] - | OkPacket[] - | ProcedureCallPacket - >( - options: QueryOptions - ): Promise<[T, FieldPacket[]]>; - query< - T extends - | OkPacket - | ResultSetHeader - | ResultSetHeader[] - | RowDataPacket[] - | RowDataPacket[][] - | OkPacket[] - | ProcedureCallPacket - >( - options: QueryOptions, - values: any - ): Promise<[T, FieldPacket[]]>; - }; -} & T; diff --git a/node_modules/named-placeholders/README.md b/node_modules/named-placeholders/README.md deleted file mode 100644 index 5b88730..0000000 --- a/node_modules/named-placeholders/README.md +++ /dev/null @@ -1,29 +0,0 @@ -[![Flattr this git repo](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=sidorares&url=https://github.com/sidorares/named-placeholders&title=named-placeholders&language=&tags=github&category=software) - -[![NPM](https://nodei.co/npm/named-placeholders.png?downloads=true&stars=true)](https://nodei.co/npm/named-placeholders/) - -[![CI](https://github.com/mysqljs/named-placeholders/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/mysqljs/named-placeholders/actions/workflows/ci.yml) - -# named-placeholders - -compiles "select foo where foo.id = :bar and foo.baz < :baz" into "select foo where foo.id = ? and foo.baz < ?" + ["bar", "baz"] - -## usage - -```sh -npm install named-placeholders -``` - -see [this mysql2 discussion](https://github.com/sidorares/node-mysql2/issues/117) - -```js -var mysql = require('mysql'); -var toUnnamed = require('named-placeholders')(); - -var q = toUnnamed('select 1+:test', { test: 123}); -mysql.createConnection().query(q[0], q[1]); -``` - -## credits - -parser is based on @mscdex code of his excellent [node-mariasql](https://github.com/mscdex/node-mariasql) library diff --git a/node_modules/named-placeholders/index.js b/node_modules/named-placeholders/index.js deleted file mode 100644 index 3524ef5..0000000 --- a/node_modules/named-placeholders/index.js +++ /dev/null @@ -1,179 +0,0 @@ -'use strict'; - -// based on code from Brian White @mscdex mariasql library - https://github.com/mscdex/node-mariasql/blob/master/lib/Client.js#L272-L332 -// License: https://github.com/mscdex/node-mariasql/blob/master/LICENSE - -const RE_PARAM = /(?:\?)|(?::(\d+|(?:[a-zA-Z][a-zA-Z0-9_]*)))/g, -DQUOTE = 34, -SQUOTE = 39, -BSLASH = 92; - -function parse(query) { - let ppos = RE_PARAM.exec(query); - let curpos = 0; - let start = 0; - let end; - const parts = []; - let inQuote = false; - let escape = false; - let qchr; - const tokens = []; - let qcnt = 0; - let lastTokenEndPos = 0; - let i; - - if (ppos) { - do { - for (i=curpos,end=ppos.index; i params[n])]; -} - -module.exports = createCompiler; -module.exports.toNumbered = toNumbered; diff --git a/node_modules/named-placeholders/node_modules/lru-cache/LICENSE b/node_modules/named-placeholders/node_modules/lru-cache/LICENSE deleted file mode 100644 index f785757..0000000 --- a/node_modules/named-placeholders/node_modules/lru-cache/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) 2010-2023 Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/named-placeholders/node_modules/lru-cache/README.md b/node_modules/named-placeholders/node_modules/lru-cache/README.md deleted file mode 100644 index f128330..0000000 --- a/node_modules/named-placeholders/node_modules/lru-cache/README.md +++ /dev/null @@ -1,1117 +0,0 @@ -# lru-cache - -A cache object that deletes the least-recently-used items. - -Specify a max number of the most recently used items that you -want to keep, and this cache will keep that many of the most -recently accessed items. - -This is not primarily a TTL cache, and does not make strong TTL -guarantees. There is no preemptive pruning of expired items by -default, but you _may_ set a TTL on the cache or on a single -`set`. If you do so, it will treat expired items as missing, and -delete them when fetched. If you are more interested in TTL -caching than LRU caching, check out -[@isaacs/ttlcache](http://npm.im/@isaacs/ttlcache). - -As of version 7, this is one of the most performant LRU -implementations available in JavaScript, and supports a wide -diversity of use cases. However, note that using some of the -features will necessarily impact performance, by causing the -cache to have to do more work. See the "Performance" section -below. - -## Installation - -```bash -npm install lru-cache --save -``` - -## Usage - -```js -// hybrid module, either works -import LRUCache from 'lru-cache' -// or: -const LRUCache = require('lru-cache') - -// At least one of 'max', 'ttl', or 'maxSize' is required, to prevent -// unsafe unbounded storage. -// -// In most cases, it's best to specify a max for performance, so all -// the required memory allocation is done up-front. -// -// All the other options are optional, see the sections below for -// documentation on what each one does. Most of them can be -// overridden for specific items in get()/set() -const options = { - max: 500, - - // for use with tracking overall storage size - maxSize: 5000, - sizeCalculation: (value, key) => { - return 1 - }, - - // for use when you need to clean up something when objects - // are evicted from the cache - dispose: (value, key) => { - freeFromMemoryOrWhatever(value) - }, - - // how long to live in ms - ttl: 1000 * 60 * 5, - - // return stale items before removing from cache? - allowStale: false, - - updateAgeOnGet: false, - updateAgeOnHas: false, - - // async method to use for cache.fetch(), for - // stale-while-revalidate type of behavior - fetchMethod: async (key, staleValue, { options, signal }) => {}, -} - -const cache = new LRUCache(options) - -cache.set('key', 'value') -cache.get('key') // "value" - -// non-string keys ARE fully supported -// but note that it must be THE SAME object, not -// just a JSON-equivalent object. -var someObject = { a: 1 } -cache.set(someObject, 'a value') -// Object keys are not toString()-ed -cache.set('[object Object]', 'a different value') -assert.equal(cache.get(someObject), 'a value') -// A similar object with same keys/values won't work, -// because it's a different object identity -assert.equal(cache.get({ a: 1 }), undefined) - -cache.clear() // empty the cache -``` - -If you put more stuff in it, then items will fall out. - -## Options - -### `max` - -The maximum number of items that remain in the cache (assuming no -TTL pruning or explicit deletions). Note that fewer items may be -stored if size calculation is used, and `maxSize` is exceeded. -This must be a positive finite intger. - -At least one of `max`, `maxSize`, or `TTL` is required. This -must be a positive integer if set. - -**It is strongly recommended to set a `max` to prevent unbounded -growth of the cache.** See "Storage Bounds Safety" below. - -### `maxSize` - -Set to a positive integer to track the sizes of items added to -the cache, and automatically evict items in order to stay below -this size. Note that this may result in fewer than `max` items -being stored. - -Attempting to add an item to the cache whose calculated size is -greater that this amount will be a no-op. The item will not be -cached, and no other items will be evicted. - -Optional, must be a positive integer if provided. - -Sets `maxEntrySize` to the same value, unless a different value -is provided for `maxEntrySize`. - -At least one of `max`, `maxSize`, or `TTL` is required. This -must be a positive integer if set. - -Even if size tracking is enabled, **it is strongly recommended to -set a `max` to prevent unbounded growth of the cache.** See -"Storage Bounds Safety" below. - -### `maxEntrySize` - -Set to a positive integer to track the sizes of items added to -the cache, and prevent caching any item over a given size. -Attempting to add an item whose calculated size is greater than -this amount will be a no-op. The item will not be cached, and no -other items will be evicted. - -Optional, must be a positive integer if provided. Defaults to -the value of `maxSize` if provided. - -### `sizeCalculation` - -Function used to calculate the size of stored items. If you're -storing strings or buffers, then you probably want to do -something like `n => n.length`. The item is passed as the first -argument, and the key is passed as the second argument. - -This may be overridden by passing an options object to -`cache.set()`. - -Requires `maxSize` to be set. - -If the `size` (or return value of `sizeCalculation`) for a given -entry is greater than `maxEntrySize`, then the item will not be -added to the cache. - -Deprecated alias: `length` - -### `fetchMethod` - -Function that is used to make background asynchronous fetches. -Called with `fetchMethod(key, staleValue, { signal, options, -context })`. May return a Promise. - -If `fetchMethod` is not provided, then `cache.fetch(key)` is -equivalent to `Promise.resolve(cache.get(key))`. - -The `signal` object is an `AbortSignal` if that's available in -the global object, otherwise it's a pretty close polyfill. - -If at any time, `signal.aborted` is set to `true`, or if the -`signal.onabort` method is called, or if it emits an `'abort'` -event which you can listen to with `addEventListener`, then that -means that the fetch should be abandoned. This may be passed -along to async functions aware of AbortController/AbortSignal -behavior. - -The `fetchMethod` should **only** return `undefined` or a Promise -resolving to `undefined` if the AbortController signaled an -`abort` event. In all other cases, it should return or resolve -to a value suitable for adding to the cache. - -The `options` object is a union of the options that may be -provided to `set()` and `get()`. If they are modified, then that -will result in modifying the settings to `cache.set()` when the -value is resolved, and in the case of `noDeleteOnFetchRejection` -and `allowStaleOnFetchRejection`, the handling of `fetchMethod` -failures. - -For example, a DNS cache may update the TTL based on the value -returned from a remote DNS server by changing `options.ttl` in -the `fetchMethod`. - -### `fetchContext` - -Arbitrary data that can be passed to the `fetchMethod` as the -`context` option. - -Note that this will only be relevant when the `cache.fetch()` -call needs to call `fetchMethod()`. Thus, any data which will -meaningfully vary the fetch response needs to be present in the -key. This is primarily intended for including `x-request-id` -headers and the like for debugging purposes, which do not affect -the `fetchMethod()` response. - -### `noDeleteOnFetchRejection` - -If a `fetchMethod` throws an error or returns a rejected promise, -then by default, any existing stale value will be removed from -the cache. - -If `noDeleteOnFetchRejection` is set to `true`, then this -behavior is suppressed, and the stale value remains in the cache -in the case of a rejected `fetchMethod`. - -This is important in cases where a `fetchMethod` is _only_ called -as a background update while the stale value is returned, when -`allowStale` is used. - -This is implicitly in effect when `allowStaleOnFetchRejection` is -set. - -This may be set in calls to `fetch()`, or defaulted on the -constructor, or overridden by modifying the options object in the -`fetchMethod`. - -### `allowStaleOnFetchRejection` - -Set to true to return a stale value from the cache when a -`fetchMethod` throws an error or returns a rejected Promise. - -If a `fetchMethod` fails, and there is no stale value available, -the `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` -errors are suppressed. - -Implies `noDeleteOnFetchRejection`. - -This may be set in calls to `fetch()`, or defaulted on the -constructor, or overridden by modifying the options object in the -`fetchMethod`. - -### `allowStaleOnFetchAbort` - -Set to true to return a stale value from the cache when the -`AbortSignal` passed to the `fetchMethod` dispatches an `'abort'` -event, whether user-triggered, or due to internal cache behavior. - -Unless `ignoreFetchAbort` is also set, the underlying -`fetchMethod` will still be considered canceled, and its return -value will be ignored and not cached. - -### `ignoreFetchAbort` - -Set to true to ignore the `abort` event emitted by the -`AbortSignal` object passed to `fetchMethod`, and still cache the -resulting resolution value, as long as it is not `undefined`. - -When used on its own, this means aborted `fetch()` calls are not -immediately resolved or rejected when they are aborted, and -instead take the full time to await. - -When used with `allowStaleOnFetchAbort`, aborted `fetch()` calls -will resolve immediately to their stale cached value or -`undefined`, and will continue to process and eventually update -the cache when they resolve, as long as the resulting value is -not `undefined`, thus supporting a "return stale on timeout while -refreshing" mechanism by passing `AbortSignal.timeout(n)` as the -signal. - -For example: - -```js -const c = new LRUCache({ - ttl: 100, - ignoreFetchAbort: true, - allowStaleOnFetchAbort: true, - fetchMethod: async (key, oldValue, { signal }) => { - // note: do NOT pass the signal to fetch()! - // let's say this fetch can take a long time. - const res = await fetch(`https://slow-backend-server/${key}`) - return await res.json() - }, -}) - -// this will return the stale value after 100ms, while still -// updating in the background for next time. -const val = await c.fetch('key', { signal: AbortSignal.timeout(100) }) -``` - -**Note**: regardless of this setting, an `abort` event _is still -emitted on the `AbortSignal` object_, so may result in invalid -results when passed to other underlying APIs that use -AbortSignals. - -This may be overridden on the `fetch()` call or in the -`fetchMethod` itself. - -### `dispose` - -Function that is called on items when they are dropped from the -cache, as `this.dispose(value, key, reason)`. - -This can be handy if you want to close file descriptors or do -other cleanup tasks when items are no longer stored in the cache. - -**NOTE**: It is called _before_ the item has been fully removed -from the cache, so if you want to put it right back in, you need -to wait until the next tick. If you try to add it back in during -the `dispose()` function call, it will break things in subtle and -weird ways. - -Unlike several other options, this may _not_ be overridden by -passing an option to `set()`, for performance reasons. If -disposal functions may vary between cache entries, then the -entire list must be scanned on every cache swap, even if no -disposal function is in use. - -The `reason` will be one of the following strings, corresponding -to the reason for the item's deletion: - -- `evict` Item was evicted to make space for a new addition -- `set` Item was overwritten by a new value -- `delete` Item was removed by explicit `cache.delete(key)` or by - calling `cache.clear()`, which deletes everything. - -The `dispose()` method is _not_ called for canceled calls to -`fetchMethod()`. If you wish to handle evictions, overwrites, -and deletes of in-flight asynchronous fetches, you must use the -`AbortSignal` provided. - -Optional, must be a function. - -### `disposeAfter` - -The same as `dispose`, but called _after_ the entry is completely -removed and the cache is once again in a clean state. - -It is safe to add an item right back into the cache at this -point. However, note that it is _very_ easy to inadvertently -create infinite recursion in this way. - -The `disposeAfter()` method is _not_ called for canceled calls to -`fetchMethod()`. If you wish to handle evictions, overwrites, -and deletes of in-flight asynchronous fetches, you must use the -`AbortSignal` provided. - -### `noDisposeOnSet` - -Set to `true` to suppress calling the `dispose()` function if the -entry key is still accessible within the cache. - -This may be overridden by passing an options object to -`cache.set()`. - -Boolean, default `false`. Only relevant if `dispose` or -`disposeAfter` options are set. - -### `ttl` - -Max time to live for items before they are considered stale. -Note that stale items are NOT preemptively removed by default, -and MAY live in the cache, contributing to its LRU max, long -after they have expired. - -Also, as this cache is optimized for LRU/MRU operations, some of -the staleness/TTL checks will reduce performance. - -This is not primarily a TTL cache, and does not make strong TTL -guarantees. There is no pre-emptive pruning of expired items, -but you _may_ set a TTL on the cache, and it will treat expired -items as missing when they are fetched, and delete them. - -Optional, but must be a positive integer in ms if specified. - -This may be overridden by passing an options object to -`cache.set()`. - -At least one of `max`, `maxSize`, or `TTL` is required. This -must be a positive integer if set. - -Even if ttl tracking is enabled, **it is strongly recommended to -set a `max` to prevent unbounded growth of the cache.** See -"Storage Bounds Safety" below. - -If ttl tracking is enabled, and `max` and `maxSize` are not set, -and `ttlAutopurge` is not set, then a warning will be emitted -cautioning about the potential for unbounded memory consumption. - -Deprecated alias: `maxAge` - -### `noUpdateTTL` - -Boolean flag to tell the cache to not update the TTL when setting -a new value for an existing key (ie, when updating a value rather -than inserting a new value). Note that the TTL value is _always_ -set (if provided) when adding a new entry into the cache. - -This may be passed as an option to `cache.set()`. - -Boolean, default false. - -### `ttlResolution` - -Minimum amount of time in ms in which to check for staleness. -Defaults to `1`, which means that the current time is checked at -most once per millisecond. - -Set to `0` to check the current time every time staleness is -tested. - -Note that setting this to a higher value _will_ improve -performance somewhat while using ttl tracking, albeit at the -expense of keeping stale items around a bit longer than intended. - -### `ttlAutopurge` - -Preemptively remove stale items from the cache. - -Note that this may _significantly_ degrade performance, -especially if the cache is storing a large number of items. It -is almost always best to just leave the stale items in the cache, -and let them fall out as new items are added. - -Note that this means that `allowStale` is a bit pointless, as -stale items will be deleted almost as soon as they expire. - -Use with caution! - -Boolean, default `false` - -### `allowStale` - -By default, if you set `ttl`, it'll only delete stale items from -the cache when you `get(key)`. That is, it's not preemptively -pruning items. - -If you set `allowStale:true`, it'll return the stale value as -well as deleting it. If you don't set this, then it'll return -`undefined` when you try to get a stale entry. - -Note that when a stale entry is fetched, _even if it is returned -due to `allowStale` being set_, it is removed from the cache -immediately. You can immediately put it back in the cache if you -wish, thus resetting the TTL. - -This may be overridden by passing an options object to -`cache.get()`. The `cache.has()` method will always return -`false` for stale items. - -Boolean, default false, only relevant if `ttl` is set. - -Deprecated alias: `stale` - -### `noDeleteOnStaleGet` - -When using time-expiring entries with `ttl`, by default stale -items will be removed from the cache when the key is accessed -with `cache.get()`. - -Setting `noDeleteOnStaleGet` to `true` will cause stale items to -remain in the cache, until they are explicitly deleted with -`cache.delete(key)`, or retrieved with `noDeleteOnStaleGet` set -to `false`. - -This may be overridden by passing an options object to -`cache.get()`. - -Boolean, default false, only relevant if `ttl` is set. - -### `updateAgeOnGet` - -When using time-expiring entries with `ttl`, setting this to -`true` will make each item's age reset to 0 whenever it is -retrieved from cache with `get()`, causing it to not expire. (It -can still fall out of cache based on recency of use, of course.) - -This may be overridden by passing an options object to -`cache.get()`. - -Boolean, default false, only relevant if `ttl` is set. - -### `updateAgeOnHas` - -When using time-expiring entries with `ttl`, setting this to -`true` will make each item's age reset to 0 whenever its presence -in the cache is checked with `has()`, causing it to not expire. -(It can still fall out of cache based on recency of use, of -course.) - -This may be overridden by passing an options object to -`cache.has()`. - -Boolean, default false, only relevant if `ttl` is set. - -## API - -### `new LRUCache(options)` - -Create a new LRUCache. All options are documented above, and are -on the cache as public members. - -### `cache.max`, `cache.maxSize`, `cache.allowStale`, - -`cache.noDisposeOnSet`, `cache.sizeCalculation`, `cache.dispose`, -`cache.maxSize`, `cache.ttl`, `cache.updateAgeOnGet`, -`cache.updateAgeOnHas` - -All option names are exposed as public members on the cache -object. - -These are intended for read access only. Changing them during -program operation can cause undefined behavior. - -### `cache.size` - -The total number of items held in the cache at the current -moment. - -### `cache.calculatedSize` - -The total size of items in cache when using size tracking. - -### `set(key, value, [{ size, sizeCalculation, ttl, noDisposeOnSet, start, status }])` - -Add a value to the cache. - -Optional options object may contain `ttl` and `sizeCalculation` -as described above, which default to the settings on the cache -object. - -If `start` is provided, then that will set the effective start -time for the TTL calculation. Note that this must be a previous -value of `performance.now()` if supported, or a previous value of -`Date.now()` if not. - -Options object may also include `size`, which will prevent -calling the `sizeCalculation` function and just use the specified -number if it is a positive integer, and `noDisposeOnSet` which -will prevent calling a `dispose` function in the case of -overwrites. - -If the `size` (or return value of `sizeCalculation`) for a given -entry is greater than `maxEntrySize`, then the item will not be -added to the cache. - -Will update the recency of the entry. - -Returns the cache object. - -For the usage of the `status` option, see **Status Tracking** -below. - -### `get(key, { updateAgeOnGet, allowStale, status } = {}) => value` - -Return a value from the cache. - -Will update the recency of the cache entry found. - -If the key is not found, `get()` will return `undefined`. This -can be confusing when setting values specifically to `undefined`, -as in `cache.set(key, undefined)`. Use `cache.has()` to -determine whether a key is present in the cache at all. - -For the usage of the `status` option, see **Status Tracking** -below. - -### `async fetch(key, options = {}) => Promise` - -The following options are supported: - -- `updateAgeOnGet` -- `allowStale` -- `size` -- `sizeCalculation` -- `ttl` -- `noDisposeOnSet` -- `forceRefresh` -- `status` - See **Status Tracking** below. -- `signal` - AbortSignal can be used to cancel the `fetch()`. - Note that the `signal` option provided to the `fetchMethod` is - a different object, because it must also respond to internal - cache state changes, but aborting this signal will abort the - one passed to `fetchMethod` as well. -- `fetchContext` - sets the `context` option passed to the - underlying `fetchMethod`. - -If the value is in the cache and not stale, then the returned -Promise resolves to the value. - -If not in the cache, or beyond its TTL staleness, then -`fetchMethod(key, staleValue, { options, signal, context })` is -called, and the value returned will be added to the cache once -resolved. - -If called with `allowStale`, and an asynchronous fetch is -currently in progress to reload a stale value, then the former -stale value will be returned. - -If called with `forceRefresh`, then the cached item will be -re-fetched, even if it is not stale. However, if `allowStale` is -set, then the old value will still be returned. This is useful -in cases where you want to force a reload of a cached value. If -a background fetch is already in progress, then `forceRefresh` -has no effect. - -Multiple fetches for the same `key` will only call `fetchMethod` -a single time, and all will be resolved when the value is -resolved, even if different options are used. - -If `fetchMethod` is not specified, then this is effectively an -alias for `Promise.resolve(cache.get(key))`. - -When the fetch method resolves to a value, if the fetch has not -been aborted due to deletion, eviction, or being overwritten, -then it is added to the cache using the options provided. - -If the key is evicted or deleted before the `fetchMethod` -resolves, then the AbortSignal passed to the `fetchMethod` will -receive an `abort` event, and the promise returned by `fetch()` -will reject with the reason for the abort. - -If a `signal` is passed to the `fetch()` call, then aborting the -signal will abort the fetch and cause the `fetch()` promise to -reject with the reason provided. - -### `peek(key, { allowStale } = {}) => value` - -Like `get()` but doesn't update recency or delete stale items. - -Returns `undefined` if the item is stale, unless `allowStale` is -set either on the cache or in the options object. - -### `has(key, { updateAgeOnHas, status } = {}) => Boolean` - -Check if a key is in the cache, without updating the recency of -use. Age is updated if `updateAgeOnHas` is set to `true` in -either the options or the constructor. - -Will return `false` if the item is stale, even though it is -technically in the cache. The difference can be determined (if -it matters) by using a `status` argument, and inspecting the -`has` field. - -For the usage of the `status` option, see **Status Tracking** -below. - -### `delete(key)` - -Deletes a key out of the cache. - -Returns `true` if the key was deleted, `false` otherwise. - -### `clear()` - -Clear the cache entirely, throwing away all values. - -Deprecated alias: `reset()` - -### `keys()` - -Return a generator yielding the keys in the cache, in order from -most recently used to least recently used. - -### `rkeys()` - -Return a generator yielding the keys in the cache, in order from -least recently used to most recently used. - -### `values()` - -Return a generator yielding the values in the cache, in order -from most recently used to least recently used. - -### `rvalues()` - -Return a generator yielding the values in the cache, in order -from least recently used to most recently used. - -### `entries()` - -Return a generator yielding `[key, value]` pairs, in order from -most recently used to least recently used. - -### `rentries()` - -Return a generator yielding `[key, value]` pairs, in order from -least recently used to most recently used. - -### `find(fn, [getOptions])` - -Find a value for which the supplied `fn` method returns a truthy -value, similar to `Array.find()`. - -`fn` is called as `fn(value, key, cache)`. - -The optional `getOptions` are applied to the resulting `get()` of -the item found. - -### `dump()` - -Return an array of `[key, entry]` objects which can be passed to -`cache.load()` - -The `start` fields are calculated relative to a portable -`Date.now()` timestamp, even if `performance.now()` is available. - -Stale entries are always included in the `dump`, even if -`allowStale` is false. - -Note: this returns an actual array, not a generator, so it can be -more easily passed around. - -### `load(entries)` - -Reset the cache and load in the items in `entries` in the order -listed. Note that the shape of the resulting cache may be -different if the same options are not used in both caches. - -The `start` fields are assumed to be calculated relative to a -portable `Date.now()` timestamp, even if `performance.now()` is -available. - -### `purgeStale()` - -Delete any stale entries. Returns `true` if anything was -removed, `false` otherwise. - -Deprecated alias: `prune` - -### `getRemainingTTL(key)` - -Return the number of ms left in the item's TTL. If item is not -in cache, returns `0`. Returns `Infinity` if item is in cache -without a defined TTL. - -### `forEach(fn, [thisp])` - -Call the `fn` function with each set of `fn(value, key, cache)` -in the LRU cache, from most recent to least recently used. - -Does not affect recency of use. - -If `thisp` is provided, function will be called in the -`this`-context of the provided object. - -### `rforEach(fn, [thisp])` - -Same as `cache.forEach(fn, thisp)`, but in order from least -recently used to most recently used. - -### `pop()` - -Evict the least recently used item, returning its value. - -Returns `undefined` if cache is empty. - -### Internal Methods and Properties - -In order to optimize performance as much as possible, "private" -members and methods are exposed on the object as normal -properties, rather than being accessed via Symbols, private -members, or closure variables. - -**Do not use or rely on these.** They will change or be removed -without notice. They will cause undefined behavior if used -inappropriately. There is no need or reason to ever call them -directly. - -This documentation is here so that it is especially clear that -this not "undocumented" because someone forgot; it _is_ -documented, and the documentation is telling you not to do it. - -**Do not report bugs that stem from using these properties.** -They will be ignored. - -- `initializeTTLTracking()` Set up the cache for tracking TTLs -- `updateItemAge(index)` Called when an item age is updated, by - internal ID -- `setItemTTL(index)` Called when an item ttl is updated, by - internal ID -- `isStale(index)` Called to check an item's staleness, by - internal ID -- `initializeSizeTracking()` Set up the cache for tracking item - size. Called automatically when a size is specified. -- `removeItemSize(index)` Updates the internal size calculation - when an item is removed or modified, by internal ID -- `addItemSize(index)` Updates the internal size calculation when - an item is added or modified, by internal ID -- `indexes()` An iterator over the non-stale internal IDs, from - most recently to least recently used. -- `rindexes()` An iterator over the non-stale internal IDs, from - least recently to most recently used. -- `newIndex()` Create a new internal ID, either reusing a deleted - ID, evicting the least recently used ID, or walking to the end - of the allotted space. -- `evict()` Evict the least recently used internal ID, returning - its ID. Does not do any bounds checking. -- `connect(p, n)` Connect the `p` and `n` internal IDs in the - linked list. -- `moveToTail(index)` Move the specified internal ID to the most - recently used position. -- `keyMap` Map of keys to internal IDs -- `keyList` List of keys by internal ID -- `valList` List of values by internal ID -- `sizes` List of calculated sizes by internal ID -- `ttls` List of TTL values by internal ID -- `starts` List of start time values by internal ID -- `next` Array of "next" pointers by internal ID -- `prev` Array of "previous" pointers by internal ID -- `head` Internal ID of least recently used item -- `tail` Internal ID of most recently used item -- `free` Stack of deleted internal IDs - -## Status Tracking - -Occasionally, it may be useful to track the internal behavior of -the cache, particularly for logging, debugging, or for behavior -within the `fetchMethod`. To do this, you can pass a `status` -object to the `get()`, `set()`, `has()`, and `fetch()` methods. - -The `status` option should be a plain JavaScript object. - -The following fields will be set appropriately: - -```ts -interface Status { - /** - * The status of a set() operation. - * - * - add: the item was not found in the cache, and was added - * - update: the item was in the cache, with the same value provided - * - replace: the item was in the cache, and replaced - * - miss: the item was not added to the cache for some reason - */ - set?: 'add' | 'update' | 'replace' | 'miss' - - /** - * the ttl stored for the item, or undefined if ttls are not used. - */ - ttl?: LRUMilliseconds - - /** - * the start time for the item, or undefined if ttls are not used. - */ - start?: LRUMilliseconds - - /** - * The timestamp used for TTL calculation - */ - now?: LRUMilliseconds - - /** - * the remaining ttl for the item, or undefined if ttls are not used. - */ - remainingTTL?: LRUMilliseconds - - /** - * The calculated size for the item, if sizes are used. - */ - size?: LRUSize - - /** - * A flag indicating that the item was not stored, due to exceeding the - * {@link maxEntrySize} - */ - maxEntrySizeExceeded?: true - - /** - * The old value, specified in the case of `set:'update'` or - * `set:'replace'` - */ - oldValue?: V - - /** - * The results of a {@link has} operation - * - * - hit: the item was found in the cache - * - stale: the item was found in the cache, but is stale - * - miss: the item was not found in the cache - */ - has?: 'hit' | 'stale' | 'miss' - - /** - * The status of a {@link fetch} operation. - * Note that this can change as the underlying fetch() moves through - * various states. - * - * - inflight: there is another fetch() for this key which is in process - * - get: there is no fetchMethod, so {@link get} was called. - * - miss: the item is not in cache, and will be fetched. - * - hit: the item is in the cache, and was resolved immediately. - * - stale: the item is in the cache, but stale. - * - refresh: the item is in the cache, and not stale, but - * {@link forceRefresh} was specified. - */ - fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh' - - /** - * The {@link fetchMethod} was called - */ - fetchDispatched?: true - - /** - * The cached value was updated after a successful call to fetchMethod - */ - fetchUpdated?: true - - /** - * The reason for a fetch() rejection. Either the error raised by the - * {@link fetchMethod}, or the reason for an AbortSignal. - */ - fetchError?: Error - - /** - * The fetch received an abort signal - */ - fetchAborted?: true - - /** - * The abort signal received was ignored, and the fetch was allowed to - * continue. - */ - fetchAbortIgnored?: true - - /** - * The fetchMethod promise resolved successfully - */ - fetchResolved?: true - - /** - * The results of the fetchMethod promise were stored in the cache - */ - fetchUpdated?: true - - /** - * The fetchMethod promise was rejected - */ - fetchRejected?: true - - /** - * The status of a {@link get} operation. - * - * - fetching: The item is currently being fetched. If a previous value is - * present and allowed, that will be returned. - * - stale: The item is in the cache, and is stale. - * - hit: the item is in the cache - * - miss: the item is not in the cache - */ - get?: 'stale' | 'hit' | 'miss' - - /** - * A fetch or get operation returned a stale value. - */ - returnedStale?: true -} -``` - -## Storage Bounds Safety - -This implementation aims to be as flexible as possible, within -the limits of safe memory consumption and optimal performance. - -At initial object creation, storage is allocated for `max` items. -If `max` is set to zero, then some performance is lost, and item -count is unbounded. Either `maxSize` or `ttl` _must_ be set if -`max` is not specified. - -If `maxSize` is set, then this creates a safe limit on the -maximum storage consumed, but without the performance benefits of -pre-allocation. When `maxSize` is set, every item _must_ provide -a size, either via the `sizeCalculation` method provided to the -constructor, or via a `size` or `sizeCalculation` option provided -to `cache.set()`. The size of every item _must_ be a positive -integer. - -If neither `max` nor `maxSize` are set, then `ttl` tracking must -be enabled. Note that, even when tracking item `ttl`, items are -_not_ preemptively deleted when they become stale, unless -`ttlAutopurge` is enabled. Instead, they are only purged the -next time the key is requested. Thus, if `ttlAutopurge`, `max`, -and `maxSize` are all not set, then the cache will potentially -grow unbounded. - -In this case, a warning is printed to standard error. Future -versions may require the use of `ttlAutopurge` if `max` and -`maxSize` are not specified. - -If you truly wish to use a cache that is bound _only_ by TTL -expiration, consider using a `Map` object, and calling -`setTimeout` to delete entries when they expire. It will perform -much better than an LRU cache. - -Here is an implementation you may use, under the same -[license](./LICENSE) as this package: - -```js -// a storage-unbounded ttl cache that is not an lru-cache -const cache = { - data: new Map(), - timers: new Map(), - set: (k, v, ttl) => { - if (cache.timers.has(k)) { - clearTimeout(cache.timers.get(k)) - } - cache.timers.set( - k, - setTimeout(() => cache.delete(k), ttl) - ) - cache.data.set(k, v) - }, - get: k => cache.data.get(k), - has: k => cache.data.has(k), - delete: k => { - if (cache.timers.has(k)) { - clearTimeout(cache.timers.get(k)) - } - cache.timers.delete(k) - return cache.data.delete(k) - }, - clear: () => { - cache.data.clear() - for (const v of cache.timers.values()) { - clearTimeout(v) - } - cache.timers.clear() - }, -} -``` - -If that isn't to your liking, check out -[@isaacs/ttlcache](http://npm.im/@isaacs/ttlcache). - -## Performance - -As of January 2022, version 7 of this library is one of the most -performant LRU cache implementations in JavaScript. - -Benchmarks can be extremely difficult to get right. In -particular, the performance of set/get/delete operations on -objects will vary _wildly_ depending on the type of key used. V8 -is highly optimized for objects with keys that are short strings, -especially integer numeric strings. Thus any benchmark which -tests _solely_ using numbers as keys will tend to find that an -object-based approach performs the best. - -Note that coercing _anything_ to strings to use as object keys is -unsafe, unless you can be 100% certain that no other type of -value will be used. For example: - -```js -const myCache = {} -const set = (k, v) => (myCache[k] = v) -const get = k => myCache[k] - -set({}, 'please hang onto this for me') -set('[object Object]', 'oopsie') -``` - -Also beware of "Just So" stories regarding performance. Garbage -collection of large (especially: deep) object graphs can be -incredibly costly, with several "tipping points" where it -increases exponentially. As a result, putting that off until -later can make it much worse, and less predictable. If a library -performs well, but only in a scenario where the object graph is -kept shallow, then that won't help you if you are using large -objects as keys. - -In general, when attempting to use a library to improve -performance (such as a cache like this one), it's best to choose -an option that will perform well in the sorts of scenarios where -you'll actually use it. - -This library is optimized for repeated gets and minimizing -eviction time, since that is the expected need of a LRU. Set -operations are somewhat slower on average than a few other -options, in part because of that optimization. It is assumed -that you'll be caching some costly operation, ideally as rarely -as possible, so optimizing set over get would be unwise. - -If performance matters to you: - -1. If it's at all possible to use small integer values as keys, - and you can guarantee that no other types of values will be - used as keys, then do that, and use a cache such as - [lru-fast](https://npmjs.com/package/lru-fast), or - [mnemonist's - LRUCache](https://yomguithereal.github.io/mnemonist/lru-cache) - which uses an Object as its data store. -2. Failing that, if at all possible, use short non-numeric - strings (ie, less than 256 characters) as your keys, and use - [mnemonist's - LRUCache](https://yomguithereal.github.io/mnemonist/lru-cache). -3. If the types of your keys will be long strings, strings that - look like floats, `null`, objects, or some mix of types, or if - you aren't sure, then this library will work well for you. -4. Do not use a `dispose` function, size tracking, or especially - ttl behavior, unless absolutely needed. These features are - convenient, and necessary in some use cases, and every attempt - has been made to make the performance impact minimal, but it - isn't nothing. - -## Breaking Changes in Version 7 - -This library changed to a different algorithm and internal data -structure in version 7, yielding significantly better -performance, albeit with some subtle changes as a result. - -If you were relying on the internals of LRUCache in version 6 or -before, it probably will not work in version 7 and above. - -For more info, see the [change log](CHANGELOG.md). diff --git a/node_modules/named-placeholders/node_modules/lru-cache/index.d.ts b/node_modules/named-placeholders/node_modules/lru-cache/index.d.ts deleted file mode 100644 index b58395e..0000000 --- a/node_modules/named-placeholders/node_modules/lru-cache/index.d.ts +++ /dev/null @@ -1,869 +0,0 @@ -// Project: https://github.com/isaacs/node-lru-cache -// Based initially on @types/lru-cache -// https://github.com/DefinitelyTyped/DefinitelyTyped -// used under the terms of the MIT License, shown below. -// -// DefinitelyTyped license: -// ------ -// MIT License -// -// Copyright (c) Microsoft Corporation. -// -// 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 -// ------ -// -// Changes by Isaac Z. Schlueter released under the terms found in the -// LICENSE file within this project. - -/** - * Integer greater than 0, representing some number of milliseconds, or the - * time at which a TTL started counting from. - */ -declare type LRUMilliseconds = number - -/** - * An integer greater than 0, reflecting the calculated size of items - */ -declare type LRUSize = number - -/** - * An integer greater than 0, reflecting a number of items - */ -declare type LRUCount = number - -declare class LRUCache implements Iterable<[K, V]> { - constructor(options: LRUCache.Options) - - /** - * Number of items in the cache. - * Alias for {@link size} - * - * @deprecated since 7.0 use {@link size} instead - */ - public readonly length: LRUCount - - public readonly max: LRUCount - public readonly maxSize: LRUSize - public readonly maxEntrySize: LRUSize - public readonly sizeCalculation: - | LRUCache.SizeCalculator - | undefined - public readonly dispose: LRUCache.Disposer - /** - * @since 7.4.0 - */ - public readonly disposeAfter: LRUCache.Disposer | null - public readonly noDisposeOnSet: boolean - public readonly ttl: LRUMilliseconds - public readonly ttlResolution: LRUMilliseconds - public readonly ttlAutopurge: boolean - public readonly allowStale: boolean - public readonly updateAgeOnGet: boolean - /** - * @since 7.11.0 - */ - public readonly noDeleteOnStaleGet: boolean - /** - * @since 7.6.0 - */ - public readonly fetchMethod: LRUCache.Fetcher | null - - /** - * The total number of items held in the cache at the current moment. - */ - public readonly size: LRUCount - - /** - * The total size of items in cache when using size tracking. - */ - public readonly calculatedSize: LRUSize - - /** - * Add a value to the cache. - */ - public set( - key: K, - value: V, - options?: LRUCache.SetOptions - ): this - - /** - * Return a value from the cache. Will update the recency of the cache entry - * found. - * - * If the key is not found, {@link get} will return `undefined`. This can be - * confusing when setting values specifically to `undefined`, as in - * `cache.set(key, undefined)`. Use {@link has} to determine whether a key is - * present in the cache at all. - */ - public get(key: K, options?: LRUCache.GetOptions): V | undefined - - /** - * Like {@link get} but doesn't update recency or delete stale items. - * Returns `undefined` if the item is stale, unless {@link allowStale} is set - * either on the cache or in the options object. - */ - public peek(key: K, options?: LRUCache.PeekOptions): V | undefined - - /** - * Check if a key is in the cache, without updating the recency of use. - * Will return false if the item is stale, even though it is technically - * in the cache. - * - * Will not update item age unless {@link updateAgeOnHas} is set in the - * options or constructor. - */ - public has(key: K, options?: LRUCache.HasOptions): boolean - - /** - * Deletes a key out of the cache. - * Returns true if the key was deleted, false otherwise. - */ - public delete(key: K): boolean - - /** - * Clear the cache entirely, throwing away all values. - */ - public clear(): void - - /** - * Delete any stale entries. Returns true if anything was removed, false - * otherwise. - */ - public purgeStale(): boolean - - /** - * Find a value for which the supplied fn method returns a truthy value, - * similar to Array.find(). fn is called as fn(value, key, cache). - */ - public find( - callbackFn: ( - value: V, - key: K, - cache: this - ) => boolean | undefined | void, - options?: LRUCache.GetOptions - ): V | undefined - - /** - * Call the supplied function on each item in the cache, in order from - * most recently used to least recently used. fn is called as - * fn(value, key, cache). Does not update age or recenty of use. - */ - public forEach( - callbackFn: (this: T, value: V, key: K, cache: this) => void, - thisArg?: T - ): void - - /** - * The same as {@link forEach} but items are iterated over in reverse - * order. (ie, less recently used items are iterated over first.) - */ - public rforEach( - callbackFn: (this: T, value: V, key: K, cache: this) => void, - thisArg?: T - ): void - - /** - * Return a generator yielding the keys in the cache, - * in order from most recently used to least recently used. - */ - public keys(): Generator - - /** - * Inverse order version of {@link keys} - * - * Return a generator yielding the keys in the cache, - * in order from least recently used to most recently used. - */ - public rkeys(): Generator - - /** - * Return a generator yielding the values in the cache, - * in order from most recently used to least recently used. - */ - public values(): Generator - - /** - * Inverse order version of {@link values} - * - * Return a generator yielding the values in the cache, - * in order from least recently used to most recently used. - */ - public rvalues(): Generator - - /** - * Return a generator yielding `[key, value]` pairs, - * in order from most recently used to least recently used. - */ - public entries(): Generator<[K, V], void, void> - - /** - * Inverse order version of {@link entries} - * - * Return a generator yielding `[key, value]` pairs, - * in order from least recently used to most recently used. - */ - public rentries(): Generator<[K, V], void, void> - - /** - * Iterating over the cache itself yields the same results as - * {@link entries} - */ - public [Symbol.iterator](): Generator<[K, V], void, void> - - /** - * Return an array of [key, entry] objects which can be passed to - * cache.load() - */ - public dump(): Array<[K, LRUCache.Entry]> - - /** - * Reset the cache and load in the items in entries in the order listed. - * Note that the shape of the resulting cache may be different if the - * same options are not used in both caches. - */ - public load( - cacheEntries: ReadonlyArray<[K, LRUCache.Entry]> - ): void - - /** - * Evict the least recently used item, returning its value or `undefined` - * if cache is empty. - */ - public pop(): V | undefined - - /** - * Deletes a key out of the cache. - * - * @deprecated since 7.0 use delete() instead - */ - public del(key: K): boolean - - /** - * Clear the cache entirely, throwing away all values. - * - * @deprecated since 7.0 use clear() instead - */ - public reset(): void - - /** - * Manually iterates over the entire cache proactively pruning old entries. - * - * @deprecated since 7.0 use purgeStale() instead - */ - public prune(): boolean - - /** - * Make an asynchronous cached fetch using the {@link fetchMethod} function. - * - * If multiple fetches for the same key are issued, then they will all be - * coalesced into a single call to fetchMethod. - * - * Note that this means that handling options such as - * {@link allowStaleOnFetchAbort}, {@link signal}, and - * {@link allowStaleOnFetchRejection} will be determined by the FIRST fetch() - * call for a given key. - * - * This is a known (fixable) shortcoming which will be addresed on when - * someone complains about it, as the fix would involve added complexity and - * may not be worth the costs for this edge case. - * - * since: 7.6.0 - */ - public fetch( - key: K, - options?: LRUCache.FetchOptions - ): Promise - - /** - * since: 7.6.0 - */ - public getRemainingTTL(key: K): LRUMilliseconds -} - -declare namespace LRUCache { - type DisposeReason = 'evict' | 'set' | 'delete' - - type SizeCalculator = (value: V, key: K) => LRUSize - type Disposer = ( - value: V, - key: K, - reason: DisposeReason - ) => void - type Fetcher = ( - key: K, - staleValue: V | undefined, - options: FetcherOptions - ) => Promise | V | void | undefined - - interface DeprecatedOptions { - /** - * alias for ttl - * - * @deprecated since 7.0 use options.ttl instead - */ - maxAge?: LRUMilliseconds - - /** - * alias for {@link sizeCalculation} - * - * @deprecated since 7.0 use {@link sizeCalculation} instead - */ - length?: SizeCalculator - - /** - * alias for allowStale - * - * @deprecated since 7.0 use options.allowStale instead - */ - stale?: boolean - } - - interface LimitedByCount { - /** - * The number of most recently used items to keep. - * Note that we may store fewer items than this if maxSize is hit. - */ - max: LRUCount - } - - type MaybeMaxEntrySizeLimit = - | { - /** - * The maximum allowed size for any single item in the cache. - * - * If a larger item is passed to {@link set} or returned by a - * {@link fetchMethod}, then it will not be stored in the cache. - */ - maxEntrySize: LRUSize - sizeCalculation?: SizeCalculator - } - | {} - - interface LimitedBySize { - /** - * If you wish to track item size, you must provide a maxSize - * note that we still will only keep up to max *actual items*, - * if max is set, so size tracking may cause fewer than max items - * to be stored. At the extreme, a single item of maxSize size - * will cause everything else in the cache to be dropped when it - * is added. Use with caution! - * - * Note also that size tracking can negatively impact performance, - * though for most cases, only minimally. - */ - maxSize: LRUSize - - /** - * Function to calculate size of items. Useful if storing strings or - * buffers or other items where memory size depends on the object itself. - * - * Items larger than {@link maxEntrySize} will not be stored in the cache. - * - * Note that when {@link maxSize} or {@link maxEntrySize} are set, every - * item added MUST have a size specified, either via a `sizeCalculation` in - * the constructor, or `sizeCalculation` or {@link size} options to - * {@link set}. - */ - sizeCalculation?: SizeCalculator - } - - interface LimitedByTTL { - /** - * Max time in milliseconds for items to live in cache before they are - * considered stale. Note that stale items are NOT preemptively removed - * by default, and MAY live in the cache, contributing to its LRU max, - * long after they have expired. - * - * Also, as this cache is optimized for LRU/MRU operations, some of - * the staleness/TTL checks will reduce performance, as they will incur - * overhead by deleting items. - * - * Must be an integer number of ms, defaults to 0, which means "no TTL" - */ - ttl: LRUMilliseconds - - /** - * Boolean flag to tell the cache to not update the TTL when - * setting a new value for an existing key (ie, when updating a value - * rather than inserting a new value). Note that the TTL value is - * _always_ set (if provided) when adding a new entry into the cache. - * - * @default false - * @since 7.4.0 - */ - noUpdateTTL?: boolean - - /** - * Minimum amount of time in ms in which to check for staleness. - * Defaults to 1, which means that the current time is checked - * at most once per millisecond. - * - * Set to 0 to check the current time every time staleness is tested. - * (This reduces performance, and is theoretically unnecessary.) - * - * Setting this to a higher value will improve performance somewhat - * while using ttl tracking, albeit at the expense of keeping stale - * items around a bit longer than their TTLs would indicate. - * - * @default 1 - * @since 7.1.0 - */ - ttlResolution?: LRUMilliseconds - - /** - * Preemptively remove stale items from the cache. - * Note that this may significantly degrade performance, - * especially if the cache is storing a large number of items. - * It is almost always best to just leave the stale items in - * the cache, and let them fall out as new items are added. - * - * Note that this means that {@link allowStale} is a bit pointless, - * as stale items will be deleted almost as soon as they expire. - * - * Use with caution! - * - * @default false - * @since 7.1.0 - */ - ttlAutopurge?: boolean - - /** - * Return stale items from {@link get} before disposing of them. - * Return stale values from {@link fetch} while performing a call - * to the {@link fetchMethod} in the background. - * - * @default false - */ - allowStale?: boolean - - /** - * Update the age of items on {@link get}, renewing their TTL - * - * @default false - */ - updateAgeOnGet?: boolean - - /** - * Do not delete stale items when they are retrieved with {@link get}. - * Note that the {@link get} return value will still be `undefined` unless - * allowStale is true. - * - * @default false - * @since 7.11.0 - */ - noDeleteOnStaleGet?: boolean - - /** - * Update the age of items on {@link has}, renewing their TTL - * - * @default false - */ - updateAgeOnHas?: boolean - } - - type SafetyBounds = - | LimitedByCount - | LimitedBySize - | LimitedByTTL - - // options shared by all three of the limiting scenarios - interface SharedOptions { - /** - * Function that is called on items when they are dropped from the cache. - * This can be handy if you want to close file descriptors or do other - * cleanup tasks when items are no longer accessible. Called with `key, - * value`. It's called before actually removing the item from the - * internal cache, so it is *NOT* safe to re-add them. - * Use {@link disposeAfter} if you wish to dispose items after they have - * been full removed, when it is safe to add them back to the cache. - */ - dispose?: Disposer - - /** - * The same as dispose, but called *after* the entry is completely - * removed and the cache is once again in a clean state. It is safe to - * add an item right back into the cache at this point. - * However, note that it is *very* easy to inadvertently create infinite - * recursion this way. - * - * @since 7.3.0 - */ - disposeAfter?: Disposer - - /** - * Set to true to suppress calling the dispose() function if the entry - * key is still accessible within the cache. - * This may be overridden by passing an options object to {@link set}. - * - * @default false - */ - noDisposeOnSet?: boolean - - /** - * Function that is used to make background asynchronous fetches. Called - * with `fetchMethod(key, staleValue, { signal, options, context })`. - * - * If `fetchMethod` is not provided, then {@link fetch} is - * equivalent to `Promise.resolve(cache.get(key))`. - * - * The `fetchMethod` should ONLY return `undefined` in cases where the - * abort controller has sent an abort signal. - * - * @since 7.6.0 - */ - fetchMethod?: LRUCache.Fetcher - - /** - * Set to true to suppress the deletion of stale data when a - * {@link fetchMethod} throws an error or returns a rejected promise - * - * This may be overridden in the {@link fetchMethod}. - * - * @default false - * @since 7.10.0 - */ - noDeleteOnFetchRejection?: boolean - - /** - * Set to true to allow returning stale data when a {@link fetchMethod} - * throws an error or returns a rejected promise. Note that this - * differs from using {@link allowStale} in that stale data will - * ONLY be returned in the case that the fetch fails, not any other - * times. - * - * This may be overridden in the {@link fetchMethod}. - * - * @default false - * @since 7.16.0 - */ - allowStaleOnFetchRejection?: boolean - - /** - * - * Set to true to ignore the `abort` event emitted by the `AbortSignal` - * object passed to {@link fetchMethod}, and still cache the - * resulting resolution value, as long as it is not `undefined`. - * - * When used on its own, this means aborted {@link fetch} calls are not - * immediately resolved or rejected when they are aborted, and instead take - * the full time to await. - * - * When used with {@link allowStaleOnFetchAbort}, aborted {@link fetch} - * calls will resolve immediately to their stale cached value or - * `undefined`, and will continue to process and eventually update the - * cache when they resolve, as long as the resulting value is not - * `undefined`, thus supporting a "return stale on timeout while - * refreshing" mechanism by passing `AbortSignal.timeout(n)` as the signal. - * - * **Note**: regardless of this setting, an `abort` event _is still emitted - * on the `AbortSignal` object_, so may result in invalid results when - * passed to other underlying APIs that use AbortSignals. - * - * This may be overridden in the {@link fetchMethod} or the call to - * {@link fetch}. - * - * @default false - * @since 7.17.0 - */ - ignoreFetchAbort?: boolean - - /** - * Set to true to return a stale value from the cache when the - * `AbortSignal` passed to the {@link fetchMethod} dispatches an `'abort'` - * event, whether user-triggered, or due to internal cache behavior. - * - * Unless {@link ignoreFetchAbort} is also set, the underlying - * {@link fetchMethod} will still be considered canceled, and its return - * value will be ignored and not cached. - * - * This may be overridden in the {@link fetchMethod} or the call to - * {@link fetch}. - * - * @default false - * @since 7.17.0 - */ - allowStaleOnFetchAbort?: boolean - - /** - * Set to any value in the constructor or {@link fetch} options to - * pass arbitrary data to the {@link fetchMethod} in the {@link context} - * options field. - * - * @since 7.12.0 - */ - fetchContext?: any - } - - type Options = SharedOptions & - DeprecatedOptions & - SafetyBounds & - MaybeMaxEntrySizeLimit - - /** - * options which override the options set in the LRUCache constructor - * when making calling {@link set}. - */ - interface SetOptions { - /** - * A value for the size of the entry, prevents calls to - * {@link sizeCalculation}. - * - * Items larger than {@link maxEntrySize} will not be stored in the cache. - * - * Note that when {@link maxSize} or {@link maxEntrySize} are set, every - * item added MUST have a size specified, either via a `sizeCalculation` in - * the constructor, or {@link sizeCalculation} or `size` options to - * {@link set}. - */ - size?: LRUSize - /** - * Overrides the {@link sizeCalculation} method set in the constructor. - * - * Items larger than {@link maxEntrySize} will not be stored in the cache. - * - * Note that when {@link maxSize} or {@link maxEntrySize} are set, every - * item added MUST have a size specified, either via a `sizeCalculation` in - * the constructor, or `sizeCalculation` or {@link size} options to - * {@link set}. - */ - sizeCalculation?: SizeCalculator - ttl?: LRUMilliseconds - start?: LRUMilliseconds - noDisposeOnSet?: boolean - noUpdateTTL?: boolean - status?: Status - } - - /** - * options which override the options set in the LRUCAche constructor - * when calling {@link has}. - */ - interface HasOptions { - updateAgeOnHas?: boolean - status: Status - } - - /** - * options which override the options set in the LRUCache constructor - * when calling {@link get}. - */ - interface GetOptions { - allowStale?: boolean - updateAgeOnGet?: boolean - noDeleteOnStaleGet?: boolean - status?: Status - } - - /** - * options which override the options set in the LRUCache constructor - * when calling {@link peek}. - */ - interface PeekOptions { - allowStale?: boolean - } - - /** - * Options object passed to the {@link fetchMethod} - * - * May be mutated by the {@link fetchMethod} to affect the behavior of the - * resulting {@link set} operation on resolution, or in the case of - * {@link noDeleteOnFetchRejection}, {@link ignoreFetchAbort}, and - * {@link allowStaleOnFetchRejection}, the handling of failure. - */ - interface FetcherFetchOptions { - allowStale?: boolean - updateAgeOnGet?: boolean - noDeleteOnStaleGet?: boolean - size?: LRUSize - sizeCalculation?: SizeCalculator - ttl?: LRUMilliseconds - noDisposeOnSet?: boolean - noUpdateTTL?: boolean - noDeleteOnFetchRejection?: boolean - allowStaleOnFetchRejection?: boolean - ignoreFetchAbort?: boolean - allowStaleOnFetchAbort?: boolean - status?: Status - } - - /** - * Status object that may be passed to {@link fetch}, {@link get}, - * {@link set}, and {@link has}. - */ - interface Status { - /** - * The status of a set() operation. - * - * - add: the item was not found in the cache, and was added - * - update: the item was in the cache, with the same value provided - * - replace: the item was in the cache, and replaced - * - miss: the item was not added to the cache for some reason - */ - set?: 'add' | 'update' | 'replace' | 'miss' - - /** - * the ttl stored for the item, or undefined if ttls are not used. - */ - ttl?: LRUMilliseconds - - /** - * the start time for the item, or undefined if ttls are not used. - */ - start?: LRUMilliseconds - - /** - * The timestamp used for TTL calculation - */ - now?: LRUMilliseconds - - /** - * the remaining ttl for the item, or undefined if ttls are not used. - */ - remainingTTL?: LRUMilliseconds - - /** - * The calculated size for the item, if sizes are used. - */ - size?: LRUSize - - /** - * A flag indicating that the item was not stored, due to exceeding the - * {@link maxEntrySize} - */ - maxEntrySizeExceeded?: true - - /** - * The old value, specified in the case of `set:'update'` or - * `set:'replace'` - */ - oldValue?: V - - /** - * The results of a {@link has} operation - * - * - hit: the item was found in the cache - * - stale: the item was found in the cache, but is stale - * - miss: the item was not found in the cache - */ - has?: 'hit' | 'stale' | 'miss' - - /** - * The status of a {@link fetch} operation. - * Note that this can change as the underlying fetch() moves through - * various states. - * - * - inflight: there is another fetch() for this key which is in process - * - get: there is no fetchMethod, so {@link get} was called. - * - miss: the item is not in cache, and will be fetched. - * - hit: the item is in the cache, and was resolved immediately. - * - stale: the item is in the cache, but stale. - * - refresh: the item is in the cache, and not stale, but - * {@link forceRefresh} was specified. - */ - fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh' - - /** - * The {@link fetchMethod} was called - */ - fetchDispatched?: true - - /** - * The cached value was updated after a successful call to fetchMethod - */ - fetchUpdated?: true - - /** - * The reason for a fetch() rejection. Either the error raised by the - * {@link fetchMethod}, or the reason for an AbortSignal. - */ - fetchError?: Error - - /** - * The fetch received an abort signal - */ - fetchAborted?: true - - /** - * The abort signal received was ignored, and the fetch was allowed to - * continue. - */ - fetchAbortIgnored?: true - - /** - * The fetchMethod promise resolved successfully - */ - fetchResolved?: true - - /** - * The fetchMethod promise was rejected - */ - fetchRejected?: true - - /** - * The status of a {@link get} operation. - * - * - fetching: The item is currently being fetched. If a previous value is - * present and allowed, that will be returned. - * - stale: The item is in the cache, and is stale. - * - hit: the item is in the cache - * - miss: the item is not in the cache - */ - get?: 'stale' | 'hit' | 'miss' - - /** - * A fetch or get operation returned a stale value. - */ - returnedStale?: true - } - - /** - * options which override the options set in the LRUCache constructor - * when calling {@link fetch}. - * - * This is the union of GetOptions and SetOptions, plus - * {@link noDeleteOnFetchRejection}, {@link allowStaleOnFetchRejection}, - * {@link forceRefresh}, and {@link fetchContext} - */ - interface FetchOptions extends FetcherFetchOptions { - forceRefresh?: boolean - fetchContext?: any - signal?: AbortSignal - status?: Status - } - - interface FetcherOptions { - signal: AbortSignal - options: FetcherFetchOptions - /** - * Object provided in the {@link fetchContext} option - */ - context: any - } - - interface Entry { - value: V - ttl?: LRUMilliseconds - size?: LRUSize - start?: LRUMilliseconds - } -} - -export = LRUCache diff --git a/node_modules/named-placeholders/node_modules/lru-cache/index.js b/node_modules/named-placeholders/node_modules/lru-cache/index.js deleted file mode 100644 index 48e99fe..0000000 --- a/node_modules/named-placeholders/node_modules/lru-cache/index.js +++ /dev/null @@ -1,1227 +0,0 @@ -const perf = - typeof performance === 'object' && - performance && - typeof performance.now === 'function' - ? performance - : Date - -const hasAbortController = typeof AbortController === 'function' - -// minimal backwards-compatibility polyfill -// this doesn't have nearly all the checks and whatnot that -// actual AbortController/Signal has, but it's enough for -// our purposes, and if used properly, behaves the same. -const AC = hasAbortController - ? AbortController - : class AbortController { - constructor() { - this.signal = new AS() - } - abort(reason = new Error('This operation was aborted')) { - this.signal.reason = this.signal.reason || reason - this.signal.aborted = true - this.signal.dispatchEvent({ - type: 'abort', - target: this.signal, - }) - } - } - -const hasAbortSignal = typeof AbortSignal === 'function' -// Some polyfills put this on the AC class, not global -const hasACAbortSignal = typeof AC.AbortSignal === 'function' -const AS = hasAbortSignal - ? AbortSignal - : hasACAbortSignal - ? AC.AbortController - : class AbortSignal { - constructor() { - this.reason = undefined - this.aborted = false - this._listeners = [] - } - dispatchEvent(e) { - if (e.type === 'abort') { - this.aborted = true - this.onabort(e) - this._listeners.forEach(f => f(e), this) - } - } - onabort() {} - addEventListener(ev, fn) { - if (ev === 'abort') { - this._listeners.push(fn) - } - } - removeEventListener(ev, fn) { - if (ev === 'abort') { - this._listeners = this._listeners.filter(f => f !== fn) - } - } - } - -const warned = new Set() -const deprecatedOption = (opt, instead) => { - const code = `LRU_CACHE_OPTION_${opt}` - if (shouldWarn(code)) { - warn(code, `${opt} option`, `options.${instead}`, LRUCache) - } -} -const deprecatedMethod = (method, instead) => { - const code = `LRU_CACHE_METHOD_${method}` - if (shouldWarn(code)) { - const { prototype } = LRUCache - const { get } = Object.getOwnPropertyDescriptor(prototype, method) - warn(code, `${method} method`, `cache.${instead}()`, get) - } -} -const deprecatedProperty = (field, instead) => { - const code = `LRU_CACHE_PROPERTY_${field}` - if (shouldWarn(code)) { - const { prototype } = LRUCache - const { get } = Object.getOwnPropertyDescriptor(prototype, field) - warn(code, `${field} property`, `cache.${instead}`, get) - } -} - -const emitWarning = (...a) => { - typeof process === 'object' && - process && - typeof process.emitWarning === 'function' - ? process.emitWarning(...a) - : console.error(...a) -} - -const shouldWarn = code => !warned.has(code) - -const warn = (code, what, instead, fn) => { - warned.add(code) - const msg = `The ${what} is deprecated. Please use ${instead} instead.` - emitWarning(msg, 'DeprecationWarning', code, fn) -} - -const isPosInt = n => n && n === Math.floor(n) && n > 0 && isFinite(n) - -/* istanbul ignore next - This is a little bit ridiculous, tbh. - * The maximum array length is 2^32-1 or thereabouts on most JS impls. - * And well before that point, you're caching the entire world, I mean, - * that's ~32GB of just integers for the next/prev links, plus whatever - * else to hold that many keys and values. Just filling the memory with - * zeroes at init time is brutal when you get that big. - * But why not be complete? - * Maybe in the future, these limits will have expanded. */ -const getUintArray = max => - !isPosInt(max) - ? null - : max <= Math.pow(2, 8) - ? Uint8Array - : max <= Math.pow(2, 16) - ? Uint16Array - : max <= Math.pow(2, 32) - ? Uint32Array - : max <= Number.MAX_SAFE_INTEGER - ? ZeroArray - : null - -class ZeroArray extends Array { - constructor(size) { - super(size) - this.fill(0) - } -} - -class Stack { - constructor(max) { - if (max === 0) { - return [] - } - const UintArray = getUintArray(max) - this.heap = new UintArray(max) - this.length = 0 - } - push(n) { - this.heap[this.length++] = n - } - pop() { - return this.heap[--this.length] - } -} - -class LRUCache { - constructor(options = {}) { - const { - max = 0, - ttl, - ttlResolution = 1, - ttlAutopurge, - updateAgeOnGet, - updateAgeOnHas, - allowStale, - dispose, - disposeAfter, - noDisposeOnSet, - noUpdateTTL, - maxSize = 0, - maxEntrySize = 0, - sizeCalculation, - fetchMethod, - fetchContext, - noDeleteOnFetchRejection, - noDeleteOnStaleGet, - allowStaleOnFetchRejection, - allowStaleOnFetchAbort, - ignoreFetchAbort, - } = options - - // deprecated options, don't trigger a warning for getting them if - // the thing being passed in is another LRUCache we're copying. - const { length, maxAge, stale } = - options instanceof LRUCache ? {} : options - - if (max !== 0 && !isPosInt(max)) { - throw new TypeError('max option must be a nonnegative integer') - } - - const UintArray = max ? getUintArray(max) : Array - if (!UintArray) { - throw new Error('invalid max value: ' + max) - } - - this.max = max - this.maxSize = maxSize - this.maxEntrySize = maxEntrySize || this.maxSize - this.sizeCalculation = sizeCalculation || length - if (this.sizeCalculation) { - if (!this.maxSize && !this.maxEntrySize) { - throw new TypeError( - 'cannot set sizeCalculation without setting maxSize or maxEntrySize' - ) - } - if (typeof this.sizeCalculation !== 'function') { - throw new TypeError('sizeCalculation set to non-function') - } - } - - this.fetchMethod = fetchMethod || null - if (this.fetchMethod && typeof this.fetchMethod !== 'function') { - throw new TypeError( - 'fetchMethod must be a function if specified' - ) - } - - this.fetchContext = fetchContext - if (!this.fetchMethod && fetchContext !== undefined) { - throw new TypeError( - 'cannot set fetchContext without fetchMethod' - ) - } - - this.keyMap = new Map() - this.keyList = new Array(max).fill(null) - this.valList = new Array(max).fill(null) - this.next = new UintArray(max) - this.prev = new UintArray(max) - this.head = 0 - this.tail = 0 - this.free = new Stack(max) - this.initialFill = 1 - this.size = 0 - - if (typeof dispose === 'function') { - this.dispose = dispose - } - if (typeof disposeAfter === 'function') { - this.disposeAfter = disposeAfter - this.disposed = [] - } else { - this.disposeAfter = null - this.disposed = null - } - this.noDisposeOnSet = !!noDisposeOnSet - this.noUpdateTTL = !!noUpdateTTL - this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection - this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection - this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort - this.ignoreFetchAbort = !!ignoreFetchAbort - - // NB: maxEntrySize is set to maxSize if it's set - if (this.maxEntrySize !== 0) { - if (this.maxSize !== 0) { - if (!isPosInt(this.maxSize)) { - throw new TypeError( - 'maxSize must be a positive integer if specified' - ) - } - } - if (!isPosInt(this.maxEntrySize)) { - throw new TypeError( - 'maxEntrySize must be a positive integer if specified' - ) - } - this.initializeSizeTracking() - } - - this.allowStale = !!allowStale || !!stale - this.noDeleteOnStaleGet = !!noDeleteOnStaleGet - this.updateAgeOnGet = !!updateAgeOnGet - this.updateAgeOnHas = !!updateAgeOnHas - this.ttlResolution = - isPosInt(ttlResolution) || ttlResolution === 0 - ? ttlResolution - : 1 - this.ttlAutopurge = !!ttlAutopurge - this.ttl = ttl || maxAge || 0 - if (this.ttl) { - if (!isPosInt(this.ttl)) { - throw new TypeError( - 'ttl must be a positive integer if specified' - ) - } - this.initializeTTLTracking() - } - - // do not allow completely unbounded caches - if (this.max === 0 && this.ttl === 0 && this.maxSize === 0) { - throw new TypeError( - 'At least one of max, maxSize, or ttl is required' - ) - } - if (!this.ttlAutopurge && !this.max && !this.maxSize) { - const code = 'LRU_CACHE_UNBOUNDED' - if (shouldWarn(code)) { - warned.add(code) - const msg = - 'TTL caching without ttlAutopurge, max, or maxSize can ' + - 'result in unbounded memory consumption.' - emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache) - } - } - - if (stale) { - deprecatedOption('stale', 'allowStale') - } - if (maxAge) { - deprecatedOption('maxAge', 'ttl') - } - if (length) { - deprecatedOption('length', 'sizeCalculation') - } - } - - getRemainingTTL(key) { - return this.has(key, { updateAgeOnHas: false }) ? Infinity : 0 - } - - initializeTTLTracking() { - this.ttls = new ZeroArray(this.max) - this.starts = new ZeroArray(this.max) - - this.setItemTTL = (index, ttl, start = perf.now()) => { - this.starts[index] = ttl !== 0 ? start : 0 - this.ttls[index] = ttl - if (ttl !== 0 && this.ttlAutopurge) { - const t = setTimeout(() => { - if (this.isStale(index)) { - this.delete(this.keyList[index]) - } - }, ttl + 1) - /* istanbul ignore else - unref() not supported on all platforms */ - if (t.unref) { - t.unref() - } - } - } - - this.updateItemAge = index => { - this.starts[index] = this.ttls[index] !== 0 ? perf.now() : 0 - } - - this.statusTTL = (status, index) => { - if (status) { - status.ttl = this.ttls[index] - status.start = this.starts[index] - status.now = cachedNow || getNow() - status.remainingTTL = status.now + status.ttl - status.start - } - } - - // debounce calls to perf.now() to 1s so we're not hitting - // that costly call repeatedly. - let cachedNow = 0 - const getNow = () => { - const n = perf.now() - if (this.ttlResolution > 0) { - cachedNow = n - const t = setTimeout( - () => (cachedNow = 0), - this.ttlResolution - ) - /* istanbul ignore else - not available on all platforms */ - if (t.unref) { - t.unref() - } - } - return n - } - - this.getRemainingTTL = key => { - const index = this.keyMap.get(key) - if (index === undefined) { - return 0 - } - return this.ttls[index] === 0 || this.starts[index] === 0 - ? Infinity - : this.starts[index] + - this.ttls[index] - - (cachedNow || getNow()) - } - - this.isStale = index => { - return ( - this.ttls[index] !== 0 && - this.starts[index] !== 0 && - (cachedNow || getNow()) - this.starts[index] > - this.ttls[index] - ) - } - } - updateItemAge(_index) {} - statusTTL(_status, _index) {} - setItemTTL(_index, _ttl, _start) {} - isStale(_index) { - return false - } - - initializeSizeTracking() { - this.calculatedSize = 0 - this.sizes = new ZeroArray(this.max) - this.removeItemSize = index => { - this.calculatedSize -= this.sizes[index] - this.sizes[index] = 0 - } - this.requireSize = (k, v, size, sizeCalculation) => { - // provisionally accept background fetches. - // actual value size will be checked when they return. - if (this.isBackgroundFetch(v)) { - return 0 - } - if (!isPosInt(size)) { - if (sizeCalculation) { - if (typeof sizeCalculation !== 'function') { - throw new TypeError('sizeCalculation must be a function') - } - size = sizeCalculation(v, k) - if (!isPosInt(size)) { - throw new TypeError( - 'sizeCalculation return invalid (expect positive integer)' - ) - } - } else { - throw new TypeError( - 'invalid size value (must be positive integer). ' + - 'When maxSize or maxEntrySize is used, sizeCalculation or size ' + - 'must be set.' - ) - } - } - return size - } - this.addItemSize = (index, size, status) => { - this.sizes[index] = size - if (this.maxSize) { - const maxSize = this.maxSize - this.sizes[index] - while (this.calculatedSize > maxSize) { - this.evict(true) - } - } - this.calculatedSize += this.sizes[index] - if (status) { - status.entrySize = size - status.totalCalculatedSize = this.calculatedSize - } - } - } - removeItemSize(_index) {} - addItemSize(_index, _size) {} - requireSize(_k, _v, size, sizeCalculation) { - if (size || sizeCalculation) { - throw new TypeError( - 'cannot set size without setting maxSize or maxEntrySize on cache' - ) - } - } - - *indexes({ allowStale = this.allowStale } = {}) { - if (this.size) { - for (let i = this.tail; true; ) { - if (!this.isValidIndex(i)) { - break - } - if (allowStale || !this.isStale(i)) { - yield i - } - if (i === this.head) { - break - } else { - i = this.prev[i] - } - } - } - } - - *rindexes({ allowStale = this.allowStale } = {}) { - if (this.size) { - for (let i = this.head; true; ) { - if (!this.isValidIndex(i)) { - break - } - if (allowStale || !this.isStale(i)) { - yield i - } - if (i === this.tail) { - break - } else { - i = this.next[i] - } - } - } - } - - isValidIndex(index) { - return ( - index !== undefined && - this.keyMap.get(this.keyList[index]) === index - ) - } - - *entries() { - for (const i of this.indexes()) { - if ( - this.valList[i] !== undefined && - this.keyList[i] !== undefined && - !this.isBackgroundFetch(this.valList[i]) - ) { - yield [this.keyList[i], this.valList[i]] - } - } - } - *rentries() { - for (const i of this.rindexes()) { - if ( - this.valList[i] !== undefined && - this.keyList[i] !== undefined && - !this.isBackgroundFetch(this.valList[i]) - ) { - yield [this.keyList[i], this.valList[i]] - } - } - } - - *keys() { - for (const i of this.indexes()) { - if ( - this.keyList[i] !== undefined && - !this.isBackgroundFetch(this.valList[i]) - ) { - yield this.keyList[i] - } - } - } - *rkeys() { - for (const i of this.rindexes()) { - if ( - this.keyList[i] !== undefined && - !this.isBackgroundFetch(this.valList[i]) - ) { - yield this.keyList[i] - } - } - } - - *values() { - for (const i of this.indexes()) { - if ( - this.valList[i] !== undefined && - !this.isBackgroundFetch(this.valList[i]) - ) { - yield this.valList[i] - } - } - } - *rvalues() { - for (const i of this.rindexes()) { - if ( - this.valList[i] !== undefined && - !this.isBackgroundFetch(this.valList[i]) - ) { - yield this.valList[i] - } - } - } - - [Symbol.iterator]() { - return this.entries() - } - - find(fn, getOptions) { - for (const i of this.indexes()) { - const v = this.valList[i] - const value = this.isBackgroundFetch(v) - ? v.__staleWhileFetching - : v - if (value === undefined) continue - if (fn(value, this.keyList[i], this)) { - return this.get(this.keyList[i], getOptions) - } - } - } - - forEach(fn, thisp = this) { - for (const i of this.indexes()) { - const v = this.valList[i] - const value = this.isBackgroundFetch(v) - ? v.__staleWhileFetching - : v - if (value === undefined) continue - fn.call(thisp, value, this.keyList[i], this) - } - } - - rforEach(fn, thisp = this) { - for (const i of this.rindexes()) { - const v = this.valList[i] - const value = this.isBackgroundFetch(v) - ? v.__staleWhileFetching - : v - if (value === undefined) continue - fn.call(thisp, value, this.keyList[i], this) - } - } - - get prune() { - deprecatedMethod('prune', 'purgeStale') - return this.purgeStale - } - - purgeStale() { - let deleted = false - for (const i of this.rindexes({ allowStale: true })) { - if (this.isStale(i)) { - this.delete(this.keyList[i]) - deleted = true - } - } - return deleted - } - - dump() { - const arr = [] - for (const i of this.indexes({ allowStale: true })) { - const key = this.keyList[i] - const v = this.valList[i] - const value = this.isBackgroundFetch(v) - ? v.__staleWhileFetching - : v - if (value === undefined) continue - const entry = { value } - if (this.ttls) { - entry.ttl = this.ttls[i] - // always dump the start relative to a portable timestamp - // it's ok for this to be a bit slow, it's a rare operation. - const age = perf.now() - this.starts[i] - entry.start = Math.floor(Date.now() - age) - } - if (this.sizes) { - entry.size = this.sizes[i] - } - arr.unshift([key, entry]) - } - return arr - } - - load(arr) { - this.clear() - for (const [key, entry] of arr) { - if (entry.start) { - // entry.start is a portable timestamp, but we may be using - // node's performance.now(), so calculate the offset. - // it's ok for this to be a bit slow, it's a rare operation. - const age = Date.now() - entry.start - entry.start = perf.now() - age - } - this.set(key, entry.value, entry) - } - } - - dispose(_v, _k, _reason) {} - - set( - k, - v, - { - ttl = this.ttl, - start, - noDisposeOnSet = this.noDisposeOnSet, - size = 0, - sizeCalculation = this.sizeCalculation, - noUpdateTTL = this.noUpdateTTL, - status, - } = {} - ) { - size = this.requireSize(k, v, size, sizeCalculation) - // if the item doesn't fit, don't do anything - // NB: maxEntrySize set to maxSize by default - if (this.maxEntrySize && size > this.maxEntrySize) { - if (status) { - status.set = 'miss' - status.maxEntrySizeExceeded = true - } - // have to delete, in case a background fetch is there already. - // in non-async cases, this is a no-op - this.delete(k) - return this - } - let index = this.size === 0 ? undefined : this.keyMap.get(k) - if (index === undefined) { - // addition - index = this.newIndex() - this.keyList[index] = k - this.valList[index] = v - this.keyMap.set(k, index) - this.next[this.tail] = index - this.prev[index] = this.tail - this.tail = index - this.size++ - this.addItemSize(index, size, status) - if (status) { - status.set = 'add' - } - noUpdateTTL = false - } else { - // update - this.moveToTail(index) - const oldVal = this.valList[index] - if (v !== oldVal) { - if (this.isBackgroundFetch(oldVal)) { - oldVal.__abortController.abort(new Error('replaced')) - } else { - if (!noDisposeOnSet) { - this.dispose(oldVal, k, 'set') - if (this.disposeAfter) { - this.disposed.push([oldVal, k, 'set']) - } - } - } - this.removeItemSize(index) - this.valList[index] = v - this.addItemSize(index, size, status) - if (status) { - status.set = 'replace' - const oldValue = - oldVal && this.isBackgroundFetch(oldVal) - ? oldVal.__staleWhileFetching - : oldVal - if (oldValue !== undefined) status.oldValue = oldValue - } - } else if (status) { - status.set = 'update' - } - } - if (ttl !== 0 && this.ttl === 0 && !this.ttls) { - this.initializeTTLTracking() - } - if (!noUpdateTTL) { - this.setItemTTL(index, ttl, start) - } - this.statusTTL(status, index) - if (this.disposeAfter) { - while (this.disposed.length) { - this.disposeAfter(...this.disposed.shift()) - } - } - return this - } - - newIndex() { - if (this.size === 0) { - return this.tail - } - if (this.size === this.max && this.max !== 0) { - return this.evict(false) - } - if (this.free.length !== 0) { - return this.free.pop() - } - // initial fill, just keep writing down the list - return this.initialFill++ - } - - pop() { - if (this.size) { - const val = this.valList[this.head] - this.evict(true) - return val - } - } - - evict(free) { - const head = this.head - const k = this.keyList[head] - const v = this.valList[head] - if (this.isBackgroundFetch(v)) { - v.__abortController.abort(new Error('evicted')) - } else { - this.dispose(v, k, 'evict') - if (this.disposeAfter) { - this.disposed.push([v, k, 'evict']) - } - } - this.removeItemSize(head) - // if we aren't about to use the index, then null these out - if (free) { - this.keyList[head] = null - this.valList[head] = null - this.free.push(head) - } - this.head = this.next[head] - this.keyMap.delete(k) - this.size-- - return head - } - - has(k, { updateAgeOnHas = this.updateAgeOnHas, status } = {}) { - const index = this.keyMap.get(k) - if (index !== undefined) { - if (!this.isStale(index)) { - if (updateAgeOnHas) { - this.updateItemAge(index) - } - if (status) status.has = 'hit' - this.statusTTL(status, index) - return true - } else if (status) { - status.has = 'stale' - this.statusTTL(status, index) - } - } else if (status) { - status.has = 'miss' - } - return false - } - - // like get(), but without any LRU updating or TTL expiration - peek(k, { allowStale = this.allowStale } = {}) { - const index = this.keyMap.get(k) - if (index !== undefined && (allowStale || !this.isStale(index))) { - const v = this.valList[index] - // either stale and allowed, or forcing a refresh of non-stale value - return this.isBackgroundFetch(v) ? v.__staleWhileFetching : v - } - } - - backgroundFetch(k, index, options, context) { - const v = index === undefined ? undefined : this.valList[index] - if (this.isBackgroundFetch(v)) { - return v - } - const ac = new AC() - if (options.signal) { - options.signal.addEventListener('abort', () => - ac.abort(options.signal.reason) - ) - } - const fetchOpts = { - signal: ac.signal, - options, - context, - } - const cb = (v, updateCache = false) => { - const { aborted } = ac.signal - const ignoreAbort = options.ignoreFetchAbort && v !== undefined - if (options.status) { - if (aborted && !updateCache) { - options.status.fetchAborted = true - options.status.fetchError = ac.signal.reason - if (ignoreAbort) options.status.fetchAbortIgnored = true - } else { - options.status.fetchResolved = true - } - } - if (aborted && !ignoreAbort && !updateCache) { - return fetchFail(ac.signal.reason) - } - // either we didn't abort, and are still here, or we did, and ignored - if (this.valList[index] === p) { - if (v === undefined) { - if (p.__staleWhileFetching) { - this.valList[index] = p.__staleWhileFetching - } else { - this.delete(k) - } - } else { - if (options.status) options.status.fetchUpdated = true - this.set(k, v, fetchOpts.options) - } - } - return v - } - const eb = er => { - if (options.status) { - options.status.fetchRejected = true - options.status.fetchError = er - } - return fetchFail(er) - } - const fetchFail = er => { - const { aborted } = ac.signal - const allowStaleAborted = - aborted && options.allowStaleOnFetchAbort - const allowStale = - allowStaleAborted || options.allowStaleOnFetchRejection - const noDelete = allowStale || options.noDeleteOnFetchRejection - if (this.valList[index] === p) { - // if we allow stale on fetch rejections, then we need to ensure that - // the stale value is not removed from the cache when the fetch fails. - const del = !noDelete || p.__staleWhileFetching === undefined - if (del) { - this.delete(k) - } else if (!allowStaleAborted) { - // still replace the *promise* with the stale value, - // since we are done with the promise at this point. - // leave it untouched if we're still waiting for an - // aborted background fetch that hasn't yet returned. - this.valList[index] = p.__staleWhileFetching - } - } - if (allowStale) { - if (options.status && p.__staleWhileFetching !== undefined) { - options.status.returnedStale = true - } - return p.__staleWhileFetching - } else if (p.__returned === p) { - throw er - } - } - const pcall = (res, rej) => { - this.fetchMethod(k, v, fetchOpts).then(v => res(v), rej) - // ignored, we go until we finish, regardless. - // defer check until we are actually aborting, - // so fetchMethod can override. - ac.signal.addEventListener('abort', () => { - if ( - !options.ignoreFetchAbort || - options.allowStaleOnFetchAbort - ) { - res() - // when it eventually resolves, update the cache. - if (options.allowStaleOnFetchAbort) { - res = v => cb(v, true) - } - } - }) - } - if (options.status) options.status.fetchDispatched = true - const p = new Promise(pcall).then(cb, eb) - p.__abortController = ac - p.__staleWhileFetching = v - p.__returned = null - if (index === undefined) { - // internal, don't expose status. - this.set(k, p, { ...fetchOpts.options, status: undefined }) - index = this.keyMap.get(k) - } else { - this.valList[index] = p - } - return p - } - - isBackgroundFetch(p) { - return ( - p && - typeof p === 'object' && - typeof p.then === 'function' && - Object.prototype.hasOwnProperty.call( - p, - '__staleWhileFetching' - ) && - Object.prototype.hasOwnProperty.call(p, '__returned') && - (p.__returned === p || p.__returned === null) - ) - } - - // this takes the union of get() and set() opts, because it does both - async fetch( - k, - { - // get options - allowStale = this.allowStale, - updateAgeOnGet = this.updateAgeOnGet, - noDeleteOnStaleGet = this.noDeleteOnStaleGet, - // set options - ttl = this.ttl, - noDisposeOnSet = this.noDisposeOnSet, - size = 0, - sizeCalculation = this.sizeCalculation, - noUpdateTTL = this.noUpdateTTL, - // fetch exclusive options - noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, - allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, - ignoreFetchAbort = this.ignoreFetchAbort, - allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, - fetchContext = this.fetchContext, - forceRefresh = false, - status, - signal, - } = {} - ) { - if (!this.fetchMethod) { - if (status) status.fetch = 'get' - return this.get(k, { - allowStale, - updateAgeOnGet, - noDeleteOnStaleGet, - status, - }) - } - - const options = { - allowStale, - updateAgeOnGet, - noDeleteOnStaleGet, - ttl, - noDisposeOnSet, - size, - sizeCalculation, - noUpdateTTL, - noDeleteOnFetchRejection, - allowStaleOnFetchRejection, - allowStaleOnFetchAbort, - ignoreFetchAbort, - status, - signal, - } - - let index = this.keyMap.get(k) - if (index === undefined) { - if (status) status.fetch = 'miss' - const p = this.backgroundFetch(k, index, options, fetchContext) - return (p.__returned = p) - } else { - // in cache, maybe already fetching - const v = this.valList[index] - if (this.isBackgroundFetch(v)) { - const stale = - allowStale && v.__staleWhileFetching !== undefined - if (status) { - status.fetch = 'inflight' - if (stale) status.returnedStale = true - } - return stale ? v.__staleWhileFetching : (v.__returned = v) - } - - // if we force a refresh, that means do NOT serve the cached value, - // unless we are already in the process of refreshing the cache. - const isStale = this.isStale(index) - if (!forceRefresh && !isStale) { - if (status) status.fetch = 'hit' - this.moveToTail(index) - if (updateAgeOnGet) { - this.updateItemAge(index) - } - this.statusTTL(status, index) - return v - } - - // ok, it is stale or a forced refresh, and not already fetching. - // refresh the cache. - const p = this.backgroundFetch(k, index, options, fetchContext) - const hasStale = p.__staleWhileFetching !== undefined - const staleVal = hasStale && allowStale - if (status) { - status.fetch = hasStale && isStale ? 'stale' : 'refresh' - if (staleVal && isStale) status.returnedStale = true - } - return staleVal ? p.__staleWhileFetching : (p.__returned = p) - } - } - - get( - k, - { - allowStale = this.allowStale, - updateAgeOnGet = this.updateAgeOnGet, - noDeleteOnStaleGet = this.noDeleteOnStaleGet, - status, - } = {} - ) { - const index = this.keyMap.get(k) - if (index !== undefined) { - const value = this.valList[index] - const fetching = this.isBackgroundFetch(value) - this.statusTTL(status, index) - if (this.isStale(index)) { - if (status) status.get = 'stale' - // delete only if not an in-flight background fetch - if (!fetching) { - if (!noDeleteOnStaleGet) { - this.delete(k) - } - if (status) status.returnedStale = allowStale - return allowStale ? value : undefined - } else { - if (status) { - status.returnedStale = - allowStale && value.__staleWhileFetching !== undefined - } - return allowStale ? value.__staleWhileFetching : undefined - } - } else { - if (status) status.get = 'hit' - // if we're currently fetching it, we don't actually have it yet - // it's not stale, which means this isn't a staleWhileRefetching. - // If it's not stale, and fetching, AND has a __staleWhileFetching - // value, then that means the user fetched with {forceRefresh:true}, - // so it's safe to return that value. - if (fetching) { - return value.__staleWhileFetching - } - this.moveToTail(index) - if (updateAgeOnGet) { - this.updateItemAge(index) - } - return value - } - } else if (status) { - status.get = 'miss' - } - } - - connect(p, n) { - this.prev[n] = p - this.next[p] = n - } - - moveToTail(index) { - // if tail already, nothing to do - // if head, move head to next[index] - // else - // move next[prev[index]] to next[index] (head has no prev) - // move prev[next[index]] to prev[index] - // prev[index] = tail - // next[tail] = index - // tail = index - if (index !== this.tail) { - if (index === this.head) { - this.head = this.next[index] - } else { - this.connect(this.prev[index], this.next[index]) - } - this.connect(this.tail, index) - this.tail = index - } - } - - get del() { - deprecatedMethod('del', 'delete') - return this.delete - } - - delete(k) { - let deleted = false - if (this.size !== 0) { - const index = this.keyMap.get(k) - if (index !== undefined) { - deleted = true - if (this.size === 1) { - this.clear() - } else { - this.removeItemSize(index) - const v = this.valList[index] - if (this.isBackgroundFetch(v)) { - v.__abortController.abort(new Error('deleted')) - } else { - this.dispose(v, k, 'delete') - if (this.disposeAfter) { - this.disposed.push([v, k, 'delete']) - } - } - this.keyMap.delete(k) - this.keyList[index] = null - this.valList[index] = null - if (index === this.tail) { - this.tail = this.prev[index] - } else if (index === this.head) { - this.head = this.next[index] - } else { - this.next[this.prev[index]] = this.next[index] - this.prev[this.next[index]] = this.prev[index] - } - this.size-- - this.free.push(index) - } - } - } - if (this.disposed) { - while (this.disposed.length) { - this.disposeAfter(...this.disposed.shift()) - } - } - return deleted - } - - clear() { - for (const index of this.rindexes({ allowStale: true })) { - const v = this.valList[index] - if (this.isBackgroundFetch(v)) { - v.__abortController.abort(new Error('deleted')) - } else { - const k = this.keyList[index] - this.dispose(v, k, 'delete') - if (this.disposeAfter) { - this.disposed.push([v, k, 'delete']) - } - } - } - - this.keyMap.clear() - this.valList.fill(null) - this.keyList.fill(null) - if (this.ttls) { - this.ttls.fill(0) - this.starts.fill(0) - } - if (this.sizes) { - this.sizes.fill(0) - } - this.head = 0 - this.tail = 0 - this.initialFill = 1 - this.free.length = 0 - this.calculatedSize = 0 - this.size = 0 - if (this.disposed) { - while (this.disposed.length) { - this.disposeAfter(...this.disposed.shift()) - } - } - } - - get reset() { - deprecatedMethod('reset', 'clear') - return this.clear - } - - get length() { - deprecatedProperty('length', 'size') - return this.size - } - - static get AbortController() { - return AC - } - static get AbortSignal() { - return AS - } -} - -module.exports = LRUCache diff --git a/node_modules/named-placeholders/node_modules/lru-cache/index.mjs b/node_modules/named-placeholders/node_modules/lru-cache/index.mjs deleted file mode 100644 index 4a0b481..0000000 --- a/node_modules/named-placeholders/node_modules/lru-cache/index.mjs +++ /dev/null @@ -1,1227 +0,0 @@ -const perf = - typeof performance === 'object' && - performance && - typeof performance.now === 'function' - ? performance - : Date - -const hasAbortController = typeof AbortController === 'function' - -// minimal backwards-compatibility polyfill -// this doesn't have nearly all the checks and whatnot that -// actual AbortController/Signal has, but it's enough for -// our purposes, and if used properly, behaves the same. -const AC = hasAbortController - ? AbortController - : class AbortController { - constructor() { - this.signal = new AS() - } - abort(reason = new Error('This operation was aborted')) { - this.signal.reason = this.signal.reason || reason - this.signal.aborted = true - this.signal.dispatchEvent({ - type: 'abort', - target: this.signal, - }) - } - } - -const hasAbortSignal = typeof AbortSignal === 'function' -// Some polyfills put this on the AC class, not global -const hasACAbortSignal = typeof AC.AbortSignal === 'function' -const AS = hasAbortSignal - ? AbortSignal - : hasACAbortSignal - ? AC.AbortController - : class AbortSignal { - constructor() { - this.reason = undefined - this.aborted = false - this._listeners = [] - } - dispatchEvent(e) { - if (e.type === 'abort') { - this.aborted = true - this.onabort(e) - this._listeners.forEach(f => f(e), this) - } - } - onabort() {} - addEventListener(ev, fn) { - if (ev === 'abort') { - this._listeners.push(fn) - } - } - removeEventListener(ev, fn) { - if (ev === 'abort') { - this._listeners = this._listeners.filter(f => f !== fn) - } - } - } - -const warned = new Set() -const deprecatedOption = (opt, instead) => { - const code = `LRU_CACHE_OPTION_${opt}` - if (shouldWarn(code)) { - warn(code, `${opt} option`, `options.${instead}`, LRUCache) - } -} -const deprecatedMethod = (method, instead) => { - const code = `LRU_CACHE_METHOD_${method}` - if (shouldWarn(code)) { - const { prototype } = LRUCache - const { get } = Object.getOwnPropertyDescriptor(prototype, method) - warn(code, `${method} method`, `cache.${instead}()`, get) - } -} -const deprecatedProperty = (field, instead) => { - const code = `LRU_CACHE_PROPERTY_${field}` - if (shouldWarn(code)) { - const { prototype } = LRUCache - const { get } = Object.getOwnPropertyDescriptor(prototype, field) - warn(code, `${field} property`, `cache.${instead}`, get) - } -} - -const emitWarning = (...a) => { - typeof process === 'object' && - process && - typeof process.emitWarning === 'function' - ? process.emitWarning(...a) - : console.error(...a) -} - -const shouldWarn = code => !warned.has(code) - -const warn = (code, what, instead, fn) => { - warned.add(code) - const msg = `The ${what} is deprecated. Please use ${instead} instead.` - emitWarning(msg, 'DeprecationWarning', code, fn) -} - -const isPosInt = n => n && n === Math.floor(n) && n > 0 && isFinite(n) - -/* istanbul ignore next - This is a little bit ridiculous, tbh. - * The maximum array length is 2^32-1 or thereabouts on most JS impls. - * And well before that point, you're caching the entire world, I mean, - * that's ~32GB of just integers for the next/prev links, plus whatever - * else to hold that many keys and values. Just filling the memory with - * zeroes at init time is brutal when you get that big. - * But why not be complete? - * Maybe in the future, these limits will have expanded. */ -const getUintArray = max => - !isPosInt(max) - ? null - : max <= Math.pow(2, 8) - ? Uint8Array - : max <= Math.pow(2, 16) - ? Uint16Array - : max <= Math.pow(2, 32) - ? Uint32Array - : max <= Number.MAX_SAFE_INTEGER - ? ZeroArray - : null - -class ZeroArray extends Array { - constructor(size) { - super(size) - this.fill(0) - } -} - -class Stack { - constructor(max) { - if (max === 0) { - return [] - } - const UintArray = getUintArray(max) - this.heap = new UintArray(max) - this.length = 0 - } - push(n) { - this.heap[this.length++] = n - } - pop() { - return this.heap[--this.length] - } -} - -class LRUCache { - constructor(options = {}) { - const { - max = 0, - ttl, - ttlResolution = 1, - ttlAutopurge, - updateAgeOnGet, - updateAgeOnHas, - allowStale, - dispose, - disposeAfter, - noDisposeOnSet, - noUpdateTTL, - maxSize = 0, - maxEntrySize = 0, - sizeCalculation, - fetchMethod, - fetchContext, - noDeleteOnFetchRejection, - noDeleteOnStaleGet, - allowStaleOnFetchRejection, - allowStaleOnFetchAbort, - ignoreFetchAbort, - } = options - - // deprecated options, don't trigger a warning for getting them if - // the thing being passed in is another LRUCache we're copying. - const { length, maxAge, stale } = - options instanceof LRUCache ? {} : options - - if (max !== 0 && !isPosInt(max)) { - throw new TypeError('max option must be a nonnegative integer') - } - - const UintArray = max ? getUintArray(max) : Array - if (!UintArray) { - throw new Error('invalid max value: ' + max) - } - - this.max = max - this.maxSize = maxSize - this.maxEntrySize = maxEntrySize || this.maxSize - this.sizeCalculation = sizeCalculation || length - if (this.sizeCalculation) { - if (!this.maxSize && !this.maxEntrySize) { - throw new TypeError( - 'cannot set sizeCalculation without setting maxSize or maxEntrySize' - ) - } - if (typeof this.sizeCalculation !== 'function') { - throw new TypeError('sizeCalculation set to non-function') - } - } - - this.fetchMethod = fetchMethod || null - if (this.fetchMethod && typeof this.fetchMethod !== 'function') { - throw new TypeError( - 'fetchMethod must be a function if specified' - ) - } - - this.fetchContext = fetchContext - if (!this.fetchMethod && fetchContext !== undefined) { - throw new TypeError( - 'cannot set fetchContext without fetchMethod' - ) - } - - this.keyMap = new Map() - this.keyList = new Array(max).fill(null) - this.valList = new Array(max).fill(null) - this.next = new UintArray(max) - this.prev = new UintArray(max) - this.head = 0 - this.tail = 0 - this.free = new Stack(max) - this.initialFill = 1 - this.size = 0 - - if (typeof dispose === 'function') { - this.dispose = dispose - } - if (typeof disposeAfter === 'function') { - this.disposeAfter = disposeAfter - this.disposed = [] - } else { - this.disposeAfter = null - this.disposed = null - } - this.noDisposeOnSet = !!noDisposeOnSet - this.noUpdateTTL = !!noUpdateTTL - this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection - this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection - this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort - this.ignoreFetchAbort = !!ignoreFetchAbort - - // NB: maxEntrySize is set to maxSize if it's set - if (this.maxEntrySize !== 0) { - if (this.maxSize !== 0) { - if (!isPosInt(this.maxSize)) { - throw new TypeError( - 'maxSize must be a positive integer if specified' - ) - } - } - if (!isPosInt(this.maxEntrySize)) { - throw new TypeError( - 'maxEntrySize must be a positive integer if specified' - ) - } - this.initializeSizeTracking() - } - - this.allowStale = !!allowStale || !!stale - this.noDeleteOnStaleGet = !!noDeleteOnStaleGet - this.updateAgeOnGet = !!updateAgeOnGet - this.updateAgeOnHas = !!updateAgeOnHas - this.ttlResolution = - isPosInt(ttlResolution) || ttlResolution === 0 - ? ttlResolution - : 1 - this.ttlAutopurge = !!ttlAutopurge - this.ttl = ttl || maxAge || 0 - if (this.ttl) { - if (!isPosInt(this.ttl)) { - throw new TypeError( - 'ttl must be a positive integer if specified' - ) - } - this.initializeTTLTracking() - } - - // do not allow completely unbounded caches - if (this.max === 0 && this.ttl === 0 && this.maxSize === 0) { - throw new TypeError( - 'At least one of max, maxSize, or ttl is required' - ) - } - if (!this.ttlAutopurge && !this.max && !this.maxSize) { - const code = 'LRU_CACHE_UNBOUNDED' - if (shouldWarn(code)) { - warned.add(code) - const msg = - 'TTL caching without ttlAutopurge, max, or maxSize can ' + - 'result in unbounded memory consumption.' - emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache) - } - } - - if (stale) { - deprecatedOption('stale', 'allowStale') - } - if (maxAge) { - deprecatedOption('maxAge', 'ttl') - } - if (length) { - deprecatedOption('length', 'sizeCalculation') - } - } - - getRemainingTTL(key) { - return this.has(key, { updateAgeOnHas: false }) ? Infinity : 0 - } - - initializeTTLTracking() { - this.ttls = new ZeroArray(this.max) - this.starts = new ZeroArray(this.max) - - this.setItemTTL = (index, ttl, start = perf.now()) => { - this.starts[index] = ttl !== 0 ? start : 0 - this.ttls[index] = ttl - if (ttl !== 0 && this.ttlAutopurge) { - const t = setTimeout(() => { - if (this.isStale(index)) { - this.delete(this.keyList[index]) - } - }, ttl + 1) - /* istanbul ignore else - unref() not supported on all platforms */ - if (t.unref) { - t.unref() - } - } - } - - this.updateItemAge = index => { - this.starts[index] = this.ttls[index] !== 0 ? perf.now() : 0 - } - - this.statusTTL = (status, index) => { - if (status) { - status.ttl = this.ttls[index] - status.start = this.starts[index] - status.now = cachedNow || getNow() - status.remainingTTL = status.now + status.ttl - status.start - } - } - - // debounce calls to perf.now() to 1s so we're not hitting - // that costly call repeatedly. - let cachedNow = 0 - const getNow = () => { - const n = perf.now() - if (this.ttlResolution > 0) { - cachedNow = n - const t = setTimeout( - () => (cachedNow = 0), - this.ttlResolution - ) - /* istanbul ignore else - not available on all platforms */ - if (t.unref) { - t.unref() - } - } - return n - } - - this.getRemainingTTL = key => { - const index = this.keyMap.get(key) - if (index === undefined) { - return 0 - } - return this.ttls[index] === 0 || this.starts[index] === 0 - ? Infinity - : this.starts[index] + - this.ttls[index] - - (cachedNow || getNow()) - } - - this.isStale = index => { - return ( - this.ttls[index] !== 0 && - this.starts[index] !== 0 && - (cachedNow || getNow()) - this.starts[index] > - this.ttls[index] - ) - } - } - updateItemAge(_index) {} - statusTTL(_status, _index) {} - setItemTTL(_index, _ttl, _start) {} - isStale(_index) { - return false - } - - initializeSizeTracking() { - this.calculatedSize = 0 - this.sizes = new ZeroArray(this.max) - this.removeItemSize = index => { - this.calculatedSize -= this.sizes[index] - this.sizes[index] = 0 - } - this.requireSize = (k, v, size, sizeCalculation) => { - // provisionally accept background fetches. - // actual value size will be checked when they return. - if (this.isBackgroundFetch(v)) { - return 0 - } - if (!isPosInt(size)) { - if (sizeCalculation) { - if (typeof sizeCalculation !== 'function') { - throw new TypeError('sizeCalculation must be a function') - } - size = sizeCalculation(v, k) - if (!isPosInt(size)) { - throw new TypeError( - 'sizeCalculation return invalid (expect positive integer)' - ) - } - } else { - throw new TypeError( - 'invalid size value (must be positive integer). ' + - 'When maxSize or maxEntrySize is used, sizeCalculation or size ' + - 'must be set.' - ) - } - } - return size - } - this.addItemSize = (index, size, status) => { - this.sizes[index] = size - if (this.maxSize) { - const maxSize = this.maxSize - this.sizes[index] - while (this.calculatedSize > maxSize) { - this.evict(true) - } - } - this.calculatedSize += this.sizes[index] - if (status) { - status.entrySize = size - status.totalCalculatedSize = this.calculatedSize - } - } - } - removeItemSize(_index) {} - addItemSize(_index, _size) {} - requireSize(_k, _v, size, sizeCalculation) { - if (size || sizeCalculation) { - throw new TypeError( - 'cannot set size without setting maxSize or maxEntrySize on cache' - ) - } - } - - *indexes({ allowStale = this.allowStale } = {}) { - if (this.size) { - for (let i = this.tail; true; ) { - if (!this.isValidIndex(i)) { - break - } - if (allowStale || !this.isStale(i)) { - yield i - } - if (i === this.head) { - break - } else { - i = this.prev[i] - } - } - } - } - - *rindexes({ allowStale = this.allowStale } = {}) { - if (this.size) { - for (let i = this.head; true; ) { - if (!this.isValidIndex(i)) { - break - } - if (allowStale || !this.isStale(i)) { - yield i - } - if (i === this.tail) { - break - } else { - i = this.next[i] - } - } - } - } - - isValidIndex(index) { - return ( - index !== undefined && - this.keyMap.get(this.keyList[index]) === index - ) - } - - *entries() { - for (const i of this.indexes()) { - if ( - this.valList[i] !== undefined && - this.keyList[i] !== undefined && - !this.isBackgroundFetch(this.valList[i]) - ) { - yield [this.keyList[i], this.valList[i]] - } - } - } - *rentries() { - for (const i of this.rindexes()) { - if ( - this.valList[i] !== undefined && - this.keyList[i] !== undefined && - !this.isBackgroundFetch(this.valList[i]) - ) { - yield [this.keyList[i], this.valList[i]] - } - } - } - - *keys() { - for (const i of this.indexes()) { - if ( - this.keyList[i] !== undefined && - !this.isBackgroundFetch(this.valList[i]) - ) { - yield this.keyList[i] - } - } - } - *rkeys() { - for (const i of this.rindexes()) { - if ( - this.keyList[i] !== undefined && - !this.isBackgroundFetch(this.valList[i]) - ) { - yield this.keyList[i] - } - } - } - - *values() { - for (const i of this.indexes()) { - if ( - this.valList[i] !== undefined && - !this.isBackgroundFetch(this.valList[i]) - ) { - yield this.valList[i] - } - } - } - *rvalues() { - for (const i of this.rindexes()) { - if ( - this.valList[i] !== undefined && - !this.isBackgroundFetch(this.valList[i]) - ) { - yield this.valList[i] - } - } - } - - [Symbol.iterator]() { - return this.entries() - } - - find(fn, getOptions) { - for (const i of this.indexes()) { - const v = this.valList[i] - const value = this.isBackgroundFetch(v) - ? v.__staleWhileFetching - : v - if (value === undefined) continue - if (fn(value, this.keyList[i], this)) { - return this.get(this.keyList[i], getOptions) - } - } - } - - forEach(fn, thisp = this) { - for (const i of this.indexes()) { - const v = this.valList[i] - const value = this.isBackgroundFetch(v) - ? v.__staleWhileFetching - : v - if (value === undefined) continue - fn.call(thisp, value, this.keyList[i], this) - } - } - - rforEach(fn, thisp = this) { - for (const i of this.rindexes()) { - const v = this.valList[i] - const value = this.isBackgroundFetch(v) - ? v.__staleWhileFetching - : v - if (value === undefined) continue - fn.call(thisp, value, this.keyList[i], this) - } - } - - get prune() { - deprecatedMethod('prune', 'purgeStale') - return this.purgeStale - } - - purgeStale() { - let deleted = false - for (const i of this.rindexes({ allowStale: true })) { - if (this.isStale(i)) { - this.delete(this.keyList[i]) - deleted = true - } - } - return deleted - } - - dump() { - const arr = [] - for (const i of this.indexes({ allowStale: true })) { - const key = this.keyList[i] - const v = this.valList[i] - const value = this.isBackgroundFetch(v) - ? v.__staleWhileFetching - : v - if (value === undefined) continue - const entry = { value } - if (this.ttls) { - entry.ttl = this.ttls[i] - // always dump the start relative to a portable timestamp - // it's ok for this to be a bit slow, it's a rare operation. - const age = perf.now() - this.starts[i] - entry.start = Math.floor(Date.now() - age) - } - if (this.sizes) { - entry.size = this.sizes[i] - } - arr.unshift([key, entry]) - } - return arr - } - - load(arr) { - this.clear() - for (const [key, entry] of arr) { - if (entry.start) { - // entry.start is a portable timestamp, but we may be using - // node's performance.now(), so calculate the offset. - // it's ok for this to be a bit slow, it's a rare operation. - const age = Date.now() - entry.start - entry.start = perf.now() - age - } - this.set(key, entry.value, entry) - } - } - - dispose(_v, _k, _reason) {} - - set( - k, - v, - { - ttl = this.ttl, - start, - noDisposeOnSet = this.noDisposeOnSet, - size = 0, - sizeCalculation = this.sizeCalculation, - noUpdateTTL = this.noUpdateTTL, - status, - } = {} - ) { - size = this.requireSize(k, v, size, sizeCalculation) - // if the item doesn't fit, don't do anything - // NB: maxEntrySize set to maxSize by default - if (this.maxEntrySize && size > this.maxEntrySize) { - if (status) { - status.set = 'miss' - status.maxEntrySizeExceeded = true - } - // have to delete, in case a background fetch is there already. - // in non-async cases, this is a no-op - this.delete(k) - return this - } - let index = this.size === 0 ? undefined : this.keyMap.get(k) - if (index === undefined) { - // addition - index = this.newIndex() - this.keyList[index] = k - this.valList[index] = v - this.keyMap.set(k, index) - this.next[this.tail] = index - this.prev[index] = this.tail - this.tail = index - this.size++ - this.addItemSize(index, size, status) - if (status) { - status.set = 'add' - } - noUpdateTTL = false - } else { - // update - this.moveToTail(index) - const oldVal = this.valList[index] - if (v !== oldVal) { - if (this.isBackgroundFetch(oldVal)) { - oldVal.__abortController.abort(new Error('replaced')) - } else { - if (!noDisposeOnSet) { - this.dispose(oldVal, k, 'set') - if (this.disposeAfter) { - this.disposed.push([oldVal, k, 'set']) - } - } - } - this.removeItemSize(index) - this.valList[index] = v - this.addItemSize(index, size, status) - if (status) { - status.set = 'replace' - const oldValue = - oldVal && this.isBackgroundFetch(oldVal) - ? oldVal.__staleWhileFetching - : oldVal - if (oldValue !== undefined) status.oldValue = oldValue - } - } else if (status) { - status.set = 'update' - } - } - if (ttl !== 0 && this.ttl === 0 && !this.ttls) { - this.initializeTTLTracking() - } - if (!noUpdateTTL) { - this.setItemTTL(index, ttl, start) - } - this.statusTTL(status, index) - if (this.disposeAfter) { - while (this.disposed.length) { - this.disposeAfter(...this.disposed.shift()) - } - } - return this - } - - newIndex() { - if (this.size === 0) { - return this.tail - } - if (this.size === this.max && this.max !== 0) { - return this.evict(false) - } - if (this.free.length !== 0) { - return this.free.pop() - } - // initial fill, just keep writing down the list - return this.initialFill++ - } - - pop() { - if (this.size) { - const val = this.valList[this.head] - this.evict(true) - return val - } - } - - evict(free) { - const head = this.head - const k = this.keyList[head] - const v = this.valList[head] - if (this.isBackgroundFetch(v)) { - v.__abortController.abort(new Error('evicted')) - } else { - this.dispose(v, k, 'evict') - if (this.disposeAfter) { - this.disposed.push([v, k, 'evict']) - } - } - this.removeItemSize(head) - // if we aren't about to use the index, then null these out - if (free) { - this.keyList[head] = null - this.valList[head] = null - this.free.push(head) - } - this.head = this.next[head] - this.keyMap.delete(k) - this.size-- - return head - } - - has(k, { updateAgeOnHas = this.updateAgeOnHas, status } = {}) { - const index = this.keyMap.get(k) - if (index !== undefined) { - if (!this.isStale(index)) { - if (updateAgeOnHas) { - this.updateItemAge(index) - } - if (status) status.has = 'hit' - this.statusTTL(status, index) - return true - } else if (status) { - status.has = 'stale' - this.statusTTL(status, index) - } - } else if (status) { - status.has = 'miss' - } - return false - } - - // like get(), but without any LRU updating or TTL expiration - peek(k, { allowStale = this.allowStale } = {}) { - const index = this.keyMap.get(k) - if (index !== undefined && (allowStale || !this.isStale(index))) { - const v = this.valList[index] - // either stale and allowed, or forcing a refresh of non-stale value - return this.isBackgroundFetch(v) ? v.__staleWhileFetching : v - } - } - - backgroundFetch(k, index, options, context) { - const v = index === undefined ? undefined : this.valList[index] - if (this.isBackgroundFetch(v)) { - return v - } - const ac = new AC() - if (options.signal) { - options.signal.addEventListener('abort', () => - ac.abort(options.signal.reason) - ) - } - const fetchOpts = { - signal: ac.signal, - options, - context, - } - const cb = (v, updateCache = false) => { - const { aborted } = ac.signal - const ignoreAbort = options.ignoreFetchAbort && v !== undefined - if (options.status) { - if (aborted && !updateCache) { - options.status.fetchAborted = true - options.status.fetchError = ac.signal.reason - if (ignoreAbort) options.status.fetchAbortIgnored = true - } else { - options.status.fetchResolved = true - } - } - if (aborted && !ignoreAbort && !updateCache) { - return fetchFail(ac.signal.reason) - } - // either we didn't abort, and are still here, or we did, and ignored - if (this.valList[index] === p) { - if (v === undefined) { - if (p.__staleWhileFetching) { - this.valList[index] = p.__staleWhileFetching - } else { - this.delete(k) - } - } else { - if (options.status) options.status.fetchUpdated = true - this.set(k, v, fetchOpts.options) - } - } - return v - } - const eb = er => { - if (options.status) { - options.status.fetchRejected = true - options.status.fetchError = er - } - return fetchFail(er) - } - const fetchFail = er => { - const { aborted } = ac.signal - const allowStaleAborted = - aborted && options.allowStaleOnFetchAbort - const allowStale = - allowStaleAborted || options.allowStaleOnFetchRejection - const noDelete = allowStale || options.noDeleteOnFetchRejection - if (this.valList[index] === p) { - // if we allow stale on fetch rejections, then we need to ensure that - // the stale value is not removed from the cache when the fetch fails. - const del = !noDelete || p.__staleWhileFetching === undefined - if (del) { - this.delete(k) - } else if (!allowStaleAborted) { - // still replace the *promise* with the stale value, - // since we are done with the promise at this point. - // leave it untouched if we're still waiting for an - // aborted background fetch that hasn't yet returned. - this.valList[index] = p.__staleWhileFetching - } - } - if (allowStale) { - if (options.status && p.__staleWhileFetching !== undefined) { - options.status.returnedStale = true - } - return p.__staleWhileFetching - } else if (p.__returned === p) { - throw er - } - } - const pcall = (res, rej) => { - this.fetchMethod(k, v, fetchOpts).then(v => res(v), rej) - // ignored, we go until we finish, regardless. - // defer check until we are actually aborting, - // so fetchMethod can override. - ac.signal.addEventListener('abort', () => { - if ( - !options.ignoreFetchAbort || - options.allowStaleOnFetchAbort - ) { - res() - // when it eventually resolves, update the cache. - if (options.allowStaleOnFetchAbort) { - res = v => cb(v, true) - } - } - }) - } - if (options.status) options.status.fetchDispatched = true - const p = new Promise(pcall).then(cb, eb) - p.__abortController = ac - p.__staleWhileFetching = v - p.__returned = null - if (index === undefined) { - // internal, don't expose status. - this.set(k, p, { ...fetchOpts.options, status: undefined }) - index = this.keyMap.get(k) - } else { - this.valList[index] = p - } - return p - } - - isBackgroundFetch(p) { - return ( - p && - typeof p === 'object' && - typeof p.then === 'function' && - Object.prototype.hasOwnProperty.call( - p, - '__staleWhileFetching' - ) && - Object.prototype.hasOwnProperty.call(p, '__returned') && - (p.__returned === p || p.__returned === null) - ) - } - - // this takes the union of get() and set() opts, because it does both - async fetch( - k, - { - // get options - allowStale = this.allowStale, - updateAgeOnGet = this.updateAgeOnGet, - noDeleteOnStaleGet = this.noDeleteOnStaleGet, - // set options - ttl = this.ttl, - noDisposeOnSet = this.noDisposeOnSet, - size = 0, - sizeCalculation = this.sizeCalculation, - noUpdateTTL = this.noUpdateTTL, - // fetch exclusive options - noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, - allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, - ignoreFetchAbort = this.ignoreFetchAbort, - allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, - fetchContext = this.fetchContext, - forceRefresh = false, - status, - signal, - } = {} - ) { - if (!this.fetchMethod) { - if (status) status.fetch = 'get' - return this.get(k, { - allowStale, - updateAgeOnGet, - noDeleteOnStaleGet, - status, - }) - } - - const options = { - allowStale, - updateAgeOnGet, - noDeleteOnStaleGet, - ttl, - noDisposeOnSet, - size, - sizeCalculation, - noUpdateTTL, - noDeleteOnFetchRejection, - allowStaleOnFetchRejection, - allowStaleOnFetchAbort, - ignoreFetchAbort, - status, - signal, - } - - let index = this.keyMap.get(k) - if (index === undefined) { - if (status) status.fetch = 'miss' - const p = this.backgroundFetch(k, index, options, fetchContext) - return (p.__returned = p) - } else { - // in cache, maybe already fetching - const v = this.valList[index] - if (this.isBackgroundFetch(v)) { - const stale = - allowStale && v.__staleWhileFetching !== undefined - if (status) { - status.fetch = 'inflight' - if (stale) status.returnedStale = true - } - return stale ? v.__staleWhileFetching : (v.__returned = v) - } - - // if we force a refresh, that means do NOT serve the cached value, - // unless we are already in the process of refreshing the cache. - const isStale = this.isStale(index) - if (!forceRefresh && !isStale) { - if (status) status.fetch = 'hit' - this.moveToTail(index) - if (updateAgeOnGet) { - this.updateItemAge(index) - } - this.statusTTL(status, index) - return v - } - - // ok, it is stale or a forced refresh, and not already fetching. - // refresh the cache. - const p = this.backgroundFetch(k, index, options, fetchContext) - const hasStale = p.__staleWhileFetching !== undefined - const staleVal = hasStale && allowStale - if (status) { - status.fetch = hasStale && isStale ? 'stale' : 'refresh' - if (staleVal && isStale) status.returnedStale = true - } - return staleVal ? p.__staleWhileFetching : (p.__returned = p) - } - } - - get( - k, - { - allowStale = this.allowStale, - updateAgeOnGet = this.updateAgeOnGet, - noDeleteOnStaleGet = this.noDeleteOnStaleGet, - status, - } = {} - ) { - const index = this.keyMap.get(k) - if (index !== undefined) { - const value = this.valList[index] - const fetching = this.isBackgroundFetch(value) - this.statusTTL(status, index) - if (this.isStale(index)) { - if (status) status.get = 'stale' - // delete only if not an in-flight background fetch - if (!fetching) { - if (!noDeleteOnStaleGet) { - this.delete(k) - } - if (status) status.returnedStale = allowStale - return allowStale ? value : undefined - } else { - if (status) { - status.returnedStale = - allowStale && value.__staleWhileFetching !== undefined - } - return allowStale ? value.__staleWhileFetching : undefined - } - } else { - if (status) status.get = 'hit' - // if we're currently fetching it, we don't actually have it yet - // it's not stale, which means this isn't a staleWhileRefetching. - // If it's not stale, and fetching, AND has a __staleWhileFetching - // value, then that means the user fetched with {forceRefresh:true}, - // so it's safe to return that value. - if (fetching) { - return value.__staleWhileFetching - } - this.moveToTail(index) - if (updateAgeOnGet) { - this.updateItemAge(index) - } - return value - } - } else if (status) { - status.get = 'miss' - } - } - - connect(p, n) { - this.prev[n] = p - this.next[p] = n - } - - moveToTail(index) { - // if tail already, nothing to do - // if head, move head to next[index] - // else - // move next[prev[index]] to next[index] (head has no prev) - // move prev[next[index]] to prev[index] - // prev[index] = tail - // next[tail] = index - // tail = index - if (index !== this.tail) { - if (index === this.head) { - this.head = this.next[index] - } else { - this.connect(this.prev[index], this.next[index]) - } - this.connect(this.tail, index) - this.tail = index - } - } - - get del() { - deprecatedMethod('del', 'delete') - return this.delete - } - - delete(k) { - let deleted = false - if (this.size !== 0) { - const index = this.keyMap.get(k) - if (index !== undefined) { - deleted = true - if (this.size === 1) { - this.clear() - } else { - this.removeItemSize(index) - const v = this.valList[index] - if (this.isBackgroundFetch(v)) { - v.__abortController.abort(new Error('deleted')) - } else { - this.dispose(v, k, 'delete') - if (this.disposeAfter) { - this.disposed.push([v, k, 'delete']) - } - } - this.keyMap.delete(k) - this.keyList[index] = null - this.valList[index] = null - if (index === this.tail) { - this.tail = this.prev[index] - } else if (index === this.head) { - this.head = this.next[index] - } else { - this.next[this.prev[index]] = this.next[index] - this.prev[this.next[index]] = this.prev[index] - } - this.size-- - this.free.push(index) - } - } - } - if (this.disposed) { - while (this.disposed.length) { - this.disposeAfter(...this.disposed.shift()) - } - } - return deleted - } - - clear() { - for (const index of this.rindexes({ allowStale: true })) { - const v = this.valList[index] - if (this.isBackgroundFetch(v)) { - v.__abortController.abort(new Error('deleted')) - } else { - const k = this.keyList[index] - this.dispose(v, k, 'delete') - if (this.disposeAfter) { - this.disposed.push([v, k, 'delete']) - } - } - } - - this.keyMap.clear() - this.valList.fill(null) - this.keyList.fill(null) - if (this.ttls) { - this.ttls.fill(0) - this.starts.fill(0) - } - if (this.sizes) { - this.sizes.fill(0) - } - this.head = 0 - this.tail = 0 - this.initialFill = 1 - this.free.length = 0 - this.calculatedSize = 0 - this.size = 0 - if (this.disposed) { - while (this.disposed.length) { - this.disposeAfter(...this.disposed.shift()) - } - } - } - - get reset() { - deprecatedMethod('reset', 'clear') - return this.clear - } - - get length() { - deprecatedProperty('length', 'size') - return this.size - } - - static get AbortController() { - return AC - } - static get AbortSignal() { - return AS - } -} - -export default LRUCache diff --git a/node_modules/named-placeholders/node_modules/lru-cache/package.json b/node_modules/named-placeholders/node_modules/lru-cache/package.json deleted file mode 100644 index 9684991..0000000 --- a/node_modules/named-placeholders/node_modules/lru-cache/package.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "name": "lru-cache", - "description": "A cache object that deletes the least-recently-used items.", - "version": "7.18.3", - "author": "Isaac Z. Schlueter ", - "keywords": [ - "mru", - "lru", - "cache" - ], - "sideEffects": false, - "scripts": { - "build": "npm run prepare", - "pretest": "npm run prepare", - "presnap": "npm run prepare", - "prepare": "node ./scripts/transpile-to-esm.js", - "size": "size-limit", - "test": "tap", - "snap": "tap", - "preversion": "npm test", - "postversion": "npm publish", - "prepublishOnly": "git push origin --follow-tags", - "format": "prettier --write .", - "typedoc": "typedoc ./index.d.ts" - }, - "type": "commonjs", - "main": "./index.js", - "module": "./index.mjs", - "types": "./index.d.ts", - "exports": { - ".": { - "import": { - "types": "./index.d.ts", - "default": "./index.mjs" - }, - "require": { - "types": "./index.d.ts", - "default": "./index.js" - } - }, - "./package.json": "./package.json" - }, - "repository": "git://github.com/isaacs/node-lru-cache.git", - "devDependencies": { - "@size-limit/preset-small-lib": "^7.0.8", - "@types/node": "^17.0.31", - "@types/tap": "^15.0.6", - "benchmark": "^2.1.4", - "c8": "^7.11.2", - "clock-mock": "^1.0.6", - "eslint-config-prettier": "^8.5.0", - "prettier": "^2.6.2", - "size-limit": "^7.0.8", - "tap": "^16.3.4", - "ts-node": "^10.7.0", - "tslib": "^2.4.0", - "typedoc": "^0.23.24", - "typescript": "^4.6.4" - }, - "license": "ISC", - "files": [ - "index.js", - "index.mjs", - "index.d.ts" - ], - "engines": { - "node": ">=12" - }, - "prettier": { - "semi": false, - "printWidth": 70, - "tabWidth": 2, - "useTabs": false, - "singleQuote": true, - "jsxSingleQuote": false, - "bracketSameLine": true, - "arrowParens": "avoid", - "endOfLine": "lf" - }, - "tap": { - "nyc-arg": [ - "--include=index.js" - ], - "node-arg": [ - "--expose-gc", - "--require", - "ts-node/register" - ], - "ts": false - }, - "size-limit": [ - { - "path": "./index.js" - } - ] -} diff --git a/node_modules/named-placeholders/package.json b/node_modules/named-placeholders/package.json deleted file mode 100644 index 3b7c987..0000000 --- a/node_modules/named-placeholders/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "named-placeholders", - "version": "1.1.3", - "description": "sql named placeholders to unnamed compiler", - "main": "index.js", - "scripts": { - "test": "mocha" - }, - "repository": { - "type": "git", - "url": "https://github.com/sidorares/named-placeholders" - }, - "keywords": [ - "sql", - "pdo", - "named", - "placeholders" - ], - "engines": { - "node": ">=12.0.0" - }, - "author": "Andrey Sidorov ", - "files": [], - "license": "MIT", - "devDependencies": { - "mocha": "^5.2.0", - "should": "^13.2.3" - }, - "dependencies": { - "lru-cache": "^7.14.1" - } -} diff --git a/node_modules/negotiator/HISTORY.md b/node_modules/negotiator/HISTORY.md index aa2a7c4..a9a5449 100644 --- a/node_modules/negotiator/HISTORY.md +++ b/node_modules/negotiator/HISTORY.md @@ -1,3 +1,35 @@ +0.6.3 / 2022-01-22 +================== + + * Revert "Lazy-load modules from main entry point" + +0.6.2 / 2019-04-29 +================== + + * Fix sorting charset, encoding, and language with extra parameters + +0.6.1 / 2016-05-02 +================== + + * perf: improve `Accept` parsing speed + * perf: improve `Accept-Charset` parsing speed + * perf: improve `Accept-Encoding` parsing speed + * perf: improve `Accept-Language` parsing speed + +0.6.0 / 2015-09-29 +================== + + * 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 + 0.5.3 / 2015-05-10 ================== diff --git a/node_modules/negotiator/README.md b/node_modules/negotiator/README.md index ef507fa..82915e5 100644 --- a/node_modules/negotiator/README.md +++ b/node_modules/negotiator/README.md @@ -3,7 +3,7 @@ [![NPM Version][npm-image]][npm-url] [![NPM Downloads][downloads-image]][downloads-url] [![Node.js Version][node-version-image]][node-version-url] -[![Build Status][travis-image]][travis-url] +[![Build Status][github-actions-ci-image]][github-actions-ci-url] [![Test Coverage][coveralls-image]][coveralls-url] An HTTP content negotiator for Node.js @@ -66,7 +66,7 @@ available media types. ```js negotiator = new Negotiator(request) -availableLanguages = 'en', 'es', 'fr' +availableLanguages = ['en', 'es', 'fr'] // Let's say Accept-Language header is 'en;q=0.8, es, pt' @@ -194,10 +194,10 @@ and more. [npm-image]: https://img.shields.io/npm/v/negotiator.svg [npm-url]: https://npmjs.org/package/negotiator [node-version-image]: https://img.shields.io/node/v/negotiator.svg -[node-version-url]: http://nodejs.org/download/ -[travis-image]: https://img.shields.io/travis/jshttp/negotiator/master.svg -[travis-url]: https://travis-ci.org/jshttp/negotiator +[node-version-url]: https://nodejs.org/en/download/ [coveralls-image]: https://img.shields.io/coveralls/jshttp/negotiator/master.svg [coveralls-url]: https://coveralls.io/r/jshttp/negotiator?branch=master [downloads-image]: https://img.shields.io/npm/dm/negotiator.svg [downloads-url]: https://npmjs.org/package/negotiator +[github-actions-ci-image]: https://img.shields.io/github/workflow/status/jshttp/negotiator/ci/master?label=ci +[github-actions-ci-url]: https://github.com/jshttp/negotiator/actions/workflows/ci.yml diff --git a/node_modules/negotiator/index.js b/node_modules/negotiator/index.js index edae9cf..4788264 100644 --- a/node_modules/negotiator/index.js +++ b/node_modules/negotiator/index.js @@ -1,11 +1,31 @@ +/*! + * negotiator + * Copyright(c) 2012 Federico Romero + * Copyright(c) 2012-2014 Isaac Z. Schlueter + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ -var preferredCharsets = require('./lib/charset'); -var preferredEncodings = require('./lib/encoding'); -var preferredLanguages = require('./lib/language'); -var preferredMediaTypes = require('./lib/mediaType'); +'use strict'; + +var preferredCharsets = require('./lib/charset') +var preferredEncodings = require('./lib/encoding') +var preferredLanguages = require('./lib/language') +var preferredMediaTypes = require('./lib/mediaType') + +/** + * Module exports. + * @public + */ module.exports = Negotiator; -Negotiator.Negotiator = Negotiator; +module.exports.Negotiator = Negotiator; + +/** + * Create a Negotiator instance from a request. + * @param {object} request + * @public + */ function Negotiator(request) { if (!(this instanceof Negotiator)) { diff --git a/node_modules/negotiator/lib/charset.js b/node_modules/negotiator/lib/charset.js index 7abd17c..cdd0148 100644 --- a/node_modules/negotiator/lib/charset.js +++ b/node_modules/negotiator/lib/charset.js @@ -1,5 +1,32 @@ +/** + * negotiator + * Copyright(c) 2012 Isaac Z. Schlueter + * Copyright(c) 2014 Federico Romero + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module exports. + * @public + */ + module.exports = preferredCharsets; -preferredCharsets.preferredCharsets = preferredCharsets; +module.exports.preferredCharsets = preferredCharsets; + +/** + * Module variables. + * @private + */ + +var simpleCharsetRegExp = /^\s*([^\s;]+)\s*(?:;(.*))?$/; + +/** + * Parse the Accept-Charset header. + * @private + */ function parseAcceptCharset(accept) { var accepts = accept.split(','); @@ -18,16 +45,21 @@ function parseAcceptCharset(accept) { return accepts; } -function parseCharset(s, i) { - var match = s.match(/^\s*(\S+?)\s*(?:;(.*))?$/); +/** + * Parse a charset from the Accept-Charset header. + * @private + */ + +function parseCharset(str, i) { + var match = simpleCharsetRegExp.exec(str); if (!match) return null; var charset = match[1]; var q = 1; if (match[2]) { var params = match[2].split(';') - for (var i = 0; i < params.length; i ++) { - var p = params[i].trim().split('='); + for (var j = 0; j < params.length; j++) { + var p = params[j].trim().split('='); if (p[0] === 'q') { q = parseFloat(p[1]); break; @@ -42,6 +74,11 @@ function parseCharset(s, i) { }; } +/** + * Get the priority of a charset. + * @private + */ + function getCharsetPriority(charset, accepted, index) { var priority = {o: -1, q: 0, s: 0}; @@ -56,6 +93,11 @@ function getCharsetPriority(charset, accepted, index) { return priority; } +/** + * Get the specificity of the charset. + * @private + */ + function specify(charset, spec, index) { var s = 0; if(spec.charset.toLowerCase() === charset.toLowerCase()){ @@ -72,15 +114,21 @@ function specify(charset, spec, index) { } } +/** + * Get the preferred charsets from an Accept-Charset header. + * @public + */ + function preferredCharsets(accept, provided) { // RFC 2616 sec 14.2: no header = * var accepts = parseAcceptCharset(accept === undefined ? '*' : accept || ''); if (!provided) { // sorted list of all charsets - return accepts.filter(isQuality).sort(compareSpecs).map(function getCharset(spec) { - return spec.charset; - }); + return accepts + .filter(isQuality) + .sort(compareSpecs) + .map(getFullCharset); } var priorities = provided.map(function getPriority(type, index) { @@ -93,10 +141,29 @@ function preferredCharsets(accept, provided) { }); } +/** + * Compare two specs. + * @private + */ + function compareSpecs(a, b) { return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0; } +/** + * Get full charset string. + * @private + */ + +function getFullCharset(spec) { + return spec.charset; +} + +/** + * Check if a spec has any quality. + * @private + */ + function isQuality(spec) { return spec.q > 0; } diff --git a/node_modules/negotiator/lib/encoding.js b/node_modules/negotiator/lib/encoding.js index 7fed673..8432cd7 100644 --- a/node_modules/negotiator/lib/encoding.js +++ b/node_modules/negotiator/lib/encoding.js @@ -1,5 +1,32 @@ +/** + * negotiator + * Copyright(c) 2012 Isaac Z. Schlueter + * Copyright(c) 2014 Federico Romero + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module exports. + * @public + */ + module.exports = preferredEncodings; -preferredEncodings.preferredEncodings = preferredEncodings; +module.exports.preferredEncodings = preferredEncodings; + +/** + * Module variables. + * @private + */ + +var simpleEncodingRegExp = /^\s*([^\s;]+)\s*(?:;(.*))?$/; + +/** + * Parse the Accept-Encoding header. + * @private + */ function parseAcceptEncoding(accept) { var accepts = accept.split(','); @@ -34,17 +61,21 @@ function parseAcceptEncoding(accept) { return accepts; } -function parseEncoding(s, i) { - var match = s.match(/^\s*(\S+?)\s*(?:;(.*))?$/); +/** + * Parse an encoding from the Accept-Encoding header. + * @private + */ +function parseEncoding(str, i) { + var match = simpleEncodingRegExp.exec(str); if (!match) return null; var encoding = match[1]; var q = 1; if (match[2]) { var params = match[2].split(';'); - for (var i = 0; i < params.length; i ++) { - var p = params[i].trim().split('='); + for (var j = 0; j < params.length; j++) { + var p = params[j].trim().split('='); if (p[0] === 'q') { q = parseFloat(p[1]); break; @@ -59,6 +90,11 @@ function parseEncoding(s, i) { }; } +/** + * Get the priority of an encoding. + * @private + */ + function getEncodingPriority(encoding, accepted, index) { var priority = {o: -1, q: 0, s: 0}; @@ -73,6 +109,11 @@ function getEncodingPriority(encoding, accepted, index) { return priority; } +/** + * Get the specificity of the encoding. + * @private + */ + function specify(encoding, spec, index) { var s = 0; if(spec.encoding.toLowerCase() === encoding.toLowerCase()){ @@ -89,14 +130,20 @@ function specify(encoding, spec, index) { } }; +/** + * Get the preferred encodings from an Accept-Encoding header. + * @public + */ + function preferredEncodings(accept, provided) { var accepts = parseAcceptEncoding(accept || ''); if (!provided) { // sorted list of all encodings - return accepts.filter(isQuality).sort(compareSpecs).map(function getEncoding(spec) { - return spec.encoding; - }); + return accepts + .filter(isQuality) + .sort(compareSpecs) + .map(getFullEncoding); } var priorities = provided.map(function getPriority(type, index) { @@ -109,10 +156,29 @@ function preferredEncodings(accept, provided) { }); } +/** + * Compare two specs. + * @private + */ + function compareSpecs(a, b) { return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0; } +/** + * Get full encoding string. + * @private + */ + +function getFullEncoding(spec) { + return spec.encoding; +} + +/** + * Check if a spec has any quality. + * @private + */ + function isQuality(spec) { return spec.q > 0; } diff --git a/node_modules/negotiator/lib/language.js b/node_modules/negotiator/lib/language.js index ed9e1ec..a231672 100644 --- a/node_modules/negotiator/lib/language.js +++ b/node_modules/negotiator/lib/language.js @@ -1,14 +1,41 @@ +/** + * negotiator + * Copyright(c) 2012 Isaac Z. Schlueter + * Copyright(c) 2014 Federico Romero + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module exports. + * @public + */ + module.exports = preferredLanguages; -preferredLanguages.preferredLanguages = preferredLanguages; +module.exports.preferredLanguages = preferredLanguages; + +/** + * Module variables. + * @private + */ + +var simpleLanguageRegExp = /^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/; + +/** + * Parse the Accept-Language header. + * @private + */ function parseAcceptLanguage(accept) { var accepts = accept.split(','); for (var i = 0, j = 0; i < accepts.length; i++) { - var langauge = parseLanguage(accepts[i].trim(), i); + var language = parseLanguage(accepts[i].trim(), i); - if (langauge) { - accepts[j++] = langauge; + if (language) { + accepts[j++] = language; } } @@ -18,21 +45,26 @@ function parseAcceptLanguage(accept) { return accepts; } -function parseLanguage(s, i) { - var match = s.match(/^\s*(\S+?)(?:-(\S+?))?\s*(?:;(.*))?$/); +/** + * Parse a language from the Accept-Language header. + * @private + */ + +function parseLanguage(str, i) { + var match = simpleLanguageRegExp.exec(str); if (!match) return null; - var prefix = match[1], - suffix = match[2], - full = prefix; + var prefix = match[1] + var suffix = match[2] + var full = prefix if (suffix) full += "-" + suffix; var q = 1; if (match[3]) { var params = match[3].split(';') - for (var i = 0; i < params.length; i ++) { - var p = params[i].split('='); + for (var j = 0; j < params.length; j++) { + var p = params[j].split('='); if (p[0] === 'q') q = parseFloat(p[1]); } } @@ -46,6 +78,11 @@ function parseLanguage(s, i) { }; } +/** + * Get the priority of a language. + * @private + */ + function getLanguagePriority(language, accepted, index) { var priority = {o: -1, q: 0, s: 0}; @@ -60,6 +97,11 @@ function getLanguagePriority(language, accepted, index) { return priority; } +/** + * Get the specificity of the language. + * @private + */ + function specify(language, spec, index) { var p = parseLanguage(language) if (!p) return null; @@ -82,15 +124,21 @@ function specify(language, spec, index) { } }; +/** + * Get the preferred languages from an Accept-Language header. + * @public + */ + function preferredLanguages(accept, provided) { // RFC 2616 sec 14.4: no header = * var accepts = parseAcceptLanguage(accept === undefined ? '*' : accept || ''); if (!provided) { // sorted list of all languages - return accepts.filter(isQuality).sort(compareSpecs).map(function getLanguage(spec) { - return spec.full; - }); + return accepts + .filter(isQuality) + .sort(compareSpecs) + .map(getFullLanguage); } var priorities = provided.map(function getPriority(type, index) { @@ -103,10 +151,29 @@ function preferredLanguages(accept, provided) { }); } +/** + * Compare two specs. + * @private + */ + function compareSpecs(a, b) { return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0; } +/** + * Get full language string. + * @private + */ + +function getFullLanguage(spec) { + return spec.full; +} + +/** + * Check if a spec has any quality. + * @private + */ + function isQuality(spec) { return spec.q > 0; } diff --git a/node_modules/negotiator/lib/mediaType.js b/node_modules/negotiator/lib/mediaType.js index 4170c25..67309dd 100644 --- a/node_modules/negotiator/lib/mediaType.js +++ b/node_modules/negotiator/lib/mediaType.js @@ -6,8 +6,27 @@ * MIT Licensed */ +'use strict'; + +/** + * Module exports. + * @public + */ + module.exports = preferredMediaTypes; -preferredMediaTypes.preferredMediaTypes = preferredMediaTypes; +module.exports.preferredMediaTypes = preferredMediaTypes; + +/** + * Module variables. + * @private + */ + +var simpleMediaTypeRegExp = /^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/; + +/** + * Parse the Accept header. + * @private + */ function parseAccept(accept) { var accepts = splitMediaTypes(accept); @@ -24,35 +43,42 @@ function parseAccept(accept) { accepts.length = j; return accepts; -}; +} -function parseMediaType(s, i) { - var match = s.match(/\s*(\S+?)\/([^;\s]+)\s*(?:;(.*))?/); +/** + * Parse a media type from the Accept header. + * @private + */ + +function parseMediaType(str, i) { + var match = simpleMediaTypeRegExp.exec(str); if (!match) return null; - var type = match[1], - subtype = match[2], - full = "" + type + "/" + subtype, - params = {}, - q = 1; + var params = Object.create(null); + var q = 1; + var subtype = match[2]; + var type = match[1]; if (match[3]) { - params = match[3].split(';').map(function(s) { - return s.trim().split('='); - }).reduce(function (set, p) { - var name = p[0].toLowerCase(); - var value = p[1]; + var kvps = splitParameters(match[3]).map(splitKeyValuePair); - set[name] = value && value[0] === '"' && value[value.length - 1] === '"' - ? value.substr(1, value.length - 2) - : value; + for (var j = 0; j < kvps.length; j++) { + var pair = kvps[j]; + var key = pair[0].toLowerCase(); + var val = pair[1]; - return set; - }, params); + // get the value, unwrapping quotes + var value = val && val[0] === '"' && val[val.length - 1] === '"' + ? val.substr(1, val.length - 2) + : val; - if (params.q != null) { - q = parseFloat(params.q); - delete params.q; + if (key === 'q') { + q = parseFloat(value); + break; + } + + // store parameter + params[key] = value; } } @@ -61,11 +87,15 @@ function parseMediaType(s, i) { subtype: subtype, params: params, q: q, - i: i, - full: full + i: i }; } +/** + * Get the priority of a media type. + * @private + */ + function getMediaTypePriority(type, accepted, index) { var priority = {o: -1, q: 0, s: 0}; @@ -80,6 +110,11 @@ function getMediaTypePriority(type, accepted, index) { return priority; } +/** + * Get the specificity of the media type. + * @private + */ + function specify(type, spec, index) { var p = parseMediaType(type); var s = 0; @@ -117,18 +152,23 @@ function specify(type, spec, index) { q: spec.q, s: s, } - } +/** + * Get the preferred media types from an Accept header. + * @public + */ + function preferredMediaTypes(accept, provided) { // RFC 2616 sec 14.2: no header = */* var accepts = parseAccept(accept === undefined ? '*/*' : accept || ''); if (!provided) { // sorted list of all types - return accepts.filter(isQuality).sort(compareSpecs).map(function getType(spec) { - return spec.full; - }); + return accepts + .filter(isQuality) + .sort(compareSpecs) + .map(getFullType); } var priorities = provided.map(function getPriority(type, index) { @@ -141,14 +181,38 @@ function preferredMediaTypes(accept, provided) { }); } +/** + * Compare two specs. + * @private + */ + function compareSpecs(a, b) { return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0; } +/** + * Get full type string. + * @private + */ + +function getFullType(spec) { + return spec.type + '/' + spec.subtype; +} + +/** + * Check if a spec has any quality. + * @private + */ + function isQuality(spec) { return spec.q > 0; } +/** + * Count the number of quotes in a string. + * @private + */ + function quoteCount(string) { var count = 0; var index = 0; @@ -161,6 +225,31 @@ function quoteCount(string) { return count; } +/** + * Split a key value pair. + * @private + */ + +function splitKeyValuePair(str) { + var index = str.indexOf('='); + var key; + var val; + + if (index === -1) { + key = str; + } else { + key = str.substr(0, index); + val = str.substr(index + 1); + } + + return [key, val]; +} + +/** + * Split an Accept header into media types. + * @private + */ + function splitMediaTypes(accept) { var accepts = accept.split(','); @@ -177,3 +266,29 @@ function splitMediaTypes(accept) { return accepts; } + +/** + * Split a string of parameters. + * @private + */ + +function splitParameters(str) { + var parameters = str.split(';'); + + for (var i = 1, j = 0; i < parameters.length; i++) { + if (quoteCount(parameters[j]) % 2 == 0) { + parameters[++j] = parameters[i]; + } else { + parameters[j] += ';' + parameters[i]; + } + } + + // trim parameters + parameters.length = j + 1; + + for (var i = 0; i < parameters.length; i++) { + parameters[i] = parameters[i].trim(); + } + + return parameters; +} diff --git a/node_modules/negotiator/package.json b/node_modules/negotiator/package.json index 28bfc9a..297635f 100644 --- a/node_modules/negotiator/package.json +++ b/node_modules/negotiator/package.json @@ -1,7 +1,7 @@ { "name": "negotiator", "description": "HTTP content negotiation", - "version": "0.5.3", + "version": "0.6.3", "contributors": [ "Douglas Christopher Wilson ", "Federico Romero ", @@ -18,8 +18,10 @@ ], "repository": "jshttp/negotiator", "devDependencies": { - "istanbul": "0.3.9", - "mocha": "~1.21.5" + "eslint": "7.32.0", + "eslint-plugin-markdown": "2.2.1", + "mocha": "9.1.3", + "nyc": "15.1.0" }, "files": [ "lib/", @@ -32,8 +34,9 @@ "node": ">= 0.6" }, "scripts": { + "lint": "eslint .", "test": "mocha --reporter spec --check-leaks --bail test/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + "test-ci": "nyc --reporter=lcov --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" } } diff --git a/node_modules/path-to-regexp/History.md b/node_modules/path-to-regexp/History.md index 9f00a1f..7f65878 100644 --- a/node_modules/path-to-regexp/History.md +++ b/node_modules/path-to-regexp/History.md @@ -1,3 +1,13 @@ +0.1.7 / 2015-07-28 +================== + + * Fixed regression with escaped round brackets and matching groups. + +0.1.6 / 2015-06-19 +================== + + * Replace `index` feature by outputting all parameters, unnamed and named. + 0.1.5 / 2015-05-08 ================== diff --git a/node_modules/path-to-regexp/Readme.md b/node_modules/path-to-regexp/Readme.md index 9ad6976..95452a6 100644 --- a/node_modules/path-to-regexp/Readme.md +++ b/node_modules/path-to-regexp/Readme.md @@ -2,7 +2,7 @@ Turn an Express-style path string such as `/user/:name` into a regular expression. -**Note:** This is a legacy branch. You should upgrade to `1.x`. If you find you are stuck on this version, your code will need to take into account the `index` property on the keys. +**Note:** This is a legacy branch. You should upgrade to `1.x`. ## Usage diff --git a/node_modules/path-to-regexp/index.js b/node_modules/path-to-regexp/index.js index 1c8d697..500d1da 100644 --- a/node_modules/path-to-regexp/index.js +++ b/node_modules/path-to-regexp/index.js @@ -91,7 +91,7 @@ function pathtoRegexp(path, keys, options) { var len = keys.length while (len-- > keysOffset && keys[len].offset > index) { - keys[len].offset += 3; + keys[len].offset += 3; // Replacement length minus asterisk length. } return '(.*)'; @@ -99,6 +99,18 @@ function pathtoRegexp(path, keys, options) { // This is a workaround for handling unnamed matching groups. while (m = MATCHING_GROUP_REGEXP.exec(path)) { + var escapeCount = 0; + var index = m.index; + + while (path.charAt(--index) === '\\') { + escapeCount++; + } + + // It's possible to escape the bracket. + if (escapeCount % 2 === 1) { + continue; + } + if (keysOffset + i === keys.length || keys[keysOffset + i].offset > m.index) { keys.splice(keysOffset + i, 0, { name: name++, // Unnamed matching groups must be consistently linear. diff --git a/node_modules/path-to-regexp/package.json b/node_modules/path-to-regexp/package.json index 64edeb2..d4e51b5 100644 --- a/node_modules/path-to-regexp/package.json +++ b/node_modules/path-to-regexp/package.json @@ -1,7 +1,7 @@ { "name": "path-to-regexp", "description": "Express style path to RegExp utility", - "version": "0.1.6", + "version": "0.1.7", "files": [ "index.js", "LICENSE" diff --git a/node_modules/process-nextick-args/index.js b/node_modules/process-nextick-args/index.js new file mode 100644 index 0000000..3eecf11 --- /dev/null +++ b/node_modules/process-nextick-args/index.js @@ -0,0 +1,45 @@ +'use strict'; + +if (typeof process === 'undefined' || + !process.version || + process.version.indexOf('v0.') === 0 || + process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) { + module.exports = { nextTick: nextTick }; +} else { + module.exports = process +} + +function nextTick(fn, arg1, arg2, arg3) { + if (typeof fn !== 'function') { + throw new TypeError('"callback" argument must be a function'); + } + var len = arguments.length; + var args, i; + switch (len) { + case 0: + case 1: + return process.nextTick(fn); + case 2: + return process.nextTick(function afterTickOne() { + fn.call(null, arg1); + }); + case 3: + return process.nextTick(function afterTickTwo() { + fn.call(null, arg1, arg2); + }); + case 4: + return process.nextTick(function afterTickThree() { + fn.call(null, arg1, arg2, arg3); + }); + default: + args = new Array(len - 1); + i = 0; + while (i < args.length) { + args[i++] = arguments[i]; + } + return process.nextTick(function afterTick() { + fn.apply(null, args); + }); + } +} + diff --git a/node_modules/@eonasdan/tempus-dominus/LICENSE b/node_modules/process-nextick-args/license.md similarity index 85% rename from node_modules/@eonasdan/tempus-dominus/LICENSE rename to node_modules/process-nextick-args/license.md index dcc3b2d..c67e353 100644 --- a/node_modules/@eonasdan/tempus-dominus/LICENSE +++ b/node_modules/process-nextick-args/license.md @@ -1,6 +1,4 @@ -The MIT License (MIT) - -Copyright (c) 2021 Jonathan Peterson (@Eonasdan) +# Copyright (c) 2015 Calvin Metcalf Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -12,10 +10,10 @@ 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 +**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. +SOFTWARE.** diff --git a/node_modules/process-nextick-args/package.json b/node_modules/process-nextick-args/package.json new file mode 100644 index 0000000..6070b72 --- /dev/null +++ b/node_modules/process-nextick-args/package.json @@ -0,0 +1,25 @@ +{ + "name": "process-nextick-args", + "version": "2.0.1", + "description": "process.nextTick but always with args", + "main": "index.js", + "files": [ + "index.js" + ], + "scripts": { + "test": "node test.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/calvinmetcalf/process-nextick-args.git" + }, + "author": "", + "license": "MIT", + "bugs": { + "url": "https://github.com/calvinmetcalf/process-nextick-args/issues" + }, + "homepage": "https://github.com/calvinmetcalf/process-nextick-args", + "devDependencies": { + "tap": "~0.2.6" + } +} diff --git a/node_modules/process-nextick-args/readme.md b/node_modules/process-nextick-args/readme.md new file mode 100644 index 0000000..ecb432c --- /dev/null +++ b/node_modules/process-nextick-args/readme.md @@ -0,0 +1,18 @@ +process-nextick-args +===== + +[![Build Status](https://travis-ci.org/calvinmetcalf/process-nextick-args.svg?branch=master)](https://travis-ci.org/calvinmetcalf/process-nextick-args) + +```bash +npm install --save process-nextick-args +``` + +Always be able to pass arguments to process.nextTick, no matter the platform + +```js +var pna = require('process-nextick-args'); + +pna.nextTick(function (a, b, c) { + console.log(a, b, c); +}, 'step', 3, 'profit'); +``` diff --git a/node_modules/proxy-addr/HISTORY.md b/node_modules/proxy-addr/HISTORY.md index 84f11aa..8480242 100644 --- a/node_modules/proxy-addr/HISTORY.md +++ b/node_modules/proxy-addr/HISTORY.md @@ -1,3 +1,84 @@ +2.0.7 / 2021-05-31 +================== + + * deps: forwarded@0.2.0 + - Use `req.socket` over deprecated `req.connection` + +2.0.6 / 2020-02-24 +================== + + * deps: ipaddr.js@1.9.1 + +2.0.5 / 2019-04-16 +================== + + * deps: ipaddr.js@1.9.0 + +2.0.4 / 2018-07-26 +================== + + * deps: ipaddr.js@1.8.0 + +2.0.3 / 2018-02-19 +================== + + * deps: ipaddr.js@1.6.0 + +2.0.2 / 2017-09-24 +================== + + * deps: forwarded@~0.1.2 + - perf: improve header parsing + - perf: reduce overhead when no `X-Forwarded-For` header + +2.0.1 / 2017-09-10 +================== + + * deps: forwarded@~0.1.1 + - Fix trimming leading / trailing OWS + - perf: hoist regular expression + * deps: ipaddr.js@1.5.2 + +2.0.0 / 2017-08-08 +================== + + * Drop support for Node.js below 0.10 + +1.1.5 / 2017-07-25 +================== + + * Fix array argument being altered + * deps: ipaddr.js@1.4.0 + +1.1.4 / 2017-03-24 +================== + + * deps: ipaddr.js@1.3.0 + +1.1.3 / 2017-01-14 +================== + + * deps: ipaddr.js@1.2.0 + +1.1.2 / 2016-05-29 +================== + + * deps: ipaddr.js@1.1.1 + - Fix IPv6-mapped IPv4 validation edge cases + +1.1.1 / 2016-05-03 +================== + + * Fix regression matching mixed versions against multiple subnets + +1.1.0 / 2016-05-01 +================== + + * Fix accepting various invalid netmasks + - IPv4 netmasks must be contingous + - IPv6 addresses cannot be used as a netmask + * deps: ipaddr.js@1.1.0 + 1.0.10 / 2015-12-09 =================== diff --git a/node_modules/proxy-addr/LICENSE b/node_modules/proxy-addr/LICENSE index b7dce6c..cab251c 100644 --- a/node_modules/proxy-addr/LICENSE +++ b/node_modules/proxy-addr/LICENSE @@ -1,6 +1,6 @@ (The MIT License) -Copyright (c) 2014 Douglas Christopher Wilson +Copyright (c) 2014-2016 Douglas Christopher Wilson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/node_modules/proxy-addr/README.md b/node_modules/proxy-addr/README.md index 26f7fc0..69c0b63 100644 --- a/node_modules/proxy-addr/README.md +++ b/node_modules/proxy-addr/README.md @@ -1,15 +1,19 @@ # proxy-addr -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Node.js Version][node-version-image]][node-version-url] -[![Build Status][travis-image]][travis-url] +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Node.js Version][node-image]][node-url] +[![Build Status][ci-image]][ci-url] [![Test Coverage][coveralls-image]][coveralls-url] Determine address of proxied request ## Install +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 proxy-addr ``` @@ -29,8 +33,8 @@ the address, `false` if you don't. The closest untrusted address is returned. ```js -proxyaddr(req, function(addr){ return addr === '127.0.0.1' }) -proxyaddr(req, function(addr, i){ return i < 1 }) +proxyaddr(req, function (addr) { return addr === '127.0.0.1' }) +proxyaddr(req, function (addr, i) { return i < 1 }) ``` The `trust` arugment may also be a single IP address string or an @@ -49,7 +53,6 @@ automatically (i.e. `fe80::00ed:1` equals `fe80:0:0:0:0:0:ed:1`). ```js proxyaddr(req, '::1') proxyaddr(req, ['::1/128', 'fe80::/10']) -proxyaddr(req, ['fe80::/ffc0::']) ``` This module will automatically work with IPv4-mapped IPv6 addresses @@ -101,8 +104,8 @@ the same arguments as `trust` does in `proxyaddr(req, trust)` and returns a function suitable for `proxyaddr(req, trust)`. ```js -var trust = proxyaddr.compile('localhost') -var addr = proxyaddr(req, trust) +var trust = proxyaddr.compile('loopback') +var addr = proxyaddr(req, trust) ``` This function is meant to be optimized for use against every request. @@ -125,13 +128,12 @@ $ npm run-script bench [MIT](LICENSE) -[npm-image]: https://img.shields.io/npm/v/proxy-addr.svg -[npm-url]: https://npmjs.org/package/proxy-addr -[node-version-image]: https://img.shields.io/node/v/proxy-addr.svg -[node-version-url]: http://nodejs.org/download/ -[travis-image]: https://img.shields.io/travis/jshttp/proxy-addr/master.svg -[travis-url]: https://travis-ci.org/jshttp/proxy-addr -[coveralls-image]: https://img.shields.io/coveralls/jshttp/proxy-addr/master.svg +[ci-image]: https://badgen.net/github/checks/jshttp/proxy-addr/master?label=ci +[ci-url]: https://github.com/jshttp/proxy-addr/actions?query=workflow%3Aci +[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/proxy-addr/master [coveralls-url]: https://coveralls.io/r/jshttp/proxy-addr?branch=master -[downloads-image]: https://img.shields.io/npm/dm/proxy-addr.svg -[downloads-url]: https://npmjs.org/package/proxy-addr +[node-image]: https://badgen.net/npm/node/proxy-addr +[node-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/proxy-addr +[npm-url]: https://npmjs.org/package/proxy-addr +[npm-version-image]: https://badgen.net/npm/v/proxy-addr diff --git a/node_modules/proxy-addr/index.js b/node_modules/proxy-addr/index.js index 3200efb..a909b05 100644 --- a/node_modules/proxy-addr/index.js +++ b/node_modules/proxy-addr/index.js @@ -1,6 +1,6 @@ /*! * proxy-addr - * Copyright(c) 2014 Douglas Christopher Wilson + * Copyright(c) 2014-2016 Douglas Christopher Wilson * MIT Licensed */ @@ -8,36 +8,40 @@ /** * Module exports. + * @public */ -module.exports = proxyaddr; -module.exports.all = alladdrs; -module.exports.compile = compile; +module.exports = proxyaddr +module.exports.all = alladdrs +module.exports.compile = compile /** * Module dependencies. + * @private */ -var forwarded = require('forwarded'); -var ipaddr = require('ipaddr.js'); +var forwarded = require('forwarded') +var ipaddr = require('ipaddr.js') /** * Variables. + * @private */ -var digitre = /^[0-9]+$/; -var isip = ipaddr.isValid; -var parseip = ipaddr.parse; +var DIGIT_REGEXP = /^[0-9]+$/ +var isip = ipaddr.isValid +var parseip = ipaddr.parse /** * Pre-defined IP ranges. + * @private */ -var ipranges = { +var IP_RANGES = { linklocal: ['169.254.0.0/16', 'fe80::/10'], loopback: ['127.0.0.1/8', '::1/128'], uniquelocal: ['10.0.0.0/8', '172.16.0.0/12', '192.168.0.0/16', 'fc00::/7'] -}; +} /** * Get all addresses in the request, optionally stopping @@ -45,201 +49,166 @@ var ipranges = { * * @param {Object} request * @param {Function|Array|String} [trust] - * @api public + * @public */ -function alladdrs(req, trust) { +function alladdrs (req, trust) { // get addresses - var addrs = forwarded(req); + var addrs = forwarded(req) if (!trust) { // Return all addresses - return addrs; + return addrs } if (typeof trust !== 'function') { - trust = compile(trust); + trust = compile(trust) } for (var i = 0; i < addrs.length - 1; i++) { - if (trust(addrs[i], i)) continue; + if (trust(addrs[i], i)) continue - addrs.length = i + 1; + addrs.length = i + 1 } - return addrs; + return addrs } /** * Compile argument into trust function. * * @param {Array|String} val - * @api private + * @private */ -function compile(val) { +function compile (val) { if (!val) { - throw new TypeError('argument is required'); + throw new TypeError('argument is required') } - var trust = typeof val === 'string' - ? [val] - : val; + var trust - if (!Array.isArray(trust)) { - throw new TypeError('unsupported trust argument'); + if (typeof val === 'string') { + trust = [val] + } else if (Array.isArray(val)) { + trust = val.slice() + } else { + throw new TypeError('unsupported trust argument') } for (var i = 0; i < trust.length; i++) { - val = trust[i]; + val = trust[i] - if (!ipranges.hasOwnProperty(val)) { - continue; + if (!Object.prototype.hasOwnProperty.call(IP_RANGES, val)) { + continue } // Splice in pre-defined range - val = ipranges[val]; - trust.splice.apply(trust, [i, 1].concat(val)); - i += val.length - 1; + val = IP_RANGES[val] + trust.splice.apply(trust, [i, 1].concat(val)) + i += val.length - 1 } - return compileTrust(compileRangeSubnets(trust)); + return compileTrust(compileRangeSubnets(trust)) } /** * Compile `arr` elements into range subnets. * * @param {Array} arr - * @api private + * @private */ -function compileRangeSubnets(arr) { - var rangeSubnets = new Array(arr.length); +function compileRangeSubnets (arr) { + var rangeSubnets = new Array(arr.length) for (var i = 0; i < arr.length; i++) { - rangeSubnets[i] = parseipNotation(arr[i]); + rangeSubnets[i] = parseipNotation(arr[i]) } - return rangeSubnets; + return rangeSubnets } /** * Compile range subnet array into trust function. * * @param {Array} rangeSubnets - * @api private + * @private */ -function compileTrust(rangeSubnets) { +function compileTrust (rangeSubnets) { // Return optimized function based on length - var len = rangeSubnets.length; + var len = rangeSubnets.length return len === 0 ? trustNone : len === 1 - ? trustSingle(rangeSubnets[0]) - : trustMulti(rangeSubnets); + ? trustSingle(rangeSubnets[0]) + : trustMulti(rangeSubnets) } /** * Parse IP notation string into range subnet. * * @param {String} note - * @api private + * @private */ -function parseipNotation(note) { - var ip; - var kind; - var max; - var pos = note.lastIndexOf('/'); - var range; - - ip = pos !== -1 +function parseipNotation (note) { + var pos = note.lastIndexOf('/') + var str = pos !== -1 ? note.substring(0, pos) - : note; + : note - if (!isip(ip)) { - throw new TypeError('invalid IP address: ' + ip); + if (!isip(str)) { + throw new TypeError('invalid IP address: ' + str) } - ip = parseip(ip); + var ip = parseip(str) - kind = ip.kind(); - max = kind === 'ipv6' - ? 128 - : 32; - - range = pos !== -1 - ? note.substring(pos + 1, note.length) - : max; - - if (typeof range !== 'number') { - range = digitre.test(range) - ? parseInt(range, 10) - : isip(range) - ? parseNetmask(range) - : 0; - } - - if (ip.kind() === 'ipv6' && ip.isIPv4MappedAddress()) { + if (pos === -1 && ip.kind() === 'ipv6' && ip.isIPv4MappedAddress()) { // Store as IPv4 - ip = ip.toIPv4Address(); - range = range <= max - ? range - 96 - : range; + ip = ip.toIPv4Address() + } + + var max = ip.kind() === 'ipv6' + ? 128 + : 32 + + var range = pos !== -1 + ? note.substring(pos + 1, note.length) + : null + + if (range === null) { + range = max + } else if (DIGIT_REGEXP.test(range)) { + range = parseInt(range, 10) + } else if (ip.kind() === 'ipv4' && isip(range)) { + range = parseNetmask(range) + } else { + range = null } if (range <= 0 || range > max) { - throw new TypeError('invalid range on address: ' + note); + throw new TypeError('invalid range on address: ' + note) } - return [ip, range]; + return [ip, range] } /** * Parse netmask string into CIDR range. * - * @param {String} note - * @api private + * @param {String} netmask + * @private */ -function parseNetmask(netmask) { - var ip = parseip(netmask); - var parts; - var size; +function parseNetmask (netmask) { + var ip = parseip(netmask) + var kind = ip.kind() - switch (ip.kind()) { - case 'ipv4': - parts = ip.octets; - size = 8; - break; - case 'ipv6': - parts = ip.parts; - size = 16; - break; - } - - var max = Math.pow(2, size) - 1; - var part; - var range = 0; - - for (var i = 0; i < parts.length; i++) { - part = parts[i] & max; - - if (part === max) { - range += size; - continue; - } - - while (part) { - part = (part << 1) & max; - range += 1; - } - - break; - } - - return range; + return kind === 'ipv4' + ? ip.prefixLengthFromSubnetMask() + : null } /** @@ -247,101 +216,112 @@ function parseNetmask(netmask) { * * @param {Object} request * @param {Function|Array|String} trust - * @api public + * @public */ -function proxyaddr(req, trust) { +function proxyaddr (req, trust) { if (!req) { - throw new TypeError('req argument is required'); + throw new TypeError('req argument is required') } if (!trust) { - throw new TypeError('trust argument is required'); + throw new TypeError('trust argument is required') } - var addrs = alladdrs(req, trust); - var addr = addrs[addrs.length - 1]; + var addrs = alladdrs(req, trust) + var addr = addrs[addrs.length - 1] - return addr; + return addr } /** * Static trust function to trust nothing. * - * @api private + * @private */ -function trustNone() { - return false; +function trustNone () { + return false } /** * Compile trust function for multiple subnets. * * @param {Array} subnets - * @api private + * @private */ -function trustMulti(subnets) { - return function trust(addr) { - if (!isip(addr)) return false; +function trustMulti (subnets) { + return function trust (addr) { + if (!isip(addr)) return false - var ip = parseip(addr); - var ipv4; - var kind = ip.kind(); - var subnet; - var subnetip; - var subnetkind; - var subnetrange; - var trusted; + var ip = parseip(addr) + var ipconv + var kind = ip.kind() for (var i = 0; i < subnets.length; i++) { - subnet = subnets[i]; - subnetip = subnet[0]; - subnetkind = subnetip.kind(); - subnetrange = subnet[1]; - trusted = ip; + var subnet = subnets[i] + var subnetip = subnet[0] + var subnetkind = subnetip.kind() + var subnetrange = subnet[1] + var trusted = ip if (kind !== subnetkind) { - if (kind !== 'ipv6' || subnetkind !== 'ipv4' || !ip.isIPv4MappedAddress()) { - continue; + if (subnetkind === 'ipv4' && !ip.isIPv4MappedAddress()) { + // Incompatible IP addresses + continue } - // Store addr as IPv4 - ipv4 = ipv4 || ip.toIPv4Address(); - trusted = ipv4; + if (!ipconv) { + // Convert IP to match subnet IP kind + ipconv = subnetkind === 'ipv4' + ? ip.toIPv4Address() + : ip.toIPv4MappedAddress() + } + + trusted = ipconv } - if (trusted.match(subnetip, subnetrange)) return true; + if (trusted.match(subnetip, subnetrange)) { + return true + } } - return false; - }; + return false + } } /** * Compile trust function for single subnet. * * @param {Object} subnet - * @api private + * @private */ -function trustSingle(subnet) { - var subnetip = subnet[0]; - var subnetkind = subnetip.kind(); - var subnetisipv4 = subnetkind === 'ipv4'; - var subnetrange = subnet[1]; +function trustSingle (subnet) { + var subnetip = subnet[0] + var subnetkind = subnetip.kind() + var subnetisipv4 = subnetkind === 'ipv4' + var subnetrange = subnet[1] - return function trust(addr) { - if (!isip(addr)) return false; + return function trust (addr) { + if (!isip(addr)) return false - var ip = parseip(addr); - var kind = ip.kind(); + var ip = parseip(addr) + var kind = ip.kind() - return kind === subnetkind - ? ip.match(subnetip, subnetrange) - : subnetisipv4 && kind === 'ipv6' && ip.isIPv4MappedAddress() - ? ip.toIPv4Address().match(subnetip, subnetrange) - : false; - }; + if (kind !== subnetkind) { + if (subnetisipv4 && !ip.isIPv4MappedAddress()) { + // Incompatible IP addresses + return false + } + + // Convert IP to match subnet IP kind + ip = subnetisipv4 + ? ip.toIPv4Address() + : ip.toIPv4MappedAddress() + } + + return ip.match(subnetip, subnetrange) + } } diff --git a/node_modules/proxy-addr/package.json b/node_modules/proxy-addr/package.json index 01ae822..24ba8f7 100644 --- a/node_modules/proxy-addr/package.json +++ b/node_modules/proxy-addr/package.json @@ -1,7 +1,7 @@ { "name": "proxy-addr", "description": "Determine address of proxied request", - "version": "1.0.10", + "version": "2.0.7", "author": "Douglas Christopher Wilson ", "license": "MIT", "keywords": [ @@ -11,14 +11,22 @@ ], "repository": "jshttp/proxy-addr", "dependencies": { - "forwarded": "~0.1.0", - "ipaddr.js": "1.0.5" + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" }, "devDependencies": { - "benchmark": "1.0.0", + "benchmark": "2.1.4", "beautify-benchmark": "0.2.4", - "istanbul": "0.4.1", - "mocha": "~1.21.5" + "deep-equal": "1.0.1", + "eslint": "7.26.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.23.4", + "eslint-plugin-markdown": "2.2.0", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "4.3.1", + "eslint-plugin-standard": "4.1.0", + "mocha": "8.4.0", + "nyc": "15.1.0" }, "files": [ "LICENSE", @@ -27,12 +35,13 @@ "index.js" ], "engines": { - "node": ">= 0.6" + "node": ">= 0.10" }, "scripts": { "bench": "node benchmark/index.js", + "lint": "eslint .", "test": "mocha --reporter spec --bail --check-leaks test/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + "test-ci": "nyc --reporter=lcov --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" } } diff --git a/node_modules/range-parser/HISTORY.md b/node_modules/range-parser/HISTORY.md index f640bea..70a973d 100644 --- a/node_modules/range-parser/HISTORY.md +++ b/node_modules/range-parser/HISTORY.md @@ -1,5 +1,21 @@ -unreleased -========== +1.2.1 / 2019-05-10 +================== + + * Improve error when `str` is not a string + +1.2.0 / 2016-06-01 +================== + + * Add `combine` option to combine overlapping ranges + +1.1.0 / 2016-05-13 +================== + + * Fix incorrectly returning -1 when there is at least one valid range + * perf: remove internal function + +1.0.3 / 2015-10-29 +================== * perf: enable strict mode diff --git a/node_modules/range-parser/LICENSE b/node_modules/range-parser/LICENSE index a491841..3599954 100644 --- a/node_modules/range-parser/LICENSE +++ b/node_modules/range-parser/LICENSE @@ -1,6 +1,7 @@ (The MIT License) -Copyright (c) 2012-2014 TJ Holowaychuk +Copyright (c) 2012-2014 TJ Holowaychuk +Copyright (c) 2015-2016 Douglas Christopher Wilson + ```js var parseRange = require('range-parser') ``` -### parseRange(size, header) +### parseRange(size, header, options) Parse the given `header` string where `size` is the maximum size of the resource. An array of ranges will be returned or negative numbers indicating an error parsing. * `-2` signals a malformed header string - * `-1` signals an invalid range + * `-1` signals an unsatisfiable range + + ```js // parse header from request -var range = parseRange(req.headers.range) +var range = parseRange(size, req.headers.range) // the type of the range if (range.type === 'bytes') { @@ -41,17 +49,36 @@ if (range.type === 'bytes') { } ``` +#### Options + +These properties are accepted in the options object. + +##### combine + +Specifies if overlapping & adjacent ranges should be combined, defaults to `false`. +When `true`, ranges will be combined and returned as if they were specified that +way in the header. + + + +```js +parseRange(100, 'bytes=50-55,0-10,5-10,56-60', { combine: true }) +// => [ +// { start: 0, end: 10 }, +// { start: 50, end: 60 } +// ] +``` + ## License [MIT](LICENSE) -[npm-image]: https://img.shields.io/npm/v/range-parser.svg +[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/range-parser/master +[coveralls-url]: https://coveralls.io/r/jshttp/range-parser?branch=master +[node-image]: https://badgen.net/npm/node/range-parser +[node-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/range-parser [npm-url]: https://npmjs.org/package/range-parser -[node-version-image]: https://img.shields.io/node/v/range-parser.svg -[node-version-url]: http://nodejs.org/download/ -[travis-image]: https://img.shields.io/travis/jshttp/range-parser.svg +[npm-version-image]: https://badgen.net/npm/v/range-parser +[travis-image]: https://badgen.net/travis/jshttp/range-parser/master [travis-url]: https://travis-ci.org/jshttp/range-parser -[coveralls-image]: https://img.shields.io/coveralls/jshttp/range-parser.svg -[coveralls-url]: https://coveralls.io/r/jshttp/range-parser -[downloads-image]: https://img.shields.io/npm/dm/range-parser.svg -[downloads-url]: https://npmjs.org/package/range-parser diff --git a/node_modules/range-parser/index.js b/node_modules/range-parser/index.js index 814e533..b7dc5c0 100644 --- a/node_modules/range-parser/index.js +++ b/node_modules/range-parser/index.js @@ -1,63 +1,162 @@ /*! * range-parser * Copyright(c) 2012-2014 TJ Holowaychuk + * Copyright(c) 2015-2016 Douglas Christopher Wilson * MIT Licensed */ -'use strict'; +'use strict' /** * Module exports. * @public */ -module.exports = rangeParser; +module.exports = rangeParser /** * Parse "Range" header `str` relative to the given file `size`. * * @param {Number} size * @param {String} str + * @param {Object} [options] * @return {Array} * @public */ -function rangeParser(size, str) { - var valid = true; - var i = str.indexOf('='); +function rangeParser (size, str, options) { + if (typeof str !== 'string') { + throw new TypeError('argument str must be a string') + } - if (-1 == i) return -2; + var index = str.indexOf('=') - var arr = str.slice(i + 1).split(',').map(function(range){ - var range = range.split('-') - , start = parseInt(range[0], 10) - , end = parseInt(range[1], 10); + if (index === -1) { + return -2 + } + + // split the range string + var arr = str.slice(index + 1).split(',') + var ranges = [] + + // add ranges type + ranges.type = str.slice(0, index) + + // parse all ranges + for (var i = 0; i < arr.length; i++) { + var range = arr[i].split('-') + var start = parseInt(range[0], 10) + var end = parseInt(range[1], 10) // -nnn if (isNaN(start)) { - start = size - end; - end = size - 1; + start = size - end + end = size - 1 // nnn- } else if (isNaN(end)) { - end = size - 1; + end = size - 1 } // limit last-byte-pos to current length - if (end > size - 1) end = size - 1; + if (end > size - 1) { + end = size - 1 + } - // invalid - if (isNaN(start) - || isNaN(end) - || start > end - || start < 0) valid = false; + // invalid or unsatisifiable + if (isNaN(start) || isNaN(end) || start > end || start < 0) { + continue + } - return { + // add range + ranges.push({ start: start, end: end - }; - }); + }) + } - arr.type = str.slice(0, i); + if (ranges.length < 1) { + // unsatisifiable + return -1 + } - return valid ? arr : -1; + return options && options.combine + ? combineRanges(ranges) + : ranges +} + +/** + * Combine overlapping & adjacent ranges. + * @private + */ + +function combineRanges (ranges) { + var ordered = ranges.map(mapWithIndex).sort(sortByRangeStart) + + for (var j = 0, i = 1; i < ordered.length; i++) { + var range = ordered[i] + var current = ordered[j] + + if (range.start > current.end + 1) { + // next range + ordered[++j] = range + } else if (range.end > current.end) { + // extend range + current.end = range.end + current.index = Math.min(current.index, range.index) + } + } + + // trim ordered array + ordered.length = j + 1 + + // generate combined range + var combined = ordered.sort(sortByRangeIndex).map(mapWithoutIndex) + + // copy ranges type + combined.type = ranges.type + + return combined +} + +/** + * Map function to add index value to ranges. + * @private + */ + +function mapWithIndex (range, index) { + return { + start: range.start, + end: range.end, + index: index + } +} + +/** + * Map function to remove index value from ranges. + * @private + */ + +function mapWithoutIndex (range) { + return { + start: range.start, + end: range.end + } +} + +/** + * Sort function to sort ranges by index. + * @private + */ + +function sortByRangeIndex (a, b) { + return a.index - b.index +} + +/** + * Sort function to sort ranges by start position. + * @private + */ + +function sortByRangeStart (a, b) { + return a.start - b.start } diff --git a/node_modules/range-parser/package.json b/node_modules/range-parser/package.json index 62abecc..abea6d8 100644 --- a/node_modules/range-parser/package.json +++ b/node_modules/range-parser/package.json @@ -2,7 +2,12 @@ "name": "range-parser", "author": "TJ Holowaychuk (http://tjholowaychuk.com)", "description": "Range header field string parser", - "version": "1.0.3", + "version": "1.2.1", + "contributors": [ + "Douglas Christopher Wilson ", + "James Wyatt Cready ", + "Jonathan Ong (http://jongleberry.com)" + ], "license": "MIT", "keywords": [ "range", @@ -11,8 +16,16 @@ ], "repository": "jshttp/range-parser", "devDependencies": { - "istanbul": "0.4.0", - "mocha": "1.21.5" + "deep-equal": "1.0.1", + "eslint": "5.16.0", + "eslint-config-standard": "12.0.0", + "eslint-plugin-markdown": "1.0.0", + "eslint-plugin-import": "2.17.2", + "eslint-plugin-node": "8.0.1", + "eslint-plugin-promise": "4.1.1", + "eslint-plugin-standard": "4.0.0", + "mocha": "6.1.4", + "nyc": "14.1.1" }, "files": [ "HISTORY.md", @@ -23,8 +36,9 @@ "node": ">= 0.6" }, "scripts": { + "lint": "eslint --plugin markdown --ext js,md .", "test": "mocha --reporter spec", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot" + "test-cov": "nyc --reporter=html --reporter=text npm test", + "test-travis": "nyc --reporter=text npm test" } } diff --git a/node_modules/raw-body/HISTORY.md b/node_modules/raw-body/HISTORY.md index baf0e2d..0b6b837 100644 --- a/node_modules/raw-body/HISTORY.md +++ b/node_modules/raw-body/HISTORY.md @@ -1,8 +1,3 @@ -2.5.2 / 2023-02-21 -================== - - * Fix error message for non-stream argument - 2.5.1 / 2022-02-28 ================== diff --git a/node_modules/raw-body/README.md b/node_modules/raw-body/README.md index d9b36d6..695c660 100644 --- a/node_modules/raw-body/README.md +++ b/node_modules/raw-body/README.md @@ -219,5 +219,5 @@ server.listen(3000); [coveralls-url]: https://coveralls.io/r/stream-utils/raw-body?branch=master [downloads-image]: https://img.shields.io/npm/dm/raw-body.svg [downloads-url]: https://npmjs.org/package/raw-body -[github-actions-ci-image]: https://img.shields.io/github/actions/workflow/status/stream-utils/raw-body/ci.yml?branch=master&label=ci +[github-actions-ci-image]: https://img.shields.io/github/workflow/status/stream-utils/raw-body/ci/master?label=ci [github-actions-ci-url]: https://github.com/jshttp/stream-utils/raw-body?query=workflow%3Aci diff --git a/node_modules/raw-body/index.js b/node_modules/raw-body/index.js index 9cdcd12..a8f537f 100644 --- a/node_modules/raw-body/index.js +++ b/node_modules/raw-body/index.js @@ -69,13 +69,6 @@ function getRawBody (stream, options, callback) { var done = callback var opts = options || {} - // light validation - if (stream === undefined) { - throw new TypeError('argument stream is required') - } else if (typeof stream !== 'object' || stream === null || typeof stream.on !== 'function') { - throw new TypeError('argument stream must be a stream') - } - if (options === true || typeof options === 'string') { // short cut for encoding opts = { diff --git a/node_modules/raw-body/package.json b/node_modules/raw-body/package.json index aabb1c3..50fc90a 100644 --- a/node_modules/raw-body/package.json +++ b/node_modules/raw-body/package.json @@ -1,7 +1,7 @@ { "name": "raw-body", "description": "Get and validate the raw body of a readable stream.", - "version": "2.5.2", + "version": "2.5.1", "author": "Jonathan Ong (http://jongleberry.com)", "contributors": [ "Douglas Christopher Wilson ", @@ -17,14 +17,14 @@ }, "devDependencies": { "bluebird": "3.7.2", - "eslint": "8.34.0", - "eslint-config-standard": "15.0.1", - "eslint-plugin-import": "2.27.5", - "eslint-plugin-markdown": "3.0.0", + "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": "6.1.1", + "eslint-plugin-promise": "5.2.0", "eslint-plugin-standard": "4.1.0", - "mocha": "10.2.0", + "mocha": "9.2.1", "nyc": "15.1.0", "readable-stream": "2.3.7", "safe-buffer": "5.2.1" diff --git a/node_modules/readable-stream/.travis.yml b/node_modules/readable-stream/.travis.yml new file mode 100644 index 0000000..f62cdac --- /dev/null +++ b/node_modules/readable-stream/.travis.yml @@ -0,0 +1,34 @@ +sudo: false +language: node_js +before_install: + - (test $NPM_LEGACY && npm install -g npm@2 && npm install -g npm@3) || true +notifications: + email: false +matrix: + fast_finish: true + include: + - node_js: '0.8' + env: NPM_LEGACY=true + - node_js: '0.10' + env: NPM_LEGACY=true + - node_js: '0.11' + env: NPM_LEGACY=true + - node_js: '0.12' + env: NPM_LEGACY=true + - node_js: 1 + env: NPM_LEGACY=true + - node_js: 2 + env: NPM_LEGACY=true + - node_js: 3 + env: NPM_LEGACY=true + - node_js: 4 + - node_js: 5 + - node_js: 6 + - node_js: 7 + - node_js: 8 + - node_js: 9 +script: "npm run test" +env: + global: + - secure: rE2Vvo7vnjabYNULNyLFxOyt98BoJexDqsiOnfiD6kLYYsiQGfr/sbZkPMOFm9qfQG7pjqx+zZWZjGSswhTt+626C0t/njXqug7Yps4c3dFblzGfreQHp7wNX5TFsvrxd6dAowVasMp61sJcRnB2w8cUzoe3RAYUDHyiHktwqMc= + - secure: g9YINaKAdMatsJ28G9jCGbSaguXCyxSTy+pBO6Ch0Cf57ZLOTka3HqDj8p3nV28LUIHZ3ut5WO43CeYKwt4AUtLpBS3a0dndHdY6D83uY6b2qh5hXlrcbeQTq2cvw2y95F7hm4D1kwrgZ7ViqaKggRcEupAL69YbJnxeUDKWEdI= diff --git a/node_modules/readable-stream/CONTRIBUTING.md b/node_modules/readable-stream/CONTRIBUTING.md new file mode 100644 index 0000000..f478d58 --- /dev/null +++ b/node_modules/readable-stream/CONTRIBUTING.md @@ -0,0 +1,38 @@ +# Developer's Certificate of Origin 1.1 + +By making a contribution to this project, I certify that: + +* (a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + +* (b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a different license), as indicated + in the file; or + +* (c) The contribution was provided directly to me by some other + person who certified (a), (b) or (c) and I have not modified + it. + +* (d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. + +## Moderation Policy + +The [Node.js Moderation Policy] applies to this WG. + +## Code of Conduct + +The [Node.js Code of Conduct][] applies to this WG. + +[Node.js Code of Conduct]: +https://github.com/nodejs/node/blob/master/CODE_OF_CONDUCT.md +[Node.js Moderation Policy]: +https://github.com/nodejs/TSC/blob/master/Moderation-Policy.md diff --git a/node_modules/readable-stream/GOVERNANCE.md b/node_modules/readable-stream/GOVERNANCE.md new file mode 100644 index 0000000..16ffb93 --- /dev/null +++ b/node_modules/readable-stream/GOVERNANCE.md @@ -0,0 +1,136 @@ +### Streams Working Group + +The Node.js Streams is jointly governed by a Working Group +(WG) +that is responsible for high-level guidance of the project. + +The WG has final authority over this project including: + +* Technical direction +* Project governance and process (including this policy) +* Contribution policy +* GitHub repository hosting +* Conduct guidelines +* Maintaining the list of additional Collaborators + +For the current list of WG members, see the project +[README.md](./README.md#current-project-team-members). + +### Collaborators + +The readable-stream GitHub repository is +maintained by the WG and additional Collaborators who are added by the +WG on an ongoing basis. + +Individuals making significant and valuable contributions are made +Collaborators and given commit-access to the project. These +individuals are identified by the WG and their addition as +Collaborators is discussed during the WG meeting. + +_Note:_ If you make a significant contribution and are not considered +for commit-access log an issue or contact a WG member directly and it +will be brought up in the next WG meeting. + +Modifications of the contents of the readable-stream repository are +made on +a collaborative basis. Anybody with a GitHub account may propose a +modification via pull request and it will be considered by the project +Collaborators. All pull requests must be reviewed and accepted by a +Collaborator with sufficient expertise who is able to take full +responsibility for the change. In the case of pull requests proposed +by an existing Collaborator, an additional Collaborator is required +for sign-off. Consensus should be sought if additional Collaborators +participate and there is disagreement around a particular +modification. See _Consensus Seeking Process_ below for further detail +on the consensus model used for governance. + +Collaborators may opt to elevate significant or controversial +modifications, or modifications that have not found consensus to the +WG for discussion by assigning the ***WG-agenda*** tag to a pull +request or issue. The WG should serve as the final arbiter where +required. + +For the current list of Collaborators, see the project +[README.md](./README.md#members). + +### WG Membership + +WG seats are not time-limited. There is no fixed size of the WG. +However, the expected target is between 6 and 12, to ensure adequate +coverage of important areas of expertise, balanced with the ability to +make decisions efficiently. + +There is no specific set of requirements or qualifications for WG +membership beyond these rules. + +The WG may add additional members to the WG by unanimous consensus. + +A WG member may be removed from the WG by voluntary resignation, or by +unanimous consensus of all other WG members. + +Changes to WG membership should be posted in the agenda, and may be +suggested as any other agenda item (see "WG Meetings" below). + +If an addition or removal is proposed during a meeting, and the full +WG is not in attendance to participate, then the addition or removal +is added to the agenda for the subsequent meeting. This is to ensure +that all members are given the opportunity to participate in all +membership decisions. If a WG member is unable to attend a meeting +where a planned membership decision is being made, then their consent +is assumed. + +No more than 1/3 of the WG members may be affiliated with the same +employer. If removal or resignation of a WG member, or a change of +employment by a WG member, creates a situation where more than 1/3 of +the WG membership shares an employer, then the situation must be +immediately remedied by the resignation or removal of one or more WG +members affiliated with the over-represented employer(s). + +### WG Meetings + +The WG meets occasionally on a Google Hangout On Air. A designated moderator +approved by the WG runs the meeting. Each meeting should be +published to YouTube. + +Items are added to the WG agenda that are considered contentious or +are modifications of governance, contribution policy, WG membership, +or release process. + +The intention of the agenda is not to approve or review all patches; +that should happen continuously on GitHub and be handled by the larger +group of Collaborators. + +Any community member or contributor can ask that something be added to +the next meeting's agenda by logging a GitHub Issue. Any Collaborator, +WG member or the moderator can add the item to the agenda by adding +the ***WG-agenda*** tag to the issue. + +Prior to each WG meeting the moderator will share the Agenda with +members of the WG. WG members can add any items they like to the +agenda at the beginning of each meeting. The moderator and the WG +cannot veto or remove items. + +The WG may invite persons or representatives from certain projects to +participate in a non-voting capacity. + +The moderator is responsible for summarizing the discussion of each +agenda item and sends it as a pull request after the meeting. + +### Consensus Seeking Process + +The WG follows a +[Consensus +Seeking](http://en.wikipedia.org/wiki/Consensus-seeking_decision-making) +decision-making model. + +When an agenda item has appeared to reach a consensus the moderator +will ask "Does anyone object?" as a final call for dissent from the +consensus. + +If an agenda item cannot reach a consensus a WG member can call for +either a closing vote or a vote to table the issue to the next +meeting. The call for a vote must be seconded by a majority of the WG +or else the discussion will continue. Simple majority wins. + +Note that changes to WG membership require a majority consensus. See +"WG Membership" above. diff --git a/node_modules/readable-stream/LICENSE b/node_modules/readable-stream/LICENSE new file mode 100644 index 0000000..2873b3b --- /dev/null +++ b/node_modules/readable-stream/LICENSE @@ -0,0 +1,47 @@ +Node.js is licensed for use as follows: + +""" +Copyright Node.js contributors. All rights reserved. + +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. +""" + +This license applies to parts of Node.js originating from the +https://github.com/joyent/node repository: + +""" +Copyright Joyent, Inc. and other Node contributors. All rights reserved. +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/readable-stream/README.md b/node_modules/readable-stream/README.md new file mode 100644 index 0000000..23fe3f3 --- /dev/null +++ b/node_modules/readable-stream/README.md @@ -0,0 +1,58 @@ +# readable-stream + +***Node-core v8.11.1 streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream) + + +[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/) +[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/) + + +[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream) + +```bash +npm install --save readable-stream +``` + +***Node-core streams for userland*** + +This package is a mirror of the Streams2 and Streams3 implementations in +Node-core. + +Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.11.1/docs/api/stream.html). + +If you want to guarantee a stable streams base, regardless of what version of +Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html). + +As of version 2.0.0 **readable-stream** uses semantic versioning. + +# Streams Working Group + +`readable-stream` is maintained by the Streams Working Group, which +oversees the development and maintenance of the Streams API within +Node.js. The responsibilities of the Streams Working Group include: + +* Addressing stream issues on the Node.js issue tracker. +* Authoring and editing stream documentation within the Node.js project. +* Reviewing changes to stream subclasses within the Node.js project. +* Redirecting changes to streams from the Node.js project to this + project. +* Assisting in the implementation of stream providers within Node.js. +* Recommending versions of `readable-stream` to be included in Node.js. +* Messaging about the future of streams to give the community advance + notice of changes. + + +## Team Members + +* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) <christopher.s.dickinson@gmail.com> + - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B +* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com> + - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242 +* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) <rod@vagg.org> + - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D +* **Sam Newman** ([@sonewman](https://github.com/sonewman)) <newmansam@outlook.com> +* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com> +* **Domenic Denicola** ([@domenic](https://github.com/domenic)) <d@domenic.me> +* **Matteo Collina** ([@mcollina](https://github.com/mcollina)) <matteo.collina@gmail.com> + - Release GPG key: 3ABC01543F22DD2239285CDD818674489FBC127E +* **Irina Shestak** ([@lrlna](https://github.com/lrlna)) <shestak.irina@gmail.com> diff --git a/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md new file mode 100644 index 0000000..83275f1 --- /dev/null +++ b/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md @@ -0,0 +1,60 @@ +# streams WG Meeting 2015-01-30 + +## Links + +* **Google Hangouts Video**: http://www.youtube.com/watch?v=I9nDOSGfwZg +* **GitHub Issue**: https://github.com/iojs/readable-stream/issues/106 +* **Original Minutes Google Doc**: https://docs.google.com/document/d/17aTgLnjMXIrfjgNaTUnHQO7m3xgzHR2VXBTmi03Qii4/ + +## Agenda + +Extracted from https://github.com/iojs/readable-stream/labels/wg-agenda prior to meeting. + +* adopt a charter [#105](https://github.com/iojs/readable-stream/issues/105) +* release and versioning strategy [#101](https://github.com/iojs/readable-stream/issues/101) +* simpler stream creation [#102](https://github.com/iojs/readable-stream/issues/102) +* proposal: deprecate implicit flowing of streams [#99](https://github.com/iojs/readable-stream/issues/99) + +## Minutes + +### adopt a charter + +* group: +1's all around + +### What versioning scheme should be adopted? +* group: +1’s 3.0.0 +* domenic+group: pulling in patches from other sources where appropriate +* mikeal: version independently, suggesting versions for io.js +* mikeal+domenic: work with TC to notify in advance of changes +simpler stream creation + +### streamline creation of streams +* sam: streamline creation of streams +* domenic: nice simple solution posted + but, we lose the opportunity to change the model + may not be backwards incompatible (double check keys) + + **action item:** domenic will check + +### remove implicit flowing of streams on(‘data’) +* add isFlowing / isPaused +* mikeal: worrying that we’re documenting polyfill methods – confuses users +* domenic: more reflective API is probably good, with warning labels for users +* new section for mad scientists (reflective stream access) +* calvin: name the “third state” +* mikeal: maybe borrow the name from whatwg? +* domenic: we’re missing the “third state” +* consensus: kind of difficult to name the third state +* mikeal: figure out differences in states / compat +* mathias: always flow on data – eliminates third state + * explore what it breaks + +**action items:** +* ask isaac for ability to list packages by what public io.js APIs they use (esp. Stream) +* ask rod/build for infrastructure +* **chris**: explore the “flow on data” approach +* add isPaused/isFlowing +* add new docs section +* move isPaused to that section + + diff --git a/node_modules/readable-stream/duplex-browser.js b/node_modules/readable-stream/duplex-browser.js new file mode 100644 index 0000000..f8b2db8 --- /dev/null +++ b/node_modules/readable-stream/duplex-browser.js @@ -0,0 +1 @@ +module.exports = require('./lib/_stream_duplex.js'); diff --git a/node_modules/readable-stream/duplex.js b/node_modules/readable-stream/duplex.js new file mode 100644 index 0000000..46924cb --- /dev/null +++ b/node_modules/readable-stream/duplex.js @@ -0,0 +1 @@ +module.exports = require('./readable').Duplex diff --git a/node_modules/readable-stream/lib/_stream_duplex.js b/node_modules/readable-stream/lib/_stream_duplex.js new file mode 100644 index 0000000..57003c3 --- /dev/null +++ b/node_modules/readable-stream/lib/_stream_duplex.js @@ -0,0 +1,131 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// 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. + +// a duplex stream is just a stream that is both readable and writable. +// Since JS doesn't have multiple prototypal inheritance, this class +// prototypally inherits from Readable, and then parasitically from +// Writable. + +'use strict'; + +/**/ + +var pna = require('process-nextick-args'); +/**/ + +/**/ +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) { + keys.push(key); + }return keys; +}; +/**/ + +module.exports = Duplex; + +/**/ +var util = Object.create(require('core-util-is')); +util.inherits = require('inherits'); +/**/ + +var Readable = require('./_stream_readable'); +var Writable = require('./_stream_writable'); + +util.inherits(Duplex, Readable); + +{ + // avoid scope creep, the keys array can then be collected + var keys = objectKeys(Writable.prototype); + for (var v = 0; v < keys.length; v++) { + var method = keys[v]; + if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; + } +} + +function Duplex(options) { + if (!(this instanceof Duplex)) return new Duplex(options); + + Readable.call(this, options); + Writable.call(this, options); + + if (options && options.readable === false) this.readable = false; + + if (options && options.writable === false) this.writable = false; + + this.allowHalfOpen = true; + if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; + + this.once('end', onend); +} + +Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._writableState.highWaterMark; + } +}); + +// the no-half-open enforcer +function onend() { + // if we allow half-open state, or if the writable side ended, + // then we're ok. + if (this.allowHalfOpen || this._writableState.ended) return; + + // no more data can be written. + // But allow more writes to happen in this tick. + pna.nextTick(onEndNT, this); +} + +function onEndNT(self) { + self.end(); +} + +Object.defineProperty(Duplex.prototype, 'destroyed', { + get: function () { + if (this._readableState === undefined || this._writableState === undefined) { + return false; + } + return this._readableState.destroyed && this._writableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (this._readableState === undefined || this._writableState === undefined) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._readableState.destroyed = value; + this._writableState.destroyed = value; + } +}); + +Duplex.prototype._destroy = function (err, cb) { + this.push(null); + this.end(); + + pna.nextTick(cb, err); +}; \ No newline at end of file diff --git a/node_modules/readable-stream/lib/_stream_passthrough.js b/node_modules/readable-stream/lib/_stream_passthrough.js new file mode 100644 index 0000000..612edb4 --- /dev/null +++ b/node_modules/readable-stream/lib/_stream_passthrough.js @@ -0,0 +1,47 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// 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. + +// a passthrough stream. +// basically just the most minimal sort of Transform stream. +// Every written chunk gets output as-is. + +'use strict'; + +module.exports = PassThrough; + +var Transform = require('./_stream_transform'); + +/**/ +var util = Object.create(require('core-util-is')); +util.inherits = require('inherits'); +/**/ + +util.inherits(PassThrough, Transform); + +function PassThrough(options) { + if (!(this instanceof PassThrough)) return new PassThrough(options); + + Transform.call(this, options); +} + +PassThrough.prototype._transform = function (chunk, encoding, cb) { + cb(null, chunk); +}; \ No newline at end of file diff --git a/node_modules/readable-stream/lib/_stream_readable.js b/node_modules/readable-stream/lib/_stream_readable.js new file mode 100644 index 0000000..0f80764 --- /dev/null +++ b/node_modules/readable-stream/lib/_stream_readable.js @@ -0,0 +1,1019 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// 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. + +'use strict'; + +/**/ + +var pna = require('process-nextick-args'); +/**/ + +module.exports = Readable; + +/**/ +var isArray = require('isarray'); +/**/ + +/**/ +var Duplex; +/**/ + +Readable.ReadableState = ReadableState; + +/**/ +var EE = require('events').EventEmitter; + +var EElistenerCount = function (emitter, type) { + return emitter.listeners(type).length; +}; +/**/ + +/**/ +var Stream = require('./internal/streams/stream'); +/**/ + +/**/ + +var Buffer = require('safe-buffer').Buffer; +var OurUint8Array = global.Uint8Array || function () {}; +function _uint8ArrayToBuffer(chunk) { + return Buffer.from(chunk); +} +function _isUint8Array(obj) { + return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; +} + +/**/ + +/**/ +var util = Object.create(require('core-util-is')); +util.inherits = require('inherits'); +/**/ + +/**/ +var debugUtil = require('util'); +var debug = void 0; +if (debugUtil && debugUtil.debuglog) { + debug = debugUtil.debuglog('stream'); +} else { + debug = function () {}; +} +/**/ + +var BufferList = require('./internal/streams/BufferList'); +var destroyImpl = require('./internal/streams/destroy'); +var StringDecoder; + +util.inherits(Readable, Stream); + +var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; + +function prependListener(emitter, event, fn) { + // Sadly this is not cacheable as some libraries bundle their own + // event emitter implementation with them. + if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); + + // This is a hack to make sure that our error handler is attached before any + // userland ones. NEVER DO THIS. This is here only because this code needs + // to continue to work with older versions of Node.js that do not include + // the prependListener() method. The goal is to eventually remove this hack. + if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; +} + +function ReadableState(options, stream) { + Duplex = Duplex || require('./_stream_duplex'); + + options = options || {}; + + // Duplex streams are both readable and writable, but share + // the same options object. + // However, some cases require setting options to different + // values for the readable and the writable sides of the duplex stream. + // These options can be provided separately as readableXXX and writableXXX. + var isDuplex = stream instanceof Duplex; + + // object stream flag. Used to make read(n) ignore n and to + // make all the buffer merging and length checks go away + this.objectMode = !!options.objectMode; + + if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; + + // the point at which it stops calling _read() to fill the buffer + // Note: 0 is a valid value, means "don't call _read preemptively ever" + var hwm = options.highWaterMark; + var readableHwm = options.readableHighWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + + if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm; + + // cast to ints. + this.highWaterMark = Math.floor(this.highWaterMark); + + // A linked list is used to store data chunks instead of an array because the + // linked list can remove elements from the beginning faster than + // array.shift() + this.buffer = new BufferList(); + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = null; + this.ended = false; + this.endEmitted = false; + this.reading = false; + + // a flag to be able to tell if the event 'readable'/'data' is emitted + // immediately, or on a later tick. We set this to true at first, because + // any actions that shouldn't happen until "later" should generally also + // not happen before the first read call. + this.sync = true; + + // whenever we return null, then we set a flag to say + // that we're awaiting a 'readable' event emission. + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + this.resumeScheduled = false; + + // has it been destroyed + this.destroyed = false; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // the number of writers that are awaiting a drain event in .pipe()s + this.awaitDrain = 0; + + // if true, a maybeReadMore has been scheduled + this.readingMore = false; + + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; + } +} + +function Readable(options) { + Duplex = Duplex || require('./_stream_duplex'); + + if (!(this instanceof Readable)) return new Readable(options); + + this._readableState = new ReadableState(options, this); + + // legacy + this.readable = true; + + if (options) { + if (typeof options.read === 'function') this._read = options.read; + + if (typeof options.destroy === 'function') this._destroy = options.destroy; + } + + Stream.call(this); +} + +Object.defineProperty(Readable.prototype, 'destroyed', { + get: function () { + if (this._readableState === undefined) { + return false; + } + return this._readableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._readableState) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._readableState.destroyed = value; + } +}); + +Readable.prototype.destroy = destroyImpl.destroy; +Readable.prototype._undestroy = destroyImpl.undestroy; +Readable.prototype._destroy = function (err, cb) { + this.push(null); + cb(err); +}; + +// Manually shove something into the read() buffer. +// This returns true if the highWaterMark has not been hit yet, +// similar to how Writable.write() returns true if you should +// write() some more. +Readable.prototype.push = function (chunk, encoding) { + var state = this._readableState; + var skipChunkCheck; + + if (!state.objectMode) { + if (typeof chunk === 'string') { + encoding = encoding || state.defaultEncoding; + if (encoding !== state.encoding) { + chunk = Buffer.from(chunk, encoding); + encoding = ''; + } + skipChunkCheck = true; + } + } else { + skipChunkCheck = true; + } + + return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); +}; + +// Unshift should *always* be something directly out of read() +Readable.prototype.unshift = function (chunk) { + return readableAddChunk(this, chunk, null, true, false); +}; + +function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { + var state = stream._readableState; + if (chunk === null) { + state.reading = false; + onEofChunk(stream, state); + } else { + var er; + if (!skipChunkCheck) er = chunkInvalid(state, chunk); + if (er) { + stream.emit('error', er); + } else if (state.objectMode || chunk && chunk.length > 0) { + if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { + chunk = _uint8ArrayToBuffer(chunk); + } + + if (addToFront) { + if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true); + } else if (state.ended) { + stream.emit('error', new Error('stream.push() after EOF')); + } else { + state.reading = false; + if (state.decoder && !encoding) { + chunk = state.decoder.write(chunk); + if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); + } else { + addChunk(stream, state, chunk, false); + } + } + } else if (!addToFront) { + state.reading = false; + } + } + + return needMoreData(state); +} + +function addChunk(stream, state, chunk, addToFront) { + if (state.flowing && state.length === 0 && !state.sync) { + stream.emit('data', chunk); + stream.read(0); + } else { + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); + + if (state.needReadable) emitReadable(stream); + } + maybeReadMore(stream, state); +} + +function chunkInvalid(state, chunk) { + var er; + if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + return er; +} + +// if it's past the high water mark, we can push in some more. +// Also, if we have no data yet, we can stand some +// more bytes. This is to work around cases where hwm=0, +// such as the repl. Also, if the push() triggered a +// readable event, and the user called read(largeNumber) such that +// needReadable was set, then we ought to push more, so that another +// 'readable' event will be triggered. +function needMoreData(state) { + return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); +} + +Readable.prototype.isPaused = function () { + return this._readableState.flowing === false; +}; + +// backwards compatibility. +Readable.prototype.setEncoding = function (enc) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; + this._readableState.decoder = new StringDecoder(enc); + this._readableState.encoding = enc; + return this; +}; + +// Don't raise the hwm > 8MB +var MAX_HWM = 0x800000; +function computeNewHighWaterMark(n) { + if (n >= MAX_HWM) { + n = MAX_HWM; + } else { + // Get the next highest power of 2 to prevent increasing hwm excessively in + // tiny amounts + n--; + n |= n >>> 1; + n |= n >>> 2; + n |= n >>> 4; + n |= n >>> 8; + n |= n >>> 16; + n++; + } + return n; +} + +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function howMuchToRead(n, state) { + if (n <= 0 || state.length === 0 && state.ended) return 0; + if (state.objectMode) return 1; + if (n !== n) { + // Only flow one buffer at a time + if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; + } + // If we're asking for more than the current hwm, then raise the hwm. + if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); + if (n <= state.length) return n; + // Don't have enough + if (!state.ended) { + state.needReadable = true; + return 0; + } + return state.length; +} + +// you can override either this method, or the async _read(n) below. +Readable.prototype.read = function (n) { + debug('read', n); + n = parseInt(n, 10); + var state = this._readableState; + var nOrig = n; + + if (n !== 0) state.emittedReadable = false; + + // if we're doing read(0) to trigger a readable event, but we + // already have a bunch of data in the buffer, then just trigger + // the 'readable' event and move on. + if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { + debug('read: emitReadable', state.length, state.ended); + if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); + return null; + } + + n = howMuchToRead(n, state); + + // if we've ended, and we're now clear, then finish it up. + if (n === 0 && state.ended) { + if (state.length === 0) endReadable(this); + return null; + } + + // All the actual chunk generation logic needs to be + // *below* the call to _read. The reason is that in certain + // synthetic stream cases, such as passthrough streams, _read + // may be a completely synchronous operation which may change + // the state of the read buffer, providing enough data when + // before there was *not* enough. + // + // So, the steps are: + // 1. Figure out what the state of things will be after we do + // a read from the buffer. + // + // 2. If that resulting state will trigger a _read, then call _read. + // Note that this may be asynchronous, or synchronous. Yes, it is + // deeply ugly to write APIs this way, but that still doesn't mean + // that the Readable class should behave improperly, as streams are + // designed to be sync/async agnostic. + // Take note if the _read call is sync or async (ie, if the read call + // has returned yet), so that we know whether or not it's safe to emit + // 'readable' etc. + // + // 3. Actually pull the requested chunks out of the buffer and return. + + // if we need a readable event, then we need to do some reading. + var doRead = state.needReadable; + debug('need readable', doRead); + + // if we currently have less than the highWaterMark, then also read some + if (state.length === 0 || state.length - n < state.highWaterMark) { + doRead = true; + debug('length less than watermark', doRead); + } + + // however, if we've ended, then there's no point, and if we're already + // reading, then it's unnecessary. + if (state.ended || state.reading) { + doRead = false; + debug('reading or ended', doRead); + } else if (doRead) { + debug('do read'); + state.reading = true; + state.sync = true; + // if the length is currently zero, then we *need* a readable event. + if (state.length === 0) state.needReadable = true; + // call internal read method + this._read(state.highWaterMark); + state.sync = false; + // If _read pushed data synchronously, then `reading` will be false, + // and we need to re-evaluate how much data we can return to the user. + if (!state.reading) n = howMuchToRead(nOrig, state); + } + + var ret; + if (n > 0) ret = fromList(n, state);else ret = null; + + if (ret === null) { + state.needReadable = true; + n = 0; + } else { + state.length -= n; + } + + if (state.length === 0) { + // If we have nothing in the buffer, then we want to know + // as soon as we *do* get something into the buffer. + if (!state.ended) state.needReadable = true; + + // If we tried to read() past the EOF, then emit end on the next tick. + if (nOrig !== n && state.ended) endReadable(this); + } + + if (ret !== null) this.emit('data', ret); + + return ret; +}; + +function onEofChunk(stream, state) { + if (state.ended) return; + if (state.decoder) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) { + state.buffer.push(chunk); + state.length += state.objectMode ? 1 : chunk.length; + } + } + state.ended = true; + + // emit 'readable' now to make sure it gets picked up. + emitReadable(stream); +} + +// Don't emit readable right away in sync mode, because this can trigger +// another read() call => stack overflow. This way, it might trigger +// a nextTick recursion warning, but that's not so bad. +function emitReadable(stream) { + var state = stream._readableState; + state.needReadable = false; + if (!state.emittedReadable) { + debug('emitReadable', state.flowing); + state.emittedReadable = true; + if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream); + } +} + +function emitReadable_(stream) { + debug('emit readable'); + stream.emit('readable'); + flow(stream); +} + +// at this point, the user has presumably seen the 'readable' event, +// and called read() to consume some data. that may have triggered +// in turn another _read(n) call, in which case reading = true if +// it's in progress. +// However, if we're not ended, or reading, and the length < hwm, +// then go ahead and try to read some more preemptively. +function maybeReadMore(stream, state) { + if (!state.readingMore) { + state.readingMore = true; + pna.nextTick(maybeReadMore_, stream, state); + } +} + +function maybeReadMore_(stream, state) { + var len = state.length; + while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { + debug('maybeReadMore read 0'); + stream.read(0); + if (len === state.length) + // didn't get any data, stop spinning. + break;else len = state.length; + } + state.readingMore = false; +} + +// abstract method. to be overridden in specific implementation classes. +// call cb(er, data) where data is <= n in length. +// for virtual (non-string, non-buffer) streams, "length" is somewhat +// arbitrary, and perhaps not very meaningful. +Readable.prototype._read = function (n) { + this.emit('error', new Error('_read() is not implemented')); +}; + +Readable.prototype.pipe = function (dest, pipeOpts) { + var src = this; + var state = this._readableState; + + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; + case 1: + state.pipes = [state.pipes, dest]; + break; + default: + state.pipes.push(dest); + break; + } + state.pipesCount += 1; + debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); + + var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; + + var endFn = doEnd ? onend : unpipe; + if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn); + + dest.on('unpipe', onunpipe); + function onunpipe(readable, unpipeInfo) { + debug('onunpipe'); + if (readable === src) { + if (unpipeInfo && unpipeInfo.hasUnpiped === false) { + unpipeInfo.hasUnpiped = true; + cleanup(); + } + } + } + + function onend() { + debug('onend'); + dest.end(); + } + + // when the dest drains, it reduces the awaitDrain counter + // on the source. This would be more elegant with a .once() + // handler in flow(), but adding and removing repeatedly is + // too slow. + var ondrain = pipeOnDrain(src); + dest.on('drain', ondrain); + + var cleanedUp = false; + function cleanup() { + debug('cleanup'); + // cleanup event handlers once the pipe is broken + dest.removeListener('close', onclose); + dest.removeListener('finish', onfinish); + dest.removeListener('drain', ondrain); + dest.removeListener('error', onerror); + dest.removeListener('unpipe', onunpipe); + src.removeListener('end', onend); + src.removeListener('end', unpipe); + src.removeListener('data', ondata); + + cleanedUp = true; + + // if the reader is waiting for a drain event from this + // specific writer, then it would cause it to never start + // flowing again. + // So, if this is awaiting a drain, then we just call it now. + // If we don't know, then assume that we are waiting for one. + if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); + } + + // If the user pushes more data while we're writing to dest then we'll end up + // in ondata again. However, we only want to increase awaitDrain once because + // dest will only emit one 'drain' event for the multiple writes. + // => Introduce a guard on increasing awaitDrain. + var increasedAwaitDrain = false; + src.on('data', ondata); + function ondata(chunk) { + debug('ondata'); + increasedAwaitDrain = false; + var ret = dest.write(chunk); + if (false === ret && !increasedAwaitDrain) { + // If the user unpiped during `dest.write()`, it is possible + // to get stuck in a permanently paused state if that write + // also returned false. + // => Check whether `dest` is still a piping destination. + if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { + debug('false write response, pause', src._readableState.awaitDrain); + src._readableState.awaitDrain++; + increasedAwaitDrain = true; + } + src.pause(); + } + } + + // if the dest has an error, then stop piping into it. + // however, don't suppress the throwing behavior for this. + function onerror(er) { + debug('onerror', er); + unpipe(); + dest.removeListener('error', onerror); + if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); + } + + // Make sure our error handler is attached before userland ones. + prependListener(dest, 'error', onerror); + + // Both close and finish should trigger unpipe, but only once. + function onclose() { + dest.removeListener('finish', onfinish); + unpipe(); + } + dest.once('close', onclose); + function onfinish() { + debug('onfinish'); + dest.removeListener('close', onclose); + unpipe(); + } + dest.once('finish', onfinish); + + function unpipe() { + debug('unpipe'); + src.unpipe(dest); + } + + // tell the dest that it's being piped to + dest.emit('pipe', src); + + // start the flow if it hasn't been started already. + if (!state.flowing) { + debug('pipe resume'); + src.resume(); + } + + return dest; +}; + +function pipeOnDrain(src) { + return function () { + var state = src._readableState; + debug('pipeOnDrain', state.awaitDrain); + if (state.awaitDrain) state.awaitDrain--; + if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { + state.flowing = true; + flow(src); + } + }; +} + +Readable.prototype.unpipe = function (dest) { + var state = this._readableState; + var unpipeInfo = { hasUnpiped: false }; + + // if we're not piping anywhere, then do nothing. + if (state.pipesCount === 0) return this; + + // just one destination. most common case. + if (state.pipesCount === 1) { + // passed in one, but it's not the right one. + if (dest && dest !== state.pipes) return this; + + if (!dest) dest = state.pipes; + + // got a match. + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + if (dest) dest.emit('unpipe', this, unpipeInfo); + return this; + } + + // slow case. multiple pipe destinations. + + if (!dest) { + // remove all. + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + + for (var i = 0; i < len; i++) { + dests[i].emit('unpipe', this, unpipeInfo); + }return this; + } + + // try to find the right one. + var index = indexOf(state.pipes, dest); + if (index === -1) return this; + + state.pipes.splice(index, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) state.pipes = state.pipes[0]; + + dest.emit('unpipe', this, unpipeInfo); + + return this; +}; + +// set up data events if they are asked for +// Ensure readable listeners eventually get something +Readable.prototype.on = function (ev, fn) { + var res = Stream.prototype.on.call(this, ev, fn); + + if (ev === 'data') { + // Start flowing on next tick if stream isn't explicitly paused + if (this._readableState.flowing !== false) this.resume(); + } else if (ev === 'readable') { + var state = this._readableState; + if (!state.endEmitted && !state.readableListening) { + state.readableListening = state.needReadable = true; + state.emittedReadable = false; + if (!state.reading) { + pna.nextTick(nReadingNextTick, this); + } else if (state.length) { + emitReadable(this); + } + } + } + + return res; +}; +Readable.prototype.addListener = Readable.prototype.on; + +function nReadingNextTick(self) { + debug('readable nexttick read 0'); + self.read(0); +} + +// pause() and resume() are remnants of the legacy readable stream API +// If the user uses them, then switch into old mode. +Readable.prototype.resume = function () { + var state = this._readableState; + if (!state.flowing) { + debug('resume'); + state.flowing = true; + resume(this, state); + } + return this; +}; + +function resume(stream, state) { + if (!state.resumeScheduled) { + state.resumeScheduled = true; + pna.nextTick(resume_, stream, state); + } +} + +function resume_(stream, state) { + if (!state.reading) { + debug('resume read 0'); + stream.read(0); + } + + state.resumeScheduled = false; + state.awaitDrain = 0; + stream.emit('resume'); + flow(stream); + if (state.flowing && !state.reading) stream.read(0); +} + +Readable.prototype.pause = function () { + debug('call pause flowing=%j', this._readableState.flowing); + if (false !== this._readableState.flowing) { + debug('pause'); + this._readableState.flowing = false; + this.emit('pause'); + } + return this; +}; + +function flow(stream) { + var state = stream._readableState; + debug('flow', state.flowing); + while (state.flowing && stream.read() !== null) {} +} + +// wrap an old-style stream as the async data source. +// This is *not* part of the readable stream interface. +// It is an ugly unfortunate mess of history. +Readable.prototype.wrap = function (stream) { + var _this = this; + + var state = this._readableState; + var paused = false; + + stream.on('end', function () { + debug('wrapped end'); + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) _this.push(chunk); + } + + _this.push(null); + }); + + stream.on('data', function (chunk) { + debug('wrapped data'); + if (state.decoder) chunk = state.decoder.write(chunk); + + // don't skip over falsy values in objectMode + if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; + + var ret = _this.push(chunk); + if (!ret) { + paused = true; + stream.pause(); + } + }); + + // proxy all the other methods. + // important when wrapping filters and duplexes. + for (var i in stream) { + if (this[i] === undefined && typeof stream[i] === 'function') { + this[i] = function (method) { + return function () { + return stream[method].apply(stream, arguments); + }; + }(i); + } + } + + // proxy certain important events. + for (var n = 0; n < kProxyEvents.length; n++) { + stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); + } + + // when we try to consume some more bytes, simply unpause the + // underlying stream. + this._read = function (n) { + debug('wrapped _read', n); + if (paused) { + paused = false; + stream.resume(); + } + }; + + return this; +}; + +Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._readableState.highWaterMark; + } +}); + +// exposed for testing purposes only. +Readable._fromList = fromList; + +// Pluck off n bytes from an array of buffers. +// Length is the combined lengths of all the buffers in the list. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function fromList(n, state) { + // nothing buffered + if (state.length === 0) return null; + + var ret; + if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { + // read it all, truncate the list + if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length); + state.buffer.clear(); + } else { + // read part of list + ret = fromListPartial(n, state.buffer, state.decoder); + } + + return ret; +} + +// Extracts only enough buffered data to satisfy the amount requested. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function fromListPartial(n, list, hasStrings) { + var ret; + if (n < list.head.data.length) { + // slice is the same for buffers and strings + ret = list.head.data.slice(0, n); + list.head.data = list.head.data.slice(n); + } else if (n === list.head.data.length) { + // first chunk is a perfect match + ret = list.shift(); + } else { + // result spans more than one buffer + ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); + } + return ret; +} + +// Copies a specified amount of characters from the list of buffered data +// chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function copyFromBufferString(n, list) { + var p = list.head; + var c = 1; + var ret = p.data; + n -= ret.length; + while (p = p.next) { + var str = p.data; + var nb = n > str.length ? str.length : n; + if (nb === str.length) ret += str;else ret += str.slice(0, n); + n -= nb; + if (n === 0) { + if (nb === str.length) { + ++c; + if (p.next) list.head = p.next;else list.head = list.tail = null; + } else { + list.head = p; + p.data = str.slice(nb); + } + break; + } + ++c; + } + list.length -= c; + return ret; +} + +// Copies a specified amount of bytes from the list of buffered data chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function copyFromBuffer(n, list) { + var ret = Buffer.allocUnsafe(n); + var p = list.head; + var c = 1; + p.data.copy(ret); + n -= p.data.length; + while (p = p.next) { + var buf = p.data; + var nb = n > buf.length ? buf.length : n; + buf.copy(ret, ret.length - n, 0, nb); + n -= nb; + if (n === 0) { + if (nb === buf.length) { + ++c; + if (p.next) list.head = p.next;else list.head = list.tail = null; + } else { + list.head = p; + p.data = buf.slice(nb); + } + break; + } + ++c; + } + list.length -= c; + return ret; +} + +function endReadable(stream) { + var state = stream._readableState; + + // If we get here before consuming all the bytes, then that is a + // bug in node. Should never happen. + if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); + + if (!state.endEmitted) { + state.ended = true; + pna.nextTick(endReadableNT, state, stream); + } +} + +function endReadableNT(state, stream) { + // Check that we didn't get one last unshift. + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream.readable = false; + stream.emit('end'); + } +} + +function indexOf(xs, x) { + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; + } + return -1; +} \ No newline at end of file diff --git a/node_modules/readable-stream/lib/_stream_transform.js b/node_modules/readable-stream/lib/_stream_transform.js new file mode 100644 index 0000000..fcfc105 --- /dev/null +++ b/node_modules/readable-stream/lib/_stream_transform.js @@ -0,0 +1,214 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// 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. + +// a transform stream is a readable/writable stream where you do +// something with the data. Sometimes it's called a "filter", +// but that's not a great name for it, since that implies a thing where +// some bits pass through, and others are simply ignored. (That would +// be a valid example of a transform, of course.) +// +// While the output is causally related to the input, it's not a +// necessarily symmetric or synchronous transformation. For example, +// a zlib stream might take multiple plain-text writes(), and then +// emit a single compressed chunk some time in the future. +// +// Here's how this works: +// +// The Transform stream has all the aspects of the readable and writable +// stream classes. When you write(chunk), that calls _write(chunk,cb) +// internally, and returns false if there's a lot of pending writes +// buffered up. When you call read(), that calls _read(n) until +// there's enough pending readable data buffered up. +// +// In a transform stream, the written data is placed in a buffer. When +// _read(n) is called, it transforms the queued up data, calling the +// buffered _write cb's as it consumes chunks. If consuming a single +// written chunk would result in multiple output chunks, then the first +// outputted bit calls the readcb, and subsequent chunks just go into +// the read buffer, and will cause it to emit 'readable' if necessary. +// +// This way, back-pressure is actually determined by the reading side, +// since _read has to be called to start processing a new chunk. However, +// a pathological inflate type of transform can cause excessive buffering +// here. For example, imagine a stream where every byte of input is +// interpreted as an integer from 0-255, and then results in that many +// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in +// 1kb of data being output. In this case, you could write a very small +// amount of input, and end up with a very large amount of output. In +// such a pathological inflating mechanism, there'd be no way to tell +// the system to stop doing the transform. A single 4MB write could +// cause the system to run out of memory. +// +// However, even in such a pathological case, only a single written chunk +// would be consumed, and then the rest would wait (un-transformed) until +// the results of the previous transformed chunk were consumed. + +'use strict'; + +module.exports = Transform; + +var Duplex = require('./_stream_duplex'); + +/**/ +var util = Object.create(require('core-util-is')); +util.inherits = require('inherits'); +/**/ + +util.inherits(Transform, Duplex); + +function afterTransform(er, data) { + var ts = this._transformState; + ts.transforming = false; + + var cb = ts.writecb; + + if (!cb) { + return this.emit('error', new Error('write callback called multiple times')); + } + + ts.writechunk = null; + ts.writecb = null; + + if (data != null) // single equals check for both `null` and `undefined` + this.push(data); + + cb(er); + + var rs = this._readableState; + rs.reading = false; + if (rs.needReadable || rs.length < rs.highWaterMark) { + this._read(rs.highWaterMark); + } +} + +function Transform(options) { + if (!(this instanceof Transform)) return new Transform(options); + + Duplex.call(this, options); + + this._transformState = { + afterTransform: afterTransform.bind(this), + needTransform: false, + transforming: false, + writecb: null, + writechunk: null, + writeencoding: null + }; + + // start out asking for a readable event once data is transformed. + this._readableState.needReadable = true; + + // we have implemented the _read method, and done the other things + // that Readable wants before the first _read call, so unset the + // sync guard flag. + this._readableState.sync = false; + + if (options) { + if (typeof options.transform === 'function') this._transform = options.transform; + + if (typeof options.flush === 'function') this._flush = options.flush; + } + + // When the writable side finishes, then flush out anything remaining. + this.on('prefinish', prefinish); +} + +function prefinish() { + var _this = this; + + if (typeof this._flush === 'function') { + this._flush(function (er, data) { + done(_this, er, data); + }); + } else { + done(this, null, null); + } +} + +Transform.prototype.push = function (chunk, encoding) { + this._transformState.needTransform = false; + return Duplex.prototype.push.call(this, chunk, encoding); +}; + +// This is the part where you do stuff! +// override this function in implementation classes. +// 'chunk' is an input chunk. +// +// Call `push(newChunk)` to pass along transformed output +// to the readable side. You may call 'push' zero or more times. +// +// Call `cb(err)` when you are done with this chunk. If you pass +// an error, then that'll put the hurt on the whole operation. If you +// never call cb(), then you'll never get another chunk. +Transform.prototype._transform = function (chunk, encoding, cb) { + throw new Error('_transform() is not implemented'); +}; + +Transform.prototype._write = function (chunk, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk; + ts.writeencoding = encoding; + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); + } +}; + +// Doesn't matter what the args are here. +// _transform does all the work. +// That we got here means that the readable side wants more data. +Transform.prototype._read = function (n) { + var ts = this._transformState; + + if (ts.writechunk !== null && ts.writecb && !ts.transforming) { + ts.transforming = true; + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + // mark that we need a transform, so that any data that comes in + // will get processed, now that we've asked for it. + ts.needTransform = true; + } +}; + +Transform.prototype._destroy = function (err, cb) { + var _this2 = this; + + Duplex.prototype._destroy.call(this, err, function (err2) { + cb(err2); + _this2.emit('close'); + }); +}; + +function done(stream, er, data) { + if (er) return stream.emit('error', er); + + if (data != null) // single equals check for both `null` and `undefined` + stream.push(data); + + // if there's nothing in the write buffer, then that means + // that nothing more will ever be provided + if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0'); + + if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming'); + + return stream.push(null); +} \ No newline at end of file diff --git a/node_modules/readable-stream/lib/_stream_writable.js b/node_modules/readable-stream/lib/_stream_writable.js new file mode 100644 index 0000000..b0b0220 --- /dev/null +++ b/node_modules/readable-stream/lib/_stream_writable.js @@ -0,0 +1,687 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// 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. + +// A bit simpler than readable streams. +// Implement an async ._write(chunk, encoding, cb), and it'll handle all +// the drain event emission and buffering. + +'use strict'; + +/**/ + +var pna = require('process-nextick-args'); +/**/ + +module.exports = Writable; + +/* */ +function WriteReq(chunk, encoding, cb) { + this.chunk = chunk; + this.encoding = encoding; + this.callback = cb; + this.next = null; +} + +// It seems a linked list but it is not +// there will be only 2 of these for each stream +function CorkedRequest(state) { + var _this = this; + + this.next = null; + this.entry = null; + this.finish = function () { + onCorkedFinish(_this, state); + }; +} +/* */ + +/**/ +var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick; +/**/ + +/**/ +var Duplex; +/**/ + +Writable.WritableState = WritableState; + +/**/ +var util = Object.create(require('core-util-is')); +util.inherits = require('inherits'); +/**/ + +/**/ +var internalUtil = { + deprecate: require('util-deprecate') +}; +/**/ + +/**/ +var Stream = require('./internal/streams/stream'); +/**/ + +/**/ + +var Buffer = require('safe-buffer').Buffer; +var OurUint8Array = global.Uint8Array || function () {}; +function _uint8ArrayToBuffer(chunk) { + return Buffer.from(chunk); +} +function _isUint8Array(obj) { + return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; +} + +/**/ + +var destroyImpl = require('./internal/streams/destroy'); + +util.inherits(Writable, Stream); + +function nop() {} + +function WritableState(options, stream) { + Duplex = Duplex || require('./_stream_duplex'); + + options = options || {}; + + // Duplex streams are both readable and writable, but share + // the same options object. + // However, some cases require setting options to different + // values for the readable and the writable sides of the duplex stream. + // These options can be provided separately as readableXXX and writableXXX. + var isDuplex = stream instanceof Duplex; + + // object stream flag to indicate whether or not this stream + // contains buffers or objects. + this.objectMode = !!options.objectMode; + + if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; + + // the point at which write() starts returning false + // Note: 0 is a valid value, means that we always return false if + // the entire buffer is not flushed immediately on write() + var hwm = options.highWaterMark; + var writableHwm = options.writableHighWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + + if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm; + + // cast to ints. + this.highWaterMark = Math.floor(this.highWaterMark); + + // if _final has been called + this.finalCalled = false; + + // drain event flag. + this.needDrain = false; + // at the start of calling end() + this.ending = false; + // when end() has been called, and returned + this.ended = false; + // when 'finish' is emitted + this.finished = false; + + // has it been destroyed + this.destroyed = false; + + // should we decode strings into buffers before passing to _write? + // this is here so that some node-core streams can optimize string + // handling at a lower level. + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // not an actual buffer we keep track of, but a measurement + // of how much we're waiting to get pushed to some underlying + // socket or file. + this.length = 0; + + // a flag to see when we're in the middle of a write. + this.writing = false; + + // when true all writes will be buffered until .uncork() call + this.corked = 0; + + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; + + // a flag to know if we're processing previously buffered items, which + // may call the _write() callback in the same tick, so that we don't + // end up in an overlapped onwrite situation. + this.bufferProcessing = false; + + // the callback that's passed to _write(chunk,cb) + this.onwrite = function (er) { + onwrite(stream, er); + }; + + // the callback that the user supplies to write(chunk,encoding,cb) + this.writecb = null; + + // the amount that is being written when _write is called. + this.writelen = 0; + + this.bufferedRequest = null; + this.lastBufferedRequest = null; + + // number of pending user-supplied write callbacks + // this must be 0 before 'finish' can be emitted + this.pendingcb = 0; + + // emit prefinish if the only thing we're waiting for is _write cbs + // This is relevant for synchronous Transform streams + this.prefinished = false; + + // True if the error was already emitted and should not be thrown again + this.errorEmitted = false; + + // count buffered requests + this.bufferedRequestCount = 0; + + // allocate the first CorkedRequest, there is always + // one allocated and free to use, and we maintain at most two + this.corkedRequestsFree = new CorkedRequest(this); +} + +WritableState.prototype.getBuffer = function getBuffer() { + var current = this.bufferedRequest; + var out = []; + while (current) { + out.push(current); + current = current.next; + } + return out; +}; + +(function () { + try { + Object.defineProperty(WritableState.prototype, 'buffer', { + get: internalUtil.deprecate(function () { + return this.getBuffer(); + }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') + }); + } catch (_) {} +})(); + +// Test _writableState for inheritance to account for Duplex streams, +// whose prototype chain only points to Readable. +var realHasInstance; +if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { + realHasInstance = Function.prototype[Symbol.hasInstance]; + Object.defineProperty(Writable, Symbol.hasInstance, { + value: function (object) { + if (realHasInstance.call(this, object)) return true; + if (this !== Writable) return false; + + return object && object._writableState instanceof WritableState; + } + }); +} else { + realHasInstance = function (object) { + return object instanceof this; + }; +} + +function Writable(options) { + Duplex = Duplex || require('./_stream_duplex'); + + // Writable ctor is applied to Duplexes, too. + // `realHasInstance` is necessary because using plain `instanceof` + // would return false, as no `_writableState` property is attached. + + // Trying to use the custom `instanceof` for Writable here will also break the + // Node.js LazyTransform implementation, which has a non-trivial getter for + // `_writableState` that would lead to infinite recursion. + if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) { + return new Writable(options); + } + + this._writableState = new WritableState(options, this); + + // legacy. + this.writable = true; + + if (options) { + if (typeof options.write === 'function') this._write = options.write; + + if (typeof options.writev === 'function') this._writev = options.writev; + + if (typeof options.destroy === 'function') this._destroy = options.destroy; + + if (typeof options.final === 'function') this._final = options.final; + } + + Stream.call(this); +} + +// Otherwise people can pipe Writable streams, which is just wrong. +Writable.prototype.pipe = function () { + this.emit('error', new Error('Cannot pipe, not readable')); +}; + +function writeAfterEnd(stream, cb) { + var er = new Error('write after end'); + // TODO: defer error events consistently everywhere, not just the cb + stream.emit('error', er); + pna.nextTick(cb, er); +} + +// Checks that a user-supplied chunk is valid, especially for the particular +// mode the stream is in. Currently this means that `null` is never accepted +// and undefined/non-string values are only allowed in object mode. +function validChunk(stream, state, chunk, cb) { + var valid = true; + var er = false; + + if (chunk === null) { + er = new TypeError('May not write null values to stream'); + } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + if (er) { + stream.emit('error', er); + pna.nextTick(cb, er); + valid = false; + } + return valid; +} + +Writable.prototype.write = function (chunk, encoding, cb) { + var state = this._writableState; + var ret = false; + var isBuf = !state.objectMode && _isUint8Array(chunk); + + if (isBuf && !Buffer.isBuffer(chunk)) { + chunk = _uint8ArrayToBuffer(chunk); + } + + if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; + + if (typeof cb !== 'function') cb = nop; + + if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { + state.pendingcb++; + ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); + } + + return ret; +}; + +Writable.prototype.cork = function () { + var state = this._writableState; + + state.corked++; +}; + +Writable.prototype.uncork = function () { + var state = this._writableState; + + if (state.corked) { + state.corked--; + + if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); + } +}; + +Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + // node::ParseEncoding() requires lower case. + if (typeof encoding === 'string') encoding = encoding.toLowerCase(); + if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); + this._writableState.defaultEncoding = encoding; + return this; +}; + +function decodeChunk(state, chunk, encoding) { + if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { + chunk = Buffer.from(chunk, encoding); + } + return chunk; +} + +Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._writableState.highWaterMark; + } +}); + +// if we're already writing something, then just put this +// in the queue, and wait our turn. Otherwise, call _write +// If we return false, then we need a drain event, so set that flag. +function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { + if (!isBuf) { + var newChunk = decodeChunk(state, chunk, encoding); + if (chunk !== newChunk) { + isBuf = true; + encoding = 'buffer'; + chunk = newChunk; + } + } + var len = state.objectMode ? 1 : chunk.length; + + state.length += len; + + var ret = state.length < state.highWaterMark; + // we must ensure that previous needDrain will not be reset to false. + if (!ret) state.needDrain = true; + + if (state.writing || state.corked) { + var last = state.lastBufferedRequest; + state.lastBufferedRequest = { + chunk: chunk, + encoding: encoding, + isBuf: isBuf, + callback: cb, + next: null + }; + if (last) { + last.next = state.lastBufferedRequest; + } else { + state.bufferedRequest = state.lastBufferedRequest; + } + state.bufferedRequestCount += 1; + } else { + doWrite(stream, state, false, len, chunk, encoding, cb); + } + + return ret; +} + +function doWrite(stream, state, writev, len, chunk, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); + state.sync = false; +} + +function onwriteError(stream, state, sync, er, cb) { + --state.pendingcb; + + if (sync) { + // defer the callback if we are being called synchronously + // to avoid piling up things on the stack + pna.nextTick(cb, er); + // this can emit finish, and it will always happen + // after error + pna.nextTick(finishMaybe, stream, state); + stream._writableState.errorEmitted = true; + stream.emit('error', er); + } else { + // the caller expect this to happen before if + // it is async + cb(er); + stream._writableState.errorEmitted = true; + stream.emit('error', er); + // this can emit finish, but finish must + // always follow error + finishMaybe(stream, state); + } +} + +function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; +} + +function onwrite(stream, er) { + var state = stream._writableState; + var sync = state.sync; + var cb = state.writecb; + + onwriteStateUpdate(state); + + if (er) onwriteError(stream, state, sync, er, cb);else { + // Check if we're actually ready to finish, but don't emit yet + var finished = needFinish(state); + + if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { + clearBuffer(stream, state); + } + + if (sync) { + /**/ + asyncWrite(afterWrite, stream, state, finished, cb); + /**/ + } else { + afterWrite(stream, state, finished, cb); + } + } +} + +function afterWrite(stream, state, finished, cb) { + if (!finished) onwriteDrain(stream, state); + state.pendingcb--; + cb(); + finishMaybe(stream, state); +} + +// Must force callback to be called on nextTick, so that we don't +// emit 'drain' before the write() consumer gets the 'false' return +// value, and has a chance to attach a 'drain' listener. +function onwriteDrain(stream, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream.emit('drain'); + } +} + +// if there's something in the buffer waiting, then process it +function clearBuffer(stream, state) { + state.bufferProcessing = true; + var entry = state.bufferedRequest; + + if (stream._writev && entry && entry.next) { + // Fast case, write everything using _writev() + var l = state.bufferedRequestCount; + var buffer = new Array(l); + var holder = state.corkedRequestsFree; + holder.entry = entry; + + var count = 0; + var allBuffers = true; + while (entry) { + buffer[count] = entry; + if (!entry.isBuf) allBuffers = false; + entry = entry.next; + count += 1; + } + buffer.allBuffers = allBuffers; + + doWrite(stream, state, true, state.length, buffer, '', holder.finish); + + // doWrite is almost always async, defer these to save a bit of time + // as the hot path ends with doWrite + state.pendingcb++; + state.lastBufferedRequest = null; + if (holder.next) { + state.corkedRequestsFree = holder.next; + holder.next = null; + } else { + state.corkedRequestsFree = new CorkedRequest(state); + } + state.bufferedRequestCount = 0; + } else { + // Slow case, write chunks one-by-one + while (entry) { + var chunk = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk.length; + + doWrite(stream, state, false, len, chunk, encoding, cb); + entry = entry.next; + state.bufferedRequestCount--; + // if we didn't call the onwrite immediately, then + // it means that we need to wait until it does. + // also, that means that the chunk and cb are currently + // being processed, so move the buffer counter past them. + if (state.writing) { + break; + } + } + + if (entry === null) state.lastBufferedRequest = null; + } + + state.bufferedRequest = entry; + state.bufferProcessing = false; +} + +Writable.prototype._write = function (chunk, encoding, cb) { + cb(new Error('_write() is not implemented')); +}; + +Writable.prototype._writev = null; + +Writable.prototype.end = function (chunk, encoding, cb) { + var state = this._writableState; + + if (typeof chunk === 'function') { + cb = chunk; + chunk = null; + encoding = null; + } else if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); + + // .end() fully uncorks + if (state.corked) { + state.corked = 1; + this.uncork(); + } + + // ignore unnecessary end() calls. + if (!state.ending && !state.finished) endWritable(this, state, cb); +}; + +function needFinish(state) { + return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; +} +function callFinal(stream, state) { + stream._final(function (err) { + state.pendingcb--; + if (err) { + stream.emit('error', err); + } + state.prefinished = true; + stream.emit('prefinish'); + finishMaybe(stream, state); + }); +} +function prefinish(stream, state) { + if (!state.prefinished && !state.finalCalled) { + if (typeof stream._final === 'function') { + state.pendingcb++; + state.finalCalled = true; + pna.nextTick(callFinal, stream, state); + } else { + state.prefinished = true; + stream.emit('prefinish'); + } + } +} + +function finishMaybe(stream, state) { + var need = needFinish(state); + if (need) { + prefinish(stream, state); + if (state.pendingcb === 0) { + state.finished = true; + stream.emit('finish'); + } + } + return need; +} + +function endWritable(stream, state, cb) { + state.ending = true; + finishMaybe(stream, state); + if (cb) { + if (state.finished) pna.nextTick(cb);else stream.once('finish', cb); + } + state.ended = true; + stream.writable = false; +} + +function onCorkedFinish(corkReq, state, err) { + var entry = corkReq.entry; + corkReq.entry = null; + while (entry) { + var cb = entry.callback; + state.pendingcb--; + cb(err); + entry = entry.next; + } + if (state.corkedRequestsFree) { + state.corkedRequestsFree.next = corkReq; + } else { + state.corkedRequestsFree = corkReq; + } +} + +Object.defineProperty(Writable.prototype, 'destroyed', { + get: function () { + if (this._writableState === undefined) { + return false; + } + return this._writableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._writableState) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._writableState.destroyed = value; + } +}); + +Writable.prototype.destroy = destroyImpl.destroy; +Writable.prototype._undestroy = destroyImpl.undestroy; +Writable.prototype._destroy = function (err, cb) { + this.end(); + cb(err); +}; \ No newline at end of file diff --git a/node_modules/readable-stream/lib/internal/streams/BufferList.js b/node_modules/readable-stream/lib/internal/streams/BufferList.js new file mode 100644 index 0000000..aefc68b --- /dev/null +++ b/node_modules/readable-stream/lib/internal/streams/BufferList.js @@ -0,0 +1,79 @@ +'use strict'; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Buffer = require('safe-buffer').Buffer; +var util = require('util'); + +function copyBuffer(src, target, offset) { + src.copy(target, offset); +} + +module.exports = function () { + function BufferList() { + _classCallCheck(this, BufferList); + + this.head = null; + this.tail = null; + this.length = 0; + } + + BufferList.prototype.push = function push(v) { + var entry = { data: v, next: null }; + if (this.length > 0) this.tail.next = entry;else this.head = entry; + this.tail = entry; + ++this.length; + }; + + BufferList.prototype.unshift = function unshift(v) { + var entry = { data: v, next: this.head }; + if (this.length === 0) this.tail = entry; + this.head = entry; + ++this.length; + }; + + BufferList.prototype.shift = function shift() { + if (this.length === 0) return; + var ret = this.head.data; + if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; + --this.length; + return ret; + }; + + BufferList.prototype.clear = function clear() { + this.head = this.tail = null; + this.length = 0; + }; + + BufferList.prototype.join = function join(s) { + if (this.length === 0) return ''; + var p = this.head; + var ret = '' + p.data; + while (p = p.next) { + ret += s + p.data; + }return ret; + }; + + BufferList.prototype.concat = function concat(n) { + if (this.length === 0) return Buffer.alloc(0); + if (this.length === 1) return this.head.data; + var ret = Buffer.allocUnsafe(n >>> 0); + var p = this.head; + var i = 0; + while (p) { + copyBuffer(p.data, ret, i); + i += p.data.length; + p = p.next; + } + return ret; + }; + + return BufferList; +}(); + +if (util && util.inspect && util.inspect.custom) { + module.exports.prototype[util.inspect.custom] = function () { + var obj = util.inspect({ length: this.length }); + return this.constructor.name + ' ' + obj; + }; +} \ No newline at end of file diff --git a/node_modules/readable-stream/lib/internal/streams/destroy.js b/node_modules/readable-stream/lib/internal/streams/destroy.js new file mode 100644 index 0000000..5a0a0d8 --- /dev/null +++ b/node_modules/readable-stream/lib/internal/streams/destroy.js @@ -0,0 +1,74 @@ +'use strict'; + +/**/ + +var pna = require('process-nextick-args'); +/**/ + +// undocumented cb() API, needed for core, not for public API +function destroy(err, cb) { + var _this = this; + + var readableDestroyed = this._readableState && this._readableState.destroyed; + var writableDestroyed = this._writableState && this._writableState.destroyed; + + if (readableDestroyed || writableDestroyed) { + if (cb) { + cb(err); + } else if (err && (!this._writableState || !this._writableState.errorEmitted)) { + pna.nextTick(emitErrorNT, this, err); + } + return this; + } + + // we set destroyed to true before firing error callbacks in order + // to make it re-entrance safe in case destroy() is called within callbacks + + if (this._readableState) { + this._readableState.destroyed = true; + } + + // if this is a duplex stream mark the writable part as destroyed as well + if (this._writableState) { + this._writableState.destroyed = true; + } + + this._destroy(err || null, function (err) { + if (!cb && err) { + pna.nextTick(emitErrorNT, _this, err); + if (_this._writableState) { + _this._writableState.errorEmitted = true; + } + } else if (cb) { + cb(err); + } + }); + + return this; +} + +function undestroy() { + if (this._readableState) { + this._readableState.destroyed = false; + this._readableState.reading = false; + this._readableState.ended = false; + this._readableState.endEmitted = false; + } + + if (this._writableState) { + this._writableState.destroyed = false; + this._writableState.ended = false; + this._writableState.ending = false; + this._writableState.finished = false; + this._writableState.errorEmitted = false; + } +} + +function emitErrorNT(self, err) { + self.emit('error', err); +} + +module.exports = { + destroy: destroy, + undestroy: undestroy +}; \ No newline at end of file diff --git a/node_modules/readable-stream/lib/internal/streams/stream-browser.js b/node_modules/readable-stream/lib/internal/streams/stream-browser.js new file mode 100644 index 0000000..9332a3f --- /dev/null +++ b/node_modules/readable-stream/lib/internal/streams/stream-browser.js @@ -0,0 +1 @@ +module.exports = require('events').EventEmitter; diff --git a/node_modules/readable-stream/lib/internal/streams/stream.js b/node_modules/readable-stream/lib/internal/streams/stream.js new file mode 100644 index 0000000..ce2ad5b --- /dev/null +++ b/node_modules/readable-stream/lib/internal/streams/stream.js @@ -0,0 +1 @@ +module.exports = require('stream'); diff --git a/node_modules/generate-function/LICENSE b/node_modules/readable-stream/node_modules/safe-buffer/LICENSE similarity index 95% rename from node_modules/generate-function/LICENSE rename to node_modules/readable-stream/node_modules/safe-buffer/LICENSE index 757562e..0c068ce 100644 --- a/node_modules/generate-function/LICENSE +++ b/node_modules/readable-stream/node_modules/safe-buffer/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2014 Mathias Buus +Copyright (c) Feross Aboukhadijeh Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -18,4 +18,4 @@ 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. \ No newline at end of file +THE SOFTWARE. diff --git a/node_modules/readable-stream/node_modules/safe-buffer/README.md b/node_modules/readable-stream/node_modules/safe-buffer/README.md new file mode 100644 index 0000000..e9a81af --- /dev/null +++ b/node_modules/readable-stream/node_modules/safe-buffer/README.md @@ -0,0 +1,584 @@ +# safe-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] + +[travis-image]: https://img.shields.io/travis/feross/safe-buffer/master.svg +[travis-url]: https://travis-ci.org/feross/safe-buffer +[npm-image]: https://img.shields.io/npm/v/safe-buffer.svg +[npm-url]: https://npmjs.org/package/safe-buffer +[downloads-image]: https://img.shields.io/npm/dm/safe-buffer.svg +[downloads-url]: https://npmjs.org/package/safe-buffer +[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg +[standard-url]: https://standardjs.com + +#### Safer Node.js Buffer API + +**Use the new Node.js Buffer APIs (`Buffer.from`, `Buffer.alloc`, +`Buffer.allocUnsafe`, `Buffer.allocUnsafeSlow`) in all versions of Node.js.** + +**Uses the built-in implementation when available.** + +## install + +``` +npm install safe-buffer +``` + +## usage + +The goal of this package is to provide a safe replacement for the node.js `Buffer`. + +It's a drop-in replacement for `Buffer`. You can use it by adding one `require` line to +the top of your node.js modules: + +```js +var Buffer = require('safe-buffer').Buffer + +// Existing buffer code will continue to work without issues: + +new Buffer('hey', 'utf8') +new Buffer([1, 2, 3], 'utf8') +new Buffer(obj) +new Buffer(16) // create an uninitialized buffer (potentially unsafe) + +// But you can use these new explicit APIs to make clear what you want: + +Buffer.from('hey', 'utf8') // convert from many types to a Buffer +Buffer.alloc(16) // create a zero-filled buffer (safe) +Buffer.allocUnsafe(16) // create an uninitialized buffer (potentially unsafe) +``` + +## api + +### Class Method: Buffer.from(array) + + +* `array` {Array} + +Allocates a new `Buffer` using an `array` of octets. + +```js +const buf = Buffer.from([0x62,0x75,0x66,0x66,0x65,0x72]); + // creates a new Buffer containing ASCII bytes + // ['b','u','f','f','e','r'] +``` + +A `TypeError` will be thrown if `array` is not an `Array`. + +### Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]]) + + +* `arrayBuffer` {ArrayBuffer} The `.buffer` property of a `TypedArray` or + a `new ArrayBuffer()` +* `byteOffset` {Number} Default: `0` +* `length` {Number} Default: `arrayBuffer.length - byteOffset` + +When passed a reference to the `.buffer` property of a `TypedArray` instance, +the newly created `Buffer` will share the same allocated memory as the +TypedArray. + +```js +const arr = new Uint16Array(2); +arr[0] = 5000; +arr[1] = 4000; + +const buf = Buffer.from(arr.buffer); // shares the memory with arr; + +console.log(buf); + // Prints: + +// changing the TypedArray changes the Buffer also +arr[1] = 6000; + +console.log(buf); + // Prints: +``` + +The optional `byteOffset` and `length` arguments specify a memory range within +the `arrayBuffer` that will be shared by the `Buffer`. + +```js +const ab = new ArrayBuffer(10); +const buf = Buffer.from(ab, 0, 2); +console.log(buf.length); + // Prints: 2 +``` + +A `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer`. + +### Class Method: Buffer.from(buffer) + + +* `buffer` {Buffer} + +Copies the passed `buffer` data onto a new `Buffer` instance. + +```js +const buf1 = Buffer.from('buffer'); +const buf2 = Buffer.from(buf1); + +buf1[0] = 0x61; +console.log(buf1.toString()); + // 'auffer' +console.log(buf2.toString()); + // 'buffer' (copy is not changed) +``` + +A `TypeError` will be thrown if `buffer` is not a `Buffer`. + +### Class Method: Buffer.from(str[, encoding]) + + +* `str` {String} String to encode. +* `encoding` {String} Encoding to use, Default: `'utf8'` + +Creates a new `Buffer` containing the given JavaScript string `str`. If +provided, the `encoding` parameter identifies the character encoding. +If not provided, `encoding` defaults to `'utf8'`. + +```js +const buf1 = Buffer.from('this is a tést'); +console.log(buf1.toString()); + // prints: this is a tést +console.log(buf1.toString('ascii')); + // prints: this is a tC)st + +const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex'); +console.log(buf2.toString()); + // prints: this is a tést +``` + +A `TypeError` will be thrown if `str` is not a string. + +### Class Method: Buffer.alloc(size[, fill[, encoding]]) + + +* `size` {Number} +* `fill` {Value} Default: `undefined` +* `encoding` {String} Default: `utf8` + +Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the +`Buffer` will be *zero-filled*. + +```js +const buf = Buffer.alloc(5); +console.log(buf); + // +``` + +The `size` must be less than or equal to the value of +`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is +`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will +be created if a `size` less than or equal to 0 is specified. + +If `fill` is specified, the allocated `Buffer` will be initialized by calling +`buf.fill(fill)`. See [`buf.fill()`][] for more information. + +```js +const buf = Buffer.alloc(5, 'a'); +console.log(buf); + // +``` + +If both `fill` and `encoding` are specified, the allocated `Buffer` will be +initialized by calling `buf.fill(fill, encoding)`. For example: + +```js +const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64'); +console.log(buf); + // +``` + +Calling `Buffer.alloc(size)` can be significantly slower than the alternative +`Buffer.allocUnsafe(size)` but ensures that the newly created `Buffer` instance +contents will *never contain sensitive data*. + +A `TypeError` will be thrown if `size` is not a number. + +### Class Method: Buffer.allocUnsafe(size) + + +* `size` {Number} + +Allocates a new *non-zero-filled* `Buffer` of `size` bytes. The `size` must +be less than or equal to the value of `require('buffer').kMaxLength` (on 64-bit +architectures, `kMaxLength` is `(2^31)-1`). Otherwise, a [`RangeError`][] is +thrown. A zero-length Buffer will be created if a `size` less than or equal to +0 is specified. + +The underlying memory for `Buffer` instances created in this way is *not +initialized*. The contents of the newly created `Buffer` are unknown and +*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such +`Buffer` instances to zeroes. + +```js +const buf = Buffer.allocUnsafe(5); +console.log(buf); + // + // (octets will be different, every time) +buf.fill(0); +console.log(buf); + // +``` + +A `TypeError` will be thrown if `size` is not a number. + +Note that the `Buffer` module pre-allocates an internal `Buffer` instance of +size `Buffer.poolSize` that is used as a pool for the fast allocation of new +`Buffer` instances created using `Buffer.allocUnsafe(size)` (and the deprecated +`new Buffer(size)` constructor) only when `size` is less than or equal to +`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). The default +value of `Buffer.poolSize` is `8192` but can be modified. + +Use of this pre-allocated internal memory pool is a key difference between +calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. +Specifically, `Buffer.alloc(size, fill)` will *never* use the internal Buffer +pool, while `Buffer.allocUnsafe(size).fill(fill)` *will* use the internal +Buffer pool if `size` is less than or equal to half `Buffer.poolSize`. The +difference is subtle but can be important when an application requires the +additional performance that `Buffer.allocUnsafe(size)` provides. + +### Class Method: Buffer.allocUnsafeSlow(size) + + +* `size` {Number} + +Allocates a new *non-zero-filled* and non-pooled `Buffer` of `size` bytes. The +`size` must be less than or equal to the value of +`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is +`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will +be created if a `size` less than or equal to 0 is specified. + +The underlying memory for `Buffer` instances created in this way is *not +initialized*. The contents of the newly created `Buffer` are unknown and +*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such +`Buffer` instances to zeroes. + +When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances, +allocations under 4KB are, by default, sliced from a single pre-allocated +`Buffer`. This allows applications to avoid the garbage collection overhead of +creating many individually allocated Buffers. This approach improves both +performance and memory usage by eliminating the need to track and cleanup as +many `Persistent` objects. + +However, in the case where a developer may need to retain a small chunk of +memory from a pool for an indeterminate amount of time, it may be appropriate +to create an un-pooled Buffer instance using `Buffer.allocUnsafeSlow()` then +copy out the relevant bits. + +```js +// need to keep around a few small chunks of memory +const store = []; + +socket.on('readable', () => { + const data = socket.read(); + // allocate for retained data + const sb = Buffer.allocUnsafeSlow(10); + // copy the data into the new allocation + data.copy(sb, 0, 0, 10); + store.push(sb); +}); +``` + +Use of `Buffer.allocUnsafeSlow()` should be used only as a last resort *after* +a developer has observed undue memory retention in their applications. + +A `TypeError` will be thrown if `size` is not a number. + +### All the Rest + +The rest of the `Buffer` API is exactly the same as in node.js. +[See the docs](https://nodejs.org/api/buffer.html). + + +## Related links + +- [Node.js issue: Buffer(number) is unsafe](https://github.com/nodejs/node/issues/4660) +- [Node.js Enhancement Proposal: Buffer.from/Buffer.alloc/Buffer.zalloc/Buffer() soft-deprecate](https://github.com/nodejs/node-eps/pull/4) + +## Why is `Buffer` unsafe? + +Today, the node.js `Buffer` constructor is overloaded to handle many different argument +types like `String`, `Array`, `Object`, `TypedArrayView` (`Uint8Array`, etc.), +`ArrayBuffer`, and also `Number`. + +The API is optimized for convenience: you can throw any type at it, and it will try to do +what you want. + +Because the Buffer constructor is so powerful, you often see code like this: + +```js +// Convert UTF-8 strings to hex +function toHex (str) { + return new Buffer(str).toString('hex') +} +``` + +***But what happens if `toHex` is called with a `Number` argument?*** + +### Remote Memory Disclosure + +If an attacker can make your program call the `Buffer` constructor with a `Number` +argument, then they can make it allocate uninitialized memory from the node.js process. +This could potentially disclose TLS private keys, user data, or database passwords. + +When the `Buffer` constructor is passed a `Number` argument, it returns an +**UNINITIALIZED** block of memory of the specified `size`. When you create a `Buffer` like +this, you **MUST** overwrite the contents before returning it to the user. + +From the [node.js docs](https://nodejs.org/api/buffer.html#buffer_new_buffer_size): + +> `new Buffer(size)` +> +> - `size` Number +> +> The underlying memory for `Buffer` instances created in this way is not initialized. +> **The contents of a newly created `Buffer` are unknown and could contain sensitive +> data.** Use `buf.fill(0)` to initialize a Buffer to zeroes. + +(Emphasis our own.) + +Whenever the programmer intended to create an uninitialized `Buffer` you often see code +like this: + +```js +var buf = new Buffer(16) + +// Immediately overwrite the uninitialized buffer with data from another buffer +for (var i = 0; i < buf.length; i++) { + buf[i] = otherBuf[i] +} +``` + + +### Would this ever be a problem in real code? + +Yes. It's surprisingly common to forget to check the type of your variables in a +dynamically-typed language like JavaScript. + +Usually the consequences of assuming the wrong type is that your program crashes with an +uncaught exception. But the failure mode for forgetting to check the type of arguments to +the `Buffer` constructor is more catastrophic. + +Here's an example of a vulnerable service that takes a JSON payload and converts it to +hex: + +```js +// Take a JSON payload {str: "some string"} and convert it to hex +var server = http.createServer(function (req, res) { + var data = '' + req.setEncoding('utf8') + req.on('data', function (chunk) { + data += chunk + }) + req.on('end', function () { + var body = JSON.parse(data) + res.end(new Buffer(body.str).toString('hex')) + }) +}) + +server.listen(8080) +``` + +In this example, an http client just has to send: + +```json +{ + "str": 1000 +} +``` + +and it will get back 1,000 bytes of uninitialized memory from the server. + +This is a very serious bug. It's similar in severity to the +[the Heartbleed bug](http://heartbleed.com/) that allowed disclosure of OpenSSL process +memory by remote attackers. + + +### Which real-world packages were vulnerable? + +#### [`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht) + +[Mathias Buus](https://github.com/mafintosh) and I +([Feross Aboukhadijeh](http://feross.org/)) found this issue in one of our own packages, +[`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht). The bug would allow +anyone on the internet to send a series of messages to a user of `bittorrent-dht` and get +them to reveal 20 bytes at a time of uninitialized memory from the node.js process. + +Here's +[the commit](https://github.com/feross/bittorrent-dht/commit/6c7da04025d5633699800a99ec3fbadf70ad35b8) +that fixed it. We released a new fixed version, created a +[Node Security Project disclosure](https://nodesecurity.io/advisories/68), and deprecated all +vulnerable versions on npm so users will get a warning to upgrade to a newer version. + +#### [`ws`](https://www.npmjs.com/package/ws) + +That got us wondering if there were other vulnerable packages. Sure enough, within a short +period of time, we found the same issue in [`ws`](https://www.npmjs.com/package/ws), the +most popular WebSocket implementation in node.js. + +If certain APIs were called with `Number` parameters instead of `String` or `Buffer` as +expected, then uninitialized server memory would be disclosed to the remote peer. + +These were the vulnerable methods: + +```js +socket.send(number) +socket.ping(number) +socket.pong(number) +``` + +Here's a vulnerable socket server with some echo functionality: + +```js +server.on('connection', function (socket) { + socket.on('message', function (message) { + message = JSON.parse(message) + if (message.type === 'echo') { + socket.send(message.data) // send back the user's message + } + }) +}) +``` + +`socket.send(number)` called on the server, will disclose server memory. + +Here's [the release](https://github.com/websockets/ws/releases/tag/1.0.1) where the issue +was fixed, with a more detailed explanation. Props to +[Arnout Kazemier](https://github.com/3rd-Eden) for the quick fix. Here's the +[Node Security Project disclosure](https://nodesecurity.io/advisories/67). + + +### What's the solution? + +It's important that node.js offers a fast way to get memory otherwise performance-critical +applications would needlessly get a lot slower. + +But we need a better way to *signal our intent* as programmers. **When we want +uninitialized memory, we should request it explicitly.** + +Sensitive functionality should not be packed into a developer-friendly API that loosely +accepts many different types. This type of API encourages the lazy practice of passing +variables in without checking the type very carefully. + +#### A new API: `Buffer.allocUnsafe(number)` + +The functionality of creating buffers with uninitialized memory should be part of another +API. We propose `Buffer.allocUnsafe(number)`. This way, it's not part of an API that +frequently gets user input of all sorts of different types passed into it. + +```js +var buf = Buffer.allocUnsafe(16) // careful, uninitialized memory! + +// Immediately overwrite the uninitialized buffer with data from another buffer +for (var i = 0; i < buf.length; i++) { + buf[i] = otherBuf[i] +} +``` + + +### How do we fix node.js core? + +We sent [a PR to node.js core](https://github.com/nodejs/node/pull/4514) (merged as +`semver-major`) which defends against one case: + +```js +var str = 16 +new Buffer(str, 'utf8') +``` + +In this situation, it's implied that the programmer intended the first argument to be a +string, since they passed an encoding as a second argument. Today, node.js will allocate +uninitialized memory in the case of `new Buffer(number, encoding)`, which is probably not +what the programmer intended. + +But this is only a partial solution, since if the programmer does `new Buffer(variable)` +(without an `encoding` parameter) there's no way to know what they intended. If `variable` +is sometimes a number, then uninitialized memory will sometimes be returned. + +### What's the real long-term fix? + +We could deprecate and remove `new Buffer(number)` and use `Buffer.allocUnsafe(number)` when +we need uninitialized memory. But that would break 1000s of packages. + +~~We believe the best solution is to:~~ + +~~1. Change `new Buffer(number)` to return safe, zeroed-out memory~~ + +~~2. Create a new API for creating uninitialized Buffers. We propose: `Buffer.allocUnsafe(number)`~~ + +#### Update + +We now support adding three new APIs: + +- `Buffer.from(value)` - convert from any type to a buffer +- `Buffer.alloc(size)` - create a zero-filled buffer +- `Buffer.allocUnsafe(size)` - create an uninitialized buffer with given size + +This solves the core problem that affected `ws` and `bittorrent-dht` which is +`Buffer(variable)` getting tricked into taking a number argument. + +This way, existing code continues working and the impact on the npm ecosystem will be +minimal. Over time, npm maintainers can migrate performance-critical code to use +`Buffer.allocUnsafe(number)` instead of `new Buffer(number)`. + + +### Conclusion + +We think there's a serious design issue with the `Buffer` API as it exists today. It +promotes insecure software by putting high-risk functionality into a convenient API +with friendly "developer ergonomics". + +This wasn't merely a theoretical exercise because we found the issue in some of the +most popular npm packages. + +Fortunately, there's an easy fix that can be applied today. Use `safe-buffer` in place of +`buffer`. + +```js +var Buffer = require('safe-buffer').Buffer +``` + +Eventually, we hope that node.js core can switch to this new, safer behavior. We believe +the impact on the ecosystem would be minimal since it's not a breaking change. +Well-maintained, popular packages would be updated to use `Buffer.alloc` quickly, while +older, insecure packages would magically become safe from this attack vector. + + +## links + +- [Node.js PR: buffer: throw if both length and enc are passed](https://github.com/nodejs/node/pull/4514) +- [Node Security Project disclosure for `ws`](https://nodesecurity.io/advisories/67) +- [Node Security Project disclosure for`bittorrent-dht`](https://nodesecurity.io/advisories/68) + + +## credit + +The original issues in `bittorrent-dht` +([disclosure](https://nodesecurity.io/advisories/68)) and +`ws` ([disclosure](https://nodesecurity.io/advisories/67)) were discovered by +[Mathias Buus](https://github.com/mafintosh) and +[Feross Aboukhadijeh](http://feross.org/). + +Thanks to [Adam Baldwin](https://github.com/evilpacket) for helping disclose these issues +and for his work running the [Node Security Project](https://nodesecurity.io/). + +Thanks to [John Hiesey](https://github.com/jhiesey) for proofreading this README and +auditing the code. + + +## license + +MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org) diff --git a/node_modules/readable-stream/node_modules/safe-buffer/index.d.ts b/node_modules/readable-stream/node_modules/safe-buffer/index.d.ts new file mode 100644 index 0000000..e9fed80 --- /dev/null +++ b/node_modules/readable-stream/node_modules/safe-buffer/index.d.ts @@ -0,0 +1,187 @@ +declare module "safe-buffer" { + export class Buffer { + length: number + write(string: string, offset?: number, length?: number, encoding?: string): number; + toString(encoding?: string, start?: number, end?: number): string; + toJSON(): { type: 'Buffer', data: any[] }; + equals(otherBuffer: Buffer): boolean; + compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number; + copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; + slice(start?: number, end?: number): Buffer; + writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readUInt8(offset: number, noAssert?: boolean): number; + readUInt16LE(offset: number, noAssert?: boolean): number; + readUInt16BE(offset: number, noAssert?: boolean): number; + readUInt32LE(offset: number, noAssert?: boolean): number; + readUInt32BE(offset: number, noAssert?: boolean): number; + readInt8(offset: number, noAssert?: boolean): number; + readInt16LE(offset: number, noAssert?: boolean): number; + readInt16BE(offset: number, noAssert?: boolean): number; + readInt32LE(offset: number, noAssert?: boolean): number; + readInt32BE(offset: number, noAssert?: boolean): number; + readFloatLE(offset: number, noAssert?: boolean): number; + readFloatBE(offset: number, noAssert?: boolean): number; + readDoubleLE(offset: number, noAssert?: boolean): number; + readDoubleBE(offset: number, noAssert?: boolean): number; + swap16(): Buffer; + swap32(): Buffer; + swap64(): Buffer; + writeUInt8(value: number, offset: number, noAssert?: boolean): number; + writeUInt16LE(value: number, offset: number, noAssert?: boolean): number; + writeUInt16BE(value: number, offset: number, noAssert?: boolean): number; + writeUInt32LE(value: number, offset: number, noAssert?: boolean): number; + writeUInt32BE(value: number, offset: number, noAssert?: boolean): number; + writeInt8(value: number, offset: number, noAssert?: boolean): number; + writeInt16LE(value: number, offset: number, noAssert?: boolean): number; + writeInt16BE(value: number, offset: number, noAssert?: boolean): number; + writeInt32LE(value: number, offset: number, noAssert?: boolean): number; + writeInt32BE(value: number, offset: number, noAssert?: boolean): number; + writeFloatLE(value: number, offset: number, noAssert?: boolean): number; + writeFloatBE(value: number, offset: number, noAssert?: boolean): number; + writeDoubleLE(value: number, offset: number, noAssert?: boolean): number; + writeDoubleBE(value: number, offset: number, noAssert?: boolean): number; + fill(value: any, offset?: number, end?: number): this; + indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; + lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; + includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean; + + /** + * Allocates a new buffer containing the given {str}. + * + * @param str String to store in buffer. + * @param encoding encoding to use, optional. Default is 'utf8' + */ + constructor (str: string, encoding?: string); + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + */ + constructor (size: number); + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + */ + constructor (array: Uint8Array); + /** + * Produces a Buffer backed by the same allocated memory as + * the given {ArrayBuffer}. + * + * + * @param arrayBuffer The ArrayBuffer with which to share memory. + */ + constructor (arrayBuffer: ArrayBuffer); + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + */ + constructor (array: any[]); + /** + * Copies the passed {buffer} data onto a new {Buffer} instance. + * + * @param buffer The buffer to copy. + */ + constructor (buffer: Buffer); + prototype: Buffer; + /** + * Allocates a new Buffer using an {array} of octets. + * + * @param array + */ + static from(array: any[]): Buffer; + /** + * When passed a reference to the .buffer property of a TypedArray instance, + * the newly created Buffer will share the same allocated memory as the TypedArray. + * The optional {byteOffset} and {length} arguments specify a memory range + * within the {arrayBuffer} that will be shared by the Buffer. + * + * @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer() + * @param byteOffset + * @param length + */ + static from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer; + /** + * Copies the passed {buffer} data onto a new Buffer instance. + * + * @param buffer + */ + static from(buffer: Buffer): Buffer; + /** + * Creates a new Buffer containing the given JavaScript string {str}. + * If provided, the {encoding} parameter identifies the character encoding. + * If not provided, {encoding} defaults to 'utf8'. + * + * @param str + */ + static from(str: string, encoding?: string): Buffer; + /** + * Returns true if {obj} is a Buffer + * + * @param obj object to test. + */ + static isBuffer(obj: any): obj is Buffer; + /** + * Returns true if {encoding} is a valid encoding argument. + * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex' + * + * @param encoding string to test. + */ + static isEncoding(encoding: string): boolean; + /** + * Gives the actual byte length of a string. encoding defaults to 'utf8'. + * This is not the same as String.prototype.length since that returns the number of characters in a string. + * + * @param string string to test. + * @param encoding encoding used to evaluate (defaults to 'utf8') + */ + static byteLength(string: string, encoding?: string): number; + /** + * Returns a buffer which is the result of concatenating all the buffers in the list together. + * + * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer. + * If the list has exactly one item, then the first item of the list is returned. + * If the list has more than one item, then a new Buffer is created. + * + * @param list An array of Buffer objects to concatenate + * @param totalLength Total length of the buffers when concatenated. + * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly. + */ + static concat(list: Buffer[], totalLength?: number): Buffer; + /** + * The same as buf1.compare(buf2). + */ + static compare(buf1: Buffer, buf2: Buffer): number; + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + * @param fill if specified, buffer will be initialized by calling buf.fill(fill). + * If parameter is omitted, buffer will be filled with zeros. + * @param encoding encoding used for call to buf.fill while initalizing + */ + static alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer; + /** + * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents + * of the newly created Buffer are unknown and may contain sensitive data. + * + * @param size count of octets to allocate + */ + static allocUnsafe(size: number): Buffer; + /** + * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents + * of the newly created Buffer are unknown and may contain sensitive data. + * + * @param size count of octets to allocate + */ + static allocUnsafeSlow(size: number): Buffer; + } +} \ No newline at end of file diff --git a/node_modules/readable-stream/node_modules/safe-buffer/index.js b/node_modules/readable-stream/node_modules/safe-buffer/index.js new file mode 100644 index 0000000..22438da --- /dev/null +++ b/node_modules/readable-stream/node_modules/safe-buffer/index.js @@ -0,0 +1,62 @@ +/* eslint-disable node/no-deprecated-api */ +var buffer = require('buffer') +var Buffer = buffer.Buffer + +// alternative to using Object.keys for old browsers +function copyProps (src, dst) { + for (var key in src) { + dst[key] = src[key] + } +} +if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { + module.exports = buffer +} else { + // Copy properties from require('buffer') + copyProps(buffer, exports) + exports.Buffer = SafeBuffer +} + +function SafeBuffer (arg, encodingOrOffset, length) { + return Buffer(arg, encodingOrOffset, length) +} + +// Copy static methods from Buffer +copyProps(Buffer, SafeBuffer) + +SafeBuffer.from = function (arg, encodingOrOffset, length) { + if (typeof arg === 'number') { + throw new TypeError('Argument must not be a number') + } + return Buffer(arg, encodingOrOffset, length) +} + +SafeBuffer.alloc = function (size, fill, encoding) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + var buf = Buffer(size) + if (fill !== undefined) { + if (typeof encoding === 'string') { + buf.fill(fill, encoding) + } else { + buf.fill(fill) + } + } else { + buf.fill(0) + } + return buf +} + +SafeBuffer.allocUnsafe = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return Buffer(size) +} + +SafeBuffer.allocUnsafeSlow = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return buffer.SlowBuffer(size) +} diff --git a/node_modules/readable-stream/node_modules/safe-buffer/package.json b/node_modules/readable-stream/node_modules/safe-buffer/package.json new file mode 100644 index 0000000..623fbc3 --- /dev/null +++ b/node_modules/readable-stream/node_modules/safe-buffer/package.json @@ -0,0 +1,37 @@ +{ + "name": "safe-buffer", + "description": "Safer Node.js Buffer API", + "version": "5.1.2", + "author": { + "name": "Feross Aboukhadijeh", + "email": "feross@feross.org", + "url": "http://feross.org" + }, + "bugs": { + "url": "https://github.com/feross/safe-buffer/issues" + }, + "devDependencies": { + "standard": "*", + "tape": "^4.0.0" + }, + "homepage": "https://github.com/feross/safe-buffer", + "keywords": [ + "buffer", + "buffer allocate", + "node security", + "safe", + "safe-buffer", + "security", + "uninitialized" + ], + "license": "MIT", + "main": "index.js", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "git://github.com/feross/safe-buffer.git" + }, + "scripts": { + "test": "standard && tape test/*.js" + } +} diff --git a/node_modules/readable-stream/package.json b/node_modules/readable-stream/package.json new file mode 100644 index 0000000..2afa6fb --- /dev/null +++ b/node_modules/readable-stream/package.json @@ -0,0 +1,52 @@ +{ + "name": "readable-stream", + "version": "2.3.7", + "description": "Streams3, a user-land copy of the stream library from Node.js", + "main": "readable.js", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "devDependencies": { + "assert": "^1.4.0", + "babel-polyfill": "^6.9.1", + "buffer": "^4.9.0", + "lolex": "^2.3.2", + "nyc": "^6.4.0", + "tap": "^0.7.0", + "tape": "^4.8.0" + }, + "scripts": { + "test": "tap test/parallel/*.js test/ours/*.js && node test/verify-dependencies.js", + "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js", + "cover": "nyc npm test", + "report": "nyc report --reporter=lcov" + }, + "repository": { + "type": "git", + "url": "git://github.com/nodejs/readable-stream" + }, + "keywords": [ + "readable", + "stream", + "pipe" + ], + "browser": { + "util": false, + "./readable.js": "./readable-browser.js", + "./writable.js": "./writable-browser.js", + "./duplex.js": "./duplex-browser.js", + "./lib/internal/streams/stream.js": "./lib/internal/streams/stream-browser.js" + }, + "nyc": { + "include": [ + "lib/**.js" + ] + }, + "license": "MIT" +} diff --git a/node_modules/readable-stream/passthrough.js b/node_modules/readable-stream/passthrough.js new file mode 100644 index 0000000..ffd791d --- /dev/null +++ b/node_modules/readable-stream/passthrough.js @@ -0,0 +1 @@ +module.exports = require('./readable').PassThrough diff --git a/node_modules/readable-stream/readable-browser.js b/node_modules/readable-stream/readable-browser.js new file mode 100644 index 0000000..e503725 --- /dev/null +++ b/node_modules/readable-stream/readable-browser.js @@ -0,0 +1,7 @@ +exports = module.exports = require('./lib/_stream_readable.js'); +exports.Stream = exports; +exports.Readable = exports; +exports.Writable = require('./lib/_stream_writable.js'); +exports.Duplex = require('./lib/_stream_duplex.js'); +exports.Transform = require('./lib/_stream_transform.js'); +exports.PassThrough = require('./lib/_stream_passthrough.js'); diff --git a/node_modules/readable-stream/readable.js b/node_modules/readable-stream/readable.js new file mode 100644 index 0000000..ec89ec5 --- /dev/null +++ b/node_modules/readable-stream/readable.js @@ -0,0 +1,19 @@ +var Stream = require('stream'); +if (process.env.READABLE_STREAM === 'disable' && Stream) { + module.exports = Stream; + exports = module.exports = Stream.Readable; + exports.Readable = Stream.Readable; + exports.Writable = Stream.Writable; + exports.Duplex = Stream.Duplex; + exports.Transform = Stream.Transform; + exports.PassThrough = Stream.PassThrough; + exports.Stream = Stream; +} else { + exports = module.exports = require('./lib/_stream_readable.js'); + exports.Stream = Stream || exports; + exports.Readable = exports; + exports.Writable = require('./lib/_stream_writable.js'); + exports.Duplex = require('./lib/_stream_duplex.js'); + exports.Transform = require('./lib/_stream_transform.js'); + exports.PassThrough = require('./lib/_stream_passthrough.js'); +} diff --git a/node_modules/readable-stream/transform.js b/node_modules/readable-stream/transform.js new file mode 100644 index 0000000..b1baba2 --- /dev/null +++ b/node_modules/readable-stream/transform.js @@ -0,0 +1 @@ +module.exports = require('./readable').Transform diff --git a/node_modules/readable-stream/writable-browser.js b/node_modules/readable-stream/writable-browser.js new file mode 100644 index 0000000..ebdde6a --- /dev/null +++ b/node_modules/readable-stream/writable-browser.js @@ -0,0 +1 @@ +module.exports = require('./lib/_stream_writable.js'); diff --git a/node_modules/readable-stream/writable.js b/node_modules/readable-stream/writable.js new file mode 100644 index 0000000..3211a6f --- /dev/null +++ b/node_modules/readable-stream/writable.js @@ -0,0 +1,8 @@ +var Stream = require("stream") +var Writable = require("./lib/_stream_writable.js") + +if (process.env.READABLE_STREAM === 'disable') { + module.exports = Stream && Stream.Writable || Writable +} else { + module.exports = Writable +} diff --git a/node_modules/router/HISTORY.md b/node_modules/router/HISTORY.md deleted file mode 100644 index 47e02da..0000000 --- a/node_modules/router/HISTORY.md +++ /dev/null @@ -1,82 +0,0 @@ -1.1.5 / 2017-01-28 -================== - - * deps: array-flatten@2.1.1 - * deps: setprototypeof@1.0.2 - - Fix using fallback even when native method exists - -1.1.4 / 2016-01-21 -================== - - * deps: array-flatten@2.0.0 - * deps: methods@~1.1.2 - - perf: enable strict mode - * deps: parseurl@~1.3.1 - - perf: enable strict mode - -1.1.3 / 2015-08-02 -================== - - * Fix infinite loop condition using `mergeParams: true` - * Fix inner numeric indices incorrectly altering parent `req.params` - * deps: array-flatten@1.1.1 - - perf: enable strict mode - * deps: path-to-regexp@0.1.7 - - Fix regression with escaped round brackets and matching groups - -1.1.2 / 2015-07-06 -================== - - * Fix hiding platform issues with `decodeURIComponent` - - Only `URIError`s are a 400 - * Fix using `*` before params in routes - * Fix using capture groups before params in routes - * deps: path-to-regexp@0.1.6 - * perf: enable strict mode - * perf: remove argument reassignments in routing - * perf: skip attempting to decode zero length string - * perf: use plain for loops - -1.1.1 / 2015-05-25 -================== - - * Fix issue where `next('route')` in `router.param` would incorrectly skip values - * deps: array-flatten@1.1.0 - * deps: debug@~2.2.0 - - deps: ms@0.7.1 - -1.1.0 / 2015-04-22 -================== - - * Use `setprototypeof` instead of `__proto__` - * deps: debug@~2.1.3 - - Fix high intensity foreground color for bold - - deps: ms@0.7.0 - -1.0.0 / 2015-01-13 -================== - - * Fix crash from error within `OPTIONS` response handler - * deps: array-flatten@1.0.2 - - Remove redundant code path - -1.0.0-beta.3 / 2015-01-11 -========================= - - * Fix duplicate methods appearing in OPTIONS responses - * Fix OPTIONS responses to include the HEAD method properly - * Remove support for leading colon in `router.param(name, fn)` - * Use `array-flatten` for flattening arrays - * deps: debug@~2.1.1 - * deps: methods@~1.1.1 - -1.0.0-beta.2 / 2014-11-19 -========================= - - * Match routes iteratively to prevent stack overflows - -1.0.0-beta.1 / 2014-11-16 -========================= - - * Initial release ported from Express 4.x - - Altered to work without Express diff --git a/node_modules/router/LICENSE b/node_modules/router/LICENSE deleted file mode 100644 index 31e7f7d..0000000 --- a/node_modules/router/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -(The MIT License) - -Copyright (c) 2013 Roman Shtylman -Copyright (c) 2014 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/router/README.md b/node_modules/router/README.md deleted file mode 100644 index a2e5e01..0000000 --- a/node_modules/router/README.md +++ /dev/null @@ -1,311 +0,0 @@ -# router - -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Node.js Version][node-version-image]][node-version-url] -[![Build Status][travis-image]][travis-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -Simple middleware-style router - -## Installation - -```bash -$ npm install router -``` - -## API - -```js -var finalhandler = require('finalhandler') -var http = require('http') -var Router = require('router') - -var router = Router() -router.get('/', function (req, res) { - res.setHeader('Content-Type', 'text/plain; charset=utf-8') - res.end('Hello World!') -}) - -var server = http.createServer(function(req, res) { - router(req, res, finalhandler(req, res)) -}) - -server.listen(3000) -``` - -This module is currently an extracted version from the Express project, -but with the main change being it can be used with a plain `http.createServer` -object or other web frameworks by removing Express-specific API calls. - -## Router(options) - -Options - -- `strict` - When `false` trailing slashes are optional (default: `false`) -- `caseSensitive` - When `true` the routing will be case sensitive. (default: `false`) -- `mergeParams` - When `true` any `req.params` passed to the router will be - merged into the router's `req.params`. (default: `false`) ([example](#example-using-mergeparams)) - -Returns a function with the signature `router(req, res, callback)` where -`callback([err])` must be provided to handle errors and fall-through from -not handling requests. - -### router.use([path], ...middleware) - -Use the given middleware function for all http methods on the given `path`, -defaulting to the root path. - -`router` does not automatically see `use` as a handler. As such, it will not -consider it one for handling `OPTIONS` requests. - -* Note: If a `path` is specified, that `path` is stripped from the start of - `req.url`. - -```js -router.use(function (req, res, next) { - // do your things - - // continue to the next middleware - // the request will stall if this is not called - next() - - // note: you should NOT call `next` if you have begun writing to the response -}) -``` - -### router\[method](path, ...[middleware], handler) - -The [http methods](https://github.com/jshttp/methods/blob/master/index.js) provide -the routing functionality in `router`. - -These are functions which you can directly call on the router to register a new -`handler` for the `method` at a specified `path`. - -```js -// handle a `GET` request -router.get('/', function (req, res) { - res.setHeader('Content-Type', 'text/plain; charset=utf-8') - res.end('Hello World!') -}) -``` - -Additional middleware may be given before the handler. These middleware behave -exactly as normal with one exception: they may invoke `next('route')`. -Calling `next('route')` bypasses the remaining middleware and handler for this -route, passing the request on to the next route. - -### router.param(name, param_middleware) - -Maps the specified path parameter `name` to a specialized param-capturing middleware. - -This function positions the middleware in the same stack as `.use`. - -Parameter mapping is used to provide pre-conditions to routes -which use normalized placeholders. For example a _:user_id_ parameter -could automatically load a user's information from the database without -any additional code: - -```js -router.param('user_id', function (req, res, next, id) { - User.find(id, function (err, user) { - if (err) { - return next(err) - } else if (!user) { - return next(new Error('failed to load user')) - } - req.user = user - - // continue processing the request - next() - }) -}) -``` - -### router.route(path) - -Creates an instance of a single `Route` for the given `path`. -(See `Router.Route` below) - -Routes can be used to handle http `methods` with their own, optional middleware. - -Using `router.route(path)` is a recommended approach to avoiding duplicate -route naming and thus typo errors. - -```js -var api = router.route('/api/') -``` - -## Router.Route(path) - -Represents a single route as an instance that can be used can be used to handle -http `methods` with it's own, optional middleware. - -### route\[method](handler) - -These are functions which you can directly call on a route to register a new -`handler` for the `method` on the route. - -```js -// handle a `GET` request -var status = router.route('/status') - -status.get(function (req, res) { - res.setHeader('Content-Type', 'text/plain; charset=utf-8') - res.end('All Systems Green!') -}) -``` - -### route.all(handler) - -Adds a handler for all HTTP methods to this route. - -The handler can behave like middleware and call `next` to continue processing -rather than responding. - -```js -router.route('/') -.all(function (req, res, next) { - next() -}) -.all(check_something) -.get(function (req, res) { - res.setHeader('Content-Type', 'text/plain; charset=utf-8') - res.end('Hello World!') -}) -``` - -## Examples - -```js -// import our modules -var http = require('http') -var Router = require('router') -var finalhandler = require('finalhandler') -var compression = require('compression') -var bodyParser = require('body-parser') - -// store our message to display -var message = "Hello World!" - -// initialize the router & server and add a final callback. -var router = Router() -var server = http.createServer(function onRequest(req, res) { - router(req, res, finalhandler(req, res)) -}) - -// use some middleware and compress all outgoing responses -router.use(compression()) - -// handle `GET` requests to `/message` -router.get('/message', function (req, res) { - res.statusCode = 200 - res.setHeader('Content-Type', 'text/plain; charset=utf-8') - res.end(message + '\n') -}) - -// create and mount a new router for our API -var api = Router() -router.use('/api/', api) - -// add a body parsing middleware to our API -api.use(bodyParser.json()) - -// handle `PATCH` requests to `/api/set-message` -api.patch('/set-message', function (req, res) { - if (req.body.value) { - message = req.body.value - - res.statusCode = 200 - res.setHeader('Content-Type', 'text/plain; charset=utf-8') - res.end(message + '\n') - } else { - res.statusCode = 400 - res.setHeader('Content-Type', 'text/plain; charset=utf-8') - res.end('Invalid API Syntax\n') - } -}) - -// make our http server listen to connections -server.listen(8080) -``` - -You can get the message by running this command in your terminal, - or navigating to `127.0.0.1:8080` in a web browser. -```bash -curl http://127.0.0.1:8080 -``` - -You can set the message by sending it a `PATCH` request via this command: -```bash -curl http://127.0.0.1:8080/api/set-message -X PATCH -H "Content-Type: application/json" -d '{"value":"Cats!"}' -``` - -### Example using mergeParams - -```js -var http = require('http') -var Router = require('router') -var finalhandler = require('finalhandler') - -// this example is about the mergeParams option -var opts = { mergeParams: true } - -// make a router with out special options -var router = Router(opts) -var server = http.createServer(function onRequest(req, res) { - - // set something to be passed into the router - req.params = { type: 'kitten' } - - router(req, res, finalhandler(req, res)) -}) - -router.get('/', function (req, res) { - res.statusCode = 200 - res.setHeader('Content-Type', 'text/plain; charset=utf-8') - - // with respond with the the params that were passed in - res.end(req.params.type + '\n') -}) - -// make another router with our options -var handler = Router(opts) - -// mount our new router to a route that accepts a param -router.use('/:path', handler) - -handler.get('/', function (req, res) { - res.statusCode = 200 - res.setHeader('Content-Type', 'text/plain; charset=utf-8') - - // will respond with the param of the router's parent route - res.end(path + '\n') -}) - -// make our http server listen to connections -server.listen(8080) -``` - -Now you can get the type, or what path you are requesting: -```bash -curl http://127.0.0.1:8080 -> kitten -curl http://127.0.0.1:8080/such_path -> such_path -``` - -## License - -[MIT](LICENSE) - -[npm-image]: https://img.shields.io/npm/v/router.svg -[npm-url]: https://npmjs.org/package/router -[node-version-image]: https://img.shields.io/node/v/router.svg -[node-version-url]: http://nodejs.org/download/ -[travis-image]: https://img.shields.io/travis/pillarjs/router/master.svg -[travis-url]: https://travis-ci.org/pillarjs/router -[coveralls-image]: https://img.shields.io/coveralls/pillarjs/router/master.svg -[coveralls-url]: https://coveralls.io/r/pillarjs/router?branch=master -[downloads-image]: https://img.shields.io/npm/dm/router.svg -[downloads-url]: https://npmjs.org/package/router diff --git a/node_modules/router/index.js b/node_modules/router/index.js deleted file mode 100644 index b488e58..0000000 --- a/node_modules/router/index.js +++ /dev/null @@ -1,735 +0,0 @@ -/*! - * router - * Copyright(c) 2013 Roman Shtylman - * Copyright(c) 2014 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var debug = require('debug')('router') -var flatten = require('array-flatten') -var Layer = require('./lib/layer') -var methods = require('methods') -var mixin = require('utils-merge') -var parseUrl = require('parseurl') -var Route = require('./lib/route') -var setPrototypeOf = require('setprototypeof') - -/** - * Module variables. - * @private - */ - -var slice = Array.prototype.slice - -/* istanbul ignore next */ -var defer = typeof setImmediate === 'function' - ? setImmediate - : function(fn){ process.nextTick(fn.bind.apply(fn, arguments)) } - -/** - * Expose `Router`. - */ - -module.exports = Router - -/** - * Expose `Route`. - */ - -module.exports.Route = Route - -/** - * Initialize a new `Router` with the given `options`. - * - * @param {object} options - * @return {Router} which is an callable function - * @public - */ - -function Router(options) { - if (!(this instanceof Router)) { - return new Router(options) - } - - var opts = options || {} - - function router(req, res, next) { - router.handle(req, res, next) - } - - // inherit from the correct prototype - setPrototypeOf(router, this) - - router.caseSensitive = opts.caseSensitive - router.mergeParams = opts.mergeParams - router.params = {} - router.strict = opts.strict - router.stack = [] - - return router -} - -/** - * Router prototype inherits from a Function. - */ - -/* istanbul ignore next */ -Router.prototype = function () {} - -/** - * Map the given param placeholder `name`(s) to the given callback. - * - * Parameter mapping is used to provide pre-conditions to routes - * which use normalized placeholders. For example a _:user_id_ parameter - * could automatically load a user's information from the database without - * any additional code. - * - * The callback uses the same signature as middleware, the only difference - * being that the value of the placeholder is passed, in this case the _id_ - * of the user. Once the `next()` function is invoked, just like middleware - * it will continue on to execute the route, or subsequent parameter functions. - * - * Just like in middleware, you must either respond to the request or call next - * to avoid stalling the request. - * - * router.param('user_id', function(req, res, next, id){ - * User.find(id, function(err, user){ - * if (err) { - * return next(err) - * } else if (!user) { - * return next(new Error('failed to load user')) - * } - * req.user = user - * next() - * }) - * }) - * - * @param {string} name - * @param {function} fn - * @public - */ - -Router.prototype.param = function param(name, fn) { - if (!name) { - throw new TypeError('argument name is required') - } - - if (typeof name !== 'string') { - throw new TypeError('argument name must be a string') - } - - if (!fn) { - throw new TypeError('argument fn is required') - } - - if (typeof fn !== 'function') { - throw new TypeError('argument fn must be a function') - } - - var params = this.params[name] - - if (!params) { - params = this.params[name] = [] - } - - params.push(fn) - - return this -} - -/** - * Dispatch a req, res into the router. - * - * @private - */ - -Router.prototype.handle = function handle(req, res, callback) { - if (!callback) { - throw new TypeError('argument callback is required') - } - - debug('dispatching %s %s', req.method, req.url) - - var idx = 0 - var methods - var protohost = getProtohost(req.url) || '' - var removed = '' - var self = this - var slashAdded = false - var paramcalled = {} - - // middleware and routes - var stack = this.stack - - // manage inter-router variables - var parentParams = req.params - var parentUrl = req.baseUrl || '' - var done = restore(callback, req, 'baseUrl', 'next', 'params') - - // setup next layer - req.next = next - - // for options requests, respond with a default if nothing else responds - if (req.method === 'OPTIONS') { - methods = [] - done = wrap(done, generateOptionsResponder(res, methods)) - } - - // setup basic req values - req.baseUrl = parentUrl - req.originalUrl = req.originalUrl || req.url - - next() - - function next(err) { - var layerError = err === 'route' - ? null - : err - - // remove added slash - if (slashAdded) { - req.url = req.url.substr(1) - slashAdded = false - } - - // restore altered req.url - if (removed.length !== 0) { - req.baseUrl = parentUrl - req.url = protohost + removed + req.url.substr(protohost.length) - removed = '' - } - - // no more matching layers - if (idx >= stack.length) { - defer(done, layerError) - return - } - - // get pathname of request - var path = getPathname(req) - - if (path == null) { - return done(layerError) - } - - // find next matching layer - var layer - var match - var route - - while (match !== true && idx < stack.length) { - layer = stack[idx++] - match = matchLayer(layer, path) - route = layer.route - - if (typeof match !== 'boolean') { - // hold on to layerError - layerError = layerError || match - } - - if (match !== true) { - continue - } - - if (!route) { - // process non-route handlers normally - continue - } - - if (layerError) { - // routes do not match with a pending error - match = false - continue - } - - var method = req.method; - var has_method = route._handles_method(method) - - // build up automatic options response - if (!has_method && method === 'OPTIONS' && methods) { - methods.push.apply(methods, route._methods()) - } - - // don't even bother matching route - if (!has_method && method !== 'HEAD') { - match = false - continue - } - } - - // no match - if (match !== true) { - return done(layerError) - } - - // store route for dispatch on change - if (route) { - req.route = route - } - - // Capture one-time layer values - req.params = self.mergeParams - ? mergeParams(layer.params, parentParams) - : layer.params - var layerPath = layer.path - - // this should be done for the layer - self.process_params(layer, paramcalled, req, res, function (err) { - if (err) { - return next(layerError || err) - } - - if (route) { - return layer.handle_request(req, res, next) - } - - trim_prefix(layer, layerError, layerPath, path) - }) - } - - function trim_prefix(layer, layerError, layerPath, path) { - var c = path[layerPath.length] - - if (c && c !== '/') { - next(layerError) - return - } - - // Trim off the part of the url that matches the route - // middleware (.use stuff) needs to have the path stripped - if (layerPath.length !== 0) { - debug('trim prefix (%s) from url %s', layerPath, req.url) - removed = layerPath - req.url = protohost + req.url.substr(protohost.length + removed.length) - - // Ensure leading slash - if (!protohost && req.url[0] !== '/') { - req.url = '/' + req.url - slashAdded = true - } - - // Setup base URL (no trailing slash) - req.baseUrl = parentUrl + (removed[removed.length - 1] === '/' - ? removed.substring(0, removed.length - 1) - : removed) - } - - debug('%s %s : %s', layer.name, layerPath, req.originalUrl) - - if (layerError) { - layer.handle_error(layerError, req, res, next) - } else { - layer.handle_request(req, res, next) - } - } -} - -/** - * Process any parameters for the layer. - * - * @private - */ - -Router.prototype.process_params = function process_params(layer, called, req, res, done) { - var params = this.params - - // captured parameters from the layer, keys and values - var keys = layer.keys - - // fast track - if (!keys || keys.length === 0) { - return done() - } - - var i = 0 - var name - var paramIndex = 0 - var key - var paramVal - var paramCallbacks - var paramCalled - - // process params in order - // param callbacks can be async - function param(err) { - if (err) { - return done(err) - } - - if (i >= keys.length ) { - return done() - } - - paramIndex = 0 - key = keys[i++] - - if (!key) { - return done() - } - - name = key.name - paramVal = req.params[name] - paramCallbacks = params[name] - paramCalled = called[name] - - if (paramVal === undefined || !paramCallbacks) { - return param() - } - - // param previously called with same value or error occurred - if (paramCalled && (paramCalled.match === paramVal - || (paramCalled.error && paramCalled.error !== 'route'))) { - // restore value - req.params[name] = paramCalled.value - - // next param - return param(paramCalled.error) - } - - called[name] = paramCalled = { - error: null, - match: paramVal, - value: paramVal - } - - paramCallback() - } - - // single param callbacks - function paramCallback(err) { - var fn = paramCallbacks[paramIndex++] - - // store updated value - paramCalled.value = req.params[key.name] - - if (err) { - // store error - paramCalled.error = err - param(err) - return - } - - if (!fn) return param() - - try { - fn(req, res, paramCallback, paramVal, key.name) - } catch (e) { - paramCallback(e) - } - } - - param() -} - -/** - * Use the given middleware function, with optional path, defaulting to "/". - * - * Use (like `.all`) will run for any http METHOD, but it will not add - * handlers for those methods so OPTIONS requests will not consider `.use` - * functions even if they could respond. - * - * The other difference is that _route_ path is stripped and not visible - * to the handler function. The main effect of this feature is that mounted - * handlers can operate without any code changes regardless of the "prefix" - * pathname. - * - * @public - */ - -Router.prototype.use = function use(handler) { - var offset = 0 - var path = '/' - - // default path to '/' - // disambiguate router.use([handler]) - if (typeof handler !== 'function') { - var arg = handler - - while (Array.isArray(arg) && arg.length !== 0) { - arg = arg[0] - } - - // first arg is the path - if (typeof arg !== 'function') { - offset = 1 - path = handler - } - } - - var callbacks = flatten(slice.call(arguments, offset)) - - if (callbacks.length === 0) { - throw new TypeError('argument handler is required') - } - - for (var i = 0; i < callbacks.length; i++) { - var fn = callbacks[i] - - if (typeof fn !== 'function') { - throw new TypeError('argument handler must be a function') - } - - // add the middleware - debug('use %s %s', path, fn.name || '') - - var layer = new Layer(path, { - sensitive: this.caseSensitive, - strict: false, - end: false - }, fn) - - layer.route = undefined - - this.stack.push(layer) - } - - return this -} - -/** - * Create a new Route for the given path. - * - * Each route contains a separate middleware stack and VERB handlers. - * - * See the Route api documentation for details on adding handlers - * and middleware to routes. - * - * @param {string} path - * @return {Route} - * @public - */ - -Router.prototype.route = function route(path) { - var route = new Route(path) - - var layer = new Layer(path, { - sensitive: this.caseSensitive, - strict: this.strict, - end: true - }, handle) - - function handle(req, res, next) { - route.dispatch(req, res, next) - } - - layer.route = route - - this.stack.push(layer) - return route -} - -// create Router#VERB functions -methods.concat('all').forEach(function(method){ - Router.prototype[method] = function (path) { - var route = this.route(path) - route[method].apply(route, slice.call(arguments, 1)) - return this - } -}) - -/** - * Generate a callback that will make an OPTIONS response. - * - * @param {OutgoingMessage} res - * @param {array} methods - * @private - */ - -function generateOptionsResponder(res, methods) { - return function onDone(fn, err) { - if (err || methods.length === 0) { - return fn(err) - } - - trySendOptionsResponse(res, methods, fn) - } -} - -/** - * Get pathname of request. - * - * @param {IncomingMessage} req - * @private - */ - -function getPathname(req) { - try { - return parseUrl(req).pathname; - } catch (err) { - return undefined; - } -} - -/** - * Get get protocol + host for a URL. - * - * @param {string} url - * @private - */ - -function getProtohost(url) { - if (url.length === 0 || url[0] === '/') { - return undefined - } - - var searchIndex = url.indexOf('?') - var pathLength = searchIndex !== -1 - ? searchIndex - : url.length - var fqdnIndex = url.substr(0, pathLength).indexOf('://') - - return fqdnIndex !== -1 - ? url.substr(0, url.indexOf('/', 3 + fqdnIndex)) - : undefined -} - -/** - * Match path to a layer. - * - * @param {Layer} layer - * @param {string} path - * @private - */ - -function matchLayer(layer, path) { - try { - return layer.match(path); - } catch (err) { - return err; - } -} - -/** - * Merge params with parent params - * - * @private - */ - -function mergeParams(params, parent) { - if (typeof parent !== 'object' || !parent) { - return params - } - - // make copy of parent for base - var obj = mixin({}, parent) - - // simple non-numeric merging - if (!(0 in params) || !(0 in parent)) { - return mixin(obj, params) - } - - var i = 0 - var o = 0 - - // determine numeric gap in params - while (i in params) { - i++ - } - - // determine numeric gap in parent - while (o in parent) { - o++ - } - - // offset numeric indices in params before merge - for (i--; i >= 0; i--) { - params[i + o] = params[i] - - // create holes for the merge when necessary - if (i < o) { - delete params[i] - } - } - - return mixin(obj, params) -} - -/** - * Restore obj props after function - * - * @private - */ - -function restore(fn, obj) { - var props = new Array(arguments.length - 2) - var vals = new Array(arguments.length - 2) - - for (var i = 0; i < props.length; i++) { - props[i] = arguments[i + 2] - vals[i] = obj[props[i]] - } - - return function(err){ - // restore vals - for (var i = 0; i < props.length; i++) { - obj[props[i]] = vals[i] - } - - return fn.apply(this, arguments) - } -} - -/** - * Send an OPTIONS response. - * - * @private - */ - -function sendOptionsResponse(res, methods) { - var options = Object.create(null) - - // build unique method map - for (var i = 0; i < methods.length; i++) { - options[methods[i]] = true - } - - // construct the allow list - var allow = Object.keys(options).sort().join(', ') - - // send response - res.setHeader('Allow', allow) - res.setHeader('Content-Length', Buffer.byteLength(allow)) - res.setHeader('Content-Type', 'text/plain') - res.setHeader('X-Content-Type-Options', 'nosniff') - res.end(allow) -} - -/** - * Try to send an OPTIONS response. - * - * @private - */ - -function trySendOptionsResponse(res, methods, next) { - try { - sendOptionsResponse(res, methods) - } catch (err) { - next(err) - } -} - -/** - * Wrap a function - * - * @private - */ - -function wrap(old, fn) { - return function proxy() { - var args = new Array(arguments.length + 1) - - args[0] = old - for (var i = 0, len = arguments.length; i < len; i++) { - args[i + 1] = arguments[i] - } - - fn.apply(this, args) - } -} diff --git a/node_modules/router/lib/layer.js b/node_modules/router/lib/layer.js deleted file mode 100644 index 99b25d2..0000000 --- a/node_modules/router/lib/layer.js +++ /dev/null @@ -1,175 +0,0 @@ -/*! - * router - * Copyright(c) 2013 Roman Shtylman - * Copyright(c) 2014 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var pathRegexp = require('path-to-regexp') -var debug = require('debug')('router:layer') - -/** - * Module variables. - * @private - */ - -var hasOwnProperty = Object.prototype.hasOwnProperty - -/** - * Expose `Layer`. - */ - -module.exports = Layer - -function Layer(path, options, fn) { - if (!(this instanceof Layer)) { - return new Layer(path, options, fn) - } - - debug('new %s', path) - var opts = options || {} - - this.handle = fn - this.name = fn.name || '' - this.params = undefined - this.path = undefined - this.regexp = pathRegexp(path, this.keys = [], opts) - - if (path === '/' && opts.end === false) { - this.regexp.fast_slash = true - } -} - -/** - * Handle the error for the layer. - * - * @param {Error} error - * @param {Request} req - * @param {Response} res - * @param {function} next - * @api private - */ - -Layer.prototype.handle_error = function handle_error(error, req, res, next) { - var fn = this.handle - - if (fn.length !== 4) { - // not a standard error handler - return next(error) - } - - try { - fn(error, req, res, next) - } catch (err) { - next(err) - } -} - -/** - * Handle the request for the layer. - * - * @param {Request} req - * @param {Response} res - * @param {function} next - * @api private - */ - -Layer.prototype.handle_request = function handle(req, res, next) { - var fn = this.handle - - if (fn.length > 3) { - // not a standard request handler - return next() - } - - try { - fn(req, res, next) - } catch (err) { - next(err) - } -} - -/** - * Check if this route matches `path`, if so - * populate `.params`. - * - * @param {String} path - * @return {Boolean} - * @api private - */ - -Layer.prototype.match = function match(path) { - if (path == null) { - // no path, nothing matches - this.params = undefined - this.path = undefined - return false - } - - if (this.regexp.fast_slash) { - // fast path non-ending match for / (everything matches) - this.params = {} - this.path = '' - return true - } - - var m = this.regexp.exec(path) - - if (!m) { - this.params = undefined - this.path = undefined - return false - } - - // store values - this.params = {} - this.path = m[0] - - // iterate matches - var keys = this.keys - var params = this.params - - for (var i = 1; i < m.length; i++) { - var key = keys[i - 1] - var prop = key.name - var val = decode_param(m[i]) - - if (val !== undefined || !(hasOwnProperty.call(params, prop))) { - params[prop] = val - } - } - - return true -} - -/** - * Decode param value. - * - * @param {string} val - * @return {string} - * @private - */ - -function decode_param(val){ - if (typeof val !== 'string' || val.length === 0) { - return val - } - - try { - return decodeURIComponent(val) - } catch (err) { - if (err instanceof URIError) { - err.message = 'Failed to decode param \'' + val + '\'' - err.status = 400 - } - - throw err - } -} diff --git a/node_modules/router/lib/route.js b/node_modules/router/lib/route.js deleted file mode 100644 index 8b67f2d..0000000 --- a/node_modules/router/lib/route.js +++ /dev/null @@ -1,221 +0,0 @@ -/*! - * router - * Copyright(c) 2013 Roman Shtylman - * Copyright(c) 2014 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var debug = require('debug')('router:route') -var flatten = require('array-flatten') -var Layer = require('./layer') -var methods = require('methods') - -/** - * Module variables. - * @private - */ - -var slice = Array.prototype.slice - -/** - * Expose `Route`. - */ - -module.exports = Route - -/** - * Initialize `Route` with the given `path`, - * - * @param {String} path - * @api private - */ - -function Route(path) { - debug('new %s', path) - this.path = path - this.stack = [] - - // route handlers for various http methods - this.methods = {} -} - -/** - * @private - */ - -Route.prototype._handles_method = function _handles_method(method) { - if (this.methods._all) { - return true - } - - // normalize name - var name = method.toLowerCase() - - if (name === 'head' && !this.methods['head']) { - name = 'get' - } - - return Boolean(this.methods[name]) -} - -/** - * @return {array} supported HTTP methods - * @private - */ - -Route.prototype._methods = function _methods() { - var methods = Object.keys(this.methods) - - // append automatic head - if (this.methods.get && !this.methods.head) { - methods.push('head') - } - - for (var i = 0; i < methods.length; i++) { - // make upper case - methods[i] = methods[i].toUpperCase() - } - - return methods -} - -/** - * dispatch req, res into this route - * - * @private - */ - -Route.prototype.dispatch = function dispatch(req, res, done) { - var idx = 0 - var stack = this.stack - if (stack.length === 0) { - return done() - } - - var method = req.method.toLowerCase() - if (method === 'head' && !this.methods['head']) { - method = 'get' - } - - req.route = this - - next() - - function next(err) { - if (err && err === 'route') { - return done() - } - - // no more matching layers - if (idx >= stack.length) { - return done(err) - } - - var layer - var match - - // find next matching layer - while (match !== true && idx < stack.length) { - layer = stack[idx++] - match = !layer.method || layer.method === method - } - - // no match - if (match !== true) { - return done(err) - } - - if (err) { - layer.handle_error(err, req, res, next) - } else { - layer.handle_request(req, res, next) - } - } -} - -/** - * Add a handler for all HTTP verbs to this route. - * - * Behaves just like middleware and can respond or call `next` - * to continue processing. - * - * You can use multiple `.all` call to add multiple handlers. - * - * function check_something(req, res, next){ - * next() - * } - * - * function validate_user(req, res, next){ - * next() - * } - * - * route - * .all(validate_user) - * .all(check_something) - * .get(function(req, res, next){ - * res.send('hello world') - * }) - * - * @param {array|function} handler - * @return {Route} for chaining - * @api public - */ - -Route.prototype.all = function all(handler) { - var callbacks = flatten(slice.call(arguments)) - - if (callbacks.length === 0) { - throw new TypeError('argument handler is required') - } - - for (var i = 0; i < callbacks.length; i++) { - var fn = callbacks[i] - - if (typeof fn !== 'function') { - throw new TypeError('argument handler must be a function') - } - - var layer = Layer('/', {}, fn) - layer.method = undefined - - this.methods._all = true - this.stack.push(layer) - } - - return this -} - -methods.forEach(function (method) { - Route.prototype[method] = function (handler) { - var callbacks = flatten(slice.call(arguments)) - - if (callbacks.length === 0) { - throw new TypeError('argument handler is required') - } - - for (var i = 0; i < callbacks.length; i++) { - var fn = callbacks[i] - - if (typeof fn !== 'function') { - throw new TypeError('argument handler must be a function') - } - - debug('%s %s', method, this.path) - - var layer = Layer('/', {}, fn) - layer.method = method - - this.methods[method] = true - this.stack.push(layer) - } - - return this - } -}) diff --git a/node_modules/router/node_modules/array-flatten/LICENSE b/node_modules/router/node_modules/array-flatten/LICENSE deleted file mode 100644 index 983fbe8..0000000 --- a/node_modules/router/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/router/node_modules/array-flatten/README.md b/node_modules/router/node_modules/array-flatten/README.md deleted file mode 100644 index 4c4588e..0000000 --- a/node_modules/router/node_modules/array-flatten/README.md +++ /dev/null @@ -1,50 +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 nested arrays. - -## 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.depth([1, [2, [3, [4, [5], 6], 7], 8], 9], 2) -//=> [1, 2, 3, [4, [5], 6], 7, 8, 9] - -(function () { - flatten.from(arguments) //=> [1, 2, 3] -})(1, [2, 3]) -``` - -### Methods - -* **flatten(array)** Flatten a nested array structure -* **flatten.from(arrayish)** Flatten an array-like structure (E.g. arguments) -* **flatten.depth(array, depth)** Flatten a nested array structure with a specific depth -* **flatten.fromDepth(arrayish, depth)** Flatten an array-like structure with a specific depth - -## 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/router/node_modules/array-flatten/array-flatten.d.ts b/node_modules/router/node_modules/array-flatten/array-flatten.d.ts deleted file mode 100644 index 6caaaf5..0000000 --- a/node_modules/router/node_modules/array-flatten/array-flatten.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -declare function flatten (array: flatten.NestedArray): T[]; - -declare namespace flatten { - export interface NestedArray extends Array> {} - - export interface NestedList { - [index: number]: T | NestedList; - length: number; - } - - export function from (array: NestedList): T[]; - export function depth (array: NestedArray, depth: number): NestedArray; - export function depthFrom (array: NestedList, depth: number): NestedArray; -} - -export = flatten; diff --git a/node_modules/router/node_modules/array-flatten/array-flatten.js b/node_modules/router/node_modules/array-flatten/array-flatten.js deleted file mode 100644 index a624fca..0000000 --- a/node_modules/router/node_modules/array-flatten/array-flatten.js +++ /dev/null @@ -1,108 +0,0 @@ -'use strict' - -/** - * Expose `arrayFlatten`. - */ -module.exports = flatten -module.exports.from = flattenFrom -module.exports.depth = flattenDepth -module.exports.fromDepth = flattenFromDepth - -/** - * Flatten an array. - * - * @param {Array} array - * @return {Array} - */ -function flatten (array) { - if (!Array.isArray(array)) { - throw new TypeError('Expected value to be an array') - } - - return flattenFrom(array) -} - -/** - * Flatten an array-like structure. - * - * @param {Array} array - * @return {Array} - */ -function flattenFrom (array) { - return flattenDown(array, []) -} - -/** - * Flatten an array-like structure with depth. - * - * @param {Array} array - * @param {number} depth - * @return {Array} - */ -function flattenDepth (array, depth) { - if (!Array.isArray(array)) { - throw new TypeError('Expected value to be an array') - } - - return flattenFromDepth(array, depth) -} - -/** - * Flatten an array-like structure with depth. - * - * @param {Array} array - * @param {number} depth - * @return {Array} - */ -function flattenFromDepth (array, depth) { - if (typeof depth !== 'number') { - throw new TypeError('Expected the depth to be a number') - } - - return flattenDownDepth(array, [], depth) -} - -/** - * Flatten an array indefinitely. - * - * @param {Array} array - * @param {Array} result - * @return {Array} - */ -function flattenDown (array, result) { - for (var i = 0; i < array.length; i++) { - var value = array[i] - - if (Array.isArray(value)) { - flattenDown(value, result) - } else { - result.push(value) - } - } - - return result -} - -/** - * Flatten an array with depth. - * - * @param {Array} array - * @param {Array} result - * @param {number} depth - * @return {Array} - */ -function flattenDownDepth (array, result, depth) { - depth-- - - for (var i = 0; i < array.length; i++) { - var value = array[i] - - if (depth > -1 && Array.isArray(value)) { - flattenDownDepth(value, result, depth) - } else { - result.push(value) - } - } - - return result -} diff --git a/node_modules/router/node_modules/array-flatten/package.json b/node_modules/router/node_modules/array-flatten/package.json deleted file mode 100644 index 058acb2..0000000 --- a/node_modules/router/node_modules/array-flatten/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "array-flatten", - "version": "2.1.1", - "description": "Flatten nested arrays", - "main": "array-flatten.js", - "typings": "array-flatten.d.ts", - "files": [ - "array-flatten.js", - "array-flatten.d.ts", - "LICENSE" - ], - "scripts": { - "lint": "standard", - "test-spec": "mocha -R spec --bail", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- -R spec --bail", - "test": "npm run lint && npm run test-cov", - "benchmark": "node benchmark" - }, - "repository": { - "type": "git", - "url": "git://github.com/blakeembrey/array-flatten.git" - }, - "keywords": [ - "array", - "flatten", - "arguments", - "depth", - "fast", - "for" - ], - "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": { - "benchmarked": "^0.2.5", - "istanbul": "^0.4.0", - "mocha": "^3.1.2", - "standard": "^8.5.0" - } -} diff --git a/node_modules/router/node_modules/debug/.jshintrc b/node_modules/router/node_modules/debug/.jshintrc deleted file mode 100644 index 299877f..0000000 --- a/node_modules/router/node_modules/debug/.jshintrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "laxbreak": true -} diff --git a/node_modules/router/node_modules/debug/.npmignore b/node_modules/router/node_modules/debug/.npmignore deleted file mode 100644 index 7e6163d..0000000 --- a/node_modules/router/node_modules/debug/.npmignore +++ /dev/null @@ -1,6 +0,0 @@ -support -test -examples -example -*.sock -dist diff --git a/node_modules/router/node_modules/debug/History.md b/node_modules/router/node_modules/debug/History.md deleted file mode 100644 index 854c971..0000000 --- a/node_modules/router/node_modules/debug/History.md +++ /dev/null @@ -1,195 +0,0 @@ - -2.2.0 / 2015-05-09 -================== - - * package: update "ms" to v0.7.1 (#202, @dougwilson) - * README: add logging to file example (#193, @DanielOchoa) - * README: fixed a typo (#191, @amir-s) - * browser: expose `storage` (#190, @stephenmathieson) - * Makefile: add a `distclean` target (#189, @stephenmathieson) - -2.1.3 / 2015-03-13 -================== - - * Updated stdout/stderr example (#186) - * Updated example/stdout.js to match debug current behaviour - * Renamed example/stderr.js to stdout.js - * Update Readme.md (#184) - * replace high intensity foreground color for bold (#182, #183) - -2.1.2 / 2015-03-01 -================== - - * dist: recompile - * update "ms" to v0.7.0 - * package: update "browserify" to v9.0.3 - * component: fix "ms.js" repo location - * changed bower package name - * updated documentation about using debug in a browser - * fix: security error on safari (#167, #168, @yields) - -2.1.1 / 2014-12-29 -================== - - * browser: use `typeof` to check for `console` existence - * browser: check for `console.log` truthiness (fix IE 8/9) - * browser: add support for Chrome apps - * Readme: added Windows usage remarks - * Add `bower.json` to properly support bower install - -2.1.0 / 2014-10-15 -================== - - * node: implement `DEBUG_FD` env variable support - * package: update "browserify" to v6.1.0 - * package: add "license" field to package.json (#135, @panuhorsmalahti) - -2.0.0 / 2014-09-01 -================== - - * package: update "browserify" to v5.11.0 - * node: use stderr rather than stdout for logging (#29, @stephenmathieson) - -1.0.4 / 2014-07-15 -================== - - * dist: recompile - * example: remove `console.info()` log usage - * example: add "Content-Type" UTF-8 header to browser example - * browser: place %c marker after the space character - * browser: reset the "content" color via `color: inherit` - * browser: add colors support for Firefox >= v31 - * debug: prefer an instance `log()` function over the global one (#119) - * Readme: update documentation about styled console logs for FF v31 (#116, @wryk) - -1.0.3 / 2014-07-09 -================== - - * Add support for multiple wildcards in namespaces (#122, @seegno) - * browser: fix lint - -1.0.2 / 2014-06-10 -================== - - * browser: update color palette (#113, @gscottolson) - * common: make console logging function configurable (#108, @timoxley) - * node: fix %o colors on old node <= 0.8.x - * Makefile: find node path using shell/which (#109, @timoxley) - -1.0.1 / 2014-06-06 -================== - - * browser: use `removeItem()` to clear localStorage - * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777) - * package: add "contributors" section - * node: fix comment typo - * README: list authors - -1.0.0 / 2014-06-04 -================== - - * make ms diff be global, not be scope - * debug: ignore empty strings in enable() - * node: make DEBUG_COLORS able to disable coloring - * *: export the `colors` array - * npmignore: don't publish the `dist` dir - * Makefile: refactor to use browserify - * package: add "browserify" as a dev dependency - * Readme: add Web Inspector Colors section - * node: reset terminal color for the debug content - * node: map "%o" to `util.inspect()` - * browser: map "%j" to `JSON.stringify()` - * debug: add custom "formatters" - * debug: use "ms" module for humanizing the diff - * Readme: add "bash" syntax highlighting - * browser: add Firebug color support - * browser: add colors for WebKit browsers - * node: apply log to `console` - * rewrite: abstract common logic for Node & browsers - * add .jshintrc file - -0.8.1 / 2014-04-14 -================== - - * package: re-add the "component" section - -0.8.0 / 2014-03-30 -================== - - * add `enable()` method for nodejs. Closes #27 - * change from stderr to stdout - * remove unnecessary index.js file - -0.7.4 / 2013-11-13 -================== - - * remove "browserify" key from package.json (fixes something in browserify) - -0.7.3 / 2013-10-30 -================== - - * fix: catch localStorage security error when cookies are blocked (Chrome) - * add debug(err) support. Closes #46 - * add .browser prop to package.json. Closes #42 - -0.7.2 / 2013-02-06 -================== - - * fix package.json - * fix: Mobile Safari (private mode) is broken with debug - * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript - -0.7.1 / 2013-02-05 -================== - - * add repository URL to package.json - * add DEBUG_COLORED to force colored output - * add browserify support - * fix component. Closes #24 - -0.7.0 / 2012-05-04 -================== - - * Added .component to package.json - * Added debug.component.js build - -0.6.0 / 2012-03-16 -================== - - * Added support for "-" prefix in DEBUG [Vinay Pulim] - * Added `.enabled` flag to the node version [TooTallNate] - -0.5.0 / 2012-02-02 -================== - - * Added: humanize diffs. Closes #8 - * Added `debug.disable()` to the CS variant - * Removed padding. Closes #10 - * Fixed: persist client-side variant again. Closes #9 - -0.4.0 / 2012-02-01 -================== - - * Added browser variant support for older browsers [TooTallNate] - * Added `debug.enable('project:*')` to browser variant [TooTallNate] - * Added padding to diff (moved it to the right) - -0.3.0 / 2012-01-26 -================== - - * Added millisecond diff when isatty, otherwise UTC string - -0.2.0 / 2012-01-22 -================== - - * Added wildcard support - -0.1.0 / 2011-12-02 -================== - - * Added: remove colors unless stderr isatty [TooTallNate] - -0.0.1 / 2010-01-03 -================== - - * Initial release diff --git a/node_modules/router/node_modules/debug/Makefile b/node_modules/router/node_modules/debug/Makefile deleted file mode 100644 index 5cf4a59..0000000 --- a/node_modules/router/node_modules/debug/Makefile +++ /dev/null @@ -1,36 +0,0 @@ - -# get Makefile directory name: http://stackoverflow.com/a/5982798/376773 -THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) -THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd) - -# BIN directory -BIN := $(THIS_DIR)/node_modules/.bin - -# applications -NODE ?= $(shell which node) -NPM ?= $(NODE) $(shell which npm) -BROWSERIFY ?= $(NODE) $(BIN)/browserify - -all: dist/debug.js - -install: node_modules - -clean: - @rm -rf dist - -dist: - @mkdir -p $@ - -dist/debug.js: node_modules browser.js debug.js dist - @$(BROWSERIFY) \ - --standalone debug \ - . > $@ - -distclean: clean - @rm -rf node_modules - -node_modules: package.json - @NODE_ENV= $(NPM) install - @touch node_modules - -.PHONY: all install clean distclean diff --git a/node_modules/router/node_modules/debug/Readme.md b/node_modules/router/node_modules/debug/Readme.md deleted file mode 100644 index b4f45e3..0000000 --- a/node_modules/router/node_modules/debug/Readme.md +++ /dev/null @@ -1,188 +0,0 @@ -# debug - - tiny node.js debugging utility modelled after node core's debugging technique. - -## Installation - -```bash -$ npm install debug -``` - -## Usage - - With `debug` you simply invoke the exported function to generate your debug function, passing it a name which will determine if a noop function is returned, or a decorated `console.error`, so all of the `console` format string goodies you're used to work fine. A unique color is selected per-function for visibility. - -Example _app.js_: - -```js -var debug = require('debug')('http') - , http = require('http') - , name = 'My App'; - -// fake app - -debug('booting %s', name); - -http.createServer(function(req, res){ - debug(req.method + ' ' + req.url); - res.end('hello\n'); -}).listen(3000, function(){ - debug('listening'); -}); - -// fake worker of some kind - -require('./worker'); -``` - -Example _worker.js_: - -```js -var debug = require('debug')('worker'); - -setInterval(function(){ - debug('doing some work'); -}, 1000); -``` - - The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples: - - ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png) - - ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png) - -#### Windows note - - On Windows the environment variable is set using the `set` command. - - ```cmd - set DEBUG=*,-not_this - ``` - -Then, run the program to be debugged as usual. - -## Millisecond diff - - When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. - - ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png) - - When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below: - - ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png) - -## Conventions - - If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". - -## Wildcards - - The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. - - You can also exclude specific debuggers by prefixing them with a "-" character. For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:". - -## Browser support - - Debug works in the browser as well, currently persisted by `localStorage`. Consider the situation shown below where you have `worker:a` and `worker:b`, and wish to debug both. Somewhere in the code on your page, include: - -```js -window.myDebug = require("debug"); -``` - - ("debug" is a global object in the browser so we give this object a different name.) When your page is open in the browser, type the following in the console: - -```js -myDebug.enable("worker:*") -``` - - Refresh the page. Debug output will continue to be sent to the console until it is disabled by typing `myDebug.disable()` in the console. - -```js -a = debug('worker:a'); -b = debug('worker:b'); - -setInterval(function(){ - a('doing some work'); -}, 1000); - -setInterval(function(){ - b('doing some work'); -}, 1200); -``` - -#### Web Inspector Colors - - Colors are also enabled on "Web Inspectors" that understand the `%c` formatting - option. These are WebKit web inspectors, Firefox ([since version - 31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) - and the Firebug plugin for Firefox (any version). - - Colored output looks something like: - - ![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png) - -### stderr vs stdout - -You can set an alternative logging method per-namespace by overriding the `log` method on a per-namespace or globally: - -Example _stdout.js_: - -```js -var debug = require('debug'); -var error = debug('app:error'); - -// by default stderr is used -error('goes to stderr!'); - -var log = debug('app:log'); -// set this namespace to log via console.log -log.log = console.log.bind(console); // don't forget to bind to console! -log('goes to stdout'); -error('still goes to stderr!'); - -// set all output to go via console.info -// overrides all per-namespace log settings -debug.log = console.info.bind(console); -error('now goes to stdout via console.info'); -log('still goes to stdout, but via console.info now'); -``` - -### Save debug output to a file - -You can save all debug statements to a file by piping them. - -Example: - -```bash -$ DEBUG_FD=3 node your-app.js 3> whatever.log -``` - -## Authors - - - TJ Holowaychuk - - Nathan Rajlich - -## License - -(The MIT License) - -Copyright (c) 2014 TJ Holowaychuk <tj@vision-media.ca> - -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/router/node_modules/debug/bower.json b/node_modules/router/node_modules/debug/bower.json deleted file mode 100644 index 6af573f..0000000 --- a/node_modules/router/node_modules/debug/bower.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "visionmedia-debug", - "main": "dist/debug.js", - "version": "2.2.0", - "homepage": "https://github.com/visionmedia/debug", - "authors": [ - "TJ Holowaychuk " - ], - "description": "visionmedia-debug", - "moduleType": [ - "amd", - "es6", - "globals", - "node" - ], - "keywords": [ - "visionmedia", - "debug" - ], - "license": "MIT", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ] -} diff --git a/node_modules/router/node_modules/debug/browser.js b/node_modules/router/node_modules/debug/browser.js deleted file mode 100644 index 7c76452..0000000 --- a/node_modules/router/node_modules/debug/browser.js +++ /dev/null @@ -1,168 +0,0 @@ - -/** - * This is the web browser implementation of `debug()`. - * - * Expose `debug()` as the module. - */ - -exports = module.exports = require('./debug'); -exports.log = log; -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; -exports.storage = 'undefined' != typeof chrome - && 'undefined' != typeof chrome.storage - ? chrome.storage.local - : localstorage(); - -/** - * Colors. - */ - -exports.colors = [ - 'lightseagreen', - 'forestgreen', - 'goldenrod', - 'dodgerblue', - 'darkorchid', - 'crimson' -]; - -/** - * Currently only WebKit-based Web Inspectors, Firefox >= v31, - * and the Firebug extension (any Firefox version) are known - * to support "%c" CSS customizations. - * - * TODO: add a `localStorage` variable to explicitly enable/disable colors - */ - -function useColors() { - // is webkit? http://stackoverflow.com/a/16459606/376773 - return ('WebkitAppearance' in document.documentElement.style) || - // is firebug? http://stackoverflow.com/a/398120/376773 - (window.console && (console.firebug || (console.exception && console.table))) || - // is firefox >= v31? - // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages - (navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31); -} - -/** - * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. - */ - -exports.formatters.j = function(v) { - return JSON.stringify(v); -}; - - -/** - * Colorize log arguments if enabled. - * - * @api public - */ - -function formatArgs() { - var args = arguments; - var useColors = this.useColors; - - args[0] = (useColors ? '%c' : '') - + this.namespace - + (useColors ? ' %c' : ' ') - + args[0] - + (useColors ? '%c ' : ' ') - + '+' + exports.humanize(this.diff); - - if (!useColors) return args; - - var c = 'color: ' + this.color; - args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1)); - - // the final "%c" is somewhat tricky, because there could be other - // arguments passed either before or after the %c, so we need to - // figure out the correct index to insert the CSS into - var index = 0; - var lastC = 0; - args[0].replace(/%[a-z%]/g, function(match) { - if ('%%' === match) return; - index++; - if ('%c' === match) { - // we only are interested in the *last* %c - // (the user may have provided their own) - lastC = index; - } - }); - - args.splice(lastC, 0, c); - return args; -} - -/** - * Invokes `console.log()` when available. - * No-op when `console.log` is not a "function". - * - * @api public - */ - -function log() { - // this hackery is required for IE8/9, where - // the `console.log` function doesn't have 'apply' - return 'object' === typeof console - && console.log - && Function.prototype.apply.call(console.log, console, arguments); -} - -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ - -function save(namespaces) { - try { - if (null == namespaces) { - exports.storage.removeItem('debug'); - } else { - exports.storage.debug = namespaces; - } - } catch(e) {} -} - -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ - -function load() { - var r; - try { - r = exports.storage.debug; - } catch(e) {} - return r; -} - -/** - * Enable namespaces listed in `localStorage.debug` initially. - */ - -exports.enable(load()); - -/** - * Localstorage attempts to return the localstorage. - * - * This is necessary because safari throws - * when a user disables cookies/localstorage - * and you attempt to access it. - * - * @return {LocalStorage} - * @api private - */ - -function localstorage(){ - try { - return window.localStorage; - } catch (e) {} -} diff --git a/node_modules/router/node_modules/debug/component.json b/node_modules/router/node_modules/debug/component.json deleted file mode 100644 index ca10637..0000000 --- a/node_modules/router/node_modules/debug/component.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "debug", - "repo": "visionmedia/debug", - "description": "small debugging utility", - "version": "2.2.0", - "keywords": [ - "debug", - "log", - "debugger" - ], - "main": "browser.js", - "scripts": [ - "browser.js", - "debug.js" - ], - "dependencies": { - "rauchg/ms.js": "0.7.1" - } -} diff --git a/node_modules/router/node_modules/debug/debug.js b/node_modules/router/node_modules/debug/debug.js deleted file mode 100644 index 7571a86..0000000 --- a/node_modules/router/node_modules/debug/debug.js +++ /dev/null @@ -1,197 +0,0 @@ - -/** - * This is the common logic for both the Node.js and web browser - * implementations of `debug()`. - * - * Expose `debug()` as the module. - */ - -exports = module.exports = debug; -exports.coerce = coerce; -exports.disable = disable; -exports.enable = enable; -exports.enabled = enabled; -exports.humanize = require('ms'); - -/** - * The currently active debug mode names, and names to skip. - */ - -exports.names = []; -exports.skips = []; - -/** - * Map of special "%n" handling functions, for the debug "format" argument. - * - * Valid key names are a single, lowercased letter, i.e. "n". - */ - -exports.formatters = {}; - -/** - * Previously assigned color. - */ - -var prevColor = 0; - -/** - * Previous log timestamp. - */ - -var prevTime; - -/** - * Select a color. - * - * @return {Number} - * @api private - */ - -function selectColor() { - return exports.colors[prevColor++ % exports.colors.length]; -} - -/** - * Create a debugger with the given `namespace`. - * - * @param {String} namespace - * @return {Function} - * @api public - */ - -function debug(namespace) { - - // define the `disabled` version - function disabled() { - } - disabled.enabled = false; - - // define the `enabled` version - function enabled() { - - var self = enabled; - - // set `diff` timestamp - var curr = +new Date(); - var ms = curr - (prevTime || curr); - self.diff = ms; - self.prev = prevTime; - self.curr = curr; - prevTime = curr; - - // add the `color` if not set - if (null == self.useColors) self.useColors = exports.useColors(); - if (null == self.color && self.useColors) self.color = selectColor(); - - var args = Array.prototype.slice.call(arguments); - - args[0] = exports.coerce(args[0]); - - if ('string' !== typeof args[0]) { - // anything else let's inspect with %o - args = ['%o'].concat(args); - } - - // apply any `formatters` transformations - var index = 0; - args[0] = args[0].replace(/%([a-z%])/g, function(match, format) { - // if we encounter an escaped % then don't increase the array index - if (match === '%%') return match; - index++; - var formatter = exports.formatters[format]; - if ('function' === typeof formatter) { - var val = args[index]; - match = formatter.call(self, val); - - // now we need to remove `args[index]` since it's inlined in the `format` - args.splice(index, 1); - index--; - } - return match; - }); - - if ('function' === typeof exports.formatArgs) { - args = exports.formatArgs.apply(self, args); - } - var logFn = enabled.log || exports.log || console.log.bind(console); - logFn.apply(self, args); - } - enabled.enabled = true; - - var fn = exports.enabled(namespace) ? enabled : disabled; - - fn.namespace = namespace; - - return fn; -} - -/** - * Enables a debug mode by namespaces. This can include modes - * separated by a colon and wildcards. - * - * @param {String} namespaces - * @api public - */ - -function enable(namespaces) { - exports.save(namespaces); - - var split = (namespaces || '').split(/[\s,]+/); - var len = split.length; - - for (var i = 0; i < len; i++) { - if (!split[i]) continue; // ignore empty strings - namespaces = split[i].replace(/\*/g, '.*?'); - if (namespaces[0] === '-') { - exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); - } else { - exports.names.push(new RegExp('^' + namespaces + '$')); - } - } -} - -/** - * Disable debug output. - * - * @api public - */ - -function disable() { - exports.enable(''); -} - -/** - * Returns true if the given mode name is enabled, false otherwise. - * - * @param {String} name - * @return {Boolean} - * @api public - */ - -function enabled(name) { - var i, len; - for (i = 0, len = exports.skips.length; i < len; i++) { - if (exports.skips[i].test(name)) { - return false; - } - } - for (i = 0, len = exports.names.length; i < len; i++) { - if (exports.names[i].test(name)) { - return true; - } - } - return false; -} - -/** - * Coerce `val`. - * - * @param {Mixed} val - * @return {Mixed} - * @api private - */ - -function coerce(val) { - if (val instanceof Error) return val.stack || val.message; - return val; -} diff --git a/node_modules/router/node_modules/debug/node.js b/node_modules/router/node_modules/debug/node.js deleted file mode 100644 index 1d392a8..0000000 --- a/node_modules/router/node_modules/debug/node.js +++ /dev/null @@ -1,209 +0,0 @@ - -/** - * Module dependencies. - */ - -var tty = require('tty'); -var util = require('util'); - -/** - * This is the Node.js implementation of `debug()`. - * - * Expose `debug()` as the module. - */ - -exports = module.exports = require('./debug'); -exports.log = log; -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; - -/** - * Colors. - */ - -exports.colors = [6, 2, 3, 4, 5, 1]; - -/** - * The file descriptor to write the `debug()` calls to. - * Set the `DEBUG_FD` env variable to override with another value. i.e.: - * - * $ DEBUG_FD=3 node script.js 3>debug.log - */ - -var fd = parseInt(process.env.DEBUG_FD, 10) || 2; -var stream = 1 === fd ? process.stdout : - 2 === fd ? process.stderr : - createWritableStdioStream(fd); - -/** - * Is stdout a TTY? Colored output is enabled when `true`. - */ - -function useColors() { - var debugColors = (process.env.DEBUG_COLORS || '').trim().toLowerCase(); - if (0 === debugColors.length) { - return tty.isatty(fd); - } else { - return '0' !== debugColors - && 'no' !== debugColors - && 'false' !== debugColors - && 'disabled' !== debugColors; - } -} - -/** - * Map %o to `util.inspect()`, since Node doesn't do that out of the box. - */ - -var inspect = (4 === util.inspect.length ? - // node <= 0.8.x - function (v, colors) { - return util.inspect(v, void 0, void 0, colors); - } : - // node > 0.8.x - function (v, colors) { - return util.inspect(v, { colors: colors }); - } -); - -exports.formatters.o = function(v) { - return inspect(v, this.useColors) - .replace(/\s*\n\s*/g, ' '); -}; - -/** - * Adds ANSI color escape codes if enabled. - * - * @api public - */ - -function formatArgs() { - var args = arguments; - var useColors = this.useColors; - var name = this.namespace; - - if (useColors) { - var c = this.color; - - args[0] = ' \u001b[3' + c + ';1m' + name + ' ' - + '\u001b[0m' - + args[0] + '\u001b[3' + c + 'm' - + ' +' + exports.humanize(this.diff) + '\u001b[0m'; - } else { - args[0] = new Date().toUTCString() - + ' ' + name + ' ' + args[0]; - } - return args; -} - -/** - * Invokes `console.error()` with the specified arguments. - */ - -function log() { - return stream.write(util.format.apply(this, arguments) + '\n'); -} - -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ - -function save(namespaces) { - if (null == namespaces) { - // If you set a process.env field to null or undefined, it gets cast to the - // string 'null' or 'undefined'. Just delete instead. - delete process.env.DEBUG; - } else { - process.env.DEBUG = namespaces; - } -} - -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ - -function load() { - return process.env.DEBUG; -} - -/** - * Copied from `node/src/node.js`. - * - * XXX: It's lame that node doesn't expose this API out-of-the-box. It also - * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame. - */ - -function createWritableStdioStream (fd) { - var stream; - var tty_wrap = process.binding('tty_wrap'); - - // Note stream._type is used for test-module-load-list.js - - switch (tty_wrap.guessHandleType(fd)) { - case 'TTY': - stream = new tty.WriteStream(fd); - stream._type = 'tty'; - - // Hack to have stream not keep the event loop alive. - // See https://github.com/joyent/node/issues/1726 - if (stream._handle && stream._handle.unref) { - stream._handle.unref(); - } - break; - - case 'FILE': - var fs = require('fs'); - stream = new fs.SyncWriteStream(fd, { autoClose: false }); - stream._type = 'fs'; - break; - - case 'PIPE': - case 'TCP': - var net = require('net'); - stream = new net.Socket({ - fd: fd, - readable: false, - writable: true - }); - - // FIXME Should probably have an option in net.Socket to create a - // stream from an existing fd which is writable only. But for now - // we'll just add this hack and set the `readable` member to false. - // Test: ./node test/fixtures/echo.js < /etc/passwd - stream.readable = false; - stream.read = null; - stream._type = 'pipe'; - - // FIXME Hack to have stream not keep the event loop alive. - // See https://github.com/joyent/node/issues/1726 - if (stream._handle && stream._handle.unref) { - stream._handle.unref(); - } - break; - - default: - // Probably an error on in uv_guess_handle() - throw new Error('Implement me. Unknown stream file type!'); - } - - // For supporting legacy API we put the FD here. - stream.fd = fd; - - stream._isStdio = true; - - return stream; -} - -/** - * Enable namespaces listed in `process.env.DEBUG` initially. - */ - -exports.enable(load()); diff --git a/node_modules/router/node_modules/debug/package.json b/node_modules/router/node_modules/debug/package.json deleted file mode 100644 index b9f033a..0000000 --- a/node_modules/router/node_modules/debug/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "debug", - "version": "2.2.0", - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/debug.git" - }, - "description": "small debugging utility", - "keywords": [ - "debug", - "log", - "debugger" - ], - "author": "TJ Holowaychuk ", - "contributors": [ - "Nathan Rajlich (http://n8.io)" - ], - "license": "MIT", - "dependencies": { - "ms": "0.7.1" - }, - "devDependencies": { - "browserify": "9.0.3", - "mocha": "*" - }, - "main": "./node.js", - "browser": "./browser.js", - "component": { - "scripts": { - "debug/index.js": "browser.js", - "debug/debug.js": "debug.js" - } - } -} diff --git a/node_modules/router/node_modules/ms/.npmignore b/node_modules/router/node_modules/ms/.npmignore deleted file mode 100644 index d1aa0ce..0000000 --- a/node_modules/router/node_modules/ms/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -node_modules -test -History.md -Makefile -component.json diff --git a/node_modules/router/node_modules/ms/History.md b/node_modules/router/node_modules/ms/History.md deleted file mode 100644 index 32fdfc1..0000000 --- a/node_modules/router/node_modules/ms/History.md +++ /dev/null @@ -1,66 +0,0 @@ - -0.7.1 / 2015-04-20 -================== - - * prevent extraordinary long inputs (@evilpacket) - * Fixed broken readme link - -0.7.0 / 2014-11-24 -================== - - * add time abbreviations, updated tests and readme for the new units - * fix example in the readme. - * add LICENSE file - -0.6.2 / 2013-12-05 -================== - - * Adding repository section to package.json to suppress warning from NPM. - -0.6.1 / 2013-05-10 -================== - - * fix singularization [visionmedia] - -0.6.0 / 2013-03-15 -================== - - * fix minutes - -0.5.1 / 2013-02-24 -================== - - * add component namespace - -0.5.0 / 2012-11-09 -================== - - * add short formatting as default and .long option - * add .license property to component.json - * add version to component.json - -0.4.0 / 2012-10-22 -================== - - * add rounding to fix crazy decimals - -0.3.0 / 2012-09-07 -================== - - * fix `ms()` [visionmedia] - -0.2.0 / 2012-09-03 -================== - - * add component.json [visionmedia] - * add days support [visionmedia] - * add hours support [visionmedia] - * add minutes support [visionmedia] - * add seconds support [visionmedia] - * add ms string support [visionmedia] - * refactor tests to facilitate ms(number) [visionmedia] - -0.1.0 / 2012-03-07 -================== - - * Initial release diff --git a/node_modules/router/node_modules/ms/LICENSE b/node_modules/router/node_modules/ms/LICENSE deleted file mode 100644 index 6c07561..0000000 --- a/node_modules/router/node_modules/ms/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -(The MIT License) - -Copyright (c) 2014 Guillermo Rauch - -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/router/node_modules/ms/README.md b/node_modules/router/node_modules/ms/README.md deleted file mode 100644 index 9b4fd03..0000000 --- a/node_modules/router/node_modules/ms/README.md +++ /dev/null @@ -1,35 +0,0 @@ -# ms.js: miliseconds conversion utility - -```js -ms('2 days') // 172800000 -ms('1d') // 86400000 -ms('10h') // 36000000 -ms('2.5 hrs') // 9000000 -ms('2h') // 7200000 -ms('1m') // 60000 -ms('5s') // 5000 -ms('100') // 100 -``` - -```js -ms(60000) // "1m" -ms(2 * 60000) // "2m" -ms(ms('10 hours')) // "10h" -``` - -```js -ms(60000, { long: true }) // "1 minute" -ms(2 * 60000, { long: true }) // "2 minutes" -ms(ms('10 hours'), { long: true }) // "10 hours" -``` - -- Node/Browser compatible. Published as [`ms`](https://www.npmjs.org/package/ms) in [NPM](http://nodejs.org/download). -- If a number is supplied to `ms`, a string with a unit is returned. -- If a string that contains the number is supplied, it returns it as -a number (e.g: it returns `100` for `'100'`). -- If you pass a string with a number and a valid unit, the number of -equivalent ms is returned. - -## License - -MIT diff --git a/node_modules/router/node_modules/ms/index.js b/node_modules/router/node_modules/ms/index.js deleted file mode 100644 index 4f92771..0000000 --- a/node_modules/router/node_modules/ms/index.js +++ /dev/null @@ -1,125 +0,0 @@ -/** - * Helpers. - */ - -var s = 1000; -var m = s * 60; -var h = m * 60; -var d = h * 24; -var y = d * 365.25; - -/** - * Parse or format the given `val`. - * - * Options: - * - * - `long` verbose formatting [false] - * - * @param {String|Number} val - * @param {Object} options - * @return {String|Number} - * @api public - */ - -module.exports = function(val, options){ - options = options || {}; - if ('string' == typeof val) return parse(val); - return options.long - ? long(val) - : short(val); -}; - -/** - * Parse the given `str` and return milliseconds. - * - * @param {String} str - * @return {Number} - * @api private - */ - -function parse(str) { - str = '' + str; - if (str.length > 10000) return; - var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str); - if (!match) return; - var n = parseFloat(match[1]); - var type = (match[2] || 'ms').toLowerCase(); - switch (type) { - case 'years': - case 'year': - case 'yrs': - case 'yr': - case 'y': - return n * y; - case 'days': - case 'day': - case 'd': - return n * d; - case 'hours': - case 'hour': - case 'hrs': - case 'hr': - case 'h': - return n * h; - case 'minutes': - case 'minute': - case 'mins': - case 'min': - case 'm': - return n * m; - case 'seconds': - case 'second': - case 'secs': - case 'sec': - case 's': - return n * s; - case 'milliseconds': - case 'millisecond': - case 'msecs': - case 'msec': - case 'ms': - return n; - } -} - -/** - * Short format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function short(ms) { - if (ms >= d) return Math.round(ms / d) + 'd'; - if (ms >= h) return Math.round(ms / h) + 'h'; - if (ms >= m) return Math.round(ms / m) + 'm'; - if (ms >= s) return Math.round(ms / s) + 's'; - return ms + 'ms'; -} - -/** - * Long format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function long(ms) { - return plural(ms, d, 'day') - || plural(ms, h, 'hour') - || plural(ms, m, 'minute') - || plural(ms, s, 'second') - || ms + ' ms'; -} - -/** - * Pluralization helper. - */ - -function plural(ms, n, name) { - if (ms < n) return; - if (ms < n * 1.5) return Math.floor(ms / n) + ' ' + name; - return Math.ceil(ms / n) + ' ' + name + 's'; -} diff --git a/node_modules/router/node_modules/ms/package.json b/node_modules/router/node_modules/ms/package.json deleted file mode 100644 index a4e5bb6..0000000 --- a/node_modules/router/node_modules/ms/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "ms", - "version": "0.7.1", - "description": "Tiny ms conversion utility", - "repository": { - "type": "git", - "url": "git://github.com/guille/ms.js.git" - }, - "main": "./index", - "devDependencies": { - "mocha": "*", - "expect.js": "*", - "serve": "*" - }, - "component": { - "scripts": { - "ms/index.js": "index.js" - } - } -} diff --git a/node_modules/router/node_modules/path-to-regexp/History.md b/node_modules/router/node_modules/path-to-regexp/History.md deleted file mode 100644 index 7f65878..0000000 --- a/node_modules/router/node_modules/path-to-regexp/History.md +++ /dev/null @@ -1,36 +0,0 @@ -0.1.7 / 2015-07-28 -================== - - * Fixed regression with escaped round brackets and matching groups. - -0.1.6 / 2015-06-19 -================== - - * Replace `index` feature by outputting all parameters, unnamed and named. - -0.1.5 / 2015-05-08 -================== - - * Add an index property for position in match result. - -0.1.4 / 2015-03-05 -================== - - * Add license information - -0.1.3 / 2014-07-06 -================== - - * Better array support - * Improved support for trailing slash in non-ending mode - -0.1.0 / 2014-03-06 -================== - - * add options.end - -0.0.2 / 2013-02-10 -================== - - * Update to match current express - * add .license property to component.json diff --git a/node_modules/router/node_modules/path-to-regexp/LICENSE b/node_modules/router/node_modules/path-to-regexp/LICENSE deleted file mode 100644 index 983fbe8..0000000 --- a/node_modules/router/node_modules/path-to-regexp/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/router/node_modules/path-to-regexp/Readme.md b/node_modules/router/node_modules/path-to-regexp/Readme.md deleted file mode 100644 index 95452a6..0000000 --- a/node_modules/router/node_modules/path-to-regexp/Readme.md +++ /dev/null @@ -1,35 +0,0 @@ -# Path-to-RegExp - -Turn an Express-style path string such as `/user/:name` into a regular expression. - -**Note:** This is a legacy branch. You should upgrade to `1.x`. - -## Usage - -```javascript -var pathToRegexp = require('path-to-regexp'); -``` - -### pathToRegexp(path, keys, options) - - - **path** A string in the express format, an array of such strings, or a regular expression - - **keys** An array to be populated with the keys present in the url. Once the function completes, this will be an array of strings. - - **options** - - **options.sensitive** Defaults to false, set this to true to make routes case sensitive - - **options.strict** Defaults to false, set this to true to make the trailing slash matter. - - **options.end** Defaults to true, set this to false to only match the prefix of the URL. - -```javascript -var keys = []; -var exp = pathToRegexp('/foo/:bar', keys); -//keys = ['bar'] -//exp = /^\/foo\/(?:([^\/]+?))\/?$/i -``` - -## Live Demo - -You can see a live demo of this library in use at [express-route-tester](http://forbeslindesay.github.com/express-route-tester/). - -## License - - MIT diff --git a/node_modules/router/node_modules/path-to-regexp/index.js b/node_modules/router/node_modules/path-to-regexp/index.js deleted file mode 100644 index 500d1da..0000000 --- a/node_modules/router/node_modules/path-to-regexp/index.js +++ /dev/null @@ -1,129 +0,0 @@ -/** - * Expose `pathtoRegexp`. - */ - -module.exports = pathtoRegexp; - -/** - * Match matching groups in a regular expression. - */ -var MATCHING_GROUP_REGEXP = /\((?!\?)/g; - -/** - * Normalize the given path string, - * returning a regular expression. - * - * An empty array should be passed, - * which will contain the placeholder - * key names. For example "/user/:id" will - * then contain ["id"]. - * - * @param {String|RegExp|Array} path - * @param {Array} keys - * @param {Object} options - * @return {RegExp} - * @api private - */ - -function pathtoRegexp(path, keys, options) { - options = options || {}; - keys = keys || []; - var strict = options.strict; - var end = options.end !== false; - var flags = options.sensitive ? '' : 'i'; - var extraOffset = 0; - var keysOffset = keys.length; - var i = 0; - var name = 0; - var m; - - if (path instanceof RegExp) { - while (m = MATCHING_GROUP_REGEXP.exec(path.source)) { - keys.push({ - name: name++, - optional: false, - offset: m.index - }); - } - - return path; - } - - if (Array.isArray(path)) { - // Map array parts into regexps and return their source. We also pass - // the same keys and options instance into every generation to get - // consistent matching groups before we join the sources together. - path = path.map(function (value) { - return pathtoRegexp(value, keys, options).source; - }); - - return new RegExp('(?:' + path.join('|') + ')', flags); - } - - path = ('^' + path + (strict ? '' : path[path.length - 1] === '/' ? '?' : '/?')) - .replace(/\/\(/g, '/(?:') - .replace(/([\/\.])/g, '\\$1') - .replace(/(\\\/)?(\\\.)?:(\w+)(\(.*?\))?(\*)?(\?)?/g, function (match, slash, format, key, capture, star, optional, offset) { - slash = slash || ''; - format = format || ''; - capture = capture || '([^\\/' + format + ']+?)'; - optional = optional || ''; - - keys.push({ - name: key, - optional: !!optional, - offset: offset + extraOffset - }); - - var result = '' - + (optional ? '' : slash) - + '(?:' - + format + (optional ? slash : '') + capture - + (star ? '((?:[\\/' + format + '].+?)?)' : '') - + ')' - + optional; - - extraOffset += result.length - match.length; - - return result; - }) - .replace(/\*/g, function (star, index) { - var len = keys.length - - while (len-- > keysOffset && keys[len].offset > index) { - keys[len].offset += 3; // Replacement length minus asterisk length. - } - - return '(.*)'; - }); - - // This is a workaround for handling unnamed matching groups. - while (m = MATCHING_GROUP_REGEXP.exec(path)) { - var escapeCount = 0; - var index = m.index; - - while (path.charAt(--index) === '\\') { - escapeCount++; - } - - // It's possible to escape the bracket. - if (escapeCount % 2 === 1) { - continue; - } - - if (keysOffset + i === keys.length || keys[keysOffset + i].offset > m.index) { - keys.splice(keysOffset + i, 0, { - name: name++, // Unnamed matching groups must be consistently linear. - optional: false, - offset: m.index - }); - } - - i++; - } - - // If the path is non-ending, match until the end or a slash. - path += (end ? '$' : (path[path.length - 1] === '/' ? '' : '(?=\\/|$)')); - - return new RegExp(path, flags); -}; diff --git a/node_modules/router/node_modules/path-to-regexp/package.json b/node_modules/router/node_modules/path-to-regexp/package.json deleted file mode 100644 index d4e51b5..0000000 --- a/node_modules/router/node_modules/path-to-regexp/package.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "path-to-regexp", - "description": "Express style path to RegExp utility", - "version": "0.1.7", - "files": [ - "index.js", - "LICENSE" - ], - "scripts": { - "test": "istanbul cover _mocha -- -R spec" - }, - "keywords": [ - "express", - "regexp" - ], - "component": { - "scripts": { - "path-to-regexp": "index.js" - } - }, - "license": "MIT", - "repository": { - "type": "git", - "url": "https://github.com/component/path-to-regexp.git" - }, - "devDependencies": { - "mocha": "^1.17.1", - "istanbul": "^0.2.6" - } -} diff --git a/node_modules/router/node_modules/setprototypeof/LICENSE b/node_modules/router/node_modules/setprototypeof/LICENSE deleted file mode 100644 index 61afa2f..0000000 --- a/node_modules/router/node_modules/setprototypeof/LICENSE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright (c) 2015, Wes Todd - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION -OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/router/node_modules/setprototypeof/README.md b/node_modules/router/node_modules/setprototypeof/README.md deleted file mode 100644 index 01d7947..0000000 --- a/node_modules/router/node_modules/setprototypeof/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# Polyfill for `Object.setPrototypeOf` - -A simple cross platform implementation to set the prototype of an instianted object. Supports all modern browsers and at least back to IE8. - -## Usage: - -``` -$ npm install --save setprototypeof -``` - -```javascript -var setPrototypeOf = require('setprototypeof'); - -var obj = {}; -setPrototypeOf(obj, { - foo: function() { - return 'bar'; - } -}); -obj.foo(); // bar -``` diff --git a/node_modules/router/node_modules/setprototypeof/index.js b/node_modules/router/node_modules/setprototypeof/index.js deleted file mode 100644 index b762a7c..0000000 --- a/node_modules/router/node_modules/setprototypeof/index.js +++ /dev/null @@ -1,13 +0,0 @@ -module.exports = Object.setPrototypeOf || ({__proto__:[]} instanceof Array ? setProtoOf : mixinProperties); - -function setProtoOf(obj, proto) { - obj.__proto__ = proto; - return obj; -} - -function mixinProperties(obj, proto) { - for (var prop in proto) { - obj[prop] = proto[prop]; - } - return obj; -} diff --git a/node_modules/router/node_modules/setprototypeof/package.json b/node_modules/router/node_modules/setprototypeof/package.json deleted file mode 100644 index 2e04d0c..0000000 --- a/node_modules/router/node_modules/setprototypeof/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "setprototypeof", - "version": "1.0.2", - "description": "A small polyfill for Object.setprototypeof", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "https://github.com/wesleytodd/setprototypeof.git" - }, - "keywords": [ - "polyfill", - "object", - "setprototypeof" - ], - "author": "Wes Todd", - "license": "ISC", - "bugs": { - "url": "https://github.com/wesleytodd/setprototypeof/issues" - }, - "homepage": "https://github.com/wesleytodd/setprototypeof" -} diff --git a/node_modules/router/package.json b/node_modules/router/package.json deleted file mode 100644 index 6fd23db..0000000 --- a/node_modules/router/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "router", - "description": "Simple middleware-style router", - "version": "1.1.5", - "author": "Douglas Christopher Wilson ", - "license": "MIT", - "repository": "pillarjs/router", - "dependencies": { - "array-flatten": "2.1.1", - "debug": "~2.2.0", - "methods": "~1.1.2", - "parseurl": "~1.3.1", - "path-to-regexp": "0.1.7", - "setprototypeof": "1.0.2", - "utils-merge": "1.0.0" - }, - "devDependencies": { - "after": "0.8.2", - "finalhandler": "0.5.1", - "istanbul": "0.4.5", - "mocha": "2.5.3", - "supertest": "1.1.0" - }, - "files": [ - "lib/", - "LICENSE", - "HISTORY.md", - "README.md", - "index.js" - ], - "engines": { - "node": ">= 0.8" - }, - "scripts": { - "test": "mocha --reporter spec --bail --check-leaks test/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" - } -} diff --git a/node_modules/send/node_modules/http-errors/LICENSE b/node_modules/safe-buffer/LICENSE similarity index 95% rename from node_modules/send/node_modules/http-errors/LICENSE rename to node_modules/safe-buffer/LICENSE index a7ae8ee..0c068ce 100644 --- a/node_modules/send/node_modules/http-errors/LICENSE +++ b/node_modules/safe-buffer/LICENSE @@ -1,7 +1,6 @@ - The MIT License (MIT) -Copyright (c) 2014 Jonathan Ong me@jongleberry.com +Copyright (c) Feross Aboukhadijeh Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/node_modules/safe-buffer/README.md b/node_modules/safe-buffer/README.md new file mode 100644 index 0000000..e9a81af --- /dev/null +++ b/node_modules/safe-buffer/README.md @@ -0,0 +1,584 @@ +# safe-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] + +[travis-image]: https://img.shields.io/travis/feross/safe-buffer/master.svg +[travis-url]: https://travis-ci.org/feross/safe-buffer +[npm-image]: https://img.shields.io/npm/v/safe-buffer.svg +[npm-url]: https://npmjs.org/package/safe-buffer +[downloads-image]: https://img.shields.io/npm/dm/safe-buffer.svg +[downloads-url]: https://npmjs.org/package/safe-buffer +[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg +[standard-url]: https://standardjs.com + +#### Safer Node.js Buffer API + +**Use the new Node.js Buffer APIs (`Buffer.from`, `Buffer.alloc`, +`Buffer.allocUnsafe`, `Buffer.allocUnsafeSlow`) in all versions of Node.js.** + +**Uses the built-in implementation when available.** + +## install + +``` +npm install safe-buffer +``` + +## usage + +The goal of this package is to provide a safe replacement for the node.js `Buffer`. + +It's a drop-in replacement for `Buffer`. You can use it by adding one `require` line to +the top of your node.js modules: + +```js +var Buffer = require('safe-buffer').Buffer + +// Existing buffer code will continue to work without issues: + +new Buffer('hey', 'utf8') +new Buffer([1, 2, 3], 'utf8') +new Buffer(obj) +new Buffer(16) // create an uninitialized buffer (potentially unsafe) + +// But you can use these new explicit APIs to make clear what you want: + +Buffer.from('hey', 'utf8') // convert from many types to a Buffer +Buffer.alloc(16) // create a zero-filled buffer (safe) +Buffer.allocUnsafe(16) // create an uninitialized buffer (potentially unsafe) +``` + +## api + +### Class Method: Buffer.from(array) + + +* `array` {Array} + +Allocates a new `Buffer` using an `array` of octets. + +```js +const buf = Buffer.from([0x62,0x75,0x66,0x66,0x65,0x72]); + // creates a new Buffer containing ASCII bytes + // ['b','u','f','f','e','r'] +``` + +A `TypeError` will be thrown if `array` is not an `Array`. + +### Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]]) + + +* `arrayBuffer` {ArrayBuffer} The `.buffer` property of a `TypedArray` or + a `new ArrayBuffer()` +* `byteOffset` {Number} Default: `0` +* `length` {Number} Default: `arrayBuffer.length - byteOffset` + +When passed a reference to the `.buffer` property of a `TypedArray` instance, +the newly created `Buffer` will share the same allocated memory as the +TypedArray. + +```js +const arr = new Uint16Array(2); +arr[0] = 5000; +arr[1] = 4000; + +const buf = Buffer.from(arr.buffer); // shares the memory with arr; + +console.log(buf); + // Prints: + +// changing the TypedArray changes the Buffer also +arr[1] = 6000; + +console.log(buf); + // Prints: +``` + +The optional `byteOffset` and `length` arguments specify a memory range within +the `arrayBuffer` that will be shared by the `Buffer`. + +```js +const ab = new ArrayBuffer(10); +const buf = Buffer.from(ab, 0, 2); +console.log(buf.length); + // Prints: 2 +``` + +A `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer`. + +### Class Method: Buffer.from(buffer) + + +* `buffer` {Buffer} + +Copies the passed `buffer` data onto a new `Buffer` instance. + +```js +const buf1 = Buffer.from('buffer'); +const buf2 = Buffer.from(buf1); + +buf1[0] = 0x61; +console.log(buf1.toString()); + // 'auffer' +console.log(buf2.toString()); + // 'buffer' (copy is not changed) +``` + +A `TypeError` will be thrown if `buffer` is not a `Buffer`. + +### Class Method: Buffer.from(str[, encoding]) + + +* `str` {String} String to encode. +* `encoding` {String} Encoding to use, Default: `'utf8'` + +Creates a new `Buffer` containing the given JavaScript string `str`. If +provided, the `encoding` parameter identifies the character encoding. +If not provided, `encoding` defaults to `'utf8'`. + +```js +const buf1 = Buffer.from('this is a tést'); +console.log(buf1.toString()); + // prints: this is a tést +console.log(buf1.toString('ascii')); + // prints: this is a tC)st + +const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex'); +console.log(buf2.toString()); + // prints: this is a tést +``` + +A `TypeError` will be thrown if `str` is not a string. + +### Class Method: Buffer.alloc(size[, fill[, encoding]]) + + +* `size` {Number} +* `fill` {Value} Default: `undefined` +* `encoding` {String} Default: `utf8` + +Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the +`Buffer` will be *zero-filled*. + +```js +const buf = Buffer.alloc(5); +console.log(buf); + // +``` + +The `size` must be less than or equal to the value of +`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is +`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will +be created if a `size` less than or equal to 0 is specified. + +If `fill` is specified, the allocated `Buffer` will be initialized by calling +`buf.fill(fill)`. See [`buf.fill()`][] for more information. + +```js +const buf = Buffer.alloc(5, 'a'); +console.log(buf); + // +``` + +If both `fill` and `encoding` are specified, the allocated `Buffer` will be +initialized by calling `buf.fill(fill, encoding)`. For example: + +```js +const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64'); +console.log(buf); + // +``` + +Calling `Buffer.alloc(size)` can be significantly slower than the alternative +`Buffer.allocUnsafe(size)` but ensures that the newly created `Buffer` instance +contents will *never contain sensitive data*. + +A `TypeError` will be thrown if `size` is not a number. + +### Class Method: Buffer.allocUnsafe(size) + + +* `size` {Number} + +Allocates a new *non-zero-filled* `Buffer` of `size` bytes. The `size` must +be less than or equal to the value of `require('buffer').kMaxLength` (on 64-bit +architectures, `kMaxLength` is `(2^31)-1`). Otherwise, a [`RangeError`][] is +thrown. A zero-length Buffer will be created if a `size` less than or equal to +0 is specified. + +The underlying memory for `Buffer` instances created in this way is *not +initialized*. The contents of the newly created `Buffer` are unknown and +*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such +`Buffer` instances to zeroes. + +```js +const buf = Buffer.allocUnsafe(5); +console.log(buf); + // + // (octets will be different, every time) +buf.fill(0); +console.log(buf); + // +``` + +A `TypeError` will be thrown if `size` is not a number. + +Note that the `Buffer` module pre-allocates an internal `Buffer` instance of +size `Buffer.poolSize` that is used as a pool for the fast allocation of new +`Buffer` instances created using `Buffer.allocUnsafe(size)` (and the deprecated +`new Buffer(size)` constructor) only when `size` is less than or equal to +`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). The default +value of `Buffer.poolSize` is `8192` but can be modified. + +Use of this pre-allocated internal memory pool is a key difference between +calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. +Specifically, `Buffer.alloc(size, fill)` will *never* use the internal Buffer +pool, while `Buffer.allocUnsafe(size).fill(fill)` *will* use the internal +Buffer pool if `size` is less than or equal to half `Buffer.poolSize`. The +difference is subtle but can be important when an application requires the +additional performance that `Buffer.allocUnsafe(size)` provides. + +### Class Method: Buffer.allocUnsafeSlow(size) + + +* `size` {Number} + +Allocates a new *non-zero-filled* and non-pooled `Buffer` of `size` bytes. The +`size` must be less than or equal to the value of +`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is +`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will +be created if a `size` less than or equal to 0 is specified. + +The underlying memory for `Buffer` instances created in this way is *not +initialized*. The contents of the newly created `Buffer` are unknown and +*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such +`Buffer` instances to zeroes. + +When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances, +allocations under 4KB are, by default, sliced from a single pre-allocated +`Buffer`. This allows applications to avoid the garbage collection overhead of +creating many individually allocated Buffers. This approach improves both +performance and memory usage by eliminating the need to track and cleanup as +many `Persistent` objects. + +However, in the case where a developer may need to retain a small chunk of +memory from a pool for an indeterminate amount of time, it may be appropriate +to create an un-pooled Buffer instance using `Buffer.allocUnsafeSlow()` then +copy out the relevant bits. + +```js +// need to keep around a few small chunks of memory +const store = []; + +socket.on('readable', () => { + const data = socket.read(); + // allocate for retained data + const sb = Buffer.allocUnsafeSlow(10); + // copy the data into the new allocation + data.copy(sb, 0, 0, 10); + store.push(sb); +}); +``` + +Use of `Buffer.allocUnsafeSlow()` should be used only as a last resort *after* +a developer has observed undue memory retention in their applications. + +A `TypeError` will be thrown if `size` is not a number. + +### All the Rest + +The rest of the `Buffer` API is exactly the same as in node.js. +[See the docs](https://nodejs.org/api/buffer.html). + + +## Related links + +- [Node.js issue: Buffer(number) is unsafe](https://github.com/nodejs/node/issues/4660) +- [Node.js Enhancement Proposal: Buffer.from/Buffer.alloc/Buffer.zalloc/Buffer() soft-deprecate](https://github.com/nodejs/node-eps/pull/4) + +## Why is `Buffer` unsafe? + +Today, the node.js `Buffer` constructor is overloaded to handle many different argument +types like `String`, `Array`, `Object`, `TypedArrayView` (`Uint8Array`, etc.), +`ArrayBuffer`, and also `Number`. + +The API is optimized for convenience: you can throw any type at it, and it will try to do +what you want. + +Because the Buffer constructor is so powerful, you often see code like this: + +```js +// Convert UTF-8 strings to hex +function toHex (str) { + return new Buffer(str).toString('hex') +} +``` + +***But what happens if `toHex` is called with a `Number` argument?*** + +### Remote Memory Disclosure + +If an attacker can make your program call the `Buffer` constructor with a `Number` +argument, then they can make it allocate uninitialized memory from the node.js process. +This could potentially disclose TLS private keys, user data, or database passwords. + +When the `Buffer` constructor is passed a `Number` argument, it returns an +**UNINITIALIZED** block of memory of the specified `size`. When you create a `Buffer` like +this, you **MUST** overwrite the contents before returning it to the user. + +From the [node.js docs](https://nodejs.org/api/buffer.html#buffer_new_buffer_size): + +> `new Buffer(size)` +> +> - `size` Number +> +> The underlying memory for `Buffer` instances created in this way is not initialized. +> **The contents of a newly created `Buffer` are unknown and could contain sensitive +> data.** Use `buf.fill(0)` to initialize a Buffer to zeroes. + +(Emphasis our own.) + +Whenever the programmer intended to create an uninitialized `Buffer` you often see code +like this: + +```js +var buf = new Buffer(16) + +// Immediately overwrite the uninitialized buffer with data from another buffer +for (var i = 0; i < buf.length; i++) { + buf[i] = otherBuf[i] +} +``` + + +### Would this ever be a problem in real code? + +Yes. It's surprisingly common to forget to check the type of your variables in a +dynamically-typed language like JavaScript. + +Usually the consequences of assuming the wrong type is that your program crashes with an +uncaught exception. But the failure mode for forgetting to check the type of arguments to +the `Buffer` constructor is more catastrophic. + +Here's an example of a vulnerable service that takes a JSON payload and converts it to +hex: + +```js +// Take a JSON payload {str: "some string"} and convert it to hex +var server = http.createServer(function (req, res) { + var data = '' + req.setEncoding('utf8') + req.on('data', function (chunk) { + data += chunk + }) + req.on('end', function () { + var body = JSON.parse(data) + res.end(new Buffer(body.str).toString('hex')) + }) +}) + +server.listen(8080) +``` + +In this example, an http client just has to send: + +```json +{ + "str": 1000 +} +``` + +and it will get back 1,000 bytes of uninitialized memory from the server. + +This is a very serious bug. It's similar in severity to the +[the Heartbleed bug](http://heartbleed.com/) that allowed disclosure of OpenSSL process +memory by remote attackers. + + +### Which real-world packages were vulnerable? + +#### [`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht) + +[Mathias Buus](https://github.com/mafintosh) and I +([Feross Aboukhadijeh](http://feross.org/)) found this issue in one of our own packages, +[`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht). The bug would allow +anyone on the internet to send a series of messages to a user of `bittorrent-dht` and get +them to reveal 20 bytes at a time of uninitialized memory from the node.js process. + +Here's +[the commit](https://github.com/feross/bittorrent-dht/commit/6c7da04025d5633699800a99ec3fbadf70ad35b8) +that fixed it. We released a new fixed version, created a +[Node Security Project disclosure](https://nodesecurity.io/advisories/68), and deprecated all +vulnerable versions on npm so users will get a warning to upgrade to a newer version. + +#### [`ws`](https://www.npmjs.com/package/ws) + +That got us wondering if there were other vulnerable packages. Sure enough, within a short +period of time, we found the same issue in [`ws`](https://www.npmjs.com/package/ws), the +most popular WebSocket implementation in node.js. + +If certain APIs were called with `Number` parameters instead of `String` or `Buffer` as +expected, then uninitialized server memory would be disclosed to the remote peer. + +These were the vulnerable methods: + +```js +socket.send(number) +socket.ping(number) +socket.pong(number) +``` + +Here's a vulnerable socket server with some echo functionality: + +```js +server.on('connection', function (socket) { + socket.on('message', function (message) { + message = JSON.parse(message) + if (message.type === 'echo') { + socket.send(message.data) // send back the user's message + } + }) +}) +``` + +`socket.send(number)` called on the server, will disclose server memory. + +Here's [the release](https://github.com/websockets/ws/releases/tag/1.0.1) where the issue +was fixed, with a more detailed explanation. Props to +[Arnout Kazemier](https://github.com/3rd-Eden) for the quick fix. Here's the +[Node Security Project disclosure](https://nodesecurity.io/advisories/67). + + +### What's the solution? + +It's important that node.js offers a fast way to get memory otherwise performance-critical +applications would needlessly get a lot slower. + +But we need a better way to *signal our intent* as programmers. **When we want +uninitialized memory, we should request it explicitly.** + +Sensitive functionality should not be packed into a developer-friendly API that loosely +accepts many different types. This type of API encourages the lazy practice of passing +variables in without checking the type very carefully. + +#### A new API: `Buffer.allocUnsafe(number)` + +The functionality of creating buffers with uninitialized memory should be part of another +API. We propose `Buffer.allocUnsafe(number)`. This way, it's not part of an API that +frequently gets user input of all sorts of different types passed into it. + +```js +var buf = Buffer.allocUnsafe(16) // careful, uninitialized memory! + +// Immediately overwrite the uninitialized buffer with data from another buffer +for (var i = 0; i < buf.length; i++) { + buf[i] = otherBuf[i] +} +``` + + +### How do we fix node.js core? + +We sent [a PR to node.js core](https://github.com/nodejs/node/pull/4514) (merged as +`semver-major`) which defends against one case: + +```js +var str = 16 +new Buffer(str, 'utf8') +``` + +In this situation, it's implied that the programmer intended the first argument to be a +string, since they passed an encoding as a second argument. Today, node.js will allocate +uninitialized memory in the case of `new Buffer(number, encoding)`, which is probably not +what the programmer intended. + +But this is only a partial solution, since if the programmer does `new Buffer(variable)` +(without an `encoding` parameter) there's no way to know what they intended. If `variable` +is sometimes a number, then uninitialized memory will sometimes be returned. + +### What's the real long-term fix? + +We could deprecate and remove `new Buffer(number)` and use `Buffer.allocUnsafe(number)` when +we need uninitialized memory. But that would break 1000s of packages. + +~~We believe the best solution is to:~~ + +~~1. Change `new Buffer(number)` to return safe, zeroed-out memory~~ + +~~2. Create a new API for creating uninitialized Buffers. We propose: `Buffer.allocUnsafe(number)`~~ + +#### Update + +We now support adding three new APIs: + +- `Buffer.from(value)` - convert from any type to a buffer +- `Buffer.alloc(size)` - create a zero-filled buffer +- `Buffer.allocUnsafe(size)` - create an uninitialized buffer with given size + +This solves the core problem that affected `ws` and `bittorrent-dht` which is +`Buffer(variable)` getting tricked into taking a number argument. + +This way, existing code continues working and the impact on the npm ecosystem will be +minimal. Over time, npm maintainers can migrate performance-critical code to use +`Buffer.allocUnsafe(number)` instead of `new Buffer(number)`. + + +### Conclusion + +We think there's a serious design issue with the `Buffer` API as it exists today. It +promotes insecure software by putting high-risk functionality into a convenient API +with friendly "developer ergonomics". + +This wasn't merely a theoretical exercise because we found the issue in some of the +most popular npm packages. + +Fortunately, there's an easy fix that can be applied today. Use `safe-buffer` in place of +`buffer`. + +```js +var Buffer = require('safe-buffer').Buffer +``` + +Eventually, we hope that node.js core can switch to this new, safer behavior. We believe +the impact on the ecosystem would be minimal since it's not a breaking change. +Well-maintained, popular packages would be updated to use `Buffer.alloc` quickly, while +older, insecure packages would magically become safe from this attack vector. + + +## links + +- [Node.js PR: buffer: throw if both length and enc are passed](https://github.com/nodejs/node/pull/4514) +- [Node Security Project disclosure for `ws`](https://nodesecurity.io/advisories/67) +- [Node Security Project disclosure for`bittorrent-dht`](https://nodesecurity.io/advisories/68) + + +## credit + +The original issues in `bittorrent-dht` +([disclosure](https://nodesecurity.io/advisories/68)) and +`ws` ([disclosure](https://nodesecurity.io/advisories/67)) were discovered by +[Mathias Buus](https://github.com/mafintosh) and +[Feross Aboukhadijeh](http://feross.org/). + +Thanks to [Adam Baldwin](https://github.com/evilpacket) for helping disclose these issues +and for his work running the [Node Security Project](https://nodesecurity.io/). + +Thanks to [John Hiesey](https://github.com/jhiesey) for proofreading this README and +auditing the code. + + +## license + +MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org) diff --git a/node_modules/safe-buffer/index.d.ts b/node_modules/safe-buffer/index.d.ts new file mode 100644 index 0000000..e9fed80 --- /dev/null +++ b/node_modules/safe-buffer/index.d.ts @@ -0,0 +1,187 @@ +declare module "safe-buffer" { + export class Buffer { + length: number + write(string: string, offset?: number, length?: number, encoding?: string): number; + toString(encoding?: string, start?: number, end?: number): string; + toJSON(): { type: 'Buffer', data: any[] }; + equals(otherBuffer: Buffer): boolean; + compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number; + copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; + slice(start?: number, end?: number): Buffer; + writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readUInt8(offset: number, noAssert?: boolean): number; + readUInt16LE(offset: number, noAssert?: boolean): number; + readUInt16BE(offset: number, noAssert?: boolean): number; + readUInt32LE(offset: number, noAssert?: boolean): number; + readUInt32BE(offset: number, noAssert?: boolean): number; + readInt8(offset: number, noAssert?: boolean): number; + readInt16LE(offset: number, noAssert?: boolean): number; + readInt16BE(offset: number, noAssert?: boolean): number; + readInt32LE(offset: number, noAssert?: boolean): number; + readInt32BE(offset: number, noAssert?: boolean): number; + readFloatLE(offset: number, noAssert?: boolean): number; + readFloatBE(offset: number, noAssert?: boolean): number; + readDoubleLE(offset: number, noAssert?: boolean): number; + readDoubleBE(offset: number, noAssert?: boolean): number; + swap16(): Buffer; + swap32(): Buffer; + swap64(): Buffer; + writeUInt8(value: number, offset: number, noAssert?: boolean): number; + writeUInt16LE(value: number, offset: number, noAssert?: boolean): number; + writeUInt16BE(value: number, offset: number, noAssert?: boolean): number; + writeUInt32LE(value: number, offset: number, noAssert?: boolean): number; + writeUInt32BE(value: number, offset: number, noAssert?: boolean): number; + writeInt8(value: number, offset: number, noAssert?: boolean): number; + writeInt16LE(value: number, offset: number, noAssert?: boolean): number; + writeInt16BE(value: number, offset: number, noAssert?: boolean): number; + writeInt32LE(value: number, offset: number, noAssert?: boolean): number; + writeInt32BE(value: number, offset: number, noAssert?: boolean): number; + writeFloatLE(value: number, offset: number, noAssert?: boolean): number; + writeFloatBE(value: number, offset: number, noAssert?: boolean): number; + writeDoubleLE(value: number, offset: number, noAssert?: boolean): number; + writeDoubleBE(value: number, offset: number, noAssert?: boolean): number; + fill(value: any, offset?: number, end?: number): this; + indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; + lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; + includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean; + + /** + * Allocates a new buffer containing the given {str}. + * + * @param str String to store in buffer. + * @param encoding encoding to use, optional. Default is 'utf8' + */ + constructor (str: string, encoding?: string); + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + */ + constructor (size: number); + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + */ + constructor (array: Uint8Array); + /** + * Produces a Buffer backed by the same allocated memory as + * the given {ArrayBuffer}. + * + * + * @param arrayBuffer The ArrayBuffer with which to share memory. + */ + constructor (arrayBuffer: ArrayBuffer); + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + */ + constructor (array: any[]); + /** + * Copies the passed {buffer} data onto a new {Buffer} instance. + * + * @param buffer The buffer to copy. + */ + constructor (buffer: Buffer); + prototype: Buffer; + /** + * Allocates a new Buffer using an {array} of octets. + * + * @param array + */ + static from(array: any[]): Buffer; + /** + * When passed a reference to the .buffer property of a TypedArray instance, + * the newly created Buffer will share the same allocated memory as the TypedArray. + * The optional {byteOffset} and {length} arguments specify a memory range + * within the {arrayBuffer} that will be shared by the Buffer. + * + * @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer() + * @param byteOffset + * @param length + */ + static from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer; + /** + * Copies the passed {buffer} data onto a new Buffer instance. + * + * @param buffer + */ + static from(buffer: Buffer): Buffer; + /** + * Creates a new Buffer containing the given JavaScript string {str}. + * If provided, the {encoding} parameter identifies the character encoding. + * If not provided, {encoding} defaults to 'utf8'. + * + * @param str + */ + static from(str: string, encoding?: string): Buffer; + /** + * Returns true if {obj} is a Buffer + * + * @param obj object to test. + */ + static isBuffer(obj: any): obj is Buffer; + /** + * Returns true if {encoding} is a valid encoding argument. + * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex' + * + * @param encoding string to test. + */ + static isEncoding(encoding: string): boolean; + /** + * Gives the actual byte length of a string. encoding defaults to 'utf8'. + * This is not the same as String.prototype.length since that returns the number of characters in a string. + * + * @param string string to test. + * @param encoding encoding used to evaluate (defaults to 'utf8') + */ + static byteLength(string: string, encoding?: string): number; + /** + * Returns a buffer which is the result of concatenating all the buffers in the list together. + * + * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer. + * If the list has exactly one item, then the first item of the list is returned. + * If the list has more than one item, then a new Buffer is created. + * + * @param list An array of Buffer objects to concatenate + * @param totalLength Total length of the buffers when concatenated. + * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly. + */ + static concat(list: Buffer[], totalLength?: number): Buffer; + /** + * The same as buf1.compare(buf2). + */ + static compare(buf1: Buffer, buf2: Buffer): number; + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + * @param fill if specified, buffer will be initialized by calling buf.fill(fill). + * If parameter is omitted, buffer will be filled with zeros. + * @param encoding encoding used for call to buf.fill while initalizing + */ + static alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer; + /** + * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents + * of the newly created Buffer are unknown and may contain sensitive data. + * + * @param size count of octets to allocate + */ + static allocUnsafe(size: number): Buffer; + /** + * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents + * of the newly created Buffer are unknown and may contain sensitive data. + * + * @param size count of octets to allocate + */ + static allocUnsafeSlow(size: number): Buffer; + } +} \ No newline at end of file diff --git a/node_modules/safe-buffer/index.js b/node_modules/safe-buffer/index.js new file mode 100644 index 0000000..f8d3ec9 --- /dev/null +++ b/node_modules/safe-buffer/index.js @@ -0,0 +1,65 @@ +/*! safe-buffer. MIT License. Feross Aboukhadijeh */ +/* eslint-disable node/no-deprecated-api */ +var buffer = require('buffer') +var Buffer = buffer.Buffer + +// alternative to using Object.keys for old browsers +function copyProps (src, dst) { + for (var key in src) { + dst[key] = src[key] + } +} +if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { + module.exports = buffer +} else { + // Copy properties from require('buffer') + copyProps(buffer, exports) + exports.Buffer = SafeBuffer +} + +function SafeBuffer (arg, encodingOrOffset, length) { + return Buffer(arg, encodingOrOffset, length) +} + +SafeBuffer.prototype = Object.create(Buffer.prototype) + +// Copy static methods from Buffer +copyProps(Buffer, SafeBuffer) + +SafeBuffer.from = function (arg, encodingOrOffset, length) { + if (typeof arg === 'number') { + throw new TypeError('Argument must not be a number') + } + return Buffer(arg, encodingOrOffset, length) +} + +SafeBuffer.alloc = function (size, fill, encoding) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + var buf = Buffer(size) + if (fill !== undefined) { + if (typeof encoding === 'string') { + buf.fill(fill, encoding) + } else { + buf.fill(fill) + } + } else { + buf.fill(0) + } + return buf +} + +SafeBuffer.allocUnsafe = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return Buffer(size) +} + +SafeBuffer.allocUnsafeSlow = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return buffer.SlowBuffer(size) +} diff --git a/node_modules/safe-buffer/package.json b/node_modules/safe-buffer/package.json new file mode 100644 index 0000000..f2869e2 --- /dev/null +++ b/node_modules/safe-buffer/package.json @@ -0,0 +1,51 @@ +{ + "name": "safe-buffer", + "description": "Safer Node.js Buffer API", + "version": "5.2.1", + "author": { + "name": "Feross Aboukhadijeh", + "email": "feross@feross.org", + "url": "https://feross.org" + }, + "bugs": { + "url": "https://github.com/feross/safe-buffer/issues" + }, + "devDependencies": { + "standard": "*", + "tape": "^5.0.0" + }, + "homepage": "https://github.com/feross/safe-buffer", + "keywords": [ + "buffer", + "buffer allocate", + "node security", + "safe", + "safe-buffer", + "security", + "uninitialized" + ], + "license": "MIT", + "main": "index.js", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "git://github.com/feross/safe-buffer.git" + }, + "scripts": { + "test": "standard && tape test/*.js" + }, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] +} diff --git a/node_modules/send/HISTORY.md b/node_modules/send/HISTORY.md index 1fa40b5..a739774 100644 --- a/node_modules/send/HISTORY.md +++ b/node_modules/send/HISTORY.md @@ -1,3 +1,229 @@ +0.18.0 / 2022-03-23 +=================== + + * Fix emitted 416 error missing headers property + * Limit the headers removed for 304 response + * deps: depd@2.0.0 + - Replace internal `eval` usage with `Function` constructor + - Use instance methods on `process` to check for listeners + * deps: destroy@1.2.0 + * deps: http-errors@2.0.0 + - deps: depd@2.0.0 + - deps: statuses@2.0.1 + * deps: on-finished@2.4.1 + * deps: statuses@2.0.1 + +0.17.2 / 2021-12-11 +=================== + + * pref: ignore empty http tokens + * deps: http-errors@1.8.1 + - deps: inherits@2.0.4 + - deps: toidentifier@1.0.1 + - deps: setprototypeof@1.2.0 + * deps: ms@2.1.3 + +0.17.1 / 2019-05-10 +=================== + + * Set stricter CSP header in redirect & error responses + * deps: range-parser@~1.2.1 + +0.17.0 / 2019-05-03 +=================== + + * deps: http-errors@~1.7.2 + - Set constructor name when possible + - Use `toidentifier` module to make class names + - deps: depd@~1.1.2 + - deps: setprototypeof@1.1.1 + - deps: statuses@'>= 1.5.0 < 2' + * deps: mime@1.6.0 + - Add extensions for JPEG-2000 images + - Add new `font/*` types from IANA + - Add WASM mapping + - Update `.bdoc` to `application/bdoc` + - Update `.bmp` to `image/bmp` + - Update `.m4a` to `audio/mp4` + - Update `.rtf` to `application/rtf` + - Update `.wav` to `audio/wav` + - Update `.xml` to `application/xml` + - Update generic extensions to `application/octet-stream`: + `.deb`, `.dll`, `.dmg`, `.exe`, `.iso`, `.msi` + - Use mime-score module to resolve extension conflicts + * deps: ms@2.1.1 + - Add `week`/`w` support + - Fix negative number handling + * deps: statuses@~1.5.0 + * perf: remove redundant `path.normalize` call + +0.16.2 / 2018-02-07 +=================== + + * Fix incorrect end tag in default error & redirects + * deps: depd@~1.1.2 + - perf: remove argument reassignment + * deps: encodeurl@~1.0.2 + - Fix encoding `%` as last character + * deps: statuses@~1.4.0 + +0.16.1 / 2017-09-29 +=================== + + * Fix regression in edge-case behavior for empty `path` + +0.16.0 / 2017-09-27 +=================== + + * Add `immutable` option + * Fix missing `` in default error & redirects + * Use instance methods on steam to check for listeners + * deps: mime@1.4.1 + - Add 70 new types for file extensions + - Set charset as "UTF-8" for .js and .json + * perf: improve path validation speed + +0.15.6 / 2017-09-22 +=================== + + * deps: debug@2.6.9 + * perf: improve `If-Match` token parsing + +0.15.5 / 2017-09-20 +=================== + + * deps: etag@~1.8.1 + - perf: replace regular expression with substring + * deps: fresh@0.5.2 + - Fix handling of modified headers with invalid dates + - perf: improve ETag match loop + - perf: improve `If-None-Match` token parsing + +0.15.4 / 2017-08-05 +=================== + + * 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 + +0.15.3 / 2017-05-16 +=================== + + * deps: debug@2.6.7 + - deps: ms@2.0.0 + * deps: ms@2.0.0 + +0.15.2 / 2017-04-26 +=================== + + * deps: debug@2.6.4 + - Fix `DEBUG_MAX_ARRAY_LENGTH` + - deps: ms@0.7.3 + * deps: ms@1.0.0 + +0.15.1 / 2017-03-04 +=================== + + * Fix issue when `Date.parse` does not return `NaN` on invalid date + * Fix strict violation in broken environments + +0.15.0 / 2017-02-25 +=================== + + * Support `If-Match` and `If-Unmodified-Since` headers + * Add `res` and `path` arguments to `directory` event + * Remove usage of `res._headers` private field + - Improves compatibility with Node.js 8 nightly + * Send complete HTML document in redirect & error responses + * Set default CSP header in redirect & error responses + * Use `res.getHeaderNames()` when available + * Use `res.headersSent` when available + * deps: debug@2.6.1 + - Allow colors in workers + - Deprecated `DEBUG_FD` environment variable set to `3` or higher + - Fix error when running under React Native + - Use same color for same namespace + - deps: ms@0.7.2 + * deps: etag@~1.8.0 + * deps: fresh@0.5.0 + - Fix false detection of `no-cache` request directive + - Fix incorrect result when `If-None-Match` has both `*` and ETags + - Fix weak `ETag` matching to match spec + - perf: delay reading header values until needed + - perf: enable strict mode + - perf: hoist regular expressions + - perf: remove duplicate conditional + - perf: remove unnecessary boolean coercions + - perf: skip checking modified time if ETag check failed + - perf: skip parsing `If-None-Match` when no `ETag` header + - perf: use `Date.parse` instead of `new Date` + * deps: http-errors@~1.6.1 + - Make `message` property enumerable for `HttpError`s + - deps: setprototypeof@1.0.3 + +0.14.2 / 2017-01-23 +=================== + + * deps: http-errors@~1.5.1 + - deps: inherits@2.0.3 + - deps: setprototypeof@1.0.2 + - deps: statuses@'>= 1.3.1 < 2' + * deps: ms@0.7.2 + * deps: statuses@~1.3.1 + +0.14.1 / 2016-06-09 +=================== + + * Fix redirect error when `path` contains raw non-URL characters + * Fix redirect when `path` starts with multiple forward slashes + +0.14.0 / 2016-06-06 +=================== + + * Add `acceptRanges` option + * Add `cacheControl` option + * Attempt to combine multiple ranges into single range + * Correctly inherit from `Stream` class + * Fix `Content-Range` header in 416 responses when using `start`/`end` options + * Fix `Content-Range` header missing from default 416 responses + * Ignore non-byte `Range` headers + * deps: http-errors@~1.5.0 + - Add `HttpError` export, for `err instanceof createError.HttpError` + - Support new code `421 Misdirected Request` + - Use `setprototypeof` module to replace `__proto__` setting + - deps: inherits@2.0.1 + - deps: statuses@'>= 1.3.0 < 2' + - perf: enable strict mode + * deps: range-parser@~1.2.0 + - Fix incorrectly returning -1 when there is at least one valid range + - perf: remove internal function + * deps: statuses@~1.3.0 + - Add `421 Misdirected Request` + - perf: enable strict mode + * perf: remove argument reassignment + +0.13.2 / 2016-03-05 +=================== + + * Fix invalid `Content-Type` header when `send.mime.default_type` unset + +0.13.1 / 2016-01-16 +=================== + + * deps: depd@~1.1.0 + - Support web browser loading + - perf: enable strict mode + * deps: destroy@~1.0.4 + - perf: enable strict mode + * deps: escape-html@~1.0.3 + - perf: enable strict mode + - perf: optimize string replacement + - perf: use faster string coercion + * deps: range-parser@~1.0.3 + - perf: enable strict mode + 0.13.0 / 2015-06-16 =================== diff --git a/node_modules/send/LICENSE b/node_modules/send/LICENSE index e4d595b..b6ea1c1 100644 --- a/node_modules/send/LICENSE +++ b/node_modules/send/LICENSE @@ -1,7 +1,7 @@ (The MIT License) Copyright (c) 2012 TJ Holowaychuk -Copyright (c) 2014-2015 Douglas Christopher Wilson +Copyright (c) 2014-2022 Douglas Christopher Wilson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/node_modules/send/README.md b/node_modules/send/README.md index 3586060..fadf838 100644 --- a/node_modules/send/README.md +++ b/node_modules/send/README.md @@ -1,21 +1,25 @@ # send -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Linux Build][travis-image]][travis-url] +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Linux Build][github-actions-ci-image]][github-actions-ci-url] [![Windows Build][appveyor-image]][appveyor-url] [![Test Coverage][coveralls-image]][coveralls-url] -[![Gratipay][gratipay-image]][gratipay-url] Send is a library for streaming files from the file system as a http response -supporting partial responses (Ranges), conditional-GET negotiation, high test -coverage, and granular events which may be leveraged to take appropriate actions -in your application or framework. +supporting partial responses (Ranges), conditional-GET negotiation (If-Match, +If-Unmodified-Since, If-None-Match, If-Modified-Since), high test coverage, +and granular events which may be leveraged to take appropriate actions in your +application or framework. Looking to serve up entire folders mapped to URLs? Try [serve-static](https://www.npmjs.org/package/serve-static). ## 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 send ``` @@ -34,6 +38,17 @@ not the actual file-system path). #### Options +##### acceptRanges + +Enable or disable accepting ranged requests, defaults to true. +Disabling this will not send `Accept-Ranges` and ignore the contents +of the `Range` request header. + +##### cacheControl + +Enable or disable setting `Cache-Control` response header, defaults to +true. Disabling this will ignore the `immutable` and `maxAge` options. + ##### dotfiles Set how "dotfiles" are treated when encountered. A dotfile is a file @@ -51,6 +66,12 @@ The default value is _similar_ to `'ignore'`, with the exception that this default will not ignore the files within a directory that begins with a dot, for backward-compatibility. +##### end + +Byte offset at which the stream ends, defaults to the length of the file +minus 1. The end is inclusive in the stream, meaning `end: 3` will include +the 4th byte in the stream. + ##### etag Enable or disable etag generation, defaults to true. @@ -62,6 +83,14 @@ in the given order. By default, this is disabled (set to `false`). An example value that will serve extension-less HTML files: `['html', 'htm']`. This is skipped if the requested file already has an extension. +##### immutable + +Enable or disable the `immutable` directive in the `Cache-Control` response +header, defaults to `false`. If set to `true`, the `maxAge` option should +also be specified to enable caching. The `immutable` directive will prevent +supported clients from making conditional requests during the life of the +`maxAge` option to check if the file has changed. + ##### index By default send supports "index.html" files, to disable this @@ -83,22 +112,36 @@ This can also be a string accepted by the Serve files relative to `path`. -### Events +##### start + +Byte offset at which the stream starts, defaults to 0. The start is inclusive, +meaning `start: 2` will include the 3rd byte in the stream. + +#### Events The `SendStream` is an event emitter and will emit the following events: - `error` an error occurred `(err)` - - `directory` a directory was requested + - `directory` a directory was requested `(res, path)` - `file` a file was requested `(path, stat)` - `headers` the headers are about to be set on a file `(res, path, stat)` - `stream` file streaming has started `(stream)` - `end` streaming has completed -### .pipe +#### .pipe The `pipe` method is used to pipe the response into the Node.js HTTP response object, typically `send(req, path, options).pipe(res)`. +### .mime + +The `mime` export is the global instance of of the +[`mime` npm module](https://www.npmjs.com/package/mime). + +This is used to configure the MIME types that are associated with file extensions +as well as other options for how to resolve the MIME type of a file (like the +default type to use for an unknown file extension). + ## Error-handling By default when no `error` listeners are present an automatic response will be @@ -129,67 +172,156 @@ $ npm test ## Examples -### Small example +### Serve a specific file + +This simple example will send a specific file to all requests. ```js -var http = require('http'); -var send = require('send'); +var http = require('http') +var send = require('send') -var app = http.createServer(function(req, res){ - send(req, req.url).pipe(res); -}).listen(3000); +var server = http.createServer(function onRequest (req, res) { + send(req, '/path/to/index.html') + .pipe(res) +}) + +server.listen(3000) ``` -Serving from a root directory with custom error-handling: +### Serve all files from a directory + +This simple example will just serve up all the files in a +given directory as the top-level. For example, a request +`GET /foo.txt` will send back `/www/public/foo.txt`. ```js -var http = require('http'); -var send = require('send'); -var url = require('url'); +var http = require('http') +var parseUrl = require('parseurl') +var send = require('send') -var app = http.createServer(function(req, res){ +var server = http.createServer(function onRequest (req, res) { + send(req, parseUrl(req).pathname, { root: '/www/public' }) + .pipe(res) +}) + +server.listen(3000) +``` + +### Custom file types + +```js +var http = require('http') +var parseUrl = require('parseurl') +var send = require('send') + +// Default unknown types to text/plain +send.mime.default_type = 'text/plain' + +// Add a custom type +send.mime.define({ + 'application/x-my-type': ['x-mt', 'x-mtt'] +}) + +var server = http.createServer(function onRequest (req, res) { + send(req, parseUrl(req).pathname, { root: '/www/public' }) + .pipe(res) +}) + +server.listen(3000) +``` + +### Custom directory index view + +This is a example of serving up a structure of directories with a +custom function to render a listing of a directory. + +```js +var http = require('http') +var fs = require('fs') +var parseUrl = require('parseurl') +var send = require('send') + +// Transfer arbitrary files from within /www/example.com/public/* +// with a custom handler for directory listing +var server = http.createServer(function onRequest (req, res) { + send(req, parseUrl(req).pathname, { index: false, root: '/www/public' }) + .once('directory', directory) + .pipe(res) +}) + +server.listen(3000) + +// Custom directory handler +function directory (res, path) { + var stream = this + + // redirect to trailing slash for consistent url + if (!stream.hasTrailingSlash()) { + return stream.redirect(path) + } + + // get directory list + fs.readdir(path, function onReaddir (err, list) { + if (err) return stream.error(err) + + // render an index for the directory + res.setHeader('Content-Type', 'text/plain; charset=UTF-8') + res.end(list.join('\n') + '\n') + }) +} +``` + +### Serving from a root directory with custom error-handling + +```js +var http = require('http') +var parseUrl = require('parseurl') +var send = require('send') + +var server = http.createServer(function onRequest (req, res) { // your custom error-handling logic: - function error(err) { - res.statusCode = err.status || 500; - res.end(err.message); + function error (err) { + res.statusCode = err.status || 500 + res.end(err.message) } // your custom headers - function headers(res, path, stat) { + function headers (res, path, stat) { // serve all files for download - res.setHeader('Content-Disposition', 'attachment'); + res.setHeader('Content-Disposition', 'attachment') } // your custom directory handling logic: - function redirect() { - res.statusCode = 301; - res.setHeader('Location', req.url + '/'); - res.end('Redirecting to ' + req.url + '/'); + function redirect () { + res.statusCode = 301 + res.setHeader('Location', req.url + '/') + res.end('Redirecting to ' + req.url + '/') } // transfer arbitrary files from within // /www/example.com/public/* - send(req, url.parse(req.url).pathname, {root: '/www/example.com/public'}) - .on('error', error) - .on('directory', redirect) - .on('headers', headers) - .pipe(res); -}).listen(3000); + send(req, parseUrl(req).pathname, { root: '/www/public' }) + .on('error', error) + .on('directory', redirect) + .on('headers', headers) + .pipe(res) +}) + +server.listen(3000) ``` -## License +## License [MIT](LICENSE) -[npm-image]: https://img.shields.io/npm/v/send.svg -[npm-url]: https://npmjs.org/package/send -[travis-image]: https://img.shields.io/travis/pillarjs/send/master.svg?label=linux -[travis-url]: https://travis-ci.org/pillarjs/send -[appveyor-image]: https://img.shields.io/appveyor/ci/dougwilson/send/master.svg?label=windows +[appveyor-image]: https://badgen.net/appveyor/ci/dougwilson/send/master?label=windows [appveyor-url]: https://ci.appveyor.com/project/dougwilson/send -[coveralls-image]: https://img.shields.io/coveralls/pillarjs/send/master.svg +[coveralls-image]: https://badgen.net/coveralls/c/github/pillarjs/send/master [coveralls-url]: https://coveralls.io/r/pillarjs/send?branch=master -[downloads-image]: https://img.shields.io/npm/dm/send.svg -[downloads-url]: https://npmjs.org/package/send -[gratipay-image]: https://img.shields.io/gratipay/dougwilson.svg -[gratipay-url]: https://www.gratipay.com/dougwilson/ +[github-actions-ci-image]: https://badgen.net/github/checks/pillarjs/send/master?label=linux +[github-actions-ci-url]: https://github.com/pillarjs/send/actions/workflows/ci.yml +[node-image]: https://badgen.net/npm/node/send +[node-url]: https://nodejs.org/en/download/ +[npm-downloads-image]: https://badgen.net/npm/dm/send +[npm-url]: https://npmjs.org/package/send +[npm-version-image]: https://badgen.net/npm/v/send diff --git a/node_modules/send/SECURITY.md b/node_modules/send/SECURITY.md new file mode 100644 index 0000000..46b48f7 --- /dev/null +++ b/node_modules/send/SECURITY.md @@ -0,0 +1,24 @@ +# Security Policies and Procedures + +## Reporting a Bug + +The `send` 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 `send`. This information +can be found in the npm registry using the command `npm owner ls send`. +If unsure or unable to get the information from the above, open an issue +in the [project issue tracker](https://github.com/pillarjs/send/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/send/index.js b/node_modules/send/index.js index 3510989..89afd7e 100644 --- a/node_modules/send/index.js +++ b/node_modules/send/index.js @@ -1,7 +1,7 @@ /*! * send * Copyright(c) 2012 TJ Holowaychuk - * Copyright(c) 2014-2015 Douglas Christopher Wilson + * Copyright(c) 2014-2022 Douglas Christopher Wilson * MIT Licensed */ @@ -16,30 +16,51 @@ var createError = require('http-errors') var debug = require('debug')('send') var deprecate = require('depd')('send') var destroy = require('destroy') +var encodeUrl = require('encodeurl') var escapeHtml = require('escape-html') - , parseRange = require('range-parser') - , Stream = require('stream') - , mime = require('mime') - , fresh = require('fresh') - , path = require('path') - , fs = require('fs') - , normalize = path.normalize - , join = path.join var etag = require('etag') -var EventEmitter = require('events').EventEmitter; -var ms = require('ms'); +var fresh = require('fresh') +var fs = require('fs') +var mime = require('mime') +var ms = require('ms') var onFinished = require('on-finished') +var parseRange = require('range-parser') +var path = require('path') var statuses = require('statuses') +var Stream = require('stream') +var util = require('util') /** - * Variables. + * Path function references. + * @private */ + var extname = path.extname -var maxMaxAge = 60 * 60 * 24 * 365 * 1000; // 1 year +var join = path.join +var normalize = path.normalize var resolve = path.resolve var sep = path.sep -var toString = Object.prototype.toString -var upPathRegexp = /(?:^|[\\\/])\.\.(?:[\\\/]|$)/ + +/** + * Regular expression for identifying a bytes Range header. + * @private + */ + +var BYTES_RANGE_REGEXP = /^ *bytes=/ + +/** + * Maximum value allowed for the max age. + * @private + */ + +var MAX_MAXAGE = 60 * 60 * 24 * 365 * 1000 // 1 year + +/** + * Regular expression to match a path with a directory up component. + * @private + */ + +var UP_PATH_REGEXP = /(?:^|[\\/])\.\.(?:[\\/]|$)/ /** * Module exports. @@ -49,14 +70,6 @@ var upPathRegexp = /(?:^|[\\\/])\.\.(?:[\\\/]|$)/ module.exports = send module.exports.mime = mime -/** - * Shim EventEmitter.listenerCount for node.js < 0.10 - */ - -/* istanbul ignore next */ -var listenerCount = EventEmitter.listenerCount - || function(emitter, type){ return emitter.listeners(type).length; }; - /** * Return a `SendStream` for `req` and `path`. * @@ -67,8 +80,8 @@ var listenerCount = EventEmitter.listenerCount * @public */ -function send(req, path, options) { - return new SendStream(req, path, options); +function send (req, path, options) { + return new SendStream(req, path, options) } /** @@ -80,13 +93,23 @@ function send(req, path, options) { * @private */ -function SendStream(req, path, options) { +function SendStream (req, path, options) { + Stream.call(this) + var opts = options || {} this.options = opts this.path = path this.req = req + this._acceptRanges = opts.acceptRanges !== undefined + ? Boolean(opts.acceptRanges) + : true + + this._cacheControl = opts.cacheControl !== undefined + ? Boolean(opts.cacheControl) + : true + this._etag = opts.etag !== undefined ? Boolean(opts.etag) : true @@ -114,6 +137,10 @@ function SendStream(req, path, options) { ? normalizeList(opts.extensions, 'extensions option') : [] + this._immutable = opts.immutable !== undefined + ? Boolean(opts.immutable) + : false + this._index = opts.index !== undefined ? normalizeList(opts.index, 'index option') : ['index.html'] @@ -127,7 +154,7 @@ function SendStream(req, path, options) { ? ms(this._maxage) : Number(this._maxage) this._maxage = !isNaN(this._maxage) - ? Math.min(Math.max(0, this._maxage), maxMaxAge) + ? Math.min(Math.max(0, this._maxage), MAX_MAXAGE) : 0 this._root = opts.root @@ -140,10 +167,10 @@ function SendStream(req, path, options) { } /** - * Inherits from `Stream.prototype`. + * Inherits from `Stream`. */ -SendStream.prototype.__proto__ = Stream.prototype; +util.inherits(SendStream, Stream) /** * Enable or disable etag generation. @@ -153,12 +180,11 @@ SendStream.prototype.__proto__ = Stream.prototype; * @api public */ -SendStream.prototype.etag = deprecate.function(function etag(val) { - val = Boolean(val); - debug('etag %s', val); - this._etag = val; - return this; -}, 'send.etag: pass etag as option'); +SendStream.prototype.etag = deprecate.function(function etag (val) { + this._etag = Boolean(val) + debug('etag %s', this._etag) + return this +}, 'send.etag: pass etag as option') /** * Enable or disable "hidden" (dot) files. @@ -168,13 +194,12 @@ SendStream.prototype.etag = deprecate.function(function etag(val) { * @api public */ -SendStream.prototype.hidden = deprecate.function(function hidden(val) { - val = Boolean(val); - debug('hidden %s', val); - this._hidden = val; +SendStream.prototype.hidden = deprecate.function(function hidden (val) { + this._hidden = Boolean(val) this._dotfiles = undefined - return this; -}, 'send.hidden: use dotfiles option'); + debug('hidden %s', this._hidden) + return this +}, 'send.hidden: use dotfiles option') /** * Set index `paths`, set to a falsy @@ -185,12 +210,12 @@ SendStream.prototype.hidden = deprecate.function(function hidden(val) { * @api public */ -SendStream.prototype.index = deprecate.function(function index(paths) { - var index = !paths ? [] : normalizeList(paths, 'paths argument'); - debug('index %o', paths); - this._index = index; - return this; -}, 'send.index: pass index as option'); +SendStream.prototype.index = deprecate.function(function index (paths) { + var index = !paths ? [] : normalizeList(paths, 'paths argument') + debug('index %o', paths) + this._index = index + return this +}, 'send.index: pass index as option') /** * Set root `path`. @@ -200,17 +225,17 @@ SendStream.prototype.index = deprecate.function(function index(paths) { * @api public */ -SendStream.prototype.root = function(path){ - path = String(path); - this._root = resolve(path) - return this; -}; +SendStream.prototype.root = function root (path) { + this._root = resolve(String(path)) + debug('root %s', this._root) + return this +} SendStream.prototype.from = deprecate.function(SendStream.prototype.root, - 'send.from: pass root as option'); + 'send.from: pass root as option') SendStream.prototype.root = deprecate.function(SendStream.prototype.root, - 'send.root: pass root as option'); + 'send.root: pass root as option') /** * Set max-age to `maxAge`. @@ -220,57 +245,62 @@ SendStream.prototype.root = deprecate.function(SendStream.prototype.root, * @api public */ -SendStream.prototype.maxage = deprecate.function(function maxage(maxAge) { - maxAge = typeof maxAge === 'string' +SendStream.prototype.maxage = deprecate.function(function maxage (maxAge) { + this._maxage = typeof maxAge === 'string' ? ms(maxAge) - : Number(maxAge); - if (isNaN(maxAge)) maxAge = 0; - if (Infinity == maxAge) maxAge = 60 * 60 * 24 * 365 * 1000; - debug('max-age %d', maxAge); - this._maxage = maxAge; - return this; -}, 'send.maxage: pass maxAge as option'); + : Number(maxAge) + this._maxage = !isNaN(this._maxage) + ? Math.min(Math.max(0, this._maxage), MAX_MAXAGE) + : 0 + debug('max-age %d', this._maxage) + return this +}, 'send.maxage: pass maxAge as option') /** * Emit error with `status`. * * @param {number} status - * @param {Error} [error] + * @param {Error} [err] * @private */ -SendStream.prototype.error = function error(status, error) { +SendStream.prototype.error = function error (status, err) { // emit if listeners instead of responding - if (listenerCount(this, 'error') !== 0) { - return this.emit('error', createError(error, status, { - expose: false - })) + if (hasListeners(this, 'error')) { + return this.emit('error', createHttpError(status, err)) } var res = this.res - var msg = statuses[status] + var msg = statuses.message[status] || String(status) + var doc = createHtmlDocument('Error', escapeHtml(msg)) - // wipe all existing headers - res._headers = null + // clear existing headers + clearHeaders(res) + + // add error headers + if (err && err.headers) { + setHeaders(res, err.headers) + } // send basic response res.statusCode = status - res.setHeader('Content-Type', 'text/plain; charset=UTF-8') - res.setHeader('Content-Length', Buffer.byteLength(msg)) + res.setHeader('Content-Type', 'text/html; charset=UTF-8') + res.setHeader('Content-Length', Buffer.byteLength(doc)) + res.setHeader('Content-Security-Policy', "default-src 'none'") res.setHeader('X-Content-Type-Options', 'nosniff') - res.end(msg) + res.end(doc) } /** * Check if the pathname ends with "/". * - * @return {Boolean} - * @api private + * @return {boolean} + * @private */ -SendStream.prototype.hasTrailingSlash = function(){ - return '/' == this.path[this.path.length - 1]; -}; +SendStream.prototype.hasTrailingSlash = function hasTrailingSlash () { + return this.path[this.path.length - 1] === '/' +} /** * Check if this is a conditional GET request. @@ -279,27 +309,57 @@ SendStream.prototype.hasTrailingSlash = function(){ * @api private */ -SendStream.prototype.isConditionalGET = function(){ - return this.req.headers['if-none-match'] - || this.req.headers['if-modified-since']; -}; +SendStream.prototype.isConditionalGET = function isConditionalGET () { + return this.req.headers['if-match'] || + this.req.headers['if-unmodified-since'] || + this.req.headers['if-none-match'] || + this.req.headers['if-modified-since'] +} /** - * Strip content-* header fields. + * Check if the request preconditions failed. + * + * @return {boolean} + * @private + */ + +SendStream.prototype.isPreconditionFailure = function isPreconditionFailure () { + var req = this.req + var res = this.res + + // if-match + var match = req.headers['if-match'] + if (match) { + var etag = res.getHeader('ETag') + return !etag || (match !== '*' && parseTokenList(match).every(function (match) { + return match !== etag && match !== 'W/' + etag && 'W/' + match !== etag + })) + } + + // if-unmodified-since + var unmodifiedSince = parseHttpDate(req.headers['if-unmodified-since']) + if (!isNaN(unmodifiedSince)) { + var lastModified = parseHttpDate(res.getHeader('Last-Modified')) + return isNaN(lastModified) || lastModified > unmodifiedSince + } + + return false +} + +/** + * Strip various content header fields for a change in entity. * * @private */ -SendStream.prototype.removeContentHeaderFields = function removeContentHeaderFields() { +SendStream.prototype.removeContentHeaderFields = function removeContentHeaderFields () { var res = this.res - var headers = Object.keys(res._headers || {}) - for (var i = 0; i < headers.length; i++) { - var header = headers[i] - if (header.substr(0, 8) === 'content-' && header !== 'content-location') { - res.removeHeader(header) - } - } + res.removeHeader('Content-Encoding') + res.removeHeader('Content-Language') + res.removeHeader('Content-Length') + res.removeHeader('Content-Range') + res.removeHeader('Content-Type') } /** @@ -308,13 +368,13 @@ SendStream.prototype.removeContentHeaderFields = function removeContentHeaderFie * @api private */ -SendStream.prototype.notModified = function(){ - var res = this.res; - debug('not modified'); - this.removeContentHeaderFields(); - res.statusCode = 304; - res.end(); -}; +SendStream.prototype.notModified = function notModified () { + var res = this.res + debug('not modified') + this.removeContentHeaderFields() + res.statusCode = 304 + res.end() +} /** * Raise error that headers already sent. @@ -322,11 +382,11 @@ SendStream.prototype.notModified = function(){ * @api private */ -SendStream.prototype.headersAlreadySent = function headersAlreadySent(){ - var err = new Error('Can\'t set headers after they are sent.'); - debug('headers already sent'); - this.error(500, err); -}; +SendStream.prototype.headersAlreadySent = function headersAlreadySent () { + var err = new Error('Can\'t set headers after they are sent.') + debug('headers already sent') + this.error(500, err) +} /** * Check if the request is cacheable, aka @@ -336,10 +396,11 @@ SendStream.prototype.headersAlreadySent = function headersAlreadySent(){ * @api private */ -SendStream.prototype.isCachable = function(){ - var res = this.res; - return (res.statusCode >= 200 && res.statusCode < 300) || 304 == res.statusCode; -}; +SendStream.prototype.isCachable = function isCachable () { + var statusCode = this.res.statusCode + return (statusCode >= 200 && statusCode < 300) || + statusCode === 304 +} /** * Handle stat() error. @@ -348,7 +409,7 @@ SendStream.prototype.isCachable = function(){ * @private */ -SendStream.prototype.onStatError = function onStatError(error) { +SendStream.prototype.onStatError = function onStatError (error) { switch (error.code) { case 'ENAMETOOLONG': case 'ENOENT': @@ -368,9 +429,12 @@ SendStream.prototype.onStatError = function onStatError(error) { * @api private */ -SendStream.prototype.isFresh = function(){ - return fresh(this.req.headers, this.res._headers); -}; +SendStream.prototype.isFresh = function isFresh () { + return fresh(this.req.headers, { + etag: this.res.getHeader('ETag'), + 'last-modified': this.res.getHeader('Last-Modified') + }) +} /** * Check if the range is fresh. @@ -379,15 +443,23 @@ SendStream.prototype.isFresh = function(){ * @api private */ -SendStream.prototype.isRangeFresh = function isRangeFresh(){ - var ifRange = this.req.headers['if-range']; +SendStream.prototype.isRangeFresh = function isRangeFresh () { + var ifRange = this.req.headers['if-range'] - if (!ifRange) return true; + if (!ifRange) { + return true + } - return ~ifRange.indexOf('"') - ? ~ifRange.indexOf(this.res._headers['etag']) - : Date.parse(this.res._headers['last-modified']) <= Date.parse(ifRange); -}; + // if-range as etag + if (ifRange.indexOf('"') !== -1) { + var etag = this.res.getHeader('ETag') + return Boolean(etag && ifRange.indexOf(etag) !== -1) + } + + // if-range as modified date + var lastModified = this.res.getHeader('Last-Modified') + return parseHttpDate(lastModified) <= parseHttpDate(ifRange) +} /** * Redirect to path. @@ -396,9 +468,11 @@ SendStream.prototype.isRangeFresh = function isRangeFresh(){ * @private */ -SendStream.prototype.redirect = function redirect(path) { - if (listenerCount(this, 'directory') !== 0) { - this.emit('directory') +SendStream.prototype.redirect = function redirect (path) { + var res = this.res + + if (hasListeners(this, 'directory')) { + this.emit('directory', res, path) return } @@ -407,17 +481,18 @@ SendStream.prototype.redirect = function redirect(path) { return } - var loc = path + '/' - var msg = 'Redirecting to ' + escapeHtml(loc) + '\n' - var res = this.res + var loc = encodeUrl(collapseLeadingSlashes(this.path + '/')) + var doc = createHtmlDocument('Redirecting', 'Redirecting to ' + + escapeHtml(loc) + '') // redirect res.statusCode = 301 res.setHeader('Content-Type', 'text/html; charset=UTF-8') - res.setHeader('Content-Length', Buffer.byteLength(msg)) + res.setHeader('Content-Length', Buffer.byteLength(doc)) + res.setHeader('Content-Security-Policy', "default-src 'none'") res.setHeader('X-Content-Type-Options', 'nosniff') res.setHeader('Location', loc) - res.end(msg) + res.end(doc) } /** @@ -428,40 +503,51 @@ SendStream.prototype.redirect = function redirect(path) { * @api public */ -SendStream.prototype.pipe = function(res){ - var self = this - , args = arguments - , root = this._root; +SendStream.prototype.pipe = function pipe (res) { + // root path + var root = this._root // references - this.res = res; + this.res = res // decode the path var path = decode(this.path) - if (path === -1) return this.error(400) + if (path === -1) { + this.error(400) + return res + } // null byte(s) - if (~path.indexOf('\0')) return this.error(400); + if (~path.indexOf('\0')) { + this.error(400) + return res + } var parts if (root !== null) { - // malicious path - if (upPathRegexp.test(normalize('.' + sep + path))) { - debug('malicious path "%s"', path) - return this.error(403) + // normalize + if (path) { + path = normalize('.' + sep + path) } + // malicious path + if (UP_PATH_REGEXP.test(path)) { + debug('malicious path "%s"', path) + this.error(403) + return res + } + + // explode path parts + parts = path.split(sep) + // join / normalize from optional root dir path = normalize(join(root, path)) - root = normalize(root + sep) - - // explode path parts - parts = path.substr(root.length).split(sep) } else { // ".." is malicious without "root" - if (upPathRegexp.test(path)) { + if (UP_PATH_REGEXP.test(path)) { debug('malicious path "%s"', path) - return this.error(403) + this.error(403) + return res } // explode path parts @@ -487,22 +573,24 @@ SendStream.prototype.pipe = function(res){ case 'allow': break case 'deny': - return this.error(403) + this.error(403) + return res case 'ignore': default: - return this.error(404) + this.error(404) + return res } } // index file support - if (this._index.length && this.path[this.path.length - 1] === '/') { - this.sendIndex(path); - return res; + if (this._index.length && this.hasTrailingSlash()) { + this.sendIndex(path) + return res } - this.sendFile(path); - return res; -}; + this.sendFile(path) + return res +} /** * Transfer `path`. @@ -511,74 +599,86 @@ SendStream.prototype.pipe = function(res){ * @api public */ -SendStream.prototype.send = function(path, stat){ - var len = stat.size; +SendStream.prototype.send = function send (path, stat) { + var len = stat.size var options = this.options var opts = {} - var res = this.res; - var req = this.req; - var ranges = req.headers.range; - var offset = options.start || 0; + var res = this.res + var req = this.req + var ranges = req.headers.range + var offset = options.start || 0 - if (res._header) { + if (headersSent(res)) { // impossible to send now - return this.headersAlreadySent(); + this.headersAlreadySent() + return } debug('pipe "%s"', path) // set header fields - this.setHeader(path, stat); + this.setHeader(path, stat) // set content-type - this.type(path); + this.type(path) // conditional GET support - if (this.isConditionalGET() - && this.isCachable() - && this.isFresh()) { - return this.notModified(); + if (this.isConditionalGET()) { + if (this.isPreconditionFailure()) { + this.error(412) + return + } + + if (this.isCachable() && this.isFresh()) { + this.notModified() + return + } } // adjust len to start/end options - len = Math.max(0, len - offset); + len = Math.max(0, len - offset) if (options.end !== undefined) { - var bytes = options.end - offset + 1; - if (len > bytes) len = bytes; + var bytes = options.end - offset + 1 + if (len > bytes) len = bytes } // Range support - if (ranges) { - ranges = parseRange(len, ranges); + if (this._acceptRanges && BYTES_RANGE_REGEXP.test(ranges)) { + // parse + ranges = parseRange(len, ranges, { + combine: true + }) // If-Range support if (!this.isRangeFresh()) { - debug('range stale'); - ranges = -2; + debug('range stale') + ranges = -2 } // unsatisfiable - if (-1 == ranges) { - debug('range unsatisfiable'); - res.setHeader('Content-Range', 'bytes */' + stat.size); - return this.error(416); + if (ranges === -1) { + debug('range unsatisfiable') + + // Content-Range + res.setHeader('Content-Range', contentRange('bytes', len)) + + // 416 Requested Range Not Satisfiable + return this.error(416, { + headers: { 'Content-Range': res.getHeader('Content-Range') } + }) } // valid (syntactically invalid/multiple ranges are treated as a regular response) - if (-2 != ranges && ranges.length === 1) { - debug('range %j', ranges); + if (ranges !== -2 && ranges.length === 1) { + debug('range %j', ranges) // Content-Range - res.statusCode = 206; - res.setHeader('Content-Range', 'bytes ' - + ranges[0].start - + '-' - + ranges[0].end - + '/' - + len); + res.statusCode = 206 + res.setHeader('Content-Range', contentRange('bytes', len, ranges[0])) - offset += ranges[0].start; - len = ranges[0].end - ranges[0].start + 1; + // adjust for requested range + offset += ranges[0].start + len = ranges[0].end - ranges[0].start + 1 } } @@ -592,13 +692,16 @@ SendStream.prototype.send = function(path, stat){ opts.end = Math.max(offset, offset + len - 1) // content-length - res.setHeader('Content-Length', len); + res.setHeader('Content-Length', len) // HEAD support - if ('HEAD' == req.method) return res.end(); + if (req.method === 'HEAD') { + res.end() + return + } this.stream(path, opts) -}; +} /** * Transfer file for `path`. @@ -606,25 +709,23 @@ SendStream.prototype.send = function(path, stat){ * @param {String} path * @api private */ -SendStream.prototype.sendFile = function sendFile(path) { +SendStream.prototype.sendFile = function sendFile (path) { var i = 0 var self = this - debug('stat "%s"', path); - fs.stat(path, function onstat(err, stat) { - if (err && err.code === 'ENOENT' - && !extname(path) - && path[path.length - 1] !== sep) { + debug('stat "%s"', path) + fs.stat(path, function onstat (err, stat) { + if (err && err.code === 'ENOENT' && !extname(path) && path[path.length - 1] !== sep) { // not found, check extensions return next(err) } if (err) return self.onStatError(err) - if (stat.isDirectory()) return self.redirect(self.path) + if (stat.isDirectory()) return self.redirect(path) self.emit('file', path, stat) self.send(path, stat) }) - function next(err) { + function next (err) { if (self._extensions.length <= i) { return err ? self.onStatError(err) @@ -649,29 +750,29 @@ SendStream.prototype.sendFile = function sendFile(path) { * @param {String} path * @api private */ -SendStream.prototype.sendIndex = function sendIndex(path){ - var i = -1; - var self = this; +SendStream.prototype.sendIndex = function sendIndex (path) { + var i = -1 + var self = this - function next(err){ + function next (err) { if (++i >= self._index.length) { - if (err) return self.onStatError(err); - return self.error(404); + if (err) return self.onStatError(err) + return self.error(404) } - var p = join(path, self._index[i]); + var p = join(path, self._index[i]) - debug('stat "%s"', p); - fs.stat(p, function(err, stat){ - if (err) return next(err); - if (stat.isDirectory()) return next(); - self.emit('file', p, stat); - self.send(p, stat); - }); + debug('stat "%s"', p) + fs.stat(p, function (err, stat) { + if (err) return next(err) + if (stat.isDirectory()) return next() + self.emit('file', p, stat) + self.send(p, stat) + }) } - next(); -}; + next() +} /** * Stream `path` to the response. @@ -681,42 +782,37 @@ SendStream.prototype.sendIndex = function sendIndex(path){ * @api private */ -SendStream.prototype.stream = function(path, options){ - // TODO: this is all lame, refactor meeee - var finished = false; - var self = this; - var res = this.res; - var req = this.req; +SendStream.prototype.stream = function stream (path, options) { + var self = this + var res = this.res // pipe - var stream = fs.createReadStream(path, options); - this.emit('stream', stream); - stream.pipe(res); + var stream = fs.createReadStream(path, options) + this.emit('stream', stream) + stream.pipe(res) - // response finished, done with the fd - onFinished(res, function onfinished(){ - finished = true; - destroy(stream); - }); + // cleanup + function cleanup () { + destroy(stream, true) + } - // error handling code-smell - stream.on('error', function onerror(err){ - // request already finished - if (finished) return; + // response finished, cleanup + onFinished(res, cleanup) - // clean up stream - finished = true; - destroy(stream); + // error handling + stream.on('error', function onerror (err) { + // clean up stream early + cleanup() // error - self.onStatError(err); - }); + self.onStatError(err) + }) // end - stream.on('end', function onend(){ - self.emit('end'); - }); -}; + stream.on('end', function onend () { + self.emit('end') + }) +} /** * Set content-type based on `path` @@ -726,14 +822,23 @@ SendStream.prototype.stream = function(path, options){ * @api private */ -SendStream.prototype.type = function(path){ - var res = this.res; - if (res.getHeader('Content-Type')) return; - var type = mime.lookup(path); - var charset = mime.charsets.lookup(type); - debug('content-type %s', type); - res.setHeader('Content-Type', type + (charset ? '; charset=' + charset : '')); -}; +SendStream.prototype.type = function type (path) { + var res = this.res + + if (res.getHeader('Content-Type')) return + + var type = mime.lookup(path) + + if (!type) { + debug('no content-type') + return + } + + var charset = mime.charsets.lookup(type) + + debug('content-type %s', type) + res.setHeader('Content-Type', type + (charset ? '; charset=' + charset : '')) +} /** * Set response header fields, most @@ -744,13 +849,26 @@ SendStream.prototype.type = function(path){ * @api private */ -SendStream.prototype.setHeader = function setHeader(path, stat){ - var res = this.res; +SendStream.prototype.setHeader = function setHeader (path, stat) { + var res = this.res - this.emit('headers', res, path, stat); + this.emit('headers', res, path, stat) - if (!res.getHeader('Accept-Ranges')) res.setHeader('Accept-Ranges', 'bytes'); - if (!res.getHeader('Cache-Control')) res.setHeader('Cache-Control', 'public, max-age=' + Math.floor(this._maxage / 1000)); + if (this._acceptRanges && !res.getHeader('Accept-Ranges')) { + debug('accept ranges') + res.setHeader('Accept-Ranges', 'bytes') + } + + if (this._cacheControl && !res.getHeader('Cache-Control')) { + var cacheControl = 'public, max-age=' + Math.floor(this._maxage / 1000) + + if (this._immutable) { + cacheControl += ', immutable' + } + + debug('cache-control %s', cacheControl) + res.setHeader('Cache-Control', cacheControl) + } if (this._lastModified && !res.getHeader('Last-Modified')) { var modified = stat.mtime.toUTCString() @@ -763,7 +881,40 @@ SendStream.prototype.setHeader = function setHeader(path, stat){ debug('etag %s', val) res.setHeader('ETag', val) } -}; +} + +/** + * Clear all headers from a response. + * + * @param {object} res + * @private + */ + +function clearHeaders (res) { + var headers = getHeaderNames(res) + + for (var i = 0; i < headers.length; i++) { + res.removeHeader(headers[i]) + } +} + +/** + * Collapse all leading slashes into a single slash + * + * @param {string} str + * @private + */ +function collapseLeadingSlashes (str) { + for (var i = 0; i < str.length; i++) { + if (str[i] !== '/') { + break + } + } + + return i > 1 + ? '/' + str.substr(i) + : str +} /** * Determine if path parts contain a dotfile. @@ -771,9 +922,10 @@ SendStream.prototype.setHeader = function setHeader(path, stat){ * @api private */ -function containsDotFile(parts) { +function containsDotFile (parts) { for (var i = 0; i < parts.length; i++) { - if (parts[i][0] === '.') { + var part = parts[i] + if (part.length > 1 && part[0] === '.') { return true } } @@ -781,6 +933,57 @@ function containsDotFile(parts) { return false } +/** + * Create a Content-Range header. + * + * @param {string} type + * @param {number} size + * @param {array} [range] + */ + +function contentRange (type, size, range) { + return type + ' ' + (range ? range.start + '-' + range.end : '*') + '/' + size +} + +/** + * Create a minimal HTML document. + * + * @param {string} title + * @param {string} body + * @private + */ + +function createHtmlDocument (title, body) { + return '\n' + + '\n' + + '\n' + + '\n' + + '' + title + '\n' + + '\n' + + '\n' + + '
' + body + '
\n' + + '\n' + + '\n' +} + +/** + * Create a HttpError object from simple arguments. + * + * @param {number} status + * @param {Error|object} err + * @private + */ + +function createHttpError (status, err) { + if (!err) { + return createError(status) + } + + return err instanceof Error + ? createError(status, err, { expose: false }) + : createError(status, err) +} + /** * decodeURIComponent. * @@ -791,7 +994,7 @@ function containsDotFile(parts) { * @api private */ -function decode(path) { +function decode (path) { try { return decodeURIComponent(path) } catch (err) { @@ -799,6 +1002,54 @@ function decode(path) { } } +/** + * Get the header names on a respnse. + * + * @param {object} res + * @returns {array[string]} + * @private + */ + +function getHeaderNames (res) { + return typeof res.getHeaderNames !== 'function' + ? Object.keys(res._headers || {}) + : res.getHeaderNames() +} + +/** + * Determine if emitter has listeners of a given type. + * + * The way to do this check is done three different ways in Node.js >= 0.8 + * so this consolidates them into a minimal set using instance methods. + * + * @param {EventEmitter} emitter + * @param {string} type + * @returns {boolean} + * @private + */ + +function hasListeners (emitter, type) { + var count = typeof emitter.listenerCount !== 'function' + ? emitter.listeners(type).length + : emitter.listenerCount(type) + + return count > 0 +} + +/** + * Determine if the response headers have been sent. + * + * @param {object} res + * @returns {boolean} + * @private + */ + +function headersSent (res) { + return typeof res.headersSent !== 'boolean' + ? Boolean(res._header) + : res.headersSent +} + /** * Normalize the index option into an array. * @@ -807,7 +1058,7 @@ function decode(path) { * @private */ -function normalizeList(val, name) { +function normalizeList (val, name) { var list = [].concat(val || []) for (var i = 0; i < list.length; i++) { @@ -818,3 +1069,75 @@ function normalizeList(val, name) { return list } + +/** + * Parse an HTTP Date into a number. + * + * @param {string} date + * @private + */ + +function parseHttpDate (date) { + var timestamp = date && Date.parse(date) + + return typeof timestamp === 'number' + ? timestamp + : NaN +} + +/** + * Parse a HTTP token list. + * + * @param {string} str + * @private + */ + +function parseTokenList (str) { + var end = 0 + var list = [] + var start = 0 + + // gather tokens + for (var i = 0, len = str.length; i < len; i++) { + switch (str.charCodeAt(i)) { + case 0x20: /* */ + if (start === end) { + start = end = i + 1 + } + break + case 0x2c: /* , */ + if (start !== end) { + list.push(str.substring(start, end)) + } + start = end = i + 1 + break + default: + end = i + 1 + break + } + } + + // final token + if (start !== end) { + list.push(str.substring(start, end)) + } + + return list +} + +/** + * Set an object of headers on a response. + * + * @param {object} res + * @param {object} headers + * @private + */ + +function setHeaders (res, headers) { + var keys = Object.keys(headers) + + for (var i = 0; i < keys.length; i++) { + var key = keys[i] + res.setHeader(key, headers[key]) + } +} diff --git a/node_modules/send/node_modules/debug/.jshintrc b/node_modules/send/node_modules/debug/.jshintrc deleted file mode 100644 index 299877f..0000000 --- a/node_modules/send/node_modules/debug/.jshintrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "laxbreak": true -} diff --git a/node_modules/send/node_modules/debug/.npmignore b/node_modules/send/node_modules/debug/.npmignore deleted file mode 100644 index 7e6163d..0000000 --- a/node_modules/send/node_modules/debug/.npmignore +++ /dev/null @@ -1,6 +0,0 @@ -support -test -examples -example -*.sock -dist diff --git a/node_modules/send/node_modules/debug/History.md b/node_modules/send/node_modules/debug/History.md deleted file mode 100644 index 854c971..0000000 --- a/node_modules/send/node_modules/debug/History.md +++ /dev/null @@ -1,195 +0,0 @@ - -2.2.0 / 2015-05-09 -================== - - * package: update "ms" to v0.7.1 (#202, @dougwilson) - * README: add logging to file example (#193, @DanielOchoa) - * README: fixed a typo (#191, @amir-s) - * browser: expose `storage` (#190, @stephenmathieson) - * Makefile: add a `distclean` target (#189, @stephenmathieson) - -2.1.3 / 2015-03-13 -================== - - * Updated stdout/stderr example (#186) - * Updated example/stdout.js to match debug current behaviour - * Renamed example/stderr.js to stdout.js - * Update Readme.md (#184) - * replace high intensity foreground color for bold (#182, #183) - -2.1.2 / 2015-03-01 -================== - - * dist: recompile - * update "ms" to v0.7.0 - * package: update "browserify" to v9.0.3 - * component: fix "ms.js" repo location - * changed bower package name - * updated documentation about using debug in a browser - * fix: security error on safari (#167, #168, @yields) - -2.1.1 / 2014-12-29 -================== - - * browser: use `typeof` to check for `console` existence - * browser: check for `console.log` truthiness (fix IE 8/9) - * browser: add support for Chrome apps - * Readme: added Windows usage remarks - * Add `bower.json` to properly support bower install - -2.1.0 / 2014-10-15 -================== - - * node: implement `DEBUG_FD` env variable support - * package: update "browserify" to v6.1.0 - * package: add "license" field to package.json (#135, @panuhorsmalahti) - -2.0.0 / 2014-09-01 -================== - - * package: update "browserify" to v5.11.0 - * node: use stderr rather than stdout for logging (#29, @stephenmathieson) - -1.0.4 / 2014-07-15 -================== - - * dist: recompile - * example: remove `console.info()` log usage - * example: add "Content-Type" UTF-8 header to browser example - * browser: place %c marker after the space character - * browser: reset the "content" color via `color: inherit` - * browser: add colors support for Firefox >= v31 - * debug: prefer an instance `log()` function over the global one (#119) - * Readme: update documentation about styled console logs for FF v31 (#116, @wryk) - -1.0.3 / 2014-07-09 -================== - - * Add support for multiple wildcards in namespaces (#122, @seegno) - * browser: fix lint - -1.0.2 / 2014-06-10 -================== - - * browser: update color palette (#113, @gscottolson) - * common: make console logging function configurable (#108, @timoxley) - * node: fix %o colors on old node <= 0.8.x - * Makefile: find node path using shell/which (#109, @timoxley) - -1.0.1 / 2014-06-06 -================== - - * browser: use `removeItem()` to clear localStorage - * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777) - * package: add "contributors" section - * node: fix comment typo - * README: list authors - -1.0.0 / 2014-06-04 -================== - - * make ms diff be global, not be scope - * debug: ignore empty strings in enable() - * node: make DEBUG_COLORS able to disable coloring - * *: export the `colors` array - * npmignore: don't publish the `dist` dir - * Makefile: refactor to use browserify - * package: add "browserify" as a dev dependency - * Readme: add Web Inspector Colors section - * node: reset terminal color for the debug content - * node: map "%o" to `util.inspect()` - * browser: map "%j" to `JSON.stringify()` - * debug: add custom "formatters" - * debug: use "ms" module for humanizing the diff - * Readme: add "bash" syntax highlighting - * browser: add Firebug color support - * browser: add colors for WebKit browsers - * node: apply log to `console` - * rewrite: abstract common logic for Node & browsers - * add .jshintrc file - -0.8.1 / 2014-04-14 -================== - - * package: re-add the "component" section - -0.8.0 / 2014-03-30 -================== - - * add `enable()` method for nodejs. Closes #27 - * change from stderr to stdout - * remove unnecessary index.js file - -0.7.4 / 2013-11-13 -================== - - * remove "browserify" key from package.json (fixes something in browserify) - -0.7.3 / 2013-10-30 -================== - - * fix: catch localStorage security error when cookies are blocked (Chrome) - * add debug(err) support. Closes #46 - * add .browser prop to package.json. Closes #42 - -0.7.2 / 2013-02-06 -================== - - * fix package.json - * fix: Mobile Safari (private mode) is broken with debug - * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript - -0.7.1 / 2013-02-05 -================== - - * add repository URL to package.json - * add DEBUG_COLORED to force colored output - * add browserify support - * fix component. Closes #24 - -0.7.0 / 2012-05-04 -================== - - * Added .component to package.json - * Added debug.component.js build - -0.6.0 / 2012-03-16 -================== - - * Added support for "-" prefix in DEBUG [Vinay Pulim] - * Added `.enabled` flag to the node version [TooTallNate] - -0.5.0 / 2012-02-02 -================== - - * Added: humanize diffs. Closes #8 - * Added `debug.disable()` to the CS variant - * Removed padding. Closes #10 - * Fixed: persist client-side variant again. Closes #9 - -0.4.0 / 2012-02-01 -================== - - * Added browser variant support for older browsers [TooTallNate] - * Added `debug.enable('project:*')` to browser variant [TooTallNate] - * Added padding to diff (moved it to the right) - -0.3.0 / 2012-01-26 -================== - - * Added millisecond diff when isatty, otherwise UTC string - -0.2.0 / 2012-01-22 -================== - - * Added wildcard support - -0.1.0 / 2011-12-02 -================== - - * Added: remove colors unless stderr isatty [TooTallNate] - -0.0.1 / 2010-01-03 -================== - - * Initial release diff --git a/node_modules/send/node_modules/debug/Makefile b/node_modules/send/node_modules/debug/Makefile deleted file mode 100644 index 5cf4a59..0000000 --- a/node_modules/send/node_modules/debug/Makefile +++ /dev/null @@ -1,36 +0,0 @@ - -# get Makefile directory name: http://stackoverflow.com/a/5982798/376773 -THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) -THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd) - -# BIN directory -BIN := $(THIS_DIR)/node_modules/.bin - -# applications -NODE ?= $(shell which node) -NPM ?= $(NODE) $(shell which npm) -BROWSERIFY ?= $(NODE) $(BIN)/browserify - -all: dist/debug.js - -install: node_modules - -clean: - @rm -rf dist - -dist: - @mkdir -p $@ - -dist/debug.js: node_modules browser.js debug.js dist - @$(BROWSERIFY) \ - --standalone debug \ - . > $@ - -distclean: clean - @rm -rf node_modules - -node_modules: package.json - @NODE_ENV= $(NPM) install - @touch node_modules - -.PHONY: all install clean distclean diff --git a/node_modules/send/node_modules/debug/Readme.md b/node_modules/send/node_modules/debug/Readme.md deleted file mode 100644 index b4f45e3..0000000 --- a/node_modules/send/node_modules/debug/Readme.md +++ /dev/null @@ -1,188 +0,0 @@ -# debug - - tiny node.js debugging utility modelled after node core's debugging technique. - -## Installation - -```bash -$ npm install debug -``` - -## Usage - - With `debug` you simply invoke the exported function to generate your debug function, passing it a name which will determine if a noop function is returned, or a decorated `console.error`, so all of the `console` format string goodies you're used to work fine. A unique color is selected per-function for visibility. - -Example _app.js_: - -```js -var debug = require('debug')('http') - , http = require('http') - , name = 'My App'; - -// fake app - -debug('booting %s', name); - -http.createServer(function(req, res){ - debug(req.method + ' ' + req.url); - res.end('hello\n'); -}).listen(3000, function(){ - debug('listening'); -}); - -// fake worker of some kind - -require('./worker'); -``` - -Example _worker.js_: - -```js -var debug = require('debug')('worker'); - -setInterval(function(){ - debug('doing some work'); -}, 1000); -``` - - The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples: - - ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png) - - ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png) - -#### Windows note - - On Windows the environment variable is set using the `set` command. - - ```cmd - set DEBUG=*,-not_this - ``` - -Then, run the program to be debugged as usual. - -## Millisecond diff - - When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. - - ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png) - - When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below: - - ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png) - -## Conventions - - If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". - -## Wildcards - - The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. - - You can also exclude specific debuggers by prefixing them with a "-" character. For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:". - -## Browser support - - Debug works in the browser as well, currently persisted by `localStorage`. Consider the situation shown below where you have `worker:a` and `worker:b`, and wish to debug both. Somewhere in the code on your page, include: - -```js -window.myDebug = require("debug"); -``` - - ("debug" is a global object in the browser so we give this object a different name.) When your page is open in the browser, type the following in the console: - -```js -myDebug.enable("worker:*") -``` - - Refresh the page. Debug output will continue to be sent to the console until it is disabled by typing `myDebug.disable()` in the console. - -```js -a = debug('worker:a'); -b = debug('worker:b'); - -setInterval(function(){ - a('doing some work'); -}, 1000); - -setInterval(function(){ - b('doing some work'); -}, 1200); -``` - -#### Web Inspector Colors - - Colors are also enabled on "Web Inspectors" that understand the `%c` formatting - option. These are WebKit web inspectors, Firefox ([since version - 31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) - and the Firebug plugin for Firefox (any version). - - Colored output looks something like: - - ![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png) - -### stderr vs stdout - -You can set an alternative logging method per-namespace by overriding the `log` method on a per-namespace or globally: - -Example _stdout.js_: - -```js -var debug = require('debug'); -var error = debug('app:error'); - -// by default stderr is used -error('goes to stderr!'); - -var log = debug('app:log'); -// set this namespace to log via console.log -log.log = console.log.bind(console); // don't forget to bind to console! -log('goes to stdout'); -error('still goes to stderr!'); - -// set all output to go via console.info -// overrides all per-namespace log settings -debug.log = console.info.bind(console); -error('now goes to stdout via console.info'); -log('still goes to stdout, but via console.info now'); -``` - -### Save debug output to a file - -You can save all debug statements to a file by piping them. - -Example: - -```bash -$ DEBUG_FD=3 node your-app.js 3> whatever.log -``` - -## Authors - - - TJ Holowaychuk - - Nathan Rajlich - -## License - -(The MIT License) - -Copyright (c) 2014 TJ Holowaychuk <tj@vision-media.ca> - -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/send/node_modules/debug/bower.json b/node_modules/send/node_modules/debug/bower.json deleted file mode 100644 index 6af573f..0000000 --- a/node_modules/send/node_modules/debug/bower.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "visionmedia-debug", - "main": "dist/debug.js", - "version": "2.2.0", - "homepage": "https://github.com/visionmedia/debug", - "authors": [ - "TJ Holowaychuk " - ], - "description": "visionmedia-debug", - "moduleType": [ - "amd", - "es6", - "globals", - "node" - ], - "keywords": [ - "visionmedia", - "debug" - ], - "license": "MIT", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ] -} diff --git a/node_modules/send/node_modules/debug/browser.js b/node_modules/send/node_modules/debug/browser.js deleted file mode 100644 index 7c76452..0000000 --- a/node_modules/send/node_modules/debug/browser.js +++ /dev/null @@ -1,168 +0,0 @@ - -/** - * This is the web browser implementation of `debug()`. - * - * Expose `debug()` as the module. - */ - -exports = module.exports = require('./debug'); -exports.log = log; -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; -exports.storage = 'undefined' != typeof chrome - && 'undefined' != typeof chrome.storage - ? chrome.storage.local - : localstorage(); - -/** - * Colors. - */ - -exports.colors = [ - 'lightseagreen', - 'forestgreen', - 'goldenrod', - 'dodgerblue', - 'darkorchid', - 'crimson' -]; - -/** - * Currently only WebKit-based Web Inspectors, Firefox >= v31, - * and the Firebug extension (any Firefox version) are known - * to support "%c" CSS customizations. - * - * TODO: add a `localStorage` variable to explicitly enable/disable colors - */ - -function useColors() { - // is webkit? http://stackoverflow.com/a/16459606/376773 - return ('WebkitAppearance' in document.documentElement.style) || - // is firebug? http://stackoverflow.com/a/398120/376773 - (window.console && (console.firebug || (console.exception && console.table))) || - // is firefox >= v31? - // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages - (navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31); -} - -/** - * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. - */ - -exports.formatters.j = function(v) { - return JSON.stringify(v); -}; - - -/** - * Colorize log arguments if enabled. - * - * @api public - */ - -function formatArgs() { - var args = arguments; - var useColors = this.useColors; - - args[0] = (useColors ? '%c' : '') - + this.namespace - + (useColors ? ' %c' : ' ') - + args[0] - + (useColors ? '%c ' : ' ') - + '+' + exports.humanize(this.diff); - - if (!useColors) return args; - - var c = 'color: ' + this.color; - args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1)); - - // the final "%c" is somewhat tricky, because there could be other - // arguments passed either before or after the %c, so we need to - // figure out the correct index to insert the CSS into - var index = 0; - var lastC = 0; - args[0].replace(/%[a-z%]/g, function(match) { - if ('%%' === match) return; - index++; - if ('%c' === match) { - // we only are interested in the *last* %c - // (the user may have provided their own) - lastC = index; - } - }); - - args.splice(lastC, 0, c); - return args; -} - -/** - * Invokes `console.log()` when available. - * No-op when `console.log` is not a "function". - * - * @api public - */ - -function log() { - // this hackery is required for IE8/9, where - // the `console.log` function doesn't have 'apply' - return 'object' === typeof console - && console.log - && Function.prototype.apply.call(console.log, console, arguments); -} - -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ - -function save(namespaces) { - try { - if (null == namespaces) { - exports.storage.removeItem('debug'); - } else { - exports.storage.debug = namespaces; - } - } catch(e) {} -} - -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ - -function load() { - var r; - try { - r = exports.storage.debug; - } catch(e) {} - return r; -} - -/** - * Enable namespaces listed in `localStorage.debug` initially. - */ - -exports.enable(load()); - -/** - * Localstorage attempts to return the localstorage. - * - * This is necessary because safari throws - * when a user disables cookies/localstorage - * and you attempt to access it. - * - * @return {LocalStorage} - * @api private - */ - -function localstorage(){ - try { - return window.localStorage; - } catch (e) {} -} diff --git a/node_modules/send/node_modules/debug/component.json b/node_modules/send/node_modules/debug/component.json deleted file mode 100644 index ca10637..0000000 --- a/node_modules/send/node_modules/debug/component.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "debug", - "repo": "visionmedia/debug", - "description": "small debugging utility", - "version": "2.2.0", - "keywords": [ - "debug", - "log", - "debugger" - ], - "main": "browser.js", - "scripts": [ - "browser.js", - "debug.js" - ], - "dependencies": { - "rauchg/ms.js": "0.7.1" - } -} diff --git a/node_modules/send/node_modules/debug/debug.js b/node_modules/send/node_modules/debug/debug.js deleted file mode 100644 index 7571a86..0000000 --- a/node_modules/send/node_modules/debug/debug.js +++ /dev/null @@ -1,197 +0,0 @@ - -/** - * This is the common logic for both the Node.js and web browser - * implementations of `debug()`. - * - * Expose `debug()` as the module. - */ - -exports = module.exports = debug; -exports.coerce = coerce; -exports.disable = disable; -exports.enable = enable; -exports.enabled = enabled; -exports.humanize = require('ms'); - -/** - * The currently active debug mode names, and names to skip. - */ - -exports.names = []; -exports.skips = []; - -/** - * Map of special "%n" handling functions, for the debug "format" argument. - * - * Valid key names are a single, lowercased letter, i.e. "n". - */ - -exports.formatters = {}; - -/** - * Previously assigned color. - */ - -var prevColor = 0; - -/** - * Previous log timestamp. - */ - -var prevTime; - -/** - * Select a color. - * - * @return {Number} - * @api private - */ - -function selectColor() { - return exports.colors[prevColor++ % exports.colors.length]; -} - -/** - * Create a debugger with the given `namespace`. - * - * @param {String} namespace - * @return {Function} - * @api public - */ - -function debug(namespace) { - - // define the `disabled` version - function disabled() { - } - disabled.enabled = false; - - // define the `enabled` version - function enabled() { - - var self = enabled; - - // set `diff` timestamp - var curr = +new Date(); - var ms = curr - (prevTime || curr); - self.diff = ms; - self.prev = prevTime; - self.curr = curr; - prevTime = curr; - - // add the `color` if not set - if (null == self.useColors) self.useColors = exports.useColors(); - if (null == self.color && self.useColors) self.color = selectColor(); - - var args = Array.prototype.slice.call(arguments); - - args[0] = exports.coerce(args[0]); - - if ('string' !== typeof args[0]) { - // anything else let's inspect with %o - args = ['%o'].concat(args); - } - - // apply any `formatters` transformations - var index = 0; - args[0] = args[0].replace(/%([a-z%])/g, function(match, format) { - // if we encounter an escaped % then don't increase the array index - if (match === '%%') return match; - index++; - var formatter = exports.formatters[format]; - if ('function' === typeof formatter) { - var val = args[index]; - match = formatter.call(self, val); - - // now we need to remove `args[index]` since it's inlined in the `format` - args.splice(index, 1); - index--; - } - return match; - }); - - if ('function' === typeof exports.formatArgs) { - args = exports.formatArgs.apply(self, args); - } - var logFn = enabled.log || exports.log || console.log.bind(console); - logFn.apply(self, args); - } - enabled.enabled = true; - - var fn = exports.enabled(namespace) ? enabled : disabled; - - fn.namespace = namespace; - - return fn; -} - -/** - * Enables a debug mode by namespaces. This can include modes - * separated by a colon and wildcards. - * - * @param {String} namespaces - * @api public - */ - -function enable(namespaces) { - exports.save(namespaces); - - var split = (namespaces || '').split(/[\s,]+/); - var len = split.length; - - for (var i = 0; i < len; i++) { - if (!split[i]) continue; // ignore empty strings - namespaces = split[i].replace(/\*/g, '.*?'); - if (namespaces[0] === '-') { - exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); - } else { - exports.names.push(new RegExp('^' + namespaces + '$')); - } - } -} - -/** - * Disable debug output. - * - * @api public - */ - -function disable() { - exports.enable(''); -} - -/** - * Returns true if the given mode name is enabled, false otherwise. - * - * @param {String} name - * @return {Boolean} - * @api public - */ - -function enabled(name) { - var i, len; - for (i = 0, len = exports.skips.length; i < len; i++) { - if (exports.skips[i].test(name)) { - return false; - } - } - for (i = 0, len = exports.names.length; i < len; i++) { - if (exports.names[i].test(name)) { - return true; - } - } - return false; -} - -/** - * Coerce `val`. - * - * @param {Mixed} val - * @return {Mixed} - * @api private - */ - -function coerce(val) { - if (val instanceof Error) return val.stack || val.message; - return val; -} diff --git a/node_modules/send/node_modules/debug/node.js b/node_modules/send/node_modules/debug/node.js deleted file mode 100644 index 1d392a8..0000000 --- a/node_modules/send/node_modules/debug/node.js +++ /dev/null @@ -1,209 +0,0 @@ - -/** - * Module dependencies. - */ - -var tty = require('tty'); -var util = require('util'); - -/** - * This is the Node.js implementation of `debug()`. - * - * Expose `debug()` as the module. - */ - -exports = module.exports = require('./debug'); -exports.log = log; -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; - -/** - * Colors. - */ - -exports.colors = [6, 2, 3, 4, 5, 1]; - -/** - * The file descriptor to write the `debug()` calls to. - * Set the `DEBUG_FD` env variable to override with another value. i.e.: - * - * $ DEBUG_FD=3 node script.js 3>debug.log - */ - -var fd = parseInt(process.env.DEBUG_FD, 10) || 2; -var stream = 1 === fd ? process.stdout : - 2 === fd ? process.stderr : - createWritableStdioStream(fd); - -/** - * Is stdout a TTY? Colored output is enabled when `true`. - */ - -function useColors() { - var debugColors = (process.env.DEBUG_COLORS || '').trim().toLowerCase(); - if (0 === debugColors.length) { - return tty.isatty(fd); - } else { - return '0' !== debugColors - && 'no' !== debugColors - && 'false' !== debugColors - && 'disabled' !== debugColors; - } -} - -/** - * Map %o to `util.inspect()`, since Node doesn't do that out of the box. - */ - -var inspect = (4 === util.inspect.length ? - // node <= 0.8.x - function (v, colors) { - return util.inspect(v, void 0, void 0, colors); - } : - // node > 0.8.x - function (v, colors) { - return util.inspect(v, { colors: colors }); - } -); - -exports.formatters.o = function(v) { - return inspect(v, this.useColors) - .replace(/\s*\n\s*/g, ' '); -}; - -/** - * Adds ANSI color escape codes if enabled. - * - * @api public - */ - -function formatArgs() { - var args = arguments; - var useColors = this.useColors; - var name = this.namespace; - - if (useColors) { - var c = this.color; - - args[0] = ' \u001b[3' + c + ';1m' + name + ' ' - + '\u001b[0m' - + args[0] + '\u001b[3' + c + 'm' - + ' +' + exports.humanize(this.diff) + '\u001b[0m'; - } else { - args[0] = new Date().toUTCString() - + ' ' + name + ' ' + args[0]; - } - return args; -} - -/** - * Invokes `console.error()` with the specified arguments. - */ - -function log() { - return stream.write(util.format.apply(this, arguments) + '\n'); -} - -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ - -function save(namespaces) { - if (null == namespaces) { - // If you set a process.env field to null or undefined, it gets cast to the - // string 'null' or 'undefined'. Just delete instead. - delete process.env.DEBUG; - } else { - process.env.DEBUG = namespaces; - } -} - -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ - -function load() { - return process.env.DEBUG; -} - -/** - * Copied from `node/src/node.js`. - * - * XXX: It's lame that node doesn't expose this API out-of-the-box. It also - * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame. - */ - -function createWritableStdioStream (fd) { - var stream; - var tty_wrap = process.binding('tty_wrap'); - - // Note stream._type is used for test-module-load-list.js - - switch (tty_wrap.guessHandleType(fd)) { - case 'TTY': - stream = new tty.WriteStream(fd); - stream._type = 'tty'; - - // Hack to have stream not keep the event loop alive. - // See https://github.com/joyent/node/issues/1726 - if (stream._handle && stream._handle.unref) { - stream._handle.unref(); - } - break; - - case 'FILE': - var fs = require('fs'); - stream = new fs.SyncWriteStream(fd, { autoClose: false }); - stream._type = 'fs'; - break; - - case 'PIPE': - case 'TCP': - var net = require('net'); - stream = new net.Socket({ - fd: fd, - readable: false, - writable: true - }); - - // FIXME Should probably have an option in net.Socket to create a - // stream from an existing fd which is writable only. But for now - // we'll just add this hack and set the `readable` member to false. - // Test: ./node test/fixtures/echo.js < /etc/passwd - stream.readable = false; - stream.read = null; - stream._type = 'pipe'; - - // FIXME Hack to have stream not keep the event loop alive. - // See https://github.com/joyent/node/issues/1726 - if (stream._handle && stream._handle.unref) { - stream._handle.unref(); - } - break; - - default: - // Probably an error on in uv_guess_handle() - throw new Error('Implement me. Unknown stream file type!'); - } - - // For supporting legacy API we put the FD here. - stream.fd = fd; - - stream._isStdio = true; - - return stream; -} - -/** - * Enable namespaces listed in `process.env.DEBUG` initially. - */ - -exports.enable(load()); diff --git a/node_modules/send/node_modules/debug/package.json b/node_modules/send/node_modules/debug/package.json deleted file mode 100644 index b9f033a..0000000 --- a/node_modules/send/node_modules/debug/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "debug", - "version": "2.2.0", - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/debug.git" - }, - "description": "small debugging utility", - "keywords": [ - "debug", - "log", - "debugger" - ], - "author": "TJ Holowaychuk ", - "contributors": [ - "Nathan Rajlich (http://n8.io)" - ], - "license": "MIT", - "dependencies": { - "ms": "0.7.1" - }, - "devDependencies": { - "browserify": "9.0.3", - "mocha": "*" - }, - "main": "./node.js", - "browser": "./browser.js", - "component": { - "scripts": { - "debug/index.js": "browser.js", - "debug/debug.js": "debug.js" - } - } -} diff --git a/node_modules/send/node_modules/depd/History.md b/node_modules/send/node_modules/depd/History.md deleted file mode 100644 index 4a36a6c..0000000 --- a/node_modules/send/node_modules/depd/History.md +++ /dev/null @@ -1,75 +0,0 @@ -1.0.1 / 2015-04-07 -================== - - * Fix `TypeError`s when under `'use strict'` code - * Fix useless type name on auto-generated messages - * Support io.js 1.x - * Support Node.js 0.12 - -1.0.0 / 2014-09-17 -================== - - * No changes - -0.4.5 / 2014-09-09 -================== - - * Improve call speed to functions using the function wrapper - * Support Node.js 0.6 - -0.4.4 / 2014-07-27 -================== - - * Work-around v8 generating empty stack traces - -0.4.3 / 2014-07-26 -================== - - * Fix exception when global `Error.stackTraceLimit` is too low - -0.4.2 / 2014-07-19 -================== - - * Correct call site for wrapped functions and properties - -0.4.1 / 2014-07-19 -================== - - * Improve automatic message generation for function properties - -0.4.0 / 2014-07-19 -================== - - * Add `TRACE_DEPRECATION` environment variable - * Remove non-standard grey color from color output - * Support `--no-deprecation` argument - * Support `--trace-deprecation` argument - * Support `deprecate.property(fn, prop, message)` - -0.3.0 / 2014-06-16 -================== - - * Add `NO_DEPRECATION` environment variable - -0.2.0 / 2014-06-15 -================== - - * Add `deprecate.property(obj, prop, message)` - * Remove `supports-color` dependency for node.js 0.8 - -0.1.0 / 2014-06-15 -================== - - * Add `deprecate.function(fn, message)` - * Add `process.on('deprecation', fn)` emitter - * Automatically generate message when omitted from `deprecate()` - -0.0.1 / 2014-06-15 -================== - - * Fix warning for dynamic calls at singe call site - -0.0.0 / 2014-06-15 -================== - - * Initial implementation diff --git a/node_modules/send/node_modules/depd/Readme.md b/node_modules/send/node_modules/depd/Readme.md deleted file mode 100644 index 5ead5da..0000000 --- a/node_modules/send/node_modules/depd/Readme.md +++ /dev/null @@ -1,274 +0,0 @@ -# depd - -[![NPM Version][npm-version-image]][npm-url] -[![NPM Downloads][npm-downloads-image]][npm-url] -[![Node.js Version][node-image]][node-url] -[![Linux Build][travis-image]][travis-url] -[![Windows Build][appveyor-image]][appveyor-url] -[![Coverage Status][coveralls-image]][coveralls-url] -[![Gratipay][gratipay-image]][gratipay-url] - -Deprecate all the things - -> With great modules comes great responsibility; mark things deprecated! - -## Install - -```sh -$ npm install depd -``` - -## API - -```js -var deprecate = require('depd')('my-module') -``` - -This library allows you to display deprecation messages to your users. -This library goes above and beyond with deprecation warnings by -introspection of the call stack (but only the bits that it is interested -in). - -Instead of just warning on the first invocation of a deprecated -function and never again, this module will warn on the first invocation -of a deprecated function per unique call site, making it ideal to alert -users of all deprecated uses across the code base, rather than just -whatever happens to execute first. - -The deprecation warnings from this module also include the file and line -information for the call into the module that the deprecated function was -in. - -**NOTE** this library has a similar interface to the `debug` module, and -this module uses the calling file to get the boundary for the call stacks, -so you should always create a new `deprecate` object in each file and not -within some central file. - -### depd(namespace) - -Create a new deprecate function that uses the given namespace name in the -messages and will display the call site prior to the stack entering the -file this function was called from. It is highly suggested you use the -name of your module as the namespace. - -### deprecate(message) - -Call this function from deprecated code to display a deprecation message. -This message will appear once per unique caller site. Caller site is the -first call site in the stack in a different file from the caller of this -function. - -If the message is omitted, a message is generated for you based on the site -of the `deprecate()` call and will display the name of the function called, -similar to the name displayed in a stack trace. - -### deprecate.function(fn, message) - -Call this function to wrap a given function in a deprecation message on any -call to the function. An optional message can be supplied to provide a custom -message. - -### deprecate.property(obj, prop, message) - -Call this function to wrap a given property on object in a deprecation message -on any accessing or setting of the property. An optional message can be supplied -to provide a custom message. - -The method must be called on the object where the property belongs (not -inherited from the prototype). - -If the property is a data descriptor, it will be converted to an accessor -descriptor in order to display the deprecation message. - -### process.on('deprecation', fn) - -This module will allow easy capturing of deprecation errors by emitting the -errors as the type "deprecation" on the global `process`. If there are no -listeners for this type, the errors are written to STDERR as normal, but if -there are any listeners, nothing will be written to STDERR and instead only -emitted. From there, you can write the errors in a different format or to a -logging source. - -The error represents the deprecation and is emitted only once with the same -rules as writing to STDERR. The error has the following properties: - - - `message` - This is the message given by the library - - `name` - This is always `'DeprecationError'` - - `namespace` - This is the namespace the deprecation came from - - `stack` - This is the stack of the call to the deprecated thing - -Example `error.stack` output: - -``` -DeprecationError: my-cool-module deprecated oldfunction - at Object. ([eval]-wrapper:6:22) - at Module._compile (module.js:456:26) - at evalScript (node.js:532:25) - at startup (node.js:80:7) - at node.js:902:3 -``` - -### process.env.NO_DEPRECATION - -As a user of modules that are deprecated, the environment variable `NO_DEPRECATION` -is provided as a quick solution to silencing deprecation warnings from being -output. The format of this is similar to that of `DEBUG`: - -```sh -$ NO_DEPRECATION=my-module,othermod node app.js -``` - -This will suppress deprecations from being output for "my-module" and "othermod". -The value is a list of comma-separated namespaces. To suppress every warning -across all namespaces, use the value `*` for a namespace. - -Providing the argument `--no-deprecation` to the `node` executable will suppress -all deprecations (only available in Node.js 0.8 or higher). - -**NOTE** This will not suppress the deperecations given to any "deprecation" -event listeners, just the output to STDERR. - -### process.env.TRACE_DEPRECATION - -As a user of modules that are deprecated, the environment variable `TRACE_DEPRECATION` -is provided as a solution to getting more detailed location information in deprecation -warnings by including the entire stack trace. The format of this is the same as -`NO_DEPRECATION`: - -```sh -$ TRACE_DEPRECATION=my-module,othermod node app.js -``` - -This will include stack traces for deprecations being output for "my-module" and -"othermod". The value is a list of comma-separated namespaces. To trace every -warning across all namespaces, use the value `*` for a namespace. - -Providing the argument `--trace-deprecation` to the `node` executable will trace -all deprecations (only available in Node.js 0.8 or higher). - -**NOTE** This will not trace the deperecations silenced by `NO_DEPRECATION`. - -## Display - -![message](files/message.png) - -When a user calls a function in your library that you mark deprecated, they -will see the following written to STDERR (in the given colors, similar colors -and layout to the `debug` module): - -``` -bright cyan bright yellow -| | reset cyan -| | | | -▼ ▼ ▼ ▼ -my-cool-module deprecated oldfunction [eval]-wrapper:6:22 -▲ ▲ ▲ ▲ -| | | | -namespace | | location of mycoolmod.oldfunction() call - | deprecation message - the word "deprecated" -``` - -If the user redirects their STDERR to a file or somewhere that does not support -colors, they see (similar layout to the `debug` module): - -``` -Sun, 15 Jun 2014 05:21:37 GMT my-cool-module deprecated oldfunction at [eval]-wrapper:6:22 -▲ ▲ ▲ ▲ ▲ -| | | | | -timestamp of message namespace | | location of mycoolmod.oldfunction() call - | deprecation message - the word "deprecated" -``` - -## Examples - -### Deprecating all calls to a function - -This will display a deprecated message about "oldfunction" being deprecated -from "my-module" on STDERR. - -```js -var deprecate = require('depd')('my-cool-module') - -// message automatically derived from function name -// Object.oldfunction -exports.oldfunction = deprecate.function(function oldfunction() { - // all calls to function are deprecated -}) - -// specific message -exports.oldfunction = deprecate.function(function () { - // all calls to function are deprecated -}, 'oldfunction') -``` - -### Conditionally deprecating a function call - -This will display a deprecated message about "weirdfunction" being deprecated -from "my-module" on STDERR when called with less than 2 arguments. - -```js -var deprecate = require('depd')('my-cool-module') - -exports.weirdfunction = function () { - if (arguments.length < 2) { - // calls with 0 or 1 args are deprecated - deprecate('weirdfunction args < 2') - } -} -``` - -When calling `deprecate` as a function, the warning is counted per call site -within your own module, so you can display different deprecations depending -on different situations and the users will still get all the warnings: - -```js -var deprecate = require('depd')('my-cool-module') - -exports.weirdfunction = function () { - if (arguments.length < 2) { - // calls with 0 or 1 args are deprecated - deprecate('weirdfunction args < 2') - } else if (typeof arguments[0] !== 'string') { - // calls with non-string first argument are deprecated - deprecate('weirdfunction non-string first arg') - } -} -``` - -### Deprecating property access - -This will display a deprecated message about "oldprop" being deprecated -from "my-module" on STDERR when accessed. A deprecation will be displayed -when setting the value and when getting the value. - -```js -var deprecate = require('depd')('my-cool-module') - -exports.oldprop = 'something' - -// message automatically derives from property name -deprecate.property(exports, 'oldprop') - -// explicit message -deprecate.property(exports, 'oldprop', 'oldprop >= 0.10') -``` - -## License - -[MIT](LICENSE) - -[npm-version-image]: https://img.shields.io/npm/v/depd.svg -[npm-downloads-image]: https://img.shields.io/npm/dm/depd.svg -[npm-url]: https://npmjs.org/package/depd -[travis-image]: https://img.shields.io/travis/dougwilson/nodejs-depd/master.svg?label=linux -[travis-url]: https://travis-ci.org/dougwilson/nodejs-depd -[appveyor-image]: https://img.shields.io/appveyor/ci/dougwilson/nodejs-depd/master.svg?label=windows -[appveyor-url]: https://ci.appveyor.com/project/dougwilson/nodejs-depd -[coveralls-image]: https://img.shields.io/coveralls/dougwilson/nodejs-depd/master.svg -[coveralls-url]: https://coveralls.io/r/dougwilson/nodejs-depd?branch=master -[node-image]: https://img.shields.io/node/v/depd.svg -[node-url]: http://nodejs.org/download/ -[gratipay-image]: https://img.shields.io/gratipay/dougwilson.svg -[gratipay-url]: https://www.gratipay.com/dougwilson/ diff --git a/node_modules/send/node_modules/depd/index.js b/node_modules/send/node_modules/depd/index.js deleted file mode 100644 index d183b0a..0000000 --- a/node_modules/send/node_modules/depd/index.js +++ /dev/null @@ -1,529 +0,0 @@ -/*! - * depd - * Copyright(c) 2014 Douglas Christopher Wilson - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var callSiteToString = require('./lib/compat').callSiteToString -var EventEmitter = require('events').EventEmitter -var relative = require('path').relative - -/** - * Module exports. - */ - -module.exports = depd - -/** - * Get the path to base files on. - */ - -var basePath = process.cwd() - -/** - * Get listener count on event emitter. - */ - -/*istanbul ignore next*/ -var eventListenerCount = EventEmitter.listenerCount - || function (emitter, type) { return emitter.listeners(type).length } - -/** - * Determine if namespace is contained in the string. - */ - -function containsNamespace(str, namespace) { - var val = str.split(/[ ,]+/) - - namespace = String(namespace).toLowerCase() - - for (var i = 0 ; i < val.length; i++) { - if (!(str = val[i])) continue; - - // namespace contained - if (str === '*' || str.toLowerCase() === namespace) { - return true - } - } - - return false -} - -/** - * Convert a data descriptor to accessor descriptor. - */ - -function convertDataDescriptorToAccessor(obj, prop, message) { - var descriptor = Object.getOwnPropertyDescriptor(obj, prop) - var value = descriptor.value - - descriptor.get = function getter() { return value } - - if (descriptor.writable) { - descriptor.set = function setter(val) { return value = val } - } - - delete descriptor.value - delete descriptor.writable - - Object.defineProperty(obj, prop, descriptor) - - return descriptor -} - -/** - * Create arguments string to keep arity. - */ - -function createArgumentsString(arity) { - var str = '' - - for (var i = 0; i < arity; i++) { - str += ', arg' + i - } - - return str.substr(2) -} - -/** - * Create stack string from stack. - */ - -function createStackString(stack) { - var str = this.name + ': ' + this.namespace - - if (this.message) { - str += ' deprecated ' + this.message - } - - for (var i = 0; i < stack.length; i++) { - str += '\n at ' + callSiteToString(stack[i]) - } - - return str -} - -/** - * Create deprecate for namespace in caller. - */ - -function depd(namespace) { - if (!namespace) { - throw new TypeError('argument namespace is required') - } - - var stack = getStack() - var site = callSiteLocation(stack[1]) - var file = site[0] - - function deprecate(message) { - // call to self as log - log.call(deprecate, message) - } - - deprecate._file = file - deprecate._ignored = isignored(namespace) - deprecate._namespace = namespace - deprecate._traced = istraced(namespace) - deprecate._warned = Object.create(null) - - deprecate.function = wrapfunction - deprecate.property = wrapproperty - - return deprecate -} - -/** - * Determine if namespace is ignored. - */ - -function isignored(namespace) { - /* istanbul ignore next: tested in a child processs */ - if (process.noDeprecation) { - // --no-deprecation support - return true - } - - var str = process.env.NO_DEPRECATION || '' - - // namespace ignored - return containsNamespace(str, namespace) -} - -/** - * Determine if namespace is traced. - */ - -function istraced(namespace) { - /* istanbul ignore next: tested in a child processs */ - if (process.traceDeprecation) { - // --trace-deprecation support - return true - } - - var str = process.env.TRACE_DEPRECATION || '' - - // namespace traced - return containsNamespace(str, namespace) -} - -/** - * Display deprecation message. - */ - -function log(message, site) { - var haslisteners = eventListenerCount(process, 'deprecation') !== 0 - - // abort early if no destination - if (!haslisteners && this._ignored) { - return - } - - var caller - var callFile - var callSite - var i = 0 - var seen = false - var stack = getStack() - var file = this._file - - if (site) { - // provided site - callSite = callSiteLocation(stack[1]) - callSite.name = site.name - file = callSite[0] - } else { - // get call site - i = 2 - site = callSiteLocation(stack[i]) - callSite = site - } - - // get caller of deprecated thing in relation to file - for (; i < stack.length; i++) { - caller = callSiteLocation(stack[i]) - callFile = caller[0] - - if (callFile === file) { - seen = true - } else if (callFile === this._file) { - file = this._file - } else if (seen) { - break - } - } - - var key = caller - ? site.join(':') + '__' + caller.join(':') - : undefined - - if (key !== undefined && key in this._warned) { - // already warned - return - } - - this._warned[key] = true - - // generate automatic message from call site - if (!message) { - message = callSite === site || !callSite.name - ? defaultMessage(site) - : defaultMessage(callSite) - } - - // emit deprecation if listeners exist - if (haslisteners) { - var err = DeprecationError(this._namespace, message, stack.slice(i)) - process.emit('deprecation', err) - return - } - - // format and write message - var format = process.stderr.isTTY - ? formatColor - : formatPlain - var msg = format.call(this, message, caller, stack.slice(i)) - process.stderr.write(msg + '\n', 'utf8') - - return -} - -/** - * Get call site location as array. - */ - -function callSiteLocation(callSite) { - var file = callSite.getFileName() || '' - var line = callSite.getLineNumber() - var colm = callSite.getColumnNumber() - - if (callSite.isEval()) { - file = callSite.getEvalOrigin() + ', ' + file - } - - var site = [file, line, colm] - - site.callSite = callSite - site.name = callSite.getFunctionName() - - return site -} - -/** - * Generate a default message from the site. - */ - -function defaultMessage(site) { - var callSite = site.callSite - var funcName = site.name - - // make useful anonymous name - if (!funcName) { - funcName = '' - } - - var context = callSite.getThis() - var typeName = context && callSite.getTypeName() - - // ignore useless type name - if (typeName === 'Object') { - typeName = undefined - } - - // make useful type name - if (typeName === 'Function') { - typeName = context.name || typeName - } - - return typeName && callSite.getMethodName() - ? typeName + '.' + funcName - : funcName -} - -/** - * Format deprecation message without color. - */ - -function formatPlain(msg, caller, stack) { - var timestamp = new Date().toUTCString() - - var formatted = timestamp - + ' ' + this._namespace - + ' deprecated ' + msg - - // add stack trace - if (this._traced) { - for (var i = 0; i < stack.length; i++) { - formatted += '\n at ' + callSiteToString(stack[i]) - } - - return formatted - } - - if (caller) { - formatted += ' at ' + formatLocation(caller) - } - - return formatted -} - -/** - * Format deprecation message with color. - */ - -function formatColor(msg, caller, stack) { - var formatted = '\x1b[36;1m' + this._namespace + '\x1b[22;39m' // bold cyan - + ' \x1b[33;1mdeprecated\x1b[22;39m' // bold yellow - + ' \x1b[0m' + msg + '\x1b[39m' // reset - - // add stack trace - if (this._traced) { - for (var i = 0; i < stack.length; i++) { - formatted += '\n \x1b[36mat ' + callSiteToString(stack[i]) + '\x1b[39m' // cyan - } - - return formatted - } - - if (caller) { - formatted += ' \x1b[36m' + formatLocation(caller) + '\x1b[39m' // cyan - } - - return formatted -} - -/** - * Format call site location. - */ - -function formatLocation(callSite) { - return relative(basePath, callSite[0]) - + ':' + callSite[1] - + ':' + callSite[2] -} - -/** - * Get the stack as array of call sites. - */ - -function getStack() { - var limit = Error.stackTraceLimit - var obj = {} - var prep = Error.prepareStackTrace - - Error.prepareStackTrace = prepareObjectStackTrace - Error.stackTraceLimit = Math.max(10, limit) - - // capture the stack - Error.captureStackTrace(obj) - - // slice this function off the top - var stack = obj.stack.slice(1) - - Error.prepareStackTrace = prep - Error.stackTraceLimit = limit - - return stack -} - -/** - * Capture call site stack from v8. - */ - -function prepareObjectStackTrace(obj, stack) { - return stack -} - -/** - * Return a wrapped function in a deprecation message. - */ - -function wrapfunction(fn, message) { - if (typeof fn !== 'function') { - throw new TypeError('argument fn must be a function') - } - - var args = createArgumentsString(fn.length) - var deprecate = this - var stack = getStack() - var site = callSiteLocation(stack[1]) - - site.name = fn.name - - var deprecatedfn = eval('(function (' + args + ') {\n' - + '"use strict"\n' - + 'log.call(deprecate, message, site)\n' - + 'return fn.apply(this, arguments)\n' - + '})') - - return deprecatedfn -} - -/** - * Wrap property in a deprecation message. - */ - -function wrapproperty(obj, prop, message) { - if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) { - throw new TypeError('argument obj must be object') - } - - var descriptor = Object.getOwnPropertyDescriptor(obj, prop) - - if (!descriptor) { - throw new TypeError('must call property on owner object') - } - - if (!descriptor.configurable) { - throw new TypeError('property must be configurable') - } - - var deprecate = this - var stack = getStack() - var site = callSiteLocation(stack[1]) - - // set site name - site.name = prop - - // convert data descriptor - if ('value' in descriptor) { - descriptor = convertDataDescriptorToAccessor(obj, prop, message) - } - - var get = descriptor.get - var set = descriptor.set - - // wrap getter - if (typeof get === 'function') { - descriptor.get = function getter() { - log.call(deprecate, message, site) - return get.apply(this, arguments) - } - } - - // wrap setter - if (typeof set === 'function') { - descriptor.set = function setter() { - log.call(deprecate, message, site) - return set.apply(this, arguments) - } - } - - Object.defineProperty(obj, prop, descriptor) -} - -/** - * Create DeprecationError for deprecation - */ - -function DeprecationError(namespace, message, stack) { - var error = new Error() - var stackString - - Object.defineProperty(error, 'constructor', { - value: DeprecationError - }) - - Object.defineProperty(error, 'message', { - configurable: true, - enumerable: false, - value: message, - writable: true - }) - - Object.defineProperty(error, 'name', { - enumerable: false, - configurable: true, - value: 'DeprecationError', - writable: true - }) - - Object.defineProperty(error, 'namespace', { - configurable: true, - enumerable: false, - value: namespace, - writable: true - }) - - Object.defineProperty(error, 'stack', { - configurable: true, - enumerable: false, - get: function () { - if (stackString !== undefined) { - return stackString - } - - // prepare stack trace - return stackString = createStackString.call(this, stack) - }, - set: function setter(val) { - stackString = val - } - }) - - return error -} diff --git a/node_modules/send/node_modules/depd/lib/compat/buffer-concat.js b/node_modules/send/node_modules/depd/lib/compat/buffer-concat.js deleted file mode 100644 index 09d9721..0000000 --- a/node_modules/send/node_modules/depd/lib/compat/buffer-concat.js +++ /dev/null @@ -1,33 +0,0 @@ -/*! - * depd - * Copyright(c) 2014 Douglas Christopher Wilson - * MIT Licensed - */ - -/** - * Module exports. - */ - -module.exports = bufferConcat - -/** - * Concatenate an array of Buffers. - */ - -function bufferConcat(bufs) { - var length = 0 - - for (var i = 0, len = bufs.length; i < len; i++) { - length += bufs[i].length - } - - var buf = new Buffer(length) - var pos = 0 - - for (var i = 0, len = bufs.length; i < len; i++) { - bufs[i].copy(buf, pos) - pos += bufs[i].length - } - - return buf -} diff --git a/node_modules/send/node_modules/depd/lib/compat/callsite-tostring.js b/node_modules/send/node_modules/depd/lib/compat/callsite-tostring.js deleted file mode 100644 index 17cf7ed..0000000 --- a/node_modules/send/node_modules/depd/lib/compat/callsite-tostring.js +++ /dev/null @@ -1,101 +0,0 @@ -/*! - * depd - * Copyright(c) 2014 Douglas Christopher Wilson - * MIT Licensed - */ - -/** - * Module exports. - */ - -module.exports = callSiteToString - -/** - * Format a CallSite file location to a string. - */ - -function callSiteFileLocation(callSite) { - var fileName - var fileLocation = '' - - if (callSite.isNative()) { - fileLocation = 'native' - } else if (callSite.isEval()) { - fileName = callSite.getScriptNameOrSourceURL() - if (!fileName) { - fileLocation = callSite.getEvalOrigin() - } - } else { - fileName = callSite.getFileName() - } - - if (fileName) { - fileLocation += fileName - - var lineNumber = callSite.getLineNumber() - if (lineNumber != null) { - fileLocation += ':' + lineNumber - - var columnNumber = callSite.getColumnNumber() - if (columnNumber) { - fileLocation += ':' + columnNumber - } - } - } - - return fileLocation || 'unknown source' -} - -/** - * Format a CallSite to a string. - */ - -function callSiteToString(callSite) { - var addSuffix = true - var fileLocation = callSiteFileLocation(callSite) - var functionName = callSite.getFunctionName() - var isConstructor = callSite.isConstructor() - var isMethodCall = !(callSite.isToplevel() || isConstructor) - var line = '' - - if (isMethodCall) { - var methodName = callSite.getMethodName() - var typeName = getConstructorName(callSite) - - if (functionName) { - if (typeName && functionName.indexOf(typeName) !== 0) { - line += typeName + '.' - } - - line += functionName - - if (methodName && functionName.lastIndexOf('.' + methodName) !== functionName.length - methodName.length - 1) { - line += ' [as ' + methodName + ']' - } - } else { - line += typeName + '.' + (methodName || '') - } - } else if (isConstructor) { - line += 'new ' + (functionName || '') - } else if (functionName) { - line += functionName - } else { - addSuffix = false - line += fileLocation - } - - if (addSuffix) { - line += ' (' + fileLocation + ')' - } - - return line -} - -/** - * Get constructor name of reviver. - */ - -function getConstructorName(obj) { - var receiver = obj.receiver - return (receiver.constructor && receiver.constructor.name) || null -} diff --git a/node_modules/send/node_modules/depd/lib/compat/index.js b/node_modules/send/node_modules/depd/lib/compat/index.js deleted file mode 100644 index 7fee026..0000000 --- a/node_modules/send/node_modules/depd/lib/compat/index.js +++ /dev/null @@ -1,69 +0,0 @@ -/*! - * depd - * Copyright(c) 2014 Douglas Christopher Wilson - * MIT Licensed - */ - -/** - * Module exports. - */ - -lazyProperty(module.exports, 'bufferConcat', function bufferConcat() { - return Buffer.concat || require('./buffer-concat') -}) - -lazyProperty(module.exports, 'callSiteToString', function callSiteToString() { - var limit = Error.stackTraceLimit - var obj = {} - var prep = Error.prepareStackTrace - - function prepareObjectStackTrace(obj, stack) { - return stack - } - - Error.prepareStackTrace = prepareObjectStackTrace - Error.stackTraceLimit = 2 - - // capture the stack - Error.captureStackTrace(obj) - - // slice the stack - var stack = obj.stack.slice() - - Error.prepareStackTrace = prep - Error.stackTraceLimit = limit - - return stack[0].toString ? toString : require('./callsite-tostring') -}) - -/** - * Define a lazy property. - */ - -function lazyProperty(obj, prop, getter) { - function get() { - var val = getter() - - Object.defineProperty(obj, prop, { - configurable: true, - enumerable: true, - value: val - }) - - return val - } - - Object.defineProperty(obj, prop, { - configurable: true, - enumerable: true, - get: get - }) -} - -/** - * Call toString() on the obj - */ - -function toString(obj) { - return obj.toString() -} diff --git a/node_modules/send/node_modules/depd/package.json b/node_modules/send/node_modules/depd/package.json deleted file mode 100644 index 9e9e402..0000000 --- a/node_modules/send/node_modules/depd/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "depd", - "description": "Deprecate all the things", - "version": "1.0.1", - "author": "Douglas Christopher Wilson ", - "license": "MIT", - "keywords": [ - "deprecate", - "deprecated" - ], - "repository": "dougwilson/nodejs-depd", - "devDependencies": { - "benchmark": "1.0.0", - "beautify-benchmark": "0.2.4", - "istanbul": "0.3.5", - "mocha": "~1.21.5" - }, - "files": [ - "lib/", - "History.md", - "LICENSE", - "index.js", - "Readme.md" - ], - "engines": { - "node": ">= 0.6" - }, - "scripts": { - "bench": "node benchmark/index.js", - "test": "mocha --reporter spec --bail test/", - "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --no-exit test/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/" - } -} diff --git a/node_modules/send/node_modules/destroy/README.md b/node_modules/send/node_modules/destroy/README.md deleted file mode 100644 index 665acb7..0000000 --- a/node_modules/send/node_modules/destroy/README.md +++ /dev/null @@ -1,38 +0,0 @@ -# Destroy - -[![NPM version][npm-image]][npm-url] -[![Build status][travis-image]][travis-url] -[![Test coverage][coveralls-image]][coveralls-url] -[![Dependency Status][david-image]][david-url] -[![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] -[![Gittip][gittip-image]][gittip-url] - -Destroy a stream. - -## API - -```js -var destroy = require('destroy') - -var fs = require('fs') -var stream = fs.createReadStream('package.json') -destroy(stream) -``` - -[npm-image]: https://img.shields.io/npm/v/destroy.svg?style=flat-square -[npm-url]: https://npmjs.org/package/destroy -[github-tag]: http://img.shields.io/github/tag/stream-utils/destroy.svg?style=flat-square -[github-url]: https://github.com/stream-utils/destroy/tags -[travis-image]: https://img.shields.io/travis/stream-utils/destroy.svg?style=flat-square -[travis-url]: https://travis-ci.org/stream-utils/destroy -[coveralls-image]: https://img.shields.io/coveralls/stream-utils/destroy.svg?style=flat-square -[coveralls-url]: https://coveralls.io/r/stream-utils/destroy?branch=master -[david-image]: http://img.shields.io/david/stream-utils/destroy.svg?style=flat-square -[david-url]: https://david-dm.org/stream-utils/destroy -[license-image]: http://img.shields.io/npm/l/destroy.svg?style=flat-square -[license-url]: LICENSE.md -[downloads-image]: http://img.shields.io/npm/dm/destroy.svg?style=flat-square -[downloads-url]: https://npmjs.org/package/destroy -[gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square -[gittip-url]: https://www.gittip.com/jonathanong/ diff --git a/node_modules/send/node_modules/destroy/index.js b/node_modules/send/node_modules/destroy/index.js deleted file mode 100644 index b455217..0000000 --- a/node_modules/send/node_modules/destroy/index.js +++ /dev/null @@ -1,36 +0,0 @@ -var ReadStream = require('fs').ReadStream -var Stream = require('stream') - -module.exports = function destroy(stream) { - if (stream instanceof ReadStream) { - return destroyReadStream(stream) - } - - if (!(stream instanceof Stream)) { - return stream - } - - if (typeof stream.destroy === 'function') { - stream.destroy() - } - - return stream -} - -function destroyReadStream(stream) { - stream.destroy() - - if (typeof stream.close === 'function') { - // node.js core bug work-around - stream.on('open', onopenClose) - } - - return stream -} - -function onopenClose() { - if (typeof this.fd === 'number') { - // actually close down the fd - this.close() - } -} diff --git a/node_modules/send/node_modules/destroy/package.json b/node_modules/send/node_modules/destroy/package.json deleted file mode 100644 index e7f3c42..0000000 --- a/node_modules/send/node_modules/destroy/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "destroy", - "description": "destroy a stream if possible", - "version": "1.0.3", - "author": { - "name": "Jonathan Ong", - "email": "me@jongleberry.com", - "url": "http://jongleberry.com", - "twitter": "https://twitter.com/jongleberry" - }, - "contributors": [ - "Douglas Christopher Wilson " - ], - "license": "MIT", - "repository": "stream-utils/destroy", - "devDependencies": { - "istanbul": "0", - "mocha": "1" - }, - "scripts": { - "test": "mocha --reporter spec", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot" - }, - "files": [ - "index.js" - ], - "keywords": [ - "stream", - "streams", - "destroy", - "cleanup", - "leak", - "fd" - ] -} diff --git a/node_modules/send/node_modules/http-errors/HISTORY.md b/node_modules/send/node_modules/http-errors/HISTORY.md deleted file mode 100644 index 4c7087d..0000000 --- a/node_modules/send/node_modules/http-errors/HISTORY.md +++ /dev/null @@ -1,76 +0,0 @@ -2015-02-02 / 1.3.1 -================== - - * Fix regression where status can be overwritten in `createError` `props` - -2015-02-01 / 1.3.0 -================== - - * Construct errors using defined constructors from `createError` - * Fix error names that are not identifiers - - `createError["I'mateapot"]` is now `createError.ImATeapot` - * Set a meaningful `name` property on constructed errors - -2014-12-09 / 1.2.8 -================== - - * Fix stack trace from exported function - * Remove `arguments.callee` usage - -2014-10-14 / 1.2.7 -================== - - * Remove duplicate line - -2014-10-02 / 1.2.6 -================== - - * Fix `expose` to be `true` for `ClientError` constructor - -2014-09-28 / 1.2.5 -================== - - * deps: statuses@1 - -2014-09-21 / 1.2.4 -================== - - * Fix dependency version to work with old `npm`s - -2014-09-21 / 1.2.3 -================== - - * deps: statuses@~1.1.0 - -2014-09-21 / 1.2.2 -================== - - * Fix publish error - -2014-09-21 / 1.2.1 -================== - - * Support Node.js 0.6 - * Use `inherits` instead of `util` - -2014-09-09 / 1.2.0 -================== - - * Fix the way inheriting functions - * Support `expose` being provided in properties argument - -2014-09-08 / 1.1.0 -================== - - * Default status to 500 - * Support provided `error` to extend - -2014-09-08 / 1.0.1 -================== - - * Fix accepting string message - -2014-09-08 / 1.0.0 -================== - - * Initial release diff --git a/node_modules/send/node_modules/http-errors/README.md b/node_modules/send/node_modules/http-errors/README.md deleted file mode 100644 index 520271e..0000000 --- a/node_modules/send/node_modules/http-errors/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# http-errors - -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Node.js Version][node-version-image]][node-version-url] -[![Build Status][travis-image]][travis-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -Create HTTP errors for Express, Koa, Connect, etc. with ease. - -## Example - -```js -var createError = require('http-errors'); - -app.use(function (req, res, next) { - if (!req.user) return next(createError(401, 'Please login to view this page.')); - next(); -}) -``` - -## API - -This is the current API, currently extracted from Koa and subject to change. - -### Error Properties - -- `message` -- `status` and `statusCode` - the status code of the error, defaulting to `500` - -### createError([status], [message], [properties]) - -```js -var err = createError(404, 'This video does not exist!'); -``` - -- `status: 500` - the status code as a number -- `message` - the message of the error, defaulting to node's text for that status code. -- `properties` - custom properties to attach to the object - -### new createError\[code || name\](\[msg]\)) - -```js -var err = new createError.NotFound(); -``` - -- `code` - the status code as a number -- `name` - the name of the error as a "bumpy case", i.e. `NotFound` or `InternalServerError`. - -## License - -[MIT](LICENSE) - -[npm-image]: https://img.shields.io/npm/v/http-errors.svg?style=flat -[npm-url]: https://npmjs.org/package/http-errors -[node-version-image]: https://img.shields.io/node/v/http-errors.svg?style=flat -[node-version-url]: http://nodejs.org/download/ -[travis-image]: https://img.shields.io/travis/jshttp/http-errors.svg?style=flat -[travis-url]: https://travis-ci.org/jshttp/http-errors -[coveralls-image]: https://img.shields.io/coveralls/jshttp/http-errors.svg?style=flat -[coveralls-url]: https://coveralls.io/r/jshttp/http-errors -[downloads-image]: https://img.shields.io/npm/dm/http-errors.svg?style=flat -[downloads-url]: https://npmjs.org/package/http-errors diff --git a/node_modules/send/node_modules/http-errors/index.js b/node_modules/send/node_modules/http-errors/index.js deleted file mode 100644 index d84b114..0000000 --- a/node_modules/send/node_modules/http-errors/index.js +++ /dev/null @@ -1,120 +0,0 @@ - -var statuses = require('statuses'); -var inherits = require('inherits'); - -function toIdentifier(str) { - return str.split(' ').map(function (token) { - return token.slice(0, 1).toUpperCase() + token.slice(1) - }).join('').replace(/[^ _0-9a-z]/gi, '') -} - -exports = module.exports = function httpError() { - // so much arity going on ~_~ - var err; - var msg; - var status = 500; - var props = {}; - for (var i = 0; i < arguments.length; i++) { - var arg = arguments[i]; - if (arg instanceof Error) { - err = arg; - status = err.status || err.statusCode || status; - continue; - } - switch (typeof arg) { - case 'string': - msg = arg; - break; - case 'number': - status = arg; - break; - case 'object': - props = arg; - break; - } - } - - if (typeof status !== 'number' || !statuses[status]) { - status = 500 - } - - // constructor - var HttpError = exports[status] - - if (!err) { - // create error - err = HttpError - ? new HttpError(msg) - : new Error(msg || statuses[status]) - Error.captureStackTrace(err, httpError) - } - - if (!HttpError || !(err instanceof HttpError)) { - // add properties to generic error - err.expose = status < 500 - err.status = err.statusCode = status - } - - for (var key in props) { - if (key !== 'status' && key !== 'statusCode') { - err[key] = props[key] - } - } - - return err; -}; - -// create generic error objects -var codes = statuses.codes.filter(function (num) { - return num >= 400; -}); - -codes.forEach(function (code) { - var name = toIdentifier(statuses[code]) - var className = name.match(/Error$/) ? name : name + 'Error' - - if (code >= 500) { - var ServerError = function ServerError(msg) { - var self = new Error(msg != null ? msg : statuses[code]) - Error.captureStackTrace(self, ServerError) - self.__proto__ = ServerError.prototype - Object.defineProperty(self, 'name', { - enumerable: false, - configurable: true, - value: className, - writable: true - }) - return self - } - inherits(ServerError, Error); - ServerError.prototype.status = - ServerError.prototype.statusCode = code; - ServerError.prototype.expose = false; - exports[code] = - exports[name] = ServerError - return; - } - - var ClientError = function ClientError(msg) { - var self = new Error(msg != null ? msg : statuses[code]) - Error.captureStackTrace(self, ClientError) - self.__proto__ = ClientError.prototype - Object.defineProperty(self, 'name', { - enumerable: false, - configurable: true, - value: className, - writable: true - }) - return self - } - inherits(ClientError, Error); - ClientError.prototype.status = - ClientError.prototype.statusCode = code; - ClientError.prototype.expose = true; - exports[code] = - exports[name] = ClientError - return; -}); - -// backwards-compatibility -exports["I'mateapot"] = exports.ImATeapot diff --git a/node_modules/send/node_modules/http-errors/package.json b/node_modules/send/node_modules/http-errors/package.json deleted file mode 100644 index 6bbb3db..0000000 --- a/node_modules/send/node_modules/http-errors/package.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "http-errors", - "description": "Create HTTP error objects", - "version": "1.3.1", - "author": "Jonathan Ong (http://jongleberry.com)", - "contributors": [ - "Alan Plum ", - "Douglas Christopher Wilson " - ], - "license": "MIT", - "repository": "jshttp/http-errors", - "dependencies": { - "inherits": "~2.0.1", - "statuses": "1" - }, - "devDependencies": { - "istanbul": "0", - "mocha": "1" - }, - "engines": { - "node": ">= 0.6" - }, - "scripts": { - "test": "mocha --reporter spec --bail", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot" - }, - "keywords": [ - "http", - "error" - ], - "files": [ - "index.js", - "HISTORY.md", - "LICENSE", - "README.md" - ] -} diff --git a/node_modules/send/node_modules/ms/.npmignore b/node_modules/send/node_modules/ms/.npmignore deleted file mode 100644 index d1aa0ce..0000000 --- a/node_modules/send/node_modules/ms/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -node_modules -test -History.md -Makefile -component.json diff --git a/node_modules/send/node_modules/ms/History.md b/node_modules/send/node_modules/ms/History.md deleted file mode 100644 index 32fdfc1..0000000 --- a/node_modules/send/node_modules/ms/History.md +++ /dev/null @@ -1,66 +0,0 @@ - -0.7.1 / 2015-04-20 -================== - - * prevent extraordinary long inputs (@evilpacket) - * Fixed broken readme link - -0.7.0 / 2014-11-24 -================== - - * add time abbreviations, updated tests and readme for the new units - * fix example in the readme. - * add LICENSE file - -0.6.2 / 2013-12-05 -================== - - * Adding repository section to package.json to suppress warning from NPM. - -0.6.1 / 2013-05-10 -================== - - * fix singularization [visionmedia] - -0.6.0 / 2013-03-15 -================== - - * fix minutes - -0.5.1 / 2013-02-24 -================== - - * add component namespace - -0.5.0 / 2012-11-09 -================== - - * add short formatting as default and .long option - * add .license property to component.json - * add version to component.json - -0.4.0 / 2012-10-22 -================== - - * add rounding to fix crazy decimals - -0.3.0 / 2012-09-07 -================== - - * fix `ms()` [visionmedia] - -0.2.0 / 2012-09-03 -================== - - * add component.json [visionmedia] - * add days support [visionmedia] - * add hours support [visionmedia] - * add minutes support [visionmedia] - * add seconds support [visionmedia] - * add ms string support [visionmedia] - * refactor tests to facilitate ms(number) [visionmedia] - -0.1.0 / 2012-03-07 -================== - - * Initial release diff --git a/node_modules/send/node_modules/ms/LICENSE b/node_modules/send/node_modules/ms/LICENSE deleted file mode 100644 index 6c07561..0000000 --- a/node_modules/send/node_modules/ms/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -(The MIT License) - -Copyright (c) 2014 Guillermo Rauch - -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/send/node_modules/ms/index.js b/node_modules/send/node_modules/ms/index.js index 4f92771..ea734fb 100644 --- a/node_modules/send/node_modules/ms/index.js +++ b/node_modules/send/node_modules/ms/index.js @@ -6,6 +6,7 @@ var s = 1000; var m = s * 60; var h = m * 60; var d = h * 24; +var w = d * 7; var y = d * 365.25; /** @@ -16,17 +17,24 @@ var y = d * 365.25; * - `long` verbose formatting [false] * * @param {String|Number} val - * @param {Object} options + * @param {Object} [options] + * @throws {Error} throw an error if val is not a non-empty string or a number * @return {String|Number} * @api public */ -module.exports = function(val, options){ +module.exports = function (val, options) { options = options || {}; - if ('string' == typeof val) return parse(val); - return options.long - ? long(val) - : short(val); + var type = typeof val; + if (type === 'string' && val.length > 0) { + return parse(val); + } else if (type === 'number' && isFinite(val)) { + return options.long ? fmtLong(val) : fmtShort(val); + } + throw new Error( + 'val is not a non-empty string or a valid number. val=' + + JSON.stringify(val) + ); }; /** @@ -38,10 +46,16 @@ module.exports = function(val, options){ */ function parse(str) { - str = '' + str; - if (str.length > 10000) return; - var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str); - if (!match) return; + str = String(str); + if (str.length > 100) { + return; + } + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + str + ); + if (!match) { + return; + } var n = parseFloat(match[1]); var type = (match[2] || 'ms').toLowerCase(); switch (type) { @@ -51,6 +65,10 @@ function parse(str) { case 'yr': case 'y': return n * y; + case 'weeks': + case 'week': + case 'w': + return n * w; case 'days': case 'day': case 'd': @@ -79,6 +97,8 @@ function parse(str) { case 'msec': case 'ms': return n; + default: + return undefined; } } @@ -90,11 +110,20 @@ function parse(str) { * @api private */ -function short(ms) { - if (ms >= d) return Math.round(ms / d) + 'd'; - if (ms >= h) return Math.round(ms / h) + 'h'; - if (ms >= m) return Math.round(ms / m) + 'm'; - if (ms >= s) return Math.round(ms / s) + 's'; +function fmtShort(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return Math.round(ms / d) + 'd'; + } + if (msAbs >= h) { + return Math.round(ms / h) + 'h'; + } + if (msAbs >= m) { + return Math.round(ms / m) + 'm'; + } + if (msAbs >= s) { + return Math.round(ms / s) + 's'; + } return ms + 'ms'; } @@ -106,20 +135,28 @@ function short(ms) { * @api private */ -function long(ms) { - return plural(ms, d, 'day') - || plural(ms, h, 'hour') - || plural(ms, m, 'minute') - || plural(ms, s, 'second') - || ms + ' ms'; +function fmtLong(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return plural(ms, msAbs, d, 'day'); + } + if (msAbs >= h) { + return plural(ms, msAbs, h, 'hour'); + } + if (msAbs >= m) { + return plural(ms, msAbs, m, 'minute'); + } + if (msAbs >= s) { + return plural(ms, msAbs, s, 'second'); + } + return ms + ' ms'; } /** * Pluralization helper. */ -function plural(ms, n, name) { - if (ms < n) return; - if (ms < n * 1.5) return Math.floor(ms / n) + ' ' + name; - return Math.ceil(ms / n) + ' ' + name + 's'; +function plural(ms, msAbs, n, name) { + var isPlural = msAbs >= n * 1.5; + return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); } diff --git a/node_modules/named-placeholders/LICENSE b/node_modules/send/node_modules/ms/license.md similarity index 96% rename from node_modules/named-placeholders/LICENSE rename to node_modules/send/node_modules/ms/license.md index bc0223f..fa5d39b 100644 --- a/node_modules/named-placeholders/LICENSE +++ b/node_modules/send/node_modules/ms/license.md @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2014 Andrey Sidorov +Copyright (c) 2020 Vercel, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/node_modules/send/node_modules/ms/package.json b/node_modules/send/node_modules/ms/package.json index a4e5bb6..4997189 100644 --- a/node_modules/send/node_modules/ms/package.json +++ b/node_modules/send/node_modules/ms/package.json @@ -1,20 +1,38 @@ { "name": "ms", - "version": "0.7.1", - "description": "Tiny ms conversion utility", - "repository": { - "type": "git", - "url": "git://github.com/guille/ms.js.git" - }, + "version": "2.1.3", + "description": "Tiny millisecond conversion utility", + "repository": "vercel/ms", "main": "./index", - "devDependencies": { - "mocha": "*", - "expect.js": "*", - "serve": "*" + "files": [ + "index.js" + ], + "scripts": { + "precommit": "lint-staged", + "lint": "eslint lib/* bin/*", + "test": "mocha tests.js" }, - "component": { - "scripts": { - "ms/index.js": "index.js" + "eslintConfig": { + "extends": "eslint:recommended", + "env": { + "node": true, + "es6": true } + }, + "lint-staged": { + "*.js": [ + "npm run lint", + "prettier --single-quote --write", + "git add" + ] + }, + "license": "MIT", + "devDependencies": { + "eslint": "4.18.2", + "expect.js": "0.3.1", + "husky": "0.14.3", + "lint-staged": "5.0.0", + "mocha": "4.0.1", + "prettier": "2.0.5" } } diff --git a/node_modules/send/node_modules/ms/readme.md b/node_modules/send/node_modules/ms/readme.md index 9b4fd03..0fc1abb 100644 --- a/node_modules/send/node_modules/ms/readme.md +++ b/node_modules/send/node_modules/ms/readme.md @@ -1,4 +1,10 @@ -# ms.js: miliseconds conversion utility +# ms + +![CI](https://github.com/vercel/ms/workflows/CI/badge.svg) + +Use this package to easily convert various time formats to milliseconds. + +## Examples ```js ms('2 days') // 172800000 @@ -8,28 +14,46 @@ ms('2.5 hrs') // 9000000 ms('2h') // 7200000 ms('1m') // 60000 ms('5s') // 5000 +ms('1y') // 31557600000 ms('100') // 100 +ms('-3 days') // -259200000 +ms('-1h') // -3600000 +ms('-200') // -200 ``` +### Convert from Milliseconds + ```js ms(60000) // "1m" ms(2 * 60000) // "2m" +ms(-3 * 60000) // "-3m" ms(ms('10 hours')) // "10h" ``` +### Time Format Written-Out + ```js ms(60000, { long: true }) // "1 minute" ms(2 * 60000, { long: true }) // "2 minutes" +ms(-3 * 60000, { long: true }) // "-3 minutes" ms(ms('10 hours'), { long: true }) // "10 hours" ``` -- Node/Browser compatible. Published as [`ms`](https://www.npmjs.org/package/ms) in [NPM](http://nodejs.org/download). -- If a number is supplied to `ms`, a string with a unit is returned. -- If a string that contains the number is supplied, it returns it as -a number (e.g: it returns `100` for `'100'`). -- If you pass a string with a number and a valid unit, the number of -equivalent ms is returned. +## Features -## License +- Works both in [Node.js](https://nodejs.org) and in the browser +- If a number is supplied to `ms`, a string with a unit is returned +- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`) +- If you pass a string with a number and a valid unit, the number of equivalent milliseconds is returned -MIT +## Related Packages + +- [ms.macro](https://github.com/knpwrs/ms.macro) - Run `ms` as a macro at build-time. + +## Caught a Bug? + +1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device +2. Link the package to the global module directory: `npm link` +3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, Node.js will now use your clone of ms! + +As always, you can run the tests using: `npm test` diff --git a/node_modules/send/node_modules/on-finished/HISTORY.md b/node_modules/send/node_modules/on-finished/HISTORY.md deleted file mode 100644 index 98ff0e9..0000000 --- a/node_modules/send/node_modules/on-finished/HISTORY.md +++ /dev/null @@ -1,88 +0,0 @@ -2.3.0 / 2015-05-26 -================== - - * Add defined behavior for HTTP `CONNECT` requests - * Add defined behavior for HTTP `Upgrade` requests - * deps: ee-first@1.1.1 - -2.2.1 / 2015-04-22 -================== - - * Fix `isFinished(req)` when data buffered - -2.2.0 / 2014-12-22 -================== - - * Add message object to callback arguments - -2.1.1 / 2014-10-22 -================== - - * Fix handling of pipelined requests - -2.1.0 / 2014-08-16 -================== - - * Check if `socket` is detached - * Return `undefined` for `isFinished` if state unknown - -2.0.0 / 2014-08-16 -================== - - * Add `isFinished` function - * Move to `jshttp` organization - * Remove support for plain socket argument - * Rename to `on-finished` - * Support both `req` and `res` as arguments - * deps: ee-first@1.0.5 - -1.2.2 / 2014-06-10 -================== - - * Reduce listeners added to emitters - - avoids "event emitter leak" warnings when used multiple times on same request - -1.2.1 / 2014-06-08 -================== - - * Fix returned value when already finished - -1.2.0 / 2014-06-05 -================== - - * Call callback when called on already-finished socket - -1.1.4 / 2014-05-27 -================== - - * Support node.js 0.8 - -1.1.3 / 2014-04-30 -================== - - * Make sure errors passed as instanceof `Error` - -1.1.2 / 2014-04-18 -================== - - * Default the `socket` to passed-in object - -1.1.1 / 2014-01-16 -================== - - * Rename module to `finished` - -1.1.0 / 2013-12-25 -================== - - * Call callback when called on already-errored socket - -1.0.1 / 2013-12-20 -================== - - * Actually pass the error to the callback - -1.0.0 / 2013-12-20 -================== - - * Initial release diff --git a/node_modules/send/node_modules/on-finished/LICENSE b/node_modules/send/node_modules/on-finished/LICENSE deleted file mode 100644 index 5931fd2..0000000 --- a/node_modules/send/node_modules/on-finished/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -(The MIT License) - -Copyright (c) 2013 Jonathan Ong -Copyright (c) 2014 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/send/node_modules/on-finished/README.md b/node_modules/send/node_modules/on-finished/README.md deleted file mode 100644 index a0e1157..0000000 --- a/node_modules/send/node_modules/on-finished/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# on-finished - -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Node.js Version][node-version-image]][node-version-url] -[![Build Status][travis-image]][travis-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -Execute a callback when a HTTP request closes, finishes, or errors. - -## Install - -```sh -$ npm install on-finished -``` - -## API - -```js -var onFinished = require('on-finished') -``` - -### onFinished(res, listener) - -Attach a listener to listen for the response to finish. The listener will -be invoked only once when the response finished. If the response finished -to an error, the first argument will contain the error. If the response -has already finished, the listener will be invoked. - -Listening to the end of a response would be used to close things associated -with the response, like open files. - -Listener is invoked as `listener(err, res)`. - -```js -onFinished(res, function (err, res) { - // clean up open fds, etc. - // err contains the error is request error'd -}) -``` - -### onFinished(req, listener) - -Attach a listener to listen for the request to finish. The listener will -be invoked only once when the request finished. If the request finished -to an error, the first argument will contain the error. If the request -has already finished, the listener will be invoked. - -Listening to the end of a request would be used to know when to continue -after reading the data. - -Listener is invoked as `listener(err, req)`. - -```js -var data = '' - -req.setEncoding('utf8') -res.on('data', function (str) { - data += str -}) - -onFinished(req, function (err, req) { - // data is read unless there is err -}) -``` - -### onFinished.isFinished(res) - -Determine if `res` is already finished. This would be useful to check and -not even start certain operations if the response has already finished. - -### onFinished.isFinished(req) - -Determine if `req` is already finished. This would be useful to check and -not even start certain operations if the request has already finished. - -## Special Node.js requests - -### HTTP CONNECT method - -The meaning of the `CONNECT` method from RFC 7231, section 4.3.6: - -> The CONNECT method requests that the recipient establish a tunnel to -> the destination origin server identified by the request-target and, -> if successful, thereafter restrict its behavior to blind forwarding -> of packets, in both directions, until the tunnel is closed. Tunnels -> are commonly used to create an end-to-end virtual connection, through -> one or more proxies, which can then be secured using TLS (Transport -> Layer Security, [RFC5246]). - -In Node.js, these request objects come from the `'connect'` event on -the HTTP server. - -When this module is used on a HTTP `CONNECT` request, the request is -considered "finished" immediately, **due to limitations in the Node.js -interface**. This means if the `CONNECT` request contains a request entity, -the request will be considered "finished" even before it has been read. - -There is no such thing as a response object to a `CONNECT` request in -Node.js, so there is no support for for one. - -### HTTP Upgrade request - -The meaning of the `Upgrade` header from RFC 7230, section 6.1: - -> The "Upgrade" header field is intended to provide a simple mechanism -> for transitioning from HTTP/1.1 to some other protocol on the same -> connection. - -In Node.js, these request objects come from the `'upgrade'` event on -the HTTP server. - -When this module is used on a HTTP request with an `Upgrade` header, the -request is considered "finished" immediately, **due to limitations in the -Node.js interface**. This means if the `Upgrade` request contains a request -entity, the request will be considered "finished" even before it has been -read. - -There is no such thing as a response object to a `Upgrade` request in -Node.js, so there is no support for for one. - -## Example - -The following code ensures that file descriptors are always closed -once the response finishes. - -```js -var destroy = require('destroy') -var http = require('http') -var onFinished = require('on-finished') - -http.createServer(function onRequest(req, res) { - var stream = fs.createReadStream('package.json') - stream.pipe(res) - onFinished(res, function (err) { - destroy(stream) - }) -}) -``` - -## License - -[MIT](LICENSE) - -[npm-image]: https://img.shields.io/npm/v/on-finished.svg -[npm-url]: https://npmjs.org/package/on-finished -[node-version-image]: https://img.shields.io/node/v/on-finished.svg -[node-version-url]: http://nodejs.org/download/ -[travis-image]: https://img.shields.io/travis/jshttp/on-finished/master.svg -[travis-url]: https://travis-ci.org/jshttp/on-finished -[coveralls-image]: https://img.shields.io/coveralls/jshttp/on-finished/master.svg -[coveralls-url]: https://coveralls.io/r/jshttp/on-finished?branch=master -[downloads-image]: https://img.shields.io/npm/dm/on-finished.svg -[downloads-url]: https://npmjs.org/package/on-finished diff --git a/node_modules/send/node_modules/on-finished/index.js b/node_modules/send/node_modules/on-finished/index.js deleted file mode 100644 index 9abd98f..0000000 --- a/node_modules/send/node_modules/on-finished/index.js +++ /dev/null @@ -1,196 +0,0 @@ -/*! - * on-finished - * Copyright(c) 2013 Jonathan Ong - * Copyright(c) 2014 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module exports. - * @public - */ - -module.exports = onFinished -module.exports.isFinished = isFinished - -/** - * Module dependencies. - * @private - */ - -var first = require('ee-first') - -/** - * Variables. - * @private - */ - -/* istanbul ignore next */ -var defer = typeof setImmediate === 'function' - ? setImmediate - : function(fn){ process.nextTick(fn.bind.apply(fn, arguments)) } - -/** - * Invoke callback when the response has finished, useful for - * cleaning up resources afterwards. - * - * @param {object} msg - * @param {function} listener - * @return {object} - * @public - */ - -function onFinished(msg, listener) { - if (isFinished(msg) !== false) { - defer(listener, null, msg) - return msg - } - - // attach the listener to the message - attachListener(msg, listener) - - return msg -} - -/** - * Determine if message is already finished. - * - * @param {object} msg - * @return {boolean} - * @public - */ - -function isFinished(msg) { - var socket = msg.socket - - if (typeof msg.finished === 'boolean') { - // OutgoingMessage - return Boolean(msg.finished || (socket && !socket.writable)) - } - - if (typeof msg.complete === 'boolean') { - // IncomingMessage - return Boolean(msg.upgrade || !socket || !socket.readable || (msg.complete && !msg.readable)) - } - - // don't know - return undefined -} - -/** - * Attach a finished listener to the message. - * - * @param {object} msg - * @param {function} callback - * @private - */ - -function attachFinishedListener(msg, callback) { - var eeMsg - var eeSocket - var finished = false - - function onFinish(error) { - eeMsg.cancel() - eeSocket.cancel() - - finished = true - callback(error) - } - - // finished on first message event - eeMsg = eeSocket = first([[msg, 'end', 'finish']], onFinish) - - function onSocket(socket) { - // remove listener - msg.removeListener('socket', onSocket) - - if (finished) return - if (eeMsg !== eeSocket) return - - // finished on first socket event - eeSocket = first([[socket, 'error', 'close']], onFinish) - } - - if (msg.socket) { - // socket already assigned - onSocket(msg.socket) - return - } - - // wait for socket to be assigned - msg.on('socket', onSocket) - - if (msg.socket === undefined) { - // node.js 0.8 patch - patchAssignSocket(msg, onSocket) - } -} - -/** - * Attach the listener to the message. - * - * @param {object} msg - * @return {function} - * @private - */ - -function attachListener(msg, listener) { - var attached = msg.__onFinished - - // create a private single listener with queue - if (!attached || !attached.queue) { - attached = msg.__onFinished = createListener(msg) - attachFinishedListener(msg, attached) - } - - attached.queue.push(listener) -} - -/** - * Create listener on message. - * - * @param {object} msg - * @return {function} - * @private - */ - -function createListener(msg) { - function listener(err) { - if (msg.__onFinished === listener) msg.__onFinished = null - if (!listener.queue) return - - var queue = listener.queue - listener.queue = null - - for (var i = 0; i < queue.length; i++) { - queue[i](err, msg) - } - } - - listener.queue = [] - - return listener -} - -/** - * Patch ServerResponse.prototype.assignSocket for node.js 0.8. - * - * @param {ServerResponse} res - * @param {function} callback - * @private - */ - -function patchAssignSocket(res, callback) { - var assignSocket = res.assignSocket - - if (typeof assignSocket !== 'function') return - - // res.on('socket', callback) is broken in 0.8 - res.assignSocket = function _assignSocket(socket) { - assignSocket.call(this, socket) - callback(socket) - } -} diff --git a/node_modules/send/node_modules/on-finished/package.json b/node_modules/send/node_modules/on-finished/package.json deleted file mode 100644 index b9df1bd..0000000 --- a/node_modules/send/node_modules/on-finished/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "on-finished", - "description": "Execute a callback when a request closes, finishes, or errors", - "version": "2.3.0", - "contributors": [ - "Douglas Christopher Wilson ", - "Jonathan Ong (http://jongleberry.com)" - ], - "license": "MIT", - "repository": "jshttp/on-finished", - "dependencies": { - "ee-first": "1.1.1" - }, - "devDependencies": { - "istanbul": "0.3.9", - "mocha": "2.2.5" - }, - "engines": { - "node": ">= 0.8" - }, - "files": [ - "HISTORY.md", - "LICENSE", - "index.js" - ], - "scripts": { - "test": "mocha --reporter spec --bail --check-leaks test/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" - } -} diff --git a/node_modules/send/node_modules/statuses/README.md b/node_modules/send/node_modules/statuses/README.md deleted file mode 100644 index f6ae24c..0000000 --- a/node_modules/send/node_modules/statuses/README.md +++ /dev/null @@ -1,114 +0,0 @@ -# Statuses - -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Node.js Version][node-version-image]][node-version-url] -[![Build Status][travis-image]][travis-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -HTTP status utility for node. - -## API - -```js -var status = require('statuses'); -``` - -### var code = status(Integer || String) - -If `Integer` or `String` is a valid HTTP code or status message, then the appropriate `code` will be returned. Otherwise, an error will be thrown. - -```js -status(403) // => 'Forbidden' -status('403') // => 'Forbidden' -status('forbidden') // => 403 -status('Forbidden') // => 403 -status(306) // throws, as it's not supported by node.js -``` - -### status.codes - -Returns an array of all the status codes as `Integer`s. - -### var msg = status[code] - -Map of `code` to `status message`. `undefined` for invalid `code`s. - -```js -status[404] // => 'Not Found' -``` - -### var code = status[msg] - -Map of `status message` to `code`. `msg` can either be title-cased or lower-cased. `undefined` for invalid `status message`s. - -```js -status['not found'] // => 404 -status['Not Found'] // => 404 -``` - -### status.redirect[code] - -Returns `true` if a status code is a valid redirect status. - -```js -status.redirect[200] // => undefined -status.redirect[301] // => true -``` - -### status.empty[code] - -Returns `true` if a status code expects an empty body. - -```js -status.empty[200] // => undefined -status.empty[204] // => true -status.empty[304] // => true -``` - -### status.retry[code] - -Returns `true` if you should retry the rest. - -```js -status.retry[501] // => undefined -status.retry[503] // => true -``` - -### statuses/codes.json - -```js -var codes = require('statuses/codes.json'); -``` - -This is a JSON file of the status codes -taken from `require('http').STATUS_CODES`. -This is saved so that codes are consistent even in older node.js versions. -For example, `308` will be added in v0.12. - -## Adding Status Codes - -The status codes are primarily sourced from http://www.iana.org/assignments/http-status-codes/http-status-codes-1.csv. -Additionally, custom codes are added from http://en.wikipedia.org/wiki/List_of_HTTP_status_codes. -These are added manually in the `lib/*.json` files. -If you would like to add a status code, add it to the appropriate JSON file. - -To rebuild `codes.json`, run the following: - -```bash -# update src/iana.json -npm run update -# build codes.json -npm run build -``` - -[npm-image]: https://img.shields.io/npm/v/statuses.svg?style=flat -[npm-url]: https://npmjs.org/package/statuses -[node-version-image]: http://img.shields.io/badge/node.js-%3E%3D_0.6-brightgreen.svg?style=flat -[node-version-url]: http://nodejs.org/download/ -[travis-image]: https://img.shields.io/travis/jshttp/statuses.svg?style=flat -[travis-url]: https://travis-ci.org/jshttp/statuses -[coveralls-image]: https://img.shields.io/coveralls/jshttp/statuses.svg?style=flat -[coveralls-url]: https://coveralls.io/r/jshttp/statuses?branch=master -[downloads-image]: http://img.shields.io/npm/dm/statuses.svg?style=flat -[downloads-url]: https://npmjs.org/package/statuses diff --git a/node_modules/send/node_modules/statuses/codes.json b/node_modules/send/node_modules/statuses/codes.json deleted file mode 100644 index 4c45a88..0000000 --- a/node_modules/send/node_modules/statuses/codes.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "100": "Continue", - "101": "Switching Protocols", - "102": "Processing", - "200": "OK", - "201": "Created", - "202": "Accepted", - "203": "Non-Authoritative Information", - "204": "No Content", - "205": "Reset Content", - "206": "Partial Content", - "207": "Multi-Status", - "208": "Already Reported", - "226": "IM Used", - "300": "Multiple Choices", - "301": "Moved Permanently", - "302": "Found", - "303": "See Other", - "304": "Not Modified", - "305": "Use Proxy", - "306": "(Unused)", - "307": "Temporary Redirect", - "308": "Permanent Redirect", - "400": "Bad Request", - "401": "Unauthorized", - "402": "Payment Required", - "403": "Forbidden", - "404": "Not Found", - "405": "Method Not Allowed", - "406": "Not Acceptable", - "407": "Proxy Authentication Required", - "408": "Request Timeout", - "409": "Conflict", - "410": "Gone", - "411": "Length Required", - "412": "Precondition Failed", - "413": "Payload Too Large", - "414": "URI Too Long", - "415": "Unsupported Media Type", - "416": "Range Not Satisfiable", - "417": "Expectation Failed", - "418": "I'm a teapot", - "422": "Unprocessable Entity", - "423": "Locked", - "424": "Failed Dependency", - "425": "Unordered Collection", - "426": "Upgrade Required", - "428": "Precondition Required", - "429": "Too Many Requests", - "431": "Request Header Fields Too Large", - "451": "Unavailable For Legal Reasons", - "500": "Internal Server Error", - "501": "Not Implemented", - "502": "Bad Gateway", - "503": "Service Unavailable", - "504": "Gateway Timeout", - "505": "HTTP Version Not Supported", - "506": "Variant Also Negotiates", - "507": "Insufficient Storage", - "508": "Loop Detected", - "509": "Bandwidth Limit Exceeded", - "510": "Not Extended", - "511": "Network Authentication Required" -} \ No newline at end of file diff --git a/node_modules/send/node_modules/statuses/index.js b/node_modules/send/node_modules/statuses/index.js deleted file mode 100644 index b06182d..0000000 --- a/node_modules/send/node_modules/statuses/index.js +++ /dev/null @@ -1,60 +0,0 @@ - -var codes = require('./codes.json'); - -module.exports = status; - -// [Integer...] -status.codes = Object.keys(codes).map(function (code) { - code = ~~code; - var msg = codes[code]; - status[code] = msg; - status[msg] = status[msg.toLowerCase()] = code; - return code; -}); - -// status codes for redirects -status.redirect = { - 300: true, - 301: true, - 302: true, - 303: true, - 305: true, - 307: true, - 308: true, -}; - -// status codes for empty bodies -status.empty = { - 204: true, - 205: true, - 304: true, -}; - -// status codes for when you should retry the request -status.retry = { - 502: true, - 503: true, - 504: true, -}; - -function status(code) { - if (typeof code === 'number') { - if (!status[code]) throw new Error('invalid status code: ' + code); - return code; - } - - if (typeof code !== 'string') { - throw new TypeError('code must be a number or string'); - } - - // '403' - var n = parseInt(code, 10) - if (!isNaN(n)) { - if (!status[n]) throw new Error('invalid status code: ' + n); - return n; - } - - n = status[code.toLowerCase()]; - if (!n) throw new Error('invalid status message: "' + code + '"'); - return n; -} diff --git a/node_modules/send/node_modules/statuses/package.json b/node_modules/send/node_modules/statuses/package.json deleted file mode 100644 index e3a627f..0000000 --- a/node_modules/send/node_modules/statuses/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "statuses", - "description": "HTTP status utility", - "version": "1.2.1", - "author": { - "name": "Jonathan Ong", - "email": "me@jongleberry.com", - "url": "http://jongleberry.com", - "twitter": "https://twitter.com/jongleberry" - }, - "repository": "jshttp/statuses", - "license": "MIT", - "keywords": [ - "http", - "status", - "code" - ], - "files": [ - "index.js", - "codes.json", - "LICENSE" - ], - "devDependencies": { - "csv-parse": "0.0.6", - "istanbul": "0", - "mocha": "1", - "stream-to-array": "2" - }, - "scripts": { - "build": "node scripts/build.js", - "update": "node scripts/update.js", - "test": "mocha --reporter spec --bail --check-leaks", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks" - } -} diff --git a/node_modules/send/package.json b/node_modules/send/package.json index 07eb51f..7f269d5 100644 --- a/node_modules/send/package.json +++ b/node_modules/send/package.json @@ -1,10 +1,12 @@ { "name": "send", "description": "Better streaming static file server with Range and conditional-GET support", - "version": "0.13.0", + "version": "0.18.0", "author": "TJ Holowaychuk ", "contributors": [ - "Douglas Christopher Wilson " + "Douglas Christopher Wilson ", + "James Wyatt Cready ", + "Jesús Leganés Combarro " ], "license": "MIT", "repository": "pillarjs/send", @@ -14,37 +16,47 @@ "server" ], "dependencies": { - "debug": "~2.2.0", - "depd": "~1.0.1", - "destroy": "1.0.3", - "escape-html": "1.0.2", - "etag": "~1.7.0", - "fresh": "0.3.0", - "http-errors": "~1.3.1", - "mime": "1.3.4", - "ms": "0.7.1", - "on-finished": "~2.3.0", - "range-parser": "~1.0.2", - "statuses": "~1.2.1" + "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" }, "devDependencies": { - "after": "0.8.1", - "istanbul": "0.3.9", - "mocha": "2.2.5", - "supertest": "1.0.1" + "after": "0.8.2", + "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": "5.2.0", + "eslint-plugin-standard": "4.1.0", + "mocha": "9.2.2", + "nyc": "15.1.0", + "supertest": "6.2.2" }, "files": [ "HISTORY.md", "LICENSE", "README.md", + "SECURITY.md", "index.js" ], "engines": { "node": ">= 0.8.0" }, "scripts": { + "lint": "eslint .", "test": "mocha --check-leaks --reporter spec --bail", - "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --check-leaks --reporter spec", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --check-leaks --reporter dot" + "test-ci": "nyc --reporter=lcov --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" } } diff --git a/node_modules/seq-queue/.jshintrc b/node_modules/seq-queue/.jshintrc deleted file mode 100644 index bb3389c..0000000 --- a/node_modules/seq-queue/.jshintrc +++ /dev/null @@ -1,19 +0,0 @@ -{ - "predef": [ - "describe", - "it", - "before", - "after", - "window", - "__resources__" - ], - "es5": true, - "node": true, - "eqeqeq": true, - "undef": true, - "curly": true, - "bitwise": true, - "immed": false, - "newcap": true, - "nonew": true -} diff --git a/node_modules/seq-queue/.npmignore b/node_modules/seq-queue/.npmignore deleted file mode 100644 index 3995665..0000000 --- a/node_modules/seq-queue/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -.project -node_modules/ -lib/doc/ diff --git a/node_modules/seq-queue/AUTHORS b/node_modules/seq-queue/AUTHORS deleted file mode 100644 index 5174d23..0000000 --- a/node_modules/seq-queue/AUTHORS +++ /dev/null @@ -1 +0,0 @@ -* Yongchang Zhou \ No newline at end of file diff --git a/node_modules/seq-queue/LICENSE b/node_modules/seq-queue/LICENSE deleted file mode 100644 index d4e3221..0000000 --- a/node_modules/seq-queue/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2012 Netease, Inc. and other pomelo contributors - -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/seq-queue/Makefile b/node_modules/seq-queue/Makefile deleted file mode 100644 index 76354ea..0000000 --- a/node_modules/seq-queue/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -TESTS = test/*.js -REPORTER = spec -TIMEOUT = 5000 - -test: - @./node_modules/.bin/mocha \ - --reporter $(REPORTER) --timeout $(TIMEOUT) $(TESTS) - -.PHONY: test \ No newline at end of file diff --git a/node_modules/seq-queue/README.md b/node_modules/seq-queue/README.md deleted file mode 100644 index 4f21a71..0000000 --- a/node_modules/seq-queue/README.md +++ /dev/null @@ -1,75 +0,0 @@ -seq-queue - queue to keep request process in sequence -===================================================== - -Seq-queue is simple tool to keep requests to be executed in order. - -As we known, Node.js codes run in asynchronous mode and the callbacks are unordered. But sometimes we may need the requests to be processed in order. For example, in a game, a player would do some operations such as turn right and go ahead. And in the server side, we would like to process these requests one by one, not do them all at the same time. - -Seq-queue takes the responsibility to make the asynchronous, unordered processing flow into serial and ordered. It's simple but not a repeated wheel. - -Seq-queue is a FIFO task queue and we can push tasks as we wish, anytime(before the queue closed), anywhere(if we hold the queue instance). A task is known as a function and we can do anything in the function and just need to call `task.done()` to tell the queue current task has finished. It promises that a task in queue would not be executed util all tasks before it finished. - -Seq-queue add timeout for each task execution. If a task throws an uncaught exception in its call back or a developer forgets to call `task.done()` callback, queue would be blocked and would not execute the left tasks. To avoid these situations, seq-queue set a timeout for each task. If a task timeout, queue would drop the task and notify develop by a 'timeout' event and then invoke the next task. Any `task.done()` invoked in a timeout task would be ignored. - - * Tags: node.js - -##Installation -``` -npm install seq-queue -``` - -##Usage -``` javascript -var seqqueue = require('seq-queue'); - -var queue = seqqueue.createQueue(1000); - -queue.push( - function(task) { - setTimeout(function() { - console.log('hello '); - task.done(); - }, 500); - }, - function() { - console.log('task timeout'); - }, - 1000 -); - -queue.push( - function(task) { - setTimeout(function() { - console.log('world~'); - task.done(); - }, 500); - } -); -``` - -##API -###seqqueue.createQueue(timeout) -Create a new queue instance. A global timeout value in ms for the new instance can be set by `timeout` parameter or use the default timeout (3s) by no parameter. - -###queue.push(fn, ontimeout, timeout) -Add a task into the queue instance. -####Arguments -+ fn(task) - The function that describes the content of task and would be invoke by queue. `fn` takes a arguemnt task and we *must* call task.done() to tell queue current task has finished. -+ ontimeout() - Callback for task timeout. -+ timeout - Timeout in ms for `fn`. If specified, it would overwrite the global timeout that set by `createQueue` for `fn`. - -###queue.close(force) -Close the queue. A closed queue would stop receiving new task immediately. And the left tasks would be treated in different ways decided by `force`. -####Arguments -+ force - If true, queue would stop working immediately and ignore any tasks left in queue. Otherwise queue would execute the tasks in queue and then stop. - -##Event -Seq-queue instances extend the EventEmitter and would emit events in their life cycles. -###'timeout'(totask) -If current task not invoke task.done() within the timeout ms, a timeout event would be emit. totask.fn and totask.timeout is the `fn` and `timeout` arguments that passed by `queue.push(2)`. -###'error'(err, task) -If the task function (not callbacks) throws an uncaught error, queue would emit an error event and passes the err and task informations by event callback arguments. -###'closed' -Emit when the close(false) is invoked. -###'drained' -Emit when close(true) is invoked or all tasks left have finished in closed status. diff --git a/node_modules/seq-queue/index.js b/node_modules/seq-queue/index.js deleted file mode 100644 index 51029d8..0000000 --- a/node_modules/seq-queue/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/seq-queue'); \ No newline at end of file diff --git a/node_modules/seq-queue/lib/.npmignore b/node_modules/seq-queue/lib/.npmignore deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/seq-queue/lib/seq-queue.js b/node_modules/seq-queue/lib/seq-queue.js deleted file mode 100644 index f13f285..0000000 --- a/node_modules/seq-queue/lib/seq-queue.js +++ /dev/null @@ -1,199 +0,0 @@ -var EventEmitter = require('events').EventEmitter; -var util = require('util'); - -var DEFAULT_TIMEOUT = 3000; -var INIT_ID = 0; -var EVENT_CLOSED = 'closed'; -var EVENT_DRAINED = 'drained'; - -/** - * Instance a new queue - * - * @param {Number} timeout a global timeout for new queue - * @class - * @constructor - */ -var SeqQueue = function(timeout) { - EventEmitter.call(this); - - if(timeout && timeout > 0) { - this.timeout = timeout; - } else { - this.timeout = DEFAULT_TIMEOUT; - } - - this.status = SeqQueueManager.STATUS_IDLE; - this.curId = INIT_ID; - this.queue = []; -}; -util.inherits(SeqQueue, EventEmitter); - -/** - * Add a task into queue. - * - * @param fn new request - * @param ontimeout callback when task timeout - * @param timeout timeout for current request. take the global timeout if this is invalid - * @returns true or false - */ -SeqQueue.prototype.push = function(fn, ontimeout, timeout) { - if(this.status !== SeqQueueManager.STATUS_IDLE && this.status !== SeqQueueManager.STATUS_BUSY) { - //ignore invalid status - return false; - } - - if(typeof fn !== 'function') { - throw new Error('fn should be a function.'); - } - this.queue.push({fn: fn, ontimeout: ontimeout, timeout: timeout}); - - if(this.status === SeqQueueManager.STATUS_IDLE) { - this.status = SeqQueueManager.STATUS_BUSY; - var self = this; - process.nextTick(function() { - self._next(self.curId); - }); - } - return true; -}; - -/** - * Close queue - * - * @param {Boolean} force if true will close the queue immediately else will execute the rest task in queue - */ -SeqQueue.prototype.close = function(force) { - if(this.status !== SeqQueueManager.STATUS_IDLE && this.status !== SeqQueueManager.STATUS_BUSY) { - //ignore invalid status - return; - } - - if(force) { - this.status = SeqQueueManager.STATUS_DRAINED; - if(this.timerId) { - clearTimeout(this.timerId); - this.timerId = undefined; - } - this.emit(EVENT_DRAINED); - } else { - this.status = SeqQueueManager.STATUS_CLOSED; - this.emit(EVENT_CLOSED); - } -}; - -/** - * Invoke next task - * - * @param {String|Number} tid last executed task id - * @api private - */ -SeqQueue.prototype._next = function(tid) { - if(tid !== this.curId || this.status !== SeqQueueManager.STATUS_BUSY && this.status !== SeqQueueManager.STATUS_CLOSED) { - //ignore invalid next call - return; - } - - if(this.timerId) { - clearTimeout(this.timerId); - this.timerId = undefined; - } - - var task = this.queue.shift(); - if(!task) { - if(this.status === SeqQueueManager.STATUS_BUSY) { - this.status = SeqQueueManager.STATUS_IDLE; - this.curId++; //modify curId to invalidate timeout task - } else { - this.status = SeqQueueManager.STATUS_DRAINED; - this.emit(EVENT_DRAINED); - } - return; - } - - var self = this; - task.id = ++this.curId; - - var timeout = task.timeout > 0 ? task.timeout : this.timeout; - timeout = timeout > 0 ? timeout : DEFAULT_TIMEOUT; - this.timerId = setTimeout(function() { - process.nextTick(function() { - self._next(task.id); - }); - self.emit('timeout', task); - if(task.ontimeout) { - task.ontimeout(); - } - }, timeout); - - try { - task.fn({ - done: function() { - var res = task.id === self.curId; - process.nextTick(function() { - self._next(task.id); - }); - return res; - } - }); - } catch(err) { - self.emit('error', err, task); - process.nextTick(function() { - self._next(task.id); - }); - } -}; - -/** - * Queue manager. - * - * @module - */ -var SeqQueueManager = module.exports; - -/** - * Queue status: idle, welcome new tasks - * - * @const - * @type {Number} - * @memberOf SeqQueueManager - */ -SeqQueueManager.STATUS_IDLE = 0; - -/** - * Queue status: busy, queue is working for some tasks now - * - * @const - * @type {Number} - * @memberOf SeqQueueManager - */ -SeqQueueManager.STATUS_BUSY = 1; - -/** - * Queue status: closed, queue has closed and would not receive task any more - * and is processing the remaining tasks now. - * - * @const - * @type {Number} - * @memberOf SeqQueueManager - */ -SeqQueueManager.STATUS_CLOSED = 2; - -/** - * Queue status: drained, queue is ready to be destroy - * - * @const - * @type {Number} - * @memberOf SeqQueueManager - */ -SeqQueueManager.STATUS_DRAINED = 3; - -/** - * Create Sequence queue - * - * @param {Number} timeout a global timeout for the new queue instance - * @return {Object} new queue instance - * @memberOf SeqQueueManager - */ -SeqQueueManager.createQueue = function(timeout) { - return new SeqQueue(timeout); -}; \ No newline at end of file diff --git a/node_modules/seq-queue/package.json b/node_modules/seq-queue/package.json deleted file mode 100644 index ec02f3a..0000000 --- a/node_modules/seq-queue/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "seq-queue", - "author": "changchang ", - "version": "0.0.5", - "description": "A simple tool to keep requests to be executed in order.", - "homepage": "https://github.com/changchang/seq-queue", - "repository": { - "type": "git", - "url": "git@github.com:changchang/seq-queue.git" - }, - "dependencies": { - }, - "devDependencies": { - "mocha": ">=0.0.1", - "should": ">=0.0.1" - } -} \ No newline at end of file diff --git a/node_modules/seq-queue/test/seq-queue-test.js b/node_modules/seq-queue/test/seq-queue-test.js deleted file mode 100644 index d91724a..0000000 --- a/node_modules/seq-queue/test/seq-queue-test.js +++ /dev/null @@ -1,307 +0,0 @@ -var should = require('should'); -var SeqQueue = require('../lib/seq-queue'); - -var timeout = 1000; - -describe('seq-queue', function() { - - describe('#createQueue', function() { - it('should return a seq-queue instance with init properties', function() { - var queue = SeqQueue.createQueue(timeout); - should.exist(queue); - queue.should.have.property('timeout', timeout); - queue.should.have.property('status', SeqQueue.IDLE); - }); - }); - - describe('#push' , function() { - it('should change the queue status from idle to busy and invoke the task at once when task finish when queue idle', function(done) { - var queue = SeqQueue.createQueue(timeout); - queue.should.have.property('status', SeqQueue.IDLE); - queue.push(function(task) { - should.exist(task); - task.done(); - queue.should.have.property('status', SeqQueue.IDLE); - done(); - }); - queue.should.have.property('status', SeqQueue.BUSY); - }); - - it('should keep the status busy and keep the new task wait until the former tasks finish when queue busy', function(done) { - var queue = SeqQueue.createQueue(timeout); - var formerTaskFinished = false; - //add first task - queue.push(function(task) { - formerTaskFinished = true; - task.done(); - }); - queue.should.have.property('status', SeqQueue.BUSY); - //add second task - queue.push(function(task) { - formerTaskFinished.should.be.true; - queue.should.have.property('status', SeqQueue.BUSY); - task.done(); - queue.should.have.property('status', SeqQueue.IDLE); - done(); - }); - queue.should.have.property('status', SeqQueue.BUSY); - }); - - it('should ok if the task call done() directly', function(done) { - var queue = SeqQueue.createQueue(); - var taskCount = 0; - queue.push(function(task) { - taskCount++; - task.done(); - }); - queue.push(function(task) { - taskCount++; - task.done(); - }); - setTimeout(function() { - taskCount.should.equal(2); - done(); - }, 500); - }); - }); - - describe('#close', function() { - it('should not accept new request but should execute the rest task in queue when close gracefully', function(done) { - var queue = SeqQueue.createQueue(timeout); - var closedEventCount = 0; - var drainedEventCount = 0; - queue.on('closed', function() { - closedEventCount++; - }); - queue.on('drained', function() { - drainedEventCount++; - }); - var executedTaskCount = 0; - queue.push(function(task) { - executedTaskCount++; - task.done(); - }).should.be.true; - queue.close(false); - queue.should.have.property('status', SeqQueue.CLOSED); - - queue.push(function(task) { - // never should be executed - executedTaskCount++; - task.done(); - }).should.be.false; - - // wait all task finished - setTimeout(function() { - executedTaskCount.should.equal(1); - closedEventCount.should.equal(1); - drainedEventCount.should.equal(1); - done(); - }, 1000); - }); - - it('should not execute any task and emit a drained event when close forcefully', function(done) { - var queue = SeqQueue.createQueue(timeout); - var drainedEventCount = 0; - queue.on('drained', function() { - drainedEventCount++; - }); - var executedTaskCount = 0; - queue.push(function(task) { - //never should be executed - executedTaskCount++; - task.done(); - }).should.be.true; - queue.close(true); - queue.should.have.property('status', SeqQueue.DRAINED); - - // wait all task finished - setTimeout(function() { - executedTaskCount.should.equal(0); - drainedEventCount.should.equal(1); - done(); - }, 1000); - }); - }); - - describe('#timeout', function() { - it('should emit timeout event and execute the next task when a task timeout by default', function(done) { - var queue = SeqQueue.createQueue(); - var executedTaskCount = 0; - var timeoutCount = 0; - var onTimeoutCount = 0; - //add timeout listener - queue.on('timeout', function(task) { - task.should.be.a('object'); - task.fn.should.be.a('function'); - timeoutCount++; - }); - - queue.push(function(task) { - executedTaskCount++; - //no task.done() invoke to cause a timeout - }, function() { - onTimeoutCount++; - }).should.be.true; - - queue.push(function(task) { - executedTaskCount++; - task.done(); - }).should.be.true; - - setTimeout(function() { - //wait all task finish - executedTaskCount.should.be.equal(2); - timeoutCount.should.be.equal(1); - onTimeoutCount.should.be.equal(1); - done(); - }, 4000); //default timeout is 3s - }); - - it('should return false when invoke task.done() if task has already timeout', function(done) { - var queue = SeqQueue.createQueue(); - var executedTaskCount = 0; - var timeoutCount = 0; - var timeout = 1000; - - //add timeout listener - queue.on('timeout', function(task) { - task.should.be.a('object'); - task.fn.should.be.a('function'); - timeoutCount++; - }); - - queue.push(function(task) { - executedTaskCount++; - task.done().should.be.true; - }).should.be.true; - - queue.push(function(task) { - //sleep to make a timeout - setTimeout(function() { - executedTaskCount++; - task.done().should.be.false; - }, timeout + 1000); - }, null, timeout).should.be.true; - - setTimeout(function() { - //wait all task finish - executedTaskCount.should.be.equal(2); - timeoutCount.should.be.equal(1); - done(); - }, 4000); - }); - - it('should never timeout after close forcefully', function(done) { - var queue = SeqQueue.createQueue(timeout); - var timeoutCount = 0; - //add timeout listener - queue.on('timeout', function(task) { - //should never enter here - timeoutCount++; - }); - - queue.push(function(task) { - //no task.done() invoke to cause a timeout - }).should.be.true; - - queue.close(true); - - setTimeout(function() { - //wait all task finish - timeoutCount.should.be.equal(0); - done(); - }, timeout * 2); - }); - - it('should use the global timeout value by default', function(done) { - var globalTimeout = timeout + 100; - var queue = SeqQueue.createQueue(globalTimeout); - //add timeout listener - queue.on('timeout', function(task) { - (Date.now() - start).should.not.be.below(globalTimeout); - done(); - }); - - queue.push(function(task) { - //no task.done() invoke to cause a timeout - }).should.be.true; - var start = Date.now(); - }); - - it('should use the timeout value in #push if it was assigned', function(done) { - var localTimeout = timeout / 2; - var queue = SeqQueue.createQueue(timeout); - //add timeout listener - queue.on('timeout', function(task) { - var diff = Date.now() - start; - diff.should.not.be.below(localTimeout); - diff.should.not.be.above(timeout); - done(); - }); - - queue.push(function(task) { - //no task.done() invoke to cause a timeout - }, null, localTimeout).should.be.true; - var start = Date.now(); - }); - }); - - describe('#error', function() { - it('should emit an error event and invoke next task when a task throws an event', function(done) { - var queue = SeqQueue.createQueue(); - var errorCount = 0; - var taskCount = 0; - //add timeout listener - queue.on('error', function(err, task) { - errorCount++; - should.exist(err); - should.exist(task); - }); - - queue.push(function(task) { - taskCount++; - throw new Error('some error'); - }).should.be.true; - - queue.push(function(task) { - taskCount++; - task.done(); - }); - - setTimeout(function() { - taskCount.should.equal(2); - errorCount.should.equal(1); - done(); - }, 500); - }); - - it('should be ok when task throw a error after done was invoked', function(done) { - var queue = SeqQueue.createQueue(); - var errorCount = 0; - var taskCount = 0; - //add timeout listener - queue.on('error', function(err, task) { - errorCount++; - should.exist(err); - should.exist(task); - }); - - queue.push(function(task) { - taskCount++; - task.done(); - throw new Error('some error'); - }).should.be.true; - - queue.push(function(task) { - taskCount++; - task.done(); - }); - - setTimeout(function() { - taskCount.should.equal(2); - errorCount.should.equal(1); - done(); - }, 500); - }); - }); -}); \ No newline at end of file diff --git a/node_modules/serve-static/HISTORY.md b/node_modules/serve-static/HISTORY.md index b34fe9f..6b58456 100644 --- a/node_modules/serve-static/HISTORY.md +++ b/node_modules/serve-static/HISTORY.md @@ -1,3 +1,165 @@ +1.15.0 / 2022-03-24 +=================== + + * deps: send@0.18.0 + - Fix emitted 416 error missing headers property + - Limit the headers removed for 304 response + - deps: depd@2.0.0 + - deps: destroy@1.2.0 + - deps: http-errors@2.0.0 + - deps: on-finished@2.4.1 + - deps: statuses@2.0.1 + +1.14.2 / 2021-12-15 +=================== + + * deps: send@0.17.2 + - deps: http-errors@1.8.1 + - deps: ms@2.1.3 + - pref: ignore empty http tokens + +1.14.1 / 2019-05-10 +=================== + + * Set stricter CSP header in redirect response + * deps: send@0.17.1 + - deps: range-parser@~1.2.1 + +1.14.0 / 2019-05-07 +=================== + + * deps: parseurl@~1.3.3 + * deps: send@0.17.0 + - deps: http-errors@~1.7.2 + - deps: mime@1.6.0 + - deps: ms@2.1.1 + - deps: statuses@~1.5.0 + - perf: remove redundant `path.normalize` call + +1.13.2 / 2018-02-07 +=================== + + * Fix incorrect end tag in redirects + * deps: encodeurl@~1.0.2 + - Fix encoding `%` as last character + * deps: send@0.16.2 + - deps: depd@~1.1.2 + - deps: encodeurl@~1.0.2 + - deps: statuses@~1.4.0 + +1.13.1 / 2017-09-29 +=================== + + * Fix regression when `root` is incorrectly set to a file + * deps: send@0.16.1 + +1.13.0 / 2017-09-27 +=================== + + * deps: send@0.16.0 + - Add 70 new types for file extensions + - Add `immutable` option + - Fix missing `` in default error & redirects + - Set charset as "UTF-8" for .js and .json + - Use instance methods on steam to check for listeners + - deps: mime@1.4.1 + - perf: improve path validation speed + +1.12.6 / 2017-09-22 +=================== + + * deps: send@0.15.6 + - deps: debug@2.6.9 + - perf: improve `If-Match` token parsing + * perf: improve slash collapsing + +1.12.5 / 2017-09-21 +=================== + + * deps: parseurl@~1.3.2 + - perf: reduce overhead for full URLs + - perf: unroll the "fast-path" `RegExp` + * deps: send@0.15.5 + - Fix handling of modified headers with invalid dates + - deps: etag@~1.8.1 + - deps: fresh@0.5.2 + +1.12.4 / 2017-08-05 +=================== + + * deps: send@0.15.4 + - deps: debug@2.6.8 + - deps: depd@~1.1.1 + - deps: http-errors@~1.6.2 + +1.12.3 / 2017-05-16 +=================== + + * deps: send@0.15.3 + - deps: debug@2.6.7 + +1.12.2 / 2017-04-26 +=================== + + * deps: send@0.15.2 + - deps: debug@2.6.4 + +1.12.1 / 2017-03-04 +=================== + + * deps: send@0.15.1 + - Fix issue when `Date.parse` does not return `NaN` on invalid date + - Fix strict violation in broken environments + +1.12.0 / 2017-02-25 +=================== + + * Send complete HTML document in redirect response + * Set default CSP header in redirect response + * deps: send@0.15.0 + - Fix false detection of `no-cache` request directive + - Fix incorrect result when `If-None-Match` has both `*` and ETags + - Fix weak `ETag` matching to match spec + - Remove usage of `res._headers` private field + - Support `If-Match` and `If-Unmodified-Since` headers + - Use `res.getHeaderNames()` when available + - Use `res.headersSent` when available + - deps: debug@2.6.1 + - deps: etag@~1.8.0 + - deps: fresh@0.5.0 + - deps: http-errors@~1.6.1 + +1.11.2 / 2017-01-23 +=================== + + * deps: send@0.14.2 + - deps: http-errors@~1.5.1 + - deps: ms@0.7.2 + - deps: statuses@~1.3.1 + +1.11.1 / 2016-06-10 +=================== + + * Fix redirect error when `req.url` contains raw non-URL characters + * deps: send@0.14.1 + +1.11.0 / 2016-06-07 +=================== + + * Use status code 301 for redirects + * deps: send@0.14.0 + - Add `acceptRanges` option + - Add `cacheControl` option + - Attempt to combine multiple ranges into single range + - Correctly inherit from `Stream` class + - Fix `Content-Range` header in 416 responses when using `start`/`end` options + - Fix `Content-Range` header missing from default 416 responses + - Ignore non-byte `Range` headers + - deps: http-errors@~1.5.0 + - deps: range-parser@~1.2.0 + - deps: statuses@~1.3.0 + - perf: remove argument reassignment + 1.10.3 / 2016-05-30 =================== diff --git a/node_modules/serve-static/LICENSE b/node_modules/serve-static/LICENSE index d8cce67..cbe62e8 100644 --- a/node_modules/serve-static/LICENSE +++ b/node_modules/serve-static/LICENSE @@ -3,7 +3,7 @@ Copyright (c) 2010 Sencha Inc. Copyright (c) 2011 LearnBoost Copyright (c) 2011 TJ Holowaychuk -Copyright (c) 2014-2015 Douglas Christopher Wilson +Copyright (c) 2014-2016 Douglas Christopher Wilson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/node_modules/serve-static/README.md b/node_modules/serve-static/README.md index 62104b1..262d944 100644 --- a/node_modules/serve-static/README.md +++ b/node_modules/serve-static/README.md @@ -1,14 +1,17 @@ # serve-static -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Linux Build][travis-image]][travis-url] +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Linux Build][github-actions-ci-image]][github-actions-ci-url] [![Windows Build][appveyor-image]][appveyor-url] [![Test Coverage][coveralls-image]][coveralls-url] -[![Gratipay][gratipay-image]][gratipay-url] ## Install +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 serve-static ``` @@ -29,6 +32,17 @@ to the next middleware, allowing for stacking and fall-backs. #### Options +##### acceptRanges + +Enable or disable accepting ranged requests, defaults to true. +Disabling this will not send `Accept-Ranges` and ignore the contents +of the `Range` request header. + +##### cacheControl + +Enable or disable setting `Cache-Control` response header, defaults to +true. Disabling this will ignore the `immutable` and `maxAge` options. + ##### dotfiles Set how "dotfiles" are treated when encountered. A dotfile is a file @@ -76,6 +90,14 @@ all methods. The default value is `true`. +##### immutable + +Enable or disable the `immutable` directive in the `Cache-Control` response +header, defaults to `false`. If set to `true`, the `maxAge` option should +also be specified to enable caching. The `immutable` directive will prevent +supported clients from making conditional requests during the life of the +`maxAge` option to check if the file has changed. + ##### index By default this module will send "index.html" files in response to a request @@ -117,12 +139,11 @@ var http = require('http') var serveStatic = require('serve-static') // Serve up public/ftp folder -var serve = serveStatic('public/ftp', {'index': ['index.html', 'index.htm']}) +var serve = serveStatic('public/ftp', { index: ['index.html', 'index.htm'] }) // Create server -var server = http.createServer(function(req, res){ - var done = finalhandler(req, res) - serve(req, res, done) +var server = http.createServer(function onRequest (req, res) { + serve(req, res, finalhandler(req, res)) }) // Listen @@ -139,19 +160,18 @@ var serveStatic = require('serve-static') // Serve up public/ftp folder var serve = serveStatic('public/ftp', { - 'index': false, - 'setHeaders': setHeaders + index: false, + setHeaders: setHeaders }) // Set header to force download -function setHeaders(res, path) { +function setHeaders (res, path) { res.setHeader('Content-Disposition', contentDisposition(path)) } // Create server -var server = http.createServer(function(req, res){ - var done = finalhandler(req, res) - serve(req, res, done) +var server = http.createServer(function onRequest (req, res) { + serve(req, res, finalhandler(req, res)) }) // Listen @@ -170,24 +190,25 @@ var serveStatic = require('serve-static') var app = express() -app.use(serveStatic('public/ftp', {'index': ['default.html', 'default.htm']})) +app.use(serveStatic('public/ftp', { index: ['default.html', 'default.htm'] })) app.listen(3000) ``` #### Multiple roots This example shows a simple way to search through multiple directories. -Files are look for in `public-optimized/` first, then `public/` second as -a fallback. +Files are searched for in `public-optimized/` first, then `public/` second +as a fallback. ```js var express = require('express') +var path = require('path') var serveStatic = require('serve-static') var app = express() -app.use(serveStatic(__dirname + '/public-optimized')) -app.use(serveStatic(__dirname + '/public')) +app.use(serveStatic(path.join(__dirname, 'public-optimized'))) +app.use(serveStatic(path.join(__dirname, 'public'))) app.listen(3000) ``` @@ -199,18 +220,19 @@ is for 1 day. ```js var express = require('express') +var path = require('path') var serveStatic = require('serve-static') var app = express() -app.use(serveStatic(__dirname + '/public', { +app.use(serveStatic(path.join(__dirname, 'public'), { maxAge: '1d', setHeaders: setCustomCacheControl })) app.listen(3000) -function setCustomCacheControl(res, path) { +function setCustomCacheControl (res, path) { if (serveStatic.mime.lookup(path) === 'text/html') { // Custom Cache-Control for HTML files res.setHeader('Cache-Control', 'public, max-age=0') @@ -222,15 +244,14 @@ function setCustomCacheControl(res, path) { [MIT](LICENSE) -[npm-image]: https://img.shields.io/npm/v/serve-static.svg -[npm-url]: https://npmjs.org/package/serve-static -[travis-image]: https://img.shields.io/travis/expressjs/serve-static/master.svg?label=linux -[travis-url]: https://travis-ci.org/expressjs/serve-static -[appveyor-image]: https://img.shields.io/appveyor/ci/dougwilson/serve-static/master.svg?label=windows +[appveyor-image]: https://badgen.net/appveyor/ci/dougwilson/serve-static/master?label=windows [appveyor-url]: https://ci.appveyor.com/project/dougwilson/serve-static -[coveralls-image]: https://img.shields.io/coveralls/expressjs/serve-static/master.svg -[coveralls-url]: https://coveralls.io/r/expressjs/serve-static -[downloads-image]: https://img.shields.io/npm/dm/serve-static.svg -[downloads-url]: https://npmjs.org/package/serve-static -[gratipay-image]: https://img.shields.io/gratipay/dougwilson.svg -[gratipay-url]: https://gratipay.com/dougwilson/ +[coveralls-image]: https://badgen.net/coveralls/c/github/expressjs/serve-static/master +[coveralls-url]: https://coveralls.io/r/expressjs/serve-static?branch=master +[github-actions-ci-image]: https://badgen.net/github/checks/expressjs/serve-static/master?label=linux +[github-actions-ci-url]: https://github.com/expressjs/serve-static/actions/workflows/ci.yml +[node-image]: https://badgen.net/npm/node/serve-static +[node-url]: https://nodejs.org/en/download/ +[npm-downloads-image]: https://badgen.net/npm/dm/serve-static +[npm-url]: https://npmjs.org/package/serve-static +[npm-version-image]: https://badgen.net/npm/v/serve-static diff --git a/node_modules/serve-static/index.js b/node_modules/serve-static/index.js index 5cebe74..b7d3984 100644 --- a/node_modules/serve-static/index.js +++ b/node_modules/serve-static/index.js @@ -2,7 +2,7 @@ * serve-static * Copyright(c) 2010 Sencha Inc. * Copyright(c) 2011 TJ Holowaychuk - * Copyright(c) 2014-2015 Douglas Christopher Wilson + * Copyright(c) 2014-2016 Douglas Christopher Wilson * MIT Licensed */ @@ -13,6 +13,7 @@ * @private */ +var encodeUrl = require('encodeurl') var escapeHtml = require('escape-html') var parseUrl = require('parseurl') var resolve = require('path').resolve @@ -131,7 +132,7 @@ function serveStatic (root, options) { */ function collapseLeadingSlashes (str) { for (var i = 0; i < str.length; i++) { - if (str[i] !== '/') { + if (str.charCodeAt(i) !== 0x2f /* / */) { break } } @@ -141,6 +142,27 @@ function collapseLeadingSlashes (str) { : str } +/** + * Create a minimal HTML document. + * + * @param {string} title + * @param {string} body + * @private + */ + +function createHtmlDocument (title, body) { + return '\n' + + '\n' + + '\n' + + '\n' + + '' + title + '\n' + + '\n' + + '\n' + + '
' + body + '
\n' + + '\n' + + '\n' +} + /** * Create a directory listener that just 404s. * @private @@ -158,7 +180,7 @@ function createNotFoundDirectoryListener () { */ function createRedirectDirectoryListener () { - return function redirect () { + return function redirect (res) { if (this.hasTrailingSlash()) { this.error(404) return @@ -172,16 +194,17 @@ function createRedirectDirectoryListener () { originalUrl.pathname = collapseLeadingSlashes(originalUrl.pathname + '/') // reformat the URL - var loc = url.format(originalUrl) - var msg = 'Redirecting to ' + escapeHtml(loc) + '\n' - var res = this.res + var loc = encodeUrl(url.format(originalUrl)) + var doc = createHtmlDocument('Redirecting', 'Redirecting to ' + + escapeHtml(loc) + '') // send redirect response - res.statusCode = 303 + res.statusCode = 301 res.setHeader('Content-Type', 'text/html; charset=UTF-8') - res.setHeader('Content-Length', Buffer.byteLength(msg)) + res.setHeader('Content-Length', Buffer.byteLength(doc)) + res.setHeader('Content-Security-Policy', "default-src 'none'") res.setHeader('X-Content-Type-Options', 'nosniff') res.setHeader('Location', loc) - res.end(msg) + res.end(doc) } } diff --git a/node_modules/serve-static/node_modules/debug/.jshintrc b/node_modules/serve-static/node_modules/debug/.jshintrc deleted file mode 100644 index 299877f..0000000 --- a/node_modules/serve-static/node_modules/debug/.jshintrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "laxbreak": true -} diff --git a/node_modules/serve-static/node_modules/debug/.npmignore b/node_modules/serve-static/node_modules/debug/.npmignore deleted file mode 100644 index 7e6163d..0000000 --- a/node_modules/serve-static/node_modules/debug/.npmignore +++ /dev/null @@ -1,6 +0,0 @@ -support -test -examples -example -*.sock -dist diff --git a/node_modules/serve-static/node_modules/debug/History.md b/node_modules/serve-static/node_modules/debug/History.md deleted file mode 100644 index 854c971..0000000 --- a/node_modules/serve-static/node_modules/debug/History.md +++ /dev/null @@ -1,195 +0,0 @@ - -2.2.0 / 2015-05-09 -================== - - * package: update "ms" to v0.7.1 (#202, @dougwilson) - * README: add logging to file example (#193, @DanielOchoa) - * README: fixed a typo (#191, @amir-s) - * browser: expose `storage` (#190, @stephenmathieson) - * Makefile: add a `distclean` target (#189, @stephenmathieson) - -2.1.3 / 2015-03-13 -================== - - * Updated stdout/stderr example (#186) - * Updated example/stdout.js to match debug current behaviour - * Renamed example/stderr.js to stdout.js - * Update Readme.md (#184) - * replace high intensity foreground color for bold (#182, #183) - -2.1.2 / 2015-03-01 -================== - - * dist: recompile - * update "ms" to v0.7.0 - * package: update "browserify" to v9.0.3 - * component: fix "ms.js" repo location - * changed bower package name - * updated documentation about using debug in a browser - * fix: security error on safari (#167, #168, @yields) - -2.1.1 / 2014-12-29 -================== - - * browser: use `typeof` to check for `console` existence - * browser: check for `console.log` truthiness (fix IE 8/9) - * browser: add support for Chrome apps - * Readme: added Windows usage remarks - * Add `bower.json` to properly support bower install - -2.1.0 / 2014-10-15 -================== - - * node: implement `DEBUG_FD` env variable support - * package: update "browserify" to v6.1.0 - * package: add "license" field to package.json (#135, @panuhorsmalahti) - -2.0.0 / 2014-09-01 -================== - - * package: update "browserify" to v5.11.0 - * node: use stderr rather than stdout for logging (#29, @stephenmathieson) - -1.0.4 / 2014-07-15 -================== - - * dist: recompile - * example: remove `console.info()` log usage - * example: add "Content-Type" UTF-8 header to browser example - * browser: place %c marker after the space character - * browser: reset the "content" color via `color: inherit` - * browser: add colors support for Firefox >= v31 - * debug: prefer an instance `log()` function over the global one (#119) - * Readme: update documentation about styled console logs for FF v31 (#116, @wryk) - -1.0.3 / 2014-07-09 -================== - - * Add support for multiple wildcards in namespaces (#122, @seegno) - * browser: fix lint - -1.0.2 / 2014-06-10 -================== - - * browser: update color palette (#113, @gscottolson) - * common: make console logging function configurable (#108, @timoxley) - * node: fix %o colors on old node <= 0.8.x - * Makefile: find node path using shell/which (#109, @timoxley) - -1.0.1 / 2014-06-06 -================== - - * browser: use `removeItem()` to clear localStorage - * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777) - * package: add "contributors" section - * node: fix comment typo - * README: list authors - -1.0.0 / 2014-06-04 -================== - - * make ms diff be global, not be scope - * debug: ignore empty strings in enable() - * node: make DEBUG_COLORS able to disable coloring - * *: export the `colors` array - * npmignore: don't publish the `dist` dir - * Makefile: refactor to use browserify - * package: add "browserify" as a dev dependency - * Readme: add Web Inspector Colors section - * node: reset terminal color for the debug content - * node: map "%o" to `util.inspect()` - * browser: map "%j" to `JSON.stringify()` - * debug: add custom "formatters" - * debug: use "ms" module for humanizing the diff - * Readme: add "bash" syntax highlighting - * browser: add Firebug color support - * browser: add colors for WebKit browsers - * node: apply log to `console` - * rewrite: abstract common logic for Node & browsers - * add .jshintrc file - -0.8.1 / 2014-04-14 -================== - - * package: re-add the "component" section - -0.8.0 / 2014-03-30 -================== - - * add `enable()` method for nodejs. Closes #27 - * change from stderr to stdout - * remove unnecessary index.js file - -0.7.4 / 2013-11-13 -================== - - * remove "browserify" key from package.json (fixes something in browserify) - -0.7.3 / 2013-10-30 -================== - - * fix: catch localStorage security error when cookies are blocked (Chrome) - * add debug(err) support. Closes #46 - * add .browser prop to package.json. Closes #42 - -0.7.2 / 2013-02-06 -================== - - * fix package.json - * fix: Mobile Safari (private mode) is broken with debug - * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript - -0.7.1 / 2013-02-05 -================== - - * add repository URL to package.json - * add DEBUG_COLORED to force colored output - * add browserify support - * fix component. Closes #24 - -0.7.0 / 2012-05-04 -================== - - * Added .component to package.json - * Added debug.component.js build - -0.6.0 / 2012-03-16 -================== - - * Added support for "-" prefix in DEBUG [Vinay Pulim] - * Added `.enabled` flag to the node version [TooTallNate] - -0.5.0 / 2012-02-02 -================== - - * Added: humanize diffs. Closes #8 - * Added `debug.disable()` to the CS variant - * Removed padding. Closes #10 - * Fixed: persist client-side variant again. Closes #9 - -0.4.0 / 2012-02-01 -================== - - * Added browser variant support for older browsers [TooTallNate] - * Added `debug.enable('project:*')` to browser variant [TooTallNate] - * Added padding to diff (moved it to the right) - -0.3.0 / 2012-01-26 -================== - - * Added millisecond diff when isatty, otherwise UTC string - -0.2.0 / 2012-01-22 -================== - - * Added wildcard support - -0.1.0 / 2011-12-02 -================== - - * Added: remove colors unless stderr isatty [TooTallNate] - -0.0.1 / 2010-01-03 -================== - - * Initial release diff --git a/node_modules/serve-static/node_modules/debug/Makefile b/node_modules/serve-static/node_modules/debug/Makefile deleted file mode 100644 index 5cf4a59..0000000 --- a/node_modules/serve-static/node_modules/debug/Makefile +++ /dev/null @@ -1,36 +0,0 @@ - -# get Makefile directory name: http://stackoverflow.com/a/5982798/376773 -THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) -THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd) - -# BIN directory -BIN := $(THIS_DIR)/node_modules/.bin - -# applications -NODE ?= $(shell which node) -NPM ?= $(NODE) $(shell which npm) -BROWSERIFY ?= $(NODE) $(BIN)/browserify - -all: dist/debug.js - -install: node_modules - -clean: - @rm -rf dist - -dist: - @mkdir -p $@ - -dist/debug.js: node_modules browser.js debug.js dist - @$(BROWSERIFY) \ - --standalone debug \ - . > $@ - -distclean: clean - @rm -rf node_modules - -node_modules: package.json - @NODE_ENV= $(NPM) install - @touch node_modules - -.PHONY: all install clean distclean diff --git a/node_modules/serve-static/node_modules/debug/Readme.md b/node_modules/serve-static/node_modules/debug/Readme.md deleted file mode 100644 index b4f45e3..0000000 --- a/node_modules/serve-static/node_modules/debug/Readme.md +++ /dev/null @@ -1,188 +0,0 @@ -# debug - - tiny node.js debugging utility modelled after node core's debugging technique. - -## Installation - -```bash -$ npm install debug -``` - -## Usage - - With `debug` you simply invoke the exported function to generate your debug function, passing it a name which will determine if a noop function is returned, or a decorated `console.error`, so all of the `console` format string goodies you're used to work fine. A unique color is selected per-function for visibility. - -Example _app.js_: - -```js -var debug = require('debug')('http') - , http = require('http') - , name = 'My App'; - -// fake app - -debug('booting %s', name); - -http.createServer(function(req, res){ - debug(req.method + ' ' + req.url); - res.end('hello\n'); -}).listen(3000, function(){ - debug('listening'); -}); - -// fake worker of some kind - -require('./worker'); -``` - -Example _worker.js_: - -```js -var debug = require('debug')('worker'); - -setInterval(function(){ - debug('doing some work'); -}, 1000); -``` - - The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples: - - ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png) - - ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png) - -#### Windows note - - On Windows the environment variable is set using the `set` command. - - ```cmd - set DEBUG=*,-not_this - ``` - -Then, run the program to be debugged as usual. - -## Millisecond diff - - When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. - - ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png) - - When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below: - - ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png) - -## Conventions - - If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". - -## Wildcards - - The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. - - You can also exclude specific debuggers by prefixing them with a "-" character. For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:". - -## Browser support - - Debug works in the browser as well, currently persisted by `localStorage`. Consider the situation shown below where you have `worker:a` and `worker:b`, and wish to debug both. Somewhere in the code on your page, include: - -```js -window.myDebug = require("debug"); -``` - - ("debug" is a global object in the browser so we give this object a different name.) When your page is open in the browser, type the following in the console: - -```js -myDebug.enable("worker:*") -``` - - Refresh the page. Debug output will continue to be sent to the console until it is disabled by typing `myDebug.disable()` in the console. - -```js -a = debug('worker:a'); -b = debug('worker:b'); - -setInterval(function(){ - a('doing some work'); -}, 1000); - -setInterval(function(){ - b('doing some work'); -}, 1200); -``` - -#### Web Inspector Colors - - Colors are also enabled on "Web Inspectors" that understand the `%c` formatting - option. These are WebKit web inspectors, Firefox ([since version - 31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) - and the Firebug plugin for Firefox (any version). - - Colored output looks something like: - - ![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png) - -### stderr vs stdout - -You can set an alternative logging method per-namespace by overriding the `log` method on a per-namespace or globally: - -Example _stdout.js_: - -```js -var debug = require('debug'); -var error = debug('app:error'); - -// by default stderr is used -error('goes to stderr!'); - -var log = debug('app:log'); -// set this namespace to log via console.log -log.log = console.log.bind(console); // don't forget to bind to console! -log('goes to stdout'); -error('still goes to stderr!'); - -// set all output to go via console.info -// overrides all per-namespace log settings -debug.log = console.info.bind(console); -error('now goes to stdout via console.info'); -log('still goes to stdout, but via console.info now'); -``` - -### Save debug output to a file - -You can save all debug statements to a file by piping them. - -Example: - -```bash -$ DEBUG_FD=3 node your-app.js 3> whatever.log -``` - -## Authors - - - TJ Holowaychuk - - Nathan Rajlich - -## License - -(The MIT License) - -Copyright (c) 2014 TJ Holowaychuk <tj@vision-media.ca> - -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/serve-static/node_modules/debug/bower.json b/node_modules/serve-static/node_modules/debug/bower.json deleted file mode 100644 index 6af573f..0000000 --- a/node_modules/serve-static/node_modules/debug/bower.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "visionmedia-debug", - "main": "dist/debug.js", - "version": "2.2.0", - "homepage": "https://github.com/visionmedia/debug", - "authors": [ - "TJ Holowaychuk " - ], - "description": "visionmedia-debug", - "moduleType": [ - "amd", - "es6", - "globals", - "node" - ], - "keywords": [ - "visionmedia", - "debug" - ], - "license": "MIT", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ] -} diff --git a/node_modules/serve-static/node_modules/debug/browser.js b/node_modules/serve-static/node_modules/debug/browser.js deleted file mode 100644 index 7c76452..0000000 --- a/node_modules/serve-static/node_modules/debug/browser.js +++ /dev/null @@ -1,168 +0,0 @@ - -/** - * This is the web browser implementation of `debug()`. - * - * Expose `debug()` as the module. - */ - -exports = module.exports = require('./debug'); -exports.log = log; -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; -exports.storage = 'undefined' != typeof chrome - && 'undefined' != typeof chrome.storage - ? chrome.storage.local - : localstorage(); - -/** - * Colors. - */ - -exports.colors = [ - 'lightseagreen', - 'forestgreen', - 'goldenrod', - 'dodgerblue', - 'darkorchid', - 'crimson' -]; - -/** - * Currently only WebKit-based Web Inspectors, Firefox >= v31, - * and the Firebug extension (any Firefox version) are known - * to support "%c" CSS customizations. - * - * TODO: add a `localStorage` variable to explicitly enable/disable colors - */ - -function useColors() { - // is webkit? http://stackoverflow.com/a/16459606/376773 - return ('WebkitAppearance' in document.documentElement.style) || - // is firebug? http://stackoverflow.com/a/398120/376773 - (window.console && (console.firebug || (console.exception && console.table))) || - // is firefox >= v31? - // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages - (navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31); -} - -/** - * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. - */ - -exports.formatters.j = function(v) { - return JSON.stringify(v); -}; - - -/** - * Colorize log arguments if enabled. - * - * @api public - */ - -function formatArgs() { - var args = arguments; - var useColors = this.useColors; - - args[0] = (useColors ? '%c' : '') - + this.namespace - + (useColors ? ' %c' : ' ') - + args[0] - + (useColors ? '%c ' : ' ') - + '+' + exports.humanize(this.diff); - - if (!useColors) return args; - - var c = 'color: ' + this.color; - args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1)); - - // the final "%c" is somewhat tricky, because there could be other - // arguments passed either before or after the %c, so we need to - // figure out the correct index to insert the CSS into - var index = 0; - var lastC = 0; - args[0].replace(/%[a-z%]/g, function(match) { - if ('%%' === match) return; - index++; - if ('%c' === match) { - // we only are interested in the *last* %c - // (the user may have provided their own) - lastC = index; - } - }); - - args.splice(lastC, 0, c); - return args; -} - -/** - * Invokes `console.log()` when available. - * No-op when `console.log` is not a "function". - * - * @api public - */ - -function log() { - // this hackery is required for IE8/9, where - // the `console.log` function doesn't have 'apply' - return 'object' === typeof console - && console.log - && Function.prototype.apply.call(console.log, console, arguments); -} - -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ - -function save(namespaces) { - try { - if (null == namespaces) { - exports.storage.removeItem('debug'); - } else { - exports.storage.debug = namespaces; - } - } catch(e) {} -} - -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ - -function load() { - var r; - try { - r = exports.storage.debug; - } catch(e) {} - return r; -} - -/** - * Enable namespaces listed in `localStorage.debug` initially. - */ - -exports.enable(load()); - -/** - * Localstorage attempts to return the localstorage. - * - * This is necessary because safari throws - * when a user disables cookies/localstorage - * and you attempt to access it. - * - * @return {LocalStorage} - * @api private - */ - -function localstorage(){ - try { - return window.localStorage; - } catch (e) {} -} diff --git a/node_modules/serve-static/node_modules/debug/component.json b/node_modules/serve-static/node_modules/debug/component.json deleted file mode 100644 index ca10637..0000000 --- a/node_modules/serve-static/node_modules/debug/component.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "debug", - "repo": "visionmedia/debug", - "description": "small debugging utility", - "version": "2.2.0", - "keywords": [ - "debug", - "log", - "debugger" - ], - "main": "browser.js", - "scripts": [ - "browser.js", - "debug.js" - ], - "dependencies": { - "rauchg/ms.js": "0.7.1" - } -} diff --git a/node_modules/serve-static/node_modules/debug/debug.js b/node_modules/serve-static/node_modules/debug/debug.js deleted file mode 100644 index 7571a86..0000000 --- a/node_modules/serve-static/node_modules/debug/debug.js +++ /dev/null @@ -1,197 +0,0 @@ - -/** - * This is the common logic for both the Node.js and web browser - * implementations of `debug()`. - * - * Expose `debug()` as the module. - */ - -exports = module.exports = debug; -exports.coerce = coerce; -exports.disable = disable; -exports.enable = enable; -exports.enabled = enabled; -exports.humanize = require('ms'); - -/** - * The currently active debug mode names, and names to skip. - */ - -exports.names = []; -exports.skips = []; - -/** - * Map of special "%n" handling functions, for the debug "format" argument. - * - * Valid key names are a single, lowercased letter, i.e. "n". - */ - -exports.formatters = {}; - -/** - * Previously assigned color. - */ - -var prevColor = 0; - -/** - * Previous log timestamp. - */ - -var prevTime; - -/** - * Select a color. - * - * @return {Number} - * @api private - */ - -function selectColor() { - return exports.colors[prevColor++ % exports.colors.length]; -} - -/** - * Create a debugger with the given `namespace`. - * - * @param {String} namespace - * @return {Function} - * @api public - */ - -function debug(namespace) { - - // define the `disabled` version - function disabled() { - } - disabled.enabled = false; - - // define the `enabled` version - function enabled() { - - var self = enabled; - - // set `diff` timestamp - var curr = +new Date(); - var ms = curr - (prevTime || curr); - self.diff = ms; - self.prev = prevTime; - self.curr = curr; - prevTime = curr; - - // add the `color` if not set - if (null == self.useColors) self.useColors = exports.useColors(); - if (null == self.color && self.useColors) self.color = selectColor(); - - var args = Array.prototype.slice.call(arguments); - - args[0] = exports.coerce(args[0]); - - if ('string' !== typeof args[0]) { - // anything else let's inspect with %o - args = ['%o'].concat(args); - } - - // apply any `formatters` transformations - var index = 0; - args[0] = args[0].replace(/%([a-z%])/g, function(match, format) { - // if we encounter an escaped % then don't increase the array index - if (match === '%%') return match; - index++; - var formatter = exports.formatters[format]; - if ('function' === typeof formatter) { - var val = args[index]; - match = formatter.call(self, val); - - // now we need to remove `args[index]` since it's inlined in the `format` - args.splice(index, 1); - index--; - } - return match; - }); - - if ('function' === typeof exports.formatArgs) { - args = exports.formatArgs.apply(self, args); - } - var logFn = enabled.log || exports.log || console.log.bind(console); - logFn.apply(self, args); - } - enabled.enabled = true; - - var fn = exports.enabled(namespace) ? enabled : disabled; - - fn.namespace = namespace; - - return fn; -} - -/** - * Enables a debug mode by namespaces. This can include modes - * separated by a colon and wildcards. - * - * @param {String} namespaces - * @api public - */ - -function enable(namespaces) { - exports.save(namespaces); - - var split = (namespaces || '').split(/[\s,]+/); - var len = split.length; - - for (var i = 0; i < len; i++) { - if (!split[i]) continue; // ignore empty strings - namespaces = split[i].replace(/\*/g, '.*?'); - if (namespaces[0] === '-') { - exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); - } else { - exports.names.push(new RegExp('^' + namespaces + '$')); - } - } -} - -/** - * Disable debug output. - * - * @api public - */ - -function disable() { - exports.enable(''); -} - -/** - * Returns true if the given mode name is enabled, false otherwise. - * - * @param {String} name - * @return {Boolean} - * @api public - */ - -function enabled(name) { - var i, len; - for (i = 0, len = exports.skips.length; i < len; i++) { - if (exports.skips[i].test(name)) { - return false; - } - } - for (i = 0, len = exports.names.length; i < len; i++) { - if (exports.names[i].test(name)) { - return true; - } - } - return false; -} - -/** - * Coerce `val`. - * - * @param {Mixed} val - * @return {Mixed} - * @api private - */ - -function coerce(val) { - if (val instanceof Error) return val.stack || val.message; - return val; -} diff --git a/node_modules/serve-static/node_modules/debug/node.js b/node_modules/serve-static/node_modules/debug/node.js deleted file mode 100644 index 1d392a8..0000000 --- a/node_modules/serve-static/node_modules/debug/node.js +++ /dev/null @@ -1,209 +0,0 @@ - -/** - * Module dependencies. - */ - -var tty = require('tty'); -var util = require('util'); - -/** - * This is the Node.js implementation of `debug()`. - * - * Expose `debug()` as the module. - */ - -exports = module.exports = require('./debug'); -exports.log = log; -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; - -/** - * Colors. - */ - -exports.colors = [6, 2, 3, 4, 5, 1]; - -/** - * The file descriptor to write the `debug()` calls to. - * Set the `DEBUG_FD` env variable to override with another value. i.e.: - * - * $ DEBUG_FD=3 node script.js 3>debug.log - */ - -var fd = parseInt(process.env.DEBUG_FD, 10) || 2; -var stream = 1 === fd ? process.stdout : - 2 === fd ? process.stderr : - createWritableStdioStream(fd); - -/** - * Is stdout a TTY? Colored output is enabled when `true`. - */ - -function useColors() { - var debugColors = (process.env.DEBUG_COLORS || '').trim().toLowerCase(); - if (0 === debugColors.length) { - return tty.isatty(fd); - } else { - return '0' !== debugColors - && 'no' !== debugColors - && 'false' !== debugColors - && 'disabled' !== debugColors; - } -} - -/** - * Map %o to `util.inspect()`, since Node doesn't do that out of the box. - */ - -var inspect = (4 === util.inspect.length ? - // node <= 0.8.x - function (v, colors) { - return util.inspect(v, void 0, void 0, colors); - } : - // node > 0.8.x - function (v, colors) { - return util.inspect(v, { colors: colors }); - } -); - -exports.formatters.o = function(v) { - return inspect(v, this.useColors) - .replace(/\s*\n\s*/g, ' '); -}; - -/** - * Adds ANSI color escape codes if enabled. - * - * @api public - */ - -function formatArgs() { - var args = arguments; - var useColors = this.useColors; - var name = this.namespace; - - if (useColors) { - var c = this.color; - - args[0] = ' \u001b[3' + c + ';1m' + name + ' ' - + '\u001b[0m' - + args[0] + '\u001b[3' + c + 'm' - + ' +' + exports.humanize(this.diff) + '\u001b[0m'; - } else { - args[0] = new Date().toUTCString() - + ' ' + name + ' ' + args[0]; - } - return args; -} - -/** - * Invokes `console.error()` with the specified arguments. - */ - -function log() { - return stream.write(util.format.apply(this, arguments) + '\n'); -} - -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ - -function save(namespaces) { - if (null == namespaces) { - // If you set a process.env field to null or undefined, it gets cast to the - // string 'null' or 'undefined'. Just delete instead. - delete process.env.DEBUG; - } else { - process.env.DEBUG = namespaces; - } -} - -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ - -function load() { - return process.env.DEBUG; -} - -/** - * Copied from `node/src/node.js`. - * - * XXX: It's lame that node doesn't expose this API out-of-the-box. It also - * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame. - */ - -function createWritableStdioStream (fd) { - var stream; - var tty_wrap = process.binding('tty_wrap'); - - // Note stream._type is used for test-module-load-list.js - - switch (tty_wrap.guessHandleType(fd)) { - case 'TTY': - stream = new tty.WriteStream(fd); - stream._type = 'tty'; - - // Hack to have stream not keep the event loop alive. - // See https://github.com/joyent/node/issues/1726 - if (stream._handle && stream._handle.unref) { - stream._handle.unref(); - } - break; - - case 'FILE': - var fs = require('fs'); - stream = new fs.SyncWriteStream(fd, { autoClose: false }); - stream._type = 'fs'; - break; - - case 'PIPE': - case 'TCP': - var net = require('net'); - stream = new net.Socket({ - fd: fd, - readable: false, - writable: true - }); - - // FIXME Should probably have an option in net.Socket to create a - // stream from an existing fd which is writable only. But for now - // we'll just add this hack and set the `readable` member to false. - // Test: ./node test/fixtures/echo.js < /etc/passwd - stream.readable = false; - stream.read = null; - stream._type = 'pipe'; - - // FIXME Hack to have stream not keep the event loop alive. - // See https://github.com/joyent/node/issues/1726 - if (stream._handle && stream._handle.unref) { - stream._handle.unref(); - } - break; - - default: - // Probably an error on in uv_guess_handle() - throw new Error('Implement me. Unknown stream file type!'); - } - - // For supporting legacy API we put the FD here. - stream.fd = fd; - - stream._isStdio = true; - - return stream; -} - -/** - * Enable namespaces listed in `process.env.DEBUG` initially. - */ - -exports.enable(load()); diff --git a/node_modules/serve-static/node_modules/debug/package.json b/node_modules/serve-static/node_modules/debug/package.json deleted file mode 100644 index b9f033a..0000000 --- a/node_modules/serve-static/node_modules/debug/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "debug", - "version": "2.2.0", - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/debug.git" - }, - "description": "small debugging utility", - "keywords": [ - "debug", - "log", - "debugger" - ], - "author": "TJ Holowaychuk ", - "contributors": [ - "Nathan Rajlich (http://n8.io)" - ], - "license": "MIT", - "dependencies": { - "ms": "0.7.1" - }, - "devDependencies": { - "browserify": "9.0.3", - "mocha": "*" - }, - "main": "./node.js", - "browser": "./browser.js", - "component": { - "scripts": { - "debug/index.js": "browser.js", - "debug/debug.js": "debug.js" - } - } -} diff --git a/node_modules/serve-static/node_modules/depd/History.md b/node_modules/serve-static/node_modules/depd/History.md deleted file mode 100644 index 507ecb8..0000000 --- a/node_modules/serve-static/node_modules/depd/History.md +++ /dev/null @@ -1,96 +0,0 @@ -1.1.2 / 2018-01-11 -================== - - * perf: remove argument reassignment - * Support Node.js 0.6 to 9.x - -1.1.1 / 2017-07-27 -================== - - * Remove unnecessary `Buffer` loading - * Support Node.js 0.6 to 8.x - -1.1.0 / 2015-09-14 -================== - - * Enable strict mode in more places - * Support io.js 3.x - * Support io.js 2.x - * Support web browser loading - - Requires bundler like Browserify or webpack - -1.0.1 / 2015-04-07 -================== - - * Fix `TypeError`s when under `'use strict'` code - * Fix useless type name on auto-generated messages - * Support io.js 1.x - * Support Node.js 0.12 - -1.0.0 / 2014-09-17 -================== - - * No changes - -0.4.5 / 2014-09-09 -================== - - * Improve call speed to functions using the function wrapper - * Support Node.js 0.6 - -0.4.4 / 2014-07-27 -================== - - * Work-around v8 generating empty stack traces - -0.4.3 / 2014-07-26 -================== - - * Fix exception when global `Error.stackTraceLimit` is too low - -0.4.2 / 2014-07-19 -================== - - * Correct call site for wrapped functions and properties - -0.4.1 / 2014-07-19 -================== - - * Improve automatic message generation for function properties - -0.4.0 / 2014-07-19 -================== - - * Add `TRACE_DEPRECATION` environment variable - * Remove non-standard grey color from color output - * Support `--no-deprecation` argument - * Support `--trace-deprecation` argument - * Support `deprecate.property(fn, prop, message)` - -0.3.0 / 2014-06-16 -================== - - * Add `NO_DEPRECATION` environment variable - -0.2.0 / 2014-06-15 -================== - - * Add `deprecate.property(obj, prop, message)` - * Remove `supports-color` dependency for node.js 0.8 - -0.1.0 / 2014-06-15 -================== - - * Add `deprecate.function(fn, message)` - * Add `process.on('deprecation', fn)` emitter - * Automatically generate message when omitted from `deprecate()` - -0.0.1 / 2014-06-15 -================== - - * Fix warning for dynamic calls at singe call site - -0.0.0 / 2014-06-15 -================== - - * Initial implementation diff --git a/node_modules/serve-static/node_modules/depd/LICENSE b/node_modules/serve-static/node_modules/depd/LICENSE deleted file mode 100644 index 84441fb..0000000 --- a/node_modules/serve-static/node_modules/depd/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2014-2017 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/serve-static/node_modules/depd/Readme.md b/node_modules/serve-static/node_modules/depd/Readme.md deleted file mode 100644 index 7790670..0000000 --- a/node_modules/serve-static/node_modules/depd/Readme.md +++ /dev/null @@ -1,280 +0,0 @@ -# depd - -[![NPM Version][npm-version-image]][npm-url] -[![NPM Downloads][npm-downloads-image]][npm-url] -[![Node.js Version][node-image]][node-url] -[![Linux Build][travis-image]][travis-url] -[![Windows Build][appveyor-image]][appveyor-url] -[![Coverage Status][coveralls-image]][coveralls-url] - -Deprecate all the things - -> With great modules comes great responsibility; mark things deprecated! - -## Install - -This module is installed directly using `npm`: - -```sh -$ npm install depd -``` - -This module can also be bundled with systems like -[Browserify](http://browserify.org/) or [webpack](https://webpack.github.io/), -though by default this module will alter it's API to no longer display or -track deprecations. - -## API - - - -```js -var deprecate = require('depd')('my-module') -``` - -This library allows you to display deprecation messages to your users. -This library goes above and beyond with deprecation warnings by -introspection of the call stack (but only the bits that it is interested -in). - -Instead of just warning on the first invocation of a deprecated -function and never again, this module will warn on the first invocation -of a deprecated function per unique call site, making it ideal to alert -users of all deprecated uses across the code base, rather than just -whatever happens to execute first. - -The deprecation warnings from this module also include the file and line -information for the call into the module that the deprecated function was -in. - -**NOTE** this library has a similar interface to the `debug` module, and -this module uses the calling file to get the boundary for the call stacks, -so you should always create a new `deprecate` object in each file and not -within some central file. - -### depd(namespace) - -Create a new deprecate function that uses the given namespace name in the -messages and will display the call site prior to the stack entering the -file this function was called from. It is highly suggested you use the -name of your module as the namespace. - -### deprecate(message) - -Call this function from deprecated code to display a deprecation message. -This message will appear once per unique caller site. Caller site is the -first call site in the stack in a different file from the caller of this -function. - -If the message is omitted, a message is generated for you based on the site -of the `deprecate()` call and will display the name of the function called, -similar to the name displayed in a stack trace. - -### deprecate.function(fn, message) - -Call this function to wrap a given function in a deprecation message on any -call to the function. An optional message can be supplied to provide a custom -message. - -### deprecate.property(obj, prop, message) - -Call this function to wrap a given property on object in a deprecation message -on any accessing or setting of the property. An optional message can be supplied -to provide a custom message. - -The method must be called on the object where the property belongs (not -inherited from the prototype). - -If the property is a data descriptor, it will be converted to an accessor -descriptor in order to display the deprecation message. - -### process.on('deprecation', fn) - -This module will allow easy capturing of deprecation errors by emitting the -errors as the type "deprecation" on the global `process`. If there are no -listeners for this type, the errors are written to STDERR as normal, but if -there are any listeners, nothing will be written to STDERR and instead only -emitted. From there, you can write the errors in a different format or to a -logging source. - -The error represents the deprecation and is emitted only once with the same -rules as writing to STDERR. The error has the following properties: - - - `message` - This is the message given by the library - - `name` - This is always `'DeprecationError'` - - `namespace` - This is the namespace the deprecation came from - - `stack` - This is the stack of the call to the deprecated thing - -Example `error.stack` output: - -``` -DeprecationError: my-cool-module deprecated oldfunction - at Object. ([eval]-wrapper:6:22) - at Module._compile (module.js:456:26) - at evalScript (node.js:532:25) - at startup (node.js:80:7) - at node.js:902:3 -``` - -### process.env.NO_DEPRECATION - -As a user of modules that are deprecated, the environment variable `NO_DEPRECATION` -is provided as a quick solution to silencing deprecation warnings from being -output. The format of this is similar to that of `DEBUG`: - -```sh -$ NO_DEPRECATION=my-module,othermod node app.js -``` - -This will suppress deprecations from being output for "my-module" and "othermod". -The value is a list of comma-separated namespaces. To suppress every warning -across all namespaces, use the value `*` for a namespace. - -Providing the argument `--no-deprecation` to the `node` executable will suppress -all deprecations (only available in Node.js 0.8 or higher). - -**NOTE** This will not suppress the deperecations given to any "deprecation" -event listeners, just the output to STDERR. - -### process.env.TRACE_DEPRECATION - -As a user of modules that are deprecated, the environment variable `TRACE_DEPRECATION` -is provided as a solution to getting more detailed location information in deprecation -warnings by including the entire stack trace. The format of this is the same as -`NO_DEPRECATION`: - -```sh -$ TRACE_DEPRECATION=my-module,othermod node app.js -``` - -This will include stack traces for deprecations being output for "my-module" and -"othermod". The value is a list of comma-separated namespaces. To trace every -warning across all namespaces, use the value `*` for a namespace. - -Providing the argument `--trace-deprecation` to the `node` executable will trace -all deprecations (only available in Node.js 0.8 or higher). - -**NOTE** This will not trace the deperecations silenced by `NO_DEPRECATION`. - -## Display - -![message](files/message.png) - -When a user calls a function in your library that you mark deprecated, they -will see the following written to STDERR (in the given colors, similar colors -and layout to the `debug` module): - -``` -bright cyan bright yellow -| | reset cyan -| | | | -▼ ▼ ▼ ▼ -my-cool-module deprecated oldfunction [eval]-wrapper:6:22 -▲ ▲ ▲ ▲ -| | | | -namespace | | location of mycoolmod.oldfunction() call - | deprecation message - the word "deprecated" -``` - -If the user redirects their STDERR to a file or somewhere that does not support -colors, they see (similar layout to the `debug` module): - -``` -Sun, 15 Jun 2014 05:21:37 GMT my-cool-module deprecated oldfunction at [eval]-wrapper:6:22 -▲ ▲ ▲ ▲ ▲ -| | | | | -timestamp of message namespace | | location of mycoolmod.oldfunction() call - | deprecation message - the word "deprecated" -``` - -## Examples - -### Deprecating all calls to a function - -This will display a deprecated message about "oldfunction" being deprecated -from "my-module" on STDERR. - -```js -var deprecate = require('depd')('my-cool-module') - -// message automatically derived from function name -// Object.oldfunction -exports.oldfunction = deprecate.function(function oldfunction () { - // all calls to function are deprecated -}) - -// specific message -exports.oldfunction = deprecate.function(function () { - // all calls to function are deprecated -}, 'oldfunction') -``` - -### Conditionally deprecating a function call - -This will display a deprecated message about "weirdfunction" being deprecated -from "my-module" on STDERR when called with less than 2 arguments. - -```js -var deprecate = require('depd')('my-cool-module') - -exports.weirdfunction = function () { - if (arguments.length < 2) { - // calls with 0 or 1 args are deprecated - deprecate('weirdfunction args < 2') - } -} -``` - -When calling `deprecate` as a function, the warning is counted per call site -within your own module, so you can display different deprecations depending -on different situations and the users will still get all the warnings: - -```js -var deprecate = require('depd')('my-cool-module') - -exports.weirdfunction = function () { - if (arguments.length < 2) { - // calls with 0 or 1 args are deprecated - deprecate('weirdfunction args < 2') - } else if (typeof arguments[0] !== 'string') { - // calls with non-string first argument are deprecated - deprecate('weirdfunction non-string first arg') - } -} -``` - -### Deprecating property access - -This will display a deprecated message about "oldprop" being deprecated -from "my-module" on STDERR when accessed. A deprecation will be displayed -when setting the value and when getting the value. - -```js -var deprecate = require('depd')('my-cool-module') - -exports.oldprop = 'something' - -// message automatically derives from property name -deprecate.property(exports, 'oldprop') - -// explicit message -deprecate.property(exports, 'oldprop', 'oldprop >= 0.10') -``` - -## License - -[MIT](LICENSE) - -[npm-version-image]: https://img.shields.io/npm/v/depd.svg -[npm-downloads-image]: https://img.shields.io/npm/dm/depd.svg -[npm-url]: https://npmjs.org/package/depd -[travis-image]: https://img.shields.io/travis/dougwilson/nodejs-depd/master.svg?label=linux -[travis-url]: https://travis-ci.org/dougwilson/nodejs-depd -[appveyor-image]: https://img.shields.io/appveyor/ci/dougwilson/nodejs-depd/master.svg?label=windows -[appveyor-url]: https://ci.appveyor.com/project/dougwilson/nodejs-depd -[coveralls-image]: https://img.shields.io/coveralls/dougwilson/nodejs-depd/master.svg -[coveralls-url]: https://coveralls.io/r/dougwilson/nodejs-depd?branch=master -[node-image]: https://img.shields.io/node/v/depd.svg -[node-url]: https://nodejs.org/en/download/ diff --git a/node_modules/serve-static/node_modules/depd/index.js b/node_modules/serve-static/node_modules/depd/index.js deleted file mode 100644 index d758d3c..0000000 --- a/node_modules/serve-static/node_modules/depd/index.js +++ /dev/null @@ -1,522 +0,0 @@ -/*! - * depd - * Copyright(c) 2014-2017 Douglas Christopher Wilson - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var callSiteToString = require('./lib/compat').callSiteToString -var eventListenerCount = require('./lib/compat').eventListenerCount -var relative = require('path').relative - -/** - * Module exports. - */ - -module.exports = depd - -/** - * Get the path to base files on. - */ - -var basePath = process.cwd() - -/** - * Determine if namespace is contained in the string. - */ - -function containsNamespace (str, namespace) { - var vals = str.split(/[ ,]+/) - var ns = String(namespace).toLowerCase() - - for (var i = 0; i < vals.length; i++) { - var val = vals[i] - - // namespace contained - if (val && (val === '*' || val.toLowerCase() === ns)) { - return true - } - } - - return false -} - -/** - * Convert a data descriptor to accessor descriptor. - */ - -function convertDataDescriptorToAccessor (obj, prop, message) { - var descriptor = Object.getOwnPropertyDescriptor(obj, prop) - var value = descriptor.value - - descriptor.get = function getter () { return value } - - if (descriptor.writable) { - descriptor.set = function setter (val) { return (value = val) } - } - - delete descriptor.value - delete descriptor.writable - - Object.defineProperty(obj, prop, descriptor) - - return descriptor -} - -/** - * Create arguments string to keep arity. - */ - -function createArgumentsString (arity) { - var str = '' - - for (var i = 0; i < arity; i++) { - str += ', arg' + i - } - - return str.substr(2) -} - -/** - * Create stack string from stack. - */ - -function createStackString (stack) { - var str = this.name + ': ' + this.namespace - - if (this.message) { - str += ' deprecated ' + this.message - } - - for (var i = 0; i < stack.length; i++) { - str += '\n at ' + callSiteToString(stack[i]) - } - - return str -} - -/** - * Create deprecate for namespace in caller. - */ - -function depd (namespace) { - if (!namespace) { - throw new TypeError('argument namespace is required') - } - - var stack = getStack() - var site = callSiteLocation(stack[1]) - var file = site[0] - - function deprecate (message) { - // call to self as log - log.call(deprecate, message) - } - - deprecate._file = file - deprecate._ignored = isignored(namespace) - deprecate._namespace = namespace - deprecate._traced = istraced(namespace) - deprecate._warned = Object.create(null) - - deprecate.function = wrapfunction - deprecate.property = wrapproperty - - return deprecate -} - -/** - * Determine if namespace is ignored. - */ - -function isignored (namespace) { - /* istanbul ignore next: tested in a child processs */ - if (process.noDeprecation) { - // --no-deprecation support - return true - } - - var str = process.env.NO_DEPRECATION || '' - - // namespace ignored - return containsNamespace(str, namespace) -} - -/** - * Determine if namespace is traced. - */ - -function istraced (namespace) { - /* istanbul ignore next: tested in a child processs */ - if (process.traceDeprecation) { - // --trace-deprecation support - return true - } - - var str = process.env.TRACE_DEPRECATION || '' - - // namespace traced - return containsNamespace(str, namespace) -} - -/** - * Display deprecation message. - */ - -function log (message, site) { - var haslisteners = eventListenerCount(process, 'deprecation') !== 0 - - // abort early if no destination - if (!haslisteners && this._ignored) { - return - } - - var caller - var callFile - var callSite - var depSite - var i = 0 - var seen = false - var stack = getStack() - var file = this._file - - if (site) { - // provided site - depSite = site - callSite = callSiteLocation(stack[1]) - callSite.name = depSite.name - file = callSite[0] - } else { - // get call site - i = 2 - depSite = callSiteLocation(stack[i]) - callSite = depSite - } - - // get caller of deprecated thing in relation to file - for (; i < stack.length; i++) { - caller = callSiteLocation(stack[i]) - callFile = caller[0] - - if (callFile === file) { - seen = true - } else if (callFile === this._file) { - file = this._file - } else if (seen) { - break - } - } - - var key = caller - ? depSite.join(':') + '__' + caller.join(':') - : undefined - - if (key !== undefined && key in this._warned) { - // already warned - return - } - - this._warned[key] = true - - // generate automatic message from call site - var msg = message - if (!msg) { - msg = callSite === depSite || !callSite.name - ? defaultMessage(depSite) - : defaultMessage(callSite) - } - - // emit deprecation if listeners exist - if (haslisteners) { - var err = DeprecationError(this._namespace, msg, stack.slice(i)) - process.emit('deprecation', err) - return - } - - // format and write message - var format = process.stderr.isTTY - ? formatColor - : formatPlain - var output = format.call(this, msg, caller, stack.slice(i)) - process.stderr.write(output + '\n', 'utf8') -} - -/** - * Get call site location as array. - */ - -function callSiteLocation (callSite) { - var file = callSite.getFileName() || '' - var line = callSite.getLineNumber() - var colm = callSite.getColumnNumber() - - if (callSite.isEval()) { - file = callSite.getEvalOrigin() + ', ' + file - } - - var site = [file, line, colm] - - site.callSite = callSite - site.name = callSite.getFunctionName() - - return site -} - -/** - * Generate a default message from the site. - */ - -function defaultMessage (site) { - var callSite = site.callSite - var funcName = site.name - - // make useful anonymous name - if (!funcName) { - funcName = '' - } - - var context = callSite.getThis() - var typeName = context && callSite.getTypeName() - - // ignore useless type name - if (typeName === 'Object') { - typeName = undefined - } - - // make useful type name - if (typeName === 'Function') { - typeName = context.name || typeName - } - - return typeName && callSite.getMethodName() - ? typeName + '.' + funcName - : funcName -} - -/** - * Format deprecation message without color. - */ - -function formatPlain (msg, caller, stack) { - var timestamp = new Date().toUTCString() - - var formatted = timestamp + - ' ' + this._namespace + - ' deprecated ' + msg - - // add stack trace - if (this._traced) { - for (var i = 0; i < stack.length; i++) { - formatted += '\n at ' + callSiteToString(stack[i]) - } - - return formatted - } - - if (caller) { - formatted += ' at ' + formatLocation(caller) - } - - return formatted -} - -/** - * Format deprecation message with color. - */ - -function formatColor (msg, caller, stack) { - var formatted = '\x1b[36;1m' + this._namespace + '\x1b[22;39m' + // bold cyan - ' \x1b[33;1mdeprecated\x1b[22;39m' + // bold yellow - ' \x1b[0m' + msg + '\x1b[39m' // reset - - // add stack trace - if (this._traced) { - for (var i = 0; i < stack.length; i++) { - formatted += '\n \x1b[36mat ' + callSiteToString(stack[i]) + '\x1b[39m' // cyan - } - - return formatted - } - - if (caller) { - formatted += ' \x1b[36m' + formatLocation(caller) + '\x1b[39m' // cyan - } - - return formatted -} - -/** - * Format call site location. - */ - -function formatLocation (callSite) { - return relative(basePath, callSite[0]) + - ':' + callSite[1] + - ':' + callSite[2] -} - -/** - * Get the stack as array of call sites. - */ - -function getStack () { - var limit = Error.stackTraceLimit - var obj = {} - var prep = Error.prepareStackTrace - - Error.prepareStackTrace = prepareObjectStackTrace - Error.stackTraceLimit = Math.max(10, limit) - - // capture the stack - Error.captureStackTrace(obj) - - // slice this function off the top - var stack = obj.stack.slice(1) - - Error.prepareStackTrace = prep - Error.stackTraceLimit = limit - - return stack -} - -/** - * Capture call site stack from v8. - */ - -function prepareObjectStackTrace (obj, stack) { - return stack -} - -/** - * Return a wrapped function in a deprecation message. - */ - -function wrapfunction (fn, message) { - if (typeof fn !== 'function') { - throw new TypeError('argument fn must be a function') - } - - var args = createArgumentsString(fn.length) - var deprecate = this // eslint-disable-line no-unused-vars - var stack = getStack() - var site = callSiteLocation(stack[1]) - - site.name = fn.name - - // eslint-disable-next-line no-eval - var deprecatedfn = eval('(function (' + args + ') {\n' + - '"use strict"\n' + - 'log.call(deprecate, message, site)\n' + - 'return fn.apply(this, arguments)\n' + - '})') - - return deprecatedfn -} - -/** - * Wrap property in a deprecation message. - */ - -function wrapproperty (obj, prop, message) { - if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) { - throw new TypeError('argument obj must be object') - } - - var descriptor = Object.getOwnPropertyDescriptor(obj, prop) - - if (!descriptor) { - throw new TypeError('must call property on owner object') - } - - if (!descriptor.configurable) { - throw new TypeError('property must be configurable') - } - - var deprecate = this - var stack = getStack() - var site = callSiteLocation(stack[1]) - - // set site name - site.name = prop - - // convert data descriptor - if ('value' in descriptor) { - descriptor = convertDataDescriptorToAccessor(obj, prop, message) - } - - var get = descriptor.get - var set = descriptor.set - - // wrap getter - if (typeof get === 'function') { - descriptor.get = function getter () { - log.call(deprecate, message, site) - return get.apply(this, arguments) - } - } - - // wrap setter - if (typeof set === 'function') { - descriptor.set = function setter () { - log.call(deprecate, message, site) - return set.apply(this, arguments) - } - } - - Object.defineProperty(obj, prop, descriptor) -} - -/** - * Create DeprecationError for deprecation - */ - -function DeprecationError (namespace, message, stack) { - var error = new Error() - var stackString - - Object.defineProperty(error, 'constructor', { - value: DeprecationError - }) - - Object.defineProperty(error, 'message', { - configurable: true, - enumerable: false, - value: message, - writable: true - }) - - Object.defineProperty(error, 'name', { - enumerable: false, - configurable: true, - value: 'DeprecationError', - writable: true - }) - - Object.defineProperty(error, 'namespace', { - configurable: true, - enumerable: false, - value: namespace, - writable: true - }) - - Object.defineProperty(error, 'stack', { - configurable: true, - enumerable: false, - get: function () { - if (stackString !== undefined) { - return stackString - } - - // prepare stack trace - return (stackString = createStackString.call(this, stack)) - }, - set: function setter (val) { - stackString = val - } - }) - - return error -} diff --git a/node_modules/serve-static/node_modules/depd/lib/browser/index.js b/node_modules/serve-static/node_modules/depd/lib/browser/index.js deleted file mode 100644 index 6be45cc..0000000 --- a/node_modules/serve-static/node_modules/depd/lib/browser/index.js +++ /dev/null @@ -1,77 +0,0 @@ -/*! - * depd - * Copyright(c) 2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module exports. - * @public - */ - -module.exports = depd - -/** - * Create deprecate for namespace in caller. - */ - -function depd (namespace) { - if (!namespace) { - throw new TypeError('argument namespace is required') - } - - function deprecate (message) { - // no-op in browser - } - - deprecate._file = undefined - deprecate._ignored = true - deprecate._namespace = namespace - deprecate._traced = false - deprecate._warned = Object.create(null) - - deprecate.function = wrapfunction - deprecate.property = wrapproperty - - return deprecate -} - -/** - * Return a wrapped function in a deprecation message. - * - * This is a no-op version of the wrapper, which does nothing but call - * validation. - */ - -function wrapfunction (fn, message) { - if (typeof fn !== 'function') { - throw new TypeError('argument fn must be a function') - } - - return fn -} - -/** - * Wrap property in a deprecation message. - * - * This is a no-op version of the wrapper, which does nothing but call - * validation. - */ - -function wrapproperty (obj, prop, message) { - if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) { - throw new TypeError('argument obj must be object') - } - - var descriptor = Object.getOwnPropertyDescriptor(obj, prop) - - if (!descriptor) { - throw new TypeError('must call property on owner object') - } - - if (!descriptor.configurable) { - throw new TypeError('property must be configurable') - } -} diff --git a/node_modules/serve-static/node_modules/depd/lib/compat/callsite-tostring.js b/node_modules/serve-static/node_modules/depd/lib/compat/callsite-tostring.js deleted file mode 100644 index 73186dc..0000000 --- a/node_modules/serve-static/node_modules/depd/lib/compat/callsite-tostring.js +++ /dev/null @@ -1,103 +0,0 @@ -/*! - * depd - * Copyright(c) 2014 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module exports. - */ - -module.exports = callSiteToString - -/** - * Format a CallSite file location to a string. - */ - -function callSiteFileLocation (callSite) { - var fileName - var fileLocation = '' - - if (callSite.isNative()) { - fileLocation = 'native' - } else if (callSite.isEval()) { - fileName = callSite.getScriptNameOrSourceURL() - if (!fileName) { - fileLocation = callSite.getEvalOrigin() - } - } else { - fileName = callSite.getFileName() - } - - if (fileName) { - fileLocation += fileName - - var lineNumber = callSite.getLineNumber() - if (lineNumber != null) { - fileLocation += ':' + lineNumber - - var columnNumber = callSite.getColumnNumber() - if (columnNumber) { - fileLocation += ':' + columnNumber - } - } - } - - return fileLocation || 'unknown source' -} - -/** - * Format a CallSite to a string. - */ - -function callSiteToString (callSite) { - var addSuffix = true - var fileLocation = callSiteFileLocation(callSite) - var functionName = callSite.getFunctionName() - var isConstructor = callSite.isConstructor() - var isMethodCall = !(callSite.isToplevel() || isConstructor) - var line = '' - - if (isMethodCall) { - var methodName = callSite.getMethodName() - var typeName = getConstructorName(callSite) - - if (functionName) { - if (typeName && functionName.indexOf(typeName) !== 0) { - line += typeName + '.' - } - - line += functionName - - if (methodName && functionName.lastIndexOf('.' + methodName) !== functionName.length - methodName.length - 1) { - line += ' [as ' + methodName + ']' - } - } else { - line += typeName + '.' + (methodName || '') - } - } else if (isConstructor) { - line += 'new ' + (functionName || '') - } else if (functionName) { - line += functionName - } else { - addSuffix = false - line += fileLocation - } - - if (addSuffix) { - line += ' (' + fileLocation + ')' - } - - return line -} - -/** - * Get constructor name of reviver. - */ - -function getConstructorName (obj) { - var receiver = obj.receiver - return (receiver.constructor && receiver.constructor.name) || null -} diff --git a/node_modules/serve-static/node_modules/depd/lib/compat/event-listener-count.js b/node_modules/serve-static/node_modules/depd/lib/compat/event-listener-count.js deleted file mode 100644 index 3a8925d..0000000 --- a/node_modules/serve-static/node_modules/depd/lib/compat/event-listener-count.js +++ /dev/null @@ -1,22 +0,0 @@ -/*! - * depd - * Copyright(c) 2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module exports. - * @public - */ - -module.exports = eventListenerCount - -/** - * Get the count of listeners on an event emitter of a specific type. - */ - -function eventListenerCount (emitter, type) { - return emitter.listeners(type).length -} diff --git a/node_modules/serve-static/node_modules/depd/lib/compat/index.js b/node_modules/serve-static/node_modules/depd/lib/compat/index.js deleted file mode 100644 index 955b333..0000000 --- a/node_modules/serve-static/node_modules/depd/lib/compat/index.js +++ /dev/null @@ -1,79 +0,0 @@ -/*! - * depd - * Copyright(c) 2014-2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var EventEmitter = require('events').EventEmitter - -/** - * Module exports. - * @public - */ - -lazyProperty(module.exports, 'callSiteToString', function callSiteToString () { - var limit = Error.stackTraceLimit - var obj = {} - var prep = Error.prepareStackTrace - - function prepareObjectStackTrace (obj, stack) { - return stack - } - - Error.prepareStackTrace = prepareObjectStackTrace - Error.stackTraceLimit = 2 - - // capture the stack - Error.captureStackTrace(obj) - - // slice the stack - var stack = obj.stack.slice() - - Error.prepareStackTrace = prep - Error.stackTraceLimit = limit - - return stack[0].toString ? toString : require('./callsite-tostring') -}) - -lazyProperty(module.exports, 'eventListenerCount', function eventListenerCount () { - return EventEmitter.listenerCount || require('./event-listener-count') -}) - -/** - * Define a lazy property. - */ - -function lazyProperty (obj, prop, getter) { - function get () { - var val = getter() - - Object.defineProperty(obj, prop, { - configurable: true, - enumerable: true, - value: val - }) - - return val - } - - Object.defineProperty(obj, prop, { - configurable: true, - enumerable: true, - get: get - }) -} - -/** - * Call toString() on the obj - */ - -function toString (obj) { - return obj.toString() -} diff --git a/node_modules/serve-static/node_modules/depd/package.json b/node_modules/serve-static/node_modules/depd/package.json deleted file mode 100644 index 5e3c863..0000000 --- a/node_modules/serve-static/node_modules/depd/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "depd", - "description": "Deprecate all the things", - "version": "1.1.2", - "author": "Douglas Christopher Wilson ", - "license": "MIT", - "keywords": [ - "deprecate", - "deprecated" - ], - "repository": "dougwilson/nodejs-depd", - "browser": "lib/browser/index.js", - "devDependencies": { - "benchmark": "2.1.4", - "beautify-benchmark": "0.2.4", - "eslint": "3.19.0", - "eslint-config-standard": "7.1.0", - "eslint-plugin-markdown": "1.0.0-beta.7", - "eslint-plugin-promise": "3.6.0", - "eslint-plugin-standard": "3.0.1", - "istanbul": "0.4.5", - "mocha": "~1.21.5" - }, - "files": [ - "lib/", - "History.md", - "LICENSE", - "index.js", - "Readme.md" - ], - "engines": { - "node": ">= 0.6" - }, - "scripts": { - "bench": "node benchmark/index.js", - "lint": "eslint --plugin markdown --ext js,md .", - "test": "mocha --reporter spec --bail test/", - "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --no-exit test/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/" - } -} diff --git a/node_modules/serve-static/node_modules/destroy/LICENSE b/node_modules/serve-static/node_modules/destroy/LICENSE deleted file mode 100644 index a7ae8ee..0000000 --- a/node_modules/serve-static/node_modules/destroy/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ - -The MIT License (MIT) - -Copyright (c) 2014 Jonathan Ong me@jongleberry.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/serve-static/node_modules/destroy/README.md b/node_modules/serve-static/node_modules/destroy/README.md deleted file mode 100644 index 6474bc3..0000000 --- a/node_modules/serve-static/node_modules/destroy/README.md +++ /dev/null @@ -1,60 +0,0 @@ -# Destroy - -[![NPM version][npm-image]][npm-url] -[![Build status][travis-image]][travis-url] -[![Test coverage][coveralls-image]][coveralls-url] -[![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] -[![Gittip][gittip-image]][gittip-url] - -Destroy a stream. - -This module is meant to ensure a stream gets destroyed, handling different APIs -and Node.js bugs. - -## API - -```js -var destroy = require('destroy') -``` - -### destroy(stream) - -Destroy the given stream. In most cases, this is identical to a simple -`stream.destroy()` call. The rules are as follows for a given stream: - - 1. If the `stream` is an instance of `ReadStream`, then call `stream.destroy()` - and add a listener to the `open` event to call `stream.close()` if it is - fired. This is for a Node.js bug that will leak a file descriptor if - `.destroy()` is called before `open`. - 2. If the `stream` is not an instance of `Stream`, then nothing happens. - 3. If the `stream` has a `.destroy()` method, then call it. - -The function returns the `stream` passed in as the argument. - -## Example - -```js -var destroy = require('destroy') - -var fs = require('fs') -var stream = fs.createReadStream('package.json') - -// ... and later -destroy(stream) -``` - -[npm-image]: https://img.shields.io/npm/v/destroy.svg?style=flat-square -[npm-url]: https://npmjs.org/package/destroy -[github-tag]: http://img.shields.io/github/tag/stream-utils/destroy.svg?style=flat-square -[github-url]: https://github.com/stream-utils/destroy/tags -[travis-image]: https://img.shields.io/travis/stream-utils/destroy.svg?style=flat-square -[travis-url]: https://travis-ci.org/stream-utils/destroy -[coveralls-image]: https://img.shields.io/coveralls/stream-utils/destroy.svg?style=flat-square -[coveralls-url]: https://coveralls.io/r/stream-utils/destroy?branch=master -[license-image]: http://img.shields.io/npm/l/destroy.svg?style=flat-square -[license-url]: LICENSE.md -[downloads-image]: http://img.shields.io/npm/dm/destroy.svg?style=flat-square -[downloads-url]: https://npmjs.org/package/destroy -[gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square -[gittip-url]: https://www.gittip.com/jonathanong/ diff --git a/node_modules/serve-static/node_modules/destroy/index.js b/node_modules/serve-static/node_modules/destroy/index.js deleted file mode 100644 index 6da2d26..0000000 --- a/node_modules/serve-static/node_modules/destroy/index.js +++ /dev/null @@ -1,75 +0,0 @@ -/*! - * destroy - * Copyright(c) 2014 Jonathan Ong - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var ReadStream = require('fs').ReadStream -var Stream = require('stream') - -/** - * Module exports. - * @public - */ - -module.exports = destroy - -/** - * Destroy a stream. - * - * @param {object} stream - * @public - */ - -function destroy(stream) { - if (stream instanceof ReadStream) { - return destroyReadStream(stream) - } - - if (!(stream instanceof Stream)) { - return stream - } - - if (typeof stream.destroy === 'function') { - stream.destroy() - } - - return stream -} - -/** - * Destroy a ReadStream. - * - * @param {object} stream - * @private - */ - -function destroyReadStream(stream) { - stream.destroy() - - if (typeof stream.close === 'function') { - // node.js core bug work-around - stream.on('open', onOpenClose) - } - - return stream -} - -/** - * On open handler to close stream. - * @private - */ - -function onOpenClose() { - if (typeof this.fd === 'number') { - // actually close down the fd - this.close() - } -} diff --git a/node_modules/serve-static/node_modules/destroy/package.json b/node_modules/serve-static/node_modules/destroy/package.json deleted file mode 100644 index 024bff9..0000000 --- a/node_modules/serve-static/node_modules/destroy/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "destroy", - "description": "destroy a stream if possible", - "version": "1.0.4", - "author": { - "name": "Jonathan Ong", - "email": "me@jongleberry.com", - "url": "http://jongleberry.com", - "twitter": "https://twitter.com/jongleberry" - }, - "contributors": [ - "Douglas Christopher Wilson " - ], - "license": "MIT", - "repository": "stream-utils/destroy", - "devDependencies": { - "istanbul": "0.4.2", - "mocha": "2.3.4" - }, - "scripts": { - "test": "mocha --reporter spec", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot" - }, - "files": [ - "index.js", - "LICENSE" - ], - "keywords": [ - "stream", - "streams", - "destroy", - "cleanup", - "leak", - "fd" - ] -} diff --git a/node_modules/serve-static/node_modules/escape-html/LICENSE b/node_modules/serve-static/node_modules/escape-html/LICENSE deleted file mode 100644 index 2e70de9..0000000 --- a/node_modules/serve-static/node_modules/escape-html/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -(The MIT License) - -Copyright (c) 2012-2013 TJ Holowaychuk -Copyright (c) 2015 Andreas Lubbe -Copyright (c) 2015 Tiancheng "Timothy" Gu - -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/serve-static/node_modules/escape-html/Readme.md b/node_modules/serve-static/node_modules/escape-html/Readme.md deleted file mode 100644 index 653d9ea..0000000 --- a/node_modules/serve-static/node_modules/escape-html/Readme.md +++ /dev/null @@ -1,43 +0,0 @@ - -# escape-html - - Escape string for use in HTML - -## Example - -```js -var escape = require('escape-html'); -var html = escape('foo & bar'); -// -> foo & bar -``` - -## Benchmark - -``` -$ npm run-script bench - -> escape-html@1.0.3 bench nodejs-escape-html -> node benchmark/index.js - - - http_parser@1.0 - node@0.10.33 - v8@3.14.5.9 - ares@1.9.0-DEV - uv@0.10.29 - zlib@1.2.3 - modules@11 - openssl@1.0.1j - - 1 test completed. - 2 tests completed. - 3 tests completed. - - no special characters x 19,435,271 ops/sec ±0.85% (187 runs sampled) - single special character x 6,132,421 ops/sec ±0.67% (194 runs sampled) - many special characters x 3,175,826 ops/sec ±0.65% (193 runs sampled) -``` - -## License - - MIT \ No newline at end of file diff --git a/node_modules/serve-static/node_modules/escape-html/index.js b/node_modules/serve-static/node_modules/escape-html/index.js deleted file mode 100644 index bf9e226..0000000 --- a/node_modules/serve-static/node_modules/escape-html/index.js +++ /dev/null @@ -1,78 +0,0 @@ -/*! - * escape-html - * Copyright(c) 2012-2013 TJ Holowaychuk - * Copyright(c) 2015 Andreas Lubbe - * Copyright(c) 2015 Tiancheng "Timothy" Gu - * MIT Licensed - */ - -'use strict'; - -/** - * Module variables. - * @private - */ - -var matchHtmlRegExp = /["'&<>]/; - -/** - * Module exports. - * @public - */ - -module.exports = escapeHtml; - -/** - * Escape special characters in the given string of html. - * - * @param {string} string The string to escape for inserting into HTML - * @return {string} - * @public - */ - -function escapeHtml(string) { - var str = '' + string; - var match = matchHtmlRegExp.exec(str); - - if (!match) { - return str; - } - - var escape; - var html = ''; - var index = 0; - var lastIndex = 0; - - for (index = match.index; index < str.length; index++) { - switch (str.charCodeAt(index)) { - case 34: // " - escape = '"'; - break; - case 38: // & - escape = '&'; - break; - case 39: // ' - escape = '''; - break; - case 60: // < - escape = '<'; - break; - case 62: // > - escape = '>'; - break; - default: - continue; - } - - if (lastIndex !== index) { - html += str.substring(lastIndex, index); - } - - lastIndex = index + 1; - html += escape; - } - - return lastIndex !== index - ? html + str.substring(lastIndex, index) - : html; -} diff --git a/node_modules/serve-static/node_modules/escape-html/package.json b/node_modules/serve-static/node_modules/escape-html/package.json deleted file mode 100644 index 57ec7bd..0000000 --- a/node_modules/serve-static/node_modules/escape-html/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "escape-html", - "description": "Escape string for use in HTML", - "version": "1.0.3", - "license": "MIT", - "keywords": [ - "escape", - "html", - "utility" - ], - "repository": "component/escape-html", - "devDependencies": { - "benchmark": "1.0.0", - "beautify-benchmark": "0.2.4" - }, - "files": [ - "LICENSE", - "Readme.md", - "index.js" - ], - "scripts": { - "bench": "node benchmark/index.js" - } -} diff --git a/node_modules/serve-static/node_modules/http-errors/HISTORY.md b/node_modules/serve-static/node_modules/http-errors/HISTORY.md deleted file mode 100644 index 4c7087d..0000000 --- a/node_modules/serve-static/node_modules/http-errors/HISTORY.md +++ /dev/null @@ -1,76 +0,0 @@ -2015-02-02 / 1.3.1 -================== - - * Fix regression where status can be overwritten in `createError` `props` - -2015-02-01 / 1.3.0 -================== - - * Construct errors using defined constructors from `createError` - * Fix error names that are not identifiers - - `createError["I'mateapot"]` is now `createError.ImATeapot` - * Set a meaningful `name` property on constructed errors - -2014-12-09 / 1.2.8 -================== - - * Fix stack trace from exported function - * Remove `arguments.callee` usage - -2014-10-14 / 1.2.7 -================== - - * Remove duplicate line - -2014-10-02 / 1.2.6 -================== - - * Fix `expose` to be `true` for `ClientError` constructor - -2014-09-28 / 1.2.5 -================== - - * deps: statuses@1 - -2014-09-21 / 1.2.4 -================== - - * Fix dependency version to work with old `npm`s - -2014-09-21 / 1.2.3 -================== - - * deps: statuses@~1.1.0 - -2014-09-21 / 1.2.2 -================== - - * Fix publish error - -2014-09-21 / 1.2.1 -================== - - * Support Node.js 0.6 - * Use `inherits` instead of `util` - -2014-09-09 / 1.2.0 -================== - - * Fix the way inheriting functions - * Support `expose` being provided in properties argument - -2014-09-08 / 1.1.0 -================== - - * Default status to 500 - * Support provided `error` to extend - -2014-09-08 / 1.0.1 -================== - - * Fix accepting string message - -2014-09-08 / 1.0.0 -================== - - * Initial release diff --git a/node_modules/serve-static/node_modules/http-errors/LICENSE b/node_modules/serve-static/node_modules/http-errors/LICENSE deleted file mode 100644 index a7ae8ee..0000000 --- a/node_modules/serve-static/node_modules/http-errors/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ - -The MIT License (MIT) - -Copyright (c) 2014 Jonathan Ong me@jongleberry.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/serve-static/node_modules/http-errors/README.md b/node_modules/serve-static/node_modules/http-errors/README.md deleted file mode 100644 index 520271e..0000000 --- a/node_modules/serve-static/node_modules/http-errors/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# http-errors - -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Node.js Version][node-version-image]][node-version-url] -[![Build Status][travis-image]][travis-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -Create HTTP errors for Express, Koa, Connect, etc. with ease. - -## Example - -```js -var createError = require('http-errors'); - -app.use(function (req, res, next) { - if (!req.user) return next(createError(401, 'Please login to view this page.')); - next(); -}) -``` - -## API - -This is the current API, currently extracted from Koa and subject to change. - -### Error Properties - -- `message` -- `status` and `statusCode` - the status code of the error, defaulting to `500` - -### createError([status], [message], [properties]) - -```js -var err = createError(404, 'This video does not exist!'); -``` - -- `status: 500` - the status code as a number -- `message` - the message of the error, defaulting to node's text for that status code. -- `properties` - custom properties to attach to the object - -### new createError\[code || name\](\[msg]\)) - -```js -var err = new createError.NotFound(); -``` - -- `code` - the status code as a number -- `name` - the name of the error as a "bumpy case", i.e. `NotFound` or `InternalServerError`. - -## License - -[MIT](LICENSE) - -[npm-image]: https://img.shields.io/npm/v/http-errors.svg?style=flat -[npm-url]: https://npmjs.org/package/http-errors -[node-version-image]: https://img.shields.io/node/v/http-errors.svg?style=flat -[node-version-url]: http://nodejs.org/download/ -[travis-image]: https://img.shields.io/travis/jshttp/http-errors.svg?style=flat -[travis-url]: https://travis-ci.org/jshttp/http-errors -[coveralls-image]: https://img.shields.io/coveralls/jshttp/http-errors.svg?style=flat -[coveralls-url]: https://coveralls.io/r/jshttp/http-errors -[downloads-image]: https://img.shields.io/npm/dm/http-errors.svg?style=flat -[downloads-url]: https://npmjs.org/package/http-errors diff --git a/node_modules/serve-static/node_modules/http-errors/index.js b/node_modules/serve-static/node_modules/http-errors/index.js deleted file mode 100644 index d84b114..0000000 --- a/node_modules/serve-static/node_modules/http-errors/index.js +++ /dev/null @@ -1,120 +0,0 @@ - -var statuses = require('statuses'); -var inherits = require('inherits'); - -function toIdentifier(str) { - return str.split(' ').map(function (token) { - return token.slice(0, 1).toUpperCase() + token.slice(1) - }).join('').replace(/[^ _0-9a-z]/gi, '') -} - -exports = module.exports = function httpError() { - // so much arity going on ~_~ - var err; - var msg; - var status = 500; - var props = {}; - for (var i = 0; i < arguments.length; i++) { - var arg = arguments[i]; - if (arg instanceof Error) { - err = arg; - status = err.status || err.statusCode || status; - continue; - } - switch (typeof arg) { - case 'string': - msg = arg; - break; - case 'number': - status = arg; - break; - case 'object': - props = arg; - break; - } - } - - if (typeof status !== 'number' || !statuses[status]) { - status = 500 - } - - // constructor - var HttpError = exports[status] - - if (!err) { - // create error - err = HttpError - ? new HttpError(msg) - : new Error(msg || statuses[status]) - Error.captureStackTrace(err, httpError) - } - - if (!HttpError || !(err instanceof HttpError)) { - // add properties to generic error - err.expose = status < 500 - err.status = err.statusCode = status - } - - for (var key in props) { - if (key !== 'status' && key !== 'statusCode') { - err[key] = props[key] - } - } - - return err; -}; - -// create generic error objects -var codes = statuses.codes.filter(function (num) { - return num >= 400; -}); - -codes.forEach(function (code) { - var name = toIdentifier(statuses[code]) - var className = name.match(/Error$/) ? name : name + 'Error' - - if (code >= 500) { - var ServerError = function ServerError(msg) { - var self = new Error(msg != null ? msg : statuses[code]) - Error.captureStackTrace(self, ServerError) - self.__proto__ = ServerError.prototype - Object.defineProperty(self, 'name', { - enumerable: false, - configurable: true, - value: className, - writable: true - }) - return self - } - inherits(ServerError, Error); - ServerError.prototype.status = - ServerError.prototype.statusCode = code; - ServerError.prototype.expose = false; - exports[code] = - exports[name] = ServerError - return; - } - - var ClientError = function ClientError(msg) { - var self = new Error(msg != null ? msg : statuses[code]) - Error.captureStackTrace(self, ClientError) - self.__proto__ = ClientError.prototype - Object.defineProperty(self, 'name', { - enumerable: false, - configurable: true, - value: className, - writable: true - }) - return self - } - inherits(ClientError, Error); - ClientError.prototype.status = - ClientError.prototype.statusCode = code; - ClientError.prototype.expose = true; - exports[code] = - exports[name] = ClientError - return; -}); - -// backwards-compatibility -exports["I'mateapot"] = exports.ImATeapot diff --git a/node_modules/serve-static/node_modules/http-errors/package.json b/node_modules/serve-static/node_modules/http-errors/package.json deleted file mode 100644 index 6bbb3db..0000000 --- a/node_modules/serve-static/node_modules/http-errors/package.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "http-errors", - "description": "Create HTTP error objects", - "version": "1.3.1", - "author": "Jonathan Ong (http://jongleberry.com)", - "contributors": [ - "Alan Plum ", - "Douglas Christopher Wilson " - ], - "license": "MIT", - "repository": "jshttp/http-errors", - "dependencies": { - "inherits": "~2.0.1", - "statuses": "1" - }, - "devDependencies": { - "istanbul": "0", - "mocha": "1" - }, - "engines": { - "node": ">= 0.6" - }, - "scripts": { - "test": "mocha --reporter spec --bail", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot" - }, - "keywords": [ - "http", - "error" - ], - "files": [ - "index.js", - "HISTORY.md", - "LICENSE", - "README.md" - ] -} diff --git a/node_modules/serve-static/node_modules/ms/.npmignore b/node_modules/serve-static/node_modules/ms/.npmignore deleted file mode 100644 index d1aa0ce..0000000 --- a/node_modules/serve-static/node_modules/ms/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -node_modules -test -History.md -Makefile -component.json diff --git a/node_modules/serve-static/node_modules/ms/History.md b/node_modules/serve-static/node_modules/ms/History.md deleted file mode 100644 index 32fdfc1..0000000 --- a/node_modules/serve-static/node_modules/ms/History.md +++ /dev/null @@ -1,66 +0,0 @@ - -0.7.1 / 2015-04-20 -================== - - * prevent extraordinary long inputs (@evilpacket) - * Fixed broken readme link - -0.7.0 / 2014-11-24 -================== - - * add time abbreviations, updated tests and readme for the new units - * fix example in the readme. - * add LICENSE file - -0.6.2 / 2013-12-05 -================== - - * Adding repository section to package.json to suppress warning from NPM. - -0.6.1 / 2013-05-10 -================== - - * fix singularization [visionmedia] - -0.6.0 / 2013-03-15 -================== - - * fix minutes - -0.5.1 / 2013-02-24 -================== - - * add component namespace - -0.5.0 / 2012-11-09 -================== - - * add short formatting as default and .long option - * add .license property to component.json - * add version to component.json - -0.4.0 / 2012-10-22 -================== - - * add rounding to fix crazy decimals - -0.3.0 / 2012-09-07 -================== - - * fix `ms()` [visionmedia] - -0.2.0 / 2012-09-03 -================== - - * add component.json [visionmedia] - * add days support [visionmedia] - * add hours support [visionmedia] - * add minutes support [visionmedia] - * add seconds support [visionmedia] - * add ms string support [visionmedia] - * refactor tests to facilitate ms(number) [visionmedia] - -0.1.0 / 2012-03-07 -================== - - * Initial release diff --git a/node_modules/serve-static/node_modules/ms/LICENSE b/node_modules/serve-static/node_modules/ms/LICENSE deleted file mode 100644 index 6c07561..0000000 --- a/node_modules/serve-static/node_modules/ms/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -(The MIT License) - -Copyright (c) 2014 Guillermo Rauch - -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/serve-static/node_modules/ms/README.md b/node_modules/serve-static/node_modules/ms/README.md deleted file mode 100644 index 9b4fd03..0000000 --- a/node_modules/serve-static/node_modules/ms/README.md +++ /dev/null @@ -1,35 +0,0 @@ -# ms.js: miliseconds conversion utility - -```js -ms('2 days') // 172800000 -ms('1d') // 86400000 -ms('10h') // 36000000 -ms('2.5 hrs') // 9000000 -ms('2h') // 7200000 -ms('1m') // 60000 -ms('5s') // 5000 -ms('100') // 100 -``` - -```js -ms(60000) // "1m" -ms(2 * 60000) // "2m" -ms(ms('10 hours')) // "10h" -``` - -```js -ms(60000, { long: true }) // "1 minute" -ms(2 * 60000, { long: true }) // "2 minutes" -ms(ms('10 hours'), { long: true }) // "10 hours" -``` - -- Node/Browser compatible. Published as [`ms`](https://www.npmjs.org/package/ms) in [NPM](http://nodejs.org/download). -- If a number is supplied to `ms`, a string with a unit is returned. -- If a string that contains the number is supplied, it returns it as -a number (e.g: it returns `100` for `'100'`). -- If you pass a string with a number and a valid unit, the number of -equivalent ms is returned. - -## License - -MIT diff --git a/node_modules/serve-static/node_modules/ms/index.js b/node_modules/serve-static/node_modules/ms/index.js deleted file mode 100644 index 4f92771..0000000 --- a/node_modules/serve-static/node_modules/ms/index.js +++ /dev/null @@ -1,125 +0,0 @@ -/** - * Helpers. - */ - -var s = 1000; -var m = s * 60; -var h = m * 60; -var d = h * 24; -var y = d * 365.25; - -/** - * Parse or format the given `val`. - * - * Options: - * - * - `long` verbose formatting [false] - * - * @param {String|Number} val - * @param {Object} options - * @return {String|Number} - * @api public - */ - -module.exports = function(val, options){ - options = options || {}; - if ('string' == typeof val) return parse(val); - return options.long - ? long(val) - : short(val); -}; - -/** - * Parse the given `str` and return milliseconds. - * - * @param {String} str - * @return {Number} - * @api private - */ - -function parse(str) { - str = '' + str; - if (str.length > 10000) return; - var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str); - if (!match) return; - var n = parseFloat(match[1]); - var type = (match[2] || 'ms').toLowerCase(); - switch (type) { - case 'years': - case 'year': - case 'yrs': - case 'yr': - case 'y': - return n * y; - case 'days': - case 'day': - case 'd': - return n * d; - case 'hours': - case 'hour': - case 'hrs': - case 'hr': - case 'h': - return n * h; - case 'minutes': - case 'minute': - case 'mins': - case 'min': - case 'm': - return n * m; - case 'seconds': - case 'second': - case 'secs': - case 'sec': - case 's': - return n * s; - case 'milliseconds': - case 'millisecond': - case 'msecs': - case 'msec': - case 'ms': - return n; - } -} - -/** - * Short format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function short(ms) { - if (ms >= d) return Math.round(ms / d) + 'd'; - if (ms >= h) return Math.round(ms / h) + 'h'; - if (ms >= m) return Math.round(ms / m) + 'm'; - if (ms >= s) return Math.round(ms / s) + 's'; - return ms + 'ms'; -} - -/** - * Long format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function long(ms) { - return plural(ms, d, 'day') - || plural(ms, h, 'hour') - || plural(ms, m, 'minute') - || plural(ms, s, 'second') - || ms + ' ms'; -} - -/** - * Pluralization helper. - */ - -function plural(ms, n, name) { - if (ms < n) return; - if (ms < n * 1.5) return Math.floor(ms / n) + ' ' + name; - return Math.ceil(ms / n) + ' ' + name + 's'; -} diff --git a/node_modules/serve-static/node_modules/ms/package.json b/node_modules/serve-static/node_modules/ms/package.json deleted file mode 100644 index a4e5bb6..0000000 --- a/node_modules/serve-static/node_modules/ms/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "ms", - "version": "0.7.1", - "description": "Tiny ms conversion utility", - "repository": { - "type": "git", - "url": "git://github.com/guille/ms.js.git" - }, - "main": "./index", - "devDependencies": { - "mocha": "*", - "expect.js": "*", - "serve": "*" - }, - "component": { - "scripts": { - "ms/index.js": "index.js" - } - } -} diff --git a/node_modules/serve-static/node_modules/on-finished/HISTORY.md b/node_modules/serve-static/node_modules/on-finished/HISTORY.md deleted file mode 100644 index 98ff0e9..0000000 --- a/node_modules/serve-static/node_modules/on-finished/HISTORY.md +++ /dev/null @@ -1,88 +0,0 @@ -2.3.0 / 2015-05-26 -================== - - * Add defined behavior for HTTP `CONNECT` requests - * Add defined behavior for HTTP `Upgrade` requests - * deps: ee-first@1.1.1 - -2.2.1 / 2015-04-22 -================== - - * Fix `isFinished(req)` when data buffered - -2.2.0 / 2014-12-22 -================== - - * Add message object to callback arguments - -2.1.1 / 2014-10-22 -================== - - * Fix handling of pipelined requests - -2.1.0 / 2014-08-16 -================== - - * Check if `socket` is detached - * Return `undefined` for `isFinished` if state unknown - -2.0.0 / 2014-08-16 -================== - - * Add `isFinished` function - * Move to `jshttp` organization - * Remove support for plain socket argument - * Rename to `on-finished` - * Support both `req` and `res` as arguments - * deps: ee-first@1.0.5 - -1.2.2 / 2014-06-10 -================== - - * Reduce listeners added to emitters - - avoids "event emitter leak" warnings when used multiple times on same request - -1.2.1 / 2014-06-08 -================== - - * Fix returned value when already finished - -1.2.0 / 2014-06-05 -================== - - * Call callback when called on already-finished socket - -1.1.4 / 2014-05-27 -================== - - * Support node.js 0.8 - -1.1.3 / 2014-04-30 -================== - - * Make sure errors passed as instanceof `Error` - -1.1.2 / 2014-04-18 -================== - - * Default the `socket` to passed-in object - -1.1.1 / 2014-01-16 -================== - - * Rename module to `finished` - -1.1.0 / 2013-12-25 -================== - - * Call callback when called on already-errored socket - -1.0.1 / 2013-12-20 -================== - - * Actually pass the error to the callback - -1.0.0 / 2013-12-20 -================== - - * Initial release diff --git a/node_modules/serve-static/node_modules/on-finished/LICENSE b/node_modules/serve-static/node_modules/on-finished/LICENSE deleted file mode 100644 index 5931fd2..0000000 --- a/node_modules/serve-static/node_modules/on-finished/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -(The MIT License) - -Copyright (c) 2013 Jonathan Ong -Copyright (c) 2014 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/serve-static/node_modules/on-finished/README.md b/node_modules/serve-static/node_modules/on-finished/README.md deleted file mode 100644 index a0e1157..0000000 --- a/node_modules/serve-static/node_modules/on-finished/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# on-finished - -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Node.js Version][node-version-image]][node-version-url] -[![Build Status][travis-image]][travis-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -Execute a callback when a HTTP request closes, finishes, or errors. - -## Install - -```sh -$ npm install on-finished -``` - -## API - -```js -var onFinished = require('on-finished') -``` - -### onFinished(res, listener) - -Attach a listener to listen for the response to finish. The listener will -be invoked only once when the response finished. If the response finished -to an error, the first argument will contain the error. If the response -has already finished, the listener will be invoked. - -Listening to the end of a response would be used to close things associated -with the response, like open files. - -Listener is invoked as `listener(err, res)`. - -```js -onFinished(res, function (err, res) { - // clean up open fds, etc. - // err contains the error is request error'd -}) -``` - -### onFinished(req, listener) - -Attach a listener to listen for the request to finish. The listener will -be invoked only once when the request finished. If the request finished -to an error, the first argument will contain the error. If the request -has already finished, the listener will be invoked. - -Listening to the end of a request would be used to know when to continue -after reading the data. - -Listener is invoked as `listener(err, req)`. - -```js -var data = '' - -req.setEncoding('utf8') -res.on('data', function (str) { - data += str -}) - -onFinished(req, function (err, req) { - // data is read unless there is err -}) -``` - -### onFinished.isFinished(res) - -Determine if `res` is already finished. This would be useful to check and -not even start certain operations if the response has already finished. - -### onFinished.isFinished(req) - -Determine if `req` is already finished. This would be useful to check and -not even start certain operations if the request has already finished. - -## Special Node.js requests - -### HTTP CONNECT method - -The meaning of the `CONNECT` method from RFC 7231, section 4.3.6: - -> The CONNECT method requests that the recipient establish a tunnel to -> the destination origin server identified by the request-target and, -> if successful, thereafter restrict its behavior to blind forwarding -> of packets, in both directions, until the tunnel is closed. Tunnels -> are commonly used to create an end-to-end virtual connection, through -> one or more proxies, which can then be secured using TLS (Transport -> Layer Security, [RFC5246]). - -In Node.js, these request objects come from the `'connect'` event on -the HTTP server. - -When this module is used on a HTTP `CONNECT` request, the request is -considered "finished" immediately, **due to limitations in the Node.js -interface**. This means if the `CONNECT` request contains a request entity, -the request will be considered "finished" even before it has been read. - -There is no such thing as a response object to a `CONNECT` request in -Node.js, so there is no support for for one. - -### HTTP Upgrade request - -The meaning of the `Upgrade` header from RFC 7230, section 6.1: - -> The "Upgrade" header field is intended to provide a simple mechanism -> for transitioning from HTTP/1.1 to some other protocol on the same -> connection. - -In Node.js, these request objects come from the `'upgrade'` event on -the HTTP server. - -When this module is used on a HTTP request with an `Upgrade` header, the -request is considered "finished" immediately, **due to limitations in the -Node.js interface**. This means if the `Upgrade` request contains a request -entity, the request will be considered "finished" even before it has been -read. - -There is no such thing as a response object to a `Upgrade` request in -Node.js, so there is no support for for one. - -## Example - -The following code ensures that file descriptors are always closed -once the response finishes. - -```js -var destroy = require('destroy') -var http = require('http') -var onFinished = require('on-finished') - -http.createServer(function onRequest(req, res) { - var stream = fs.createReadStream('package.json') - stream.pipe(res) - onFinished(res, function (err) { - destroy(stream) - }) -}) -``` - -## License - -[MIT](LICENSE) - -[npm-image]: https://img.shields.io/npm/v/on-finished.svg -[npm-url]: https://npmjs.org/package/on-finished -[node-version-image]: https://img.shields.io/node/v/on-finished.svg -[node-version-url]: http://nodejs.org/download/ -[travis-image]: https://img.shields.io/travis/jshttp/on-finished/master.svg -[travis-url]: https://travis-ci.org/jshttp/on-finished -[coveralls-image]: https://img.shields.io/coveralls/jshttp/on-finished/master.svg -[coveralls-url]: https://coveralls.io/r/jshttp/on-finished?branch=master -[downloads-image]: https://img.shields.io/npm/dm/on-finished.svg -[downloads-url]: https://npmjs.org/package/on-finished diff --git a/node_modules/serve-static/node_modules/on-finished/index.js b/node_modules/serve-static/node_modules/on-finished/index.js deleted file mode 100644 index 9abd98f..0000000 --- a/node_modules/serve-static/node_modules/on-finished/index.js +++ /dev/null @@ -1,196 +0,0 @@ -/*! - * on-finished - * Copyright(c) 2013 Jonathan Ong - * Copyright(c) 2014 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module exports. - * @public - */ - -module.exports = onFinished -module.exports.isFinished = isFinished - -/** - * Module dependencies. - * @private - */ - -var first = require('ee-first') - -/** - * Variables. - * @private - */ - -/* istanbul ignore next */ -var defer = typeof setImmediate === 'function' - ? setImmediate - : function(fn){ process.nextTick(fn.bind.apply(fn, arguments)) } - -/** - * Invoke callback when the response has finished, useful for - * cleaning up resources afterwards. - * - * @param {object} msg - * @param {function} listener - * @return {object} - * @public - */ - -function onFinished(msg, listener) { - if (isFinished(msg) !== false) { - defer(listener, null, msg) - return msg - } - - // attach the listener to the message - attachListener(msg, listener) - - return msg -} - -/** - * Determine if message is already finished. - * - * @param {object} msg - * @return {boolean} - * @public - */ - -function isFinished(msg) { - var socket = msg.socket - - if (typeof msg.finished === 'boolean') { - // OutgoingMessage - return Boolean(msg.finished || (socket && !socket.writable)) - } - - if (typeof msg.complete === 'boolean') { - // IncomingMessage - return Boolean(msg.upgrade || !socket || !socket.readable || (msg.complete && !msg.readable)) - } - - // don't know - return undefined -} - -/** - * Attach a finished listener to the message. - * - * @param {object} msg - * @param {function} callback - * @private - */ - -function attachFinishedListener(msg, callback) { - var eeMsg - var eeSocket - var finished = false - - function onFinish(error) { - eeMsg.cancel() - eeSocket.cancel() - - finished = true - callback(error) - } - - // finished on first message event - eeMsg = eeSocket = first([[msg, 'end', 'finish']], onFinish) - - function onSocket(socket) { - // remove listener - msg.removeListener('socket', onSocket) - - if (finished) return - if (eeMsg !== eeSocket) return - - // finished on first socket event - eeSocket = first([[socket, 'error', 'close']], onFinish) - } - - if (msg.socket) { - // socket already assigned - onSocket(msg.socket) - return - } - - // wait for socket to be assigned - msg.on('socket', onSocket) - - if (msg.socket === undefined) { - // node.js 0.8 patch - patchAssignSocket(msg, onSocket) - } -} - -/** - * Attach the listener to the message. - * - * @param {object} msg - * @return {function} - * @private - */ - -function attachListener(msg, listener) { - var attached = msg.__onFinished - - // create a private single listener with queue - if (!attached || !attached.queue) { - attached = msg.__onFinished = createListener(msg) - attachFinishedListener(msg, attached) - } - - attached.queue.push(listener) -} - -/** - * Create listener on message. - * - * @param {object} msg - * @return {function} - * @private - */ - -function createListener(msg) { - function listener(err) { - if (msg.__onFinished === listener) msg.__onFinished = null - if (!listener.queue) return - - var queue = listener.queue - listener.queue = null - - for (var i = 0; i < queue.length; i++) { - queue[i](err, msg) - } - } - - listener.queue = [] - - return listener -} - -/** - * Patch ServerResponse.prototype.assignSocket for node.js 0.8. - * - * @param {ServerResponse} res - * @param {function} callback - * @private - */ - -function patchAssignSocket(res, callback) { - var assignSocket = res.assignSocket - - if (typeof assignSocket !== 'function') return - - // res.on('socket', callback) is broken in 0.8 - res.assignSocket = function _assignSocket(socket) { - assignSocket.call(this, socket) - callback(socket) - } -} diff --git a/node_modules/serve-static/node_modules/on-finished/package.json b/node_modules/serve-static/node_modules/on-finished/package.json deleted file mode 100644 index b9df1bd..0000000 --- a/node_modules/serve-static/node_modules/on-finished/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "on-finished", - "description": "Execute a callback when a request closes, finishes, or errors", - "version": "2.3.0", - "contributors": [ - "Douglas Christopher Wilson ", - "Jonathan Ong (http://jongleberry.com)" - ], - "license": "MIT", - "repository": "jshttp/on-finished", - "dependencies": { - "ee-first": "1.1.1" - }, - "devDependencies": { - "istanbul": "0.3.9", - "mocha": "2.2.5" - }, - "engines": { - "node": ">= 0.8" - }, - "files": [ - "HISTORY.md", - "LICENSE", - "index.js" - ], - "scripts": { - "test": "mocha --reporter spec --bail --check-leaks test/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" - } -} diff --git a/node_modules/serve-static/node_modules/send/HISTORY.md b/node_modules/serve-static/node_modules/send/HISTORY.md deleted file mode 100644 index 35aef46..0000000 --- a/node_modules/serve-static/node_modules/send/HISTORY.md +++ /dev/null @@ -1,315 +0,0 @@ -0.13.2 / 2016-03-05 -=================== - - * Fix invalid `Content-Type` header when `send.mime.default_type` unset - -0.13.1 / 2016-01-16 -=================== - - * deps: depd@~1.1.0 - - Support web browser loading - - perf: enable strict mode - * deps: destroy@~1.0.4 - - perf: enable strict mode - * deps: escape-html@~1.0.3 - - perf: enable strict mode - - perf: optimize string replacement - - perf: use faster string coercion - * deps: range-parser@~1.0.3 - - perf: enable strict mode - -0.13.0 / 2015-06-16 -=================== - - * Allow Node.js HTTP server to set `Date` response header - * Fix incorrectly removing `Content-Location` on 304 response - * Improve the default redirect response headers - * Send appropriate headers on default error response - * Use `http-errors` for standard emitted errors - * Use `statuses` instead of `http` module for status messages - * deps: escape-html@1.0.2 - * deps: etag@~1.7.0 - - Improve stat performance by removing hashing - * deps: fresh@0.3.0 - - Add weak `ETag` matching support - * 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 - * perf: enable strict mode - * perf: remove unnecessary array allocations - -0.12.3 / 2015-05-13 -=================== - - * deps: debug@~2.2.0 - - deps: ms@0.7.1 - * deps: depd@~1.0.1 - * deps: etag@~1.6.0 - - Improve support for JXcore - - Support "fake" stats objects in environments without `fs` - * deps: ms@0.7.1 - - Prevent extraordinarily long inputs - * deps: on-finished@~2.2.1 - -0.12.2 / 2015-03-13 -=================== - - * Throw errors early for invalid `extensions` or `index` options - * deps: debug@~2.1.3 - - Fix high intensity foreground color for bold - - deps: ms@0.7.0 - -0.12.1 / 2015-02-17 -=================== - - * Fix regression sending zero-length files - -0.12.0 / 2015-02-16 -=================== - - * Always read the stat size from the file - * Fix mutating passed-in `options` - * deps: mime@1.3.4 - -0.11.1 / 2015-01-20 -=================== - - * Fix `root` path disclosure - -0.11.0 / 2015-01-05 -=================== - - * deps: debug@~2.1.1 - * deps: etag@~1.5.1 - - deps: crc@3.2.1 - * deps: ms@0.7.0 - - Add `milliseconds` - - Add `msecs` - - Add `secs` - - Add `mins` - - Add `hrs` - - Add `yrs` - * deps: on-finished@~2.2.0 - -0.10.1 / 2014-10-22 -=================== - - * deps: on-finished@~2.1.1 - - Fix handling of pipelined requests - -0.10.0 / 2014-10-15 -=================== - - * deps: debug@~2.1.0 - - Implement `DEBUG_FD` env variable support - * deps: depd@~1.0.0 - * deps: etag@~1.5.0 - - Improve string performance - - Slightly improve speed for weak ETags over 1KB - -0.9.3 / 2014-09-24 -================== - - * deps: etag@~1.4.0 - - Support "fake" stats objects - -0.9.2 / 2014-09-15 -================== - - * deps: depd@0.4.5 - * deps: etag@~1.3.1 - * deps: range-parser@~1.0.2 - -0.9.1 / 2014-09-07 -================== - - * deps: fresh@0.2.4 - -0.9.0 / 2014-09-07 -================== - - * Add `lastModified` option - * Use `etag` to generate `ETag` header - * deps: debug@~2.0.0 - -0.8.5 / 2014-09-04 -================== - - * Fix malicious path detection for empty string path - -0.8.4 / 2014-09-04 -================== - - * Fix a path traversal issue when using `root` - -0.8.3 / 2014-08-16 -================== - - * deps: destroy@1.0.3 - - renamed from dethroy - * deps: on-finished@2.1.0 - -0.8.2 / 2014-08-14 -================== - - * Work around `fd` leak in Node.js 0.10 for `fs.ReadStream` - * deps: dethroy@1.0.2 - -0.8.1 / 2014-08-05 -================== - - * Fix `extensions` behavior when file already has extension - -0.8.0 / 2014-08-05 -================== - - * Add `extensions` option - -0.7.4 / 2014-08-04 -================== - - * Fix serving index files without root dir - -0.7.3 / 2014-07-29 -================== - - * Fix incorrect 403 on Windows and Node.js 0.11 - -0.7.2 / 2014-07-27 -================== - - * deps: depd@0.4.4 - - Work-around v8 generating empty stack traces - -0.7.1 / 2014-07-26 -================== - - * deps: depd@0.4.3 - - Fix exception when global `Error.stackTraceLimit` is too low - -0.7.0 / 2014-07-20 -================== - - * Deprecate `hidden` option; use `dotfiles` option - * Add `dotfiles` option - * deps: debug@1.0.4 - * 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 - -0.6.0 / 2014-07-11 -================== - - * Deprecate `from` option; use `root` option - * Deprecate `send.etag()` -- use `etag` in `options` - * Deprecate `send.hidden()` -- use `hidden` in `options` - * Deprecate `send.index()` -- use `index` in `options` - * Deprecate `send.maxage()` -- use `maxAge` in `options` - * Deprecate `send.root()` -- use `root` in `options` - * Cap `maxAge` value to 1 year - * deps: debug@1.0.3 - - Add support for multiple wildcards in namespaces - -0.5.0 / 2014-06-28 -================== - - * Accept string for `maxAge` (converted by `ms`) - * Add `headers` event - * Include link in default redirect response - * Use `EventEmitter.listenerCount` to count listeners - -0.4.3 / 2014-06-11 -================== - - * Do not throw un-catchable error on file open race condition - * Use `escape-html` for HTML escaping - * deps: debug@1.0.2 - - fix some debugging output colors on node.js 0.8 - * deps: finished@1.2.2 - * deps: fresh@0.2.2 - -0.4.2 / 2014-06-09 -================== - - * fix "event emitter leak" warnings - * deps: debug@1.0.1 - * deps: finished@1.2.1 - -0.4.1 / 2014-06-02 -================== - - * Send `max-age` in `Cache-Control` in correct format - -0.4.0 / 2014-05-27 -================== - - * Calculate ETag with md5 for reduced collisions - * Fix wrong behavior when index file matches directory - * Ignore stream errors after request ends - - Goodbye `EBADF, read` - * Skip directories in index file search - * deps: debug@0.8.1 - -0.3.0 / 2014-04-24 -================== - - * Fix sending files with dots without root set - * Coerce option types - * Accept API options in options object - * Set etags to "weak" - * Include file path in etag - * Make "Can't set headers after they are sent." catchable - * Send full entity-body for multi range requests - * Default directory access to 403 when index disabled - * Support multiple index paths - * Support "If-Range" header - * Control whether to generate etags - * deps: mime@1.2.11 - -0.2.0 / 2014-01-29 -================== - - * update range-parser and fresh - -0.1.4 / 2013-08-11 -================== - - * update fresh - -0.1.3 / 2013-07-08 -================== - - * Revert "Fix fd leak" - -0.1.2 / 2013-07-03 -================== - - * Fix fd leak - -0.1.0 / 2012-08-25 -================== - - * add options parameter to send() that is passed to fs.createReadStream() [kanongil] - -0.0.4 / 2012-08-16 -================== - - * allow custom "Accept-Ranges" definition - -0.0.3 / 2012-07-16 -================== - - * fix normalization of the root directory. Closes #3 - -0.0.2 / 2012-07-09 -================== - - * add passing of req explicitly for now (YUCK) - -0.0.1 / 2010-01-03 -================== - - * Initial release diff --git a/node_modules/serve-static/node_modules/send/LICENSE b/node_modules/serve-static/node_modules/send/LICENSE deleted file mode 100644 index e4d595b..0000000 --- a/node_modules/serve-static/node_modules/send/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -(The MIT License) - -Copyright (c) 2012 TJ Holowaychuk -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/serve-static/node_modules/send/README.md b/node_modules/serve-static/node_modules/send/README.md deleted file mode 100644 index d241555..0000000 --- a/node_modules/serve-static/node_modules/send/README.md +++ /dev/null @@ -1,234 +0,0 @@ -# send - -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Linux Build][travis-image]][travis-url] -[![Windows Build][appveyor-image]][appveyor-url] -[![Test Coverage][coveralls-image]][coveralls-url] -[![Gratipay][gratipay-image]][gratipay-url] - -Send is a library for streaming files from the file system as a http response -supporting partial responses (Ranges), conditional-GET negotiation, high test -coverage, and granular events which may be leveraged to take appropriate actions -in your application or framework. - -Looking to serve up entire folders mapped to URLs? Try [serve-static](https://www.npmjs.org/package/serve-static). - -## Installation - -```bash -$ npm install send -``` - -## API - -```js -var send = require('send') -``` - -### send(req, path, [options]) - -Create a new `SendStream` for the given path to send to a `res`. The `req` is -the Node.js HTTP request and the `path` is a urlencoded path to send (urlencoded, -not the actual file-system path). - -#### Options - -##### dotfiles - -Set how "dotfiles" are treated when encountered. A dotfile is a file -or directory that begins with a dot ("."). Note this check is done on -the path itself without checking if the path actually exists on the -disk. If `root` is specified, only the dotfiles above the root are -checked (i.e. the root itself can be within a dotfile when when set -to "deny"). - - - `'allow'` No special treatment for dotfiles. - - `'deny'` Send a 403 for any request for a dotfile. - - `'ignore'` Pretend like the dotfile does not exist and 404. - -The default value is _similar_ to `'ignore'`, with the exception that -this default will not ignore the files within a directory that begins -with a dot, for backward-compatibility. - -##### end - -Byte offset at which the stream ends, defaults to the length of the file -minus 1. The end is inclusive in the stream, meaning `end: 3` will include -the 4th byte in the stream. - -##### etag - -Enable or disable etag generation, defaults to true. - -##### extensions - -If a given file doesn't exist, try appending one of the given extensions, -in the given order. By default, this is disabled (set to `false`). An -example value that will serve extension-less HTML files: `['html', 'htm']`. -This is skipped if the requested file already has an extension. - -##### index - -By default send supports "index.html" files, to disable this -set `false` or to supply a new index pass a string or an array -in preferred order. - -##### lastModified - -Enable or disable `Last-Modified` header, defaults to true. Uses the file -system's last modified value. - -##### maxAge - -Provide a max-age in milliseconds for http caching, defaults to 0. -This can also be a string accepted by the -[ms](https://www.npmjs.org/package/ms#readme) module. - -##### root - -Serve files relative to `path`. - -##### start - -Byte offset at which the stream starts, defaults to 0. The start is inclusive, -meaning `start: 2` will include the 3rd byte in the stream. - -#### Events - -The `SendStream` is an event emitter and will emit the following events: - - - `error` an error occurred `(err)` - - `directory` a directory was requested - - `file` a file was requested `(path, stat)` - - `headers` the headers are about to be set on a file `(res, path, stat)` - - `stream` file streaming has started `(stream)` - - `end` streaming has completed - -#### .pipe - -The `pipe` method is used to pipe the response into the Node.js HTTP response -object, typically `send(req, path, options).pipe(res)`. - -### .mime - -The `mime` export is the global instance of of the -[`mime` npm module](https://www.npmjs.com/package/mime). - -This is used to configure the MIME types that are associated with file extensions -as well as other options for how to resolve the MIME type of a file (like the -default type to use for an unknown file extension). - -## Error-handling - -By default when no `error` listeners are present an automatic response will be -made, otherwise you have full control over the response, aka you may show a 5xx -page etc. - -## Caching - -It does _not_ perform internal caching, you should use a reverse proxy cache -such as Varnish for this, or those fancy things called CDNs. If your -application is small enough that it would benefit from single-node memory -caching, it's small enough that it does not need caching at all ;). - -## Debugging - -To enable `debug()` instrumentation output export __DEBUG__: - -``` -$ DEBUG=send node app -``` - -## Running tests - -``` -$ npm install -$ npm test -``` - -## Examples - -### Small example - -```js -var http = require('http'); -var send = require('send'); - -var app = http.createServer(function(req, res){ - send(req, req.url).pipe(res); -}).listen(3000); -``` - -### Custom file types - -```js -var http = require('http'); -var send = require('send'); - -// Default unknown types to text/plain -send.mime.default_type = 'text/plain'; - -// Add a custom type -send.mime.define({ - 'application/x-my-type': ['x-mt', 'x-mtt'] -}); - -var app = http.createServer(function(req, res){ - send(req, req.url).pipe(res); -}).listen(3000); -``` - -### Serving from a root directory with custom error-handling - -```js -var http = require('http'); -var send = require('send'); -var url = require('url'); - -var app = http.createServer(function(req, res){ - // your custom error-handling logic: - function error(err) { - res.statusCode = err.status || 500; - res.end(err.message); - } - - // your custom headers - function headers(res, path, stat) { - // serve all files for download - res.setHeader('Content-Disposition', 'attachment'); - } - - // your custom directory handling logic: - function redirect() { - res.statusCode = 301; - res.setHeader('Location', req.url + '/'); - res.end('Redirecting to ' + req.url + '/'); - } - - // transfer arbitrary files from within - // /www/example.com/public/* - send(req, url.parse(req.url).pathname, {root: '/www/example.com/public'}) - .on('error', error) - .on('directory', redirect) - .on('headers', headers) - .pipe(res); -}).listen(3000); -``` - -## License - -[MIT](LICENSE) - -[npm-image]: https://img.shields.io/npm/v/send.svg -[npm-url]: https://npmjs.org/package/send -[travis-image]: https://img.shields.io/travis/pillarjs/send/master.svg?label=linux -[travis-url]: https://travis-ci.org/pillarjs/send -[appveyor-image]: https://img.shields.io/appveyor/ci/dougwilson/send/master.svg?label=windows -[appveyor-url]: https://ci.appveyor.com/project/dougwilson/send -[coveralls-image]: https://img.shields.io/coveralls/pillarjs/send/master.svg -[coveralls-url]: https://coveralls.io/r/pillarjs/send?branch=master -[downloads-image]: https://img.shields.io/npm/dm/send.svg -[downloads-url]: https://npmjs.org/package/send -[gratipay-image]: https://img.shields.io/gratipay/dougwilson.svg -[gratipay-url]: https://www.gratipay.com/dougwilson/ diff --git a/node_modules/serve-static/node_modules/send/index.js b/node_modules/serve-static/node_modules/send/index.js deleted file mode 100644 index a4e5af8..0000000 --- a/node_modules/serve-static/node_modules/send/index.js +++ /dev/null @@ -1,829 +0,0 @@ -/*! - * send - * Copyright(c) 2012 TJ Holowaychuk - * Copyright(c) 2014-2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var createError = require('http-errors') -var debug = require('debug')('send') -var deprecate = require('depd')('send') -var destroy = require('destroy') -var escapeHtml = require('escape-html') - , parseRange = require('range-parser') - , Stream = require('stream') - , mime = require('mime') - , fresh = require('fresh') - , path = require('path') - , fs = require('fs') - , normalize = path.normalize - , join = path.join -var etag = require('etag') -var EventEmitter = require('events').EventEmitter; -var ms = require('ms'); -var onFinished = require('on-finished') -var statuses = require('statuses') - -/** - * Variables. - */ -var extname = path.extname -var maxMaxAge = 60 * 60 * 24 * 365 * 1000; // 1 year -var resolve = path.resolve -var sep = path.sep -var toString = Object.prototype.toString -var upPathRegexp = /(?:^|[\\\/])\.\.(?:[\\\/]|$)/ - -/** - * Module exports. - * @public - */ - -module.exports = send -module.exports.mime = mime - -/** - * Shim EventEmitter.listenerCount for node.js < 0.10 - */ - -/* istanbul ignore next */ -var listenerCount = EventEmitter.listenerCount - || function(emitter, type){ return emitter.listeners(type).length; }; - -/** - * Return a `SendStream` for `req` and `path`. - * - * @param {object} req - * @param {string} path - * @param {object} [options] - * @return {SendStream} - * @public - */ - -function send(req, path, options) { - return new SendStream(req, path, options); -} - -/** - * Initialize a `SendStream` with the given `path`. - * - * @param {Request} req - * @param {String} path - * @param {object} [options] - * @private - */ - -function SendStream(req, path, options) { - var opts = options || {} - - this.options = opts - this.path = path - this.req = req - - this._etag = opts.etag !== undefined - ? Boolean(opts.etag) - : true - - this._dotfiles = opts.dotfiles !== undefined - ? opts.dotfiles - : 'ignore' - - if (this._dotfiles !== 'ignore' && this._dotfiles !== 'allow' && this._dotfiles !== 'deny') { - throw new TypeError('dotfiles option must be "allow", "deny", or "ignore"') - } - - this._hidden = Boolean(opts.hidden) - - if (opts.hidden !== undefined) { - deprecate('hidden: use dotfiles: \'' + (this._hidden ? 'allow' : 'ignore') + '\' instead') - } - - // legacy support - if (opts.dotfiles === undefined) { - this._dotfiles = undefined - } - - this._extensions = opts.extensions !== undefined - ? normalizeList(opts.extensions, 'extensions option') - : [] - - this._index = opts.index !== undefined - ? normalizeList(opts.index, 'index option') - : ['index.html'] - - this._lastModified = opts.lastModified !== undefined - ? Boolean(opts.lastModified) - : true - - this._maxage = opts.maxAge || opts.maxage - this._maxage = typeof this._maxage === 'string' - ? ms(this._maxage) - : Number(this._maxage) - this._maxage = !isNaN(this._maxage) - ? Math.min(Math.max(0, this._maxage), maxMaxAge) - : 0 - - this._root = opts.root - ? resolve(opts.root) - : null - - if (!this._root && opts.from) { - this.from(opts.from) - } -} - -/** - * Inherits from `Stream.prototype`. - */ - -SendStream.prototype.__proto__ = Stream.prototype; - -/** - * Enable or disable etag generation. - * - * @param {Boolean} val - * @return {SendStream} - * @api public - */ - -SendStream.prototype.etag = deprecate.function(function etag(val) { - val = Boolean(val); - debug('etag %s', val); - this._etag = val; - return this; -}, 'send.etag: pass etag as option'); - -/** - * Enable or disable "hidden" (dot) files. - * - * @param {Boolean} path - * @return {SendStream} - * @api public - */ - -SendStream.prototype.hidden = deprecate.function(function hidden(val) { - val = Boolean(val); - debug('hidden %s', val); - this._hidden = val; - this._dotfiles = undefined - return this; -}, 'send.hidden: use dotfiles option'); - -/** - * Set index `paths`, set to a falsy - * value to disable index support. - * - * @param {String|Boolean|Array} paths - * @return {SendStream} - * @api public - */ - -SendStream.prototype.index = deprecate.function(function index(paths) { - var index = !paths ? [] : normalizeList(paths, 'paths argument'); - debug('index %o', paths); - this._index = index; - return this; -}, 'send.index: pass index as option'); - -/** - * Set root `path`. - * - * @param {String} path - * @return {SendStream} - * @api public - */ - -SendStream.prototype.root = function(path){ - path = String(path); - this._root = resolve(path) - return this; -}; - -SendStream.prototype.from = deprecate.function(SendStream.prototype.root, - 'send.from: pass root as option'); - -SendStream.prototype.root = deprecate.function(SendStream.prototype.root, - 'send.root: pass root as option'); - -/** - * Set max-age to `maxAge`. - * - * @param {Number} maxAge - * @return {SendStream} - * @api public - */ - -SendStream.prototype.maxage = deprecate.function(function maxage(maxAge) { - maxAge = typeof maxAge === 'string' - ? ms(maxAge) - : Number(maxAge); - if (isNaN(maxAge)) maxAge = 0; - if (Infinity == maxAge) maxAge = 60 * 60 * 24 * 365 * 1000; - debug('max-age %d', maxAge); - this._maxage = maxAge; - return this; -}, 'send.maxage: pass maxAge as option'); - -/** - * Emit error with `status`. - * - * @param {number} status - * @param {Error} [error] - * @private - */ - -SendStream.prototype.error = function error(status, error) { - // emit if listeners instead of responding - if (listenerCount(this, 'error') !== 0) { - return this.emit('error', createError(error, status, { - expose: false - })) - } - - var res = this.res - var msg = statuses[status] - - // wipe all existing headers - res._headers = null - - // send basic response - res.statusCode = status - res.setHeader('Content-Type', 'text/plain; charset=UTF-8') - res.setHeader('Content-Length', Buffer.byteLength(msg)) - res.setHeader('X-Content-Type-Options', 'nosniff') - res.end(msg) -} - -/** - * Check if the pathname ends with "/". - * - * @return {Boolean} - * @api private - */ - -SendStream.prototype.hasTrailingSlash = function(){ - return '/' == this.path[this.path.length - 1]; -}; - -/** - * Check if this is a conditional GET request. - * - * @return {Boolean} - * @api private - */ - -SendStream.prototype.isConditionalGET = function(){ - return this.req.headers['if-none-match'] - || this.req.headers['if-modified-since']; -}; - -/** - * Strip content-* header fields. - * - * @private - */ - -SendStream.prototype.removeContentHeaderFields = function removeContentHeaderFields() { - var res = this.res - var headers = Object.keys(res._headers || {}) - - for (var i = 0; i < headers.length; i++) { - var header = headers[i] - if (header.substr(0, 8) === 'content-' && header !== 'content-location') { - res.removeHeader(header) - } - } -} - -/** - * Respond with 304 not modified. - * - * @api private - */ - -SendStream.prototype.notModified = function(){ - var res = this.res; - debug('not modified'); - this.removeContentHeaderFields(); - res.statusCode = 304; - res.end(); -}; - -/** - * Raise error that headers already sent. - * - * @api private - */ - -SendStream.prototype.headersAlreadySent = function headersAlreadySent(){ - var err = new Error('Can\'t set headers after they are sent.'); - debug('headers already sent'); - this.error(500, err); -}; - -/** - * Check if the request is cacheable, aka - * responded with 2xx or 304 (see RFC 2616 section 14.2{5,6}). - * - * @return {Boolean} - * @api private - */ - -SendStream.prototype.isCachable = function(){ - var res = this.res; - return (res.statusCode >= 200 && res.statusCode < 300) || 304 == res.statusCode; -}; - -/** - * Handle stat() error. - * - * @param {Error} error - * @private - */ - -SendStream.prototype.onStatError = function onStatError(error) { - switch (error.code) { - case 'ENAMETOOLONG': - case 'ENOENT': - case 'ENOTDIR': - this.error(404, error) - break - default: - this.error(500, error) - break - } -} - -/** - * Check if the cache is fresh. - * - * @return {Boolean} - * @api private - */ - -SendStream.prototype.isFresh = function(){ - return fresh(this.req.headers, this.res._headers); -}; - -/** - * Check if the range is fresh. - * - * @return {Boolean} - * @api private - */ - -SendStream.prototype.isRangeFresh = function isRangeFresh(){ - var ifRange = this.req.headers['if-range']; - - if (!ifRange) return true; - - return ~ifRange.indexOf('"') - ? ~ifRange.indexOf(this.res._headers['etag']) - : Date.parse(this.res._headers['last-modified']) <= Date.parse(ifRange); -}; - -/** - * Redirect to path. - * - * @param {string} path - * @private - */ - -SendStream.prototype.redirect = function redirect(path) { - if (listenerCount(this, 'directory') !== 0) { - this.emit('directory') - return - } - - if (this.hasTrailingSlash()) { - this.error(403) - return - } - - var loc = path + '/' - var msg = 'Redirecting to ' + escapeHtml(loc) + '\n' - var res = this.res - - // redirect - res.statusCode = 301 - res.setHeader('Content-Type', 'text/html; charset=UTF-8') - res.setHeader('Content-Length', Buffer.byteLength(msg)) - res.setHeader('X-Content-Type-Options', 'nosniff') - res.setHeader('Location', loc) - res.end(msg) -} - -/** - * Pipe to `res. - * - * @param {Stream} res - * @return {Stream} res - * @api public - */ - -SendStream.prototype.pipe = function(res){ - var self = this - , args = arguments - , root = this._root; - - // references - this.res = res; - - // decode the path - var path = decode(this.path) - if (path === -1) return this.error(400) - - // null byte(s) - if (~path.indexOf('\0')) return this.error(400); - - var parts - if (root !== null) { - // malicious path - if (upPathRegexp.test(normalize('.' + sep + path))) { - debug('malicious path "%s"', path) - return this.error(403) - } - - // join / normalize from optional root dir - path = normalize(join(root, path)) - root = normalize(root + sep) - - // explode path parts - parts = path.substr(root.length).split(sep) - } else { - // ".." is malicious without "root" - if (upPathRegexp.test(path)) { - debug('malicious path "%s"', path) - return this.error(403) - } - - // explode path parts - parts = normalize(path).split(sep) - - // resolve the path - path = resolve(path) - } - - // dotfile handling - if (containsDotFile(parts)) { - var access = this._dotfiles - - // legacy support - if (access === undefined) { - access = parts[parts.length - 1][0] === '.' - ? (this._hidden ? 'allow' : 'ignore') - : 'allow' - } - - debug('%s dotfile "%s"', access, path) - switch (access) { - case 'allow': - break - case 'deny': - return this.error(403) - case 'ignore': - default: - return this.error(404) - } - } - - // index file support - if (this._index.length && this.path[this.path.length - 1] === '/') { - this.sendIndex(path); - return res; - } - - this.sendFile(path); - return res; -}; - -/** - * Transfer `path`. - * - * @param {String} path - * @api public - */ - -SendStream.prototype.send = function(path, stat){ - var len = stat.size; - var options = this.options - var opts = {} - var res = this.res; - var req = this.req; - var ranges = req.headers.range; - var offset = options.start || 0; - - if (res._header) { - // impossible to send now - return this.headersAlreadySent(); - } - - debug('pipe "%s"', path) - - // set header fields - this.setHeader(path, stat); - - // set content-type - this.type(path); - - // conditional GET support - if (this.isConditionalGET() - && this.isCachable() - && this.isFresh()) { - return this.notModified(); - } - - // adjust len to start/end options - len = Math.max(0, len - offset); - if (options.end !== undefined) { - var bytes = options.end - offset + 1; - if (len > bytes) len = bytes; - } - - // Range support - if (ranges) { - ranges = parseRange(len, ranges); - - // If-Range support - if (!this.isRangeFresh()) { - debug('range stale'); - ranges = -2; - } - - // unsatisfiable - if (-1 == ranges) { - debug('range unsatisfiable'); - res.setHeader('Content-Range', 'bytes */' + stat.size); - return this.error(416); - } - - // valid (syntactically invalid/multiple ranges are treated as a regular response) - if (-2 != ranges && ranges.length === 1) { - debug('range %j', ranges); - - // Content-Range - res.statusCode = 206; - res.setHeader('Content-Range', 'bytes ' - + ranges[0].start - + '-' - + ranges[0].end - + '/' - + len); - - offset += ranges[0].start; - len = ranges[0].end - ranges[0].start + 1; - } - } - - // clone options - for (var prop in options) { - opts[prop] = options[prop] - } - - // set read options - opts.start = offset - opts.end = Math.max(offset, offset + len - 1) - - // content-length - res.setHeader('Content-Length', len); - - // HEAD support - if ('HEAD' == req.method) return res.end(); - - this.stream(path, opts) -}; - -/** - * Transfer file for `path`. - * - * @param {String} path - * @api private - */ -SendStream.prototype.sendFile = function sendFile(path) { - var i = 0 - var self = this - - debug('stat "%s"', path); - fs.stat(path, function onstat(err, stat) { - if (err && err.code === 'ENOENT' - && !extname(path) - && path[path.length - 1] !== sep) { - // not found, check extensions - return next(err) - } - if (err) return self.onStatError(err) - if (stat.isDirectory()) return self.redirect(self.path) - self.emit('file', path, stat) - self.send(path, stat) - }) - - function next(err) { - if (self._extensions.length <= i) { - return err - ? self.onStatError(err) - : self.error(404) - } - - var p = path + '.' + self._extensions[i++] - - debug('stat "%s"', p) - fs.stat(p, function (err, stat) { - if (err) return next(err) - if (stat.isDirectory()) return next() - self.emit('file', p, stat) - self.send(p, stat) - }) - } -} - -/** - * Transfer index for `path`. - * - * @param {String} path - * @api private - */ -SendStream.prototype.sendIndex = function sendIndex(path){ - var i = -1; - var self = this; - - function next(err){ - if (++i >= self._index.length) { - if (err) return self.onStatError(err); - return self.error(404); - } - - var p = join(path, self._index[i]); - - debug('stat "%s"', p); - fs.stat(p, function(err, stat){ - if (err) return next(err); - if (stat.isDirectory()) return next(); - self.emit('file', p, stat); - self.send(p, stat); - }); - } - - next(); -}; - -/** - * Stream `path` to the response. - * - * @param {String} path - * @param {Object} options - * @api private - */ - -SendStream.prototype.stream = function(path, options){ - // TODO: this is all lame, refactor meeee - var finished = false; - var self = this; - var res = this.res; - var req = this.req; - - // pipe - var stream = fs.createReadStream(path, options); - this.emit('stream', stream); - stream.pipe(res); - - // response finished, done with the fd - onFinished(res, function onfinished(){ - finished = true; - destroy(stream); - }); - - // error handling code-smell - stream.on('error', function onerror(err){ - // request already finished - if (finished) return; - - // clean up stream - finished = true; - destroy(stream); - - // error - self.onStatError(err); - }); - - // end - stream.on('end', function onend(){ - self.emit('end'); - }); -}; - -/** - * Set content-type based on `path` - * if it hasn't been explicitly set. - * - * @param {String} path - * @api private - */ - -SendStream.prototype.type = function type(path) { - var res = this.res; - - if (res.getHeader('Content-Type')) return; - - var type = mime.lookup(path); - - if (!type) { - debug('no content-type'); - return; - } - - var charset = mime.charsets.lookup(type); - - debug('content-type %s', type); - res.setHeader('Content-Type', type + (charset ? '; charset=' + charset : '')); -}; - -/** - * Set response header fields, most - * fields may be pre-defined. - * - * @param {String} path - * @param {Object} stat - * @api private - */ - -SendStream.prototype.setHeader = function setHeader(path, stat){ - var res = this.res; - - this.emit('headers', res, path, stat); - - if (!res.getHeader('Accept-Ranges')) res.setHeader('Accept-Ranges', 'bytes'); - if (!res.getHeader('Cache-Control')) res.setHeader('Cache-Control', 'public, max-age=' + Math.floor(this._maxage / 1000)); - - if (this._lastModified && !res.getHeader('Last-Modified')) { - var modified = stat.mtime.toUTCString() - debug('modified %s', modified) - res.setHeader('Last-Modified', modified) - } - - if (this._etag && !res.getHeader('ETag')) { - var val = etag(stat) - debug('etag %s', val) - res.setHeader('ETag', val) - } -}; - -/** - * Determine if path parts contain a dotfile. - * - * @api private - */ - -function containsDotFile(parts) { - for (var i = 0; i < parts.length; i++) { - if (parts[i][0] === '.') { - return true - } - } - - return false -} - -/** - * decodeURIComponent. - * - * Allows V8 to only deoptimize this fn instead of all - * of send(). - * - * @param {String} path - * @api private - */ - -function decode(path) { - try { - return decodeURIComponent(path) - } catch (err) { - return -1 - } -} - -/** - * Normalize the index option into an array. - * - * @param {boolean|string|array} val - * @param {string} name - * @private - */ - -function normalizeList(val, name) { - var list = [].concat(val || []) - - for (var i = 0; i < list.length; i++) { - if (typeof list[i] !== 'string') { - throw new TypeError(name + ' must be array of strings or false') - } - } - - return list -} diff --git a/node_modules/serve-static/node_modules/send/package.json b/node_modules/serve-static/node_modules/send/package.json deleted file mode 100644 index 6602867..0000000 --- a/node_modules/serve-static/node_modules/send/package.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "send", - "description": "Better streaming static file server with Range and conditional-GET support", - "version": "0.13.2", - "author": "TJ Holowaychuk ", - "contributors": [ - "Douglas Christopher Wilson " - ], - "license": "MIT", - "repository": "pillarjs/send", - "keywords": [ - "static", - "file", - "server" - ], - "dependencies": { - "debug": "~2.2.0", - "depd": "~1.1.0", - "destroy": "~1.0.4", - "escape-html": "~1.0.3", - "etag": "~1.7.0", - "fresh": "0.3.0", - "http-errors": "~1.3.1", - "mime": "1.3.4", - "ms": "0.7.1", - "on-finished": "~2.3.0", - "range-parser": "~1.0.3", - "statuses": "~1.2.1" - }, - "devDependencies": { - "after": "0.8.1", - "istanbul": "0.4.2", - "mocha": "2.4.5", - "supertest": "1.1.0" - }, - "files": [ - "HISTORY.md", - "LICENSE", - "README.md", - "index.js" - ], - "engines": { - "node": ">= 0.8.0" - }, - "scripts": { - "test": "mocha --check-leaks --reporter spec --bail", - "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --check-leaks --reporter spec", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --check-leaks --reporter dot" - } -} diff --git a/node_modules/serve-static/node_modules/statuses/LICENSE b/node_modules/serve-static/node_modules/statuses/LICENSE deleted file mode 100644 index a7ae8ee..0000000 --- a/node_modules/serve-static/node_modules/statuses/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ - -The MIT License (MIT) - -Copyright (c) 2014 Jonathan Ong me@jongleberry.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/serve-static/node_modules/statuses/README.md b/node_modules/serve-static/node_modules/statuses/README.md deleted file mode 100644 index f6ae24c..0000000 --- a/node_modules/serve-static/node_modules/statuses/README.md +++ /dev/null @@ -1,114 +0,0 @@ -# Statuses - -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Node.js Version][node-version-image]][node-version-url] -[![Build Status][travis-image]][travis-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -HTTP status utility for node. - -## API - -```js -var status = require('statuses'); -``` - -### var code = status(Integer || String) - -If `Integer` or `String` is a valid HTTP code or status message, then the appropriate `code` will be returned. Otherwise, an error will be thrown. - -```js -status(403) // => 'Forbidden' -status('403') // => 'Forbidden' -status('forbidden') // => 403 -status('Forbidden') // => 403 -status(306) // throws, as it's not supported by node.js -``` - -### status.codes - -Returns an array of all the status codes as `Integer`s. - -### var msg = status[code] - -Map of `code` to `status message`. `undefined` for invalid `code`s. - -```js -status[404] // => 'Not Found' -``` - -### var code = status[msg] - -Map of `status message` to `code`. `msg` can either be title-cased or lower-cased. `undefined` for invalid `status message`s. - -```js -status['not found'] // => 404 -status['Not Found'] // => 404 -``` - -### status.redirect[code] - -Returns `true` if a status code is a valid redirect status. - -```js -status.redirect[200] // => undefined -status.redirect[301] // => true -``` - -### status.empty[code] - -Returns `true` if a status code expects an empty body. - -```js -status.empty[200] // => undefined -status.empty[204] // => true -status.empty[304] // => true -``` - -### status.retry[code] - -Returns `true` if you should retry the rest. - -```js -status.retry[501] // => undefined -status.retry[503] // => true -``` - -### statuses/codes.json - -```js -var codes = require('statuses/codes.json'); -``` - -This is a JSON file of the status codes -taken from `require('http').STATUS_CODES`. -This is saved so that codes are consistent even in older node.js versions. -For example, `308` will be added in v0.12. - -## Adding Status Codes - -The status codes are primarily sourced from http://www.iana.org/assignments/http-status-codes/http-status-codes-1.csv. -Additionally, custom codes are added from http://en.wikipedia.org/wiki/List_of_HTTP_status_codes. -These are added manually in the `lib/*.json` files. -If you would like to add a status code, add it to the appropriate JSON file. - -To rebuild `codes.json`, run the following: - -```bash -# update src/iana.json -npm run update -# build codes.json -npm run build -``` - -[npm-image]: https://img.shields.io/npm/v/statuses.svg?style=flat -[npm-url]: https://npmjs.org/package/statuses -[node-version-image]: http://img.shields.io/badge/node.js-%3E%3D_0.6-brightgreen.svg?style=flat -[node-version-url]: http://nodejs.org/download/ -[travis-image]: https://img.shields.io/travis/jshttp/statuses.svg?style=flat -[travis-url]: https://travis-ci.org/jshttp/statuses -[coveralls-image]: https://img.shields.io/coveralls/jshttp/statuses.svg?style=flat -[coveralls-url]: https://coveralls.io/r/jshttp/statuses?branch=master -[downloads-image]: http://img.shields.io/npm/dm/statuses.svg?style=flat -[downloads-url]: https://npmjs.org/package/statuses diff --git a/node_modules/serve-static/node_modules/statuses/codes.json b/node_modules/serve-static/node_modules/statuses/codes.json deleted file mode 100644 index 4c45a88..0000000 --- a/node_modules/serve-static/node_modules/statuses/codes.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "100": "Continue", - "101": "Switching Protocols", - "102": "Processing", - "200": "OK", - "201": "Created", - "202": "Accepted", - "203": "Non-Authoritative Information", - "204": "No Content", - "205": "Reset Content", - "206": "Partial Content", - "207": "Multi-Status", - "208": "Already Reported", - "226": "IM Used", - "300": "Multiple Choices", - "301": "Moved Permanently", - "302": "Found", - "303": "See Other", - "304": "Not Modified", - "305": "Use Proxy", - "306": "(Unused)", - "307": "Temporary Redirect", - "308": "Permanent Redirect", - "400": "Bad Request", - "401": "Unauthorized", - "402": "Payment Required", - "403": "Forbidden", - "404": "Not Found", - "405": "Method Not Allowed", - "406": "Not Acceptable", - "407": "Proxy Authentication Required", - "408": "Request Timeout", - "409": "Conflict", - "410": "Gone", - "411": "Length Required", - "412": "Precondition Failed", - "413": "Payload Too Large", - "414": "URI Too Long", - "415": "Unsupported Media Type", - "416": "Range Not Satisfiable", - "417": "Expectation Failed", - "418": "I'm a teapot", - "422": "Unprocessable Entity", - "423": "Locked", - "424": "Failed Dependency", - "425": "Unordered Collection", - "426": "Upgrade Required", - "428": "Precondition Required", - "429": "Too Many Requests", - "431": "Request Header Fields Too Large", - "451": "Unavailable For Legal Reasons", - "500": "Internal Server Error", - "501": "Not Implemented", - "502": "Bad Gateway", - "503": "Service Unavailable", - "504": "Gateway Timeout", - "505": "HTTP Version Not Supported", - "506": "Variant Also Negotiates", - "507": "Insufficient Storage", - "508": "Loop Detected", - "509": "Bandwidth Limit Exceeded", - "510": "Not Extended", - "511": "Network Authentication Required" -} \ No newline at end of file diff --git a/node_modules/serve-static/node_modules/statuses/index.js b/node_modules/serve-static/node_modules/statuses/index.js deleted file mode 100644 index b06182d..0000000 --- a/node_modules/serve-static/node_modules/statuses/index.js +++ /dev/null @@ -1,60 +0,0 @@ - -var codes = require('./codes.json'); - -module.exports = status; - -// [Integer...] -status.codes = Object.keys(codes).map(function (code) { - code = ~~code; - var msg = codes[code]; - status[code] = msg; - status[msg] = status[msg.toLowerCase()] = code; - return code; -}); - -// status codes for redirects -status.redirect = { - 300: true, - 301: true, - 302: true, - 303: true, - 305: true, - 307: true, - 308: true, -}; - -// status codes for empty bodies -status.empty = { - 204: true, - 205: true, - 304: true, -}; - -// status codes for when you should retry the request -status.retry = { - 502: true, - 503: true, - 504: true, -}; - -function status(code) { - if (typeof code === 'number') { - if (!status[code]) throw new Error('invalid status code: ' + code); - return code; - } - - if (typeof code !== 'string') { - throw new TypeError('code must be a number or string'); - } - - // '403' - var n = parseInt(code, 10) - if (!isNaN(n)) { - if (!status[n]) throw new Error('invalid status code: ' + n); - return n; - } - - n = status[code.toLowerCase()]; - if (!n) throw new Error('invalid status message: "' + code + '"'); - return n; -} diff --git a/node_modules/serve-static/node_modules/statuses/package.json b/node_modules/serve-static/node_modules/statuses/package.json deleted file mode 100644 index e3a627f..0000000 --- a/node_modules/serve-static/node_modules/statuses/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "statuses", - "description": "HTTP status utility", - "version": "1.2.1", - "author": { - "name": "Jonathan Ong", - "email": "me@jongleberry.com", - "url": "http://jongleberry.com", - "twitter": "https://twitter.com/jongleberry" - }, - "repository": "jshttp/statuses", - "license": "MIT", - "keywords": [ - "http", - "status", - "code" - ], - "files": [ - "index.js", - "codes.json", - "LICENSE" - ], - "devDependencies": { - "csv-parse": "0.0.6", - "istanbul": "0", - "mocha": "1", - "stream-to-array": "2" - }, - "scripts": { - "build": "node scripts/build.js", - "update": "node scripts/update.js", - "test": "mocha --reporter spec --bail --check-leaks", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks" - } -} diff --git a/node_modules/serve-static/package.json b/node_modules/serve-static/package.json index ea10baa..9d935f5 100644 --- a/node_modules/serve-static/package.json +++ b/node_modules/serve-static/package.json @@ -1,23 +1,28 @@ { "name": "serve-static", "description": "Serve static files", - "version": "1.10.3", + "version": "1.15.0", "author": "Douglas Christopher Wilson ", "license": "MIT", "repository": "expressjs/serve-static", "dependencies": { + "encodeurl": "~1.0.2", "escape-html": "~1.0.3", - "parseurl": "~1.3.1", - "send": "0.13.2" + "parseurl": "~1.3.3", + "send": "0.18.0" }, "devDependencies": { - "eslint": "2.11.1", - "eslint-config-standard": "5.3.1", - "eslint-plugin-promise": "1.3.1", - "eslint-plugin-standard": "1.3.2", - "istanbul": "0.4.3", - "mocha": "2.5.3", - "supertest": "1.1.0" + "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": "5.2.0", + "eslint-plugin-standard": "4.1.0", + "mocha": "9.2.2", + "nyc": "15.1.0", + "safe-buffer": "5.2.1", + "supertest": "6.2.2" }, "files": [ "LICENSE", @@ -28,9 +33,10 @@ "node": ">= 0.8.0" }, "scripts": { - "lint": "eslint **/*.js", + "lint": "eslint .", "test": "mocha --reporter spec --bail --check-leaks test/", - "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/" + "test-ci": "nyc --reporter=lcov --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test", + "version": "node scripts/version-history.js && git add HISTORY.md" } } diff --git a/node_modules/sqlstring/HISTORY.md b/node_modules/sqlstring/HISTORY.md index aea1dfc..e2c7e51 100644 --- a/node_modules/sqlstring/HISTORY.md +++ b/node_modules/sqlstring/HISTORY.md @@ -1,13 +1,3 @@ -2.3.3 / 2022-03-06 -================== - - * Fix escaping `Date` objects from foreign isolates - -2.3.2 / 2020-04-15 -================== - - * perf: remove outdated array pattern - 2.3.1 / 2018-02-24 ================== diff --git a/node_modules/sqlstring/README.md b/node_modules/sqlstring/README.md index a00c560..fafe6f4 100644 --- a/node_modules/sqlstring/README.md +++ b/node_modules/sqlstring/README.md @@ -3,7 +3,7 @@ [![NPM Version][npm-version-image]][npm-url] [![NPM Downloads][npm-downloads-image]][npm-url] [![Node.js Version][node-image]][node-url] -[![Build Status][github-actions-ci-image]][github-actions-ci-url] +[![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url] Simple SQL escape and format for MySQL @@ -16,6 +16,7 @@ $ npm install sqlstring ## Usage + ```js var SqlString = require('sqlstring'); @@ -197,9 +198,9 @@ console.log(sql); // UPDATE `users` SET `email` = 'foobar@example.com', `modifie [npm-version-image]: https://img.shields.io/npm/v/sqlstring.svg [npm-downloads-image]: https://img.shields.io/npm/dm/sqlstring.svg [npm-url]: https://npmjs.org/package/sqlstring +[travis-image]: https://img.shields.io/travis/mysqljs/sqlstring/master.svg +[travis-url]: https://travis-ci.org/mysqljs/sqlstring [coveralls-image]: https://img.shields.io/coveralls/mysqljs/sqlstring/master.svg [coveralls-url]: https://coveralls.io/r/mysqljs/sqlstring?branch=master -[github-actions-ci-image]: https://img.shields.io/github/workflow/status/mysqljs/sqlstring/ci/master?label=build -[github-actions-ci-url]: https://github.com/mysqljs/sqlstring/actions/workflows/ci.yml [node-image]: https://img.shields.io/node/v/sqlstring.svg [node-url]: https://nodejs.org/en/download diff --git a/node_modules/sqlstring/lib/SqlString.js b/node_modules/sqlstring/lib/SqlString.js index 8206dad..419adec 100644 --- a/node_modules/sqlstring/lib/SqlString.js +++ b/node_modules/sqlstring/lib/SqlString.js @@ -40,7 +40,7 @@ SqlString.escape = function escape(val, stringifyObjects, timeZone) { case 'boolean': return (val) ? 'true' : 'false'; case 'number': return val + ''; case 'object': - if (Object.prototype.toString.call(val) === '[object Date]') { + if (val instanceof Date) { return SqlString.dateToString(val, timeZone || 'local'); } else if (Array.isArray(val)) { return SqlString.arrayToList(val, timeZone); @@ -78,7 +78,7 @@ SqlString.format = function format(sql, values, stringifyObjects, timeZone) { return sql; } - if (!Array.isArray(values)) { + if (!(values instanceof Array || Array.isArray(values))) { values = [values]; } diff --git a/node_modules/sqlstring/package.json b/node_modules/sqlstring/package.json index 5aa57f1..2c951a3 100644 --- a/node_modules/sqlstring/package.json +++ b/node_modules/sqlstring/package.json @@ -1,7 +1,7 @@ { "name": "sqlstring", "description": "Simple SQL escape and format for MySQL", - "version": "2.3.3", + "version": "2.3.1", "contributors": [ "Adri Van Houdt ", "Douglas Christopher Wilson ", @@ -21,9 +21,9 @@ "devDependencies": { "beautify-benchmark": "0.2.4", "benchmark": "2.1.4", - "eslint": "7.32.0", - "eslint-plugin-markdown": "2.2.1", - "nyc": "15.1.0", + "eslint": "4.18.1", + "eslint-plugin-markdown": "1.0.0-beta.6", + "nyc": "10.3.2", "urun": "0.0.8", "utest": "0.0.8" }, @@ -39,9 +39,9 @@ }, "scripts": { "bench": "node benchmark/index.js", - "lint": "eslint .", + "lint": "eslint --plugin markdown --ext js,md .", "test": "node test/run.js", - "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", + "test-ci": "nyc --reporter=text npm test", "test-cov": "nyc --reporter=html --reporter=text npm test" } } diff --git a/node_modules/utils-merge/.npmignore b/node_modules/utils-merge/.npmignore new file mode 100644 index 0000000..3e53844 --- /dev/null +++ b/node_modules/utils-merge/.npmignore @@ -0,0 +1,9 @@ +CONTRIBUTING.md +Makefile +docs/ +examples/ +reports/ +test/ + +.jshintrc +.travis.yml diff --git a/node_modules/utils-merge/.travis.yml b/node_modules/utils-merge/.travis.yml deleted file mode 100644 index af92b02..0000000 --- a/node_modules/utils-merge/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: "node_js" -node_js: - - "0.4" - - "0.6" - - "0.8" - - "0.10" diff --git a/node_modules/utils-merge/LICENSE b/node_modules/utils-merge/LICENSE index e33bd10..76f6d08 100644 --- a/node_modules/utils-merge/LICENSE +++ b/node_modules/utils-merge/LICENSE @@ -1,6 +1,6 @@ -(The MIT License) +The MIT License (MIT) -Copyright (c) 2013 Jared Hanson +Copyright (c) 2013-2017 Jared Hanson 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 diff --git a/node_modules/utils-merge/README.md b/node_modules/utils-merge/README.md index 2f94e9b..0cb7117 100644 --- a/node_modules/utils-merge/README.md +++ b/node_modules/utils-merge/README.md @@ -1,10 +1,19 @@ # utils-merge +[![Version](https://img.shields.io/npm/v/utils-merge.svg?label=version)](https://www.npmjs.com/package/utils-merge) +[![Build](https://img.shields.io/travis/jaredhanson/utils-merge.svg)](https://travis-ci.org/jaredhanson/utils-merge) +[![Quality](https://img.shields.io/codeclimate/github/jaredhanson/utils-merge.svg?label=quality)](https://codeclimate.com/github/jaredhanson/utils-merge) +[![Coverage](https://img.shields.io/coveralls/jaredhanson/utils-merge.svg)](https://coveralls.io/r/jaredhanson/utils-merge) +[![Dependencies](https://img.shields.io/david/jaredhanson/utils-merge.svg)](https://david-dm.org/jaredhanson/utils-merge) + + Merges the properties from a source object into a destination object. ## Install - $ npm install utils-merge +```bash +$ npm install utils-merge +``` ## Usage @@ -16,19 +25,10 @@ merge(a, b); // => { foo: 'bar', bar: 'baz' } ``` -## Tests - - $ npm install - $ npm test - -[![Build Status](https://secure.travis-ci.org/jaredhanson/utils-merge.png)](http://travis-ci.org/jaredhanson/utils-merge) - -## Credits - - - [Jared Hanson](http://github.com/jaredhanson) - ## License [The MIT License](http://opensource.org/licenses/MIT) -Copyright (c) 2013 Jared Hanson <[http://jaredhanson.net/](http://jaredhanson.net/)> +Copyright (c) 2013-2017 Jared Hanson <[http://jaredhanson.net/](http://jaredhanson.net/)> + + Sponsor diff --git a/node_modules/utils-merge/package.json b/node_modules/utils-merge/package.json index a02940d..e36b078 100644 --- a/node_modules/utils-merge/package.json +++ b/node_modules/utils-merge/package.json @@ -1,10 +1,15 @@ { "name": "utils-merge", - "version": "1.0.0", + "version": "1.0.1", "description": "merge() utility function", "keywords": [ "util" ], + "author": { + "name": "Jared Hanson", + "email": "jaredhanson@gmail.com", + "url": "http://www.jaredhanson.net/" + }, "repository": { "type": "git", "url": "git://github.com/jaredhanson/utils-merge.git" @@ -12,28 +17,24 @@ "bugs": { "url": "http://github.com/jaredhanson/utils-merge/issues" }, - "author": { - "name": "Jared Hanson", - "email": "jaredhanson@gmail.com", - "url": "http://www.jaredhanson.net/" - }, + "license": "MIT", "licenses": [ { "type": "MIT", - "url": "http://www.opensource.org/licenses/MIT" + "url": "http://opensource.org/licenses/MIT" } ], "main": "./index", - "dependencies": { - }, + "dependencies": {}, "devDependencies": { + "make-node": "0.3.x", "mocha": "1.x.x", "chai": "1.x.x" }, - "scripts": { - "test": "node_modules/.bin/mocha --reporter spec --require test/bootstrap/node test/*.test.js" - }, "engines": { "node": ">= 0.4.0" + }, + "scripts": { + "test": "node_modules/.bin/mocha --reporter spec --require test/bootstrap/node test/*.test.js" } } diff --git a/node_modules/vary/HISTORY.md b/node_modules/vary/HISTORY.md index cddbcd4..f6cbcf7 100644 --- a/node_modules/vary/HISTORY.md +++ b/node_modules/vary/HISTORY.md @@ -1,3 +1,19 @@ +1.1.2 / 2017-09-23 +================== + + * perf: improve header token parsing speed + +1.1.1 / 2017-03-20 +================== + + * perf: hoist regular expression + +1.1.0 / 2015-09-29 +================== + + * Only accept valid field names in the `field` argument + - Ensures the resulting string is a valid HTTP header value + 1.0.1 / 2015-07-08 ================== diff --git a/node_modules/vary/LICENSE b/node_modules/vary/LICENSE index 142ede3..84441fb 100644 --- a/node_modules/vary/LICENSE +++ b/node_modules/vary/LICENSE @@ -1,6 +1,6 @@ (The MIT License) -Copyright (c) 2014-2015 Douglas Christopher Wilson +Copyright (c) 2014-2017 Douglas Christopher Wilson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/node_modules/vary/README.md b/node_modules/vary/README.md index 5966542..cc000b3 100644 --- a/node_modules/vary/README.md +++ b/node_modules/vary/README.md @@ -10,12 +10,18 @@ Manipulate the HTTP Vary header ## 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 vary ``` ## API + + ```js var vary = require('vary') ``` @@ -29,6 +35,8 @@ header, or an array of multiple fields. This will append the header if not already listed, otherwise leaves it listed in the current location. + + ```js // Append "Origin" to the Vary header of the response vary(res, 'Origin') @@ -43,6 +51,8 @@ or an array of multiple fields. This will append the header if not already listed, otherwise leaves it listed in the current location. The new header string is returned. + + ```js // Get header string appending "Origin" to "Accept, User-Agent" vary.append('Accept, User-Agent', 'Origin') @@ -56,7 +66,7 @@ vary.append('Accept, User-Agent', 'Origin') var http = require('http') var vary = require('vary') -http.createServer(function onRequest(req, res) { +http.createServer(function onRequest (req, res) { // about to user-agent sniff vary(res, 'User-Agent') @@ -82,7 +92,7 @@ $ npm test [npm-image]: https://img.shields.io/npm/v/vary.svg [npm-url]: https://npmjs.org/package/vary [node-version-image]: https://img.shields.io/node/v/vary.svg -[node-version-url]: http://nodejs.org/download/ +[node-version-url]: https://nodejs.org/en/download [travis-image]: https://img.shields.io/travis/jshttp/vary/master.svg [travis-url]: https://travis-ci.org/jshttp/vary [coveralls-image]: https://img.shields.io/coveralls/jshttp/vary/master.svg diff --git a/node_modules/vary/index.js b/node_modules/vary/index.js index e818dbb..5b5e741 100644 --- a/node_modules/vary/index.js +++ b/node_modules/vary/index.js @@ -1,23 +1,30 @@ /*! * vary - * Copyright(c) 2014-2015 Douglas Christopher Wilson + * Copyright(c) 2014-2017 Douglas Christopher Wilson * MIT Licensed */ -'use strict'; +'use strict' /** * Module exports. */ -module.exports = vary; -module.exports.append = append; +module.exports = vary +module.exports.append = append /** - * Variables. + * RegExp to match field-name in RFC 7230 sec 3.2 + * + * field-name = token + * token = 1*tchar + * tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" + * / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~" + * / DIGIT / ALPHA + * ; any VCHAR, except delimiters */ -var separators = /[\(\)<>@,;:\\"\/\[\]\?=\{\}\u0020\u0009]/; +var FIELD_NAME_REGEXP = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/ /** * Append a field to a vary header. @@ -25,57 +32,57 @@ var separators = /[\(\)<>@,;:\\"\/\[\]\?=\{\}\u0020\u0009]/; * @param {String} header * @param {String|Array} field * @return {String} - * @api public + * @public */ -function append(header, field) { +function append (header, field) { if (typeof header !== 'string') { - throw new TypeError('header argument is required'); + throw new TypeError('header argument is required') } if (!field) { - throw new TypeError('field argument is required'); + throw new TypeError('field argument is required') } // get fields array var fields = !Array.isArray(field) ? parse(String(field)) - : field; + : field - // assert on invalid fields - for (var i = 0; i < fields.length; i++) { - if (separators.test(fields[i])) { - throw new TypeError('field argument contains an invalid header'); + // assert on invalid field names + for (var j = 0; j < fields.length; j++) { + if (!FIELD_NAME_REGEXP.test(fields[j])) { + throw new TypeError('field argument contains an invalid header name') } } // existing, unspecified vary if (header === '*') { - return header; + return header } // enumerate current values - var val = header; - var vals = parse(header.toLowerCase()); + var val = header + var vals = parse(header.toLowerCase()) // unspecified vary if (fields.indexOf('*') !== -1 || vals.indexOf('*') !== -1) { - return '*'; + return '*' } for (var i = 0; i < fields.length; i++) { - var fld = fields[i].toLowerCase(); + var fld = fields[i].toLowerCase() // append value (case-preserving) if (vals.indexOf(fld) === -1) { - vals.push(fld); + vals.push(fld) val = val ? val + ', ' + fields[i] - : fields[i]; + : fields[i] } } - return val; + return val } /** @@ -83,11 +90,36 @@ function append(header, field) { * * @param {String} header * @return {Array} - * @api private + * @private */ -function parse(header) { - return header.trim().split(/ *, */); +function parse (header) { + var end = 0 + var list = [] + var start = 0 + + // gather tokens + for (var i = 0, len = header.length; i < len; i++) { + switch (header.charCodeAt(i)) { + case 0x20: /* */ + if (start === end) { + start = end = i + 1 + } + break + case 0x2c: /* , */ + list.push(header.substring(start, end)) + start = end = i + 1 + break + default: + end = i + 1 + break + } + } + + // final token + list.push(header.substring(start, end)) + + return list } /** @@ -95,23 +127,23 @@ function parse(header) { * * @param {Object} res * @param {String|Array} field - * @api public + * @public */ -function vary(res, field) { +function vary (res, field) { if (!res || !res.getHeader || !res.setHeader) { // quack quack - throw new TypeError('res argument is required'); + throw new TypeError('res argument is required') } // get existing header var val = res.getHeader('Vary') || '' var header = Array.isArray(val) ? val.join(', ') - : String(val); + : String(val) // set new header if ((val = append(header, field))) { - res.setHeader('Vary', val); + res.setHeader('Vary', val) } } diff --git a/node_modules/vary/package.json b/node_modules/vary/package.json index 3b26890..028f72a 100644 --- a/node_modules/vary/package.json +++ b/node_modules/vary/package.json @@ -1,7 +1,7 @@ { "name": "vary", "description": "Manipulate the HTTP Vary header", - "version": "1.0.1", + "version": "1.1.2", "author": "Douglas Christopher Wilson ", "license": "MIT", "keywords": [ @@ -11,9 +11,18 @@ ], "repository": "jshttp/vary", "devDependencies": { - "istanbul": "0.3.17", - "mocha": "2.2.5", - "supertest": "1.0.1" + "beautify-benchmark": "0.2.4", + "benchmark": "2.1.4", + "eslint": "3.19.0", + "eslint-config-standard": "10.2.1", + "eslint-plugin-import": "2.7.0", + "eslint-plugin-markdown": "1.0.0-beta.6", + "eslint-plugin-node": "5.1.1", + "eslint-plugin-promise": "3.5.0", + "eslint-plugin-standard": "3.0.1", + "istanbul": "0.4.5", + "mocha": "2.5.3", + "supertest": "1.1.0" }, "files": [ "HISTORY.md", @@ -25,6 +34,8 @@ "node": ">= 0.8" }, "scripts": { + "bench": "node benchmark/index.js", + "lint": "eslint --plugin markdown --ext js,md .", "test": "mocha --reporter spec --bail --check-leaks test/", "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" diff --git a/package-lock.json b/package-lock.json index de1cd6c..c5a8722 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,37 +9,19 @@ "version": "1.0.0", "license": "ISC", "dependencies": { - "@eonasdan/tempus-dominus": "^6.7.19", - "@popperjs/core": "^2.11.8", "bcrypt": "^5.1.1", - "body-parser": "^1.20.2", + "body-parser": "^1.20.1", "bootstrap": "^5.2.1", "cookie-parser": "^1.4.6", "dateformat": "^4.6.3", "dotenv": "^16.3.1", - "express": "^5.0.0-alpha.2", + "express": "^4.18.2", "hbs": "^4.2.0", - "mysql2": "^3.6.5", + "mysql": "^2.18.1", "nodemon": "^3.0.1", "uuid": "^9.0.1" } }, - "node_modules/@eonasdan/tempus-dominus": { - "version": "6.7.19", - "resolved": "https://registry.npmjs.org/@eonasdan/tempus-dominus/-/tempus-dominus-6.7.19.tgz", - "integrity": "sha512-rUHm1lTZLWdYUBAJJvic1p4Df/0h0rqV523r+DZtCkfty2ejf9NDsTYw3Vi0acSCt2kqwXom9R8jslzxxVcfOw==", - "funding": { - "url": "https://ko-fi.com/eonasdan" - }, - "peerDependencies": { - "@popperjs/core": "^2.11.6" - }, - "peerDependenciesMeta": { - "@popperjs/core\"": { - "optional": true - } - } - }, "node_modules/@mapbox/node-pre-gyp": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz", @@ -77,6 +59,7 @@ "version": "2.11.8", "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", + "peer": true, "funding": { "type": "opencollective", "url": "https://opencollective.com/popperjs" @@ -88,12 +71,12 @@ "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" }, "node_modules/accepts": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.2.13.tgz", - "integrity": "sha512-R190A3EzrS4huFOVZajhXCYZt5p5yrkaQOB4nsWzfth0cYaDcSN5J86l58FJ1dt7igp37fB/QhnuFkGAJmr+eg==", + "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.6", - "negotiator": "0.5.3" + "mime-types": "~2.1.34", + "negotiator": "0.6.3" }, "engines": { "node": ">= 0.6" @@ -182,9 +165,9 @@ } }, "node_modules/array-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.0.tgz", - "integrity": "sha512-B9Cdx2PIqexNnAWplLzRP89pa0vcEMkHGKr6/CY0ZzuI1Z5o6E392/7OtSFyrzEIXZ/pDdoGRoDaWJHg9mJMaA==" + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" }, "node_modules/balanced-match": { "version": "1.0.2", @@ -204,6 +187,14 @@ "node": ">= 10.0.0" } }, + "node_modules/bignumber.js": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.0.tgz", + "integrity": "sha512-t/OYhhJ2SD+YGBQcjY8GzzDHEk9f3nerxjtfa6tlMXfe7frs/WozhvCNoGvpM0P3bNf3Gq5ZRMlGr5f3r4/N8A==", + "engines": { + "node": "*" + } + }, "node_modules/binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", @@ -213,12 +204,12 @@ } }, "node_modules/body-parser": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", - "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "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.5", + "content-type": "~1.0.4", "debug": "2.6.9", "depd": "2.0.0", "destroy": "1.2.0", @@ -226,7 +217,7 @@ "iconv-lite": "0.4.24", "on-finished": "2.4.1", "qs": "6.11.0", - "raw-body": "2.5.2", + "raw-body": "2.5.1", "type-is": "~1.6.18", "unpipe": "1.0.0" }, @@ -347,9 +338,12 @@ "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==" }, "node_modules/content-disposition": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.0.tgz", - "integrity": "sha512-PWzG8GssMHTPSLBoOeK5MvPPJeWU5ZVX8omvJC16BUH/nUX6J/jM/hgm/mrPWzTXVV3B3OoBhFdHXyGLU4TgUw==", + "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" } @@ -363,11 +357,11 @@ } }, "node_modules/cookie": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.1.3.tgz", - "integrity": "sha512-mWkFhcL+HVG1KjeCjEBVJJ7s4sAGMLiBDFSDs4bzzvgLZt7rW8BhP6XV/8b1+pNvx/skd3yYxPuaF3Z6LlQzyw==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", + "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", "engines": { - "node": "*" + "node": ">= 0.6" } }, "node_modules/cookie-parser": { @@ -395,6 +389,11 @@ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" + }, "node_modules/dateformat": { "version": "4.6.3", "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-4.6.3.tgz", @@ -429,14 +428,6 @@ "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==" }, - "node_modules/denque": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", - "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==", - "engines": { - "node": ">=0.10" - } - }, "node_modules/depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", @@ -483,101 +474,68 @@ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, - "node_modules/escape-html": { + "node_modules/encodeurl": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.2.tgz", - "integrity": "sha512-J5ahyCRC4liskWVAfkmosNWfG0eHQxI0W+Ko7k3cZaYVMfgt05dwZ68vw6S/TZM1BPvuTv3kq6CRCb7WWtBUVA==" + "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.7.0", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.7.0.tgz", - "integrity": "sha512-Mbv5pNpLNPrm1b4rzZlZlfTRpdDr31oiD43N362sIyvSWVNu5Du33EcJGzvEV4YdYLuENB1HzND907cQkFmXNw==", + "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": "5.0.0-alpha.2", - "resolved": "https://registry.npmjs.org/express/-/express-5.0.0-alpha.2.tgz", - "integrity": "sha512-dCv747cpHLEUBzHm5MR8y6eq43izDxmfWtpq1oaTY3vlW3nlLugPob1rzg7/mul/a7o/Svg6SNx/oc/3fz61mA==", + "version": "4.18.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", + "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", "dependencies": { - "accepts": "~1.2.10", - "array-flatten": "1.1.0", - "content-disposition": "0.5.0", - "content-type": "~1.0.1", - "cookie": "0.1.3", + "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.2.0", - "depd": "~1.0.1", - "escape-html": "1.0.2", - "etag": "~1.7.0", - "finalhandler": "0.4.0", - "fresh": "0.3.0", - "merge-descriptors": "1.0.0", - "methods": "~1.1.1", - "on-finished": "~2.3.0", - "parseurl": "~1.3.0", - "path-is-absolute": "1.0.0", - "path-to-regexp": "0.1.6", - "proxy-addr": "~1.0.8", - "qs": "4.0.0", - "range-parser": "~1.0.2", - "router": "~1.1.2", - "send": "0.13.0", - "serve-static": "~1.10.0", - "type-is": "~1.6.4", - "utils-merge": "1.0.0", - "vary": "~1.0.0" + "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/node_modules/debug": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", - "integrity": "sha512-X0rGvJcskG1c3TgSCPqHJ0XJgwlcvOC7elJ5Y0hYuKBZoVqWpAMfLOeIh2UI/DCQ5ruodIjvsugZtjUYUw2pUw==", - "dependencies": { - "ms": "0.7.1" - } - }, - "node_modules/express/node_modules/depd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.0.1.tgz", - "integrity": "sha512-OEWAMbCkK9IWQ8pfTvHBhCSqHgR+sk5pbiYqq0FqfARG4Cy+cRsCbITx6wh5pcsmfBPiJAcbd98tfdz5fnBbag==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/express/node_modules/ms": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", - "integrity": "sha512-lRLiIR9fSNpnP6TC4v8+4OU7oStC01esuNowdQ34L+Gk8e5Puoc88IqJ+XAY/B3Mn2ZKis8l8HX90oU8ivzUHg==" - }, - "node_modules/express/node_modules/on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==", - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/express/node_modules/path-is-absolute": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz", - "integrity": "sha512-hUUTsB/vByumPhn43R+Azhsx4TQPvyQqW+XyCR6UA8ae+FGIjf5Oygj6o/FYK4ZdwnrXth2eIBKk4YlrUU0ElQ==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/express/node_modules/qs": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-4.0.0.tgz", - "integrity": "sha512-8MPmJ83uBOPsQj5tQCv4g04/nTiY+d17yl9o3Bw73vC6XlEm2POIRRlOgWJ8i74bkGLII670cDJJZkgiZ2sIkg==" - }, "node_modules/fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -590,60 +548,39 @@ } }, "node_modules/finalhandler": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-0.4.0.tgz", - "integrity": "sha512-jJU2WE88OqUvwAIf/1K2G2fTdKKZ8LvSwYQyFFekDcmBnBmht38enbcmErnA7iNZktcEo/o2JAHYbe1QDOAgaA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", "dependencies": { - "debug": "~2.2.0", - "escape-html": "1.0.2", - "on-finished": "~2.3.0", + "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/finalhandler/node_modules/debug": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", - "integrity": "sha512-X0rGvJcskG1c3TgSCPqHJ0XJgwlcvOC7elJ5Y0hYuKBZoVqWpAMfLOeIh2UI/DCQ5ruodIjvsugZtjUYUw2pUw==", - "dependencies": { - "ms": "0.7.1" - } - }, - "node_modules/finalhandler/node_modules/ms": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", - "integrity": "sha512-lRLiIR9fSNpnP6TC4v8+4OU7oStC01esuNowdQ34L+Gk8e5Puoc88IqJ+XAY/B3Mn2ZKis8l8HX90oU8ivzUHg==" - }, - "node_modules/finalhandler/node_modules/on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==", - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/foreachasync": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/foreachasync/-/foreachasync-3.0.0.tgz", "integrity": "sha512-J+ler7Ta54FwwNcx6wQRDhTIbNeyDcARMkOcguEqnEdtm0jKvN3Li3PDAb2Du3ubJYEWfYL83XMROXdsXAXycw==" }, "node_modules/forwarded": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", - "integrity": "sha512-Ua9xNhH0b8pwE3yRbFfXJvfdWF0UHNCdeyb2sbi9Ul/M+r3PTdrz7Cv4SCfZRMjmzEM9PhraqfZFbGTIg3OMyA==", + "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.3.0", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.3.0.tgz", - "integrity": "sha512-akx5WBKAwMSg36qoHTuMMVncHWctlaDGslJASDYAhoLrzDUDCjZlOngNa/iC6lPm9aA0qk8pN5KnpmbJHSIIQQ==", + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", "engines": { "node": ">= 0.6" } @@ -715,14 +652,6 @@ "node": ">=10" } }, - "node_modules/generate-function": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", - "integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==", - "dependencies": { - "is-property": "^1.0.2" - } - }, "node_modules/get-intrinsic": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.2.tgz", @@ -947,9 +876,9 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "node_modules/ipaddr.js": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.0.5.tgz", - "integrity": "sha512-wBj+q+3uP78gMowwWgFLAYm/q4x5goyZmDsmuvyz+nd1u0D/ghgXXtc1OkgmTzSiWT101kiqGacwFk9eGQw6xQ==", + "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" } @@ -1000,15 +929,10 @@ "node": ">=0.12.0" } }, - "node_modules/is-property": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", - "integrity": "sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==" - }, - "node_modules/long": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", - "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" }, "node_modules/lru-cache": { "version": "6.0.0", @@ -1052,9 +976,9 @@ } }, "node_modules/merge-descriptors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.0.tgz", - "integrity": "sha512-YJiZmTZTkrqvgefMsWdioTKsZdHnfAhHHkEdPg+4PCqMJEGHQo5iJQjEbMv3XyBZ6y3Z2Rj1mqq1WNKq9e0yNw==" + "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", @@ -1065,11 +989,14 @@ } }, "node_modules/mime": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz", - "integrity": "sha512-sAaYXszED5ALBt665F0wMQCUXpGuZsGdopoqcHPdL39ZYdi7uHoZlhrfZfhv8WzivhBzr/oXwaj+yiK5wY8MXQ==", + "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": { @@ -1157,66 +1084,29 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" }, - "node_modules/mysql2": { - "version": "3.6.5", - "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.6.5.tgz", - "integrity": "sha512-pS/KqIb0xlXmtmqEuTvBXTmLoQ5LmAz5NW/r8UyQ1ldvnprNEj3P9GbmuQQ2J0A4LO+ynotGi6TbscPa8OUb+w==", + "node_modules/mysql": { + "version": "2.18.1", + "resolved": "https://registry.npmjs.org/mysql/-/mysql-2.18.1.tgz", + "integrity": "sha512-Bca+gk2YWmqp2Uf6k5NFEurwY/0td0cpebAucFpY/3jhrwrVGuxU2uQFCHjU19SJfje0yQvi+rVWdq78hR5lig==", "dependencies": { - "denque": "^2.1.0", - "generate-function": "^2.3.1", - "iconv-lite": "^0.6.3", - "long": "^5.2.1", - "lru-cache": "^8.0.0", - "named-placeholders": "^1.1.3", - "seq-queue": "^0.0.5", - "sqlstring": "^2.3.2" + "bignumber.js": "9.0.0", + "readable-stream": "2.3.7", + "safe-buffer": "5.1.2", + "sqlstring": "2.3.1" }, "engines": { - "node": ">= 8.0" + "node": ">= 0.6" } }, - "node_modules/mysql2/node_modules/iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/mysql2/node_modules/lru-cache": { - "version": "8.0.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-8.0.5.tgz", - "integrity": "sha512-MhWWlVnuab1RG5/zMRRcVGXZLCXrZTgfwMikgzCegsPnG62yDQo5JnqKkrK4jO5iKqDAZGItAqN5CtKBCBWRUA==", - "engines": { - "node": ">=16.14" - } - }, - "node_modules/named-placeholders": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.3.tgz", - "integrity": "sha512-eLoBxg6wE/rZkJPhU/xRX1WTpkFEwDJEN96oxFrTsqBdbT5ec295Q+CoHrL9IT0DipqKhmGcaZmwOt8OON5x1w==", - "dependencies": { - "lru-cache": "^7.14.1" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/named-placeholders/node_modules/lru-cache": { - "version": "7.18.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", - "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", - "engines": { - "node": ">=12" - } + "node_modules/mysql/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, "node_modules/negotiator": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.5.3.tgz", - "integrity": "sha512-oXmnazqehLNFohqgLxRyUdOQU9/UX0NpCpsnbjWUjM62ZM8oSOXYZpHc68XR130ftPNano0oQXGdREAplZRhaQ==", + "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" } @@ -1375,9 +1265,9 @@ } }, "node_modules/path-to-regexp": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.6.tgz", - "integrity": "sha512-Ut++lkiF1BogIUY+3SADhfDDdvzb8EOU/D8JutrlrfEuh+DGQbo5c78P96dSuapLEfeH7rpWhiBfJCDAGvSJVQ==" + "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/picomatch": { "version": "2.3.1", @@ -1390,16 +1280,21 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, "node_modules/proxy-addr": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-1.0.10.tgz", - "integrity": "sha512-iq6kR9KN32aFvXjDyC8nIrm203AHeIBPjL6dpaHgSdbpTO8KoPlD0xG92xwwtkCL9+yt1LE5VwpEk43TyP38Dg==", + "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.1.0", - "ipaddr.js": "1.0.5" + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" }, "engines": { - "node": ">= 0.6" + "node": ">= 0.10" } }, "node_modules/pstree.remy": { @@ -1422,17 +1317,17 @@ } }, "node_modules/range-parser": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.0.3.tgz", - "integrity": "sha512-nDsRrtIxVUO5opg/A8T2S3ebULVIfuh8ECbh4w3N4mWxIiT3QILDJDUQayPqm2e8Q8NUa0RSUkGCfe33AfjR3Q==", + "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.2", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", - "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "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", @@ -1443,6 +1338,25 @@ "node": ">= 0.8" } }, + "node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/readable-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, "node_modules/readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -1468,50 +1382,24 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/router": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/router/-/router-1.1.5.tgz", - "integrity": "sha512-p0l/vfNVavaB7DXh3BxJv3NMZi3QKEiIYDnLVyOV5Bo/7Uo3YYk3z65T2IJHG7cfC9QV8UanGhHLOIfPoS9A5g==", - "dependencies": { - "array-flatten": "2.1.1", - "debug": "~2.2.0", - "methods": "~1.1.2", - "parseurl": "~1.3.1", - "path-to-regexp": "0.1.7", - "setprototypeof": "1.0.2", - "utils-merge": "1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/router/node_modules/array-flatten": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-2.1.1.tgz", - "integrity": "sha512-Ylfqm/V1V/VKGazsJeRDZ31wV9gdNeK3ZsvwbYBAVSNgH8o8CMLfdx/ofn9pnMVsvTMfvC3yfcBYzGpD1vxnlw==" - }, - "node_modules/router/node_modules/debug": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", - "integrity": "sha512-X0rGvJcskG1c3TgSCPqHJ0XJgwlcvOC7elJ5Y0hYuKBZoVqWpAMfLOeIh2UI/DCQ5ruodIjvsugZtjUYUw2pUw==", - "dependencies": { - "ms": "0.7.1" - } - }, - "node_modules/router/node_modules/ms": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", - "integrity": "sha512-lRLiIR9fSNpnP6TC4v8+4OU7oStC01esuNowdQ34L+Gk8e5Puoc88IqJ+XAY/B3Mn2ZKis8l8HX90oU8ivzUHg==" - }, - "node_modules/router/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/router/node_modules/setprototypeof": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.2.tgz", - "integrity": "sha512-mNRSo7UFE4c4tjxlZ3KxO5r+3oQUD1M/KXbp/XTwTwybL4VR9T8Ltmv5DvZX8iRz6C3hQmQftXEV0EmTKRV6mg==" + "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", @@ -1533,180 +1421,47 @@ } }, "node_modules/send": { - "version": "0.13.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.13.0.tgz", - "integrity": "sha512-zck2y84i0SbUUiwq2l5gGPNVpCplL48og5xIhFjNjQa09003YCTy6Vb3rKfVuG8W8PWNUtUOntjQEBdwkJ9oBw==", + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", "dependencies": { - "debug": "~2.2.0", - "depd": "~1.0.1", - "destroy": "1.0.3", - "escape-html": "1.0.2", - "etag": "~1.7.0", - "fresh": "0.3.0", - "http-errors": "~1.3.1", - "mime": "1.3.4", - "ms": "0.7.1", - "on-finished": "~2.3.0", - "range-parser": "~1.0.2", - "statuses": "~1.2.1" + "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/debug": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", - "integrity": "sha512-X0rGvJcskG1c3TgSCPqHJ0XJgwlcvOC7elJ5Y0hYuKBZoVqWpAMfLOeIh2UI/DCQ5ruodIjvsugZtjUYUw2pUw==", - "dependencies": { - "ms": "0.7.1" - } - }, - "node_modules/send/node_modules/depd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.0.1.tgz", - "integrity": "sha512-OEWAMbCkK9IWQ8pfTvHBhCSqHgR+sk5pbiYqq0FqfARG4Cy+cRsCbITx6wh5pcsmfBPiJAcbd98tfdz5fnBbag==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/send/node_modules/destroy": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.3.tgz", - "integrity": "sha512-KB/AVLKRwZPOEo6/lxkDJ+Bv3jFRRrhmnRMPvpWwmIfUggpzGkQBqolyo8FRf833b/F5rzmy1uVN3fHBkjTxgw==" - }, - "node_modules/send/node_modules/http-errors": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.3.1.tgz", - "integrity": "sha512-gMygNskMurDCWfoCdyh1gOeDfSbkAHXqz94QoPj5IHIUjC/BG8/xv7FSEUr7waR5RcAya4j58bft9Wu/wHNeXA==", - "dependencies": { - "inherits": "~2.0.1", - "statuses": "1" - }, - "engines": { - "node": ">= 0.6" - } - }, "node_modules/send/node_modules/ms": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", - "integrity": "sha512-lRLiIR9fSNpnP6TC4v8+4OU7oStC01esuNowdQ34L+Gk8e5Puoc88IqJ+XAY/B3Mn2ZKis8l8HX90oU8ivzUHg==" - }, - "node_modules/send/node_modules/on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==", - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/send/node_modules/statuses": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.2.1.tgz", - "integrity": "sha512-pVEuxHdSGrt8QmQ3LOZXLhSA6MP/iPqKzZeO6Squ7PNGkA/9MBsSfV0/L+bIxkoDmjF4tZcLpcVq/fkqoHvuKg==" - }, - "node_modules/seq-queue": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/seq-queue/-/seq-queue-0.0.5.tgz", - "integrity": "sha512-hr3Wtp/GZIc/6DAGPDcV4/9WoZhjrkXsi5B/07QgX8tsdc6ilr7BFM6PM6rbdAX1kFSDYeZGLipIZZKyQP0O5Q==" + "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.10.3", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.10.3.tgz", - "integrity": "sha512-ScsFovjz3Db+vGgpofR/U8p8UULEcGV9akqyo8TQ1mMnjcxemE7Y5Muo+dvy3tJLY/doY2v1H61eCBMYGmwfrA==", + "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.1", - "send": "0.13.2" + "parseurl": "~1.3.3", + "send": "0.18.0" }, "engines": { "node": ">= 0.8.0" } }, - "node_modules/serve-static/node_modules/debug": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", - "integrity": "sha512-X0rGvJcskG1c3TgSCPqHJ0XJgwlcvOC7elJ5Y0hYuKBZoVqWpAMfLOeIh2UI/DCQ5ruodIjvsugZtjUYUw2pUw==", - "dependencies": { - "ms": "0.7.1" - } - }, - "node_modules/serve-static/node_modules/depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/serve-static/node_modules/destroy": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", - "integrity": "sha512-3NdhDuEXnfun/z7x9GOElY49LoqVHoGScmOKwmxhsS8N5Y+Z8KyPPDnaSzqWgYt/ji4mqwfTS34Htrk0zPIXVg==" - }, - "node_modules/serve-static/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/serve-static/node_modules/http-errors": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.3.1.tgz", - "integrity": "sha512-gMygNskMurDCWfoCdyh1gOeDfSbkAHXqz94QoPj5IHIUjC/BG8/xv7FSEUr7waR5RcAya4j58bft9Wu/wHNeXA==", - "dependencies": { - "inherits": "~2.0.1", - "statuses": "1" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/serve-static/node_modules/ms": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", - "integrity": "sha512-lRLiIR9fSNpnP6TC4v8+4OU7oStC01esuNowdQ34L+Gk8e5Puoc88IqJ+XAY/B3Mn2ZKis8l8HX90oU8ivzUHg==" - }, - "node_modules/serve-static/node_modules/on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==", - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/serve-static/node_modules/send": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/send/-/send-0.13.2.tgz", - "integrity": "sha512-cQ0rmXHrdO2Iof08igV2bG/yXWD106ANwBg6DkGQNT2Vsznbgq6T0oAIQboy1GoFsIuy51jCim26aA9tj3Z3Zg==", - "dependencies": { - "debug": "~2.2.0", - "depd": "~1.1.0", - "destroy": "~1.0.4", - "escape-html": "~1.0.3", - "etag": "~1.7.0", - "fresh": "0.3.0", - "http-errors": "~1.3.1", - "mime": "1.3.4", - "ms": "0.7.1", - "on-finished": "~2.3.0", - "range-parser": "~1.0.3", - "statuses": "~1.2.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/serve-static/node_modules/statuses": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.2.1.tgz", - "integrity": "sha512-pVEuxHdSGrt8QmQ3LOZXLhSA6MP/iPqKzZeO6Squ7PNGkA/9MBsSfV0/L+bIxkoDmjF4tZcLpcVq/fkqoHvuKg==" - }, "node_modules/set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", @@ -1769,9 +1524,9 @@ } }, "node_modules/sqlstring": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.3.tgz", - "integrity": "sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.1.tgz", + "integrity": "sha512-ooAzh/7dxIG5+uDik1z/Rd1vli0+38izZhGzSa34FwR7IbelPWCCKSNIl8jlL/F7ERvy8CB2jNeM1E9i9mXMAQ==", "engines": { "node": ">= 0.6" } @@ -1926,9 +1681,9 @@ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" }, "node_modules/utils-merge": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.0.tgz", - "integrity": "sha512-HwU9SLQEtyo+0uoKXd1nkLqigUWLB+QuNQR4OcmB73eWqksM5ovuqcycks2x043W8XVb75rG1HQ0h93TMXkzQQ==", + "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" } @@ -1946,9 +1701,9 @@ } }, "node_modules/vary": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.0.1.tgz", - "integrity": "sha512-yNsH+tC0r8quK2tg/yqkXqqaYzeKTkSqQ+8T6xCoWgOi/bU/omMYz+6k+I91JJJDeltJzI7oridTOq6OYkY0Tw==", + "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" } @@ -2000,12 +1755,6 @@ } }, "dependencies": { - "@eonasdan/tempus-dominus": { - "version": "6.7.19", - "resolved": "https://registry.npmjs.org/@eonasdan/tempus-dominus/-/tempus-dominus-6.7.19.tgz", - "integrity": "sha512-rUHm1lTZLWdYUBAJJvic1p4Df/0h0rqV523r+DZtCkfty2ejf9NDsTYw3Vi0acSCt2kqwXom9R8jslzxxVcfOw==", - "requires": {} - }, "@mapbox/node-pre-gyp": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz", @@ -2035,7 +1784,8 @@ "@popperjs/core": { "version": "2.11.8", "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", - "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==" + "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", + "peer": true }, "abbrev": { "version": "1.1.1", @@ -2043,12 +1793,12 @@ "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" }, "accepts": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.2.13.tgz", - "integrity": "sha512-R190A3EzrS4huFOVZajhXCYZt5p5yrkaQOB4nsWzfth0cYaDcSN5J86l58FJ1dt7igp37fB/QhnuFkGAJmr+eg==", + "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==", "requires": { - "mime-types": "~2.1.6", - "negotiator": "0.5.3" + "mime-types": "~2.1.34", + "negotiator": "0.6.3" } }, "agent-base": { @@ -2115,9 +1865,9 @@ } }, "array-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.0.tgz", - "integrity": "sha512-B9Cdx2PIqexNnAWplLzRP89pa0vcEMkHGKr6/CY0ZzuI1Z5o6E392/7OtSFyrzEIXZ/pDdoGRoDaWJHg9mJMaA==" + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" }, "balanced-match": { "version": "1.0.2", @@ -2133,18 +1883,23 @@ "node-addon-api": "^5.0.0" } }, + "bignumber.js": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.0.tgz", + "integrity": "sha512-t/OYhhJ2SD+YGBQcjY8GzzDHEk9f3nerxjtfa6tlMXfe7frs/WozhvCNoGvpM0P3bNf3Gq5ZRMlGr5f3r4/N8A==" + }, "binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==" }, "body-parser": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", - "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", + "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", "requires": { "bytes": "3.1.2", - "content-type": "~1.0.5", + "content-type": "~1.0.4", "debug": "2.6.9", "depd": "2.0.0", "destroy": "1.2.0", @@ -2152,7 +1907,7 @@ "iconv-lite": "0.4.24", "on-finished": "2.4.1", "qs": "6.11.0", - "raw-body": "2.5.2", + "raw-body": "2.5.1", "type-is": "~1.6.18", "unpipe": "1.0.0" } @@ -2231,9 +1986,12 @@ "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==" }, "content-disposition": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.0.tgz", - "integrity": "sha512-PWzG8GssMHTPSLBoOeK5MvPPJeWU5ZVX8omvJC16BUH/nUX6J/jM/hgm/mrPWzTXVV3B3OoBhFdHXyGLU4TgUw==" + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "requires": { + "safe-buffer": "5.2.1" + } }, "content-type": { "version": "1.0.5", @@ -2241,9 +1999,9 @@ "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==" }, "cookie": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.1.3.tgz", - "integrity": "sha512-mWkFhcL+HVG1KjeCjEBVJJ7s4sAGMLiBDFSDs4bzzvgLZt7rW8BhP6XV/8b1+pNvx/skd3yYxPuaF3Z6LlQzyw==" + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", + "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==" }, "cookie-parser": { "version": "1.4.6", @@ -2266,6 +2024,11 @@ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" }, + "core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" + }, "dateformat": { "version": "4.6.3", "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-4.6.3.tgz", @@ -2294,11 +2057,6 @@ "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==" }, - "denque": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", - "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==" - }, "depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", @@ -2329,86 +2087,57 @@ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, - "escape-html": { + "encodeurl": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.2.tgz", - "integrity": "sha512-J5ahyCRC4liskWVAfkmosNWfG0eHQxI0W+Ko7k3cZaYVMfgt05dwZ68vw6S/TZM1BPvuTv3kq6CRCb7WWtBUVA==" + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==" + }, + "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==" }, "etag": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.7.0.tgz", - "integrity": "sha512-Mbv5pNpLNPrm1b4rzZlZlfTRpdDr31oiD43N362sIyvSWVNu5Du33EcJGzvEV4YdYLuENB1HzND907cQkFmXNw==" + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==" }, "express": { - "version": "5.0.0-alpha.2", - "resolved": "https://registry.npmjs.org/express/-/express-5.0.0-alpha.2.tgz", - "integrity": "sha512-dCv747cpHLEUBzHm5MR8y6eq43izDxmfWtpq1oaTY3vlW3nlLugPob1rzg7/mul/a7o/Svg6SNx/oc/3fz61mA==", + "version": "4.18.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", + "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", "requires": { - "accepts": "~1.2.10", - "array-flatten": "1.1.0", - "content-disposition": "0.5.0", - "content-type": "~1.0.1", - "cookie": "0.1.3", + "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.2.0", - "depd": "~1.0.1", - "escape-html": "1.0.2", - "etag": "~1.7.0", - "finalhandler": "0.4.0", - "fresh": "0.3.0", - "merge-descriptors": "1.0.0", - "methods": "~1.1.1", - "on-finished": "~2.3.0", - "parseurl": "~1.3.0", - "path-is-absolute": "1.0.0", - "path-to-regexp": "0.1.6", - "proxy-addr": "~1.0.8", - "qs": "4.0.0", - "range-parser": "~1.0.2", - "router": "~1.1.2", - "send": "0.13.0", - "serve-static": "~1.10.0", - "type-is": "~1.6.4", - "utils-merge": "1.0.0", - "vary": "~1.0.0" - }, - "dependencies": { - "debug": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", - "integrity": "sha512-X0rGvJcskG1c3TgSCPqHJ0XJgwlcvOC7elJ5Y0hYuKBZoVqWpAMfLOeIh2UI/DCQ5ruodIjvsugZtjUYUw2pUw==", - "requires": { - "ms": "0.7.1" - } - }, - "depd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.0.1.tgz", - "integrity": "sha512-OEWAMbCkK9IWQ8pfTvHBhCSqHgR+sk5pbiYqq0FqfARG4Cy+cRsCbITx6wh5pcsmfBPiJAcbd98tfdz5fnBbag==" - }, - "ms": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", - "integrity": "sha512-lRLiIR9fSNpnP6TC4v8+4OU7oStC01esuNowdQ34L+Gk8e5Puoc88IqJ+XAY/B3Mn2ZKis8l8HX90oU8ivzUHg==" - }, - "on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==", - "requires": { - "ee-first": "1.1.1" - } - }, - "path-is-absolute": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz", - "integrity": "sha512-hUUTsB/vByumPhn43R+Azhsx4TQPvyQqW+XyCR6UA8ae+FGIjf5Oygj6o/FYK4ZdwnrXth2eIBKk4YlrUU0ElQ==" - }, - "qs": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-4.0.0.tgz", - "integrity": "sha512-8MPmJ83uBOPsQj5tQCv4g04/nTiY+d17yl9o3Bw73vC6XlEm2POIRRlOgWJ8i74bkGLII670cDJJZkgiZ2sIkg==" - } + "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" } }, "fill-range": { @@ -2420,37 +2149,17 @@ } }, "finalhandler": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-0.4.0.tgz", - "integrity": "sha512-jJU2WE88OqUvwAIf/1K2G2fTdKKZ8LvSwYQyFFekDcmBnBmht38enbcmErnA7iNZktcEo/o2JAHYbe1QDOAgaA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", "requires": { - "debug": "~2.2.0", - "escape-html": "1.0.2", - "on-finished": "~2.3.0", + "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" - }, - "dependencies": { - "debug": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", - "integrity": "sha512-X0rGvJcskG1c3TgSCPqHJ0XJgwlcvOC7elJ5Y0hYuKBZoVqWpAMfLOeIh2UI/DCQ5ruodIjvsugZtjUYUw2pUw==", - "requires": { - "ms": "0.7.1" - } - }, - "ms": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", - "integrity": "sha512-lRLiIR9fSNpnP6TC4v8+4OU7oStC01esuNowdQ34L+Gk8e5Puoc88IqJ+XAY/B3Mn2ZKis8l8HX90oU8ivzUHg==" - }, - "on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==", - "requires": { - "ee-first": "1.1.1" - } - } } }, "foreachasync": { @@ -2459,14 +2168,14 @@ "integrity": "sha512-J+ler7Ta54FwwNcx6wQRDhTIbNeyDcARMkOcguEqnEdtm0jKvN3Li3PDAb2Du3ubJYEWfYL83XMROXdsXAXycw==" }, "forwarded": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", - "integrity": "sha512-Ua9xNhH0b8pwE3yRbFfXJvfdWF0UHNCdeyb2sbi9Ul/M+r3PTdrz7Cv4SCfZRMjmzEM9PhraqfZFbGTIg3OMyA==" + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==" }, "fresh": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.3.0.tgz", - "integrity": "sha512-akx5WBKAwMSg36qoHTuMMVncHWctlaDGslJASDYAhoLrzDUDCjZlOngNa/iC6lPm9aA0qk8pN5KnpmbJHSIIQQ==" + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==" }, "fs-minipass": { "version": "2.1.0", @@ -2518,14 +2227,6 @@ "wide-align": "^1.1.2" } }, - "generate-function": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", - "integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==", - "requires": { - "is-property": "^1.0.2" - } - }, "get-intrinsic": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.2.tgz", @@ -2687,9 +2388,9 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "ipaddr.js": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.0.5.tgz", - "integrity": "sha512-wBj+q+3uP78gMowwWgFLAYm/q4x5goyZmDsmuvyz+nd1u0D/ghgXXtc1OkgmTzSiWT101kiqGacwFk9eGQw6xQ==" + "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==" }, "is-binary-path": { "version": "2.1.0", @@ -2722,15 +2423,10 @@ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" }, - "is-property": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", - "integrity": "sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==" - }, - "long": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", - "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" }, "lru-cache": { "version": "6.0.0", @@ -2761,9 +2457,9 @@ "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==" }, "merge-descriptors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.0.tgz", - "integrity": "sha512-YJiZmTZTkrqvgefMsWdioTKsZdHnfAhHHkEdPg+4PCqMJEGHQo5iJQjEbMv3XyBZ6y3Z2Rj1mqq1WNKq9e0yNw==" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" }, "methods": { "version": "1.1.2", @@ -2771,9 +2467,9 @@ "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==" }, "mime": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz", - "integrity": "sha512-sAaYXszED5ALBt665F0wMQCUXpGuZsGdopoqcHPdL39ZYdi7uHoZlhrfZfhv8WzivhBzr/oXwaj+yiK5wY8MXQ==" + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" }, "mime-db": { "version": "1.52.0", @@ -2835,55 +2531,28 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" }, - "mysql2": { - "version": "3.6.5", - "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.6.5.tgz", - "integrity": "sha512-pS/KqIb0xlXmtmqEuTvBXTmLoQ5LmAz5NW/r8UyQ1ldvnprNEj3P9GbmuQQ2J0A4LO+ynotGi6TbscPa8OUb+w==", + "mysql": { + "version": "2.18.1", + "resolved": "https://registry.npmjs.org/mysql/-/mysql-2.18.1.tgz", + "integrity": "sha512-Bca+gk2YWmqp2Uf6k5NFEurwY/0td0cpebAucFpY/3jhrwrVGuxU2uQFCHjU19SJfje0yQvi+rVWdq78hR5lig==", "requires": { - "denque": "^2.1.0", - "generate-function": "^2.3.1", - "iconv-lite": "^0.6.3", - "long": "^5.2.1", - "lru-cache": "^8.0.0", - "named-placeholders": "^1.1.3", - "seq-queue": "^0.0.5", - "sqlstring": "^2.3.2" + "bignumber.js": "9.0.0", + "readable-stream": "2.3.7", + "safe-buffer": "5.1.2", + "sqlstring": "2.3.1" }, "dependencies": { - "iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "requires": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - } - }, - "lru-cache": { - "version": "8.0.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-8.0.5.tgz", - "integrity": "sha512-MhWWlVnuab1RG5/zMRRcVGXZLCXrZTgfwMikgzCegsPnG62yDQo5JnqKkrK4jO5iKqDAZGItAqN5CtKBCBWRUA==" - } - } - }, - "named-placeholders": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.3.tgz", - "integrity": "sha512-eLoBxg6wE/rZkJPhU/xRX1WTpkFEwDJEN96oxFrTsqBdbT5ec295Q+CoHrL9IT0DipqKhmGcaZmwOt8OON5x1w==", - "requires": { - "lru-cache": "^7.14.1" - }, - "dependencies": { - "lru-cache": { - "version": "7.18.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", - "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==" + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" } } }, "negotiator": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.5.3.tgz", - "integrity": "sha512-oXmnazqehLNFohqgLxRyUdOQU9/UX0NpCpsnbjWUjM62ZM8oSOXYZpHc68XR130ftPNano0oQXGdREAplZRhaQ==" + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" }, "neo-async": { "version": "2.6.2", @@ -2996,22 +2665,27 @@ "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==" }, "path-to-regexp": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.6.tgz", - "integrity": "sha512-Ut++lkiF1BogIUY+3SADhfDDdvzb8EOU/D8JutrlrfEuh+DGQbo5c78P96dSuapLEfeH7rpWhiBfJCDAGvSJVQ==" + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" }, "picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, "proxy-addr": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-1.0.10.tgz", - "integrity": "sha512-iq6kR9KN32aFvXjDyC8nIrm203AHeIBPjL6dpaHgSdbpTO8KoPlD0xG92xwwtkCL9+yt1LE5VwpEk43TyP38Dg==", + "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==", "requires": { - "forwarded": "~0.1.0", - "ipaddr.js": "1.0.5" + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" } }, "pstree.remy": { @@ -3028,14 +2702,14 @@ } }, "range-parser": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.0.3.tgz", - "integrity": "sha512-nDsRrtIxVUO5opg/A8T2S3ebULVIfuh8ECbh4w3N4mWxIiT3QILDJDUQayPqm2e8Q8NUa0RSUkGCfe33AfjR3Q==" + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" }, "raw-body": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", - "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", + "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", "requires": { "bytes": "3.1.2", "http-errors": "2.0.0", @@ -3043,6 +2717,27 @@ "unpipe": "1.0.0" } }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, "readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -3059,49 +2754,10 @@ "glob": "^7.1.3" } }, - "router": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/router/-/router-1.1.5.tgz", - "integrity": "sha512-p0l/vfNVavaB7DXh3BxJv3NMZi3QKEiIYDnLVyOV5Bo/7Uo3YYk3z65T2IJHG7cfC9QV8UanGhHLOIfPoS9A5g==", - "requires": { - "array-flatten": "2.1.1", - "debug": "~2.2.0", - "methods": "~1.1.2", - "parseurl": "~1.3.1", - "path-to-regexp": "0.1.7", - "setprototypeof": "1.0.2", - "utils-merge": "1.0.0" - }, - "dependencies": { - "array-flatten": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-2.1.1.tgz", - "integrity": "sha512-Ylfqm/V1V/VKGazsJeRDZ31wV9gdNeK3ZsvwbYBAVSNgH8o8CMLfdx/ofn9pnMVsvTMfvC3yfcBYzGpD1vxnlw==" - }, - "debug": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", - "integrity": "sha512-X0rGvJcskG1c3TgSCPqHJ0XJgwlcvOC7elJ5Y0hYuKBZoVqWpAMfLOeIh2UI/DCQ5ruodIjvsugZtjUYUw2pUw==", - "requires": { - "ms": "0.7.1" - } - }, - "ms": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", - "integrity": "sha512-lRLiIR9fSNpnP6TC4v8+4OU7oStC01esuNowdQ34L+Gk8e5Puoc88IqJ+XAY/B3Mn2ZKis8l8HX90oU8ivzUHg==" - }, - "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==" - }, - "setprototypeof": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.2.tgz", - "integrity": "sha512-mNRSo7UFE4c4tjxlZ3KxO5r+3oQUD1M/KXbp/XTwTwybL4VR9T8Ltmv5DvZX8iRz6C3hQmQftXEV0EmTKRV6mg==" - } - } + "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==" }, "safer-buffer": { "version": "2.1.2", @@ -3117,155 +2773,41 @@ } }, "send": { - "version": "0.13.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.13.0.tgz", - "integrity": "sha512-zck2y84i0SbUUiwq2l5gGPNVpCplL48og5xIhFjNjQa09003YCTy6Vb3rKfVuG8W8PWNUtUOntjQEBdwkJ9oBw==", + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", "requires": { - "debug": "~2.2.0", - "depd": "~1.0.1", - "destroy": "1.0.3", - "escape-html": "1.0.2", - "etag": "~1.7.0", - "fresh": "0.3.0", - "http-errors": "~1.3.1", - "mime": "1.3.4", - "ms": "0.7.1", - "on-finished": "~2.3.0", - "range-parser": "~1.0.2", - "statuses": "~1.2.1" + "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" }, "dependencies": { - "debug": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", - "integrity": "sha512-X0rGvJcskG1c3TgSCPqHJ0XJgwlcvOC7elJ5Y0hYuKBZoVqWpAMfLOeIh2UI/DCQ5ruodIjvsugZtjUYUw2pUw==", - "requires": { - "ms": "0.7.1" - } - }, - "depd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.0.1.tgz", - "integrity": "sha512-OEWAMbCkK9IWQ8pfTvHBhCSqHgR+sk5pbiYqq0FqfARG4Cy+cRsCbITx6wh5pcsmfBPiJAcbd98tfdz5fnBbag==" - }, - "destroy": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.3.tgz", - "integrity": "sha512-KB/AVLKRwZPOEo6/lxkDJ+Bv3jFRRrhmnRMPvpWwmIfUggpzGkQBqolyo8FRf833b/F5rzmy1uVN3fHBkjTxgw==" - }, - "http-errors": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.3.1.tgz", - "integrity": "sha512-gMygNskMurDCWfoCdyh1gOeDfSbkAHXqz94QoPj5IHIUjC/BG8/xv7FSEUr7waR5RcAya4j58bft9Wu/wHNeXA==", - "requires": { - "inherits": "~2.0.1", - "statuses": "1" - } - }, "ms": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", - "integrity": "sha512-lRLiIR9fSNpnP6TC4v8+4OU7oStC01esuNowdQ34L+Gk8e5Puoc88IqJ+XAY/B3Mn2ZKis8l8HX90oU8ivzUHg==" - }, - "on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==", - "requires": { - "ee-first": "1.1.1" - } - }, - "statuses": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.2.1.tgz", - "integrity": "sha512-pVEuxHdSGrt8QmQ3LOZXLhSA6MP/iPqKzZeO6Squ7PNGkA/9MBsSfV0/L+bIxkoDmjF4tZcLpcVq/fkqoHvuKg==" + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" } } }, - "seq-queue": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/seq-queue/-/seq-queue-0.0.5.tgz", - "integrity": "sha512-hr3Wtp/GZIc/6DAGPDcV4/9WoZhjrkXsi5B/07QgX8tsdc6ilr7BFM6PM6rbdAX1kFSDYeZGLipIZZKyQP0O5Q==" - }, "serve-static": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.10.3.tgz", - "integrity": "sha512-ScsFovjz3Db+vGgpofR/U8p8UULEcGV9akqyo8TQ1mMnjcxemE7Y5Muo+dvy3tJLY/doY2v1H61eCBMYGmwfrA==", + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", "requires": { + "encodeurl": "~1.0.2", "escape-html": "~1.0.3", - "parseurl": "~1.3.1", - "send": "0.13.2" - }, - "dependencies": { - "debug": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", - "integrity": "sha512-X0rGvJcskG1c3TgSCPqHJ0XJgwlcvOC7elJ5Y0hYuKBZoVqWpAMfLOeIh2UI/DCQ5ruodIjvsugZtjUYUw2pUw==", - "requires": { - "ms": "0.7.1" - } - }, - "depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==" - }, - "destroy": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", - "integrity": "sha512-3NdhDuEXnfun/z7x9GOElY49LoqVHoGScmOKwmxhsS8N5Y+Z8KyPPDnaSzqWgYt/ji4mqwfTS34Htrk0zPIXVg==" - }, - "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==" - }, - "http-errors": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.3.1.tgz", - "integrity": "sha512-gMygNskMurDCWfoCdyh1gOeDfSbkAHXqz94QoPj5IHIUjC/BG8/xv7FSEUr7waR5RcAya4j58bft9Wu/wHNeXA==", - "requires": { - "inherits": "~2.0.1", - "statuses": "1" - } - }, - "ms": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", - "integrity": "sha512-lRLiIR9fSNpnP6TC4v8+4OU7oStC01esuNowdQ34L+Gk8e5Puoc88IqJ+XAY/B3Mn2ZKis8l8HX90oU8ivzUHg==" - }, - "on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==", - "requires": { - "ee-first": "1.1.1" - } - }, - "send": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/send/-/send-0.13.2.tgz", - "integrity": "sha512-cQ0rmXHrdO2Iof08igV2bG/yXWD106ANwBg6DkGQNT2Vsznbgq6T0oAIQboy1GoFsIuy51jCim26aA9tj3Z3Zg==", - "requires": { - "debug": "~2.2.0", - "depd": "~1.1.0", - "destroy": "~1.0.4", - "escape-html": "~1.0.3", - "etag": "~1.7.0", - "fresh": "0.3.0", - "http-errors": "~1.3.1", - "mime": "1.3.4", - "ms": "0.7.1", - "on-finished": "~2.3.0", - "range-parser": "~1.0.3", - "statuses": "~1.2.1" - } - }, - "statuses": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.2.1.tgz", - "integrity": "sha512-pVEuxHdSGrt8QmQ3LOZXLhSA6MP/iPqKzZeO6Squ7PNGkA/9MBsSfV0/L+bIxkoDmjF4tZcLpcVq/fkqoHvuKg==" - } + "parseurl": "~1.3.3", + "send": "0.18.0" } }, "set-blocking": { @@ -3318,9 +2860,9 @@ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" }, "sqlstring": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.3.tgz", - "integrity": "sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==" + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.1.tgz", + "integrity": "sha512-ooAzh/7dxIG5+uDik1z/Rd1vli0+38izZhGzSa34FwR7IbelPWCCKSNIl8jlL/F7ERvy8CB2jNeM1E9i9mXMAQ==" }, "statuses": { "version": "2.0.1", @@ -3438,9 +2980,9 @@ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" }, "utils-merge": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.0.tgz", - "integrity": "sha512-HwU9SLQEtyo+0uoKXd1nkLqigUWLB+QuNQR4OcmB73eWqksM5ovuqcycks2x043W8XVb75rG1HQ0h93TMXkzQQ==" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==" }, "uuid": { "version": "9.0.1", @@ -3448,9 +2990,9 @@ "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==" }, "vary": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.0.1.tgz", - "integrity": "sha512-yNsH+tC0r8quK2tg/yqkXqqaYzeKTkSqQ+8T6xCoWgOi/bU/omMYz+6k+I91JJJDeltJzI7oridTOq6OYkY0Tw==" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==" }, "walk": { "version": "2.3.15", diff --git a/package.json b/package.json index 7448dd9..1aab573 100644 --- a/package.json +++ b/package.json @@ -10,17 +10,15 @@ "author": "Laurent LE CORRE", "license": "ISC", "dependencies": { - "@eonasdan/tempus-dominus": "^6.7.19", - "@popperjs/core": "^2.11.8", "bcrypt": "^5.1.1", - "body-parser": "^1.20.2", + "body-parser": "^1.20.1", "bootstrap": "^5.2.1", "cookie-parser": "^1.4.6", "dateformat": "^4.6.3", "dotenv": "^16.3.1", - "express": "^5.0.0-alpha.2", + "express": "^4.18.2", "hbs": "^4.2.0", - "mysql2": "^3.6.5", + "mysql": "^2.18.1", "nodemon": "^3.0.1", "uuid": "^9.0.1" } diff --git a/public/session.js b/public/scripts-session.js similarity index 94% rename from public/session.js rename to public/scripts-session.js index 54387a0..f057495 100644 --- a/public/session.js +++ b/public/scripts-session.js @@ -1,7 +1,8 @@ + // DatePicker sur l'écran de création d'une session window.datetimepicker1 = $('#datetimepicker1'); - datetimepicker1.tempusDominus({ + //put your config here allowInputToggle: true, stepping: 15, localization: { @@ -14,4 +15,4 @@ datetimepicker1.tempusDominus({ // Ecran de création d'une session --> interdire la saisie directe d'une date document.getElementById("datetimepicker1").addEventListener('change', function(){ alert("Veuillez cliquer sur le calendrier pour modifier la date et/ou l'heure"); -}) +}); \ No newline at end of file diff --git a/views/create-session.hbs b/views/create-session.hbs index 94ede24..5457e23 100644 --- a/views/create-session.hbs +++ b/views/create-session.hbs @@ -10,14 +10,10 @@ - - - - - - {{!-- --}} - {{!-- --}} - {{!-- --}} + + + +